Title: [156312] trunk/Source/WebCore
Revision
156312
Author
[email protected]
Date
2013-09-23 17:55:44 -0700 (Mon, 23 Sep 2013)

Log Message

Move style change analysis code to RenderElement
https://bugs.webkit.org/show_bug.cgi?id=121812

Reviewed by Andreas Kling.

Text renderers don't need this. There is no text renderer specific invalidation and text
style never changes independent from the containing RenderElement.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (156311 => 156312)


--- trunk/Source/WebCore/ChangeLog	2013-09-24 00:51:34 UTC (rev 156311)
+++ trunk/Source/WebCore/ChangeLog	2013-09-24 00:55:44 UTC (rev 156312)
@@ -1,3 +1,13 @@
+2013-09-23  Antti Koivisto  <[email protected]>
+
+        Move style change analysis code to RenderElement
+        https://bugs.webkit.org/show_bug.cgi?id=121812
+
+        Reviewed by Andreas Kling.
+
+        Text renderers don't need this. There is no text renderer specific invalidation and text
+        style never changes independent from the containing RenderElement.
+
 2013-09-23  Commit Queue  <[email protected]>
 
         Unreviewed, rolling out r156307.

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (156311 => 156312)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2013-09-24 00:51:34 UTC (rev 156311)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2013-09-24 00:55:44 UTC (rev 156312)
@@ -325,7 +325,7 @@
         }
     }
 
-    propagateStyleToAnonymousChildren(true);    
+    propagateStyleToAnonymousChildren(PropagateToBlockChildrenOnly);
     m_lineHeight = -1;
 
     // After our style changed, if we lose our ability to propagate floats into next sibling

Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (156311 => 156312)


--- trunk/Source/WebCore/rendering/RenderElement.cpp	2013-09-24 00:51:34 UTC (rev 156311)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp	2013-09-24 00:55:44 UTC (rev 156312)
@@ -27,6 +27,9 @@
 
 #include "AXObjectCache.h"
 #include "ContentData.h"
+#include "CursorList.h"
+#include "EventHandler.h"
+#include "Frame.h"
 #include "HTMLElement.h"
 #include "HTMLNames.h"
 #include "RenderCounter.h"
@@ -50,8 +53,15 @@
 #include "RenderView.h"
 #include "SVGRenderSupport.h"
 
+#if USE(ACCELERATED_COMPOSITING)
+#include "RenderLayerCompositor.h"
+#endif
+
 namespace WebCore {
 
+bool RenderElement::s_affectsParentBlock = false;
+bool RenderElement::s_noLongerAffectsParentBlock = false;
+
 RenderElement::RenderElement(Element* element)
     : RenderObject(element)
     , m_firstChild(nullptr)
@@ -444,6 +454,209 @@
     return true;
 }
 
