The default bug view has changed. See this FAQ.

attributes should be defined on Element and not Node

RESOLVED FIXED in mozilla22

Status

()

Core
DOM
RESOLVED FIXED
4 years ago
3 years ago

People

(Reporter: Erik Arvidsson, Assigned: Ms2ger)

Tracking

({addon-compat, dev-doc-complete, site-compat})

Trunk
mozilla22
addon-compat, dev-doc-complete, site-compat
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
It makes no sense to expose attributes and hasAttributes on non Elements and DOM core updated the spec accordingly.

Updated

4 years ago
OS: Linux → All
Hardware: x86_64 → All
Version: unspecified → Trunk
(Assignee)

Comment 1

4 years ago
I've got a patch for attributes.
Assignee: nobody → Ms2ger
(Assignee)

Updated

4 years ago
Summary: attributes and hasAttributes should be defined on Element and not Node → attributes should be defined on Element and not Node
(Assignee)

Comment 2

4 years ago
Created attachment 723255 [details] [diff] [review]
Patch v1

I filed bug 849661 for hasAttributes.
Attachment #723255 - Flags: review?(jonas)
Comment on attachment 723255 [details] [diff] [review]
Patch v1

Review of attachment 723255 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with the below fixed.

::: layout/inspector/src/inDOMView.cpp
@@ +1178,5 @@
>  {
>    NS_ENSURE_ARG(aNode);
>    // attribute nodes
>    if (mWhatToShow & nsIDOMNodeFilter::SHOW_ATTRIBUTE) {
> +    if (nsCOMPtr<nsIDOMElement> element = do_QueryInterface(aNode)) {

Are you sure this will work? The assignment operator for do_QI works weirdly in that do_QI doesn't actually return the result of the QI, it always returns a non-null object.

I'd move this outside out the if-statement and just do |if (element)| to be on the safe side. It's not causing any runtime or compile time cost.
Attachment #723255 - Flags: review?(jonas) → review+
(Assignee)

Comment 4

4 years ago
https://hg.mozilla.org/mozilla-central/rev/27a901ae549c
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
(Assignee)

Updated

4 years ago
Keywords: addon-compat, dev-doc-needed
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

Also, please update the following doc:
https://developer.mozilla.org/en-US/docs/DOM/Node.attributes

Updated

4 years ago
Keywords: site-compat
Doc updated:
Node.attributes moved to Element.attributes https://developer.mozilla.org/en-US/docs/Web/API/Element.attributes
https://developer.mozilla.org/en-US/docs/Web/API/Node
https://developer.mozilla.org/en-US/docs/Web/API/Element
https://developer.mozilla.org/en-US/Firefox/Releases/22
Keywords: dev-doc-needed → dev-doc-complete
You need to log in before you can comment on or make changes to this bug.