Closed Bug 899388 Opened 11 years ago Closed 11 years ago

Remove XUL-related interfaces and ChromeWindow from content

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla26

People

(Reporter: bruant.d, Assigned: emk)

References

Details

(Keywords: dev-doc-complete, site-compat)

Attachments

(4 files, 4 obsolete files)

Follow-up from https://bugzilla.mozilla.org/show_bug.cgi?id=898687#c12
At the bottom of [1] are listed a bunch of XUL-related interfaces (+ ChromeWindow) which are currently reflected in web content while have no reason to and should be removed from there.


[1] http://mxr.mozilla.org/mozilla-central/source/dom/tests/mochitest/general/test_interfaces.html?force=1
https://tbpl.mozilla.org/?tree=Try&rev=a59ab2c54b74
Assignee: nobody → VYV03354
Status: NEW → ASSIGNED
Attachment #784408 - Flags: review?(bzbarsky)
Comment on attachment 784408 [details] [diff] [review]
Remove XUL-related interfaces and ChromeWindow from content

Does the XULCommandDispatcher stuff still work in content XBL?  What about the other XUL interfaces here?
Forgot to remove XULControlElement and XULLabeledControlElement.
https://tbpl.mozilla.org/?tree=Try&rev=13c0d678f5d3
But let me consider about content XBL.
Attachment #784408 - Attachment is obsolete: true
Attachment #784408 - Flags: review?(bzbarsky)
Depends on: 900994
Apply this patch on top of bun 900994.
Attachment #784595 - Attachment is obsolete: true
Attachment #785545 - Flags: review?(bzbarsky)
except content XBL.
Attachment #785547 - Attachment is patch: true
Attachment #785547 - Flags: review?(bzbarsky)
I was unable to remove XULElement from content because wrapping XUL elements will end up with calling XULElementBinding::GetProto().
Attachment #785548 - Flags: review?(bzbarsky)
Green on try except for one known orange:
https://tbpl.mozilla.org/?tree=Try&rev=3d9d6614f958
Attachment #785545 - Attachment description: Enable WebIDL XUL interfaces on Chrome or content XBL → Part 1: Enable WebIDL XUL interfaces on Chrome or content XBL
Attachment #785546 - Attachment description: Implement allowXBL option for xpc bindings → Part 2: Implement allowXBL option for xpc bindings
Rebased
Attachment #785547 - Attachment is obsolete: true
Attachment #785547 - Flags: review?(bzbarsky)
Attachment #785737 - Flags: review?(bzbarsky)
Attachment #785548 - Attachment description: Test to make sure that XUL interfaces are not exposed on content, modulo content XBL → Part 4: Test to make sure that XUL interfaces are not exposed on content, modulo content XBL
Hmm.  Does the IsChromeOrXBL check work correctly?   Specifically, don't we enter the content compartment before calling that method for interface objects, so we're not calling it for interface ctors on the XBL compartment?
Flags: needinfo?(VYV03354)
Comment on attachment 785545 [details] [diff] [review]
Part 1: Enable WebIDL XUL interfaces on Chrome or content XBL

Hrm, indeed it didn't work.
Attachment #785545 - Flags: review?(bzbarsky)
Comment on attachment 785548 [details] [diff] [review]
Part 4: Test to make sure that XUL interfaces are not exposed on content, modulo content XBL

I somehow missed a test for WebIDL interface objects...
Attachment #785548 - Flags: review?(bzbarsky)
Flags: needinfo?(VYV03354)
I suspect the infrastructure I'm adding in bug 897913 might help, actually.
Depends on: 897913
Comment on attachment 785546 [details] [diff] [review]
Part 2: Implement allowXBL option for xpc bindings

r=me
Attachment #785546 - Flags: review?(bzbarsky) → review+
Comment on attachment 785737 [details] [diff] [review]
Part 3: Remove XUL-related interfaces and ChromeWindow from content

r=me
Attachment #785737 - Flags: review?(bzbarsky) → review+
Comment on attachment 785545 [details] [diff] [review]
Part 1: Enable WebIDL XUL interfaces on Chrome or content XBL

Yeah, bug 897913 helped.
Attachment #785545 - Flags: review?(bzbarsky)
Added WebIDL interfaces to the test.
Attachment #785548 - Attachment is obsolete: true
Attachment #786471 - Flags: review?(bzbarsky)
Comment on attachment 785545 [details] [diff] [review]
Part 1: Enable WebIDL XUL interfaces on Chrome or content XBL

r=me
Attachment #785545 - Flags: review?(bzbarsky) → review+
Comment on attachment 786471 [details] [diff] [review]
Part 4: Test to make sure that XUL interfaces are not exposed on content, modulo content XBL

>+      ok(interfaceNamesInGlobalScope.indexOf(name) >= 0 ||
>+         isXBLScope && interfaceNamesInXBLScope.indexOf(name) >= 0,

I'd prefer:

      ok(interfaceNamesInGlobalScope.indexOf(name) >= 0 ||
         (isXBLScope && interfaceNamesInXBLScope.indexOf(name) >= 0),

and r=me with that
Attachment #786471 - Flags: review?(bzbarsky) → review+
Depends on: 922141
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: