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 2c1b5bee29fb8df519818bd1fb51beae183a9303..6e6ee87f7aa736fbaa7960d45861f1477ed6c926 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(); |
} |
@@ -846,11 +847,30 @@ bool Node::ShouldHaveFocusAppearance() const { |
} |
bool Node::IsInert() const { |
kochi
2017/05/22 07:31:15
Could you also update the comment in Node.h above
aboxhall
2017/05/23 02:45:43
Added some links in the .h
|
+ if (!CanParticipateInFlatTree()) |
+ return true; |
+ |
+ if (!isConnected()) |
kochi
2017/05/22 07:31:15
style nit: you can combine line 850 and 853 into o
aboxhall
2017/05/23 02:45:43
Makes sense, done.
|
+ 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(); |
} |