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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/style/script-tests/push-down-implicit-styles-around-list-win.js

Issue 2800723002: Ensure we never remove the style attribute when syncing it from CSSOM. (Closed)
Patch Set: Nits Created 3 years, 8 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 push down inline styles properly.'); 1 description('Test to make sure we push down inline styles properly.');
2 2
3 if (window.internals) 3 if (window.internals)
4 internals.settings.setEditingBehavior('win'); 4 internals.settings.setEditingBehavior('win');
5 var testContainer = document.createElement("div"); 5 var testContainer = document.createElement("div");
6 testContainer.contentEditable = true; 6 testContainer.contentEditable = true;
7 document.body.appendChild(testContainer); 7 document.body.appendChild(testContainer);
8 8
9 function testSingleToggle(toggleCommand, selector, initialContents, expectedCont ents) 9 function testSingleToggle(toggleCommand, selector, initialContents, expectedCont ents)
10 { 10 {
(...skipping 13 matching lines...) Expand all
24 window.getSelection().modify('extend', 'forward', 'word'); 24 window.getSelection().modify('extend', 'forward', 'word');
25 return 'first word'; 25 return 'first word';
26 } 26 }
27 27
28 function selectLastWord(container) { 28 function selectLastWord(container) {
29 window.getSelection().collapse(container, container.childNodes.length); 29 window.getSelection().collapse(container, container.childNodes.length);
30 window.getSelection().modify('extend', 'backward', 'word'); 30 window.getSelection().modify('extend', 'backward', 'word');
31 return 'last word'; 31 return 'last word';
32 } 32 }
33 33
34 testSingleToggle("bold", selectFirstWord, '<b><ul><li><b>a</b></li></ul></b>', ' <ul><li>a</li></ul>'); 34 testSingleToggle("bold", selectFirstWord, '<b><ul><li><b>a</b></li></ul></b>', ' <ul style=""><li style="">a</li></ul>');
35 testSingleToggle("bold", selectFirstWord, '<b><ul><li>hello</li><li>world</li></ ul></b>', '<ul><li>hello</li><li style="font-weight: bold;">world</li></ul>'); 35 testSingleToggle("bold", selectFirstWord, '<b><ul><li>hello</li><li>world</li></ ul></b>', '<ul style=""><li style="">hello</li><li style="font-weight: bold;">wo rld</li></ul>');
36 testSingleToggle("bold", selectLastWord, '<ul><li>hello</li><li style="font-weig ht: bold;">world</li></ul>', '<ul><li>hello</li><li>world</li></ul>'); 36 testSingleToggle("bold", selectLastWord, '<ul><li>hello</li><li style="font-weig ht: bold;">world</li></ul>', '<ul><li>hello</li><li style="">world</li></ul>');
37 testSingleToggle("bold", selectFirstWord, '<b><ul><li>hello world</li><li>webkit </li></ul></b>', '<ul><li>hello <b>world</b></li><li style="font-weight: bold;"> webkit</li></ul>'); 37 testSingleToggle("bold", selectFirstWord, '<b><ul><li>hello world</li><li>webkit </li></ul></b>', '<ul style=""><li style="">hello <b>world</b></li><li style="fo nt-weight: bold;">webkit</li></ul>');
38 38
39 testSingleToggle("italic", selectFirstWord, '<i><ul><li><i>a</i></li></ul></i>', '<ul><li>a</li></ul>'); 39 testSingleToggle("italic", selectFirstWord, '<i><ul><li><i>a</i></li></ul></i>', '<ul style=""><li style="">a</li></ul>');
40 testSingleToggle("italic", selectFirstWord, '<i><ul><li>hello</li><li>world</li> </ul></i>', '<ul><li>hello</li><li style="font-style: italic;">world</li></ul>') ; 40 testSingleToggle("italic", selectFirstWord, '<i><ul><li>hello</li><li>world</li> </ul></i>', '<ul style=""><li style="">hello</li><li style="font-style: italic;" >world</li></ul>');
41 testSingleToggle("italic", selectLastWord, '<ul><li>hello</li><li style="font-st yle: italic;">world</li></ul>', '<ul><li>hello</li><li>world</li></ul>'); 41 testSingleToggle("italic", selectLastWord, '<ul><li>hello</li><li style="font-st yle: italic;">world</li></ul>', '<ul><li>hello</li><li style="">world</li></ul>' );
42 testSingleToggle("italic", selectFirstWord, '<i><ul><li>hello world</li><li>webk it</li></ul></i>', '<ul><li>hello <i>world</i></li><li style="font-style: italic ;">webkit</li></ul>'); 42 testSingleToggle("italic", selectFirstWord, '<i><ul><li>hello world</li><li>webk it</li></ul></i>', '<ul style=""><li style="">hello <i>world</i></li><li style=" font-style: italic;">webkit</li></ul>');
43 43
44 testSingleToggle("underline", selectFirstWord, '<u><ul><li><u>a</u></li></ul></u >', '<ul><li>a</li></ul>'); 44 testSingleToggle("underline", selectFirstWord, '<u><ul><li><u>a</u></li></ul></u >', '<ul style=""><li style="">a</li></ul>');
45 testSingleToggle("underline", selectFirstWord, '<u><ul><li>hello</li><li>world</ li></ul></u>', '<ul><li>hello</li><li style="text-decoration-line: underline;">w orld</li></ul>'); 45 testSingleToggle("underline", selectFirstWord, '<u><ul><li>hello</li><li>world</ li></ul></u>', '<ul style=""><li style="">hello</li><li style="text-decoration-l ine: underline;">world</li></ul>');
46 testSingleToggle("underline", selectLastWord, '<ul><li>hello</li><li style="text -decoration: underline;">world</li></ul>', '<ul><li>hello</li><li>world</li></ul >'); 46 testSingleToggle("underline", selectLastWord, '<ul><li>hello</li><li style="text -decoration: underline;">world</li></ul>', '<ul><li>hello</li><li style="">world </li></ul>');
47 testSingleToggle("underline", selectFirstWord, '<u><ul><li>hello world</li><li>w ebkit</li></ul></u>', '<ul><li>hello <u>world</u></li><li style="text-decoration -line: underline;">webkit</li></ul>'); 47 testSingleToggle("underline", selectFirstWord, '<u><ul><li>hello world</li><li>w ebkit</li></ul></u>', '<ul style=""><li style="">hello <u>world</u></li><li styl e="text-decoration-line: underline;">webkit</li></ul>');
48 48
49 testSingleToggle("strikethrough", selectFirstWord, '<strike><ul><li><strike>a</s trike></li></ul></strike>', '<ul><li>a</li></ul>'); 49 testSingleToggle("strikethrough", selectFirstWord, '<strike><ul><li><strike>a</s trike></li></ul></strike>', '<ul style=""><li style="">a</li></ul>');
50 testSingleToggle("strikethrough", selectFirstWord, '<strike><ul><li>hello</li><l i>world</li></ul></strike>', '<ul><li>hello</li><li style="text-decoration-line: line-through;">world</li></ul>'); 50 testSingleToggle("strikethrough", selectFirstWord, '<strike><ul><li>hello</li><l i>world</li></ul></strike>', '<ul style=""><li style="">hello</li><li style="tex t-decoration-line: line-through;">world</li></ul>');
51 testSingleToggle("strikethrough", selectLastWord, '<ul><li>hello</li><li style=" text-decoration: line-through;">world</li></ul>', '<ul><li>hello</li><li>world</ li></ul>'); 51 testSingleToggle("strikethrough", selectLastWord, '<ul><li>hello</li><li style=" text-decoration: line-through;">world</li></ul>', '<ul><li>hello</li><li style=" ">world</li></ul>');
52 testSingleToggle("strikethrough", selectFirstWord, '<strike><ul><li>hello world< /li><li>webkit</li></ul></strike>', '<ul><li>hello <strike>world</strike></li><l i style="text-decoration-line: line-through;">webkit</li></ul>'); 52 testSingleToggle("strikethrough", selectFirstWord, '<strike><ul><li>hello world< /li><li>webkit</li></ul></strike>', '<ul style=""><li style="">hello <strike>wor ld</strike></li><li style="text-decoration-line: line-through;">webkit</li></ul> ');
53 53
54 document.body.removeChild(testContainer); 54 document.body.removeChild(testContainer);
55 55
56 var successfullyParsed = true; 56 var successfullyParsed = true;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698