Skip to main content

Bug Tracker

Side navigation

#12072 closed bug (fixed)

Opened July 12, 2012 04:22PM UTC

Closed April 18, 2013 05:51PM UTC

Last modified January 23, 2014 05:46PM UTC

Remove Firefox deprecated nodeValue, getAttributeNode, specified

Reported by: dmethvin Owned by: timmywil
Priority: high Milestone: 1.10/2.0
Component: attributes Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:
Description

Firefox 13 generates a pretty large set of warnings in our attribute unit tests:

Use of getAttributeNode() is deprecated. Use getAttribute() instead.
Use of attributes' nodeValue attribute is deprecated. Use value instead.
Use of document.createAttribute() is deprecated. Use element.setAttribute() instead.
Use of attributes' specified attribute is deprecated. It always returns true.

The fact that .specified is already broken may already be causing some bugs. We should either 1) remove these uses entirely or 2) feature test them so we don't use them in browsers where they're unsupported.

Ideally we'd have a way to do that feature testing without making Firefox blurt something out on the console. People are really sensitive about that, and no amount of reasoning will make them understand that a warning does not equate to an error. See #4774, #7291, #7535, and #10531 for example.

Attachments (0)
Change History (36)

Changed July 12, 2012 04:23PM UTC by dmethvin comment:1

component: unfiledattributes
milestone: None1.9
priority: undecidedhigh
status: newopen

Changed July 12, 2012 07:38PM UTC by dmethvin comment:2

#11397 is a duplicate of this ticket.

Changed August 01, 2012 05:07PM UTC by dmethvin comment:3

#12162 is a duplicate of this ticket.

Changed August 01, 2012 05:09PM UTC by dmethvin comment:4

summary: Remove/avoid deprecated attribute featuresRemove Firefox deprecated nodeValue, getAttributeNode, specified

Changed August 01, 2012 06:24PM UTC by timmywil comment:5

The only codepath in 1.8 that I can find that uses getAttributeNode in Firefox is the propHook for tabIndex. That could use a feature detect.

Changed August 01, 2012 06:28PM UTC by timmywil comment:6

Also, the option valHook uses the attributes property, which is sort of the feature detect itself. However, even with the warning and specified always being true, that valHook will continue working. We could still adjust it if we want.

Changed August 01, 2012 06:29PM UTC by timmywil comment:7

Btw, Neither event.js nor native Sizzle uses the attributes property in FF anymore.

Changed August 01, 2012 07:32PM UTC by dmethvin comment:8

We're using .specified in Sizzle.attr, which according to the Firefox docs always returns true now. The boolHook is using .nodeValue.

Changed August 01, 2012 08:54PM UTC by timmywil comment:9

@dmethvin: Actually, none of that is true.

As far as Sizzle.attr, notice that assertAttributes is true in Firefox so specified would never be used.

For the boolHook, typeof property is always "boolean" in Firefox so it would never get to it.

Changed August 01, 2012 09:04PM UTC by dmethvin comment:10

Hmm, I see what you mean, it shouldn't be reaching those. So I wonder where are all these warnings coming from? I can't rebuild from master atm, so maybe this was for older code. How many warnings are you seeing in Firefox?

Changed August 01, 2012 09:19PM UTC by timmywil comment:11

@dmethvin: As I said, the propHook for tabindex and the valHook for option elements. The latter is the use case for both of the tickets marked as duplicates of this ticket. There may be other cases that I missed, but I'm confident that if we adjust those two cases, we wouldn't see warnings anymore.

Changed September 04, 2012 02:46PM UTC by timmywil comment:12

owner: → timmywil
status: openassigned

Changed December 04, 2012 09:04PM UTC by rhujer@visooal.com comment:13

Experiencing this issue too. Is there any progress in the last three months?

Changed December 19, 2012 11:22PM UTC by jure.mav@gmail.com comment:14

Any progress on this issue?

Changed December 19, 2012 11:37PM UTC by dmethvin comment:15

jure.mav, I don't know. Do you have some code to contribute?

Changed December 25, 2012 03:16AM UTC by KP comment:16

I don't see any of these errors anymore in FF.

Changed January 04, 2013 11:30PM UTC by dmethvin comment:17

These still occur in 1.9pre if "Show JavaScript Warnings" are enabled in Firefox 17.

