Refactor GetSelectionTextColors to return a SelectionColors struct instead of a bool and two out-params. The struct carries distinct flags (mHasBackground, mOverridesForeground, mHasPaintImpact), where mHasPaintImpact is true whenever the pseudo has any computed style, not just when colors are set. This ensures highlights specifying only text-shadow are included in the selection range list and get their shadow painted. Also fixes ::target-text incorrectly overriding ::highlight foreground colors when no author text color is specified, and caches the target-text light/dark scheme selection to avoid recomputing the contrast ratio. This also required to allow 1px fuzziness in the test. Differential Revision: https://phabricator.services.mozilla.com/D285546
15 lines
510 B
HTML
15 lines
510 B
HTML
<!doctype html>
|
|
<meta charset="utf-8">
|
|
<title>CSS Pseudo-Elements Test: ::target-text empty author rule should not suppress default colors</title>
|
|
<link rel="help" href="https://drafts.csswg.org/css-pseudo/#selectordef-target-text">
|
|
<link rel="match" href="target-text-011-ref.html">
|
|
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
|
|
<style>
|
|
.ahem { font-family: Ahem; }
|
|
::target-text {}
|
|
</style>
|
|
<p class="ahem">match me</p>
|
|
<script>
|
|
window.location.hash = "#:~:text=match%20me";
|
|
</script>
|