[BlackBerry] Improve about:memory page
https://bugs.webkit.org/show_bug.cgi?id=87676

Patch by Yong Li <yoli@rim.com> on 2012-07-16
Reviewed by Rob Buis.

Add a table for process memory usage summary for easy read.

* WebCoreSupport/AboutData.cpp:
(WebCore::memoryPage):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122745 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Only apply page scale delta to root scroll layer
https://bugs.webkit.org/show_bug.cgi?id=91374

Patch by Sami Kyostila <skyostil@chromium.org> on 2012-07-16
Reviewed by Adrienne Walker.

Source/WebCore:

When the user pinch-zooms the web page though the Chromium compositor, the
per-layer page scale delta is used to keep track of the difference between the
page scale on the compositor thread versus the main thread. On the next
commit to the main thread these values are reset to 1.

When calculating layer positions, the compositor applies a layer's page scale
delta both to the layer itself as well as all of its children. Since we are
currently updating the page scale delta on all scrollable layers, this results
in scrollable child layers getting scaled multiple times.

This patch changes the compositor to only apply the page scale delta on the
root scroll layer.

New unit test: CCLayerTreeHostImplTest.pageScaleDeltaAppliedToRootScrollLayerOnly

* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::setPageScaleFactorAndLimits):
(WebCore::CCLayerTreeHostImpl::setPageScaleDelta):

Source/WebKit/chromium:

New unit test
CCLayerTreeHostImplTest.pageScaleDeltaAppliedToRootScrollLayerOnly to verify
the transformation of child layer while pinch zooming.

* tests/CCLayerTreeHostImplTest.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122746 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Position grid items by row/column index
https://bugs.webkit.org/show_bug.cgi?id=91293

Reviewed by Ojan Vafai.

Source/WebCore:

Do some initial grid positioning. Only handle the simple case where tracks are
fixed values and don't properly size the grid items. This gives us something to
work with and starts implementing the "Grid Track Sizing Algorithm":
http://dev.w3.org/csswg/css3-grid-layout/#grid-track-sizing-algorithm0

Test: fast/css-grid-layout/place-cell-by-index.html

* rendering/RenderGrid.cpp:
(RenderGrid::GridTrack): Data structure for holding the track size. UsedBreadth matches the terminology
used in the spec.
(WebCore::RenderGrid::layoutBlock): Pull in some boiler plate code and put the
grid specific code in layoutGridItems.
(WebCore::RenderGrid::computedUsedBreadthOfGridTracks): Implement part of the grid track sizing algorithm.
(WebCore::RenderGrid::layoutGridItems): Compute the size of grid tracks, layout and position children.
(WebCore::RenderGrid::findChildLogicalPosition): Map track sizes to the actual position of the child.
* rendering/RenderGrid.h:
* rendering/style/RenderStyle.h: Just return a copy of Length rather than a reference to Length. This seems
more consistent with other getters that return a Length.

LayoutTests:

Add a test for grid layout in each writing mode direction.  The height in vertical writing mode is incorrect for now.

* fast/css-grid-layout/containing-block-grids-expected.html: Scope <p> around text only.
* fast/css-grid-layout/containing-block-grids.html: Fix missing closing </div>.
* fast/css-grid-layout/place-cell-by-index-expected.txt: Added.
* fast/css-grid-layout/place-cell-by-index.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122747 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Cleanup a bunch of invalid BUG* lines. Rebaseline tests that were straightfoward
rebaselines and update the expectations to match what's actually happening on the bots.

* platform/chromium-linux/fast/repaint/repaint-across-writing-mode-boundary-expected.png:
* platform/chromium-linux/http/tests/misc/slow-loading-image-in-pattern-expected.png:
* platform/chromium-mac-snowleopard/fast/backgrounds/solid-color-context-restore-expected.png: Added.
* platform/chromium-mac-snowleopard/fast/reflections/inline-crash-expected.png: Added.
* platform/chromium-mac-snowleopard/http/tests/misc/slow-loading-image-in-pattern-expected.png: Added.
* platform/chromium-mac/fast/backgrounds/solid-color-context-restore-expected.png: Added.
* platform/chromium-mac/fast/reflections/inline-crash-expected.png: Added.
* platform/chromium-mac/http/tests/misc/slow-loading-image-in-pattern-expected.png: Added.
* platform/chromium-mac/transforms/2d/zoom-menulist-expected.png: Added.
* platform/chromium-win/http/tests/misc/slow-loading-image-in-pattern-expected.png:
* platform/chromium/TestExpectations:
* platform/gtk/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122748 268f45cc-cd09-0410-ab3c-d52691b4dbfc
test-webkitpy: use message pools
https://bugs.webkit.org/show_bug.cgi?id=91292

