зеркало из https://github.com/mozilla/gecko-dev.git
Bug 923251 - Part a: Make ParseMediaList return void; r=heycam
This commit is contained in:
Родитель
6536e2fa3b
Коммит
5f81e1fd5c
|
@ -1244,22 +1244,18 @@ Loader::PrepareSheet(nsCSSStyleSheet* aSheet,
|
|||
{
|
||||
NS_PRECONDITION(aSheet, "Must have a sheet!");
|
||||
|
||||
nsresult rv;
|
||||
nsRefPtr<nsMediaList> mediaList(aMediaList);
|
||||
|
||||
if (!aMediaString.IsEmpty()) {
|
||||
NS_ASSERTION(!aMediaList,
|
||||
"must not provide both aMediaString and aMediaList");
|
||||
mediaList = new nsMediaList();
|
||||
NS_ENSURE_TRUE(mediaList, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
nsCSSParser mediumParser(this);
|
||||
|
||||
// We have aMediaString only when linked from link elements, style
|
||||
// elements, or PIs, so pass true.
|
||||
rv = mediumParser.ParseMediaList(aMediaString, nullptr, 0, mediaList,
|
||||
true);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
mediumParser.ParseMediaList(aMediaString, nullptr, 0, mediaList, true);
|
||||
}
|
||||
|
||||
aSheet->SetMedia(mediaList);
|
||||
|
|
|
@ -114,11 +114,11 @@ public:
|
|||
bool aIsImportant,
|
||||
bool aIsSVGMode);
|
||||
|
||||
nsresult ParseMediaList(const nsSubstring& aBuffer,
|
||||
nsIURI* aURL, // for error reporting
|
||||
uint32_t aLineNumber, // for error reporting
|
||||
nsMediaList* aMediaList,
|
||||
bool aHTMLMode);
|
||||
void ParseMediaList(const nsSubstring& aBuffer,
|
||||
nsIURI* aURL, // for error reporting
|
||||
uint32_t aLineNumber, // for error reporting
|
||||
nsMediaList* aMediaList,
|
||||
bool aHTMLMode);
|
||||
|
||||
bool ParseColorString(const nsSubstring& aBuffer,
|
||||
nsIURI* aURL, // for error reporting
|
||||
|
@ -1151,7 +1151,7 @@ CSSParserImpl::ParseProperty(const nsCSSProperty aPropID,
|
|||
#pragma optimize( "", on )
|
||||
#endif
|
||||
|
||||
nsresult
|
||||
void
|
||||
CSSParserImpl::ParseMediaList(const nsSubstring& aBuffer,
|
||||
nsIURI* aURI, // for error reporting
|
||||
uint32_t aLineNumber, // for error reporting
|
||||
|
@ -1189,8 +1189,6 @@ CSSParserImpl::ParseMediaList(const nsSubstring& aBuffer,
|
|||
CLEAR_ERROR();
|
||||
ReleaseScanner();
|
||||
mHTMLMediaMode = false;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -11265,14 +11263,14 @@ nsCSSParser::ParseProperty(const nsCSSProperty aPropID,
|
|||
aIsImportant, aIsSVGMode);
|
||||
}
|
||||
|
||||
nsresult
|
||||
void
|
||||
nsCSSParser::ParseMediaList(const nsSubstring& aBuffer,
|
||||
nsIURI* aURI,
|
||||
uint32_t aLineNumber,
|
||||
nsMediaList* aMediaList,
|
||||
bool aHTMLMode)
|
||||
{
|
||||
return static_cast<CSSParserImpl*>(mImpl)->
|
||||
static_cast<CSSParserImpl*>(mImpl)->
|
||||
ParseMediaList(aBuffer, aURI, aLineNumber, aMediaList, aHTMLMode);
|
||||
}
|
||||
|
||||
|
|
|
@ -134,11 +134,11 @@ public:
|
|||
* parentheses and strings more important than commas. |aURL| and
|
||||
* |aLineNumber| are used for error reporting.
|
||||
*/
|
||||
nsresult ParseMediaList(const nsSubstring& aBuffer,
|
||||
nsIURI* aURL,
|
||||
uint32_t aLineNumber,
|
||||
nsMediaList* aMediaList,
|
||||
bool aHTMLMode);
|
||||
void ParseMediaList(const nsSubstring& aBuffer,
|
||||
nsIURI* aURL,
|
||||
uint32_t aLineNumber,
|
||||
nsMediaList* aMediaList,
|
||||
bool aHTMLMode);
|
||||
|
||||
/**
|
||||
* Parse aBuffer into a nsCSSValue |aValue|. Will return false
|
||||
|
|
|
@ -534,8 +534,8 @@ nsMediaList::SetText(const nsAString& aMediaText)
|
|||
|
||||
bool htmlMode = mStyleSheet && mStyleSheet->GetOwnerNode();
|
||||
|
||||
return parser.ParseMediaList(aMediaText, nullptr, 0,
|
||||
this, htmlMode);
|
||||
parser.ParseMediaList(aMediaText, nullptr, 0, this, htmlMode);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
Загрузка…
Ссылка в новой задаче