+void RenderElement::propagateStyleToAnonymousChildren(StylePropagationType propagationType)
+{
+    // FIXME: We could save this call when the change only affected non-inherited properties.
+    for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
+        if (!child->isAnonymous() || child->style()->styleType() != NOPSEUDO)
+            continue;
+
+        if (propagationType == PropagateToBlockChildrenOnly && !child->isRenderBlock())
+            continue;
+
+#if ENABLE(FULLSCREEN_API)
+        if (child->isRenderFullScreen() || child->isRenderFullScreenPlaceholder())
+            continue;
+#endif
+
+        RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(style(), child->style()->display());
+        if (style()->specifiesColumns()) {
+            if (child->style()->specifiesColumns())
+                newStyle->inheritColumnPropertiesFrom(style());
+            if (child->style()->columnSpan())
+                newStyle->setColumnSpan(ColumnSpanAll);
+        }
+
+        // Preserve the position style of anonymous block continuations as they can have relative or sticky position when
+        // they contain block descendants of relative or sticky positioned inlines.
+        if (child->isInFlowPositioned() && toRenderBlock(child)->isAnonymousBlockContinuation())
+            newStyle->setPosition(child->style()->position());
+
+        child->setStyle(newStyle.release());
+    }
+}
+
+// On low-powered/mobile devices, preventing blitting on a scroll can cause noticeable delays
+// when scrolling a page with a fixed background image. As an optimization, assuming there are
+// no fixed positoned elements on the page, we can acclerate scrolling (via blitting) if we
+// ignore the CSS property "background-attachment: fixed".
+static bool shouldRepaintFixedBackgroundsOnScroll(FrameView* frameView)
+{
+#if !ENABLE(FAST_MOBILE_SCROLLING) || !PLATFORM(QT)
+    UNUSED_PARAM(frameView);
+#endif
+
+    bool repaintFixedBackgroundsOnScroll = true;
+#if ENABLE(FAST_MOBILE_SCROLLING)
+#if PLATFORM(QT)
+    if (frameView->delegatesScrolling())
+        repaintFixedBackgroundsOnScroll = false;
+#else
+    repaintFixedBackgroundsOnScroll = false;
+#endif
+#endif
+    return repaintFixedBackgroundsOnScroll;
+}
+
+static inline bool rendererHasBackground(const RenderObject* renderer)
+{
+    return renderer && renderer->hasBackground();
+}
+
+void RenderElement::styleWillChange(StyleDifference diff, const RenderStyle* newStyle)
+{
+    if (m_style) {
+        // If our z-index changes value or our visibility changes,
+        // we need to dirty our stacking context's z-order list.
+        if (newStyle) {
+            bool visibilityChanged = m_style->visibility() != newStyle->visibility() 
+                || m_style->zIndex() != newStyle->zIndex() 
+                || m_style->hasAutoZIndex() != newStyle->hasAutoZIndex();
+#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(DRAGGABLE_REGION)
+            if (visibilityChanged)
+                document().setAnnotatedRegionsDirty(true);
+#endif
+            if (visibilityChanged) {
+                if (AXObjectCache* cache = document().existingAXObjectCache())
+                    cache->childrenChanged(parent());
+            }
+
+            // Keep layer hierarchy visibility bits up to date if visibility changes.
+            if (m_style->visibility() != newStyle->visibility()) {
+                if (RenderLayer* layer = enclosingLayer()) {
+                    if (newStyle->visibility() == VISIBLE)
+                        layer->setHasVisibleContent();
+                    else if (layer->hasVisibleContent() && (this == &layer->renderer() || layer->renderer().style()->visibility() != VISIBLE)) {
+                        layer->dirtyVisibleContentStatus();
+                        if (diff > StyleDifferenceRepaintLayer)
+                            repaint();
+                    }
+                }
+            }
+        }
+
+        if (m_parent && (newStyle->outlineSize() < m_style->outlineSize() || shouldRepaintForStyleDifference(diff)))
+            repaint();
+        if (isFloating() && (m_style->floating() != newStyle->floating()))
+            // For changes in float styles, we need to conceivably remove ourselves
+            // from the floating objects list.
+            toRenderBox(this)->removeFloatingOrPositionedChildFromBlockLists();
+        else if (isOutOfFlowPositioned() && (m_style->position() != newStyle->position()))
+            // For changes in positioning styles, we need to conceivably remove ourselves
+            // from the positioned objects list.
+            toRenderBox(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();
+
+        // reset style flags
+        if (diff == StyleDifferenceLayout || diff == StyleDifferenceLayoutPositionedMovementOnly) {
+            setFloating(false);
+            clearPositionedState();
+        }
+        setHorizontalWritingMode(true);
+        setHasBoxDecorations(false);
+        setHasOverflowClip(false);
+        setHasTransform(false);
+        setHasReflection(false);
+    } else {
+        s_affectsParentBlock = false;
+        s_noLongerAffectsParentBlock = false;
+    }
+
+    bool repaintFixedBackgroundsOnScroll = shouldRepaintFixedBackgroundsOnScroll(&view().frameView());
+
+    bool newStyleSlowScroll = newStyle && repaintFixedBackgroundsOnScroll && newStyle->hasFixedBackgroundImage();
+    bool oldStyleSlowScroll = m_style && repaintFixedBackgroundsOnScroll && m_style->hasFixedBackgroundImage();
+
+#if USE(ACCELERATED_COMPOSITING)
+    bool drawsRootBackground = isRoot() || (isBody() && !rendererHasBackground(document().documentElement()->renderer()));
+    if (drawsRootBackground && repaintFixedBackgroundsOnScroll) {
+        if (view().compositor().supportsFixedRootBackgroundCompositing()) {
+            if (newStyleSlowScroll && newStyle->hasEntirelyFixedBackground())
+                newStyleSlowScroll = false;
+
+            if (oldStyleSlowScroll && m_style->hasEntirelyFixedBackground())
+                oldStyleSlowScroll = false;
+        }
+    }
+#endif
+    if (oldStyleSlowScroll != newStyleSlowScroll) {
+        if (oldStyleSlowScroll)
+            view().frameView().removeSlowRepaintObject(this);
+
+        if (newStyleSlowScroll)
+            view().frameView().addSlowRepaintObject(this);
+    }
+}
+
+static bool areNonIdenticalCursorListsEqual(const RenderStyle* a, const RenderStyle* b)
+{
+    ASSERT(a->cursors() != b->cursors());
+    return a->cursors() && b->cursors() && *a->cursors() == *b->cursors();
+}
+
+static inline bool areCursorsEqual(const RenderStyle* a, const RenderStyle* b)
+{
+    return a->cursor() == b->cursor() && (a->cursors() == b->cursors() || areNonIdenticalCursorListsEqual(a, b));
+}
+
+void RenderElement::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
+{
+    if (s_affectsParentBlock)
+        handleDynamicFloatPositionChange();
+
+    if (s_noLongerAffectsParentBlock)
+        removeAnonymousWrappersForInlinesIfNecessary();
+#if ENABLE(SVG)
+    SVGRenderSupport::styleChanged(this);
+#endif
+
+    if (!m_parent)
+        return;
+    
+    if (diff == StyleDifferenceLayout || diff == StyleDifferenceSimplifiedLayout) {
+        RenderCounter::rendererStyleChanged(this, oldStyle, m_style.get());
+
+        // If the object already needs layout, then setNeedsLayout won't do
+        // any work. But if the containing block has changed, then we may need
+        // to mark the new containing blocks for layout. The change that can
+        // directly affect the containing block of this object is a change to
+        // the position style.
+        if (needsLayout() && oldStyle->position() != m_style->position())
+            markContainingBlocksForLayout();
+
+        if (diff == StyleDifferenceLayout)
+            setNeedsLayoutAndPrefWidthsRecalc();
+        else
+            setNeedsSimplifiedNormalFlowLayout();
+    } else if (diff == StyleDifferenceSimplifiedLayoutAndPositionedMovement) {
+        setNeedsPositionedMovementLayout(oldStyle);
+        setNeedsSimplifiedNormalFlowLayout();
+    } else if (diff == StyleDifferenceLayoutPositionedMovementOnly)
+        setNeedsPositionedMovementLayout(oldStyle);
+
+    // Don't check for repaint here; we need to wait until the layer has been
+    // updated by subclasses before we know if we have to repaint (in setStyle()).
+
+    if (oldStyle && !areCursorsEqual(oldStyle, style()))
+        frame().eventHandler().scheduleCursorUpdate();
+}
+
 void RenderElement::insertedIntoTree()
 {
     RenderObject::insertedIntoTree();
@@ -481,6 +694,13 @@
         removeLayers(layer);
     }
 
+    bool repaintFixedBackgroundsOnScroll = shouldRepaintFixedBackgroundsOnScroll(&view().frameView());
+    if (repaintFixedBackgroundsOnScroll && m_style && m_style->hasFixedBackgroundImage())
+        view().frameView().removeSlowRepaintObject(this);
+
+    if (isOutOfFlowPositioned() && parent()->childrenInline())
+        parent()->dirtyLinesFromChangedChild(this);
+
     RenderObject::willBeRemovedFromTree();
 }
 

