forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1874705: Run invalidation on appended elements even if the first …
…node is not an element. r=firefox-style-system-reviewers,emilio Differential Revision: https://phabricator.services.mozilla.com/D198604
- Loading branch information
Showing
5 changed files
with
65 additions
and
19 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
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
40 changes: 40 additions & 0 deletions
40
testing/web-platform/tests/css/selectors/invalidation/has-append-first-node.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,40 @@ | ||
<!DOCTYPE html> | ||
<html class="reftest-wait"> | ||
<link rel="author" title="David Shin" href="mailto:[email protected]"> | ||
<link rel="help" href="https://drafts.csswg.org/selectors/#relational"> | ||
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1874705"> | ||
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht"> | ||
<style> | ||
#dut { | ||
width: 100px; | ||
height: 100px; | ||
background: red; | ||
} | ||
#dut:has(span) { | ||
background: green; | ||
} | ||
</style> | ||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> | ||
<div id="dut"></div> | ||
<script> | ||
function raf() { | ||
return new Promise(resolve => { | ||
requestAnimationFrame(resolve); | ||
}); | ||
} | ||
|
||
async function go() { | ||
await raf(); | ||
await raf(); | ||
const df = document.createDocumentFragment(); | ||
const t = document.createTextNode('\n'); | ||
df.appendChild(t); | ||
const s = document.createElement("span"); | ||
df.appendChild(s); | ||
dut.appendChild(df); | ||
document.documentElement.className = ''; | ||
} | ||
|
||
go(); | ||
</script> | ||
</html> |