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

Side by Side Diff: LayoutTests/editing/execCommand/script-tests/toggle-text-decorations.js

Issue 7973008: Revert 93001 - Apple-style-span class seems unnecessary (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/874/
Patch Set: Created 9 years, 3 months 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 unified diff | Download patch
OLDNEW
1 description("Test to make sure we can toggle text decorations correctly.") 1 description("Test to make sure we can toggle text decorations correctly.")
2 2
3 var testContainer = document.createElement("div"); 3 var testContainer = document.createElement("div");
4 testContainer.contentEditable = true; 4 testContainer.contentEditable = true;
5 document.body.appendChild(testContainer); 5 document.body.appendChild(testContainer);
6 6
7 function testSingleToggle(toggleCommand, initialContents, expectedContents) 7 function testSingleToggle(toggleCommand, initialContents, expectedContents)
8 { 8 {
9 testContainer.innerHTML = initialContents; 9 testContainer.innerHTML = initialContents;
10 window.getSelection().selectAllChildren(testContainer); 10 window.getSelection().selectAllChildren(testContainer);
11 document.execCommand("styleWithCSS", false, true); 11 document.execCommand("styleWithCSS", false, true);
12 document.execCommand(toggleCommand, false, null); 12 document.execCommand(toggleCommand, false, null);
13 if (testContainer.innerHTML === expectedContents) { 13 if (testContainer.innerHTML === expectedContents) {
14 testPassed("one " + toggleCommand + " command converted " + initialConte nts + " to " + expectedContents); 14 testPassed("one " + toggleCommand + " command converted " + initialConte nts + " to " + expectedContents);
15 } else { 15 } else {
16 testFailed("one " + toggleCommand + " command converted " + initialConte nts + " to " + testContainer.innerHTML + ", expected " + expectedContents); 16 testFailed("one " + toggleCommand + " command converted " + initialConte nts + " to " + testContainer.innerHTML + ", expected " + expectedContents);
17 } 17 }
18 } 18 }
19 19
20 testSingleToggle("underline", "test", "<span style=\"text-decoration: underline; \">test</span>"); 20 testSingleToggle("underline", "test", "<span class=\"Apple-style-span\" style=\" text-decoration: underline;\">test</span>");
21 testSingleToggle("underline", "<span style=\"text-decoration: underline;\">test< /span>", "test"); 21 testSingleToggle("underline", "<span class=\"Apple-style-span\" style=\"text-dec oration: underline;\">test</span>", "test");
22 testSingleToggle("underline", "<span style=\"text-decoration: underline line-thr ough overline;\">test</span>", "<span style=\"text-decoration: overline line-thr ough;\">test</span>"); 22 testSingleToggle("underline", "<span class=\"Apple-style-span\" style=\"text-dec oration: underline line-through overline;\">test</span>", "<span class=\"Apple-s tyle-span\" style=\"text-decoration: overline line-through;\">test</span>");
23 testSingleToggle("strikethrough", "test", "<span style=\"text-decoration: line-t hrough;\">test</span>"); 23 testSingleToggle("strikethrough", "test", "<span class=\"Apple-style-span\" styl e=\"text-decoration: line-through;\">test</span>");
24 testSingleToggle("strikethrough", "<span style=\"text-decoration: line-through;\ ">test</span>", "test"); 24 testSingleToggle("strikethrough", "<span class=\"Apple-style-span\" style=\"text -decoration: line-through;\">test</span>", "test");
25 testSingleToggle("strikethrough", "<span style=\"text-decoration: underline line -through overline;\">test</span>", "<span style=\"text-decoration: underline ove rline;\">test</span>"); 25 testSingleToggle("strikethrough", "<span class=\"Apple-style-span\" style=\"text -decoration: underline line-through overline;\">test</span>", "<span class=\"App le-style-span\" style=\"text-decoration: underline overline;\">test</span>");
26 26
27 document.body.removeChild(testContainer); 27 document.body.removeChild(testContainer);
28 28
29 var successfullyParsed = true; 29 var successfullyParsed = true;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698