Revert use of SVG <mask> elements for -webkit-mask-image (r176798, r177494, r186180)
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Jul 2015 01:15:01 +0000 (01:15 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Jul 2015 01:15:01 +0000 (01:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=146653

Reviewed by Dean Jackson.

Fixes rdar://problem/21435233.

r177494 caused a number of regressions (bugs 141857, 146509, 146561), added new layering violations, and
was not being maintained, so revert it.

This patch reverts r177494.

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseFillProperty):
(WebCore::CSSParser::parseMaskImage): Deleted.
* css/CSSParser.h:
* css/CSSPropertyNames.in:
* css/CSSValue.h:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertMaskImageOperations): Deleted.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::loadPendingSVGDocuments):
(WebCore::StyleResolver::loadPendingImages):
(WebCore::StyleResolver::adjustStyleForMaskImages): Deleted.
(WebCore::StyleResolver::applyMatchedProperties): Deleted.
* css/StyleResolver.h:
* page/FrameView.cpp:
(WebCore::FrameView::containsSVGDocument):
* page/FrameView.h:
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
(WebCore::blendFunc): Deleted.
(WebCore::MaskImagePropertyWrapper::MaskImagePropertyWrapper): Deleted.
(WebCore::MaskImagePropertyWrapper::equals): Deleted.
* platform/ScrollView.h:
(WebCore::ScrollView::containsSVGDocument):
* platform/graphics/MaskImageOperation.cpp:
(WebCore::MaskImageOperation::~MaskImageOperation): Deleted.
(WebCore::MaskImageOperation::operator==): Deleted.
* platform/graphics/MaskImageOperation.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::maskClipRect):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::updateFillImages):
(WebCore::RenderElement::~RenderElement): Deleted.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::~RenderLayer): Deleted.
(WebCore::RenderLayer::calculateClipRects): Deleted.
* rendering/RenderLayer.h:
* rendering/RenderLayerMaskImageInfo.cpp: Removed.
* rendering/style/FillLayer.h:
(WebCore::FillLayer::image):
(WebCore::FillLayer::imageOrMaskImage):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setMaskImage): Deleted.
* rendering/style/RenderStyle.h:

LayoutTests:

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

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@186391 268f45cc-cd09-0410-ab3c-d52691b4dbfc

52 files changed:
LayoutTests/ChangeLog
LayoutTests/css3/masking/mask-multiple-values-expected.html [deleted file]
LayoutTests/css3/masking/mask-multiple-values.html [deleted file]
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 [deleted file]
LayoutTests/css3/masking/mask-svg-clipped-fragmentId.html [deleted file]
LayoutTests/css3/masking/mask-svg-fragmentId-expected.html [deleted file]
LayoutTests/css3/masking/mask-svg-fragmentId.html [deleted file]
LayoutTests/css3/masking/mask-svg-inline-fragmentId-expected.html [deleted file]
LayoutTests/css3/masking/mask-svg-inline-fragmentId.html [deleted file]
LayoutTests/css3/masking/mask-svg-inline-invalid-fragmentId-expected.html [deleted file]
LayoutTests/css3/masking/mask-svg-inline-invalid-fragmentId.html [deleted file]
LayoutTests/css3/masking/mask-svg-invalid-fragmentId-expected.html [deleted file]
LayoutTests/css3/masking/mask-svg-invalid-fragmentId.html [deleted file]
LayoutTests/css3/masking/mask-svg-script-entire-svg-to-mask-expected.html [deleted file]
LayoutTests/css3/masking/mask-svg-script-entire-svg-to-mask.html [deleted file]
LayoutTests/css3/masking/mask-svg-script-mask-to-entire-svg-expected.html [deleted file]
LayoutTests/css3/masking/mask-svg-script-mask-to-entire-svg.html [deleted file]
LayoutTests/css3/masking/mask-svg-script-mask-to-none-expected.html [deleted file]
LayoutTests/css3/masking/mask-svg-script-mask-to-none.html [deleted file]
LayoutTests/css3/masking/mask-svg-script-mask-to-png-expected.html [deleted file]
LayoutTests/css3/masking/mask-svg-script-mask-to-png.html [deleted file]
LayoutTests/css3/masking/mask-svg-script-none-to-mask-expected.html [deleted file]
LayoutTests/css3/masking/mask-svg-script-none-to-mask.html [deleted file]
LayoutTests/css3/masking/mask-svg-script-png-to-mask-expected.html [deleted file]
LayoutTests/css3/masking/mask-svg-script-png-to-mask.html [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSParser.h
Source/WebCore/css/CSSPropertyNames.in
Source/WebCore/css/CSSValue.h
Source/WebCore/css/StyleBuilderConverter.h
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/RenderBoxModelObject.cpp
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderLayerMaskImageInfo.cpp [deleted file]
Source/WebCore/rendering/style/FillLayer.h
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/style/RenderStyle.h

index 744ba3f..0e4ecea 100644 (file)
@@ -1,3 +1,55 @@
+2015-07-06  Simon Fraser  <simon.fraser@apple.com>
+
+        Revert use of SVG <mask> elements for -webkit-mask-image (r176798, r177494, r186180)
+        https://bugs.webkit.org/show_bug.cgi?id=146653
+
+        Reviewed by Dean Jackson.
+
+        Fixes rdar://problem/21435233.
+
+        r177494 caused a number of regressions (bugs 141857, 146509, 146561), added new layering violations, and
+        was not being maintained, so revert it.
+
+        This patch reverts r177494.
+
+        * css3/masking/mask-base64-expected.html: Removed.
+        * css3/masking/mask-base64.html: Removed.
+        * css3/masking/mask-multiple-values-expected.html: Removed.
+        * css3/masking/mask-multiple-values.html: Removed.
+        * css3/masking/mask-repeat-space-padding-expected.html:
+        * css3/masking/mask-repeat-space-padding.html:
+        * css3/masking/mask-svg-clipped-fragmentId-expected.html: Removed.
+        * css3/masking/mask-svg-clipped-fragmentId.html: Removed.
+        * css3/masking/mask-svg-fragmentId-expected.html: Removed.
+        * css3/masking/mask-svg-fragmentId.html: Removed.
+        * css3/masking/mask-svg-inline-fragmentId-expected.html: Removed.
+        * css3/masking/mask-svg-inline-fragmentId.html: Removed.
+        * css3/masking/mask-svg-inline-invalid-fragmentId-expected.html: Removed.
+        * css3/masking/mask-svg-inline-invalid-fragmentId.html: Removed.
+        * css3/masking/mask-svg-invalid-fragmentId-expected.html: Removed.
+        * css3/masking/mask-svg-invalid-fragmentId.html: Removed.
+        * css3/masking/mask-svg-no-fragmentId-expected.html: Removed.
+        * css3/masking/mask-svg-no-fragmentId-tiled-expected.html: Removed.
+        * css3/masking/mask-svg-no-fragmentId-tiled.html: Removed.
+        * css3/masking/mask-svg-no-fragmentId.html: Removed.
+        * css3/masking/mask-svg-script-entire-svg-to-mask-expected.html: Removed.
+        * css3/masking/mask-svg-script-entire-svg-to-mask.html: Removed.
+        * css3/masking/mask-svg-script-mask-to-entire-svg-expected.html: Removed.
+        * css3/masking/mask-svg-script-mask-to-entire-svg.html: Removed.
+        * css3/masking/mask-svg-script-mask-to-none-expected.html: Removed.
+        * css3/masking/mask-svg-script-mask-to-none.html: Removed.
+        * css3/masking/mask-svg-script-mask-to-png-expected.html: Removed.
+        * css3/masking/mask-svg-script-mask-to-png.html: Removed.
+        * css3/masking/mask-svg-script-none-to-mask-expected.html: Removed.
+        * css3/masking/mask-svg-script-none-to-mask.html: Removed.
+        * css3/masking/mask-svg-script-none-to-png-expected.html: Removed.
+        * css3/masking/mask-svg-script-none-to-png.html: Removed.
+        * css3/masking/mask-svg-script-png-to-mask-expected.html: Removed.
+        * css3/masking/mask-svg-script-png-to-mask.html: Removed.
+        * css3/masking/mask-svg-script-png-to-none-expected.html: Removed.
+        * css3/masking/mask-svg-script-png-to-none.html: Removed.
+        * css3/masking/resources/masks.svg: Removed.
+
 2015-07-06  Daniel Bates  <dabates@apple.com>
 
         Isolated worlds should respect Content Security Policy; User Agent Shadow DOM
diff --git a/LayoutTests/css3/masking/mask-multiple-values-expected.html b/LayoutTests/css3/masking/mask-multiple-values-expected.html
deleted file mode 100644 (file)
index 7a1b62b..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-    <head>
-        <style>
-            p {
-                margin: 0px;
-            }
-            #back {
-                width: 500px;
-                height: 500px;
-                background-color: green;
-            }
-            .front {
-                position: absolute;
-                width: 300px;
-                height: 300px;
-                background-color: black;
-                border: 50px solid blue;
-                padding: 50px;
-                -webkit-mask-repeat: no-repeat;
-                -webkit-mask-origin: content-box;
-                -webkit-mask-clip: border-box;
-            }
-            #front1 {
-                -webkit-mask-image: url('resources/circle.png');
-                -webkit-mask-size: 150px 120px;
-                -webkit-mask-position: -120px -110px;
-            }
-            #front2 {
-                -webkit-mask-image: url('resources/masks.svg#lowerHalf');
-                -webkit-mask-size: 300px 240px;
-                -webkit-mask-position: 50px 0px;
-            }
-            #front3 {
-                -webkit-mask-image: url('resources/masks.svg#upperHalf');
-                -webkit-mask-size: 300px 240px;
-                -webkit-mask-position: 50px 0px;
-            }
-            #front4 {
-                -webkit-mask-image: url('resources/masks.svg#invalidId');
-                -webkit-mask-size: 225px 180px;
-                -webkit-mask-position: 160px 220px;
-            }
-        </style>
-    </head>
-
-    <body>
-        <p><a href="https://bugs.webkit.org/show_bug.cgi?id=129682">Bug 129682</a> - This test uses multiple masks from multiple resources.</p>
-        <div id="back">
-            <div class="front" id="front1"></div>
-            <div class="front" id="front2"></div>
-            <div class="front" id="front3"></div>
-            <div class="front" id="front4"></div>
-        </div>
-    </body>
-</html>
-
diff --git a/LayoutTests/css3/masking/mask-multiple-values.html b/LayoutTests/css3/masking/mask-multiple-values.html
deleted file mode 100644 (file)
index ed2d675..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-    <head>
-        <style>
-            p {
-                margin: 0px;
-            }
-            #back {
-                width: 500px;
-                height: 500px;
-                background-color: green;
-            }
-            #front {
-                width: 300px;
-                height: 300px;
-                background-color: black;
-                border: 50px solid blue;
-                padding: 50px;
-                -webkit-mask-image: url('resources/circle.png'), url('resources/masks.svg#lowerHalf'), url('resources/masks.svg#upperHalf'), url('resources/masks.svg#invalidId');
-                -webkit-mask-size: 150px 120px, 300px 240px, 300px 240px, 225px 180px;
-                -webkit-mask-position: -120px -110px, 50px 0px, 50px 0px, 160px 220px;
-                -webkit-mask-repeat: no-repeat;
-                -webkit-mask-origin: content-box;
-                -webkit-mask-clip: border-box;
-            }
-        </style>
-    </head>
-
-    <body>
-        <p><a href="https://bugs.webkit.org/show_bug.cgi?id=129682">Bug 129682</a> - This test uses multiple masks from multiple resources.</p>
-        <div id="back">
-            <div id="front"></div>
-        </div>
-    </body>
-</html>
-
index 3cce138..2be9836 100644 (file)
@@ -26,7 +26,7 @@
             function addMasks() {
                 for (var x = 0; x < width; x += sizeX + spaceX) {
                     for (var y = 0; y < height; y += sizeY + spaceY) {
-                        urls.push("url(resources/circle.svg)");
+                        urls.push("url(resources/circle.png)");
                         size.push(sizeX + "px " + sizeY + "px");
                         position.push(x + "px " + y + "px");
                     }
index e1c480a..e1c6d3b 100644 (file)
@@ -13,7 +13,7 @@
                 background-color: red;
                 border: 50px solid blue;
                 padding: 50px;
-                -webkit-mask-image: url("resources/circle.svg");
+                -webkit-mask-image: url("resources/circle.png");
                 -webkit-mask-size: 100px;
                 -webkit-mask-repeat: space;
                 -webkit-mask-origin: padding-box;
diff --git a/LayoutTests/css3/masking/mask-svg-clipped-fragmentId-expected.html b/LayoutTests/css3/masking/mask-svg-clipped-fragmentId-expected.html
deleted file mode 100644 (file)
index c7d9b83..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-    <head>
-        <style>
-            p {
-                margin: 0px;
-            }
-            #back {
-                width: 320px;
-                height: 420px;
-                background-color: green;
-                overflow: hidden;
-            }
-            #blackSVG {
-                position: relative;
-                left: 60px;
-                top: -35px;
-            }
-            #blueSVG {
-                position: relative;
-                left: 70px;
-                top: -474px;
-            }
-        </style>
-    </head>
-
-    <body>
-        
-        <p><a href="https://bugs.webkit.org/show_bug.cgi?id=129682">Bug 129682</a> - This test used a &lt;mask&gt; element and paints it at the side of the masked element, causing it to be clipped.</p>
-        <div id="back">
-            <svg id="blackSVG" width="320px" height="420px">
-                <path fill="black" d="M80,20 L280,20 L280,380 L240,380 L240,60 L80,60 L80,20"/>
-            </svg>
-            <svg id="blueSVG" width="320px" height="420px">
-                <path fill="blue" d="M70,20 L280,20 L280,395 L240,395 L240,60 L70,60 L70,20"/>
-            </svg>
-        </div>
-    </body>
-</html>
-
diff --git a/LayoutTests/css3/masking/mask-svg-clipped-fragmentId.html b/LayoutTests/css3/masking/mask-svg-clipped-fragmentId.html
deleted file mode 100644 (file)
index 2ab0941..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-    <head>
-        <style>
-            p {
-                margin: 0px;
-            }
-            #back {
-                width: 320px;
-                height: 420px;
-                background-color: green;
-            }
-            #front {
-                width: 300px;
-                height: 400px;
-                background-color: black;
-                border: 10px solid blue;
-                -webkit-mask-image: url('resources/masks.svg#upperHalf');
-                -webkit-mask-size: 320px 420px;
-                -webkit-mask-position: 50px -45px;
-                -webkit-mask-repeat: no-repeat;
-                -webkit-mask-origin: content-box;
-                -webkit-mask-clip: border-box;
-            }
-        </style>
-    </head>
-
-    <body>
-        <p><a href="https://bugs.webkit.org/show_bug.cgi?id=129682">Bug 129682</a> - This test used a &lt;mask&gt; element and paints it at the side of the masked element, causing it to be clipped.</p>
-        <div id="back">
-            <div id="front"></div>
-        </div>
-    </body>
-</html>
-
diff --git a/LayoutTests/css3/masking/mask-svg-fragmentId-expected.html b/LayoutTests/css3/masking/mask-svg-fragmentId-expected.html
deleted file mode 100644 (file)
index 5a170cd..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<!DOCTYPE html>
-<html>
-    <head>
-        <style>
-            p {
-                margin: 0px;
-            }
-        </style>
-    </head>
-    <body>
-        <p><a href="https://bugs.webkit.org/show_bug.cgi?id=129682">Bug 129682</a> - On success, you should see a green inverted-L shape and no red.</p>
-        <p>This test references a &lt;mask&gt; element from an external SVG</p>
-        <svg width="300px" height="400px">
-            <path fill="green" d="M80,20 L280,20 L280,380 L240,380 L240,60 L80,60 L80,20"/>
-        </svg>
-    </body>
-</html>
\ No newline at end of file
diff --git a/LayoutTests/css3/masking/mask-svg-fragmentId.html b/LayoutTests/css3/masking/mask-svg-fragmentId.html
deleted file mode 100644 (file)
index 00fd70e..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html>
-<html>
-    <head>
-        <style>
-            p {
-                margin: 0px;
-            }
-            #maskedElement {
-                width: 300px;
-                height: 400px;
-                background-color: green;
-                -webkit-mask-image:url('resources/masks.svg#upperHalf');
-            }
-            #redSvg {
-                position: absolute;
-            }
-        </style>
-    </head>
-
-    <body>
-        <p><a href="https://bugs.webkit.org/show_bug.cgi?id=129682">Bug 129682</a> - On success, you should see a green inverted-L shape and no red.</p>
-        <p>This test references a &lt;mask&gt; element from an external SVG</p>
-        <svg id="redSvg" width="300px" height="400px">
-            <path fill="red" d="M80,20 L280,20 L280,380 L240,380 L240,60 L80,60 L80,20"/>
-        </svg>
-        <div id="maskedElement"></div>
-    </body>
-</html>
\ No newline at end of file
diff --git a/LayoutTests/css3/masking/mask-svg-inline-fragmentId-expected.html b/LayoutTests/css3/masking/mask-svg-inline-fragmentId-expected.html
deleted file mode 100644 (file)
index 82785a7..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<!DOCTYPE html>
-<html>
-    <head>
-        <style>
-            p {
-                margin: 0px;
-            }
-        </style>
-    </head>
-    <body>
-        <p><a href="https://bugs.webkit.org/show_bug.cgi?id=129682">Bug 129682</a> - On success, you should see a green L shape and no red.</p>
-        <p>This test references a &lt;mask&gt; element defined in the main HTML document</p>
-        <svg width="300px" height="400px">
-            <path fill="green" d="M20,20 L60,20 L60,340 L220,340 L220,380 L20,380 L20,20"/>
-        </svg>
-    </body>
-</html>
\ No newline at end of file
diff --git a/LayoutTests/css3/masking/mask-svg-inline-fragmentId.html b/LayoutTests/css3/masking/mask-svg-inline-fragmentId.html
deleted file mode 100644 (file)
index 225417b..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<!DOCTYPE html>
-<html>
-    <head>
-        <style>
-            p {
-                margin: 0px;
-            }
-            #maskedElement {
-                width: 300px;
-                height: 400px;
-                background-color: green;
-                -webkit-mask-image:url('#lowerHalf');
-            }
-            #redSvg {
-                position: absolute;
-            }
-        </style>
-    </head>
-
-    <body>
-        <p><a href="https://bugs.webkit.org/show_bug.cgi?id=129682">Bug 129682</a> - On success, you should see a green L shape and no red.</p>
-        <p>This test references a &lt;mask&gt; element defined in the main HTML document</p>
-        <svg id="redSvg" width="300px" height="400px">
-            <path fill="red" d="M20,20 L60,20 L60,340 L220,340 L220,380 L20,380 L20,20"/>
-            <mask id="lowerHalf" maskUnits="objectBoundingBox">
-                <path fill="#FFFFFF" d="M20,20 L60,20 L60,340 L220,340 L220,380 L20,380 L20,20"/>
-            </mask>
-        </svg>
-        <div id="maskedElement"></div>
-    </body>
-</html>
\ No newline at end of file
diff --git a/LayoutTests/css3/masking/mask-svg-inline-invalid-fragmentId-expected.html b/LayoutTests/css3/masking/mask-svg-inline-invalid-fragmentId-expected.html
deleted file mode 100644 (file)
index 43378ee..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<!DOCTYPE html>
-<html>
-    <head>
-        <style>
-            p {
-                margin: 0px;
-            }
-            #elementToNotBeCovered {
-                width: 300px;
-                height: 400px;
-                background-color: #2222FF;
-                position: absolute;
-                left: 10px;
-                top: 50px;
-            }
-        </style>
-    </head>
-    <body>
-        <p><a href="https://bugs.webkit.org/show_bug.cgi?id=129682">Bug 129682</a> - On success, you should see a blue rectangle and no red.</p>
-        <p>This test references an invalid fragment identifier.</p>
-        <div id="elementToNotBeCovered"></div>
-    </body>
-</html>
\ No newline at end of file
diff --git a/LayoutTests/css3/masking/mask-svg-inline-invalid-fragmentId.html b/LayoutTests/css3/masking/mask-svg-inline-invalid-fragmentId.html
deleted file mode 100644 (file)
index 6be3c06..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE html>
-<html>
-    <head>
-        <style>
-            p {
-                margin: 0px;
-            }
-            #maskedElement {
-                width: 300px;
-                height: 400px;
-                background-color: red;
-                -webkit-mask-image:url('#invalidId');
-                position: absolute;
-                left: 10px;
-                top: 50px;
-            }
-            #elementToNotBeCovered {
-                width: 300px;
-                height: 400px;
-                background-color: #2222FF;
-                position: absolute;
-                left: 10px;
-                top: 50px;
-            }
-        </style>
-    </head>
-
-    <body>
-        <p><a href="https://bugs.webkit.org/show_bug.cgi?id=129682">Bug 129682</a> - On success, you should see a blue rectangle and no red.</p>
-        <p>This test references an invalid fragment identifier.</p>
-        <div id="elementToNotBeCovered"></div>
-        <div id="maskedElement"></div>
-    </body>
-</html>
\ No newline at end of file
diff --git a/LayoutTests/css3/masking/mask-svg-invalid-fragmentId-expected.html b/LayoutTests/css3/masking/mask-svg-invalid-fragmentId-expected.html
deleted file mode 100644 (file)
index c73ab7e..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<!DOCTYPE html>
-<html>
-    <head>
-        <style>
-            p {
-                margin: 0px;
-            }
-        </style>
-    </head>
-
-    <body>
-        <p><a href="https://bugs.webkit.org/show_bug.cgi?id=129682">Bug 129682</a> - On success, you should see 4 green rectangles and no red.</p>
-        <p>This test references an invalid fragment identifier from an external SVG</p>
-        <svg width="300px" height="400px">
-            <rect x="5px" y="45px" width="140px" height="140px" fill="green"/>
-            <rect x="155px" y="45px" width="140px" height="140px" fill="green"/>
-            <rect x="155px" y="215px" width="140px" height="140px" fill="green"/>
-            <rect x="5px" y="215px" width="140px" height="140px" fill="green"/>
-        </svg>
-    </body>
-</html>
\ No newline at end of file
diff --git a/LayoutTests/css3/masking/mask-svg-invalid-fragmentId.html b/LayoutTests/css3/masking/mask-svg-invalid-fragmentId.html
deleted file mode 100644 (file)
index 0b354ea..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<!DOCTYPE html>
-<html>
-    <head>
-        <style>
-            p {
-                margin: 0px;
-            }
-            #maskedElement {
-                width: 300px;
-                height: 400px;
-                background-color: green;
-                -webkit-mask-image:url('resources/masks.svg#invalidId');
-            }
-            #redSvg {
-                position: absolute;
-            }
-        </style>
-    </head>
-
-    <body>
-        <p><a href="https://bugs.webkit.org/show_bug.cgi?id=129682">Bug 129682</a> - On success, you should see 4 green rectangles and no red.</p>
-        <p>This test references an invalid fragment identifier from an external SVG</p>
-        <svg id="redSvg" width="300px" height="400px">
-            <rect x="5px" y="45px" width="140px" height="140px" fill="red"/>
-            <rect x="155px" y="45px" width="140px" height="140px" fill="red"/>
-            <rect x="155px" y="215px" width="140px" height="140px" fill="red"/>
-            <rect x="5px" y="215px" width="140px" height="140px" fill="red"/>
-        </svg>
-        <div id="maskedElement"></div>
-    </body>
-</html>
\ No newline at end of file
diff --git a/LayoutTests/css3/masking/mask-svg-script-entire-svg-to-mask-expected.html b/LayoutTests/css3/masking/mask-svg-script-entire-svg-to-mask-expected.html
deleted file mode 100644 (file)
index 4f24ee9..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<!DOCTYPE html>
-<html>
-    <head>
-        <style>
-            p {
-                margin: 0px;
-            }
-        </style>
-    </head>
-    <body>
-        <p><a href="https://bugs.webkit.org/show_bug.cgi?id=129682">Bug 129682</a> - On success, you should see a blue inverted-L shape and no red.</p>
-        <p>This test sets the mask-image via CSS to the entire SVG and then changes it to a &lt;mask&gt; element from the SVG via a script.</p>
-        <svg width="300px" height="400px">
-            <path fill="blue" d="M80,20 L280,20 L280,380 L240,380 L240,60 L80,60 L80,20"/>
-        </svg>
-    </body>
-</html>
\ No newline at end of file
diff --git a/LayoutTests/css3/masking/mask-svg-script-entire-svg-to-mask.html b/LayoutTests/css3/masking/mask-svg-script-entire-svg-to-mask.html
deleted file mode 100644 (file)
index e21fd60..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<!DOCTYPE html>
-<html>
-    <head>
-        <style>
-            p {
-                margin: 0px;
-            }
-            #maskedElement {
-                width: 300px;
-                height: 400px;
-                background-color: green;
-                -webkit-mask-image:url('resources/masks.svg');
-            }
-            #redSvg {
-                position: absolute;
-            }
-        </style>
-    </head>
-
-    <body>
-        <p><a href="https://bugs.webkit.org/show_bug.cgi?id=129682">Bug 129682</a> - On success, you should see a blue inverted-L shape and no red.</p>
-        <p>This test sets the mask-image via CSS to the entire SVG and then changes it to a &lt;mask&gt; element from the SVG via a script.</p>
-        <svg id="redSvg" width="300px" height="400px">
-            <path fill="red" d="M80,20 L280,20 L280,380 L240,380 L240,60 L80,60 L80,20"/>
-        </svg>
-        <div id="maskedElement"></div>
-
-        <script>
-            var maskedElement = document.getElementById("maskedElement");
-            maskedElement.style.cssText += "-webkit-mask-image:url('resources/masks.svg#upperHalf');background-color: blue";
-        </script>
-    </body>
-</html>
\ No newline at end of file
diff --git a/LayoutTests/css3/masking/mask-svg-script-mask-to-entire-svg-expected.html b/LayoutTests/css3/masking/mask-svg-script-mask-to-entire-svg-expected.html
deleted file mode 100644 (file)
index 5bbdbd0..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<!DOCTYPE html>
-<html>
-    <head>
-        <style>
-            p {
-                margin: 0px;
-            }
-            #maskedElement {
-                width: 300px;
-                height: 400px;
-                background-color: blue;
-                -webkit-mask-image:url('resources/masks.svg');
-            }
-        </style>
-    </head>
-    <body>
-        <p><a href="https://bugs.webkit.org/show_bug.cgi?id=129682">Bug 129682</a> - On success, you should see four blue squares and no red.</p>
-        <p>This test sets the mask-image via CSS to a &lt;mask&gt; element from an SVG file and then changes it to the entire SVG file via a script.</p>
-        <div id="maskedElement"></div>
-    </body>
-</html>
\ No newline at end of file
diff --git a/LayoutTests/css3/masking/mask-svg-script-mask-to-entire-svg.html b/LayoutTests/css3/masking/mask-svg-script-mask-to-entire-svg.html
deleted file mode 100644 (file)
index a0872e6..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<!DOCTYPE html>
-<html>
-    <head>
-        <style>
-            p {
-                margin: 0px;
-            }
-            #maskedElement {
-                width: 300px;
-                height: 400px;
-                background-color: green;
-                -webkit-mask-image:url('resources/masks.svg#lowerHalf');
-            }
-            #redSvg {
-                position: absolute;
-            }
-        </style>
-    </head>
-
-    <body>
-        <p><a href="https://bugs.webkit.org/show_bug.cgi?id=129682">Bug 129682</a> - On success, you should see four blue squares and no red.</p>
-        <p>This test sets the mask-image via CSS to a &lt;mask&gt; element from an SVG file and then changes it to the entire SVG file via a script.</p>
-        <svg id="redSvg" width="300px" height="400px">
-            <rect x="5px" y="45px" width="140px" height="140px" fill="red"/>
-            <rect x="155px" y="45px" width="140px" height="140px" fill="red"/>
-            <rect x="155px" y="215px" width="140px" height="140px" fill="red"/>
-            <rect x="5px" y="215px" width="140px" height="140px" fill="red"/>
-        </svg>
-        <div id="maskedElement"></div>
-
-        <script>
-            var maskedElement = document.getElementById("maskedElement");
-            maskedElement.style.cssText += "-webkit-mask-image:url('resources/masks.svg');background-color:blue";
-        </script>
-    </body>
-</html>
\ No newline at end of file
diff --git a/LayoutTests/css3/masking/mask-svg-script-mask-to-none-expected.html b/LayoutTests/css3/masking/mask-svg-script-mask-to-none-expected.html
deleted file mode 100644 (file)
index afc49d8..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE html>
-<html>
-    <head>
-        <style>
-            p {
-                margin: 0px;
-            }
-            #maskedElement {
-                width: 400px;
-                height: 400px;
-                background-color: blue;
-            }
-        </style>
-    </head>
-    <body>
-        <p><a href="https://bugs.webkit.org/show_bug.cgi?id=129682">Bug 129682</a> - On success, you should see a blue rectangle and no red.</p>
-        <p>This test sets the mask-image via CSS to a &lt;mask&gt; element from an external SVG file and then changes it to 'none' via a script.</p>
-        <div id="maskedElement"></div>
-    </body>
-</html>
\ No newline at end of file
diff --git a/LayoutTests/css3/masking/mask-svg-script-mask-to-none.html b/LayoutTests/css3/masking/mask-svg-script-mask-to-none.html
deleted file mode 100644 (file)
index cd1c1bc..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE html>
-<html>
-    <head>
-        <style>
-            p {
-                margin: 0px;
-            }
-            #maskedElement {
-                width: 400px;
-                height: 400px;
-                background-color: green;
-                -webkit-mask-image:url('resources/masks.svg#lowerHalf');
-            }
-            #redElement {
-                width: 400px;
-                height: 400px;
-                background-color: red;
-                position: absolute;
-                z-index: -1;
-            }
-        </style>
-    </head>
-
-    <body>
-        <p><a href="https://bugs.webkit.org/show_bug.cgi?id=129682">Bug 129682</a> - On success, you should see a blue rectangle and no red.</p>
-        <p>This test sets the mask-image via CSS to a &lt;mask&gt; element from an external SVG file and then changes it to 'none' via a script.</p>
-        <div id="redElement"></div>
-        <div id="maskedElement"></div>
-        <script>
-            var maskedElement = document.getElementById("maskedElement");
-            maskedElement.style.cssText += "-webkit-mask-image:none;background-color: blue";
-        </script>
-    </body>
-</html>
\ No newline at end of file
diff --git a/LayoutTests/css3/masking/mask-svg-script-mask-to-png-expected.html b/LayoutTests/css3/masking/mask-svg-script-mask-to-png-expected.html
deleted file mode 100644 (file)
index 82f526a..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<!DOCTYPE html>
-<html>
-    <head>
-        <style>
-            p {
-                margin: 0px;
-            }
-            #maskedElement {
-                width: 360px;
-                height: 288px;
-                background-color: blue;
-                -webkit-mask-image:url('resources/circle.png');
-            }
-        </style>
-    </head>
-    <body>
-        <p><a href="https://bugs.webkit.org/show_bug.cgi?id=129682">Bug 129682</a> - On success, you should see a blue circle and no red.</p>
-        <p>This test sets the mask-image via CSS to a &lt;mask&gt; element from an SVG file and then changes it to a PNG via a script.</p>
-        <div id="maskedElement"></div>
-    </body>
-</html>
\ No newline at end of file
diff --git a/LayoutTests/css3/masking/mask-svg-script-mask-to-png.html b/LayoutTests/css3/masking/mask-svg-script-mask-to-png.html
deleted file mode 100644 (file)
index d86b943..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<!DOCTYPE html>
-<html>
-    <head>
-        <style>
-            p {
-                margin: 0px;
-            }
-            #maskedElement {
-                width: 360px;
-                height: 288px;
-                background-color: red;
-                -webkit-mask-image:url('resources/masks.svg#lowerHalf');
-            }
-            #redElement {
-                position: absolute;
-                width: 360px;
-                height: 288px;
-                background-color: red;
-                -webkit-transform: scale(0.95, 0.95);
-                -webkit-mask-image: url('resources/circle.png');
-            }
-        </style>
-    </head>
-
-    <body>
-        <p><a href="https://bugs.webkit.org/show_bug.cgi?id=129682">Bug 129682</a> - On success, you should see a blue circle and no red.</p>
-        <p>This test sets the mask-image via CSS to a &lt;mask&gt; element from an SVG file and then changes it to a PNG via a script.</p>
-        <div id="redElement"></div>
-        <div id="maskedElement"></div>
-
-        <script>
-            var maskedElement = document.getElementById("maskedElement");
-            maskedElement.style.cssText += "-webkit-mask-image:url('resources/circle.png');background-color: blue";
-        </script>
-    </body>
-</html>
\ No newline at end of file
diff --git a/LayoutTests/css3/masking/mask-svg-script-none-to-mask-expected.html b/LayoutTests/css3/masking/mask-svg-script-none-to-mask-expected.html
deleted file mode 100644 (file)
index 5293ada..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<!DOCTYPE html>
-<html>
-    <head>
-        <style>
-            p {
-                margin: 0px;
-            }
-            #maskedElement {
-                width: 400px;
-                height: 400px;
-                background-color: blue;
-                -webkit-mask-image:url('resources/masks.svg#upperHalf');
-            }
-        </style>
-    </head>
-    <body>
-        <p><a href="https://bugs.webkit.org/show_bug.cgi?id=129682">Bug 129682</a> - On success, you should see a blue inverted-L shape and no red.</p>
-        <p>This test sets the mask-image value to a &lt;mask&gt; element from an external SVG via a script.</p>
-        <div id="maskedElement"></div>
-    </body>
-</html>
\ No newline at end of file
diff --git a/LayoutTests/css3/masking/mask-svg-script-none-to-mask.html b/LayoutTests/css3/masking/mask-svg-script-none-to-mask.html
deleted file mode 100644 (file)
index c971c91..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-<!DOCTYPE html>
-<html>
-    <head>
-        <style>
-            p {
-                margin: 0px;
-            }
-            #maskedElement {
-                width: 400px;
-                height: 400px;
-                background-color: red;
-            }
-            #redSvg {
-                position: absolute;
-            }
-        </style>
-    </head>
-
-    <body>
-        <p><a href="https://bugs.webkit.org/show_bug.cgi?id=129682">Bug 129682</a> - On success, you should see a blue inverted-L shape and no red.</p>
-        <p>This test sets the mask-image value to a &lt;mask&gt; element from an external SVG via a script.</p>
-        <svg id="redSvg" width="300px" height="400px">
-            <path fill="red" d="M80,20 L280,20 L280,380 L240,380 L240,60 L80,60 L80,20"/>
-        </svg>
-        <div id="maskedElement"></div>
-
-        <script>
-            var maskedElement = document.getElementById("maskedElement");
-            maskedElement.style.cssText += "-webkit-mask-image:url('resources/masks.svg#upperHalf');background-color: blue";
-        </script>
-    </body>
-</html>
\ No newline at end of file
diff --git a/LayoutTests/css3/masking/mask-svg-script-png-to-mask-expected.html b/LayoutTests/css3/masking/mask-svg-script-png-to-mask-expected.html
deleted file mode 100644 (file)
index 16f4ce8..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<!DOCTYPE html>
-<html>
-    <head>
-        <style>
-            p {
-                margin: 0px;
-            }
-        </style>
-    </head>
-    <body>
-        <p><a href="https://bugs.webkit.org/show_bug.cgi?id=129682">Bug 129682</a> - On success, you should see a blue inverted-L shape and no red.</p>
-        <p>This test sets the mask-image via CSS to a PNG and then changes it to a &lt;mask&gt; element from an SVG file via a script.</p>
-        <svg width="300px" height="400px">
-            <path fill="blue" d="M80,20 L280,20 L280,380 L240,380 L240,60 L80,60 L80,20"/>
-        </svg>
-    </body>
-</html>
\ No newline at end of file
diff --git a/LayoutTests/css3/masking/mask-svg-script-png-to-mask.html b/LayoutTests/css3/masking/mask-svg-script-png-to-mask.html
deleted file mode 100644 (file)
index 43dd32f..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<!DOCTYPE html>
-<html>
-    <head>
-        <style>
-            p {
-                margin: 0px;
-            }
-            #maskedElement {
-                width: 300px;
-                height: 400px;
-                background-color: green;
-                -webkit-mask-image:url('resources/circle.png');
-            }
-            #redSvg {
-                position: absolute;
-            }
-        </style>
-    </head>
-
-    <body>
-        <p><a href="https://bugs.webkit.org/show_bug.cgi?id=129682">Bug 129682</a> - On success, you should see a blue inverted-L shape and no red.</p>
-        <p>This test sets the mask-image via CSS to a PNG and then changes it to a &lt;mask&gt; element from an SVG file via a script.</p>
-        <svg id="redSvg" width="300px" height="400px">
-            <path fill="red" d="M80,20 L280,20 L280,380 L240,380 L240,60 L80,60 L80,20"/>
-        </svg>
-        <div id="maskedElement"></div>
-
-        <script>
-            var maskedElement = document.getElementById("maskedElement");
-            maskedElement.style.cssText += "-webkit-mask-image:url('resources/masks.svg#upperHalf');background-color: blue";
-        </script>
-    </body>
-</html>
\ No newline at end of file
index a4bf239..3350097 100644 (file)
@@ -2,6 +2,70 @@
 
         Revert use of SVG <mask> elements for -webkit-mask-image (r176798, r177494, r186180)
         https://bugs.webkit.org/show_bug.cgi?id=146653
