Changeset 164579 in webkit
- Timestamp:
- Feb 24, 2014 2:02:10 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 9 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r164577 r164579 1 2014-02-24 Mihai Tica <mitica@adobe.com> 2 3 [CSS Blending] An element having -webkit-mix-blend-mode should only blend with the contents of the parent stacking context 4 https://bugs.webkit.org/show_bug.cgi?id=129154 5 6 Reviewed by Dean Jackson. 7 8 Test that isolation is performed for blending, in other words, an element having -webkit-mix-blend-mode is blending with the 9 contents of the parent stacking context, but not with any of the underlying content. 10 11 * css3/compositing/blend-mode-isolated-group-1.html: Added. 12 * css3/compositing/blend-mode-isolated-group-2.html: Added. 13 * css3/compositing/blend-mode-isolated-group-3.html: Added. 14 * platform/mac/css3/compositing/blend-mode-isolated-group-1-expected.png: Added. 15 * platform/mac/css3/compositing/blend-mode-isolated-group-1-expected.txt: Added. 16 * platform/mac/css3/compositing/blend-mode-isolated-group-2-expected.png: Added. 17 * platform/mac/css3/compositing/blend-mode-isolated-group-2-expected.txt: Added. 18 * platform/mac/css3/compositing/blend-mode-isolated-group-3-expected.png: Added. 19 * platform/mac/css3/compositing/blend-mode-isolated-group-3-expected.txt: Added. 20 1 21 2014-02-24 Krzysztof Czech <k.czech@samsung.com> 2 22 -
trunk/Source/WebCore/ChangeLog
r164577 r164579 1 2014-02-24 Mihai Tica <mitica@adobe.com> 2 3 [CSS Blending] An element having -webkit-mix-blend-mode should only blend with the contents of the parent stacking context 4 https://bugs.webkit.org/show_bug.cgi?id=129154 5 6 Reviewed by Dean Jackson. 7 8 The blending operation of an element having -webkit-mix-blend-mode should be restricted to the parent stacking context. 9 This change isolates blending, preventing it from blending with other underlying elements besides the parent stacking context. 10 11 Tests: css3/compositing/blend-mode-isolated-group-1.html 12 css3/compositing/blend-mode-isolated-group-2.html 13 css3/compositing/blend-mode-isolated-group-3.html 14 15 * rendering/RenderLayer.cpp: 16 (WebCore::RenderLayer::RenderLayer): Initialize added members to false. 17 (WebCore::RenderLayer::updateBlendMode): Check if a blend mode was set or unset. If so, set the m_updateParentStackingContextShouldIsolateBlendingDirty to true. 18 (WebCore::RenderLayer::updateParentStackingContextShouldIsolateBlending): Traverse to the parent stacking context and update the 19 m_isolatesBlending member accordingly. 20 * rendering/RenderLayer.h: 21 - Add isolatesBlending() as a condition for creating a transparency layer in the paintsWithTransparency method. 22 - Add m_updateParentStackingContextShouldIsolateBlendingDirty member. 23 - Add m_isolatesBlending member and getter. 24 * rendering/RenderLayerCompositor.cpp: 25 (WebCore::RenderLayerCompositor::computeCompositingRequirements): Call updateParentStackingContextShouldIsolateBlending. 26 1 27 2014-02-24 Krzysztof Czech <k.czech@samsung.com> 2 28 -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r164482 r164579 186 186 #if ENABLE(CSS_COMPOSITING) 187 187 , m_blendMode(BlendModeNormal) 188 , m_isolatesBlending(false) 189 , m_updateParentStackingContextShouldIsolateBlendingDirty(false) 188 190 #endif 189 191 , m_renderer(rendererLayerModelObject) … … 802 804 #if ENABLE(CSS_COMPOSITING) 803 805 804 void RenderLayer::updateBlendMode() 805 { 806 void RenderLayer::updateBlendMode(const RenderStyle* oldStyle) 807 { 808 m_updateParentStackingContextShouldIsolateBlendingDirty = false; 809 810 if ((!oldStyle && renderer().style().hasBlendMode()) || (oldStyle && oldStyle->hasBlendMode() != renderer().style().hasBlendMode())) 811 m_updateParentStackingContextShouldIsolateBlendingDirty = true; 812 806 813 BlendMode newBlendMode = renderer().style().blendMode(); 807 814 if (newBlendMode != m_blendMode) { … … 810 817 backing()->setBlendMode(newBlendMode); 811 818 } 819 } 820 821 void RenderLayer::updateParentStackingContextShouldIsolateBlending() 822 { 823 if (!m_updateParentStackingContextShouldIsolateBlendingDirty) 824 return; 825 826 if (isComposited()) { 827 m_updateParentStackingContextShouldIsolateBlendingDirty = false; 828 return; 829 } 830 831 for (auto ancestor = parent(); ancestor && !ancestor->isComposited() && !ancestor->isRootLayer(); ancestor = ancestor->parent()) { 832 if (ancestor->isStackingContext()) { 833 ancestor->m_isolatesBlending = renderer().style().hasBlendMode(); 834 break; 835 } 836 } 837 838 m_updateParentStackingContextShouldIsolateBlendingDirty = false; 812 839 } 813 840 … … 6516 6543 updateTransform(); 6517 6544 #if ENABLE(CSS_COMPOSITING) 6518 updateBlendMode( );6545 updateBlendMode(oldStyle); 6519 6546 #endif 6520 6547 #if ENABLE(CSS_FILTERS) -
trunk/Source/WebCore/rendering/RenderLayer.h
r164482 r164579 504 504 505 505 #if ENABLE(CSS_COMPOSITING) 506 void updateBlendMode(); 506 void updateBlendMode(const RenderStyle*); 507 void updateParentStackingContextShouldIsolateBlending(); 507 508 #endif 508 509 … … 776 777 #endif 777 778 779 bool hasBlendMode() const 780 { 778 781 #if ENABLE(CSS_COMPOSITING) 779 bool hasBlendMode() const { return renderer().hasBlendMode(); }782 return renderer().hasBlendMode(); 780 783 #else 781 bool hasBlendMode() const { return false; } 782 #endif 784 return false; 785 #endif 786 } 787 788 bool isolatesBlending() const 789 { 790 #if ENABLE(CSS_COMPOSITING) 791 return m_isolatesBlending; 792 #else 793 return false; 794 #endif 795 } 783 796 784 797 bool isComposited() const { return m_backing != 0; } … … 799 812 bool paintsWithTransparency(PaintBehavior paintBehavior) const 800 813 { 801 return (isTransparent() || hasBlendMode() ) && ((paintBehavior & PaintBehaviorFlattenCompositingLayers) || !isComposited());814 return (isTransparent() || hasBlendMode() || isolatesBlending()) && ((paintBehavior & PaintBehaviorFlattenCompositingLayers) || !isComposited()); 802 815 } 803 816 … … 1232 1245 #if ENABLE(CSS_COMPOSITING) 1233 1246 BlendMode m_blendMode : 5; 1247 bool m_isolatesBlending : 1; 1248 bool m_updateParentStackingContextShouldIsolateBlendingDirty : 1; 1234 1249 #endif 1235 1250 -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r164415 r164579 1054 1054 layer.updateLayerListsIfNeeded(); 1055 1055 1056 #if ENABLE(CSS_COMPOSITING) 1057 layer.updateParentStackingContextShouldIsolateBlending(); 1058 #endif 1059 1056 1060 if (layer.isFlowThreadCollectingGraphicsLayersUnderRegions()) { 1057 1061 RenderFlowThread& flowThread = toRenderFlowThread(layer.renderer());
Note: See TracChangeset
for help on using the changeset viewer.