Reviewed by Ojan Vafai.

Restructure the test-running code to be message-driven and
use a MessagePool; note that this does not yet actually run the
tests in parallel.

Also clean up the unit tests so that the fake loader is passed
to the _Worker properly, and reduce a lot of the cut&pasted code
in the tests.

No functional changes; covered by existing tests.

* Scripts/webkitpy/test/printer.py:
(Printer.print_started_test):
(Printer.print_finished_test):
* Scripts/webkitpy/test/runner.py:
(Runner.__init__):
(Runner.run):
(Runner.handle):
(_Worker):
(_Worker.__init__):
(_Worker.handle):
* Scripts/webkitpy/test/runner_unittest.py:
(RunnerTest.assert_run):
(RunnerTest.test_regular):
(RunnerTest.test_verbose):
(RunnerTest.test_timing):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122749 268f45cc-cd09-0410-ab3c-d52691b4dbfc
test-webkitpy: run tests in parallel
https://bugs.webkit.org/show_bug.cgi?id=91294

Reviewed by Ojan Vafai.

This change adds support for running tests in parallel. This is
not yet on by default, since the logging isn't very pretty w/
parallel tests.

Also, there are some (multiprocessing-related) tests that can't be
run in parallel and so we skip them in that situation; I need to
come up with a mechanism for dealing with this, since you
apparently can't use multiprocessing as both a parent and a
child process.

* Scripts/webkitpy/test/finder.py:
(Finder.find_names):
(Finder._default_names):
* Scripts/webkitpy/test/main.py:
(Tester._parse_args):
(Tester.run):
* Scripts/webkitpy/test/main_unittest.py:
(TesterTest.test_no_tests_found):
* Scripts/webkitpy/test/runner.py:
(Runner.run):
* Scripts/webkitpy/test/runner_unittest.py:
(RunnerTest.test_regular):
(RunnerTest.test_verbose):
(RunnerTest.test_timing):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122750 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Unreviewed gardening. Layout Test fast/frames/calculate-fixed.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=91415

Has been intermittently failing TEXT since at least r122699.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122752 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add dfg switch to create_jit_stubs script
https://bugs.webkit.org/show_bug.cgi?id=91256

Reviewed by Geoffrey Garen.

* create_jit_stubs: Add a switch to enable or disable the generation of
                    stub functions in #if ENABLE(DFG_JIT) conditions.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122753 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Upstream WebGL Code
https://bugs.webkit.org/show_bug.cgi?id=91143

Patch by Joshua Netterfield <jnetterfield@rim.com> on 2012-07-16
Reviewed by Rob Buis.

This patch includes BlackBerry-specific fixes for anti-aliasing, logging, and shader compilation.

Source/WebCore:

No new tests, because there is no new functionality.

