Chromium Code Reviews| Index: third_party/WebKit/Source/core/dom/ContainerNode.cpp |
| diff --git a/third_party/WebKit/Source/core/dom/ContainerNode.cpp b/third_party/WebKit/Source/core/dom/ContainerNode.cpp |
| index d7f3ac0c07bc72120e077f48712cfacdb70a4443..03c3eb32bb32468a932fc03f670199f86c6765e8 100644 |
| --- a/third_party/WebKit/Source/core/dom/ContainerNode.cpp |
| +++ b/third_party/WebKit/Source/core/dom/ContainerNode.cpp |
| @@ -772,10 +772,18 @@ void ContainerNode::detach(const AttachContext& context) |
| Node::detach(context); |
| } |
| +bool ContainerNode::shouldUpdateRangesAfterChildrenChanged(const ChildrenChange& change) |
| +{ |
| + return !change.byParser |
| + && change.type != TextChanged |
|
keishi
2016/06/04 07:02:45
nit: would the code be easier to understand if it
yosin_UTC9
2016/06/06 05:21:26
Done.
|
| + && change.type != ElementInserted |
| + && change.type != NonElementInserted; |
| +} |
| + |
| void ContainerNode::childrenChanged(const ChildrenChange& change) |
| { |
| document().incDOMTreeVersion(); |
| - if (!change.byParser && change.type != TextChanged) |
| + if (shouldUpdateRangesAfterChildrenChanged(change)) |
| document().updateRangesAfterChildrenChanged(this); |
| invalidateNodeListCachesInAncestors(); |
| if (change.isChildInsertion() && !childNeedsStyleRecalc()) { |