| Differences between
and this patch
- a/Source/WebCore/ChangeLog +40 lines
Lines 1-5 a/Source/WebCore/ChangeLog_sec1
1
2014-06-19  Simon Fraser  <simon.fraser@apple.com>
1
2014-06-19  Simon Fraser  <simon.fraser@apple.com>
2
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
        <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
41
2014-06-19  Simon Fraser  <simon.fraser@apple.com>
42
3
        Handle scrolling tree modifications which remove intermediate nodes
43
        Handle scrolling tree modifications which remove intermediate nodes
4
        https://bugs.webkit.org/show_bug.cgi?id=134082
44
        https://bugs.webkit.org/show_bug.cgi?id=134082
5
45
- a/Source/WebKit2/ChangeLog +15 lines
Lines 1-5 a/Source/WebKit2/ChangeLog_sec1
1
2014-06-19  Simon Fraser  <simon.fraser@apple.com>
1
2014-06-19  Simon Fraser  <simon.fraser@apple.com>
2
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
        <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
16
2014-06-19  Simon Fraser  <simon.fraser@apple.com>
17
3
        Handle scrolling tree modifications which remove intermediate nodes
18
        Handle scrolling tree modifications which remove intermediate nodes
4
        https://bugs.webkit.org/show_bug.cgi?id=134082
19
        https://bugs.webkit.org/show_bug.cgi?id=134082
