REGRESSION(r119948): [Forms] Spin button Up/Down actions make value to zero for input type "number" when step mismatched
https://bugs.webkit.org/show_bug.cgi?id=91197

Reviewed by Kent Tamura.

Source/WebCore:

This patch fixes implementation of Decimal::ceiling() and floor().
They return wrong value for small fractional numbers.

The bug is occurred when:
  - Step-able input type, e.g. number, date, datetime, and so on.
  - Current value is step mismatched
  - Current value is smaller than step
  - Step up/down by spin button
because spin button up/down actions are implemented in InputType::setpUpFromRenderer
which calls Decimal::ceiling() and floor() for step mismatched case.

Tests: fast/forms/number/number-stepup-stepdown-from-renderer.html: Added test cases
       WebKit/chromium/tests/DecimalTest.cpp: Added test cases

* platform/Decimal.cpp:
(WebCore::Decimal::ceiling): Changed to return 1 for positive small fractional number.
(WebCore::Decimal::floor): Changed to return -1 for negative small fractional number.

Source/WebKit/chromium:

This patch adds test cases for Decimal::ceiling() and floor() of
positive/negative small fractional numbers.

* tests/DecimalTest.cpp:
(TEST_F):

LayoutTests:

This patch adds new test cases.

* fast/forms/number/number-stepup-stepdown-from-renderer-expected.txt: Updated for new test cases.
* fast/forms/number/number-stepup-stepdown-from-renderer.html: Added new test cases.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122552 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CodeGeneratorJS.pm : SetterExpression should use 'push' rather than 'unshift'
https://bugs.webkit.org/show_bug.cgi?id=91198

Patch by Dongwoo Im <dw.im@samsung.com> on 2012-07-13
Reviewed by Kentaro Hara.

'SetterExpression' should use 'push' to make arguments, rather than 'unshift'.

No new tests. Covered by existing tests.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122553 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt][WK2] Implement GraphicsSurface for Linux/GLX.
https://bugs.webkit.org/show_bug.cgi?id=90881

Source/WebCore:

Add a GLX based GraphicsSurface implementation for Linux.
Native X windows are being used for exchanging textures
with the UIProcess.

Reviewed by Noam Rosenthal.

* Target.pri:
* WebCore.pri:
* platform/graphics/surfaces/GraphicsSurface.cpp:
(WebCore::GraphicsSurface::create):
    Move creating GraphicsSurface instance into
    platformCreate/platformImport functions to allow
    platform specific creation based on the provided flags.
(WebCore::GraphicsSurface::GraphicsSurface):
(WebCore::GraphicsSurface::~GraphicsSurface):
    Call platformDestroy when destroying a GraphicsSurface.
(WebCore):
* platform/graphics/surfaces/GraphicsSurface.h:
    Make platformCreate/platformImport functions static
    to be able to call these from the static create function.
    Add Destructor prototype and add GraphicsSurfacePrivate member.
(WebCore):
(GraphicsSurface):
* platform/graphics/surfaces/mac/GraphicsSurfaceMac.cpp:
(WebCore):
(WebCore::GraphicsSurface::platformCreate):
(WebCore::GraphicsSurface::platformImport):
    Insert creation of GraphicsSurface instance.
    This allows having a platform specific creation mechanism
    for GLX.
* platform/graphics/surfaces/qt/GraphicsSurfaceGLX.cpp: Added.
(WebCore):
(OffScreenRootWindow):
(WebCore::OffScreenRootWindow::OffScreenRootWindow):
(WebCore::OffScreenRootWindow::get):
(WebCore::OffScreenRootWindow::~OffScreenRootWindow):
    Add an OffScreenRootWindow singelton that is being used
    as a parent for all native offscreen windows.
(GraphicsSurfacePrivate):
    This class is used to manage all the X related resources
    such as opening a display or creating XPixmaps etc.
(WebCore::GraphicsSurfacePrivate::GraphicsSurfacePrivate):
    Open a connection to the X server and create a
    QOpenGLContext that can be used to resolve GL functions.
(WebCore::GraphicsSurfacePrivate::~GraphicsSurfacePrivate):
    Properly cleanup and release all the X resources again.
(WebCore::GraphicsSurfacePrivate::createSurface):
    Create a surface that is placed off screen and can be
    used as a rendering target by the WebProcess.
(WebCore::GraphicsSurfacePrivate::createPixmap):
    Create a GLXPixmap from the XWindow that was previously
    redirected by the WebProcess. This GLXPixmap can then be
    bound to a texture and being painted on screen by the
    UIProcess.
(WebCore::GraphicsSurfacePrivate::makeCurrent):
(WebCore::GraphicsSurfacePrivate::swapBuffers):
(WebCore::GraphicsSurfacePrivate::display):
(WebCore::GraphicsSurfacePrivate::glxPixmap):
(WebCore::GraphicsSurfacePrivate::size):
(WebCore::GraphicsSurfacePrivate::glContext):
(WebCore::resolveGLMethods):
    Initialize all the function pointers for the GL functions used.
(WebCore::GraphicsSurface::platformExport):
(WebCore::GraphicsSurface::platformGetTextureID):
    Bind the GLXPixmap to a texture.
(WebCore::GraphicsSurface::platformCopyToGLTexture):
    Not beeing implemented for GLX.
(WebCore::GraphicsSurface::platformCopyFromFramebuffer):
    Blit origin fbo onto the GraphicsSurface's backing.
(WebCore::GraphicsSurface::platformCreate):
(WebCore::GraphicsSurface::platformImport):
(WebCore::GraphicsSurface::platformLock):
(WebCore::GraphicsSurface::platformUnlock):
(WebCore::GraphicsSurface::platformDestroy):

Source/WebKit2:

Add a GLX based GraphicsSurface implementation for Linux.

Reviewed by Noam Rosenthal.

* Shared/ShareableSurface.cpp:
(WebKit::ShareableSurface::create):
    Only create a GraphicsSurface from a ShareableSurface::Handle
    in case the Handle contains a valid GraphicsSurface token.
    Otherwise fall back to creating a ShareableBitmap.
* UIProcess/LayerTreeCoordinatorProxy.cpp:
(WebKit::createLayerTileUniqueKey):
    Create a unique key for a surface based on tileID and layerID.
(WebKit::LayerTreeCoordinatorProxy::updateTileForLayer):
    Even when GraphicsSurface is enabled, not all ShareableSurfaces
    will necessarily be backed by a GraphicsSurface. In case of
    a ShareableSurface being backed by a ShareableBitmap instead,
    the GraphicsSurface token will always be null.
    So instead of using the GraphicsSurface token as a key for
    storing surfaces in a map, we create a unique key from
    layerID and tileID.
* UIProcess/LayerTreeCoordinatorProxy.h:
(LayerTreeCoordinatorProxy):

Tools:

Enable GraphicsSurface for Linux based platforms
whenever the Xcomposite extension is available.

Reviewed by Noam Rosenthal.

* qmake/config.tests/libXcomposite/libXcomposite.cpp: Added.
(main):
* qmake/config.tests/libXcomposite/libXcomposite.pro: Added.
  Add a configure test to detect Xcomposite extension and
  activate GraphicsSurface on linux in case the extension is available.
* qmake/configure.pri:
* qmake/mkspecs/features/features.prf:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122554 268f45cc-cd09-0410-ab3c-d52691b4dbfc