Title: [287385] trunk/Source/WebCore
Revision
287385
Author
[email protected]
Date
2021-12-22 23:14:55 -0800 (Wed, 22 Dec 2021)

Log Message

RenderLayer WIP
https://bugs.webkit.org/show_bug.cgi?id=234154

Patch by Rob Buis <[email protected]> on 2021-12-22
Reviewed by Simon Fraser.

The  members to store absolute (static inline/block) and
relative offset are used orthogonally, so we just merge
them.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPosition):
* rendering/RenderLayer.h:
(WebCore::RenderLayer::offsetForInFlowPosition const):
(WebCore::RenderLayer::staticInlinePosition const):
(WebCore::RenderLayer::staticBlockPosition const):
(WebCore::RenderLayer::setStaticInlinePosition):
(WebCore::RenderLayer::setStaticBlockPosition):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (287384 => 287385)


--- trunk/Source/WebCore/ChangeLog	2021-12-23 07:00:15 UTC (rev 287384)
+++ trunk/Source/WebCore/ChangeLog	2021-12-23 07:14:55 UTC (rev 287385)
@@ -1,3 +1,23 @@
+2021-12-22  Rob Buis  <[email protected]>
+
+        RenderLayer WIP
+        https://bugs.webkit.org/show_bug.cgi?id=234154
+
+        Reviewed by Simon Fraser.
+
+        The  members to store absolute (static inline/block) and
+        relative offset are used orthogonally, so we just merge
+        them.
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::updateLayerPosition):
+        * rendering/RenderLayer.h:
+        (WebCore::RenderLayer::offsetForInFlowPosition const):
+        (WebCore::RenderLayer::staticInlinePosition const):
+        (WebCore::RenderLayer::staticBlockPosition const):
+        (WebCore::RenderLayer::setStaticInlinePosition):
+        (WebCore::RenderLayer::setStaticBlockPosition):
+
 2021-12-22  Michael Saboff  <[email protected]>
 
         Fix WebKit Build issues when using system content path

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (287384 => 287385)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2021-12-23 07:00:15 UTC (rev 287384)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2021-12-23 07:14:55 UTC (rev 287385)
@@ -1713,11 +1713,9 @@
     bool positionOrOffsetChanged = false;
     if (renderer().isInFlowPositioned()) {
         LayoutSize newOffset = downcast<RenderBoxModelObject>(renderer()).offsetForInFlowPosition();
-        positionOrOffsetChanged = newOffset != m_offsetForInFlowPosition;
-        m_offsetForInFlowPosition = newOffset;
-        localPoint.move(m_offsetForInFlowPosition);
-    } else {
-        m_offsetForInFlowPosition = LayoutSize();
+        positionOrOffsetChanged = newOffset != m_offsetForPosition;
+        m_offsetForPosition = newOffset;
+        localPoint.move(m_offsetForPosition);
     }
 
     // FIXME: We'd really like to just get rid of the concept of a layer rectangle and rely on the renderers.

Modified: trunk/Source/WebCore/rendering/RenderLayer.h (287384 => 287385)


--- trunk/Source/WebCore/rendering/RenderLayer.h	2021-12-23 07:00:15 UTC (rev 287384)
+++ trunk/Source/WebCore/rendering/RenderLayer.h	2021-12-23 07:14:55 UTC (rev 287385)
@@ -513,7 +513,7 @@
     void willRemoveChildWithBlendMode();
 #endif
 
-    const LayoutSize& offsetForInFlowPosition() const { return m_offsetForInFlowPosition; }
+    const LayoutSize& offsetForInFlowPosition() const { return m_offsetForPosition; }
 
     void clearClipRectsIncludingDescendants(ClipRectsType typeToClear = AllClipRectTypes);
     void clearClipRects(ClipRectsType typeToClear = AllClipRectTypes);
@@ -716,11 +716,11 @@
     void setRepaintStatus(RepaintStatus status) { m_repaintStatus = status; }
     RepaintStatus repaintStatus() const { return static_cast<RepaintStatus>(m_repaintStatus); }
 
-    LayoutUnit staticInlinePosition() const { return m_staticInlinePosition; }
-    LayoutUnit staticBlockPosition() const { return m_staticBlockPosition; }
+    LayoutUnit staticInlinePosition() const { return m_offsetForPosition.width(); }
+    LayoutUnit staticBlockPosition() const { return m_offsetForPosition.height(); }
    
-    void setStaticInlinePosition(LayoutUnit position) { m_staticInlinePosition = position; }
-    void setStaticBlockPosition(LayoutUnit position) { m_staticBlockPosition = position; }
+    void setStaticInlinePosition(LayoutUnit position) { m_offsetForPosition.setWidth(position); }
+    void setStaticBlockPosition(LayoutUnit position) { m_offsetForPosition.setHeight(position); }
 
     bool hasTransform() const { return renderer().hasTransform(); }
     // Note that this transform has the transform-origin baked in.
@@ -1175,8 +1175,8 @@
     // Only valid if m_repaintRectsValid is set (std::optional<> not used to avoid padding).
     LayerRepaintRects m_repaintRects;
 
-    // Our current relative position offset.
-    LayoutSize m_offsetForInFlowPosition;
+    // Our current relative or absolute position offset.
+    LayoutSize m_offsetForPosition;
 
     // Our (x,y) coordinates are in our parent layer's coordinate space.
     LayoutPoint m_topLeft;
@@ -1189,10 +1189,6 @@
     Markable<ScrollingScope, IntegralMarkableTraits<ScrollingScope, 0>> m_boxScrollingScope;
     Markable<ScrollingScope, IntegralMarkableTraits<ScrollingScope, 0>> m_contentsScrollingScope;
 
-    // Cached normal flow values for absolute positioned elements with static left/top values.
-    LayoutUnit m_staticInlinePosition;
-    LayoutUnit m_staticBlockPosition;
-
     std::unique_ptr<TransformationMatrix> m_transform;
     
     // May ultimately be extended to many replicas (with their own paint order).
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to