Closed Bug 1556352 Opened 5 years ago Closed 3 years ago

Custom elements: implement custom element reaction's formAssociatedCallback

Categories

(Core :: DOM: Core & HTML, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
95 Branch
Tracking Status
firefox95 --- fixed

People

(Reporter: jdai, Assigned: edgar)

References

Details

Attachments

(3 files, 4 obsolete files)

Summary: Custom elements: implement formAssociatedCallback → Custom elements: implement Custom element reaction's formAssociatedCallback
Summary: Custom elements: implement Custom element reaction's formAssociatedCallback → Custom elements: implement custom element reaction's formAssociatedCallback
Depends on: 1182875
Assignee: jdai → echen
No longer depends on: 1182875

I would like to refactor and clean up custom element callbacks a bit in this bug.

To make adding new callback a bit easiler.

Depends on D129169

Attachment #9247052 - Attachment description: Bug 1556352 - Part 1: Merge WebComponents.webidl into CustomElementRegistry.webidl; → Bug 1556352 - Part 1: Merge WebComponents.webidl into CustomElementRegistry.webidl; r=smaug
Attachment #9247101 - Attachment description: Bug 1556352 - Part 2: Remove unnecessary includes from CustomElementRegistry.h; → Bug 1556352 - Part 2: Remove unnecessary includes from CustomElementRegistry.h; r=smaug
Attachment #9247145 - Attachment description: Bug 1556352 - Part 3: Merge LifecycleCallback*Args; → Bug 1556352 - Part 3: Merge LifecycleCallback*Args; r=smaug
Attachment #9247146 - Attachment description: Bug 1556352 - Part 4: Move CustomElementCallback declaration out of CustomElementRegistry.h; → Bug 1556352 - Part 4: Move CustomElementCallback declaration out of CustomElementRegistry.h; r=smaug
Attachment #9247159 - Attachment description: Bug 1556352 - Part 5: Implement formAssociatedCallback; → Bug 1556352 - Part 5: Implement formAssociatedCallback; r=smaug

We need the refactor/cleanup part to add a new callback, but there are still more things I would need to consider to hook the formAssociated callback. So I am going to move the refactor/cleanup part to bug 1556354 which is simpler to implement, in order to not block other callback implementations, e.g. bug 1556363.

Comment on attachment 9247052 [details]
Bug 1556352 - Part 1: Merge WebComponents.webidl into CustomElementRegistry.webidl; r=smaug

Revision D129139 was moved to bug 1556354. Setting attachment 9247052 [details] to obsolete.

Attachment #9247052 - Attachment is obsolete: true

Comment on attachment 9247101 [details]
Bug 1556352 - Part 2: Remove unnecessary includes from CustomElementRegistry.h; r=smaug

Revision D129169 was moved to bug 1556354. Setting attachment 9247101 [details] to obsolete.

Attachment #9247101 - Attachment is obsolete: true

Comment on attachment 9247145 [details]
Bug 1556352 - Part 3: Merge LifecycleCallback*Args; r=smaug

Revision D129190 was moved to bug 1556354. Setting attachment 9247145 [details] to obsolete.

Attachment #9247145 - Attachment is obsolete: true

Comment on attachment 9247146 [details]
Bug 1556352 - Part 4: Move CustomElementCallback declaration out of CustomElementRegistry.h; r=smaug

Revision D129191 was moved to bug 1556354. Setting attachment 9247146 [details] to obsolete.

Attachment #9247146 - Attachment is obsolete: true

See steps 14 of https://html.spec.whatwg.org/commit-snapshots/3ad5159be8f27e110a70cefadcb50fc45ec21b05/#create-an-element-for-the-token

From spec perspective, FACE needs this in order to enqueue the formAssociated callback
while FACE is inserted into document. Otherwise it would bail out in
https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#association-of-controls-and-forms:parser-inserted-flag,
and wouldn't run https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#reset-the-form-owner
steps nor https://html.spec.whatwg.org/multipage/custom-elements.html#custom-element-reactions:reset-the-form-owner

From implementation perspective, we don't implement parser inserted flag, but we do
update the form owner from parser. Not doing this would make the subsequent part
which implements formAssociated callback a bit simpler, where we don't need to consider
or handle the case that form owner is set from parser.

Attachment #9247159 - Attachment description: Bug 1556352 - Part 5: Implement formAssociatedCallback; r=smaug → Bug 1556352 - Part 2: Implement formAssociatedCallback; r=smaug
Pushed by echen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ee2b69cb286c
Part 1: Do not set form owner from parser for form-associated custom element; r=smaug
https://hg.mozilla.org/integration/autoland/rev/ee3956242401
Part 2: Implement formAssociatedCallback; r=smaug
https://hg.mozilla.org/integration/autoland/rev/f423533b66a9
Part 3: Add wpt test for updating id attribute of form element; r=smaug
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/31416 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 95 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: