Diff
Modified: trunk/Source/WebCore/ChangeLog (121124 => 121125)
--- trunk/Source/WebCore/ChangeLog 2012-06-25 00:14:23 UTC (rev 121124)
+++ trunk/Source/WebCore/ChangeLog 2012-06-25 00:29:03 UTC (rev 121125)
@@ -1,3 +1,22 @@
+2012-06-24 Adam Barth <[email protected]>
+
+ 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:
+
2012-06-24 Antti Koivisto <[email protected]>
Optimize RenderGeometryMap mappings gathering
Modified: trunk/Source/WebCore/WebCore.exp.in (121124 => 121125)
--- trunk/Source/WebCore/WebCore.exp.in 2012-06-25 00:14:23 UTC (rev 121124)
+++ trunk/Source/WebCore/WebCore.exp.in 2012-06-25 00:29:03 UTC (rev 121125)
@@ -254,7 +254,7 @@
__ZN7WebCore14FileIconLoader14notifyFinishedEN3WTF10PassRefPtrINS_4IconEEE
__ZN7WebCore14FrameSelection10setFocusedEb
__ZN7WebCore14FrameSelection12setSelectionERKNS_16VisibleSelectionEjNS0_19CursorAlignOnScrollENS_15TextGranularityE
-__ZN7WebCore14FrameSelection15revealSelectionERKNS_15ScrollAlignmentEb
+__ZN7WebCore14FrameSelection15revealSelectionERKNS_15ScrollAlignmentENS_18RevealExtentOptionE
__ZN7WebCore14FrameSelection16setSelectedRangeEPNS_5RangeENS_9EAffinityEb
__ZN7WebCore14FrameSelection19absoluteCaretBoundsEv
__ZN7WebCore14FrameSelection20setSelectionFromNoneEv
Modified: trunk/Source/WebCore/editing/Editor.cpp (121124 => 121125)
--- trunk/Source/WebCore/editing/Editor.cpp 2012-06-25 00:14:23 UTC (rev 121124)
+++ trunk/Source/WebCore/editing/Editor.cpp 2012-06-25 00:29:03 UTC (rev 121125)
@@ -2301,7 +2301,7 @@
if (m_ignoreCompositionSelectionChange)
return;
- m_frame->selection()->revealSelection(alignment, revealExtentOption == RevealExtent);
+ m_frame->selection()->revealSelection(alignment, revealExtentOption);
}
void Editor::setIgnoreCompositionSelectionChange(bool ignore)
Modified: trunk/Source/WebCore/editing/Editor.h (121124 => 121125)
--- trunk/Source/WebCore/editing/Editor.h 2012-06-25 00:14:23 UTC (rev 121124)
+++ trunk/Source/WebCore/editing/Editor.h 2012-06-25 00:29:03 UTC (rev 121125)
@@ -423,11 +423,6 @@
void pasteAsPlainTextWithPasteboard(Pasteboard*);
void pasteWithPasteboard(Pasteboard*, bool allowPlainText);
- enum RevealExtentOption {
- RevealExtent,
- DoNotRevealExtent
- };
-
void revealSelectionAfterEditingOperation(const ScrollAlignment& = ScrollAlignment::alignCenterIfNeeded, RevealExtentOption = DoNotRevealExtent);
void markMisspellingsOrBadGrammar(const VisibleSelection&, bool checkSpelling, RefPtr<Range>& firstMisspellingRange);
TextCheckingTypeMask resolveTextCheckingTypeMask(TextCheckingTypeMask);
Modified: trunk/Source/WebCore/editing/FrameSelection.cpp (121124 => 121125)
--- trunk/Source/WebCore/editing/FrameSelection.cpp 2012-06-25 00:14:23 UTC (rev 121124)
+++ trunk/Source/WebCore/editing/FrameSelection.cpp 2012-06-25 00:29:03 UTC (rev 121125)
@@ -303,7 +303,7 @@
else
alignment = (align == AlignCursorOnScrollAlways) ? ScrollAlignment::alignTopAlways : ScrollAlignment::alignToEdgeIfNeeded;
- revealSelection(alignment, true);
+ revealSelection(alignment, RevealExtent);
}
notifyAccessibilityForSelectionChange();
@@ -1932,7 +1932,7 @@
return scanForForm(start);
}
-void FrameSelection::revealSelection(const ScrollAlignment& alignment, bool revealExtent)
+void FrameSelection::revealSelection(const ScrollAlignment& alignment, RevealExtentOption revealExtentOption)
{
LayoutRect rect;
@@ -1943,7 +1943,7 @@
rect = absoluteCaretBounds();
break;
case VisibleSelection::RangeSelection:
- rect = revealExtent ? VisiblePosition(extent()).absoluteCaretBounds() : enclosingIntRect(bounds(false));
+ rect = revealExtentOption == RevealExtent ? VisiblePosition(extent()).absoluteCaretBounds() : enclosingIntRect(bounds(false));
break;
}
Modified: trunk/Source/WebCore/editing/FrameSelection.h (121124 => 121125)
--- trunk/Source/WebCore/editing/FrameSelection.h 2012-06-25 00:14:23 UTC (rev 121124)
+++ trunk/Source/WebCore/editing/FrameSelection.h 2012-06-25 00:29:03 UTC (rev 121125)
@@ -49,6 +49,11 @@
enum EUserTriggered { NotUserTriggered = 0, UserTriggered = 1 };
+enum RevealExtentOption {
+ RevealExtent,
+ DoNotRevealExtent
+};
+
class CaretBase {
WTF_MAKE_NONCOPYABLE(CaretBase);
WTF_MAKE_FAST_ALLOCATED;
@@ -247,7 +252,7 @@
HTMLFormElement* currentForm() const;
- void revealSelection(const ScrollAlignment& = ScrollAlignment::alignCenterIfNeeded, bool revealExtent = false);
+ void revealSelection(const ScrollAlignment& = ScrollAlignment::alignCenterIfNeeded, RevealExtentOption = DoNotRevealExtent);
void setSelectionFromNone();
private: