Skip to content
Commit 79ec8ffb authored by Delan Azabani's avatar Delan Azabani Committed by Chromium LUCI CQ
Browse files

CSS highlight painting order: independent originating element shadows

This patch fixes several bugs around ::selection shadow painting.

We now paint the originating element’s shadows for selected text when
painting the same shadows for the unselected parts, suppressing only
the text proper in the selected part.

We now suppress the originating element’s shadows when painting the
ClipOut phase in NGTextPainter::PaintSelectedText, because this is the
wrong time (and wrong clipping rect) to paint those shadows.

The net result of these first two changes is that originating element
shadows for all text (including selected text) are now painted without
erroneous clipping, and always behind any unselected text proper.

We now clear any ShadowList pointer copied from the given style in
HPU::HighlightPaintingStyle, because the default text-shadow for each
highlight pseudo should be none, not inherited from the originating
element. Previously we would paint originating element shadows over
the ::selection background if HighlightPseudoStyle returns nullptr.

Together these changes should fix bug 474335 entirely, and go a long
way towards spec-compliant highlight painting (bug 1147859). Relevant
tests and screenshots (relative to <https://crrev.com/c/2647046>):

• https://wpt.live/css/css-pseudo/highlight-painting-order.htmlhttps://bucket.daz.cat/work/igalia/0/6.html?wm=vertical-rlhttps://bucket.daz.cat/8361fa79820580e0.png (right = patch)

Bug: 1147859, 474335
Change-Id: I3485b840d3967a75542678ee146a3d6d5c926a77
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2649833


Commit-Queue: Delan Azabani <dazabani@igalia.com>
Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#850950}
parent 7ae60470
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment