Commit c43e58a8 authored by Rune Lillesveen's avatar Rune Lillesveen Committed by Commit Bot

Make GetReattachParent a member of Node.

We will need it outside of node.cc for layout tree rebuild root.

Bug: 868810
Change-Id: If428d5c1f954686c70c35631718c5fa270c8971b
Reviewed-on: https://chromium-review.googlesource.com/1217422Reviewed-by: default avatarAnders Ruud <andruud@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#590223}
parent 3e9b07c4
......@@ -872,27 +872,27 @@ void Node::MarkAncestorsWithChildNeedsStyleRecalc() {
GetDocument().ScheduleLayoutTreeUpdateIfNeeded();
}
static ContainerNode* GetReattachParent(Node& node) {
if (node.IsPseudoElement())
return node.ParentOrShadowHostNode();
if (node.IsChildOfV1ShadowHost()) {
if (HTMLSlotElement* slot = node.AssignedSlot())
ContainerNode* Node::GetReattachParent() const {
if (IsPseudoElement())
return ParentOrShadowHostNode();
if (IsChildOfV1ShadowHost()) {
if (HTMLSlotElement* slot = AssignedSlot())
return slot;
}
if (node.IsInV0ShadowTree() || node.IsChildOfV0ShadowHost()) {
if (ShadowRootWhereNodeCanBeDistributedForV0(node)) {
if (IsInV0ShadowTree() || IsChildOfV0ShadowHost()) {
if (ShadowRootWhereNodeCanBeDistributedForV0(*this)) {
if (V0InsertionPoint* insertion_point =
const_cast<V0InsertionPoint*>(ResolveReprojection(&node))) {
const_cast<V0InsertionPoint*>(ResolveReprojection(this))) {
return insertion_point;
}
}
}
return node.ParentOrShadowHostNode();
return ParentOrShadowHostNode();
}
void Node::MarkAncestorsWithChildNeedsReattachLayoutTree() {
for (ContainerNode* p = GetReattachParent(*this);
p && !p->ChildNeedsReattachLayoutTree(); p = GetReattachParent(*p))
for (ContainerNode* p = GetReattachParent();
p && !p->ChildNeedsReattachLayoutTree(); p = p->GetReattachParent())
p->SetChildNeedsReattachLayoutTree();
}
......
......@@ -600,6 +600,7 @@ class CORE_EXPORT Node : public EventTarget {
bool IsChildOfV1ShadowHost() const;
bool IsChildOfV0ShadowHost() const;
ShadowRoot* V1ShadowRootOfParent() const;
ContainerNode* GetReattachParent() const;
bool IsDocumentTypeNode() const { return getNodeType() == kDocumentTypeNode; }
virtual bool ChildTypeAllowed(NodeType) const { return false; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment