Bug 1321284 - Part 3: Make Servo-based styling use the "flattened tree parent for style". r=bholley

MozReview-Commit-ID: BnW5VZ3xLpG

--HG--
extra : rebase_source : 2315408fb39fc52f272731ce0e936ec6ba4ea195
This commit is contained in:
Cameron McCormack 2016-12-01 14:55:49 +08:00
Родитель a72478f6c9
Коммит bd110300be
2 изменённых файлов: 8 добавлений и 5 удалений

Просмотреть файл

@ -8,6 +8,7 @@
#define mozilla_dom_ElementInlines_h
#include "mozilla/dom/Element.h"
#include "mozilla/ServoBindings.h"
#include "nsIContentInlines.h"
#include "nsIDocument.h"
@ -54,7 +55,7 @@ Element::NoteDirtyDescendantsForServo()
Element* curr = this;
while (curr && !curr->HasDirtyDescendantsForServo()) {
curr->SetHasDirtyDescendantsForServo();
curr = curr->GetFlattenedTreeParentElement();
curr = curr->GetFlattenedTreeParentElementForStyle();
}
MOZ_ASSERT(DirtyDescendantsBitIsPropagatedForServo());
@ -70,8 +71,10 @@ Element::DirtyDescendantsBitIsPropagatedForServo()
return false;
}
nsINode* parentNode = curr->GetParentNode();
curr = curr->GetFlattenedTreeParentElement();
MOZ_ASSERT_IF(!curr, parentNode == OwnerDoc());
curr = curr->GetFlattenedTreeParentElementForStyle();
MOZ_ASSERT_IF(!curr,
parentNode == OwnerDoc() ||
parentNode == parentNode->OwnerDoc()->GetRootElement());
}
return true;
}

Просмотреть файл

@ -62,7 +62,7 @@ Gecko_NodeIsElement(RawGeckoNodeBorrowed aNode)
RawGeckoNodeBorrowedOrNull
Gecko_GetParentNode(RawGeckoNodeBorrowed aNode)
{
return aNode->GetFlattenedTreeParentNode();
return aNode->GetFlattenedTreeParentNodeForStyle();
}
RawGeckoNodeBorrowedOrNull
@ -92,7 +92,7 @@ Gecko_GetNextSibling(RawGeckoNodeBorrowed aNode)
RawGeckoElementBorrowedOrNull
Gecko_GetParentElement(RawGeckoElementBorrowed aElement)
{
return aElement->GetFlattenedTreeParentElement();
return aElement->GetFlattenedTreeParentElementForStyle();
}
RawGeckoElementBorrowedOrNull