+
+        Reviewed by Dean Jackson.
+
+        Fixes rdar://problem/21435233.
+
+        r177494 caused a number of regressions (bugs 141857, 146509, 146561), added new layering violations, and
+        was not being maintained, so revert it.
+
+        This patch reverts r177494.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::ComputedStyleExtractor::propertyValue):
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseFillProperty):
+        (WebCore::CSSParser::parseMaskImage): Deleted.
+        * css/CSSParser.h:
+        * css/CSSPropertyNames.in:
+        * css/CSSValue.h:
+        * css/StyleBuilderConverter.h:
+        (WebCore::StyleBuilderConverter::convertMaskImageOperations): Deleted.
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::loadPendingSVGDocuments):
+        (WebCore::StyleResolver::loadPendingImages):
+        (WebCore::StyleResolver::adjustStyleForMaskImages): Deleted.
+        (WebCore::StyleResolver::applyMatchedProperties): Deleted.
+        * css/StyleResolver.h:
+        * page/FrameView.cpp:
+        (WebCore::FrameView::containsSVGDocument):
+        * page/FrameView.h:
+        * page/animation/CSSPropertyAnimation.cpp:
+        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
+        (WebCore::blendFunc): Deleted.
+        (WebCore::MaskImagePropertyWrapper::MaskImagePropertyWrapper): Deleted.
+        (WebCore::MaskImagePropertyWrapper::equals): Deleted.
+        * platform/ScrollView.h:
+        (WebCore::ScrollView::containsSVGDocument):
+        * platform/graphics/MaskImageOperation.cpp:
+        (WebCore::MaskImageOperation::~MaskImageOperation): Deleted.
+        (WebCore::MaskImageOperation::operator==): Deleted.
+        * platform/graphics/MaskImageOperation.h:
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::maskClipRect):
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::paintFillLayerExtended):
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::updateFillImages):
+        (WebCore::RenderElement::~RenderElement): Deleted.
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::~RenderLayer): Deleted.
+        (WebCore::RenderLayer::calculateClipRects): Deleted.
+        * rendering/RenderLayer.h:
+        * rendering/RenderLayerMaskImageInfo.cpp: Removed.
+        * rendering/style/FillLayer.h:
+        (WebCore::FillLayer::image):
+        (WebCore::FillLayer::imageOrMaskImage):
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::setMaskImage): Deleted.
+        * rendering/style/RenderStyle.h:
+
+2015-07-06  Simon Fraser  <simon.fraser@apple.com>
+
+        Revert use of SVG <mask> elements for -webkit-mask-image (r176798, r177494, r186180)
+        https://bugs.webkit.org/show_bug.cgi?id=146653
         
         Fixes rdar://problem/21435233.
 
