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

getAttribute is case sensitive in HTML

VERIFIED FIXED in M18

Status

()

Core
DOM: Core & HTML
P3
critical
VERIFIED FIXED
17 years ago
17 years ago

People

(Reporter: Chanah Stern, Assigned: jst)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [nsbeta3+])

(Reporter)

Description

17 years ago
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; m17) Gecko/20000807
BuildID:    2000080712



Reproducible: Always
Steps to Reproduce:
1.Create an HTML Element with a user defined attribute that contains a capital
letter
2.create an alert that will show the user the value of the above attribute
3.notice the alert contains an empty string

Expected Results:  should have shown the value of the attribute
*Please note* I installed MileStone 15 and this bug did NOT exist back then.

<!-- the following code demonstrates the problem I am having in both windows NT
and windows 95 -->

<html>
<head>
<script>
function testGetAttributeWithCaps()
{
alert("lower case attribute: " +

document.forms[0].elements["Test_Lower_Element"].getAttribute("lowerattribute"));

    alert("CAPTIAL CASE ATTRIBUTE: " +

document.forms[0].elements["Test_Capital_Element"].getAttribute("Capitalattribute"));



}
</script>

</head>
<body onload=testGetAttributeWithCaps()>
<form>
<!-- doesn't work -->
<input type=select name="Test_Capital_Element" Capitalattribute="doesn't work">
<!-- works -->
<input type=select name="Test_Lower_Element" lowerattribute="worked">

</form>
</body>
</html>

Comment 1

17 years ago
All bugs must have summaries.
Summary: NONE: see HTML inserted below → User defined element attributes not shown in alert box
(Assignee)

Comment 2

17 years ago
The problem is that getAttribute() only works in HTML if the attribute name is
given as lowercase (sigh!), thanks for catching this problem!

This is bad, really bad, must have for beta3.
Severity: major → critical
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Keywords: correctness, nsbeta3
OS: Windows NT → All
Hardware: PC → All
Summary: User defined element attributes not shown in alert box → getAttribute is case sensitive in HTML
Target Milestone: --- → Future

Comment 3

17 years ago
Not sure why this is futured, given jst's comment that this is a bad 
bug.  Changing milestone to M18 and marking nsbeta3+.
Whiteboard: [nsbeta3+]
Target Milestone: Future → M18
(Assignee)

Comment 4

17 years ago
Oops, my bad! Thanks for catching that Nisheeth.
(Assignee)

Comment 5

17 years ago
Fixed.
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED

Comment 6

17 years ago
Verified with 2000-09-13-09.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.