[Webkit-unassigned] [Bug 46986] Should commit pending autocorrection before next round of text checking.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Oct 6 14:06:58 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=46986





--- Comment #2 from Enrica Casucci <enrica at apple.com>  2010-10-06 14:06:58 PST ---
(From update of attachment 69481)
View in context: https://bugs.webkit.org/attachment.cgi?id=69481&action=review

> WebCore/editing/Editor.cpp:2410
> +    if (m_rangeToBeReplacedByCorrection.get()) {

No need to call get(). Your test could be
if (m_rangeToBeReplacedByCorrection)

> WebCore/editing/Editor.cpp:2412
> +        RefPtr<Range> paragraphRange = m_rangeToBeReplacedByCorrection->cloneRange(ec);

It would be great if you could come up with a more descriptive name than paragraphRange.

> WebCore/editing/Editor.cpp:2416
> +            RefPtr<Range> offsetAsRange = Range::create(paragraphRange->startContainer(ec)->document(), paragraphRange->startPosition(), paragraphRange->startPosition());

Same for offsetAsRange.

> WebCore/editing/Editor.cpp:2421
> +                    // Take note of the location of autocorrection so that we can add marker after the replacement took place.

This code would benefit from a more detailed comment.

> WebCore/editing/Editor.cpp:2439
> +        m_rangeToBeReplacedByCorrection = RefPtr<Range>();

if what you want to do here is release, then call m_rangeToBeReplacedByCorrection.release();

> WebCore/editing/Editor.cpp:2717
> +            for (size_t i = 0; i < markerCount; ++i) {

You don't need markerCount, you can use directly markers.size() in your for loop.

> WebCore/editing/Editor.cpp:2724
> +            if (doMarkMisspelling)

You can use node->document()->markers()->addMarker, since you have node initialized.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list