summaryrefslogtreecommitdiffstats
path: root/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp')
-rw-r--r--WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
index f5fa06b..a2863b1 100644
--- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
+++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
@@ -175,7 +175,7 @@ bool DumpRenderTreeSupportQt::hasDocumentElement(QWebFrame* frame)
void DumpRenderTreeSupportQt::setJavaScriptProfilingEnabled(QWebFrame* frame, bool enabled)
{
-#if ENABLE(JAVASCRIPT_DEBUGGER)
+#if ENABLE(JAVASCRIPT_DEBUGGER) && ENABLE(INSPECTOR)
Frame* coreFrame = QWebFramePrivate::core(frame);
InspectorController* controller = coreFrame->page()->inspectorController();
if (!controller)
@@ -437,6 +437,32 @@ bool DumpRenderTreeSupportQt::isCommandEnabled(QWebPage* page, const QString& na
return page->handle()->page->focusController()->focusedOrMainFrame()->editor()->command(name).isEnabled();
}
+bool DumpRenderTreeSupportQt::findString(QWebPage* page, const QString& string, const QStringList& optionArray)
+{
+ // 1. Parse the options from the array
+ WebCore::FindOptions options = 0;
+ const int optionCount = optionArray.size();
+ for (int i = 0; i < optionCount; ++i) {
+ const QString& option = optionArray.at(i);
+ if (option == QLatin1String("CaseInsensitive"))
+ options |= WebCore::CaseInsensitive;
+ else if (option == QLatin1String("AtWordStarts"))
+ options |= WebCore::AtWordStarts;
+ else if (option == QLatin1String("TreatMedialCapitalAsWordStart"))
+ options |= WebCore::TreatMedialCapitalAsWordStart;
+ else if (option == QLatin1String("Backwards"))
+ options |= WebCore::Backwards;
+ else if (option == QLatin1String("WrapAround"))
+ options |= WebCore::WrapAround;
+ else if (option == QLatin1String("StartInSelection"))
+ options |= WebCore::StartInSelection;
+ }
+
+ // 2. find the string
+ WebCore::Frame* frame = page->handle()->page->focusController()->focusedOrMainFrame();
+ return frame && frame->editor()->findString(string, options);
+}
+
QString DumpRenderTreeSupportQt::markerTextForListItem(const QWebElement& listItem)
{
return WebCore::markerTextForListItem(listItem.m_element);