Commit 3fe6fcbb authored by Rune Lillesveen's avatar Rune Lillesveen Committed by Commit Bot

Run layout to avoid stale layout during SetIsInert()

Speculative fix for crbug.com/789094

Bug: 789094
Change-Id: I1ea9215d049d84b4117f8836754f467c3d8ec9bc
Reviewed-on: https://chromium-review.googlesource.com/c/823582Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599171}
parent 7422130d
<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<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.createShadowRoot();
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.");
</script>
...@@ -175,12 +175,13 @@ void HTMLDialogElement::showModal(ExceptionState& exception_state) { ...@@ -175,12 +175,13 @@ void HTMLDialogElement::showModal(ExceptionState& exception_state) {
GetDocument().AddToTopLayer(this); GetDocument().AddToTopLayer(this);
SetBooleanAttribute(openAttr, true); SetBooleanAttribute(openAttr, true);
ForceLayoutForCentering();
// Throw away the AX cache first, so the subsequent steps don't have a chance // Throw away the AX cache first, so the subsequent steps don't have a chance
// of queuing up AX events on objects that would be invalidated when the cache // of queuing up AX events on objects that would be invalidated when the cache
// is thrown away. // is thrown away.
InertSubtreesChanged(GetDocument(), *this); InertSubtreesChanged(GetDocument(), *this);
ForceLayoutForCentering();
SetFocusForDialog(this); SetFocusForDialog(this);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment