Closed
Bug 849661
Opened 12 years ago
Closed 12 years ago
Remove support for Node.hasAttributes()
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
WONTFIX
mozilla22
People
(Reporter: Ms2ger, Assigned: ayg)
References
Details
(Keywords: addon-compat, dev-doc-complete, site-compat)
Attachments
(1 file)
33.32 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
Node.hasAttributes() has been removed from the spec: <http://dom.spec.whatwg.org/#dom-node-hasattributes>. We should try to remove it as well.
Assignee | ||
Comment 1•12 years ago
|
||
Tested already in <http://w3c-test.org/webapps/DOMCore/tests/submissions/Ms2ger/historical.html>.
Assignee: nobody → ayg
Status: NEW → ASSIGNED
Flags: in-testsuite+
Assignee | ||
Comment 2•12 years ago
|
||
We actually use this method in parser/htmlparser/tests/mochitest/parser_datreader.js. Now that .attributes is on Element instead of Node, the correct replacement of node.hasAttributes() is node.attributes && node.attributes.length, right? That's a bit verbose, especially when "node" is the result of a method.
Assignee | ||
Comment 3•12 years ago
|
||
I'm not totally convinced we actually want to do this, especially since .attributes is no longer on Node per spec. But if we do, here's a patch. WebKit seems not to support the method, so probably there's no big compat risk.
https://tbpl.mozilla.org/?tree=Try&rev=f084e2ba16a6
Attachment #727198 -
Flags: review?(bzbarsky)
![]() |
||
Comment 4•12 years ago
|
||
I'm not totally convinced either. Peter? Jonas?
Flags: needinfo?(peterv)
Flags: needinfo?(jonas)
Unless there is compat risk, or there are strong stated use cases, I think we should nuke it from orbit.
Flags: needinfo?(jonas)
![]() |
||
Comment 6•12 years ago
|
||
Comment on attachment 727198 [details] [diff] [review]
Patch
r=me
Attachment #727198 -
Flags: review?(bzbarsky) → review+
Reporter | ||
Comment 7•12 years ago
|
||
Strictly speaking, you should also update the uuids for all subclasses of nsIDOMNode; fortunately, there's a script: <http://people.mozilla.org/~sfink/uploads/update-uuids>.
Reporter | ||
Updated•12 years ago
|
Keywords: addon-compat,
dev-doc-needed
Assignee | ||
Comment 8•12 years ago
|
||
Should I update all the other IIDs as Ms2ger says? I don't think anyone's ever asked me to do that before (maybe I broke some extensions!).
Flags: needinfo?(bzbarsky)
![]() |
||
Comment 9•12 years ago
|
||
> Should I update all the other IIDs as Ms2ger says?
Yes. I keep forgetting about that bit of annoyance. :(
Flags: needinfo?(bzbarsky)
Assignee | ||
Comment 10•12 years ago
|
||
Comment 11•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
Comment 12•12 years ago
|
||
(In reply to Jonas Sicking (:sicking) from comment #5)
> Unless there is compat risk, or there are strong stated use cases, I think
> we should nuke it from orbit.
It's used in <https://developer.mozilla.org/en-US/docs/JXON>, and you've just broken comm-central's JXON code as a result.
![]() |
||
Comment 13•12 years ago
|
||
Can that be fixed using comment 2?
Comment 14•12 years ago
|
||
Probably; I haven't tested it.
Comment 15•12 years ago
|
||
I ported the change suggested in comment 2 and it passed the broken unit tests:
https://hg.mozilla.org/comm-central/rev/cebc16631aa6
Comment 16•12 years ago
|
||
https://developer.mozilla.org/en-US/docs/Firefox_22_for_developers
https://developer.mozilla.org/en-US/docs/DOM/Node.hasAttributes
Keywords: dev-doc-needed → dev-doc-complete
Comment 17•12 years ago
|
||
I've added this bug to the compatibility doc. Please correct the info if wrong.
https://developer.mozilla.org/en-US/docs/Site_Compatibility_for_Firefox_22
Comment 18•12 years ago
|
||
WebKit moved Node.prototype.hasAttributes and Node.prototype.attributes to Element.prototype. Removing hasAttributes completely seems like too large of a risk.
Comment 19•12 years ago
|
||
(In reply to Erik Arvidsson from comment #18)
> WebKit moved Node.prototype.hasAttributes and Node.prototype.attributes to
> Element.prototype. Removing hasAttributes completely seems like too large of
> a risk.
As in don't remove it from Node?
If you don't, you lose the ability to easily check for it before using it (which is the easy fix for the JXON code)
The fact that webkit still has this certainly puts the risk involved here into a different light.
I don't have strong opinions though. Ideal would be to go through the safe route of warning+measuring (using telemetry) and then removing only if usage is small enough. But that's a lot of work so I don't have a strong opinion.
But please be careful before issuing statements like the one in comment 3.
Assignee | ||
Comment 22•12 years ago
|
||
Sorry for comment 3 -- I don't know what test I was using, but probably I was using a non-element node like "document" and didn't think to check an element. I don't see the value in trying to remove this if everyone does in fact support it; I'd be amazed if it doesn't cause at least a few pages to break.
Assignee | ||
Comment 23•12 years ago
|
||
Spec bug asking for it to be re-added: https://bugs.webkit.org/show_bug.cgi?id=113580
Assignee | ||
Comment 24•12 years ago
|
||
![]() |
||
Comment 25•12 years ago
|
||
Thank you, Aryeh.
I've backed this out on inbound in bug 856752.
Resolution: FIXED → WONTFIX
Comment 26•12 years ago
|
||
(In reply to Joshua Cranmer [:jcranmer] from comment #12)
>
> It's used in <https://developer.mozilla.org/en-US/docs/JXON>, and you've
> just broken comm-central's JXON code as a result.
That's excactly what happed to my Reminderfox implementation for CalDAV support following that JXON page!
It was working up to TB 21 but failed with TB22.0a2!
![]() |
||
Updated•12 years ago
|
Flags: needinfo?(peterv)
You need to log in
before you can comment on or make changes to this bug.
Description
•