From 20527995d095c925a9938896b606c6ff9003efc9 Mon Sep 17 00:00:00 2001 From: Delan Azabani Date: Wed, 26 May 2021 20:30:40 +0000 Subject: [PATCH] Bug 1712698 [wpt PR 29100] - CSS highlight painting: fix ::selection decoration regression, a=testonly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Automatic update from web-platform-tests CSS highlight painting: fix ::selection decoration regression NG’s text-decoration support is currently pretty buggy. One of these bugs is that we make no attempt to paint any decorations on selected text (part of bug 1147859), only the originating text’s decorations. Notice how the line-through (blue) is behind the selected text (grey) in : https://bucket.daz.cat/791f25c9b0bbd7e4.png /c/2647046 reordered highlight painting such that the ::selection background is painted over originating text (part of bug 1147859). This worsens the impact of the first bug, making the decorations difficult or impossible to see when text is selected: https://bucket.daz.cat/5e546e5bb1dab511.png This patch makes the minimum changes necessary to fix the regression without reverting /c/2647046. It approximates pre-M90 painting by “lifting” decorations to ::selection overlay when text is selected: https://bucket.daz.cat/ac5cdae75969f321.png One minor side effect of this is that underlines and overlines, which are supposed to paint under text, will also “lift” so they paint over unselected text whenever the user selects text. Splitting decorations so that they can correctly order with both unselected and selected text at the same time is best left to a subsequent patch. Bug: 1209248 Change-Id: Ie7da0e4369e96fd337e0a90bdcd6631dfb6aee05 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2902289 Reviewed-by: Philip Rogers Commit-Queue: Delan Azabani Cr-Commit-Position: refs/heads/master@{#886768} -- wpt-commits: dce98cf58c52db5fb92f2eed697955cf667f1fb9 wpt-pr: 29100 --- .../highlight-painting-005-ref.html | 14 ++++++++ .../css-pseudo/highlight-painting-005.html | 32 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 testing/web-platform/tests/css/css-pseudo/highlight-painting-005-ref.html create mode 100644 testing/web-platform/tests/css/css-pseudo/highlight-painting-005.html diff --git a/testing/web-platform/tests/css/css-pseudo/highlight-painting-005-ref.html b/testing/web-platform/tests/css/css-pseudo/highlight-painting-005-ref.html new file mode 100644 index 000000000000..bc6086f7115a --- /dev/null +++ b/testing/web-platform/tests/css/css-pseudo/highlight-painting-005-ref.html @@ -0,0 +1,14 @@ + + + + +

Test passes if all of the text below is decorated with a line-through. +

quick
diff --git a/testing/web-platform/tests/css/css-pseudo/highlight-painting-005.html b/testing/web-platform/tests/css/css-pseudo/highlight-painting-005.html new file mode 100644 index 000000000000..458676c3e8ee --- /dev/null +++ b/testing/web-platform/tests/css/css-pseudo/highlight-painting-005.html @@ -0,0 +1,32 @@ + + +CSS Pseudo-Elements Test: highlight painting + + + + + + + + +

Test passes if all of the text below is decorated with a line-through. +

quick
+