Closed Bug 1145017 Opened 9 years ago Closed 9 years ago

Use our new binding proto setup for custom element prototypes when possible

Categories

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

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla39
Tracking Status
firefox39 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(1 file)

The patch checked in for bug 1130028 seems to rely on post-wrapping SetPrototype calls, and in particular on the prototype set happening on the Xray, not on the object itself.

This, unfortunately, does not play nice at all with what I was trying to do in the "part 4" patch in bug 1117172.

The reason I'd like to do _something_ there is that in the common case of all the stuff being part of the webpage we don't want to do the dynamic JS_SetPrototype business: that deoptimizes the object and makes performance-me very unhappy.

Seems to me like if NodePrincipal() subsumes the compartment principal of the proto we should be able to just pass it in as-is.  Otherwise, do what we do now.  Seem reasonable?
Note that with this patch I'm also changing the priority order of the given
proto and the custom proto; the former takes priority.  This makes sense to me:
if the caller is doing |new Foo| they really should get something with
Foo.prototype as its proto.  This should not be a problem for custom elements
in general so far, because nodes/elements are mostly not constructible anyway.
For now.  When they become that way, I think this is the behavior we'll want.
Attachment #8579823 - Flags: review?(wchen)
Attachment #8579823 - Flags: review?(bobbyholley)
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Attachment #8579823 - Flags: review?(bobbyholley) → review+
Attachment #8579823 - Flags: review?(wchen) → review+
https://hg.mozilla.org/mozilla-central/rev/6030e30ae43d
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
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: