Make NamedNodeMap only deal with Attrs

RESOLVED FIXED in mozilla22

Status

()

Core
DOM: Core & HTML
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: Ms2ger, Assigned: Ms2ger)

Tracking

(Depends on: 1 bug, Blocks: 1 bug, {dev-doc-complete, site-compat})

Trunk
mozilla22
dev-doc-complete, site-compat
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

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

Once Attr no longer inherits from Node, we won't we able to QI back and forth like the callers here do.
Attachment #720439 - Flags: review?(mounir)
Comment on attachment 720439 [details] [diff] [review]
Patch v1

Don't have time nor motivation for that.
Attachment #720439 - Flags: review?(mounir) → review?(khuey)
Comment on attachment 720439 [details] [diff] [review]
Patch v1

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

Please mark nsIDOMAttr as builtinclass.

::: content/base/src/nsDOMAttributeMap.cpp
@@ +200,3 @@
>  {
>    ErrorResult rv;
> +  *aReturn = SetNamedItemInternal(aAttr, false, rv).get();

Wow this code is ugly

::: dom/interfaces/core/Makefile.in
@@ +23,5 @@
>  	nsIDOMDocument.idl			\
>  	nsIDOMDocumentFragment.idl		\
>  	nsIDOMDocumentType.idl			\
>  	nsIDOMElement.idl			\
> +	nsIDOMMozNamedAttrMap.idl			\

Line up the \ please.

::: editor/libeditor/base/nsEditor.cpp
@@ +2241,3 @@
>      // always remove item number 0 (first item in list)
> +    if (NS_SUCCEEDED(destAttributes->Item(0, getter_AddRefs(attr))) && attr) {
> +      nsAutoString str;

Don't use nsAutoString here.  The stack buffer is wasted.  nsString is just fine.  (Yes I realize this was here before).

@@ +2258,3 @@
>    {
> +    if (NS_SUCCEEDED(sourceAttributes->Item(i, getter_AddRefs(attr))) && attr) {
> +      nsAutoString sourceAttrName;

Same here.

@@ +2258,5 @@
>    {
> +    if (NS_SUCCEEDED(sourceAttributes->Item(i, getter_AddRefs(attr))) && attr) {
> +      nsAutoString sourceAttrName;
> +      if (NS_SUCCEEDED(attr->GetName(sourceAttrName))) {
> +        nsAutoString sourceAttrValue;

And here.

@@ +2278,1 @@
>  #endif

You can remove #ifdef DEBUG_personiveneverheardof code.
Attachment #720439 - Flags: review?(khuey) → review+

Updated

4 years ago
Depends on: 849612
(Assignee)

Comment 3

4 years ago
https://hg.mozilla.org/mozilla-central/rev/b1a08130fae6
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
Depends on: 858344
https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap
https://developer.mozilla.org/en-US/docs/Site_Compatibility_for_Firefox_22
Keywords: dev-doc-complete, site-compat
(In reply to Kohei Yoshino [:kohei] from comment #4)
> https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap
> https://developer.mozilla.org/en-US/docs/Site_Compatibility_for_Firefox_22

The interface has been renamed to MozNamedAttrMap, not MozNamedNodeMap. (Because this interface is only used for attributes.)
(In reply to Masatoshi Kimura [:emk] from comment #5)
> The interface has been renamed to MozNamedAttrMap, not MozNamedNodeMap.
> (Because this interface is only used for attributes.)

Thank you for pointing it out. I just fixed the documents.
You need to log in before you can comment on or make changes to this bug.