From dbcb511748240b74f9ca966aaa66d0f5982202b2 Mon Sep 17 00:00:00 2001 From: "L. David Baron" Date: Wed, 4 Feb 2009 13:22:45 -0800 Subject: [PATCH] Backed out changeset eec3076f3bab (Bug 474655, Warn when nsIDOMCSSStyleDeclaration::GetPropertyCSSValue is called) because we trigger the warning too much ourselves (Bug 475311) --- dom/locales/en-US/chrome/layout/css.properties | 2 -- layout/style/nsCSSRules.cpp | 8 -------- layout/style/nsComputedDOMStyle.cpp | 14 +------------- layout/style/nsComputedDOMStyle.h | 2 -- layout/style/nsDOMCSSDeclaration.cpp | 16 ---------------- layout/style/nsStyleUtil.cpp | 10 ---------- layout/style/nsStyleUtil.h | 2 -- 7 files changed, 1 insertion(+), 53 deletions(-) diff --git a/dom/locales/en-US/chrome/layout/css.properties b/dom/locales/en-US/chrome/layout/css.properties index a15eeb5d2230..3f3be4760b78 100644 --- a/dom/locales/en-US/chrome/layout/css.properties +++ b/dom/locales/en-US/chrome/layout/css.properties @@ -37,8 +37,6 @@ MimeNotCss=The stylesheet %1$S was not loaded because its MIME type, "%2$S", is not "text/css". MimeNotCssWarn=The stylesheet %1$S was loaded as CSS even though its MIME type, "%2$S", is not "text/css". -UseOfGetPropertyCSSValueWarning=Use of getPropertyCSSValue() is deprecated. To upgrade your code, use getPropertyValue() instead. - PEUnexpEOF2=Unexpected end of file while searching for %1$S. PEParseRuleWSOnly=Whitespace-only string given to be parsed as rule. PEDeclDropped=Declaration dropped. diff --git a/layout/style/nsCSSRules.cpp b/layout/style/nsCSSRules.cpp index 7d001ef66934..1835ec6c88b0 100644 --- a/layout/style/nsCSSRules.cpp +++ b/layout/style/nsCSSRules.cpp @@ -1670,14 +1670,6 @@ NS_IMETHODIMP nsCSSFontFaceStyleDecl::GetPropertyCSSValue(const nsAString & propertyName, nsIDOMCSSValue **aResult NS_OUTPARAM) { - nsCOMPtr sheetURI; - nsIStyleSheet *sheet = ContainingRule()->mSheet; - if (sheet) { - sheet->GetSheetURI(getter_AddRefs(sheetURI)); - } - nsStyleUtil::ReportUseOfDeprecatedMethod(sheetURI, - "UseOfGetPropertyCSSValueWarning"); - // ??? nsDOMCSSDeclaration returns null/NS_OK, but that seems wrong. return NS_ERROR_NOT_IMPLEMENTED; } diff --git a/layout/style/nsComputedDOMStyle.cpp b/layout/style/nsComputedDOMStyle.cpp index a99d1b3fa45d..818e0e2a3f5d 100644 --- a/layout/style/nsComputedDOMStyle.cpp +++ b/layout/style/nsComputedDOMStyle.cpp @@ -296,7 +296,7 @@ nsComputedDOMStyle::GetPropertyValue(const nsAString& aPropertyName, aReturn.Truncate(); - nsresult rv = GetPropertyCSSValueInternal(aPropertyName, getter_AddRefs(val)); + nsresult rv = GetPropertyCSSValue(aPropertyName, getter_AddRefs(val)); NS_ENSURE_SUCCESS(rv, rv); if (val) { @@ -310,18 +310,6 @@ nsComputedDOMStyle::GetPropertyValue(const nsAString& aPropertyName, NS_IMETHODIMP nsComputedDOMStyle::GetPropertyCSSValue(const nsAString& aPropertyName, nsIDOMCSSValue** aReturn) -{ - nsCOMPtr document = do_QueryReferent(mDocumentWeak); - nsStyleUtil:: - ReportUseOfDeprecatedMethod(document ? document->GetDocumentURI() : nsnull, - "UseOfGetPropertyCSSValueWarning"); - - return GetPropertyCSSValueInternal(aPropertyName, aReturn); -} - -nsresult -nsComputedDOMStyle::GetPropertyCSSValueInternal(const nsAString& aPropertyName, - nsIDOMCSSValue** aReturn) { NS_ENSURE_ARG_POINTER(aReturn); *aReturn = nsnull; diff --git a/layout/style/nsComputedDOMStyle.h b/layout/style/nsComputedDOMStyle.h index ef58236f9169..c2d6e1a2f53d 100644 --- a/layout/style/nsComputedDOMStyle.h +++ b/layout/style/nsComputedDOMStyle.h @@ -76,8 +76,6 @@ public: static void Shutdown(); private: - nsresult GetPropertyCSSValueInternal(const nsAString& aPropertyName, - nsIDOMCSSValue** aReturn); void FlushPendingReflows(); #define STYLE_STRUCT(name_, checkdata_cb_, ctor_args_) \ diff --git a/layout/style/nsDOMCSSDeclaration.cpp b/layout/style/nsDOMCSSDeclaration.cpp index d7fd80bb3c6a..3c7da82381e4 100644 --- a/layout/style/nsDOMCSSDeclaration.cpp +++ b/layout/style/nsDOMCSSDeclaration.cpp @@ -51,7 +51,6 @@ #include "nsIPrincipal.h" #include "nsContentUtils.h" -#include "nsStyleUtil.h" nsDOMCSSDeclaration::nsDOMCSSDeclaration() @@ -147,21 +146,6 @@ nsDOMCSSDeclaration::GetPropertyCSSValue(const nsAString& aPropertyName, { NS_ENSURE_ARG_POINTER(aReturn); - nsCOMPtr cssLoader; - nsCOMPtr cssParser; - nsCOMPtr baseURI, sheetURI; - nsCOMPtr sheetPrincipal; - - nsresult result = GetCSSParsingEnvironment(getter_AddRefs(sheetURI), - getter_AddRefs(baseURI), - getter_AddRefs(sheetPrincipal), - getter_AddRefs(cssLoader), - getter_AddRefs(cssParser)); - if (NS_SUCCEEDED(result)) { - nsStyleUtil::ReportUseOfDeprecatedMethod(sheetURI, - "UseOfGetPropertyCSSValueWarning"); - } - // We don't support CSSValue yet so we'll just return null... *aReturn = nsnull; diff --git a/layout/style/nsStyleUtil.cpp b/layout/style/nsStyleUtil.cpp index c0e010bfdd6c..864ce93cee05 100644 --- a/layout/style/nsStyleUtil.cpp +++ b/layout/style/nsStyleUtil.cpp @@ -51,7 +51,6 @@ #include "nsReadableUtils.h" #include "nsContentUtils.h" #include "nsTextFormatter.h" -#include "nsIScriptError.h" // XXX This is here because nsCachedStyleData is accessed outside of // the content module; e.g., by nsCSSFrameConstructor. @@ -607,12 +606,3 @@ nsStyleUtil::IsSignificantChild(nsIContent* aChild, PRBool aTextIsSignificant, !aChild->TextIsOnlyWhitespace()); } -/* static */ void -nsStyleUtil::ReportUseOfDeprecatedMethod(nsIURI* aURI, const char* aWarning) -{ - nsContentUtils::ReportToConsole(nsContentUtils::eCSS_PROPERTIES, - aWarning, nsnull, 0, aURI, - EmptyString(), 0, 0, - nsIScriptError::warningFlag, - "CSS Object Model"); -} diff --git a/layout/style/nsStyleUtil.h b/layout/style/nsStyleUtil.h index aa180dccaa40..b98f4564b837 100644 --- a/layout/style/nsStyleUtil.h +++ b/layout/style/nsStyleUtil.h @@ -109,8 +109,6 @@ public: static PRBool IsSignificantChild(nsIContent* aChild, PRBool aTextIsSignificant, PRBool aWhitespaceIsSignificant); - - static void ReportUseOfDeprecatedMethod(nsIURI* aURI, const char* aWarning); };