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

Issue 1497503002: Removes the custom toString callback for the various DOM constructors. (Closed)

Created:
5 years ago by epertoso
Modified:
5 years ago
CC:
adamk, blink-reviews, blink-reviews-bindings_chromium.org, chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Removes the custom toString callback for the various DOM constructors. Currently, functions like (for example) HTMLElement.toString() invoke a callback that obtains HTMLElement.toString's toString function and applies it to HTMLElement. This leads to some weird behaviour, like: > HTMLDocument.toString() "function HTMLDocument() { [native code] }" > HTMLHRElement.toString() "function HTMLHRElement() { [native code] }" > HTMLDocument.toString.toString = function() { return "foobar"; } function () { return "foobar"; } > HTMLHRElement.toString() "foobar" > HTMLDivElement function "foobar" If we don't install the custom toString callback, everything works as expected. BUG= Committed: https://crrev.com/6089c0dadd2f88366ce775da7a4de63d784978b6 Cr-Commit-Position: refs/heads/master@{#362998}

Patch Set 1 #

Patch Set 2 : Added layout test #

Total comments: 6

Patch Set 3 : testharness.js #

Total comments: 4

Patch Set 4 : Update #

Unified diffs Side-by-side diffs Delta from patch set Stats (+28 lines, -122 lines) Patch
A third_party/WebKit/LayoutTests/fast/dom/Window/element-constructors-to-string.html View 1 2 3 1 chunk +28 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.h View 2 chunks +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp View 2 chunks +0 lines, -29 lines 0 comments Download
M third_party/WebKit/Source/bindings/templates/interface_base.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8SVGTestInterface.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestException.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexed.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedGlobal.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexedPrimaryGlobal.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface3.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor2.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor3.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceConstructor4.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceCustomConstructor.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceDocument.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEmpty.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventInitConstructor.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceEventTarget.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNamedConstructor2.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceWillBeGarbageCollected.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestNode.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperations.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestSpecialOperationsNotEnumerable.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/core/V8TestTypedefs.cpp View 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp View 1 chunk +0 lines, -3 lines 0 comments Download

Messages

