Changeset 168462 in webkit


Ignore:
Timestamp:
May 7, 2014 10:42:21 PM (10 years ago)
Author:
commit-queue@webkit.org
Message:

[CSS Blending] Blending doesn't work if the parent stacking context is not a self painting layer
https://bugs.webkit.org/show_bug.cgi?id=130891

Patch by Ion Rosca <Ion Rosca> on 2014-05-07
Reviewed by Dean Jackson.

Source/WebCore:
The stacking context layers having unisolated blending descendants should be able
to create transparency layers or to become composited in order to restrict blending
content to accessing the information outside the current stacking context.
Some layers are not self painting layers and these layers cannot crate transparency
layers and cannot be composited, thus they are not able to isolate blending descendants
when it's required.

The solution in this patch is to make a layer isSelfPaintingLayer when
it needs to isolate blending descendants (hasUnisolatedBlendingDescendants).

Tests: css3/blending/blend-mode-isolation-accelerated-overflow-hidden.html

css3/blending/blend-mode-isolation-overflow-hidden.html
css3/blending/blend-mode-isolation-turn-off-self-painting-layer.html
css3/blending/blend-mode-isolation-turn-off-self-painting-layer1.html
css3/blending/blend-mode-isolation-turn-off-self-painting-layer2.html
css3/blending/blend-mode-isolation-turn-on-self-painting-layer.html

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::updateAncestorChainHasBlendingDescendants):
When hasUnisolatedBlendingDescendants is set we make sure that isSelfPaintingLayer flag is set too.
(WebCore::RenderLayer::updateDescendantDependentFlags):
The flags might be read or changed while walking the descendants, so we don't want to reset
them before traversing the tree.
(WebCore::RenderLayer::shouldBeSelfPaintingLayer):
Adding isolatesBlending() condition for a layer to be self painting.

  • rendering/RenderLayer.h:

Removing ASSERT from hasUnisolatedBlendingDescendants(). It crashes in minibrowser
and in layout tests when painting contents. Similar bugs on other flags: #71044, #71277.

  • rendering/RenderLayerModelObject.cpp:

(WebCore::RenderLayerModelObject::styleDidChange):
Telling ancestors that blend mode property has been removed from CSS when the layer for
this element is going to be removed; styleChanged will not be called anymore.

LayoutTests:
Removed position:relative which forced tests to avoid this bug.

  • css3/blending/blend-mode-accelerated-parent-overflow-hidden.html:
  • css3/blending/blend-mode-clip-accelerated-blending-canvas.html:
  • css3/blending/blend-mode-clip-accelerated-blending-child.html:
  • css3/blending/blend-mode-clip-accelerated-blending-with-siblings.html:
  • css3/blending/blend-mode-clip-accelerated-transformed-blending.html:

New tests:

  • css3/blending/blend-mode-isolation-accelerated-overflow-hidden-expected.txt: Added.
  • css3/blending/blend-mode-isolation-accelerated-overflow-hidden.html: Added.
  • css3/blending/blend-mode-isolation-overflow-hidden-expected.html: Added.
  • css3/blending/blend-mode-isolation-overflow-hidden.html: Added.
  • css3/blending/blend-mode-isolation-turn-off-self-painting-layer-expected.txt: Added.
  • css3/blending/blend-mode-isolation-turn-off-self-painting-layer.html: Added.
  • css3/blending/blend-mode-isolation-turn-off-self-painting-layer1-expected.txt: Added.
  • css3/blending/blend-mode-isolation-turn-off-self-painting-layer1.html: Added.
  • css3/blending/blend-mode-isolation-turn-off-self-painting-layer2-expected.txt: Added.
  • css3/blending/blend-mode-isolation-turn-off-self-painting-layer2.html: Added.
  • css3/blending/blend-mode-isolation-turn-on-self-painting-layer-expected.txt: Added.
  • css3/blending/blend-mode-isolation-turn-on-self-painting-layer.html: Added.
