Move layerTreeAsText to window.internals
https://bugs.webkit.org/show_bug.cgi?id=98690

Reviewed by James Robinson.

Add window.internals.layerTreeAsText(document), and change the tests to use it.
I'll remove testRunner.layerTreeAsText() in a later patch.

Source/WebCore:

* testing/Internals.cpp:
(WebCore::Internals::layerTreeAsText):
* testing/Internals.h:
(Internals):
* testing/Internals.idl:

LayoutTests:

* compositing/animation/animation-compositing.html:
* compositing/backing/no-backing-for-clip-overlap.html:
* compositing/backing/no-backing-for-clip.html:
* compositing/backing/no-backing-for-perspective.html:
* compositing/bounds-in-flipped-writing-mode.html:
* compositing/clip-child-by-non-stacking-ancestor.html:
* compositing/columns/composited-in-paginated.html:
* compositing/geometry/ancestor-overflow-change.html:
* compositing/geometry/bounds-clipped-composited-child.html:
* compositing/geometry/bounds-ignores-hidden-composited-descendant.html:
* compositing/geometry/bounds-ignores-hidden-dynamic-negzindex.html:
* compositing/geometry/bounds-ignores-hidden-dynamic.html:
* compositing/geometry/bounds-ignores-hidden.html:
* compositing/geometry/clip.html:
* compositing/geometry/composited-in-columns.html:
* compositing/geometry/fixed-position-composited-switch.html:
* compositing/geometry/flipped-writing-mode.html:
* compositing/geometry/foreground-layer.html:
* compositing/geometry/layer-due-to-layer-children-deep-switch.html:
* compositing/geometry/layer-due-to-layer-children-switch.html:
* compositing/geometry/limit-layer-bounds-clipping-ancestor.html:
* compositing/geometry/limit-layer-bounds-fixed-positioned.html:
* compositing/geometry/limit-layer-bounds-opacity-transition.html:
* compositing/geometry/limit-layer-bounds-overflow-root.html:
* compositing/geometry/limit-layer-bounds-positioned-transition.html:
* compositing/geometry/limit-layer-bounds-positioned.html:
* compositing/geometry/limit-layer-bounds-transformed-overflow.html:
* compositing/geometry/limit-layer-bounds-transformed.html:
* compositing/geometry/preserve-3d-switching.html:
* compositing/iframes/become-composited-nested-iframes.html:
* compositing/iframes/become-overlapped-iframe.html:
* compositing/iframes/composited-parent-iframe.html:
* compositing/iframes/connect-compositing-iframe-delayed.html:
* compositing/iframes/connect-compositing-iframe.html:
* compositing/iframes/connect-compositing-iframe2.html:
* compositing/iframes/connect-compositing-iframe3.html:
* compositing/iframes/enter-compositing-iframe.html:
* compositing/iframes/iframe-resize.html:
* compositing/iframes/iframe-size-from-zero.html:
* compositing/iframes/iframe-size-to-zero.html:
* compositing/iframes/iframe-src-change.html:
* compositing/iframes/invisible-nested-iframe-hide.html:
* compositing/iframes/invisible-nested-iframe-show.html:
* compositing/iframes/leave-compositing-iframe.html:
* compositing/iframes/overlapped-iframe-iframe.html:
* compositing/iframes/overlapped-iframe.html:
* compositing/iframes/overlapped-nested-iframes.html:
* compositing/iframes/page-cache-layer-tree.html:
* compositing/iframes/resizer.html:
* compositing/iframes/scrolling-iframe.html:
* compositing/images/clip-on-directly-composited-image.html:
* compositing/layer-creation/animation-overlap-with-children.html:
* compositing/layer-creation/fixed-position-and-transform.html:
* compositing/layer-creation/fixed-position-out-of-view.html:
* compositing/layer-creation/fixed-position-under-transform.html:
* compositing/layer-creation/no-compositing-for-preserve-3d.html:
* compositing/layer-creation/overflow-scroll-overlap.html:
* compositing/layer-creation/overlap-animation.html:
* compositing/layer-creation/overlap-child-layer.html:
* compositing/layer-creation/overlap-clipping.html:
* compositing/layer-creation/overlap-transformed-and-clipped.html:
* compositing/layer-creation/overlap-transformed-layer.html:
* compositing/layer-creation/overlap-transforms.html:
* compositing/layer-creation/rotate3d-overlap.html:
* compositing/layer-creation/scroll-partial-update.html:
* compositing/layer-creation/spanOverlapsCanvas.html:
* compositing/layer-creation/stacking-context-overlap-nested.html:
* compositing/layer-creation/stacking-context-overlap.html:
* compositing/layer-creation/translatez-overlap.html:
* compositing/overflow-trumps-transform-style.html:
* compositing/overflow/clip-descendents.html:
* compositing/overflow/content-gains-scrollbars.html:
* compositing/overflow/content-loses-scrollbars.html:
* compositing/overflow/overflow-auto-with-touch-no-overflow.html:
* compositing/overflow/overflow-auto-with-touch-toggle.html:
* compositing/overflow/overflow-auto-with-touch.html:
* compositing/overflow/overflow-hidden-with-touch.html:
* compositing/overflow/overflow-overlay-with-touch-no-overflow.html:
* compositing/overflow/overflow-overlay-with-touch.html:
* compositing/overflow/overflow-scroll-with-touch-no-overflow.html:
* compositing/overflow/overflow-scrollbar-layers.html:
* compositing/overflow/overflow-visible-with-touch.html:
* compositing/overflow/resize-painting.html:
* compositing/overflow/scrolling-content-clip-to-viewport.html:
* compositing/overflow/textarea-scroll-touch.html:
* compositing/plugins/1x1-composited-plugin.html:
* compositing/plugins/large-to-small-composited-plugin.html:
* compositing/plugins/no-backing-store.html:
* compositing/plugins/small-to-large-composited-plugin.html:
* compositing/rtl/rtl-absolute-overflow-scrolled.html:
* compositing/rtl/rtl-absolute-overflow.html:
* compositing/rtl/rtl-absolute.html:
* compositing/rtl/rtl-fixed-overflow-scrolled.html:
* compositing/rtl/rtl-fixed-overflow.html:
* compositing/rtl/rtl-fixed.html:
* compositing/rtl/rtl-iframe-absolute-overflow-scrolled.html:
* compositing/rtl/rtl-iframe-absolute-overflow.html:
* compositing/rtl/rtl-iframe-absolute.html:
* compositing/rtl/rtl-iframe-fixed-overflow-scrolled.html:
* compositing/rtl/rtl-iframe-fixed-overflow.html:
* compositing/rtl/rtl-iframe-fixed.html:
* compositing/rtl/rtl-iframe-relative.html:
* compositing/rtl/rtl-relative.html:
* compositing/tiled-layers-hidpi.html:
* compositing/tiling/crash-reparent-tiled-layer.html:
* compositing/tiling/huge-layer-add-remove-child.html-disabled:
* compositing/tiling/huge-layer-img.html-disabled:
* compositing/tiling/huge-layer-resize.html-disabled:
* compositing/tiling/huge-layer-with-layer-children-resize.html-disabled:
* compositing/tiling/huge-layer-with-layer-children.html-disabled:
* compositing/tiling/huge-layer.html-disabled:
* compositing/video/video-poster.html:
* compositing/visibility/layer-visible-content.html:
* compositing/visibility/visibility-image-layers-dynamic.html:
* css3/compositing/should-have-compositing-layer.html:
* css3/filters/composited-during-animation-layertree.html:
* css3/filters/composited-during-transition-layertree.html:
* css3/filters/filtered-compositing-descendant.html:
* css3/filters/should-not-have-compositing-layer.html:
* platform/chromium-android/compositing/layer-creation/overflow-scrolling-touch.html:
* platform/chromium/compositing/force-compositing-mode/force-composite-empty.html:
* platform/chromium/compositing/force-compositing-mode/no-overflow-iframe-layer.html:
* platform/chromium/compositing/force-compositing-mode/overflow-hidden-iframe-layer.html:
* platform/chromium/compositing/force-compositing-mode/overflow-iframe-enter-compositing.html:
* platform/chromium/compositing/force-compositing-mode/overflow-iframe-layer.html:
* platform/chromium/compositing/force-compositing-mode/overflow-iframe-leave-compositing.html:
* platform/mac/compositing/canvas/accelerated-canvas-compositing.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130689 268f45cc-cd09-0410-ab3c-d52691b4dbfc
nrwt: [chromium] run http tests in parallel on bigger machines
https://bugs.webkit.org/show_bug.cgi?id=98562

