- a/Source/WebCore/ChangeLog +59 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2018-02-06  Frederic Wang  <fwang@igalia.com>
2
3
        Add scrolling node types to distinguish main frames and subframes.
4
        https://bugs.webkit.org/show_bug.cgi?id=182533
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        This patch splits FrameScrollingNode type into two types: MainFrameScrollingNode and
9
        SubframeScrollingNode. This is needed because new places in the code are likely to
10
        distinguish them e.g. in ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll
11
        or when iOS frame scrolling is introduced (see bug 173833).
12
13
        No new tests, behavior unchanged.
14
15
        * page/scrolling/AsyncScrollingCoordinator.cpp:
16
        (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView): This is only called
17
        for main frames, so pass MainFrameScrollingNode.
18
        * page/scrolling/ScrollingCoordinator.cpp:
19
        (WebCore::operator<<): Distinguish subframe and main frame when dumping.
20
        * page/scrolling/ScrollingCoordinator.h: Split FrameScrollingNode into two cases.
21
        * page/scrolling/ScrollingStateFrameScrollingNode.cpp: Add node type to constructor and
22
        ASSERT it remains of type FrameScrollingNode.
23
        (WebCore::ScrollingStateFrameScrollingNode::create):
24
        (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
25
        * page/scrolling/ScrollingStateFrameScrollingNode.h: Add node type to constructor.
26
        * page/scrolling/ScrollingStateNode.h:
27
        (WebCore::ScrollingStateNode::isFrameScrollingNode const): Includes the two cases.
28
        * page/scrolling/ScrollingStateTree.cpp:
29
        (WebCore::ScrollingStateTree::createNode): Split FrameScrollingNode into two cases and pass
30
        the node type.
31
        (WebCore::ScrollingStateTree::attachNode): The first case only happens for main frames while
32
        the second case only happens with subframes. Use the appriate node type.
33
        * page/scrolling/ScrollingTreeFrameScrollingNode.cpp: Add node type to constructor and
34
        ASSERT it remains of type FrameScrollingNode.
35
        (WebCore::ScrollingTreeFrameScrollingNode::ScrollingTreeFrameScrollingNode):
36
        * page/scrolling/ScrollingTreeFrameScrollingNode.h: Add node type to constructor.
37
        * page/scrolling/ScrollingTreeNode.h: Includes the two cases.
38
        (WebCore::ScrollingTreeNode::isFrameScrollingNode const):
39
        * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h: Add node type to constructor.
40
        * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm: Ditto.
41
        (WebCore::ScrollingTreeFrameScrollingNodeIOS::create):
42
        (WebCore::ScrollingTreeFrameScrollingNodeIOS::ScrollingTreeFrameScrollingNodeIOS):
43
        * page/scrolling/ios/ScrollingTreeIOS.cpp: Split FrameScrollingNode into two cases.
44
        (WebCore::ScrollingTreeIOS::createScrollingTreeNode):
45
        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: Add node type to constructor.
46
        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: Ditto.
47
        (WebCore::ScrollingTreeFrameScrollingNodeMac::create):
48
        (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac):
49
        * page/scrolling/mac/ScrollingTreeMac.cpp: Split FrameScrollingNode into two cases.
50
        (ScrollingTreeMac::createScrollingTreeNode):
51
        * rendering/RenderLayerCompositor.cpp:
52
        (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers): Distinguish the cases of
53
        main frames and subframes.
54
        (WebCore::scrollCoordinationRoleForNodeType): Split FrameScrollingNode into two cases.
55
        (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame): Distinguish the cases
56
        of main frames and subframes.
57
        (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): Split FrameScrollingNode into
58
        two cases.
59
1
2018-02-06  Ms2ger  <Ms2ger@igalia.com>
60
2018-02-06  Ms2ger  <Ms2ger@igalia.com>
2
61
3
        Initialize ImageBitmap::m_bitmapData in the constructor.
62
        Initialize ImageBitmap::m_bitmapData in the constructor.
- a/Source/WebKit/ChangeLog +25 lines
Lines 1-3 a/Source/WebKit/ChangeLog_sec1
1
2018-02-06  Frederic Wang  <fwang@igalia.com>
2
3
        Add scrolling node types to distinguish main frames and subframes.
4
        https://bugs.webkit.org/show_bug.cgi?id=182533
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: Replace the case of
9
        FrameScrollingNode with MainFrameScrollingNode and SubframeScrollingNode.
10
        (WebKit::encodeNodeAndDescendants):
11
        (WebKit::RemoteScrollingCoordinatorTransaction::decode):
12
        (WebKit::dump):
13
        * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp: Ditto.
14
        (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
15
        * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp: Ditto and pass the node type to the
16
        constructor of the frame scrolling node.
17
        (WebKit::RemoteScrollingTree::createScrollingTreeNode):
18
        * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm: Replace the case of
19
        FrameScrollingNode with MainFrameScrollingNode and SubframeScrollingNode.
20
        (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
21
        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: In order to
22
        determine whether the node is a main frame or subframe, use the node type instead of checking
23
        whether the node as a parent.
24
        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll):
25
1
2018-02-06  Michael Catanzaro  <mcatanzaro@igalia.com>
26
2018-02-06  Michael Catanzaro  <mcatanzaro@igalia.com>
2
27
3
        Unreviewed, fix format specifiers added in r228116
28
        Unreviewed, fix format specifiers added in r228116
- a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp -1 / +1 lines
Lines 505-511 void AsyncScrollingCoordinator::ensureRootStateNodeForFrameView(FrameView& frame a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp_sec1
505
    // For non-main frames, it is only possible to arrive in this function from
505
    // For non-main frames, it is only possible to arrive in this function from
506
    // RenderLayerCompositor::updateBacking where the node has already been created.
506
    // RenderLayerCompositor::updateBacking where the node has already been created.
507
    ASSERT(frameView.frame().isMainFrame());
507
    ASSERT(frameView.frame().isMainFrame());
508
    attachToStateTree(FrameScrollingNode, frameView.scrollLayerID(), 0);
508
    attachToStateTree(MainFrameScrollingNode, frameView.scrollLayerID(), 0);
509
}
509
}
510
510
511
void AsyncScrollingCoordinator::updateFrameScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer, GraphicsLayer* insetClipLayer, const ScrollingGeometry* scrollingGeometry)
511
void AsyncScrollingCoordinator::updateFrameScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer, GraphicsLayer* insetClipLayer, const ScrollingGeometry* scrollingGeometry)
- a/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp -2 / +5 lines
Lines 425-432 TextStream& operator<<(TextStream& ts, ScrollableAreaParameters scrollableAreaPa a/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp_sec1
425
TextStream& operator<<(TextStream& ts, ScrollingNodeType nodeType)
425
TextStream& operator<<(TextStream& ts, ScrollingNodeType nodeType)
426
{
426
{
427
    switch (nodeType) {
427
    switch (nodeType) {
428
    case FrameScrollingNode:
428
    case MainFrameScrollingNode:
429
        ts << "frame-scrolling";
429
        ts << "main-frame-scrolling";
430
        break;
431
    case SubframeScrollingNode:
432
        ts << "subframe-scrolling";
430
        break;
433
        break;
431
    case OverflowScrollingNode:
434
    case OverflowScrollingNode:
432
        ts << "overflow-scrolling";
435
        ts << "overflow-scrolling";
- a/Source/WebCore/page/scrolling/ScrollingCoordinator.h -1 / +1 lines
Lines 54-60 namespace WebCore { a/Source/WebCore/page/scrolling/ScrollingCoordinator.h_sec1
54
typedef unsigned SynchronousScrollingReasons;
54
typedef unsigned SynchronousScrollingReasons;
55
typedef uint64_t ScrollingNodeID;
55
typedef uint64_t ScrollingNodeID;
56
56
57
enum ScrollingNodeType { FrameScrollingNode, OverflowScrollingNode, FixedNode, StickyNode };
57
enum ScrollingNodeType { MainFrameScrollingNode, SubframeScrollingNode, OverflowScrollingNode, FixedNode, StickyNode };
58
58
59
enum ScrollingStateTreeAsTextBehaviorFlags {
59
enum ScrollingStateTreeAsTextBehaviorFlags {
60
    ScrollingStateTreeAsTextBehaviorNormal                  = 0,
60
    ScrollingStateTreeAsTextBehaviorNormal                  = 0,
- a/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp -4 / +5 lines
Lines 33-46 a/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp_sec1
33
33
34
namespace WebCore {
34
namespace WebCore {
35
35
36
Ref<ScrollingStateFrameScrollingNode> ScrollingStateFrameScrollingNode::create(ScrollingStateTree& stateTree, ScrollingNodeID nodeID)
36
Ref<ScrollingStateFrameScrollingNode> ScrollingStateFrameScrollingNode::create(ScrollingStateTree& stateTree, ScrollingNodeType nodeType, ScrollingNodeID nodeID)
37
{
37
{
38
    return adoptRef(*new ScrollingStateFrameScrollingNode(stateTree, nodeID));
38
    return adoptRef(*new ScrollingStateFrameScrollingNode(stateTree, nodeType, nodeID));
39
}
39
}
40
40
41
ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode(ScrollingStateTree& stateTree, ScrollingNodeID nodeID)
41
ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode(ScrollingStateTree& stateTree, ScrollingNodeType nodeType, ScrollingNodeID nodeID)
42
    : ScrollingStateScrollingNode(stateTree, FrameScrollingNode, nodeID)
42
    : ScrollingStateScrollingNode(stateTree, nodeType, nodeID)
43
{
43
{
44
    ASSERT(isFrameScrollingNode());
44
}
45
}
45
46
46
ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode(const ScrollingStateFrameScrollingNode& stateNode, ScrollingStateTree& adoptiveTree)
47
ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode(const ScrollingStateFrameScrollingNode& stateNode, ScrollingStateTree& adoptiveTree)
- a/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h -2 / +2 lines
Lines 39-45 class Scrollbar; a/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h_sec1
39
39
40
class ScrollingStateFrameScrollingNode final : public ScrollingStateScrollingNode {
40
class ScrollingStateFrameScrollingNode final : public ScrollingStateScrollingNode {
41
public:
41
public:
42
    static Ref<ScrollingStateFrameScrollingNode> create(ScrollingStateTree&, ScrollingNodeID);
42
    static Ref<ScrollingStateFrameScrollingNode> create(ScrollingStateTree&, ScrollingNodeType, ScrollingNodeID);
43
43
44
    Ref<ScrollingStateNode> clone(ScrollingStateTree&) override;
44
    Ref<ScrollingStateNode> clone(ScrollingStateTree&) override;
45
45
Lines 134-140 public: a/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h_sec2
134
    void dumpProperties(WTF::TextStream&, ScrollingStateTreeAsTextBehavior) const override;
134
    void dumpProperties(WTF::TextStream&, ScrollingStateTreeAsTextBehavior) const override;
135
135
136
private:
136
private:
137
    ScrollingStateFrameScrollingNode(ScrollingStateTree&, ScrollingNodeID);
137
    ScrollingStateFrameScrollingNode(ScrollingStateTree&, ScrollingNodeType, ScrollingNodeID);
138
    ScrollingStateFrameScrollingNode(const ScrollingStateFrameScrollingNode&, ScrollingStateTree&);
138
    ScrollingStateFrameScrollingNode(const ScrollingStateFrameScrollingNode&, ScrollingStateTree&);
139
139
140
    LayerRepresentation m_counterScrollingLayer;
140
    LayerRepresentation m_counterScrollingLayer;
- a/Source/WebCore/page/scrolling/ScrollingStateNode.h -1 / +1 lines
Lines 197-203 public: a/Source/WebCore/page/scrolling/ScrollingStateNode.h_sec1
197
    bool isFixedNode() const { return m_nodeType == FixedNode; }
197
    bool isFixedNode() const { return m_nodeType == FixedNode; }
198
    bool isStickyNode() const { return m_nodeType == StickyNode; }
198
    bool isStickyNode() const { return m_nodeType == StickyNode; }
199
    bool isScrollingNode() const { return isFrameScrollingNode() || isOverflowScrollingNode(); }
199
    bool isScrollingNode() const { return isFrameScrollingNode() || isOverflowScrollingNode(); }
200
    bool isFrameScrollingNode() const { return m_nodeType == FrameScrollingNode; }
200
    bool isFrameScrollingNode() const { return m_nodeType == MainFrameScrollingNode || m_nodeType == SubframeScrollingNode; }
201
    bool isOverflowScrollingNode() const { return m_nodeType == OverflowScrollingNode; }
201
    bool isOverflowScrollingNode() const { return m_nodeType == OverflowScrollingNode; }
202
202
203
    virtual Ref<ScrollingStateNode> clone(ScrollingStateTree& adoptiveTree) = 0;
203
    virtual Ref<ScrollingStateNode> clone(ScrollingStateTree& adoptiveTree) = 0;
- a/Source/WebCore/page/scrolling/ScrollingStateTree.cpp -4 / +5 lines
Lines 72-79 Ref<ScrollingStateNode> ScrollingStateTree::createNode(ScrollingNodeType nodeTyp a/Source/WebCore/page/scrolling/ScrollingStateTree.cpp_sec1
72
        return ScrollingStateFixedNode::create(*this, nodeID);
72
        return ScrollingStateFixedNode::create(*this, nodeID);
73
    case StickyNode:
73
    case StickyNode:
74
        return ScrollingStateStickyNode::create(*this, nodeID);
74
        return ScrollingStateStickyNode::create(*this, nodeID);
75
    case FrameScrollingNode:
75
    case MainFrameScrollingNode:
76
        return ScrollingStateFrameScrollingNode::create(*this, nodeID);
76
    case SubframeScrollingNode:
77
        return ScrollingStateFrameScrollingNode::create(*this, nodeType, nodeID);
77
    case OverflowScrollingNode:
78
    case OverflowScrollingNode:
78
        return ScrollingStateOverflowScrollingNode::create(*this, nodeID);
79
        return ScrollingStateOverflowScrollingNode::create(*this, nodeID);
79
    }
80
    }
Lines 116-122 ScrollingNodeID ScrollingStateTree::attachNode(ScrollingNodeType nodeType, Scrol a/Source/WebCore/page/scrolling/ScrollingStateTree.cpp_sec2
116
        // 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.
117
        clear();
118
        clear();
118
119
119
        setRootStateNode(ScrollingStateFrameScrollingNode::create(*this, newNodeID));
120
        setRootStateNode(ScrollingStateFrameScrollingNode::create(*this, MainFrameScrollingNode, newNodeID));
120
        newNode = rootStateNode();
121
        newNode = rootStateNode();
121
        m_hasNewRootStateNode = true;
122
        m_hasNewRootStateNode = true;
122
    } else {
123
    } else {
Lines 124-130 ScrollingNodeID ScrollingStateTree::attachNode(ScrollingNodeType nodeType, Scrol a/Source/WebCore/page/scrolling/ScrollingStateTree.cpp_sec3
124
        if (!parent)
125
        if (!parent)
125
            return 0;
126
            return 0;
126
127
127
        if (nodeType == FrameScrollingNode && parentID) {
128
        if (nodeType == SubframeScrollingNode && parentID) {
128
            if (auto orphanedNode = m_orphanedSubframeNodes.take(newNodeID)) {
129
            if (auto orphanedNode = m_orphanedSubframeNodes.take(newNodeID)) {
129
                newNode = orphanedNode.get();
130
                newNode = orphanedNode.get();
130
                parent->appendChild(orphanedNode.releaseNonNull());
131
                parent->appendChild(orphanedNode.releaseNonNull());
- a/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp -2 / +3 lines
Lines 36-44 a/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp_sec1
36
36
37
namespace WebCore {
37
namespace WebCore {
38
38
39
ScrollingTreeFrameScrollingNode::ScrollingTreeFrameScrollingNode(ScrollingTree& scrollingTree, ScrollingNodeID nodeID)
39
ScrollingTreeFrameScrollingNode::ScrollingTreeFrameScrollingNode(ScrollingTree& scrollingTree, ScrollingNodeType nodeType, ScrollingNodeID nodeID)
40
    : ScrollingTreeScrollingNode(scrollingTree, FrameScrollingNode, nodeID)
40
    : ScrollingTreeScrollingNode(scrollingTree, nodeType, nodeID)
41
{
41
{
42
    ASSERT(isFrameScrollingNode());
42
}
43
}
43
44
44
ScrollingTreeFrameScrollingNode::~ScrollingTreeFrameScrollingNode() = default;
45
ScrollingTreeFrameScrollingNode::~ScrollingTreeFrameScrollingNode() = default;
- a/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.h -1 / +1 lines
Lines 61-67 public: a/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.h_sec1
61
    FloatRect fixedPositionRect() { return FloatRect(lastCommittedScrollPosition(), scrollableAreaSize()); };
61
    FloatRect fixedPositionRect() { return FloatRect(lastCommittedScrollPosition(), scrollableAreaSize()); };
62
62
63
protected:
63
protected:
64
    ScrollingTreeFrameScrollingNode(ScrollingTree&, ScrollingNodeID);
64
    ScrollingTreeFrameScrollingNode(ScrollingTree&, ScrollingNodeType, ScrollingNodeID);
65
65
66
    void scrollBy(const FloatSize&);
66
    void scrollBy(const FloatSize&);
67
    void scrollByWithoutContentEdgeConstraints(const FloatSize&);
67
    void scrollByWithoutContentEdgeConstraints(const FloatSize&);
- a/Source/WebCore/page/scrolling/ScrollingTreeNode.h -1 / +1 lines
Lines 50-56 public: a/Source/WebCore/page/scrolling/ScrollingTreeNode.h_sec1
50
    bool isFixedNode() const { return nodeType() == FixedNode; }
50
    bool isFixedNode() const { return nodeType() == FixedNode; }
51
    bool isStickyNode() const { return nodeType() == StickyNode; }
51
    bool isStickyNode() const { return nodeType() == StickyNode; }
52
    bool isScrollingNode() const { return isFrameScrollingNode() || isOverflowScrollingNode(); }
52
    bool isScrollingNode() const { return isFrameScrollingNode() || isOverflowScrollingNode(); }
53
    bool isFrameScrollingNode() const { return nodeType() == FrameScrollingNode; }
53
    bool isFrameScrollingNode() const { return nodeType() == MainFrameScrollingNode || nodeType() == SubframeScrollingNode; }
54
    bool isOverflowScrollingNode() const { return nodeType() == OverflowScrollingNode; }
54
    bool isOverflowScrollingNode() const { return nodeType() == OverflowScrollingNode; }
55
55
56
    virtual void commitStateBeforeChildren(const ScrollingStateNode&) = 0;
56
    virtual void commitStateBeforeChildren(const ScrollingStateNode&) = 0;
- a/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h -2 / +2 lines
Lines 36-46 namespace WebCore { a/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h_sec1
36
36
37
class ScrollingTreeFrameScrollingNodeIOS : public ScrollingTreeFrameScrollingNode {
37
class ScrollingTreeFrameScrollingNodeIOS : public ScrollingTreeFrameScrollingNode {
38
public:
38
public:
39
    WEBCORE_EXPORT static Ref<ScrollingTreeFrameScrollingNodeIOS> create(ScrollingTree&, ScrollingNodeID);
39
    WEBCORE_EXPORT static Ref<ScrollingTreeFrameScrollingNodeIOS> create(ScrollingTree&, ScrollingNodeType, ScrollingNodeID);
40
    virtual ~ScrollingTreeFrameScrollingNodeIOS();
40
    virtual ~ScrollingTreeFrameScrollingNodeIOS();
41
41
42
protected:
42
protected:
43
    ScrollingTreeFrameScrollingNodeIOS(ScrollingTree&, ScrollingNodeID);
43
    ScrollingTreeFrameScrollingNodeIOS(ScrollingTree&, ScrollingNodeType, ScrollingNodeID);
44
44
45
    // ScrollingTreeNode member functions.
45
    // ScrollingTreeNode member functions.
46
    void commitStateBeforeChildren(const ScrollingStateNode&) override;
46
    void commitStateBeforeChildren(const ScrollingStateNode&) override;
- a/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm -4 / +4 lines
Lines 38-50 a/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm_sec1
38
38
39
namespace WebCore {
39
namespace WebCore {
40
40
41
Ref<ScrollingTreeFrameScrollingNodeIOS> ScrollingTreeFrameScrollingNodeIOS::create(ScrollingTree& scrollingTree, ScrollingNodeID nodeID)
41
Ref<ScrollingTreeFrameScrollingNodeIOS> ScrollingTreeFrameScrollingNodeIOS::create(ScrollingTree& scrollingTree, ScrollingNodeType nodeType, ScrollingNodeID nodeID)
42
{
42
{
43
    return adoptRef(*new ScrollingTreeFrameScrollingNodeIOS(scrollingTree, nodeID));
43
    return adoptRef(*new ScrollingTreeFrameScrollingNodeIOS(scrollingTree, nodeType, nodeID));
44
}
44
}
45
45
46
ScrollingTreeFrameScrollingNodeIOS::ScrollingTreeFrameScrollingNodeIOS(ScrollingTree& scrollingTree, ScrollingNodeID nodeID)
46
ScrollingTreeFrameScrollingNodeIOS::ScrollingTreeFrameScrollingNodeIOS(ScrollingTree& scrollingTree, ScrollingNodeType nodeType, ScrollingNodeID nodeID)
47
    : ScrollingTreeFrameScrollingNode(scrollingTree, nodeID)
47
    : ScrollingTreeFrameScrollingNode(scrollingTree, nodeType, nodeID)
48
{
48
{
49
}
49
}
50
50
- a/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.cpp -2 / +3 lines
Lines 86-93 void ScrollingTreeIOS::scrollingTreeNodeDidScroll(ScrollingNodeID nodeID, const a/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.cpp_sec1
86
Ref<ScrollingTreeNode> ScrollingTreeIOS::createScrollingTreeNode(ScrollingNodeType nodeType, ScrollingNodeID nodeID)
86
Ref<ScrollingTreeNode> ScrollingTreeIOS::createScrollingTreeNode(ScrollingNodeType nodeType, ScrollingNodeID nodeID)
87
{
87
{
88
    switch (nodeType) {
88
    switch (nodeType) {
89
    case FrameScrollingNode:
89
    case MainFrameScrollingNode:
90
        return ScrollingTreeFrameScrollingNodeIOS::create(*this, nodeID);
90
    case SubframeScrollingNode:
91
        return ScrollingTreeFrameScrollingNodeIOS::create(*this, nodeType, nodeID);
91
    case OverflowScrollingNode:
92
    case OverflowScrollingNode:
92
        ASSERT_NOT_REACHED();
93
        ASSERT_NOT_REACHED();
93
        break;
94
        break;
- a/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h -2 / +2 lines
Lines 38-48 namespace WebCore { a/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h_sec1
38
38
39
class ScrollingTreeFrameScrollingNodeMac : public ScrollingTreeFrameScrollingNode, private ScrollControllerClient {
39
class ScrollingTreeFrameScrollingNodeMac : public ScrollingTreeFrameScrollingNode, private ScrollControllerClient {
40
public:
40
public:
41
    WEBCORE_EXPORT static Ref<ScrollingTreeFrameScrollingNode> create(ScrollingTree&, ScrollingNodeID);
41
    WEBCORE_EXPORT static Ref<ScrollingTreeFrameScrollingNode> create(ScrollingTree&, ScrollingNodeType, ScrollingNodeID);
42
    virtual ~ScrollingTreeFrameScrollingNodeMac();
42
    virtual ~ScrollingTreeFrameScrollingNodeMac();
43
43
44
private:
44
private:
45
    ScrollingTreeFrameScrollingNodeMac(ScrollingTree&, ScrollingNodeID);
45
    ScrollingTreeFrameScrollingNodeMac(ScrollingTree&, ScrollingNodeType, ScrollingNodeID);
46
46
47
    void releaseReferencesToScrollerImpsOnTheMainThread();
47
    void releaseReferencesToScrollerImpsOnTheMainThread();
48
48
- a/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm -4 / +4 lines
Lines 48-60 a/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm_sec1
48
48
49
namespace WebCore {
49
namespace WebCore {
50
50
51
Ref<ScrollingTreeFrameScrollingNode> ScrollingTreeFrameScrollingNodeMac::create(ScrollingTree& scrollingTree, ScrollingNodeID nodeID)
51
Ref<ScrollingTreeFrameScrollingNode> ScrollingTreeFrameScrollingNodeMac::create(ScrollingTree& scrollingTree, ScrollingNodeType nodeType, ScrollingNodeID nodeID)
52
{
52
{
53
    return adoptRef(*new ScrollingTreeFrameScrollingNodeMac(scrollingTree, nodeID));
53
    return adoptRef(*new ScrollingTreeFrameScrollingNodeMac(scrollingTree, nodeType, nodeID));
54
}
54
}
55
55
56
ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac(ScrollingTree& scrollingTree, ScrollingNodeID nodeID)
56
ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac(ScrollingTree& scrollingTree, ScrollingNodeType nodeType, ScrollingNodeID nodeID)
57
    : ScrollingTreeFrameScrollingNode(scrollingTree, nodeID)
57
    : ScrollingTreeFrameScrollingNode(scrollingTree, nodeType, nodeID)
58
    , m_scrollController(*this)
58
    , m_scrollController(*this)
59
    , m_verticalScrollerImp(nullptr)
59
    , m_verticalScrollerImp(nullptr)
60
    , m_horizontalScrollerImp(nullptr)
60
    , m_horizontalScrollerImp(nullptr)
- a/Source/WebCore/page/scrolling/mac/ScrollingTreeMac.cpp -2 / +3 lines
Lines 47-54 ScrollingTreeMac::ScrollingTreeMac(AsyncScrollingCoordinator& scrollingCoordinat a/Source/WebCore/page/scrolling/mac/ScrollingTreeMac.cpp_sec1
47
Ref<ScrollingTreeNode> ScrollingTreeMac::createScrollingTreeNode(ScrollingNodeType nodeType, ScrollingNodeID nodeID)
47
Ref<ScrollingTreeNode> ScrollingTreeMac::createScrollingTreeNode(ScrollingNodeType nodeType, ScrollingNodeID nodeID)
48
{
48
{
49
    switch (nodeType) {
49
    switch (nodeType) {
50
    case FrameScrollingNode:
50
    case MainFrameScrollingNode:
51
        return ScrollingTreeFrameScrollingNodeMac::create(*this, nodeID);
51
    case SubframeScrollingNode:
52
        return ScrollingTreeFrameScrollingNodeMac::create(*this, nodeType, nodeID);
52
    case OverflowScrollingNode:
53
    case OverflowScrollingNode:
53
        ASSERT_NOT_REACHED();
54
        ASSERT_NOT_REACHED();
54
        break;
55
        break;
- a/Source/WebCore/rendering/RenderLayerCompositor.cpp -5 / +7 lines
Lines 3675-3688 void RenderLayerCompositor::reattachSubframeScrollLayers() a/Source/WebCore/rendering/RenderLayerCompositor.cpp_sec1
3675
        if (!parentNodeID)
3675
        if (!parentNodeID)
3676
            continue;
3676
            continue;
3677
3677
3678
        scrollingCoordinator->attachToStateTree(FrameScrollingNode, frameScrollingNodeID, parentNodeID);
3678
        scrollingCoordinator->attachToStateTree(child->isMainFrame() ? MainFrameScrollingNode : SubframeScrollingNode, frameScrollingNodeID, parentNodeID);
3679
    }
3679
    }
3680
}
3680
}
3681
3681
3682
static inline LayerScrollCoordinationRole scrollCoordinationRoleForNodeType(ScrollingNodeType nodeType)
3682
static inline LayerScrollCoordinationRole scrollCoordinationRoleForNodeType(ScrollingNodeType nodeType)
3683
{
3683
{
3684
    switch (nodeType) {
3684
    switch (nodeType) {
3685
    case FrameScrollingNode:
3685
    case MainFrameScrollingNode:
3686
    case SubframeScrollingNode:
3686
    case OverflowScrollingNode:
3687
    case OverflowScrollingNode:
3687
        return Scrolling;
3688
        return Scrolling;
3688
    case FixedNode:
3689
    case FixedNode:
Lines 3741-3747 void RenderLayerCompositor::updateScrollCoordinationForThisFrame(ScrollingNodeID a/Source/WebCore/rendering/RenderLayerCompositor.cpp_sec2
3741
    auto* scrollingCoordinator = this->scrollingCoordinator();
3742
    auto* scrollingCoordinator = this->scrollingCoordinator();
3742
    ASSERT(scrollingCoordinator->coordinatesScrollingForFrameView(m_renderView.frameView()));
3743
    ASSERT(scrollingCoordinator->coordinatesScrollingForFrameView(m_renderView.frameView()));
3743
3744
3744
    ScrollingNodeID nodeID = attachScrollingNode(*m_renderView.layer(), FrameScrollingNode, parentNodeID);
3745
    ScrollingNodeID nodeID = attachScrollingNode(*m_renderView.layer(), m_renderView.frame().isMainFrame() ? MainFrameScrollingNode : SubframeScrollingNode, parentNodeID);
3745
    scrollingCoordinator->updateFrameScrollingNode(nodeID, m_scrollLayer.get(), m_rootContentLayer.get(), fixedRootBackgroundLayer(), clipLayer());
3746
    scrollingCoordinator->updateFrameScrollingNode(nodeID, m_scrollLayer.get(), m_rootContentLayer.get(), fixedRootBackgroundLayer(), clipLayer());
3746
}
3747
}
3747
3748
Lines 3775-3781 void RenderLayerCompositor::updateScrollCoordinatedLayer(RenderLayer& layer, Lay a/Source/WebCore/rendering/RenderLayerCompositor.cpp_sec3
3775
    // Always call this even if the backing is already attached because the parent may have changed.
3776
    // Always call this even if the backing is already attached because the parent may have changed.
3776
    // If a node plays both roles, fixed/sticky is always the ancestor node of scrolling.
3777
    // If a node plays both roles, fixed/sticky is always the ancestor node of scrolling.
3777
    if (reasons & ViewportConstrained) {
3778
    if (reasons & ViewportConstrained) {
3778
        ScrollingNodeType nodeType = FrameScrollingNode;
3779
        ScrollingNodeType nodeType = MainFrameScrollingNode;
3779
        if (layer.renderer().isFixedPositioned())
3780
        if (layer.renderer().isFixedPositioned())
3780
            nodeType = FixedNode;
3781
            nodeType = FixedNode;
3781
        else if (layer.renderer().style().position() == StickyPosition)
3782
        else if (layer.renderer().style().position() == StickyPosition)
Lines 3800-3806 void RenderLayerCompositor::updateScrollCoordinatedLayer(RenderLayer& layer, Lay a/Source/WebCore/rendering/RenderLayerCompositor.cpp_sec4
3800
            case StickyNode:
3801
            case StickyNode:
3801
                scrollingCoordinator->updateNodeViewportConstraints(nodeID, computeStickyViewportConstraints(layer));
3802
                scrollingCoordinator->updateNodeViewportConstraints(nodeID, computeStickyViewportConstraints(layer));
3802
                break;
3803
                break;
3803
            case FrameScrollingNode:
3804
            case MainFrameScrollingNode:
3805
            case SubframeScrollingNode:
3804
            case OverflowScrollingNode:
3806
            case OverflowScrollingNode:
3805
                break;
3807
                break;
3806
            }
3808
            }
- a/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp -3 / +6 lines
Lines 334-340 static void encodeNodeAndDescendants(IPC::Encoder& encoder, const ScrollingState a/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp_sec1
334
    ++encodedNodeCount;
334
    ++encodedNodeCount;
335
335
336
    switch (stateNode.nodeType()) {
336
    switch (stateNode.nodeType()) {
337
    case FrameScrollingNode:
337
    case MainFrameScrollingNode:
338
    case SubframeScrollingNode:
338
        encoder << downcast<ScrollingStateFrameScrollingNode>(stateNode);
339
        encoder << downcast<ScrollingStateFrameScrollingNode>(stateNode);
339
        break;
340
        break;
340
    case OverflowScrollingNode:
341
    case OverflowScrollingNode:
Lines 418-424 bool RemoteScrollingCoordinatorTransaction::decode(IPC::Decoder& decoder) a/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp_sec2
418
        ASSERT(!parentNodeID || newNode->parent());
419
        ASSERT(!parentNodeID || newNode->parent());
419
        
420
        
420
        switch (nodeType) {
421
        switch (nodeType) {
421
        case FrameScrollingNode:
422
        case MainFrameScrollingNode:
423
        case SubframeScrollingNode:
422
            if (!decoder.decode(downcast<ScrollingStateFrameScrollingNode>(*newNode)))
424
            if (!decoder.decode(downcast<ScrollingStateFrameScrollingNode>(*newNode)))
423
                return false;
425
                return false;
424
            break;
426
            break;
Lines 561-567 static void dump(TextStream& ts, const ScrollingStateNode& node, bool changedPro a/Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp_sec3
561
        ts.dumpProperty("layer", static_cast<GraphicsLayer::PlatformLayerID>(node.layer()));
563
        ts.dumpProperty("layer", static_cast<GraphicsLayer::PlatformLayerID>(node.layer()));
562
    
564
    
563
    switch (node.nodeType()) {
565
    switch (node.nodeType()) {
564
    case FrameScrollingNode:
566
    case MainFrameScrollingNode:
567
    case SubframeScrollingNode:
565
        dump(ts, downcast<ScrollingStateFrameScrollingNode>(node), changedPropertiesOnly);
568
        dump(ts, downcast<ScrollingStateFrameScrollingNode>(node), changedPropertiesOnly);
566
        break;
569
        break;
567
    case OverflowScrollingNode:
570
    case OverflowScrollingNode:
- a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp -1 / +2 lines
Lines 103-109 void RemoteScrollingCoordinatorProxy::connectStateNodeLayers(ScrollingStateTree& a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp_sec1
103
            currNode->setLayer(layerTreeHost.getLayer(currNode->layer()));
103
            currNode->setLayer(layerTreeHost.getLayer(currNode->layer()));
104
104
105
        switch (currNode->nodeType()) {
105
        switch (currNode->nodeType()) {
106
        case FrameScrollingNode: {
106
        case MainFrameScrollingNode:
107
        case SubframeScrollingNode: {
107
            ScrollingStateFrameScrollingNode& scrollingStateNode = downcast<ScrollingStateFrameScrollingNode>(*currNode);
108
            ScrollingStateFrameScrollingNode& scrollingStateNode = downcast<ScrollingStateFrameScrollingNode>(*currNode);
108
            
109
            
109
            if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer))
110
            if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrolledContentsLayer))
- a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp -3 / +4 lines
Lines 113-123 void RemoteScrollingTree::scrollingTreeNodeRequestsScroll(ScrollingNodeID nodeID a/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp_sec1
113
Ref<ScrollingTreeNode> RemoteScrollingTree::createScrollingTreeNode(ScrollingNodeType nodeType, ScrollingNodeID nodeID)
113
Ref<ScrollingTreeNode> RemoteScrollingTree::createScrollingTreeNode(ScrollingNodeType nodeType, ScrollingNodeID nodeID)
114
{
114
{
115
    switch (nodeType) {
115
    switch (nodeType) {
116
    case FrameScrollingNode:
116
    case MainFrameScrollingNode:
117
    case SubframeScrollingNode:
117
#if PLATFORM(IOS)
118
#if PLATFORM(IOS)
118
        return ScrollingTreeFrameScrollingNodeIOS::create(*this, nodeID);
119
        return ScrollingTreeFrameScrollingNodeIOS::create(*this, nodeType, nodeID);
119
#else
120
#else
120
        return ScrollingTreeFrameScrollingNodeMac::create(*this, nodeID);
121
        return ScrollingTreeFrameScrollingNodeMac::create(*this, nodeType, nodeID);
121
#endif
122
#endif
122
    case OverflowScrollingNode:
123
    case OverflowScrollingNode:
123
#if PLATFORM(IOS)
124
#if PLATFORM(IOS)
- a/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm -1 / +2 lines
Lines 67-73 void RemoteScrollingCoordinatorProxy::connectStateNodeLayers(ScrollingStateTree& a/Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm_sec1
67
                scrollingStateNode.setScrolledContentsLayer(layerRepresentationFromLayerOrView(layerTreeHost.getLayer(scrollingStateNode.scrolledContentsLayer())));
67
                scrollingStateNode.setScrolledContentsLayer(layerRepresentationFromLayerOrView(layerTreeHost.getLayer(scrollingStateNode.scrolledContentsLayer())));
68
            break;
68
            break;
69
        };
69
        };
70
        case FrameScrollingNode: {
70
        case MainFrameScrollingNode:
71
        case SubframeScrollingNode: {
71
            ScrollingStateFrameScrollingNode& scrollingStateNode = downcast<ScrollingStateFrameScrollingNode>(*currNode);
72
            ScrollingStateFrameScrollingNode& scrollingStateNode = downcast<ScrollingStateFrameScrollingNode>(*currNode);
72
            
73
            
73
            if (scrollingStateNode.hasChangedProperty(ScrollingStateNode::ScrollLayer))
74
            if (scrollingStateNode.hasChangedProperty(ScrollingStateNode::ScrollLayer))
- a/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm -1 / +1 lines
Lines 247-253 void ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll(const Fl a/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm_sec1
247
247
248
    FloatRect fixedPositionRect;
248
    FloatRect fixedPositionRect;
249
    auto* frameNode = scrollingNode().enclosingFrameNodeIncludingSelf();
249
    auto* frameNode = scrollingNode().enclosingFrameNodeIncludingSelf();
250
    if (frameNode && frameNode->parent())
250
    if (frameNode && frameNode->nodeType() == SubframeScrollingNode)
251
        fixedPositionRect = frameNode->fixedPositionRect();
251
        fixedPositionRect = frameNode->fixedPositionRect();
252
    else
252
    else
253
        fixedPositionRect = scrollingTree().fixedPositionRect();
253
        fixedPositionRect = scrollingTree().fixedPositionRect();

Return to Bug 182533