Modified: trunk/Source/WebCore/rendering/RenderElement.h (156311 => 156312)


--- trunk/Source/WebCore/rendering/RenderElement.h	2013-09-24 00:51:34 UTC (rev 156311)
+++ trunk/Source/WebCore/rendering/RenderElement.h	2013-09-24 00:55:44 UTC (rev 156312)
@@ -66,6 +66,9 @@
 
     bool layerCreationAllowedForSubtree() const;
 
+    enum StylePropagationType { PropagateToAllChildren, PropagateToBlockChildrenOnly };
+    void propagateStyleToAnonymousChildren(StylePropagationType);
+
     LayoutUnit valueForLength(const Length&, LayoutUnit maximumValue, bool roundPercentages = false) const;
     LayoutUnit minimumValueForLength(const Length&, LayoutUnit maximumValue, bool roundPercentages = false) const;
 
@@ -73,6 +76,8 @@
     void setLastChild(RenderObject* child) { m_lastChild = child; }
     void destroyLeftoverChildren();
 
+    virtual void styleWillChange(StyleDifference, const RenderStyle*) OVERRIDE;
+    virtual void styleDidChange(StyleDifference, const RenderStyle*) OVERRIDE;
     virtual void insertedIntoTree() OVERRIDE;
     virtual void willBeRemovedFromTree() OVERRIDE;
     virtual void willBeDestroyed() OVERRIDE;
