From 30689fcc0da0530f7982df9deb0c7c59ac9a8354 Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Fri, 7 Sep 2018 21:08:44 +0000 Subject: [PATCH] Bug 1488300 - Kick off external SVG resource loading from DidSetComputedStyle. r=dholbert Differential Revision: https://phabricator.services.mozilla.com/D4901 --HG-- extra : moz-landing-system : lando --- layout/generic/nsFrame.cpp | 12 ++++++++++++ testing/web-platform/meta/MANIFEST.json | 4 ++-- .../mask-image/mask-image-url-remote-mask.html | 5 ----- .../css/css-masking/mask-image/support/mask.svg | 1 - 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 2890f09b447f..e6f70e7ac8ae 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -1203,6 +1203,18 @@ nsFrame::DidSetComputedStyle(ComputedStyle* aOldComputedStyle) } } + // SVGObserverUtils::GetEffectProperties() asserts that we only invoke it with + // the first continuation so we need to check that in advance. Continuing text + // frame doesn't initialize its continuation pointer before reaching here for + // the first time, so we have to exclude text frames. This doesn't affect + // correctness because text nodes themselves shouldn't have effects applied. + if (!IsTextFrame() && !GetPrevContinuation()) { + // Kick off loading of external SVG resources referenced from properties if + // any. This currently includes filter, clip-path, and mask. We don't care + // about the return value. We only want its side effect. + Unused << SVGObserverUtils::GetEffectProperties(this); + } + // If the page contains markup that overrides text direction, and // does not contain any characters that would activate the Unicode // bidi algorithm, we need to call |SetBidiEnabled| on the pres diff --git a/testing/web-platform/meta/MANIFEST.json b/testing/web-platform/meta/MANIFEST.json index 4a9467c154f7..65bc1033989f 100644 --- a/testing/web-platform/meta/MANIFEST.json +++ b/testing/web-platform/meta/MANIFEST.json @@ -544749,7 +544749,7 @@ "reftest" ], "css/css-masking/mask-image/mask-image-url-remote-mask.html": [ - "cfa3a6166cdcb41b2feaab2ffd5c087a568771f5", + "f3f2eefaa92df83296379efd861b39e2ab65f78e", "reftest" ], "css/css-masking/mask-image/reference/mask-image-ref.html": [ @@ -544765,7 +544765,7 @@ "support" ], "css/css-masking/mask-image/support/mask.svg": [ - "30e601c87c32a08912e261dab22734033df1ef8e", + "cab55923d32ddb9525cb81a12d8035b1bf51bb4c", "support" ], "css/css-masking/parsing/clip-invalid.html": [ 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 index cfa3a6166cdc..f3f2eefaa92d 100644 --- 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 @@ -26,8 +26,3 @@

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/mask.svg b/testing/web-platform/tests/css/css-masking/mask-image/support/mask.svg index 30e601c87c32..cab55923d32d 100644 --- 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 @@ -2,5 +2,4 @@ -