mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Scrolling to some anchors broken (charset issues). Bug 190886,
r+sr=dbaron, a=asa
This commit is contained in:
parent
fc9d7d0b38
commit
eb44a4ba46
@ -5707,7 +5707,14 @@ nsDocShell::ScrollIfAnchor(nsIURI * aURI, PRBool * aWasAnchor, PRUint32 aLoadTyp
|
||||
|
||||
// We try the UTF-8 string first, and then try the
|
||||
// document's charset (see below).
|
||||
rv = shell->GoToAnchor(NS_ConvertUTF8toUCS2(str), scroll);
|
||||
// If the string is not UTF-8, conversion will fail and give us
|
||||
// an empty Unicode string. In that case, we should just fall
|
||||
// through to using the page's charset.
|
||||
rv = NS_ERROR_FAILURE;
|
||||
NS_ConvertUTF8toUCS2 uStr(str);
|
||||
if (!uStr.IsEmpty()) {
|
||||
rv = shell->GoToAnchor(NS_ConvertUTF8toUCS2(str), scroll);
|
||||
}
|
||||
nsMemory::Free(str);
|
||||
|
||||
// Above will fail if the anchor name is not UTF-8.
|
||||
|
Loading…
Reference in New Issue
Block a user