@@ -84,11 +89,16 @@
     void isText() const WTF_DELETED_FUNCTION;
     void isRenderElement() const WTF_DELETED_FUNCTION;
 
-    virtual RenderObject* firstChildSlow() const { return firstChild(); }
-    virtual RenderObject* lastChildSlow() const { return lastChild(); }
+    virtual RenderObject* firstChildSlow() const OVERRIDE FINAL { return firstChild(); }
+    virtual RenderObject* lastChildSlow() const OVERRIDE FINAL { return lastChild(); }
 
     RenderObject* m_firstChild;
     RenderObject* m_lastChild;
+
+    // FIXME: Get rid of this hack.
+    // Store state between styleWillChange and styleDidChange
+    static bool s_affectsParentBlock;
+    static bool s_noLongerAffectsParentBlock;
 };
 
 inline LayoutUnit RenderElement::valueForLength(const Length& length, LayoutUnit maximumValue, bool roundPercentages) const

Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (156311 => 156312)


--- trunk/Source/WebCore/rendering/RenderObject.cpp	2013-09-24 00:51:34 UTC (rev 156311)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp	2013-09-24 00:55:44 UTC (rev 156312)
@@ -29,7 +29,6 @@
 
 #include "AXObjectCache.h"
 #include "AnimationController.h"
-#include "CursorList.h"
 #include "EventHandler.h"
 #include "FloatQuad.h"
 #include "FlowThreadController.h"
@@ -65,10 +64,6 @@
 #include <wtf/RefCountedLeakCounter.h>
 #include <wtf/StackStats.h>
 
-#if USE(ACCELERATED_COMPOSITING)
-#include "RenderLayerCompositor.h"
-#endif
-
 #if ENABLE(SVG)
 #include "RenderSVGResourceContainer.h"
 #include "SVGRenderSupport.h"
@@ -107,31 +102,6 @@
 
 COMPILE_ASSERT(sizeof(RenderObject) == sizeof(SameSizeAsRenderObject), RenderObject_should_stay_small);
 
-// On low-powered/mobile devices, preventing blitting on a scroll can cause noticeable delays
-// when scrolling a page with a fixed background image. As an optimization, assuming there are
-// no fixed positoned elements on the page, we can acclerate scrolling (via blitting) if we
-// ignore the CSS property "background-attachment: fixed".
-static bool shouldRepaintFixedBackgroundsOnScroll(FrameView* frameView)
-{
-#if !ENABLE(FAST_MOBILE_SCROLLING) || !PLATFORM(QT)
-    UNUSED_PARAM(frameView);
-#endif
-
-    bool repaintFixedBackgroundsOnScroll = true;
-#if ENABLE(FAST_MOBILE_SCROLLING)
-#if PLATFORM(QT)
-    if (frameView->delegatesScrolling())
-        repaintFixedBackgroundsOnScroll = false;
-#else
-    repaintFixedBackgroundsOnScroll = false;
-#endif
-#endif
-    return repaintFixedBackgroundsOnScroll;
-}
-
-bool RenderObject::s_affectsParentBlock = false;
-bool RenderObject::s_noLongerAffectsParentBlock = false;
-
 RenderObjectAncestorLineboxDirtySet* RenderObject::s_ancestorLineboxDirtySet = 0;
 
 void* RenderObject::operator new(size_t sz, RenderArena& renderArena)
@@ -1788,7 +1758,7 @@
     return false;
 }
 
-inline bool RenderObject::shouldRepaintForStyleDifference(StyleDifference diff) const
+bool RenderObject::shouldRepaintForStyleDifference(StyleDifference diff) const
 {
     return diff == StyleDifferenceRepaint || (diff == StyleDifferenceRepaintIfText && hasImmediateNonWhitespaceTextChild());
 }
@@ -1865,187 +1835,6 @@
     }
 }
 
