-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix async->manual rename in CSS, plus add more testing
When [1] landed, it forgot to change the default CSS for `async` to `manual`. Clearly that indicates a lack of appearance testing, so this CL adds a WPT for the appearance of pop-ups. I also opened this issue to discuss the standard styling: openui/open-ui#561 In the meantime, this CL also refactors all of the test-assumed default styles for [popup] into popup-styles.css, so that if we change these in the future it won't be so painful. This CL also had to add code to the <selectmenu> positioning algorithm to remove any margin. I think that's the right way to handle this, but that does mean developer `margin` settings on a slotted listbox won't have any effect. That seems right, but I don't know for sure. [1] https://chromium-review.googlesource.com/c/chromium/src/+/3722345 Bug: 1307772 Change-Id: I4ecf7bee947e90e2abdcedb47b3d38c958abb2f5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3749343 Reviewed-by: Joey Arhar <[email protected]> Commit-Queue: Mason Freed <[email protected]> Cr-Commit-Position: refs/heads/main@{#1021422}
- Loading branch information
1 parent
d974506
commit fe9314d
Showing
19 changed files
with
112 additions
and
154 deletions.
There are no files selected for viewing
14 changes: 3 additions & 11 deletions
14
html/semantics/popups/popup-animated-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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8" /> | ||
<title>Popup element appearance</title> | ||
<link rel="stylesheet" href="resources/popup-styles.css"> | ||
|
||
<style> | ||
.fake-pop-up {top: 100px;} | ||
#blank {left: -300px;} | ||
#auto {left: -100px;} | ||
#hint {left: 100px;} | ||
#manual {left: 300px;} | ||
</style> | ||
|
||
<p>There should be four pop-ups with similar appearance, and | ||
the word Unknown with no special styling.</p> | ||
<div class="fake-pop-up" id=blank>Blank</div> | ||
<div class="fake-pop-up" id=auto>Auto</div> | ||
<div class="fake-pop-up" id=hint><span>Hint</span></div> | ||
<div class="fake-pop-up" id=manual>Manual</div> | ||
<div class="not-a-pop-up!" id=unknown>Unknown</div> |
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,33 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8" /> | ||
<title>Popup element appearance</title> | ||
<link rel="author" href="mailto:[email protected]"> | ||
<link rel=help href="https://open-ui.org/components/popup.research.explainer"> | ||
<link rel="match" href="popup-appearance-ref.tentative.html"> | ||
|
||
<style> | ||
[popup] {top: 100px} | ||
[popup=""] {left: -300px} | ||
[popup=auto] {left: -100px; } | ||
[popup=hint] {left: 100px; } | ||
[popup=manual] {left: 300px; } | ||
</style> | ||
|
||
<p>There should be four pop-ups with similar appearance, and | ||
the word Unknown with no special styling.</p> | ||
<div popup>Blank | ||
<div popup=auto>Auto</div> | ||
</div> | ||
<div popup=hint>Hint</div> | ||
<div popup=manual>Manual</div> | ||
<!-- This ensures unsupported popup values don't receive styling --> | ||
<div popup=unknown>Unknown</div> | ||
<script> | ||
document.querySelectorAll('[popup]').forEach(p => { | ||
try { | ||
p.showPopUp(); | ||
} catch { | ||
// The unknown popup should throw an error on .showPopUp(). | ||
} | ||
}); | ||
</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
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
20 changes: 2 additions & 18 deletions
20
html/semantics/popups/popup-defaultopen-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 |
---|---|---|
@@ -1,22 +1,6 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<link rel=author href="mailto:[email protected]"> | ||
<link rel="stylesheet" href="resources/popup-styles.css"> | ||
|
||
<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> | ||
<div class="fake-pop-up">This is a popup, which should be open upon load</div> |
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
10 changes: 3 additions & 7 deletions
10
html/semantics/popups/popup-hidden-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 |
---|---|---|
@@ -1,19 +1,15 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<link rel=author href="mailto:[email protected]"> | ||
<link rel="stylesheet" href="resources/popup-styles.css"> | ||
|
||
<div>This content should be visible</div> | ||
<div class=fake-pop-up>This content should be visible</div> | ||
|
||
<style> | ||
div { | ||
position: fixed; | ||
.fake-pop-up { | ||
top: 0; | ||
left: 0; | ||
width: 300px; | ||
height: 200px; | ||
padding: 1em; | ||
border: 1px solid; | ||
background: white; | ||
color: black; | ||
} | ||
</style> |
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
18 changes: 2 additions & 16 deletions
18
html/semantics/popups/popup-open-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 |
---|---|---|
@@ -1,26 +1,12 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<link rel=author href="mailto:[email protected]"> | ||
<link rel="stylesheet" href="resources/popup-styles.css"> | ||
|
||
<div class=topmost></div> | ||
<div class=fakepopup>This is a popup</div> | ||
<div class=fake-pop-up>This is a popup</div> | ||
|
||
<style> | ||
.fakepopup { | ||
/* 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; | ||
margin: 1em; | ||
background: white; | ||
color: black; | ||
} | ||
.topmost { | ||
position:fixed; | ||
top:0; | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<link rel="author" href="mailto:[email protected]"> | ||
<link rel="stylesheet" href="resources/popup-styles.css"> | ||
|
||
<div id=popup> | ||
<div class="fake-pop-up"> | ||
Inside popup | ||
<div class=z style="z-index: 2; background:lightgreen">z-index 2 | ||
<div class=z style="z-index: 3; background:lightblue; left: 20px;">z-index 3</div> | ||
|
@@ -13,19 +14,10 @@ | |
</div> | ||
|
||
<style> | ||
#popup { | ||
/* Per spec: */ | ||
display: block; | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
/* Per settings in test file: */ | ||
.fake-pop-up { | ||
width: 200px; | ||
height: 230px; | ||
border: 1px solid red; | ||
padding: 1em; | ||
background: white; | ||
color: black; | ||
top:50px; | ||
left:50px; | ||
} | ||
|
Oops, something went wrong.