Closed Bug 4824 Opened 26 years ago Closed 26 years ago

clicking on some anchors will crash apprunner and viewer

Categories

(Core :: Layout, defect, P3)

All
Linux
defect

Tracking

()

VERIFIED INVALID

People

(Reporter: rusty.lynch, Assigned: troy)

References

()

Details

When some anchors are clicked on using either apprunner or viewer, the browser crashes. For an example try some of the anchors on http://www.aracnet.com/~rtlynch/Margins.htm. So for this bug has been seen on linux, solaris, and win-98 builds. I was able to track the bug down to PresShell::GoToAnchor. The abort happens due to a "rv = element->QueryInterface(KIContentIID, getter_AddRefs(content))" call where element is null. The reason this call was tried is that a few lines up there is a "rv = htmlDoc->GetElementById(aAnchorName, getter_AddRefs (element))" call that returns zero even when it fails.
Assignee: don → troy
Component: Apprunner → Layout
Status: NEW → ASSIGNED
Target Milestone: M4
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Fixed. Added NULL pointer checks to GoToAnchor()
QA Contact: 3853 → 4144
QA Contact: 4144 → 4110
Status: RESOLVED → VERIFIED
Using 4/9 build on Win 95, Win NT, Win 98, Mac8.5 and Linux. Loaded page and clicked on each anchor. No crashes. Tested in Apprunner (Viewer.exe is in separate app now). Verifying bug fixed.
Severity: critical → minor
Status: VERIFIED → REOPENED
The null check for element before trying to use element does prevent crashing, but the anchor links still do not work. ( now clicking on one of the effected anchor links just returns with no action. ) There is still the underlying problem of htmlDoc->GetElementById(aAnchorName, getter_AddRefs(element)) returning zero even when the operation was unsuccessfull. From what I can see, it looks like this condition occures when there is a large amount of text between the anchor and the link to the anchor.
Status: REOPENED → RESOLVED
Closed: 26 years ago26 years ago
Resolution: FIXED → INVALID
This really should have been a separate bug, because it describes a different problem. The reason clicking on the links doesn't work is that the anchor name has a '#' in front of it: <STRONG><A name="#TopMargin">Top Margin</A><br></STRONG> The '#' is a separator character used in a fragment identifier. The anchor identifier is the part _after_ the '#' character. The "name" attribute specifies the unique anchor name. Therefore, the link is specifying the anchor identifier as "TopMargin", but the anchor name is "#TopMargin" and so they don't match. Note that the links don't work in Communicator either. They do work in IE, presumably because IE is ignoring the '#' in the "name" attribute. They should not be doing that. See chapter 12 of the HTML4 spec for more details: http://www.w3.org/TR/REC-html40/struct/links.html
Status: RESOLVED → VERIFIED
Verifying bug INVALID
You need to log in before you can comment on or make changes to this bug.