The current implementation of custom elements does not follow HTML standard, and does not use IDL callback functions. Custom elements should be implemented based on IDL callback functions so that the incumbent realm will be handled correctly.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/e181bc53635e66cbc80ab91781fd07b4e2140d50 commit e181bc53635e66cbc80ab91781fd07b4e2140d50 Author: Yuki Shiino <yukishiino@chromium.org> Date: Wed Aug 15 08:13:45 2018 v8binding: Support "construct a callback function type value". https://heycam.github.io/webidl/#construct-a-callback-function This patch supports "construct" algorithm of IDL callback functions. The following WIP patch will be going to use this algorithm. https://chromium-review.googlesource.com/c/chromium/src/+/1170731 Bug: 873942 Change-Id: I3d58db6cb4cb23662593e2c96080668346a399a2 Reviewed-on: https://chromium-review.googlesource.com/1174079 Reviewed-by: Hitoshi Yoshida <peria@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Commit-Queue: Yuki Shiino <yukishiino@chromium.org> Cr-Commit-Position: refs/heads/master@{#583192} [modify] https://crrev.com/e181bc53635e66cbc80ab91781fd07b4e2140d50/third_party/blink/renderer/bindings/templates/callback_function.cpp.tmpl [modify] https://crrev.com/e181bc53635e66cbc80ab91781fd07b4e2140d50/third_party/blink/renderer/bindings/templates/callback_function.h.tmpl [modify] https://crrev.com/e181bc53635e66cbc80ab91781fd07b4e2140d50/third_party/blink/renderer/bindings/tests/results/core/v8_any_callback_function_optional_any_arg.cc [modify] https://crrev.com/e181bc53635e66cbc80ab91781fd07b4e2140d50/third_party/blink/renderer/bindings/tests/results/core/v8_any_callback_function_optional_any_arg.h [modify] https://crrev.com/e181bc53635e66cbc80ab91781fd07b4e2140d50/third_party/blink/renderer/bindings/tests/results/core/v8_any_callback_function_variadic_any_args.cc [modify] https://crrev.com/e181bc53635e66cbc80ab91781fd07b4e2140d50/third_party/blink/renderer/bindings/tests/results/core/v8_any_callback_function_variadic_any_args.h [modify] https://crrev.com/e181bc53635e66cbc80ab91781fd07b4e2140d50/third_party/blink/renderer/platform/bindings/callback_function_base.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1ebfa0471a550ebca45a1b68c1354dcadf2ecdd9 commit 1ebfa0471a550ebca45a1b68c1354dcadf2ecdd9 Author: Yuki Shiino <yukishiino@chromium.org> Date: Thu Aug 16 09:47:56 2018 v8binding: Unify similar implementation of callback function/interface. This is a follow-up of https://crrev.com/c/1174079 . Unify very similar implementations of callback interface's operations, callback function's invoke and construct algorithms into a single Jinja2 macro. Bug: 873942 Change-Id: I87a2ce8a0aceeb6a2af07ec4f85b3e1c83d994ae Reviewed-on: https://chromium-review.googlesource.com/1175742 Reviewed-by: Hitoshi Yoshida <peria@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Commit-Queue: Yuki Shiino <yukishiino@chromium.org> Cr-Commit-Position: refs/heads/master@{#583590} [modify] https://crrev.com/1ebfa0471a550ebca45a1b68c1354dcadf2ecdd9/third_party/blink/renderer/bindings/scripts/v8_callback_function.py [modify] https://crrev.com/1ebfa0471a550ebca45a1b68c1354dcadf2ecdd9/third_party/blink/renderer/bindings/scripts/v8_callback_interface.py [modify] https://crrev.com/1ebfa0471a550ebca45a1b68c1354dcadf2ecdd9/third_party/blink/renderer/bindings/scripts/v8_types.py [modify] https://crrev.com/1ebfa0471a550ebca45a1b68c1354dcadf2ecdd9/third_party/blink/renderer/bindings/templates/callback_function.cpp.tmpl [modify] https://crrev.com/1ebfa0471a550ebca45a1b68c1354dcadf2ecdd9/third_party/blink/renderer/bindings/templates/callback_interface.cpp.tmpl [add] https://crrev.com/1ebfa0471a550ebca45a1b68c1354dcadf2ecdd9/third_party/blink/renderer/bindings/templates/callback_invoke.cc.tmpl [modify] https://crrev.com/1ebfa0471a550ebca45a1b68c1354dcadf2ecdd9/third_party/blink/renderer/bindings/templates/templates.gni [modify] https://crrev.com/1ebfa0471a550ebca45a1b68c1354dcadf2ecdd9/third_party/blink/renderer/bindings/tests/results/core/v8_any_callback_function_optional_any_arg.cc [modify] https://crrev.com/1ebfa0471a550ebca45a1b68c1354dcadf2ecdd9/third_party/blink/renderer/bindings/tests/results/core/v8_any_callback_function_variadic_any_args.cc [modify] https://crrev.com/1ebfa0471a550ebca45a1b68c1354dcadf2ecdd9/third_party/blink/renderer/bindings/tests/results/core/v8_long_callback_function.cc [modify] https://crrev.com/1ebfa0471a550ebca45a1b68c1354dcadf2ecdd9/third_party/blink/renderer/bindings/tests/results/core/v8_string_sequence_callback_function_long_sequence_arg.cc [modify] https://crrev.com/1ebfa0471a550ebca45a1b68c1354dcadf2ecdd9/third_party/blink/renderer/bindings/tests/results/core/v8_test_callback_interface.cc [modify] https://crrev.com/1ebfa0471a550ebca45a1b68c1354dcadf2ecdd9/third_party/blink/renderer/bindings/tests/results/core/v8_test_legacy_callback_interface.cc [modify] https://crrev.com/1ebfa0471a550ebca45a1b68c1354dcadf2ecdd9/third_party/blink/renderer/bindings/tests/results/core/v8_void_callback_function.cc [modify] https://crrev.com/1ebfa0471a550ebca45a1b68c1354dcadf2ecdd9/third_party/blink/renderer/bindings/tests/results/core/v8_void_callback_function_dictionary_arg.cc [modify] https://crrev.com/1ebfa0471a550ebca45a1b68c1354dcadf2ecdd9/third_party/blink/renderer/bindings/tests/results/core/v8_void_callback_function_enum_arg.cc [modify] https://crrev.com/1ebfa0471a550ebca45a1b68c1354dcadf2ecdd9/third_party/blink/renderer/bindings/tests/results/core/v8_void_callback_function_interface_arg.cc [modify] https://crrev.com/1ebfa0471a550ebca45a1b68c1354dcadf2ecdd9/third_party/blink/renderer/bindings/tests/results/core/v8_void_callback_function_test_interface_sequence_arg.cc [modify] https://crrev.com/1ebfa0471a550ebca45a1b68c1354dcadf2ecdd9/third_party/blink/renderer/bindings/tests/results/core/v8_void_callback_function_typedef.cc [modify] https://crrev.com/1ebfa0471a550ebca45a1b68c1354dcadf2ecdd9/third_party/blink/renderer/bindings/tests/results/modules/v8_void_callback_function_modules.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/fb6c96410a9094159c954a55fead45102a2ff18d commit fb6c96410a9094159c954a55fead45102a2ff18d Author: Yuki Shiino <yukishiino@chromium.org> Date: Tue Sep 25 07:20:30 2018 v8binding: Implement custom elements based on IDL callback function. CustomElementRegistry.define() is defined based on IDL callback function in HTML standard. This patch re-implements custom elements based on CallbackFunctionBase. A new class CallbackMethodRetriever will be shared among CSS Painting API, CSS Animation, etc. because these standards follow the same way as custom elements. The new implementation collectly implements the Entry and Incumbent realm. Especially the Entry realm is fixed to use the callback function's associated realm. Bug: chromium:873942 Change-Id: Ib2d77c5b09073c62e210ce77fad57c35a27ea62c Reviewed-on: https://chromium-review.googlesource.com/1170731 Commit-Queue: Yuki Shiino <yukishiino@chromium.org> Reviewed-by: Kent Tamura <tkent@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Cr-Commit-Position: refs/heads/master@{#593846} [modify] https://crrev.com/fb6c96410a9094159c954a55fead45102a2ff18d/third_party/WebKit/LayoutTests/custom-elements/constructor-may-poach-upgrading-element.html [modify] https://crrev.com/fb6c96410a9094159c954a55fead45102a2ff18d/third_party/WebKit/LayoutTests/custom-elements/spec/construct.html [modify] https://crrev.com/fb6c96410a9094159c954a55fead45102a2ff18d/third_party/WebKit/LayoutTests/custom-elements/spec/create-element-defined-synchronous.html [modify] https://crrev.com/fb6c96410a9094159c954a55fead45102a2ff18d/third_party/WebKit/LayoutTests/custom-elements/spec/state-failed-upgrade.html [modify] https://crrev.com/fb6c96410a9094159c954a55fead45102a2ff18d/third_party/WebKit/LayoutTests/custom-elements/spec/upgrade-element.html [modify] https://crrev.com/fb6c96410a9094159c954a55fead45102a2ff18d/third_party/blink/renderer/bindings/core/v8/BUILD.gn [modify] https://crrev.com/fb6c96410a9094159c954a55fead45102a2ff18d/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition.cc [modify] https://crrev.com/fb6c96410a9094159c954a55fead45102a2ff18d/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition.h [modify] https://crrev.com/fb6c96410a9094159c954a55fead45102a2ff18d/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition_builder.cc [modify] https://crrev.com/fb6c96410a9094159c954a55fead45102a2ff18d/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition_builder.h [modify] https://crrev.com/fb6c96410a9094159c954a55fead45102a2ff18d/third_party/blink/renderer/bindings/scripts/v8_types.py [modify] https://crrev.com/fb6c96410a9094159c954a55fead45102a2ff18d/third_party/blink/renderer/core/dom/document.idl [modify] https://crrev.com/fb6c96410a9094159c954a55fead45102a2ff18d/third_party/blink/renderer/core/html/custom/custom_element_definition_builder.h [modify] https://crrev.com/fb6c96410a9094159c954a55fead45102a2ff18d/third_party/blink/renderer/core/html/custom/custom_element_registry.cc [modify] https://crrev.com/fb6c96410a9094159c954a55fead45102a2ff18d/third_party/blink/renderer/core/html/custom/custom_element_registry.h [modify] https://crrev.com/fb6c96410a9094159c954a55fead45102a2ff18d/third_party/blink/renderer/core/html/custom/custom_element_registry.idl [modify] https://crrev.com/fb6c96410a9094159c954a55fead45102a2ff18d/third_party/blink/renderer/core/html/custom/custom_element_registry_test.cc [modify] https://crrev.com/fb6c96410a9094159c954a55fead45102a2ff18d/third_party/blink/renderer/core/html/custom/custom_element_test.cc [modify] https://crrev.com/fb6c96410a9094159c954a55fead45102a2ff18d/third_party/blink/renderer/core/html/custom/custom_element_test_helpers.h [modify] https://crrev.com/fb6c96410a9094159c954a55fead45102a2ff18d/third_party/blink/renderer/platform/BUILD.gn [add] https://crrev.com/fb6c96410a9094159c954a55fead45102a2ff18d/third_party/blink/renderer/platform/bindings/callback_method_retriever.cc [add] https://crrev.com/fb6c96410a9094159c954a55fead45102a2ff18d/third_party/blink/renderer/platform/bindings/callback_method_retriever.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f947f7d357b36bc53348206074e6658ddc16ad6c commit f947f7d357b36bc53348206074e6658ddc16ad6c Author: Colin Blundell <blundell@chromium.org> Date: Tue Sep 25 09:23:41 2018 Revert "v8binding: Implement custom elements based on IDL callback function." This reverts commit fb6c96410a9094159c954a55fead45102a2ff18d. Reason for revert: Causing failures on many tests in https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Linux%20Tests%20%28dbg%29%281%29%2832%29/53032 Example failure here: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8934428546391264512/+/steps/sync_integration_tests/0/logs/TwoClientAppsSyncTest.StartWithDifferentApps/0 Original change's description: > v8binding: Implement custom elements based on IDL callback function. > > CustomElementRegistry.define() is defined based on IDL callback > function in HTML standard. This patch re-implements custom > elements based on CallbackFunctionBase. > > A new class CallbackMethodRetriever will be shared among > CSS Painting API, CSS Animation, etc. because these standards > follow the same way as custom elements. > > The new implementation collectly implements the Entry and > Incumbent realm. Especially the Entry realm is fixed to > use the callback function's associated realm. > > Bug: chromium:873942 > Change-Id: Ib2d77c5b09073c62e210ce77fad57c35a27ea62c > Reviewed-on: https://chromium-review.googlesource.com/1170731 > Commit-Queue: Yuki Shiino <yukishiino@chromium.org> > Reviewed-by: Kent Tamura <tkent@chromium.org> > Reviewed-by: Kentaro Hara <haraken@chromium.org> > Cr-Commit-Position: refs/heads/master@{#593846} TBR=yukishiino@chromium.org,hayato@chromium.org,haraken@chromium.org,tkent@chromium.org Change-Id: I1950e38ba76bec35f692120b7968e072398f86e0 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: chromium:873942 Reviewed-on: https://chromium-review.googlesource.com/1242906 Reviewed-by: Colin Blundell <blundell@chromium.org> Commit-Queue: Colin Blundell <blundell@chromium.org> Cr-Commit-Position: refs/heads/master@{#593873} [modify] https://crrev.com/f947f7d357b36bc53348206074e6658ddc16ad6c/third_party/WebKit/LayoutTests/custom-elements/constructor-may-poach-upgrading-element.html [modify] https://crrev.com/f947f7d357b36bc53348206074e6658ddc16ad6c/third_party/WebKit/LayoutTests/custom-elements/spec/construct.html [modify] https://crrev.com/f947f7d357b36bc53348206074e6658ddc16ad6c/third_party/WebKit/LayoutTests/custom-elements/spec/create-element-defined-synchronous.html [modify] https://crrev.com/f947f7d357b36bc53348206074e6658ddc16ad6c/third_party/WebKit/LayoutTests/custom-elements/spec/state-failed-upgrade.html [modify] https://crrev.com/f947f7d357b36bc53348206074e6658ddc16ad6c/third_party/WebKit/LayoutTests/custom-elements/spec/upgrade-element.html [modify] https://crrev.com/f947f7d357b36bc53348206074e6658ddc16ad6c/third_party/blink/renderer/bindings/core/v8/BUILD.gn [modify] https://crrev.com/f947f7d357b36bc53348206074e6658ddc16ad6c/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition.cc [modify] https://crrev.com/f947f7d357b36bc53348206074e6658ddc16ad6c/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition.h [modify] https://crrev.com/f947f7d357b36bc53348206074e6658ddc16ad6c/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition_builder.cc [modify] https://crrev.com/f947f7d357b36bc53348206074e6658ddc16ad6c/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition_builder.h [modify] https://crrev.com/f947f7d357b36bc53348206074e6658ddc16ad6c/third_party/blink/renderer/bindings/scripts/v8_types.py [modify] https://crrev.com/f947f7d357b36bc53348206074e6658ddc16ad6c/third_party/blink/renderer/core/dom/document.idl [modify] https://crrev.com/f947f7d357b36bc53348206074e6658ddc16ad6c/third_party/blink/renderer/core/html/custom/custom_element_definition_builder.h [modify] https://crrev.com/f947f7d357b36bc53348206074e6658ddc16ad6c/third_party/blink/renderer/core/html/custom/custom_element_registry.cc [modify] https://crrev.com/f947f7d357b36bc53348206074e6658ddc16ad6c/third_party/blink/renderer/core/html/custom/custom_element_registry.h [modify] https://crrev.com/f947f7d357b36bc53348206074e6658ddc16ad6c/third_party/blink/renderer/core/html/custom/custom_element_registry.idl [modify] https://crrev.com/f947f7d357b36bc53348206074e6658ddc16ad6c/third_party/blink/renderer/core/html/custom/custom_element_registry_test.cc [modify] https://crrev.com/f947f7d357b36bc53348206074e6658ddc16ad6c/third_party/blink/renderer/core/html/custom/custom_element_test.cc [modify] https://crrev.com/f947f7d357b36bc53348206074e6658ddc16ad6c/third_party/blink/renderer/core/html/custom/custom_element_test_helpers.h [modify] https://crrev.com/f947f7d357b36bc53348206074e6658ddc16ad6c/third_party/blink/renderer/platform/BUILD.gn [delete] https://crrev.com/94412cb311654e5e50b429d6d44412e60d66807e/third_party/blink/renderer/platform/bindings/callback_method_retriever.cc [delete] https://crrev.com/94412cb311654e5e50b429d6d44412e60d66807e/third_party/blink/renderer/platform/bindings/callback_method_retriever.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b5fb537e6644f2db2064f138c2d50c549edbc804 commit b5fb537e6644f2db2064f138c2d50c549edbc804 Author: Yuki Shiino <yukishiino@chromium.org> Date: Wed Sep 26 05:12:49 2018 Reland "v8binding: Implement custom elements based on IDL callback function." This is a reland of fb6c96410a9094159c954a55fead45102a2ff18d The change from the reverted one is a bug fix. In the previous patch, v8::Undefined is mistakenly stored in v8::Local<v8::Function> and it caused a type error. This patch uses v8::Local<v8::Value> instead, so that it safely represents v8::Function or v8::Undefined. Original change's description: > v8binding: Implement custom elements based on IDL callback function. > > CustomElementRegistry.define() is defined based on IDL callback > function in HTML standard. This patch re-implements custom > elements based on CallbackFunctionBase. > > A new class CallbackMethodRetriever will be shared among > CSS Painting API, CSS Animation, etc. because these standards > follow the same way as custom elements. > > The new implementation collectly implements the Entry and > Incumbent realm. Especially the Entry realm is fixed to > use the callback function's associated realm. > > Bug: chromium:873942 > Change-Id: Ib2d77c5b09073c62e210ce77fad57c35a27ea62c > Reviewed-on: https://chromium-review.googlesource.com/1170731 > Commit-Queue: Yuki Shiino <yukishiino@chromium.org> > Reviewed-by: Kent Tamura <tkent@chromium.org> > Reviewed-by: Kentaro Hara <haraken@chromium.org> > Cr-Commit-Position: refs/heads/master@{#593846} Bug: chromium:873942 Change-Id: I001d383a1fa6a1605713c50e37ad00b39f2e8194 Reviewed-on: https://chromium-review.googlesource.com/1242784 Reviewed-by: Kentaro Hara <haraken@chromium.org> Reviewed-by: Kent Tamura <tkent@chromium.org> Reviewed-by: Hayato Ito <hayato@chromium.org> Commit-Queue: Yuki Shiino <yukishiino@chromium.org> Cr-Commit-Position: refs/heads/master@{#594225} [modify] https://crrev.com/b5fb537e6644f2db2064f138c2d50c549edbc804/third_party/WebKit/LayoutTests/custom-elements/constructor-may-poach-upgrading-element.html [modify] https://crrev.com/b5fb537e6644f2db2064f138c2d50c549edbc804/third_party/WebKit/LayoutTests/custom-elements/spec/construct.html [modify] https://crrev.com/b5fb537e6644f2db2064f138c2d50c549edbc804/third_party/WebKit/LayoutTests/custom-elements/spec/create-element-defined-synchronous.html [modify] https://crrev.com/b5fb537e6644f2db2064f138c2d50c549edbc804/third_party/WebKit/LayoutTests/custom-elements/spec/state-failed-upgrade.html [modify] https://crrev.com/b5fb537e6644f2db2064f138c2d50c549edbc804/third_party/WebKit/LayoutTests/custom-elements/spec/upgrade-element.html [modify] https://crrev.com/b5fb537e6644f2db2064f138c2d50c549edbc804/third_party/blink/renderer/bindings/core/v8/BUILD.gn [modify] https://crrev.com/b5fb537e6644f2db2064f138c2d50c549edbc804/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition.cc [modify] https://crrev.com/b5fb537e6644f2db2064f138c2d50c549edbc804/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition.h [modify] https://crrev.com/b5fb537e6644f2db2064f138c2d50c549edbc804/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition_builder.cc [modify] https://crrev.com/b5fb537e6644f2db2064f138c2d50c549edbc804/third_party/blink/renderer/bindings/core/v8/script_custom_element_definition_builder.h [modify] https://crrev.com/b5fb537e6644f2db2064f138c2d50c549edbc804/third_party/blink/renderer/bindings/scripts/v8_types.py [modify] https://crrev.com/b5fb537e6644f2db2064f138c2d50c549edbc804/third_party/blink/renderer/core/dom/document.idl [modify] https://crrev.com/b5fb537e6644f2db2064f138c2d50c549edbc804/third_party/blink/renderer/core/html/custom/custom_element_definition_builder.h [modify] https://crrev.com/b5fb537e6644f2db2064f138c2d50c549edbc804/third_party/blink/renderer/core/html/custom/custom_element_registry.cc [modify] https://crrev.com/b5fb537e6644f2db2064f138c2d50c549edbc804/third_party/blink/renderer/core/html/custom/custom_element_registry.h [modify] https://crrev.com/b5fb537e6644f2db2064f138c2d50c549edbc804/third_party/blink/renderer/core/html/custom/custom_element_registry.idl [modify] https://crrev.com/b5fb537e6644f2db2064f138c2d50c549edbc804/third_party/blink/renderer/core/html/custom/custom_element_registry_test.cc [modify] https://crrev.com/b5fb537e6644f2db2064f138c2d50c549edbc804/third_party/blink/renderer/core/html/custom/custom_element_test.cc [modify] https://crrev.com/b5fb537e6644f2db2064f138c2d50c549edbc804/third_party/blink/renderer/core/html/custom/custom_element_test_helpers.h [modify] https://crrev.com/b5fb537e6644f2db2064f138c2d50c549edbc804/third_party/blink/renderer/platform/BUILD.gn [add] https://crrev.com/b5fb537e6644f2db2064f138c2d50c549edbc804/third_party/blink/renderer/platform/bindings/callback_method_retriever.cc [add] https://crrev.com/b5fb537e6644f2db2064f138c2d50c549edbc804/third_party/blink/renderer/platform/bindings/callback_method_retriever.h
Comment 1 by bugdroid1@chromium.org
, Aug 15