mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-19 05:37:30 +09:00
Issue #2112 - Part 6: Remove IsStyledByServo function and callers
This commit is contained in:
parent
a93a7bed47
commit
10bf8705d0
13 changed files with 16 additions and 181 deletions
|
|
@ -1615,7 +1615,7 @@ Element::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||||
// And clear the lazy frame construction bits.
|
// And clear the lazy frame construction bits.
|
||||||
NODE_NEEDS_FRAME | NODE_DESCENDANTS_NEED_FRAMES);
|
NODE_NEEDS_FRAME | NODE_DESCENDANTS_NEED_FRAMES);
|
||||||
// And the restyle bits
|
// And the restyle bits
|
||||||
UnsetRestyleFlagsIfGecko();
|
UnsetRestyleFlags();
|
||||||
} else if (IsInShadowTree()) {
|
} else if (IsInShadowTree()) {
|
||||||
// We're not in a document, but we did get inserted into a shadow tree.
|
// We're not in a document, but we did get inserted into a shadow tree.
|
||||||
// Since we won't have any restyle data in the document's restyle trackers,
|
// Since we won't have any restyle data in the document's restyle trackers,
|
||||||
|
|
@ -1625,7 +1625,7 @@ Element::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||||
// inserted into a document.
|
// inserted into a document.
|
||||||
UnsetFlags(NODE_FORCE_XBL_BINDINGS |
|
UnsetFlags(NODE_FORCE_XBL_BINDINGS |
|
||||||
NODE_NEEDS_FRAME | NODE_DESCENDANTS_NEED_FRAMES);
|
NODE_NEEDS_FRAME | NODE_DESCENDANTS_NEED_FRAMES);
|
||||||
UnsetRestyleFlagsIfGecko();
|
UnsetRestyleFlags();
|
||||||
} else {
|
} else {
|
||||||
// If we're not in the doc and not in a shadow tree,
|
// If we're not in the doc and not in a shadow tree,
|
||||||
// update our subtree pointer.
|
// update our subtree pointer.
|
||||||
|
|
@ -1766,18 +1766,6 @@ Element::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// It would be cleanest to mark nodes as dirty when (a) they're created and
|
|
||||||
// (b) they're unbound from a tree. However, we can't easily do (a) right now,
|
|
||||||
// because IsStyledByServo() is not always easy to check at node creation time,
|
|
||||||
// and the bits have different meaning in the non-IsStyledByServo case.
|
|
||||||
//
|
|
||||||
// So for now, we just mark nodes as dirty when they're inserted into a
|
|
||||||
// document or shadow tree.
|
|
||||||
if (IsStyledByServo() && IsInComposedDoc()) {
|
|
||||||
MOZ_ASSERT(!HasServoData());
|
|
||||||
SetIsDirtyForServo();
|
|
||||||
}
|
|
||||||
|
|
||||||
// XXXbz script execution during binding can trigger some of these
|
// XXXbz script execution during binding can trigger some of these
|
||||||
// postcondition asserts.... But we do want that, since things will
|
// postcondition asserts.... But we do want that, since things will
|
||||||
// generally be quite broken when that happens.
|
// generally be quite broken when that happens.
|
||||||
|
|
@ -1904,12 +1892,6 @@ Element::UnbindFromTree(bool aDeep, bool aNullParent)
|
||||||
|
|
||||||
ClearInDocument();
|
ClearInDocument();
|
||||||
|
|
||||||
// Computed styled data isn't useful for detached nodes, and we'll need to
|
|
||||||
// recomputed it anyway if we ever insert the nodes back into a document.
|
|
||||||
if (IsStyledByServo()) {
|
|
||||||
ClearServoData();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Editable descendant count only counts descendants that
|
// Editable descendant count only counts descendants that
|
||||||
// are in the uncomposed document.
|
// are in the uncomposed document.
|
||||||
ResetEditableDescendantCount();
|
ResetEditableDescendantCount();
|
||||||
|
|
|
||||||
|
|
@ -1662,9 +1662,9 @@ inline const mozilla::dom::Element* nsINode::AsElement() const
|
||||||
return static_cast<const mozilla::dom::Element*>(this);
|
return static_cast<const mozilla::dom::Element*>(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void nsINode::UnsetRestyleFlagsIfGecko()
|
inline void nsINode::UnsetRestyleFlags()
|
||||||
{
|
{
|
||||||
if (IsElement() && !IsStyledByServo()) {
|
if (IsElement()) {
|
||||||
UnsetFlags(ELEMENT_ALL_RESTYLE_FLAGS);
|
UnsetFlags(ELEMENT_ALL_RESTYLE_FLAGS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2531,51 +2531,3 @@ FragmentOrElement::SetIsElementInStyleScopeFlagOnShadowTree(bool aInStyleScope)
|
||||||
shadowRoot->SetIsElementInStyleScopeFlagOnSubtree(aInStyleScope);
|
shadowRoot->SetIsElementInStyleScopeFlagOnSubtree(aInStyleScope);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
static void
|
|
||||||
AssertDirtyDescendantsBitPropagated(nsINode* aNode)
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(aNode->HasDirtyDescendantsForServo());
|
|
||||||
nsINode* parent = aNode->GetFlattenedTreeParentNode();
|
|
||||||
if (!parent->IsContent()) {
|
|
||||||
MOZ_ASSERT(parent == aNode->OwnerDoc());
|
|
||||||
MOZ_ASSERT(parent->HasDirtyDescendantsForServo());
|
|
||||||
} else {
|
|
||||||
AssertDirtyDescendantsBitPropagated(parent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
static void AssertDirtyDescendantsBitPropagated(nsINode* aNode) {}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void
|
|
||||||
nsIContent::MarkAncestorsAsHavingDirtyDescendantsForServo()
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(IsInComposedDoc());
|
|
||||||
|
|
||||||
// Get the parent in the flattened tree.
|
|
||||||
nsINode* parent = GetFlattenedTreeParentNode();
|
|
||||||
|
|
||||||
// Loop until we hit a base case.
|
|
||||||
while (true) {
|
|
||||||
|
|
||||||
// Base case: the document.
|
|
||||||
if (!parent->IsContent()) {
|
|
||||||
MOZ_ASSERT(parent == OwnerDoc());
|
|
||||||
parent->SetHasDirtyDescendantsForServo();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Base case: the parent is already marked, and therefore
|
|
||||||
// so are all its ancestors.
|
|
||||||
if (parent->HasDirtyDescendantsForServo()) {
|
|
||||||
AssertDirtyDescendantsBitPropagated(parent);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Mark the parent and iterate.
|
|
||||||
parent->SetHasDirtyDescendantsForServo();
|
|
||||||
parent = parent->GetFlattenedTreeParentNode();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -2277,11 +2277,6 @@ nsDocument::IsWebComponentsEnabled(JSContext* aCx, JSObject* aObject)
|
||||||
do_QueryInterface(nsJSUtils::GetStaticScriptGlobal(global));
|
do_QueryInterface(nsJSUtils::GetStaticScriptGlobal(global));
|
||||||
|
|
||||||
nsIDocument* doc = window ? window->GetExtantDoc() : nullptr;
|
nsIDocument* doc = window ? window->GetExtantDoc() : nullptr;
|
||||||
if (doc && doc->IsStyledByServo()) {
|
|
||||||
NS_WARNING("stylo: Web Components not supported yet");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -555,18 +555,6 @@ nsGenericDOMDataNode::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||||
|
|
||||||
UpdateEditableState(false);
|
UpdateEditableState(false);
|
||||||
|
|
||||||
// It would be cleanest to mark nodes as dirty when (a) they're created and
|
|
||||||
// (b) they're unbound from a tree. However, we can't easily do (a) right now,
|
|
||||||
// because IsStyledByServo() is not always easy to check at node creation time,
|
|
||||||
// and the bits have different meaning in the non-IsStyledByServo case.
|
|
||||||
//
|
|
||||||
// So for now, we just mark nodes as dirty when they're inserted into a
|
|
||||||
// document or shadow tree.
|
|
||||||
if (IsStyledByServo() && IsInComposedDoc()) {
|
|
||||||
MOZ_ASSERT(!HasServoData());
|
|
||||||
SetIsDirtyForServo();
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_POSTCONDITION(aDocument == GetUncomposedDoc(), "Bound to wrong document");
|
NS_POSTCONDITION(aDocument == GetUncomposedDoc(), "Bound to wrong document");
|
||||||
NS_POSTCONDITION(aParent == GetParent(), "Bound to wrong parent");
|
NS_POSTCONDITION(aParent == GetParent(), "Bound to wrong parent");
|
||||||
NS_POSTCONDITION(aBindingParent == GetBindingParent(),
|
NS_POSTCONDITION(aBindingParent == GetBindingParent(),
|
||||||
|
|
@ -598,12 +586,6 @@ nsGenericDOMDataNode::UnbindFromTree(bool aDeep, bool aNullParent)
|
||||||
}
|
}
|
||||||
ClearInDocument();
|
ClearInDocument();
|
||||||
|
|
||||||
// Computed styled data isn't useful for detached nodes, and we'll need to
|
|
||||||
// recomputed it anyway if we ever insert the nodes back into a document.
|
|
||||||
if (IsStyledByServo()) {
|
|
||||||
ClearServoData();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (aNullParent || !mParent->IsInShadowTree()) {
|
if (aNullParent || !mParent->IsInShadowTree()) {
|
||||||
UnsetFlags(NODE_IS_IN_SHADOW_TREE);
|
UnsetFlags(NODE_IS_IN_SHADOW_TREE);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -933,13 +933,6 @@ public:
|
||||||
mozilla::dom::Element* GetEditingHost();
|
mozilla::dom::Element* GetEditingHost();
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO all the way up the flattened
|
|
||||||
* parent chain to the document. If an ancestor is found with the bit already
|
|
||||||
* set, this method asserts that all of its ancestors also have the bit set.
|
|
||||||
*/
|
|
||||||
void MarkAncestorsAsHavingDirtyDescendantsForServo();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determining language. Look at the nearest ancestor element that has a lang
|
* Determining language. Look at the nearest ancestor element that has a lang
|
||||||
* attribute in the XML namespace or is an HTML/SVG element and has a lang in
|
* attribute in the XML namespace or is an HTML/SVG element and has a lang in
|
||||||
|
|
|
||||||
|
|
@ -1158,10 +1158,6 @@ public:
|
||||||
|
|
||||||
void UpdateStyleBackendType();
|
void UpdateStyleBackendType();
|
||||||
|
|
||||||
bool IsStyledByServo() const {
|
|
||||||
return GetStyleBackendType() == mozilla::StyleBackendType::Servo;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get this document's StyleImageLoader. This is guaranteed to not return null.
|
* Get this document's StyleImageLoader. This is guaranteed to not return null.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1018,55 +1018,7 @@ public:
|
||||||
virtual nsPIDOMWindowOuter* GetOwnerGlobalForBindings() override;
|
virtual nsPIDOMWindowOuter* GetOwnerGlobalForBindings() override;
|
||||||
virtual nsIGlobalObject* GetOwnerGlobal() const override;
|
virtual nsIGlobalObject* GetOwnerGlobal() const override;
|
||||||
|
|
||||||
/**
|
inline void UnsetRestyleFlags();
|
||||||
* Returns true if this is a node belonging to a document that uses the Servo
|
|
||||||
* style system.
|
|
||||||
*/
|
|
||||||
bool IsStyledByServo() const { return false; }
|
|
||||||
|
|
||||||
bool IsDirtyForServo() const
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(IsStyledByServo());
|
|
||||||
return HasFlag(NODE_IS_DIRTY_FOR_SERVO);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool HasDirtyDescendantsForServo() const
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(IsStyledByServo());
|
|
||||||
return HasFlag(NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SetIsDirtyForServo() {
|
|
||||||
MOZ_ASSERT(IsStyledByServo());
|
|
||||||
SetFlags(NODE_IS_DIRTY_FOR_SERVO);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SetHasDirtyDescendantsForServo() {
|
|
||||||
MOZ_ASSERT(IsStyledByServo());
|
|
||||||
SetFlags(NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SetIsDirtyAndHasDirtyDescendantsForServo() {
|
|
||||||
MOZ_ASSERT(IsStyledByServo());
|
|
||||||
SetFlags(NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO | NODE_IS_DIRTY_FOR_SERVO);
|
|
||||||
}
|
|
||||||
|
|
||||||
void UnsetIsDirtyForServo() {
|
|
||||||
MOZ_ASSERT(IsStyledByServo());
|
|
||||||
UnsetFlags(NODE_IS_DIRTY_FOR_SERVO);
|
|
||||||
}
|
|
||||||
|
|
||||||
void UnsetHasDirtyDescendantsForServo() {
|
|
||||||
MOZ_ASSERT(IsStyledByServo());
|
|
||||||
UnsetFlags(NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO);
|
|
||||||
}
|
|
||||||
|
|
||||||
void UnsetIsDirtyAndHasDirtyDescendantsForServo() {
|
|
||||||
MOZ_ASSERT(IsStyledByServo());
|
|
||||||
UnsetFlags(NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO | NODE_IS_DIRTY_FOR_SERVO);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void UnsetRestyleFlagsIfGecko();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a mutation observer to be notified when this node, or any of its
|
* Adds a mutation observer to be notified when this node, or any of its
|
||||||
|
|
|
||||||
|
|
@ -1417,7 +1417,6 @@ ElementRestyler::ElementRestyler(nsPresContext* aPresContext,
|
||||||
, mLoggingDepth(aRestyleTracker.LoggingDepth() + 1)
|
, mLoggingDepth(aRestyleTracker.LoggingDepth() + 1)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
MOZ_ASSERT_IF(mContent, !mContent->IsStyledByServo());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ElementRestyler::ElementRestyler(const ElementRestyler& aParentRestyler,
|
ElementRestyler::ElementRestyler(const ElementRestyler& aParentRestyler,
|
||||||
|
|
@ -1452,7 +1451,6 @@ ElementRestyler::ElementRestyler(const ElementRestyler& aParentRestyler,
|
||||||
, mLoggingDepth(aParentRestyler.mLoggingDepth + 1)
|
, mLoggingDepth(aParentRestyler.mLoggingDepth + 1)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
MOZ_ASSERT_IF(mContent, !mContent->IsStyledByServo());
|
|
||||||
if (aConstructorFlags & FOR_OUT_OF_FLOW_CHILD) {
|
if (aConstructorFlags & FOR_OUT_OF_FLOW_CHILD) {
|
||||||
// Note that the out-of-flow may not be a geometric descendant of
|
// Note that the out-of-flow may not be a geometric descendant of
|
||||||
// the frame where we started the reresolve. Therefore, even if
|
// the frame where we started the reresolve. Therefore, even if
|
||||||
|
|
@ -1501,7 +1499,6 @@ ElementRestyler::ElementRestyler(ParentContextFromChildFrame,
|
||||||
, mLoggingDepth(aParentRestyler.mLoggingDepth + 1)
|
, mLoggingDepth(aParentRestyler.mLoggingDepth + 1)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
MOZ_ASSERT_IF(mContent, !mContent->IsStyledByServo());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ElementRestyler::ElementRestyler(nsPresContext* aPresContext,
|
ElementRestyler::ElementRestyler(nsPresContext* aPresContext,
|
||||||
|
|
@ -1715,7 +1712,6 @@ ElementRestyler::ConditionallyRestyleChildren(nsIFrame* aFrame,
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(aFrame->GetContent());
|
MOZ_ASSERT(aFrame->GetContent());
|
||||||
MOZ_ASSERT(aFrame->GetContent()->IsElement());
|
MOZ_ASSERT(aFrame->GetContent()->IsElement());
|
||||||
MOZ_ASSERT(!aFrame->GetContent()->IsStyledByServo());
|
|
||||||
|
|
||||||
ConditionallyRestyleUndisplayedDescendants(aFrame, aRestyleRoot);
|
ConditionallyRestyleUndisplayedDescendants(aFrame, aRestyleRoot);
|
||||||
ConditionallyRestyleContentChildren(aFrame, aRestyleRoot);
|
ConditionallyRestyleContentChildren(aFrame, aRestyleRoot);
|
||||||
|
|
@ -1729,7 +1725,6 @@ ElementRestyler::ConditionallyRestyleContentChildren(nsIFrame* aFrame,
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(aFrame->GetContent());
|
MOZ_ASSERT(aFrame->GetContent());
|
||||||
MOZ_ASSERT(aFrame->GetContent()->IsElement());
|
MOZ_ASSERT(aFrame->GetContent()->IsElement());
|
||||||
MOZ_ASSERT(!aFrame->GetContent()->IsStyledByServo());
|
|
||||||
|
|
||||||
if (aFrame->GetContent()->HasFlag(mRestyleTracker.RootBit())) {
|
if (aFrame->GetContent()->HasFlag(mRestyleTracker.RootBit())) {
|
||||||
aRestyleRoot = aFrame->GetContent()->AsElement();
|
aRestyleRoot = aFrame->GetContent()->AsElement();
|
||||||
|
|
@ -1821,7 +1816,6 @@ ElementRestyler::ConditionallyRestyleUndisplayedNodes(
|
||||||
if (aUndisplayedParent &&
|
if (aUndisplayedParent &&
|
||||||
aUndisplayedParent->IsElement() &&
|
aUndisplayedParent->IsElement() &&
|
||||||
aUndisplayedParent->HasFlag(mRestyleTracker.RootBit())) {
|
aUndisplayedParent->HasFlag(mRestyleTracker.RootBit())) {
|
||||||
MOZ_ASSERT(!aUndisplayedParent->IsStyledByServo());
|
|
||||||
aRestyleRoot = aUndisplayedParent->AsElement();
|
aRestyleRoot = aUndisplayedParent->AsElement();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1848,7 +1842,6 @@ void
|
||||||
ElementRestyler::ConditionallyRestyleContentDescendants(Element* aElement,
|
ElementRestyler::ConditionallyRestyleContentDescendants(Element* aElement,
|
||||||
Element* aRestyleRoot)
|
Element* aRestyleRoot)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(!aElement->IsStyledByServo());
|
|
||||||
if (aElement->HasFlag(mRestyleTracker.RootBit())) {
|
if (aElement->HasFlag(mRestyleTracker.RootBit())) {
|
||||||
aRestyleRoot = aElement;
|
aRestyleRoot = aElement;
|
||||||
}
|
}
|
||||||
|
|
@ -1879,7 +1872,6 @@ ElementRestyler::ConditionallyRestyle(nsIFrame* aFrame, Element* aRestyleRoot)
|
||||||
bool
|
bool
|
||||||
ElementRestyler::ConditionallyRestyle(Element* aElement, Element* aRestyleRoot)
|
ElementRestyler::ConditionallyRestyle(Element* aElement, Element* aRestyleRoot)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(!aElement->IsStyledByServo());
|
|
||||||
LOG_RESTYLE("considering element %s for eRestyle_SomeDescendants",
|
LOG_RESTYLE("considering element %s for eRestyle_SomeDescendants",
|
||||||
ElementTagToString(aElement).get());
|
ElementTagToString(aElement).get());
|
||||||
LOG_RESTYLE_INDENT();
|
LOG_RESTYLE_INDENT();
|
||||||
|
|
|
||||||
|
|
@ -166,8 +166,6 @@ RestyleTracker::DoProcessRestyles()
|
||||||
AutoTArray<RefPtr<Element>, RESTYLE_ARRAY_STACKSIZE> laterSiblingArr;
|
AutoTArray<RefPtr<Element>, RESTYLE_ARRAY_STACKSIZE> laterSiblingArr;
|
||||||
for (auto iter = mPendingRestyles.Iter(); !iter.Done(); iter.Next()) {
|
for (auto iter = mPendingRestyles.Iter(); !iter.Done(); iter.Next()) {
|
||||||
auto element = static_cast<dom::Element*>(iter.Key());
|
auto element = static_cast<dom::Element*>(iter.Key());
|
||||||
MOZ_ASSERT(!element->IsStyledByServo(),
|
|
||||||
"Should not have Servo-styled elements here");
|
|
||||||
// Only collect the entries that actually need restyling by us (and
|
// Only collect the entries that actually need restyling by us (and
|
||||||
// haven't, for example, already been restyled).
|
// haven't, for example, already been restyled).
|
||||||
// It's important to not mess with the flags on entries not in our
|
// It's important to not mess with the flags on entries not in our
|
||||||
|
|
@ -180,7 +178,6 @@ RestyleTracker::DoProcessRestyles()
|
||||||
}
|
}
|
||||||
for (uint32_t i = 0; i < laterSiblingArr.Length(); ++i) {
|
for (uint32_t i = 0; i < laterSiblingArr.Length(); ++i) {
|
||||||
Element* element = laterSiblingArr[i];
|
Element* element = laterSiblingArr[i];
|
||||||
MOZ_ASSERT(!element->IsStyledByServo());
|
|
||||||
for (nsIContent* sibling = element->GetNextSibling();
|
for (nsIContent* sibling = element->GetNextSibling();
|
||||||
sibling;
|
sibling;
|
||||||
sibling = sibling->GetNextSibling()) {
|
sibling = sibling->GetNextSibling()) {
|
||||||
|
|
|
||||||
|
|
@ -2442,7 +2442,7 @@ nsCSSFrameConstructor::ConstructDocElementFrame(Element* aDocEle
|
||||||
// this document. Unlike in AddFrameConstructionItems, it's safe to
|
// this document. Unlike in AddFrameConstructionItems, it's safe to
|
||||||
// unset all element restyle flags, since we don't have any
|
// unset all element restyle flags, since we don't have any
|
||||||
// siblings.
|
// siblings.
|
||||||
aDocElement->UnsetRestyleFlagsIfGecko();
|
aDocElement->UnsetRestyleFlags();
|
||||||
|
|
||||||
// --------- CREATE AREA OR BOX FRAME -------
|
// --------- CREATE AREA OR BOX FRAME -------
|
||||||
// FIXME: Should this use ResolveStyleContext? (The calls in this
|
// FIXME: Should this use ResolveStyleContext? (The calls in this
|
||||||
|
|
@ -5585,7 +5585,7 @@ nsCSSFrameConstructor::ShouldCreateItemsForChild(nsFrameConstructorState& aState
|
||||||
nsContainerFrame* aParentFrame)
|
nsContainerFrame* aParentFrame)
|
||||||
{
|
{
|
||||||
aContent->UnsetFlags(NODE_DESCENDANTS_NEED_FRAMES | NODE_NEEDS_FRAME);
|
aContent->UnsetFlags(NODE_DESCENDANTS_NEED_FRAMES | NODE_NEEDS_FRAME);
|
||||||
if (aContent->IsElement() && !aContent->IsStyledByServo()) {
|
if (aContent->IsElement()) {
|
||||||
// We can't just remove our pending restyle flags, since we may
|
// We can't just remove our pending restyle flags, since we may
|
||||||
// have restyle-later-siblings set on us. But we _can_ remove the
|
// have restyle-later-siblings set on us. But we _can_ remove the
|
||||||
// "is possible restyle root" flags, and need to. Otherwise we can
|
// "is possible restyle root" flags, and need to. Otherwise we can
|
||||||
|
|
@ -10504,14 +10504,13 @@ nsCSSFrameConstructor::AddFCItemsForAnonymousContent(
|
||||||
{
|
{
|
||||||
for (uint32_t i = 0; i < aAnonymousItems.Length(); ++i) {
|
for (uint32_t i = 0; i < aAnonymousItems.Length(); ++i) {
|
||||||
nsIContent* content = aAnonymousItems[i].mContent;
|
nsIContent* content = aAnonymousItems[i].mContent;
|
||||||
// Gecko-styled nodes should have no pending restyle flags.
|
|
||||||
MOZ_ASSERT_IF(!content->IsStyledByServo(),
|
|
||||||
!content->IsElement() ||
|
|
||||||
!(content->GetFlags() & ELEMENT_ALL_RESTYLE_FLAGS));
|
|
||||||
// Assert some things about this content
|
// Assert some things about this content
|
||||||
MOZ_ASSERT(!(content->GetFlags() &
|
MOZ_ASSERT(!(content->GetFlags() &
|
||||||
(NODE_DESCENDANTS_NEED_FRAMES | NODE_NEEDS_FRAME)),
|
(NODE_DESCENDANTS_NEED_FRAMES | NODE_NEEDS_FRAME)),
|
||||||
"Should not be marked as needing frames");
|
"Should not be marked as needing frames");
|
||||||
|
MOZ_ASSERT(!content->IsElement() ||
|
||||||
|
!(content->GetFlags() & ELEMENT_ALL_RESTYLE_FLAGS),
|
||||||
|
"Should have no pending restyle flags");
|
||||||
MOZ_ASSERT(!content->GetPrimaryFrame(),
|
MOZ_ASSERT(!content->GetPrimaryFrame(),
|
||||||
"Should have no existing frame");
|
"Should have no existing frame");
|
||||||
MOZ_ASSERT(!content->IsNodeOfType(nsINode::eCOMMENT) &&
|
MOZ_ASSERT(!content->IsNodeOfType(nsINode::eCOMMENT) &&
|
||||||
|
|
@ -10753,7 +10752,7 @@ nsCSSFrameConstructor::ProcessChildren(nsFrameConstructorState& aState,
|
||||||
|
|
||||||
// Frame construction item construction should not post
|
// Frame construction item construction should not post
|
||||||
// restyles, so removing restyle flags here is safe.
|
// restyles, so removing restyle flags here is safe.
|
||||||
child->UnsetRestyleFlagsIfGecko();
|
child->UnsetRestyleFlags();
|
||||||
if (addChildItems) {
|
if (addChildItems) {
|
||||||
AddFrameConstructionItems(aState, child, iter.XBLInvolved(), insertion,
|
AddFrameConstructionItems(aState, child, iter.XBLInvolved(), insertion,
|
||||||
itemsToConstruct);
|
itemsToConstruct);
|
||||||
|
|
@ -11917,7 +11916,7 @@ nsCSSFrameConstructor::BuildInlineChildItems(nsFrameConstructorState& aState,
|
||||||
// restyle root" flags in AddFrameConstructionItems. But note
|
// restyle root" flags in AddFrameConstructionItems. But note
|
||||||
// that we can remove all restyle flags, just like in
|
// that we can remove all restyle flags, just like in
|
||||||
// ProcessChildren and for the same reason.
|
// ProcessChildren and for the same reason.
|
||||||
content->UnsetRestyleFlagsIfGecko();
|
content->UnsetRestyleFlags();
|
||||||
|
|
||||||
RefPtr<nsStyleContext> childContext =
|
RefPtr<nsStyleContext> childContext =
|
||||||
ResolveStyleContext(parentStyleContext, content, &aState);
|
ResolveStyleContext(parentStyleContext, content, &aState);
|
||||||
|
|
|
||||||
|
|
@ -281,7 +281,7 @@ nsHTMLFramesetFrame::Init(nsIContent* aContent,
|
||||||
for (uint32_t i = childX; i < numChildren; i++) {
|
for (uint32_t i = childX; i < numChildren; i++) {
|
||||||
nsIContent *child = mContent->GetChildAt(i);
|
nsIContent *child = mContent->GetChildAt(i);
|
||||||
child->UnsetFlags(NODE_DESCENDANTS_NEED_FRAMES | NODE_NEEDS_FRAME);
|
child->UnsetFlags(NODE_DESCENDANTS_NEED_FRAMES | NODE_NEEDS_FRAME);
|
||||||
child->UnsetRestyleFlagsIfGecko();
|
child->UnsetRestyleFlags();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -289,7 +289,7 @@ nsHTMLFramesetFrame::Init(nsIContent* aContent,
|
||||||
child->UnsetFlags(NODE_DESCENDANTS_NEED_FRAMES | NODE_NEEDS_FRAME);
|
child->UnsetFlags(NODE_DESCENDANTS_NEED_FRAMES | NODE_NEEDS_FRAME);
|
||||||
// Also clear the restyle flags in the child like
|
// Also clear the restyle flags in the child like
|
||||||
// nsCSSFrameConstructor::ProcessChildren does.
|
// nsCSSFrameConstructor::ProcessChildren does.
|
||||||
child->UnsetRestyleFlagsIfGecko();
|
child->UnsetRestyleFlags();
|
||||||
|
|
||||||
// IMPORTANT: This must match the conditions in
|
// IMPORTANT: This must match the conditions in
|
||||||
// nsCSSFrameConstructor::ContentAppended/Inserted/Removed
|
// nsCSSFrameConstructor::ContentAppended/Inserted/Removed
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@
|
||||||
#include "nsWrapperCacheInlines.h"
|
#include "nsWrapperCacheInlines.h"
|
||||||
#include "nsIFrame.h"
|
#include "nsIFrame.h"
|
||||||
#include "ActiveLayerTracker.h"
|
#include "ActiveLayerTracker.h"
|
||||||
#include "ServoDeclarationBlock.h"
|
|
||||||
#include "StyleSetHandle.h"
|
#include "StyleSetHandle.h"
|
||||||
#include "DeclarationBlockInlines.h"
|
#include "DeclarationBlockInlines.h"
|
||||||
|
|
||||||
|
|
@ -134,12 +133,8 @@ nsDOMCSSAttributeDeclaration::GetCSSDeclaration(Operation aOperation)
|
||||||
|
|
||||||
// cannot fail
|
// cannot fail
|
||||||
RefPtr<DeclarationBlock> decl;
|
RefPtr<DeclarationBlock> decl;
|
||||||
if (mElement->IsStyledByServo()) {
|
decl = new css::Declaration();
|
||||||
decl = new ServoDeclarationBlock();
|
decl->AsGecko()->InitializeEmpty();
|
||||||
} else {
|
|
||||||
decl = new css::Declaration();
|
|
||||||
decl->AsGecko()->InitializeEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
// this *can* fail (inside SetAttrAndNotify, at least).
|
// this *can* fail (inside SetAttrAndNotify, at least).
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue