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..0544141b3248e20bf74016e358edcbc79fdc047a 100644 |
--- a/third_party/WebKit/Source/core/dom/Node.cpp |
+++ b/third_party/WebKit/Source/core/dom/Node.cpp |
@@ -753,8 +753,9 @@ void Node::MarkAncestorsWithChildNeedsStyleInvalidation() { |
void Node::MarkAncestorsWithChildNeedsDistributionRecalc() { |
ScriptForbiddenScope forbid_script_during_raw_iteration; |
for (Node* node = this; node && !node->ChildNeedsDistributionRecalc(); |
- node = node->ParentOrShadowHostNode()) |
+ node = node->ParentOrShadowHostNode()) { |
node->SetChildNeedsDistributionRecalc(); |
+ } |
GetDocument().ScheduleLayoutTreeUpdateIfNeeded(); |
} |
@@ -828,11 +829,30 @@ bool Node::ShouldHaveFocusAppearance() const { |
} |
bool Node::IsInert() const { |
+ if (!CanParticipateInFlatTree()) |
+ return true; |
+ |
+ if (!isConnected()) |
+ return true; |
+ |
+ DCHECK(!ChildNeedsDistributionRecalc()); |
esprehn
2017/05/12 21:16:54
This assert should be inside FlatTreeTraversal pro
aboxhall
2017/05/18 01:30:49
Acknowledged.
|
+ |
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(); |
esprehn
2017/05/12 21:16:54
This won't work in OOPIF, it means out of process
aboxhall
2017/05/18 01:30:49
Acknowledged.
|
} |