Closed Bug 875198 Opened 11 years ago Closed 10 years ago

|crossOriginWindow instanceof Window| should work

Categories

(Core :: XPConnect, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 789261

People

(Reporter: bholley, Unassigned)

References

Details

Per spec, I don't see any reason why this wouldn't, but it doesn't work at all with our architecture. I initially thought we could just munge the security policy on XOWs to allows hasInstance, but then I realized that we don't ever hit the proxy hasInstance hook never gets called, because the constructor itself is not cross-origin (just the object under test).

I need to think about how to fix this.
Note: I have ready-made todo test coverage for this in js/xpconnect/tests/mochitest/test_bug870423.html
Depends on: 870423
Given the description, this should work for WebIDL binding objects, since InterfaceHasInstance does:

  1668   const DOMClass* domClass = GetDOMClass(js::UncheckedUnwrap(instance));

the only issue is that Window and Location (which are the only cross-origin-accessible objects) are not WebIDL objects yet, right?
(In reply to Boris Zbarsky (:bz) from comment #2)
> Given the description, this should work for WebIDL binding objects, since
> InterfaceHasInstance does:
> 
>   1668   const DOMClass* domClass =
> GetDOMClass(js::UncheckedUnwrap(instance));
> 
> the only issue is that Window and Location (which are the only
> cross-origin-accessible objects) are not WebIDL objects yet, right?

Oh, nice. Marking the deps. Once that lands, all we should need to do is flip the todo on comment 1.
Depends on: 832014, 789261
Both todos in test_bug870423.html are fixed, so this should be done?
Yep!
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.