|
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
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
|
Total messages: 4 (1 generated)
|