- Revision
- 123678
- Author
- [email protected]
- Date
- 2012-07-25 16:41:45 -0700 (Wed, 25 Jul 2012)
Log Message
Improve the output of editing/pasteboard/paste-noscript-xhtml.xhtml
https://bugs.webkit.org/show_bug.cgi?id=92307
Reviewed by Tony Chang.
Use dump-as-markup to improve the readability of output, and removed replaced the call to sayHello in iframe's src
content attribute by a call to alert("hello") so that reference error doesn't show up on the result, and moved
the resource from editing/resources to editing/pasteboard/resources as it's not used elsewhere.
* editing/pasteboard/paste-noscript-xhtml-expected.txt:
* editing/pasteboard/paste-noscript-xhtml.xhtml:
* editing/pasteboard/resources/paste-noscript-content.html: Copied from LayoutTests/editing/resources/htmlcontent.html.
* editing/resources/htmlcontent.html: Removed.
* platform/chromium-mac/editing/pasteboard/paste-noscript-xhtml-expected.txt: Removed.
* platform/chromium-win/editing/pasteboard/paste-noscript-xhtml-expected.txt: Removed.
Modified Paths
Added Paths
Removed Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (123677 => 123678)
--- trunk/LayoutTests/ChangeLog 2012-07-25 23:39:27 UTC (rev 123677)
+++ trunk/LayoutTests/ChangeLog 2012-07-25 23:41:45 UTC (rev 123678)
@@ -1,3 +1,21 @@
+2012-07-25 Ryosuke Niwa <[email protected]>
+
+ Improve the output of editing/pasteboard/paste-noscript-xhtml.xhtml
+ https://bugs.webkit.org/show_bug.cgi?id=92307
+
+ Reviewed by Tony Chang.
+
+ Use dump-as-markup to improve the readability of output, and removed replaced the call to sayHello in iframe's src
+ content attribute by a call to alert("hello") so that reference error doesn't show up on the result, and moved
+ the resource from editing/resources to editing/pasteboard/resources as it's not used elsewhere.
+
+ * editing/pasteboard/paste-noscript-xhtml-expected.txt:
+ * editing/pasteboard/paste-noscript-xhtml.xhtml:
+ * editing/pasteboard/resources/paste-noscript-content.html: Copied from LayoutTests/editing/resources/htmlcontent.html.
+ * editing/resources/htmlcontent.html: Removed.
+ * platform/chromium-mac/editing/pasteboard/paste-noscript-xhtml-expected.txt: Removed.
+ * platform/chromium-win/editing/pasteboard/paste-noscript-xhtml-expected.txt: Removed.
+
2012-07-25 Rafael Brandao <[email protected]>
[Qt] platform/qt/tables/mozilla tests needs update after rebaseline and new testfonts
Modified: trunk/LayoutTests/editing/pasteboard/paste-noscript-xhtml-expected.txt (123677 => 123678)
--- trunk/LayoutTests/editing/pasteboard/paste-noscript-xhtml-expected.txt 2012-07-25 23:39:27 UTC (rev 123677)
+++ trunk/LayoutTests/editing/pasteboard/paste-noscript-xhtml-expected.txt 2012-07-25 23:41:45 UTC (rev 123678)
@@ -1,7 +1,78 @@
ALERT: hello
-CONSOLE MESSAGE: line 1: ReferenceError: Can't find variable: sayHello
-This test copies the content of an iframe and pastes it in an editable area in an xhtml document and verifies that no script, handlers or _javascript_ urls are copied.
+ALERT: hello
-HelloCNNHello
-This is a form
-<button xmlns="http://www.w3.org/1999/xhtml" id="button1" style="width: 100px; ">Hello</button><a xmlns="http://www.w3.org/1999/xhtml" id="anchor1" href="" xmlns="http://www.w3.org/1999/xhtml" id="anchor2">Hello</a><iframe xmlns="http://www.w3.org/1999/xhtml" id="iframe1" style="width: 200px; height: 100px; background-color: rgb(204, 238, 238); "></iframe><form xmlns="http://www.w3.org/1999/xhtml" id="form1" style="width: 200px; height: 150px; background-color: rgb(204, 238, 238); ">This is a form</form>
+This test copies the content of an iframe and pastes it
+in an editable area in an xhtml document and verifies that no script, handlers or _javascript_ urls are copied.
+
+
+Copied content:
+| "
+"
+| <button>
+| id="button1"
+| _onclick_="sayHello()"
+| _ondblclick_="sayHello()"
+| style="width: 100px;"
+| "<#selection-anchor>Hello"
+| <a>
+| href=""
+| id="anchor1"
+| "CNN"
+| <a>
+| href=""
+| id="anchor2"
+| "Hello"
+| "
+"
+| <script>
+| style="display: block; position: fixed; top: 4000px"
+| "alert('hello');"
+| "
+"
+| <script>
+| src=""
+| style="display: block; position: fixed; top: 4000px"
+| "
+"
+| <iframe>
+| id="iframe1"
+| src=""
+| style="width: 200px; height: 100px; background-color:#cee;"
+| "
+"
+| <form>
+| action=""
+| id="form1"
+| style="width: 200px; height: 150px; background-color:#cee;"
+| "This is a form<#selection-focus>"
+| "
+
+"
+
+FRAME 0:
+| <head>
+| <body>
+
+Pasted content:
+| <button>
+| id="button1"
+| style="width: 100px; "
+| "Hello"
+| <a>
+| href=""
+| id="anchor1"
+| "CNN"
+| <a>
+| id="anchor2"
+| "Hello"
+| <iframe>
+| id="iframe1"
+| style="width: 200px; height: 100px; background-color: rgb(204, 238, 238); "
+| <form>
+| id="form1"
+| style="width: 200px; height: 150px; background-color: rgb(204, 238, 238); "
+| "This is a form<#selection-caret>"
+
+FRAME 0:
+| <head>
+| <body>
Modified: trunk/LayoutTests/editing/pasteboard/paste-noscript-xhtml.xhtml (123677 => 123678)
--- trunk/LayoutTests/editing/pasteboard/paste-noscript-xhtml.xhtml 2012-07-25 23:39:27 UTC (rev 123677)
+++ trunk/LayoutTests/editing/pasteboard/paste-noscript-xhtml.xhtml 2012-07-25 23:41:45 UTC (rev 123678)
@@ -1,45 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
-<body _onload_="foo()">
+<body _onload_="runTest()">
<div id="description">
This test copies the content of an iframe and pastes it
in an editable area in an xhtml document and verifies that no script, handlers or _javascript_ urls are copied.
</div>
-<iframe id="iframe1" src=""
+<iframe id="iframe1" src=""
<div id="pastehere" contenteditable="true"></div>
-<ul id="console"></ul>
+<script src=""
<script>
-if (window.testRunner)
- window.testRunner.dumpAsText();
-if (window.testRunner)
- window.testRunner.waitUntilDone();
+Markup.waitUntilDone();
-function foo() {
- var frame = frames[0];
- var sel = frame.getSelection();
- var doc = frame.document;
- sel.setPosition(doc.body, 0);
+function runTest() {
+ Markup.description(document.getElementById('description').textContent);
+
+ var doc = frames[0].document;
+ getSelection().setPosition(doc.body, 0);
doc.execCommand("SelectAll");
doc.execCommand("Copy");
- var p1 = document.getElementById("pastehere");
- var s = window.getSelection();
- s.setPosition(p1, 0);
+ Markup.dump(doc.body, 'Copied content');
+
+ getSelection().setPosition(document.getElementById("pastehere"), 0);
document.execCommand("Paste");
- log(document.getElementById("pastehere").innerHTML);
+ Markup.dump('pastehere', 'Pasted content');
- if (window.testRunner)
- window.testRunner.notifyDone();
+ Markup.notifyDone();
}
-function log(str) {
- var li = document.createElement("li");
- li.appendChild(document.createTextNode(str));
- var console = document.getElementById("console");
- console.appendChild(li);
-}
</script>
</body>
</html>
Copied: trunk/LayoutTests/editing/pasteboard/resources/paste-noscript-content.html (from rev 123398, trunk/LayoutTests/editing/resources/htmlcontent.html) (0 => 123678)
--- trunk/LayoutTests/editing/pasteboard/resources/paste-noscript-content.html (rev 0)
+++ trunk/LayoutTests/editing/pasteboard/resources/paste-noscript-content.html 2012-07-25 23:41:45 UTC (rev 123678)
@@ -0,0 +1,15 @@
+<script>
+function sayHello()
+{
+ alert("Hello");
+}
+if (window.testRunner)
+ testRunner.dumpAsText();
+</script>
+<body>
+<button id="button1" _onclick_="sayHello()" _ondblclick_="sayHello()" style="width: 100px;">Hello</button><a id="anchor1" href="" id="anchor2" href=""
+<script style="display: block; position: fixed; top: 4000px">alert('hello');</script>
+<script src="" style="display: block; position: fixed; top: 4000px"></script>
+<iframe id="iframe1" src="" style="width: 200px; height: 100px; background-color:#cee;"></iframe>
+<form id="form1" action="" style="width: 200px; height: 150px; background-color:#cee;">This is a form</form>
+</body>
Deleted: trunk/LayoutTests/editing/resources/htmlcontent.html (123677 => 123678)
--- trunk/LayoutTests/editing/resources/htmlcontent.html 2012-07-25 23:39:27 UTC (rev 123677)
+++ trunk/LayoutTests/editing/resources/htmlcontent.html 2012-07-25 23:41:45 UTC (rev 123678)
@@ -1,15 +0,0 @@
-<script>
-function sayHello()
-{
- alert("Hello");
-}
-if (window.testRunner)
- testRunner.dumpAsText();
-</script>
-<body>
-<button id="button1" _onclick_="sayHello()" _ondblclick_="sayHello()" style="width: 100px;">Hello</button><a id="anchor1" href="" id="anchor2" href=""
-<script style="display: block; position: fixed; top: 4000px">alert('hello');</script>
-<script src="" style="display: block; position: fixed; top: 4000px"></script>
-<iframe id="iframe1" src="" style="width: 200px; height: 100px; background-color:#cee;"></iframe>
-<form id="form1" action="" style="width: 200px; height: 150px; background-color:#cee;">This is a form</form>
-</body>
Deleted: trunk/LayoutTests/platform/chromium-mac/editing/pasteboard/paste-noscript-xhtml-expected.txt (123677 => 123678)
--- trunk/LayoutTests/platform/chromium-mac/editing/pasteboard/paste-noscript-xhtml-expected.txt 2012-07-25 23:39:27 UTC (rev 123677)
+++ trunk/LayoutTests/platform/chromium-mac/editing/pasteboard/paste-noscript-xhtml-expected.txt 2012-07-25 23:41:45 UTC (rev 123678)
@@ -1,7 +0,0 @@
-ALERT: hello
-CONSOLE MESSAGE: line 1: Uncaught ReferenceError: sayHello is not defined
-This test copies the content of an iframe and pastes it in an editable area in an xhtml document and verifies that no script, handlers or _javascript_ urls are copied.
-
-HelloCNNHello
-This is a form
-<button xmlns="http://www.w3.org/1999/xhtml" id="button1" style="width: 100px; ">Hello</button><a xmlns="http://www.w3.org/1999/xhtml" id="anchor1" href="" xmlns="http://www.w3.org/1999/xhtml" id="anchor2">Hello</a><iframe xmlns="http://www.w3.org/1999/xhtml" id="iframe1" style="width: 200px; height: 100px; background-color: rgb(204, 238, 238); "></iframe><form xmlns="http://www.w3.org/1999/xhtml" id="form1" style="width: 200px; height: 150px; background-color: rgb(204, 238, 238); ">This is a form</form>
Deleted: trunk/LayoutTests/platform/chromium-win/editing/pasteboard/paste-noscript-xhtml-expected.txt (123677 => 123678)
--- trunk/LayoutTests/platform/chromium-win/editing/pasteboard/paste-noscript-xhtml-expected.txt 2012-07-25 23:39:27 UTC (rev 123677)
+++ trunk/LayoutTests/platform/chromium-win/editing/pasteboard/paste-noscript-xhtml-expected.txt 2012-07-25 23:41:45 UTC (rev 123678)
@@ -1,7 +0,0 @@
-ALERT: hello
-CONSOLE MESSAGE: line 1: Uncaught ReferenceError: sayHello is not defined
-This test copies the content of an iframe and pastes it in an editable area in an xhtml document and verifies that no script, handlers or _javascript_ urls are copied.
-
-HelloCNNHello
-This is a form
-<button xmlns="http://www.w3.org/1999/xhtml" id="button1" style="width: 100px; ">Hello</button><a xmlns="http://www.w3.org/1999/xhtml" id="anchor1" href="" xmlns="http://www.w3.org/1999/xhtml" id="anchor2">Hello</a><iframe xmlns="http://www.w3.org/1999/xhtml" id="iframe1" style="width: 200px; height: 100px; background-color: rgb(204, 238, 238); "></iframe><form xmlns="http://www.w3.org/1999/xhtml" id="form1" style="width: 200px; height: 150px; background-color: rgb(204, 238, 238); ">This is a form</form>