-static inline bool rendererHasBackground(const RenderObject* renderer)
-{
-    return renderer && renderer->hasBackground();
-}
-
-void RenderObject::styleWillChange(StyleDifference diff, const RenderStyle* newStyle)
-{
-    if (m_style) {
-        // If our z-index changes value or our visibility changes,
-        // we need to dirty our stacking context's z-order list.
-        if (newStyle) {
-            bool visibilityChanged = m_style->visibility() != newStyle->visibility() 
-                || m_style->zIndex() != newStyle->zIndex() 
-                || m_style->hasAutoZIndex() != newStyle->hasAutoZIndex();
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(DRAGGABLE_REGION)
-            if (visibilityChanged)
-                document().setAnnotatedRegionsDirty(true);
-#endif
-            if (visibilityChanged) {
-                if (AXObjectCache* cache = document().existingAXObjectCache())
-                    cache->childrenChanged(parent());
-            }
-
-            // Keep layer hierarchy visibility bits up to date if visibility changes.
-            if (m_style->visibility() != newStyle->visibility()) {
-                if (RenderLayer* l = enclosingLayer()) {
-                    if (newStyle->visibility() == VISIBLE)
-                        l->setHasVisibleContent();
-                    else if (l->hasVisibleContent() && (this == &l->renderer() || l->renderer().style()->visibility() != VISIBLE)) {
-                        l->dirtyVisibleContentStatus();
-                        if (diff > StyleDifferenceRepaintLayer)
-                            repaint();
-                    }
-                }
-            }
-        }
-
-        if (m_parent && (newStyle->outlineSize() < m_style->outlineSize() || shouldRepaintForStyleDifference(diff)))
-            repaint();
-        if (isFloating() && (m_style->floating() != newStyle->floating()))
-            // For changes in float styles, we need to conceivably remove ourselves
-            // from the floating objects list.
-            toRenderBox(this)->removeFloatingOrPositionedChildFromBlockLists();
-        else if (isOutOfFlowPositioned() && (m_style->position() != newStyle->position()))
-            // For changes in positioning styles, we need to conceivably remove ourselves
-            // from the positioned objects list.
-            toRenderBox(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();
-
-        // reset style flags
-        if (diff == StyleDifferenceLayout || diff == StyleDifferenceLayoutPositionedMovementOnly) {
-            setFloating(false);
-            clearPositionedState();
-        }
-        setHorizontalWritingMode(true);
-        setHasBoxDecorations(false);
-        setHasOverflowClip(false);
-        setHasTransform(false);
-        setHasReflection(false);
-    } else {
-        s_affectsParentBlock = false;
-        s_noLongerAffectsParentBlock = false;
-    }
-
-    bool repaintFixedBackgroundsOnScroll = shouldRepaintFixedBackgroundsOnScroll(&view().frameView());
-
-    bool newStyleSlowScroll = newStyle && repaintFixedBackgroundsOnScroll && newStyle->hasFixedBackgroundImage();
-    bool oldStyleSlowScroll = m_style && repaintFixedBackgroundsOnScroll && m_style->hasFixedBackgroundImage();
-
-#if USE(ACCELERATED_COMPOSITING)
-    bool drawsRootBackground = isRoot() || (isBody() && !rendererHasBackground(document().documentElement()->renderer()));
-    if (drawsRootBackground && repaintFixedBackgroundsOnScroll) {
-        if (view().compositor().supportsFixedRootBackgroundCompositing()) {
-            if (newStyleSlowScroll && newStyle->hasEntirelyFixedBackground())
-                newStyleSlowScroll = false;
-
-            if (oldStyleSlowScroll && m_style->hasEntirelyFixedBackground())
-                oldStyleSlowScroll = false;
-        }
-    }
-#endif
-    if (oldStyleSlowScroll != newStyleSlowScroll) {
-        if (oldStyleSlowScroll)
-            view().frameView().removeSlowRepaintObject(this);
-
-        if (newStyleSlowScroll)
-            view().frameView().addSlowRepaintObject(this);
-    }
-}
-
-static bool areNonIdenticalCursorListsEqual(const RenderStyle* a, const RenderStyle* b)
-{
-    ASSERT(a->cursors() != b->cursors());
-    return a->cursors() && b->cursors() && *a->cursors() == *b->cursors();
-}
-
-static inline bool areCursorsEqual(const RenderStyle* a, const RenderStyle* b)
-{
-    return a->cursor() == b->cursor() && (a->cursors() == b->cursors() || areNonIdenticalCursorListsEqual(a, b));
-}
-
-void RenderObject::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
-{
-    if (s_affectsParentBlock)
-        handleDynamicFloatPositionChange();
-
-    if (s_noLongerAffectsParentBlock)
-        removeAnonymousWrappersForInlinesIfNecessary();
-#if ENABLE(SVG)
-    SVGRenderSupport::styleChanged(this);
-#endif
-
-    if (!m_parent)
-        return;
-    
-    if (diff == StyleDifferenceLayout || diff == StyleDifferenceSimplifiedLayout) {
-        RenderCounter::rendererStyleChanged(this, oldStyle, m_style.get());
-
-        // If the object already needs layout, then setNeedsLayout won't do
-        // any work. But if the containing block has changed, then we may need
-        // to mark the new containing blocks for layout. The change that can
-        // directly affect the containing block of this object is a change to
-        // the position style.
-        if (needsLayout() && oldStyle->position() != m_style->position())
-            markContainingBlocksForLayout();
-
-        if (diff == StyleDifferenceLayout)
-            setNeedsLayoutAndPrefWidthsRecalc();
-        else
-            setNeedsSimplifiedNormalFlowLayout();
-    } else if (diff == StyleDifferenceSimplifiedLayoutAndPositionedMovement) {
-        setNeedsPositionedMovementLayout(oldStyle);
-        setNeedsSimplifiedNormalFlowLayout();
-    } else if (diff == StyleDifferenceLayoutPositionedMovementOnly)
-        setNeedsPositionedMovementLayout(oldStyle);
-
-    // Don't check for repaint here; we need to wait until the layer has been
-    // updated by subclasses before we know if we have to repaint (in setStyle()).
-
-    if (oldStyle && !areCursorsEqual(oldStyle, style()))
-        frame().eventHandler().scheduleCursorUpdate();
-}
-
-void RenderObject::propagateStyleToAnonymousChildren(bool blockChildrenOnly)
-{
-    // FIXME: We could save this call when the change only affected non-inherited properties.
-    for (RenderObject* child = firstChildSlow(); child; child = child->nextSibling()) {
-        if (!child->isAnonymous() || child->style()->styleType() != NOPSEUDO)
-            continue;
-
-        if (blockChildrenOnly && !child->isRenderBlock())
-            continue;
-
-#if ENABLE(FULLSCREEN_API)
-        if (child->isRenderFullScreen() || child->isRenderFullScreenPlaceholder())
-            continue;
-#endif
-
-        RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(style(), child->style()->display());
-        if (style()->specifiesColumns()) {
-            if (child->style()->specifiesColumns())
-                newStyle->inheritColumnPropertiesFrom(style());
-            if (child->style()->columnSpan())
-                newStyle->setColumnSpan(ColumnSpanAll);
-        }
-
-        // Preserve the position style of anonymous block continuations as they can have relative or sticky position when
-        // they contain block descendants of relative or sticky positioned inlines.
-        if (child->isInFlowPositioned() && toRenderBlock(child)->isAnonymousBlockContinuation())
-            newStyle->setPosition(child->style()->position());
-
-        child->setStyle(newStyle.release());
-    }
-}
-
 void RenderObject::updateFillImages(const FillLayer* oldLayers, const FillLayer* newLayers)
 {
     // Optimize the common case
@@ -2466,15 +2255,6 @@
 {
     // FIXME: We should ASSERT(isRooted()) but we have some out-of-order removals which would need to be fixed first.
 
-    if (!isText()) {
-        bool repaintFixedBackgroundsOnScroll = shouldRepaintFixedBackgroundsOnScroll(&view().frameView());
-        if (repaintFixedBackgroundsOnScroll && m_style && m_style->hasFixedBackgroundImage())
-            view().frameView().removeSlowRepaintObject(this);
-    }
-
-    if (isOutOfFlowPositioned() && parent()->childrenInline())
-        parent()->dirtyLinesFromChangedChild(this);
-
     removeFromRenderFlowThread();
 
     if (RenderNamedFlowThread* containerFlowThread = parent()->renderNamedFlowThreadWrapper())

Modified: trunk/Source/WebCore/rendering/RenderObject.h (156311 => 156312)


--- trunk/Source/WebCore/rendering/RenderObject.h	2013-09-24 00:51:34 UTC (rev 156311)
+++ trunk/Source/WebCore/rendering/RenderObject.h	2013-09-24 00:55:44 UTC (rev 156312)
@@ -966,10 +966,9 @@
 
 protected:
     // Overrides should call the superclass at the end
-    virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle);
+    virtual void styleWillChange(StyleDifference, const RenderStyle*) { }
     // Overrides should call the superclass at the start
-    virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
-    void propagateStyleToAnonymousChildren(bool blockChildrenOnly = false);
+    virtual void styleDidChange(StyleDifference, const RenderStyle*) { }
 
     void drawLineForBoxSide(GraphicsContext*, int x1, int y1, int x2, int y2, BoxSide,
                             Color, EBorderStyle, int adjbw1, int adjbw2, bool antialias = false);
@@ -1151,11 +1150,6 @@
     void setNeedsSimplifiedNormalFlowLayout(bool b) { m_bitfields.setNeedsSimplifiedNormalFlowLayout(b); }
     void setIsDragging(bool b) { m_bitfields.setIsDragging(b); }
     void setEverHadLayout(bool b) { m_bitfields.setEverHadLayout(b); }
-
-private:
-    // Store state between styleWillChange and styleDidChange
-    static bool s_affectsParentBlock;
-    static bool s_noLongerAffectsParentBlock;
 };
 
 inline bool RenderObject::documentBeingDestroyed() const

Modified: trunk/Source/WebCore/rendering/RenderRuby.cpp (156311 => 156312)


--- trunk/Source/WebCore/rendering/RenderRuby.cpp	2013-09-24 00:51:34 UTC (rev 156311)
+++ trunk/Source/WebCore/rendering/RenderRuby.cpp	2013-09-24 00:55:44 UTC (rev 156312)
@@ -121,7 +121,7 @@
 void RenderRubyAsInline::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
 {
     RenderInline::styleDidChange(diff, oldStyle);
-    propagateStyleToAnonymousChildren();
+    propagateStyleToAnonymousChildren(PropagateToAllChildren);
 }
 
 void RenderRubyAsInline::addChild(RenderObject* child, RenderObject* beforeChild)
@@ -227,7 +227,7 @@
 void RenderRubyAsBlock::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
 {
     RenderBlock::styleDidChange(diff, oldStyle);
-    propagateStyleToAnonymousChildren();
+    propagateStyleToAnonymousChildren(PropagateToAllChildren);
 }
 
 void RenderRubyAsBlock::addChild(RenderObject* child, RenderObject* beforeChild)

Modified: trunk/Source/WebCore/rendering/RenderTable.cpp (156311 => 156312)


--- trunk/Source/WebCore/rendering/RenderTable.cpp	2013-09-24 00:51:34 UTC (rev 156311)
+++ trunk/Source/WebCore/rendering/RenderTable.cpp	2013-09-24 00:55:44 UTC (rev 156312)
@@ -78,7 +78,7 @@
 void RenderTable::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
 {
     RenderBlock::styleDidChange(diff, oldStyle);
-    propagateStyleToAnonymousChildren();
+    propagateStyleToAnonymousChildren(PropagateToAllChildren);
 
     ETableLayout oldTableLayout = oldStyle ? oldStyle->tableLayout() : TAUTO;
 

Modified: trunk/Source/WebCore/rendering/RenderTableRow.cpp (156311 => 156312)


--- trunk/Source/WebCore/rendering/RenderTableRow.cpp	2013-09-24 00:51:34 UTC (rev 156311)
+++ trunk/Source/WebCore/rendering/RenderTableRow.cpp	2013-09-24 00:55:44 UTC (rev 156312)
@@ -66,7 +66,7 @@
     ASSERT(style()->display() == TABLE_ROW);
 
     RenderBox::styleDidChange(diff, oldStyle);
-    propagateStyleToAnonymousChildren();
+    propagateStyleToAnonymousChildren(PropagateToAllChildren);
 
     if (section() && oldStyle && style()->logicalHeight() != oldStyle->logicalHeight())
         section()->rowLogicalHeightChanged(rowIndex());

Modified: trunk/Source/WebCore/rendering/RenderTableSection.cpp (156311 => 156312)


--- trunk/Source/WebCore/rendering/RenderTableSection.cpp	2013-09-24 00:51:34 UTC (rev 156311)
+++ trunk/Source/WebCore/rendering/RenderTableSection.cpp	2013-09-24 00:55:44 UTC (rev 156312)
@@ -106,7 +106,7 @@
 void RenderTableSection::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
 {
     RenderBox::styleDidChange(diff, oldStyle);
-    propagateStyleToAnonymousChildren();
+    propagateStyleToAnonymousChildren(PropagateToAllChildren);
 
     // If border was changed, notify table.
     RenderTable* table = this->table();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to