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

Unified Diff: third_party/WebKit/Source/core/dom/Node.cpp

Issue 2088453002: Implement the inert attribute (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix up some tests Created 4 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/dom/Node.cpp
diff --git a/third_party/WebKit/Source/core/dom/Node.cpp b/third_party/WebKit/Source/core/dom/Node.cpp
index a7f51f704a679c10db793f474762e3b0348a759a..72a7872e7328c1fd068f6eaa6c02680dcb7b828a 100644
--- a/third_party/WebKit/Source/core/dom/Node.cpp
+++ b/third_party/WebKit/Source/core/dom/Node.cpp
@@ -770,6 +770,16 @@ bool Node::isInert() const
const HTMLDialogElement* dialog = document().activeModalDialog();
if (dialog && this != document() && (!canParticipateInFlatTree() || !FlatTreeTraversal::containsIncludingPseudoElement(*dialog, *this)))
return true;
+
+ if (RuntimeEnabledFeatures::inertAttributeEnabled()) {
+ const Node* n = this;
esprehn 2016/06/27 22:27:15 node, don't abbreviate
aboxhall 2016/06/29 00:13:12 Done.
+ do {
+ if (n->isElementNode() && toElement(n)->hasAttribute(HTMLNames::inertAttr))
esprehn 2016/06/27 22:27:15 I think you want instead use node.parentOrShadowHo
aboxhall 2016/06/27 23:59:22 Where do I want to do that, sorry?
esprehn 2016/06/28 18:55:07 Your loop should be over parentOrShadowHostElement
aboxhall 2016/06/29 00:13:12 Done.
+ return true;
+ n = n->parentOrShadowHostNode();
+ } while (n);
+ }
+
return document().localOwner() && document().localOwner()->isInert();
}

Powered by Google App Engine
This is Rietveld 408576698