diff options
Diffstat (limited to 'WebKit/qt/WebCoreSupport')
-rw-r--r-- | WebKit/qt/WebCoreSupport/ChromeClientQt.cpp | 12 | ||||
-rw-r--r-- | WebKit/qt/WebCoreSupport/ChromeClientQt.h | 7 | ||||
-rw-r--r-- | WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp | 27 | ||||
-rw-r--r-- | WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h | 2 | ||||
-rw-r--r-- | WebKit/qt/WebCoreSupport/EditorClientQt.cpp | 31 | ||||
-rw-r--r-- | WebKit/qt/WebCoreSupport/PageClientQt.cpp | 32 | ||||
-rw-r--r-- | WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp | 6 | ||||
-rw-r--r-- | WebKit/qt/WebCoreSupport/QtPlatformPlugin.h | 2 |
8 files changed, 106 insertions, 13 deletions
diff --git a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp index f0d3903..3fec1d3 100644 --- a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp +++ b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp @@ -165,10 +165,13 @@ void ChromeClientQt::takeFocus(FocusDirection) } -void ChromeClientQt::focusedNodeChanged(WebCore::Node*) +void ChromeClientQt::focusedNodeChanged(Node*) { } +void ChromeClientQt::focusedFrameChanged(Frame*) +{ +} Page* ChromeClientQt::createWindow(Frame*, const FrameLoadRequest& request, const WindowFeatures& features, const NavigationAction&) { @@ -412,6 +415,13 @@ void ChromeClientQt::scroll(const IntSize& delta, const IntRect& scrollViewRect, emit m_webPage->scrollRequested(delta.width(), delta.height(), scrollViewRect); } +#if ENABLE(TILED_BACKING_STORE) +void ChromeClientQt::delegatedScrollRequested(const IntSize& delta) +{ + emit m_webPage->scrollRequested(delta.width(), delta.height(), QRect(QPoint(0, 0), m_webPage->viewportSize())); +} +#endif + IntRect ChromeClientQt::windowToScreen(const IntRect& rect) const { QWebPageClient* pageClient = platformPageClient(); diff --git a/WebKit/qt/WebCoreSupport/ChromeClientQt.h b/WebKit/qt/WebCoreSupport/ChromeClientQt.h index bbd2452..b8bc72d 100644 --- a/WebKit/qt/WebCoreSupport/ChromeClientQt.h +++ b/WebKit/qt/WebCoreSupport/ChromeClientQt.h @@ -72,6 +72,7 @@ namespace WebCore { virtual void takeFocus(FocusDirection); virtual void focusedNodeChanged(Node*); + virtual void focusedFrameChanged(Frame*); virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&, const NavigationAction&); virtual void show(); @@ -115,6 +116,9 @@ namespace WebCore { virtual void invalidateContentsAndWindow(const IntRect&, bool); virtual void invalidateContentsForSlowScroll(const IntRect&, bool); virtual void scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect); +#if ENABLE(TILED_BACKING_STORE) + virtual void delegatedScrollRequested(const IntSize& scrollDelta); +#endif virtual IntPoint screenToWindow(const IntPoint&) const; virtual IntRect windowToScreen(const IntRect&) const; @@ -134,6 +138,9 @@ namespace WebCore { virtual void reachedMaxAppCacheSize(int64_t spaceNeeded); virtual void reachedApplicationCacheOriginQuota(SecurityOrigin*); #endif +#if ENABLE(CONTEXT_MENUS) + virtual void showContextMenu() { } +#endif #if ENABLE(NOTIFICATIONS) virtual NotificationPresenter* notificationPresenter() const; diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp index 4309e5c..f5fa06b 100644 --- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp +++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp @@ -47,6 +47,7 @@ #include "HistoryItem.h" #include "HTMLInputElement.h" #include "InspectorController.h" +#include "NodeList.h" #include "NotificationPresenterClientQt.h" #include "Page.h" #include "PageGroup.h" @@ -278,7 +279,7 @@ void DumpRenderTreeSupportQt::suspendAnimations(QWebFrame *frame) if (!controller) return; - controller->suspendAnimations(coreFrame->document()); + controller->suspendAnimations(); } void DumpRenderTreeSupportQt::resumeAnimations(QWebFrame *frame) @@ -291,7 +292,7 @@ void DumpRenderTreeSupportQt::resumeAnimations(QWebFrame *frame) if (!controller) return; - controller->resumeAnimations(coreFrame->document()); + controller->resumeAnimations(); } void DumpRenderTreeSupportQt::clearFrameName(QWebFrame* frame) @@ -544,6 +545,8 @@ void DumpRenderTreeSupportQt::setEditingBehavior(QWebPage* page, const QString& coreEditingBehavior = EditingWindowsBehavior; else if (editingBehavior == "mac") coreEditingBehavior = EditingMacBehavior; + else if (editingBehavior == "unix") + coreEditingBehavior = EditingUnixBehavior; else { ASSERT_NOT_REACHED(); return; @@ -778,6 +781,26 @@ QString DumpRenderTreeSupportQt::plainText(const QVariant& range) return map.value("innerText").toString(); } +QVariantList DumpRenderTreeSupportQt::nodesFromRect(const QWebElement& document, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping) +{ + QVariantList res; + WebCore::Element* webElement = document.m_element; + if (!webElement) + return res; + + Document* doc = webElement->document(); + if (!doc) + return res; + RefPtr<NodeList> nodes = doc->nodesFromRect(x, y, top, right, bottom, left, ignoreClipping); + for (int i = 0; i < nodes->length(); i++) { + QVariant v; + // QWebElement will be null if the Node is not an HTML Element + v.setValue(QWebElement(nodes->item(i))); + res << v; + } + return res; +} + // Provide a backward compatibility with previously exported private symbols as of QtWebKit 4.6 release void QWEBKIT_EXPORT qt_resumeActiveDOMObjects(QWebFrame* frame) diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h index 356b226..82d9319 100644 --- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h +++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h @@ -133,6 +133,8 @@ public: static void addUserStyleSheet(QWebPage* page, const QString& sourceCode); static void simulateDesktopNotificationClick(const QString& title); static QString viewportAsText(QWebPage*, const QSize&); + + static QVariantList nodesFromRect(const QWebElement& document, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping); }; #endif diff --git a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp index 2dd3b37..91a0cc6 100644 --- a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp +++ b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp @@ -46,6 +46,7 @@ #include "PlatformKeyboardEvent.h" #include "QWebPageClient.h" #include "Range.h" +#include "Settings.h" #include "WindowsKeyboardCodes.h" #include "qwebpage.h" #include "qwebpage_p.h" @@ -360,9 +361,21 @@ void EditorClientQt::handleKeyboardEvent(KeyboardEvent* event) // FIXME: refactor all of this to use Actions or something like them if (start->isContentEditable()) { + bool doSpatialNavigation = false; + if (isSpatialNavigationEnabled(frame)) { + if (!kevent->modifiers()) { + switch (kevent->windowsVirtualKeyCode()) { + case VK_LEFT: + case VK_RIGHT: + case VK_UP: + case VK_DOWN: + doSpatialNavigation = true; + } + } + } #ifndef QT_NO_SHORTCUT QWebPage::WebAction action = QWebPagePrivate::editorActionForKeyEvent(kevent->qtEvent()); - if (action != QWebPage::NoWebAction) { + if (action != QWebPage::NoWebAction && !doSpatialNavigation) { const char* cmd = QWebPagePrivate::editorCommandForWebActions(action); // WebKit doesn't have enough information about mode to decide how commands that just insert text if executed via Editor should be treated, // so we leave it upon WebCore to either handle them immediately (e.g. Tab that changes focus) or let a keypress event be generated @@ -386,26 +399,26 @@ void EditorClientQt::handleKeyboardEvent(KeyboardEvent* event) case VK_LEFT: if (kevent->shiftKey()) frame->editor()->command("MoveLeftAndModifySelection").execute(); - else - frame->editor()->command("MoveLeft").execute(); + else if (!frame->editor()->command("MoveLeft").execute()) + return; break; case VK_RIGHT: if (kevent->shiftKey()) frame->editor()->command("MoveRightAndModifySelection").execute(); - else - frame->editor()->command("MoveRight").execute(); + else if (!frame->editor()->command("MoveRight").execute()) + return; break; case VK_UP: if (kevent->shiftKey()) frame->editor()->command("MoveUpAndModifySelection").execute(); - else - frame->editor()->command("MoveUp").execute(); + else if (!frame->editor()->command("MoveUp").execute()) + return; break; case VK_DOWN: if (kevent->shiftKey()) frame->editor()->command("MoveDownAndModifySelection").execute(); - else - frame->editor()->command("MoveDown").execute(); + else if (!frame->editor()->command("MoveDown").execute()) + return; break; case VK_PRIOR: // PageUp if (kevent->shiftKey()) diff --git a/WebKit/qt/WebCoreSupport/PageClientQt.cpp b/WebKit/qt/WebCoreSupport/PageClientQt.cpp index 4d42c39..9fa5bf7 100644 --- a/WebKit/qt/WebCoreSupport/PageClientQt.cpp +++ b/WebKit/qt/WebCoreSupport/PageClientQt.cpp @@ -21,15 +21,19 @@ #include "config.h" #include "PageClientQt.h" +#include "TextureMapperQt.h" #include "texmap/TextureMapperPlatformLayer.h" - +#include <QGraphicsScene> +#include <QGraphicsView> #if defined(Q_WS_X11) #include <QX11Info> #endif #ifdef QT_OPENGL_LIB +#include "opengl/TextureMapperGL.h" #include <QGLWidget> #endif + namespace WebCore { #if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) @@ -45,6 +49,11 @@ public: m_frame->d->rootGraphicsLayer = m_layer; } + void setTextureMapper(PassOwnPtr<TextureMapper> textureMapper) + { + m_frame->d->textureMapper = textureMapper; + } + virtual ~PlatformLayerProxyQt() { if (m_layer) @@ -53,6 +62,11 @@ public: m_frame->d->rootGraphicsLayer = 0; } + virtual TextureMapper* textureMapper() + { + return m_frame->d->textureMapper.get(); + } + // Since we just paint the composited tree and never create a special item for it, we don't have to handle its size changes. void setSizeChanged(const IntSize&) { } @@ -69,6 +83,11 @@ public: { if (m_widget) m_widget->installEventFilter(this); + + if (textureMapper()) + return; + + setTextureMapper(TextureMapperQt::create()); } // We don't want a huge region-clip on the compositing layers; instead we unite the rectangles together @@ -103,6 +122,17 @@ public: : PlatformLayerProxyQt(frame, layer, object) , m_graphicsItem(object) { + if (textureMapper()) + return; + +#ifdef QT_OPENGL_LIB + QGraphicsView* view = object->scene()->views()[0]; + if (view && view->viewport() && view->viewport()->inherits("QGLWidget")) { + setTextureMapper(TextureMapperGL::create()); + return; + } +#endif + setTextureMapper(TextureMapperQt::create()); } void setNeedsDisplay() diff --git a/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp b/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp index 9786967..ede8a73 100644 --- a/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp +++ b/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp @@ -107,4 +107,10 @@ QWebHapticFeedbackPlayer* QtPlatformPlugin::createHapticFeedbackPlayer() return p ? static_cast<QWebHapticFeedbackPlayer*>(p->createExtension(QWebKitPlatformPlugin::Haptics)) : 0; } +QWebTouchModifier* QtPlatformPlugin::createTouchModifier() +{ + QWebKitPlatformPlugin* p = plugin(); + return p ? static_cast<QWebTouchModifier*>(p->createExtension(QWebKitPlatformPlugin::TouchInteraction)) : 0; +} + } diff --git a/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h b/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h index a3e50c2..ef14a1f 100644 --- a/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h +++ b/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h @@ -28,6 +28,7 @@ class QWebKitPlatformPlugin; class QWebNotificationPresenter; class QWebHapticFeedbackPlayer; class QWebSelectData; +class QWebTouchModifier; namespace WebCore { @@ -39,6 +40,7 @@ public: QWebSelectMethod* createSelectInputMethod(); QWebNotificationPresenter* createNotificationPresenter(); QWebHapticFeedbackPlayer* createHapticFeedbackPlayer(); + QWebTouchModifier* createTouchModifier(); QWebKitPlatformPlugin* plugin(); |