Fixed a problem where changes to inline-style were not causing the correct clearing of the style system's cached rules. b=97874 r=pierre sr=hyatt

This commit is contained in:
attinasi%netscape.com 2001-11-29 00:56:43 +00:00
Родитель 3d14ac721e
Коммит 70790d62ab
2 изменённых файлов: 18 добавлений и 12 удалений

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

@ -10146,6 +10146,15 @@ nsCSSFrameConstructor::AttributeChanged(nsIPresContext* aPresContext,
}
}
// first see if we need to manage the style system:
// inlineStyle changes require us to clear out style data associated with the style attribute
if (inlineStyle &&
(reconstruct || reframe || restyle)) {
nsCOMPtr<nsIStyleSet> set;
shell->GetStyleSet(getter_AddRefs(set));
set->ClearStyleData(aPresContext, rule, styleContext);
}
// apply changes
if (primaryFrame && aHint == NS_STYLE_HINT_ATTRCHANGE)
result = primaryFrame->AttributeChanged(aPresContext, aContent, aNameSpaceID, aAttribute, aModType, aHint);
@ -10156,12 +10165,6 @@ nsCSSFrameConstructor::AttributeChanged(nsIPresContext* aPresContext,
result = RecreateFramesForContent(aPresContext, aContent, inlineStyle, rule, styleContext);
}
else if (restyle) {
if (inlineStyle) {
nsCOMPtr<nsIStyleSet> set;
shell->GetStyleSet(getter_AddRefs(set));
set->ClearStyleData(aPresContext, rule, styleContext);
}
// If there is no frame then there is no point in re-styling it,
// is there?
if (primaryFrame) {

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

@ -10146,6 +10146,15 @@ nsCSSFrameConstructor::AttributeChanged(nsIPresContext* aPresContext,
}
}
// first see if we need to manage the style system:
// inlineStyle changes require us to clear out style data associated with the style attribute
if (inlineStyle &&
(reconstruct || reframe || restyle)) {
nsCOMPtr<nsIStyleSet> set;
shell->GetStyleSet(getter_AddRefs(set));
set->ClearStyleData(aPresContext, rule, styleContext);
}
// apply changes
if (primaryFrame && aHint == NS_STYLE_HINT_ATTRCHANGE)
result = primaryFrame->AttributeChanged(aPresContext, aContent, aNameSpaceID, aAttribute, aModType, aHint);
@ -10156,12 +10165,6 @@ nsCSSFrameConstructor::AttributeChanged(nsIPresContext* aPresContext,
result = RecreateFramesForContent(aPresContext, aContent, inlineStyle, rule, styleContext);
}
else if (restyle) {
if (inlineStyle) {
nsCOMPtr<nsIStyleSet> set;
shell->GetStyleSet(getter_AddRefs(set));
set->ClearStyleData(aPresContext, rule, styleContext);
}
// If there is no frame then there is no point in re-styling it,
// is there?
if (primaryFrame) {