Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(430)

Issue 943013002: Implement Custom Elements (Closed)

Created:
5 years, 10 months ago by abarth-chromium
Modified:
5 years, 10 months ago
Reviewers:
ojan
CC:
eseidel, esprehn, mojo-reviews_chromium.org, ojan, qsr+mojo_chromium.org
Base URL:
git@github.com:domokit/mojo.git@master
Target Ref:
refs/heads/master
Project:
mojo
Visibility:
Public.

Description

Implement Custom Elements This CL implements custom elements. The design is as follows: 1) Authors subclass Element and call registerElement. 2) When we create C++ elements for custom elements, we call the author's constructor synchronously. 3) The attach/detach/attributeChanged callbacks are called either: a) when exiting the current custom element callback scoped (e.g., before returning from appendChild), or b) when draining the microtask queue. The implementation in this CL is a bit fragile because we don't detect name registration conflicts and we let you create custom elements with the same name as built-in elements. Also, not every part of the engine is prepared to execute script synchronously below createElement. We'll need to iron out these issues over time, but this CL is a start. R=ojan@chromium.org Committed: https://chromium.googlesource.com/external/mojo/+/2d2d1918a543b85e2c13134af4aee6d790f4c864

Patch Set 1 #

Patch Set 2 : attributeChanged***d***Callback #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+436 lines, -69 lines) Patch
M sky/engine/bindings/scripts/templates/attributes_cpp.template View 1 chunk +1 line, -1 line 0 comments Download
M sky/engine/bindings/scripts/templates/methods_cpp.template View 1 chunk +1 line, -1 line 0 comments Download
M sky/engine/bindings/scripts/v8_attributes.py View 1 chunk +1 line, -1 line 0 comments Download
M sky/engine/bindings/scripts/v8_methods.py View 1 chunk +1 line, -1 line 0 comments Download
M sky/engine/build/scripts/templates/ElementFactory.cpp.tmpl View 2 chunks +2 lines, -7 lines 0 comments Download
M sky/engine/core/core.gni View 1 chunk +6 lines, -0 lines 0 comments Download
M sky/engine/core/dom/Document.h View 4 chunks +4 lines, -4 lines 0 comments Download
M sky/engine/core/dom/Document.cpp View 7 chunks +9 lines, -10 lines 0 comments Download
M sky/engine/core/dom/Document.idl View 1 chunk +1 line, -2 lines 0 comments Download
M sky/engine/core/dom/DocumentInit.h View 3 chunks +8 lines, -5 lines 0 comments Download
M sky/engine/core/dom/DocumentInit.cpp View 3 chunks +5 lines, -10 lines 0 comments Download
M sky/engine/core/dom/Element.h View 1 chunk +3 lines, -0 lines 0 comments Download
M sky/engine/core/dom/Element.cpp View 7 chunks +14 lines, -8 lines 2 comments Download
M sky/engine/core/dom/Element.idl View 1 chunk +6 lines, -3 lines 0 comments Download
M sky/engine/core/dom/Node.idl View 1 chunk +4 lines, -4 lines 0 comments Download
M sky/engine/core/dom/ParentNode.idl View 1 chunk +7 lines, -7 lines 0 comments Download
A sky/engine/core/dom/custom2/new_custom_element.h View 1 chunk +26 lines, -0 lines 0 comments Download
A sky/engine/core/dom/custom2/new_custom_element.cc View 1 1 chunk +86 lines, -0 lines 2 comments Download
A sky/engine/core/dom/custom2/new_custom_element_callback_scope.h View 1 chunk +29 lines, -0 lines 0 comments Download
A sky/engine/core/dom/custom2/new_custom_element_callback_scope.cc View 1 chunk +39 lines, -0 lines 0 comments Download
A sky/engine/core/dom/custom2/new_custom_element_registry.h View 1 chunk +46 lines, -0 lines 0 comments Download
A sky/engine/core/dom/custom2/new_custom_element_registry.cc View 1 chunk +48 lines, -0 lines 0 comments Download
M sky/engine/core/html/imports/HTMLImportLoader.cpp View 1 chunk +1 line, -1 line 0 comments Download
M sky/engine/web/WebElement.cpp View 3 chunks +3 lines, -3 lines 0 comments Download
A sky/tests/custom-elements/callbacks.sky View 1 1 chunk +55 lines, -0 lines 0 comments Download
A + sky/tests/custom-elements/callbacks-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
A sky/tests/custom-elements/registration.sky View 1 1 chunk +27 lines, -0 lines 0 comments Download
A sky/tests/custom-elements/registration-expected.txt View 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (1 generated)
ojan
lgtm. Elliott should probably review too, but that doesn't necessarily need to block landing. https://codereview.chromium.org/943013002/diff/20001/sky/engine/core/dom/Element.cpp ...
5 years, 10 months ago (2015-02-20 23:09:34 UTC) #2
abarth-chromium
https://codereview.chromium.org/943013002/diff/20001/sky/engine/core/dom/Element.cpp File sky/engine/core/dom/Element.cpp (right): https://codereview.chromium.org/943013002/diff/20001/sky/engine/core/dom/Element.cpp#newcode95 sky/engine/core/dom/Element.cpp:95: element->setCustomElementState(Element::Upgraded); On 2015/02/20 at 23:09:34, ojan wrote: > Presumablye ...
5 years, 10 months ago (2015-02-21 00:00:45 UTC) #3
abarth-chromium
5 years, 10 months ago (2015-02-21 00:15:46 UTC) #4
Message was sent while issue was closed.
Committed patchset #2 (id:20001) manually as
2d2d1918a543b85e2c13134af4aee6d790f4c864 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698