-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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} GitOrigin-RevId: 9d0421abc7790a8e3447ae6151c87557e9081146
- Loading branch information
1 parent
4fde274
commit 3729a07
Showing
20 changed files
with
125 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,6 +110,7 @@ | |
"impressionexpiry", | ||
"incremental", | ||
"inert", | ||
"initiallyopen", | ||
"inputmode", | ||
"integrity", | ||
"is", | ||
|
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
.../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
...t/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
...wpt/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
...l/wpt/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
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