Source/WebCore/ChangeLog

112014-06-19 Simon Fraser <simon.fraser@apple.com>
22
 3 [iOS WebKit2] Make -webkit-overflow-scrolling:touch work in iframes (breaks MSWord previews)
 4 https://bugs.webkit.org/show_bug.cgi?id=134085
 5 <rdar://problem/16440586>
 6
 7 Reviewed by NOBODY (OOPS!).
 8
 9 When nodes were detached from the scrolling tree, we would previously throw away
 10 all descendant nodes, expecting that they would be re-attached as we walk the compositing
 11 layer tree in RenderLayerCompositor.
 12
 13 However, this doesn't work across frame boundaries; the subframe may never update
 14 its compositing layers again, so would lose all its scrolling nodes.
 15
 16 Fix by having ScrollingStateTree::detachNode() by default set aside subframe nodes
 17 into a hash map. On reattach, we'll look in the hash map and pull out an existing node
 18 (with its children intact) if possible.
 19
 20 Tests: platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-gain-scrolling-ancestor.html
 21 platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-lose-scrolling-ancestor.html
 22 platform/mac-wk2/tiled-drawing/scrolling/frames/remove-coordinated-frame.html
 23
 24 * page/scrolling/ScrollingStateNode.cpp:
 25 (WebCore::ScrollingStateNode::ScrollingStateNode):
 26 * page/scrolling/ScrollingStateTree.cpp:
 27 (WebCore::ScrollingStateTree::attachNode):
 28 (WebCore::ScrollingStateTree::detachNode):
 29 (WebCore::ScrollingStateTree::clear):
 30 (WebCore::ScrollingStateTree::removeNodeAndAllDescendants):
 31 (WebCore::ScrollingStateTree::recursiveNodeWillBeRemoved):
 32 * page/scrolling/ScrollingStateTree.h:
 33 * page/scrolling/ScrollingTree.cpp:
 34 (WebCore::ScrollingTree::commitNewTreeState): Go back to removing the deleted
 35 nodes from m_nodeMap first.
 36 (WebCore::ScrollingTree::removeDestroyedNodes): There is no need for this to
 37 actually make use of ScrollingTreeNode* any more; the ASSERT(!node->parent())
 38 is bogus because it can fire when whole subtrees are removed, and to clear the
 39 latched node we just need the ID.
 40
 412014-06-19 Simon Fraser <simon.fraser@apple.com>
 42
343 Handle scrolling tree modifications which remove intermediate nodes
444 https://bugs.webkit.org/show_bug.cgi?id=134082
545

Source/WebKit2/ChangeLog

112014-06-19 Simon Fraser <simon.fraser@apple.com>
22
 3 [iOS WebKit2] Make -webkit-overflow-scrolling:touch work in iframes (breaks MSWord previews)
 4 https://bugs.webkit.org/show_bug.cgi?id=134085
 5 <rdar://problem/16440586>
 6
 7 Reviewed by NOBODY (OOPS!).
 8
 9 Add some debug-only assertions that check that the number of nodes we encoded is
 10 the expected number.
 11
 12 * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
 13 (WebKit::encodeNodeAndDescendants):
 14 (WebKit::RemoteScrollingCoordinatorTransaction::encode):
 15
 162014-06-19 Simon Fraser <simon.fraser@apple.com>
 17
318 Handle scrolling tree modifications which remove intermediate nodes
419 https://bugs.webkit.org/show_bug.cgi?id=134082
520

Source/WebCore/page/scrolling/ScrollingStateNode.cpp

@@ScrollingStateNode::ScrollingStateNode(ScrollingNodeType nodeType, ScrollingStat
4141 , m_nodeID(nodeID)
4242 , m_changedProperties(0)
4343 , m_scrollingStateTree(scrollingStateTree)
44  , m_parent(0)
 44 , m_parent(nullptr)
4545{
4646}
4747

@@ScrollingStateNode::ScrollingStateNode(const ScrollingStateNode& stateNode, Scro
5252 , m_nodeID(stateNode.scrollingNodeID())
5353 , m_changedProperties(stateNode.changedProperties())
5454 , m_scrollingStateTree(adoptiveTree)
55  , m_parent(0)
 55 , m_parent(nullptr)
5656{
5757 if (hasChangedProperty(ScrollLayer))
5858 setLayer(stateNode.layer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));

Source/WebCore/page/scrolling/ScrollingStateTree.cpp

@@ScrollingNodeID ScrollingStateTree::attachNode(ScrollingNodeType nodeType, Scrol
8282 return newNodeID;
8383
8484 // The node is being re-parented. To do that, we'll remove it, and then re-create a new node.
85  removeNodeAndAllDescendants(node);
 85 removeNodeAndAllDescendants(node, OrphanSubframeNodes);
8686 }
8787
8888 ScrollingStateNode* newNode = nullptr;

@@ScrollingNodeID ScrollingStateTree::attachNode(ScrollingNodeType nodeType, Scrol
9898 if (!parent)
9999 return 0;
100100
101  switch (nodeType) {
102  case FixedNode: {
103  RefPtr<ScrollingStateFixedNode> fixedNode = ScrollingStateFixedNode::create(*this, newNodeID);
104  newNode = fixedNode.get();
105  parent->appendChild(fixedNode.release());
106  break;
107  }
108  case StickyNode: {
109  RefPtr<ScrollingStateStickyNode> stickyNode = ScrollingStateStickyNode::create(*this, newNodeID);
110  newNode = stickyNode.get();
111  parent->appendChild(stickyNode.release());
112  break;
113  }
114  case FrameScrollingNode: {
115  RefPtr<ScrollingStateFrameScrollingNode> scrollingNode = ScrollingStateFrameScrollingNode::create(*this, newNodeID);
116  newNode = scrollingNode.get();
117  parent->appendChild(scrollingNode.release());
118  break;
119  }
120  case OverflowScrollingNode: {
121  RefPtr<ScrollingStateOverflowScrollingNode> scrollingNode = ScrollingStateOverflowScrollingNode::create(*this, newNodeID);
122  newNode = scrollingNode.get();
123  parent->appendChild(scrollingNode.release());
124  break;
 101 if (nodeType == FrameScrollingNode && parentID) {
 102 if (RefPtr<ScrollingStateNode> orphanedNode = m_orphanedSubframeNodes.take(newNodeID)) {
 103 newNode = orphanedNode.get();
 104 parent->appendChild(orphanedNode.release());
 105 }
125106 }
 107
 108 if (!newNode) {
 109 switch (nodeType) {
 110 case FixedNode: {
 111 RefPtr<ScrollingStateFixedNode> fixedNode = ScrollingStateFixedNode::create(*this, newNodeID);
 112 newNode = fixedNode.get();
 113 parent->appendChild(fixedNode.release());
 114 break;
 115 }
 116 case StickyNode: {
 117 RefPtr<ScrollingStateStickyNode> stickyNode = ScrollingStateStickyNode::create(*this, newNodeID);
 118 newNode = stickyNode.get();
 119 parent->appendChild(stickyNode.release());
 120 break;
 121 }
 122 case FrameScrollingNode: {
 123 RefPtr<ScrollingStateFrameScrollingNode> scrollingNode = ScrollingStateFrameScrollingNode::create(*this, newNodeID);
 124 newNode = scrollingNode.get();
 125 parent->appendChild(scrollingNode.release());
 126 break;
 127 }
 128 case OverflowScrollingNode: {
 129 RefPtr<ScrollingStateOverflowScrollingNode> scrollingNode = ScrollingStateOverflowScrollingNode::create(*this, newNodeID);
 130 newNode = scrollingNode.get();
 131 parent->appendChild(scrollingNode.release());
 132 break;
 133 }
 134 }
126135 }
127136 }
128137

@@void ScrollingStateTree::detachNode(ScrollingNodeID nodeID)
141150 if (!node)
142151 return;
143152
144  removeNodeAndAllDescendants(node);
 153 removeNodeAndAllDescendants(node, OrphanSubframeNodes);
145154}
146155
147156void ScrollingStateTree::clear()
148157{
149  removeNodeAndAllDescendants(rootStateNode());
 158 if (rootStateNode())
 159 removeNodeAndAllDescendants(rootStateNode());
 160
150161 ASSERT(m_stateNodeMap.isEmpty());
151162 m_stateNodeMap.clear();
 163 m_orphanedSubframeNodes.clear();
152164}
153165
154166PassOwnPtr<ScrollingStateTree> ScrollingStateTree::commit(LayerRepresentation::Type preferredLayerRepresentation)
155167{
 168 m_orphanedSubframeNodes.clear();
 169
156170 // This function clones and resets the current state tree, but leaves the tree structure intact.
157171 OwnPtr<ScrollingStateTree> treeStateClone = ScrollingStateTree::create();
158172 treeStateClone->setPreferredLayerRepresentation(preferredLayerRepresentation);

@@void ScrollingStateTree::addNode(ScrollingStateNode* node)
178192 m_stateNodeMap.add(node->scrollingNodeID(), node);
179193}
180194
181 void ScrollingStateTree::removeNodeAndAllDescendants(ScrollingStateNode* node)
 195void ScrollingStateTree::removeNodeAndAllDescendants(ScrollingStateNode* node, SubframeNodeRemoval subframeNodeRemoval)
182196{
183  if (!node)
184  return;
 197 ScrollingStateNode* parent = node->parent();
185198
186  recursiveNodeWillBeRemoved(node);
 199 recursiveNodeWillBeRemoved(node, subframeNodeRemoval);
187200
188201 if (node == m_rootStateNode)
189202 m_rootStateNode = nullptr;
190  else if (ScrollingStateNode* parent = node->parent()) {
 203 else if (parent) {
191204 ASSERT(parent->children() && parent->children()->find(node) != notFound);
192205 if (auto children = parent->children()) {
193206 size_t index = children->find(node);

@@void ScrollingStateTree::removeNodeAndAllDescendants(ScrollingStateNode* node)
197210 }
198211}
199212
200 void ScrollingStateTree::recursiveNodeWillBeRemoved(ScrollingStateNode* currNode)
 213void ScrollingStateTree::recursiveNodeWillBeRemoved(ScrollingStateNode* currNode, SubframeNodeRemoval subframeNodeRemoval)
201214{
 215 currNode->setParent(nullptr);
 216 if (subframeNodeRemoval == OrphanSubframeNodes && currNode != m_rootStateNode && currNode->isFrameScrollingNode()) {
 217 m_orphanedSubframeNodes.add(currNode->scrollingNodeID(), currNode);
 218 return;
 219 }
 220
202221 willRemoveNode(currNode);
203222
204223 if (auto children = currNode->children()) {
205224 for (auto& child : *children)
206  recursiveNodeWillBeRemoved(child.get());
 225 recursiveNodeWillBeRemoved(child.get(), subframeNodeRemoval);
207226 }
208227}
209228

Source/WebCore/page/scrolling/ScrollingStateTree.h

@@private:
8181
8282 void setRootStateNode(PassRefPtr<ScrollingStateFrameScrollingNode> rootStateNode) { m_rootStateNode = rootStateNode; }
8383 void addNode(ScrollingStateNode*);
84  void removeNodeAndAllDescendants(ScrollingStateNode*);
8584
86  void recursiveNodeWillBeRemoved(ScrollingStateNode* currNode);
 85 enum SubframeNodeRemoval {
 86 DeleteSubframeNodes,
 87 OrphanSubframeNodes
 88 };
 89 void removeNodeAndAllDescendants(ScrollingStateNode*, SubframeNodeRemoval = DeleteSubframeNodes);
 90
 91 void recursiveNodeWillBeRemoved(ScrollingStateNode* currNode, SubframeNodeRemoval);
8792 void willRemoveNode(ScrollingStateNode*);
8893
8994 AsyncScrollingCoordinator* m_scrollingCoordinator;
9095 StateNodeMap m_stateNodeMap;
9196 RefPtr<ScrollingStateFrameScrollingNode> m_rootStateNode;
9297 HashSet<ScrollingNodeID> m_nodesRemovedSinceLastCommit;
 98 HashMap<ScrollingNodeID, RefPtr<ScrollingStateNode>> m_orphanedSubframeNodes;
9399 bool m_hasChangedProperties;
94100 bool m_hasNewRootStateNode;
95101 LayerRepresentation::Type m_preferredLayerRepresentation;

Source/WebCore/page/scrolling/ScrollingTree.cpp

@@void ScrollingTree::commitNewTreeState(PassOwnPtr<ScrollingStateTree> scrollingS
149149 bool scrollRequestIsProgammatic = rootNode ? rootNode->requestedScrollPositionRepresentsProgrammaticScroll() : false;
150150 TemporaryChange<bool> changeHandlingProgrammaticScroll(m_isHandlingProgrammaticScroll, scrollRequestIsProgammatic);
151151
152  {
153  OrphanScrollingNodeMap orphanNodes;
154  updateTreeFromStateNode(rootNode, orphanNodes);
155  }
156 
157152 removeDestroyedNodes(*scrollingStateTree);
 153
 154 OrphanScrollingNodeMap orphanNodes;
 155 updateTreeFromStateNode(rootNode, orphanNodes);
158156}
159157
160158void ScrollingTree::updateTreeFromStateNode(const ScrollingStateNode* stateNode, OrphanScrollingNodeMap& orphanNodes)

@@void ScrollingTree::updateTreeFromStateNode(const ScrollingStateNode* stateNode,
216214
217215void ScrollingTree::removeDestroyedNodes(const ScrollingStateTree& stateTree)
218216{
219  for (const auto& removedNode : stateTree.removedNodes()) {
220  ScrollingTreeNode* node = m_nodeMap.take(removedNode);
221  if (!node)
222  continue;
223 
224  if (node->scrollingNodeID() == m_latchedNode)
 217 for (const auto& removedNodeID : stateTree.removedNodes()) {
 218 m_nodeMap.remove(removedNodeID);
 219 if (removedNodeID == m_latchedNode)
225220 clearLatchedNode();
226 
227  // We should have unparented this node already via updateTreeFromStateNode().
228  ASSERT(!node->parent());
229221 }
230222}
231223

Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp

@@bool ArgumentCoder<ScrollingStateStickyNode>::decode(ArgumentDecoder& decoder, S
317317
318318namespace WebKit {
319319
320 static void encodeNodeAndDescendants(IPC::ArgumentEncoder& encoder, const ScrollingStateNode& stateNode)
 320static void encodeNodeAndDescendants(IPC::ArgumentEncoder& encoder, const ScrollingStateNode& stateNode, int& encodedNodeCount)
321321{
 322 ++encodedNodeCount;
 323
322324 switch (stateNode.nodeType()) {
323325 case FrameScrollingNode:
324326 encoder << toScrollingStateFrameScrollingNode(stateNode);

@@static void encodeNodeAndDescendants(IPC::ArgumentEncoder& encoder, const Scroll
338340 return;
339341
340342 for (const auto& child : *stateNode.children())
341  encodeNodeAndDescendants(encoder, *child.get());
 343 encodeNodeAndDescendants(encoder, *child.get(), encodedNodeCount);
342344}
343345
344346void RemoteScrollingCoordinatorTransaction::encode(IPC::ArgumentEncoder& encoder) const

@@void RemoteScrollingCoordinatorTransaction::encode(IPC::ArgumentEncoder& encoder
352354 if (m_scrollingStateTree) {
353355 encoder << m_scrollingStateTree->hasChangedProperties();
354356
 357 int numNodesEncoded = 0;
355358 if (const ScrollingStateNode* rootNode = m_scrollingStateTree->rootStateNode())
356  encodeNodeAndDescendants(encoder, *rootNode);
 359 encodeNodeAndDescendants(encoder, *rootNode, numNodesEncoded);
357360
 361 ASSERT_UNUSED(numNodesEncoded, numNodesEncoded == numNodes);
358362 encoder << m_scrollingStateTree->removedNodes();
359363 } else
360364 encoder << Vector<ScrollingNodeID>();

LayoutTests/ChangeLog

 12014-06-19 Simon Fraser <simon.fraser@apple.com>
 2
 3 [iOS WebKit2] Make -webkit-overflow-scrolling:touch work in iframes (breaks MSWord previews)
 4 https://bugs.webkit.org/show_bug.cgi?id=134085
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Tests that add and remove a fixed container of a scroll-coordinated iframe.
 9
 10 * platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-expected.txt:
 11 * platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-gain-scrolling-ancestor-expected.txt: Added.
 12 * platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-gain-scrolling-ancestor.html: Added.
 13 * platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-in-fixed-expected.txt:
 14 * platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-lose-scrolling-ancestor-expected.txt: Added.
 15 * platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-lose-scrolling-ancestor.html: Added.
 16 * platform/mac-wk2/tiled-drawing/scrolling/frames/remove-coordinated-frame-expected.txt: Added.
 17 * platform/mac-wk2/tiled-drawing/scrolling/frames/remove-coordinated-frame.html: Added.
 18 * platform/mac-wk2/tiled-drawing/scrolling/frames/resources/doc-with-sticky.html:
 19
1202014-06-18 Benjamin Poulain <benjamin@webkit.org>
221
322 Subtrees with :first-child and :last-child are not invalidated when siblings are added/removed

LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-expected.txt

44 (children 1
55 (Frame scrolling node
66 (scrollable area size 485 300)
7  (contents size 485 1868)
 7 (contents size 485 420)
88 (children 1
99 (Sticky node
10  (anchor edges: AnchorEdgeTop )
 10 (anchor edges: AnchorEdgeTop AnchorEdgeBottom)
1111 (top offset 10.00)
12  (containing block rect 8.00, 10.00 469.00 x 1850.00)
13  (sticky box rect 8.00 830.00 100.00 100.00)
 12 (bottom offset 10.00)
 13 (containing block rect 8.00, 8.00 469.00 x 404.00)
 14 (sticky box rect 8.00 312.00 100.00 100.00)
1415 (constraining rect 0.00 0.00 485.00 300.00)
15  (sticky offset at last layout 0.00 0.00)
16  (layer position at last layout 8.00 830.00)
 16 (sticky offset at last layout 0.00 -122.00)
 17 (layer position at last layout 8.00 190.00)
1718 )
1819 )
1920 )

LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-gain-scrolling-ancestor-expected.txt

 1(Frame scrolling node
 2 (scrollable area size 785 600)
 3 (contents size 785 1016)
 4 (children 1
 5 (Fixed node
 6 (anchor edges: AnchorEdgeLeft AnchorEdgeTop)
 7 (viewport rect at last layout: 0.00 0.00 785.00 600.00)
 8 (layer position at last layout 8.00 10.00)
 9 (children 1
 10 (Frame scrolling node
 11 (scrollable area size 500 300)
 12 (contents size 500 420)
 13 (children 1
 14 (Sticky node
 15 (anchor edges: AnchorEdgeTop AnchorEdgeBottom)
 16 (top offset 10.00)
 17 (bottom offset 10.00)
 18 (containing block rect 8.00, 8.00 484.00 x 404.00)
 19 (sticky box rect 8.00 312.00 100.00 100.00)
 20 (constraining rect 0.00 0.00 500.00 300.00)
 21 (sticky offset at last layout 0.00 -122.00)
 22 (layer position at last layout 8.00 190.00)
 23 )
 24 )
 25 )
 26 )
 27 )
 28 )
 29)
 30

LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-gain-scrolling-ancestor.html

 1<!DOCTYPE html>
 2<html>
 3<head>
 4 <style>
 5 body {
 6 height: 1000px;
 7 }
 8
 9 iframe {
 10 display: block;
 11 margin: 10px;
 12 border: 5px solid black;
 13 }
 14
 15 #container {
 16 position: absolute;
 17 top: 10px;
 18 border: 4px solid green;
 19 padding: 10px;
 20 }
 21
 22 #container.fixed {
 23 position: fixed;
 24 top: 10px;
 25 border: 4px solid orange;
 26 }
 27
 28 #tree {
 29 position: absolute;
 30 top: 375px;
 31 }
 32 </style>
 33 <script>
 34 if (window.testRunner) {
 35 testRunner.waitUntilDone();
 36 testRunner.dumpAsText();
 37 window.internals.settings.setScrollingTreeIncludesFrames(true);
 38 }
 39
 40 function startTest()
 41 {
 42 window.setTimeout(function() {
 43 document.getElementById('container').classList.toggle('fixed');
 44
 45 if (window.internals)
 46 document.getElementById('tree').innerText = internals.scrollingStateTreeAsText();
 47
 48 if (window.testRunner)
 49 testRunner.notifyDone();
 50
 51 }, 0);
 52 }
 53
 54 window.addEventListener('load', startTest, false);
 55 </script>
 56</head>
 57<body>
 58
 59 <div id="container">
 60 <iframe src="resources/doc-with-sticky.html" scrolling="no" width="500" height="300"></iframe>
 61 </div>
 62<pre id="tree">Scrolling tree goes here</pre>
 63</body>
 64</html>

LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-in-fixed-expected.txt

99 (children 1
1010 (Frame scrolling node
1111 (scrollable area size 485 300)
12  (contents size 485 1868)
 12 (contents size 485 420)
1313 (children 1
1414 (Sticky node
15  (anchor edges: AnchorEdgeTop )
 15 (anchor edges: AnchorEdgeTop AnchorEdgeBottom)
1616 (top offset 10.00)
17  (containing block rect 8.00, 10.00 469.00 x 1850.00)
18  (sticky box rect 8.00 830.00 100.00 100.00)
 17 (bottom offset 10.00)
 18 (containing block rect 8.00, 8.00 469.00 x 404.00)
 19 (sticky box rect 8.00 312.00 100.00 100.00)
1920 (constraining rect 0.00 0.00 485.00 300.00)
20  (sticky offset at last layout 0.00 0.00)
21  (layer position at last layout 8.00 830.00)
 21 (sticky offset at last layout 0.00 -122.00)
 22 (layer position at last layout 8.00 190.00)
2223 )
2324 )
2425 )

LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-lose-scrolling-ancestor-expected.txt

 1(Frame scrolling node
 2 (scrollable area size 785 600)
 3 (contents size 785 1016)
 4 (children 1
 5 (Frame scrolling node
 6 (scrollable area size 500 300)
 7 (contents size 500 420)
 8 (children 1
 9 (Sticky node
 10 (anchor edges: AnchorEdgeTop AnchorEdgeBottom)
 11 (top offset 10.00)
 12 (bottom offset 10.00)
 13 (containing block rect 8.00, 8.00 484.00 x 404.00)
 14 (sticky box rect 8.00 312.00 100.00 100.00)
 15 (constraining rect 0.00 0.00 500.00 300.00)
 16 (sticky offset at last layout 0.00 -122.00)
 17 (layer position at last layout 8.00 190.00)
 18 )
 19 )
 20 )
 21 )
 22)
 23

LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-lose-scrolling-ancestor.html

 1<!DOCTYPE html>
 2<html>
 3<head>
 4 <style>
 5 body {
 6 height: 1000px;
 7 }
 8
 9 iframe {
 10 display: block;
 11 margin: 10px;
 12 border: 5px solid black;
 13 }
 14
 15 #container {
 16 position: absolute;
 17 top: 10px;
 18 border: 4px solid green;
 19 padding: 10px;
 20 }
 21
 22 #container.fixed {
 23 position: fixed;
 24 top: 10px;
 25 border: 4px solid orange;
 26 }
 27
 28 #tree {
 29 position: absolute;
 30 top: 375px;
 31 }
 32 </style>
 33 <script>
 34 if (window.testRunner) {
 35 testRunner.waitUntilDone();
 36 testRunner.dumpAsText();
 37 window.internals.settings.setScrollingTreeIncludesFrames(true);
 38 }
 39
 40 function startTest()
 41 {
 42 window.setTimeout(function() {
 43 document.getElementById('container').classList.toggle('fixed');
 44
 45 if (window.internals)
 46 document.getElementById('tree').innerText = internals.scrollingStateTreeAsText();
 47
 48 if (window.testRunner)
 49 testRunner.notifyDone();
 50
 51 }, 0);
 52 }
 53
 54 window.addEventListener('load', startTest, false);
 55 </script>
 56</head>
 57<body>
 58
 59 <div id="container" class="fixed">
 60 <iframe src="resources/doc-with-sticky.html" scrolling="no" width="500" height="300"></iframe>
 61 </div>
 62<pre id="tree">Scrolling tree goes here</pre>
 63</body>
 64</html>

LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/remove-coordinated-frame-expected.txt

 1(Frame scrolling node
 2 (scrollable area size 785 600)
 3 (contents size 785 1016)
 4 (children 1
 5 (Fixed node
 6 (anchor edges: AnchorEdgeLeft AnchorEdgeTop)
 7 (viewport rect at last layout: 0.00 0.00 785.00 600.00)
 8 (layer position at last layout 8.00 10.00)
 9 (children 0
 10 )
 11 )
 12 )
 13)
 14

LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/remove-coordinated-frame.html

 1<!DOCTYPE html>
 2<html>
 3<head>
 4 <style>
 5 body {
 6 height: 1000px;
 7 }
 8
 9 iframe {
 10 display: block;
 11 margin: 10px;
 12 border: 5px solid black;
 13 }
 14
 15 #container {
 16 position: absolute;
 17 top: 10px;
 18 border: 4px solid green;
 19 padding: 10px;
 20 }
 21
 22 #container.fixed {
 23 position: fixed;
 24 top: 10px;
 25 border: 4px solid orange;
 26 }
 27
 28 #tree {
 29 position: absolute;
 30 top: 375px;
 31 }
 32 </style>
 33 <script>
 34 if (window.testRunner) {
 35 testRunner.waitUntilDone();
 36 testRunner.dumpAsText();
 37 window.internals.settings.setScrollingTreeIncludesFrames(true);
 38 }
 39
 40 function startTest()
 41 {
 42 window.setTimeout(function() {
 43 var iframe = document.getElementById('iframe');
 44 iframe.remove();
 45
 46 if (window.internals)
 47 document.getElementById('tree').innerText = internals.scrollingStateTreeAsText();
 48
 49 if (window.testRunner)
 50 testRunner.notifyDone();
 51
 52 }, 0);
 53 }
 54
 55 window.addEventListener('load', startTest, false);
 56 </script>
 57</head>
 58<body>
 59
 60 <div id="container" class="fixed">
 61 <iframe id="iframe" src="resources/doc-with-sticky.html" scrolling="no" width="500" height="300"></iframe>
 62 </div>
 63<pre id="tree">Scrolling tree goes here</pre>
 64</body>
 65</html>

LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/resources/doc-with-sticky.html

99 background-color: blue;
1010 }
1111
 12 .scrolling {
 13 height: 300px;
 14 width: 400px;
 15 overflow: scroll;
 16 -webkit-overflow-scrolling: touch;
 17 border: 2px solid black;
 18 }
 19
1220 .spacer {
1321 height: 400px;
1422 margin: 10px;

1725 .sticky {
1826 position: -webkit-sticky;
1927 top: 10px;
 28 bottom: 10px;
2029 }
2130
2231 .composited {

2534 </style>
2635</head>
2736<body>
28  <div class="spacer"></div>
29  <div class="spacer"></div>
 37 <div class="composited scrolling">
 38 <div class="spacer"></div>
 39 <div class="spacer"></div>
 40 <div class="sticky box"></div>
 41 <div class="spacer"></div>
 42 <div class="spacer"></div>
 43 </div>
3044 <div class="sticky box"></div>
31  <div class="spacer"></div>
32  <div class="spacer"></div>
33  <div class="composited box"></div>
 45
3446</body>
3547</html>