Closed Bug 299297 Opened 19 years ago Closed 19 years ago

firefox confuses "id" and "name"

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
minor

Tracking

()

VERIFIED INVALID

People

(Reporter: orion2480, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4

Scenario: 

I have a page with an anchor tag with NAME="foo" for use in same page
jumping/linking (neither the source or target anchor have ID's).  

I have another separate element on the page (a table element), which happens to
have the same ID as my anchors NAME.  

So, the link that is supposed to jump down to my ancor "foo" instead jumps to
the table element with ID "foo" (which is further down on the page).  Firefox is
confusing ID's with NAME's.  

Reproducible: Always

Steps to Reproduce:
1. Create link at the top of your page that links to an anchor in the middle of
your page
2. Create an anchor tag in the middle, with NAME="foo"
3. Create table element later in the page with ID="foo"

Actual Results:  
Link jumps to end of page where I have a table element with ID="foo" instead of
to the middle of the page where I have an anchor with NAME="foo".

Expected Results:  
Jumping to middle of the page, not the end.
Probably INVALID

See: http://www.w3.org/TR/html4/struct/links.html#h-12.2.3 , which covers more
or less exactly this situation.

"The id and name attributes share the same name space. This means that they
cannot both define an anchor with the same name in the same document."
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.