Closed
Bug 97939
Opened 23 years ago
Closed 21 years ago
myObj instanceof HTMLDocument == false // always
Categories
(Core :: DOM: Core & HTML, defect, P4)
Tracking
()
RESOLVED
WORKSFORME
Future
People
(Reporter: hattons, Unassigned)
Details
Attachments
(2 files)
The results of the following code seem wrong, and others using older builds have attested to different (i.e., correct) results. var testStr = "(pad instanceof HTMLDocument) = "+(pad instanceof HTMLDocument) + "; pad = " + pad + "<br>"; pad.writeln(testStr); testStr = "(pad instanceof Object) = " + (pad instanceof Object) + "; pad = " + pad +"<br>"; pad.writeln(testStr); // output: // (pad instanceof HTMLDocument) = false; pad = [object HTMLDocument] // should be true -----------------^^^^^ observe-------^^^^^^^^^^^^ // (pad instanceof Object) = true; pad = [object HTMLDocument] function chk(p) { alert(p instanceof HTMLDocument) }; chk(window.open().document); // prints 'false' should be 'true' I tested the same code on NT and got the same results.
Comment 1•23 years ago
|
||
Browser, not engine --> DOM Level 0. Steve - FWIW, how are you defining the variable 'pad'?
Assignee: rogerl → jst
Component: Javascript Engine → DOM Level 0
QA Contact: pschwartau → desale
Reporter | ||
Comment 2•23 years ago
|
||
Comment 3•23 years ago
|
||
Comment 4•23 years ago
|
||
Reduced testcase attached. jst, here's a fun one. window.document is of type [HTMLDocument], and window.document instanceof HTMLDocument returns true. Now if I open a new window, get the document of this new window, its type is [HTMLDocument], but newWindow.document instanceof HTMLDocument returns false. Does anyone understand? Marking NEW.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
Comment 5•23 years ago
|
||
newWindow.document instanceof newWindow.HTMLDocument works, we're currently not sharing classes across scopes, so this won't work when doing cross-window coding... Won't be fixed any time soon unless this is fixed as part of some other more important bug.
Target Milestone: --- → Future
Comment 6•22 years ago
|
||
Severity = LOW [No Crash, No severe functional failure, No Cosmetic failure] Visibility = MEDIUM [Dont see any real world website usage, Gets one point of compatibility with other browsers, since reporter says it used to work on older builds. gets one more point on compliance with adopted techonology, that is JS] Priority = Visibility * Severity Priority = p4 adding word "qawanted" because I'm setting this priority on available data & if someone feels otherwise then please investigate this more & feel free to change this priority.
Keywords: qawanted
Priority: -- → P4
Comment 7•21 years ago
|
||
Mozilla Build ID: 2003020208 Platform: i386 OS: Windows 2000 This works for me. Both test cases show "true" as expected.
Comment 9•21 years ago
|
||
Yeah, as comment 7 suggests, this works now. Resolving.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•