Skip to content

Commit

Permalink
Bug 1866874 [wpt PR 43377] - Address concerns about CSSStyleSheet-con…
Browse files Browse the repository at this point in the history
…structable-concat.html, a=testonly

Automatic update from web-platform-tests
Address concerns about CSSStyleSheet-constructable-concat.html

See [1] for comments, but this CL adds reftest-wait to ensure
the test finishes before the image capture, and adds PASS lines
for all passed tests.

This makes no difference in Chromium, but ensures this test
works correctly in other browsers.

[1] web-platform-tests/wpt#43310

Bug: 1236777
Change-Id: I849284eafdd0afb630a11b0a9e6b73bc0264fd6b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5062333
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Commit-Queue: Mason Freed <masonf@chromium.org>
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Auto-Submit: Mason Freed <masonf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1229509}

--

wpt-commits: 2f79845b3d3e3a0244c8512df9b6c430e5a1d2f7
wpt-pr: 43377
  • Loading branch information
Mason Freed authored and moz-wptsync-bot committed Dec 1, 2023
1 parent 41a7634 commit 5d4ce92
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@

<span>This should be green</span><br>
<span>This should be green</span>
<pre>Tests:
PASS
PASS
PASS
PASS
</pre>

<style>
span {
background-color:green;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!DOCTYPE html>
<html class="reftest-wait">
<meta charset="utf-8">
<title>Adoptedstylesheets.concat should work when starting empty</title>
<link rel="author" href="mailto:masonf@chromium.org">
Expand All @@ -7,15 +8,13 @@

<span>This should be green</span>
<div id=host></div>
<pre id=errors></pre>
<pre id=tests>Tests:
</pre>

<script>
function assert_equals(val1,val2) {
if (val1 === val2) {
return;
}
const t = document.createTextNode(`FAIL! ${val1} should be equal to ${val2}\n`);
errors.appendChild(t);
const t = val1 === val2 ? 'PASS' : `FAIL! ${val1} !== ${val2}`;
tests.appendChild(document.createTextNode(`${t}\n`));
}
window.onload = () => {
const sheet = new CSSStyleSheet();
Expand All @@ -30,5 +29,6 @@
assert_equals(shadow.adoptedStyleSheets.length,0);
shadow.adoptedStyleSheets = shadow.adoptedStyleSheets.concat([sheet]);
assert_equals(shadow.adoptedStyleSheets.length,1);
document.documentElement.classList.remove("reftest-wait");
};
</script>

0 comments on commit 5d4ce92

Please sign in to comment.