Closed Bug 1145017 Opened 5 years ago Closed 5 years ago
Use our new binding proto setup for custom element prototypes when possible
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.
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Attachment #8579823 - Flags: review?(bobbyholley) → review+
You need to log in before you can comment on or make changes to this bug.