Closed
Bug 86792
Opened 24 years ago
Closed 24 years ago
Anchors external to the current document using 8-bit characters do not work
Categories
(Core :: Internationalization, defect, P2)
Core
Internationalization
Tracking
()
VERIFIED
FIXED
mozilla0.9.2
People
(Reporter: momoi, Assigned: ftang)
Details
(Keywords: intl, Whiteboard: [PDT+]r=nhotta, sr=jst. need a= since 16:47 6/20, critical for 0.9.2)
Attachments
(5 files)
** Observed with 6/15/2001 Win32 trunk build **
Some Japanese web pages have a link to an anchor
in another document. And that anchor could be using
8-bit characters like Shift)JIS Japanese.
For example,
http://foobar.foo.bar/#??
8-bit anchors do work within the same document.
You can test this either via 2 web pages with a
link referring to an achor on another page.
Or you can try the direct URL to the anchor,
and it will not work, either.
Reporter | ||
Comment 1•24 years ago
|
||
TM to 0.9.2 and priority to P2.
Priority: -- → P2
Target Milestone: --- → mozilla0.9.2
Comment 2•24 years ago
|
||
This was once fixed by bug 58819.
It used to be the anchor was not URL escaped in nsHTMLContentSink.cpp.
But now it's escaped, so I think it would work if it's unescaped.
This could be generic to even ASCII anchors if the anchor contains characters
which need URL escape.
Keywords: intl
Assignee | ||
Comment 3•24 years ago
|
||
according to momoi, this is a very very important bug.
Without this bug fixed, Netscape will lost chance to ship
X,XXX,XXX copy of OEM bundle deal for YYYY company for product ZZZZ.
PDT: I cannot put important marketing information into public bug system.
Ask me and I can tell you what is X,XXXX,XXX , YYYY and ZZZZ.
Change the bug to ALL for platform and ALL for OS
OS: Windows 2000 → All
Hardware: PC → All
Assignee | ||
Comment 4•24 years ago
|
||
>8-bit anchors do work within the same document.
Is this true? I thought that we look at the problem together and conclude it
does work in the same document but does not work if the anchor is refer to a
different .html document.
for inside netscape. I put some test cases under
http://warp/u/ftang/tmp/10_inf/
We cannot attach those test cases into bugzllia since they are 3rd party
copyright html.
Reporter | ||
Comment 5•24 years ago
|
||
>> 8-bit anchors do work within the same document.
> Is this true? I thought that we look at the problem together and conclude it
> does work in the same document but does not work if the anchor is refer to a
> different .html document.
I think you are saying the same thing as I did. Within the same document,
8-bit characters as anchors seem to be working.
Assignee | ||
Comment 6•24 years ago
|
||
Assignee | ||
Comment 7•24 years ago
|
||
Assignee | ||
Comment 8•24 years ago
|
||
ok, I attach one test case here in the attachement.
how to reproduce
1. open part 2 - 06/20/01 00:53
2. click on the 3rd link
expect result-
open one new window
and the page scroll to "A 3"
actaul result-
open one new window and the page stay in the beginning
however, if now you
3. click on the part 2, and click the 4th link
it WILL scrool the the new window to the 4th link
It looks it does NOT work with the first link which open the window.
It seems the non ASCII anchor is working but not working while we mixed with
target set or open new window....
Assignee | ||
Comment 9•24 years ago
|
||
from my simplified test cases it seems the problem only happen while in the
first click to bring up the document in a new named window.
I suspect there are some JavaScript code which open the new window scrow up the
URL
Comment 10•24 years ago
|
||
I tested ASCII anchor name which contains a space (URL escape is also applied to
space).
So HREF to an anchor <a NAME="ccc ccc">, like this <a href="anchor.html#ccc
ccc"> does not work (works with 4.x).
Assignee | ||
Comment 11•24 years ago
|
||
Assignee | ||
Comment 12•24 years ago
|
||
nhotta- did you produce the same fix? :)
internal test case at http://warp/u/ftang/tmp/10_inf
Assignee | ||
Updated•24 years ago
|
Whiteboard: patch ready. need r=
Comment 13•24 years ago
|
||
Frank and Naoki:
I don't know if your fix covered some problem here, just in case:
I created a testcase(see attached file later) which contain Ascii and Japanese
(kanji, hirakana and half-width katakana) anchor name in different html file.
The links in anchor2.html will call the anchors in another file anchor.html:
1. Save the document as shift-jis, inside the same document, it will work fine
no matter ascii or Japanese anchor name.
2. If the files save as iso-8859-1, inside same document, only works when
anchor name is ascii, the non-ascii anchor won't do anything.
3. When links in anchor2.html call anchors in anchor.html, only ascii anchor
works fine, all other Japanese anchor will go to the beginning of the
anchor.html page.
Comment 14•24 years ago
|
||
Comment 15•24 years ago
|
||
Assignee | ||
Comment 16•24 years ago
|
||
My local build which have the patch fix the case 3 - anchor2.html link to
anchor.html
Not quite sure what do you mean in case 2, save as ISO-8859-1
Comment 17•24 years ago
|
||
r=nhotta
About the allocation of ToNewCString, I see other places in mozilla doing it
differently.
e.g.
nsUnescape(NS_CONST_CAST(char*, filename.get()));
http://lxr.mozilla.org/mozilla/source/netwerk/streamconv/converters/nsIndexedToHTML.cpp#164
Then you could do it something like this.
nsCAutoString unescapedRef(mRef);
nsUnescape(NS_CONST_CAST(char*, unescapedRef.get()));
But that modifies the buffer without updating the length field of the class.
Unescape does not require to increase the buffer size but it causes
inconsistency inside the class.
Reassign to ftang.
Assignee: nhotta → ftang
Updated•24 years ago
|
Whiteboard: patch ready. need r= → patch ready. need sr=
Comment 18•24 years ago
|
||
BTW, the anchor in nsHTMLContentSink.cpp used to be not escaped as I mentioned
before. You might want to check why it was changed and if the other part of
nsHTMLContentSink.cpp can handle unescaped URI then the unescape could be
applied at the assignment to 'mRef'. Or if you want to minimize the impact by
the change then the current way of copy before unescape would be fine.
Assignee | ||
Comment 19•24 years ago
|
||
thanks for the review:
>But that modifies the buffer without updating the length field of the class.
Then I will keep using the current approach.
Status: NEW → ASSIGNED
Whiteboard: patch ready. need sr= → [PDT+]patch ready. need sr=
Assignee | ||
Updated•24 years ago
|
Whiteboard: [PDT+]patch ready. need sr= → [PDT+]patch ready. need sr= from jst 2:17 6/20
Comment 20•24 years ago
|
||
Hmm...there's also a nsXMLContentSink::ScrollToRef. There was some hope that
we'd be able to consolidate the redundant code in the various content sinks, but
that won't happen till sometime in the future. The HTML and XML versions look
considerably different, but probably should be virtually identical.
Comment 21•24 years ago
|
||
The XML content sink actually does the right thing now, as long as the URI we're
loading actually is a URL (i.e. nsIURL) since it calls GetRef() on the URL which
unescapes the ref.
sr=jst for the attached patch.
Assignee | ||
Updated•24 years ago
|
Whiteboard: [PDT+]patch ready. need sr= from jst 2:17 6/20 → [PDT+]r=nhotta, sr=jst. need a=
Assignee | ||
Updated•24 years ago
|
Whiteboard: [PDT+]r=nhotta, sr=jst. need a= → [PDT+]r=nhotta, sr=jst. need a= since 16:47 6/20
Comment 22•24 years ago
|
||
a=chofmann
Assignee | ||
Comment 23•24 years ago
|
||
fix and check in
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Updated•24 years ago
|
Whiteboard: [PDT+]r=nhotta, sr=jst. need a= since 16:47 6/20 → [PDT+]r=nhotta, sr=jst. need a= since 16:47 6/20, critical for 0.9.2
Comment 24•24 years ago
|
||
Switching QA contact to ylong for verification.
QA Contact: andreasb → ylong
Reporter | ||
Comment 25•24 years ago
|
||
Thank you. I looked at this with an afternoon Win32 build from
6/21/2001. The original web pages that had this problem
no longer shows this problem.
Comment 26•24 years ago
|
||
The Sony VAIO menual page works fine now, however anchor still doesn't work very
well so that I filed another bug 87700 for that.
Mark this one as verified.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•