Form-associated custom elements: Support the state restore feature
Restarting Chrome application, duplicate a tab, and back/forward navigation call 'restoreValueCallback' of form-associated custom elements to restore their state. Implementation: * element_internals.{h,cc}: Hook some methods to support the state restore feature. ElementInternals::RestoreFormControlState() posts a microtask to call 'restoreValueCallback'. * form_controller.{h,cc}: - ControlType() supports ElementInternals. We store custom element name as a type. - SavedFormState::Deserialize(): Accept custom element names. - FormController::RestoreControlStateOnUpgrade(): Added for upgraded custom elements. * html_element.{h,cc}: FinishParsingChildren() Hook it to restore the state of form-associated custom elements which are not owned by a <form>. * file.{h,cc}, file_input_type.cc: Move logic to save/restore File state to blink::File in order to share it with ElementInternals. Change-Id: Idb8ea5d333afbd566ae838334800cbf0b8128af5 Reviewed-on: https://chromium-review.googlesource.com/c/1436416Reviewed-by:Hayato Ito <hayato@chromium.org> Commit-Queue: Hayato Ito <hayato@chromium.org> Commit-Queue: Kent Tamura <tkent@chromium.org> Auto-Submit: Kent Tamura <tkent@chromium.org> Cr-Commit-Position: refs/heads/master@{#626447}
Showing
Please register or sign in to comment