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

Side by Side Diff: LayoutTests/editing/execCommand/script-tests/toggle-unlink-win.js

Issue 14930006: Ctrl+Shift+Right in Windows should select the spacing after the word (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added expectations for chromium-mac for delete-cell-contents-win.html Created 7 years, 7 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 preserve styles when removing links") 1 description("Test to make sure we preserve styles when removing links")
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, selector, expectedCont ents) 7 function testSingleToggle(toggleCommand, initialContents, selector, expectedCont ents)
8 { 8 {
9 testContainer.innerHTML = initialContents; 9 testContainer.innerHTML = initialContents;
10 var selected = selector(testContainer); 10 var selected = selector(testContainer);
(...skipping 24 matching lines...) Expand all
35 return 'last two words'; 35 return 'last two words';
36 } 36 }
37 37
38 function selectLastWord(container) { 38 function selectLastWord(container) {
39 window.getSelection().setPosition(container, container.childNodes.length); 39 window.getSelection().setPosition(container, container.childNodes.length);
40 window.getSelection().modify('extend', 'backward', 'word'); 40 window.getSelection().modify('extend', 'backward', 'word');
41 return 'last word'; 41 return 'last word';
42 } 42 }
43 43
44 if (window.internals) 44 if (window.internals)
45 internals.settings.setEditingBehavior('mac'); 45 internals.settings.setEditingBehavior('win');
46 46
47 testSingleToggle("unlink", 'hello <b>world</b>', selectAll, 'hello <b>world</b>' ); 47 testSingleToggle("unlink", 'hello <b>world</b>', selectAll, 'hello <b>world</b>' );
48 testSingleToggle("unlink", '<a href="http://webkit.org/"><u>hello world</u></a>' , selectAll, '<u>hello world</u>'); 48 testSingleToggle("unlink", '<a href="http://webkit.org/"><u>hello world</u></a>' , selectAll, '<u>hello world</u>');
49 testSingleToggle("unlink", 'hello <i><a href="http://webkit.org/">world</a></i>' , selectAll, 'hello <i>world</i>'); 49 testSingleToggle("unlink", 'hello <i><a href="http://webkit.org/">world</a></i>' , selectAll, 'hello <i>world</i>');
50 testSingleToggle("unlink", 'hello <a href="http://webkit.org/" style="font-weigh t: bold;">world</a>', selectAll, 'hello <b>world</b>'); 50 testSingleToggle("unlink", 'hello <a href="http://webkit.org/" style="font-weigh t: bold;">world</a>', selectAll, 'hello <b>world</b>');
51 testSingleToggle("unlink", 'hello <a href="http://webkit.org/" style="color: blu e;">world</a> WebKit', selectAll, 'hello <font color="#0000ff">world</font> WebK it'); 51 testSingleToggle("unlink", 'hello <a href="http://webkit.org/" style="color: blu e;">world</a> WebKit', selectAll, 'hello <font color="#0000ff">world</font> WebK it');
52 testSingleToggle("unlink", 'hello <a href="http://webkit.org/" style="color: blu e; display: block;">world</a> WebKit', 52 testSingleToggle("unlink", 'hello <a href="http://webkit.org/" style="color: blu e; display: block;">world</a> WebKit',
53 selectAll, 'hello <font color="#0000ff"><span style="display: block;">world< /span></font> WebKit'); 53 selectAll, 'hello <font color="#0000ff"><span style="display: block;">world< /span></font> WebKit');
54 testSingleToggle("unlink", '<a href="http://webkit.org/" style="font-size: large ;">hello world</a> WebKit', 54 testSingleToggle("unlink", '<a href="http://webkit.org/" style="font-size: large ;">hello world</a> WebKit',
55 selectLastTwoWords, '<a href="http://webkit.org/" style="font-size: large;"> hello </a><font size="4">world</font> WebKit'); 55 selectLastTwoWords, '<a href="http://webkit.org/" style="font-size: large;"> hello </a><font size="4">world</font> WebKit');
56 testSingleToggle("unlink", 'hello <a href="http://webkit.org/" style="font-size: large;">world <span style="font-size: small;">WebKit</span> rocks</a>', 56 testSingleToggle("unlink", 'hello <a href="http://webkit.org/" style="font-size: large;">world <span style="font-size: small;">WebKit</span> rocks</a>',
57 selectLastTwoWords, 'hello <a href="http://webkit.org/"><font size="4">world </font></a><span style="font-size: small;">WebKit</span><font size="4"> rocks</ font>'); 57 selectLastTwoWords, 'hello <a href="http://webkit.org/"><font size="4">world </font></a><span style="font-size: small;">WebKit</span><font size="4"> rocks</ font>');
58 testSingleToggle("unlink", 'hello <a href="http://webkit.org/" style="font-style : italic;"><b>world</b> WebKit</a>', 58 testSingleToggle("unlink", 'hello <a href="http://webkit.org/" style="font-style : italic;"><b>world</b> WebKit</a>',
59 selectFirstTwoWords, 'hello <b style="font-style: italic;">world</b><a href= "http://webkit.org/"><i> WebKit</i></a>'); 59 selectFirstTwoWords, 'hello <b style="font-style: italic;">world</b> <a href ="http://webkit.org/" style="font-style: italic;">WebKit</a>');
60
61 testSingleToggle("unlink", '<a href="http://webkit.org/" style="background-color : yellow;"><div>hello</div><div>world</div></a>', 60 testSingleToggle("unlink", '<a href="http://webkit.org/" style="background-color : yellow;"><div>hello</div><div>world</div></a>',
62 selectAll, '<div style="background-color: yellow;">hello</div><div style="ba ckground-color: yellow;">world</div>'); 61 selectAll, '<div style="background-color: yellow;">hello</div><div style="ba ckground-color: yellow;">world</div>');
63 testSingleToggle("unlink", 'hello<a href="http://webkit.org/" style="background- color: yellow;"><div>world</div></a>WebKit', 62 testSingleToggle("unlink", 'hello<a href="http://webkit.org/" style="background- color: yellow;"><div>world</div></a>WebKit',
64 selectAll, 'hello<div style="background-color: yellow;">world</div><span sty le="background-color: yellow;">WebKit</span>'); 63 selectAll, 'hello<div style="background-color: yellow;">world</div><span sty le="background-color: yellow;">WebKit</span>');
65 testSingleToggle("unlink", '<a href="http://webkit.org/" style="font-weight: bol d;"><div>hello</div><div>world WebKit</div></a>', 64 testSingleToggle("unlink", '<a href="http://webkit.org/" style="font-weight: bol d;"><div>hello</div><div>world WebKit</div></a>',
66 selectLastTwoWords, '<a href="http://webkit.org/"><div style="font-weight: b old;">hello</div></a><div style="font-weight: bold;">world WebKit</div>'); 65 selectLastTwoWords, '<a href="http://webkit.org/"><div style="font-weight: b old;">hello</div></a><div style="font-weight: bold;">world WebKit</div>');
67 testSingleToggle("unlink", '<a href="http://webkit.org/" style="font-weight: bol d;"><div style="font-weight: normal;">hello</div><div>world</div></a>', 66 testSingleToggle("unlink", '<a href="http://webkit.org/" style="font-weight: bol d;"><div style="font-weight: normal;">hello</div><div>world</div></a>',
68 selectLastWord, '<a href="http://webkit.org/"><div style="font-weight: norma l;">hello</div></a><div style="font-weight: bold;">world</div>'); 67 selectLastWord, '<a href="http://webkit.org/"><div style="font-weight: norma l;">hello</div></a><div style="font-weight: bold;">world</div>');
69 68
70 document.body.removeChild(testContainer); 69 document.body.removeChild(testContainer);
71 70
72 var successfullyParsed = true; 71 var successfullyParsed = true;
OLDNEW
« no previous file with comments | « LayoutTests/editing/execCommand/script-tests/toggle-link-win.js ('k') | LayoutTests/editing/execCommand/toggle-link-win.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698