Bug 158230. Clear out all the relevant style data when inline style

causes reframes.  r=dbaron, sr=hyatt, a=asa
This commit is contained in:
bzbarsky%mit.edu 2002-07-23 23:18:26 +00:00
parent b16d9bed18
commit b05829e57c
2 changed files with 10 additions and 18 deletions

View File

@ -12208,16 +12208,12 @@ nsCSSFrameConstructor::RecreateFramesForContent(nsIPresContext* aPresContext,
// Now that the old frame is gone (and has stopped depending on obsolete style
// data), we need to blow away our style information if this reframe happened as
// a result of an inline style attribute changing.
// XXXldb Why does this look different from the code in
// |AttributeChanged|?
if (aInlineStyle) {
if (aStyleContext)
aStyleContext->ClearCachedDataForRule(aInlineStyleRule);
else {
nsCOMPtr<nsIStyleSet> set;
shell->GetStyleSet(getter_AddRefs(set));
set->ClearCachedDataInRuleTree(aInlineStyleRule);
}
nsCOMPtr<nsIStyleSet> set;
shell->GetStyleSet(getter_AddRefs(set));
// XXXldb If |aStyleContext| is null, wouldn't it be faster to pass
// in something to tell it that this change is for inline style?
set->ClearStyleData(aPresContext, aInlineStyleRule, aStyleContext);
}
if (NS_SUCCEEDED(rv)) {

View File

@ -12208,16 +12208,12 @@ nsCSSFrameConstructor::RecreateFramesForContent(nsIPresContext* aPresContext,
// Now that the old frame is gone (and has stopped depending on obsolete style
// data), we need to blow away our style information if this reframe happened as
// a result of an inline style attribute changing.
// XXXldb Why does this look different from the code in
// |AttributeChanged|?
if (aInlineStyle) {
if (aStyleContext)
aStyleContext->ClearCachedDataForRule(aInlineStyleRule);
else {
nsCOMPtr<nsIStyleSet> set;
shell->GetStyleSet(getter_AddRefs(set));
set->ClearCachedDataInRuleTree(aInlineStyleRule);
}
nsCOMPtr<nsIStyleSet> set;
shell->GetStyleSet(getter_AddRefs(set));
// XXXldb If |aStyleContext| is null, wouldn't it be faster to pass
// in something to tell it that this change is for inline style?
set->ClearStyleData(aPresContext, aInlineStyleRule, aStyleContext);
}
if (NS_SUCCEEDED(rv)) {