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.cpp137
1 files changed, 137 insertions, 0 deletions
diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
index 935be85..6e59a20 100644
--- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
+++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
@@ -23,16 +23,21 @@
#include "config.h"
#include "DumpRenderTreeSupportQt.h"
+#include "CSSComputedStyleDeclaration.h"
#include "ContextMenu.h"
#include "ContextMenuClientQt.h"
#include "ContextMenuController.h"
#include "Editor.h"
+#include "EditorClientQt.h"
#include "Element.h"
#include "FocusController.h"
#include "Frame.h"
+#include "FrameLoaderClientQt.h"
#include "FrameView.h"
#include "GCController.h"
+#include "HTMLInputElement.h"
#include "InspectorController.h"
+#include "NotificationPresenterClientQt.h"
#include "Page.h"
#include "PageGroup.h"
#include "PluginDatabase.h"
@@ -47,6 +52,7 @@
#include "TextIterator.h"
#include "WorkerThread.h"
+#include "qwebelement.h"
#include "qwebframe.h"
#include "qwebframe_p.h"
#include "qwebpage.h"
@@ -377,6 +383,23 @@ QString DumpRenderTreeSupportQt::markerTextForListItem(const QWebElement& listIt
return WebCore::markerTextForListItem(listItem.m_element);
}
+QVariantMap DumpRenderTreeSupportQt::computedStyleIncludingVisitedInfo(const QWebElement& element)
+{
+ QVariantMap res;
+
+ WebCore::Element* webElement = element.m_element;
+ if (!webElement)
+ return res;
+
+ RefPtr<WebCore::CSSComputedStyleDeclaration> style = computedStyle(webElement, true);
+ for (int i = 0; i < style->length(); i++) {
+ QString name = style->item(i);
+ QString value = (static_cast<WebCore::CSSStyleDeclaration*>(style.get()))->getPropertyValue(name);
+ res[name] = QVariant(value);
+ }
+ return res;
+}
+
QVariantList DumpRenderTreeSupportQt::selectedRange(QWebPage* page)
{
WebCore::Frame* frame = page->handle()->page->focusController()->focusedOrMainFrame();
@@ -421,6 +444,74 @@ QVariantList DumpRenderTreeSupportQt::firstRectForCharacterRange(QWebPage* page,
return rect;
}
+bool DumpRenderTreeSupportQt::elementDoesAutoCompleteForElementWithId(QWebFrame* frame, const QString& elementId)
+{
+ Frame* coreFrame = QWebFramePrivate::core(frame);
+ if (!coreFrame)
+ return false;
+
+ Document* doc = coreFrame->document();
+ Q_ASSERT(doc);
+
+ Node* coreNode = doc->getElementById(elementId);
+ if (!coreNode || !coreNode->renderer())
+ return false;
+
+ HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(coreNode);
+ if (!inputElement)
+ return false;
+
+ return (inputElement->isTextField()
+ && inputElement->inputType() != HTMLInputElement::PASSWORD
+ && inputElement->autoComplete());
+}
+
+void DumpRenderTreeSupportQt::dumpFrameLoader(bool b)
+{
+ FrameLoaderClientQt::dumpFrameLoaderCallbacks = b;
+}
+
+void DumpRenderTreeSupportQt::dumpResourceLoadCallbacks(bool b)
+{
+ FrameLoaderClientQt::dumpResourceLoadCallbacks = b;
+}
+
+void DumpRenderTreeSupportQt::dumpResourceLoadCallbacksPath(const QString& path)
+{
+ FrameLoaderClientQt::dumpResourceLoadCallbacksPath = path;
+}
+
+void DumpRenderTreeSupportQt::setWillSendRequestReturnsNullOnRedirect(bool b)
+{
+ FrameLoaderClientQt::sendRequestReturnsNullOnRedirect = b;
+}
+
+void DumpRenderTreeSupportQt::setWillSendRequestReturnsNull(bool b)
+{
+ FrameLoaderClientQt::sendRequestReturnsNull = b;
+}
+
+void DumpRenderTreeSupportQt::setWillSendRequestClearHeaders(const QStringList& headers)
+{
+ FrameLoaderClientQt::sendRequestClearHeaders = headers;
+}
+
+void DumpRenderTreeSupportQt::dumpEditingCallbacks(bool b)
+{
+ EditorClientQt::dumpEditingCallbacks = b;
+}
+
+void DumpRenderTreeSupportQt::dumpSetAcceptsEditing(bool b)
+{
+ EditorClientQt::acceptsEditing = b;
+}
+
+void DumpRenderTreeSupportQt::dumpNotification(bool b)
+{
+#if ENABLE(NOTIFICATIONS)
+ NotificationPresenterClientQt::dumpNotification = b;
+#endif
+}
// Provide a backward compatibility with previously exported private symbols as of QtWebKit 4.6 release
void QWEBKIT_EXPORT qt_resumeActiveDOMObjects(QWebFrame* frame)
@@ -502,3 +593,49 @@ void QWEBKIT_EXPORT qt_webpage_setGroupName(QWebPage* page, const QString& group
{
DumpRenderTreeSupportQt::webPageSetGroupName(page, groupName);
}
+
+void QWEBKIT_EXPORT qt_dump_frame_loader(bool b)
+{
+ DumpRenderTreeSupportQt::dumpFrameLoader(b);
+}
+
+void QWEBKIT_EXPORT qt_dump_resource_load_callbacks(bool b)
+{
+ DumpRenderTreeSupportQt::dumpResourceLoadCallbacks(b);
+}
+
+void QWEBKIT_EXPORT qt_dump_resource_load_callbacks_path(const QString& path)
+{
+ DumpRenderTreeSupportQt::dumpResourceLoadCallbacksPath(path);
+}
+
+void QWEBKIT_EXPORT qt_set_will_send_request_returns_null_on_redirect(bool b)
+{
+ DumpRenderTreeSupportQt::setWillSendRequestReturnsNullOnRedirect(b);
+
+}
+
+void QWEBKIT_EXPORT qt_set_will_send_request_returns_null(bool b)
+{
+ DumpRenderTreeSupportQt::setWillSendRequestReturnsNull(b);
+}
+
+void QWEBKIT_EXPORT qt_set_will_send_request_clear_headers(const QStringList& headers)
+{
+ DumpRenderTreeSupportQt::setWillSendRequestClearHeaders(headers);
+}
+
+void QWEBKIT_EXPORT qt_dump_editing_callbacks(bool b)
+{
+ DumpRenderTreeSupportQt::dumpEditingCallbacks(b);
+}
+
+void QWEBKIT_EXPORT qt_dump_set_accepts_editing(bool b)
+{
+ DumpRenderTreeSupportQt::dumpSetAcceptsEditing(b);
+}
+
+void QWEBKIT_EXPORT qt_dump_notification(bool b)
+{
+ DumpRenderTreeSupportQt::dumpNotification(b);
+}