http://i.imgur.com/ugHiT.png

@timmywil can you take a look?

Changed January 07, 2013 03:26PM UTC by timmywil comment:18

Yea, I need to get on top of this. Will do tomorrow morning.

Changed January 26, 2013 09:44PM UTC by dmethvin comment:19

milestone: 1.91.9.1

@timmywil another ping on this one, sorry. I'd like to get it wrapped up for 1.9.1 if possible.

Changed February 27, 2013 10:32PM UTC by prashant sharma comment:20

@timmywil :- any updates on this one. Sorry to bug you for this bug :)

Changed March 01, 2013 05:53PM UTC by dmethvin comment:21

milestone: 1.9.1None

Changed March 18, 2013 04:15PM UTC by timmywil comment:22

#13612 is a duplicate of this ticket.

Changed March 25, 2013 11:40AM UTC by anonymous comment:23

Any news on that?

Changed March 25, 2013 11:42AM UTC by anonymous comment:24

"''I don't see any of these errors anymore in FF.''" - I don't know how that's possible. I see this error all the time in every version of Firefox I work with. Would be really good if someone have fixed that :)

Changed April 16, 2013 03:01AM UTC by anonymous comment:25

There was no error in FF 19, but in FF 20 it showed up.

Changed April 18, 2013 03:08PM UTC by anonymous comment:26

I'm seeing this error in Firefox 20

Changed April 18, 2013 05:51PM UTC by Timmy Willison comment:27

resolution: → fixed
status: assignedclosed

Remove unnecessary usage of getAttributeNode(). Fixes #12072.

Changeset: 3ef7a9683b95fa334ab75458a531bb263782c748

Changed April 18, 2013 06:02PM UTC by timmywil comment:28

milestone: None1.10/2.0

Changed May 27, 2013 12:35PM UTC by anonymous comment:29

Replying to [comment:28 timmywil]:

I still see this error in Firefox 21, jQuery 2.0.

Changed May 27, 2013 02:47PM UTC by dmethvin comment:30

Try running without any add-ons. If you can repro **without any add-ons** using a page that simply includes jQuery, let us know.

Changed June 24, 2013 03:10PM UTC by anonymous comment:31

Call to .specified near line...

jquery.js - Line: 2271

jQuery.extend({valHooks: {option: {get: function( elem ) {

attributes.value is undefined in Blackberry 4.7 but

uses .value. See #6932

var val = elem.attributes.value;

return !val || val.specified ? elem.value : elem.text;

Changed June 24, 2013 03:15PM UTC by dmethvin comment:32

@anonymous:31, do you have code that runs in Firefox that gets to this line? Can you share it?

Changed June 24, 2013 06:52PM UTC by anonymous comment:33

Replying to [comment:32 dmethvin]:

@anonymous:31, do you have code that runs in Firefox that gets to this line? Can you share it?

Apologies:

I went to put together a minimal test case to reproduce the error...and naturally double checked to make sure I was running the latest versions...and oops Feb.2013...So sorry...I see now the code has been modified in v1.10.1

Changed June 24, 2013 08:43PM UTC by anonymous comment:34

Replying to [comment:33 anonymous]:

Replying to [comment:32 dmethvin]: > @anonymous:31, do you have code that runs in Firefox that gets to this line? Can you share it? Apologies: I went to put together a minimal test case to reproduce the error...and naturally double checked to make sure I was running the latest versions...and oops Feb.2013...So sorry...I see now the code has been modified in v1.10.1

v1.10.1 testing all good now.

Changed January 23, 2014 05:32PM UTC by Erwan Legrand comment:35

I can reproduce this with jQuery-2.0.3 without any add-on: http://jsfiddle.net/NKBRe/1/

(The issue appears to be fixed in 1.10.1, though.)

Changed January 23, 2014 05:46PM UTC by m_gol comment:36

Replying to [comment:35 Erwan Legrand]:

I can reproduce this with jQuery-2.0.3 without any add-on: http://jsfiddle.net/NKBRe/1/ (The issue appears to be fixed in 1.10.1, though.)

Works fine on master: http://jsfiddle.net/NKBRe/3/

Please, always test on https://code.jquery.com/jquery-git2.js before reporting; on jsFiddle you can even choose "jQuery 2.x (edge)" from the list.