Side navigation
#14633 closed bug (migrated)
Opened December 12, 2013 08:03PM UTC
Closed October 21, 2014 12:28AM UTC
removeAttr("selected") should not set property to false
Reported by: | wchen@mozilla.com | Owned by: | timmywil |
---|---|---|---|
Priority: | low | Milestone: | 1.12/2.2 |
Component: | attributes | Version: | 2.0.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
In Firefox the selected value is 1. In Chrome the selected value is 2.
removeAttr has special handing for boolean attributes to set the corresponding DOM property to false: https://github.com/jquery/jquery/blob/master/src/attributes/attr.js#L86
Removing an attribute and setting the DOM property to false are very different. In this case, as specified (http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#dom-option-selected), setting the property to false means setting the dirtiness to true. This changes how the option should react to "selected" attribute changes. In the test case, it means that adding the "selected" attribute at the end should not select the option.
Firefox respects the specified behaviour and does not select the second option.
Attachments (0)
Change History (5)
Changed December 23, 2013 11:21PM UTC by comment:1
milestone: | None → 1.12/2.2 |
---|---|
status: | new → open |
Changed January 23, 2014 04:54PM UTC by comment:2
component: | unfiled → attributes |
---|
Changed June 30, 2014 04:14PM UTC by comment:3
owner: | → timmywil |
---|---|
status: | open → assigned |
Changed October 06, 2014 09:12PM UTC by comment:4
priority: | undecided → low |
---|
Changed October 21, 2014 12:28AM UTC by comment:5
resolution: | → migrated |
---|---|
status: | assigned → closed |
Migrated to https://github.com/jquery/jquery/issues/1759
I agree this is the right thing to do, but perhaps not the compatible thing. Let's kick this can down the road for now.