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); void* slot = mData->SlotForValue(aProperty);
NS_ASSERTION(!slot || !mImportantData || NS_ASSERTION(!slot || !mImportantData ||
!mImportantData->SlotForValue(aProperty), !mImportantData->StorageFor(aProperty),
"Property both important and not?"); "Property both important and not?");
return slot; 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 * Clear the data, in preparation for its replacement with entirely
* new data by a call to |CompressFrom|. * new data by a call to |CompressFrom|.

View File

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