-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1705974 [wpt PR 28566] - Add initiallyopen attribute to the <popu…
…p> element, a=testonly Automatic update from web-platform-tests Add initiallyopen attribute to the <popup> element This add an attribute called initiallyopen to the <popup> element. When this attribute is present on page load, the first such element will be shown by default. See [1] for the conversation and Open-UI resolution. This CL also re-points the explainer links for all popup tests to the new Open-UI repo. [1] openui/open-ui#311 (comment) Bug: 1168738 Change-Id: Ib95d12234f359d503dc168e6799dd2a17b0dc18e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2832157 Reviewed-by: Ionel Popescu <iopopesc@microsoft.com> Commit-Queue: Mason Freed <masonf@chromium.org> Cr-Commit-Position: refs/heads/master@{#874037} -- wpt-commits: 9144cfb5bfbeaa6f919bd02ebe53ccbbd408beb4 wpt-pr: 28566
- Loading branch information
1 parent
a942474
commit 5989cfc
Showing
14 changed files
with
90 additions
and
11 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
2 changes: 1 addition & 1 deletion
2
.../html/semantics/interactive-elements/the-popup-element/popup-element-basic.tentative.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
2 changes: 1 addition & 1 deletion
2
...html/semantics/interactive-elements/the-popup-element/popup-hidden-display.tentative.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
22 changes: 22 additions & 0 deletions
22
...ics/interactive-elements/the-popup-element/popup-initiallyopen-display-ref.tentative.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,22 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<link rel=author href="mailto:masonf@chromium.org"> | ||
|
||
<div>This is a popup, which should be open upon load</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> |
26 changes: 26 additions & 0 deletions
26
...mantics/interactive-elements/the-popup-element/popup-initiallyopen-display.tentative.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,26 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<link rel=author href="mailto:masonf@chromium.org"> | ||
<link rel=help href="https://open-ui.org/components/popup.research.explainer"> | ||
<link rel=match href="popup-initiallyopen-display-ref.tentative.html"> | ||
|
||
<popup id=p1 initiallyopen>This is a popup, which should be open upon load</popup> | ||
<popup id=p2 initiallyopen>This is a second popup with initiallyopen, which should NOT be open upon load</popup> | ||
|
||
<style> | ||
popup { | ||
width: fit-content; | ||
height: fit-content; | ||
border: 1px solid; | ||
padding: 1em; | ||
background: white; | ||
color: black; | ||
} | ||
#p1 { | ||
top:0; | ||
} | ||
#p2 { | ||
top:100px; | ||
} | ||
</style> | ||
|
31 changes: 31 additions & 0 deletions
31
.../html/semantics/interactive-elements/the-popup-element/popup-initiallyopen.tentative.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,31 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<link rel=author href="mailto:masonf@chromium.org"> | ||
<link rel=help href="https://open-ui.org/components/popup.research.explainer"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
|
||
<popup id=p1 initiallyopen>This is a popup, which should be open upon load</popup> | ||
<popup id=p2 initiallyopen>This is a second popup with initiallyopen, which should NOT be open upon load</popup> | ||
<popup id=p3>Also not visible</popup> | ||
|
||
<script> | ||
test(function(){ | ||
assert_true(p1.open,'initiallyopen should open the popup'); | ||
assert_true(p1.hasAttribute('initiallyopen')); | ||
assert_true(p1.initiallyOpen,'initiallyopen should be reflected in the IDL attribute'); | ||
assert_false(p2.open, 'Only the first popup with initiallyopen should be open on load'); | ||
assert_true(p2.hasAttribute('initiallyopen'),'initiallyopen should be present/true, even if not opened'); | ||
assert_true(p2.initiallyOpen,'initiallyopen should be present/true, even if not opened'); | ||
|
||
assert_false(p3.open); | ||
p3.setAttribute('initiallyopen',''); | ||
assert_false(p3.open, 'Changing initiallyopen should not affect open status'); | ||
assert_true(p3.hasAttribute('initiallyopen')); | ||
assert_true(p3.initiallyOpen,'initiallyopen should still reflect to IDL'); | ||
|
||
p1.removeAttribute('initiallyopen'); | ||
assert_true(p1.open,'removing initiallyopen should not close the popup'); | ||
assert_false(p1.hasAttribute('initiallyopen'),'...but it should reflect to IDL'); | ||
}, "The initiallyopen attribute should affect page load only"); | ||
</script> |
2 changes: 1 addition & 1 deletion
2
...semantics/interactive-elements/the-popup-element/popup-inside-display-none.tentative.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
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
2 changes: 1 addition & 1 deletion
2
...s/html/semantics/interactive-elements/the-popup-element/popup-open-display.tentative.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
2 changes: 1 addition & 1 deletion
2
...mantics/interactive-elements/the-popup-element/popup-open-overflow-display.tentative.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
2 changes: 1 addition & 1 deletion
2
...sts/html/semantics/interactive-elements/the-popup-element/popup-shadow-dom.tentative.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
2 changes: 1 addition & 1 deletion
2
...tests/html/semantics/interactive-elements/the-popup-element/popup-stacking.tentative.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