Files
firefox/testing/web-platform/tests/css/css-pseudo
Oriol Brufau 32c28359ac Bug 1911585 [wpt PR 47454] - Accept 'cursor' on ::marker pseudo-elements, a=testonly
Automatic update from web-platform-tests
Accept 'cursor' on ::marker pseudo-elements

According to this CSSWG resolution:
https://github.com/w3c/csswg-drafts/issues/6203#issuecomment-2221026768

Bug: 352335092
Change-Id: I5d1c2f89cabf10e397de70bd70bfbe03910a0676
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5756462
Reviewed-by: Steinar H Gunderson <[email protected]>
Commit-Queue: Oriol Brufau <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1337776}

--

wpt-commits: 165162b51fc2d3d0cc39d930c6aed809adef58cb
wpt-pr: 47454
2024-08-08 07:20:39 +00:00
..
…
…

Highlight pseudos

There are many subtle browser differences in rendering these pseudo-elements, most of which comply with the specs, so here are some hints.

Use the helpers in support/highlights.css and support/selections.js where possible. They include rules and functions for “basic” but tricky tasks like setting up a test area, selecting content, and triggering spellcheck.

When creating complex layered references, start by wrapping your text in a relative container, then prepend absolute layers with copies of that text, then mark up those copies with spans. Make everything transparent initially, and set visible styles on the spans only. The absolute layers will perfectly overlap your original text, which you can keep for external layout. For example:

<div class="container">
    <div class="spelling-error"><span>Teh</span> <span>dgo</span> and
        <span>teh</span> <span>sphixn</span>.</div>
    <div class="selection">Teh d<span>go and te</span>h sphixn.</div>
    Teh dgo and teh sphixn.
</div>
.container { position: relative; color: transparent; }
.container > * { position: absolute; }
.spelling-error > span { background: ...; color: ...; }
.selection > span { background: ...; text-shadow: ...; }

Simplify this pattern at your own peril! For example, if you set backgrounds directly on layers as your highlight backgrounds, they will always be exactly line-height tall, but even if your line-height is 1, the actual line boxes and so on can still be taller (unless they contain Ahem text only).

Selection regression tests

Four tests are based on the properties described in https://crrev.com/915543, and were designed to catch regressions as bugs were fixed in Chromium:

  • selection-originating-underline-order.html (P1)
  • selection-originating-decoration-color.html (P3)
  • selection-originating-strikethrough-order.html (P4)
  • selection-background-painting-order.html (P5)

Ideally we would want a test for property P2, that line-through decorations are always painted over text when selecting some of that text. But unfortunately, originating decoration recoloring (when correctly implemented) essentially makes it impossible to tell whether the text or the decoration was painted on top.

Some ways this test could become possible:

  • Wider impl support for ::target-text or ::highlight decorations. Decorations introduced by highlight pseudos aren’t recolored, so we could move the originating text-decoration to any highlight that paints under ::selection (currently all of them), choose another ::selection color, and check which is painted on top.

  • SVG adds support for text-decoration-color, or HTML adds support for stroke and stroke-width via CSS, as long as we continue to recolor originating decorations to color only. Then we could stroke in another color, and check which is painted on top.

  • css-pseudo adds some kind of support for suppressing or otherwise tweaking the recoloring of originating decorations.

  • Some other standard means for text to contain colors other than the color property, such as color fonts.