Changeset 167424 in webkit


Ignore:
Timestamp:
Apr 17, 2014 1:42:53 AM (10 years ago)
Author:
commit-queue@webkit.org
Message:

[CSS Blending] Isolation descendant dependent flags are not updated correctly
https://bugs.webkit.org/show_bug.cgi?id=130892

Patch by Ion Rosca <Ion Rosca> on 2014-04-17
Reviewed by Dean Jackson.

Source/WebCore:
The isolation descendant dependent flag (m_hasUnisolatedBlendingDescendants)
will help us to determine if a layer should isolate blending descendants or not.
The m_hasUnisolatedBlendingDescendants flag should be set for layers that have blending descendant layers
not isolated by descendant stacking contexts.
An element isolatesBlending() if it has this flag set and creates stacking context.

Tests: css3/compositing/blend-mode-isolation-flags-append-non-stacking-context-blending.html

css3/compositing/blend-mode-isolation-flags-append-stacking-context-blending.html
css3/compositing/blend-mode-isolation-flags-remove-non-stacking-context-blending.html
css3/compositing/blend-mode-isolation-flags-remove-stacking-context-blending.html
css3/compositing/blend-mode-isolation-flags-turn-off-blending-no-isolation.html
css3/compositing/blend-mode-isolation-flags-turn-off-blending.html
css3/compositing/blend-mode-isolation-flags-turn-off-stacking-context.html
css3/compositing/blend-mode-isolation-flags-turn-on-blending.html
css3/compositing/blend-mode-isolation-flags-turn-on-stacking-context.html

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::updateBlendMode):
(WebCore::RenderLayer::updateAncestorChainHasBlendingDescendants):

When a layer has blending and it hasn't had it before, we set the isolation

flag for all its ancestors up to the first layer creating stacking context.
I removed the isComposited() check here. Isolation flags should be correct regardless
of compositing state. Moreover, if this method is called from styleChanged(),
the compositing state might not be accurate, it's going to be recalculated afterwards.
(WebCore::RenderLayer::dirtyAncestorChainHasBlendingDescendants):

When a layer doesn't have blending, but it used to have it before, we mark

the isolation flag as dirty for all its ancestors up to the first layer
creating stacking context. The isolation flags will be recalculated by
RenderLayer::updateDescendantDependentFlags.
(WebCore::RenderLayer::updateDescendantDependentFlags):

Evaluates if the layer has unisolated blending descendants by traversing

the layer subtree.
(WebCore::RenderLayer::addChild):

When adding a subtree that has blending or has some unisolated descendants,

we set the flag for all the ancestors, up to the stacking context layer.
(WebCore::RenderLayer::removeChild):

When removing a subtree that had blending or had some unisolated descendants,

we dirty the flag so that it could be reevaluated.
(WebCore::RenderLayer::calculateClipRects):
(WebCore::RenderLayer::updateTransform):

  • rendering/RenderLayer.h:

Rename m_hasBlendedElementInChildStackingContext => m_hasUnisolatedBlendingDescendants

and m_hasBlendedElementInChildStackingContextStatusDirty => m_hasUnisolatedBlendingDescendantsStatusDirty,

  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::computeCompositingRequirements):

Add an assert to make sure that if m_hasUnisolatedCompositedBlendingDescendants is true,

then m_hasUnisolatedBlendingDescendants is true as well.

LayoutTests:

  • css3/compositing/blend-mode-isolation-flags-append-non-stacking-context-blending.html: Added.
  • css3/compositing/blend-mode-isolation-flags-append-stacking-context-blending.html: Added.
  • css3/compositing/blend-mode-isolation-flags-remove-non-stacking-context-blending.html: Added.
  • css3/compositing/blend-mode-isolation-flags-remove-stacking-context-blending.html: Added.
  • css3/compositing/blend-mode-isolation-flags-turn-off-blending-no-isolation.html: Added.
  • css3/compositing/blend-mode-isolation-flags-turn-off-blending.html: Added.
  • css3/compositing/blend-mode-isolation-flags-turn-off-stacking-context.html: Added.
  • css3/compositing/blend-mode-isolation-flags-turn-on-blending.html: Added.
  • css3/compositing/blend-mode-isolation-flags-turn-on-stacking-context.html: Added.
  • platform/mac/css3/compositing/blend-mode-background-expected.txt:
  • platform/mac/css3/compositing/blend-mode-isolated-group-1-expected.txt:
  • platform/mac/css3/compositing/blend-mode-isolated-group-2-expected.txt:
  • platform/mac/css3/compositing/blend-mode-isolated-group-3-expected.txt:
  • platform/mac/css3/compositing/blend-mode-isolation-flags-append-non-stacking-context-blending-expected.txt: Added.
  • platform/mac/css3/compositing/blend-mode-isolation-flags-append-stacking-context-blending-expected.txt: Added.
  • platform/mac/css3/compositing/blend-mode-isolation-flags-remove-non-stacking-context-blending-expected.txt: Added.
  • platform/mac/css3/compositing/blend-mode-isolation-flags-remove-stacking-context-blending-expected.txt: Added.
  • platform/mac/css3/compositing/blend-mode-isolation-flags-turn-off-blending-expected.txt: Added.
  • platform/mac/css3/compositing/blend-mode-isolation-flags-turn-off-blending-no-isolation-expected.txt: Added.
  • platform/mac/css3/compositing/blend-mode-isolation-flags-turn-off-stacking-context-expected.txt: Added.
  • platform/mac/css3/compositing/blend-mode-isolation-flags-turn-on-blending-expected.txt: Added.
  • platform/mac/css3/compositing/blend-mode-isolation-flags-turn-on-stacking-context-expected.txt: Added.
  • platform/mac/css3/compositing/blend-mode-layers-expected.txt:
  • platform/mac/css3/compositing/blend-mode-reflection-expected.txt:
  • platform/mac/css3/compositing/blend-mode-simple-composited-expected.txt:
  • platform/mac/css3/compositing/blend-mode-simple-expected.txt:
Location:
trunk
Files:
18 added
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r167406 r167424  
     12014-04-17  Ion Rosca  <rosca@adobe.com>
     2
     3        [CSS Blending] Isolation descendant dependent flags are not updated correctly
     4        https://bugs.webkit.org/show_bug.cgi?id=130892
     5
     6        Reviewed by Dean Jackson.
     7
     8        * css3/compositing/blend-mode-isolation-flags-append-non-stacking-context-blending.html: Added.
     9        * css3/compositing/blend-mode-isolation-flags-append-stacking-context-blending.html: Added.
     10        * css3/compositing/blend-mode-isolation-flags-remove-non-stacking-context-blending.html: Added.
     11        * css3/compositing/blend-mode-isolation-flags-remove-stacking-context-blending.html: Added.
     12        * css3/compositing/blend-mode-isolation-flags-turn-off-blending-no-isolation.html: Added.
     13        * css3/compositing/blend-mode-isolation-flags-turn-off-blending.html: Added.
     14        * css3/compositing/blend-mode-isolation-flags-turn-off-stacking-context.html: Added.
     15        * css3/compositing/blend-mode-isolation-flags-turn-on-blending.html: Added.
     16        * css3/compositing/blend-mode-isolation-flags-turn-on-stacking-context.html: Added.
     17        * platform/mac/css3/compositing/blend-mode-background-expected.txt:
     18        * platform/mac/css3/compositing/blend-mode-isolated-group-1-expected.txt:
     19        * platform/mac/css3/compositing/blend-mode-isolated-group-2-expected.txt:
     20        * platform/mac/css3/compositing/blend-mode-isolated-group-3-expected.txt:
     21        * platform/mac/css3/compositing/blend-mode-isolation-flags-append-non-stacking-context-blending-expected.txt: Added.
     22        * platform/mac/css3/compositing/blend-mode-isolation-flags-append-stacking-context-blending-expected.txt: Added.
     23        * platform/mac/css3/compositing/blend-mode-isolation-flags-remove-non-stacking-context-blending-expected.txt: Added.
     24        * platform/mac/css3/compositing/blend-mode-isolation-flags-remove-stacking-context-blending-expected.txt: Added.
     25        * platform/mac/css3/compositing/blend-mode-isolation-flags-turn-off-blending-expected.txt: Added.
     26        * platform/mac/css3/compositing/blend-mode-isolation-flags-turn-off-blending-no-isolation-expected.txt: Added.
     27        * platform/mac/css3/compositing/blend-mode-isolation-flags-turn-off-stacking-context-expected.txt: Added.
     28        * platform/mac/css3/compositing/blend-mode-isolation-flags-turn-on-blending-expected.txt: Added.
     29        * platform/mac/css3/compositing/blend-mode-isolation-flags-turn-on-stacking-context-expected.txt: Added.
     30        * platform/mac/css3/compositing/blend-mode-layers-expected.txt:
     31        * platform/mac/css3/compositing/blend-mode-reflection-expected.txt:
     32        * platform/mac/css3/compositing/blend-mode-simple-composited-expected.txt:
     33        * platform/mac/css3/compositing/blend-mode-simple-expected.txt:
     34
    1352014-04-16  Brian J. Burg  <burg@cs.washington.edu>
    236
  • trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-background-expected.txt

    r166525 r167424  
    11layer at (0,0) size 800x600
    22  RenderView at (0,0) size 800x600
    3 layer at (0,0) size 800x100
     3layer at (0,0) size 800x100 isolatesBlending
    44  RenderBlock {HTML} at (0,0) size 800x100
    55    RenderBody {BODY} at (8,20) size 784x60 [bgcolor=#0000FF]
  • trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-isolated-group-1-expected.txt

    r166525 r167424  
    88layer at (48,48) size 60x60 blendMode: multiply
    99  RenderBlock {DIV} at (20,20) size 60x60 [bgcolor=#008000]
    10 layer at (128,28) size 60x60
     10layer at (128,28) size 60x60 isolatesBlending
    1111  RenderBlock (floating) {DIV} at (120,20) size 60x60 [bgcolor=#EE82EE]
    1212layer at (148,48) size 60x60 blendMode: multiply
    1313  RenderBlock {DIV} at (20,20) size 60x60 [bgcolor=#008000]
    14 layer at (228,28) size 60x60
     14layer at (228,28) size 60x60 isolatesBlending
    1515  RenderBlock (floating) {DIV} at (220,20) size 60x60 [bgcolor=#EE82EE]
    1616layer at (248,48) size 60x60 blendMode: multiply
    1717  RenderBlock {DIV} at (20,20) size 60x60 [bgcolor=#008000]
    18 layer at (328,28) size 60x60
     18layer at (328,28) size 60x60 isolatesBlending
    1919  RenderBlock (floating) {DIV} at (320,20) size 60x60 [bgcolor=#EE82EE]
    2020layer at (348,48) size 60x60 blendMode: multiply
  • trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-isolated-group-2-expected.txt

    r166525 r167424  
    88layer at (48,48) size 60x60 blendMode: multiply
    99  RenderBlock {DIV} at (20,20) size 60x60 [bgcolor=#008000]
    10 layer at (128,28) size 60x60
     10layer at (128,28) size 60x60 isolatesBlending
    1111  RenderBlock (floating) {DIV} at (120,20) size 60x60 [bgcolor=#EE82EE]
    1212layer at (148,48) size 60x60 blendMode: multiply
    1313  RenderBlock {DIV} at (20,20) size 60x60 [bgcolor=#008000]
    14 layer at (228,28) size 60x60
     14layer at (228,28) size 60x60 isolatesBlending
    1515  RenderBlock (floating) {DIV} at (220,20) size 60x60 [bgcolor=#EE82EE]
    1616layer at (248,48) size 60x60 blendMode: multiply
    1717  RenderBlock {DIV} at (20,20) size 60x60 [bgcolor=#008000]
    18 layer at (328,28) size 60x60
     18layer at (328,28) size 60x60 isolatesBlending
    1919  RenderBlock (floating) {DIV} at (320,20) size 60x60 [bgcolor=#EE82EE]
    2020layer at (348,48) size 60x60 blendMode: multiply
  • trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-isolated-group-3-expected.txt

    r166525 r167424  
    88layer at (68,68) size 60x60
    99  RenderBlock (positioned) {DIV} at (40,40) size 60x60 [bgcolor=#FFA500]
    10 layer at (128,28) size 60x60
     10layer at (128,28) size 60x60 isolatesBlending
    1111  RenderBlock (floating) zI: -1 {DIV} at (120,20) size 60x60 [bgcolor=#EE82EE]
    1212layer at (148,48) size 60x60 blendMode: multiply
     
    1414layer at (168,68) size 60x60
    1515  RenderBlock (positioned) {DIV} at (40,40) size 60x60 [bgcolor=#FFA500]
    16 layer at (228,28) size 60x60
     16layer at (228,28) size 60x60 isolatesBlending
    1717  RenderBlock (floating) zI: -1 {DIV} at (220,20) size 60x60 [bgcolor=#EE82EE]
    1818layer at (248,48) size 60x60 blendMode: multiply
     
    2020layer at (268,68) size 60x60
    2121  RenderBlock (positioned) {DIV} at (20,20) size 60x60 [bgcolor=#FFA500]
    22 layer at (328,28) size 60x60
     22layer at (328,28) size 60x60 isolatesBlending
    2323  RenderBlock (floating) zI: -1 {DIV} at (320,20) size 60x60 [bgcolor=#EE82EE]
    2424layer at (348,48) size 60x60 blendMode: multiply
     
    3232layer at (468,68) size 60x60
    3333  RenderBlock (positioned) {DIV} at (40,40) size 60x60 [bgcolor=#FFA500]
    34 layer at (528,28) size 60x60
     34layer at (528,28) size 60x60 isolatesBlending
    3535  RenderBlock (floating) zI: -1 {DIV} at (520,20) size 60x60 [bgcolor=#EE82EE]
    3636layer at (548,48) size 60x60 blendMode: multiply
     
    3838layer at (568,68) size 60x60
    3939  RenderBlock (positioned) {DIV} at (40,40) size 60x60 [bgcolor=#FFA500]
    40 layer at (628,28) size 60x60
     40layer at (628,28) size 60x60 isolatesBlending
    4141  RenderBlock (floating) zI: -1 {DIV} at (620,20) size 60x60 [bgcolor=#EE82EE]
    4242layer at (648,48) size 60x60 blendMode: multiply
     
    4444layer at (668,68) size 60x60
    4545  RenderBlock (positioned) {DIV} at (20,20) size 60x60 [bgcolor=#FFA500]
    46 layer at (28,128) size 60x60
     46layer at (28,128) size 60x60 isolatesBlending
    4747  RenderBlock (floating) zI: -1 {DIV} at (20,120) size 60x60 [bgcolor=#EE82EE]
    4848layer at (48,148) size 60x60 blendMode: multiply
  • trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-layers-expected.txt

    r166525 r167424  
    11layer at (0,0) size 800x600
    22  RenderView at (0,0) size 800x600
    3 layer at (0,0) size 800x366
     3layer at (0,0) size 800x366 isolatesBlending
    44  RenderBlock {HTML} at (0,0) size 800x366
    55    RenderBody {BODY} at (8,16) size 784x0
     
    3838layer at (53,216) size 80x150
    3939  RenderBlock (relative positioned) {DIV} at (0,0) size 80x150 [bgcolor=#FFFF00]
    40 layer at (223,246) size 160x75
     40layer at (223,246) size 160x75 isolatesBlending
    4141  RenderBlock {DIV} at (0,50) size 160x75 [bgcolor=#00FFFF]
    4242layer at (243,206) size 160x160 blendMode: multiply
  • trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-reflection-expected.txt

    r166525 r167424  
    11layer at (0,0) size 800x600
    22  RenderView at (0,0) size 800x600
    3 layer at (0,0) size 800x286
     3layer at (0,0) size 800x286 isolatesBlending
    44  RenderBlock {HTML} at (0,0) size 800x286
    55    RenderBody {BODY} at (8,16) size 784x0
  • trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-simple-composited-expected.txt

    r166525 r167424  
    11layer at (0,0) size 800x600
    22  RenderView at (0,0) size 800x600
    3 layer at (0,0) size 800x576
     3layer at (0,0) size 800x576 isolatesBlending
    44  RenderBlock {HTML} at (0,0) size 800x576
    55    RenderBody {BODY} at (8,16) size 784x0
  • trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-simple-expected.txt

    r166525 r167424  
    11layer at (0,0) size 800x600
    22  RenderView at (0,0) size 800x600
    3 layer at (0,0) size 800x576
     3layer at (0,0) size 800x576 isolatesBlending
    44  RenderBlock {HTML} at (0,0) size 800x576
    55    RenderBody {BODY} at (8,16) size 784x0
  • trunk/Source/WebCore/ChangeLog

    r167423 r167424  
     12014-04-17  Ion Rosca  <rosca@adobe.com>
     2
     3        [CSS Blending] Isolation descendant dependent flags are not updated correctly
     4        https://bugs.webkit.org/show_bug.cgi?id=130892
     5
     6        Reviewed by Dean Jackson.
     7
     8        The isolation descendant dependent flag (m_hasUnisolatedBlendingDescendants)
     9        will help us to determine if a layer should isolate blending descendants or not.
     10        The m_hasUnisolatedBlendingDescendants flag should be set for layers that have blending descendant layers
     11        not isolated by descendant stacking contexts.
     12        An element isolatesBlending() if it has this flag set and creates stacking context.
     13
     14        Tests: css3/compositing/blend-mode-isolation-flags-append-non-stacking-context-blending.html
     15               css3/compositing/blend-mode-isolation-flags-append-stacking-context-blending.html
     16               css3/compositing/blend-mode-isolation-flags-remove-non-stacking-context-blending.html
     17               css3/compositing/blend-mode-isolation-flags-remove-stacking-context-blending.html
     18               css3/compositing/blend-mode-isolation-flags-turn-off-blending-no-isolation.html
     19               css3/compositing/blend-mode-isolation-flags-turn-off-blending.html
     20               css3/compositing/blend-mode-isolation-flags-turn-off-stacking-context.html
     21               css3/compositing/blend-mode-isolation-flags-turn-on-blending.html
     22               css3/compositing/blend-mode-isolation-flags-turn-on-stacking-context.html
     23
     24        * rendering/RenderLayer.cpp:
     25        (WebCore::RenderLayer::RenderLayer):
     26        (WebCore::RenderLayer::updateBlendMode):
     27        (WebCore::RenderLayer::updateAncestorChainHasBlendingDescendants):
     28            When a layer has blending and it hasn't had it before, we set the isolation
     29        flag for all its ancestors up to the first layer creating stacking context.
     30        I removed the isComposited() check here. Isolation flags should be correct regardless
     31        of compositing state. Moreover, if this method is called from styleChanged(),
     32        the compositing state might not be accurate, it's going to be recalculated afterwards. 
     33        (WebCore::RenderLayer::dirtyAncestorChainHasBlendingDescendants):
     34            When a layer doesn't have blending, but it used to have it before, we mark
     35        the isolation flag as dirty for all its ancestors up to the first layer
     36        creating stacking context. The isolation flags will be recalculated by
     37        RenderLayer::updateDescendantDependentFlags.
     38        (WebCore::RenderLayer::updateDescendantDependentFlags):
     39            Evaluates if the layer has unisolated blending descendants by traversing
     40        the layer subtree.
     41        (WebCore::RenderLayer::addChild):
     42            When adding a subtree that has blending or has some unisolated descendants,
     43        we set the flag for all the ancestors, up to the stacking context layer.
     44        (WebCore::RenderLayer::removeChild):
     45            When removing a subtree that had blending or had some unisolated descendants,
     46        we dirty the flag so that it could be reevaluated.
     47        (WebCore::RenderLayer::calculateClipRects):
     48        (WebCore::RenderLayer::updateTransform):
     49        * rendering/RenderLayer.h:
     50            Rename m_hasBlendedElementInChildStackingContext => m_hasUnisolatedBlendingDescendants
     51        and m_hasBlendedElementInChildStackingContextStatusDirty => m_hasUnisolatedBlendingDescendantsStatusDirty,
     52        * rendering/RenderLayerCompositor.cpp:
     53        (WebCore::RenderLayerCompositor::computeCompositingRequirements):
     54            Add an assert to make sure that if m_hasUnisolatedCompositedBlendingDescendants is true,
     55        then m_hasUnisolatedBlendingDescendants is true as well.
     56
    1572014-04-17  Tim Horton  <timothy_horton@apple.com>
    258
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r167215 r167424  
    188188    , m_blendMode(BlendModeNormal)
    189189    , m_hasUnisolatedCompositedBlendingDescendants(false)
    190     , m_hasBlendedElementInChildStackingContext(false)
    191     , m_hasBlendedElementInChildStackingContextStatusDirty(false)
     190    , m_hasUnisolatedBlendingDescendants(false)
     191    , m_hasUnisolatedBlendingDescendantsStatusDirty(false)
    192192#endif
    193193    , m_renderer(rendererLayerModelObject)
     
    809809{
    810810    bool hadBlendMode = m_blendMode != BlendModeNormal;
    811     if (hadBlendMode != hasBlendMode()) {
     811    if (parent() && hadBlendMode != hasBlendMode()) {
    812812        if (hasBlendMode())
    813             updateNonCompositedParentStackingContextHasBlendedChild(true);
     813            parent()->updateAncestorChainHasBlendingDescendants();
    814814        else
    815             dirtyAncestorParentStackingContextHasBlendedElement();
     815            parent()->dirtyAncestorChainHasBlendingDescendants();
    816816    }
    817817
     
    821821}
    822822
    823 void RenderLayer::updateNonCompositedParentStackingContextHasBlendedChild(bool hasBlendedChild)
    824 {
    825     if (isComposited())
    826         return;
    827 
    828     for (auto ancestor = parent(); ancestor && !ancestor->isComposited() && !ancestor->renderer().isRoot(); ancestor = ancestor->parent()) {
    829         ancestor->m_hasBlendedElementInChildStackingContext = hasBlendedChild;
    830 
    831         if (ancestor->isStackingContext())
     823void RenderLayer::updateAncestorChainHasBlendingDescendants()
     824{
     825    for (auto layer = this; layer; layer = layer->parent()) {
     826        if (!layer->hasUnisolatedBlendingDescendantsStatusDirty() && layer->hasUnisolatedBlendingDescendants())
    832827            break;
    833     }
    834 }
    835 
    836 void RenderLayer::dirtyAncestorParentStackingContextHasBlendedElement()
    837 {
    838     for (auto layer = this; layer && !layer->isComposited() && !layer->m_hasBlendedElementInChildStackingContextStatusDirty; layer = layer->parent()) {
    839         layer->m_hasBlendedElementInChildStackingContextStatusDirty = true;
     828        layer->m_hasUnisolatedBlendingDescendants = true;
     829        layer->m_hasUnisolatedBlendingDescendantsStatusDirty = false;
    840830
    841831        if (layer->isStackingContext())
     
    844834}
    845835
    846 bool RenderLayer::nonCompositedParentStackingContextHasBlendedChild() const
    847 {
    848     for (auto ancestor = parent(); ancestor && !ancestor->isComposited() && !ancestor->renderer().isRoot(); ancestor = ancestor->parent()) {
    849         if (ancestor->isStackingContext())
    850             return ancestor->hasBlendedElementInChildStackingContext();
    851     }
    852 
    853     return false;
    854 }
    855 
     836void RenderLayer::dirtyAncestorChainHasBlendingDescendants()
     837{
     838    for (auto layer = this; layer; layer = layer->parent()) {
     839        if (layer->hasUnisolatedBlendingDescendantsStatusDirty())
     840            break;
     841       
     842        layer->m_hasUnisolatedBlendingDescendantsStatusDirty = true;
     843
     844        if (layer->isStackingContext())
     845            break;
     846    }
     847}
    856848#endif
    857849
     
    10981090void RenderLayer::updateDescendantDependentFlags(HashSet<const RenderObject*>* outOfFlowDescendantContainingBlocks)
    10991091{
    1100     if (m_visibleDescendantStatusDirty || m_hasSelfPaintingLayerDescendantDirty || m_hasOutOfFlowPositionedDescendantDirty || hasBlendedElementInChildStackingContextStatusDirty()) {
     1092    if (m_visibleDescendantStatusDirty || m_hasSelfPaintingLayerDescendantDirty || m_hasOutOfFlowPositionedDescendantDirty || hasUnisolatedBlendingDescendantsStatusDirty()) {
    11011093        m_hasVisibleDescendant = false;
    11021094        m_hasSelfPaintingLayerDescendant = false;
    11031095        m_hasOutOfFlowPositionedDescendant = false;
    1104         setHasBlendedElementInChildStackingContext(false);
     1096#if ENABLE(CSS_COMPOSITING)
     1097        m_hasUnisolatedBlendingDescendants = false;
     1098#endif
    11051099
    11061100        HashSet<const RenderObject*> childOutOfFlowDescendantContainingBlocks;
     
    11221116            bool hasSelfPaintingLayerDescendant = child->isSelfPaintingLayer() || child->hasSelfPaintingLayerDescendant();
    11231117            bool hasOutOfFlowPositionedDescendant = !childOutOfFlowDescendantContainingBlocks.isEmpty();
    1124             bool hasBlendedElementInChildStackingContext = child->hasBlendMode() || child->hasBlendedElementInChildStackingContext();
    1125 
     1118#if ENABLE(CSS_COMPOSITING)
     1119            bool hasUnisolatedBlendingDescendants = child->hasBlendMode() || (child->hasUnisolatedBlendingDescendants() && !child->isolatesBlending());
     1120
     1121            m_hasUnisolatedBlendingDescendants |= hasUnisolatedBlendingDescendants;
     1122#endif
    11261123            m_hasVisibleDescendant |= hasVisibleDescendant;
    11271124            m_hasSelfPaintingLayerDescendant |= hasSelfPaintingLayerDescendant;
    11281125            m_hasOutOfFlowPositionedDescendant |= hasOutOfFlowPositionedDescendant;
    1129             setHasBlendedElementInChildStackingContext(this->hasBlendedElementInChildStackingContext() | hasBlendedElementInChildStackingContext);
    1130 
    1131             if (m_hasVisibleDescendant && m_hasSelfPaintingLayerDescendant && m_hasOutOfFlowPositionedDescendant && this->hasBlendedElementInChildStackingContext())
     1126
     1127            bool allFlagsSet = m_hasVisibleDescendant && m_hasSelfPaintingLayerDescendant && m_hasOutOfFlowPositionedDescendant;
     1128#if ENABLE(CSS_COMPOSITING)
     1129            allFlagsSet &= m_hasUnisolatedBlendingDescendants;
     1130#endif
     1131            if (allFlagsSet)
    11321132                break;
    11331133        }
     
    11431143
    11441144        m_hasOutOfFlowPositionedDescendantDirty = false;
    1145 
    1146         setHasBlendedElementInChildStackingContextStatusDirty(false);
     1145#if ENABLE(CSS_COMPOSITING)
     1146        m_hasUnisolatedBlendingDescendantsStatusDirty = false;
     1147#endif
    11471148    }
    11481149
     
    18011802
    18021803#if ENABLE(CSS_COMPOSITING)
    1803     if (child->hasBlendMode() || (!child->isStackingContext() && child->hasBlendedElementInChildStackingContext()))
    1804         child->updateNonCompositedParentStackingContextHasBlendedChild(true);
     1804    if (child->hasBlendMode() || (child->hasUnisolatedBlendingDescendants() && !child->isolatesBlending()))
     1805        updateAncestorChainHasBlendingDescendants();
    18051806#endif
    18061807
     
    18481849
    18491850#if ENABLE(CSS_COMPOSITING)
    1850     if (oldChild->hasBlendMode() || oldChild->isolatesBlending())
    1851         dirtyAncestorParentStackingContextHasBlendedElement();
     1851    if (oldChild->hasBlendMode() || (oldChild->hasUnisolatedBlendingDescendants() && !oldChild->isolatesBlending()))
     1852        dirtyAncestorChainHasBlendingDescendants();
    18521853#endif
    18531854
     
    64306431
    64316432#if ENABLE(CSS_COMPOSITING)
    6432             m_hasBlendedElementInChildStackingContext = isStackingContext ? nonCompositedParentStackingContextHasBlendedChild() : false;
    6433             dirtyAncestorParentStackingContextHasBlendedElement();
     6433        if (parent()) {
     6434            if (isStackingContext) {
     6435                if (!hasUnisolatedBlendingDescendantsStatusDirty() && hasUnisolatedBlendingDescendants())
     6436                    parent()->dirtyAncestorChainHasBlendingDescendants();
     6437            } else {
     6438                if (hasUnisolatedBlendingDescendantsStatusDirty())
     6439                    parent()->dirtyAncestorChainHasBlendingDescendants();
     6440                else if (hasUnisolatedBlendingDescendants())
     6441                    parent()->updateAncestorChainHasBlendingDescendants();
     6442            }
     6443        }
    64346444#endif
    64356445
  • trunk/Source/WebCore/rendering/RenderLayer.h

    r167215 r167424  
    778778#endif
    779779
    780     bool hasBlendMode() const
    781     {
    782780#if ENABLE(CSS_COMPOSITING)
    783         return renderer().hasBlendMode();
    784 #else
    785         return false;
    786 #endif
    787     }
    788 
    789 #if ENABLE(CSS_COMPOSITING)
     781    bool hasBlendMode() const { return renderer().hasBlendMode(); }
    790782    BlendMode blendMode() const { return m_blendMode; }
    791 #endif
    792 
    793     bool isolatesCompositedBlending() const
    794     {
    795 #if ENABLE(CSS_COMPOSITING)
    796         return m_hasUnisolatedCompositedBlendingDescendants && isStackingContext();
    797 #else
    798         return false;
    799 #endif
    800     }
    801 
    802 #if ENABLE(CSS_COMPOSITING)
     783
     784    bool isolatesCompositedBlending() const { return m_hasUnisolatedCompositedBlendingDescendants && isStackingContext(); }
    803785    bool hasUnisolatedCompositedBlendingDescendants() const { return m_hasUnisolatedCompositedBlendingDescendants; }
    804786    void setHasUnisolatedCompositedBlendingDescendants(bool hasUnisolatedCompositedBlendingDescendants)
     
    806788        m_hasUnisolatedCompositedBlendingDescendants = hasUnisolatedCompositedBlendingDescendants;
    807789    }
    808 #endif
    809 
    810     bool isolatesBlending() const
    811     {
    812 #if ENABLE(CSS_COMPOSITING)
    813         return m_hasBlendedElementInChildStackingContext && isStackingContext();
     790
     791    bool isolatesBlending() const { return hasUnisolatedBlendingDescendants() && isStackingContext(); }
     792    bool hasUnisolatedBlendingDescendants() const
     793    {
     794        ASSERT(!m_hasUnisolatedBlendingDescendantsStatusDirty);
     795        return m_hasUnisolatedBlendingDescendants;
     796    }
     797    bool hasUnisolatedBlendingDescendantsStatusDirty() const { return m_hasUnisolatedBlendingDescendantsStatusDirty; }
    814798#else
    815         return false;
    816 #endif
    817     }
    818 
    819     bool hasBlendedElementInChildStackingContext() const
    820     {
    821 #if ENABLE(CSS_COMPOSITING)
    822         return m_hasBlendedElementInChildStackingContext;
    823 #else
    824         return false;
    825 #endif
    826     }
    827 
    828     void setHasBlendedElementInChildStackingContext(bool hasBlendedElementInChildStackingContext)
    829     {
    830 #if ENABLE(CSS_COMPOSITING)
    831         m_hasBlendedElementInChildStackingContext = hasBlendedElementInChildStackingContext;
    832 #else
    833         UNUSED_PARAM(hasBlendedElementInChildStackingContext);
    834 #endif
    835     }
    836 
    837     bool hasBlendedElementInChildStackingContextStatusDirty() const
    838     {
    839 #if ENABLE(CSS_COMPOSITING)
    840         return m_hasBlendedElementInChildStackingContextStatusDirty;
    841 #else
    842         return false;
    843 #endif
    844     }
    845 
    846     void setHasBlendedElementInChildStackingContextStatusDirty(bool hasBlendedElementInChildStackingContextStatusDirty)
    847     {
    848 #if ENABLE(CSS_COMPOSITING)
    849         m_hasBlendedElementInChildStackingContextStatusDirty = hasBlendedElementInChildStackingContextStatusDirty;
    850 #else
    851         UNUSED_PARAM(hasBlendedElementInChildStackingContextStatusDirty);
    852 #endif
    853     }
     799    bool hasBlendMode() const { return false; }
     800    bool isolatesCompositedBlending() const { return false; }
     801    bool isolatesBlending() const { return false; }
     802    bool hasUnisolatedBlendingDescendantsStatusDirty() const { return false; }
     803#endif
    854804
    855805    bool isComposited() const { return m_backing != 0; }
     
    11671117
    11681118#if ENABLE(CSS_COMPOSITING)
    1169     void updateNonCompositedParentStackingContextHasBlendedChild(bool hasBlendedChild);
    1170     void dirtyAncestorParentStackingContextHasBlendedElement();
    1171     bool nonCompositedParentStackingContextHasBlendedChild() const;
     1119    void updateAncestorChainHasBlendingDescendants();
     1120    void dirtyAncestorChainHasBlendingDescendants();
    11721121#endif
    11731122
     
    13111260    BlendMode m_blendMode : 5;
    13121261    bool m_hasUnisolatedCompositedBlendingDescendants : 1;
    1313     bool m_hasBlendedElementInChildStackingContext : 1;
    1314     bool m_hasBlendedElementInChildStackingContextStatusDirty : 1;
     1262    bool m_hasUnisolatedBlendingDescendants : 1;
     1263    bool m_hasUnisolatedBlendingDescendantsStatusDirty : 1;
    13151264#endif
    13161265
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r167407 r167424  
    12521252#if ENABLE(CSS_COMPOSITING)
    12531253    layer.setHasUnisolatedCompositedBlendingDescendants(childState.m_hasUnisolatedCompositedBlendingDescendants);
     1254    ASSERT(!layer.hasUnisolatedCompositedBlendingDescendants() || layer.hasUnisolatedBlendingDescendants());
    12541255#endif
    12551256    // Now check for reasons to become composited that depend on the state of descendant layers.
Note: See TracChangeset for help on using the changeset viewer.