Closed Bug 191092 Opened 22 years ago Closed 8 years ago

Can't use |in| operator on collections or node lists

Categories

(Core :: XPConnect, defect)

defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: neil, Unassigned)

References

()

Details

If you click on the URL provided you will see a false alert although any document contains at least one tag. This applies to HTML collections and XUL node lists.
This is likely classinfo voodoo....
OS: Windows 95 → All
Hardware: PC → All
Summary: Can't use operator in on collections or node lists → Can't use |in| operator on collections or node lists
Yeah, I bet it is... feel free to push this over on my plate if nobody else wants it. But do we really care? Are there real sites out there that breaks? Sure it should be fixed, but how urgent is it? Does this work in IE?
> Does this work in IE? Yes - IE6 returns 'true' on the above javascript:URL javascript:alert(0 in document.getElementsByTagName('*'))
The rationale: editorUtilities.js currently has the code var editorList = tmpWindow.document.getElementsByTagName("editor"); if (editorList && editorList.length > 0) return editorList[0]; Now editorList.length > 0 is expensive, but editorList[0] != null is a JS strict warning if the tmpWindow has no editor elements. bz pointed out that there's a workaround of editorList.item(0) != null but 0 in editorList would be neater.
With some definition of 'neater', maybe... :-)
Assignee: dbradley → nobody
QA Contact: pschwartau → xpconnect
These are presumably on WebIDL bindings now so they probably behave the way they are supposed to.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INCOMPLETE
Yes, this totally works now.
Resolution: INCOMPLETE → WORKSFORME
You need to log in before you can comment on or make changes to this bug.