* platform/graphics/GraphicsContext3D.h: Add a value for TI Imagination chipsets on BlackBerry platforms
* platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp: Multiple downstream changes
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::reshapeFBOs):
(WebCore):
(WebCore::GraphicsContext3D::logFrameBufferStatus):
(WebCore::GraphicsContext3D::readPixelsIMG): BlackBerry-specific fix for Imagination hardware.
(WebCore::GraphicsContext3D::paintsIntoCanvasBuffer):
(WebCore::GraphicsContext3D::platformTexture):
(WebCore::GraphicsContext3D::platformGraphicsContext3D):
(WebCore::GraphicsContext3D::paintToCanvas):
* platform/graphics/opengl/Extensions3DOpenGL.h: Remove unnecessary whitespace.
(Extensions3DOpenGL):
* platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
(WebCore::Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE): Hack to fix ANGLE-generated code on BlackBerry platforms.
* platform/graphics/opengl/Extensions3DOpenGLCommon.h:
(Extensions3DOpenGLCommon):
* platform/graphics/opengl/Extensions3DOpenGLES.cpp: I am not in a position to change system headers from correct to incorrect.
(WebCore::Extensions3DOpenGLES::renderbufferStorageMultisample):
(WebCore::Extensions3DOpenGLES::supportsExtension):
* platform/graphics/opengl/Extensions3DOpenGLES.h: I am not in a position to change system headers from correct to incorrect.
(Extensions3DOpenGLES):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: Add a BlackBerry-specific anti-aliasing fix.
(WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
(WebCore::GraphicsContext3D::prepareTexture):
(WebCore::GraphicsContext3D::bindFramebuffer):
(WebCore::GraphicsContext3D::compileShader):
(WebCore::GraphicsContext3D::copyTexImage2D):
(WebCore::GraphicsContext3D::copyTexSubImage2D):
(WebCore):
* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
(WebCore):

Source/WebKit:

* PlatformBlackBerry.cmake: Define WTF_USE_OPENGL_ES_2 on WebGL-enabled builds.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122754 268f45cc-cd09-0410-ab3c-d52691b4dbfc
SVGAnimationElement::currentValuesForValuesAnimation crash
https://bugs.webkit.org/show_bug.cgi?id=91326

Reviewed by Simon Fraser.

SVGSMILElement::progress() assumes that seekToIntervalCorrespondingToTime() always
lands inside a defined interval, but one can force arbitrary time offsets using
setCurrentTime(). This patch adds logic for handling non-interval time offsets
gracefully.

Source/WebCore:

Test: svg/animations/smil-setcurrenttime-crash.svg

* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::progress):

LayoutTests:

* svg/animations/smil-setcurrenttime-crash-expected.txt: Added.
* svg/animations/smil-setcurrenttime-crash.svg: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122755 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Remove targetRenderSurface concept, give layers a renderTarget which is the layer whose coordinate space they draw into
https://bugs.webkit.org/show_bug.cgi?id=91288

Reviewed by Adrienne Walker.

Source/WebCore:

Always use pointers to layers when discussing render targets instead of
pointing directly to a RenderSurface.

Covered by existing tests.

* platform/graphics/chromium/LayerChromium.cpp:
(WebCore::LayerChromium::LayerChromium):
(WebCore::LayerChromium::createRenderSurface):
* platform/graphics/chromium/LayerChromium.h:
(WebCore::LayerChromium::renderTarget):
(WebCore::LayerChromium::setRenderTarget):
(LayerChromium):
* platform/graphics/chromium/RenderSurfaceChromium.cpp:
* platform/graphics/chromium/RenderSurfaceChromium.h:
* platform/graphics/chromium/ScrollbarLayerChromium.cpp:
(WebCore::ScrollbarLayerChromium::setTexturePriorities):
* platform/graphics/chromium/TiledLayerChromium.cpp:
(WebCore::TiledLayerChromium::setTexturePrioritiesInRect):
* platform/graphics/chromium/cc/CCLayerImpl.cpp:
(WebCore::CCLayerImpl::CCLayerImpl):
(WebCore::CCLayerImpl::createRenderSurface):
(WebCore::CCLayerImpl::dumpLayerProperties):
* platform/graphics/chromium/cc/CCLayerImpl.h:
(WebCore::CCLayerImpl::renderTarget):
(WebCore::CCLayerImpl::setRenderTarget):
(CCLayerImpl):
* platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
(WebCore::calculateLayerScissorRect):
(WebCore::calculateSurfaceScissorRect):
(WebCore::calculateVisibleContentRect):
(WebCore::computeScrollCompensationForThisLayer):
(WebCore::calculateDrawTransformsInternal):
(WebCore::pointIsClippedBySurfaceOrClipRect):
* platform/graphics/chromium/cc/CCOcclusionTracker.cpp:
(WebCore::::enterLayer):
(WebCore::::leaveLayer):
(WebCore::::enterRenderTarget):
(WebCore::::finishedRenderTarget):
(WebCore):
(WebCore::reduceOcclusionBelowSurface):
(WebCore::::leaveToRenderTarget):
(WebCore::::markOccludedBehindLayer):
(WebCore::::occluded):
(WebCore::::unoccludedContentRect):
(WebCore::::unoccludedContributingSurfaceContentRect):
(WebCore::::layerScissorRectInTargetSurface):
* platform/graphics/chromium/cc/CCOcclusionTracker.h:
(CCOcclusionTrackerBase):
(WebCore::CCOcclusionTrackerBase::StackObject::StackObject):
(StackObject):
* platform/graphics/chromium/cc/CCQuadCuller.cpp:
(WebCore::CCQuadCuller::appendSurface):
* platform/graphics/chromium/cc/CCRenderSurface.cpp:
* platform/graphics/chromium/cc/CCRenderSurface.h:
(CCRenderSurface):

