bug 272815: Make sure the parser is aware when we encounter a meta tag, so that other meta tags in the document don't override the first (correct) charset. r=bzbarsky sr=jst
git-svn-id: svn://10.0.0.236/trunk@169635 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
2836199f0b
commit
b0eca57bf6
@ -307,6 +307,9 @@ NS_IMETHODIMP nsMetaCharsetObserver::Notify(
|
||||
}
|
||||
} // if(NS_SUCCEEDED(res)
|
||||
}
|
||||
}
|
||||
else {
|
||||
res = NS_HTMLPARSER_VALID_META_CHARSET;
|
||||
} // if EqualIgnoreCase
|
||||
} // if !newCharset.IsEmpty()
|
||||
} // if
|
||||
|
||||
@ -86,5 +86,8 @@ public:
|
||||
|
||||
};
|
||||
|
||||
#define NS_HTMLPARSER_VALID_META_CHARSET NS_ERROR_GENERATE_SUCCESS( \
|
||||
NS_ERROR_MODULE_HTMLPARSER,3000)
|
||||
|
||||
#endif /* nsIElementObserver_h__ */
|
||||
|
||||
|
||||
@ -1575,6 +1575,13 @@ nsObserverEntry::Notify(nsIParserNode* aNode,
|
||||
if (NS_FAILED(result)) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (result == NS_HTMLPARSER_VALID_META_CHARSET) {
|
||||
// Inform the parser that this meta tag contained a valid
|
||||
// charset. See bug 272815
|
||||
aParser->SetDocumentCharset(charset, kCharsetFromMetaTag);
|
||||
result = NS_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user