Closed Bug 187414 Opened 23 years ago Closed 23 years ago

Use NodeFilters for DOM View

Categories

(Other Applications :: DOM Inspector, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: caillon, Assigned: caillon)

Details

Attachments

(1 file)

Attachment #110476 - Flags: superreview?(bzbarsky)
Attachment #110476 - Flags: review?(bugmail)
Comment on attachment 110476 [details] [diff] [review] Why didn't it use NodeFilter before? > + PRUint32 filterForNodeType = 1 << (nodeType - 1); Ew. This assumes all sorts of stuff about the filter consts and the node types... Perhaps an inline function to do this would be in order; one which asserts that |nodeType| is in a certain range (that standardized by the existing DOM3 spec?) At the very least, this line deserves a nice comment explaining what's going on. Other than that, looks good.
Attachment #110476 - Flags: superreview?(bzbarsky) → superreview+
Comment on attachment 110476 [details] [diff] [review] Why didn't it use NodeFilter before? >+ PRUint32 filterForNodeType = 1 << (nodeType - 1); What bz said. Please add checks to make sure that nodeType is within the allowed range (1-12). >Index: extensions/inspector/resources/content/viewers/domNode/domNode.js >=================================================================== >@@ -71,7 +71,7 @@ > > // prepare and attach the DOM DataSource > this.mDOMView = XPCU.createInstance(kDOMViewCID, "inIDOMView"); >- this.mDOMView.addFilterByType(2, true); >+ this.mDOMView.whatToShow |= NodeFilter.SHOW_ATTRIBUTE; Shouldn't this be this.mDOMView.whatToShow = NodeFilter.SHOW_ATTRIBUTE; since the second argument was |true|. with that, r=sicking
Attachment #110476 - Flags: review?(bugmail) → review+
Checked in.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Product: Core → Other Applications
QA Contact: timeless → dom-inspector
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: