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

Unified Diff: third_party/WebKit/Source/bindings/templates/interface_base.cpp

Issue 1366643003: [DO NOT LAND] Set @@toStringTag for DOM object prototypes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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/bindings/templates/interface_base.cpp
diff --git a/third_party/WebKit/Source/bindings/templates/interface_base.cpp b/third_party/WebKit/Source/bindings/templates/interface_base.cpp
index 3f4e4511ea482a2666ffa5ce84cb8c764a8e155b..9716125107801ce15d1b788bd74c28fc4bd5b021 100644
--- a/third_party/WebKit/Source/bindings/templates/interface_base.cpp
+++ b/third_party/WebKit/Source/bindings/templates/interface_base.cpp
@@ -472,6 +472,13 @@ static void install{{v8_class}}Template(v8::Local<v8::FunctionTemplate> function
functionTemplate->SetHiddenPrototype(true);
{% endif %}
+ {# Willful violation of WebIDL 4.5.4 and 4.7 - implement the class string
+ for interfaces via @@toStringTag on the prototype. WebIDL requires
+ @@toStringTag instances and prototype (with 'Prototype' appended) but
+ this has performance concerns and may not be necessary for web compat.
+ https://www.w3.org/Bugs/Public/show_bug.cgi?id=28244 #}
+ prototypeTemplate->Set(v8::Symbol::GetToStringTag(isolate), v8AtomicString(isolate, "{{interface_name}}"));
+
// Custom toString template
functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::from(isolate)->toStringTemplate());
{% endif %}

Powered by Google App Engine
This is Rietveld 408576698