Bug 174142 - When dragging a selection, clearing the selection in dragstart should not crash the web process
Summary: When dragging a selection, clearing the selection in dragstart should not cra...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-07-04 16:30 PDT by Wenson Hsieh
Modified: 2017-07-05 13:32 PDT (History)
4 users (show)

See Also:


Attachments
Patch (10.06 KB, patch)
2017-07-04 17:04 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wenson Hsieh 2017-07-04 16:30:16 PDT
Test case:

<meta name="viewport" content="width=device-width, initial-scale=1">
<code><p id="paragraph" style="font-size: 100px;">START DRAGGING</p></code>
<script>
function select(node) {
    let range = document.createRange(node);
    range.setStartBefore(node);
    range.setEndAfter(node);
    getSelection().removeAllRanges();
    getSelection().addRange(range);
}

select(paragraph.childNodes[0]);
document.body.addEventListener("dragstart", () => {
    getSelection().removeAllRanges();
    paragraph.textContent = "PASS";
    paragraph.style.color = "green";
});
</script>
Comment 1 Wenson Hsieh 2017-07-04 16:34:53 PDT
<rdar://problem/33067501>
Comment 2 Wenson Hsieh 2017-07-04 17:04:36 PDT
Created attachment 314586 [details]
Patch
Comment 3 WebKit Commit Bot 2017-07-05 13:32:45 PDT
Comment on attachment 314586 [details]
Patch

Clearing flags on attachment: 314586

Committed r219153: <http://trac.webkit.org/changeset/219153>
Comment 4 WebKit Commit Bot 2017-07-05 13:32:46 PDT
All reviewed patches have been landed.  Closing bug.