diff options
Diffstat (limited to 'src/3rdparty/webkit/WebKit/qt/Api')
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp | 16 | ||||
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp | 28 | ||||
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h | 4 | ||||
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h | 2 | ||||
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp | 139 | ||||
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.h | 24 | ||||
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/Api/qwebhistory_p.h | 27 | ||||
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp | 112 | ||||
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h | 13 | ||||
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h | 3 | ||||
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp | 9 | ||||
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h | 2 | ||||
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp | 15 |
13 files changed, 298 insertions, 96 deletions
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp index adc55ae..413a662 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp @@ -1046,10 +1046,10 @@ QString QWebElement::computedStyleProperty(const QString &name) const */ QStringList QWebElement::classes() const { - if (!hasAttribute("class")) + if (!hasAttribute(QLatin1String("class"))) return QStringList(); - QStringList classes = attribute("class").simplified().split(' ', QString::SkipEmptyParts); + QStringList classes = attribute(QLatin1String("class")).simplified().split(QLatin1Char(' '), QString::SkipEmptyParts); #if QT_VERSION >= 0x040500 classes.removeDuplicates(); #else @@ -1089,8 +1089,8 @@ void QWebElement::addClass(const QString &name) QStringList list = classes(); if (!list.contains(name)) { list.append(name); - QString value = list.join(" "); - setAttribute("class", value); + QString value = list.join(QLatin1String(" ")); + setAttribute(QLatin1String("class"), value); } } @@ -1102,8 +1102,8 @@ void QWebElement::removeClass(const QString &name) QStringList list = classes(); if (list.contains(name)) { list.removeAll(name); - QString value = list.join(" "); - setAttribute("class", value); + QString value = list.join(QLatin1String(" ")); + setAttribute(QLatin1String("class"), value); } } @@ -1119,8 +1119,8 @@ void QWebElement::toggleClass(const QString &name) else list.append(name); - QString value = list.join(" "); - setAttribute("class", value); + QString value = list.join(QLatin1String(" ")); + setAttribute(QLatin1String("class"), value); } /*! diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp index cedd8ae..381251d 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp @@ -1017,6 +1017,10 @@ QWebHitTestResult QWebFrame::hitTestContent(const QPoint &pos) const return QWebHitTestResult(); HitTestResult result = d->frame->eventHandler()->hitTestResultAtPoint(d->frame->view()->windowToContents(pos), /*allowShadowContent*/ false, /*ignoreClipping*/ true); + + if (result.scrollbar()) + return QWebHitTestResult(); + return QWebHitTestResult(new QWebHitTestResultPrivate(result)); } @@ -1268,9 +1272,7 @@ QWebHitTestResultPrivate::QWebHitTestResultPrivate(const WebCore::HitTestResult WebCore::Frame *wframe = hitTest.targetFrame(); if (wframe) linkTargetFrame = QWebFramePrivate::kit(wframe); - Element* urlElement = hitTest.URLElement(); - if (urlElement) - linkTarget = urlElement->target(); + linkElement = QWebElement(hitTest.URLElement()); isContentEditable = hitTest.isContentEditable(); isContentSelected = hitTest.isSelected(); @@ -1413,21 +1415,21 @@ QUrl QWebHitTestResult::linkTitle() const /*! \since 4.6 - Returns the name of the target frame that will load the link if it is activated. + Returns the element that represents the link. \sa linkTargetFrame() */ -QString QWebHitTestResult::linkTarget() const +QWebElement QWebHitTestResult::linkElement() const { if (!d) - return 0; - return d->linkTarget; + return QWebElement(); + return d->linkElement; } /*! Returns the frame that will load the link if it is activated. - \sa linkTarget() + \sa linkElement() */ QWebFrame *QWebHitTestResult::linkTargetFrame() const { @@ -1509,13 +1511,3 @@ QWebFrame *QWebHitTestResult::frame() const return d->frame; } -/*! - \since 4.6 - Returns true if the test includes a scrollbar. -*/ -bool QWebHitTestResult::isScrollBar() const -{ - if (!d) - return false; - return d->isScrollBar; -} diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h index ebc22fe..3ed453e 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.h @@ -79,7 +79,7 @@ public: QUrl linkUrl() const; QUrl linkTitle() const; QWebFrame *linkTargetFrame() const; - QString linkTarget() const; + QWebElement linkElement() const; QString alternateText() const; // for img, area, input and applet @@ -93,8 +93,6 @@ public: QWebFrame *frame() const; - bool isScrollBar() const; - private: QWebHitTestResult(QWebHitTestResultPrivate *priv); QWebHitTestResultPrivate *d; diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h index 325e6e0..0c7da90 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h @@ -107,7 +107,7 @@ public: QUrl linkUrl; QString linkTitle; QPointer<QWebFrame> linkTargetFrame; - QString linkTarget; + QWebElement linkElement; QString alternateText; QUrl imageUrl; QPixmap pixmap; diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp index 07d027d..7cdc00e 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp @@ -28,6 +28,7 @@ #include "PageGroup.h" #include <QSharedData> +#include <QDebug> /*! \class QWebHistoryItem @@ -213,6 +214,8 @@ bool QWebHistoryItem::isValid() const number of items is given by count(), and the history can be cleared with the clear() function. + QWebHistory's state can be saved with saveState() and loaded with restoreState(). + \sa QWebHistoryItem, QWebHistoryInterface, QWebPage */ @@ -405,9 +408,13 @@ int QWebHistory::currentItemIndex() const */ QWebHistoryItem QWebHistory::itemAt(int i) const { - WebCore::HistoryItem *item = d->lst->itemAtIndex(i); - - QWebHistoryItemPrivate *priv = new QWebHistoryItemPrivate(item); + QWebHistoryItemPrivate *priv; + if (i < 0 || i >= count()) + priv = new QWebHistoryItemPrivate(0); + else { + WebCore::HistoryItem *item = d->lst->entries()[i].get(); + priv = new QWebHistoryItemPrivate(item); + } return QWebHistoryItem(priv); } @@ -441,3 +448,129 @@ void QWebHistory::setMaximumItemCount(int count) d->lst->setCapacity(count); } +/*! + \enum QWebHistory::HistoryStateVersion + + This enum describes the versions available for QWebHistory's saveState() function: + + \value HistoryVersion_1 Version 1 (Qt 4.6) + \value DefaultHistoryVersion The current default version in 1. +*/ + +/*! + \since 4.6 + + Restores the state of QWebHistory from the given \a buffer. Returns true + if the history was successfully restored; otherwise returns false. + + \sa saveState() +*/ +bool QWebHistory::restoreState(const QByteArray& buffer) +{ + QDataStream stream(buffer); + int version; + bool result = false; + stream >> version; + + switch (version) { + case HistoryVersion_1: { + int count; + int currentIndex; + stream >> count >> currentIndex; + + clear(); + // only if there are elements + if (count) { + // after clear() is new clear HistoryItem (at the end we had to remove it) + WebCore::HistoryItem *nullItem = d->lst->currentItem(); + for (int i = 0;i < count;i++) { + WTF::PassRefPtr<WebCore::HistoryItem> item = WebCore::HistoryItem::create(); + item->restoreState(stream, version); + d->lst->addItem(item); + } + d->lst->removeItem(nullItem); + goToItem(itemAt(currentIndex)); + result = stream.status() == QDataStream::Ok; + } + break; + } + default: {} // result is false; + } + + return result; +}; + +/*! + \since 4.6 + Saves the state of this QWebHistory into a QByteArray. + + Saves the current state of this QWebHistory. The version number, \a version, is + stored as part of the data. + + To restore the saved state, pass the return value to restoreState(). + + \sa restoreState() +*/ +QByteArray QWebHistory::saveState(HistoryStateVersion version) const +{ + QByteArray buffer; + QDataStream stream(&buffer, QIODevice::WriteOnly); + stream << version; + + switch (version) { + case HistoryVersion_1: { + stream << count() << currentItemIndex(); + + const WebCore::HistoryItemVector &items = d->lst->entries(); + for (int i = 0; i < items.size(); i++) + items[i].get()->saveState(stream, version); + + if (stream.status() != QDataStream::Ok) + buffer = QByteArray(); // make buffer isNull()==true and isEmpty()==true + break; + } + default: + buffer.clear(); + + } + + return buffer; +} + +/*! + \since 4.6 + \fn QDataStream& operator<<(QDataStream& stream, const QWebHistory& history) + \relates QWebHistory + + Saves the given \a history into the specified \a stream. This is a convenience function + and is equivalent to calling the saveState() method. + + \sa QWebHistory::saveState() +*/ + +QDataStream& operator<<(QDataStream& stream, const QWebHistory& history) +{ + return stream << history.saveState(); +} + +/*! + \fn QDataStream& operator>>(QDataStream& stream, QWebHistory& history) + \relates QWebHistory + \since 4.6 + + Loads a QWebHistory from the specified \a stream into the given \a history. + This is a convenience function and it is equivalent to calling the restoreState() + method. + + \sa QWebHistory::restoreState() +*/ + +QDataStream& operator>>(QDataStream& stream, QWebHistory& history) +{ + QByteArray buffer; + stream >> buffer; + history.restoreState(buffer); + return stream; +} + + diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.h index c39077d..1a048f4 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.h +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.h @@ -42,6 +42,9 @@ public: QWebHistoryItem &operator=(const QWebHistoryItem &other); ~QWebHistoryItem(); + //bool restoreState(QByteArray& buffer); + //QByteArray saveState(QWebHistory::HistoryStateVersion version = DefaultHistoryVersion) const; + QUrl originalUrl() const; QUrl url() const; @@ -60,13 +63,29 @@ private: friend class QWebHistory; friend class QWebPage; friend class WebCore::FrameLoaderClientQt; + friend class QWebHistoryItemPrivate; + //friend QDataStream & operator<<(QDataStream& out,const QWebHistoryItem& hist); + //friend QDataStream & operator>>(QDataStream& in,QWebHistoryItem& hist); QExplicitlySharedDataPointer<QWebHistoryItemPrivate> d; }; +//QWEBKIT_EXPORT QDataStream & operator<<(QDataStream& out,const QWebHistoryItem& hist); +//QWEBKIT_EXPORT QDataStream & operator>>(QDataStream& in,QWebHistoryItem& hist); + + class QWebHistoryPrivate; class QWEBKIT_EXPORT QWebHistory { public: + enum HistoryStateVersion { + HistoryVersion_1, + /*, HistoryVersion_2, */ + DefaultHistoryVersion = HistoryVersion_1 + }; + + bool restoreState(const QByteArray& buffer); + QByteArray saveState(HistoryStateVersion version = DefaultHistoryVersion) const; + void clear(); QList<QWebHistoryItem> items() const; @@ -98,10 +117,15 @@ private: friend class QWebPage; friend class QWebPagePrivate; + friend QWEBKIT_EXPORT QDataStream& operator>>(QDataStream&, QWebHistory&); + friend QWEBKIT_EXPORT QDataStream& operator<<(QDataStream&, const QWebHistory&); Q_DISABLE_COPY(QWebHistory) QWebHistoryPrivate *d; }; +QWEBKIT_EXPORT QDataStream& operator<<(QDataStream& stream, const QWebHistory& history); +QWEBKIT_EXPORT QDataStream& operator>>(QDataStream& stream, QWebHistory& history); + #endif diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory_p.h index 32e69fe..4bee62b 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory_p.h +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory_p.h @@ -22,10 +22,16 @@ #include "BackForwardList.h" #include "HistoryItem.h" +#include <QtCore/qglobal.h> +#include <QtCore/qshareddata.h> -class QWebHistoryItemPrivate : public QSharedData +class Q_AUTOTEST_EXPORT QWebHistoryItemPrivate : public QSharedData { public: + static QExplicitlySharedDataPointer<QWebHistoryItemPrivate> get(QWebHistoryItem *q) + { + return q->d; + } QWebHistoryItemPrivate(WebCore::HistoryItem *i) { if (i) @@ -37,6 +43,25 @@ public: if (item) item->deref(); } + + /* QByteArray saveStateWithoutVersionControl(QWebHistory::HistoryStateVersion version) + { + QByteArray buffer; + switch(version){ + case QWebHistory::HistoryVersion1: + buffer=item->saveState(version); + break; + default:{} + } + return buffer; + } + + bool restoreStateWithoutVersionControl(QWebHistory::HistoryStateVersion version,QDataStream& stream) + { + + } +*/ + WebCore::HistoryItem *item; }; diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp index 2decbca..5899a1b 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp @@ -43,6 +43,7 @@ #include "DragController.h" #include "DragData.h" #include "EditorClientQt.h" +#include "SecurityOrigin.h" #include "Settings.h" #include "Page.h" #include "Pasteboard.h" @@ -795,13 +796,26 @@ void QWebPagePrivate::keyPressEvent(QKeyEvent *ev) defaultFont = view->font(); QFontMetrics fm(defaultFont); int fontHeight = fm.height(); - if (!handleScrolling(ev)) { + if (!handleScrolling(ev, frame)) { switch (ev->key()) { + case Qt::Key_Back: + q->triggerAction(QWebPage::Back); + break; + case Qt::Key_Forward: + q->triggerAction(QWebPage::Forward); + break; + case Qt::Key_Stop: + q->triggerAction(QWebPage::Stop); + break; + case Qt::Key_Refresh: + q->triggerAction(QWebPage::Reload); + break; case Qt::Key_Backspace: if (ev->modifiers() == Qt::ShiftModifier) q->triggerAction(QWebPage::Forward); else q->triggerAction(QWebPage::Back); + break; default: handled = false; break; @@ -985,7 +999,7 @@ void QWebPagePrivate::shortcutOverrideEvent(QKeyEvent* event) } } -bool QWebPagePrivate::handleScrolling(QKeyEvent *ev) +bool QWebPagePrivate::handleScrolling(QKeyEvent *ev, Frame *frame) { ScrollDirection direction; ScrollGranularity granularity; @@ -1032,10 +1046,7 @@ bool QWebPagePrivate::handleScrolling(QKeyEvent *ev) } } - if (!mainFrame->d->frame->eventHandler()->scrollOverflow(direction, granularity)) - mainFrame->d->frame->view()->scroll(direction, granularity); - - return true; + return frame->eventHandler()->scrollRecursively(direction, granularity); } /*! @@ -1101,6 +1112,7 @@ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const changes the behaviour to a case sensitive find operation. \value FindWrapsAroundDocument Makes findText() restart from the beginning of the document if the end was reached and the text was not found. + \value HighlightAllOccurrences Highlights all existing occurrences of a specific string. */ /*! @@ -1598,16 +1610,21 @@ void QWebPage::setViewportSize(const QSize &size) const } } -QSize QWebPage::fixedLayoutSize() const +QSize QWebPage::fixedContentsSize() const { - if (d->mainFrame && d->mainFrame->d->frame->view()) - return d->mainFrame->d->frame->view()->fixedLayoutSize(); + QWebFrame* frame = d->mainFrame; + if (frame) { + WebCore::FrameView* view = frame->d->frame->view(); + if (view && view->useFixedLayout()) { + return d->mainFrame->d->frame->view()->fixedLayoutSize(); + } + } return d->fixedLayoutSize; } /*! - \property QWebPage::fixedLayoutSize + \property QWebPage::fixedContentsSize \since 4.6 \brief the size of the fixed layout @@ -1615,37 +1632,22 @@ QSize QWebPage::fixedLayoutSize() const 1024x768 for example then webkit will layout the page as if the viewport were that size rather than something different. */ -void QWebPage::setFixedLayoutSize(const QSize &size) const +void QWebPage::setFixedContentsSize(const QSize &size) const { d->fixedLayoutSize = size; QWebFrame *frame = mainFrame(); if (frame->d->frame && frame->d->frame->view()) { WebCore::FrameView* view = frame->d->frame->view(); - view->setFixedLayoutSize(size); - view->forceLayout(); - } -} - -bool QWebPage::useFixedLayout() const -{ - return d->useFixedLayout; -} -/*! - \property QWebPage::useFixedLayout - \since 4.6 - \brief whether to use a fixed layout size -*/ -void QWebPage::setUseFixedLayout(bool useFixedLayout) -{ - d->useFixedLayout = useFixedLayout; - - QWebFrame *frame = mainFrame(); - if (frame->d->frame && frame->d->frame->view()) { - WebCore::FrameView* view = frame->d->frame->view(); - view->setUseFixedLayout(useFixedLayout); - view->forceLayout(); + if (size.isValid()) { + view->setUseFixedLayout(true); + view->setFixedLayoutSize(size); + view->forceLayout(); + } else if (view->useFixedLayout()) { + view->setUseFixedLayout(false); + view->forceLayout(); + } } } @@ -1675,7 +1677,7 @@ bool QWebPage::acceptNavigationRequest(QWebFrame *frame, const QWebNetworkReques return true; case DelegateExternalLinks: - if (WebCore::FrameLoader::shouldTreatURLSchemeAsLocal(request.url().scheme())) + if (WebCore::SecurityOrigin::shouldTreatURLSchemeAsLocal(request.url().scheme())) return true; emit linkClicked(request.url()); return false; @@ -2193,7 +2195,7 @@ bool QWebPage::swallowContextMenuEvent(QContextMenuEvent *event) if (QWebFrame* webFrame = d->frameAt(event->pos())) { Frame* frame = QWebFramePrivate::core(webFrame); - if (Scrollbar* scrollbar = frame->view()->scrollbarUnderMouse(PlatformMouseEvent(event, 1))) { + if (Scrollbar* scrollbar = frame->view()->scrollbarUnderPoint(PlatformMouseEvent(event, 1).pos())) { return scrollbar->contextMenu(PlatformMouseEvent(event, 1)); } } @@ -2228,7 +2230,10 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos) WebCore::Frame* focusedFrame = d->page->focusController()->focusedOrMainFrame(); HitTestResult result = focusedFrame->eventHandler()->hitTestResultAtPoint(focusedFrame->view()->windowToContents(pos), /*allowShadowContent*/ false); - d->hitTestResult = QWebHitTestResult(new QWebHitTestResultPrivate(result)); + if (result.scrollbar()) + d->hitTestResult = QWebHitTestResult(); + else + d->hitTestResult = QWebHitTestResult(new QWebHitTestResultPrivate(result)); WebCore::ContextMenu menu(result); menu.populate(); if (d->page->inspectorController()->enabled()) @@ -2349,8 +2354,18 @@ bool QWebPage::supportsExtension(Extension extension) const } /*! - Finds the next occurrence of the string, \a subString, in the page, using the given \a options. - Returns true of \a subString was found and selects the match visually; otherwise returns false. + Finds the specified string, \a subString, in the page, using the given \a options. + + If the HighlightAllOccurrences flag is passed, the function will highlight all occurrences + that exist in the page. All subsequent calls will extend the highlight, rather than + replace it, with occurrences of the new string. + + If the HighlightAllOccurrences flag is not passed, the function will select an occurrence + and all subsequent calls will replace the current occurrence with the next one. + + To clear the selection, just pass an empty string. + + Returns true if \a subString was found; otherwise returns false. */ bool QWebPage::findText(const QString &subString, FindFlags options) { @@ -2358,13 +2373,22 @@ bool QWebPage::findText(const QString &subString, FindFlags options) if (options & FindCaseSensitively) caseSensitivity = ::TextCaseSensitive; - ::FindDirection direction = ::FindDirectionForward; - if (options & FindBackward) - direction = ::FindDirectionBackward; + if (options & HighlightAllOccurrences) { + if (subString.isEmpty()) { + d->page->unmarkAllTextMatches(); + return true; + } else { + return d->page->markAllMatchesForText(subString, caseSensitivity, true, 0); + } + } else { + ::FindDirection direction = ::FindDirectionForward; + if (options & FindBackward) + direction = ::FindDirectionBackward; - const bool shouldWrap = options & FindWrapsAroundDocument; + const bool shouldWrap = options & FindWrapsAroundDocument; - return d->page->findString(subString, caseSensitivity, direction, shouldWrap); + return d->page->findString(subString, caseSensitivity, direction, shouldWrap); + } } /*! diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h index 2152865..86822d2 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h @@ -66,8 +66,7 @@ class QWEBKIT_EXPORT QWebPage : public QObject Q_PROPERTY(bool modified READ isModified) Q_PROPERTY(QString selectedText READ selectedText) Q_PROPERTY(QSize viewportSize READ viewportSize WRITE setViewportSize) - Q_PROPERTY(QSize fixedLayoutSize READ fixedLayoutSize WRITE setFixedLayoutSize) - Q_PROPERTY(bool useFixedLayout READ useFixedLayout WRITE setUseFixedLayout) + Q_PROPERTY(QSize fixedContentsSize READ fixedContentsSize WRITE setFixedContentsSize) Q_PROPERTY(bool forwardUnsupportedContent READ forwardUnsupportedContent WRITE setForwardUnsupportedContent) Q_PROPERTY(LinkDelegationPolicy linkDelegationPolicy READ linkDelegationPolicy WRITE setLinkDelegationPolicy) Q_PROPERTY(QPalette palette READ palette WRITE setPalette) @@ -173,7 +172,8 @@ public: enum FindFlag { FindBackward = 1, FindCaseSensitively = 2, - FindWrapsAroundDocument = 4 + FindWrapsAroundDocument = 4, + HighlightAllOccurrences = 8 }; Q_DECLARE_FLAGS(FindFlags, FindFlag) @@ -234,11 +234,8 @@ public: QSize viewportSize() const; void setViewportSize(const QSize &size) const; - QSize fixedLayoutSize() const; - void setFixedLayoutSize(const QSize &size) const; - - bool useFixedLayout() const; - void setUseFixedLayout(bool useFixedLayout); + QSize fixedContentsSize() const; + void setFixedContentsSize(const QSize &size) const; virtual bool event(QEvent*); bool focusNextPrevChild(bool next); diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h index a897bf1..984bec1 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h @@ -45,6 +45,7 @@ namespace WebCore class Element; class Node; class Page; + class Frame; #ifndef QT_NO_CURSOR class SetCursorEvent : public QEvent { @@ -113,7 +114,7 @@ public: void shortcutOverrideEvent(QKeyEvent*); void leaveEvent(QEvent *); - bool handleScrolling(QKeyEvent*); + bool handleScrolling(QKeyEvent*, WebCore::Frame*); #ifndef QT_NO_SHORTCUT static QWebPage::WebAction editorActionForKeyEvent(QKeyEvent* event); diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp index cc49499..02ef4a0 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp @@ -190,8 +190,8 @@ void QWebSettingsPrivate::apply() global->attributes.value(QWebSettings::LocalStorageDatabaseEnabled)); settings->setLocalStorageEnabled(value); - value = attributes.value(QWebSettings::AllowUniversalAccessFromFileUrls, - global->attributes.value(QWebSettings::AllowUniversalAccessFromFileUrls)); + value = attributes.value(QWebSettings::LocalContentCanAccessRemoteUrls, + global->attributes.value(QWebSettings::LocalContentCanAccessRemoteUrls)); settings->setAllowUniversalAccessFromFileURLs(value); } else { QList<QWebSettingsPrivate *> settings = *::allSettings(); @@ -328,8 +328,7 @@ QWebSettings *QWebSettings::globalSettings() web application cache feature is enabled or not. \value LocalStorageDatabaseEnabled Specifies whether support for the HTML 5 local storage feature is enabled or not. - \value AllowUniversalAccessFromFileUrls Specifies whether documents from file - Urls should be granted universal access (e.g., to HTTP and HTTPS documents). + \value LocalContentCanAccessRemoteUrls Specifies whether locally loaded documents are allowed to access remote urls. */ /*! @@ -358,7 +357,7 @@ QWebSettings::QWebSettings() d->attributes.insert(QWebSettings::OfflineStorageDatabaseEnabled, true); d->attributes.insert(QWebSettings::OfflineWebApplicationCacheEnabled, true); d->attributes.insert(QWebSettings::LocalStorageDatabaseEnabled, true); - d->attributes.insert(QWebSettings::AllowUniversalAccessFromFileUrls, true); + d->attributes.insert(QWebSettings::LocalContentCanAccessRemoteUrls, true); d->offlineStorageDefaultQuota = 5 * 1024 * 1024; } diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h index da0c9f2..7cbca25 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h @@ -64,7 +64,7 @@ public: OfflineStorageDatabaseEnabled, OfflineWebApplicationCacheEnabled, LocalStorageDatabaseEnabled, - AllowUniversalAccessFromFileUrls + LocalContentCanAccessRemoteUrls }; enum WebGraphic { MissingImageGraphic, diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp index 3c56b93..c634a7f 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp @@ -646,9 +646,18 @@ void QWebView::setRenderHint(QPainter::RenderHint hint, bool enabled) /*! - Finds the next occurrence of the string, \a subString, in the page, using - the given \a options. Returns true of \a subString was found and selects - the match visually; otherwise returns false. + Finds the specified string, \a subString, in the page, using the given \a options. + + If the HighlightAllOccurrences flag is passed, the function will highlight all occurrences + that exist in the page. All subsequent calls will extend the highlight, rather than + replace it, with occurrences of the new string. + + If the HighlightAllOccurrences flag is not passed, the function will select an occurrence + and all subsequent calls will replace the current occurrence with the next one. + + To clear the selection, just pass an empty string. + + Returns true if \a subString was found; otherwise returns false. \sa selectedText(), selectionChanged() */ |