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.html • https://bucket.daz.cat/work/igalia/0/6.html?wm=vertical-rl • https://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:Koji Ishii <kojii@chromium.org> Reviewed-by:
Stephen Chenney <schenney@chromium.org> Reviewed-by:
Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/master@{#850950}
Loading
Please register or sign in to comment