Last Comment Bug 844134 - attributes should be defined on Element and not Node
: attributes should be defined on Element and not Node
: addon-compat, dev-doc-complete, site-compat
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: All All
-- normal (vote)
: mozilla22
Assigned To: :Ms2ger (⌚ UTC+1/+2)
: Andrew Overholt [:overholt]
Depends on:
  Show dependency treegraph
Reported: 2013-02-22 08:10 PST by Erik Arvidsson
Modified: 2014-09-07 23:21 PDT (History)
8 users (show)
Ms2ger: in‑testsuite+
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Patch v1 (21.47 KB, patch)
2013-03-10 13:21 PDT, :Ms2ger (⌚ UTC+1/+2)
jonas: review+
Details | Diff | Splinter Review

Description User image Erik Arvidsson 2013-02-22 08:10:24 PST
It makes no sense to expose attributes and hasAttributes on non Elements and DOM core updated the spec accordingly.
Comment 1 User image :Ms2ger (⌚ UTC+1/+2) 2013-02-25 04:21:09 PST
I've got a patch for attributes.
Comment 2 User image :Ms2ger (⌚ UTC+1/+2) 2013-03-10 13:21:45 PDT
Created attachment 723255 [details] [diff] [review]
Patch v1

I filed bug 849661 for hasAttributes.
Comment 3 User image Jonas Sicking (:sicking) No longer reading bugmail consistently 2013-03-10 23:05:03 PDT
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.
Comment 4 User image :Ms2ger (⌚ UTC+1/+2) 2013-03-17 06:13:44 PDT
Comment 5 User image Kohei Yoshino [:kohei] 2013-03-29 09:56:20 PDT
I've added this bug to the compatibility doc. Please correct the info if wrong.

Also, please update the following doc:

Note You need to log in before you can comment on or make changes to this bug.