mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 21:18:35 +00:00
Avoid nsIStyledContent QI in RuleProcessorData (bug 309927). r+sr=dbaron.
This commit is contained in:
parent
176d660efb
commit
04c16c894f
@ -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