Speed up edge case in RemoveProperty. Bug 131614, r=caillon, sr=jst,

a=dbaron
This commit is contained in:
bzbarsky%mit.edu 2002-03-18 05:08:23 +00:00
parent 4e709fd3f6
commit 5965b731bf
2 changed files with 6 additions and 2 deletions

View File

@ -50,6 +50,7 @@
#include "nsIURI.h" #include "nsIURI.h"
#include "nsINameSpaceManager.h" #include "nsINameSpaceManager.h"
#include "nsIHTMLContentContainer.h" #include "nsIHTMLContentContainer.h"
#include "nsStyleConsts.h"
MOZ_DECL_CTOR_COUNTER(nsDOMCSSAttributeDeclaration) MOZ_DECL_CTOR_COUNTER(nsDOMCSSAttributeDeclaration)
@ -85,7 +86,7 @@ nsDOMCSSAttributeDeclaration::RemoveProperty(const nsAReadableString& aPropertyN
nsHTMLAtoms::style); nsHTMLAtoms::style);
} }
PRInt32 hint = decl->GetStyleImpact(); PRInt32 hint = NS_STYLE_HINT_NONE;
nsCSSProperty prop = nsCSSProps::LookupProperty(aPropertyName); nsCSSProperty prop = nsCSSProps::LookupProperty(aPropertyName);
nsCSSValue val; nsCSSValue val;
@ -96,6 +97,7 @@ nsDOMCSSAttributeDeclaration::RemoveProperty(const nsAReadableString& aPropertyN
// We pass in eCSSProperty_UNKNOWN here so that we don't get the // We pass in eCSSProperty_UNKNOWN here so that we don't get the
// property name in the return string. // property name in the return string.
val.ToString(aReturn, eCSSProperty_UNKNOWN); val.ToString(aReturn, eCSSProperty_UNKNOWN);
hint = nsCSSProps::kHintTable[prop];
} else { } else {
// If we tried to remove an invalid property or a property that wasn't // If we tried to remove an invalid property or a property that wasn't
// set we simply return success and an empty string // set we simply return success and an empty string

View File

@ -50,6 +50,7 @@
#include "nsIURI.h" #include "nsIURI.h"
#include "nsINameSpaceManager.h" #include "nsINameSpaceManager.h"
#include "nsIHTMLContentContainer.h" #include "nsIHTMLContentContainer.h"
#include "nsStyleConsts.h"
MOZ_DECL_CTOR_COUNTER(nsDOMCSSAttributeDeclaration) MOZ_DECL_CTOR_COUNTER(nsDOMCSSAttributeDeclaration)
@ -85,7 +86,7 @@ nsDOMCSSAttributeDeclaration::RemoveProperty(const nsAReadableString& aPropertyN
nsHTMLAtoms::style); nsHTMLAtoms::style);
} }
PRInt32 hint = decl->GetStyleImpact(); PRInt32 hint = NS_STYLE_HINT_NONE;
nsCSSProperty prop = nsCSSProps::LookupProperty(aPropertyName); nsCSSProperty prop = nsCSSProps::LookupProperty(aPropertyName);
nsCSSValue val; nsCSSValue val;
@ -96,6 +97,7 @@ nsDOMCSSAttributeDeclaration::RemoveProperty(const nsAReadableString& aPropertyN
// We pass in eCSSProperty_UNKNOWN here so that we don't get the // We pass in eCSSProperty_UNKNOWN here so that we don't get the
// property name in the return string. // property name in the return string.
val.ToString(aReturn, eCSSProperty_UNKNOWN); val.ToString(aReturn, eCSSProperty_UNKNOWN);
hint = nsCSSProps::kHintTable[prop];
} else { } else {
// If we tried to remove an invalid property or a property that wasn't // If we tried to remove an invalid property or a property that wasn't
// set we simply return success and an empty string // set we simply return success and an empty string