Update web-platform-tests to revision 9c4b78680260532467b053e6bd0fd506251c4fdb

This commit is contained in:
WPT Sync Bot 2021-01-28 08:20:31 +00:00
parent 35d56e4a5a
commit 7e5a73a627
110 changed files with 703 additions and 1693 deletions

View file

@ -5,22 +5,42 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<popup id=popup>This is a popup</popup>
<popup id=p1>This is a popup</popup>
<popup id=p2 open>This is another popup, with an unused "open" attribute</popup>
<script>
test(function() {
assert_true(document.createElement('popup') instanceof HTMLPopupElement);
}, "popup element exists")
test(function() {
const popup = document.getElementById('popup');
assert_equals(window.getComputedStyle(popup).getPropertyValue('display'),'none');
assert_equals(popup.getAttribute('open'),null);
popup.show();
assert_equals(popup.getAttribute('open'),"");
assert_equals(window.getComputedStyle(popup).getPropertyValue('display'),'block');
popup.hide();
assert_equals(popup.getAttribute('open'),null);
assert_equals(window.getComputedStyle(popup).getPropertyValue('display'),'none');
}, "popup element basic show/hide behavior")
const popup1 = document.getElementById('p1');
const popup2 = document.getElementById('p2');
test(function(){
assert_false(popup1.open);
assert_false(popup2.open);
assert_equals(getComputedStyle(popup2).display,"none");
}, 'The IDL "open" content attribute must have no effect, and must not be reflected to the WebIDL.');
test(function(){
assert_false(popup1.open);
assert_false(popup1.hasAttribute("open"));
assert_equals(getComputedStyle(popup1).display,"none");
popup1.open = true; // Should have no effect
assert_false(popup1.open);
popup1.show();
assert_true(popup1.open);
assert_false(popup1.hasAttribute("open"));
assert_not_equals(getComputedStyle(popup1).display,"none");
popup1.open = false; // Should have no effect
assert_true(popup1.open);
popup1.hide();
assert_false(popup1.open);
assert_false(popup1.hasAttribute("open"));
assert_equals(getComputedStyle(popup1).display,"none");
popup1.setAttribute("open","");
assert_false(popup1.open,'Setting open attribute should not reflect to the WebIDL');
assert_true(popup1.hasAttribute("open"));
assert_equals(getComputedStyle(popup1).display,"none");
}, "The only visibility control for <popup> is through .show() and .hide().");
</script>

View file

@ -0,0 +1,5 @@
<!DOCTYPE html>
<meta charset="utf-8">
<link rel=author title="Mason Freed" href="mailto:masonfreed@chromium.org">
No popup should be displayed here.<p>

View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<meta charset="utf-8">
<link rel=author title="Mason Freed" href="mailto:masonfreed@chromium.org">
<link rel=help href="https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/Popup/explainer.md">
<link rel=match href="popup-hidden-display-ref.tentative.html">
No popup should be displayed here.<p>
<popup>This content should be hidden</popup>
<style>
popup {
display: block; /* This should have no effect */
top: 0;
left: 0;
width: 300px;
height: 200px;
border: 1px solid;
background: white;
color: black;
}
</style>

View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<meta charset="utf-8">
<link rel=author title="Mason Freed" href="mailto:masonfreed@chromium.org">
<div>This is a popup</div>
<style>
div {
/* Per spec: */
display: block;
position: fixed;
top: 0;
left: 0;
/* Per settings in test file: */
width: fit-content;
height: fit-content;
border: 1px solid;
padding: 1em;
background: -internal-light-dark(white, black);
color: -internal-light-dark(black, white);
}
</style>

View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<meta charset="utf-8">
<link rel=author title="Mason Freed" href="mailto:masonfreed@chromium.org">
<link rel=help href="https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/Popup/explainer.md">
<link rel=match href="popup-open-display-ref.tentative.html">
<popup>This is a popup</popup>
<style>
popup {
width: fit-content;
height: fit-content;
border: 1px solid;
padding: 1em;
background: white;
color: black;
}
</style>
<script>
document.querySelector('popup').show();
</script>

View file

@ -1,29 +0,0 @@
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="author" title="Mason Freed" href="mailto:masonfreed@chromium.org">
<link rel=help href="https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/Popup/explainer.md">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<popup id=p1>This is a closed popup</popup>
<popup id=p2 open>This is an open popup</popup>
<script>
var popup1 = document.getElementById('p1');
var popup2 = document.getElementById('p2');
test(function(){
assert_false(popup1.open);
assert_true(popup2.open);
}, "The IDL open attribute must return true if the content open attribute is set, and false if it is absent.");
test(function(){
assert_false(popup1.hasAttribute("open"));
popup1.open = true;
assert_true(popup1.hasAttribute("open"));
popup1.open = false;
assert_true(popup2.hasAttribute("open"));
popup2.open = false;
assert_false(popup2.hasAttribute("open"));
}, "On setting, the content open attribute must be removed if the IDL open attribute is set to false, and must be present if the IDL open attribute is set to true.");
</script>