| OLD | NEW |
| 1 <html> | 1 <!doctype html> |
| 2 <head> | 2 <script src="../../resources/testharness.js"></script> |
| 3 | 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <style> | 4 <script src="../assert_selection.js"></script> |
| 5 body { | |
| 6 font-size: 24px; | |
| 7 } | |
| 8 .editing { | |
| 9 border: 2px solid red; | |
| 10 padding: 12px; | |
| 11 } | |
| 12 p { | |
| 13 border: 2px solid blue; | |
| 14 padding: 12px; | |
| 15 } | |
| 16 br { | |
| 17 background-color: green; | |
| 18 } | |
| 19 | |
| 20 </style> | |
| 21 <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script
> | |
| 22 | |
| 23 <script> | 5 <script> |
| 24 | 6 test(() => assert_selection( |
| 25 function editingTest() { | 7 [ |
| 26 for (i = 0; i < 3; i++) | 8 '<div contenteditable>', |
| 27 moveSelectionForwardByCharacterCommand(); | 9 '<p id="test"><b>foo|</b><br>bar</p>', |
| 28 insertParagraphCommand(); | 10 '</div>', |
| 29 typeCharacterCommand(); | 11 ].join(''), |
| 30 } | 12 selection => { |
| 31 | 13 selection.document.execCommand('insertParagraph'); |
| 14 selection.document.execCommand('insertText', false, 'x'); |
| 15 }, |
| 16 [ |
| 17 '<div contenteditable>', |
| 18 '<p id="test"><b>foo</b></p>', |
| 19 '<p id="test"><b>x|<br></b>bar</p>', |
| 20 '</div>', |
| 21 ].join('')), |
| 22 'Insert "x" before BR, since insertParagraph puts caret before BR'); |
| 32 </script> | 23 </script> |
| 33 | |
| 34 <title>Editing Test</title> | |
| 35 </head> | |
| 36 <body contenteditable id="root" style="word-wrap: break-word; -khtml-nbsp-mode:
space; -khtml-line-break: after-white-space;"> | |
| 37 | |
| 38 Test inserting paragraphs: should see "foo" in a blue box, then a blue box with
with two lines in it: First line a bold "x"; second line a non-bold "bar". Fix f
or this bug: | |
| 39 <a href="rdar://problem/3924579"><rdar://problem/3927554></a> Style info a
pplied to remainder of document after a newline is entered | |
| 40 | |
| 41 <div style="height: 12px"></div> | |
| 42 | |
| 43 <p id="test"><b>foo</b><br>bar</p> | |
| 44 | |
| 45 <script> | |
| 46 runEditingTest(); | |
| 47 </script> | |
| 48 | |
| 49 </body> | |
| 50 </html> | |
| OLD | NEW |