Total messages: 30 (7 generated)
epertoso
5 years ago (2015-12-02 16:47:37 UTC) #3
sof
dbc - commit messages that include the what/why/wherefore makes for quicker-to-comprehend commits. Could you add ...
5 years ago (2015-12-02 16:57:22 UTC) #4
epertoso
On 2015/12/02 at 16:57:22, sigbjornf wrote: > dbc - commit messages that include the what/why/wherefore ...
5 years ago (2015-12-02 17:26:21 UTC) #6
sof
On 2015/12/02 17:26:21, epertoso wrote: > On 2015/12/02 at 16:57:22, sigbjornf wrote: > > dbc ...
5 years ago (2015-12-02 18:29:18 UTC) #7
jsbell
cc: adamk who was involved in some changes here recently, IIRC
5 years ago (2015-12-02 19:36:47 UTC) #9
adamk
I'm not sure that haraken is going to be able to provide any context here. ...
5 years ago (2015-12-02 22:10:15 UTC) #11
adamk
That being said, I'd love to hear if anyone can think of why this code ...
5 years ago (2015-12-02 22:10:49 UTC) #12
haraken
Yeah, I don't know a context why we introduced the code. Two questions: - Does ...
5 years ago (2015-12-03 00:07:03 UTC) #13
epertoso
On 2015/12/03 at 00:07:03, haraken wrote: > Yeah, I don't know a context why we ...
5 years ago (2015-12-03 10:09:37 UTC) #14
haraken
On 2015/12/03 10:09:37, epertoso wrote: > On 2015/12/03 at 00:07:03, haraken wrote: > > Yeah, ...
5 years ago (2015-12-03 10:28:14 UTC) #15
epertoso
On 2015/12/03 at 10:28:14, haraken wrote: > On 2015/12/03 10:09:37, epertoso wrote: > > On ...
5 years ago (2015-12-03 10:33:13 UTC) #16
haraken
On 2015/12/03 10:33:13, epertoso wrote: > On 2015/12/03 at 10:28:14, haraken wrote: > > On ...
5 years ago (2015-12-03 10:37:30 UTC) #17
epertoso
On 2015/12/03 at 10:37:30, haraken wrote: > On 2015/12/03 10:33:13, epertoso wrote: > > On ...
5 years ago (2015-12-03 11:27:04 UTC) #18
jochen (gone - plz use gerrit)
for this test, it's probably better to write a testharness based test: https://darobin.github.io/test-harness-tutorial/docs/using-testharness.html https://codereview.chromium.org/1497503002/diff/20001/third_party/WebKit/LayoutTests/fast/dom/Window/element-constructors-to-string.html File ...
5 years ago (2015-12-03 11:41:42 UTC) #19
Toon Verwaest
Does the old code align better however? I presume not at all. Does FF have ...
5 years ago (2015-12-03 11:54:36 UTC) #20
epertoso
https://codereview.chromium.org/1497503002/diff/20001/third_party/WebKit/LayoutTests/fast/dom/Window/element-constructors-to-string.html File third_party/WebKit/LayoutTests/fast/dom/Window/element-constructors-to-string.html (right): https://codereview.chromium.org/1497503002/diff/20001/third_party/WebKit/LayoutTests/fast/dom/Window/element-constructors-to-string.html#newcode1 third_party/WebKit/LayoutTests/fast/dom/Window/element-constructors-to-string.html:1: <html> On 2015/12/03 at 11:41:42, jochen wrote: > should ...
5 years ago (2015-12-03 12:04:18 UTC) #21
jochen (gone - plz use gerrit)
https://codereview.chromium.org/1497503002/diff/40001/third_party/WebKit/LayoutTests/fast/dom/Window/element-constructors-to-string-expected.txt File third_party/WebKit/LayoutTests/fast/dom/Window/element-constructors-to-string-expected.txt (right): https://codereview.chromium.org/1497503002/diff/40001/third_party/WebKit/LayoutTests/fast/dom/Window/element-constructors-to-string-expected.txt#newcode1 third_party/WebKit/LayoutTests/fast/dom/Window/element-constructors-to-string-expected.txt:1: Test that HTML element constructors' toString is just Function.prototype.toString, ...
5 years ago (2015-12-03 12:09:11 UTC) #22
epertoso
https://codereview.chromium.org/1497503002/diff/40001/third_party/WebKit/LayoutTests/fast/dom/Window/element-constructors-to-string-expected.txt File third_party/WebKit/LayoutTests/fast/dom/Window/element-constructors-to-string-expected.txt (right): https://codereview.chromium.org/1497503002/diff/40001/third_party/WebKit/LayoutTests/fast/dom/Window/element-constructors-to-string-expected.txt#newcode1 third_party/WebKit/LayoutTests/fast/dom/Window/element-constructors-to-string-expected.txt:1: Test that HTML element constructors' toString is just Function.prototype.toString, ...
5 years ago (2015-12-03 13:01:00 UTC) #23
haraken
LGTM on my side. Let's wait for other reviewer's approval.
5 years ago (2015-12-03 14:50:29 UTC) #24
jochen (gone - plz use gerrit)
lgtm
5 years ago (2015-12-03 14:54:57 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1497503002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1497503002/60001
5 years ago (2015-12-03 14:57:10 UTC) #27
commit-bot: I haz the power
Committed patchset #4 (id:60001)
5 years ago (2015-12-03 17:06:38 UTC) #28
commit-bot: I haz the power
5 years ago (2015-12-03 17:07:38 UTC) #30
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/6089c0dadd2f88366ce775da7a4de63d784978b6
Cr-Commit-Position: refs/heads/master@{#362998}

Powered by Google App Engine
This is Rietveld 408576698