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

Unified Diff: third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.cpp

Issue 2024073002: Add callbacks to ScriptCustomElementDefinition (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add tryCatch Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.cpp
diff --git a/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.cpp b/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.cpp
index 031cf43724dfcc92528917cf05a45a356ba8ede6..158184bf02a85cc559b3f6943ce571ee0d763406 100644
--- a/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.cpp
+++ b/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.cpp
@@ -123,7 +123,10 @@ void CustomElementsRegistry::define(
// TODO(dominicc): Implement steps:
// 5: localName
// 6-7: extends processing
- // 8-9: observed attributes caching
+
+ // 8-9: observed attributes caching is done below, together with callbacks.
+ // TODO(kojii): https://github.com/whatwg/html/issues/1373 for the ordering.
+ // When it's resolved, revisit if this code needs changes.
// TODO(dominicc): Add a test where the prototype getter destroys
// the context.
@@ -131,11 +134,14 @@ void CustomElementsRegistry::define(
if (!builder.checkPrototype())
return;
- // TODO(dominicc): Implement steps:
+ // 8-9: observed attributes caching
// 12-13: connected callback
// 14-15: disconnected callback
// 16-17: attribute changed callback
+ if (!builder.rememberOriginalProperties())
+ return;
+
// TODO(dominicc): Add a test where retrieving the prototype
// recursively calls define with the same name.

Powered by Google App Engine
This is Rietveld 408576698