[SVG Masking] Enable the use of <mask> elements for -webkit-mask-image
authorstavila@adobe.com <stavila@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Dec 2014 14:19:21 +0000 (14:19 +0000)
committerstavila@adobe.com <stavila@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Dec 2014 14:19:21 +0000 (14:19 +0000)
commit57d928fe86173648ae2eeb4bc4afdb6d73f69798
treec977880bf1a9656a9c15e9a1256ca3206d3b01cd
parentb04e843ca83dccbf707bd082cdc0b296bcd82489
[SVG Masking] Enable the use of <mask> elements for -webkit-mask-image
https://bugs.webkit.org/show_bug.cgi?id=139294

Reviewed by Simon Fraser.

Source/WebCore:

This patch links together all parts required for the functionality which improves
the -webkit-mask-image property by allowing it to reference a <mask> element defined
in an inline or external SVG document.
Support for this new functionality has been added in a previous patch, under issue
https://bugs.webkit.org/show_bug.cgi?id=139092. A more detailed description of how
the new functionality works can be found in the ChangeLog for that commit.
The containsSVGDocument in ScrollView has been removed because it was added in the
previous patch but is no longer required.

Tests: css3/masking/mask-base64.html
       css3/masking/mask-multiple-values.html
       css3/masking/mask-svg-clipped-fragmentId.html
       css3/masking/mask-svg-fragmentId.html
       css3/masking/mask-svg-inline-fragmentId.html
       css3/masking/mask-svg-inline-invalid-fragmentId.html
       css3/masking/mask-svg-invalid-fragmentId.html
       css3/masking/mask-svg-no-fragmentId-tiled.html
       css3/masking/mask-svg-no-fragmentId.html
       css3/masking/mask-svg-script-entire-svg-to-mask.html
       css3/masking/mask-svg-script-mask-to-entire-svg.html
       css3/masking/mask-svg-script-mask-to-none.html
       css3/masking/mask-svg-script-mask-to-png.html
       css3/masking/mask-svg-script-none-to-mask.html
       css3/masking/mask-svg-script-none-to-png.html
       css3/masking/mask-svg-script-png-to-mask.html
       css3/masking/mask-svg-script-png-to-none.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseFillShorthand):
(WebCore::CSSParser::parseFillProperty):
(WebCore::CSSParser::parseMaskImage):
* css/CSSParser.h:
* css/DeprecatedStyleBuilder.cpp:
(WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustStyleForMaskImages):
(WebCore::StyleResolver::applyProperty):
(WebCore::StyleResolver::loadPendingSVGDocuments):
(WebCore::StyleResolver::createMaskImageOperations):
(WebCore::StyleResolver::loadPendingImages):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
(WebCore::MaskImagePropertyWrapper::MaskImagePropertyWrapper):
(WebCore::MaskImagePropertyWrapper::equals):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* platform/graphics/MaskImageOperation.cpp:
(WebCore::MaskImageOperation::~MaskImageOperation):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::maskClipRect):
* rendering/RenderBox.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
(WebCore::RenderBoxModelObject::calculateFillTileSize):
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::~RenderElement):
(WebCore::RenderElement::updateFillImages):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderLayer.h:
* rendering/style/FillLayer.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setMaskImage):
* rendering/style/RenderStyle.h:

LayoutTests:

Added tests for different situations using URLs with fragment id
for the -webkit-mask-image property.

