From 298b74c26600efd3a63b0c42d45073910e6faae8 Mon Sep 17 00:00:00 2001 From: Dorel Luca Date: Mon, 3 Sep 2018 07:15:08 +0300 Subject: [PATCH] Backed out changeset a0621cac7491 (bug 1486252) for wpt failures on /css/css-masking/mask-image/mask-image-url-remote-mask.html --- layout/style/nsStyleStruct.cpp | 34 ++---- testing/web-platform/meta/MANIFEST.json | 100 ------------------ .../mask-image/mask-image-url-image-hash.html | 28 ----- .../mask-image/mask-image-url-image.html | 28 ----- .../mask-image/mask-image-url-local-mask.html | 33 ------ .../mask-image-url-remote-mask.html | 28 ----- .../mask-image/reference/mask-image-ref.html | 14 --- .../mask-image/support/image-with-ref.svg | 9 -- .../css-masking/mask-image/support/image.svg | 3 - .../css-masking/mask-image/support/mask.svg | 5 - 10 files changed, 11 insertions(+), 271 deletions(-) delete mode 100644 testing/web-platform/tests/css/css-masking/mask-image/mask-image-url-image-hash.html delete mode 100644 testing/web-platform/tests/css/css-masking/mask-image/mask-image-url-image.html delete mode 100644 testing/web-platform/tests/css/css-masking/mask-image/mask-image-url-local-mask.html delete mode 100644 testing/web-platform/tests/css/css-masking/mask-image/mask-image-url-remote-mask.html delete mode 100644 testing/web-platform/tests/css/css-masking/mask-image/reference/mask-image-ref.html delete mode 100644 testing/web-platform/tests/css/css-masking/mask-image/support/image-with-ref.svg delete mode 100644 testing/web-platform/tests/css/css-masking/mask-image/support/image.svg delete mode 100644 testing/web-platform/tests/css/css-masking/mask-image/support/mask.svg diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp index 0253fae1cdb5..88658c10400d 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp @@ -1320,30 +1320,18 @@ nsStyleSVGReset::FinishStyle(nsPresContext* aPresContext, const nsStyleSVGReset* NS_FOR_VISIBLE_IMAGE_LAYERS_BACK_TO_FRONT(i, mMask) { nsStyleImage& image = mMask.mLayers[i].mImage; if (image.GetType() == eStyleImageType_Image) { - URLValueData* url = image.GetURLValue(); - // If the url is a local ref, it must be a , so we don't - // need to resolve the style image. - if (url->IsLocalRef()) { - continue; - } -#if 0 - // XXX The old style system also checks whether this is a reference to - // the current document with reference, but it doesn't seem to be a - // behavior mentioned anywhere, so we comment out the code for now. - nsIURI* docURI = aPresContext->Document()->GetDocumentURI(); - if (url->EqualsExceptRef(docURI)) { - continue; - } -#endif + // If the url of mask resource contains a reference('#'), it should be a + // , mostly. For a , there is no need to + // resolve this style image, since we do not depend on it to get the + // SVG mask resource. + if (!image.GetURLValue()->HasRef()) { + const nsStyleImage* oldImage = + (aOldStyle && aOldStyle->mMask.mLayers.Length() > i) + ? &aOldStyle->mMask.mLayers[i].mImage + : nullptr; - // Otherwise, we may need the image even if it has a reference, in case - // the referenced element isn't a valid SVG element. - const nsStyleImage* oldImage = - (aOldStyle && aOldStyle->mMask.mLayers.Length() > i) - ? &aOldStyle->mMask.mLayers[i].mImage - : nullptr; - - image.ResolveImage(aPresContext, oldImage); + image.ResolveImage(aPresContext, oldImage); + } } } } diff --git a/testing/web-platform/meta/MANIFEST.json b/testing/web-platform/meta/MANIFEST.json index 92d0824a0683..1c5904e03428 100644 --- a/testing/web-platform/meta/MANIFEST.json +++ b/testing/web-platform/meta/MANIFEST.json @@ -125343,54 +125343,6 @@ {} ] ], - "css/css-masking/mask-image/mask-image-url-image-hash.html": [ - [ - "/css/css-masking/mask-image/mask-image-url-image-hash.html", - [ - [ - "/css/css-masking/mask-image/reference/mask-image-ref.html", - "==" - ] - ], - {} - ] - ], - "css/css-masking/mask-image/mask-image-url-image.html": [ - [ - "/css/css-masking/mask-image/mask-image-url-image.html", - [ - [ - "/css/css-masking/mask-image/reference/mask-image-ref.html", - "==" - ] - ], - {} - ] - ], - "css/css-masking/mask-image/mask-image-url-local-mask.html": [ - [ - "/css/css-masking/mask-image/mask-image-url-local-mask.html", - [ - [ - "/css/css-masking/mask-image/reference/mask-image-ref.html", - "==" - ] - ], - {} - ] - ], - "css/css-masking/mask-image/mask-image-url-remote-mask.html": [ - [ - "/css/css-masking/mask-image/mask-image-url-remote-mask.html", - [ - [ - "/css/css-masking/mask-image/reference/mask-image-ref.html", - "==" - ] - ], - {} - ] - ], "css/css-masking/test-mask.html": [ [ "/css/css-masking/test-mask.html", @@ -256732,26 +256684,6 @@ {} ] ], - "css/css-masking/mask-image/reference/mask-image-ref.html": [ - [ - {} - ] - ], - "css/css-masking/mask-image/support/image-with-ref.svg": [ - [ - {} - ] - ], - "css/css-masking/mask-image/support/image.svg": [ - [ - {} - ] - ], - "css/css-masking/mask-image/support/mask.svg": [ - [ - {} - ] - ], "css/css-masking/parsing/support/parsing-testcommon.js": [ [ {} @@ -540585,38 +540517,6 @@ "c415eaaa67a2bc9a4b621700049eb0c0b60ec0a3", "testharness" ], - "css/css-masking/mask-image/mask-image-url-image-hash.html": [ - "b1efc90818bec85d5022a9b908a14c2e0c35ff3b", - "reftest" - ], - "css/css-masking/mask-image/mask-image-url-image.html": [ - "40a1ff9b281647a03cd90046cb62a088c0ed7081", - "reftest" - ], - "css/css-masking/mask-image/mask-image-url-local-mask.html": [ - "18abc54f85eb4bfd93962dbef92dd5cffe5ba62b", - "reftest" - ], - "css/css-masking/mask-image/mask-image-url-remote-mask.html": [ - "f3f2eefaa92df83296379efd861b39e2ab65f78e", - "reftest" - ], - "css/css-masking/mask-image/reference/mask-image-ref.html": [ - "4e121163f9d093b468e710882cb164bb965d9aa8", - "support" - ], - "css/css-masking/mask-image/support/image-with-ref.svg": [ - "fe77fb37ac60a8a503d849d019c9ca391d9cf523", - "support" - ], - "css/css-masking/mask-image/support/image.svg": [ - "28dbaa0238353b47b0d7877cac054d002352078a", - "support" - ], - "css/css-masking/mask-image/support/mask.svg": [ - "cab55923d32ddb9525cb81a12d8035b1bf51bb4c", - "support" - ], "css/css-masking/parsing/clip-invalid.html": [ "18ae8b552a5904097a4b9f0f639b3d0ca123242b", "testharness" diff --git a/testing/web-platform/tests/css/css-masking/mask-image/mask-image-url-image-hash.html b/testing/web-platform/tests/css/css-masking/mask-image/mask-image-url-image-hash.html deleted file mode 100644 index b1efc90818be..000000000000 --- a/testing/web-platform/tests/css/css-masking/mask-image/mask-image-url-image-hash.html +++ /dev/null @@ -1,28 +0,0 @@ - -CSS Test: mask-image: url(image.svg#hash) - - - - - - -

The test passes if there is a green square and no red below.

-
diff --git a/testing/web-platform/tests/css/css-masking/mask-image/mask-image-url-image.html b/testing/web-platform/tests/css/css-masking/mask-image/mask-image-url-image.html deleted file mode 100644 index 40a1ff9b2816..000000000000 --- a/testing/web-platform/tests/css/css-masking/mask-image/mask-image-url-image.html +++ /dev/null @@ -1,28 +0,0 @@ - -CSS Test: mask-image: url(image.svg) - - - - - - -

The test passes if there is a green square and no red below.

-
diff --git a/testing/web-platform/tests/css/css-masking/mask-image/mask-image-url-local-mask.html b/testing/web-platform/tests/css/css-masking/mask-image/mask-image-url-local-mask.html deleted file mode 100644 index 18abc54f85eb..000000000000 --- a/testing/web-platform/tests/css/css-masking/mask-image/mask-image-url-local-mask.html +++ /dev/null @@ -1,33 +0,0 @@ - -CSS Test: mask-image: url(#local-mask) - - - - - - -

The test passes if there is a green square and no red below.

-
- - - - - diff --git a/testing/web-platform/tests/css/css-masking/mask-image/mask-image-url-remote-mask.html b/testing/web-platform/tests/css/css-masking/mask-image/mask-image-url-remote-mask.html deleted file mode 100644 index f3f2eefaa92d..000000000000 --- a/testing/web-platform/tests/css/css-masking/mask-image/mask-image-url-remote-mask.html +++ /dev/null @@ -1,28 +0,0 @@ - -CSS Test: mask-image: url(remote.svg#mask) - - - - - - -

The test passes if there is a green square and no red below.

-
diff --git a/testing/web-platform/tests/css/css-masking/mask-image/reference/mask-image-ref.html b/testing/web-platform/tests/css/css-masking/mask-image/reference/mask-image-ref.html deleted file mode 100644 index 4e121163f9d0..000000000000 --- a/testing/web-platform/tests/css/css-masking/mask-image/reference/mask-image-ref.html +++ /dev/null @@ -1,14 +0,0 @@ - -CSS Reference: mask-image - - - -

The test passes if there is a green square and no red below.

-
diff --git a/testing/web-platform/tests/css/css-masking/mask-image/support/image-with-ref.svg b/testing/web-platform/tests/css/css-masking/mask-image/support/image-with-ref.svg deleted file mode 100644 index fe77fb37ac60..000000000000 --- a/testing/web-platform/tests/css/css-masking/mask-image/support/image-with-ref.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - diff --git a/testing/web-platform/tests/css/css-masking/mask-image/support/image.svg b/testing/web-platform/tests/css/css-masking/mask-image/support/image.svg deleted file mode 100644 index 28dbaa023835..000000000000 --- a/testing/web-platform/tests/css/css-masking/mask-image/support/image.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/testing/web-platform/tests/css/css-masking/mask-image/support/mask.svg b/testing/web-platform/tests/css/css-masking/mask-image/support/mask.svg deleted file mode 100644 index cab55923d32d..000000000000 --- a/testing/web-platform/tests/css/css-masking/mask-image/support/mask.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - -