mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Merge backout of changeset eec3076f3bab (Bug 474655, Warn when nsIDOMCSSStyleDeclaration::GetPropertyCSSValue is called) because we trigger the warning too much ourselves (Bug 475311)
This commit is contained in:
commit
668fa595a8
@ -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.
|
||||
|
@ -1670,14 +1670,6 @@ 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;
|
||||
}
|
||||
|
@ -297,7 +297,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) {
|
||||
@ -311,18 +311,6 @@ nsComputedDOMStyle::GetPropertyValue(const nsAString& aPropertyName,
|
||||
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;
|
||||
|
@ -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_) \
|
||||
|
@ -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<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;
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
@ -109,8 +109,6 @@ public:
|
||||
static PRBool IsSignificantChild(nsIContent* aChild,
|
||||
PRBool aTextIsSignificant,
|
||||
PRBool aWhitespaceIsSignificant);
|
||||
|
||||
static void ReportUseOfDeprecatedMethod(nsIURI* aURI, const char* aWarning);
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user