index 33be9e1..23c13b5 100644 (file)
                6C638896A96CCEE50C8C946C /* CachedResourceRequestInitiators.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6C638894A96CCEE50C8C946C /* CachedResourceRequestInitiators.cpp */; };
                6C6CCAB019DC42B90043D5DB /* WebKitCSSResourceValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6C6CCAAE19DC42B90043D5DB /* WebKitCSSResourceValue.cpp */; };
                6C6CCAB119DC42B90043D5DB /* WebKitCSSResourceValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C6CCAAF19DC42B90043D5DB /* WebKitCSSResourceValue.h */; };
-               6CBFE4A419EBF2D400CA2F9D /* RenderLayerMaskImageInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6CBFE4A219EBF2D400CA2F9D /* RenderLayerMaskImageInfo.cpp */; };
                6CBFE4A519EBF2D400CA2F9D /* RenderLayerMaskImageInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 6CBFE4A319EBF2D400CA2F9D /* RenderLayerMaskImageInfo.h */; };
                6CDDE8D01770BB220016E072 /* RegionOversetState.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C70A81417707C49009A446E /* RegionOversetState.h */; settings = {ATTRIBUTES = (Private, ); }; };
                6E0E569B183BFFE600E0E8D5 /* FloatRoundedRect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E0E5699183BFFE600E0E8D5 /* FloatRoundedRect.cpp */; };
                6C6CCAAE19DC42B90043D5DB /* WebKitCSSResourceValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitCSSResourceValue.cpp; sourceTree = "<group>"; };
                6C6CCAAF19DC42B90043D5DB /* WebKitCSSResourceValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitCSSResourceValue.h; sourceTree = "<group>"; };
                6C70A81417707C49009A446E /* RegionOversetState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegionOversetState.h; sourceTree = "<group>"; };
-               6CBFE4A219EBF2D400CA2F9D /* RenderLayerMaskImageInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderLayerMaskImageInfo.cpp; sourceTree = "<group>"; };
                6CBFE4A319EBF2D400CA2F9D /* RenderLayerMaskImageInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderLayerMaskImageInfo.h; sourceTree = "<group>"; };
                6E0E5699183BFFE600E0E8D5 /* FloatRoundedRect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FloatRoundedRect.cpp; sourceTree = "<group>"; };
                6E0E569A183BFFE600E0E8D5 /* FloatRoundedRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FloatRoundedRect.h; sourceTree = "<group>"; };
                                0F580CF90F12DE9B0051D689 /* RenderLayerCompositor.h */,
                                50D10D971545F5760096D288 /* RenderLayerFilterInfo.cpp */,
                                50D10D981545F5760096D288 /* RenderLayerFilterInfo.h */,