Reviewed by Eric Seidel.

The "locked tests" shard (which includes the http tests and the
perf tests) is the long pole on machines where we have 4 or more
workers, so we should start making sure that
we can run http tests in parallel, following the normal sharding
rules (all tests in the same directory are in the same shard by
default). We should still probably limit the number of workers
hitting the web server in parallel where we can; a heuristic of
no more than 25% of them seems okay for a start. This will
likely only affect developer workstations and a couple of bots
at first, so should be low risk and a good reward.

* Scripts/webkitpy/layout_tests/port/base.py:
(Port.default_max_locked_shards):
* Scripts/webkitpy/layout_tests/port/chromium.py:
(ChromiumPort.default_max_locked_shards):
* Scripts/webkitpy/layout_tests/port/chromium_port_testcase.py:
(ChromiumPortTestCase.test_default_max_locked_shards):
* Scripts/webkitpy/layout_tests/port/port_testcase.py:
(PortTestCase.test_default_max_locked_shards):
* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(_set_up_derived_options):
(parse_args):
* Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
(MainTest.test_max_locked_shards):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130690 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Mac Chromium: Ignore system numpad modifier
https://bugs.webkit.org/show_bug.cgi?id=97161

Patch by Sailesh Agrawal <sail@chromium.org> on 2012-10-08
Reviewed by Tony Chang.

