summaryrefslogtreecommitdiffstats
path: root/WebCore/page/Page.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/page/Page.cpp')
-rw-r--r--WebCore/page/Page.cpp25
1 files changed, 21 insertions, 4 deletions
diff --git a/WebCore/page/Page.cpp b/WebCore/page/Page.cpp
index 5453e1e..6d583b4 100644
--- a/WebCore/page/Page.cpp
+++ b/WebCore/page/Page.cpp
@@ -525,25 +525,31 @@ static Frame* incrementFrame(Frame* curr, bool forward, bool 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() || !mainFrame())
return false;
+ bool shouldWrap = options & WrapAround;
Frame* frame = focusController()->focusedOrMainFrame();
Frame* startFrame = frame;
do {
- if (frame->editor()->findString(target, direction == FindDirectionForward, caseSensitivity == TextCaseSensitive, false, true)) {
+ if (frame->editor()->findString(target, (options & ~WrapAround) | StartInSelection)) {
if (frame != startFrame)
startFrame->selection()->clear();
focusController()->setFocusedFrame(frame);
return true;
}
- frame = incrementFrame(frame, direction == FindDirectionForward, shouldWrap);
+ frame = incrementFrame(frame, !(options & Backwards), shouldWrap);
} while (frame && frame != startFrame);
// Search contents of startFrame, on the other side of the selection that we did earlier.
// We cheat a bit and just research with wrap on
if (shouldWrap && !startFrame->selection()->isNone()) {
- bool found = startFrame->editor()->findString(target, direction == FindDirectionForward, caseSensitivity == TextCaseSensitive, true, true);
+ bool found = startFrame->editor()->findString(target, options | WrapAround | StartInSelection);
focusController()->setFocusedFrame(frame);
return found;
}
@@ -553,6 +559,11 @@ bool Page::findString(const String& target, TextCaseSensitivity caseSensitivity,
unsigned int Page::markAllMatchesForText(const String& target, TextCaseSensitivity caseSensitivity, bool shouldHighlight, unsigned limit)
{
+ return markAllMatchesForText(target, caseSensitivity == TextCaseInsensitive ? CaseInsensitive : 0, shouldHighlight, limit);
+}
+
+unsigned int Page::markAllMatchesForText(const String& target, FindOptions options, bool shouldHighlight, unsigned limit)
+{
if (target.isEmpty() || !mainFrame())
return 0;
@@ -561,7 +572,7 @@ unsigned int Page::markAllMatchesForText(const String& target, TextCaseSensitivi
Frame* frame = mainFrame();
do {
frame->editor()->setMarkedTextMatchesAreHighlighted(shouldHighlight);
- matches += frame->editor()->countMatchesForText(target, caseSensitivity == TextCaseSensitive, limit ? (limit - matches) : 0, true);
+ matches += frame->editor()->countMatchesForText(target, options, limit ? (limit - matches) : 0, true);
frame = incrementFrame(frame, true, false);
} while (frame);
@@ -872,6 +883,12 @@ SpeechInput* Page::speechInput()
}
#endif
+void Page::dnsPrefetchingStateChanged()
+{
+ for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext())
+ frame->document()->initDNSPrefetch();
+}
+
void Page::privateBrowsingStateChanged()
{
bool privateBrowsingEnabled = m_settings->privateBrowsingEnabled();