- a/Source/WebCore/ChangeLog +16 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2018-12-08  Commit Queue  <commit-queue@webkit.org>
2
3
        Unreviewed, rolling out r239010.
4
        https://bugs.webkit.org/show_bug.cgi?id=192537
5
6
        Breaks fast/visual-viewport/tiled-drawing/zoomed-fixed-
7
        scrolling-layers-state.html again (Requested by ap on
8
        #webkit).
9
10
        Reverted changeset:
11
12
        "Allow control over child order when adding nodes to the
13
        scrolling tree"
14
        https://bugs.webkit.org/show_bug.cgi?id=176914
15
        https://trac.webkit.org/changeset/239010
16
1
2018-12-08  Eric Carlson  <eric.carlson@apple.com>
17
2018-12-08  Eric Carlson  <eric.carlson@apple.com>
2
18
3
        [MediaStream] Scaled video frames should be resized in letterbox mode
19
        [MediaStream] Scaled video frames should be resized in letterbox mode
- a/Source/WebKit/ChangeLog +16 lines
Lines 1-3 a/Source/WebKit/ChangeLog_sec1
1
2018-12-08  Commit Queue  <commit-queue@webkit.org>
2
3
        Unreviewed, rolling out r239010.
4
        https://bugs.webkit.org/show_bug.cgi?id=192537
5
6
        Breaks fast/visual-viewport/tiled-drawing/zoomed-fixed-
7
        scrolling-layers-state.html again (Requested by ap on
8
        #webkit).
9
10
        Reverted changeset:
11
12
        "Allow control over child order when adding nodes to the
13
        scrolling tree"
14
        https://bugs.webkit.org/show_bug.cgi?id=176914
15
        https://trac.webkit.org/changeset/239010
16
1
2018-12-08  Alex Christensen  <achristensen@webkit.org>
17
2018-12-08  Alex Christensen  <achristensen@webkit.org>
2
18
3
        Don't programmatically capitalize safe browsing warning buttons
19
        Don't programmatically capitalize safe browsing warning buttons
- a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp -4 / +3 lines
Lines 474-483 void AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange(Scrollable a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp_sec1
474
        scrollableArea.horizontalScrollbarLayerDidChange();
474
        scrollableArea.horizontalScrollbarLayerDidChange();
475
}
475
}
476
476
477
ScrollingNodeID AsyncScrollingCoordinator::attachToStateTree(ScrollingNodeType nodeType, ScrollingNodeID newNodeID, ScrollingNodeID parentID, size_t childIndex)
477
ScrollingNodeID AsyncScrollingCoordinator::attachToStateTree(ScrollingNodeType nodeType, ScrollingNodeID newNodeID, ScrollingNodeID parentID)
478
{
478
{
479
    LOG_WITH_STREAM(Scrolling, stream << "AsyncScrollingCoordinator::attachToStateTree " << nodeType << " node " << newNodeID << " parent " << parentID << " index " << childIndex);
479
    return m_scrollingStateTree->attachNode(nodeType, newNodeID, parentID);
480
    return m_scrollingStateTree->attachNode(nodeType, newNodeID, parentID, childIndex);
481
}
480
}
482
481
483
void AsyncScrollingCoordinator::detachFromStateTree(ScrollingNodeID nodeID)
482
void AsyncScrollingCoordinator::detachFromStateTree(ScrollingNodeID nodeID)
Lines 510-516 void AsyncScrollingCoordinator::ensureRootStateNodeForFrameView(FrameView& frame a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp_sec2
510
    // For non-main frames, it is only possible to arrive in this function from
509
    // For non-main frames, it is only possible to arrive in this function from
511
    // RenderLayerCompositor::updateBacking where the node has already been created.
510
    // RenderLayerCompositor::updateBacking where the node has already been created.
512
    ASSERT(frameView.frame().isMainFrame());
511
    ASSERT(frameView.frame().isMainFrame());
513
    attachToStateTree(MainFrameScrollingNode, frameView.scrollLayerID(), 0, 0);
512
    attachToStateTree(MainFrameScrollingNode, frameView.scrollLayerID(), 0);
514
}
513
}
515
514
516
void AsyncScrollingCoordinator::updateFrameScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer, GraphicsLayer* insetClipLayer, const ScrollingGeometry& scrollingGeometry)
515
void AsyncScrollingCoordinator::updateFrameScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer, GraphicsLayer* insetClipLayer, const ScrollingGeometry& scrollingGeometry)
- a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h -1 / +1 lines
Lines 97-103 private: a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h_sec1
97
97
98
    WEBCORE_EXPORT bool requestScrollPositionUpdate(FrameView&, const IntPoint&) override;
