-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
- Loading branch information
1 parent
d563ea8
commit 5b4c45c
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
<meta charset="utf-8" /> | ||
<title>Popup anchor nesting</title> | ||
<link rel="author" href="mailto:[email protected]"> | ||
<link rel=help href="https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/Popup/explainer.md"> | ||
<link rel=help href="https://open-ui.org/components/popup.research.explainer"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/resources/testdriver.js"></script> | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<link rel="author" href="mailto:[email protected]"> | ||
<link rel=help href="https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/Popup/explainer.md"> | ||
<link rel=help href="https://open-ui.org/components/popup.research.explainer"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<link rel=author href="mailto:[email protected]"> | ||
<link rel=help href="https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/Popup/explainer.md"> | ||
<link rel=help href="https://open-ui.org/components/popup.research.explainer"> | ||
<link rel=match href="popup-hidden-display-ref.tentative.html"> | ||
|
||
No popup should be displayed here.<p> | ||
|
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:[email protected]"> | ||
|
||
<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:[email protected]"> | ||
<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:[email protected]"> | ||
<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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<link rel=author href="mailto:[email protected]"> | ||
<link rel=help href="https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/Popup/explainer.md"> | ||
<link rel=help href="https://open-ui.org/components/popup.research.explainer"> | ||
<link rel=match href="popup-hidden-display-ref.tentative.html"> | ||
|
||
No popup should be displayed here.<p> | ||
|
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
<meta charset="utf-8" /> | ||
<title>Popup invoking attribute</title> | ||
<link rel="author" href="mailto:[email protected]"> | ||
<link rel=help href="https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/Popup/explainer.md"> | ||
<link rel=help href="https://open-ui.org/components/popup.research.explainer"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/resources/testdriver.js"></script> | ||
|
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
<meta charset="utf-8" /> | ||
<title>Popup light dismiss on scroll</title> | ||
<link rel="author" href="mailto:[email protected]"> | ||
<link rel=help href="https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/Popup/explainer.md"> | ||
<link rel=help href="https://open-ui.org/components/popup.research.explainer"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
|
||
|
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
<meta charset="utf-8" /> | ||
<title>Popup light dismiss behavior</title> | ||
<link rel="author" href="mailto:[email protected]"> | ||
<link rel=help href="https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/Popup/explainer.md"> | ||
<link rel=help href="https://open-ui.org/components/popup.research.explainer"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/resources/testdriver.js"></script> | ||
|
2 changes: 1 addition & 1 deletion
2
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<link rel=author href="mailto:[email protected]"> | ||
<link rel=help href="https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/Popup/explainer.md"> | ||
<link rel=help href="https://open-ui.org/components/popup.research.explainer"> | ||
<link rel=match href="popup-open-display-ref.tentative.html"> | ||
|
||
<popup>This is a popup</popup> | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<link rel=author href="mailto:[email protected]"> | ||
<link rel=help href="https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/Popup/explainer.md"> | ||
<link rel=help href="https://open-ui.org/components/popup.research.explainer"> | ||
<link rel=match href="popup-open-overflow-display-ref.tentative.html"> | ||
|
||
<div id=container> | ||
|
2 changes: 1 addition & 1 deletion
2
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<link rel="author" href="mailto:[email protected]"> | ||
<link rel=help href="https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/Popup/explainer.md"> | ||
<link rel=help href="https://open-ui.org/components/popup.research.explainer"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<link rel="author" href="mailto:[email protected]"> | ||
<link rel=help href="https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/Popup/explainer.md"> | ||
<link rel=help href="https://open-ui.org/components/popup.research.explainer"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
|
||
|