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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/execCommand/script-tests/remove-format-multiple-elements-mac.js

Issue 2193033004: Restore the collapsed spaces of the text when we copy it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test fails Created 4 years, 4 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("This tests removing multiple elements by RemoveFormat command.") 1 description("This tests removing multiple elements by RemoveFormat command.")
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 if (window.internals) 6 if (window.internals)
7 internals.settings.setEditingBehavior("mac"); 7 internals.settings.setEditingBehavior("mac");
8 8
9 function testRemoveFormat(initialContents, selector, expected) 9 function testRemoveFormat(initialContents, selector, expected)
10 { 10 {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 } 58 }
59 59
60 testRemoveFormat('hello', selectAll, 'hello'); 60 testRemoveFormat('hello', selectAll, 'hello');
61 testRemoveFormat('<i>hello</i> <u>world</u>', selectAll, 'hello world'); 61 testRemoveFormat('<i>hello</i> <u>world</u>', selectAll, 'hello world');
62 testRemoveFormat('<b><u>hello</u> world</b> <a href="http://webkit.org/"><em>Web Kit</em></a>', selectAll, 'hello world <a href="http://webkit.org/">WebKit</a>') ; 62 testRemoveFormat('<b><u>hello</u> world</b> <a href="http://webkit.org/"><em>Web Kit</em></a>', selectAll, 'hello world <a href="http://webkit.org/">WebKit</a>') ;
63 testRemoveFormat('<b><u>hello</u> world</b> <a href="http://webkit.org/"><em>Web Kit</em></a>', 63 testRemoveFormat('<b><u>hello</u> world</b> <a href="http://webkit.org/"><em>Web Kit</em></a>',
64 selectSecondWord, '<b><u>hello</u> </b>world <a href="http://webkit.org/"><e m>WebKit</em></a>'); 64 selectSecondWord, '<b><u>hello</u> </b>world <a href="http://webkit.org/"><e m>WebKit</em></a>');
65 testRemoveFormat('<sub><tt>hello world WebKit</tt></sub>', selectSecondWord, '<s ub><tt>hello </tt></sub>world<sub><tt> WebKit</tt></sub>'); 65 testRemoveFormat('<sub><tt>hello world WebKit</tt></sub>', selectSecondWord, '<s ub><tt>hello </tt></sub>world<sub><tt> WebKit</tt></sub>');
66 testRemoveFormat('<q><ins><var>hello wor</var>ld</ins> WebKit</q>', selectSecond Word, '<q><ins><var>hello </var></ins></q>world<q> WebKit</q>'); 66 testRemoveFormat('<q><ins><var>hello wor</var>ld</ins> WebKit</q>', selectSecond Word, '<q><ins><var>hello </var></ins></q>world<q> WebKit</q>');
67 testRemoveFormat('<b>hello <dfn>world <kbd>WebKit</kbd></dfn></b>', selectLastWo rd, '<b>hello <dfn>world </dfn></b>WebKit'); 67 testRemoveFormat('<b>hello <dfn>world <kbd>WebKit</kbd></dfn></b>', selectLastWo rd, '<b>hello <dfn>world </dfn></b>WebKit');
68 testRemoveFormat('<b>hello <dfn>world <kbd>WebKit</kbd></dfn></b>', selectSecond Word, '<b>hello </b>world<b><dfn> <kbd>WebKit</kbd></dfn></b>'); 68 testRemoveFormat('<b>hello <dfn>world <kbd>WebKit</kbd></dfn></b>', selectSecond Word, '<b>hello </b>world <b><dfn><kbd>WebKit</kbd></dfn></b>');
69 testRemoveFormat('<code>hello <strong>world WebKit</storng></code>', selectFirst TwoWords, 'hello world<code><strong> WebKit</strong></code>'); 69 testRemoveFormat('<code>hello <strong>world WebKit</storng></code>', selectFirst TwoWords, 'hello world<code><strong> WebKit</strong></code>');
70 testRemoveFormat('<acronym><tt><mark><samp>hello</samp></mark> world <sub>WebKit </sub></tt></acronym>', 70 testRemoveFormat('<acronym><tt><mark><samp>hello</samp></mark> world <sub>WebKit </sub></tt></acronym>',
71 selectFirstTwoWords, '<mark>hello</mark> world<acronym><tt> <sub>WebKit</sub ></tt></acronym>'); 71 selectFirstTwoWords, '<mark>hello</mark> world <acronym><tt><sub>WebKit</sub ></tt></acronym>');
72 testRemoveFormat('<b><div>hello world</div></b><div>WebKit</div>', selectLastTwo Words, '<div><b>hello </b>world</div><div>WebKit</div>'); 72 testRemoveFormat('<b><div>hello world</div></b><div>WebKit</div>', selectLastTwo Words, '<div><b>hello </b>world</div><div>WebKit</div>');
73 testRemoveFormat('<q><b><div>hello world</div></b>WebKit</q>', selectLastTwoWord s, '<div><q><b>hello </b></q>world</div>WebKit'); 73 testRemoveFormat('<q><b><div>hello world</div></b>WebKit</q>', selectLastTwoWord s, '<div><q><b>hello </b></q>world</div>WebKit');
74 testRemoveFormat('<q><b><div>hello world</div></b>WebKit</q>', selectSecondWord, '<div><q><b>hello </b></q>world</div><q>WebKit</q>'); 74 testRemoveFormat('<q><b><div>hello world</div></b>WebKit</q>', selectSecondWord, '<div><q><b>hello </b></q>world</div><q>WebKit</q>');
75 testRemoveFormat('<b><div>hello</div>webkit</b>', selectFirstLine, '<div>hello</ div><b>webkit</b>'); 75 testRemoveFormat('<b><div>hello</div>webkit</b>', selectFirstLine, '<div>hello</ div><b>webkit</b>');
76 76
77 testRemoveFormat('<i style="font-weight:bold;">hello</i> <u>world</u>', selectAl l, 'hello world'); 77 testRemoveFormat('<i style="font-weight:bold;">hello</i> <u>world</u>', selectAl l, 'hello world');
78 testRemoveFormat('<font color="red"><b style="font-size: large;"><u>hello</u> wo rld</b> WebKit</font>', 78 testRemoveFormat('<font color="red"><b style="font-size: large;"><u>hello</u> wo rld</b> WebKit</font>',
79 selectSecondWord, '<font color="red"><b style="font-size: large;"><u>hello</ u> </b></font>world<font color="red"> WebKit</font>'); 79 selectSecondWord, '<font color="red"><b style="font-size: large;"><u>hello</ u> </b></font>world<font color="red"> WebKit</font>');
80 testRemoveFormat('<font size="5"><i><u style="font-size: small;">hello</u> world </i><font size="3"> WebKit</font></font>', 80 testRemoveFormat('<font size="5"><i><u style="font-size: small;">hello</u> world </i><font size="3"> WebKit</font></font>',
81 selectSecondWord, '<font size="5"><i><u style="font-size: small;">hello</u> </i></font>world<font size="5"><font size="3"> WebKit</font></font>'); 81 selectSecondWord, '<font size="5"><i><u style="font-size: small;">hello</u> </i></font>world<font size="5"><font size="3"> WebKit</font></font>');
82 testRemoveFormat('<sup><div style="text-decoration-line: underline; font-size: l arge;">hello <dfn style="font-size: normal;">world</dfn></div> WebKit</sup>', 82 testRemoveFormat('<sup><div style="text-decoration-line: underline; font-size: l arge;">hello <dfn style="font-size: normal;">world</dfn></div> WebKit</sup>',
83 selectSecondWord, '<div><sup><font size="4"><u>hello </u></font></sup>world< /div><sup> WebKit</sup>'); 83 selectSecondWord, '<div><sup><font size="4"><u>hello </u></font></sup>world< /div><sup> WebKit</sup>');
84 84
85 document.body.removeChild(testContainer); 85 document.body.removeChild(testContainer);
86 86
87 var successfullyParsed = true; 87 var successfullyParsed = true;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698