98
    WEBCORE_EXPORT bool requestScrollPositionUpdate(FrameView&, const IntPoint&) override;
99
99
100
    WEBCORE_EXPORT ScrollingNodeID attachToStateTree(ScrollingNodeType, ScrollingNodeID newNodeID, ScrollingNodeID parentID, size_t childIndex) override;
100
    WEBCORE_EXPORT ScrollingNodeID attachToStateTree(ScrollingNodeType, ScrollingNodeID newNodeID, ScrollingNodeID parentID) override;
101
    WEBCORE_EXPORT void detachFromStateTree(ScrollingNodeID) override;
101
    WEBCORE_EXPORT void detachFromStateTree(ScrollingNodeID) override;
102
    WEBCORE_EXPORT void clearStateTree() override;
102
    WEBCORE_EXPORT void clearStateTree() override;
103
    
103
    
- a/Source/WebCore/page/scrolling/ScrollingCoordinator.h -2 / +1 lines
Lines 164-171 public: a/Source/WebCore/page/scrolling/ScrollingCoordinator.h_sec1
164
    virtual void commitTreeStateIfNeeded() { }
164
    virtual void commitTreeStateIfNeeded() { }
165
    virtual bool requestScrollPositionUpdate(FrameView&, const IntPoint&) { return false; }
165
    virtual bool requestScrollPositionUpdate(FrameView&, const IntPoint&) { return false; }
166
    virtual bool handleWheelEvent(FrameView&, const PlatformWheelEvent&) { return true; }
166
    virtual bool handleWheelEvent(FrameView&, const PlatformWheelEvent&) { return true; }
167
    virtual ScrollingNodeID attachToStateTree(ScrollingNodeType, ScrollingNodeID newNodeID, ScrollingNodeID /*parentID*/, size_t /*childIndex*/ = notFound) { return newNodeID; }
167
    virtual ScrollingNodeID attachToStateTree(ScrollingNodeType, ScrollingNodeID newNodeID, ScrollingNodeID /*parentID*/) { return newNodeID; }
168
169
    virtual void detachFromStateTree(ScrollingNodeID) { }
168
    virtual void detachFromStateTree(ScrollingNodeID) { }
170
    virtual void clearStateTree() { }
169
    virtual void clearStateTree() { }
171
170
- a/Source/WebCore/page/scrolling/ScrollingStateNode.cpp -20 lines
Lines 97-122 void ScrollingStateNode::appendChild(Ref<ScrollingStateNode>&& childNode) a/Source/WebCore/page/scrolling/ScrollingStateNode.cpp_sec1
97
    m_children->append(WTFMove(childNode));
97
    m_children->append(WTFMove(childNode));
