зеркало из https://github.com/mozilla/gecko-dev.git
Fix for 90081, r/sr=waterson,attinasi
This commit is contained in:
Родитель
4ae03235e4
Коммит
1f794f1074
|
@ -548,7 +548,38 @@ nsStyleContext::SetStyle(nsStyleStructID aSID, const nsStyleStruct& aStruct)
|
|||
NS_IMETHODIMP
|
||||
nsStyleContext::RemapStyle(nsIPresContext* aPresContext, PRBool aRecurse)
|
||||
{
|
||||
// XXXdwh This function can probably be eliminated.
|
||||
// First we need to clear out all of our style data.
|
||||
if (mCachedStyleData.mResetData || mCachedStyleData.mInheritedData)
|
||||
mCachedStyleData.Destroy(mBits, aPresContext);
|
||||
|
||||
mBits &= ~NS_STYLE_INHERIT_MASK; // Clear out all data that indicates we should look for
|
||||
// style data in our parent.
|
||||
|
||||
// Now we need to ensure that any cached data along the path from our
|
||||
// rule node back to the root is cleared out.
|
||||
mRuleNode->ClearPath();
|
||||
|
||||
// Now do the same for all of our children, but only if the recurse boolean
|
||||
// is set.
|
||||
if (!aRecurse)
|
||||
return NS_OK;
|
||||
|
||||
if (mChild) {
|
||||
nsStyleContext* child = mChild;
|
||||
do {
|
||||
child->RemapStyle(aPresContext);
|
||||
child = child->mNextSibling;
|
||||
} while (mChild != child);
|
||||
}
|
||||
|
||||
if (mEmptyChild) {
|
||||
nsStyleContext* child = mEmptyChild;
|
||||
do {
|
||||
child->RemapStyle(aPresContext);
|
||||
child = child->mNextSibling;
|
||||
} while (mEmptyChild != child);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -299,6 +299,7 @@ public:
|
|||
|
||||
NS_IMETHOD GetPresContext(nsIPresContext** aResult)=0;
|
||||
|
||||
NS_IMETHOD ClearPath()=0;
|
||||
NS_IMETHOD ClearCachedData(nsIStyleRule* aRule)=0;
|
||||
NS_IMETHOD ClearCachedDataInSubtree(nsIStyleRule* aRule)=0;
|
||||
|
||||
|
|
|
@ -412,6 +412,12 @@ nsRuleNode::GetRule(nsIStyleRule** aResult)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsRuleNode::ClearPath()
|
||||
{
|
||||
return ClearCachedData(mRule);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsRuleNode::ClearCachedData(nsIStyleRule* aRule)
|
||||
{
|
||||
|
|
|
@ -240,6 +240,7 @@ public:
|
|||
NS_IMETHOD GetParent(nsIRuleNode** aResult);
|
||||
NS_IMETHOD IsRoot(PRBool* aResult);
|
||||
NS_IMETHOD GetRule(nsIStyleRule** aResult);
|
||||
NS_IMETHOD ClearPath();
|
||||
NS_IMETHOD ClearCachedData(nsIStyleRule* aRule);
|
||||
NS_IMETHOD ClearCachedDataInSubtree(nsIStyleRule* aRule);
|
||||
NS_IMETHOD GetPresContext(nsIPresContext** aResult);
|
||||
|
|
|
@ -548,7 +548,38 @@ nsStyleContext::SetStyle(nsStyleStructID aSID, const nsStyleStruct& aStruct)
|
|||
NS_IMETHODIMP
|
||||
nsStyleContext::RemapStyle(nsIPresContext* aPresContext, PRBool aRecurse)
|
||||
{
|
||||
// XXXdwh This function can probably be eliminated.
|
||||
// First we need to clear out all of our style data.
|
||||
if (mCachedStyleData.mResetData || mCachedStyleData.mInheritedData)
|
||||
mCachedStyleData.Destroy(mBits, aPresContext);
|
||||
|
||||
mBits &= ~NS_STYLE_INHERIT_MASK; // Clear out all data that indicates we should look for
|
||||
// style data in our parent.
|
||||
|
||||
// Now we need to ensure that any cached data along the path from our
|
||||
// rule node back to the root is cleared out.
|
||||
mRuleNode->ClearPath();
|
||||
|
||||
// Now do the same for all of our children, but only if the recurse boolean
|
||||
// is set.
|
||||
if (!aRecurse)
|
||||
return NS_OK;
|
||||
|
||||
if (mChild) {
|
||||
nsStyleContext* child = mChild;
|
||||
do {
|
||||
child->RemapStyle(aPresContext);
|
||||
child = child->mNextSibling;
|
||||
} while (mChild != child);
|
||||
}
|
||||
|
||||
if (mEmptyChild) {
|
||||
nsStyleContext* child = mEmptyChild;
|
||||
do {
|
||||
child->RemapStyle(aPresContext);
|
||||
child = child->mNextSibling;
|
||||
} while (mEmptyChild != child);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче