| var edit = document.getElementById("edit"); |
| edit.nextSibling.parentNode.removeChild(edit.nextSibling); |
| var source = document.getElementById("source"); |
| var selection = getSelection(); |
| selection.setPosition(source.firstChild, 5); |
| selection.modify("extend", "forward", "word"); |
| document.execCommand("Copy"); |
| document.execCommand("SelectAll"); |
| document.execCommand("Paste"); |
| Test for <i><a href="rdar://problem/6864786">rdar://problem/6864786</a>: REGRESSION: Crash below ApplyStyleCommand::applyInlineStyleToRange when reviewing a patch in Bugzilla</i>. |
| The test passes if it does not crash. |
| <div id="source" style="font-size: 36px">Copy the second word in this sentence.</div> |
| <pre id="edit" style="-webkit-user-modify: read-write-plaintext-only;">Select All here and paste<br></pre> |