⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 121121 in webkit


Ignore:
Timestamp:
Jun 24, 2012, 2:44:47 PM (14 years ago)
Author:
commit-queue@webkit.org
Message:

After Editor::setComposition is called, input should scroll to the end of the composition.
https://bugs.webkit.org/show_bug.cgi?id=88999

Patch by Oli Lan <olilan@chromium.org> on 2012-06-24
Reviewed by Ryosuke Niwa.

Source/WebCore:

This fixes an issue where after a call to setComposition, the start of the composition is revealed
(scrolled to) instead of the end (where the caret/editing point should be).

The change is to allow revealSelectionAfterEditingOperation to take a revealExtent parameter,
and to pass that parameter as true when calling from setIgnoreCompositionSelectionChange, which is
called at the end of setComposition.

Test: fast/forms/input-set-composition-scroll.html

  • editing/Editor.cpp:

(WebCore::Editor::revealSelectionAfterEditingOperation):
(WebCore::Editor::setIgnoreCompositionSelectionChange):

  • editing/Editor.h:

(Editor):

LayoutTests:

This tests that after setComposition is called, the input scrolls to the end of the composition
(i.e. that the end of the selection/composition is revealed).

  • fast/forms/input-set-composition-scroll-expected.txt: Added.
  • fast/forms/input-set-composition-scroll.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r121120 r121121  
     12012-06-24  Oli Lan  <olilan@chromium.org>
     2
     3        After Editor::setComposition is called, input should scroll to the end of the composition.
     4        https://bugs.webkit.org/show_bug.cgi?id=88999
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        This tests that after setComposition is called, the input scrolls to the end of the composition
     9        (i.e. that the end of the selection/composition is revealed).
     10
     11        * fast/forms/input-set-composition-scroll-expected.txt: Added.
     12        * fast/forms/input-set-composition-scroll.html: Added.
     13
    1142012-06-24  Adam Barth  <abarth@webkit.org>
    215
  • trunk/Source/WebCore/ChangeLog

    r121117 r121121  
     12012-06-24  Oli Lan  <olilan@chromium.org>
     2
     3        After Editor::setComposition is called, input should scroll to the end of the composition.
     4        https://bugs.webkit.org/show_bug.cgi?id=88999
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        This fixes an issue where after a call to setComposition, the start of the composition is revealed
     9        (scrolled to) instead of the end (where the caret/editing point should be).
     10
     11        The change is to allow revealSelectionAfterEditingOperation to take a revealExtent parameter,
     12        and to pass that parameter as true when calling from setIgnoreCompositionSelectionChange, which is
     13        called at the end of setComposition.
     14
     15        Test: fast/forms/input-set-composition-scroll.html
     16
     17        * editing/Editor.cpp:
     18        (WebCore::Editor::revealSelectionAfterEditingOperation):
     19        (WebCore::Editor::setIgnoreCompositionSelectionChange):
     20        * editing/Editor.h:
     21        (Editor):
     22
    1232012-06-24  Joshua Bell  <jsbell@chromium.org>
    224
  • trunk/Source/WebCore/editing/Editor.cpp

    r120985 r121121  
    22972297}
    22982298
    2299 void Editor::revealSelectionAfterEditingOperation(const ScrollAlignment& alignment)
     2299void Editor::revealSelectionAfterEditingOperation(const ScrollAlignment& alignment, RevealExtentOption revealExtentOption)
    23002300{
    23012301    if (m_ignoreCompositionSelectionChange)
    23022302        return;
    23032303
    2304     m_frame->selection()->revealSelection(alignment);
     2304    m_frame->selection()->revealSelection(alignment, revealExtentOption == RevealExtent);
    23052305}
    23062306
     
    23122312    m_ignoreCompositionSelectionChange = ignore;
    23132313    if (!ignore)
    2314         revealSelectionAfterEditingOperation();
     2314        revealSelectionAfterEditingOperation(ScrollAlignment::alignToEdgeIfNeeded, RevealExtent);
    23152315}
    23162316
  • trunk/Source/WebCore/editing/Editor.h

    r120985 r121121  
    423423    void pasteAsPlainTextWithPasteboard(Pasteboard*);
    424424    void pasteWithPasteboard(Pasteboard*, bool allowPlainText);
    425     void revealSelectionAfterEditingOperation(const ScrollAlignment& = ScrollAlignment::alignCenterIfNeeded);
     425
     426    enum RevealExtentOption {
     427        RevealExtent,
     428        DoNotRevealExtent
     429    };
     430
     431    void revealSelectionAfterEditingOperation(const ScrollAlignment& = ScrollAlignment::alignCenterIfNeeded, RevealExtentOption = DoNotRevealExtent);
    426432    void markMisspellingsOrBadGrammar(const VisibleSelection&, bool checkSpelling, RefPtr<Range>& firstMisspellingRange);
    427433    TextCheckingTypeMask resolveTextCheckingTypeMask(TextCheckingTypeMask);
Note: See TracChangeset for help on using the changeset viewer.