98
}
98
}
99
99
100
void ScrollingStateNode::insertChild(Ref<ScrollingStateNode>&& childNode, size_t index)
101
{
102
    childNode->setParent(this);
103
104
    if (!m_children) {
105
        ASSERT(!index);
106
        m_children = std::make_unique<Vector<RefPtr<ScrollingStateNode>>>();
107
    }
108
109
    m_children->insert(index, WTFMove(childNode));
110
}
111
112
size_t ScrollingStateNode::indexOfChild(ScrollingStateNode& childNode) const
113
{
114
    if (!m_children)
115
        return notFound;
116
117
    return m_children->find(&childNode);
118
}
119
120
void ScrollingStateNode::reconcileLayerPositionForViewportRect(const LayoutRect& viewportRect, ScrollingLayerPositionAction action)
100
void ScrollingStateNode::reconcileLayerPositionForViewportRect(const LayoutRect& viewportRect, ScrollingLayerPositionAction action)
121
{
101
{
122
    if (!m_children)
102
    if (!m_children)
- a/Source/WebCore/page/scrolling/ScrollingStateNode.h -3 lines
Lines 236-244 public: a/Source/WebCore/page/scrolling/ScrollingStateNode.h_sec1
236
    Vector<RefPtr<ScrollingStateNode>>* children() const { return m_children.get(); }
236
    Vector<RefPtr<ScrollingStateNode>>* children() const { return m_children.get(); }
237
237
238
    void appendChild(Ref<ScrollingStateNode>&&);
238
    void appendChild(Ref<ScrollingStateNode>&&);
239
    void insertChild(Ref<ScrollingStateNode>&&, size_t index);
240
241
    size_t indexOfChild(ScrollingStateNode&) const;
242
239
243
    String scrollingStateTreeAsText(ScrollingStateTreeAsTextBehavior = ScrollingStateTreeAsTextBehaviorNormal) const;
240
    String scrollingStateTreeAsText(ScrollingStateTreeAsTextBehavior = ScrollingStateTreeAsTextBehaviorNormal) const;
244
241
- a/Source/WebCore/page/scrolling/ScrollingStateTree.cpp -35 / +12 lines
Lines 82-120 Ref<ScrollingStateNode> ScrollingStateTree::createNode(ScrollingNodeType nodeTyp a/Source/WebCore/page/scrolling/ScrollingStateTree.cpp_sec1
82
    return ScrollingStateFixedNode::create(*this, nodeID);
82
    return ScrollingStateFixedNode::create(*this, nodeID);
83
}
83
}
84
84
85
bool ScrollingStateTree::nodeTypeAndParentMatch(ScrollingStateNode& node, ScrollingNodeType nodeType, ScrollingStateNode* parentNode) const
85
bool ScrollingStateTree::nodeTypeAndParentMatch(ScrollingStateNode& node, ScrollingNodeType nodeType, ScrollingNodeID parentID) const
86
{
86
{
87
    if (node.nodeType() != nodeType)
87
    if (node.nodeType() != nodeType)
88
        return false;
88
        return false;
89
89
90
    return node.parent() == parentNode;
90
    auto* parent = stateNodeForID(parentID);
91
    if (!parent)
92
        return true;
93
94
    return node.parent() == parent;
91
}
95
}
92
96
93
ScrollingNodeID ScrollingStateTree::attachNode(ScrollingNodeType nodeType, ScrollingNodeID newNodeID, ScrollingNodeID parentID, size_t childIndex)
97
ScrollingNodeID ScrollingStateTree::attachNode(ScrollingNodeType nodeType, ScrollingNodeID newNodeID, ScrollingNodeID parentID)
94
{
98
{
95
    ASSERT(newNodeID);
99
    ASSERT(newNodeID);
96
100
97
    if (auto* node = stateNodeForID(newNodeID)) {
101
    if (auto* node = stateNodeForID(newNodeID)) {
98
        auto* parent = stateNodeForID(parentID);
102
        if (nodeTypeAndParentMatch(*node, nodeType, parentID))
99
        if (nodeTypeAndParentMatch(*node, nodeType, parent)) {
100
            if (!parentID)
101
                return newNodeID;
102
103
            size_t currentIndex = parent->indexOfChild(*node);
104
            if (currentIndex == childIndex)
105
                return newNodeID;
106
107
            ASSERT(currentIndex != notFound);
108
            Ref<ScrollingStateNode> protectedNode(*node);
109
            parent->children()->remove(currentIndex);
110
111
            if (childIndex == notFound)
112
                parent->appendChild(WTFMove(protectedNode));
113
            else
114
                parent->insertChild(WTFMove(protectedNode), childIndex);
115
116
            return newNodeID;
103
            return newNodeID;
117
        }
118
104
119
#if ENABLE(ASYNC_SCROLLING)
105
#if ENABLE(ASYNC_SCROLLING)
120
        // If the type has changed, we need to destroy and recreate the node with a new ID.
106
        // If the type has changed, we need to destroy and recreate the node with a new ID.
Lines 128-134 ScrollingNodeID ScrollingStateTree::attachNode(ScrollingNodeType nodeType, Scrol a/Source/WebCore/page/scrolling/ScrollingStateTree.cpp_sec2
128
114
129
    ScrollingStateNode* newNode = nullptr;
115
    ScrollingStateNode* newNode = nullptr;
130
    if (!parentID) {
116
    if (!parentID) {
131
        ASSERT(!childIndex || childIndex == notFound);
132
        // If we're resetting the root node, we should clear the HashMap and destroy the current children.
117
        // If we're resetting the root node, we should clear the HashMap and destroy the current children.
133
        clear();
118
        clear();
134
119
Lines 137-168 ScrollingNodeID ScrollingStateTree::attachNode(ScrollingNodeType nodeType, Scrol a/Source/WebCore/page/scrolling/ScrollingStateTree.cpp_sec3
137
        m_hasNewRootStateNode = true;
122
        m_hasNewRootStateNode = true;
138
    } else {
123
    } else {
139
        auto* parent = stateNodeForID(parentID);
124
        auto* parent = stateNodeForID(parentID);
140
        if (!parent) {
125
        if (!parent)
141
            ASSERT_NOT_REACHED();
142
            return 0;
126
            return 0;
143
        }
144
127
145
        if (nodeType == SubframeScrollingNode && parentID) {
128
        if (nodeType == SubframeScrollingNode && parentID) {
146
            if (auto orphanedNode = m_orphanedSubframeNodes.take(newNodeID)) {
129
            if (auto orphanedNode = m_orphanedSubframeNodes.take(newNodeID)) {
147
                newNode = orphanedNode.get();
130
                newNode = orphanedNode.get();
148
                if (childIndex == notFound)
131
                parent->appendChild(orphanedNode.releaseNonNull());
149
                    parent->appendChild(orphanedNode.releaseNonNull());
150
                else
151
                    parent->insertChild(orphanedNode.releaseNonNull(), childIndex);
152
            }
132
            }
153
        }
133
        }
154
134
155
        if (!newNode) {
135
        if (!newNode) {
156
            auto stateNode = createNode(nodeType, newNodeID);
136
            auto stateNode = createNode(nodeType, newNodeID);
157
            newNode = stateNode.ptr();
137
            newNode = stateNode.ptr();
158
            if (childIndex == notFound)
138
            parent->appendChild(WTFMove(stateNode));
159
                parent->appendChild(WTFMove(stateNode));
160
            else
161
                parent->insertChild(WTFMove(stateNode), childIndex);
162
        }
139
        }
163
    }
140
    }
164
141
165
    addNode(*newNode);
142
    m_stateNodeMap.set(newNodeID, newNode);
166
    m_nodesRemovedSinceLastCommit.remove(newNodeID);
143
    m_nodesRemovedSinceLastCommit.remove(newNodeID);
167
    return newNodeID;
144
    return newNodeID;
168
}
145
}
- a/Source/WebCore/page/scrolling/ScrollingStateTree.h -2 / +2 lines
Lines 51-57 public: a/Source/WebCore/page/scrolling/ScrollingStateTree.h_sec1
51
    ScrollingStateFrameScrollingNode* rootStateNode() const { return m_rootStateNode.get(); }
51
    ScrollingStateFrameScrollingNode* rootStateNode() const { return m_rootStateNode.get(); }
52
    WEBCORE_EXPORT ScrollingStateNode* stateNodeForID(ScrollingNodeID) const;
52
    WEBCORE_EXPORT ScrollingStateNode* stateNodeForID(ScrollingNodeID) const;
53
53
54
    WEBCORE_EXPORT ScrollingNodeID attachNode(ScrollingNodeType, ScrollingNodeID, ScrollingNodeID parentID, size_t childIndex);
54
    WEBCORE_EXPORT ScrollingNodeID attachNode(ScrollingNodeType, ScrollingNodeID, ScrollingNodeID parentID);
55
    void detachNode(ScrollingNodeID);
55
    void detachNode(ScrollingNodeID);
56
    void clear();
56
    void clear();
57
    
57
    
Lines 81-87 private: a/Source/WebCore/page/scrolling/ScrollingStateTree.h_sec2
81
81
82
    Ref<ScrollingStateNode> createNode(ScrollingNodeType, ScrollingNodeID);
82
    Ref<ScrollingStateNode> createNode(ScrollingNodeType, ScrollingNodeID);
83
83
84
    bool nodeTypeAndParentMatch(ScrollingStateNode&, ScrollingNodeType, ScrollingStateNode* parentNode) const;
84
    bool nodeTypeAndParentMatch(ScrollingStateNode&, ScrollingNodeType, ScrollingNodeID parentID) const;
85
85
86
    enum class SubframeNodeRemoval { Delete, Orphan };
86
    enum class SubframeNodeRemoval { Delete, Orphan };
87
    void removeNodeAndAllDescendants(ScrollingStateNode*, SubframeNodeRemoval = SubframeNodeRemoval::Delete);
87
    void removeNodeAndAllDescendants(ScrollingStateNode*, SubframeNodeRemoval = SubframeNodeRemoval::Delete);
- a/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp -1 / +1 lines
Lines 413-419 bool RemoteScrollingCoordinatorTransaction::decode(IPC::Decoder& decoder) a/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp_sec1
413
        if (!decoder.decode(parentNodeID))
413
        if (!decoder.decode(parentNodeID))
414
            return false;
414
            return false;
415
415
416
        m_scrollingStateTree->attachNode(nodeType, nodeID, parentNodeID, notFound); // Append new node.
416
        m_scrollingStateTree->attachNode(nodeType, nodeID, parentNodeID);
417
        ScrollingStateNode* newNode = m_scrollingStateTree->stateNodeForID(nodeID);
417
        ScrollingStateNode* newNode = m_scrollingStateTree->stateNodeForID(nodeID);
418
        ASSERT(newNode);
418
        ASSERT(newNode);
419
        ASSERT(!parentNodeID || newNode->parent());
419
        ASSERT(!parentNodeID || newNode->parent());
- a/LayoutTests/ChangeLog +16 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2018-12-08  Commit Queue  <commit-queue@webkit.org>
2
3
        Unreviewed, rolling out r239010.
4
        https://bugs.webkit.org/show_bug.cgi?id=192537
5
6
        Breaks fast/visual-viewport/tiled-drawing/zoomed-fixed-
7
        scrolling-layers-state.html again (Requested by ap on
8
        #webkit).
9
10
        Reverted changeset:
11
12
        "Allow control over child order when adding nodes to the
13
        scrolling tree"
14
        https://bugs.webkit.org/show_bug.cgi?id=176914
15
        https://trac.webkit.org/changeset/239010
16
1
2018-12-08  Eric Carlson  <eric.carlson@apple.com>
17
2018-12-08  Eric Carlson  <eric.carlson@apple.com>
2
18
3
        [MediaStream] Scaled video frames should be resized in letterbox mode
19
        [MediaStream] Scaled video frames should be resized in letterbox mode
- a/LayoutTests/platform/mac-wk2/TestExpectations -2 lines
Lines 321-328 webkit.org/b/167321 tiled-drawing/scrolling/scroll-snap/scroll-snap-proximity-ma a/LayoutTests/platform/mac-wk2/TestExpectations_sec1
321
321
322
webkit.org/b/148408 tiled-drawing/scrolling/root-overflow-with-mousewheel.html [ Pass Failure Timeout ]
322
webkit.org/b/148408 tiled-drawing/scrolling/root-overflow-with-mousewheel.html [ Pass Failure Timeout ]
323
323
324
webkit.org/b/192529 fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolling-layers-state.html [ Pass Failure ]
325
326
webkit.org/b/139820 fast/frames/lots-of-objects.html [ Pass Timeout ]
324
webkit.org/b/139820 fast/frames/lots-of-objects.html [ Pass Timeout ]
327
webkit.org/b/139820 fast/frames/lots-of-iframes.html [ Pass Timeout ]
325
webkit.org/b/139820 fast/frames/lots-of-iframes.html [ Pass Timeout ]
328
326

Return to Bug 192537