Closed Bug 526939 Opened 15 years ago Closed 14 years ago

DOM Inspector hangs trying to find a ID that doesn't exist

Categories

(Other Applications :: DOM Inspector, defect)

defect
Not set
critical

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jruderman, Assigned: crussell)

References

Details

(Keywords: regression)

Attachments

(3 files, 1 obsolete file)

Steps to reproduce:
1. Open DOM Inspector.
2. Cmd+F
3. Type something that isn't an ID in the document.
4. Press Enter.

Result: DOM Inspector hangs, even on short documents.

Expected: Tell me 'not found', preferably without using a nested dialog.


Tested with:
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.3a1pre) Gecko/20091103 Firefox/3.7a1pre

Happens with both:
DOM Inspector 2.0.3
DOM Inspector 2.0.4 (AMO sandbox)
Do you have a stack of the hang?
Attached file stack from domi 2.0.3
I get the same thing on latest Ubuntu. Hanging occurs on XULRunner 1.9.2 while the same app using 1.9.1 works fine.
OS: Mac OS X → All
I traced it back to improper behavior for inDeepTreeWalker::nextNode, where it will just sit on the last node if the end of the document is reached, instead of setting its currentNode to null. Seems like it has something to do with the rewrite in bug 522601.
Keywords: regression
> improper behavior for inDeepTreeWalker::nextNode, where it will just sit on the
> last node if the end of the document is reached, instead of setting its
> currentNode to null

That's the correct behavior of a DOM TreeWalker.  The DOM spec is very clear on this issue:

  nextNode
    Moves the TreeWalker to the next visible node in document order relative to
    the current node, and returns the new node. If the current node has no next
    node, or if the search for nextNode attempts to step upward from the
    TreeWalker's root node, returns null, and retains the current node. 

So the real issue is that I missed an inDOMTreeWalker consumer that was depending on the old, buggy, behavior...

Colby, did you digging turn up the relevant consumer by chance, or should I look for it?
And yes, the new behavior was definitely introduced in bug 522601.
Blocks: 522601
(In reply to comment #5)

> That's the correct behavior of a DOM TreeWalker.  The DOM spec is very clear on
> this issue:

Oops! I've even read that paragraph at least three times without understanding what it actually says.

> So the real issue is that I missed an inDOMTreeWalker consumer that was
> depending on the old, buggy, behavior...
> 
> Colby, did you digging turn up the relevant consumer by chance, or should I
> look for it?

And I'm usually better at cross-referencing bugs, too. Bug 526939.
Err... maybe I should pay attention to the bug IDs as well. It's in resources/content/viewers/dom/dom.js FindNext().
Attached patch dom.js cleanup (obsolete) — Splinter Review
Assignee: nobody → Sevenspade
Status: NEW → ASSIGNED
Attachment #435501 - Flags: review?(sdwilsh)
Severity: normal → critical
Hardware: x86 → All
Comment on attachment 435502 [details] [diff] [review]
findNext fix that expects inDeepTreeWalker::NextNode's TreeWalker behavior (apply this second)

r=sdwilsh
Attachment #435502 - Flags: superreview?(bzbarsky)
Attachment #435502 - Flags: review?(sdwilsh)
Attachment #435502 - Flags: review+
Blocks: DOMi2.0.5
Comment on attachment 435501 [details] [diff] [review]
dom.js cleanup

>+    this.setProcessingInstructions(
>+      PrefUtils.getPref("inspector.dom.showProcessingInstructions"));
>+    this.setAccessibleNodes(
>+      PrefUtils.getPref("inspector.dom.showAccessibleNodes"));
>+    this.setWhitespaceNodes(
>+      PrefUtils.getPref("inspector.dom.showWhitespaceNodes"));
nit: for multiline calls like this, do this:
callingFunc(
  arguemnt
);

r=sdwilsh
Attachment #435501 - Flags: review?(sdwilsh) → review+
Comment on attachment 435502 [details] [diff] [review]
findNext fix that expects inDeepTreeWalker::NextNode's TreeWalker behavior (apply this second)

Oh, awesome.  I'd been planning to look at this code tomorrow, but it looks like I win.

sr=me, and thank you for cleaning up my mess!
Attachment #435502 - Flags: superreview?(bzbarsky) → superreview+
(In reply to comment #14)
> Oh, awesome.  I'd been planning to look at this code tomorrow, but it looks
> like I win.
> 
> sr=me, and thank you for cleaning up my mess!

I was impatient. And if I'd realized that that inDeepTreeWalker was doing what it was supposed to be doing, I'd have just done this Friday.
Keywords: checkin-needed
Attachment #435511 - Attachment description: dom.js cleanup mkII → dom.js cleanup mkII (apply this first)
Attachment #435502 - Attachment description: findNext fix that expects inDeepTreeWalker::NextNode's TreeWalker behavior → findNext fix that expects inDeepTreeWalker::NextNode's TreeWalker behavior (apply this second)
landed

http://hg.mozilla.org/dom-inspector/rev/832c66dff1b4
http://hg.mozilla.org/dom-inspector/rev/27b0e9ef1715

I forget to specify -u to point Colby name so checkins appears under my name. If it's important issue then I'd like to fix this. However I need to realize how to do this, please ping me if you know this.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
It's somewhat important, but you can't fix it post-fact.  You have to get it right the first time (e.g. by using "hg out" before pushing).
(In reply to comment #17)
> It's somewhat important, but you can't fix it post-fact.  You have to get it
> right the first time (e.g. by using "hg out" before pushing).
or backout and reland
(In reply to comment #18)
> (In reply to comment #17)
> > It's somewhat important, but you can't fix it post-fact.  You have to get it
> > right the first time (e.g. by using "hg out" before pushing).
> or backout and reland

Shawn, please make decision as DOMi owner :)
(In reply to comment #19)
> Shawn, please make decision as DOMi owner :)
I'll leave it up to the person who wrote the patch.  If they don't care, you can leave it in.
I told surkov via that I didn't mind.
that's via IRC
(In reply to comment #21)
> I told surkov via that I didn't mind.

Ok, thanks. Next time I will be more careful.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: