| OLD | NEW |
| 1 <html> | 1 <!doctype html> |
| 2 <head> | 2 <script src="../../resources/testharness.js"></script> |
| 3 <style> | 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 .editing { | 4 <script src="../assert_selection.js"></script> |
| 5 border: 2px solid red; | |
| 6 padding: 12px; | |
| 7 font-size: 24px; | |
| 8 text-decoration: underline; | |
| 9 } | |
| 10 </style> | |
| 11 <script src="../../resources/dump-as-markup.js"></script> | |
| 12 <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script
> | |
| 13 <script> | 5 <script> |
| 6 // Test for http://wkb.ug/27809 |
| 7 test(() => assert_selection( |
| 8 [ |
| 9 '<style>.underline { text-decoration: underline; }</style>', |
| 10 '<div class="underline" contenteditable>^abc|</div>', |
| 11 ].join(''), |
| 12 'underline', |
| 13 [ |
| 14 '<style>.underline { text-decoration: underline; }</style>', |
| 15 '<div class="underline" contenteditable>^abc|</div>', |
| 16 ].join('')), |
| 17 'Underline command does nothing when selected text has undeline (style s
heet).'); |
| 14 | 18 |
| 15 function editingTest() { | 19 test(() => assert_selection( |
| 16 if (window.testRunner) | 20 '<div contenteditable style="text-decoration: underline">^abc|</div>', |
| 17 testRunner.dumpAsText(); | 21 'underline', |
| 18 for (i = 0; i < 6; i++) | 22 '<div contenteditable style="text-decoration: underline">^abc|</div>'), |
| 19 typeCharacterCommand(); | 23 'Underline command does nothing when selected text has undeline (inline)
.'); |
| 20 typeCharacterCommand(' '); | |
| 21 for (i = 0; i < 6; i++) | |
| 22 typeCharacterCommand(); | |
| 23 typeCharacterCommand(' '); | |
| 24 for (i = 0; i < 6; i++) | |
| 25 typeCharacterCommand(); | |
| 26 moveSelectionBackwardByWordCommand(); | |
| 27 moveSelectionBackwardByWordCommand(); | |
| 28 extendSelectionForwardByWordCommand(); | |
| 29 underlineCommand(); | |
| 30 document.body.appendChild(document.createTextNode(document.getElementById('r
oot').innerHTML)); | |
| 31 } | |
| 32 | |
| 33 </script> | 24 </script> |
| 34 <title>Editing Test</title> | |
| 35 </head> | |
| 36 <body> | |
| 37 <div contenteditable id="root" class="editing"> | |
| 38 <span id="test"></span> | |
| 39 </div> | |
| 40 <script> | |
| 41 Markup.description('This tests removing underline from stylesheet (.editing has
underline). Because text-decoration that comes from a style rule cannot be pushe
d down, the underline should stay. (see bug 27809).'); | |
| 42 runEditingTest(); | |
| 43 Markup.dump('root'); | |
| 44 </script> | |
| 45 </body> | |
| 46 </html> | |
| OLD | NEW |