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

Issue 1017733003: [DO NOT LAND] Set @@toStringTag for DOM object prototypes (Closed)

Created:
5 years, 9 months ago by jsbell
Modified:
5 years, 3 months ago
CC:
arv+blink, blink-reviews, blink-reviews-bindings_chromium.org, vivekg_samsung, vivekg
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

[DO NOT LAND] Set @@toStringTag for DOM object prototypes [DO NOT LAND] Requires "--harmony-tostring" support enabled. The behavior change is that ({}).toString.call() on a prototype will return "[object HTMLElement]" rather than "[object Object]". This also allows us to remove calling SetClassName() on each instance, bringing the DOM and ES6 closer together. This is a willful violation of WebIDL, which explicitly requires a @@toStringTag property on each *instance* (e.g. "HTMLElement") and on each prototype (e.g. "HTMLElementPrototype"). We do not believe there is a web compat issue since Blink has never returned a particular string, but we'll need to watch closely. https://www.w3.org/Bugs/Public/show_bug.cgi?id=28244 BUG=239915

Patch Set 1 #

Patch Set 2 : Investigate and address fast/ failures #

Patch Set 3 : More test rebaselines #

Total comments: 1

Patch Set 4 : Add dedicated test #

Patch Set 5 : Move @@toStringTag to prototype #

Patch Set 6 : Test expectations #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+398 lines, -223 lines) Patch
M LayoutTests/fast/dom/DOMException/dispatch-event-exception-expected.txt View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/dom/DOMException/prototype-object.html View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/dom/DOMException/prototype-object-expected.txt View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/dom/DOMException/resources/dispatch-event-exception.js View 1 2 3 4 1 chunk +1 line, -2 lines 0 comments Download
M LayoutTests/fast/dom/htmlallcollection-enumerated-properties.html View 1 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/dom/htmlallcollection-enumerated-properties-expected.txt View 1 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/dom/prototype-chain-expected.txt View 1 2 3 4 1 chunk +22 lines, -22 lines 0 comments Download
M LayoutTests/fast/dom/wrapper-classes.html View 1 2 3 4 2 chunks +4 lines, -2 lines 0 comments Download
M LayoutTests/fast/dom/wrapper-classes-expected.txt View 1 2 3 4 1 chunk +150 lines, -150 lines 0 comments Download
M LayoutTests/fast/events/event-view-toString-expected.txt View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
A LayoutTests/fast/js/webidl-class-strings.html View 1 2 3 4 1 chunk +81 lines, -0 lines 0 comments Download
A LayoutTests/fast/js/webidl-class-strings-expected.txt View 1 2 3 4 1 chunk +33 lines, -0 lines 0 comments Download
M LayoutTests/fast/serviceworker/serviceworker-interface-expected.txt View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/workers/shared-worker-replace-self-expected.txt View 1 2 3 4 5 1 chunk +1 line, -1 line 1 comment Download
M LayoutTests/fast/workers/worker-replace-self-expected.txt View 1 2 3 4 5 1 chunk +1 line, -1 line 1 comment Download
M LayoutTests/http/tests/w3c/webperf/approved/UserTiming/idlharness-expected.txt View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
M LayoutTests/http/tests/w3c/webperf/approved/navigation-timing/html/idlharness-expected.txt View 1 2 3 4 5 3 chunks +4 lines, -4 lines 1 comment Download
M LayoutTests/http/tests/xmlhttprequest/XMLHttpRequestException.html View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M LayoutTests/http/tests/xmlhttprequest/XMLHttpRequestException-expected.txt View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-inheritance.html View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
M LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-inheritance-expected.txt View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
M LayoutTests/imported/web-platform-tests/IndexedDB/interfaces-expected.txt View 1 2 3 4 9 chunks +11 lines, -11 lines 0 comments Download
M LayoutTests/imported/web-platform-tests/encoding/idlharness-expected.txt View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M LayoutTests/imported/web-platform-tests/html/browsers/the-window-object/window-prototype-chain-expected.txt View 1 2 3 4 1 chunk +3 lines, -3 lines 0 comments Download
M LayoutTests/inspector/console/console-log-document-proto-expected.txt View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/svg/custom/SVGException-expected.txt View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/svg/custom/script-tests/SVGException.js View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/bindings/core/v8/V8DOMConfiguration.cpp View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M Source/bindings/templates/interface.cpp View 1 2 3 4 1 chunk +0 lines, -1 line 0 comments Download
M Source/bindings/templates/interface_base.cpp View 1 2 3 4 1 chunk +7 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/core/V8SVGTestInterface.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestException.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestInterface.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestInterface2.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestInterface3.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestInterfaceAccessors.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M Source/bindings/tests/results/core/V8TestInterfaceConstructor2.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestInterfaceConstructor3.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestInterfaceConstructor4.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestInterfaceCustomConstructor.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestInterfaceDocument.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestInterfaceEmpty.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestInterfaceEventInitConstructor.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestInterfaceEventTarget.cpp View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor2.cpp View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M Source/bindings/tests/results/core/V8TestInterfaceNode.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestInterfaceOwnProperties.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestInterfaceOwnPropertiesDerived.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestInterfaceWillBeGarbageCollected.cpp View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M Source/bindings/tests/results/core/V8TestNode.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestObject.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestSpecialOperations.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestSpecialOperationsNotEnumerable.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/core/V8TestTypedefs.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M Source/bindings/tests/results/modules/V8TestInterface5.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (2 generated)
jsbell
Just throwing this up to see what the bots say - we shouldn't even think ...
5 years, 9 months ago (2015-03-17 23:57:14 UTC) #1
jsbell
On 2015/03/17 23:57:14, jsbell wrote: > * Need to understand and remove/replace result->SetClassName() call from ...
5 years, 9 months ago (2015-03-19 16:52:19 UTC) #2
haraken
LGTM https://codereview.chromium.org/1017733003/diff/40001/Source/bindings/templates/interface_base.cpp File Source/bindings/templates/interface_base.cpp (right): https://codereview.chromium.org/1017733003/diff/40001/Source/bindings/templates/interface_base.cpp#newcode475 Source/bindings/templates/interface_base.cpp:475: instanceTemplate->Set(v8::Symbol::GetToStringTag(isolate), v8AtomicString(isolate, "{{interface_name}}")); Just to confirm: What is ...
5 years, 9 months ago (2015-03-19 23:30:56 UTC) #4
jsbell
On 2015/03/19 23:30:56, haraken wrote: > Just to confirm: What is the interface_name of WebKitTransitionEvent? ...
5 years, 9 months ago (2015-03-19 23:43:21 UTC) #5
jsbell
PS#4 adds a dedicated test fast/js/webidl-class-strings.html - doesn't cover everything in the spec yet, though. ...
5 years, 9 months ago (2015-03-21 00:06:00 UTC) #6
arv (Not doing code reviews)
On 2015/03/21 00:06:00, jsbell wrote: > PS#4 adds a dedicated test fast/js/webidl-class-strings.html - doesn't cover ...
5 years, 6 months ago (2015-06-02 22:25:26 UTC) #7
arv (Not doing code reviews)
I wonder if we can get away with a data property on the prototype only. ...
5 years, 6 months ago (2015-06-02 22:27:08 UTC) #9
jsbell
On 2015/06/02 22:25:26, arv wrote: > > (new Image).__proto__ === document.createElement('img').__proto__ > > > > ...
5 years, 6 months ago (2015-06-03 17:06:23 UTC) #10
arv (Not doing code reviews)
I think we should just skip the Prototype part for now and follow ES6. It ...
5 years, 6 months ago (2015-06-04 15:48:06 UTC) #11
jsbell
Bumped this to align (I think) with arv's proposal.
5 years, 6 months ago (2015-06-05 19:00:44 UTC) #12
arv (Not doing code reviews)
LGTM Lets coordinate landing this ASAP after the next branch has been cut.
5 years, 6 months ago (2015-06-05 19:05:48 UTC) #13
jsbell
Address the text failures from the try job, then putting this on ice for a ...
5 years, 6 months ago (2015-06-05 21:34:40 UTC) #14
arv (Not doing code reviews)
On 2015/06/05 21:34:40, jsbell wrote: > Address the text failures from the try job, then ...
5 years, 6 months ago (2015-06-05 21:49:27 UTC) #15
jsbell
5 years, 3 months ago (2015-09-23 17:42:28 UTC) #16

Powered by Google App Engine
This is Rietveld 408576698