Backed out changeset eec3076f3bab (Bug 474655, Warn when nsIDOMCSSStyleDeclaration::GetPropertyCSSValue is called) because we trigger the warning too much ourselves (Bug 475311)
authorL. David Baron <dbaron@dbaron.org>
Wed, 04 Feb 2009 13:22:45 -0800
changeset 24627 674246a64ed25f818e72b1982cc20168502c2988
parent 24089 eec3076f3bab68a031a39a4b01617a3e4c97834b
child 24628 e2a26d16bf06577d5fa235e91d0ed3afd888e188
push idunknown
push userunknown
push dateunknown
bugs474655, 475311
milestone1.9.2a1pre
backs outeec3076f3bab68a031a39a4b01617a3e4c97834b
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
layout/style/nsCSSRules.cpp
layout/style/nsComputedDOMStyle.cpp
layout/style/nsComputedDOMStyle.h
layout/style/nsDOMCSSDeclaration.cpp
layout/style/nsStyleUtil.cpp
layout/style/nsStyleUtil.h
--- a/dom/locales/en-US/chrome/layout/css.properties
+++ b/dom/locales/en-US/chrome/layout/css.properties
@@ -32,18 +32,16 @@
 # the provisions above, a recipient may use your version of this file under
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 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.
 PEDeclSkipped=Skipped to next declaration.
 PEUnknownProperty=Unknown property '%1$S'.
 PEValueParsingError=Error in parsing value for '%1$S'.
 PEExpectEndValue=Expected end of value but found '%1$S'.
 PESkipAtRuleEOF=end of unknown at-rule
--- a/layout/style/nsCSSRules.cpp
+++ b/layout/style/nsCSSRules.cpp
@@ -1665,24 +1665,16 @@ nsCSSFontFaceStyleDecl::GetPropertyValue
   return GetPropertyValue(nsCSSProps::LookupFontDesc(propertyName), aResult);
 }
 
 // nsIDOMCSSValue getPropertyCSSValue (in DOMString propertyName);
 NS_IMETHODIMP
 nsCSSFontFaceStyleDecl::GetPropertyCSSValue(const nsAString & propertyName,
                                             nsIDOMCSSValue **aResult NS_OUTPARAM)
 {
-  nsCOMPtr<nsIURI> 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;
 }
 
 // DOMString removeProperty (in DOMString propertyName) raises (DOMException);
 NS_IMETHODIMP
 nsCSSFontFaceStyleDecl::RemoveProperty(const nsAString & propertyName,
                                        nsAString & aResult NS_OUTPARAM)
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -291,43 +291,31 @@ nsComputedDOMStyle::GetParentRule(nsIDOM
 NS_IMETHODIMP
 nsComputedDOMStyle::GetPropertyValue(const nsAString& aPropertyName,
                                      nsAString& aReturn)
 {
   nsCOMPtr<nsIDOMCSSValue> val;
 
   aReturn.Truncate();
 
-  nsresult rv = GetPropertyCSSValueInternal(aPropertyName, getter_AddRefs(val));
+  nsresult rv = GetPropertyCSSValue(aPropertyName, getter_AddRefs(val));
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (val) {
     rv = val->GetCssText(aReturn);
   }
 
   return rv;
 }
 
 
 NS_IMETHODIMP
 nsComputedDOMStyle::GetPropertyCSSValue(const nsAString& aPropertyName,
                                         nsIDOMCSSValue** aReturn)
 {
-  nsCOMPtr<nsIDocument> 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;
 
   nsCOMPtr<nsIDocument> document = do_QueryReferent(mDocumentWeak);
   NS_ENSURE_TRUE(document, NS_ERROR_NOT_AVAILABLE);
 
   // Flush _before_ getting the presshell, since that could create a new
   // presshell.  Also note that we want to flush the style on the document
--- a/layout/style/nsComputedDOMStyle.h
+++ b/layout/style/nsComputedDOMStyle.h
@@ -71,18 +71,16 @@ public:
   NS_DECL_NSIDOMCSSSTYLEDECLARATION
 
   nsComputedDOMStyle();
   virtual ~nsComputedDOMStyle();
 
   static void Shutdown();
 
 private:
-  nsresult GetPropertyCSSValueInternal(const nsAString& aPropertyName,
-                                       nsIDOMCSSValue** aReturn);
   void FlushPendingReflows();
   
 #define STYLE_STRUCT(name_, checkdata_cb_, ctor_args_)                  \
   const nsStyle##name_ * GetStyle##name_() {                            \
     return mStyleContextHolder->GetStyle##name_();                      \
   }
 #include "nsStyleStructList.h"
 #undef STYLE_STRUCT
--- a/layout/style/nsDOMCSSDeclaration.cpp
+++ b/layout/style/nsDOMCSSDeclaration.cpp
@@ -46,17 +46,16 @@
 #include "nsCSSDeclaration.h"
 #include "nsCSSProps.h"
 #include "nsCOMPtr.h"
 #include "nsIURL.h"
 #include "nsReadableUtils.h"
 #include "nsIPrincipal.h"
 
 #include "nsContentUtils.h"
-#include "nsStyleUtil.h"
 
 
 nsDOMCSSDeclaration::nsDOMCSSDeclaration()
   : mInner(this)
 {
 }
 
 nsDOMCSSDeclaration::~nsDOMCSSDeclaration()
@@ -142,31 +141,16 @@ nsDOMCSSDeclaration::GetLength(PRUint32*
 }
 
 NS_IMETHODIMP
 nsDOMCSSDeclaration::GetPropertyCSSValue(const nsAString& aPropertyName,
                                          nsIDOMCSSValue** aReturn)
 {
   NS_ENSURE_ARG_POINTER(aReturn);
 
-  nsCOMPtr<nsICSSLoader> cssLoader;
-  nsCOMPtr<nsICSSParser> cssParser;
-  nsCOMPtr<nsIURI> baseURI, sheetURI;
-  nsCOMPtr<nsIPrincipal> 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;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMCSSDeclaration::Item(PRUint32 aIndex, nsAString& aReturn)
--- a/layout/style/nsStyleUtil.cpp
+++ b/layout/style/nsStyleUtil.cpp
@@ -46,17 +46,16 @@
 #include "nsIContent.h"
 #include "nsIDocument.h"
 #include "nsINameSpaceManager.h"
 #include "nsIURI.h"
 #include "nsNetUtil.h"
 #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.
 #include "nsRuleNode.h"
 
 nsCachedStyleData::StyleStructInfo
 nsCachedStyleData::gInfo[] = {
 
@@ -602,17 +601,8 @@ nsStyleUtil::IsSignificantChild(nsIConte
     return PR_TRUE;
   }
 
   return aTextIsSignificant && isText && aChild->TextLength() != 0 &&
          (aWhitespaceIsSignificant ||
           !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");
-}
--- a/layout/style/nsStyleUtil.h
+++ b/layout/style/nsStyleUtil.h
@@ -104,14 +104,12 @@ public:
   static float ColorComponentToFloat(PRUint8 aAlpha);
 
   /*
    * Does this child count as significant for selector matching?
    */
   static PRBool IsSignificantChild(nsIContent* aChild,
                                    PRBool aTextIsSignificant,
                                    PRBool aWhitespaceIsSignificant);
-
-  static void ReportUseOfDeprecatedMethod(nsIURI* aURI, const char* aWarning);
 };
 
 
 #endif /* nsStyleUtil_h___ */