Fix for 104336, deCOMtaminate rulenode, rulewalker, frames, r=dbaron, sr=waterson
This commit is contained in:
@@ -49,7 +49,6 @@
|
||||
#include "nsIHTMLAttributes.h"
|
||||
#include "nsIStyleRule.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsIPresContext.h"
|
||||
#include "nsILinkHandler.h"
|
||||
@@ -102,7 +101,7 @@
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsFormControlHelper.h"
|
||||
#include "nsObjectFrame.h"
|
||||
#include "nsIRuleNode.h"
|
||||
#include "nsRuleNode.h"
|
||||
#include "nsIXULDocument.h"
|
||||
|
||||
static NS_DEFINE_CID(kTextNodeCID, NS_TEXTNODE_CID);
|
||||
@@ -11312,24 +11311,12 @@ nsCSSFrameConstructor::RecreateFramesForContent(nsIPresContext* aPresContext,
|
||||
// data, we need to blow away our style information if this reframe happened as
|
||||
// a result of an inline style attribute changing.
|
||||
if (aInlineStyle) {
|
||||
if (aStyleContext) {
|
||||
nsCOMPtr<nsIRuleNode> ruleNode;
|
||||
aStyleContext->GetRuleNode(getter_AddRefs(ruleNode));
|
||||
ruleNode->ClearCachedData(aInlineStyleRule); // XXXdwh. If we're willing to *really* special case
|
||||
// inline style, we could only invalidate the struct data
|
||||
// that actually changed. For example, if someone changes
|
||||
// style.left, we really only need to blow away cached
|
||||
// data in the position struct.
|
||||
}
|
||||
if (aStyleContext)
|
||||
aStyleContext->ClearCachedDataForRule(aInlineStyleRule);
|
||||
else {
|
||||
// Ok, our only option left is to just crawl the entire rule
|
||||
// tree and blow away the data that way.
|
||||
nsCOMPtr<nsIStyleSet> set;
|
||||
shell->GetStyleSet(getter_AddRefs(set));
|
||||
nsCOMPtr<nsIRuleNode> rootNode;
|
||||
set->GetRuleTree(getter_AddRefs(rootNode));
|
||||
if (rootNode)
|
||||
rootNode->ClearCachedDataInSubtree(aInlineStyleRule);
|
||||
set->ClearCachedDataInRuleTree(aInlineStyleRule);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user