haikuwebkit/LayoutTests/css3/blending/svg-blend-layer-mask.html

20 lines
579 B
HTML
Raw Permalink Normal View History

Source/WebCore: [CSS Blending] Add -webkit-blend-mode support for SVG. https://bugs.webkit.org/show_bug.cgi?id=110427 Patch by Mihai Tica <mitica@adobe.com> on 2014-02-18 Reviewed by Dirk Schulze. Add support for blend modes to SVG. This includes adding and validating isolation for blending. Make masked elements isolate blending by creating a transparency layer. Tests: css3/compositing/svg-blend-color-burn.html css3/compositing/svg-blend-color-dodge.html css3/compositing/svg-blend-color.html css3/compositing/svg-blend-darken.html css3/compositing/svg-blend-difference.html css3/compositing/svg-blend-exclusion.html css3/compositing/svg-blend-hard-light.html css3/compositing/svg-blend-hue.html css3/compositing/svg-blend-layer-blend.html css3/compositing/svg-blend-layer-clip-path.html css3/compositing/svg-blend-layer-filter.html css3/compositing/svg-blend-layer-mask.html css3/compositing/svg-blend-layer-opacity.html css3/compositing/svg-blend-layer-shadow.html css3/compositing/svg-blend-lighten.html css3/compositing/svg-blend-luminosity.html css3/compositing/svg-blend-multiply-alpha.html css3/compositing/svg-blend-multiply.html css3/compositing/svg-blend-normal.html css3/compositing/svg-blend-overlay.html css3/compositing/svg-blend-saturation.html css3/compositing/svg-blend-screen.html css3/compositing/svg-blend-soft-light.html * rendering/RenderElement.cpp: (WebCore::RenderElement::styleDidChange): Also pass a pointer to the old style when calling SVGRenderSupport::styleChanged. * rendering/style/RenderStyle.h: Add blendMode default getter when CSS_COMPOSITING is disabled. * rendering/style/SVGRenderStyle.h: (WebCore::SVGRenderStyle::isolatesBlending): Add method. * rendering/svg/SVGRenderSupport.cpp: (WebCore::SVGRenderSupport::styleChanged): Call updateMaskedAncestorShouldIsolateBlending only when a blend mode is set/unset. (WebCore::SVGRenderSupport::isolatesBlending): Implement method that decides whether an SVGElement isolates or not blending. (WebCore::SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending): Traverse to the nearest ancestor having a mask. - Set a flag causing the creation of a transparency layer when rendering the masked element. * rendering/svg/SVGRenderSupport.h: * rendering/svg/SVGRenderingContext.cpp: (WebCore::SVGRenderingContext::prepareToRenderSVGContent): Call GraphicsContext::setCompositeOperation. - Isolate blending by creating a transparency layer. - Isolate group when rendering a masked element having a blended child node. * svg/SVGGraphicsElement.cpp: (WebCore::SVGGraphicsElement::SVGGraphicsElement): Set default m_shouldIsolateBlending to false. * svg/SVGGraphicsElement.h: Add m_shouldIsolateBlending member, getter and setter. (WebCore::SVGGraphicsElement::shouldIsolateBlending): (WebCore::SVGGraphicsElement::setShouldIsolateBlending): LayoutTests: [CSS Blending] Add -webkit-blend-mode support for SVG. https://bugs.webkit.org/show_bug.cgi?id=110427 Patch by Mihai Tica <mitica@adobe.com> on 2014-02-18 Reviewed by Dirk Schulze. Test -webkit-blend-mode implementation for simple SVGs. This includes: - Test each blend operator. - Test that ensures blending is isolated by other properties: blending, filters, masks, shadow and opacity. * css3/compositing/svg-blend-color-burn.html: Test blend mode color-burn. * css3/compositing/svg-blend-color-dodge.html: Test blend mode color-dodge. * css3/compositing/svg-blend-color.html: Test blend mode color. * css3/compositing/svg-blend-darken.html: Test blend mode darken. * css3/compositing/svg-blend-difference.html: Test blend mode difference. * css3/compositing/svg-blend-exclusion.html: Test blend mode exclusion. * css3/compositing/svg-blend-hard-light.html: Test blend mode hard-light. * css3/compositing/svg-blend-hue.html: Test blend mode hue. * css3/compositing/svg-blend-layer-blend.html: mix-blend-mode should isolate for blending. * css3/compositing/svg-blend-layer-clip-path.html: clip-path should not isolate for blending. * css3/compositing/svg-blend-layer-filter.html: filters should isolate for blending. * css3/compositing/svg-blend-layer-mask.html: masks should isolate for blending. * css3/compositing/svg-blend-layer-opacity.html: opacity should isolate for blending. * css3/compositing/svg-blend-layer-shadow.html: -webkit-shadow should isolate for blending. * css3/compositing/svg-blend-lighten.html: Test blend mode lighten. * css3/compositing/svg-blend-luminosity.html: Test blend mode luminosity. * css3/compositing/svg-blend-multiply-alpha.html: Test blend mode multiply while also having alpha set. * css3/compositing/svg-blend-multiply.html: Test blend mode multiply. * css3/compositing/svg-blend-normal.html: Test blend mode normal. Note this blend mode has no effect. * css3/compositing/svg-blend-overlay.html: Test blend mode overlay. * css3/compositing/svg-blend-saturation.html: Test blend mode saturation. * css3/compositing/svg-blend-screen.html: Test blend mode screen. * css3/compositing/svg-blend-soft-light.html: Test blend mode soft-light. * platform/mac/css3/compositing/svg-blend-color-burn-expected.png: Added. * platform/mac/css3/compositing/svg-blend-color-burn-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-color-dodge-expected.png: Added. * platform/mac/css3/compositing/svg-blend-color-dodge-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-color-expected.png: Added. * platform/mac/css3/compositing/svg-blend-color-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-darken-expected.png: Added. * platform/mac/css3/compositing/svg-blend-darken-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-difference-expected.png: Added. * platform/mac/css3/compositing/svg-blend-difference-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-exclusion-expected.png: Added. * platform/mac/css3/compositing/svg-blend-exclusion-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-hard-light-expected.png: Added. * platform/mac/css3/compositing/svg-blend-hard-light-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-hue-expected.png: Added. * platform/mac/css3/compositing/svg-blend-hue-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-layer-blend-expected.png: Added. * platform/mac/css3/compositing/svg-blend-layer-blend-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-layer-clip-path-expected.png: Added. * platform/mac/css3/compositing/svg-blend-layer-clip-path-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-layer-filter-expected.png: Added. * platform/mac/css3/compositing/svg-blend-layer-filter-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-layer-mask-expected.png: Added. * platform/mac/css3/compositing/svg-blend-layer-mask-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-layer-opacity-expected.png: Added. * platform/mac/css3/compositing/svg-blend-layer-opacity-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-layer-shadow-expected.png: Added. * platform/mac/css3/compositing/svg-blend-layer-shadow-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-lighten-expected.png: Added. * platform/mac/css3/compositing/svg-blend-lighten-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-luminosity-expected.png: Added. * platform/mac/css3/compositing/svg-blend-luminosity-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-multiply-alpha-expected.png: Added. * platform/mac/css3/compositing/svg-blend-multiply-alpha-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-multiply-expected.png: Added. * platform/mac/css3/compositing/svg-blend-multiply-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-normal-expected.png: Added. * platform/mac/css3/compositing/svg-blend-normal-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-overlay-expected.png: Added. * platform/mac/css3/compositing/svg-blend-overlay-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-saturation-expected.png: Added. * platform/mac/css3/compositing/svg-blend-saturation-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-screen-expected.png: Added. * platform/mac/css3/compositing/svg-blend-screen-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-soft-light-expected.png: Added. * platform/mac/css3/compositing/svg-blend-soft-light-expected.txt: Added. Canonical link: https://commits.webkit.org/147005@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@164294 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-02-18 17:10:37 +00:00
<!DOCTYPE HTML>
<html>
<body>
<p>Test for isolation caused by a mask. This test passes if the whole rectangle is green.</p>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="400px" height="400px" >
<defs>
<mask id="msk">
<rect x="10" y="10" width="20" height="20" fill="rgb(255,255,255)"/>
</mask>
</defs>
<g transform="scale(4 4)">
<rect x="0" y="0" width="40" height="40" fill="rgb(0,255,0)"/>
<g mask="url(#msk)">
[CSS Blending] Removing -webkit- prefixes for mix-blend-mode and isolation from layout tests. https://bugs.webkit.org/show_bug.cgi?id=132680 Patch by Ion Rosca <rosca@adobe.com> on 2014-05-08 Reviewed by Mihnea Ovidenie. * css3/blending/blend-mode-accelerated-parent-overflow-hidden.html: * css3/blending/blend-mode-isolation-accelerated-overflow-hidden.html: * css3/blending/blend-mode-isolation-flags-append-non-stacking-context-blending.html: * css3/blending/blend-mode-isolation-flags-append-stacking-context-blending.html: * css3/blending/blend-mode-isolation-flags-remove-non-stacking-context-blending.html: * css3/blending/blend-mode-isolation-flags-remove-stacking-context-blending.html: * css3/blending/blend-mode-isolation-flags-turn-off-blending-no-isolation.html: * css3/blending/blend-mode-isolation-flags-turn-off-blending.html: * css3/blending/blend-mode-isolation-flags-turn-off-stacking-context.html: * css3/blending/blend-mode-isolation-flags-turn-on-blending.html: * css3/blending/blend-mode-isolation-flags-turn-on-stacking-context.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: * css3/blending/blend-mode-overflow.html: * css3/blending/repaint/blend-mode-turn-off-isolation-no-effect.html: * css3/blending/repaint/blend-mode-turn-off-isolation.html: * css3/blending/svg-blend-color-burn.html: * css3/blending/svg-blend-darken.html: * css3/blending/svg-blend-difference.html: * css3/blending/svg-blend-exclusion.html: * css3/blending/svg-blend-layer-mask.html: * css3/blending/svg-blend-lighten.html: * css3/blending/svg-blend-normal.html: * css3/blending/svg-blend-overlay.html: * css3/blending/svg-isolation-default.html: * css3/blending/svg-isolation-simple.html: Canonical link: https://commits.webkit.org/150734@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168472 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-05-08 16:19:56 +00:00
<rect x="10" y="10" width="20" height="20" fill="rgb(0,255,0)" style="mix-blend-mode: difference"/>
Source/WebCore: [CSS Blending] Add -webkit-blend-mode support for SVG. https://bugs.webkit.org/show_bug.cgi?id=110427 Patch by Mihai Tica <mitica@adobe.com> on 2014-02-18 Reviewed by Dirk Schulze. Add support for blend modes to SVG. This includes adding and validating isolation for blending. Make masked elements isolate blending by creating a transparency layer. Tests: css3/compositing/svg-blend-color-burn.html css3/compositing/svg-blend-color-dodge.html css3/compositing/svg-blend-color.html css3/compositing/svg-blend-darken.html css3/compositing/svg-blend-difference.html css3/compositing/svg-blend-exclusion.html css3/compositing/svg-blend-hard-light.html css3/compositing/svg-blend-hue.html css3/compositing/svg-blend-layer-blend.html css3/compositing/svg-blend-layer-clip-path.html css3/compositing/svg-blend-layer-filter.html css3/compositing/svg-blend-layer-mask.html css3/compositing/svg-blend-layer-opacity.html css3/compositing/svg-blend-layer-shadow.html css3/compositing/svg-blend-lighten.html css3/compositing/svg-blend-luminosity.html css3/compositing/svg-blend-multiply-alpha.html css3/compositing/svg-blend-multiply.html css3/compositing/svg-blend-normal.html css3/compositing/svg-blend-overlay.html css3/compositing/svg-blend-saturation.html css3/compositing/svg-blend-screen.html css3/compositing/svg-blend-soft-light.html * rendering/RenderElement.cpp: (WebCore::RenderElement::styleDidChange): Also pass a pointer to the old style when calling SVGRenderSupport::styleChanged. * rendering/style/RenderStyle.h: Add blendMode default getter when CSS_COMPOSITING is disabled. * rendering/style/SVGRenderStyle.h: (WebCore::SVGRenderStyle::isolatesBlending): Add method. * rendering/svg/SVGRenderSupport.cpp: (WebCore::SVGRenderSupport::styleChanged): Call updateMaskedAncestorShouldIsolateBlending only when a blend mode is set/unset. (WebCore::SVGRenderSupport::isolatesBlending): Implement method that decides whether an SVGElement isolates or not blending. (WebCore::SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending): Traverse to the nearest ancestor having a mask. - Set a flag causing the creation of a transparency layer when rendering the masked element. * rendering/svg/SVGRenderSupport.h: * rendering/svg/SVGRenderingContext.cpp: (WebCore::SVGRenderingContext::prepareToRenderSVGContent): Call GraphicsContext::setCompositeOperation. - Isolate blending by creating a transparency layer. - Isolate group when rendering a masked element having a blended child node. * svg/SVGGraphicsElement.cpp: (WebCore::SVGGraphicsElement::SVGGraphicsElement): Set default m_shouldIsolateBlending to false. * svg/SVGGraphicsElement.h: Add m_shouldIsolateBlending member, getter and setter. (WebCore::SVGGraphicsElement::shouldIsolateBlending): (WebCore::SVGGraphicsElement::setShouldIsolateBlending): LayoutTests: [CSS Blending] Add -webkit-blend-mode support for SVG. https://bugs.webkit.org/show_bug.cgi?id=110427 Patch by Mihai Tica <mitica@adobe.com> on 2014-02-18 Reviewed by Dirk Schulze. Test -webkit-blend-mode implementation for simple SVGs. This includes: - Test each blend operator. - Test that ensures blending is isolated by other properties: blending, filters, masks, shadow and opacity. * css3/compositing/svg-blend-color-burn.html: Test blend mode color-burn. * css3/compositing/svg-blend-color-dodge.html: Test blend mode color-dodge. * css3/compositing/svg-blend-color.html: Test blend mode color. * css3/compositing/svg-blend-darken.html: Test blend mode darken. * css3/compositing/svg-blend-difference.html: Test blend mode difference. * css3/compositing/svg-blend-exclusion.html: Test blend mode exclusion. * css3/compositing/svg-blend-hard-light.html: Test blend mode hard-light. * css3/compositing/svg-blend-hue.html: Test blend mode hue. * css3/compositing/svg-blend-layer-blend.html: mix-blend-mode should isolate for blending. * css3/compositing/svg-blend-layer-clip-path.html: clip-path should not isolate for blending. * css3/compositing/svg-blend-layer-filter.html: filters should isolate for blending. * css3/compositing/svg-blend-layer-mask.html: masks should isolate for blending. * css3/compositing/svg-blend-layer-opacity.html: opacity should isolate for blending. * css3/compositing/svg-blend-layer-shadow.html: -webkit-shadow should isolate for blending. * css3/compositing/svg-blend-lighten.html: Test blend mode lighten. * css3/compositing/svg-blend-luminosity.html: Test blend mode luminosity. * css3/compositing/svg-blend-multiply-alpha.html: Test blend mode multiply while also having alpha set. * css3/compositing/svg-blend-multiply.html: Test blend mode multiply. * css3/compositing/svg-blend-normal.html: Test blend mode normal. Note this blend mode has no effect. * css3/compositing/svg-blend-overlay.html: Test blend mode overlay. * css3/compositing/svg-blend-saturation.html: Test blend mode saturation. * css3/compositing/svg-blend-screen.html: Test blend mode screen. * css3/compositing/svg-blend-soft-light.html: Test blend mode soft-light. * platform/mac/css3/compositing/svg-blend-color-burn-expected.png: Added. * platform/mac/css3/compositing/svg-blend-color-burn-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-color-dodge-expected.png: Added. * platform/mac/css3/compositing/svg-blend-color-dodge-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-color-expected.png: Added. * platform/mac/css3/compositing/svg-blend-color-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-darken-expected.png: Added. * platform/mac/css3/compositing/svg-blend-darken-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-difference-expected.png: Added. * platform/mac/css3/compositing/svg-blend-difference-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-exclusion-expected.png: Added. * platform/mac/css3/compositing/svg-blend-exclusion-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-hard-light-expected.png: Added. * platform/mac/css3/compositing/svg-blend-hard-light-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-hue-expected.png: Added. * platform/mac/css3/compositing/svg-blend-hue-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-layer-blend-expected.png: Added. * platform/mac/css3/compositing/svg-blend-layer-blend-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-layer-clip-path-expected.png: Added. * platform/mac/css3/compositing/svg-blend-layer-clip-path-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-layer-filter-expected.png: Added. * platform/mac/css3/compositing/svg-blend-layer-filter-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-layer-mask-expected.png: Added. * platform/mac/css3/compositing/svg-blend-layer-mask-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-layer-opacity-expected.png: Added. * platform/mac/css3/compositing/svg-blend-layer-opacity-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-layer-shadow-expected.png: Added. * platform/mac/css3/compositing/svg-blend-layer-shadow-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-lighten-expected.png: Added. * platform/mac/css3/compositing/svg-blend-lighten-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-luminosity-expected.png: Added. * platform/mac/css3/compositing/svg-blend-luminosity-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-multiply-alpha-expected.png: Added. * platform/mac/css3/compositing/svg-blend-multiply-alpha-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-multiply-expected.png: Added. * platform/mac/css3/compositing/svg-blend-multiply-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-normal-expected.png: Added. * platform/mac/css3/compositing/svg-blend-normal-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-overlay-expected.png: Added. * platform/mac/css3/compositing/svg-blend-overlay-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-saturation-expected.png: Added. * platform/mac/css3/compositing/svg-blend-saturation-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-screen-expected.png: Added. * platform/mac/css3/compositing/svg-blend-screen-expected.txt: Added. * platform/mac/css3/compositing/svg-blend-soft-light-expected.png: Added. * platform/mac/css3/compositing/svg-blend-soft-light-expected.txt: Added. Canonical link: https://commits.webkit.org/147005@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@164294 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-02-18 17:10:37 +00:00
</g>
</g>
</svg>
</body>
</html>