forked from web-platform-tests/wpt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Highlight API: Ignore CSS contain when painting
Per the CSSWG resolution [1], ignore CSS contain boundaries when painting. Update tests, and remove some tests that are no longer interesting now that StaticRange painting no longer needs to take contain boundaries into account. [1] w3c/csswg-drafts#4598 Bug: 1164461 Change-Id: Iad9249867ea704f924827db810816935069363c4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3437210 Reviewed-by: Rune Lillesveen <[email protected]> Reviewed-by: Fernando Fiori <[email protected]> Commit-Queue: Dan Clark <[email protected]> Cr-Commit-Position: refs/heads/main@{#967368}
- Loading branch information
1 parent
aa7e51c
commit caab8b2
Showing
7 changed files
with
28 additions
and
129 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
css/css-highlight-api/painting/custom-highlight-painting-018.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,22 @@ | ||
<!DOCTYPE html> | ||
<meta charset="UTF-8"> | ||
<title>CSS Highlight API Test: Range across contain boundary is painted</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-highlight-api-1/"> | ||
<link rel="match" href="custom-highlight-painting-001-ref.html"> | ||
<meta name="assert" value="Highlight should be painted even though a Range that crosses a css-contain boundary is a part of it"> | ||
<style> | ||
::highlight(example-highlight) { | ||
background-color: yellow; | ||
color: blue; | ||
} | ||
#target { | ||
contain: paint; | ||
} | ||
</style> | ||
<body><span>One </span><span id="target"><span>two </span><span>three…</span></span> | ||
<script> | ||
let r = new Range(); | ||
r.setStart(document.body, 0); | ||
r.setEnd(document.querySelector("#target"), 1); | ||
CSS.highlights.set("example-highlight", new Highlight(r)); | ||
</script> |
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
8 changes: 4 additions & 4 deletions
8
css/css-highlight-api/painting/custom-highlight-painting-staticrange-002.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 |
---|---|---|
@@ -1,21 +1,21 @@ | ||
<!DOCTYPE html> | ||
<meta charset="UTF-8"> | ||
<title>CSS Highlight API Test: </title> | ||
<title>CSS Highlight API Test: StaticRange across contain boundary is painted</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-highlight-api-1/"> | ||
<link rel="match" href="custom-highlight-painting-001-ref.html"> | ||
<meta name="assert" value="StaticRanges crossing both boundaries of a css-contain (i.e. containing it entirely) should be painted"> | ||
<meta name="assert" value="A StaticRange crossing a contain boundary should be painted"> | ||
<style> | ||
::highlight(example-highlight) { | ||
background-color: yellow; | ||
color: blue; | ||
} | ||
#contained { | ||
contain: style; | ||
contain: paint; | ||
} | ||
</style> | ||
<body><span>One <span id="contained">two </span>three…</span> | ||
<script> | ||
let h = new Highlight(); | ||
h.add(new StaticRange({startContainer: document.body.firstChild.childNodes[0], startOffset: 0, endContainer: document.body.firstChild.childNodes[2], endOffset: 0})); | ||
h.add(new StaticRange({startContainer: document.body.firstChild.childNodes[0], startOffset: 0, endContainer: document.body.firstChild.childNodes[1], endOffset: 1})); | ||
CSS.highlights.set("example-highlight", h); | ||
</script> |
30 changes: 0 additions & 30 deletions
30
css/css-highlight-api/painting/custom-highlight-painting-staticrange-004.html
This file was deleted.
Oops, something went wrong.
30 changes: 0 additions & 30 deletions
30
css/css-highlight-api/painting/custom-highlight-painting-staticrange-005.html
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
css/css-highlight-api/painting/custom-highlight-painting-staticrange-006.html
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
css/css-highlight-api/painting/custom-highlight-painting-staticrange-007.html
This file was deleted.
Oops, something went wrong.