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 fdc20908685c44adee91624c3ce73ec23a9780ba..05da4ba57cccec8fe1657e5aec919b3956aaf479 100644 |
| --- a/third_party/WebKit/Source/core/dom/Node.cpp |
| +++ b/third_party/WebKit/Source/core/dom/Node.cpp |
| @@ -390,6 +390,18 @@ Node* Node::getRootNode(const GetRootNodeOptions& options) const { |
| : &treeRoot(); |
| } |
| +Text* Node::nextTextSibling() const { |
| + for (Node* sibling = nextSibling(); |
| + sibling && |
| + !(sibling->isElementNode() && toElement(sibling)->layoutObject()); |
|
esprehn
2016/10/17 21:36:26
Run demorgans :)
(!sibling->isElementNode() || !t
nainar
2016/10/18 00:04:41
Done.
|
| + sibling = sibling->nextSibling()) { |
| + if (sibling->isTextNode()) { |
| + return toText(sibling); |
| + } |
| + } |
| + return nullptr; |
| +} |
| + |
| Node* Node::insertBefore(Node* newChild, |
| Node* refChild, |
| ExceptionState& exceptionState) { |
| @@ -697,6 +709,17 @@ void Node::markAncestorsWithChildNeedsStyleRecalc() { |
| document().scheduleLayoutTreeUpdateIfNeeded(); |
| } |
| +void Node::markAncestorsWithChildNeedsReattachLayoutTree() { |
| + for (ContainerNode* p = parentOrShadowHostNode(); |
| + p && !p->childNeedsReattachLayoutTree(); p = p->parentOrShadowHostNode()) |
| + p->setChildNeedsReattachLayoutTree(); |
| +} |
| + |
| +void Node::setNeedsReattachLayoutTree() { |
| + setFlag(NeedsReattachLayoutTree); |
| + markAncestorsWithChildNeedsReattachLayoutTree(); |
| +} |
| + |
| void Node::setNeedsStyleRecalc(StyleChangeType changeType, |
| const StyleChangeReasonForTracing& reason) { |
| DCHECK(changeType != NoStyleChange); |
| @@ -888,6 +911,7 @@ void Node::attachLayoutTree(const AttachContext&) { |
| (layoutObject()->parent() || layoutObject()->isLayoutView()))); |
| clearNeedsStyleRecalc(); |
| + clearNeedsReattachLayoutTree(); |
| if (AXObjectCache* cache = document().axObjectCache()) |
| cache->updateCacheAfterNodeIsAttached(this); |