On Mac, arrow key events have numpad modifier set. This is inconsistent with other platforms.

My fix is to only rely on keycode to decide when to set the numpad modifier.

This code is not exersided by layout tests so I added a new unit test for this.

* WebKit.gypi:
* WebKitUnitTests.gyp:
* src/mac/WebInputEventFactory.mm:
(WebKit::isKeypadEvent): Removed check for numpad modifier.
* tests/WebInputEventFactoryTestMac.mm: Added.
(TEST): Added new test for WebInputEventFactory::keyboardEvent().

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Some non-scrollable elements are added to non-fast-scrollable region
https://bugs.webkit.org/show_bug.cgi?id=97927

Patch by Sami Kyostila <skyostil@chromium.org> on 2012-10-08
Reviewed by James Robinson.

Source/WebCore:

Only RenderLayers that can actually be scrolled should be added to the
ScrollingCoordinator's non-fast scrollable region. Otherwise we may
needlessly fall back to main thread scrolling.

Test: ScrollingCoordinatorChromiumTest.clippedBodyTest

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateScrollbarsAfterLayout):
(WebCore::RenderLayer::updateScrollbarsAfterStyleChange):

Source/WebKit/chromium:

Test that a non-scrollable RenderLayer isn't added to the non-fast scrollable
region.

The test in this patch consists of a web page where both the html and
body elements clip horizontal overflow. This results in a hierarchy
where the body element gets a scrollable RenderLayer. However, that
layer isn't (interactively) scrollable because while the scroll geometry
is calculated based on the amount of overflow, the scroll bars are
hidden because of the "overflow-x: hidden" style.

Previously this layer would have made the entire page part of the
non-fast scrollable region. With this patch,
RenderLayer::allowScrolling() is used as a pre-requisite for expanding
the region, thus avoiding the problem.

* tests/ScrollingCoordinatorChromiumTest.cpp:
(WebKit::TEST_F):
(WebKit):
* tests/data/clipped-body.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130692 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Try to fix Windows build by exporting Frame::layerTreeAsText().

* win/WebKit2.def:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130693 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rename RenderObject::firstLineStyleSlowCase() to a more appropriate cachedFirstLineStyle()
https://bugs.webkit.org/show_bug.cgi?id=98631

Patch by Arpita Bahuguna <arpitabahuguna@gmail.com> on 2012-10-08
Reviewed by Eric Seidel.

Renaming firstLineStyleSlowCase() to cachedFirstLineStyle().

The current name is confusing since the function actually gets the
the cached first-line styles.
It also makes the name more descriptive of its functionality
and in accordance with RenderObject::uncachedFirstLineStyle().

No new tests required for this change since no change in behavior is expected.

* rendering/RenderObject.cpp:
(WebCore::RenderObject::cachedFirstLineStyle):
* rendering/RenderObject.h:
(WebCore::RenderObject::firstLineStyle):
(RenderObject):
Renamed RenderObject::firstLineStyleSlowCase() to cachedFirstLineStyle()
and made the associated changes.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130694 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Generalize moving URLComponent's begin position
https://bugs.webkit.org/show_bug.cgi?id=98626

Reviewed by Adam Barth.

The patch r130609 introduced moving URLComponents's position.
It turns out this concept is really useful in the parser so
this patch generalize the idea.

* wtf/url/api/ParsedURL.cpp:
(WTF::ParsedURL::removePort):
* wtf/url/src/URLCanonEtc.cpp:
* wtf/url/src/URLComponent.h:
(WTF::URLComponent::moveBy):
Rename URLComponent::move() to URLComponent::moveBy() for consistency
with some of WebCore types.

* wtf/url/src/URLParse.cpp:
* wtf/url/src/URLParseFile.cpp:

* wtf/url/src/URLSegments.cpp:
(WTF::URLSegments::moveFromComponentBy):
Change the semantic to everything from a certain component. This is
useful to move everything, including the scheme.

* wtf/url/src/URLSegments.h:
(URLSegments):


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