5
20
- a/Source/WebCore/page/scrolling/ScrollingStateNode.cpp -2 / +2 lines
Lines 41-47 ScrollingStateNode::ScrollingStateNode(ScrollingNodeType nodeType, ScrollingStat a/Source/WebCore/page/scrolling/ScrollingStateNode.cpp_sec1
41
    , m_nodeID(nodeID)
41
    , m_nodeID(nodeID)
42
    , m_changedProperties(0)
42
    , m_changedProperties(0)
43
    , m_scrollingStateTree(scrollingStateTree)
43
    , m_scrollingStateTree(scrollingStateTree)
44
    , m_parent(0)
44
    , m_parent(nullptr)
45
{
45
{
46
}
46
}
47
47
Lines 52-58 ScrollingStateNode::ScrollingStateNode(const ScrollingStateNode& stateNode, Scro a/Source/WebCore/page/scrolling/ScrollingStateNode.cpp_sec2
52
    , m_nodeID(stateNode.scrollingNodeID())
52
    , m_nodeID(stateNode.scrollingNodeID())
53
    , m_changedProperties(stateNode.changedProperties())
53
    , m_changedProperties(stateNode.changedProperties())
54
    , m_scrollingStateTree(adoptiveTree)
54
    , m_scrollingStateTree(adoptiveTree)
55
    , m_parent(0)
55
    , m_parent(nullptr)
56
{
56
{
57
    if (hasChangedProperty(ScrollLayer))
57
    if (hasChangedProperty(ScrollLayer))
58
        setLayer(stateNode.layer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
58
        setLayer(stateNode.layer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
- a/Source/WebCore/page/scrolling/ScrollingStateTree.cpp -34 / +53 lines
Lines 82-88 ScrollingNodeID ScrollingStateTree::attachNode(ScrollingNodeType nodeType, Scrol a/Source/WebCore/page/scrolling/ScrollingStateTree.cpp_sec1
82
            return newNodeID;
82
            return newNodeID;
83
83
84
        // The node is being re-parented. To do that, we'll remove it, and then re-create a new node.
84
        // 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);
86
    }
86
    }
87
87
88
    ScrollingStateNode* newNode = nullptr;
88
    ScrollingStateNode* newNode = nullptr;
Lines 98-128 ScrollingNodeID ScrollingStateTree::attachNode(ScrollingNodeType nodeType, Scrol a/Source/WebCore/page/scrolling/ScrollingStateTree.cpp_sec2
98
        if (!parent)
98
        if (!parent)
99
            return 0;
99
            return 0;
100
100
101
        switch (nodeType) {
101
        if (nodeType == FrameScrollingNode && parentID) {
102
        case FixedNode: {
102
            if (RefPtr<ScrollingStateNode> orphanedNode = m_orphanedSubframeNodes.take(newNodeID)) {
103
            RefPtr<ScrollingStateFixedNode> fixedNode = ScrollingStateFixedNode::create(*this, newNodeID);
103
                newNode = orphanedNode.get();
104
            newNode = fixedNode.get();
104
                parent->appendChild(orphanedNode.release());
105
            parent->appendChild(fixedNode.release());
105
            }
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;
125
        }
106
        }
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
            }
126
        }
135
        }
127
    }
136
    }
128
137
Lines 141-158 void ScrollingStateTree::detachNode(ScrollingNodeID nodeID) a/Source/WebCore/page/scrolling/ScrollingStateTree.cpp_sec3
141
    if (!node)
150
    if (!node)
142
        return;
151
        return;
143
152
144
    removeNodeAndAllDescendants(node);
153
    removeNodeAndAllDescendants(node, OrphanSubframeNodes);
145
}
154
}
146
155
147
void ScrollingStateTree::clear()
156
void ScrollingStateTree::clear()
148
{
157
{
149
    removeNodeAndAllDescendants(rootStateNode());
158
    if (rootStateNode())
159
        removeNodeAndAllDescendants(rootStateNode());
160
150
    ASSERT(m_stateNodeMap.isEmpty());
161
    ASSERT(m_stateNodeMap.isEmpty());
151
    m_stateNodeMap.clear();
162
    m_stateNodeMap.clear();
163
    m_orphanedSubframeNodes.clear();
152
}
164
}
153
165
154
PassOwnPtr<ScrollingStateTree> ScrollingStateTree::commit(LayerRepresentation::Type preferredLayerRepresentation)
166
PassOwnPtr<ScrollingStateTree> ScrollingStateTree::commit(LayerRepresentation::Type preferredLayerRepresentation)
155
{
167
{
168
    m_orphanedSubframeNodes.clear();
169
156
    // This function clones and resets the current state tree, but leaves the tree structure intact.
170
    // This function clones and resets the current state tree, but leaves the tree structure intact.
157
    OwnPtr<ScrollingStateTree> treeStateClone = ScrollingStateTree::create();
171
    OwnPtr<ScrollingStateTree> treeStateClone = ScrollingStateTree::create();
158
    treeStateClone->setPreferredLayerRepresentation(preferredLayerRepresentation);
172
    treeStateClone->setPreferredLayerRepresentation(preferredLayerRepresentation);
Lines 178-193 void ScrollingStateTree::addNode(ScrollingStateNode* node) a/Source/WebCore/page/scrolling/ScrollingStateTree.cpp_sec4
178
    m_stateNodeMap.add(node->scrollingNodeID(), node);
192
    m_stateNodeMap.add(node->scrollingNodeID(), node);
179
}
193
}
180
194
181
void ScrollingStateTree::removeNodeAndAllDescendants(ScrollingStateNode* node)
195
void ScrollingStateTree::removeNodeAndAllDescendants(ScrollingStateNode* node, SubframeNodeRemoval subframeNodeRemoval)
182
{
196
{
183
    if (!node)
197
    ScrollingStateNode* parent = node->parent();
184
        return;
185
198
186
    recursiveNodeWillBeRemoved(node);
199
    recursiveNodeWillBeRemoved(node, subframeNodeRemoval);
187
200
188
    if (node == m_rootStateNode)
201
    if (node == m_rootStateNode)
189
        m_rootStateNode = nullptr;
202
        m_rootStateNode = nullptr;
190
    else if (ScrollingStateNode* parent = node->parent()) {
203
    else if (parent) {
191
        ASSERT(parent->children() && parent->children()->find(node) != notFound);
204
        ASSERT(parent->children() && parent->children()->find(node) != notFound);
192
        if (auto children = parent->children()) {
205
        if (auto children = parent->children()) {
193
            size_t index = children->find(node);
206
            size_t index = children->find(node);
Lines 197-209 void ScrollingStateTree::removeNodeAndAllDescendants(ScrollingStateNode* node) a/Source/WebCore/page/scrolling/ScrollingStateTree.cpp_sec5
197
    }
210
    }
198
}
211
}
199
212
200
void ScrollingStateTree::recursiveNodeWillBeRemoved(ScrollingStateNode* currNode)
213
void ScrollingStateTree::recursiveNodeWillBeRemoved(ScrollingStateNode* currNode, SubframeNodeRemoval subframeNodeRemoval)
201
{
214
{
215
    currNode->setParent(nullptr);
216
    if (subframeNodeRemoval == OrphanSubframeNodes && currNode != m_rootStateNode && currNode->isFrameScrollingNode()) {
217
        m_orphanedSubframeNodes.add(currNode->scrollingNodeID(), currNode);
218
        return;
219
    }
220
202
    willRemoveNode(currNode);
221
    willRemoveNode(currNode);
203
222
204
    if (auto children = currNode->children()) {
223
    if (auto children = currNode->children()) {
205
        for (auto& child : *children)
224
        for (auto& child : *children)
206
            recursiveNodeWillBeRemoved(child.get());
225
            recursiveNodeWillBeRemoved(child.get(), subframeNodeRemoval);
207
    }
226
    }
208
}
227
}
209
228
- a/Source/WebCore/page/scrolling/ScrollingStateTree.h -2 / +8 lines
Lines 81-95 private: a/Source/WebCore/page/scrolling/ScrollingStateTree.h_sec1
81
81
82
    void setRootStateNode(PassRefPtr<ScrollingStateFrameScrollingNode> rootStateNode) { m_rootStateNode = rootStateNode; }
82
    void setRootStateNode(PassRefPtr<ScrollingStateFrameScrollingNode> rootStateNode) { m_rootStateNode = rootStateNode; }
83
    void addNode(ScrollingStateNode*);
83
    void addNode(ScrollingStateNode*);
84
    void removeNodeAndAllDescendants(ScrollingStateNode*);
85
84
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);
87
    void willRemoveNode(ScrollingStateNode*);
92
    void willRemoveNode(ScrollingStateNode*);
88
93
89
    AsyncScrollingCoordinator* m_scrollingCoordinator;
94
    AsyncScrollingCoordinator* m_scrollingCoordinator;
90
    StateNodeMap m_stateNodeMap;
95
    StateNodeMap m_stateNodeMap;
91
    RefPtr<ScrollingStateFrameScrollingNode> m_rootStateNode;
96
    RefPtr<ScrollingStateFrameScrollingNode> m_rootStateNode;
92
    HashSet<ScrollingNodeID> m_nodesRemovedSinceLastCommit;
97
    HashSet<ScrollingNodeID> m_nodesRemovedSinceLastCommit;
98
    HashMap<ScrollingNodeID, RefPtr<ScrollingStateNode>> m_orphanedSubframeNodes;
93
    bool m_hasChangedProperties;
99
    bool m_hasChangedProperties;
94
    bool m_hasNewRootStateNode;
100
    bool m_hasNewRootStateNode;
95
    LayerRepresentation::Type m_preferredLayerRepresentation;
101
    LayerRepresentation::Type m_preferredLayerRepresentation;
- a/Source/WebCore/page/scrolling/ScrollingTree.cpp -14 / +6 lines
Lines 149-160 void ScrollingTree::commitNewTreeState(PassOwnPtr<ScrollingStateTree> scrollingS a/Source/WebCore/page/scrolling/ScrollingTree.cpp_sec1
149
    bool scrollRequestIsProgammatic = rootNode ? rootNode->requestedScrollPositionRepresentsProgrammaticScroll() : false;
149
    bool scrollRequestIsProgammatic = rootNode ? rootNode->requestedScrollPositionRepresentsProgrammaticScroll() : false;
150
    TemporaryChange<bool> changeHandlingProgrammaticScroll(m_isHandlingProgrammaticScroll, scrollRequestIsProgammatic);
150
    TemporaryChange<bool> changeHandlingProgrammaticScroll(m_isHandlingProgrammaticScroll, scrollRequestIsProgammatic);
151
151
152
    {
153
        OrphanScrollingNodeMap orphanNodes;
154
        updateTreeFromStateNode(rootNode, orphanNodes);
155
    }
156
157
    removeDestroyedNodes(*scrollingStateTree);
152
    removeDestroyedNodes(*scrollingStateTree);
153
154
    OrphanScrollingNodeMap orphanNodes;
155
    updateTreeFromStateNode(rootNode, orphanNodes);
158
}
156
}
159
157
160
void ScrollingTree::updateTreeFromStateNode(const ScrollingStateNode* stateNode, OrphanScrollingNodeMap& orphanNodes)
158
void ScrollingTree::updateTreeFromStateNode(const ScrollingStateNode* stateNode, OrphanScrollingNodeMap& orphanNodes)
Lines 216-231 void ScrollingTree::updateTreeFromStateNode(const ScrollingStateNode* stateNode, a/Source/WebCore/page/scrolling/ScrollingTree.cpp_sec2
216
214
217
void ScrollingTree::removeDestroyedNodes(const ScrollingStateTree& stateTree)
215
void ScrollingTree::removeDestroyedNodes(const ScrollingStateTree& stateTree)
218
{
216
{
219
    for (const auto& removedNode : stateTree.removedNodes()) {
217
    for (const auto& removedNodeID : stateTree.removedNodes()) {
220
        ScrollingTreeNode* node = m_nodeMap.take(removedNode);
218
        m_nodeMap.remove(removedNodeID);
221
        if (!node)
219
        if (removedNodeID == m_latchedNode)
222
            continue;
223
224
        if (node->scrollingNodeID() == m_latchedNode)
225
            clearLatchedNode();
220
            clearLatchedNode();
226
227
        // We should have unparented this node already via updateTreeFromStateNode().
228
        ASSERT(!node->parent());
229
    }
221
    }
230
}
222
}
231
223
- a/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp -3 / +7 lines
Lines 317-324 bool ArgumentCoder<ScrollingStateStickyNode>::decode(ArgumentDecoder& decoder, S a/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp_sec1
317
317
318
namespace WebKit {
318
namespace WebKit {
319
319
320
static void encodeNodeAndDescendants(IPC::ArgumentEncoder& encoder, const ScrollingStateNode& stateNode)
320
static void encodeNodeAndDescendants(IPC::ArgumentEncoder& encoder, const ScrollingStateNode& stateNode, int& encodedNodeCount)
321
{
321
{
322
    ++encodedNodeCount;
323
322
    switch (stateNode.nodeType()) {
324
    switch (stateNode.nodeType()) {
323
    case FrameScrollingNode:
325
    case FrameScrollingNode:
324
        encoder << toScrollingStateFrameScrollingNode(stateNode);
326
        encoder << toScrollingStateFrameScrollingNode(stateNode);
Lines 338-344 static void encodeNodeAndDescendants(IPC::ArgumentEncoder& encoder, const Scroll a/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp_sec2
338
        return;
340
        return;
339
341
340
    for (const auto& child : *stateNode.children())
342
    for (const auto& child : *stateNode.children())
341
        encodeNodeAndDescendants(encoder, *child.get());
343
        encodeNodeAndDescendants(encoder, *child.get(), encodedNodeCount);
342
}
344
}
343
345
344
void RemoteScrollingCoordinatorTransaction::encode(IPC::ArgumentEncoder& encoder) const
346
void RemoteScrollingCoordinatorTransaction::encode(IPC::ArgumentEncoder& encoder) const
Lines 352-360 void RemoteScrollingCoordinatorTransaction::encode(IPC::ArgumentEncoder& encoder a/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp_sec3
352
    if (m_scrollingStateTree) {
354
    if (m_scrollingStateTree) {
353
        encoder << m_scrollingStateTree->hasChangedProperties();
355
        encoder << m_scrollingStateTree->hasChangedProperties();
354
356
357
        int numNodesEncoded = 0;
355
        if (const ScrollingStateNode* rootNode = m_scrollingStateTree->rootStateNode())
358
        if (const ScrollingStateNode* rootNode = m_scrollingStateTree->rootStateNode())
356
            encodeNodeAndDescendants(encoder, *rootNode);
359
            encodeNodeAndDescendants(encoder, *rootNode, numNodesEncoded);
357
360
361
        ASSERT_UNUSED(numNodesEncoded, numNodesEncoded == numNodes);
358
        encoder << m_scrollingStateTree->removedNodes();
362
        encoder << m_scrollingStateTree->removedNodes();
359
    } else
363
    } else
360
        encoder << Vector<ScrollingNodeID>();
364
        encoder << Vector<ScrollingNodeID>();
- a/LayoutTests/ChangeLog +19 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2014-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
1
2014-06-18  Benjamin Poulain  <benjamin@webkit.org>
20
2014-06-18  Benjamin Poulain  <benjamin@webkit.org>
2
21
3
        Subtrees with :first-child and :last-child are not invalidated when siblings are added/removed
22
        Subtrees with :first-child and :last-child are not invalidated when siblings are added/removed
- a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-expected.txt -6 / +7 lines
Lines 4-19 a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-expected.txt_sec1
4
  (children 1
4
  (children 1
5
    (Frame scrolling node
5
    (Frame scrolling node
6
      (scrollable area size 485 300)
6
      (scrollable area size 485 300)
7
      (contents size 485 1868)
7
      (contents size 485 420)
8
      (children 1
8
      (children 1
9
        (Sticky node
9
        (Sticky node
10
          (anchor edges: AnchorEdgeTop )
10
          (anchor edges: AnchorEdgeTop AnchorEdgeBottom)
11
          (top offset 10.00)
11
          (top offset 10.00)
12
          (containing block rect 8.00, 10.00 469.00 x 1850.00)
12
          (bottom offset 10.00)
13
          (sticky box rect 8.00 830.00 100.00 100.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)
14
          (constraining rect 0.00 0.00 485.00 300.00)
15
          (constraining rect 0.00 0.00 485.00 300.00)
15
          (sticky offset at last layout 0.00 0.00)
16
          (sticky offset at last layout 0.00 -122.00)
16
          (layer position at last layout 8.00 830.00)
17
          (layer position at last layout 8.00 190.00)
17
        )
18
        )
18
      )
19
      )
19
    )
20
    )
- a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-gain-scrolling-ancestor-expected.txt +30 lines
Line 0 a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-gain-scrolling-ancestor-expected.txt_sec1
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
- a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-gain-scrolling-ancestor.html +64 lines
Line 0 a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-gain-scrolling-ancestor.html_sec1
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>
- a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-in-fixed-expected.txt -6 / +7 lines
Lines 9-24 a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-in-fixed-expected.txt_sec1
9
      (children 1
9
      (children 1
10
        (Frame scrolling node
10
        (Frame scrolling node
11
          (scrollable area size 485 300)
11
          (scrollable area size 485 300)
12
          (contents size 485 1868)
12
          (contents size 485 420)
13
          (children 1
13
          (children 1
14
            (Sticky node
14
            (Sticky node
15
              (anchor edges: AnchorEdgeTop )
15
              (anchor edges: AnchorEdgeTop AnchorEdgeBottom)
16
              (top offset 10.00)
16
              (top offset 10.00)
17
              (containing block rect 8.00, 10.00 469.00 x 1850.00)
17
              (bottom offset 10.00)
18
              (sticky box rect 8.00 830.00 100.00 100.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)
19
              (constraining rect 0.00 0.00 485.00 300.00)
20
              (constraining rect 0.00 0.00 485.00 300.00)
20
              (sticky offset at last layout 0.00 0.00)
21
              (sticky offset at last layout 0.00 -122.00)
21
              (layer position at last layout 8.00 830.00)
22
              (layer position at last layout 8.00 190.00)
22
            )
23
            )
23
          )
24
          )
24
        )
25
        )
- a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-lose-scrolling-ancestor-expected.txt +23 lines
Line 0 a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-lose-scrolling-ancestor-expected.txt_sec1
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
- a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-lose-scrolling-ancestor.html +64 lines
Line 0 a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/coordinated-frame-lose-scrolling-ancestor.html_sec1
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>
- a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/remove-coordinated-frame-expected.txt +14 lines
Line 0 a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/remove-coordinated-frame-expected.txt_sec1
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
- a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/remove-coordinated-frame.html +65 lines
Line 0 a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/remove-coordinated-frame.html_sec1
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>
- a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/resources/doc-with-sticky.html -5 / +17 lines
Lines 9-14 a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/resources/doc-with-sticky.html_sec1
9
            background-color: blue;
9
            background-color: blue;
10
        }
10
        }
11
        
11
        
12
        .scrolling {
13
            height: 300px;
14
            width: 400px;
15
            overflow: scroll;
16
            -webkit-overflow-scrolling: touch;
17
            border: 2px solid black;
18
        }
19
        
12
        .spacer {
20
        .spacer {
13
            height: 400px;
21
            height: 400px;
14
            margin: 10px;
22
            margin: 10px;
Lines 17-22 a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/resources/doc-with-sticky.html_sec2
17
        .sticky {
25
        .sticky {
18
            position: -webkit-sticky;
26
            position: -webkit-sticky;
19
            top: 10px;
27
            top: 10px;
28
            bottom: 10px;
20
        }
29
        }
21
        
30
        
22
        .composited {
31
        .composited {
Lines 25-35 a/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/resources/doc-with-sticky.html_sec3
25
    </style>
34
    </style>
26
</head>
35
</head>
27
<body>
36
<body>
28
    <div class="spacer"></div>
37
    <div class="composited scrolling">
29
    <div class="spacer"></div>
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>
30
    <div class="sticky box"></div>
44
    <div class="sticky box"></div>
31
    <div class="spacer"></div>
45
32
    <div class="spacer"></div>
33
    <div class="composited box"></div>
34
</body>
46
</body>
35
</html>
47
</html>

Return to Bug 134085