Avoid nsIStyledContent QI in RuleProcessorData (bug 309927). r+sr=dbaron.
git-svn-id: svn://10.0.0.236/trunk@180922 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
39194c7420
commit
525bfb6c80
@ -2684,11 +2684,14 @@ RuleProcessorData::RuleProcessorData(nsPresContext* aPresContext,
|
||||
mPresContext->EventStateManager()->GetContentState(aContent, mEventState);
|
||||
|
||||
// get the styledcontent interface and the ID
|
||||
if (NS_SUCCEEDED(aContent->QueryInterface(NS_GET_IID(nsIStyledContent), (void**)&mStyledContent))) {
|
||||
NS_ASSERTION(mStyledContent, "Succeeded but returned null");
|
||||
if (aContent->IsContentOfType(nsIContent::eELEMENT)) {
|
||||
mStyledContent = NS_STATIC_CAST(nsIStyledContent*, aContent);
|
||||
mContentID = mStyledContent->GetID();
|
||||
}
|
||||
|
||||
NS_ASSERTION(nsCOMPtr<nsIStyledContent>(do_QueryInterface(aContent)) == mStyledContent,
|
||||
"nsIStyledContent must agree with IsContentOfType(eELEMENT)");
|
||||
|
||||
// see if there are attributes for the content
|
||||
mHasAttributes = aContent->GetAttrCount() > 0;
|
||||
|
||||
@ -2734,8 +2737,6 @@ RuleProcessorData::~RuleProcessorData()
|
||||
if (mParentData)
|
||||
mParentData->Destroy(mPresContext);
|
||||
|
||||
NS_IF_RELEASE(mStyledContent);
|
||||
|
||||
delete mLanguage;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user