<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[269458] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/269458">269458</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2020-11-05 11:52:54 -0800 (Thu, 05 Nov 2020)</dd>
</dl>

<h3>Log Message</h3>
<pre>Clean up ScrollingStateTree setPropertyChangesAfterReattach() code
https://bugs.webkit.org/show_bug.cgi?id=218621

Reviewed by Antti Koivisto.

Replace lots of individual setPropertyChangedInternal() calls with a single call
with an OptionSet<> argument.

The virtual applicableProperties() calls base classes to generate an OptionSet<>
of all the properties for a node type.

* page/scrolling/ScrollingStateFixedNode.cpp:
(WebCore::ScrollingStateFixedNode::applicableProperties const):
(WebCore::ScrollingStateFixedNode::setPropertyChangesAfterReattach): Deleted.
* page/scrolling/ScrollingStateFixedNode.h:
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::applicableProperties const):
(WebCore::ScrollingStateFrameScrollingNode::setPropertyChangesAfterReattach): Deleted.
* page/scrolling/ScrollingStateFrameScrollingNode.h:
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::applicableProperties const):
(WebCore::ScrollingStateNode::setPropertyChangesAfterReattach):
* page/scrolling/ScrollingStateNode.h:
(WebCore::ScrollingStateNode::setPropertiesChangedInternal):
* page/scrolling/ScrollingStateOverflowScrollProxyNode.cpp:
(WebCore::ScrollingStateOverflowScrollProxyNode::applicableProperties const):
(WebCore::ScrollingStateOverflowScrollProxyNode::setPropertyChangesAfterReattach): Deleted.
* page/scrolling/ScrollingStateOverflowScrollProxyNode.h:
* page/scrolling/ScrollingStatePositionedNode.cpp:
(WebCore::ScrollingStatePositionedNode::applicableProperties const):
(WebCore::ScrollingStatePositionedNode::setPropertyChangesAfterReattach): Deleted.
* page/scrolling/ScrollingStatePositionedNode.h:
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::applicableProperties const):
(WebCore::ScrollingStateScrollingNode::setPropertyChangesAfterReattach): Deleted.
* page/scrolling/ScrollingStateScrollingNode.h:
* page/scrolling/ScrollingStateStickyNode.cpp:
(WebCore::ScrollingStateStickyNode::applicableProperties const):
(WebCore::ScrollingStateStickyNode::setPropertyChangesAfterReattach): Deleted.
* page/scrolling/ScrollingStateStickyNode.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStateFixedNodecpp">trunk/Source/WebCore/page/scrolling/ScrollingStateFixedNode.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStateFixedNodeh">trunk/Source/WebCore/page/scrolling/ScrollingStateFixedNode.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStateFrameScrollingNodecpp">trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStateFrameScrollingNodeh">trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStateNodecpp">trunk/Source/WebCore/page/scrolling/ScrollingStateNode.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStateNodeh">trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStateOverflowScrollProxyNodecpp">trunk/Source/WebCore/page/scrolling/ScrollingStateOverflowScrollProxyNode.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStateOverflowScrollProxyNodeh">trunk/Source/WebCore/page/scrolling/ScrollingStateOverflowScrollProxyNode.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStatePositionedNodecpp">trunk/Source/WebCore/page/scrolling/ScrollingStatePositionedNode.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStatePositionedNodeh">trunk/Source/WebCore/page/scrolling/ScrollingStatePositionedNode.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStateScrollingNodecpp">trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStateScrollingNodeh">trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStateStickyNodecpp">trunk/Source/WebCore/page/scrolling/ScrollingStateStickyNode.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingStateStickyNodeh">trunk/Source/WebCore/page/scrolling/ScrollingStateStickyNode.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (269457 => 269458)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2020-11-05 19:51:34 UTC (rev 269457)
+++ trunk/Source/WebCore/ChangeLog      2020-11-05 19:52:54 UTC (rev 269458)
</span><span class="lines">@@ -1,3 +1,46 @@
</span><ins>+2020-11-05  Simon Fraser  <simon.fraser@apple.com>
+
+        Clean up ScrollingStateTree setPropertyChangesAfterReattach() code
+        https://bugs.webkit.org/show_bug.cgi?id=218621
+
+        Reviewed by Antti Koivisto.
+
+        Replace lots of individual setPropertyChangedInternal() calls with a single call
+        with an OptionSet<> argument.
+
+        The virtual applicableProperties() calls base classes to generate an OptionSet<>
+        of all the properties for a node type.
+
+        * page/scrolling/ScrollingStateFixedNode.cpp:
+        (WebCore::ScrollingStateFixedNode::applicableProperties const):
+        (WebCore::ScrollingStateFixedNode::setPropertyChangesAfterReattach): Deleted.
+        * page/scrolling/ScrollingStateFixedNode.h:
+        * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
+        (WebCore::ScrollingStateFrameScrollingNode::applicableProperties const):
+        (WebCore::ScrollingStateFrameScrollingNode::setPropertyChangesAfterReattach): Deleted.
+        * page/scrolling/ScrollingStateFrameScrollingNode.h:
+        * page/scrolling/ScrollingStateNode.cpp:
+        (WebCore::ScrollingStateNode::applicableProperties const):
+        (WebCore::ScrollingStateNode::setPropertyChangesAfterReattach):
+        * page/scrolling/ScrollingStateNode.h:
+        (WebCore::ScrollingStateNode::setPropertiesChangedInternal):
+        * page/scrolling/ScrollingStateOverflowScrollProxyNode.cpp:
+        (WebCore::ScrollingStateOverflowScrollProxyNode::applicableProperties const):
+        (WebCore::ScrollingStateOverflowScrollProxyNode::setPropertyChangesAfterReattach): Deleted.
+        * page/scrolling/ScrollingStateOverflowScrollProxyNode.h:
+        * page/scrolling/ScrollingStatePositionedNode.cpp:
+        (WebCore::ScrollingStatePositionedNode::applicableProperties const):
+        (WebCore::ScrollingStatePositionedNode::setPropertyChangesAfterReattach): Deleted.
+        * page/scrolling/ScrollingStatePositionedNode.h:
+        * page/scrolling/ScrollingStateScrollingNode.cpp:
+        (WebCore::ScrollingStateScrollingNode::applicableProperties const):
+        (WebCore::ScrollingStateScrollingNode::setPropertyChangesAfterReattach): Deleted.
+        * page/scrolling/ScrollingStateScrollingNode.h:
+        * page/scrolling/ScrollingStateStickyNode.cpp:
+        (WebCore::ScrollingStateStickyNode::applicableProperties const):
+        (WebCore::ScrollingStateStickyNode::setPropertyChangesAfterReattach): Deleted.
+        * page/scrolling/ScrollingStateStickyNode.h:
+
</ins><span class="cx"> 2020-11-05  Wenson Hsieh  <wenson_hsieh@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Clean up Source/WebCore/platform/graphics/DashArray.h
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStateFixedNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateFixedNode.cpp (269457 => 269458)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStateFixedNode.cpp  2020-11-05 19:51:34 UTC (rev 269457)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateFixedNode.cpp     2020-11-05 19:52:54 UTC (rev 269458)
</span><span class="lines">@@ -58,10 +58,13 @@
</span><span class="cx">     return adoptRef(*new ScrollingStateFixedNode(*this, adoptiveTree));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ScrollingStateFixedNode::setPropertyChangesAfterReattach()
</del><ins>+OptionSet<ScrollingStateNode::Property> ScrollingStateFixedNode::applicableProperties() const
</ins><span class="cx"> {
</span><del>-    setPropertyChangedInternal(Property::ViewportConstraints);
-    ScrollingStateNode::setPropertyChangesAfterReattach();
</del><ins>+    constexpr OptionSet<Property> nodeProperties = { Property::RelatedOverflowScrollingNodes, Property::LayoutConstraintData };
+
+    auto properties = ScrollingStateNode::applicableProperties();
+    properties.add(nodeProperties);
+    return properties;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ScrollingStateFixedNode::updateConstraints(const FixedPositionViewportConstraints& constraints)
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStateFixedNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateFixedNode.h (269457 => 269458)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStateFixedNode.h    2020-11-05 19:51:34 UTC (rev 269457)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateFixedNode.h       2020-11-05 19:52:54 UTC (rev 269458)
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx"> public:
</span><span class="cx">     static Ref<ScrollingStateFixedNode> create(ScrollingStateTree&, ScrollingNodeID);
</span><span class="cx"> 
</span><del>-    Ref<ScrollingStateNode> clone(ScrollingStateTree&) override;
</del><ins>+    Ref<ScrollingStateNode> clone(ScrollingStateTree&) final;
</ins><span class="cx"> 
</span><span class="cx">     virtual ~ScrollingStateFixedNode();
</span><span class="cx"> 
</span><span class="lines">@@ -51,12 +51,11 @@
</span><span class="cx">     ScrollingStateFixedNode(ScrollingStateTree&, ScrollingNodeID);
</span><span class="cx">     ScrollingStateFixedNode(const ScrollingStateFixedNode&, ScrollingStateTree&);
</span><span class="cx"> 
</span><del>-    void setPropertyChangesAfterReattach() override;
</del><ins>+    void reconcileLayerPositionForViewportRect(const LayoutRect& viewportRect, ScrollingLayerPositionAction) final;
</ins><span class="cx"> 
</span><del>-    void reconcileLayerPositionForViewportRect(const LayoutRect& viewportRect, ScrollingLayerPositionAction) override;
</del><ins>+    void dumpProperties(WTF::TextStream&, ScrollingStateTreeAsTextBehavior) const final;
+    OptionSet<ScrollingStateNode::Property> applicableProperties() const final;
</ins><span class="cx"> 
</span><del>-    void dumpProperties(WTF::TextStream&, ScrollingStateTreeAsTextBehavior) const override;
-
</del><span class="cx">     FixedPositionViewportConstraints m_constraints;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStateFrameScrollingNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp (269457 => 269458)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp 2020-11-05 19:51:34 UTC (rev 269457)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp    2020-11-05 19:52:54 UTC (rev 269458)
</span><span class="lines">@@ -86,30 +86,33 @@
</span><span class="cx">     return adoptRef(*new ScrollingStateFrameScrollingNode(*this, adoptiveTree));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ScrollingStateFrameScrollingNode::setPropertyChangesAfterReattach()
</del><ins>+OptionSet<ScrollingStateNode::Property> ScrollingStateFrameScrollingNode::applicableProperties() const
</ins><span class="cx"> {
</span><del>-    setPropertyChangedInternal(Property::FrameScaleFactor);
-    setPropertyChangedInternal(Property::EventTrackingRegion);
-    setPropertyChangedInternal(Property::RootContentsLayer);
-    setPropertyChangedInternal(Property::ScrolledContentsLayer);
-    setPropertyChangedInternal(Property::CounterScrollingLayer);
-    setPropertyChangedInternal(Property::InsetClipLayer);
-    setPropertyChangedInternal(Property::ContentShadowLayer);
-    setPropertyChangedInternal(Property::HeaderHeight);
-    setPropertyChangedInternal(Property::FooterHeight);
-    setPropertyChangedInternal(Property::HeaderLayer);
-    setPropertyChangedInternal(Property::FooterLayer);
-    setPropertyChangedInternal(Property::BehaviorForFixedElements);
-    setPropertyChangedInternal(Property::TopContentInset);
-    setPropertyChangedInternal(Property::FixedElementsLayoutRelativeToFrame);
-    setPropertyChangedInternal(Property::VisualViewportIsSmallerThanLayoutViewport);
-    setPropertyChangedInternal(Property::AsyncFrameOrOverflowScrollingEnabled);
-    setPropertyChangedInternal(Property::LayoutViewport);
-    setPropertyChangedInternal(Property::MinLayoutViewportOrigin);
-    setPropertyChangedInternal(Property::MaxLayoutViewportOrigin);
-    setPropertyChangedInternal(Property::OverrideVisualViewportSize);
</del><ins>+    constexpr OptionSet<Property> nodeProperties = {
+        Property::FrameScaleFactor,
+        Property::EventTrackingRegion,
+        Property::RootContentsLayer,
+        Property::CounterScrollingLayer,
+        Property::InsetClipLayer,
+        Property::ContentShadowLayer,
+        Property::HeaderHeight,
+        Property::FooterHeight,
+        Property::HeaderLayer,
+        Property::FooterLayer,
+        Property::BehaviorForFixedElements,
+        Property::TopContentInset,
+        Property::FixedElementsLayoutRelativeToFrame,
+        Property::VisualViewportIsSmallerThanLayoutViewport,
+        Property::AsyncFrameOrOverflowScrollingEnabled,
+        Property::LayoutViewport,
+        Property::MinLayoutViewportOrigin,
+        Property::MaxLayoutViewportOrigin,
+        Property::OverrideVisualViewportSize,
+    };
</ins><span class="cx"> 
</span><del>-    ScrollingStateScrollingNode::setPropertyChangesAfterReattach();
</del><ins>+    auto properties = ScrollingStateScrollingNode::applicableProperties();
+    properties.add(nodeProperties);
+    return properties;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ScrollingStateFrameScrollingNode::setFrameScaleFactor(float scaleFactor)
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStateFrameScrollingNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h (269457 => 269458)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h   2020-11-05 19:51:34 UTC (rev 269457)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h      2020-11-05 19:52:54 UTC (rev 269458)
</span><span class="lines">@@ -117,7 +117,7 @@
</span><span class="cx">     ScrollingStateFrameScrollingNode(ScrollingStateTree&, ScrollingNodeType, ScrollingNodeID);
</span><span class="cx">     ScrollingStateFrameScrollingNode(const ScrollingStateFrameScrollingNode&, ScrollingStateTree&);
</span><span class="cx"> 
</span><del>-    void setPropertyChangesAfterReattach() override;
</del><ins>+    OptionSet<ScrollingStateNode::Property> applicableProperties() const final;
</ins><span class="cx"> 
</span><span class="cx">     LayerRepresentation m_rootContentsLayer;
</span><span class="cx">     LayerRepresentation m_counterScrollingLayer;
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStateNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateNode.cpp (269457 => 269458)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStateNode.cpp       2020-11-05 19:51:34 UTC (rev 269457)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateNode.cpp  2020-11-05 19:52:54 UTC (rev 269458)
</span><span class="lines">@@ -68,10 +68,15 @@
</span><span class="cx">     m_scrollingStateTree.setHasChangedProperties();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+OptionSet<ScrollingStateNode::Property> ScrollingStateNode::applicableProperties() const
+{
+    return { Property::Layer, Property::ChildNodes };
+}
+
</ins><span class="cx"> void ScrollingStateNode::setPropertyChangesAfterReattach()
</span><span class="cx"> {
</span><del>-    setPropertyChangedInternal(Property::Layer);
-    setPropertyChangedInternal(Property::ChildNodes);
</del><ins>+    auto allPropertiesForNodeType = applicableProperties();
+    setPropertiesChangedInternal(allPropertiesForNodeType);
</ins><span class="cx">     m_scrollingStateTree.setHasChangedProperties();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStateNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h (269457 => 269458)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h 2020-11-05 19:51:34 UTC (rev 269457)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h    2020-11-05 19:52:54 UTC (rev 269458)
</span><span class="lines">@@ -314,8 +314,10 @@
</span><span class="cx">     ScrollingStateNode(ScrollingNodeType, ScrollingStateTree&, ScrollingNodeID);
</span><span class="cx"> 
</span><span class="cx">     void setPropertyChangedInternal(Property property) { m_changedProperties.add(property); }
</span><ins>+    void setPropertiesChangedInternal(OptionSet<Property> properties) { m_changedProperties.add(properties); }
</ins><span class="cx"> 
</span><span class="cx">     virtual void dumpProperties(WTF::TextStream&, ScrollingStateTreeAsTextBehavior) const;
</span><ins>+    virtual OptionSet<Property> applicableProperties() const;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     void dump(WTF::TextStream&, ScrollingStateTreeAsTextBehavior) const;
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStateOverflowScrollProxyNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateOverflowScrollProxyNode.cpp (269457 => 269458)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStateOverflowScrollProxyNode.cpp    2020-11-05 19:51:34 UTC (rev 269457)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateOverflowScrollProxyNode.cpp       2020-11-05 19:52:54 UTC (rev 269458)
</span><span class="lines">@@ -57,13 +57,16 @@
</span><span class="cx">     return adoptRef(*new ScrollingStateOverflowScrollProxyNode(*this, adoptiveTree));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ScrollingStateOverflowScrollProxyNode::setPropertyChangesAfterReattach()
</del><ins>+OptionSet<ScrollingStateNode::Property> ScrollingStateOverflowScrollProxyNode::applicableProperties() const
</ins><span class="cx"> {
</span><del>-    setPropertyChangedInternal(Property::OverflowScrollingNode);
</del><ins>+    constexpr OptionSet<Property> nodeProperties = { Property::OverflowScrollingNode };
</ins><span class="cx"> 
</span><del>-    ScrollingStateNode::setPropertyChangesAfterReattach();
</del><ins>+    auto properties = ScrollingStateNode::applicableProperties();
+    properties.add(nodeProperties);
+    return properties;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+
</ins><span class="cx"> void ScrollingStateOverflowScrollProxyNode::setOverflowScrollingNode(ScrollingNodeID nodeID)
</span><span class="cx"> {
</span><span class="cx">     if (nodeID == m_overflowScrollingNodeID)
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStateOverflowScrollProxyNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateOverflowScrollProxyNode.h (269457 => 269458)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStateOverflowScrollProxyNode.h      2020-11-05 19:51:34 UTC (rev 269457)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateOverflowScrollProxyNode.h 2020-11-05 19:52:54 UTC (rev 269458)
</span><span class="lines">@@ -43,14 +43,13 @@
</span><span class="cx">     ScrollingNodeID overflowScrollingNode() const { return m_overflowScrollingNodeID; }
</span><span class="cx">     WEBCORE_EXPORT void setOverflowScrollingNode(ScrollingNodeID);
</span><span class="cx"> 
</span><del>-    void dumpProperties(WTF::TextStream&, ScrollingStateTreeAsTextBehavior) const override;
-
</del><span class="cx"> private:
</span><span class="cx">     ScrollingStateOverflowScrollProxyNode(ScrollingStateTree&, ScrollingNodeID);
</span><span class="cx">     ScrollingStateOverflowScrollProxyNode(const ScrollingStateOverflowScrollProxyNode&, ScrollingStateTree&);
</span><span class="cx"> 
</span><del>-    void setPropertyChangesAfterReattach() override;
-    
</del><ins>+    void dumpProperties(WTF::TextStream&, ScrollingStateTreeAsTextBehavior) const final;
+    OptionSet<ScrollingStateNode::Property> applicableProperties() const final;
+
</ins><span class="cx">     ScrollingNodeID m_overflowScrollingNodeID { 0 };
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStatePositionedNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStatePositionedNode.cpp (269457 => 269458)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStatePositionedNode.cpp     2020-11-05 19:51:34 UTC (rev 269457)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStatePositionedNode.cpp        2020-11-05 19:52:54 UTC (rev 269458)
</span><span class="lines">@@ -59,11 +59,13 @@
</span><span class="cx">     return adoptRef(*new ScrollingStatePositionedNode(*this, adoptiveTree));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ScrollingStatePositionedNode::setPropertyChangesAfterReattach()
</del><ins>+OptionSet<ScrollingStateNode::Property> ScrollingStatePositionedNode::applicableProperties() const
</ins><span class="cx"> {
</span><del>-    setPropertyChangedInternal(Property::RelatedOverflowScrollingNodes);
-    setPropertyChangedInternal(Property::LayoutConstraintData);
-    ScrollingStateNode::setPropertyChangesAfterReattach();
</del><ins>+    constexpr OptionSet<Property> nodeProperties = { Property::RelatedOverflowScrollingNodes, Property::LayoutConstraintData };
+
+    auto properties = ScrollingStateNode::applicableProperties();
+    properties.add(nodeProperties);
+    return properties;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ScrollingStatePositionedNode::setRelatedOverflowScrollingNodes(Vector<ScrollingNodeID>&& nodes)
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStatePositionedNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStatePositionedNode.h (269457 => 269458)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStatePositionedNode.h       2020-11-05 19:51:34 UTC (rev 269457)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStatePositionedNode.h  2020-11-05 19:52:54 UTC (rev 269458)
</span><span class="lines">@@ -56,10 +56,9 @@
</span><span class="cx">     ScrollingStatePositionedNode(ScrollingStateTree&, ScrollingNodeID);
</span><span class="cx">     ScrollingStatePositionedNode(const ScrollingStatePositionedNode&, ScrollingStateTree&);
</span><span class="cx"> 
</span><del>-    void setPropertyChangesAfterReattach() override;
</del><ins>+    void dumpProperties(WTF::TextStream&, ScrollingStateTreeAsTextBehavior) const final;
+    OptionSet<ScrollingStateNode::Property> applicableProperties() const final;
</ins><span class="cx"> 
</span><del>-    void dumpProperties(WTF::TextStream&, ScrollingStateTreeAsTextBehavior) const override;
-
</del><span class="cx">     Vector<ScrollingNodeID> m_relatedOverflowScrollingNodes;
</span><span class="cx">     AbsolutePositionConstraints m_constraints;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStateScrollingNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp (269457 => 269458)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp      2020-11-05 19:51:34 UTC (rev 269457)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp 2020-11-05 19:52:54 UTC (rev 269458)
</span><span class="lines">@@ -80,33 +80,38 @@
</span><span class="cx">     scrollingStateTree().scrollingNodeRemoved();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ScrollingStateScrollingNode::setPropertyChangesAfterReattach()
</del><ins>+OptionSet<ScrollingStateNode::Property> ScrollingStateScrollingNode::applicableProperties() const
</ins><span class="cx"> {
</span><del>-    setPropertyChangedInternal(Property::ScrollableAreaSize);
-    setPropertyChangedInternal(Property::TotalContentsSize);
-    setPropertyChangedInternal(Property::ReachableContentsSize);
-    setPropertyChangedInternal(Property::ScrollPosition);
-    setPropertyChangedInternal(Property::ScrollOrigin);
-    setPropertyChangedInternal(Property::ScrollableAreaParams);
</del><ins>+    // Note that this list does not include Property::RequestedScrollPosition, which is imperative, not stateful.
+    constexpr OptionSet<Property> nodeProperties = {
+        Property::ScrollableAreaSize,
+        Property::TotalContentsSize,
+        Property::ReachableContentsSize,
+        Property::ScrollPosition,
+        Property::ScrollOrigin,
+        Property::ScrollableAreaParams,
</ins><span class="cx"> #if ENABLE(SCROLLING_THREAD)
</span><del>-    setPropertyChangedInternal(Property::ReasonsForSynchronousScrolling);
</del><ins>+        Property::ReasonsForSynchronousScrolling,
</ins><span class="cx"> #endif
</span><span class="cx"> #if ENABLE(CSS_SCROLL_SNAP)
</span><del>-    setPropertyChangedInternal(Property::HorizontalSnapOffsets);
-    setPropertyChangedInternal(Property::VerticalSnapOffsets);
-    setPropertyChangedInternal(Property::HorizontalSnapOffsetRanges);
-    setPropertyChangedInternal(Property::VerticalSnapOffsetRanges);
-    setPropertyChangedInternal(Property::CurrentHorizontalSnapOffsetIndex);
-    setPropertyChangedInternal(Property::CurrentVerticalSnapOffsetIndex);
</del><ins>+        Property::HorizontalSnapOffsets,
+        Property::VerticalSnapOffsets,
+        Property::HorizontalSnapOffsetRanges,
+        Property::VerticalSnapOffsetRanges,
+        Property::CurrentHorizontalSnapOffsetIndex,
+        Property::CurrentVerticalSnapOffsetIndex,
+        Property::IsMonitoringWheelEvents,
</ins><span class="cx"> #endif
</span><del>-    setPropertyChangedInternal(Property::IsMonitoringWheelEvents);
-    setPropertyChangedInternal(Property::ScrollContainerLayer);
-    setPropertyChangedInternal(Property::ScrolledContentsLayer);
-    setPropertyChangedInternal(Property::HorizontalScrollbarLayer);
-    setPropertyChangedInternal(Property::VerticalScrollbarLayer);
-    setPropertyChangedInternal(Property::PainterForScrollbar);
</del><ins>+        Property::ScrollContainerLayer,
+        Property::ScrolledContentsLayer,
+        Property::HorizontalScrollbarLayer,
+        Property::VerticalScrollbarLayer,
+        Property::PainterForScrollbar
+    };
</ins><span class="cx"> 
</span><del>-    ScrollingStateNode::setPropertyChangesAfterReattach();
</del><ins>+    auto properties = ScrollingStateNode::applicableProperties();
+    properties.add(nodeProperties);
+    return properties;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ScrollingStateScrollingNode::setScrollableAreaSize(const FloatSize& size)
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStateScrollingNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h (269457 => 269458)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h        2020-11-05 19:51:34 UTC (rev 269457)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h   2020-11-05 19:52:54 UTC (rev 269458)
</span><span class="lines">@@ -128,8 +128,7 @@
</span><span class="cx">     ScrollingStateScrollingNode(ScrollingStateTree&, ScrollingNodeType, ScrollingNodeID);
</span><span class="cx">     ScrollingStateScrollingNode(const ScrollingStateScrollingNode&, ScrollingStateTree&);
</span><span class="cx"> 
</span><del>-    void setPropertyChangesAfterReattach() override;
-
</del><ins>+    OptionSet<Property> applicableProperties() const override;
</ins><span class="cx">     void dumpProperties(WTF::TextStream&, ScrollingStateTreeAsTextBehavior) const override;
</span><span class="cx"> 
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStateStickyNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateStickyNode.cpp (269457 => 269458)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStateStickyNode.cpp 2020-11-05 19:51:34 UTC (rev 269457)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateStickyNode.cpp    2020-11-05 19:52:54 UTC (rev 269458)
</span><span class="lines">@@ -63,10 +63,13 @@
</span><span class="cx">     return adoptRef(*new ScrollingStateStickyNode(*this, adoptiveTree));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ScrollingStateStickyNode::setPropertyChangesAfterReattach()
</del><ins>+OptionSet<ScrollingStateNode::Property> ScrollingStateStickyNode::applicableProperties() const
</ins><span class="cx"> {
</span><del>-    setPropertyChangedInternal(Property::ViewportConstraints);
-    ScrollingStateNode::setPropertyChangesAfterReattach();
</del><ins>+    constexpr OptionSet<Property> nodeProperties = { Property::ViewportConstraints };
+
+    auto properties = ScrollingStateNode::applicableProperties();
+    properties.add(nodeProperties);
+    return properties;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ScrollingStateStickyNode::updateConstraints(const StickyPositionViewportConstraints& constraints)
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingStateStickyNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateStickyNode.h (269457 => 269458)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingStateStickyNode.h   2020-11-05 19:51:34 UTC (rev 269457)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateStickyNode.h      2020-11-05 19:52:54 UTC (rev 269458)
</span><span class="lines">@@ -51,12 +51,11 @@
</span><span class="cx">     ScrollingStateStickyNode(ScrollingStateTree&, ScrollingNodeID);
</span><span class="cx">     ScrollingStateStickyNode(const ScrollingStateStickyNode&, ScrollingStateTree&);
</span><span class="cx"> 
</span><del>-    void setPropertyChangesAfterReattach() override;
-
</del><span class="cx">     FloatPoint computeLayerPosition(const LayoutRect& viewportRect) const;
</span><del>-    void reconcileLayerPositionForViewportRect(const LayoutRect& viewportRect, ScrollingLayerPositionAction) override;
</del><ins>+    void reconcileLayerPositionForViewportRect(const LayoutRect& viewportRect, ScrollingLayerPositionAction) final;
</ins><span class="cx"> 
</span><del>-    void dumpProperties(WTF::TextStream&, ScrollingStateTreeAsTextBehavior) const override;
</del><ins>+    void dumpProperties(WTF::TextStream&, ScrollingStateTreeAsTextBehavior) const final;
+    OptionSet<ScrollingStateNode::Property> applicableProperties() const final;
</ins><span class="cx"> 
</span><span class="cx">     StickyPositionViewportConstraints m_constraints;
</span><span class="cx"> };
</span></span></pre>
</div>
</div>

</body>
</html>