From c8838c8f598b35adcbf3f057ccabc5720b1e79c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20S=C3=B6derquist?= Date: Thu, 30 May 2024 03:52:38 -0700 Subject: [PATCH] Referenced SVG elements in an external resource document match :target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Track which elements are referenced (by ) in an external resource document by funneling the lookup through a special function on SVGResourceDocumentContent that creates SVGResourceTarget objects for each (valid) reference and lets the targeted element weakly reference the object. While matching :target, the selector checker will check if the element has a reference to an SVGResourceTarget object and let :target match if it does. Bug: 342705674 Change-Id: I9b88e4338dccc0e01c45afb0df3e1c412b2466a9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5574989 Reviewed-by: Rune Lillesveen Commit-Queue: Fredrik Söderquist Cr-Commit-Position: refs/heads/main@{#1307926} --- svg/struct/reftests/support/sprites-stacked.svg | 10 ++++++++++ svg/struct/reftests/support/sprites-target.svg | 8 ++++++++ .../use-external-resource-target-pseudo-001.html | 9 +++++++++ .../use-external-resource-target-pseudo-002.html | 9 +++++++++ 4 files changed, 36 insertions(+) create mode 100644 svg/struct/reftests/support/sprites-stacked.svg create mode 100644 svg/struct/reftests/support/sprites-target.svg create mode 100644 svg/struct/reftests/use-external-resource-target-pseudo-001.html create mode 100644 svg/struct/reftests/use-external-resource-target-pseudo-002.html diff --git a/svg/struct/reftests/support/sprites-stacked.svg b/svg/struct/reftests/support/sprites-stacked.svg new file mode 100644 index 00000000000000..bebe1bd9198068 --- /dev/null +++ b/svg/struct/reftests/support/sprites-stacked.svg @@ -0,0 +1,10 @@ + + + + + + diff --git a/svg/struct/reftests/support/sprites-target.svg b/svg/struct/reftests/support/sprites-target.svg new file mode 100644 index 00000000000000..1eb11bfbfb4271 --- /dev/null +++ b/svg/struct/reftests/support/sprites-target.svg @@ -0,0 +1,8 @@ + + + + diff --git a/svg/struct/reftests/use-external-resource-target-pseudo-001.html b/svg/struct/reftests/use-external-resource-target-pseudo-001.html new file mode 100644 index 00000000000000..153aedba026055 --- /dev/null +++ b/svg/struct/reftests/use-external-resource-target-pseudo-001.html @@ -0,0 +1,9 @@ + +<use> referencing an external document resource with :target pseudo class + + + + + + + diff --git a/svg/struct/reftests/use-external-resource-target-pseudo-002.html b/svg/struct/reftests/use-external-resource-target-pseudo-002.html new file mode 100644 index 00000000000000..0a483aff54d4d9 --- /dev/null +++ b/svg/struct/reftests/use-external-resource-target-pseudo-002.html @@ -0,0 +1,9 @@ + +<use> referencing an external document resource with :target pseudo class + + + + + + +