Viewport-constrained renderers are always RenderLayerModelObjects
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Dec 2018 02:43:29 +0000 (02:43 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Dec 2018 02:43:29 +0000 (02:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=192342

Reviewed by Myles C. Maxfield.

addViewportConstrainedObject/removeViewportConstrainedObject can take RenderLayerModelObjects,
since all viewport-constrained renderers have layers.

* page/FrameView.cpp:
(WebCore::FrameView::addViewportConstrainedObject):
(WebCore::FrameView::removeViewportConstrainedObject):
* page/FrameView.h:
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::styleDidChange): The 0 argument is actually a nullptr RenderGeometryMap,
which has a default value, and the comment was obsolete.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238837 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/FrameView.h
Source/WebCore/rendering/RenderLayerModelObject.cpp

index aafb0e2..5eaeee0 100644 (file)
@@ -1,3 +1,21 @@
+2018-12-03  Simon Fraser  <simon.fraser@apple.com>
+
+        Viewport-constrained renderers are always RenderLayerModelObjects
+        https://bugs.webkit.org/show_bug.cgi?id=192342
+
+        Reviewed by Myles C. Maxfield.
+
+        addViewportConstrainedObject/removeViewportConstrainedObject can take RenderLayerModelObjects,
+        since all viewport-constrained renderers have layers.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::addViewportConstrainedObject):
+        (WebCore::FrameView::removeViewportConstrainedObject):
+        * page/FrameView.h:
+        * rendering/RenderLayerModelObject.cpp:
+        (WebCore::RenderLayerModelObject::styleDidChange): The 0 argument is actually a nullptr RenderGeometryMap,
+        which has a default value, and the comment was obsolete.
+
 2018-12-03  Don Olmstead  <don.olmstead@sony.com>
 
         Fix some unused parameter warnings
index 778b4c5..edd1ceb 100644 (file)
@@ -1515,7 +1515,7 @@ void FrameView::removeSlowRepaintObject(RenderElement& renderer)
     }
 }
 
-void FrameView::addViewportConstrainedObject(RenderElement* object)
+void FrameView::addViewportConstrainedObject(RenderLayerModelObject* object)
 {
     if (!m_viewportConstrainedObjects)
         m_viewportConstrainedObjects = std::make_unique<ViewportConstrainedObjectSet>();
@@ -1532,7 +1532,7 @@ void FrameView::addViewportConstrainedObject(RenderElement* object)
     }
 }
 
-void FrameView::removeViewportConstrainedObject(RenderElement* object)
+void FrameView::removeViewportConstrainedObject(RenderLayerModelObject* object)
 {
     if (m_viewportConstrainedObjects && m_viewportConstrainedObjects->remove(object)) {
         if (Page* page = frame().page()) {
index d45e75d..bc993a8 100644 (file)
@@ -53,12 +53,12 @@ class Element;
 class FloatSize;
 class Frame;
 class HTMLFrameOwnerElement;
-class Node;
 class Page;
 class RenderBox;
 class RenderElement;
 class RenderEmbeddedObject;
 class RenderLayer;
+class RenderLayerModelObject;
 class RenderObject;
 class RenderScrollbarPart;
 class RenderStyle;
@@ -290,9 +290,9 @@ public:
     bool hasSlowRepaintObjects() const { return m_slowRepaintObjects && m_slowRepaintObjects->size(); }
 
     // Includes fixed- and sticky-position objects.
-    typedef HashSet<RenderElement*> ViewportConstrainedObjectSet;
-    void addViewportConstrainedObject(RenderElement*);
-    void removeViewportConstrainedObject(RenderElement*);
+    typedef HashSet<RenderLayerModelObject*> ViewportConstrainedObjectSet;
+    void addViewportConstrainedObject(RenderLayerModelObject*);
+    void removeViewportConstrainedObject(RenderLayerModelObject*);
     const ViewportConstrainedObjectSet* viewportConstrainedObjects() const { return m_viewportConstrainedObjects.get(); }
     bool hasViewportConstrainedObjects() const { return m_viewportConstrainedObjects && m_viewportConstrainedObjects->size() > 0; }
     
index 2e4d763..06fccde 100644 (file)
@@ -170,9 +170,7 @@ void RenderLayerModelObject::styleDidChange(StyleDifference diff, const RenderSt
             createLayer();
             if (parent() && !needsLayout() && containingBlock()) {
                 layer()->setRepaintStatus(NeedsFullRepaint);
-                // There is only one layer to update, it is not worth using |cachedOffset| since
-                // we are not sure the value will be used.
-                layer()->updateLayerPositions(0);
+                layer()->updateLayerPositions();
             }
         }
     } else if (layer() && layer()->parent()) {