Closed Bug 345982 Opened 18 years ago Closed 18 years ago

Object - DOM Node does not update when changing values of a node's attributes

Categories

(Other Applications :: DOM Inspector, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: sdwilsh, Assigned: sylvain.pasche)

References

Details

(Keywords: testcase)

Attachments

(2 files, 2 obsolete files)

In the Object - DOM Node view, you can select an attribute and edit it.  However, upon saving the change the view is not updated and the old value is still present.

This also happens when inserting a new attribute.  The new attribute is not shown unless you deselect the node, and then select it again.
Attached file Testcase (needs chrome privs) (obsolete) —
Keywords: testcase
Attached patch Patch, v1 (obsolete) — Splinter Review
For the first tree in the testcase (the one broken in the bugreport, which is used in the domNode view of DOM Inspector), the call "NodeToRow(content, &contentRow)" is always failing as the content node is not in any rows.

That's why I have put the following code in the else block.
Attachment #236633 - Flags: superreview?(neil)
Attachment #236633 - Flags: review?(timeless)
This is partly a regression from the new edit dialog - since it actually removes and reinserts the attribute instead of replacing it, it actually does more damage such as forgetting the selection, changing the order of the map, etc.
Comment on attachment 236633 [details] [diff] [review]
Patch, v1

I think the mRootNode == content test should be done much earlier. Also I suspect that having a -w version of your next patch might ease review.
Attachment #236633 - Flags: superreview?(neil) → superreview-
(In reply to comment #3)
> This is partly a regression from the new edit dialog - since it actually
> removes and reinserts the attribute instead of replacing it, it actually does
> more damage such as forgetting the selection, changing the order of the map,
> etc.

I think you are reffering to Bug 205872, but this isn't correct.  It only removes the attribute if there is a namespace change, otherwise it should just set it.
DOMNodeViewer.reset() function was missing
Attachment #236632 - Attachment is obsolete: true
Attached patch patch, v2Splinter Review
(In reply to comment #4)
> (From update of attachment 236633 [details] [diff] [review] [edit])
> I think the mRootNode == content test should be done much earlier. Also I
> suspect that having a -w version of your next patch might ease review.

That what I wanted to do first, but the condition (mRootNode == content) is also true if the root element is visible, like the second tree of the testcase. So I added a condition if we are not showing the elements.

I did not supply a -w for this second patch, as I think it is clearer now what part has been moved. I also had to remove the !contentNode in the second condition, otherwise the second tree of the testcase is not update because the index of the root == 0.
Attachment #236633 - Attachment is obsolete: true
Attachment #236659 - Flags: superreview?(neil)
Attachment #236659 - Flags: review?(timeless)
Attachment #236633 - Flags: review?(timeless)
Comment on attachment 236659 [details] [diff] [review]
patch, v2

Yes, I like this, thanks.
Attachment #236659 - Flags: superreview?(neil) → superreview+
Attachment #236659 - Flags: review?(timeless) → review+
Whiteboard: [checkin needed]
timeless: Thanks for the check-in. BTW, the patch was by me which is not what the check-in comment says, but I'm won't be offended for this ;-)

Would this make sense on the branch?
Whiteboard: [checkin needed]
(In reply to comment #9)
> timeless: Thanks for the check-in. BTW, the patch was by me which is not what
> the check-in comment says, but I'm won't be offended for this ;-)

Sorry - I guess that's what happens when I bug him to get it checked in :/
I'll be sure to specify next time.

> Would this make sense on the branch?

Well, it only doesn't work on 1.5 (I know you mean 2.0, but I can't test it.  I'm going to presume that the behavior is probably the same) when you insert a new attribute.  Changing them works just fine, and in fact it may have been a result of an error on my part in a previous bug that made it not work right for changing anyway.

What I'm trying to say is that it would be nice on branch, but it's been like this for a while so you don't have to go out of your way for it :)
Assignee: dom-inspector → sylvain.pasche
Blocks: 353770
Is this fixed (as in, can we resolve this)?
(In reply to comment #11)
> Is this fixed (as in, can we resolve this)?

The testcase runs as expected on minefield -> resolving
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
QA Contact: timeless → dom-inspector
Depends on: 499134
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: