From 1e9a10172d6b9c24c7d386d6fc6ad28a233c318f Mon Sep 17 00:00:00 2001 From: Stephen Chenney Date: Wed, 6 Sep 2023 04:49:34 -0700 Subject: [PATCH] Resolve highlight custom properties from the root It was resolved in https://github.com/w3c/csswg-drafts/issues/6641 that CSS Highlight Pseudos should inherit custom properties from the root element if those properties are not defined in the highlight inheritance path. Implement that by copying the variables when style is initialized for the pseudo elements. Bug: 1412395 Change-Id: I88c22cea6a9eb5f465a5c0dd97444b39b07368a2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4827862 Reviewed-by: Anders Hartvoll Ruud Commit-Queue: Stephen Chenney Cr-Commit-Position: refs/heads/main@{#1192961} --- css/css-pseudo/highlight-cascade-008-ref.html | 18 ++++++++ css/css-pseudo/highlight-cascade-008.html | 31 ++++++++++++++ css/css-pseudo/highlight-cascade-009.html | 41 +++++++++++++++++++ 3 files changed, 90 insertions(+) create mode 100644 css/css-pseudo/highlight-cascade-008-ref.html create mode 100644 css/css-pseudo/highlight-cascade-008.html create mode 100644 css/css-pseudo/highlight-cascade-009.html diff --git a/css/css-pseudo/highlight-cascade-008-ref.html b/css/css-pseudo/highlight-cascade-008-ref.html new file mode 100644 index 00000000000000..c87ddcf93c9ae7 --- /dev/null +++ b/css/css-pseudo/highlight-cascade-008-ref.html @@ -0,0 +1,18 @@ + +Custom property values from the root element + + +
PASS if background-color is green when selected, except this which is blue, and underline is yellow. \ No newline at end of file diff --git a/css/css-pseudo/highlight-cascade-008.html b/css/css-pseudo/highlight-cascade-008.html new file mode 100644 index 00000000000000..10ca924b8fd1d2 --- /dev/null +++ b/css/css-pseudo/highlight-cascade-008.html @@ -0,0 +1,31 @@ + +Custom property values from the root element + + + + + + + +
PASS if background-color is green when selected, except this which is blue, and underline is yellow.
+ \ No newline at end of file diff --git a/css/css-pseudo/highlight-cascade-009.html b/css/css-pseudo/highlight-cascade-009.html new file mode 100644 index 00000000000000..884a0958db0833 --- /dev/null +++ b/css/css-pseudo/highlight-cascade-009.html @@ -0,0 +1,41 @@ + + +CSS Pseudo-Elements Test: highlight cascade: inheritance of custom properties + + + + + + + + + + +
Some text
+ +