-                               6CBFE4A219EBF2D400CA2F9D /* RenderLayerMaskImageInfo.cpp */,
                                6CBFE4A319EBF2D400CA2F9D /* RenderLayerMaskImageInfo.h */,
                                3C244FE5A375AC633F88BE6F /* RenderLayerModelObject.cpp */,
                                3C244FE4A375AC633F88BE6F /* RenderLayerModelObject.h */,
                                0F580D000F12DE9B0051D689 /* RenderLayerBacking.cpp in Sources */,
                                0F580CFE0F12DE9B0051D689 /* RenderLayerCompositor.cpp in Sources */,
                                50D10D991545F5760096D288 /* RenderLayerFilterInfo.cpp in Sources */,
-                               6CBFE4A419EBF2D400CA2F9D /* RenderLayerMaskImageInfo.cpp in Sources */,
                                3C244FEBA375AC633F88BE6F /* RenderLayerModelObject.cpp in Sources */,
                                BC33FB1B0F30EE85002CDD7C /* RenderLineBoxList.cpp in Sources */,
                                BCEA4863097D93020094C9E4 /* RenderLineBreak.cpp in Sources */,
index 6f96497..53332be 100644 (file)
@@ -1906,8 +1906,9 @@ PassRefPtr<CSSValue> ComputedStyleExtractor::propertyValue(CSSPropertyID propert
 
         case CSSPropertyBackgroundColor:
             return cssValuePool().createColorValue(m_allowVisitedStyle? style->visitedDependentColor(CSSPropertyBackgroundColor).rgb() : style->backgroundColor().rgb());
-        case CSSPropertyBackgroundImage: {
-            const FillLayer* layers = style->backgroundLayers();
+        case CSSPropertyBackgroundImage:
+        case CSSPropertyWebkitMaskImage: {
+            const FillLayer* layers = propertyID == CSSPropertyWebkitMaskImage ? style->maskLayers() : style->backgroundLayers();
             if (!layers)
                 return cssValuePool().createIdentifierValue(CSSValueNone);
 
@@ -1927,27 +1928,6 @@ PassRefPtr<CSSValue> ComputedStyleExtractor::propertyValue(CSSPropertyID propert
             }
             return list.release();
         }
-        case CSSPropertyWebkitMaskImage: {
-            const FillLayer* layers = style->maskLayers();
-            if (!layers)
-                return cssValuePool().createIdentifierValue(CSSValueNone);
-
-            if (!layers->next()) {
-                if (layers->maskImage().get())
-                    return layers->maskImage()->cssValue();
-
-                return cssValuePool().createIdentifierValue(CSSValueNone);
-            }
-
-            RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
-            for (const FillLayer* currLayer = layers; currLayer; currLayer = currLayer->next()) {
-                if (currLayer->maskImage().get())
-                    list->append(*currLayer->maskImage()->cssValue());
-                else
-                    list->append(cssValuePool().createIdentifierValue(CSSValueNone));
-            }
-            return list.release();
-        }
         case CSSPropertyBackgroundSize:
         case CSSPropertyWebkitBackgroundSize:
         case CSSPropertyWebkitMaskSize: {
index 9cc308b..a2248ca 100644 (file)
@@ -90,7 +90,6 @@
 #include "TextEncoding.h"
 #include "WebKitCSSFilterValue.h"
 #include "WebKitCSSRegionRule.h"
-#include "WebKitCSSResourceValue.h"
 #include "WebKitCSSTransformValue.h"
 #include <JavaScriptCore/Profile.h>
 #include <bitset>
@@ -4704,11 +4703,8 @@ bool CSSParser::parseFillProperty(CSSPropertyID propId, CSSPropertyID& propId1,
                     }
                     break;
                 case CSSPropertyBackgroundImage:
-                    if (parseFillImage(*m_valueList, currValue))
-                        m_valueList->next();
-                    break;
                 case CSSPropertyWebkitMaskImage:
-                    if (parseMaskImage(*m_valueList, currValue))
+                    if (parseFillImage(*m_valueList, currValue))
                         m_valueList->next();
                     break;
                 case CSSPropertyWebkitBackgroundClip:
@@ -9911,30 +9907,6 @@ bool CSSParser::parseFilter(CSSParserValueList& valueList, RefPtr<CSSValue>& res
     return true;
 }
 
-bool CSSParser::parseMaskImage(CSSParserValueList& valueList, RefPtr<CSSValue>& outValue)
-{
-    outValue = nullptr;
-    CSSParserValue* value = valueList.current();
-    if (value->id == CSSValueNone) {
-        outValue = WebKitCSSResourceValue::create(cssValuePool().createIdentifierValue(CSSValueNone));
-        return outValue.get();
-    }
-
-    RefPtr<CSSValue> resourceValue;
-    if (value->unit == CSSPrimitiveValue::CSS_URI) {
-        if (protocolIs(value->string, "data"))
-            parseFillImage(valueList, resourceValue);
-        else
-            resourceValue = CSSPrimitiveValue::create(completeURL(value->string), CSSPrimitiveValue::CSS_URI);
-    } else
-        parseFillImage(valueList, resourceValue);
-
-    if (resourceValue)
-        outValue = WebKitCSSResourceValue::create(resourceValue);
-
-    return outValue.get();
-}
-
 #if ENABLE(CSS_REGIONS)
 static bool validFlowName(const String& flowName)
 {
index f7923c5..4e53008 100644 (file)
@@ -157,8 +157,6 @@ public:
     Vector<SourceSize> parseSizesAttribute(StringView);
     SourceSize sourceSize(std::unique_ptr<MediaQueryExp>&&, CSSParserValue&);
 
-    // FIXME: Maybe these two methods could be combined into one.
-    bool parseMaskImage(CSSParserValueList&, RefPtr<CSSValue>&);
     bool parseFillImage(CSSParserValueList&, RefPtr<CSSValue>&);
 
     enum FillPositionFlag { InvalidFillPosition = 0, AmbiguousFillPosition = 1, XFillPosition = 2, YFillPosition = 4 };
index ef94364..33797b5 100644 (file)
@@ -538,7 +538,7 @@ justify-items [Initial=initialSelfAlignment, Converter=SelfOrDefaultAlignmentDat
 -webkit-mask-box-image-width [Custom=All]
 -webkit-mask-clip [FillLayerProperty, NameForMethods=Clip]
 -webkit-mask-composite [FillLayerProperty, NameForMethods=Composite]
--webkit-mask-image [Custom=Initial|Inherit, Converter=MaskImageOperations]
+-webkit-mask-image [FillLayerProperty, NameForMethods=Image]
 -webkit-mask-origin [FillLayerProperty, NameForMethods=Origin]
 -webkit-mask-position [Longhands=-webkit-mask-position-x|-webkit-mask-position-y]
 -webkit-mask-position-x [FillLayerProperty, NameForMethods=XPosition]
index 59ea1c9..b956876 100644 (file)
@@ -171,7 +171,6 @@ protected:
 #endif
         SVGColorClass,
         SVGPaintClass,
-        WebKitCSSResourceClass,
 
 #if ENABLE(CSS_ANIMATIONS_LEVEL_2)
         AnimationTriggerScrollClass,
@@ -189,6 +188,7 @@ protected:
 #if ENABLE(CSS_GRID_LAYOUT)
         GridLineNamesClass,
 #endif
+        WebKitCSSResourceClass
 
         // Do not append non-list class types here.
     };
index 417a401..7a6beaf 100644 (file)
@@ -104,7 +104,6 @@ public:
     static Optional<float> convertPerspective(StyleResolver&, CSSValue&);
     static Optional<Length> convertMarqueeIncrement(StyleResolver&, CSSValue&);
     static Optional<FilterOperations> convertFilterOperations(StyleResolver&, CSSValue&);
-    static Vector<RefPtr<MaskImageOperation>> convertMaskImageOperations(StyleResolver&, CSSValue&);
 #if PLATFORM(IOS)
     static bool convertTouchCallout(StyleResolver&, CSSValue&);
 #endif
@@ -1013,57 +1012,6 @@ static inline WebKitCSSResourceValue* maskImageValueFromIterator(CSSValueList& m
     return &downcast<WebKitCSSResourceValue>(it->get());
 }
 
-inline Vector<RefPtr<MaskImageOperation>> StyleBuilderConverter::convertMaskImageOperations(StyleResolver& styleResolver, CSSValue& value)
-{
-    Vector<RefPtr<MaskImageOperation>> operations;
-    RefPtr<WebKitCSSResourceValue> maskImageValue;
-    RefPtr<CSSValueList> maskImagesList;
-    CSSValueList::iterator listIterator;
-    if (is<WebKitCSSResourceValue>(value))
-        maskImageValue = &downcast<WebKitCSSResourceValue>(value);
-    else if (is<CSSValueList>(value)) {
-        maskImagesList = &downcast<CSSValueList>(value);
-        listIterator = maskImagesList->begin();
-        maskImageValue = maskImageValueFromIterator(*maskImagesList, listIterator);
-    }
-
-    while (maskImageValue.get()) {
-        RefPtr<CSSValue> maskInnerValue = maskImageValue->innerValue();
-
-        RefPtr<MaskImageOperation> newMaskImage;
-        if (is<CSSPrimitiveValue>(maskInnerValue.get())) {
-            RefPtr<CSSPrimitiveValue> primitiveValue = downcast<CSSPrimitiveValue>(maskInnerValue.get());
-            if (primitiveValue->isValueID() && primitiveValue->getValueID() == CSSValueNone)
-                newMaskImage = MaskImageOperation::create();
-            else {
-                String cssUrl = primitiveValue->getStringValue();
-                URL url = styleResolver.document().completeURL(cssUrl);
-
-                bool isExternalDocument = SVGURIReference::isExternalURIReference(cssUrl, styleResolver.document());
-                newMaskImage = MaskImageOperation::create(maskImageValue, cssUrl, url.fragmentIdentifier(), isExternalDocument, &styleResolver.document().cachedResourceLoader());
-                if (isExternalDocument)
-                    styleResolver.state().maskImagesWithPendingSVGDocuments().append(newMaskImage);
-            }
-        } else {
-            if (RefPtr<StyleImage> image = styleResolver.styleImage(CSSPropertyWebkitMaskImage, *maskInnerValue))
-                newMaskImage = MaskImageOperation::create(image);
-        }
-
-        // If we didn't get a valid value, use None so we keep the correct number and order of masks.
-        if (!newMaskImage)
-            newMaskImage = MaskImageOperation::create();
-
-        operations.append(newMaskImage);
-
-        if (maskImagesList)
-            maskImageValue = maskImageValueFromIterator(*maskImagesList, ++listIterator);
-        else
-            maskImageValue = nullptr;
-    }
-
-    return operations;
-}
-
 inline RefPtr<FontFeatureSettings> StyleBuilderConverter::convertFontFeatureSettings(StyleResolver&, CSSValue& value)
 {
     if (is<CSSPrimitiveValue>(value)) {
index f223067..7e69fb9 100644 (file)
@@ -1158,63 +1158,6 @@ void StyleResolver::adjustStyleForInterCharacterRuby()
         style->setWritingMode(LeftToRightWritingMode);
 }
 
-void StyleResolver::adjustStyleForMaskImages()
-{
-    // If we already have the same mask image objects loaded on the old style,
-    // use the old ones instead of loading new ones.
-    RenderStyle* newStyle = m_state.style();
-    RenderStyle* oldStyle = (m_state.element() ? m_state.element()->renderStyle() : nullptr);
-
-    if (newStyle && oldStyle) {
-        Vector<RefPtr<MaskImageOperation>> removedExternalResources;
-        
-        // Get all mask objects from the old style in a vector
-        // so we can remove them as we match them, making the following steps faster.
-        Vector<RefPtr<MaskImageOperation>> oldStyleMaskImages;
-        const FillLayer* oldMaskLayer = oldStyle->maskLayers();
-        while (oldMaskLayer) {
-            RefPtr<MaskImageOperation> oldMaskImage = oldMaskLayer->maskImage();
-            if (oldMaskImage.get())
-                oldStyleMaskImages.append(oldMaskImage);
-
-            oldMaskLayer = oldMaskLayer->next();
-        }
-
-        if (oldStyleMaskImages.isEmpty())
-            return;
-
-        // Try to match the new mask objects through the list from the old style.
-        // This should work perfectly and optimal when the list of masks remained
-        // the same and also work correctly (but slower) when they were reordered.
-        FillLayer* newMaskLayer = &newStyle->ensureMaskLayers();
-        int countOldStyleMaskImages = oldStyleMaskImages.size();
-        while (newMaskLayer && countOldStyleMaskImages) {
-            RefPtr<MaskImageOperation> newMaskImage = newMaskLayer->maskImage();
-            if (newMaskImage.get()) {
-                for (int i = 0; i < countOldStyleMaskImages; i++) {
-                    RefPtr<MaskImageOperation> oldMaskImage = oldStyleMaskImages[i];
-                    if (*oldMaskImage == *newMaskImage) {
-                        newMaskLayer->setMaskImage(oldMaskImage);
-                        if (newMaskImage->isExternalDocument())
-                            removedExternalResources.append(newMaskImage);
-
-                        oldStyleMaskImages.remove(i);
-                        countOldStyleMaskImages--;
-                        break;
-                    }
-                }
-            }
-
-            newMaskLayer = newMaskLayer->next();
-        }
-
-        Vector<RefPtr<MaskImageOperation>>& pendingResources = m_state.maskImagesWithPendingSVGDocuments();
-        pendingResources.removeAllMatching([&removedExternalResources] (const RefPtr<MaskImageOperation>& resource) {
-            return removedExternalResources.contains(resource);
-        });
-    }
-}
-
 void StyleResolver::adjustRenderStyle(RenderStyle& style, const RenderStyle& parentStyle, Element *e)
 {
     // Cache our original display.
@@ -1810,8 +1753,6 @@ void StyleResolver::applyMatchedProperties(const MatchResult& matchResult, const
     // There are some CSS properties that affect the same RenderStyle values,
     // so to preserve behavior, we queue them up during cascade and flush here.
     cascade.applyDeferredProperties(*this);
-    
-    adjustStyleForMaskImages();
 
     // Start loading resources referenced by this style.
     loadPendingResources();
@@ -2239,13 +2180,7 @@ void StyleResolver::loadPendingSVGDocuments()
     // style is NULL. We don't know exactly why this happens. Our guess is
     // reentering styleForElement().
     ASSERT(state.style());
-    if (!state.style())
-        return;
-    
-    bool hasFilters = (state.style()->hasFilter() && !state.filtersWithPendingSVGDocuments().isEmpty());
-    bool hasMasks = (state.style()->hasMask() && !state.maskImagesWithPendingSVGDocuments().isEmpty());
-    
-    if (!hasFilters && !hasMasks)
+    if (!state.style() || !state.style()->hasFilter() || state.filtersWithPendingSVGDocuments().isEmpty())
         return;
 
     ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions();
@@ -2253,19 +2188,10 @@ void StyleResolver::loadPendingSVGDocuments()
 
     CachedResourceLoader& cachedResourceLoader = state.document().cachedResourceLoader();
     
-    if (hasFilters) {
-        for (auto& filterOperation : state.filtersWithPendingSVGDocuments())
-            filterOperation->getOrCreateCachedSVGDocumentReference()->load(cachedResourceLoader, options);
-
-        state.filtersWithPendingSVGDocuments().clear();
-    }
-    
-    if (hasMasks) {
-        for (auto& maskImageOperation : state.maskImagesWithPendingSVGDocuments())
-            maskImageOperation->ensureCachedSVGDocumentReference()->load(cachedResourceLoader, options);
+    for (auto& filterOperation : state.filtersWithPendingSVGDocuments())
+        filterOperation->getOrCreateCachedSVGDocumentReference()->load(cachedResourceLoader, options);
 
-        state.maskImagesWithPendingSVGDocuments().clear();
-    }
+    state.filtersWithPendingSVGDocuments().clear();
 }
 
 bool StyleResolver::createFilterOperations(CSSValue& inValue, FilterOperations& outOperations)
@@ -2528,10 +2454,9 @@ void StyleResolver::loadPendingImages()
         }
         case CSSPropertyWebkitMaskImage: {
             for (FillLayer* maskLayer = &m_state.style()->ensureMaskLayers(); maskLayer; maskLayer = maskLayer->next()) {
-                RefPtr<MaskImageOperation> maskImage = maskLayer->maskImage();
-                auto* styleImage = maskImage.get() ? maskImage->image() : nullptr;
+                auto* styleImage = maskLayer->image();
                 if (is<StylePendingImage>(styleImage))
-                    maskImage->setImage(loadPendingImage(downcast<StylePendingImage>(*styleImage)));
+                    maskLayer->setImage(loadPendingImage(downcast<StylePendingImage>(*styleImage)));
             }
             break;
         }
index bf83e45..0c33fce 100644 (file)
@@ -302,7 +302,6 @@ private:
 #endif
     
     void adjustStyleForInterCharacterRuby();
-    void adjustStyleForMaskImages();
     
     bool fastRejectSelector(const RuleData&) const;
 
index bacc3f8..5fd1559 100644 (file)
@@ -4508,6 +4508,14 @@ bool FrameView::isFlippedDocument() const
     return renderView->style().isFlippedBlocksWritingMode();
 }
 
+bool FrameView::containsSVGDocument() const
+{
+    if (frame().document())
+        return frame().document()->isSVGDocument();
+    
+    return false;
+}
+
 void FrameView::notifyWidgetsInAllFrames(WidgetNotification notification)
 {
     for (auto* frame = m_frame.ptr(); frame; frame = frame->tree().traverseNext(m_frame.ptr())) {
index 2ae1674..aa9dfd5 100644 (file)
@@ -561,6 +561,7 @@ protected:
 
     virtual bool isVerticalDocument() const override;
     virtual bool isFlippedDocument() const override;
+    virtual bool containsSVGDocument() const override;
 
 private:
     explicit FrameView(Frame&);
index 192bcef..1b9d423 100644 (file)
@@ -42,7 +42,6 @@
 #include "ClipPathOperation.h"
 #include "FloatConversion.h"
 #include "IdentityTransformOperation.h"
-#include "MaskImageOperation.h"
 #include "Matrix3DTransformOperation.h"
 #include "MatrixTransformOperation.h"
 #include "RenderBox.h"
@@ -348,19 +347,6 @@ static inline PassRefPtr<StyleImage> blendFunc(const AnimationBase* anim, StyleI
     return to;
 }
 
-static inline PassRefPtr<MaskImageOperation> blendFunc(const AnimationBase* anim, const RefPtr<MaskImageOperation> from, const RefPtr<MaskImageOperation> to, double progress)
-{
-    if (!from.get() || !to.get())
-        return to;
-
-    // Only animates between masks using images (PNG, entire SVG, generated image).
-    // It does not animate between <mask> elements (file.svg#identifier).
-    if (from->image() && to->image())
-        return MaskImageOperation::create(blendFunc(anim, from->image(), to->image(), progress));
-
-    return to;
-}
-
 static inline NinePieceImage blendFunc(const AnimationBase* anim, const NinePieceImage& from, const NinePieceImage& to, double progress)
 {
     if (!from.hasImage() || !to.hasImage())
@@ -527,31 +513,6 @@ public:
     }
 };
 
-class MaskImagePropertyWrapper : public PropertyWrapper<const RefPtr<MaskImageOperation>> {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    MaskImagePropertyWrapper()
-        : PropertyWrapper<const RefPtr<MaskImageOperation>>(CSSPropertyWebkitMaskImage, &RenderStyle::maskImage, &RenderStyle::setMaskImage)
-    {
-    }
-    
-    virtual bool equals(const RenderStyle* a, const RenderStyle* b) const
-    {
-        // If the style pointers are the same, don't bother doing the test.
-        // If either is null, return false. If both are null, return true.
-        if (a == b)
-            return true;
-        if (!a || !b)
-            return false;
-        
-        const RefPtr<MaskImageOperation> maskImageA = (a->*m_getter)();
-        const RefPtr<MaskImageOperation> maskImageB = (b->*m_getter)();
-        StyleImage* styleImageA = (maskImageA ? maskImageA->image() : nullptr);
-        StyleImage* styleImageB = (maskImageB ? maskImageB->image() : nullptr);
-        return StyleImage::imagesEquivalent(styleImageA, styleImageB);
-    }
-};
-
 class PropertyWrapperColor : public PropertyWrapperGetter<Color> {
     WTF_MAKE_FAST_ALLOCATED;
 public:
@@ -1239,7 +1200,7 @@ CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap()
 
         new FillLayersPropertyWrapper(CSSPropertyBackgroundImage, &RenderStyle::backgroundLayers, &RenderStyle::ensureBackgroundLayers),
         new StyleImagePropertyWrapper(CSSPropertyListStyleImage, &RenderStyle::listStyleImage, &RenderStyle::setListStyleImage),
-        new MaskImagePropertyWrapper(),
+        new StyleImagePropertyWrapper(CSSPropertyWebkitMaskImage, &RenderStyle::maskImage, &RenderStyle::setMaskImage),
 
         new StyleImagePropertyWrapper(CSSPropertyBorderImageSource, &RenderStyle::borderImageSource, &RenderStyle::setBorderImageSource),
         new LengthPropertyWrapper<LengthBox>(CSSPropertyBorderImageSlice, &RenderStyle::borderImageSlices, &RenderStyle::setBorderImageSlices),
index d2d7330..6e8df72 100644 (file)
@@ -408,6 +408,7 @@ protected:
     // Subclassed by FrameView to check the writing-mode of the document.
     virtual bool isVerticalDocument() const { return true; }
     virtual bool isFlippedDocument() const { return false; }
+    virtual bool containsSVGDocument() const { return false; }
 
     // Called to update the scrollbars to accurately reflect the state of the view.
     void updateScrollbars(const IntSize& desiredOffset);
index 46142e3..6c283f4 100644 (file)
@@ -82,15 +82,6 @@ MaskImageOperation::MaskImageOperation()
 
 MaskImageOperation::~MaskImageOperation()
 {
-    setRenderLayerImageClient(nullptr);
-}
-
-bool MaskImageOperation::operator==(const MaskImageOperation& other) const
-{
-    if (m_url.length())
-        return (m_url == other.m_url && m_fragment == other.m_fragment && m_isExternalDocument == other.m_isExternalDocument);
-
-    return m_styleImage.get() == other.m_styleImage.get();
 }
 
 bool MaskImageOperation::isCSSValueNone() const
index b0c1a46..3c7f245 100644 (file)
@@ -55,13 +55,9 @@ public:
     PassRefPtr<CSSValue> cssValue();
 
     virtual ~MaskImageOperation();
-    
-    bool operator==(const MaskImageOperation&) const;
-    inline bool operator!=(const MaskImageOperation& other) const { return !operator==(other); }
 
     const String& url() const { return m_url; }
     const String& fragment() const { return m_fragment; }
-    bool isExternalDocument() const { return m_isExternalDocument; }
     StyleImage* image() const { return m_styleImage.get(); }
     void setImage(PassRefPtr<StyleImage>);
     void setRenderLayerImageClient(CachedImageClient*);
index 6171db5..078f903 100644 (file)
@@ -1573,7 +1573,7 @@ LayoutRect RenderBox::maskClipRect(const LayoutPoint& paintOffset)
     LayoutRect result;
     LayoutRect borderBox = borderBoxRect();
     for (const FillLayer* maskLayer = style().maskLayers(); maskLayer; maskLayer = maskLayer->next()) {
-        if (maskLayer->maskImage()) {
+        if (maskLayer->image()) {
             // Masks should never have fixed attachment, so it's OK for paintContainer to be null.
             BackgroundImageGeometry geometry = calculateBackgroundImageGeometry(nullptr, *maskLayer, paintOffset, borderBox);
             result.unite(geometry.destRect());
index 84997fd..0c3712e 100644 (file)
@@ -27,8 +27,6 @@
 #include "RenderBoxModelObject.h"
 
 #include "BorderEdge.h"
-#include "CachedImage.h"
-#include "CachedSVGDocument.h"
 #include "FloatRoundedRect.h"
 #include "Frame.h"
 #include "FrameView.h"
 #include "RenderNamedFlowFragment.h"
 #include "RenderNamedFlowThread.h"
 #include "RenderRegion.h"
-#include "RenderSVGResourceMasker.h"
 #include "RenderTable.h"
 #include "RenderTableRow.h"
 #include "RenderText.h"
 #include "RenderTextFragment.h"
 #include "RenderView.h"
-#include "SVGImageForContainer.h"
 #include "ScrollingConstraints.h"
 #include "Settings.h"
-#include "StyleCachedImage.h"
 #include "TransformState.h"
 #include <wtf/NeverDestroyed.h>
 
@@ -684,7 +679,7 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
     FloatRect pixelSnappedRect = snapRectToDevicePixels(rect, deviceScaleFactor);
 
     // Fast path for drawing simple color backgrounds.
-    if (!isRoot && !clippedWithLocalScrolling && !shouldPaintBackgroundImage && isBorderFill && !bgLayer->hasMaskImage() && !bgLayer->next()) {
+    if (!isRoot && !clippedWithLocalScrolling && !shouldPaintBackgroundImage && isBorderFill && !bgLayer->next()) {
         if (!colorVisible)
             return;
 
@@ -844,25 +839,18 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
     }
 
     // no progressive loading of the background image
-    if (!baseBgColorOnly && (shouldPaintBackgroundImage || bgLayer->hasMaskImage())) {
+    if (!baseBgColorOnly && shouldPaintBackgroundImage) {
         BackgroundImageGeometry geometry = calculateBackgroundImageGeometry(paintInfo.paintContainer, *bgLayer, rect.location(), scrolledPaintRect, backgroundObject);
         geometry.clip(LayoutRect(pixelSnappedRect));
-
         if (!geometry.destRect().isEmpty()) {
-            bool didPaintCustomMask = false;
             CompositeOperator compositeOp = op == CompositeSourceOver ? bgLayer->composite() : op;
             auto clientForBackgroundImage = backgroundObject ? backgroundObject : this;
-            RefPtr<Image> image = (bgImage ? bgImage->image(clientForBackgroundImage, geometry.tileSize()) : nullptr);
-            if (!image.get() && bgLayer->hasMaskImage())
-                didPaintCustomMask = bgLayer->maskImage()->drawMask(*this, geometry, context, compositeOp);
-
-            if (!didPaintCustomMask && shouldPaintBackgroundImage) {
-                context->setDrawLuminanceMask(bgLayer->maskSourceType() == MaskLuminance);
-                bool useLowQualityScaling = shouldPaintAtLowQuality(context, image.get(), bgLayer, geometry.tileSize());
-                if (image.get())
-                    image->setSpaceSize(geometry.spaceSize());
-                context->drawTiledImage(image.get(), style().colorSpace(), geometry.destRect(), toLayoutPoint(geometry.relativePhase()), geometry.tileSize(), ImagePaintingOptions(compositeOp, bgLayer->blendMode(), ImageOrientationDescription(), useLowQualityScaling));
-            }
+            RefPtr<Image> image = bgImage->image(clientForBackgroundImage, geometry.tileSize());
+            context->setDrawLuminanceMask(bgLayer->maskSourceType() == MaskLuminance);
+            bool useLowQualityScaling = shouldPaintAtLowQuality(context, image.get(), bgLayer, geometry.tileSize());
+            if (image.get())
+                image->setSpaceSize(geometry.spaceSize());
+            context->drawTiledImage(image.get(), style().colorSpace(), geometry.destRect(), toLayoutPoint(geometry.relativePhase()), geometry.tileSize(), ImagePaintingOptions(compositeOp, bgLayer->blendMode(), ImageOrientationDescription(), useLowQualityScaling));
         }
     }
 
index d597787..132cdde 100644 (file)
@@ -123,8 +123,6 @@ RenderElement::~RenderElement()
         for (const FillLayer* maskLayer = m_style->maskLayers(); maskLayer; maskLayer = maskLayer->next()) {
             if (StyleImage* maskImage = maskLayer->image())
                 maskImage->removeClient(this);
-            else if (maskLayer->maskImage().get())
-                maskLayer->maskImage()->removeRendererImageClient(this);
         }
 
         if (StyleImage* borderImage = m_style->borderImage().image())
@@ -332,17 +330,13 @@ void RenderElement::updateFillImages(const FillLayer* oldLayers, const FillLayer
     
     // Go through the new layers and addClients first, to avoid removing all clients of an image.
     for (const FillLayer* currNew = newLayers; currNew; currNew = currNew->next()) {
-        if (StyleImage* image = currNew->image())
-            image->addClient(this);
-        else if (currNew->maskImage().get())
-            currNew->maskImage()->addRendererImageClient(this);
+        if (currNew->image())
+            currNew->image()->addClient(this);
     }
 
     for (const FillLayer* currOld = oldLayers; currOld; currOld = currOld->next()) {
-        if (StyleImage* image = currOld->image())
-            image->removeClient(this);
-        else if (currOld->maskImage().get())
-            currOld->maskImage()->removeRendererImageClient(this);
+        if (currOld->image())
+            currOld->image()->removeClient(this);
     }
 }
 
index 54c10fc..e1ee00c 100644 (file)
@@ -370,7 +370,6 @@ RenderLayer::~RenderLayer()
         removeReflection();
 
     FilterInfo::remove(*this);
-    MaskImageInfo::remove(*this);
 
     // Child layers will be deleted by their corresponding render objects, so
     // we don't need to delete them ourselves.
@@ -6713,7 +6712,6 @@ void RenderLayer::styleChanged(StyleDifference diff, const RenderStyle* oldStyle
     updateBlendMode();
 #endif
     updateOrRemoveFilterClients();
-    updateOrRemoveMaskImageClients();
 
     updateNeedsCompositedScrolling();
 
@@ -6868,14 +6866,6 @@ void RenderLayer::updateOrRemoveFilterClients()
         filterInfo->removeReferenceFilterClients();
 }
 
-void RenderLayer::updateOrRemoveMaskImageClients()
-{
-    if (renderer().style().maskImage().get())
-        MaskImageInfo::get(*this).updateMaskImageClients();
-    else if (MaskImageInfo* maskImageInfo = MaskImageInfo::getIfExists(*this))
-        maskImageInfo->removeMaskImageClients();
-}
-
 void RenderLayer::updateOrRemoveFilterEffectRenderer()
 {
     // FilterEffectRenderer is only used to render the filters in software mode,
index f52118a..853a81c 100644 (file)
@@ -920,7 +920,6 @@ private:
 
     void updateOrRemoveFilterClients();
     void updateOrRemoveFilterEffectRenderer();
-    void updateOrRemoveMaskImageClients();
 
 #if ENABLE(CSS_COMPOSITING)
     void updateAncestorChainHasBlendingDescendants();
diff --git a/Source/WebCore/rendering/RenderLayerMaskImageInfo.cpp b/Source/WebCore/rendering/RenderLayerMaskImageInfo.cpp
deleted file mode 100644 (file)
index eb102ac..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
- * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
- * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "RenderLayerMaskImageInfo.h"
-
-#include "CachedSVGDocument.h"
-#include "SVGMaskElement.h"
-#include <wtf/NeverDestroyed.h>
-
-namespace WebCore {
-
-class RenderLayer::MaskImageInfo::SVGDocumentClient : public CachedSVGDocumentClient {
-public:
-    SVGDocumentClient(RenderLayer& layer)
-        : m_layer(layer)
-    {
-    }
-
-private:
-    virtual void notifyFinished(CachedResource*) override
-    {
-        m_layer.renderer().repaint();
-    }
-
-    RenderLayer& m_layer;
-};
-
-class RenderLayer::MaskImageInfo::ImageClient : public CachedImageClient {
-public:
-    ImageClient(RenderLayer& layer)
-        : m_layer(layer)
-    {
-    }
-
-private:
-    virtual void imageChanged(CachedImage*, const IntRect*) override
-    {
-        m_layer.renderer().repaint();
-    }
-
-    RenderLayer& m_layer;
-};
-
-HashMap<const RenderLayer*, std::unique_ptr<RenderLayer::MaskImageInfo>>& RenderLayer::MaskImageInfo::layerToMaskMap()
-{
-    static NeverDestroyed<HashMap<const RenderLayer*, std::unique_ptr<MaskImageInfo>>> layerToMaskMap;
-    return layerToMaskMap;
-}
-
-RenderLayer::MaskImageInfo* RenderLayer::MaskImageInfo::getIfExists(const RenderLayer& layer)
-{
-    ASSERT(layer.m_hasMaskImageInfo == layerToMaskMap().contains(&layer));
-    return layer.m_hasMaskImageInfo ? layerToMaskMap().get(&layer) : nullptr;
-}
-
-RenderLayer::MaskImageInfo& RenderLayer::MaskImageInfo::get(RenderLayer& layer)
-{
-    ASSERT(layer.m_hasMaskImageInfo == layerToMaskMap().contains(&layer));
-
-    auto& info = layerToMaskMap().add(&layer, nullptr).iterator->value;
-    if (!info) {
-        info = std::make_unique<MaskImageInfo>(layer);
-        layer.m_hasMaskImageInfo = true;
-    }
-    return *info;
-}
-
-void RenderLayer::MaskImageInfo::remove(RenderLayer& layer)
-{
-    ASSERT(layer.m_hasMaskImageInfo == layerToMaskMap().contains(&layer));
-
-    if (layerToMaskMap().remove(&layer))
-        layer.m_hasMaskImageInfo = false;
-}
-
-RenderLayer::MaskImageInfo::MaskImageInfo(RenderLayer& layer)
-    : m_layer(layer)
-    , m_svgDocumentClient(std::make_unique<SVGDocumentClient>(layer))
-    , m_imageClient(std::make_unique<ImageClient>(layer))
-{
-}
-
-RenderLayer::MaskImageInfo::~MaskImageInfo()
-{
-    removeMaskImageClients();
-}
-
-void RenderLayer::MaskImageInfo::updateMaskImageClients()
-{
-    removeMaskImageClients();
-    
-    for (auto* maskLayer = m_layer.renderer().style().maskLayers(); maskLayer; maskLayer = maskLayer->next()) {
-        RefPtr<MaskImageOperation> maskImage = maskLayer->maskImage();
-        maskImage->setRenderLayerImageClient(m_imageClient.get());
-        m_maskImageOperations.append(maskImage);
-
-        CachedSVGDocumentReference* documentReference = maskImage->cachedSVGDocumentReference();
-        CachedSVGDocument* cachedSVGDocument = documentReference ? documentReference->document() : nullptr;
-        
-        if (cachedSVGDocument) {
-            // Reference is external; wait for notifyFinished and then repaint.
-            cachedSVGDocument->addClient(m_svgDocumentClient.get());
-            m_externalSVGReferences.append(cachedSVGDocument);
-        } else {
-            // Reference is internal; add layer as a client so we can trigger mask repaint on SVG attribute change.
-            Element* masker = m_layer.renderer().document().getElementById(maskImage->fragment());
-            if (is<SVGMaskElement>(masker)) {
-                downcast<SVGMaskElement>(*masker).addClientRenderLayer(&m_layer);
-                m_internalSVGReferences.append(masker);
-            }
-        }
-    }
-}
-
-void RenderLayer::MaskImageInfo::removeMaskImageClients()
-{
-    for (auto& maskImage : m_maskImageOperations)
-        maskImage->setRenderLayerImageClient(nullptr);
-    m_maskImageOperations.clear();
-
-    for (auto& externalSVGReference : m_externalSVGReferences)
-        externalSVGReference->removeClient(m_svgDocumentClient.get());
-    m_externalSVGReferences.clear();
-    
-    for (auto& internalSVGReference : m_internalSVGReferences)
-        downcast<SVGMaskElement>(internalSVGReference.get())->removeClientRenderLayer(&m_layer);
-    m_internalSVGReferences.clear();
-}
-
-} // namespace WebCore
index 0309863..c5e106d 100644 (file)
@@ -68,8 +68,9 @@ public:
     explicit FillLayer(EFillLayerType);
     ~FillLayer();
 
-    StyleImage* image() const { return hasMaskImage() ? maskImage()->image() : m_image.get(); }
     const RefPtr<MaskImageOperation>& maskImage() const { return m_maskImageOperation; }
+    StyleImage* image() const { return m_image.get(); }
+    StyleImage* imageOrMaskImage() const { return hasMaskImage() ? maskImage()->image() : image(); }
     const Length& xPosition() const { return m_xPosition; }
     const Length& yPosition() const { return m_yPosition; }
     BackgroundEdgeOrigin backgroundXOrigin() const { return static_cast<BackgroundEdgeOrigin>(m_backgroundXOrigin); }
@@ -181,8 +182,6 @@ private:
 
     std::unique_ptr<FillLayer> m_next;
 
-    // FIXME: A FillLayer will always have at least one of these pointers null.
-    // Maybe we could group them together somehow and decrease the size of FillLayer.
     RefPtr<MaskImageOperation> m_maskImageOperation;
     RefPtr<StyleImage> m_image;
 
index 47fee89..cc06a49 100644 (file)
@@ -895,28 +895,6 @@ bool RenderStyle::diffRequiresLayerRepaint(const RenderStyle& style, bool isComp
 
     return false;
 }
-    
-void RenderStyle::setMaskImage(const Vector<RefPtr<MaskImageOperation>>& ops)
-{
-    FillLayer* curLayer = &rareNonInheritedData.access()->m_mask;
-    while (curLayer) {
-        curLayer->setMaskImage(nullptr);
-        curLayer = curLayer->next();
-    }
-
-    curLayer = &rareNonInheritedData.access()->m_mask;
-    FillLayer* prevLayer = nullptr;
-    for (auto& maskImage : ops) {
-        if (!curLayer) {
-            prevLayer->setNext(std::make_unique<FillLayer>(MaskFillLayer));
-            curLayer = prevLayer->next();
-        }
-
-        curLayer->setMaskImage(maskImage);
-        prevLayer = curLayer;
-        curLayer = curLayer->next();
-    }
-}
 
 void RenderStyle::setClip(Length top, Length right, Length bottom, Length left)
 {
index a369f30..ccc5322 100644 (file)
@@ -107,7 +107,6 @@ class FilterOperations;
 class FontCascade;
 class FontMetrics;
 class IntRect;
-class MaskImageOperation;
 class Pair;
 class ShadowData;
 class StyleImage;
@@ -809,6 +808,7 @@ public:
     FillLayer& ensureBackgroundLayers() { return m_background.access()->m_background; }
     const FillLayer* backgroundLayers() const { return &(m_background->background()); }
 
+    StyleImage* maskImage() const { return rareNonInheritedData->m_mask.image(); }
     EFillRepeat maskRepeatX() const { return static_cast<EFillRepeat>(rareNonInheritedData->m_mask.repeatX()); }
     EFillRepeat maskRepeatY() const { return static_cast<EFillRepeat>(rareNonInheritedData->m_mask.repeatY()); }
     CompositeOperator maskComposite() const { return static_cast<CompositeOperator>(rareNonInheritedData->m_mask.composite()); }
@@ -1049,7 +1049,7 @@ public:
     void applyTransform(TransformationMatrix&, const FloatRect& boundingBox, ApplyTransformOrigin = IncludeTransformOrigin) const;
     void setPageScaleTransform(float);
 
-    bool hasMask() const { return rareNonInheritedData->m_mask.hasNonEmptyMaskImage() || rareNonInheritedData->m_mask.hasImage() || rareNonInheritedData->m_maskBoxImage.hasImage(); }
+    bool hasMask() const { return rareNonInheritedData->m_mask.hasImage() || rareNonInheritedData->m_maskBoxImage.hasImage(); }
 
     TextCombine textCombine() const { return static_cast<TextCombine>(rareNonInheritedData->m_textCombine); }
     bool hasTextCombine() const { return textCombine() != TextCombineNone; }
@@ -1155,9 +1155,6 @@ public:
     FilterOperations& mutableFilter() { return rareNonInheritedData.access()->m_filter.access()->m_operations; }
     const FilterOperations& filter() const { return rareNonInheritedData->m_filter->m_operations; }
     bool hasFilter() const { return !rareNonInheritedData->m_filter->m_operations.operations().isEmpty(); }
-    
-    RefPtr<MaskImageOperation>& mutableMaskImage() { return rareNonInheritedData.access()->m_mask.m_maskImageOperation; }
-    const RefPtr<MaskImageOperation> maskImage() const { return rareNonInheritedData->m_mask.maskImage(); }
 
 #if ENABLE(FILTERS_LEVEL_2)
     FilterOperations& mutableBackdropFilter() { return rareNonInheritedData.access()->m_backdropFilter.access()->m_operations; }
@@ -1413,6 +1410,8 @@ public:
         }
     }
 
+    void setMaskImage(PassRefPtr<StyleImage> v) { rareNonInheritedData.access()->m_mask.setImage(v); }
+
     void setMaskBoxImage(const NinePieceImage& b) { SET_VAR(rareNonInheritedData, m_maskBoxImage, b); }
     void setMaskBoxImageSource(PassRefPtr<StyleImage> v) { rareNonInheritedData.access()->m_maskBoxImage.setImage(v); }
     void setMaskXPosition(Length length) { SET_VAR(rareNonInheritedData, m_mask.m_xPosition, WTF::move(length)); }
@@ -1618,9 +1617,6 @@ public:
     void setBackdropFilter(const FilterOperations& ops) { SET_VAR(rareNonInheritedData.access()->m_backdropFilter, m_operations, ops); }
 #endif
 
-    void setMaskImage(const Vector<RefPtr<MaskImageOperation>>&);
-    void setMaskImage(const RefPtr<MaskImageOperation> maskImage) { Vector<RefPtr<MaskImageOperation>> vectMask; vectMask.append(maskImage); setMaskImage(vectMask); }
-
     void setTabSize(unsigned size) { SET_VAR(rareInheritedData, m_tabSize, size); }
 
     // End CSS3 Setters