* css3/masking/mask-base64-expected.html: Added.
* css3/masking/mask-base64.html: Added.
* css3/masking/mask-multiple-values-expected.html: Added.
* css3/masking/mask-multiple-values.html: Added.
* css3/masking/mask-repeat-space-padding-expected.html:
* css3/masking/mask-repeat-space-padding.html:
* css3/masking/mask-svg-clipped-fragmentId-expected.html: Added.
* css3/masking/mask-svg-clipped-fragmentId.html: Added.
* css3/masking/mask-svg-fragmentId-expected.html: Added.
* css3/masking/mask-svg-fragmentId.html: Added.
* css3/masking/mask-svg-inline-fragmentId-expected.html: Added.
* css3/masking/mask-svg-inline-fragmentId.html: Added.
* css3/masking/mask-svg-inline-invalid-fragmentId-expected.html: Added.
* css3/masking/mask-svg-inline-invalid-fragmentId.html: Added.
* css3/masking/mask-svg-invalid-fragmentId-expected.html: Added.
* css3/masking/mask-svg-invalid-fragmentId.html: Added.
* css3/masking/mask-svg-no-fragmentId-expected.html: Added.
* css3/masking/mask-svg-no-fragmentId-tiled-expected.html: Added.
* css3/masking/mask-svg-no-fragmentId-tiled.html: Added.
* css3/masking/mask-svg-no-fragmentId.html: Added.
* css3/masking/mask-svg-script-entire-svg-to-mask-expected.html: Added.
* css3/masking/mask-svg-script-entire-svg-to-mask.html: Added.
* css3/masking/mask-svg-script-mask-to-entire-svg-expected.html: Added.
* css3/masking/mask-svg-script-mask-to-entire-svg.html: Added.
* css3/masking/mask-svg-script-mask-to-none-expected.html: Added.
* css3/masking/mask-svg-script-mask-to-none.html: Added.
* css3/masking/mask-svg-script-mask-to-png-expected.html: Added.
* css3/masking/mask-svg-script-mask-to-png.html: Added.
* css3/masking/mask-svg-script-none-to-mask-expected.html: Added.
* css3/masking/mask-svg-script-none-to-mask.html: Added.
* css3/masking/mask-svg-script-none-to-png-expected.html: Added.
* css3/masking/mask-svg-script-none-to-png.html: Added.
* css3/masking/mask-svg-script-png-to-mask-expected.html: Added.
* css3/masking/mask-svg-script-png-to-mask.html: Added.
* css3/masking/mask-svg-script-png-to-none-expected.html: Added.
* css3/masking/mask-svg-script-png-to-none.html: Added.
* css3/masking/resources/masks.svg: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@177223 268f45cc-cd09-0410-ab3c-d52691b4dbfc
64 files changed:
LayoutTests/ChangeLog
LayoutTests/css3/masking/mask-base64-expected.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-base64.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-multiple-values-expected.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-multiple-values.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-repeat-space-padding-expected.html
LayoutTests/css3/masking/mask-repeat-space-padding.html
LayoutTests/css3/masking/mask-svg-clipped-fragmentId-expected.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-svg-clipped-fragmentId.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-svg-fragmentId-expected.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-svg-fragmentId.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-svg-inline-fragmentId-expected.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-svg-inline-fragmentId.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-svg-inline-invalid-fragmentId-expected.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-svg-inline-invalid-fragmentId.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-svg-invalid-fragmentId-expected.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-svg-invalid-fragmentId.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-svg-no-fragmentId-expected.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-svg-no-fragmentId-tiled-expected.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-svg-no-fragmentId-tiled.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-svg-no-fragmentId.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-svg-script-entire-svg-to-mask-expected.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-svg-script-entire-svg-to-mask.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-svg-script-mask-to-entire-svg-expected.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-svg-script-mask-to-entire-svg.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-svg-script-mask-to-none-expected.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-svg-script-mask-to-none.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-svg-script-mask-to-png-expected.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-svg-script-mask-to-png.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-svg-script-none-to-mask-expected.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-svg-script-none-to-mask.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-svg-script-none-to-png-expected.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-svg-script-none-to-png.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-svg-script-png-to-mask-expected.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-svg-script-png-to-mask.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-svg-script-png-to-none-expected.html [new file with mode: 0644]
LayoutTests/css3/masking/mask-svg-script-png-to-none.html [new file with mode: 0644]
LayoutTests/css3/masking/resources/masks.svg [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSParser.h
Source/WebCore/css/CSSValue.h
Source/WebCore/css/DeprecatedStyleBuilder.cpp
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/css/StyleResolver.h
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/FrameView.h
Source/WebCore/page/animation/CSSPropertyAnimation.cpp
Source/WebCore/platform/ScrollView.h
Source/WebCore/platform/graphics/MaskImageOperation.cpp
Source/WebCore/platform/graphics/MaskImageOperation.h
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBox.h
Source/WebCore/rendering/RenderBoxModelObject.cpp
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderLayerMaskImageInfo.cpp
Source/WebCore/rendering/RenderLayerMaskImageInfo.h
Source/WebCore/rendering/style/FillLayer.cpp
Source/WebCore/rendering/style/FillLayer.h
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/style/RenderStyle.h