-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NGHighlightPainter: generalize background ::selection painting logic
This changes is mostly a refactor, which: - generalizes the ::selection behavior in PaintSelectionBackground and move it to PaintHighlightBackground, so all highlight pseudos now correctly paint their backgrounds pixel-snapped in physical space regardless of ‘writing-mode’. - merge SelectionBackgroundColor into HighlightBackgroundColor, without generalizing any of the ::selection behavior to other highlights. - merge the ::selection background step of PaintHighlightOverlays into the loop that handles all other highlights. There is a follow up bug (crbug.com/1480139) to calculate the custom highlight background rect the same way we calculate the ::select background rect, which accounts for line heights and line breaks. Bug: 1434114 Change-Id: I51a5d030cedad33d70e306b5a1c940823b59acc7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4803362 Commit-Queue: Stephen Chenney <schenney@chromium.org> Reviewed-by: Stephen Chenney <schenney@chromium.org> Cr-Commit-Position: refs/heads/main@{#1209405}
- Loading branch information
1 parent
3785fcc
commit be0da47
Showing
5 changed files
with
210 additions
and
109 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
15 changes: 15 additions & 0 deletions
15
...s/css-highlight-api/painting/custom-highlight-painting-vertical-writing-mode-001-ref.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!doctype html> | ||
<link rel="stylesheet" href="../../css-pseudo/support/highlights.css"> | ||
<meta charset="utf-8"> | ||
<style> | ||
:root { | ||
writing-mode: vertical-rl; | ||
} | ||
|
||
.highlighted { | ||
background-color: yellow; | ||
color: blue; | ||
} | ||
</style> | ||
<body> | ||
<div class="highlight_reftest"><span class="highlighted">One two </span><span>three…</span></div> |
Oops, something went wrong.