diff options
Diffstat (limited to 'WebKit/qt/Api')
-rw-r--r-- | WebKit/qt/Api/DerivedSources.pro | 2 | ||||
-rw-r--r-- | WebKit/qt/Api/qgraphicswebview.cpp | 34 | ||||
-rw-r--r-- | WebKit/qt/Api/qgraphicswebview.h | 4 | ||||
-rw-r--r-- | WebKit/qt/Api/qwebframe.cpp | 10 | ||||
-rw-r--r-- | WebKit/qt/Api/qwebframe_p.h | 3 | ||||
-rw-r--r-- | WebKit/qt/Api/qwebinspector.cpp | 25 | ||||
-rw-r--r-- | WebKit/qt/Api/qwebinspector_p.h | 4 | ||||
-rw-r--r-- | WebKit/qt/Api/qwebkitplatformplugin.h | 13 | ||||
-rw-r--r-- | WebKit/qt/Api/qwebpage.cpp | 144 | ||||
-rw-r--r-- | WebKit/qt/Api/qwebpage.h | 18 | ||||
-rw-r--r-- | WebKit/qt/Api/qwebpage_p.h | 15 | ||||
-rw-r--r-- | WebKit/qt/Api/qwebsettings.cpp | 6 | ||||
-rw-r--r-- | WebKit/qt/Api/qwebsettings.h | 3 | ||||
-rw-r--r-- | WebKit/qt/Api/qwebview.cpp | 12 |
14 files changed, 162 insertions, 131 deletions
diff --git a/WebKit/qt/Api/DerivedSources.pro b/WebKit/qt/Api/DerivedSources.pro index 6fb52f2..d8bd1db 100644 --- a/WebKit/qt/Api/DerivedSources.pro +++ b/WebKit/qt/Api/DerivedSources.pro @@ -10,7 +10,7 @@ DESTDIR = ../../../include/QtWebKit QUOTE = "" DOUBLE_ESCAPED_QUOTE = "" ESCAPE = "" -win32-msvc* | (contains(QMAKE_HOST.os, "Windows"):isEmpty(QMAKE_SH)) { +win32-msvc* | wince* | contains(QMAKE_HOST.os, "Windows"):isEmpty(QMAKE_SH) { # MinGW's make will run makefile commands using sh, even if make # was run from the Windows shell, if it finds sh in the path. ESCAPE = "^" diff --git a/WebKit/qt/Api/qgraphicswebview.cpp b/WebKit/qt/Api/qgraphicswebview.cpp index 7f66d98..36d4326 100644 --- a/WebKit/qt/Api/qgraphicswebview.cpp +++ b/WebKit/qt/Api/qgraphicswebview.cpp @@ -75,7 +75,6 @@ public: QGraphicsWebView* q; QWebPage* page; bool resizesToContents; - QSize deviceSize; // Just a convenience to avoid using page->client->overlay always QSharedPointer<QGraphicsItemOverlay> overlay; @@ -131,13 +130,8 @@ void QGraphicsWebViewPrivate::updateResizesToContentsForPage() if (!page->preferredContentsSize().isValid()) page->setPreferredContentsSize(QSize(960, 800)); -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) QObject::connect(page->mainFrame(), SIGNAL(contentsSizeChanged(QSize)), q, SLOT(_q_contentsSizeChanged(const QSize&)), Qt::UniqueConnection); -#else - QObject::connect(page->mainFrame(), SIGNAL(contentsSizeChanged(QSize)), - q, SLOT(_q_contentsSizeChanged(const QSize&))); -#endif } else { QObject::disconnect(page->mainFrame(), SIGNAL(contentsSizeChanged(QSize)), q, SLOT(_q_contentsSizeChanged(const QSize&))); @@ -243,14 +237,10 @@ QGraphicsWebView::QGraphicsWebView(QGraphicsItem* parent) : QGraphicsWidget(parent) , d(new QGraphicsWebViewPrivate(this)) { -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) setFlag(QGraphicsItem::ItemUsesExtendedStyleOption, true); -#endif setAcceptDrops(true); setAcceptHoverEvents(true); -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) setAcceptTouchEvents(true); -#endif setFocusPolicy(Qt::StrongFocus); setFlag(QGraphicsItem::ItemClipsChildrenToShape, true); #if ENABLE(TILED_BACKING_STORE) @@ -316,7 +306,6 @@ bool QGraphicsWebView::sceneEvent(QEvent* event) { // Re-implemented in order to allows fixing event-related bugs in patch releases. -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) if (d->page && (event->type() == QEvent::TouchBegin || event->type() == QEvent::TouchEnd || event->type() == QEvent::TouchUpdate)) { @@ -325,7 +314,6 @@ bool QGraphicsWebView::sceneEvent(QEvent* event) // Always return true so that we'll receive also TouchUpdate and TouchEnd events return true; } -#endif return QGraphicsWidget::sceneEvent(event); } @@ -419,11 +407,7 @@ void QGraphicsWebViewPrivate::detachCurrentPage() if (!page) return; -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) page->d->view.clear(); -#else - page->d->view = 0; -#endif // The client has always to be deleted. delete page->d->client; @@ -555,24 +539,6 @@ QIcon QGraphicsWebView::icon() const } /*! - \property QGraphicsWebView::deviceSize - \brief the size of the device using the web view - - The device size is used by the DOM window object methods - otherHeight(), otherWidth() as well as a page for the viewport - meta tag attributes device-width and device-height. -*/ -void QGraphicsWebView::setDeviceSize(const QSize& size) -{ - d->deviceSize = size; -} - -QSize QGraphicsWebView::deviceSize() const -{ - return d->deviceSize; -} - -/*! \property QGraphicsWebView::zoomFactor \brief the zoom factor for the view */ diff --git a/WebKit/qt/Api/qgraphicswebview.h b/WebKit/qt/Api/qgraphicswebview.h index 77f0359..8620ac5 100644 --- a/WebKit/qt/Api/qgraphicswebview.h +++ b/WebKit/qt/Api/qgraphicswebview.h @@ -41,7 +41,6 @@ class QWEBKIT_EXPORT QGraphicsWebView : public QGraphicsWidget { Q_PROPERTY(QString title READ title NOTIFY titleChanged) Q_PROPERTY(QIcon icon READ icon NOTIFY iconChanged) Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor) - Q_PROPERTY(QSize deviceSize READ deviceSize WRITE setDeviceSize) Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged) @@ -65,9 +64,6 @@ public: qreal zoomFactor() const; void setZoomFactor(qreal); - QSize deviceSize() const; - void setDeviceSize(const QSize&); - bool isModified() const; void load(const QUrl& url); diff --git a/WebKit/qt/Api/qwebframe.cpp b/WebKit/qt/Api/qwebframe.cpp index 46580bb..1791096 100644 --- a/WebKit/qt/Api/qwebframe.cpp +++ b/WebKit/qt/Api/qwebframe.cpp @@ -230,6 +230,14 @@ void QWebFramePrivate::init(QWebFrame *qframe, QWebFrameData *frameData) frame->init(); } +WebCore::ViewportArguments QWebFramePrivate::viewportArguments() +{ + if (!frame || !frame->document()) + return WebCore::ViewportArguments(); + + return frame->document()->viewportArguments(); +} + void QWebFramePrivate::setPage(QWebPage* newPage) { if (page == newPage) @@ -781,11 +789,9 @@ void QWebFrame::load(const QNetworkRequest &req, case QNetworkAccessManager::PostOperation: request.setHTTPMethod("POST"); break; -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) case QNetworkAccessManager::DeleteOperation: request.setHTTPMethod("DELETE"); break; -#endif case QNetworkAccessManager::UnknownOperation: // eh? break; diff --git a/WebKit/qt/Api/qwebframe_p.h b/WebKit/qt/Api/qwebframe_p.h index 6d6eca1..5ba3f52 100644 --- a/WebKit/qt/Api/qwebframe_p.h +++ b/WebKit/qt/Api/qwebframe_p.h @@ -90,6 +90,8 @@ public: void renderFromTiledBackingStore(WebCore::GraphicsContext*, const QRegion& clip); #endif + WebCore::ViewportArguments viewportArguments(); + QWebFrame *q; Qt::ScrollBarPolicy horizontalScrollBarPolicy; Qt::ScrollBarPolicy verticalScrollBarPolicy; @@ -101,7 +103,6 @@ public: int marginWidth; int marginHeight; bool zoomTextOnly; - WebCore::ViewportArguments viewportArguments; }; class QWebHitTestResultPrivate { diff --git a/WebKit/qt/Api/qwebinspector.cpp b/WebKit/qt/Api/qwebinspector.cpp index 802ea98..27148f7 100644 --- a/WebKit/qt/Api/qwebinspector.cpp +++ b/WebKit/qt/Api/qwebinspector.cpp @@ -196,6 +196,31 @@ void QWebInspectorPrivate::setFrontend(QWidget* newFrontend) } } +/*! + * \internal + */ +void QWebInspectorPrivate::attachAndReplaceRemoteFrontend(QObject* newRemoteFrontend) +{ + if (remoteFrontend) + remoteFrontend->setParent(0); + + remoteFrontend = newRemoteFrontend; + + if (remoteFrontend) + remoteFrontend->setParent(q); +} + +/*! + * \internal + */ +void QWebInspectorPrivate::detachRemoteFrontend() +{ + if (remoteFrontend) { + remoteFrontend->deleteLater(); + remoteFrontend = 0; + } +} + void QWebInspectorPrivate::adjustFrontendSize(const QSize& size) { if (frontend) diff --git a/WebKit/qt/Api/qwebinspector_p.h b/WebKit/qt/Api/qwebinspector_p.h index 4d327cc..3099eb1 100644 --- a/WebKit/qt/Api/qwebinspector_p.h +++ b/WebKit/qt/Api/qwebinspector_p.h @@ -33,14 +33,18 @@ public: : q(qq) , page(0) , frontend(0) + , remoteFrontend(0) {} void setFrontend(QWidget* newFrontend); + void attachAndReplaceRemoteFrontend(QObject* newRemoteFrontend); + void detachRemoteFrontend(); void adjustFrontendSize(const QSize& size); QWebInspector* q; QWebPage* page; QWidget* frontend; + QObject* remoteFrontend; }; #endif diff --git a/WebKit/qt/Api/qwebkitplatformplugin.h b/WebKit/qt/Api/qwebkitplatformplugin.h index 76496c5..a851d56 100644 --- a/WebKit/qt/Api/qwebkitplatformplugin.h +++ b/WebKit/qt/Api/qwebkitplatformplugin.h @@ -84,9 +84,13 @@ Q_SIGNALS: void notificationClicked(); }; -class QWebHapticFeedbackPlayer +class QWebHapticFeedbackPlayer: public QObject { + Q_OBJECT public: + QWebHapticFeedbackPlayer() {} + virtual ~QWebHapticFeedbackPlayer() {} + enum HapticStrength { None, Weak, Medium, Strong }; @@ -110,12 +114,9 @@ public: }; virtual bool supportsExtension(Extension extension) const = 0; - virtual QWebSelectMethod* createSelectInputMethod() const = 0; - virtual QWebNotificationPresenter* createNotificationPresenter() const = 0; - virtual QWebHapticFeedbackPlayer* createHapticFeedbackPlayer() const = 0; - + virtual QObject* createExtension(Extension extension) const = 0; }; -Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.4"); +Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.5"); #endif // QWEBKITPLATFORMPLUGIN_H diff --git a/WebKit/qt/Api/qwebpage.cpp b/WebKit/qt/Api/qwebpage.cpp index 181b3a6..932103d 100644 --- a/WebKit/qt/Api/qwebpage.cpp +++ b/WebKit/qt/Api/qwebpage.cpp @@ -21,6 +21,7 @@ #include "config.h" #include "qwebpage.h" + #include "qwebview.h" #include "qwebframe.h" #include "qwebpage_p.h" @@ -77,6 +78,7 @@ #include "HTMLInputElement.h" #include "HTMLNames.h" #include "HitTestResult.h" +#include "InspectorServerQt.h" #include "WindowFeatures.h" #include "WebPlatformStrategies.h" #include "LocalizedStrings.h" @@ -86,6 +88,7 @@ #include "GeolocationPermissionClientQt.h" #include "NotificationPresenterClientQt.h" #include "PageClientQt.h" +#include "PlatformTouchEvent.h" #include "WorkerThread.h" #include "wtf/Threading.h" @@ -93,6 +96,7 @@ #include <QBasicTimer> #include <QBitArray> #include <QDebug> +#include <QDesktopWidget> #include <QDragEnterEvent> #include <QDragLeaveEvent> #include <QDragMoveEvent> @@ -112,16 +116,13 @@ #include <QSysInfo> #include <QTextCharFormat> #include <QTextDocument> +#include <QTouchEvent> #include <QNetworkAccessManager> #include <QNetworkRequest> #if defined(Q_WS_X11) #include <QX11Info> #endif -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) -#include <QTouchEvent> -#include "PlatformTouchEvent.h" -#endif using namespace WebCore; @@ -254,12 +255,29 @@ static inline Qt::DropAction dragOpToDropAction(unsigned actions) QWebPagePrivate::QWebPagePrivate(QWebPage *qq) : q(qq) + , page(0) , client(0) -#if QT_VERSION < QT_VERSION_CHECK(4, 6, 0) - , view(0) + , mainFrame(0) +#ifndef QT_NO_UNDOSTACK + , undoStack(0) #endif + , insideOpenCall(false) + , m_totalBytes(0) + , m_bytesReceived() , clickCausedFocus(false) + , networkManager(0) + , forwardUnsupportedContent(false) + , smartInsertDeleteEnabled(true) + , selectTrailingWhitespaceEnabled(false) + , linkPolicy(QWebPage::DontDelegateLinks) , viewportSize(QSize(0, 0)) +#ifndef QT_NO_CONTEXTMENU + , currentContextMenu(0) +#endif + , settings(0) + , editable(false) + , useFixedLayout(false) + , pluginFactory(0) , inspectorFrontend(0) , inspector(0) , inspectorIsInternalOnly(false) @@ -272,7 +290,7 @@ QWebPagePrivate::QWebPagePrivate(QWebPage *qq) WebCore::Font::setCodePath(WebCore::Font::Complex); #endif - WebPlatformStrategies::initialize(qq); + WebPlatformStrategies::initialize(); Page::PageClients pageClients; pageClients.chromeClient = new ChromeClientQt(q); @@ -284,23 +302,6 @@ QWebPagePrivate::QWebPagePrivate(QWebPage *qq) settings = new QWebSettings(page->settings()); -#ifndef QT_NO_UNDOSTACK - undoStack = 0; -#endif - mainFrame = 0; - networkManager = 0; - pluginFactory = 0; - insideOpenCall = false; - forwardUnsupportedContent = false; - editable = false; - useFixedLayout = false; - linkPolicy = QWebPage::DontDelegateLinks; -#ifndef QT_NO_CONTEXTMENU - currentContextMenu = 0; -#endif - smartInsertDeleteEnabled = true; - selectTrailingWhitespaceEnabled = false; - history.d = new QWebHistoryPrivate(page->backForwardList()); memset(actions, 0, sizeof(actions)); @@ -793,7 +794,6 @@ void QWebPagePrivate::mouseReleaseEvent(QGraphicsSceneMouseEvent* ev) void QWebPagePrivate::handleSoftwareInputPanel(Qt::MouseButton button) { -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) Frame* frame = page->focusController()->focusedFrame(); if (!frame) return; @@ -810,7 +810,6 @@ void QWebPagePrivate::handleSoftwareInputPanel(Qt::MouseButton button) } clickCausedFocus = false; -#endif } void QWebPagePrivate::mouseReleaseEvent(QMouseEvent *ev) @@ -1136,9 +1135,7 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev) { WebCore::Frame *frame = page->focusController()->focusedOrMainFrame(); WebCore::Editor *editor = frame->editor(); -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) QInputMethodEvent::Attribute selection(QInputMethodEvent::Selection, 0, 0, QVariant()); -#endif if (!editor->canEdit()) { ev->ignore(); @@ -1177,13 +1174,11 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev) } break; } -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) case QInputMethodEvent::Selection: { selection = a; hasSelection = true; break; } -#endif } } @@ -1195,7 +1190,6 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev) // 3. populated preedit with a selection attribute, and start/end of 0 or non-0 updates selection of supplied preedit text // 4. otherwise event is updating supplied pre-edit text QString preedit = ev->preeditString(); -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) if (hasSelection) { QString text = (renderTextControl) ? QString(renderTextControl->text()) : QString(); if (preedit.isEmpty() && selection.start + selection.length > 0) @@ -1203,10 +1197,8 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev) editor->setComposition(preedit, underlines, (selection.length < 0) ? selection.start + selection.length : selection.start, (selection.length < 0) ? selection.start : selection.start + selection.length); - } else -#endif - if (!preedit.isEmpty()) - editor->setComposition(preedit, underlines, preedit.length(), 0); + } else if (!preedit.isEmpty()) + editor->setComposition(preedit, underlines, preedit.length(), 0); } ev->accept(); @@ -1302,6 +1294,10 @@ void QWebPagePrivate::dynamicPropertyChangeEvent(QDynamicPropertyChangeEvent* ev frame->tiledBackingStore()->setKeepAndCoverAreaMultipliers(keepMultiplier, coverMultiplier); } #endif + else if (event->propertyName() == "_q_webInspectorServerPort") { + InspectorServerQt* inspectorServer = InspectorServerQt::server(); + inspectorServer->listen(inspectorServerPort()); + } } #endif @@ -1391,7 +1387,6 @@ bool QWebPagePrivate::handleScrolling(QKeyEvent *ev, Frame *frame) return frame->eventHandler()->scrollRecursively(direction, granularity); } -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) bool QWebPagePrivate::touchEvent(QTouchEvent* event) { WebCore::Frame* frame = QWebFramePrivate::core(mainFrame); @@ -1404,7 +1399,6 @@ bool QWebPagePrivate::touchEvent(QTouchEvent* event) // Return whether the default action was cancelled in the JS event handler return frame->eventHandler()->handleTouchEvent(PlatformTouchEvent(event)); } -#endif /*! This method is used by the input method to query a set of properties of the page @@ -1479,7 +1473,6 @@ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const return QVariant(); } -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) case Qt::ImAnchorPosition: { if (renderTextControl) { if (editor->hasComposition()) { @@ -1502,7 +1495,6 @@ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const } return QVariant(0); } -#endif default: return QVariant(); } @@ -1559,6 +1551,14 @@ InspectorController* QWebPagePrivate::inspectorController() #endif } +quint16 QWebPagePrivate::inspectorServerPort() +{ +#if ENABLE(INSPECTOR) && !defined(QT_NO_PROPERTIES) + if (q && q->property("_q_webInspectorServerPort").isValid()) + return q->property("_q_webInspectorServerPort").toInt(); +#endif + return 0; +} /*! \enum QWebPage::FindFlag @@ -1987,11 +1987,7 @@ void QWebPage::setView(QWidget* view) */ QWidget *QWebPage::view() const { -#if QT_VERSION < QT_VERSION_CHECK(4, 6, 0) - return d->view; -#else return d->view.data(); -#endif } /*! @@ -2325,19 +2321,67 @@ void QWebPage::setViewportSize(const QSize &size) const } } -QWebPage::ViewportConfiguration QWebPage::viewportConfigurationForSize(QSize availableSize) const +static int getintenv(const char* variable) +{ + bool ok; + int value = qgetenv(variable).toInt(&ok); + return (ok) ? value : -1; +} + +static QSize queryDeviceSizeForScreenContainingWidget(const QWidget* widget) +{ + QDesktopWidget* desktop = QApplication::desktop(); + if (!desktop) + return QSize(); + + QSize size; + + if (widget) { + // Returns the available geometry of the screen which contains widget. + // NOTE: this must be the the full screen size including any fixed status areas etc. + size = desktop->availableGeometry(widget).size(); + } else + size = desktop->availableGeometry().size(); + + // This must be in portrait mode, adjust if not. + if (size.width() > size.height()) { + int width = size.width(); + size.setWidth(size.height()); + size.setHeight(width); + } + + return size; +} + +/*! + Computes the optimal viewport configuration given the \a availableSize, when + user interface components are disregarded. + + The configuration is also dependent on the device screen size which is obtained + automatically. For testing purposes the size can be overridden by setting two + environment variables QTWEBKIT_DEVICE_WIDTH and QTWEBKIT_DEVICE_HEIGHT, which + both needs to be set. +*/ + +QWebPage::ViewportConfiguration QWebPage::viewportConfigurationForSize(const QSize& availableSize) const { static int desktopWidth = 980; static int deviceDPI = 160; - FloatRect rect = d->page->chrome()->windowRect(); + ViewportConfiguration result; - int deviceWidth = rect.width(); - int deviceHeight = rect.height(); + int deviceWidth = getintenv("QTWEBKIT_DEVICE_WIDTH"); + int deviceHeight = getintenv("QTWEBKIT_DEVICE_HEIGHT"); - WebCore::ViewportConfiguration conf = WebCore::findConfigurationForViewportData(mainFrame()->d->viewportArguments, desktopWidth, deviceWidth, deviceHeight, deviceDPI, availableSize); + // Both environment variables need to be set - or they will be ignored. + if (deviceWidth < 0 && deviceHeight < 0) { + QSize size = queryDeviceSizeForScreenContainingWidget((d->client) ? d->client->ownerWidget() : 0); + deviceWidth = size.width(); + deviceHeight = size.height(); + } - ViewportConfiguration result; + WebCore::ViewportConfiguration conf = WebCore::findConfigurationForViewportData(mainFrame()->d->viewportArguments(), + desktopWidth, deviceWidth, deviceHeight, deviceDPI, availableSize); result.m_isValid = true; result.m_size = conf.layoutViewport; @@ -2854,13 +2898,11 @@ bool QWebPage::event(QEvent *ev) case QEvent::Leave: d->leaveEvent(ev); break; -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) case QEvent::TouchBegin: case QEvent::TouchUpdate: case QEvent::TouchEnd: // Return whether the default action was cancelled in the JS event handler return d->touchEvent(static_cast<QTouchEvent*>(ev)); -#endif #ifndef QT_NO_PROPERTIES case QEvent::DynamicPropertyChange: d->dynamicPropertyChangeEvent(static_cast<QDynamicPropertyChangeEvent*>(ev)); diff --git a/WebKit/qt/Api/qwebpage.h b/WebKit/qt/Api/qwebpage.h index b1441ff..e71e3da 100644 --- a/WebKit/qt/Api/qwebpage.h +++ b/WebKit/qt/Api/qwebpage.h @@ -55,6 +55,7 @@ namespace WebCore { class EditorClientQt; class FrameLoaderClientQt; class InspectorClientQt; + class InspectorServerRequestHandlerQt; class InspectorFrontendClientQt; class NotificationPresenterClientQt; class GeolocationPermissionClientQt; @@ -216,13 +217,13 @@ public: QWebPage::ViewportConfiguration& operator=(const QWebPage::ViewportConfiguration& other); - inline qreal initialScaleFactor() const { return m_initialScaleFactor; }; - inline qreal minimumScaleFactor() const { return m_minimumScaleFactor; }; - inline qreal maximumScaleFactor() const { return m_maximumScaleFactor; }; - inline qreal devicePixelRatio() const { return m_devicePixelRatio; }; - inline bool isUserScalable() const { return m_isUserScalable; }; - inline bool isValid() const { return m_isValid; }; - inline QSize size() const { return m_size; }; + inline qreal initialScaleFactor() const { return m_initialScaleFactor; } + inline qreal minimumScaleFactor() const { return m_minimumScaleFactor; } + inline qreal maximumScaleFactor() const { return m_maximumScaleFactor; } + inline qreal devicePixelRatio() const { return m_devicePixelRatio; } + inline bool isUserScalable() const { return m_isUserScalable; } + inline bool isValid() const { return m_isValid; } + inline QSize size() const { return m_size; } private: QSharedDataPointer<QtViewportConfigurationPrivate> d; @@ -275,7 +276,7 @@ public: QSize viewportSize() const; void setViewportSize(const QSize &size) const; - ViewportConfiguration viewportConfigurationForSize(QSize availableSize) const; + ViewportConfiguration viewportConfigurationForSize(const QSize& availableSize) const; QSize preferredContentsSize() const; void setPreferredContentsSize(const QSize &size) const; @@ -425,6 +426,7 @@ private: friend class WebCore::EditorClientQt; friend class WebCore::FrameLoaderClientQt; friend class WebCore::InspectorClientQt; + friend class WebCore::InspectorServerRequestHandlerQt; friend class WebCore::InspectorFrontendClientQt; friend class WebCore::NotificationPresenterClientQt; friend class WebCore::GeolocationPermissionClientQt; diff --git a/WebKit/qt/Api/qwebpage_p.h b/WebKit/qt/Api/qwebpage_p.h index 82f5365..12716f9 100644 --- a/WebKit/qt/Api/qwebpage_p.h +++ b/WebKit/qt/Api/qwebpage_p.h @@ -131,38 +131,29 @@ public: void handleSoftwareInputPanel(Qt::MouseButton); bool handleScrolling(QKeyEvent*, WebCore::Frame*); -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) // Returns whether the default action was cancelled in the JS event handler bool touchEvent(QTouchEvent*); -#endif void setInspector(QWebInspector*); QWebInspector* getOrCreateInspector(); WebCore::InspectorController* inspectorController(); + quint16 inspectorServerPort(); #ifndef QT_NO_SHORTCUT static QWebPage::WebAction editorActionForKeyEvent(QKeyEvent* event); #endif static const char* editorCommandForWebActions(QWebPage::WebAction action); - WebCore::ChromeClientQt *chromeClient; - WebCore::ContextMenuClientQt *contextMenuClient; - WebCore::EditorClientQt *editorClient; + QWebPage *q; WebCore::Page *page; - + QWebPageClient* client; QPointer<QWebFrame> mainFrame; - QWebPage *q; - QWebPageClient* client; #ifndef QT_NO_UNDOSTACK QUndoStack *undoStack; #endif -#if QT_VERSION >= 0x040600 QWeakPointer<QWidget> view; -#else - QWidget* view; -#endif bool insideOpenCall; quint64 m_totalBytes; diff --git a/WebKit/qt/Api/qwebsettings.cpp b/WebKit/qt/Api/qwebsettings.cpp index b71de25..6b36522 100644 --- a/WebKit/qt/Api/qwebsettings.cpp +++ b/WebKit/qt/Api/qwebsettings.cpp @@ -174,6 +174,11 @@ void QWebSettingsPrivate::apply() settings->setWebGLEnabled(value); #endif + + value = attributes.value(QWebSettings::HyperlinkAuditingEnabled, + global->attributes.value(QWebSettings::HyperlinkAuditingEnabled)); + + settings->setHyperlinkAuditingEnabled(value); value = attributes.value(QWebSettings::JavascriptCanOpenWindows, global->attributes.value(QWebSettings::JavascriptCanOpenWindows)); @@ -495,6 +500,7 @@ QWebSettings::QWebSettings() d->attributes.insert(QWebSettings::LocalContentCanAccessFileUrls, true); d->attributes.insert(QWebSettings::AcceleratedCompositingEnabled, true); d->attributes.insert(QWebSettings::WebGLEnabled, false); + d->attributes.insert(QWebSettings::HyperlinkAuditingEnabled, false); d->attributes.insert(QWebSettings::TiledBackingStoreEnabled, false); d->attributes.insert(QWebSettings::FrameFlatteningEnabled, false); d->attributes.insert(QWebSettings::SiteSpecificQuirksEnabled, true); diff --git a/WebKit/qt/Api/qwebsettings.h b/WebKit/qt/Api/qwebsettings.h index 8967e7c..d5e0ef6 100644 --- a/WebKit/qt/Api/qwebsettings.h +++ b/WebKit/qt/Api/qwebsettings.h @@ -75,7 +75,8 @@ public: TiledBackingStoreEnabled, FrameFlatteningEnabled, SiteSpecificQuirksEnabled, - WebGLEnabled + WebGLEnabled, + HyperlinkAuditingEnabled }; enum WebGraphic { MissingImageGraphic, diff --git a/WebKit/qt/Api/qwebview.cpp b/WebKit/qt/Api/qwebview.cpp index 1f400cb..64b7a90 100644 --- a/WebKit/qt/Api/qwebview.cpp +++ b/WebKit/qt/Api/qwebview.cpp @@ -307,9 +307,7 @@ QWebView::QWebView(QWidget *parent) setAttribute(Qt::WA_InputMethodEnabled); #endif -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) setAttribute(Qt::WA_AcceptTouchEvents); -#endif #if defined(Q_WS_MAEMO_5) QAbstractKineticScroller* scroller = new QWebViewKineticScroller(); static_cast<QWebViewKineticScroller*>(scroller)->setWidget(this); @@ -348,13 +346,7 @@ void QWebViewPrivate::detachCurrentPage() if (!page) return; - if (page) { -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) - page->d->view.clear(); -#else - page->d->view = 0; -#endif - } + page->d->view.clear(); // if the page client is the special client constructed for // delegating the responsibilities to a QWidget, we need @@ -828,7 +820,6 @@ bool QWebView::event(QEvent *e) if (cursor().shape() == Qt::ArrowCursor) d->page->d->client->resetCursor(); #endif -#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) } else if (e->type() == QEvent::TouchBegin || e->type() == QEvent::TouchEnd || e->type() == QEvent::TouchUpdate) { @@ -836,7 +827,6 @@ bool QWebView::event(QEvent *e) // Always return true so that we'll receive also TouchUpdate and TouchEnd events return true; -#endif } else if (e->type() == QEvent::Leave) d->page->event(e); } |