Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(392)

Unified Diff: third_party/WebKit/Source/core/html/HTMLDialogElement.cpp

Issue 2883033003: Propagate inert state to OOPIFs when a modal dialog is active (Closed)
Patch Set: Restore earlier approach + UpdateDistribution() Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/HTMLDialogElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLDialogElement.cpp b/third_party/WebKit/Source/core/html/HTMLDialogElement.cpp
index 1d9e1a693d6210291de5c0bb9ecfeb98bd34a60c..3a89cb9840495b448b1bc4dfb5d911e86769ff1c 100644
--- a/third_party/WebKit/Source/core/html/HTMLDialogElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLDialogElement.cpp
@@ -34,6 +34,7 @@
#include "core/frame/LocalFrameView.h"
#include "core/frame/UseCounter.h"
#include "core/html/HTMLFormControlElement.h"
+#include "core/html/HTMLFrameOwnerElement.h"
#include "core/style/ComputedStyle.h"
namespace blink {
@@ -82,6 +83,13 @@ static void SetFocusForDialog(HTMLDialogElement* dialog) {
}
static void InertSubtreesChanged(Document& document) {
+ if (document.GetFrame()) {
+ // SetIsInert recurses through subframes to propagate the inert bit as
+ // needed.
+ document.GetFrame()->SetIsInert(document.LocalOwner() &&
alexmos 2017/06/16 02:17:58 How does this work when showModal is called in a m
kenrb 2017/06/19 19:26:23 For the main frame, is_inert_ is correctly always
alexmos 2017/06/20 18:46:10 Ah, I see - I missed this distinction that this me
+ document.LocalOwner()->IsInert());
+ }
+
// When a modal dialog opens or closes, nodes all over the accessibility
// tree can change inertness which means they must be added or removed from
// the tree. The most foolproof way is to clear the entire tree and rebuild
@@ -189,7 +197,7 @@ void HTMLDialogElement::showModal(ExceptionState& exception_state) {
void HTMLDialogElement::RemovedFrom(ContainerNode* insertion_point) {
HTMLElement::RemovedFrom(insertion_point);
SetNotCentered();
- // FIXME: We should call inertSubtreesChanged() here.
+ InertSubtreesChanged(GetDocument());
}
void HTMLDialogElement::SetCentered(LayoutUnit centered_position) {

Powered by Google App Engine
This is Rietveld 408576698