Remove unneeded SlotForValue calls (since SlotForValue will soon require EnsureMutable has been called). (Bug 522595) r=bzbarsky

This commit is contained in:
L. David Baron 2009-12-11 08:13:19 -08:00
parent b540b44323
commit 703198f766
2 changed files with 8 additions and 3 deletions

View File

@ -148,11 +148,16 @@ public:
void* slot = mData->SlotForValue(aProperty);
NS_ASSERTION(!slot || !mImportantData ||
!mImportantData->SlotForValue(aProperty),
!mImportantData->StorageFor(aProperty),
"Property both important and not?");
return slot;
}
PRBool HasNonImportantValueFor(nsCSSProperty aProperty) const {
NS_ABORT_IF_FALSE(!nsCSSProps::IsShorthand(aProperty), "must be longhand");
return !!mData->StorageFor(aProperty);
}
/**
* Clear the data, in preparation for its replacement with entirely
* new data by a call to |CompressFrom|.

View File

@ -739,8 +739,8 @@ BuildStyleRule(nsCSSProperty aProperty,
doc->GetDocumentURI(), baseURI,
aTargetElement->NodePrincipal(),
declaration, &changed)) ||
// SlotForValue checks whether property parsed w/out CSS parsing errors
!declaration->SlotForValue(propertyToCheck) ||
// check whether property parsed without CSS parsing errors
!declaration->HasNonImportantValueFor(propertyToCheck) ||
NS_FAILED(NS_NewCSSStyleRule(getter_AddRefs(styleRule), nsnull,
declaration))) {
NS_WARNING("failure in BuildStyleRule");