Closed
Bug 296207
Opened 21 years ago
Closed 20 years ago
nsDOMAttributeMap::SetNamedItemInternal() could be optimized
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
People
(Reporter: allan, Assigned: sicking)
Details
Attachments
(1 file)
|
13.69 KB,
patch
|
allan
:
review+
peterv
:
superreview+
|
Details | Diff | Splinter Review |
| Assignee | ||
Comment 1•21 years ago
|
||
Fixes this bug and makes sure .ownerDocument is always right (was required to
be able to just grab the existing nodeinfo)
Attachment #185816 -
Flags: superreview?(peterv)
Attachment #185816 -
Flags: review?(allan)
| Reporter | ||
Comment 2•21 years ago
|
||
Comment on attachment 185816 [details] [diff] [review]
patch
base/src/nsDOMAttributeMap.cpp
L 100: +SetDocumentFunc(nsAttrHashKey::KeyType aKey, nsCOMPtr<nsIDOMNode>&
aData, void* aUserArg)
W 115: + return NS_OK;
with that r=me
Attachment #185816 -
Flags: review?(allan) → review+
Comment 3•21 years ago
|
||
Comment on attachment 185816 [details] [diff] [review]
patch
> Index: base/public/nsIAttribute.h
> ===================================================================
> + /**
> + * Called when our ownerElement is moved into a new document.
> + * Updates the nodeinfo of this node.
> + */
> + virtual nsresult SetDocument(nsIDocument* aDocument) = 0;
SetOwnerDocument?
> Index: base/src/nsDOMAttributeMap.cpp
> ===================================================================
> +nsresult
> +nsDOMAttributeMap::SetDocument(nsIDocument* aDocument)
> +{
> + PRUint32 n = mAttributeCache.Enumerate(SetDocumentFunc, aDocument);
> + NS_ENSURE_TRUE(n == mAttributeCache.Count(), NS_ERROR_OUT_OF_MEMORY);
NS_ERROR_FAILURE
> @@ -208,46 +226,46 @@ nsDOMAttributeMap::SetNamedItemInternal(
> + // setting a preexisting attribute is a no-op
> + return NS_OK;
"If the new Node replaces an existing node the replaced Node is returned,
otherwise null is returned."
I think you need to return the source node in this case, not null.
Attachment #185816 -
Flags: superreview?(peterv) → superreview+
Comment 4•20 years ago
|
||
To sicking, since it's his patch... Requesting blocking so we don't forget to
check this in.
Assignee: general → bugmail
Flags: blocking1.9a1?
| Assignee | ||
Comment 5•20 years ago
|
||
Checked in
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Updated•19 years ago
|
Flags: blocking1.9a1?
Updated•7 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•