<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - VisibleSelection should only accept Range by reference"
href="https://bugs.webkit.org/show_bug.cgi?id=144047#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - VisibleSelection should only accept Range by reference"
href="https://bugs.webkit.org/show_bug.cgi?id=144047">bug 144047</a>
from <span class="vcard"><a class="email" href="mailto:bfulgham@webkit.org" title="Brent Fulgham <bfulgham@webkit.org>"> <span class="fn">Brent Fulgham</span></a>
</span></b>
<pre>It's interesting (alarming?) that there are cases in the same file (e.g., WebPage.cpp) where null checks are performed, and others where it is missed:
Example 1: (WebPage.cpp Line 4207)
void WebPage::insertTextAsync(const String& text, const EditingRange& replacementEditingRange, bool registerUndoGroup)
RefPtr<Range> replacementRange = rangeFromEditingRange(frame, replacementEditingRange);
if (replacementRange)
frame.selection().setSelection(VisibleSelection(replacementRange.get(), SEL_DEFAULT_AFFINITY));
Example 2: (WebPage.cpp Line 4296)
void WebPage::setCompositionAsync(const String& text, Vector<CompositionUnderline> underlines, const EditingRange& selection, const EditingRange& replacementEditingRange)
replacementRange = rangeFromEditingRange(frame, replacementEditingRange);
frame.selection().setSelection(VisibleSelection(replacementRange.get(), SEL_DEFAULT_AFFINITY));</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>