Location:
trunk
Files:
12 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r168460 r168462  
     12014-05-07  Ion Rosca  <rosca@adobe.com>
     2
     3        [CSS Blending] Blending doesn't work if the parent stacking context is not a self painting layer
     4        https://bugs.webkit.org/show_bug.cgi?id=130891
     5
     6        Reviewed by Dean Jackson.
     7
     8        Removed position:relative which forced tests to avoid this bug.
     9        * css3/blending/blend-mode-accelerated-parent-overflow-hidden.html:
     10        * css3/blending/blend-mode-clip-accelerated-blending-canvas.html:
     11        * css3/blending/blend-mode-clip-accelerated-blending-child.html:
     12        * css3/blending/blend-mode-clip-accelerated-blending-with-siblings.html:
     13        * css3/blending/blend-mode-clip-accelerated-transformed-blending.html:
     14
     15        New tests:
     16        * css3/blending/blend-mode-isolation-accelerated-overflow-hidden-expected.txt: Added.
     17        * css3/blending/blend-mode-isolation-accelerated-overflow-hidden.html: Added.
     18        * css3/blending/blend-mode-isolation-overflow-hidden-expected.html: Added.
     19        * css3/blending/blend-mode-isolation-overflow-hidden.html: Added.
     20        * css3/blending/blend-mode-isolation-turn-off-self-painting-layer-expected.txt: Added.
     21        * css3/blending/blend-mode-isolation-turn-off-self-painting-layer.html: Added.
     22        * css3/blending/blend-mode-isolation-turn-off-self-painting-layer1-expected.txt: Added.
     23        * css3/blending/blend-mode-isolation-turn-off-self-painting-layer1.html: Added.
     24        * css3/blending/blend-mode-isolation-turn-off-self-painting-layer2-expected.txt: Added.
     25        * css3/blending/blend-mode-isolation-turn-off-self-painting-layer2.html: Added.
     26        * css3/blending/blend-mode-isolation-turn-on-self-painting-layer-expected.txt: Added.
     27        * css3/blending/blend-mode-isolation-turn-on-self-painting-layer.html: Added.
     28
    1292014-05-06  Myles C. Maxfield  <mmaxfield@apple.com>
    230
  • trunk/LayoutTests/css3/blending/blend-mode-accelerated-parent-overflow-hidden.html

    r168356 r168462  
    99                isolation:isolate;
    1010                -webkit-isolation:isolate;
    11                 position: relative; /*avoid #130891 issue*/
    1211        }
    1312
  • trunk/LayoutTests/css3/blending/blend-mode-clip-accelerated-blending-canvas.html

    r168356 r168462  
    77       background: rgb(0, 255, 0);
    88       isolation: isolate;
    9        position: relative; /*avoid #130891 issue*/
    109   }
    1110   .blending {
  • trunk/LayoutTests/css3/blending/blend-mode-clip-accelerated-blending-child.html

    r168356 r168462  
    77       background: rgb(0, 255, 0);
    88       isolation: isolate;
    9        position: relative; /*avoid #130891 issue*/
    109   }
    1110
  • trunk/LayoutTests/css3/blending/blend-mode-clip-accelerated-blending-with-siblings.html

    r168356 r168462  
    66       overflow:hidden;
    77       isolation: isolate;
    8        position: relative; /*avoid #130891 issue*/
    98   }
    109
  • trunk/LayoutTests/css3/blending/blend-mode-clip-accelerated-transformed-blending.html

    r168356 r168462  
    77       background: rgb(0, 255, 0);
    88       isolation: isolate;
    9        position: relative; /*avoid #130891 issue*/
    109   }
    1110
  • trunk/Source/WebCore/ChangeLog

    r168460 r168462  
     12014-05-07  Ion Rosca  <rosca@adobe.com>
     2
     3        [CSS Blending] Blending doesn't work if the parent stacking context is not a self painting layer
     4        https://bugs.webkit.org/show_bug.cgi?id=130891
     5
     6        Reviewed by Dean Jackson.
     7
     8        The stacking context layers having unisolated blending descendants should be able
     9        to create transparency layers or to become composited in order to restrict blending
     10        content to accessing the information outside the current stacking context.
     11        Some layers are not self painting layers and these layers cannot crate transparency
     12        layers and cannot be composited, thus they are not able to isolate blending descendants
     13        when it's required.
     14       
     15        The solution in this patch is to make a layer isSelfPaintingLayer when
     16        it needs to isolate blending descendants (hasUnisolatedBlendingDescendants).
     17
     18        Tests: css3/blending/blend-mode-isolation-accelerated-overflow-hidden.html
     19               css3/blending/blend-mode-isolation-overflow-hidden.html
     20               css3/blending/blend-mode-isolation-turn-off-self-painting-layer.html
     21               css3/blending/blend-mode-isolation-turn-off-self-painting-layer1.html
     22               css3/blending/blend-mode-isolation-turn-off-self-painting-layer2.html
     23               css3/blending/blend-mode-isolation-turn-on-self-painting-layer.html
     24
     25        * rendering/RenderLayer.cpp:
     26        (WebCore::RenderLayer::updateAncestorChainHasBlendingDescendants):
     27        When hasUnisolatedBlendingDescendants is set we make sure that isSelfPaintingLayer flag is set too.
     28        (WebCore::RenderLayer::updateDescendantDependentFlags):
     29        The flags might be read or changed while walking the descendants, so we don't want to reset
     30        them before traversing the tree.
     31        (WebCore::RenderLayer::shouldBeSelfPaintingLayer):
     32        Adding isolatesBlending() condition for a layer to be self painting.
     33        * rendering/RenderLayer.h:
     34        Removing ASSERT from hasUnisolatedBlendingDescendants(). It crashes in minibrowser
     35        and in layout tests when painting contents. Similar bugs on other flags: #71044, #71277.
     36        * rendering/RenderLayerModelObject.cpp:
     37        (WebCore::RenderLayerModelObject::styleDidChange):
     38        Telling ancestors that blend mode property has been removed from CSS when the layer for
     39        this element is going to be removed; styleChanged will not be called anymore.
     40
    1412014-05-06  Myles C. Maxfield  <mmaxfield@apple.com>
    242
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r168424 r168462  
    832832        layer->m_hasUnisolatedBlendingDescendantsStatusDirty = false;
    833833
     834        layer->updateSelfPaintingLayer();
     835
    834836        if (layer->isStackingContext())
    835837            break;
     
    10421044{
    10431045    if (m_visibleDescendantStatusDirty || m_hasSelfPaintingLayerDescendantDirty || m_hasOutOfFlowPositionedDescendantDirty || hasUnisolatedBlendingDescendantsStatusDirty()) {
    1044         m_hasVisibleDescendant = false;
    1045         m_hasSelfPaintingLayerDescendant = false;
    1046         m_hasOutOfFlowPositionedDescendant = false;
     1046        bool hasVisibleDescendant = false;
     1047        bool hasSelfPaintingLayerDescendant = false;
     1048        bool hasOutOfFlowPositionedDescendant = false;
    10471049#if ENABLE(CSS_COMPOSITING)
    1048         m_hasUnisolatedBlendingDescendants = false;
     1050        bool hasUnisolatedBlendingDescendants = false;
    10491051#endif
    10501052
     
    10641066            }
    10651067
    1066             bool hasVisibleDescendant = child->m_hasVisibleContent || child->m_hasVisibleDescendant;
    1067             bool hasSelfPaintingLayerDescendant = child->isSelfPaintingLayer() || child->hasSelfPaintingLayerDescendant();
    1068             bool hasOutOfFlowPositionedDescendant = !childOutOfFlowDescendantContainingBlocks.isEmpty();
     1068            hasVisibleDescendant |= child->m_hasVisibleContent || child->m_hasVisibleDescendant;
     1069            hasSelfPaintingLayerDescendant |= child->isSelfPaintingLayer() || child->hasSelfPaintingLayerDescendant();
     1070            hasOutOfFlowPositionedDescendant |= !childOutOfFlowDescendantContainingBlocks.isEmpty();
    10691071#if ENABLE(CSS_COMPOSITING)
    1070             bool hasUnisolatedBlendingDescendants = child->hasBlendMode() || (child->hasUnisolatedBlendingDescendants() && !child->isolatesBlending());
    1071 
    1072             m_hasUnisolatedBlendingDescendants |= hasUnisolatedBlendingDescendants;
     1072            hasUnisolatedBlendingDescendants |= child->hasBlendMode() || (child->hasUnisolatedBlendingDescendants() && !child->isolatesBlending());
    10731073#endif
    1074             m_hasVisibleDescendant |= hasVisibleDescendant;
    1075             m_hasSelfPaintingLayerDescendant |= hasSelfPaintingLayerDescendant;
    1076             m_hasOutOfFlowPositionedDescendant |= hasOutOfFlowPositionedDescendant;
    1077 
    1078             bool allFlagsSet = m_hasVisibleDescendant && m_hasSelfPaintingLayerDescendant && m_hasOutOfFlowPositionedDescendant;
     1074
     1075            bool allFlagsSet = hasVisibleDescendant && hasSelfPaintingLayerDescendant && hasOutOfFlowPositionedDescendant;
    10791076#if ENABLE(CSS_COMPOSITING)
    1080             allFlagsSet &= m_hasUnisolatedBlendingDescendants;
     1077            allFlagsSet &= hasUnisolatedBlendingDescendants;
    10811078#endif
    10821079            if (allFlagsSet)
     
    10871084            outOfFlowDescendantContainingBlocks->remove(&renderer());
    10881085
     1086        m_hasVisibleDescendant = hasVisibleDescendant;
    10891087        m_visibleDescendantStatusDirty = false;
     1088        m_hasSelfPaintingLayerDescendant = hasSelfPaintingLayerDescendant;
    10901089        m_hasSelfPaintingLayerDescendantDirty = false;
    10911090
     1091        m_hasOutOfFlowPositionedDescendant = hasOutOfFlowPositionedDescendant;
    10921092        if (m_hasOutOfFlowPositionedDescendantDirty)
    10931093            updateNeedsCompositedScrolling();
     
    10951095        m_hasOutOfFlowPositionedDescendantDirty = false;
    10961096#if ENABLE(CSS_COMPOSITING)
    1097         m_hasUnisolatedBlendingDescendantsStatusDirty = false;
     1097        m_hasUnisolatedBlendingDescendants = hasUnisolatedBlendingDescendants;
     1098        if (m_hasUnisolatedBlendingDescendantsStatusDirty) {
     1099            m_hasUnisolatedBlendingDescendantsStatusDirty = false;
     1100            updateSelfPaintingLayer();
     1101        }
    10981102#endif
    10991103    }
     
    61796183        || hasOverlayScrollbars()
    61806184        || needsCompositedScrolling()
     6185        || isolatesBlending()
    61816186        || renderer().hasReflection()
    61826187        || renderer().hasMask()
  • trunk/Source/WebCore/rendering/RenderLayer.h

    r168380 r168462  
    807807
    808808    bool isolatesBlending() const { return hasUnisolatedBlendingDescendants() && isStackingContext(); }
    809     bool hasUnisolatedBlendingDescendants() const
    810     {
    811         ASSERT(!m_hasUnisolatedBlendingDescendantsStatusDirty);
    812         return m_hasUnisolatedBlendingDescendants;
    813     }
     809   
     810    // FIXME: We should ASSERT(!m_hasUnisolatedBlendingDescendantsStatusDirty); here but we hit the same bugs as visible content above.
     811    bool hasUnisolatedBlendingDescendants() const { return m_hasUnisolatedBlendingDescendants; }
    814812    bool hasUnisolatedBlendingDescendantsStatusDirty() const { return m_hasUnisolatedBlendingDescendantsStatusDirty; }
    815813#else
  • trunk/Source/WebCore/rendering/RenderLayerModelObject.cpp

    r165491 r168462  
    152152        }
    153153    } else if (layer() && layer()->parent()) {
     154#if ENABLE(CSS_COMPOSITING)
     155        if (oldStyle->hasBlendMode())
     156            layer()->parent()->dirtyAncestorChainHasBlendingDescendants();
     157#endif
    154158        setHasTransform(false); // Either a transform wasn't specified or the object doesn't support transforms, so just null out the bit.
    155159        setHasReflection(false);
Note: See TracChangeset for help on using the changeset viewer.