Prepare for position:sticky support inside accelerated overflow-scroll with WK2
https://bugs.webkit.org/show_bug.cgi?id=133329

Reviewed by Tim Horton.

RenderLayerCompositor::computeStickyViewportConstraints() was always using
the viewport rect as the constraining rect for sticky position. This is not
correct when inside overflow:scroll.

Refactor code in RenderBoxModelObject to make getting the rect easy, and use
it to compute the constraints.

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::constrainingRectForStickyPosition):
(WebCore::RenderBoxModelObject::stickyPositionOffset):
* rendering/RenderBoxModelObject.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeStickyViewportConstraints):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169408 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Instantiate a ScrollingTreeMac on Mac
https://bugs.webkit.org/show_bug.cgi?id=133332

Reviewed by Tim Horton.

Mac previously instantiated a ThreadedScrollingTree, but this has no platform
knowledge. To support future expansion, create a ScrollingTreeMac subclass and
instantiate that on Mac.

Also protect ScrollingCoordinatorMac in PLATFORM(MAC) #ifdefs and remove it from the
EXCLUDED_SOURCE_FILE_NAMES list in the xcconfig file, following general trends.

* Configurations/WebCore.xcconfig:
* WebCore.xcodeproj/project.pbxproj:
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::create): Deleted.
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::ScrollingCoordinatorMac):
* page/scrolling/mac/ScrollingTreeMac.cpp: Copied from Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h.
(ScrollingTreeMac::create):
(ScrollingTreeMac::ScrollingTreeMac):
* page/scrolling/mac/ScrollingTreeMac.h: Copied from Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169409 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Do some renaming in the scrolling tree
https://bugs.webkit.org/show_bug.cgi?id=133333

Reviewed by Tim Horton.

Source/WebCore:

Rename ScrollingTreeNode::parentScrollPositionDidChange() to updateLayersAfterAncestorChange()
since this goes deep and to indicate that it's about layer updating.

Also rename the "viewportRect" parameter to "fixedPositionRect", since on iOS
this is the custom fixed-position rect that changes on zooming.

* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::viewportChangedViaDelegatedScrolling):
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeFrameScrollingNode.h:
* page/scrolling/ScrollingTreeNode.h:
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
(WebCore::ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterViewportChange):
(WebCore::ScrollingTreeFrameScrollingNodeIOS::updateChildNodesAfterScroll):
* page/scrolling/mac/ScrollingTreeFixedNode.h:
* page/scrolling/mac/ScrollingTreeFixedNode.mm:
(WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
(WebCore::ScrollingTreeFixedNode::parentScrollPositionDidChange): Deleted.
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
* page/scrolling/mac/ScrollingTreeStickyNode.h:
* page/scrolling/mac/ScrollingTreeStickyNode.mm:
(WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange):
(WebCore::ScrollingTreeStickyNode::parentScrollPositionDidChange): Deleted.

Source/WebKit2:

Rename ScrollingTreeNode::parentScrollPositionDidChange() to updateLayersAfterAncestorChange()
since this goes deep and to indicate that it's about layer updating.

Also rename the "viewportRect" parameter to "fixedPositionRect", since on iOS
this is the custom fixed-position rect that changes on zooming.

* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling):
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterViewportChange):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169410 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS WK2] Fix behavior of position:sticky inside accelerated overflow-scroll
https://bugs.webkit.org/show_bug.cgi?id=133334
<rdar://problem/16462535>

Reviewed by Tim Horton.

When the scroll position changes in an accelerated overflow-scroll element, we have
to update child nodes in the scrolling tree for position:sticky. That requires a
more generic ability to update the scrolling tree after some arbitrary zoom or
scroll. To do this, we need to know the current fixed position rect, rather than
having it passed in.

So make the fixed position rect available from ScrollingTree, and make it possible
to get the current scrollPosition() from any ScrollingTreeScrollingNode.

Also, implement updateLayersAfterDelegatedScroll() in ScrollingTreeOverflowScrollingNodeIOS,
and have it update descendant layers.

Finally, fix ScrollingTreeOverflowScrollingNode to use the correct rectangle for its
constraints math, using the scroll position of the parent node if appropriate.

Source/WebCore:
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
(WebCore::ScrollingTreeFrameScrollingNodeIOS::updateChildNodesAfterScroll):
* page/scrolling/ios/ScrollingTreeIOS.cpp:
(WebCore::ScrollingTreeIOS::fixedPositionRect):
* page/scrolling/ios/ScrollingTreeIOS.h:
* page/scrolling/mac/ScrollingTreeStickyNode.mm:
(WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange):

Source/WebKit2:
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
* UIProcess/Scrolling/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::fixedPositionRect):
* UIProcess/Scrolling/RemoteScrollingTree.h:
* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterDelegatedScroll):
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll):
* UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169411 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (Margin tiles): Background gradient on dom.spec.whatwg.org is very slow to render
https://bugs.webkit.org/show_bug.cgi?id=133335
<rdar://problem/17011392>

Reviewed by Simon Fraser.

* platform/graphics/Image.cpp:
(WebCore::Image::drawTiled):
Make cross-platform and use some iOS code which avoids patterned drawing when the pattern buffer
would be very large. Instead, it calls draw() repeatedly over the pattern space, avoiding the allocation
of a huge (in the case of bug 133335, nearly 2GB) buffer.


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