Skip to main content

Bug Tracker

Side navigation

#9980 closed enhancement (fixed)

Opened August 04, 2011 08:33PM UTC

Closed August 04, 2011 10:18PM UTC

Last modified March 17, 2012 08:46PM UTC

We can simplify the attr code by using getAttributeNode for everything in IE6/7

Reported by: timmywil Owned by:
Priority: low Milestone: 1.6.3
Component: attributes Version: 1.6.2
Keywords: Cc:
Blocked by: Blocking:
Description

Right now, the formHook(or the main hook for IE6/7 that uses getAttributeNode) is used in all of the cases that have been found to be absolutely necessary. The problem is, it's a lot of cases. Switching to getAttributeNode for everything in IE6/7 is safe, surprisingly removes the need for jQuery.attrFix completely (except to provide the tabIndex hook to both tabindex and tabIndex), and reduces the number of checks to see if getAttributeNode is needed. In IE6/7, getAttributeNode behaves almost exactly the same way as getAttribute in modern browsers.

Attachments (0)
Change History (5)

Changed August 04, 2011 09:53PM UTC by rwaldron comment:1

Hot damn.

Changed August 04, 2011 10:18PM UTC by timmywil comment:2

resolution: → fixed
status: newclosed

Now using getAttributeNode in all attribute cases in IE6/7, which normalizes attribute behaviors across browsers, is less hacky, and shortens the attribute code. Fixes #9980.

Changeset: 8c2cb49917fc1082abac0a26298b992dcd6a5b6e

Changed August 04, 2011 10:20PM UTC by timmywil comment:3

milestone: None1.6.3

Changed August 04, 2011 10:20PM UTC by timmywil comment:4

component: unfiledattributes
priority: undecidedlow

Changed October 29, 2011 02:29PM UTC by Philip Jägenstedt <philip@foolip.org> comment:5

This commit caused the behavior of .attr('foo') to change for markup like <div foo></div>. Here's what I used to bisect my way here:

<span itemscope></span>

<script>

alert($('span').attr('itemscope') == "" ? 'good' : 'bad');

</script>

This appears to have been fixed in a later release, but I can't see it linked from here.