[SVG Masking] Enable the use of <mask> elements for -webkit-mask-image
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Dec 2014 17:54:38 +0000 (17:54 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Dec 2014 17:54:38 +0000 (17:54 +0000)
commit56f45745a82db730e04ee78772337272186e777e
tree056ae683718f256ef5b1d7295536dd8e7ce65701
parent81a808b9abe7584a4f635e903f048c9756330743
[SVG Masking] Enable the use of <mask> elements for -webkit-mask-image
https://bugs.webkit.org/show_bug.cgi?id=139294

Patch by Radu Stavila <stavila@adobe.com> on 2014-12-11
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@177155 268f45cc-cd09-0410-ab3c-d52691b4dbfc
63 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/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