Remove RenderElement::s_affectsParentBlock
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Feb 2018 16:31:34 +0000 (16:31 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Feb 2018 16:31:34 +0000 (16:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=183187
<rdar://problem/37961079>

Reviewed by Antti Koivisto.

Remove the hack to track floating/out-of-flow changes between styleWillChange and styleDidChange.

Covered by existing tests.

* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleWillChange):
(WebCore::RenderElement::styleDidChange):
* rendering/RenderElement.h:

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

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderElement.h

index 736ac24..935b592 100644 (file)
@@ -1,3 +1,20 @@
+2018-02-28  Zalan Bujtas  <zalan@apple.com>
+
+        Remove RenderElement::s_affectsParentBlock
+        https://bugs.webkit.org/show_bug.cgi?id=183187
+        <rdar://problem/37961079>
+
+        Reviewed by Antti Koivisto.
+
+        Remove the hack to track floating/out-of-flow changes between styleWillChange and styleDidChange.
+
+        Covered by existing tests.
+
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::styleWillChange):
+        (WebCore::RenderElement::styleDidChange):
+        * rendering/RenderElement.h:
+
 2018-02-28  Antti Koivisto  <antti@apple.com>
 
         Filter attribute selectors with selector filter
index 24ce116..411a02b 100644 (file)
@@ -94,7 +94,6 @@ struct SameSizeAsRenderElement : public RenderObject {
 
 static_assert(sizeof(RenderElement) == sizeof(SameSizeAsRenderElement), "RenderElement should stay small");
 
-bool RenderElement::s_affectsParentBlock = false;
 bool RenderElement::s_noLongerAffectsParentBlock = false;
     
 inline RenderElement::RenderElement(ContainerNode& elementOrDocument, RenderStyle&& style, BaseTypeFlags baseTypeFlags)
@@ -749,10 +748,6 @@ void RenderElement::styleWillChange(StyleDifference diff, const RenderStyle& new
             downcast<RenderBox>(*this).removeFloatingOrPositionedChildFromBlockLists();
         }
 
-        s_affectsParentBlock = isFloatingOrOutOfFlowPositioned()
-            && (!newStyle.isFloating() && !newStyle.hasOutOfFlowPosition())
-            && parent() && (parent()->isRenderBlockFlow() || parent()->isRenderInline());
-
         s_noLongerAffectsParentBlock = ((!isFloating() && newStyle.isFloating()) || (!isOutOfFlowPositioned() && newStyle.hasOutOfFlowPosition()))
             && parent() && parent()->isRenderBlock();
 
@@ -769,10 +764,8 @@ void RenderElement::styleWillChange(StyleDifference diff, const RenderStyle& new
         setHasOverflowClip(false);
         setHasTransformRelatedProperty(false);
         setHasReflection(false);
-    } else {
-        s_affectsParentBlock = false;
+    } else
         s_noLongerAffectsParentBlock = false;
-    }
 
     bool newStyleSlowScroll = false;
     if (newStyle.hasFixedBackgroundImage() && !settings().fixedBackgroundsPaintRelativeToDocument()) {
@@ -813,7 +806,10 @@ void RenderElement::styleDidChange(StyleDifference diff, const RenderStyle* oldS
     updateImage(oldStyle ? oldStyle->maskBoxImage().image() : nullptr, m_style.maskBoxImage().image());
     updateShapeImage(oldStyle ? oldStyle->shapeOutside() : nullptr, m_style.shapeOutside());
 
-    if (s_affectsParentBlock) {
+    bool affectsParentBlock = oldStyle && (oldStyle->isFloating() || oldStyle->hasOutOfFlowPosition())
+        && !style().isFloating() && !style().hasOutOfFlowPosition()
+        && parent() && (parent()->isRenderBlockFlow() || parent()->isRenderInline());
+    if (affectsParentBlock) {
         // We have gone from not affecting the inline status of the parent flow to suddenly
         // having an impact. See if there is a mismatch between the parent flow's
         // childrenInline() state and our state.
index af95e3e..161cfcb 100644 (file)
@@ -351,7 +351,6 @@ private:
 
     // FIXME: Get rid of this hack.
     // Store state between styleWillChange and styleDidChange
-    static bool s_affectsParentBlock;
     static bool s_noLongerAffectsParentBlock;
 };