Diff
Modified: trunk/LayoutTests/ChangeLog (144882 => 144883)
--- trunk/LayoutTests/ChangeLog 2013-03-06 06:27:43 UTC (rev 144882)
+++ trunk/LayoutTests/ChangeLog 2013-03-06 06:43:13 UTC (rev 144883)
@@ -1,3 +1,22 @@
+2013-03-05 Claudio Saavedra <csaave...@igalia.com>
+
+ Make toggle-unlink.html test Mac specific behaviour
+ https://bugs.webkit.org/show_bug.cgi?id=111321
+
+ Reviewed by Ryosuke Niwa.
+
+ A new test for Windows behavior will have to be added once bug
+ 110487 is landed.
+
+ * editing/execCommand/script-tests/toggle-unlink-mac.js: Renamed
+ from
+ LayoutTests/editing/execCommand/script-tests/toggle-unlink.js.
+ Also set editing behaviour to Mac.
+ * editing/execCommand/toggle-unlink-mac-expected.txt: Renamed from
+ LayoutTests/editing/execCommand/toggle-unlink-expected.txt.
+ * editing/execCommand/toggle-unlink-mac.html: Renamed from
+ LayoutTests/editing/execCommand/toggle-unlink.html.
+
2013-03-05 Vsevolod Vlasov <vse...@chromium.org>
Unreviewed chromium test expectations update.
Copied: trunk/LayoutTests/editing/execCommand/script-tests/toggle-unlink-mac.js (from rev 144882, trunk/LayoutTests/editing/execCommand/script-tests/toggle-unlink.js) (0 => 144883)
--- trunk/LayoutTests/editing/execCommand/script-tests/toggle-unlink-mac.js (rev 0)
+++ trunk/LayoutTests/editing/execCommand/script-tests/toggle-unlink-mac.js 2013-03-06 06:43:13 UTC (rev 144883)
@@ -0,0 +1,72 @@
+description("Test to make sure we preserve styles when removing links")
+
+var testContainer = document.createElement("div");
+testContainer.contentEditable = true;
+document.body.appendChild(testContainer);
+
+function testSingleToggle(toggleCommand, initialContents, selector, expectedContents)
+{
+ testContainer.innerHTML = initialContents;
+ var selected = selector(testContainer);
+ document.execCommand(toggleCommand, false, 'http://webkit.org/');
+ action = "" + ' on ' + selected + ' of "' + initialContents + '" yields "' + testContainer.innerHTML + '"';
+ if (testContainer.innerHTML === expectedContents)
+ testPassed(action);
+ else
+ testFailed(action + ', expected "' + expectedContents + '"');
+}
+
+function selectAll(container) {
+ window.getSelection().selectAllChildren(container);
+ return 'all';
+}
+
+function selectFirstTwoWords(container) {
+ window.getSelection().setPosition(container, 0);
+ window.getSelection().modify('extend', 'forward', 'word');
+ window.getSelection().modify('extend', 'forward', 'word');
+ return 'first two words';
+}
+
+function selectLastTwoWords(container) {
+ window.getSelection().setPosition(container, container.childNodes.length);
+ window.getSelection().modify('extend', 'backward', 'word');
+ window.getSelection().modify('extend', 'backward', 'word');
+ return 'last two words';
+}
+
+function selectLastWord(container) {
+ window.getSelection().setPosition(container, container.childNodes.length);
+ window.getSelection().modify('extend', 'backward', 'word');
+ return 'last word';
+}
+
+if (window.internals)
+ internals.settings.setEditingBehavior('mac');
+
+testSingleToggle("unlink", 'hello <b>world</b>', selectAll, 'hello <b>world</b>');
+testSingleToggle("unlink", '<a href="" world</u></a>', selectAll, '<u>hello world</u>');
+testSingleToggle("unlink", 'hello <i><a href="" selectAll, 'hello <i>world</i>');
+testSingleToggle("unlink", 'hello <a href="" style="font-weight: bold;">world</a>', selectAll, 'hello <b>world</b>');
+testSingleToggle("unlink", 'hello <a href="" style="color: blue;">world</a> WebKit', selectAll, 'hello <font color="#0000ff">world</font> WebKit');
+testSingleToggle("unlink", 'hello <a href="" style="color: blue; display: block;">world</a> WebKit',
+ selectAll, 'hello <font color="#0000ff"><span style="display: block;">world</span></font> WebKit');
+testSingleToggle("unlink", '<a href="" style="font-size: large;">hello world</a> WebKit',
+ selectLastTwoWords, '<a href="" style="font-size: large;">hello </a><font size="4">world</font> WebKit');
+testSingleToggle("unlink", 'hello <a href="" style="font-size: large;">world <span style="font-size: small;">WebKit</span> rocks</a>',
+ selectLastTwoWords, 'hello <a href="" size="4">world </font></a><span style="font-size: small;">WebKit</span><font size="4"> rocks</font>');
+testSingleToggle("unlink", 'hello <a href="" style="font-style: italic;"><b>world</b> WebKit</a>',
+ selectFirstTwoWords, 'hello <b style="font-style: italic;">world</b><a href="" WebKit</i></a>');
+
+testSingleToggle("unlink", '<a href="" style="background-color: yellow;"><div>hello</div><div>world</div></a>',
+ selectAll, '<div style="background-color: yellow;">hello</div><div style="background-color: yellow;">world</div>');
+testSingleToggle("unlink", 'hello<a href="" style="background-color: yellow;"><div>world</div></a>WebKit',
+ selectAll, 'hello<div style="background-color: yellow;">world</div><span style="background-color: yellow;">WebKit</span>');
+testSingleToggle("unlink", '<a href="" style="font-weight: bold;"><div>hello</div><div>world WebKit</div></a>',
+ selectLastTwoWords, '<a href="" style="font-weight: bold;">hello</div></a><div style="font-weight: bold;">world WebKit</div>');
+testSingleToggle("unlink", '<a href="" style="font-weight: bold;"><div style="font-weight: normal;">hello</div><div>world</div></a>',
+ selectLastWord, '<a href="" style="font-weight: normal;">hello</div></a><div style="font-weight: bold;">world</div>');
+
+document.body.removeChild(testContainer);
+
+var successfullyParsed = true;
Deleted: trunk/LayoutTests/editing/execCommand/script-tests/toggle-unlink.js (144882 => 144883)
--- trunk/LayoutTests/editing/execCommand/script-tests/toggle-unlink.js 2013-03-06 06:27:43 UTC (rev 144882)
+++ trunk/LayoutTests/editing/execCommand/script-tests/toggle-unlink.js 2013-03-06 06:43:13 UTC (rev 144883)
@@ -1,69 +0,0 @@
-description("Test to make sure we preserve styles when removing links")
-
-var testContainer = document.createElement("div");
-testContainer.contentEditable = true;
-document.body.appendChild(testContainer);
-
-function testSingleToggle(toggleCommand, initialContents, selector, expectedContents)
-{
- testContainer.innerHTML = initialContents;
- var selected = selector(testContainer);
- document.execCommand(toggleCommand, false, 'http://webkit.org/');
- action = "" + ' on ' + selected + ' of "' + initialContents + '" yields "' + testContainer.innerHTML + '"';
- if (testContainer.innerHTML === expectedContents)
- testPassed(action);
- else
- testFailed(action + ', expected "' + expectedContents + '"');
-}
-
-function selectAll(container) {
- window.getSelection().selectAllChildren(container);
- return 'all';
-}
-
-function selectFirstTwoWords(container) {
- window.getSelection().setPosition(container, 0);
- window.getSelection().modify('extend', 'forward', 'word');
- window.getSelection().modify('extend', 'forward', 'word');
- return 'first two words';
-}
-
-function selectLastTwoWords(container) {
- window.getSelection().setPosition(container, container.childNodes.length);
- window.getSelection().modify('extend', 'backward', 'word');
- window.getSelection().modify('extend', 'backward', 'word');
- return 'last two words';
-}
-
-function selectLastWord(container) {
- window.getSelection().setPosition(container, container.childNodes.length);
- window.getSelection().modify('extend', 'backward', 'word');
- return 'last word';
-}
-
-testSingleToggle("unlink", 'hello <b>world</b>', selectAll, 'hello <b>world</b>');
-testSingleToggle("unlink", '<a href="" world</u></a>', selectAll, '<u>hello world</u>');
-testSingleToggle("unlink", 'hello <i><a href="" selectAll, 'hello <i>world</i>');
-testSingleToggle("unlink", 'hello <a href="" style="font-weight: bold;">world</a>', selectAll, 'hello <b>world</b>');
-testSingleToggle("unlink", 'hello <a href="" style="color: blue;">world</a> WebKit', selectAll, 'hello <font color="#0000ff">world</font> WebKit');
-testSingleToggle("unlink", 'hello <a href="" style="color: blue; display: block;">world</a> WebKit',
- selectAll, 'hello <font color="#0000ff"><span style="display: block;">world</span></font> WebKit');
-testSingleToggle("unlink", '<a href="" style="font-size: large;">hello world</a> WebKit',
- selectLastTwoWords, '<a href="" style="font-size: large;">hello </a><font size="4">world</font> WebKit');
-testSingleToggle("unlink", 'hello <a href="" style="font-size: large;">world <span style="font-size: small;">WebKit</span> rocks</a>',
- selectLastTwoWords, 'hello <a href="" size="4">world </font></a><span style="font-size: small;">WebKit</span><font size="4"> rocks</font>');
-testSingleToggle("unlink", 'hello <a href="" style="font-style: italic;"><b>world</b> WebKit</a>',
- selectFirstTwoWords, 'hello <b style="font-style: italic;">world</b><a href="" WebKit</i></a>');
-
-testSingleToggle("unlink", '<a href="" style="background-color: yellow;"><div>hello</div><div>world</div></a>',
- selectAll, '<div style="background-color: yellow;">hello</div><div style="background-color: yellow;">world</div>');
-testSingleToggle("unlink", 'hello<a href="" style="background-color: yellow;"><div>world</div></a>WebKit',
- selectAll, 'hello<div style="background-color: yellow;">world</div><span style="background-color: yellow;">WebKit</span>');
-testSingleToggle("unlink", '<a href="" style="font-weight: bold;"><div>hello</div><div>world WebKit</div></a>',
- selectLastTwoWords, '<a href="" style="font-weight: bold;">hello</div></a><div style="font-weight: bold;">world WebKit</div>');
-testSingleToggle("unlink", '<a href="" style="font-weight: bold;"><div style="font-weight: normal;">hello</div><div>world</div></a>',
- selectLastWord, '<a href="" style="font-weight: normal;">hello</div></a><div style="font-weight: bold;">world</div>');
-
-document.body.removeChild(testContainer);
-
-var successfullyParsed = true;
Deleted: trunk/LayoutTests/editing/execCommand/toggle-unlink-expected.txt (144882 => 144883)
--- trunk/LayoutTests/editing/execCommand/toggle-unlink-expected.txt 2013-03-06 06:27:43 UTC (rev 144882)
+++ trunk/LayoutTests/editing/execCommand/toggle-unlink-expected.txt 2013-03-06 06:43:13 UTC (rev 144883)
@@ -1,22 +0,0 @@
-Test to make sure we preserve styles when removing links
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS unlink on all of "hello <b>world</b>" yields "hello <b>world</b>"
-PASS unlink on all of "<a href="" world</u></a>" yields "<u>hello world</u>"
-PASS unlink on all of "hello <i><a href="" yields "hello <i>world</i>"
-PASS unlink on all of "hello <a href="" style="font-weight: bold;">world</a>" yields "hello <b>world</b>"
-PASS unlink on all of "hello <a href="" style="color: blue;">world</a> WebKit" yields "hello <font color="#0000ff">world</font> WebKit"
-PASS unlink on all of "hello <a href="" style="color: blue; display: block;">world</a> WebKit" yields "hello <font color="#0000ff"><span style="display: block;">world</span></font> WebKit"
-PASS unlink on last two words of "<a href="" style="font-size: large;">hello world</a> WebKit" yields "<a href="" style="font-size: large;">hello </a><font size="4">world</font> WebKit"
-PASS unlink on last two words of "hello <a href="" style="font-size: large;">world <span style="font-size: small;">WebKit</span> rocks</a>" yields "hello <a href="" size="4">world </font></a><span style="font-size: small;">WebKit</span><font size="4"> rocks</font>"
-PASS unlink on first two words of "hello <a href="" style="font-style: italic;"><b>world</b> WebKit</a>" yields "hello <b style="font-style: italic;">world</b><a href="" WebKit</i></a>"
-PASS unlink on all of "<a href="" style="background-color: yellow;"><div>hello</div><div>world</div></a>" yields "<div style="background-color: yellow;">hello</div><div style="background-color: yellow;">world</div>"
-PASS unlink on all of "hello<a href="" style="background-color: yellow;"><div>world</div></a>WebKit" yields "hello<div style="background-color: yellow;">world</div><span style="background-color: yellow;">WebKit</span>"
-PASS unlink on last two words of "<a href="" style="font-weight: bold;"><div>hello</div><div>world WebKit</div></a>" yields "<a href="" style="font-weight: bold;">hello</div></a><div style="font-weight: bold;">world WebKit</div>"
-PASS unlink on last word of "<a href="" style="font-weight: bold;"><div style="font-weight: normal;">hello</div><div>world</div></a>" yields "<a href="" style="font-weight: normal;">hello</div></a><div style="font-weight: bold;">world</div>"
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
Copied: trunk/LayoutTests/editing/execCommand/toggle-unlink-mac-expected.txt (from rev 144882, trunk/LayoutTests/editing/execCommand/toggle-unlink-expected.txt) (0 => 144883)
--- trunk/LayoutTests/editing/execCommand/toggle-unlink-mac-expected.txt (rev 0)
+++ trunk/LayoutTests/editing/execCommand/toggle-unlink-mac-expected.txt 2013-03-06 06:43:13 UTC (rev 144883)
@@ -0,0 +1,22 @@
+Test to make sure we preserve styles when removing links
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS unlink on all of "hello <b>world</b>" yields "hello <b>world</b>"
+PASS unlink on all of "<a href="" world</u></a>" yields "<u>hello world</u>"
+PASS unlink on all of "hello <i><a href="" yields "hello <i>world</i>"
+PASS unlink on all of "hello <a href="" style="font-weight: bold;">world</a>" yields "hello <b>world</b>"
+PASS unlink on all of "hello <a href="" style="color: blue;">world</a> WebKit" yields "hello <font color="#0000ff">world</font> WebKit"
+PASS unlink on all of "hello <a href="" style="color: blue; display: block;">world</a> WebKit" yields "hello <font color="#0000ff"><span style="display: block;">world</span></font> WebKit"
+PASS unlink on last two words of "<a href="" style="font-size: large;">hello world</a> WebKit" yields "<a href="" style="font-size: large;">hello </a><font size="4">world</font> WebKit"
+PASS unlink on last two words of "hello <a href="" style="font-size: large;">world <span style="font-size: small;">WebKit</span> rocks</a>" yields "hello <a href="" size="4">world </font></a><span style="font-size: small;">WebKit</span><font size="4"> rocks</font>"
+PASS unlink on first two words of "hello <a href="" style="font-style: italic;"><b>world</b> WebKit</a>" yields "hello <b style="font-style: italic;">world</b><a href="" WebKit</i></a>"
+PASS unlink on all of "<a href="" style="background-color: yellow;"><div>hello</div><div>world</div></a>" yields "<div style="background-color: yellow;">hello</div><div style="background-color: yellow;">world</div>"
+PASS unlink on all of "hello<a href="" style="background-color: yellow;"><div>world</div></a>WebKit" yields "hello<div style="background-color: yellow;">world</div><span style="background-color: yellow;">WebKit</span>"
+PASS unlink on last two words of "<a href="" style="font-weight: bold;"><div>hello</div><div>world WebKit</div></a>" yields "<a href="" style="font-weight: bold;">hello</div></a><div style="font-weight: bold;">world WebKit</div>"
+PASS unlink on last word of "<a href="" style="font-weight: bold;"><div style="font-weight: normal;">hello</div><div>world</div></a>" yields "<a href="" style="font-weight: normal;">hello</div></a><div style="font-weight: bold;">world</div>"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Copied: trunk/LayoutTests/editing/execCommand/toggle-unlink-mac.html (from rev 144882, trunk/LayoutTests/editing/execCommand/toggle-unlink.html) (0 => 144883)
--- trunk/LayoutTests/editing/execCommand/toggle-unlink-mac.html (rev 0)
+++ trunk/LayoutTests/editing/execCommand/toggle-unlink-mac.html 2013-03-06 06:43:13 UTC (rev 144883)
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src=""
+<script src=""
+</body>
+</html>
Deleted: trunk/LayoutTests/editing/execCommand/toggle-unlink.html (144882 => 144883)
--- trunk/LayoutTests/editing/execCommand/toggle-unlink.html 2013-03-06 06:27:43 UTC (rev 144882)
+++ trunk/LayoutTests/editing/execCommand/toggle-unlink.html 2013-03-06 06:43:13 UTC (rev 144883)
@@ -1,12 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script src=""
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-<script src=""
-<script src=""
-</body>
-</html>