Custom elements: implement custom element reaction's formStateRestoreCallback
Categories
(Core :: DOM: Core & HTML, enhancement, P3)
Tracking
()
People
(Reporter: jdai, Assigned: avandolder)
References
(Blocks 2 open bugs, )
Details
Attachments
(4 files, 1 obsolete file)
| Reporter | ||
Updated•5 years ago
|
Comment 1•4 years ago
|
||
We need to figure out how to support form restoration or autocomplete for form-associated custom elements first.
Updated•4 years ago
|
Updated•3 years ago
|
| Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
| Assignee | ||
Comment 2•2 years ago
|
||
Updated•2 years ago
|
| Assignee | ||
Comment 3•2 years ago
|
||
Depends on D174114
Comment 4•2 years ago
|
||
Hi team.
Just to alert you that on Edge (Chromium based), there is a bug that related to the value being passed instead of the state:
https://bugs.chromium.org/p/chromium/issues/detail?id=1429585
Edge leaves live pages in a broken state, where as Chrome (stable) has not implemented yet.
Looking at a D174115 test, it treats state as value, which may pass, but note that state could be something like 'checked' or 'unchecked' which is to be parsed into a computed value (eg: checked). This near-exact example is given in the spec.
A test that ensures that null is passed for an unchecked radio-button from a page that called ElementInternals.setFormValue(null) could ensure we avoid some possible bugs.
Updated•2 years ago
|
| Assignee | ||
Comment 5•2 years ago
|
||
I realized that the method I was using to test the patch is actually broken right now, and won't be possible until bug 1502814 gets fixed.
| Assignee | ||
Comment 6•2 years ago
|
||
Depends on D174114
Comment 7•2 years ago
|
||
| Assignee | ||
Comment 8•2 years ago
|
||
Depends on D174115
Comment 9•2 years ago
|
||
Comment on attachment 9329660 [details]
Bug 1556358 - Nullable union used as callback arguments needs to be actually declared; r?peterv
Revision D176127 was moved to bug 1836127. Setting attachment 9329660 [details] to obsolete.
Comment 10•2 years ago
|
||
Comment 11•2 years ago
|
||
| bugherder | ||
Comment 12•2 years ago
|
||
Comment 13•2 years ago
•
|
||
Backed out 3 changesets (Bug 1556358) for causing bustages in ElementInternals.cpp CLOSED TREE
Log: https://treeherder.mozilla.org/logviewer?job_id=419337358&repo=autoland&lineNumber=10831
https://treeherder.mozilla.org/logviewer?job_id=419347156&repo=autoland&lineNumber=2134
Backout: https://hg.mozilla.org/integration/autoland/rev/f9a60b1fb1fcbdf257a253cd78f89de6fe9b3b5e
| Assignee | ||
Comment 14•2 years ago
|
||
The failure during test-verify appears to be a result of a pref changing in the background, unrelated to these patches; it should be fixed once https://bugzilla.mozilla.org/show_bug.cgi?id=1838233 lands.
Comment 15•2 years ago
|
||
Comment 16•2 years ago
|
||
Backed out for causing Bb build bustages in ElementInternals.cpp.
- Backout link
- Push with failures
- Failure Log
- Failure line: /builds/worker/checkouts/gecko/dom/html/ElementInternals.cpp:473:10: error: no matching function for call to 'nsContentUtils::EnqueueLifecycleCallback(mozilla::dom::ElementCallbackType, RefPtr<mozilla::dom::HTMLElement>&, <brace-enclosed initializer list>)'
| Assignee | ||
Comment 17•2 years ago
|
||
(In reply to Serban Stanca [:SerbanS] from comment #16)
Backed out for causing Bb build bustages in ElementInternals.cpp.
- Backout link
- Push with failures
- Failure Log
- Failure line: /builds/worker/checkouts/gecko/dom/html/ElementInternals.cpp:473:10: error: no matching function for call to 'nsContentUtils::EnqueueLifecycleCallback(mozilla::dom::ElementCallbackType, RefPtr<mozilla::dom::HTMLElement>&, <brace-enclosed initializer list>)'
Hmm. I'll admit I have no idea what is causing this failure. The changes from D174114 should have already landed, so that call should be fine. I guess I'll try landing the patches one at a time and see if that works instead.
Comment 18•2 years ago
|
||
Comment 19•2 years ago
|
||
| bugherder | ||
Comment 20•2 years ago
|
||
Comment 21•2 years ago
|
||
Backed out for causing Bb bustages on ElementInternals.cpp
Comment 22•2 years ago
|
||
Comment 23•2 years ago
|
||
(lets reopen this first and close once all part is stick)
Comment 24•2 years ago
|
||
(And I think we are no longer depend on bug 1502814 as tests now use same document to test)
Comment 25•2 years ago
|
||
Backed out for causing bustage on ElementInternals.cpp
- backout: https://hg.mozilla.org/integration/autoland/rev/9b4582f72278af7055aa5c0c7656b2f2b313ff44
- push: https://treeherder.mozilla.org/jobs?repo=autoland&selectedTaskRun=cPh49cewSECqhrrWlCqAYw.0&revision=08f12e7fa5f04d9acf47a841046c192b3b6b9b71
- failure log: https://treeherder.mozilla.org/logviewer?job_id=419874849&repo=autoland&lineNumber=10469
[task 2023-06-19T17:40:25.512Z] 17:40:25 INFO - In file included from Unified_cpp_dom_html0.cpp:11:
[task 2023-06-19T17:40:25.512Z] 17:40:25 INFO - /builds/worker/checkouts/gecko/dom/html/ElementInternals.cpp: In member function 'void mozilla::dom::ElementInternals::RestoreFormValue(mozilla::dom::Nullable<mozilla::dom::OwningFileOrUSVStringOrFormData>&&, mozilla::dom::Nullable<mozilla::dom::OwningFileOrUSVStringOrFormData>&&)':
[task 2023-06-19T17:40:25.512Z] 17:40:25 ERROR - /builds/worker/checkouts/gecko/dom/html/ElementInternals.cpp:473:10: error: no matching function for call to 'nsContentUtils::EnqueueLifecycleCallback(mozilla::dom::ElementCallbackType, RefPtr<mozilla::dom::HTMLElement>&, <brace-enclosed initializer list>)'
[task 2023-06-19T17:40:25.512Z] 17:40:25 INFO - });
[task 2023-06-19T17:40:25.512Z] 17:40:25 INFO - ^
Updated•2 years ago
|
| Assignee | ||
Comment 26•2 years ago
|
||
(In reply to Adam Vandolder [:avandolder] from comment #17)
(In reply to Serban Stanca [:SerbanS] from comment #16)
Backed out for causing Bb build bustages in ElementInternals.cpp.
- Backout link
- Push with failures
- Failure Log
- Failure line: /builds/worker/checkouts/gecko/dom/html/ElementInternals.cpp:473:10: error: no matching function for call to 'nsContentUtils::EnqueueLifecycleCallback(mozilla::dom::ElementCallbackType, RefPtr<mozilla::dom::HTMLElement>&, <brace-enclosed initializer list>)'
Hmm. I'll admit I have no idea what is causing this failure. The changes from D174114 should have already landed, so that call should be fine. I guess I'll try landing the patches one at a time and see if that works instead.
So I think the cause is that, for whatever reason, this one specific linux64-debug build uses --std=gnu++17, which might not properly support aggregate initialization with designated initializers as they are a C++20 feature. At least now I know the problem wasn't how I was trying to land the stack.
Comment 27•2 years ago
|
||
Comment 28•2 years ago
•
|
||
Backed out for causing wpt failures on ElementInternals-setFormValue.html.
[task 2023-06-20T05:04:04.417Z] 05:04:04 INFO - TEST-START | /custom-elements/form-associated/ElementInternals-setFormValue.html
[task 2023-06-20T05:04:04.433Z] 05:04:04 INFO - Closing window 16dcadac-9476-4255-ac1f-978c1f3703c4
[task 2023-06-20T05:04:06.977Z] 05:04:06 INFO - PID 7319 | -----------------------------------------------------
[task 2023-06-20T05:04:06.977Z] 05:04:06 INFO - PID 7319 | Suppressions used:
[task 2023-06-20T05:04:06.977Z] 05:04:06 INFO - PID 7319 | count bytes template
[task 2023-06-20T05:04:06.978Z] 05:04:06 INFO - PID 7319 | 2 288 libfontconfig.so
[task 2023-06-20T05:04:06.978Z] 05:04:06 INFO - PID 7319 | -----------------------------------------------------
[task 2023-06-20T05:04:07.579Z] 05:04:07 INFO -
[task 2023-06-20T05:04:07.579Z] 05:04:07 INFO - TEST-PASS | /custom-elements/form-associated/ElementInternals-setFormValue.html | Single value - name is missing
[task 2023-06-20T05:04:07.579Z] 05:04:07 INFO - TEST-PASS | /custom-elements/form-associated/ElementInternals-setFormValue.html | Single value - empty name exists
[task 2023-06-20T05:04:07.579Z] 05:04:07 INFO - TEST-UNEXPECTED-FAIL | /custom-elements/form-associated/ElementInternals-setFormValue.html | Single value - Non-empty name exists - assert_equals: expected "?name-pd1=value-pd1&name-usv=abc%EF%BF%BD%EF%BF%BDdef&name-file=test_file.txt" but got "?name-pd1=value-pd1&name-ce1=value-ce1&name-usv=abc%EF%BF%BD%EF%BF%BDdef&name-file=test_file.txt"
[task 2023-06-20T05:04:07.579Z] 05:04:07 INFO - @http://web-platform.test:8000/custom-elements/form-associated/ElementInternals-setFormValue.html:153:18
[task 2023-06-20T05:04:07.579Z] 05:04:07 INFO -
[task 2023-06-20T05:04:07.579Z] 05:04:07 INFO - TEST-UNEXPECTED-FAIL | /custom-elements/form-associated/ElementInternals-setFormValue.html | Null value should submit nothing - assert_equals: expected "?name-pd1=value-pd1" but got "?name-pd1=value-pd1&name-ce2=abc%EF%BF%BD%EF%BF%BDdef"
[task 2023-06-20T05:04:07.579Z] 05:04:07 INFO - @http://web-platform.test:8000/custom-elements/form-associated/ElementInternals-setFormValue.html:166:18
[task 2023-06-20T05:04:07.595Z] 05:04:07 INFO - ...................................................
[task 2023-06-20T05:04:07.596Z] 05:04:07 INFO - TEST-OK | /custom-elements/form-associated/ElementInternals-setFormValue.html | took 3168ms
Comment 29•2 years ago
|
||
Comment 30•2 years ago
|
||
| bugherder | ||
| Assignee | ||
Updated•2 years ago
|
Comment 31•2 years ago
|
||
Comment 32•2 years ago
|
||
| bugherder | ||
Comment 33•2 years ago
|
||
Adam, is there anything planned to be done in this bug? If not, please remove the leave-open keyword and close this. Thank you!
| Assignee | ||
Updated•2 years ago
|
Comment 34•2 years ago
|
||
:avandolder is this something you want to nominate for fx116 relnotes?
| Assignee | ||
Comment 35•2 years ago
|
||
Release Note Request (optional, but appreciated)
[Why is this notable]: Adds support for a new reaction callback on custom element definitions, formStateRestoreCallback.
[Affects Firefox for Android]: n/a
[Suggested wording]: Usage of the formStateRestoreCallback custom element reaction callback is now supported, allowing developers to add support for browser's attempting to restore prior user state. Note that 'autocomplete' for custom elements remains unsupported.
[Links (documentation, blog post, etc)]: Specification is at https://html.spec.whatwg.org/multipage/custom-elements.html#custom-element-reactions, an explanatory post from the Chrome devs is at https://web.dev/more-capable-form-controls/
Comment 36•2 years ago
|
||
Added to 116 release notes, currently in beta https://www.mozilla.org/en-US/firefox/116.0beta/releasenotes/
Description
•