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