diff options
Diffstat (limited to 'src/3rdparty/webkit/WebKit/qt/Api')
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/Api/DerivedSources.pro | 6 | ||||
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp | 9 | ||||
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp | 32 | ||||
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp | 2 | ||||
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp | 103 | ||||
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp | 26 | ||||
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h | 3 |
7 files changed, 85 insertions, 96 deletions
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/DerivedSources.pro b/src/3rdparty/webkit/WebKit/qt/Api/DerivedSources.pro index 22d4c8d..389fb5f 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/DerivedSources.pro +++ b/src/3rdparty/webkit/WebKit/qt/Api/DerivedSources.pro @@ -28,7 +28,7 @@ qtheader_module.commands += echo $${QUOTE}$${LITERAL_HASH}define QT_QTWEBKIT_MOD qtheader_module.commands += echo $${QUOTE}$${LITERAL_HASH}include $${ESCAPE}<QtNetwork/QtNetwork$${ESCAPE}>$${QUOTE} >> $${qtheader_module.target} && WEBKIT_CLASS_HEADERS = $${LITERAL_DOLLAR}$${LITERAL_DOLLAR}$${LITERAL_DOLLAR}$${LITERAL_DOLLAR}PWD/QtWebKit -regex = ".*\\sclass\\sQWEBKIT_EXPORT\\s(\\w+)\\s(.*)" +regex = ".*\sclass\sQWEBKIT_EXPORT\s(\w+)\s(.*)" for(HEADER, WEBKIT_API_HEADERS) { # 1. Append to QtWebKit header that includes all other header files @@ -70,7 +70,7 @@ for(HEADER, WEBKIT_API_HEADERS) { res = $$find(src, $$regex) isEmpty(res):break() - exp = $$replace(src, $$regex, "EXPORTED_CLASS = \\1") + exp = $$replace(src, $$regex, "EXPORTED_CLASS = \1") eval($$exp) CLASS_TARGET = "qtheader_$${EXPORTED_CLASS}" @@ -87,7 +87,7 @@ for(HEADER, WEBKIT_API_HEADERS) { # Qt's QRegExp does not support inline non-greedy matching, # so we'll have to work around it by updating the haystack - src = $$replace(src, $$regex, "\\2") + src = $$replace(src, $$regex, "\2") src_words = $$join(src, $${LITERAL_WHITESPACE}) } } diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp index 75a23d9..7a25646 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp @@ -127,7 +127,7 @@ public: #endif void updateResizesToContentsForPage(); - QRectF graphicsItemVisibleRect() const; + virtual QRectF graphicsItemVisibleRect() const; #if ENABLE(TILED_BACKING_STORE) void updateTiledBackingStoreScale(); #endif @@ -597,12 +597,7 @@ void QGraphicsWebView::paint(QPainter* painter, const QStyleOptionGraphicsItem* #if ENABLE(TILED_BACKING_STORE) if (WebCore::TiledBackingStore* backingStore = QWebFramePrivate::core(page()->mainFrame())->tiledBackingStore()) { // FIXME: We should set the backing store viewport earlier than in paint - if (d->resizesToContents) - backingStore->viewportChanged(WebCore::IntRect(d->graphicsItemVisibleRect())); - else { - QRectF visibleRect(d->page->mainFrame()->scrollPosition(), d->page->mainFrame()->geometry().size()); - backingStore->viewportChanged(WebCore::IntRect(visibleRect)); - } + backingStore->adjustVisibleRect(); // QWebFrame::render is a public API, bypass it for tiled rendering so behavior does not need to change. WebCore::GraphicsContext context(painter); page()->mainFrame()->d->renderFromTiledBackingStore(&context, option->exposedRect.toAlignedRect()); diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp index 44cc3b5..721aaa6 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp @@ -275,8 +275,9 @@ void QWEBKIT_EXPORT qt_drt_evaluateScriptInIsolatedWorld(QWebFrame* qFrame, int JSC::JSValue result = frame->script()->executeScriptInWorld(mainThreadNormalWorld(), script, true).jsValue(); } -static bool webframe_scrollOverflow(WebCore::Frame* frame, int dx, int dy, const QPoint& pos) +bool QWEBKIT_EXPORT qtwebkit_webframe_scrollOverflow(QWebFrame* qFrame, int dx, int dy, const QPoint& pos) { + WebCore::Frame* frame = QWebFramePrivate::core(qFrame); if (!frame || !frame->document() || !frame->view() || !frame->eventHandler()) return false; @@ -299,17 +300,24 @@ static bool webframe_scrollOverflow(WebCore::Frame* frame, int dx, int dy, const bool scrolledHorizontal = false; bool scrolledVertical = false; - if (dx > 0) - scrolledHorizontal = renderLayer->scroll(ScrollRight, ScrollByPixel, dx); - else if (dx < 0) - scrolledHorizontal = renderLayer->scroll(ScrollLeft, ScrollByPixel, qAbs(dx)); + do { + if (dx > 0) + scrolledHorizontal = renderLayer->scroll(ScrollRight, ScrollByPixel, dx); + else if (dx < 0) + scrolledHorizontal = renderLayer->scroll(ScrollLeft, ScrollByPixel, qAbs(dx)); + + if (dy > 0) + scrolledVertical = renderLayer->scroll(ScrollDown, ScrollByPixel, dy); + else if (dy < 0) + scrolledVertical = renderLayer->scroll(ScrollUp, ScrollByPixel, qAbs(dy)); - if (dy > 0) - scrolledVertical = renderLayer->scroll(ScrollDown, ScrollByPixel, dy); - else if (dy < 0) - scrolledVertical = renderLayer->scroll(ScrollUp, ScrollByPixel, qAbs(dy)); + if (scrolledHorizontal || scrolledVertical) + return true; - return (scrolledHorizontal || scrolledVertical); + renderLayer = renderLayer->parent(); + } while (renderLayer); + + return false; } @@ -325,7 +333,7 @@ void QWEBKIT_EXPORT qtwebkit_webframe_scrollRecursively(QWebFrame* qFrame, int d if (!qFrame) return; - if (webframe_scrollOverflow(QWebFramePrivate::core(qFrame), dx, dy, pos)) + if (qtwebkit_webframe_scrollOverflow(qFrame, dx, dy, pos)) return; bool scrollHorizontal = false; @@ -339,7 +347,7 @@ void QWEBKIT_EXPORT qtwebkit_webframe_scrollRecursively(QWebFrame* qFrame, int d if (dy > 0) // scroll down scrollVertical = qFrame->scrollBarValue(Qt::Vertical) < qFrame->scrollBarMaximum(Qt::Vertical); - else if (dy < 0) //scroll up + else if (dy < 0) //scroll up scrollVertical = qFrame->scrollBarValue(Qt::Vertical) > qFrame->scrollBarMinimum(Qt::Vertical); if (scrollHorizontal || scrollVertical) { diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp index d852012..06e6cfa 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp @@ -540,6 +540,8 @@ QDataStream& operator>>(QDataStream& source, QWebHistory& history) d->lst->addItem(item); } d->lst->removeItem(nullItem); + // Update the HistoryController. + history.d->lst->page()->mainFrame()->loader()->history()->setCurrentItem(history.d->lst->entries()[currentIndex].get()); history.goToItem(history.itemAt(currentIndex)); } } diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp index c5f508f..b7182b4 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp @@ -1294,6 +1294,9 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev) { WebCore::Frame *frame = page->focusController()->focusedOrMainFrame(); WebCore::Editor *editor = frame->editor(); +#if QT_VERSION >= 0x040600 + QInputMethodEvent::Attribute selection(QInputMethodEvent::Selection, 0, 0, QVariant()); +#endif if (!editor->canEdit()) { ev->ignore(); @@ -1310,6 +1313,7 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev) renderTextControl = toRenderTextControl(renderer); Vector<CompositionUnderline> underlines; + bool hasSelection = false; for (int i = 0; i < ev->attributes().size(); ++i) { const QInputMethodEvent::Attribute& a = ev->attributes().at(i); @@ -1333,10 +1337,8 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev) } #if QT_VERSION >= 0x040600 case QInputMethodEvent::Selection: { - if (renderTextControl) { - renderTextControl->setSelectionStart(qMin(a.start, (a.start + a.length))); - renderTextControl->setSelectionEnd(qMax(a.start, (a.start + a.length))); - } + selection = a; + hasSelection = true; break; } #endif @@ -1345,10 +1347,25 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev) if (!ev->commitString().isEmpty()) editor->confirmComposition(ev->commitString()); - else if (!ev->preeditString().isEmpty()) { + else { + // 1. empty preedit with a selection attribute, and start/end of 0 cancels composition + // 2. empty preedit with a selection attribute, and start/end of non-0 updates selection of current preedit text + // 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(); - editor->setComposition(preedit, underlines, preedit.length(), 0); +#if QT_VERSION >= 0x040600 + if (hasSelection) { + QString text = (renderTextControl) ? QString(renderTextControl->text()) : QString(); + if (preedit.isEmpty() && selection.start + selection.length > 0) + preedit = text; + editor->setComposition(preedit, underlines, + (selection.length < 0) ? selection.start + selection.length : selection.start, + (selection.length < 0) ? selection.start : selection.start + selection.length); + } else +#endif + editor->setComposition(preedit, underlines, preedit.length(), 0); } + ev->accept(); } @@ -1518,7 +1535,7 @@ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const RefPtr<Range> range = editor->compositionRange(); return QVariant(renderTextControl->selectionEnd() - TextIterator::rangeLength(range.get())); } - return QVariant(renderTextControl->selectionEnd()); + return QVariant(frame->selection()->extent().offsetInContainerNode()); } return QVariant(); } @@ -1550,7 +1567,7 @@ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const RefPtr<Range> range = editor->compositionRange(); return QVariant(renderTextControl->selectionStart() - TextIterator::rangeLength(range.get())); } - return QVariant(renderTextControl->selectionStart()); + return QVariant(frame->selection()->base().offsetInContainerNode()); } return QVariant(); } @@ -3329,12 +3346,37 @@ QString QWebPage::userAgentForUrl(const QUrl&) const #elif defined Q_WS_X11 "X11" #elif defined Q_OS_SYMBIAN - "SymbianOS" + "Symbian" #else "Unknown" #endif ); +#if defined Q_OS_SYMBIAN + QSysInfo::SymbianVersion symbianVersion = QSysInfo::symbianVersion(); + switch (symbianVersion) { + case QSysInfo::SV_9_2: + firstPartTemp += QString::fromLatin1("OS/9.2"); + break; + case QSysInfo::SV_9_3: + firstPartTemp += QString::fromLatin1("OS/9.3"); + break; + case QSysInfo::SV_9_4: + firstPartTemp += QString::fromLatin1("OS/9.4"); + break; + case QSysInfo::SV_SF_2: + firstPartTemp += QString::fromLatin1("/2"); + break; + case QSysInfo::SV_SF_3: + firstPartTemp += QString::fromLatin1("/3"); + break; + case QSysInfo::SV_SF_4: + firstPartTemp += QString::fromLatin1("/4"); + default: + break; + } +#endif + firstPartTemp += QString::fromLatin1("; "); // SSL support @@ -3458,51 +3500,22 @@ QString QWebPage::userAgentForUrl(const QUrl&) const firstPartTemp += QString::fromLatin1("Sun Solaris"); #elif defined Q_OS_ULTRIX firstPartTemp += QString::fromLatin1("DEC Ultrix"); -#elif defined Q_OS_SYMBIAN - firstPartTemp += QString::fromLatin1("SymbianOS"); - QSysInfo::SymbianVersion symbianVersion = QSysInfo::symbianVersion(); - switch (symbianVersion) { - case QSysInfo::SV_9_2: - firstPartTemp += QString::fromLatin1("/9.2"); - break; - case QSysInfo::SV_9_3: - firstPartTemp += QString::fromLatin1("/9.3"); - break; - case QSysInfo::SV_9_4: - firstPartTemp += QString::fromLatin1("/9.4"); - break; - case QSysInfo::SV_SF_2: - firstPartTemp += QString::fromLatin1("^2"); - break; - case QSysInfo::SV_SF_3: - firstPartTemp += QString::fromLatin1("^3"); - break; - case QSysInfo::SV_SF_4: - firstPartTemp += QString::fromLatin1("^4"); - break; - default: - firstPartTemp += QString::fromLatin1("/Unknown"); - } - -#if defined Q_WS_S60 +#elif defined Q_WS_S60 firstPartTemp += QLatin1Char(' '); - firstPartTemp += QString::fromLatin1("Series60"); QSysInfo::S60Version s60Version = QSysInfo::s60Version(); switch (s60Version) { case QSysInfo::SV_S60_3_1: - firstPartTemp += QString::fromLatin1("/3.1"); + firstPartTemp += QString::fromLatin1("Series60/3.1"); break; case QSysInfo::SV_S60_3_2: - firstPartTemp += QString::fromLatin1("/3.2"); + firstPartTemp += QString::fromLatin1("Series60/3.2"); break; case QSysInfo::SV_S60_5_0: - firstPartTemp += QString::fromLatin1("/5.0"); + firstPartTemp += QString::fromLatin1("Series60/5.0"); break; default: - firstPartTemp += QString::fromLatin1("/Unknown"); + break; } -#endif - #elif defined Q_OS_UNIX firstPartTemp += QString::fromLatin1("UNIX BSD/SYSV system"); #elif defined Q_OS_UNIXWARE @@ -3532,8 +3545,8 @@ QString QWebPage::userAgentForUrl(const QUrl&) const QString thirdPartTemp; thirdPartTemp.reserve(150); -#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) - thirdPartTemp + QLatin1String(" Mobile Safari/"); +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) + thirdPartTemp += QLatin1String(" Mobile Safari/"); #else thirdPartTemp += QLatin1String(" Safari/"); #endif diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp index 115f9fc..81823f6 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp @@ -74,7 +74,6 @@ public: QString localStoragePath; QString offlineWebApplicationCachePath; qint64 offlineStorageDefaultQuota; - QUrl inspectorLocation; void apply(); WebCore::Settings* settings; @@ -1011,31 +1010,6 @@ void QWebSettings::setLocalStoragePath(const QString& path) } /*! - \since 4.7 - - Specifies the \a location of a frontend to load with each web page when using Web Inspector. - - \sa inspectorUrl() -*/ -void QWebSettings::setInspectorUrl(const QUrl& location) -{ - d->inspectorLocation = location; - d->apply(); -} - -/*! - \since 4.7 - - Returns the location of the Web Inspector frontend. - - \sa setInspectorUrl() -*/ -QUrl QWebSettings::inspectorUrl() const -{ - return d->inspectorLocation; -} - -/*! \since 4.6 Returns the path for HTML5 local storage. diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h index 3592e2c..b978f5e 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h @@ -136,9 +136,6 @@ public: void setLocalStoragePath(const QString& path); QString localStoragePath() const; - void setInspectorUrl(const QUrl &location); - QUrl inspectorUrl() const; - static void clearMemoryCaches(); static void enablePersistentStorage(const QString& path = QString()); |