-
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.
Fix backdrop color for <dialog popup>
When a `<dialog>` is opened via `.showPopUp()`, it should have a completely transparent ::backdrop. This CL fixes that by adding a special case for dialog::open. See also: openui/open-ui#561 (comment) Bug: 1307772 Change-Id: I444730c57c699f4af4a708cc316dd81aa7563669 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3933277 Auto-Submit: Mason Freed <masonf@chromium.org> Reviewed-by: Joey Arhar <jarhar@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1054947} NOKEYCHECK=True GitOrigin-RevId: 4c1740d3237061fd2c84bad3fe9179d3fa345e9d
- Loading branch information
1 parent
57448e6
commit bbf2233
Showing
3 changed files
with
62 additions
and
1 deletion.
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
33 changes: 33 additions & 0 deletions
33
...k/web_tests/external/wpt/html/semantics/popups/popup-dialog-appearance-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,33 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8" /> | ||
<title>Dialog-Popup appearance</title> | ||
<link rel="author" href="mailto:masonf@chromium.org"> | ||
|
||
<p>Both dialogs should have the same shades of background.</p> | ||
<p>The pop-up should have a completely-transparent ::backdrop.</p> | ||
<dialog popup id=d1>This is a modal dialog</dialog> | ||
<dialog popup id=d2>This is a dialog pop-up</dialog> | ||
|
||
<style> | ||
dialog { | ||
left: 50px; | ||
right: auto; | ||
bottom: auto; | ||
} | ||
#d1 {top:100px;} | ||
#d2 {top:150px;} | ||
/* Force backdrop to spec: */ | ||
#d1::backdrop { | ||
/* https://html.spec.whatwg.org/multipage/rendering.html#flow-content-3 */ | ||
background-color: rgba(0, 0, 0, 0.1); | ||
} | ||
#d2::backdrop { | ||
/* When shown as a pop-up, backdrop must be transparent */ | ||
background-color: transparent; | ||
} | ||
</style> | ||
|
||
<script> | ||
document.getElementById('d1').showModal(); | ||
document.getElementById('d2').showPopUp(); | ||
</script> |
26 changes: 26 additions & 0 deletions
26
blink/web_tests/external/wpt/html/semantics/popups/popup-dialog-appearance.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" /> | ||
<title>Dialog-Popup appearance</title> | ||
<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-dialog-appearance-ref.tentative.html"> | ||
|
||
<p>Both dialogs should have the same shades of background.</p> | ||
<p>The pop-up should have a completely-transparent ::backdrop.</p> | ||
<dialog popup id=d1>This is a modal dialog</dialog> | ||
<dialog popup id=d2>This is a dialog pop-up</dialog> | ||
|
||
<style> | ||
dialog { | ||
left: 50px; | ||
right: auto; | ||
bottom: auto; | ||
} | ||
#d1 {top:100px;} | ||
#d2 {top:150px;} | ||
</style> | ||
|
||
<script> | ||
document.getElementById('d1').showModal(); | ||
document.getElementById('d2').showPopUp(); | ||
</script> |