Source/WebKit/chromium:

* tests/CCDamageTrackerTest.cpp:
(WebKitTests::TEST_F):
* tests/CCLayerImplTest.cpp:
(WebCore::TEST):
* tests/CCLayerTreeHostCommonTest.cpp:
* tests/CCOcclusionTrackerTest.cpp:
(WebKitTests::CCOcclusionTrackerTestOverlappingSurfaceSiblings::runMyTest):
(WebKitTests::CCOcclusionTrackerTestOverlappingSurfaceSiblingsWithTwoTransforms::runMyTest):
(WebKitTests::CCOcclusionTrackerTestAnimationOpacity1OnMainThread::runMyTest):
(WebKitTests::CCOcclusionTrackerTestAnimationOpacity0OnMainThread::runMyTest):
(WebKitTests::CCOcclusionTrackerTestAnimationTranslateOnMainThread::runMyTest):
(WebKitTests::CCOcclusionTrackerTestReplicaOccluded::runMyTest):
(WebKitTests::CCOcclusionTrackerTestSurfaceWithReplicaUnoccluded::runMyTest):
(WebKitTests::CCOcclusionTrackerTestSurfaceAndReplicaOccludedDifferently::runMyTest):
(WebKitTests::CCOcclusionTrackerTestSurfaceChildOfSurface::runMyTest):
(WebKitTests::CCOcclusionTrackerTestTopmostSurfaceIsClippedToScissor::runMyTest):
(WebKitTests::CCOcclusionTrackerTestSurfaceChildOfClippingSurface::runMyTest):
* tests/CCQuadCullerTest.cpp:
* tests/CCTiledLayerTestCommon.cpp:
(WebKitTests::FakeTiledLayerChromium::setTexturePriorities):
* tests/LayerChromiumTest.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122756 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Any webpage can crash webkit via qnx.callExtensionMethod assuming 'this' is the 'qnx' object.
https://bugs.webkit.org/show_bug.cgi?id=91419

Run the following in inspector to crash WebKit

qnx.callExtensionMethod.apply(window, []);

In the c++ that handles the function it assumes that when callExtensionMethod
is called that 'this' is the object 'qnx'.  The qnx object has a hidden
variable that the code casts and uses, but when 'this' is not qnx such as the
example this will cause a crash.  Any website can insert the above JavaScript
to cause the crash.

Patch by Benjamin C Meyer <bmeyer@rim.com> on 2012-07-16
Reviewed by Yong Li.

* WebCoreSupport/ClientExtension.cpp:
(clientExtensionMethod):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122757 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix Layout Test pointer-lock/locked-element-removed-from-dom.html flakiness.
https://bugs.webkit.org/show_bug.cgi?id=91373

Reviewed by Adrienne Walker.

pointer-lock-test-harness corrected to no longer silently allow too many
asynchronous doNextStep calls in a test. The locked-element-removed-from-dom test
generated too many events and incorrectly exited the test early.

* platform/chromium/TestExpectations:
    Re-enabled locked-element-removed-from-dom test.html
* pointer-lock/locked-element-removed-from-dom.html:
    Absorb extra doNextStep.
* pointer-lock/resources/pointer-lock-test-harness.js:
(doNextStep.setTimeout):
    Fail tests that call doNextStep too many times.


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