Closed Bug 31588 Opened 25 years ago Closed 25 years ago

Clicking on text in named anchor jumps to top of anchor when anchor is not terminated

Categories

(Core :: DOM: HTML Parser, defect, P3)

x86
Windows 98
defect

Tracking

()

VERIFIED DUPLICATE of bug 31594

People

(Reporter: jruderman, Assigned: cmanske)

References

()

Details

Attachments

(1 file)

Steps to reproduce: 1. Go to http://www.freei.net/ffaq.htm 2. Scroll down to the first paragraph below the table of contents 3. Click on some text in the middle of the paragraph Result: Browser jumps up to near the top of the page. Possibly related to Bug 29416.
Attached file Simplified test case
http://www.freei.net/ffaq.htm has an unclosed <a name="top"> tag near the top, and that's what's causing the problem. The paragraphs after the first three are excluded because they're below a table (I have no idea why this excludes them, though).
Changing summary from "Clicking in paragraph below named anchor jumps to top" to "Clicking on text in named anchor jumps to top of anchor".
Summary: Clicking in paragraph below named anchor jumps to top → Clicking on text in named anchor jumps to top of anchor
The editor, interestingly, does include the text under the table as part of the link (which it shows as underlined). The table only stops named anchors (not hrefs) and only in the mozilla browser.
Filed to editor bugs using the same testcase: bug 31592 and bug 31594.
Confirming, nice test case. Changing component to parser. Is this right?
Status: UNCONFIRMED → NEW
Component: Browser-General → Parser
Ever confirmed: true
Anchor should be terminated with </a> to prevent this. Not sure why there's a difference with browser behavior.
Assignee: cbegle → cmanske
Summary: Clicking on text in named anchor jumps to top of anchor → Clicking on text in named anchor jumps to top of anchor when anchor is not terminated
I don't think it's limited to non-terminated <a> tags. Try adding a </a> at the bottom of the test case -- I think the same things happen.
Yes, but my point is that the correct HTML syntax for named anchor should always have </a> immediatley following the <a>. The test case is definitely incorrect. This bug is essentially invalid, but I plan to send it off to layout for the issue that there's a difference in parsing between browser and editor. The parser should automatically "insert" the </a> when it is missing as a "bad HTML fixup".
The fact that it underline text between <a> and </a> (bug 31594) means it is treating this as a link. Thus this behavior is expected. *** This bug has been marked as a duplicate of 31594 ***
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → DUPLICATE
verified dupe
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: