mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 796938 - Switch to GetEntryDocument in GetDocumentCharacterSetForURI. r=smaug
This commit is contained in:
parent
d89ee84121
commit
97a2a1660d
@ -42,15 +42,8 @@ GetDocumentCharacterSetForURI(const nsAString& aHref, nsACString& aCharset)
|
||||
{
|
||||
aCharset.Truncate();
|
||||
|
||||
JSContext *cx = nsContentUtils::GetCurrentJSContext();
|
||||
if (cx) {
|
||||
nsCOMPtr<nsPIDOMWindow> window =
|
||||
do_QueryInterface(nsJSUtils::GetDynamicScriptGlobal(cx));
|
||||
NS_ENSURE_TRUE(window, NS_ERROR_FAILURE);
|
||||
|
||||
if (nsIDocument* doc = window->GetDoc()) {
|
||||
aCharset = doc->GetDocumentCharacterSet();
|
||||
}
|
||||
if (nsIDocument* doc = GetEntryDocument()) {
|
||||
aCharset = doc->GetDocumentCharacterSet();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user