fune/testing/web-platform/tests/css/css-pseudo
2024-06-03 15:50:57 +00:00
..
highlight-cascade Bug 1896050 [wpt PR 46197] - CSS highlight pseudos: resolve styles for ::search-text, a=testonly 2024-05-23 10:00:16 +00:00
parsing Bug 1895830 [wpt PR 46179] - CSS highlight pseudos: parse ::search-text and ::search-text:current, a=testonly 2024-05-21 09:46:57 +00:00
reference Bug 1892735 [wpt PR 45825] - Split Highlight Inheritance tests into a new directory, a=testonly 2024-04-25 13:29:09 +00:00
slider
support
active-selection-001-manual.html
active-selection-002-manual.html
active-selection-004-manual.html
active-selection-011.html
active-selection-012.html
active-selection-014.html
active-selection-016.html
active-selection-018.html
active-selection-021.html
active-selection-025.html
active-selection-027.html
active-selection-031.html
active-selection-041.html
active-selection-043.html
active-selection-045.html
active-selection-051-ref.html
active-selection-051.html
active-selection-052.html
active-selection-053.html
active-selection-054.html
active-selection-056.html
active-selection-057.html
active-selection-063.html
backdrop-animate-002-ref.html
backdrop-animate-002.html
backdrop-animate.html
before-after-dynamic-custom-property-001-ref.html
before-after-dynamic-custom-property-001.html
before-dynamic-display-none.html
before-in-display-none-thcrash.html
chrome-bug-1299142-crash.html
chrome-first-letter-container-query-crash.html
chrome-first-letter-inside-replaced-crash.html
file-selector-button-001-notref.html
file-selector-button-001.html
file-selector-button-after-part.html
file-selector-button-display-none-overflow-crash.html
file-selector-button-display-toggle-crash.html
file-selector-button-float.html
file-selector-button-inherit.html
first-letter-001-ref.html
first-letter-001.html
first-letter-002.html
first-letter-003.html
first-letter-004-ref.html
first-letter-004.html
first-letter-005-ref.html
first-letter-005.html
first-letter-allowed-properties.html
first-letter-and-sibling-display-change.html
first-letter-and-whitespace-ref.html
first-letter-and-whitespace.html
first-letter-background-image-dynamic.html
first-letter-background-image-ref.html
first-letter-background-image.html
first-letter-block-to-inline-ref.html
first-letter-block-to-inline.html
first-letter-crash.html
first-letter-digraph.html
first-letter-exclude-block-child-marker-ref.html
first-letter-exclude-block-child-marker.html
first-letter-exclude-inline-child-marker-ref.html
first-letter-exclude-inline-child-marker.html
first-letter-exclude-inline-marker-ref.html
first-letter-exclude-inline-marker.html
first-letter-hi-001-ref.html
first-letter-hi-001.html
first-letter-hi-002-ref.html
first-letter-hi-002.html
first-letter-list-item-dynamic-001-ref.html
first-letter-list-item-dynamic-001.html
first-letter-of-html-root-crash-ref.html
first-letter-of-html-root-refcrash.html
first-letter-opacity-001-not-ref.html
first-letter-opacity-001-ref.html
first-letter-opacity-001.html
first-letter-opacity-float-001-ref.html
first-letter-opacity-float-001.html
first-letter-punctuation-and-space-ref.html
first-letter-punctuation-and-space.html
first-letter-punctuation-dynamic-ref.html
first-letter-punctuation-dynamic.html
first-letter-skip-empty-span-nested-ref.html
first-letter-skip-empty-span-nested.html
first-letter-skip-empty-span-ref.html
first-letter-skip-empty-span.html
first-letter-skip-marker-ref.html
first-letter-skip-marker.html
first-letter-text-and-display-change.html
first-letter-width-ref.html
first-letter-width.html
first-letter-with-before-after-ref.html
first-letter-with-before-after.html
first-letter-with-preceding-new-line.html
first-letter-with-quote-ref.html
first-letter-with-quote.html
first-letter-with-span-ref.html
first-letter-with-span.html
first-line-allowed-properties.html
first-line-and-marker-ref.html
first-line-and-marker.html
first-line-and-placeholder-ref.html
first-line-and-placeholder.html
first-line-change-inline-color-nested-ref.html
first-line-change-inline-color-nested.html
first-line-change-inline-color-ref.html
first-line-change-inline-color.html
first-line-first-letter-insert-crash.html
first-line-float-mapped-attribute-crash.html
first-line-green-ref.html
first-line-inherited-no-transition-ref.html
first-line-inherited-no-transition.html
first-line-inherited-transition-crash.html
first-line-inherited-with-transition-ref.html
first-line-inherited-with-transition.html
first-line-input-image-crash.html
first-line-line-height-001-ref.html
first-line-line-height-001.html
first-line-line-height-002-ref.html
first-line-line-height-002.html
first-line-nested-gcs.html
first-line-on-ancestor-block-ref.html
first-line-on-ancestor-block.html
first-line-opacity-001-not-ref.html
first-line-opacity-001-ref.html
first-line-opacity-001.html
first-line-replaced-001-ref.html
first-line-replaced-001.html
first-line-with-before-after-ref.html
first-line-with-before-after.html
first-line-with-inline-block-before-ref.html
first-line-with-inline-block-before.html
first-line-with-inline-block.html
first-line-with-out-of-flow-and-nested-div.html
first-line-with-out-of-flow-and-nested-span.html
first-line-with-out-of-flow-ref.html
first-line-with-out-of-flow.html
get-computed-style-crash.html Bug 1895942 [wpt PR 46187] - VT: Fix UAF in tokenizer parsing, a=testonly 2024-05-21 09:46:28 +00:00
grammar-error-001-ref.html
grammar-error-001.html
grammar-error-002-manual.html
grammar-error-003-manual.html
grammar-spelling-errors-001.html
grammar-spelling-errors-002.html
highlight-custom-properties-dynamic-001-ref.html
highlight-custom-properties-dynamic-001.html
highlight-painting-001-ref.html
highlight-painting-001.html
highlight-painting-002-ref.html
highlight-painting-002.html
highlight-painting-003-ref.html
highlight-painting-003.html
highlight-painting-004-ref1.html
highlight-painting-004-ref2.html
highlight-painting-004-ref3.html
highlight-painting-004.html
highlight-painting-005-crash.html
highlight-painting-currentcolor-005-ref.html
highlight-painting-currentcolor-005.html
highlight-painting-shadows-horizontal-ref.html Bug 1893091 [wpt PR 45863] - [Highlight Pseudos] Correctly paint shadows, a=testonly 2024-04-29 07:28:01 +00:00
highlight-painting-shadows-horizontal.html Bug 1893091 [wpt PR 45863] - [Highlight Pseudos] Correctly paint shadows, a=testonly 2024-04-29 07:28:01 +00:00
highlight-painting-shadows-vertical-ref.html Bug 1893091 [wpt PR 45863] - [Highlight Pseudos] Correctly paint shadows, a=testonly 2024-04-29 07:28:01 +00:00
highlight-painting-shadows-vertical.html Bug 1893091 [wpt PR 45863] - [Highlight Pseudos] Correctly paint shadows, a=testonly 2024-04-29 07:28:01 +00:00
highlight-painting-soft-hyphens-001-ref.html
highlight-painting-soft-hyphens-001.html
highlight-painting-soft-hyphens-002-crash.html
highlight-styling-001-ref.html
highlight-styling-001.html
highlight-styling-002-ref.html
highlight-styling-002.html
highlight-styling-003-ref.html
highlight-styling-003.tentative.html
highlight-z-index-001-ref.html
highlight-z-index-001.html
highlight-z-index-002-ref.html
highlight-z-index-002.html
idlharness.html
marker-and-other-pseudo-elements-ref.html
marker-and-other-pseudo-elements.html
marker-animate-002-ref.html
marker-animate-002.html
marker-animate.html
marker-color-ref.html
marker-color.html
marker-computed-content.html
marker-computed-size.html
marker-content-001-ref.html
marker-content-001.html
marker-content-001b.html
marker-content-001c.html
marker-content-002-ref.html
marker-content-002.html
marker-content-003-ref.html
marker-content-003.html
marker-content-003b.html
marker-content-004-ref.html
marker-content-004.html
marker-content-005-ref.html
marker-content-005.html
marker-content-006-ref.html
marker-content-006.html
marker-content-007-ref.html
marker-content-007.tentative.html
marker-content-008-ref.html
marker-content-008.tentative.html
marker-content-009-ref.html
marker-content-009.tentative.html
marker-content-010-ref-001.html
marker-content-010-ref-002.html
marker-content-010.html
marker-content-011-ref.html
marker-content-011.tentative.html
marker-content-012-ref.html
marker-content-012.html
marker-content-013-ref.html
marker-content-013.html
marker-content-014-ref.html
marker-content-014.html
marker-content-015-ref.html
marker-content-015.html
marker-content-016-ref.html
marker-content-016.html
marker-content-017-ref.html
marker-content-017.html
marker-content-018-ref.html
marker-content-018.html
marker-content-019-ref.html
marker-content-019.html
marker-content-020-ref.html
marker-content-020.html
marker-content-021-ref.html
marker-content-021.html
marker-content-022-ref.html
marker-content-022.html
marker-content-023-ref.html
marker-content-023.html
marker-content-024-ref.html
marker-content-024.html
marker-default-styles.html
marker-display-computed.html
marker-display-dynamic-001.html
marker-font-properties-ref.html
marker-font-properties.html
marker-font-variant-numeric-default-ref.html
marker-font-variant-numeric-default.html
marker-font-variant-numeric-normal-ref.html
marker-font-variant-numeric-normal.html
marker-hit-testing.html
marker-hyphens-ref.html
marker-hyphens.html
marker-inherit-line-height-ref.html
marker-inherit-line-height.html
marker-inherit-values-ref.html
marker-inherit-values.html
marker-intrinsic-contribution-001.html
marker-intrinsic-contribution-002-ref.html
marker-intrinsic-contribution-002.html
marker-letter-spacing-ref-001.html
marker-letter-spacing-ref-002.html
marker-letter-spacing.html
marker-line-break-ref.html
marker-line-break.html
marker-line-height-ref.html
marker-line-height.html
marker-list-style-position-ref-001.html
marker-list-style-position-ref-002.html
marker-list-style-position.html
marker-overflow-wrap.html
marker-reverted-styles.html
marker-tab-size-ref.html
marker-tab-size.html
marker-text-align-001-ref.html
marker-text-align-001.html
marker-text-align-002-ref.html
marker-text-align-002.html
marker-text-align-003-ref.html
marker-text-align-003.html
marker-text-combine-upright-ref.html
marker-text-combine-upright.html
marker-text-decoration-skip-ink-ref.html
marker-text-decoration-skip-ink.html
marker-text-emphasis-ref.html
marker-text-emphasis.html
marker-text-shadow-ref.html
marker-text-shadow.html
marker-text-transform-default-ref.html
marker-text-transform-default.html
marker-text-transform-dynamic-ref.html
marker-text-transform-dynamic.html
marker-text-transform-uppercase-ref.html
marker-text-transform-uppercase.html
marker-unicode-bidi-default-ref.html
marker-unicode-bidi-default.html
marker-unicode-bidi-normal-ref.html
marker-unicode-bidi-normal.html
marker-variable-computed-style.html
marker-variable-ref.html
marker-variable.html
marker-word-break-ref.html
marker-word-break.html
marker-word-spacing-ref.html
marker-word-spacing.html
META.yml
outside-marker-paint-order-ref.html
outside-marker-paint-order.html
placeholder-as-multicol-crash.html
placeholder-excluded-properties.html
placeholder-inherit.html
placeholder-input-dynamic-crash.html
placeholder-input-number-notref.html
placeholder-input-number.html
README.md
selection-background-color-001.html
selection-background-painting-order-ref1.html
selection-background-painting-order-ref2.html
selection-background-painting-order.html
selection-contenteditable-011.html
selection-input-011.html
selection-intercharacter-011.html
selection-intercharacter-012.html
selection-link-001-ref.html
selection-link-001.html
selection-link-002-ref.html
selection-link-002.html
selection-link-003-ref.html
selection-link-003.html
selection-originating-decoration-color-ref.html
selection-originating-decoration-color.html
selection-originating-strikethrough-order-ref.html
selection-originating-strikethrough-order.html
selection-originating-underline-order-ref.html
selection-originating-underline-order.html
selection-over-highlight-001-ref.html
selection-over-highlight-001.html
selection-overlay-and-grammar-001.html
selection-overlay-and-spelling-001.html
selection-paint-image-notref.html
selection-paint-image.html
selection-textarea-011.html
selection-universal-shadow-dom.html
spelling-error-001-ref.html
spelling-error-001.html
spelling-error-002-manual.html
spelling-error-003-manual.html
spelling-error-004-crash.html
spelling-error-005-crash.html
spelling-error-006-notref.html
spelling-error-006.html
svg-text-selection-002.html
target-text-001.html
target-text-002.html
target-text-003.html
target-text-004.html
target-text-005.html
target-text-006.html
target-text-007.html
target-text-008-ref.html
target-text-008.html
target-text-009.html
target-text-010.html
target-text-dynamic-001-ref.html
target-text-dynamic-001.html
target-text-dynamic-002.html
target-text-dynamic-003.html
target-text-dynamic-004.html Bug 1892741 [wpt PR 45826] - Clean up CSS Highlight tests and expectations, a=testonly 2024-04-25 13:29:00 +00:00
target-text-five-words-ref.html
target-text-lime-green-ref.html
target-text-lime-ref.html
target-text-shadow-horizontal-ref.html Bug 1893091 [wpt PR 45863] - [Highlight Pseudos] Correctly paint shadows, a=testonly 2024-04-29 07:28:01 +00:00
target-text-shadow-horizontal.html Bug 1893091 [wpt PR 45863] - [Highlight Pseudos] Correctly paint shadows, a=testonly 2024-04-29 07:28:01 +00:00
target-text-shadow-vertical-ref.html Bug 1893091 [wpt PR 45863] - [Highlight Pseudos] Correctly paint shadows, a=testonly 2024-04-29 07:28:01 +00:00
target-text-shadow-vertical.html Bug 1893091 [wpt PR 45863] - [Highlight Pseudos] Correctly paint shadows, a=testonly 2024-04-29 07:28:01 +00:00
target-text-text-decoration-001-ref.html
target-text-text-decoration-001.html
target-text-two-words-ref.html
text-selection.html
textpath-selection-011-ref.html
textpath-selection-011.html
WEB_FEATURES.yml Bug 1895306 [wpt PR 46103] - Map ::target-text tests to web-features, a=testonly 2024-05-14 07:22:13 +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 arent 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.