From 5965b731bf5de7aeb7199ff6d5102db85a72e8f2 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Mon, 18 Mar 2002 05:08:23 +0000 Subject: [PATCH] Speed up edge case in RemoveProperty. Bug 131614, r=caillon, sr=jst, a=dbaron --- content/html/style/src/nsDOMCSSAttrDeclaration.cpp | 4 +++- layout/style/nsDOMCSSAttrDeclaration.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/content/html/style/src/nsDOMCSSAttrDeclaration.cpp b/content/html/style/src/nsDOMCSSAttrDeclaration.cpp index aa0f2e2e9625..359e3279836e 100644 --- a/content/html/style/src/nsDOMCSSAttrDeclaration.cpp +++ b/content/html/style/src/nsDOMCSSAttrDeclaration.cpp @@ -50,6 +50,7 @@ #include "nsIURI.h" #include "nsINameSpaceManager.h" #include "nsIHTMLContentContainer.h" +#include "nsStyleConsts.h" MOZ_DECL_CTOR_COUNTER(nsDOMCSSAttributeDeclaration) @@ -85,7 +86,7 @@ nsDOMCSSAttributeDeclaration::RemoveProperty(const nsAReadableString& aPropertyN nsHTMLAtoms::style); } - PRInt32 hint = decl->GetStyleImpact(); + PRInt32 hint = NS_STYLE_HINT_NONE; nsCSSProperty prop = nsCSSProps::LookupProperty(aPropertyName); nsCSSValue val; @@ -96,6 +97,7 @@ nsDOMCSSAttributeDeclaration::RemoveProperty(const nsAReadableString& aPropertyN // We pass in eCSSProperty_UNKNOWN here so that we don't get the // property name in the return string. val.ToString(aReturn, eCSSProperty_UNKNOWN); + hint = nsCSSProps::kHintTable[prop]; } else { // If we tried to remove an invalid property or a property that wasn't // set we simply return success and an empty string diff --git a/layout/style/nsDOMCSSAttrDeclaration.cpp b/layout/style/nsDOMCSSAttrDeclaration.cpp index aa0f2e2e9625..359e3279836e 100644 --- a/layout/style/nsDOMCSSAttrDeclaration.cpp +++ b/layout/style/nsDOMCSSAttrDeclaration.cpp @@ -50,6 +50,7 @@ #include "nsIURI.h" #include "nsINameSpaceManager.h" #include "nsIHTMLContentContainer.h" +#include "nsStyleConsts.h" MOZ_DECL_CTOR_COUNTER(nsDOMCSSAttributeDeclaration) @@ -85,7 +86,7 @@ nsDOMCSSAttributeDeclaration::RemoveProperty(const nsAReadableString& aPropertyN nsHTMLAtoms::style); } - PRInt32 hint = decl->GetStyleImpact(); + PRInt32 hint = NS_STYLE_HINT_NONE; nsCSSProperty prop = nsCSSProps::LookupProperty(aPropertyName); nsCSSValue val; @@ -96,6 +97,7 @@ nsDOMCSSAttributeDeclaration::RemoveProperty(const nsAReadableString& aPropertyN // We pass in eCSSProperty_UNKNOWN here so that we don't get the // property name in the return string. val.ToString(aReturn, eCSSProperty_UNKNOWN); + hint = nsCSSProps::kHintTable[prop]; } else { // If we tried to remove an invalid property or a property that wasn't // set we simply return success and an empty string