Chromium Code Reviews| 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 7d8415f0b1a934c007004df3e9fc46dcb54354ce..be953cac6736f98a354fd1e0d7d34f814856b18d 100644 |
| --- a/third_party/WebKit/Source/core/dom/Node.cpp |
| +++ b/third_party/WebKit/Source/core/dom/Node.cpp |
| @@ -828,11 +828,27 @@ bool Node::ShouldHaveFocusAppearance() const { |
| } |
| bool Node::IsInert() const { |
| + if (!CanParticipateInFlatTree()) |
| + return true; |
| + |
| + DCHECK(!ChildNeedsDistributionRecalc()); |
| + |
| const HTMLDialogElement* dialog = GetDocument().ActiveModalDialog(); |
| if (dialog && this != GetDocument() && |
| - (!CanParticipateInFlatTree() || |
| - !FlatTreeTraversal::ContainsIncludingPseudoElement(*dialog, *this))) |
| + !FlatTreeTraversal::ContainsIncludingPseudoElement(*dialog, *this)) { |
| return true; |
| + } |
| + |
| + if (RuntimeEnabledFeatures::inertAttributeEnabled()) { |
| + const Element* element = this->IsElementNode() |
| + ? ToElement(this) |
| + : FlatTreeTraversal::ParentElement(*this); |
| + while (element) { |
| + if (element->hasAttribute(HTMLNames::inertAttr)) |
| + return true; |
| + element = FlatTreeTraversal::ParentElement(*element); |
| + } |
| + } |
| return GetDocument().LocalOwner() && GetDocument().LocalOwner()->IsInert(); |
|
dmazzoni
2017/05/08 06:06:09
I just realized this only walks local frames, so i
|
| } |