[webkit-reviews] review granted: [Bug 134897] Copying and pasting trivial H2 content causes a crash in firstPositionInNode : [Attachment 235333] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Jul 22 18:34:45 PDT 2014
Ryosuke Niwa <rniwa at webkit.org> has granted Myles C. Maxfield
<mmaxfield at apple.com>'s request for review:
Bug 134897: Copying and pasting trivial H2 content causes a crash in
firstPositionInNode
https://bugs.webkit.org/show_bug.cgi?id=134897
Attachment 235333: Patch
https://bugs.webkit.org/attachment.cgi?id=235333&action=review
------- Additional Comments from Ryosuke Niwa <rniwa at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=235333&action=review
> LayoutTests/editing/pasteboard/heading-crash.html:6
> +<head>
> +<script src="../editing.js"></script>
> +<script src="../../resources/dump-as-markup.js"></script>
> +</head>
We don't need to put this in head.
> LayoutTests/editing/pasteboard/heading-crash.html:12
> + <h2 id="source" contenteditable="true">Copy This Text</h2>
> + <h2 id="destination" contenteditable="true">Paste Here</h2>
> + <script>
> + if (window.testRunner)
> + testRunner.dumpAsText();
We don't normally indent test content like this.
> LayoutTests/editing/pasteboard/heading-crash.html:21
> + var range = document.createRange();
> + source.focus();
> + range.selectNodeContents(source);
> + selection.removeAllRanges();
> + selection.addRange(range);
Why don't you just do document.execCommand('selectAll') instead?
> LayoutTests/editing/pasteboard/heading-crash.html:27
> + selection.removeAllRanges();
> + range.selectNodeContents(destination);
> + selection.addRange(range);
Ditto. destination.focus(); document.execCommand('selectAll').
More information about the webkit-reviews
mailing list