Repository navigation
fix(html): the pdf's selection keeps its background - #910
Merged
Merged
Conversation
The `::selection` rules that keep the hidden text layer hidden stated a colour and no background. An author `::selection` rule drops the UA's own background, so a selection in a pdf view painted nothing at all: no glyphs, which was the point, but no highlight either, and a reader selecting text saw no selection to aim a mark at. The rules now state the background with the colour, as `Highlight`, which follows the platform rather than fixing a colour of its own. Checked in chromium against five variants of the rule: the colour alone takes the background with it, `-webkit-text-fill-color` does not hide the layer at all, and stating both does what is wanted. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FJJdfqpnVCKBNHXjAVxSou
andiwand
force-pushed
the
fix/selection-keeps-its-background
branch
from
September 20, 2026 09:41
3e9e649 to
55876ba
Compare
…e comments A highlight pseudo takes `background-color`; the `background` shorthand also carries longhands the pseudo does not, which a strict engine may drop whole. The two entries in `Unreleased` describe one change nothing has released, so they read as one. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0149gFxhkvKTBQidz6brU8Vt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #907, which went one step too far: the
::selectionrules it added state a colour and no background, and an author::selectionrule drops the UA's own background. So a selection in a pdf view painted nothing at all - no glyphs, which was the point, but no highlight either. Reported from the device: "no selection background nothing", and with no visible selection there is nothing to aim a mark at.The rules now state the background with the colour, as
Highlight, so it follows the platform.Checked
Five variants of the rule in chromium, one row each, all selected at once:
color:transparent-webkit-text-fill-color:transparentcolor:transparent;background:Highlightcolor:transparent;background-color:rgba(...)Only the last two do both, and
Highlightis the one that is not a hardcoded colour.🤖 Generated with Claude Code
https://claude.ai/code/session_01FJJdfqpnVCKBNHXjAVxSou