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

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

Issue 1017733003: [DO NOT LAND] Set @@toStringTag for DOM object prototypes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Test expectations Created 5 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: Source/bindings/templates/interface_base.cpp
diff --git a/Source/bindings/templates/interface_base.cpp b/Source/bindings/templates/interface_base.cpp
index 1d817dd1f9eff827971e41c2c8afd5c37141524a..be331daabaada9df03d29876b6d4ddf260d6011f 100644
--- a/Source/bindings/templates/interface_base.cpp
+++ b/Source/bindings/templates/interface_base.cpp
@@ -469,6 +469,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