forked from web-platform-tests/wpt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
See the bug for details, but it's possible (and ok) to already have a closewatcher in showModal(). I also found a test that wasn't being run, due to an error in a prior migration. Fixed: 384549097 Change-Id: I4f32e782a01cda79c63088b9bbf8ea41e158703e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6153855 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@{#1403636}
- Loading branch information
1 parent
3fdd928
commit fed5fd6
Showing
2 changed files
with
33 additions
and
13 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
html/semantics/interactive-elements/the-dialog-element/dialog-closewatcher-crash.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,20 @@ | ||
<!DOCTYPE html> | ||
|
||
<!-- This test passes if it does not crash. --> | ||
|
||
<dl> | ||
<dt contenteditable></dt> | ||
<dialog open></dialog> | ||
</dl> | ||
|
||
<script> | ||
const dialog = document.querySelector('dialog'); | ||
dialog.open = false; | ||
document.querySelector('dl').addEventListener("focusin", () => { | ||
dialog.showModal(); | ||
}); | ||
document.defaultView.requestIdleCallback(() => { | ||
window.getSelection().addRange(document.createRange()); | ||
dialog.close(); | ||
}); | ||
</script> |
26 changes: 13 additions & 13 deletions
26
html/semantics/interactive-elements/the-dialog-element/dialog-showModal-inert-crash.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,17 +1,17 @@ | ||
<!DOCTYPE html> | ||
|
||
<!-- This test passes if it does not crash. --> | ||
|
||
<iframe id="frame"></iframe> | ||
<script> | ||
async_test(function(t) { | ||
onload = t.step_func(() => { | ||
const host = document.createElement("div"); | ||
frame.appendChild(host); | ||
frame.contentDocument.body.innerHTML = "<dialog></dialog>"; | ||
document.body.offsetTop; | ||
const root = host.attachShadow({mode: 'open'}); | ||
root.innerHTML = "<content>"; | ||
const dialog = frame.contentDocument.querySelector("dialog"); | ||
dialog.showModal(); | ||
t.done(); | ||
}); | ||
}, "Dialog.showModal() called when we have a dirty shadow distribution should not crash."); | ||
window.onload = () => { | ||
const host = document.createElement("div"); | ||
frame.appendChild(host); | ||
frame.contentDocument.body.innerHTML = "<dialog></dialog>"; | ||
document.body.offsetTop; | ||
const root = host.attachShadow({mode: 'open'}); | ||
root.innerHTML = "<content>"; | ||
const dialog = frame.contentDocument.querySelector("dialog"); | ||
dialog.showModal(); | ||
}; | ||
</script> |