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

Changeset 121125 in webkit


Ignore:
Timestamp:
Jun 24, 2012, 5:29:03 PM (14 years ago)
Author:
abarth@webkit.org
Message:

Change the type of the second argument of FrameSelection::revealSelection to use RevealExtentOption
https://bugs.webkit.org/show_bug.cgi?id=89833

Reviewed by Ryosuke Niwa.

As requested by Ryosuke Niwa. Rare boolean parameters are hard to read.

  • WebCore.exp.in:
  • editing/Editor.cpp:

(WebCore::Editor::revealSelectionAfterEditingOperation):

  • editing/Editor.h:

(Editor):

  • editing/FrameSelection.cpp:

(WebCore::FrameSelection::setSelection):
(WebCore::FrameSelection::revealSelection):

  • editing/FrameSelection.h:
Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r121124 r121125  
     12012-06-24  Adam Barth  <abarth@webkit.org>
     2
     3        Change the type of the second argument of FrameSelection::revealSelection to use RevealExtentOption
     4        https://bugs.webkit.org/show_bug.cgi?id=89833
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        As requested by Ryosuke Niwa.  Rare boolean parameters are hard to read.
     9
     10        * WebCore.exp.in:
     11        * editing/Editor.cpp:
     12        (WebCore::Editor::revealSelectionAfterEditingOperation):
     13        * editing/Editor.h:
     14        (Editor):
     15        * editing/FrameSelection.cpp:
     16        (WebCore::FrameSelection::setSelection):
     17        (WebCore::FrameSelection::revealSelection):
     18        * editing/FrameSelection.h:
     19
    1202012-06-24  Antti Koivisto  <antti@apple.com>
    221
  • trunk/Source/WebCore/WebCore.exp.in

    r121016 r121125  
    255255__ZN7WebCore14FrameSelection10setFocusedEb
    256256__ZN7WebCore14FrameSelection12setSelectionERKNS_16VisibleSelectionEjNS0_19CursorAlignOnScrollENS_15TextGranularityE
    257 __ZN7WebCore14FrameSelection15revealSelectionERKNS_15ScrollAlignmentEb
     257__ZN7WebCore14FrameSelection15revealSelectionERKNS_15ScrollAlignmentENS_18RevealExtentOptionE
    258258__ZN7WebCore14FrameSelection16setSelectedRangeEPNS_5RangeENS_9EAffinityEb
    259259__ZN7WebCore14FrameSelection19absoluteCaretBoundsEv
  • trunk/Source/WebCore/editing/Editor.cpp

    r121121 r121125  
    23022302        return;
    23032303
    2304     m_frame->selection()->revealSelection(alignment, revealExtentOption == RevealExtent);
     2304    m_frame->selection()->revealSelection(alignment, revealExtentOption);
    23052305}
    23062306
  • trunk/Source/WebCore/editing/Editor.h

    r121121 r121125  
    424424    void pasteWithPasteboard(Pasteboard*, bool allowPlainText);
    425425
    426     enum RevealExtentOption {
    427         RevealExtent,
    428         DoNotRevealExtent
    429     };
    430 
    431426    void revealSelectionAfterEditingOperation(const ScrollAlignment& = ScrollAlignment::alignCenterIfNeeded, RevealExtentOption = DoNotRevealExtent);
    432427    void markMisspellingsOrBadGrammar(const VisibleSelection&, bool checkSpelling, RefPtr<Range>& firstMisspellingRange);
  • trunk/Source/WebCore/editing/FrameSelection.cpp

    r119705 r121125  
    304304            alignment = (align == AlignCursorOnScrollAlways) ? ScrollAlignment::alignTopAlways : ScrollAlignment::alignToEdgeIfNeeded;
    305305
    306         revealSelection(alignment, true);
     306        revealSelection(alignment, RevealExtent);
    307307    }
    308308
     
    19331933}
    19341934
    1935 void FrameSelection::revealSelection(const ScrollAlignment& alignment, bool revealExtent)
     1935void FrameSelection::revealSelection(const ScrollAlignment& alignment, RevealExtentOption revealExtentOption)
    19361936{
    19371937    LayoutRect rect;
     
    19441944        break;
    19451945    case VisibleSelection::RangeSelection:
    1946         rect = revealExtent ? VisiblePosition(extent()).absoluteCaretBounds() : enclosingIntRect(bounds(false));
     1946        rect = revealExtentOption == RevealExtent ? VisiblePosition(extent()).absoluteCaretBounds() : enclosingIntRect(bounds(false));
    19471947        break;
    19481948    }
  • trunk/Source/WebCore/editing/FrameSelection.h

    r120896 r121125  
    5050enum EUserTriggered { NotUserTriggered = 0, UserTriggered = 1 };
    5151
     52enum RevealExtentOption {
     53    RevealExtent,
     54    DoNotRevealExtent
     55};
     56
    5257class CaretBase {
    5358    WTF_MAKE_NONCOPYABLE(CaretBase);
     
    248253    HTMLFormElement* currentForm() const;
    249254
    250     void revealSelection(const ScrollAlignment& = ScrollAlignment::alignCenterIfNeeded, bool revealExtent = false);
     255    void revealSelection(const ScrollAlignment& = ScrollAlignment::alignCenterIfNeeded, RevealExtentOption = DoNotRevealExtent);
    251256    void setSelectionFromNone();
    252257
Note: See TracChangeset for help on using the changeset viewer.