Diff
Modified: trunk/Source/WebCore/ChangeLog (157145 => 157146)
--- trunk/Source/WebCore/ChangeLog 2013-10-08 23:25:49 UTC (rev 157145)
+++ trunk/Source/WebCore/ChangeLog 2013-10-08 23:49:16 UTC (rev 157146)
@@ -1,3 +1,20 @@
+2013-10-07 Sam Weinig <s...@webkit.org>
+
+ Consolidate findString functions
+ https://bugs.webkit.org/show_bug.cgi?id=122480
+
+ Reviewed by Darin Adler.
+
+ * editing/Editor.cpp:
+ * editing/Editor.h:
+ * editing/EditorCommand.cpp:
+ (WebCore::executeFindString):
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::find):
+ * page/Page.cpp:
+ * page/Page.h:
+ Fix a long standing FIXME.
+
2013-10-08 Bem Jones-Bey <bjone...@adobe.com>
Move m_floatingObjects to RenderBlockFlow from RenderBlock
Modified: trunk/Source/WebCore/editing/Editor.cpp (157145 => 157146)
--- trunk/Source/WebCore/editing/Editor.cpp 2013-10-08 23:25:49 UTC (rev 157145)
+++ trunk/Source/WebCore/editing/Editor.cpp 2013-10-08 23:49:16 UTC (rev 157146)
@@ -2825,13 +2825,6 @@
style->setPropertyInternal(CSSPropertyWebkitLineBreak, "after-white-space", false, IGNORE_EXCEPTION);
}
-// Searches from the beginning of the document if nothing is selected.
-bool Editor::findString(const String& target, bool forward, bool caseFlag, bool wrapFlag, bool startInSelection)
-{
- FindOptions options = (forward ? 0 : Backwards) | (caseFlag ? 0 : CaseInsensitive) | (wrapFlag ? WrapAround : 0) | (startInSelection ? StartInSelection : 0);
- return findString(target, options);
-}
-
bool Editor::findString(const String& target, FindOptions options)
{
VisibleSelection selection = m_frame.selection().selection();
Modified: trunk/Source/WebCore/editing/Editor.h (157145 => 157146)
--- trunk/Source/WebCore/editing/Editor.h 2013-10-08 23:25:49 UTC (rev 157145)
+++ trunk/Source/WebCore/editing/Editor.h 2013-10-08 23:49:16 UTC (rev 157146)
@@ -325,8 +325,6 @@
String selectedText() const;
String selectedTextForClipboard() const;
bool findString(const String&, FindOptions);
- // FIXME: Switch callers over to the FindOptions version and retire this one.
- bool findString(const String&, bool forward, bool caseFlag, bool wrapFlag, bool startInSelection);
PassRefPtr<Range> rangeOfString(const String&, Range*, FindOptions);
PassRefPtr<Range> findStringAndScrollToVisible(const String&, Range*, FindOptions);
Modified: trunk/Source/WebCore/editing/EditorCommand.cpp (157145 => 157146)
--- trunk/Source/WebCore/editing/EditorCommand.cpp 2013-10-08 23:25:49 UTC (rev 157145)
+++ trunk/Source/WebCore/editing/EditorCommand.cpp 2013-10-08 23:49:16 UTC (rev 157146)
@@ -412,7 +412,7 @@
static bool executeFindString(Frame& frame, Event*, EditorCommandSource, const String& value)
{
- return frame.editor().findString(value, true, false, true, false);
+ return frame.editor().findString(value, CaseInsensitive | WrapAround);
}
static bool executeFontName(Frame& frame, Event*, EditorCommandSource source, const String& value)
Modified: trunk/Source/WebCore/page/DOMWindow.cpp (157145 => 157146)
--- trunk/Source/WebCore/page/DOMWindow.cpp 2013-10-08 23:25:49 UTC (rev 157145)
+++ trunk/Source/WebCore/page/DOMWindow.cpp 2013-10-08 23:49:16 UTC (rev 157146)
@@ -1098,8 +1098,9 @@
if (!isCurrentlyDisplayedInFrame())
return false;
- // FIXME (13016): Support wholeWord, searchInFrames and showDialog
- return m_frame->editor().findString(string, !backwards, caseSensitive, wrap, false);
+ // FIXME (13016): Support wholeWord, searchInFrames and showDialog.
+ FindOptions options = (backwards ? Backwards : 0) | (caseSensitive ? 0 : CaseInsensitive) | (wrap ? WrapAround : 0);
+ return m_frame->editor().findString(string, options);
}
bool DOMWindow::offscreenBuffering() const
Modified: trunk/Source/WebCore/page/Page.cpp (157145 => 157146)
--- trunk/Source/WebCore/page/Page.cpp 2013-10-08 23:25:49 UTC (rev 157145)
+++ trunk/Source/WebCore/page/Page.cpp 2013-10-08 23:49:16 UTC (rev 157146)
@@ -547,11 +547,6 @@
: curr->tree().traversePreviousWithWrap(wrapFlag);
}
-bool Page::findString(const String& target, TextCaseSensitivity caseSensitivity, FindDirection direction, bool shouldWrap)
-{
- return findString(target, (caseSensitivity == TextCaseInsensitive ? CaseInsensitive : 0) | (direction == FindDirectionBackward ? Backwards : 0) | (shouldWrap ? WrapAround : 0));
-}
-
bool Page::findString(const String& target, FindOptions options)
{
if (target.isEmpty())
Modified: trunk/Source/WebCore/page/Page.h (157145 => 157146)
--- trunk/Source/WebCore/page/Page.h 2013-10-08 23:25:49 UTC (rev 157145)
+++ trunk/Source/WebCore/page/Page.h 2013-10-08 23:49:16 UTC (rev 157146)
@@ -236,8 +236,6 @@
bool tabKeyCyclesThroughElements() const { return m_tabKeyCyclesThroughElements; }
bool findString(const String&, FindOptions);
- // FIXME: Switch callers over to the FindOptions version and retire this one.
- bool findString(const String&, TextCaseSensitivity, FindDirection, bool shouldWrap);
PassRefPtr<Range> rangeOfString(const String&, Range*, FindOptions);
Modified: trunk/Source/WebKit/efl/ChangeLog (157145 => 157146)
--- trunk/Source/WebKit/efl/ChangeLog 2013-10-08 23:25:49 UTC (rev 157145)
+++ trunk/Source/WebKit/efl/ChangeLog 2013-10-08 23:49:16 UTC (rev 157146)
@@ -1,5 +1,17 @@
2013-10-07 Sam Weinig <s...@webkit.org>
+ Consolidate findString functions
+ https://bugs.webkit.org/show_bug.cgi?id=122480
+
+ Reviewed by Darin Adler.
+
+ * ewk/ewk_frame.cpp:
+ (ewk_frame_text_search):
+ * ewk/ewk_view.cpp:
+ (ewk_view_text_search):
+
+2013-10-07 Sam Weinig <s...@webkit.org>
+
CTTE: Use references in and around DragController
https://bugs.webkit.org/show_bug.cgi?id=122427
Modified: trunk/Source/WebKit/efl/ewk/ewk_frame.cpp (157145 => 157146)
--- trunk/Source/WebKit/efl/ewk/ewk_frame.cpp 2013-10-08 23:25:49 UTC (rev 157145)
+++ trunk/Source/WebKit/efl/ewk/ewk_frame.cpp 2013-10-08 23:49:16 UTC (rev 157146)
@@ -498,7 +498,8 @@
EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->frame, false);
EINA_SAFETY_ON_NULL_RETURN_VAL(text, false);
- return smartData->frame->editor().findString(WTF::String::fromUTF8(text), forward, caseSensitive, wrap, true);
+ WebCore::FindOptions options = (caseSensitive ? 0 : WebCore::CaseInsensitive) | (forward ? 0 : WebCore::Backwards) | (wrap ? WebCore::WrapAround : 0) | WebCore::StartInSelection;
+ return smartData->frame->editor().findString(WTF::String::fromUTF8(text), options);
}
unsigned int ewk_frame_text_matches_mark(Evas_Object* ewkFrame, const char* string, Eina_Bool caseSensitive, Eina_Bool highlight, unsigned int limit)
Modified: trunk/Source/WebKit/efl/ewk/ewk_view.cpp (157145 => 157146)
--- trunk/Source/WebKit/efl/ewk/ewk_view.cpp 2013-10-08 23:25:49 UTC (rev 157145)
+++ trunk/Source/WebKit/efl/ewk/ewk_view.cpp 2013-10-08 23:49:16 UTC (rev 157146)
@@ -1496,20 +1496,9 @@
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
EINA_SAFETY_ON_NULL_RETURN_VAL(string, false);
- WTF::TextCaseSensitivity sensitive;
- WebCore::FindDirection direction;
- if (caseSensitive)
- sensitive = WTF::TextCaseSensitive;
- else
- sensitive = WTF::TextCaseInsensitive;
-
- if (forward)
- direction = WebCore::FindDirectionForward;
- else
- direction = WebCore::FindDirectionBackward;
-
- return priv->page->findString(String::fromUTF8(string), sensitive, direction, wrap);
+ WebCore::FindOptions options = (caseSensitive ? 0 : WebCore::CaseInsensitive) | (forward ? 0 : WebCore::Backwards) | (wrap ? WebCore::WrapAround : 0);
+ return priv->page->findString(String::fromUTF8(string), options);
}
/**
Modified: trunk/Source/WebKit/gtk/ChangeLog (157145 => 157146)
--- trunk/Source/WebKit/gtk/ChangeLog 2013-10-08 23:25:49 UTC (rev 157145)
+++ trunk/Source/WebKit/gtk/ChangeLog 2013-10-08 23:49:16 UTC (rev 157146)
@@ -1,5 +1,15 @@
2013-10-07 Sam Weinig <s...@webkit.org>
+ Consolidate findString functions
+ https://bugs.webkit.org/show_bug.cgi?id=122480
+
+ Reviewed by Darin Adler.
+
+ * webkit/webkitwebview.cpp:
+ (webkit_web_view_search_text):
+
+2013-10-07 Sam Weinig <s...@webkit.org>
+
CTTE: Use references in and around DragController
https://bugs.webkit.org/show_bug.cgi?id=122427
Modified: trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp (157145 => 157146)
--- trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp 2013-10-08 23:25:49 UTC (rev 157145)
+++ trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp 2013-10-08 23:49:16 UTC (rev 157146)
@@ -4375,10 +4375,8 @@
g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), FALSE);
g_return_val_if_fail(string, FALSE);
- TextCaseSensitivity caseSensitivity = caseSensitive ? TextCaseSensitive : TextCaseInsensitive;
- FindDirection direction = forward ? FindDirectionForward : FindDirectionBackward;
-
- return core(webView)->findString(String::fromUTF8(string), caseSensitivity, direction, shouldWrap);
+ FindOptions options = (caseSensitive ? 0 : CaseInsensitive) | (forward ? 0 : Backwards) | (shouldWrap ? WrapAround : 0);
+ return core(webView)->findString(String::fromUTF8(string), options);
}
/**
Modified: trunk/Source/WebKit/win/ChangeLog (157145 => 157146)
--- trunk/Source/WebKit/win/ChangeLog 2013-10-08 23:25:49 UTC (rev 157145)
+++ trunk/Source/WebKit/win/ChangeLog 2013-10-08 23:49:16 UTC (rev 157146)
@@ -1,5 +1,15 @@
2013-10-07 Sam Weinig <s...@webkit.org>
+ Consolidate findString functions
+ https://bugs.webkit.org/show_bug.cgi?id=122480
+
+ Reviewed by Darin Adler.
+
+ * WebView.cpp:
+ (WebView::searchFor):
+
+2013-10-07 Sam Weinig <s...@webkit.org>
+
CTTE: Use references in and around DragController
https://bugs.webkit.org/show_bug.cgi?id=122427
Modified: trunk/Source/WebKit/win/WebView.cpp (157145 => 157146)
--- trunk/Source/WebKit/win/WebView.cpp 2013-10-08 23:25:49 UTC (rev 157145)
+++ trunk/Source/WebKit/win/WebView.cpp 2013-10-08 23:49:16 UTC (rev 157146)
@@ -3511,7 +3511,8 @@
if (!str || !SysStringLen(str))
return E_INVALIDARG;
- *found = m_page->findString(toString(str), caseFlag ? TextCaseSensitive : TextCaseInsensitive, forward ? FindDirectionForward : FindDirectionBackward, wrapFlag);
+ FindOptions options = (caseFlag ? 0 : CaseInsensitive) | (forward ? 0 : Backwards) | (wrapFlag ? WrapAround : 0);
+ *found = m_page->findString(toString(str), options);
return S_OK;
}