Title: [224561] trunk/Source/WebCore
Revision
224561
Author
[email protected]
Date
2017-11-07 17:02:32 -0800 (Tue, 07 Nov 2017)

Log Message

There is no such thing as block element continuation
https://bugs.webkit.org/show_bug.cgi?id=179400

Reviewed by Zalan Bujtas.

There are no non-anonymous block continuations. This is dead code.

* rendering/RenderBlock.cpp:
(WebCore::borderOrPaddingLogicalWidthChanged):
(WebCore::RenderBlock::styleDidChange):
(WebCore::RenderBlock::blockElementContinuation const): Deleted.

    This would always return null.

* rendering/RenderBlock.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (224560 => 224561)


--- trunk/Source/WebCore/ChangeLog	2017-11-08 00:30:45 UTC (rev 224560)
+++ trunk/Source/WebCore/ChangeLog	2017-11-08 01:02:32 UTC (rev 224561)
@@ -1,3 +1,21 @@
+2017-11-07  Antti Koivisto  <[email protected]>
+
+        There is no such thing as block element continuation
+        https://bugs.webkit.org/show_bug.cgi?id=179400
+
+        Reviewed by Zalan Bujtas.
+
+        There are no non-anonymous block continuations. This is dead code.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::borderOrPaddingLogicalWidthChanged):
+        (WebCore::RenderBlock::styleDidChange):
+        (WebCore::RenderBlock::blockElementContinuation const): Deleted.
+
+            This would always return null.
+
+        * rendering/RenderBlock.h:
+
 2017-11-07  Zalan Bujtas  <[email protected]>
 
         [LayoutState cleanup] Rename enable/disableLayoutState

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (224560 => 224561)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2017-11-08 00:30:45 UTC (rev 224560)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2017-11-08 01:02:32 UTC (rev 224561)
@@ -415,18 +415,19 @@
     RenderBox::styleWillChange(diff, newStyle);
 }
 
-static bool borderOrPaddingLogicalWidthChanged(const RenderStyle* oldStyle, const RenderStyle* newStyle)
+static bool borderOrPaddingLogicalWidthChanged(const RenderStyle& oldStyle, const RenderStyle& newStyle)
 {
-    if (newStyle->isHorizontalWritingMode())
-        return oldStyle->borderLeftWidth() != newStyle->borderLeftWidth()
-            || oldStyle->borderRightWidth() != newStyle->borderRightWidth()
-            || oldStyle->paddingLeft() != newStyle->paddingLeft()
-            || oldStyle->paddingRight() != newStyle->paddingRight();
+    if (newStyle.isHorizontalWritingMode()) {
+        return oldStyle.borderLeftWidth() != newStyle.borderLeftWidth()
+            || oldStyle.borderRightWidth() != newStyle.borderRightWidth()
+            || oldStyle.paddingLeft() != newStyle.paddingLeft()
+            || oldStyle.paddingRight() != newStyle.paddingRight();
+    }
 
-    return oldStyle->borderTopWidth() != newStyle->borderTopWidth()
-        || oldStyle->borderBottomWidth() != newStyle->borderBottomWidth()
-        || oldStyle->paddingTop() != newStyle->paddingTop()
-        || oldStyle->paddingBottom() != newStyle->paddingBottom();
+    return oldStyle.borderTopWidth() != newStyle.borderTopWidth()
+        || oldStyle.borderBottomWidth() != newStyle.borderBottomWidth()
+        || oldStyle.paddingTop() != newStyle.paddingTop()
+        || oldStyle.paddingBottom() != newStyle.paddingBottom();
 }
 
 void RenderBlock::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
@@ -437,18 +438,11 @@
     if (hadTransform != hasTransform())
         adjustFragmentedFlowStateOnContainingBlockChangeIfNeeded();
 
-    auto& newStyle = style();
-    if (!isAnonymousBlock() && !isContinuation()) {
-        // Ensure that all of our continuation blocks pick up the new style.
-        for (RenderBlock* currCont = blockElementContinuation(); currCont; currCont = currCont->blockElementContinuation())
-            currCont->setStyle(RenderStyle::clone(newStyle));
-    }
-
     propagateStyleToAnonymousChildren(PropagateToBlockChildrenOnly);
 
     // It's possible for our border/padding to change, but for the overall logical width of the block to
     // end up being the same. We keep track of this change so in layoutBlock, we can know to set relayoutChildren=true.
-    setShouldForceRelayoutChildren(oldStyle && diff == StyleDifferenceLayout && needsLayout() && borderOrPaddingLogicalWidthChanged(oldStyle, &newStyle));
+    setShouldForceRelayoutChildren(oldStyle && diff == StyleDifferenceLayout && needsLayout() && borderOrPaddingLogicalWidthChanged(*oldStyle, style()));
 }
 
 RenderBlock* RenderBlock::continuationBefore(RenderObject* beforeChild)
@@ -1742,17 +1736,6 @@
     return is<RenderInline>(continuation) ? downcast<RenderInline>(continuation) : nullptr;
 }
 
-RenderBlock* RenderBlock::blockElementContinuation() const
-{
-    RenderBoxModelObject* currentContinuation = continuation();
-    if (!currentContinuation || currentContinuation->isInline())
-        return nullptr;
-    RenderBlock& nextContinuation = downcast<RenderBlock>(*currentContinuation);
-    if (nextContinuation.isAnonymousBlock())
-        return nextContinuation.blockElementContinuation();
-    return &nextContinuation;
-}
-    
 static ContinuationOutlineTableMap* continuationOutlineTable()
 {
     static NeverDestroyed<ContinuationOutlineTableMap> table;

Modified: trunk/Source/WebCore/rendering/RenderBlock.h (224560 => 224561)


--- trunk/Source/WebCore/rendering/RenderBlock.h	2017-11-08 00:30:45 UTC (rev 224560)
+++ trunk/Source/WebCore/rendering/RenderBlock.h	2017-11-08 01:02:32 UTC (rev 224561)
@@ -191,7 +191,6 @@
 
     bool isAnonymousBlockContinuation() const { return isAnonymousBlock() && continuation(); }
     WEBCORE_EXPORT RenderInline* inlineElementContinuation() const;
-    RenderBlock* blockElementContinuation() const;
 
     static RenderPtr<RenderBlock> createAnonymousWithParentRendererAndDisplay(const RenderBox& parent, EDisplay = BLOCK);
     RenderPtr<RenderBlock> createAnonymousBlock(EDisplay = BLOCK) const;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to