[Webkit-unassigned] [Bug 72281] Fix find on web pages with -webkit-user-select: none for Chromium

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Nov 18 10:56:18 PST 2011


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





--- Comment #11 from Darin Adler <darin at apple.com>  2011-11-18 10:56:18 PST ---
(From update of attachment 115832)
View in context: https://bugs.webkit.org/attachment.cgi?id=115832&action=review

> Source/WebCore/editing/Editor.cpp:2785
> +PassRefPtr<Range> Editor::findStringUsingMarkers(const String& target, Range* previousMatch, FindOptions options)
> +{
> +    ExceptionCode ec = 0;
> +
> +    if (previousMatch)
> +        m_frame->document()->markers()->setMarkersActive(previousMatch, false);
> +
> +    RefPtr<Range> nextMatch;
> +    do {
> +        nextMatch = rangeOfString(target, previousMatch, options);
> +        if (!nextMatch || (nextMatch->collapsed(ec) && !nextMatch->startContainer()->isInShadowTree()))
> +            return 0;
> +    } while (!insideVisibleArea(nextMatch.get()));
> +
> +    // Scroll the result into view.
> +    nextMatch->firstNode()->renderer()->enclosingLayer()->scrollRectToVisible(
> +        nextMatch->boundingBox(),
> +        ScrollAlignment::alignCenterIfNeeded,
> +        ScrollAlignment::alignCenterIfNeeded);
> +    m_frame->document()->markers()->setMarkersActive(nextMatch.get(), true);
> +
> +    return nextMatch.release();
> +}

Why does this code need to be inside Editor?

The caller is going to have to manipulate the markers directly anyway if it wants to, say, “leave find mode”, so encapsulating the creation and destruction of these markers here inside this function does not provide a useful abstraction.

-- 
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