mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 582712 - Remove nsHTMLDocument::TryBookmarkCharset; r=bz a=bsmedberg
This commit is contained in:
parent
994a73d975
commit
f4cdfb893f
@ -467,48 +467,6 @@ nsHTMLDocument::TryCacheCharset(nsICachingChannel* aCachingChannel,
|
|||||||
return PR_FALSE;
|
return PR_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
PRBool
|
|
||||||
nsHTMLDocument::TryBookmarkCharset(nsIDocShell* aDocShell,
|
|
||||||
nsIChannel* aChannel,
|
|
||||||
PRInt32& aCharsetSource,
|
|
||||||
nsACString& aCharset)
|
|
||||||
{
|
|
||||||
if (kCharsetFromBookmarks <= aCharsetSource) {
|
|
||||||
return PR_TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!aChannel) {
|
|
||||||
return PR_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
nsCOMPtr<nsICharsetResolver> bookmarksResolver =
|
|
||||||
do_GetService("@mozilla.org/embeddor.implemented/bookmark-charset-resolver;1");
|
|
||||||
|
|
||||||
if (!bookmarksResolver) {
|
|
||||||
return PR_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
PRBool wantCharset; // ignored for now
|
|
||||||
nsCAutoString charset;
|
|
||||||
nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(aDocShell));
|
|
||||||
nsCOMPtr<nsISupports> closure;
|
|
||||||
nsresult rv = bookmarksResolver->RequestCharset(webNav,
|
|
||||||
aChannel,
|
|
||||||
&wantCharset,
|
|
||||||
getter_AddRefs(closure),
|
|
||||||
charset);
|
|
||||||
// FIXME: Bug 337970
|
|
||||||
NS_ASSERTION(!wantCharset, "resolved charset notification not implemented!");
|
|
||||||
|
|
||||||
if (NS_SUCCEEDED(rv) && !charset.IsEmpty()) {
|
|
||||||
aCharset = charset;
|
|
||||||
aCharsetSource = kCharsetFromBookmarks;
|
|
||||||
return PR_TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return PR_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static PRBool
|
static PRBool
|
||||||
CheckSameOrigin(nsINode* aNode1, nsINode* aNode2)
|
CheckSameOrigin(nsINode* aNode1, nsINode* aNode2)
|
||||||
{
|
{
|
||||||
@ -880,10 +838,6 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
|
|||||||
// Use the channel's charset (e.g., charset from HTTP
|
// Use the channel's charset (e.g., charset from HTTP
|
||||||
// "Content-Type" header).
|
// "Content-Type" header).
|
||||||
}
|
}
|
||||||
else if (!scheme.EqualsLiteral("about") && // don't try to access bookmarks for about:blank
|
|
||||||
TryBookmarkCharset(docShell, aChannel, charsetSource, charset)) {
|
|
||||||
// Use the bookmark's charset.
|
|
||||||
}
|
|
||||||
else if (cachingChan && !urlSpec.IsEmpty() &&
|
else if (cachingChan && !urlSpec.IsEmpty() &&
|
||||||
TryCacheCharset(cachingChan, charsetSource, charset)) {
|
TryCacheCharset(cachingChan, charsetSource, charset)) {
|
||||||
// Use the cache's charset.
|
// Use the cache's charset.
|
||||||
|
@ -309,10 +309,6 @@ protected:
|
|||||||
static PRBool TryCacheCharset(nsICachingChannel* aCachingChannel,
|
static PRBool TryCacheCharset(nsICachingChannel* aCachingChannel,
|
||||||
PRInt32& aCharsetSource,
|
PRInt32& aCharsetSource,
|
||||||
nsACString& aCharset);
|
nsACString& aCharset);
|
||||||
static PRBool TryBookmarkCharset(nsIDocShell* aDocShell,
|
|
||||||
nsIChannel* aChannel,
|
|
||||||
PRInt32& aCharsetSource,
|
|
||||||
nsACString& aCharset);
|
|
||||||
// aParentDocument could be null.
|
// aParentDocument could be null.
|
||||||
PRBool TryParentCharset(nsIDocumentCharsetInfo* aDocInfo,
|
PRBool TryParentCharset(nsIDocumentCharsetInfo* aDocInfo,
|
||||||
nsIDocument* aParentDocument,
|
nsIDocument* aParentDocument,
|
||||||
|
@ -94,18 +94,17 @@ enum eParserDocType {
|
|||||||
#define kCharsetFromDocTypeDefault 3
|
#define kCharsetFromDocTypeDefault 3
|
||||||
#define kCharsetFromCache 4
|
#define kCharsetFromCache 4
|
||||||
#define kCharsetFromParentFrame 5
|
#define kCharsetFromParentFrame 5
|
||||||
#define kCharsetFromBookmarks 6
|
#define kCharsetFromAutoDetection 6
|
||||||
#define kCharsetFromAutoDetection 7
|
#define kCharsetFromHintPrevDoc 7
|
||||||
#define kCharsetFromHintPrevDoc 8
|
#define kCharsetFromMetaPrescan 8 // this one and smaller: HTML5 Tentative
|
||||||
#define kCharsetFromMetaPrescan 9 // this one and smaller: HTML5 Tentative
|
#define kCharsetFromMetaTag 9 // this one and greater: HTML5 Confident
|
||||||
#define kCharsetFromMetaTag 10 // this one and greater: HTML5 Confident
|
#define kCharsetFromByteOrderMark 10
|
||||||
#define kCharsetFromByteOrderMark 11
|
#define kCharsetFromChannel 11
|
||||||
#define kCharsetFromChannel 12
|
#define kCharsetFromOtherComponent 12
|
||||||
#define kCharsetFromOtherComponent 13
|
|
||||||
// Levels below here will be forced onto childframes too
|
// Levels below here will be forced onto childframes too
|
||||||
#define kCharsetFromParentForced 14
|
#define kCharsetFromParentForced 13
|
||||||
#define kCharsetFromUserForced 15
|
#define kCharsetFromUserForced 14
|
||||||
#define kCharsetFromPreviousLoading 16
|
#define kCharsetFromPreviousLoading 15
|
||||||
|
|
||||||
enum eStreamState {eNone,eOnStart,eOnDataAvail,eOnStop};
|
enum eStreamState {eNone,eOnStart,eOnDataAvail,eOnStop};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user