Skip to content

Commit

Permalink
Import wpt@d81f04acd4371d2939c7a30a090c9af913165874
Browse files Browse the repository at this point in the history
Using wpt-import in Chromium a0721c8.
With Chromium commits locally applied on WPT:
02f17c4 "Fix dialog focusing steps for disconnected dialog"


Note to sheriffs: This CL imports external tests and adds
expectations for those tests; if this CL is large and causes
a few new failures, please fix the failures by adding new
lines to TestExpectations rather than reverting. See:
https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_platform_tests.md

Directory owners for changes in this CL:
rego@igalia.com:
  external/wpt/css/selectors

NOAUTOREVERT=true
R=rubber-stamper@appspot.gserviceaccount.com

No-Export: true
Cq-Include-Trybots: luci.chromium.try:linux-wpt-identity-fyi-rel,linux-wpt-input-fyi-rel,linux-blink-rel
Change-Id: Ib7141e0e557ba76768e114d8f96a0e39db8db9c7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3635440
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: WPT Autoroller <wpt-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1001233}
  • Loading branch information
Chromium WPT Sync authored and Chromium LUCI CQ committed May 9, 2022
1 parent bc8e3dd commit a73a6cc
Show file tree
Hide file tree
Showing 6 changed files with 180 additions and 14 deletions.
2 changes: 1 addition & 1 deletion third_party/blink/web_tests/external/Version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Version: 2bc981110402ce8c1e21b6a70d7fdb00518ee748
Version: d81f04acd4371d2939c7a30a090c9af913165874
119 changes: 114 additions & 5 deletions third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json
Original file line number Diff line number Diff line change
Expand Up @@ -86687,6 +86687,84 @@
],
{}
]
],
"table-row-paint-htb-ltr.html": [
"ecc156bd38bcc414b8d66abf84d355c040f0782d",
[
null,
[
[
"/css/css-break/table/table-row-paint-htb-ltr-ref.html",
"=="
]
],
{}
]
],
"table-row-paint-vlr-rtl.html": [
"f3d32c9df664c75350ee8b029267be13b0894eee",
[
null,
[
[
"/css/css-break/table/table-row-paint-vlr-rtl-ref.html",
"=="
]
],
{}
]
],
"table-row-paint-vrl-rtl.html": [
"a74a952b4b9e9f96cd6be5878011eaf34f4632ba",
[
null,
[
[
"/css/css-break/table/table-row-paint-vrl-rtl-ref.html",
"=="
]
],
{}
]
],
"table-section-paint-htb-ltr.html": [
"ff0eda1be83c900c256fe3ac994e16408f10f8f9",
[
null,
[
[
"/css/css-break/table/table-section-paint-htb-ltr-ref.html",
"=="
]
],
{}
]
],
"table-section-paint-vlr-rtl.html": [
"1dbdb212ace7aee3afffa21d01863912ae62cdd2",
[
null,
[
[
"/css/css-break/table/table-section-paint-vlr-rtl-ref.html",
"=="
]
],
{}
]
],
"table-section-paint-vrl-rtl.html": [
"d079c35818e1a920b2a07375114388876d2e880a",
[
null,
[
[
"/css/css-break/table/table-section-paint-vrl-rtl-ref.html",
"=="
]
],
{}
]
]
},
"tall-break-inside-avoid-at-start.html": [
Expand Down Expand Up @@ -259977,6 +260055,30 @@
"table-col-paint-vrl-rtl-ref.html": [
"0fde8bacc51d23a2065246727daf90fef8885f0c",
[]
],
"table-row-paint-htb-ltr-ref.html": [
"74e99b0143aa89b641b06297a282b2d46c868e06",
[]
],
"table-row-paint-vlr-rtl-ref.html": [
"587b6c1ee44f200c6e40888f841ca69da69b82d7",
[]
],
"table-row-paint-vrl-rtl-ref.html": [
"ea81d9bcff8e2a2af1f8aff39484a1f2d79edde7",
[]
],
"table-section-paint-htb-ltr-ref.html": [
"75b2078c146fe2e895d67526d8b52d39071783e6",
[]
],
"table-section-paint-vlr-rtl-ref.html": [
"a2e65520ec6dc22e0bc811dd6164785333893d65",
[]
],
"table-section-paint-vrl-rtl-ref.html": [
"bc860a560ff99d8c7dfdc536beccef5070b42dd3",
[]
]
},
"transform-006-ref.html": [
Expand Down Expand Up @@ -337111,14 +337213,14 @@
]
],
"idbfactory-databases-opaque-origin.html": [
"5f1b3070c638ddf36b7d2d30717c24d324a38f06",
"ff5b668664a4499e89700eaf0c30be91d701366e",
[
null,
{}
]
],
"idbfactory-deleteDatabase-opaque-origin.html": [
"058116fac515ab372450808d43a9e86123d336dc",
"071438953747ee16ad8edefb7601b9431c7aec6a",
[
null,
{}
Expand All @@ -337139,7 +337241,7 @@
]
],
"idbfactory-open-opaque-origin.html": [
"2c2889fbf7d11515afe088f59db878478b24bb66",
"a71da9afb3a4c50ec6dfe53198df9e02a0396941",
[
null,
{}
Expand Down Expand Up @@ -395885,6 +395987,13 @@
{}
]
],
"modal-pseudo-class-in-has.html": [
"9c487fba16fdad7d07dfc1b867dfddf7a4a021cb",
[
null,
{}
]
],
"not-001.html": [
"db1cf291c7e07f42ba2e40f12ed2d470bfafaa65",
[
Expand Down Expand Up @@ -467997,7 +468106,7 @@
]
],
"dialog-focusing-steps-disconnected.html": [
"0171ee287fad27c9ee3ffe83a5bac7d2c9ba4a47",
"bf621b640b7058d90542ed80dbe86d7c5cf99337",
[
null,
{}
Expand Down Expand Up @@ -468064,7 +468173,7 @@
]
],
"dialog-show-modal.html": [
"ed643756508ce3939f0636ef5ac9d0991fc39c17",
"610e66d20112fd217ec91154245debd9a2693600",
[
null,
{}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!DOCTYPE html>
<meta charset="utf-8" />
<title>CSS Selectors Invalidation: :modal pseudo class in :has()</title>
<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m">
<link rel="help" href="https://drafts.csswg.org/selectors/#relational">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
#subject:has(#dialog:modal) { color: green }
</style>
<div id="subject">
This is some text.
<dialog id="dialog">This is a dialog</dialog>
</div>
<script>
test(function() {
assert_equals(getComputedStyle(subject).color, "rgb(0, 0, 0)",
"ancestor should be black since dialog is not modal");
dialog.show();
assert_equals(getComputedStyle(subject).color, "rgb(0, 0, 0)",
"ancestor should be black since dialog is not modal");
dialog.close();
}, ":modal pseudo-class is not active with dialog.show()");
test(function() {
assert_equals(getComputedStyle(subject).color, "rgb(0, 0, 0)",
"ancestor should be black");
dialog.showModal();
assert_equals(getComputedStyle(subject).color, "rgb(0, 128, 0)",
"ancestor should be green since dialog is shown modally");
dialog.close();
assert_equals(getComputedStyle(subject).color, "rgb(0, 0, 0)",
"ancestor should be black since dialog is closed");
}, ":modal pseudo-class invalidation with showModal+close");
test(function() {
assert_equals(getComputedStyle(subject).color, "rgb(0, 0, 0)",
"ancestor should be black");
dialog.showModal();
assert_equals(getComputedStyle(subject).color, "rgb(0, 128, 0)",
"ancestor should be green since dialog is shown modally");
dialog.remove();
assert_equals(getComputedStyle(subject).color, "rgb(0, 0, 0)",
"ancestor should be black since dialog is closed");
}, ":modal pseudo-class invalidation with showModal+remove");
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,29 @@

<script>
test(() => {
const dialog = document.getElementById('mydialog');
const dialog = document.getElementById("mydialog");
const computedStyle = window.getComputedStyle(dialog, null);
assert_equals(computedStyle.display, 'none');
assert_equals(computedStyle.display, "none");
assert_false(dialog.matches(":modal"));

dialog.showModal();
assert_equals(computedStyle.display, 'block');
assert_equals(computedStyle.display, "block");
assert_true(dialog.matches(":modal"));

// The quoted texts output below are from <http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#dom-dialog-showmodal>.
assert_throws_dom('InvalidStateError', () => dialog.showModal());
assert_throws_dom("InvalidStateError", () => dialog.showModal());

dialog.close();
assert_equals(computedStyle.display, 'none');
assert_equals(computedStyle.display, "none");
assert_false(dialog.matches(":modal"));

dialog.parentNode.removeChild(dialog);
assert_throws_dom('InvalidStateError', () => dialog.showModal());
assert_throws_dom("InvalidStateError", () => dialog.showModal());

const doc = document.implementation.createHTMLDocument();
doc.body.appendChild(dialog);
assert_false(dialog.open);
dialog.showModal();
assert_true(dialog.open, 'Although the document is not attached to any pages, showModal() should execute as normal.');
}, 'Tests that showModal() performs the steps specified in the HTML spec.');
assert_true(dialog.open, "Although the document is not attached to any pages, showModal() should execute as normal.");
}, "Tests that showModal() performs the steps specified in the HTML spec.");
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
This is a testharness.js-based test.
PASS :modal pseudo-class is not active with dialog.show()
FAIL :modal pseudo-class invalidation with showModal+close assert_equals: ancestor should be green since dialog is shown modally expected "rgb(0, 128, 0)" but got "rgb(0, 0, 0)"
FAIL :modal pseudo-class invalidation with showModal+remove Failed to execute 'showModal' on 'HTMLDialogElement': The element already has an 'open' attribute, and therefore cannot be opened modally.
Harness: the test ran to completion.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This is a testharness.js-based test.
FAIL Tests that showModal() performs the steps specified in the HTML spec. Failed to execute 'matches' on 'Element': ':modal' is not a valid selector.
Harness: the test ran to completion.

0 comments on commit a73a6cc

Please sign in to comment.