mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1180120 - Part 1: Record on style contexts that reset style is explicitly inherited. r=dbaron
This commit is contained in:
parent
b9c4097e25
commit
188f43bf45
@ -2754,6 +2754,14 @@ nsRuleNode::SetDefaultOnRoot(const nsStyleStructID aSID, nsStyleContext* aContex
|
|||||||
/* We can't be cached in the rule node. We have to be put right */ \
|
/* We can't be cached in the rule node. We have to be put right */ \
|
||||||
/* on the style context. */ \
|
/* on the style context. */ \
|
||||||
aContext->SetStyle(eStyleStruct_##type_, data_); \
|
aContext->SetStyle(eStyleStruct_##type_, data_); \
|
||||||
|
if (aContext->GetParent()) { \
|
||||||
|
/* This is pessimistic; we could be uncacheable because we had a */ \
|
||||||
|
/* relative font-weight, for example, which does not need to defeat */ \
|
||||||
|
/* the restyle optimizations in RestyleManager.cpp that look at */ \
|
||||||
|
/* NS_STYLE_HAS_CHILD_THAT_USES_RESET_STYLE. */ \
|
||||||
|
aContext->GetParent()-> \
|
||||||
|
AddStyleBit(NS_STYLE_HAS_CHILD_THAT_USES_RESET_STYLE); \
|
||||||
|
} \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
return data_;
|
return data_;
|
||||||
|
@ -316,6 +316,10 @@ nsStyleContext::MoveTo(nsStyleContext* aNewParent)
|
|||||||
|
|
||||||
nsStyleContext* oldParent = mParent;
|
nsStyleContext* oldParent = mParent;
|
||||||
|
|
||||||
|
if (oldParent->HasChildThatUsesResetStyle()) {
|
||||||
|
aNewParent->AddStyleBit(NS_STYLE_HAS_CHILD_THAT_USES_RESET_STYLE);
|
||||||
|
}
|
||||||
|
|
||||||
aNewParent->AddRef();
|
aNewParent->AddRef();
|
||||||
|
|
||||||
mParent->RemoveChild(this);
|
mParent->RemoveChild(this);
|
||||||
|
@ -173,6 +173,9 @@ public:
|
|||||||
bool HasPseudoElementData() const
|
bool HasPseudoElementData() const
|
||||||
{ return !!(mBits & NS_STYLE_HAS_PSEUDO_ELEMENT_DATA); }
|
{ return !!(mBits & NS_STYLE_HAS_PSEUDO_ELEMENT_DATA); }
|
||||||
|
|
||||||
|
bool HasChildThatUsesResetStyle() const
|
||||||
|
{ return mBits & NS_STYLE_HAS_CHILD_THAT_USES_RESET_STYLE; }
|
||||||
|
|
||||||
// Is the only link whose visitedness is allowed to influence the
|
// Is the only link whose visitedness is allowed to influence the
|
||||||
// style of the node this style context is for (which is that element
|
// style of the node this style context is for (which is that element
|
||||||
// or its nearest ancestor that is a link) visited?
|
// or its nearest ancestor that is a link) visited?
|
||||||
|
@ -63,8 +63,10 @@ class imgIContainer;
|
|||||||
#define NS_STYLE_IN_DISPLAY_NONE_SUBTREE 0x100000000
|
#define NS_STYLE_IN_DISPLAY_NONE_SUBTREE 0x100000000
|
||||||
// See nsStyleContext::FindChildWithRules
|
// See nsStyleContext::FindChildWithRules
|
||||||
#define NS_STYLE_INELIGIBLE_FOR_SHARING 0x200000000
|
#define NS_STYLE_INELIGIBLE_FOR_SHARING 0x200000000
|
||||||
|
// See nsStyleContext::HasChildThatUsesResetStyle
|
||||||
|
#define NS_STYLE_HAS_CHILD_THAT_USES_RESET_STYLE 0x400000000
|
||||||
// See nsStyleContext::GetPseudoEnum
|
// See nsStyleContext::GetPseudoEnum
|
||||||
#define NS_STYLE_CONTEXT_TYPE_SHIFT 34
|
#define NS_STYLE_CONTEXT_TYPE_SHIFT 35
|
||||||
|
|
||||||
// Additional bits for nsRuleNode's mDependentBits:
|
// Additional bits for nsRuleNode's mDependentBits:
|
||||||
#define NS_RULE_NODE_IS_ANIMATION_RULE 0x01000000
|
#define NS_RULE_NODE_IS_ANIMATION_RULE 0x01000000
|
||||||
|
Loading…
Reference in New Issue
Block a user