Changeset 140620 in webkit


Ignore:
Timestamp:
Jan 23, 2013 5:42:08 PM (11 years ago)
Author:
vollick@chromium.org
Message:

Introduce the "stacking container" concept.
https://bugs.webkit.org/show_bug.cgi?id=107734

Reviewed by Simon Fraser.

A stacking container is treated just like a stacking context. That
is, it has z-order lists, it and its descendants are stacked as a
unit, and when the RenderLayerCompositor does its overlap testing,
the composited regions for all layer lists take effect only once the
stacking container is done being processed.

This patch also adds the function RenderLayer::isStackingContainer().
Currently, this is equivalent to RenderLayer::isStackingContext(),
but in future, the definition of stacking container will be broadened
to encompass more than just stacking contexts.

Other than the addition of this extra function, the patch is mostly
comprised of name changes. Any code that used to refer to the
stacking context concept, but didn't necessarily require a stacking
context in the strict, CSS-sense, was switched to refer to stacking
container. No functionality was changed.

No new tests, no change in functionality.

Source/WebCore:

  • inspector/InspectorLayerTreeAgent.cpp:

(WebCore::InspectorLayerTreeAgent::buildObjectForLayer):

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::RenderLayer):
(WebCore):
(WebCore::RenderLayer::updatePagination):
(WebCore::RenderLayer::canBeStackingContainer):
(WebCore::RenderLayer::setHasVisibleContent):
(WebCore::RenderLayer::dirty3DTransformedDescendantStatus):
(WebCore::RenderLayer::stackingContainer):
(WebCore::compositingContainer):
(WebCore::expandClipRectForDescendantsAndReflection):
(WebCore::RenderLayer::addChild):
(WebCore::RenderLayer::removeChild):
(WebCore::RenderLayer::updateNeedsCompositedScrolling):
(WebCore::RenderLayer::updateCompositingLayersAfterScroll):
(WebCore::RenderLayer::paintPaginatedChildLayer):
(WebCore::RenderLayer::hitTestPaginatedChildLayer):
(WebCore::RenderLayer::calculateLayerBounds):
(WebCore::RenderLayer::dirtyZOrderLists):
(WebCore::RenderLayer::dirtyStackingContainerZOrderLists):
(WebCore::RenderLayer::collectLayers):
(WebCore::RenderLayer::updateCompositingAndLayerListsIfNeeded):
(WebCore::RenderLayer::updateStackingContextsAfterStyleChange):
(WebCore::RenderLayer::styleChanged):

  • rendering/RenderLayer.h:

(RenderLayer):
(WebCore::RenderLayer::isStackingContainer):
(WebCore::RenderLayer::posZOrderList):
(WebCore::RenderLayer::negZOrderList):
(WebCore::RenderLayer::isDirtyStackingContainer):
(WebCore::RenderLayer::clearZOrderLists):
(WebCore::RenderLayer::updateZOrderLists):

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
(WebCore::RenderLayerBacking::compositingOpacity):
(WebCore::RenderLayerBacking::hasVisibleNonCompositingDescendantLayers):

  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::enclosingNonStackingClippingLayer):
(WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
(WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
(WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
(WebCore::RenderLayerCompositor::requiresCompositingForPosition):
(WebCore::RenderLayerCompositor::layerHas3DContent):
(WebCore::isRootmostFixedOrStickyLayer):

Source/WebKit2:

  • WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:

(WebKit::updateOffsetFromViewportForSelf):

Location:
trunk/Source
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r140617 r140620  
     12013-01-23  Ian Vollick  <vollick@chromium.org>
     2
     3        Introduce the "stacking container" concept.
     4        https://bugs.webkit.org/show_bug.cgi?id=107734
     5
     6        Reviewed by Simon Fraser.
     7
     8        A stacking container is treated just like a stacking context. That
     9        is, it has z-order lists, it and its descendants are stacked as a
     10        unit, and when the RenderLayerCompositor does its overlap testing,
     11        the composited regions for all layer lists take effect only once the
     12        stacking container is done being processed.
     13
     14        This patch also adds the function RenderLayer::isStackingContainer().
     15        Currently, this is equivalent to RenderLayer::isStackingContext(),
     16        but in future, the definition of stacking container will be broadened
     17        to encompass more than just stacking contexts.
     18
     19        Other than the addition of this extra function, the patch is mostly
     20        comprised of name changes. Any code that used to refer to the
     21        stacking context concept, but didn't necessarily require a stacking
     22        context in the strict, CSS-sense, was switched to refer to stacking
     23        container. No functionality was changed.
     24
     25        No new tests, no change in functionality.
     26
     27        * inspector/InspectorLayerTreeAgent.cpp:
     28        (WebCore::InspectorLayerTreeAgent::buildObjectForLayer):
     29        * rendering/RenderLayer.cpp:
     30        (WebCore::RenderLayer::RenderLayer):
     31        (WebCore):
     32        (WebCore::RenderLayer::updatePagination):
     33        (WebCore::RenderLayer::canBeStackingContainer):
     34        (WebCore::RenderLayer::setHasVisibleContent):
     35        (WebCore::RenderLayer::dirty3DTransformedDescendantStatus):
     36        (WebCore::RenderLayer::stackingContainer):
     37        (WebCore::compositingContainer):
     38        (WebCore::expandClipRectForDescendantsAndReflection):
     39        (WebCore::RenderLayer::addChild):
     40        (WebCore::RenderLayer::removeChild):
     41        (WebCore::RenderLayer::updateNeedsCompositedScrolling):
     42        (WebCore::RenderLayer::updateCompositingLayersAfterScroll):
     43        (WebCore::RenderLayer::paintPaginatedChildLayer):
     44        (WebCore::RenderLayer::hitTestPaginatedChildLayer):
     45        (WebCore::RenderLayer::calculateLayerBounds):
     46        (WebCore::RenderLayer::dirtyZOrderLists):
     47        (WebCore::RenderLayer::dirtyStackingContainerZOrderLists):
     48        (WebCore::RenderLayer::collectLayers):
     49        (WebCore::RenderLayer::updateCompositingAndLayerListsIfNeeded):
     50        (WebCore::RenderLayer::updateStackingContextsAfterStyleChange):
     51        (WebCore::RenderLayer::styleChanged):
     52        * rendering/RenderLayer.h:
     53        (RenderLayer):
     54        (WebCore::RenderLayer::isStackingContainer):
     55        (WebCore::RenderLayer::posZOrderList):
     56        (WebCore::RenderLayer::negZOrderList):
     57        (WebCore::RenderLayer::isDirtyStackingContainer):
     58        (WebCore::RenderLayer::clearZOrderLists):
     59        (WebCore::RenderLayer::updateZOrderLists):
     60        * rendering/RenderLayerBacking.cpp:
     61        (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
     62        (WebCore::RenderLayerBacking::compositingOpacity):
     63        (WebCore::RenderLayerBacking::hasVisibleNonCompositingDescendantLayers):
     64        * rendering/RenderLayerCompositor.cpp:
     65        (WebCore::RenderLayerCompositor::enclosingNonStackingClippingLayer):
     66        (WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
     67        (WebCore::RenderLayerCompositor::computeCompositingRequirements):
     68        (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
     69        (WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
     70        (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
     71        (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
     72        (WebCore::RenderLayerCompositor::layerHas3DContent):
     73        (WebCore::isRootmostFixedOrStickyLayer):
     74
    1752013-01-23  Simon Fraser  <simon.fraser@apple.com>
    276
  • trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp

    r138457 r140620  
    150150        childrenArray->addItem(buildObjectForLayer(renderLayer->reflectionLayer()));
    151151
    152     if (renderLayer->isStackingContext()) {
     152    if (renderLayer->isStackingContainer()) {
    153153        if (Vector<RenderLayer*>* negZOrderList = renderLayer->negZOrderList()) {
    154154            size_t listSize = negZOrderList->size();
     
    164164    }
    165165   
    166     if (renderLayer->isStackingContext()) {
     166    if (renderLayer->isStackingContainer()) {
    167167        if (Vector<RenderLayer*>* posZOrderList = renderLayer->posZOrderList()) {
    168168            size_t listSize = posZOrderList->size();
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r140546 r140620  
    197197    m_isSelfPaintingLayer = shouldBeSelfPaintingLayer();
    198198
    199     // Non-stacking contexts should have empty z-order lists. As this is already the case,
     199    // Non-stacking containers should have empty z-order lists. As this is already the case,
    200200    // there is no need to dirty / recompute these lists.
    201     m_zOrderListsDirty = isStackingContext();
     201    m_zOrderListsDirty = isStackingContainer();
    202202
    203203    ScrollableArea::setConstrainsScrollingToContentEdge(false);
     
    523523}
    524524
    525 // If we are a stacking context, then this function will determine if our
     525// If we are a stacking container, then this function will determine if our
    526526// descendants for a contiguous block in stacking order. This is required in
    527 // order for an element to be safely promoted to a stacking context. It is safe
    528 // to become a stacking context if this change would not alter the stacking
     527// order for an element to be safely promoted to a stacking container. It is safe
     528// to become a stacking container if this change would not alter the stacking
    529529// order of layers on the page. That can only happen if a non-descendant appear
    530530// between us and our descendants in stacking order. Here's an example:
     
    539539//
    540540// I've labeled our normal flow descendants A, B, C, and D, our stacking
    541 // context descendants with their z indices, and us with 'this' (we're a
    542 // stacking context and our zIndex doesn't matter here). These nodes appear in
     541// container descendants with their z indices, and us with 'this' (we're a
     542// stacking container and our zIndex doesn't matter here). These nodes appear in
    543543// three lists: posZOrder, negZOrder, and normal flow (keep in mind that normal
    544544// flow layers don't overlap). So if we arrange these lists in order we get our
     
    556556// Note that the normal flow descendants can share an index because they don't
    557557// stack/overlap. Now our problem becomes very simple: a layer can safely become
    558 // a stacking context if the stacking-order indices of it and its descendants
     558// a stacking container if the stacking-order indices of it and its descendants
    559559// appear in a contiguous block in the list of stacking indices. This problem
    560560// can be solved very efficiently by calculating the min/max stacking indices in
    561 // the subtree, and the number stacking context descendants. Once we have this
     561// the subtree, and the number stacking container descendants. Once we have this
    562562// information, we know that the subtree's indices form a contiguous block if:
    563563//
     
    574574//  ===>                             2 == 2
    575575//
    576 //  Since this is true, A can safely become a stacking context.
     576//  Since this is true, A can safely become a stacking container.
    577577//  Now, for node C we have:
    578578//
     
    586586//  ===>                             4 == 2
    587587//
    588 // Since this is false, C cannot be safely promoted to a stacking context. This
     588// Since this is false, C cannot be safely promoted to a stacking container. This
    589589// happened because of the elements with z-index 5 and 0. Now if 5 had been a
    590590// child of C rather than D, and A had no child with Z index 0, we would have had:
     
    916916    }
    917917
    918     // If we're not normal flow, then we need to look for a multi-column object between us and our stacking context.
    919     RenderLayer* ancestorStackingContext = stackingContext();
     918    // If we're not normal flow, then we need to look for a multi-column object between us and our stacking container.
     919    RenderLayer* ancestorStackingContainer = stackingContainer();
    920920    for (RenderLayer* curr = parent(); curr; curr = curr->parent()) {
    921921        if (curr->renderer()->hasColumns()) {
     
    923923            return;
    924924        }
    925         if (curr == ancestorStackingContext)
     925        if (curr == ancestorStackingContainer)
    926926            return;
    927927    }
    928928}
    929929
    930 bool RenderLayer::canSafelyEstablishAStackingContext() const
    931 {
    932     if (isStackingContext() || !stackingContext())
     930bool RenderLayer::canBeStackingContainer() const
     931{
     932    if (isStackingContext() || !stackingContainer())
    933933        return true;
    934934
     
    948948    if (!isNormalFlowOnly()) {
    949949        // We don't collect invisible layers in z-order lists if we are not in compositing mode.
    950         // As we became visible, we need to dirty our stacking contexts ancestors to be properly
     950        // As we became visible, we need to dirty our stacking containers ancestors to be properly
    951951        // collected. FIXME: When compositing, we could skip this dirtying phase.
    952         for (RenderLayer* sc = stackingContext(); sc; sc = sc->stackingContext()) {
     952        for (RenderLayer* sc = stackingContainer(); sc; sc = sc->stackingContainer()) {
    953953            sc->dirtyZOrderLists();
    954954            if (sc->hasVisibleContent())
     
    10691069void RenderLayer::dirty3DTransformedDescendantStatus()
    10701070{
    1071     RenderLayer* curr = stackingContext();
     1071    RenderLayer* curr = stackingContainer();
    10721072    if (curr)
    10731073        curr->m_3DTransformedDescendantStatusDirty = true;
    10741074       
    10751075    // This propagates up through preserve-3d hierarchies to the enclosing flattening layer.
    1076     // Note that preserves3D() creates stacking context, so we can just run up the stacking contexts.
     1076    // Note that preserves3D() creates stacking context, so we can just run up the stacking containers.
    10771077    while (curr && curr->preserves3D()) {
    10781078        curr->m_3DTransformedDescendantStatusDirty = true;
    1079         curr = curr->stackingContext();
     1079        curr = curr->stackingContainer();
    10801080    }
    10811081}
     
    12401240}
    12411241
    1242 RenderLayer* RenderLayer::stackingContext() const
     1242RenderLayer* RenderLayer::stackingContainer() const
    12431243{
    12441244    RenderLayer* layer = parent();
    1245     while (layer && !layer->isStackingContext())
     1245    while (layer && !layer->isStackingContainer())
    12461246        layer = layer->parent();
    12471247
    1248     ASSERT(!layer || layer->isStackingContext());
     1248    ASSERT(!layer || layer->isStackingContainer());
    12491249    return layer;
    12501250}
     
    12961296static inline const RenderLayer* compositingContainer(const RenderLayer* layer)
    12971297{
    1298     return layer->isNormalFlowOnly() ? layer->parent() : layer->stackingContext();
     1298    return layer->isNormalFlowOnly() ? layer->parent() : layer->stackingContainer();
    12991299}
    13001300
     
    15101510    if (!layer->renderer()->hasMask()) {
    15111511        // Note: we don't have to walk z-order lists since transparent elements always establish
    1512         // a stacking context. This means we can just walk the layer tree directly.
     1512        // a stacking container. This means we can just walk the layer tree directly.
    15131513        for (RenderLayer* curr = layer->firstChild(); curr; curr = curr->nextSibling()) {
    15141514            if (!layer->reflection() || layer->reflectionLayer() != curr)
     
    16251625
    16261626    if (!child->isNormalFlowOnly() || child->firstChild()) {
    1627         // Dirty the z-order list in which we are contained.  The stackingContext() can be null in the
    1628         // case where we're building up generated content layers.  This is ok, since the lists will start
     1627        // Dirty the z-order list in which we are contained. The stackingContainer() can be null in the
     1628        // case where we're building up generated content layers. This is ok, since the lists will start
    16291629        // off dirty in that case anyway.
    1630         child->dirtyStackingContextZOrderLists();
     1630        child->dirtyStackingContainerZOrderLists();
    16311631    }
    16321632
     
    16691669        // Dirty the z-order list in which we are contained.  When called via the
    16701670        // reattachment process in removeOnlyThisLayer, the layer may already be disconnected
    1671         // from the main layer tree, so we need to null-check the |stackingContext| value.
    1672         oldChild->dirtyStackingContextZOrderLists();
     1671        // from the main layer tree, so we need to null-check the |stackingContainer| value.
     1672        oldChild->dirtyStackingContainerZOrderLists();
    16731673    }
    16741674
     
    19051905    else {
    19061906        bool forceUseCompositedScrolling = acceleratedCompositingForOverflowScrollEnabled()
    1907             && canSafelyEstablishAStackingContext()
     1907            && canBeStackingContainer()
    19081908            && !hasOutOfFlowPositionedDescendant();
    19091909
     
    22182218#if USE(ACCELERATED_COMPOSITING)
    22192219    if (compositor()->inCompositingMode()) {
    2220         // Our stacking context is guaranteed to contain all of our descendants that may need
     2220        // Our stacking container is guaranteed to contain all of our descendants that may need
    22212221        // repositioning, so update compositing layers from there.
    2222         if (RenderLayer* compositingAncestor = stackingContext()->enclosingCompositingLayer()) {
     2222        if (RenderLayer* compositingAncestor = stackingContainer()->enclosingCompositingLayer()) {
    22232223            if (compositor()->compositingConsultsOverlap())
    22242224                compositor()->updateCompositingLayers(CompositingUpdateOnScroll, compositingAncestor);
     
    38433843    // We need to do multiple passes, breaking up our child layer into strips.
    38443844    Vector<RenderLayer*> columnLayers;
    3845     RenderLayer* ancestorLayer = isNormalFlowOnly() ? parent() : stackingContext();
     3845    RenderLayer* ancestorLayer = isNormalFlowOnly() ? parent() : stackingContainer();
    38463846    for (RenderLayer* curr = childLayer->parent(); curr; curr = curr->parent()) {
    38473847        if (curr->renderer()->hasColumns() && checkContainingBlockChainForPagination(childLayer->renderer(), curr->renderBox()))
     
    43574357{
    43584358    Vector<RenderLayer*> columnLayers;
    4359     RenderLayer* ancestorLayer = isNormalFlowOnly() ? parent() : stackingContext();
     4359    RenderLayer* ancestorLayer = isNormalFlowOnly() ? parent() : stackingContainer();
    43604360    for (RenderLayer* curr = childLayer->parent(); curr; curr = curr->parent()) {
    43614361        if (curr->renderer()->hasColumns() && checkContainingBlockChainForPagination(childLayer->renderer(), curr->renderBox()))
     
    49194919    }
    49204920   
    4921     ASSERT(isStackingContext() || (!posZOrderList() || !posZOrderList()->size()));
     4921    ASSERT(isStackingContainer() || (!posZOrderList() || !posZOrderList()->size()));
    49224922
    49234923#if !ASSERT_DISABLED
     
    51005100{
    51015101    ASSERT(m_layerListMutationAllowed);
    5102     ASSERT(isStackingContext());
     5102    ASSERT(isStackingContainer());
    51035103
    51045104    if (m_posZOrderList)
     
    51175117}
    51185118
    5119 void RenderLayer::dirtyStackingContextZOrderLists()
    5120 {
    5121     RenderLayer* sc = stackingContext();
     5119void RenderLayer::dirtyStackingContainerZOrderLists()
     5120{
     5121    RenderLayer* sc = stackingContainer();
    51225122    if (sc)
    51235123        sc->dirtyZOrderLists();
     
    52085208    updateDescendantDependentFlags();
    52095209
     5210    bool isStacking = isStackingContainer();
    52105211    // Overflow layers are just painted by their enclosing layers, so they don't get put in zorder lists.
    5211     bool includeHiddenLayer = includeHiddenLayers || (m_hasVisibleContent || (m_hasVisibleDescendant && isStackingContext()));
     5212    bool includeHiddenLayer = includeHiddenLayers || (m_hasVisibleContent || (m_hasVisibleDescendant && isStacking));
    52125213    if (includeHiddenLayer && !isNormalFlowOnly() && !renderer()->isRenderFlowThread()) {
    52135214        // Determine which buffer the child should be in.
     
    52235224
    52245225    // Recur into our children to collect more layers, but only if we don't establish
    5225     // a stacking context.
    5226     if ((includeHiddenLayers || m_hasVisibleDescendant) && !isStackingContext()) {
     5226    // a stacking context/container.
     5227    if ((includeHiddenLayers || m_hasVisibleDescendant) && !isStacking) {
    52275228        for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) {
    52285229            // Ignore reflections.
     
    52535254#if USE(ACCELERATED_COMPOSITING)
    52545255    if (compositor()->inCompositingMode()) {
    5255         if (isDirtyStackingContext() || m_normalFlowListDirty)
     5256        if (isDirtyStackingContainer() || m_normalFlowListDirty)
    52565257            compositor()->updateCompositingLayers(CompositingUpdateOnHitTest, this);
    52575258        return;
     
    53745375    bool isStackingContext = this->isStackingContext();
    53755376    if (isStackingContext != wasStackingContext) {
    5376         dirtyStackingContextZOrderLists();
     5377        dirtyStackingContainerZOrderLists();
    53775378        if (isStackingContext)
    53785379            dirtyZOrderLists();
     
    53855386    // likely be folded along with the rest.
    53865387    if (oldStyle->zIndex() != renderer()->style()->zIndex() || oldStyle->visibility() != renderer()->style()->visibility()) {
    5387         dirtyStackingContextZOrderLists();
     5388        dirtyStackingContainerZOrderLists();
    53885389        if (isStackingContext)
    53895390            dirtyZOrderLists();
     
    54815482        if (p)
    54825483            p->dirtyNormalFlowList();
    5483         dirtyStackingContextZOrderLists();
     5484        dirtyStackingContainerZOrderLists();
    54845485    }
    54855486
     
    55355536        m_backing->updateGraphicsLayerGeometry();
    55365537    else if (oldStyle && oldStyle->overflowX() != renderer()->style()->overflowX()) {
    5537         if (stackingContext()->hasCompositingDescendant())
     5538        if (stackingContainer()->hasCompositingDescendant())
    55385539            compositor()->setCompositingLayersNeedRebuild();
    55395540    }
  • trunk/Source/WebCore/rendering/RenderLayer.h

    r140286 r140620  
    428428    void repaintBlockSelectionGaps();
    429429
    430     // Get the enclosing stacking context for this layer.  A stacking context is a layer
    431     // that has a non-auto z-index.
    432     RenderLayer* stackingContext() const;
     430    // A stacking context is a layer that has a non-auto z-index.
    433431    bool isStackingContext() const { return isStackingContext(renderer()->style()); }
    434432
     433    // A stacking container can have z-order lists. All stacking contexts are
     434    // stacking containers, but the converse is not true.
     435    bool isStackingContainer() const { return isStackingContext(); }
     436
     437    // Gets the enclosing stacking container for this layer.
     438    RenderLayer* stackingContainer() const;
     439
    435440    void dirtyZOrderLists();
    436     void dirtyStackingContextZOrderLists();
     441    void dirtyStackingContainerZOrderLists();
    437442
    438443    Vector<RenderLayer*>* posZOrderList() const
    439444    {
    440445        ASSERT(!m_zOrderListsDirty);
    441         ASSERT(isStackingContext() || !m_posZOrderList);
     446        ASSERT(isStackingContainer() || !m_posZOrderList);
    442447        return m_posZOrderList.get();
    443448    }
     
    448453    {
    449454        ASSERT(!m_zOrderListsDirty);
    450         ASSERT(isStackingContext() || !m_negZOrderList);
     455        ASSERT(isStackingContainer() || !m_negZOrderList);
    451456        return m_negZOrderList.get();
    452457    }
     
    761766
    762767    bool isStackingContext(const RenderStyle* style) const { return !style->hasAutoZIndex() || isRootLayer(); }
    763     bool isDirtyStackingContext() const { return m_zOrderListsDirty && isStackingContext(); }
     768
     769    bool isDirtyStackingContainer() const { return m_zOrderListsDirty && isStackingContainer(); }
    764770
    765771    void setAncestorChainHasSelfPaintingLayerDescendant();
     
    986992#endif
    987993
    988     // Returns true if z ordering would not change if this layer were to establish a stacking context.
    989     bool canSafelyEstablishAStackingContext() const;
     994    // Returns true if z ordering would not change if this layer were a stacking container.
     995    bool canBeStackingContainer() const;
    990996
    991997    friend class RenderLayerBacking;
     
    11541160inline void RenderLayer::clearZOrderLists()
    11551161{
    1156     ASSERT(!isStackingContext());
     1162    ASSERT(!isStackingContainer());
    11571163
    11581164    m_posZOrderList.clear();
     
    11651171        return;
    11661172
    1167     if (!isStackingContext()) {
     1173    if (!isStackingContainer()) {
    11681174        clearZOrderLists();
    11691175        m_zOrderListsDirty = false;
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r140223 r140620  
    566566{
    567567    // If we haven't built z-order lists yet, wait until later.
    568     if (m_owningLayer->isStackingContext() && m_owningLayer->m_zOrderListsDirty)
     568    if (m_owningLayer->isStackingContainer() && m_owningLayer->m_zOrderListsDirty)
    569569        return;
    570570
     
    12661266        // We only care about parents that are stacking contexts.
    12671267        // Recall that opacity creates stacking context.
    1268         if (!curr->isStackingContext())
     1268        if (!curr->isStackingContainer())
    12691269            continue;
    12701270       
     
    14761476    }
    14771477
    1478     if (m_owningLayer->isStackingContext()) {
     1478    if (m_owningLayer->isStackingContainer()) {
    14791479        if (!m_owningLayer->hasVisibleDescendant())
    14801480            return false;
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r140593 r140620  
    734734{
    735735    for (RenderLayer* curr = layer->parent(); curr != 0; curr = curr->parent()) {
    736         if (curr->isStackingContext())
     736        if (curr->isStackingContainer())
    737737            return 0;
    738738
     
    781781#endif
    782782
    783     if (layer->isStackingContext()) {
     783    if (layer->isStackingContainer()) {
    784784        if (Vector<RenderLayer*>* negZOrderList = layer->negZOrderList()) {
    785785            size_t listSize = negZOrderList->size();
     
    799799    }
    800800
    801     if (layer->isStackingContext()) {
     801    if (layer->isStackingContainer()) {
    802802        if (Vector<RenderLayer*>* posZOrderList = layer->posZOrderList()) {
    803803            size_t listSize = posZOrderList->size();
     
    884884    bool anyDescendantHas3DTransform = false;
    885885
    886     if (layer->isStackingContext()) {
     886    if (layer->isStackingContainer()) {
    887887        if (Vector<RenderLayer*>* negZOrderList = layer->negZOrderList()) {
    888888            size_t listSize = negZOrderList->size();
     
    916916    }
    917917
    918     if (layer->isStackingContext()) {
     918    if (layer->isStackingContainer()) {
    919919        if (Vector<RenderLayer*>* posZOrderList = layer->posZOrderList()) {
    920920            size_t listSize = posZOrderList->size();
     
    10971097#endif
    10981098
    1099     if (layer->isStackingContext()) {
     1099    if (layer->isStackingContainer()) {
    11001100        if (Vector<RenderLayer*>* negZOrderList = layer->negZOrderList()) {
    11011101            size_t listSize = negZOrderList->size();
     
    11191119    }
    11201120   
    1121     if (layer->isStackingContext()) {
     1121    if (layer->isStackingContainer()) {
    11221122        if (Vector<RenderLayer*>* posZOrderList = layer->posZOrderList()) {
    11231123            size_t listSize = posZOrderList->size();
     
    13351335#endif
    13361336
    1337     if (layer->isStackingContext()) {
     1337    if (layer->isStackingContainer()) {
    13381338        if (Vector<RenderLayer*>* negZOrderList = layer->negZOrderList()) {
    13391339            size_t listSize = negZOrderList->size();
     
    13491349    }
    13501350   
    1351     if (layer->isStackingContext()) {
     1351    if (layer->isStackingContainer()) {
    13521352        if (Vector<RenderLayer*>* posZOrderList = layer->posZOrderList()) {
    13531353            size_t listSize = posZOrderList->size();
     
    13861386#endif
    13871387   
    1388     if (layer->isStackingContext()) {
     1388    if (layer->isStackingContainer()) {
    13891389        if (Vector<RenderLayer*>* negZOrderList = layer->negZOrderList()) {
    13901390            size_t listSize = negZOrderList->size();
     
    14001400    }
    14011401   
    1402     if (layer->isStackingContext()) {
     1402    if (layer->isStackingContainer()) {
    14031403        if (Vector<RenderLayer*>* posZOrderList = layer->posZOrderList()) {
    14041404            size_t listSize = posZOrderList->size();
     
    20342034    EPosition position = renderer->style()->position();
    20352035    bool isFixed = renderer->isOutOfFlowPositioned() && position == FixedPosition;
    2036     if (isFixed && !layer->isStackingContext())
     2036    if (isFixed && !layer->isStackingContainer())
    20372037        return false;
    20382038   
     
    26452645#endif
    26462646
    2647     if (layer->isStackingContext()) {
     2647    if (layer->isStackingContainer()) {
    26482648        if (Vector<RenderLayer*>* negZOrderList = layer->negZOrderList()) {
    26492649            size_t listSize = negZOrderList->size();
     
    26952695        return false;
    26962696
    2697     for (RenderLayer* stackingContext = layer->stackingContext(); stackingContext; stackingContext = stackingContext->stackingContext()) {
    2698         if (stackingContext->isComposited() && stackingContext->renderer()->style()->position() == FixedPosition)
     2697    for (RenderLayer* stackingContainer = layer->stackingContainer(); stackingContainer; stackingContainer = stackingContainer->stackingContainer()) {
     2698        if (stackingContainer->isComposited() && stackingContainer->renderer()->style()->position() == FixedPosition)
    26992699            return false;
    27002700    }
  • trunk/Source/WebKit2/ChangeLog

    r140612 r140620  
     12013-01-23  Ian Vollick  <vollick@chromium.org>
     2
     3        Introduce the "stacking container" concept.
     4        https://bugs.webkit.org/show_bug.cgi?id=107734
     5
     6        Reviewed by Simon Fraser.
     7
     8        A stacking container is treated just like a stacking context. That
     9        is, it has z-order lists, it and its descendants are stacked as a
     10        unit, and when the RenderLayerCompositor does its overlap testing,
     11        the composited regions for all layer lists take effect only once the
     12        stacking container is done being processed.
     13
     14        This patch also adds the function RenderLayer::isStackingContainer().
     15        Currently, this is equivalent to RenderLayer::isStackingContext(),
     16        but in future, the definition of stacking container will be broadened
     17        to encompass more than just stacking contexts.
     18
     19        Other than the addition of this extra function, the patch is mostly
     20        comprised of name changes. Any code that used to refer to the
     21        stacking context concept, but didn't necessarily require a stacking
     22        context in the strict, CSS-sense, was switched to refer to stacking
     23        container. No functionality was changed.
     24
     25        No new tests, no change in functionality.
     26
     27        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
     28        (WebKit::updateOffsetFromViewportForSelf):
     29
    1302013-01-23  Anders Carlsson  <andersca@apple.com>
    231
  • trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp

    r140328 r140620  
    481481        return;
    482482
    483     if (!renderLayer->isStackingContext())
     483    if (!renderLayer->isStackingContainer())
    484484        return;
    485485
Note: See TracChangeset for help on using the changeset viewer.