| <!DOCTYPE html> |
| <html> |
| <body> |
| <script src="../../resources/dump-as-markup.js"></script> |
| <div id="div" contenteditable="true"><b>This</b> text should look the same as the text above.</div> |
| <script> |
| |
| if (window.testRunner) |
| testRunner.dumpEditingCallbacks(); |
| |
| if (window.internals) |
| internals.settings.setEditingBehavior('mac'); |
| |
| var sel = window.getSelection(); |
| var div = document.getElementById("div"); |
| |
| sel.setPosition(div, 0); |
| |
| sel.modify("extend", "forward", "word"); |
| document.execCommand("RemoveFormat"); |
| |
| Markup.description("This tests that RemoveFormat not only removes style from the selected part of the DOM, but that it also applies the document default style to the selection if that's necessary in order to leave the selected text unstyled."); |
| Markup.dump(div); |
| |
| </script> |
| </body> |
| </html> |