Changeset 156312 in webkit


Ignore:
Timestamp:
Sep 23, 2013, 5:55:44 PM (11 years ago)
Author:
Antti Koivisto
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.

Location:
trunk/Source/WebCore
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r156311 r156312  
     12013-09-23  Antti Koivisto  <antti@apple.com>
     2
     3        Move style change analysis code to RenderElement
     4        https://bugs.webkit.org/show_bug.cgi?id=121812
     5
     6        Reviewed by Andreas Kling.
     7
     8        Text renderers don't need this. There is no text renderer specific invalidation and text
     9        style never changes independent from the containing RenderElement.
     10
    1112013-09-23  Commit Queue  <commit-queue@webkit.org>
    212
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r156285 r156312  
    326326    }
    327327
    328     propagateStyleToAnonymousChildren(true);   
     328    propagateStyleToAnonymousChildren(PropagateToBlockChildrenOnly);
    329329    m_lineHeight = -1;
    330330
  • trunk/Source/WebCore/rendering/RenderElement.cpp

    r156310 r156312  
    2828#include "AXObjectCache.h"
    2929#include "ContentData.h"
     30#include "CursorList.h"
     31#include "EventHandler.h"
     32#include "Frame.h"
    3033#include "HTMLElement.h"
    3134#include "HTMLNames.h"
     
    5154#include "SVGRenderSupport.h"
    5255
     56#if USE(ACCELERATED_COMPOSITING)
     57#include "RenderLayerCompositor.h"
     58#endif
     59
    5360namespace WebCore {
     61
     62bool RenderElement::s_affectsParentBlock = false;
     63bool RenderElement::s_noLongerAffectsParentBlock = false;
    5464
    5565RenderElement::RenderElement(Element* element)
     
    445455}
    446456
     457void RenderElement::propagateStyleToAnonymousChildren(StylePropagationType propagationType)
     458{
     459    // FIXME: We could save this call when the change only affected non-inherited properties.
     460    for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
     461        if (!child->isAnonymous() || child->style()->styleType() != NOPSEUDO)
     462            continue;
     463
     464        if (propagationType == PropagateToBlockChildrenOnly && !child->isRenderBlock())
     465            continue;
     466
     467#if ENABLE(FULLSCREEN_API)
     468        if (child->isRenderFullScreen() || child->isRenderFullScreenPlaceholder())
     469            continue;
     470#endif
     471
     472        RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(style(), child->style()->display());
     473        if (style()->specifiesColumns()) {
     474            if (child->style()->specifiesColumns())
     475                newStyle->inheritColumnPropertiesFrom(style());
     476            if (child->style()->columnSpan())
     477                newStyle->setColumnSpan(ColumnSpanAll);
     478        }
     479
     480        // Preserve the position style of anonymous block continuations as they can have relative or sticky position when
     481        // they contain block descendants of relative or sticky positioned inlines.
     482        if (child->isInFlowPositioned() && toRenderBlock(child)->isAnonymousBlockContinuation())
     483            newStyle->setPosition(child->style()->position());
     484
     485        child->setStyle(newStyle.release());
     486    }
     487}
     488
     489// On low-powered/mobile devices, preventing blitting on a scroll can cause noticeable delays
     490// when scrolling a page with a fixed background image. As an optimization, assuming there are
     491// no fixed positoned elements on the page, we can acclerate scrolling (via blitting) if we
     492// ignore the CSS property "background-attachment: fixed".
     493static bool shouldRepaintFixedBackgroundsOnScroll(FrameView* frameView)
     494{
     495#if !ENABLE(FAST_MOBILE_SCROLLING) || !PLATFORM(QT)
     496    UNUSED_PARAM(frameView);
     497#endif
     498
     499    bool repaintFixedBackgroundsOnScroll = true;
     500#if ENABLE(FAST_MOBILE_SCROLLING)
     501#if PLATFORM(QT)
     502    if (frameView->delegatesScrolling())
     503        repaintFixedBackgroundsOnScroll = false;
     504#else
     505    repaintFixedBackgroundsOnScroll = false;
     506#endif
     507#endif
     508    return repaintFixedBackgroundsOnScroll;
     509}
     510
     511static inline bool rendererHasBackground(const RenderObject* renderer)
     512{
     513    return renderer && renderer->hasBackground();
     514}
     515
     516void RenderElement::styleWillChange(StyleDifference diff, const RenderStyle* newStyle)
     517{
     518    if (m_style) {
     519        // If our z-index changes value or our visibility changes,
     520        // we need to dirty our stacking context's z-order list.
     521        if (newStyle) {
     522            bool visibilityChanged = m_style->visibility() != newStyle->visibility()
     523                || m_style->zIndex() != newStyle->zIndex()
     524                || m_style->hasAutoZIndex() != newStyle->hasAutoZIndex();
     525#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(DRAGGABLE_REGION)
     526            if (visibilityChanged)
     527                document().setAnnotatedRegionsDirty(true);
     528#endif
     529            if (visibilityChanged) {
     530                if (AXObjectCache* cache = document().existingAXObjectCache())
     531                    cache->childrenChanged(parent());
     532            }
     533
     534            // Keep layer hierarchy visibility bits up to date if visibility changes.
     535            if (m_style->visibility() != newStyle->visibility()) {
     536                if (RenderLayer* layer = enclosingLayer()) {
     537                    if (newStyle->visibility() == VISIBLE)
     538                        layer->setHasVisibleContent();
     539                    else if (layer->hasVisibleContent() && (this == &layer->renderer() || layer->renderer().style()->visibility() != VISIBLE)) {
     540                        layer->dirtyVisibleContentStatus();
     541                        if (diff > StyleDifferenceRepaintLayer)
     542                            repaint();
     543                    }
     544                }
     545            }
     546        }
     547
     548        if (m_parent && (newStyle->outlineSize() < m_style->outlineSize() || shouldRepaintForStyleDifference(diff)))
     549            repaint();
     550        if (isFloating() && (m_style->floating() != newStyle->floating()))
     551            // For changes in float styles, we need to conceivably remove ourselves
     552            // from the floating objects list.
     553            toRenderBox(this)->removeFloatingOrPositionedChildFromBlockLists();
     554        else if (isOutOfFlowPositioned() && (m_style->position() != newStyle->position()))
     555            // For changes in positioning styles, we need to conceivably remove ourselves
     556            // from the positioned objects list.
     557            toRenderBox(this)->removeFloatingOrPositionedChildFromBlockLists();
     558
     559        s_affectsParentBlock = isFloatingOrOutOfFlowPositioned()
     560            && (!newStyle->isFloating() && !newStyle->hasOutOfFlowPosition())
     561            && parent() && (parent()->isRenderBlockFlow() || parent()->isRenderInline());
     562
     563        s_noLongerAffectsParentBlock = ((!isFloating() && newStyle->isFloating()) || (!isOutOfFlowPositioned() && newStyle->hasOutOfFlowPosition()))
     564            && parent() && parent()->isRenderBlock();
     565
     566        // reset style flags
     567        if (diff == StyleDifferenceLayout || diff == StyleDifferenceLayoutPositionedMovementOnly) {
     568            setFloating(false);
     569            clearPositionedState();
     570        }
     571        setHorizontalWritingMode(true);
     572        setHasBoxDecorations(false);
     573        setHasOverflowClip(false);
     574        setHasTransform(false);
     575        setHasReflection(false);
     576    } else {
     577        s_affectsParentBlock = false;
     578        s_noLongerAffectsParentBlock = false;
     579    }
     580
     581    bool repaintFixedBackgroundsOnScroll = shouldRepaintFixedBackgroundsOnScroll(&view().frameView());
     582
     583    bool newStyleSlowScroll = newStyle && repaintFixedBackgroundsOnScroll && newStyle->hasFixedBackgroundImage();
     584    bool oldStyleSlowScroll = m_style && repaintFixedBackgroundsOnScroll && m_style->hasFixedBackgroundImage();
     585
     586#if USE(ACCELERATED_COMPOSITING)
     587    bool drawsRootBackground = isRoot() || (isBody() && !rendererHasBackground(document().documentElement()->renderer()));
     588    if (drawsRootBackground && repaintFixedBackgroundsOnScroll) {
     589        if (view().compositor().supportsFixedRootBackgroundCompositing()) {
     590            if (newStyleSlowScroll && newStyle->hasEntirelyFixedBackground())
     591                newStyleSlowScroll = false;
     592
     593            if (oldStyleSlowScroll && m_style->hasEntirelyFixedBackground())
     594                oldStyleSlowScroll = false;
     595        }
     596    }
     597#endif
     598    if (oldStyleSlowScroll != newStyleSlowScroll) {
     599        if (oldStyleSlowScroll)
     600            view().frameView().removeSlowRepaintObject(this);
     601
     602        if (newStyleSlowScroll)
     603            view().frameView().addSlowRepaintObject(this);
     604    }
     605}
     606
     607static bool areNonIdenticalCursorListsEqual(const RenderStyle* a, const RenderStyle* b)
     608{
     609    ASSERT(a->cursors() != b->cursors());
     610    return a->cursors() && b->cursors() && *a->cursors() == *b->cursors();
     611}
     612
     613static inline bool areCursorsEqual(const RenderStyle* a, const RenderStyle* b)
     614{
     615    return a->cursor() == b->cursor() && (a->cursors() == b->cursors() || areNonIdenticalCursorListsEqual(a, b));
     616}
     617
     618void RenderElement::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
     619{
     620    if (s_affectsParentBlock)
     621        handleDynamicFloatPositionChange();
     622
     623    if (s_noLongerAffectsParentBlock)
     624        removeAnonymousWrappersForInlinesIfNecessary();
     625#if ENABLE(SVG)
     626    SVGRenderSupport::styleChanged(this);
     627#endif
     628
     629    if (!m_parent)
     630        return;
     631   
     632    if (diff == StyleDifferenceLayout || diff == StyleDifferenceSimplifiedLayout) {
     633        RenderCounter::rendererStyleChanged(this, oldStyle, m_style.get());
     634
     635        // If the object already needs layout, then setNeedsLayout won't do
     636        // any work. But if the containing block has changed, then we may need
     637        // to mark the new containing blocks for layout. The change that can
     638        // directly affect the containing block of this object is a change to
     639        // the position style.
     640        if (needsLayout() && oldStyle->position() != m_style->position())
     641            markContainingBlocksForLayout();
     642
     643        if (diff == StyleDifferenceLayout)
     644            setNeedsLayoutAndPrefWidthsRecalc();
     645        else
     646            setNeedsSimplifiedNormalFlowLayout();
     647    } else if (diff == StyleDifferenceSimplifiedLayoutAndPositionedMovement) {
     648        setNeedsPositionedMovementLayout(oldStyle);
     649        setNeedsSimplifiedNormalFlowLayout();
     650    } else if (diff == StyleDifferenceLayoutPositionedMovementOnly)
     651        setNeedsPositionedMovementLayout(oldStyle);
     652
     653    // Don't check for repaint here; we need to wait until the layer has been
     654    // updated by subclasses before we know if we have to repaint (in setStyle()).
     655
     656    if (oldStyle && !areCursorsEqual(oldStyle, style()))
     657        frame().eventHandler().scheduleCursorUpdate();
     658}
     659
    447660void RenderElement::insertedIntoTree()
    448661{
     
    481694        removeLayers(layer);
    482695    }
     696
     697    bool repaintFixedBackgroundsOnScroll = shouldRepaintFixedBackgroundsOnScroll(&view().frameView());
     698    if (repaintFixedBackgroundsOnScroll && m_style && m_style->hasFixedBackgroundImage())
     699        view().frameView().removeSlowRepaintObject(this);
     700
     701    if (isOutOfFlowPositioned() && parent()->childrenInline())
     702        parent()->dirtyLinesFromChangedChild(this);
    483703
    484704    RenderObject::willBeRemovedFromTree();
  • trunk/Source/WebCore/rendering/RenderElement.h

    r156310 r156312  
    6767    bool layerCreationAllowedForSubtree() const;
    6868
     69    enum StylePropagationType { PropagateToAllChildren, PropagateToBlockChildrenOnly };
     70    void propagateStyleToAnonymousChildren(StylePropagationType);
     71
    6972    LayoutUnit valueForLength(const Length&, LayoutUnit maximumValue, bool roundPercentages = false) const;
    7073    LayoutUnit minimumValueForLength(const Length&, LayoutUnit maximumValue, bool roundPercentages = false) const;
     
    7477    void destroyLeftoverChildren();
    7578
     79    virtual void styleWillChange(StyleDifference, const RenderStyle*) OVERRIDE;
     80    virtual void styleDidChange(StyleDifference, const RenderStyle*) OVERRIDE;
    7681    virtual void insertedIntoTree() OVERRIDE;
    7782    virtual void willBeRemovedFromTree() OVERRIDE;
     
    8590    void isRenderElement() const WTF_DELETED_FUNCTION;
    8691
    87     virtual RenderObject* firstChildSlow() const { return firstChild(); }
    88     virtual RenderObject* lastChildSlow() const { return lastChild(); }
     92    virtual RenderObject* firstChildSlow() const OVERRIDE FINAL { return firstChild(); }
     93    virtual RenderObject* lastChildSlow() const OVERRIDE FINAL { return lastChild(); }
    8994
    9095    RenderObject* m_firstChild;
    9196    RenderObject* m_lastChild;
     97
     98    // FIXME: Get rid of this hack.
     99    // Store state between styleWillChange and styleDidChange
     100    static bool s_affectsParentBlock;
     101    static bool s_noLongerAffectsParentBlock;
    92102};
    93103
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r156310 r156312  
    3030#include "AXObjectCache.h"
    3131#include "AnimationController.h"
    32 #include "CursorList.h"
    3332#include "EventHandler.h"
    3433#include "FloatQuad.h"
     
    6665#include <wtf/StackStats.h>
    6766
    68 #if USE(ACCELERATED_COMPOSITING)
    69 #include "RenderLayerCompositor.h"
    70 #endif
    71 
    7267#if ENABLE(SVG)
    7368#include "RenderSVGResourceContainer.h"
     
    107102
    108103COMPILE_ASSERT(sizeof(RenderObject) == sizeof(SameSizeAsRenderObject), RenderObject_should_stay_small);
    109 
    110 // On low-powered/mobile devices, preventing blitting on a scroll can cause noticeable delays
    111 // when scrolling a page with a fixed background image. As an optimization, assuming there are
    112 // no fixed positoned elements on the page, we can acclerate scrolling (via blitting) if we
    113 // ignore the CSS property "background-attachment: fixed".
    114 static bool shouldRepaintFixedBackgroundsOnScroll(FrameView* frameView)
    115 {
    116 #if !ENABLE(FAST_MOBILE_SCROLLING) || !PLATFORM(QT)
    117     UNUSED_PARAM(frameView);
    118 #endif
    119 
    120     bool repaintFixedBackgroundsOnScroll = true;
    121 #if ENABLE(FAST_MOBILE_SCROLLING)
    122 #if PLATFORM(QT)
    123     if (frameView->delegatesScrolling())
    124         repaintFixedBackgroundsOnScroll = false;
    125 #else
    126     repaintFixedBackgroundsOnScroll = false;
    127 #endif
    128 #endif
    129     return repaintFixedBackgroundsOnScroll;
    130 }
    131 
    132 bool RenderObject::s_affectsParentBlock = false;
    133 bool RenderObject::s_noLongerAffectsParentBlock = false;
    134104
    135105RenderObjectAncestorLineboxDirtySet* RenderObject::s_ancestorLineboxDirtySet = 0;
     
    17891759}
    17901760
    1791 inline bool RenderObject::shouldRepaintForStyleDifference(StyleDifference diff) const
     1761bool RenderObject::shouldRepaintForStyleDifference(StyleDifference diff) const
    17921762{
    17931763    return diff == StyleDifferenceRepaint || (diff == StyleDifferenceRepaintIfText && hasImmediateNonWhitespaceTextChild());
     
    18631833        // not having an outline to having an outline.
    18641834        repaint();
    1865     }
    1866 }
    1867 
    1868 static inline bool rendererHasBackground(const RenderObject* renderer)
    1869 {
    1870     return renderer && renderer->hasBackground();
    1871 }
    1872 
    1873 void RenderObject::styleWillChange(StyleDifference diff, const RenderStyle* newStyle)
    1874 {
    1875     if (m_style) {
    1876         // If our z-index changes value or our visibility changes,
    1877         // we need to dirty our stacking context's z-order list.
    1878         if (newStyle) {
    1879             bool visibilityChanged = m_style->visibility() != newStyle->visibility()
    1880                 || m_style->zIndex() != newStyle->zIndex()
    1881                 || m_style->hasAutoZIndex() != newStyle->hasAutoZIndex();
    1882 #if ENABLE(DASHBOARD_SUPPORT) || ENABLE(DRAGGABLE_REGION)
    1883             if (visibilityChanged)
    1884                 document().setAnnotatedRegionsDirty(true);
    1885 #endif
    1886             if (visibilityChanged) {
    1887                 if (AXObjectCache* cache = document().existingAXObjectCache())
    1888                     cache->childrenChanged(parent());
    1889             }
    1890 
    1891             // Keep layer hierarchy visibility bits up to date if visibility changes.
    1892             if (m_style->visibility() != newStyle->visibility()) {
    1893                 if (RenderLayer* l = enclosingLayer()) {
    1894                     if (newStyle->visibility() == VISIBLE)
    1895                         l->setHasVisibleContent();
    1896                     else if (l->hasVisibleContent() && (this == &l->renderer() || l->renderer().style()->visibility() != VISIBLE)) {
    1897                         l->dirtyVisibleContentStatus();
    1898                         if (diff > StyleDifferenceRepaintLayer)
    1899                             repaint();
    1900                     }
    1901                 }
    1902             }
    1903         }
    1904 
    1905         if (m_parent && (newStyle->outlineSize() < m_style->outlineSize() || shouldRepaintForStyleDifference(diff)))
    1906             repaint();
    1907         if (isFloating() && (m_style->floating() != newStyle->floating()))
    1908             // For changes in float styles, we need to conceivably remove ourselves
    1909             // from the floating objects list.
    1910             toRenderBox(this)->removeFloatingOrPositionedChildFromBlockLists();
    1911         else if (isOutOfFlowPositioned() && (m_style->position() != newStyle->position()))
    1912             // For changes in positioning styles, we need to conceivably remove ourselves
    1913             // from the positioned objects list.
    1914             toRenderBox(this)->removeFloatingOrPositionedChildFromBlockLists();
    1915 
    1916         s_affectsParentBlock = isFloatingOrOutOfFlowPositioned()
    1917             && (!newStyle->isFloating() && !newStyle->hasOutOfFlowPosition())
    1918             && parent() && (parent()->isRenderBlockFlow() || parent()->isRenderInline());
    1919 
    1920         s_noLongerAffectsParentBlock = ((!isFloating() && newStyle->isFloating()) || (!isOutOfFlowPositioned() && newStyle->hasOutOfFlowPosition()))
    1921             && parent() && parent()->isRenderBlock();
    1922 
    1923         // reset style flags
    1924         if (diff == StyleDifferenceLayout || diff == StyleDifferenceLayoutPositionedMovementOnly) {
    1925             setFloating(false);
    1926             clearPositionedState();
    1927         }
    1928         setHorizontalWritingMode(true);
    1929         setHasBoxDecorations(false);
    1930         setHasOverflowClip(false);
    1931         setHasTransform(false);
    1932         setHasReflection(false);
    1933     } else {
    1934         s_affectsParentBlock = false;
    1935         s_noLongerAffectsParentBlock = false;
    1936     }
    1937 
    1938     bool repaintFixedBackgroundsOnScroll = shouldRepaintFixedBackgroundsOnScroll(&view().frameView());
    1939 
    1940     bool newStyleSlowScroll = newStyle && repaintFixedBackgroundsOnScroll && newStyle->hasFixedBackgroundImage();
    1941     bool oldStyleSlowScroll = m_style && repaintFixedBackgroundsOnScroll && m_style->hasFixedBackgroundImage();
    1942 
    1943 #if USE(ACCELERATED_COMPOSITING)
    1944     bool drawsRootBackground = isRoot() || (isBody() && !rendererHasBackground(document().documentElement()->renderer()));
    1945     if (drawsRootBackground && repaintFixedBackgroundsOnScroll) {
    1946         if (view().compositor().supportsFixedRootBackgroundCompositing()) {
    1947             if (newStyleSlowScroll && newStyle->hasEntirelyFixedBackground())
    1948                 newStyleSlowScroll = false;
    1949 
    1950             if (oldStyleSlowScroll && m_style->hasEntirelyFixedBackground())
    1951                 oldStyleSlowScroll = false;
    1952         }
    1953     }
    1954 #endif
    1955     if (oldStyleSlowScroll != newStyleSlowScroll) {
    1956         if (oldStyleSlowScroll)
    1957             view().frameView().removeSlowRepaintObject(this);
    1958 
    1959         if (newStyleSlowScroll)
    1960             view().frameView().addSlowRepaintObject(this);
    1961     }
    1962 }
    1963 
    1964 static bool areNonIdenticalCursorListsEqual(const RenderStyle* a, const RenderStyle* b)
    1965 {
    1966     ASSERT(a->cursors() != b->cursors());
    1967     return a->cursors() && b->cursors() && *a->cursors() == *b->cursors();
    1968 }
    1969 
    1970 static inline bool areCursorsEqual(const RenderStyle* a, const RenderStyle* b)
    1971 {
    1972     return a->cursor() == b->cursor() && (a->cursors() == b->cursors() || areNonIdenticalCursorListsEqual(a, b));
    1973 }
    1974 
    1975 void RenderObject::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
    1976 {
    1977     if (s_affectsParentBlock)
    1978         handleDynamicFloatPositionChange();
    1979 
    1980     if (s_noLongerAffectsParentBlock)
    1981         removeAnonymousWrappersForInlinesIfNecessary();
    1982 #if ENABLE(SVG)
    1983     SVGRenderSupport::styleChanged(this);
    1984 #endif
    1985 
    1986     if (!m_parent)
    1987         return;
    1988    
    1989     if (diff == StyleDifferenceLayout || diff == StyleDifferenceSimplifiedLayout) {
    1990         RenderCounter::rendererStyleChanged(this, oldStyle, m_style.get());
    1991 
    1992         // If the object already needs layout, then setNeedsLayout won't do
    1993         // any work. But if the containing block has changed, then we may need
    1994         // to mark the new containing blocks for layout. The change that can
    1995         // directly affect the containing block of this object is a change to
    1996         // the position style.
    1997         if (needsLayout() && oldStyle->position() != m_style->position())
    1998             markContainingBlocksForLayout();
    1999 
    2000         if (diff == StyleDifferenceLayout)
    2001             setNeedsLayoutAndPrefWidthsRecalc();
    2002         else
    2003             setNeedsSimplifiedNormalFlowLayout();
    2004     } else if (diff == StyleDifferenceSimplifiedLayoutAndPositionedMovement) {
    2005         setNeedsPositionedMovementLayout(oldStyle);
    2006         setNeedsSimplifiedNormalFlowLayout();
    2007     } else if (diff == StyleDifferenceLayoutPositionedMovementOnly)
    2008         setNeedsPositionedMovementLayout(oldStyle);
    2009 
    2010     // Don't check for repaint here; we need to wait until the layer has been
    2011     // updated by subclasses before we know if we have to repaint (in setStyle()).
    2012 
    2013     if (oldStyle && !areCursorsEqual(oldStyle, style()))
    2014         frame().eventHandler().scheduleCursorUpdate();
    2015 }
    2016 
    2017 void RenderObject::propagateStyleToAnonymousChildren(bool blockChildrenOnly)
    2018 {
    2019     // FIXME: We could save this call when the change only affected non-inherited properties.
    2020     for (RenderObject* child = firstChildSlow(); child; child = child->nextSibling()) {
    2021         if (!child->isAnonymous() || child->style()->styleType() != NOPSEUDO)
    2022             continue;
    2023 
    2024         if (blockChildrenOnly && !child->isRenderBlock())
    2025             continue;
    2026 
    2027 #if ENABLE(FULLSCREEN_API)
    2028         if (child->isRenderFullScreen() || child->isRenderFullScreenPlaceholder())
    2029             continue;
    2030 #endif
    2031 
    2032         RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(style(), child->style()->display());
    2033         if (style()->specifiesColumns()) {
    2034             if (child->style()->specifiesColumns())
    2035                 newStyle->inheritColumnPropertiesFrom(style());
    2036             if (child->style()->columnSpan())
    2037                 newStyle->setColumnSpan(ColumnSpanAll);
    2038         }
    2039 
    2040         // Preserve the position style of anonymous block continuations as they can have relative or sticky position when
    2041         // they contain block descendants of relative or sticky positioned inlines.
    2042         if (child->isInFlowPositioned() && toRenderBlock(child)->isAnonymousBlockContinuation())
    2043             newStyle->setPosition(child->style()->position());
    2044 
    2045         child->setStyle(newStyle.release());
    20461835    }
    20471836}
     
    24662255{
    24672256    // FIXME: We should ASSERT(isRooted()) but we have some out-of-order removals which would need to be fixed first.
    2468 
    2469     if (!isText()) {
    2470         bool repaintFixedBackgroundsOnScroll = shouldRepaintFixedBackgroundsOnScroll(&view().frameView());
    2471         if (repaintFixedBackgroundsOnScroll && m_style && m_style->hasFixedBackgroundImage())
    2472             view().frameView().removeSlowRepaintObject(this);
    2473     }
    2474 
    2475     if (isOutOfFlowPositioned() && parent()->childrenInline())
    2476         parent()->dirtyLinesFromChangedChild(this);
    24772257
    24782258    removeFromRenderFlowThread();
  • trunk/Source/WebCore/rendering/RenderObject.h

    r156310 r156312  
    967967protected:
    968968    // Overrides should call the superclass at the end
    969     virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle);
     969    virtual void styleWillChange(StyleDifference, const RenderStyle*) { }
    970970    // Overrides should call the superclass at the start
    971     virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
    972     void propagateStyleToAnonymousChildren(bool blockChildrenOnly = false);
     971    virtual void styleDidChange(StyleDifference, const RenderStyle*) { }
    973972
    974973    void drawLineForBoxSide(GraphicsContext*, int x1, int y1, int x2, int y2, BoxSide,
     
    11521151    void setIsDragging(bool b) { m_bitfields.setIsDragging(b); }
    11531152    void setEverHadLayout(bool b) { m_bitfields.setEverHadLayout(b); }
    1154 
    1155 private:
    1156     // Store state between styleWillChange and styleDidChange
    1157     static bool s_affectsParentBlock;
    1158     static bool s_noLongerAffectsParentBlock;
    11591153};
    11601154
  • trunk/Source/WebCore/rendering/RenderRuby.cpp

    r156285 r156312  
    122122{
    123123    RenderInline::styleDidChange(diff, oldStyle);
    124     propagateStyleToAnonymousChildren();
     124    propagateStyleToAnonymousChildren(PropagateToAllChildren);
    125125}
    126126
     
    228228{
    229229    RenderBlock::styleDidChange(diff, oldStyle);
    230     propagateStyleToAnonymousChildren();
     230    propagateStyleToAnonymousChildren(PropagateToAllChildren);
    231231}
    232232
  • trunk/Source/WebCore/rendering/RenderTable.cpp

    r156285 r156312  
    7979{
    8080    RenderBlock::styleDidChange(diff, oldStyle);
    81     propagateStyleToAnonymousChildren();
     81    propagateStyleToAnonymousChildren(PropagateToAllChildren);
    8282
    8383    ETableLayout oldTableLayout = oldStyle ? oldStyle->tableLayout() : TAUTO;
  • trunk/Source/WebCore/rendering/RenderTableRow.cpp

    r156285 r156312  
    6767
    6868    RenderBox::styleDidChange(diff, oldStyle);
    69     propagateStyleToAnonymousChildren();
     69    propagateStyleToAnonymousChildren(PropagateToAllChildren);
    7070
    7171    if (section() && oldStyle && style()->logicalHeight() != oldStyle->logicalHeight())
  • trunk/Source/WebCore/rendering/RenderTableSection.cpp

    r156285 r156312  
    107107{
    108108    RenderBox::styleDidChange(diff, oldStyle);
    109     propagateStyleToAnonymousChildren();
     109    propagateStyleToAnonymousChildren(PropagateToAllChildren);
    110110
    111111    // If border was changed, notify table.
Note: See TracChangeset for help on using the changeset viewer.