If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Anchor name pollutes document name space.

VERIFIED FIXED in mozilla0.9

Status

()

Core
Layout
P3
normal
VERIFIED FIXED
17 years ago
16 years ago

People

(Reporter: bht237, Assigned: jst)

Tracking

({testcase})

Trunk
mozilla0.9
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

17 years ago
While this is not a big deal to work around, finding such a thing can be a damn
nuisance. Some authors have simple links on their pages that go to "top" which
is in fact quite a logical name :)
You add some JavaScript to such a page und you are stuffed :(

The test case fails with "top.test() is not a function"
<HTML>
<HEAD>
<SCRIPT>
function test(){
}//End test()
</SCRIPT>
</HEAD>
<BODY>
<A NAME="top"></A>
<FORM>
<INPUT type=button value="Test" onClick="top.test()">
</FORM>
</BODY></HTML>
(Reporter)

Updated

17 years ago
Keywords: 4xp, testcase

Comment 1

17 years ago
over to HTML Element
Assignee: asa → clayton
Status: UNCONFIRMED → NEW
Component: Browser-General → HTML Element
Ever confirmed: true
QA Contact: doronr → lorca

Comment 2

17 years ago
Created attachment 18091 [details]
Said testcase in a file.

Comment 3

17 years ago
Reporter-
I tried running this testcase on a Mac build 10-24-08 and get no such error.
What date build are you using?
(Reporter)

Comment 4

17 years ago
Reply to Dan Lorca: Fails on 2000102004 on Win95. Will download latest and re-test.
(Reporter)

Comment 5

17 years ago
Reply 2 to Dan Lorca: Fails on 2000102604 on Win95.
Error displays in JavaScript console.
XML/DOM team's turn to triage Clayton's bugs.
Assignee: clayton → jst
(Assignee)

Comment 7

17 years ago
Brendan, is there anything we can do about this? The problem is that 'top' in
the input elements onclick handler resolves to document.top which is the anchor
named 'top' and not to window.top, ideas? Do we need to special case the global
properties in the documents Resolve method, doesn't feel like something I'd
wanna do but is there some other way around this problem?
Status: NEW → ASSIGNED
OS: Windows 95 → All
Hardware: PC → All
jst: no need to try to have your cake and eat it too -- this bug is simply about
a DOM level 0 incompatibility (maybe not with the spec, but certainly with Nav2
thru 4).  The old code,
http://lxr.mozilla.org/classic/source/lib/libmocha/lm_href.c#548, never bound a
named anchor by its NAME attribute's value in document.  It did bind the anchor
by its name and index in document.anchors.  I'm revising the Summary slightly.

/be
Summary: Anchor name pollutes window name space. → Anchor name pollutes document name space.
(Reporter)

Comment 9

17 years ago
I agree. As a JavaScript user, I would not expect to find an anchor by 
document.<anchorName>
(Assignee)

Comment 10

17 years ago
Ok, my bad. The problem is not that document.top resolves to the anchor element,
the problem is in HTMLFormElement::Resolve(), if the name being resolved in a
form isn't found in the form the Resolve() method calls GetElementsByName() on
the document, and that'll find any element with a 'name' attribute that matches
(per the spec). We'd need to call something other than GetElementsByName() on
the document in nsHTMLFormElement::Resolve()...

(Assignee)

Updated

17 years ago
Target Milestone: --- → mozilla0.9
(Assignee)

Comment 11

17 years ago
Setting target milestone to mozilla0.9, this mess needs some cleaning up
(Assignee)

Comment 12

17 years ago
*** Bug 63289 has been marked as a duplicate of this bug. ***
(Assignee)

Comment 13

17 years ago
*** Bug 63752 has been marked as a duplicate of this bug. ***
Reassigning QA Contact for all open and unverified bugs previously under Lorca's
care to Gerardo as per phone conversation this morning.
QA Contact: lorca → gerardok

Comment 15

17 years ago
qa contact updated.
QA Contact: gerardok → bsharma
(Assignee)

Updated

17 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED
(Assignee)

Comment 16

17 years ago
Fix checked in.

Updated

17 years ago
Status: RESOLVED → VERIFIED

Comment 17

17 years ago
Verified on:
build: 2001-04-09-11-Mtrunk
Platform: Win 2000

The page loads fine.
SPAM. HTML Element component deprecated, changing component to Layout. See bug
88132 for details.
Component: HTML Element → Layout
You need to log in before you can comment on or make changes to this bug.