Update web-platform-tests and CSS tests.

- Update CSS tests to revision e05bfd5e30ed662c2f8a353577003f8eed230180.
- Update web-platform-tests to revision a052787dd5c069a340031011196b73affbd68cd9.
This commit is contained in:
Ms2ger 2017-02-06 11:06:12 +01:00
parent fb4f421c8b
commit 296fa2512b
21852 changed files with 2080936 additions and 892894 deletions

View file

@ -55,11 +55,9 @@
test(function(){
assert_false(d1.open);
assert_false(b0.commandDisabled);
d1.showModal();
this.add_cleanup(function() { d1.close(); });
assert_true(d1.open);
assert_true(b0.commandDisabled);
assert_equals(document.activeElement, b1);
});
@ -80,11 +78,8 @@
test(function(){
assert_false(d3.open);
assert_false(b3.commandDisabled);
assert_false(d4.open);
assert_false(b4.commandDisabled);
assert_false(d5.open);
assert_false(b5.commandDisabled);
d3.showModal();
this.add_cleanup(function() { d3.close(); });
d4.showModal();
@ -92,11 +87,8 @@
d5.showModal();
this.add_cleanup(function() { d5.close(); });
assert_true(d3.open);
assert_true(b3.commandDisabled);
assert_true(d4.open);
assert_true(b4.commandDisabled);
assert_true(d5.open);
assert_false(b5.commandDisabled);
}, "when opening multiple dialogs, only the newest one is non-inert");
test(function(){

View file

@ -0,0 +1,134 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>summary element: activation behavior</title>
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-summary-element">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<details id="happy-path-starts-closed">
<summary id="happy-path-starts-closed-summary">Summary</summary>
<p>Contents</p>
</details>
<details id="happy-path-starts-open" open>
<summary id="happy-path-starts-open-summary">Summary</summary>
<p>Contents</p>
</details>
<details id="details-not-being-rendered" style="display: none">
<summary id="details-not-being-rendered-summary">Summary</summary>
<p>Contents</p>
</details>
<details id="summary-not-being-rendered">
<summary id="summary-not-being-rendered-summary" style="display: none">Summary</summary>
<p>Contents</p>
</details>
<details id="has-preceding-element">
<span></span>
<summary id="has-preceding-element-summary">Summary</summary>
<p>Contents</p>
</details>
<details id="has-preceding-summary">
<summary>Summary 1</summary>
<summary id="has-preceding-summary-summary">Summary 2</summary>
<p>Contents</p>
</details>
<details id="has-preceding-summary-descendant">
<span><summary>Summary 1</summary></span>
<summary id="has-preceding-summary-descendant-summary">Summary 2</summary>
<p>Contents</p>
</details>
<details id="summary-nested">
<span><summary id="summary-nested-summary">Summary</summary></span>
<p>Contents</p>
</details>
<details id="toggle-tester">
<summary>Summary</summary>
<p>Contents</p>
</details>
<script>
"use strict";
testSummary(
"happy-path-starts-closed", false, true,
"Should open a closed details if all conditions are met"
);
testSummary(
"happy-path-starts-open", true, false,
"Should close an open details if all conditions are met"
);
testSummary(
"details-not-being-rendered", false, true,
"Should open a closed details even if the details is not being rendered"
);
testSummary(
"summary-not-being-rendered", false, true,
"Should open a closed details even if the summary is not being rendered"
);
testSummary(
"has-preceding-element", false, true,
"Should open a closed details if a span element precedes the summary"
);
testSummary(
"has-preceding-summary", false, false,
"Should stay closed if another summary element precedes the summary"
);
testSummary(
"has-preceding-summary-descendant", false, true,
"Should open a closed details if another summary element *nested inside a span* precedes the summary"
);
testSummary(
"summary-nested", false, false,
"Should stay closed if the summary element is nested inside a span element"
);
async_test(t => {
const details = document.getElementById("toggle-tester");
const summary = details.firstElementChild;
let timesToggleFired = 0;
details.addEventListener("toggle", t.step_func(() => {
++timesToggleFired;
}));
t.step_timeout(() => {
assert_equals(timesToggleFired, 1, "Expected toggle to fire exactly once");
t.done();
}, 200);
summary.click();
summary.click();
summary.click();
summary.click();
Promise.resolve().then(() => summary.click());
}, "toggle events should be coalesced even when using the activation behavior of a summary");
function testSummary(detailsId, expectedBefore, expectedAfter, name) {
test(() => {
const details = document.getElementById(detailsId);
const summary = document.getElementById(detailsId + "-summary");
assert_equals(details.open, expectedBefore, "Before activation: expected open to be " + expectedBefore);
summary.click();
assert_equals(details.open, expectedAfter, "After activation: expected open to be " + expectedAfter);
}, name);
}
</script>