Closed Bug 1542932 Opened 6 years ago Closed 6 years ago

Generate CustomElementConstructor from WebIDL callback definition

Categories

(Core :: DOM: Bindings (WebIDL), task)

task
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: karlt, Assigned: karlt)

References

Details

Attachments

(6 files)

CustomElementDefinition performs a copy conversion from a Function IDL callback to CustomElementConstructor to bypass class access protection on CallbackObject::CallSetup, to call JS::Construct(), and to provide non-void return values from the callback.

Let's instead generate CustomElementConstructor from WebIDL so that the interface definition can be more accurate, and so that other code involving constructor callbacks doesn't need to be separately hand-crafted.

https://github.com/heycam/webidl/issues/701 proposes a way that would indicate whether a callback is a construct or not, and so we can know whether a callback requires either Call() or Construct() methods.

Type: defect → task
Depends on: 1542934

TreatNonObjectAsNull is rejected in the parser because / so that there is no
need to implement the equivalent of CallCallback.getCallGuard().

Depends on D26864

Attachment #9057183 - Attachment description: Bug 1542932 Add code generation for callback constructors with Gecko interface return types r?bzbarsky → bug 1542932 Add code generation for callback constructors r?bzbarsky
Attachment #9057185 - Attachment description: Bug 1542932 Generate CustomElementConstructor from WebIDL callback definition r?bzbarsky → bug 1542932 Generate CustomElementConstructor from WebIDL callback definition r?bzbarsky
Pushed by ktomlinson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7f7069a44442 part 1. Add support for callback constructors in the IDL parser. r=qdot https://hg.mozilla.org/integration/autoland/rev/9c837ead0cab Add code generation for callback constructors r=bzbarsky https://hg.mozilla.org/integration/autoland/rev/87dfe897f8aa align CustomElementConstructor::Construct() parameters with WebIDL bindings conventions r=bzbarsky https://hg.mozilla.org/integration/autoland/rev/a3305716fa2e Generate CustomElementConstructor from WebIDL callback definition r=bzbarsky https://hg.mozilla.org/integration/autoland/rev/60e641a02435 Change define() parameter functionConstructor from Function to CustomElementConstructor r=bzbarsky https://hg.mozilla.org/integration/autoland/rev/6d1c102cccd2 Remove CustomElementConstructor copy r=bzbarsky
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: