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

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

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