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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/Window/element-constructors-to-string.html

Issue 1497503002: Removes the custom toString callback for the various DOM constructors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added layout test Created 5 years 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/Window/element-constructors-to-string-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/dom/Window/element-constructors-to-string.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/element-constructors-to-string.html b/third_party/WebKit/LayoutTests/fast/dom/Window/element-constructors-to-string.html
new file mode 100644
index 0000000000000000000000000000000000000000..3f049835dd30f43536e0782063c1a1d7b52dcf8d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/element-constructors-to-string.html
@@ -0,0 +1,27 @@
+<html>
jochen (gone - plz use gerrit) 2015/12/03 11:41:42 should start with <!DOCTYPE html>
epertoso 2015/12/03 12:04:17 Done.
+<body>
+<p>Test that HTML element constructors' toString is just Function.prototype.toString, and that changing &lt;HTML ELEMENT&gt;.toString.toString doesn't change the output of &lt;HTML ELEMENT&gt;.toString().</p>
+<script>
+if (window.testRunner)
+ testRunner.dumpAsText();
jochen (gone - plz use gerrit) 2015/12/03 11:41:42 also 4sp indent in html/js
epertoso 2015/12/03 12:04:17 Done.
+
+function test() {
+ document.write("<p>HTMLElement.toString(): " + window.HTMLElement.toString() + "</p>");
+ document.write("<p>HTMLElement.toString.toString(): " + window.HTMLElement.toString.toString() + "</p>");
+ document.write("<p>HTMLElement.toString === Function.prototype.toString: " + eval("HTMLElement.toString === Function.prototype.toString") + "</p>");
+
+ window.HTMLElement.toString.toString = function() { return "foobar"; }
+ document.write("<p>After setting HTMLElement.toString.toString to \"function() { return \"foobar\"; }\"</p>");
+
+ document.write("<p>HTMLElement.toString(): " + window.HTMLElement.toString() + "</p>");
+ document.write("<p>HTMLElement.toString.toString(): " + window.HTMLElement.toString.toString() + "</p>");
+ document.write("<p>HTMLElement.toString === Function.prototype.toString: " + eval("HTMLElement.toString === Function.prototype.toString") + "</p>");
+ document.write("<p>HTMLDivElement.toString(): " + window.HTMLDivElement.toString() + "</p>");
+ document.write("<p>HTMLDivElement.toString.toString(): " + window.HTMLDivElement.toString.toString() + "</p>");
+}
+
+test("HTMLElement");
jochen (gone - plz use gerrit) 2015/12/03 11:41:42 test() is declared without parameters
epertoso 2015/12/03 12:04:17 Now using testharness.js.
+
+</script>
+</body>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/Window/element-constructors-to-string-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698