diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-17 16:21:14 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-17 16:21:14 +0200 |
commit | 8995b83bcbfbb68245f779b64e5517627c6cc6ea (patch) | |
tree | 17985605dab9263cc2444bd4d45f189e142cca7c /Source/WebKit/qt/Api | |
parent | b9c9652036d5e9f1e29c574f40bc73a35c81ace6 (diff) | |
download | qtwebkit-8995b83bcbfbb68245f779b64e5517627c6cc6ea.tar.gz |
Imported WebKit commit cf4f8fc6f19b0629f51860cb2d4b25e139d07e00 (http://svn.webkit.org/repository/webkit/trunk@131592)
New snapshot that includes the build fixes for Mac OS X 10.6 and earlier as well
as the previously cherry-picked changes
Diffstat (limited to 'Source/WebKit/qt/Api')
-rw-r--r-- | Source/WebKit/qt/Api/qwebframe.cpp | 88 | ||||
-rw-r--r-- | Source/WebKit/qt/Api/qwebhistory.cpp | 2 | ||||
-rw-r--r-- | Source/WebKit/qt/Api/qwebpage.cpp | 19 | ||||
-rw-r--r-- | Source/WebKit/qt/Api/qwebpage_p.h | 1 | ||||
-rw-r--r-- | Source/WebKit/qt/Api/qwebplugindatabase.cpp | 4 | ||||
-rw-r--r-- | Source/WebKit/qt/Api/qwebsettings.cpp | 12 |
6 files changed, 12 insertions, 114 deletions
diff --git a/Source/WebKit/qt/Api/qwebframe.cpp b/Source/WebKit/qt/Api/qwebframe.cpp index adbfa1ccd..0accd3362 100644 --- a/Source/WebKit/qt/Api/qwebframe.cpp +++ b/Source/WebKit/qt/Api/qwebframe.cpp @@ -106,90 +106,6 @@ QT_BEGIN_NAMESPACE extern Q_GUI_EXPORT int qt_defaultDpi(); QT_END_NAMESPACE -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; - - QPoint contentsPos = frame->view()->windowToContents(pos); - Node* node = frame->document()->elementFromPoint(contentsPos.x(), contentsPos.y()); - if (!node) - return false; - - RenderObject* renderer = node->renderer(); - if (!renderer) - return false; - - if (renderer->isListBox()) - return false; - - RenderLayer* renderLayer = renderer->enclosingLayer(); - if (!renderLayer) - return false; - - bool scrolledHorizontal = false; - bool scrolledVertical = false; - - 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 (scrolledHorizontal || scrolledVertical) - return true; - - renderLayer = renderLayer->parent(); - } while (renderLayer); - - return false; -} - - -/*! - \internal - Scrolls nested frames starting at this frame, \a dx pixels to the right - and \a dy pixels downward. Both \a dx and \a dy may be negative. First attempts - to scroll elements with CSS overflow at position pos, followed by this frame. If this - frame doesn't scroll, attempts to scroll the parent -*/ -void QWEBKIT_EXPORT qtwebkit_webframe_scrollRecursively(QWebFrame* qFrame, int dx, int dy, const QPoint& pos) -{ - if (!qFrame) - return; - - if (qtwebkit_webframe_scrollOverflow(qFrame, dx, dy, pos)) - return; - - bool scrollHorizontal = false; - bool scrollVertical = false; - - do { - if (dx > 0) // scroll right - scrollHorizontal = qFrame->scrollBarValue(Qt::Horizontal) < qFrame->scrollBarMaximum(Qt::Horizontal); - else if (dx < 0) // scroll left - scrollHorizontal = qFrame->scrollBarValue(Qt::Horizontal) > qFrame->scrollBarMinimum(Qt::Horizontal); - - if (dy > 0) // scroll down - scrollVertical = qFrame->scrollBarValue(Qt::Vertical) < qFrame->scrollBarMaximum(Qt::Vertical); - else if (dy < 0) //scroll up - scrollVertical = qFrame->scrollBarValue(Qt::Vertical) > qFrame->scrollBarMinimum(Qt::Vertical); - - if (scrollHorizontal || scrollVertical) { - qFrame->scroll(dx, dy); - return; - } - - qFrame = qFrame->parentFrame(); - } while (qFrame); -} - static inline ResourceRequestCachePolicy cacheLoadControlToCachePolicy(uint cacheLoadControl) { switch (cacheLoadControl) { @@ -1695,9 +1611,9 @@ QWebHitTestResultPrivate::QWebHitTestResultPrivate(const WebCore::HitTestResult boundingRect = innerNonSharedNode ? innerNonSharedNode->renderer()->absoluteBoundingBoxRect() : IntRect(); WebCore::Image *img = hitTest.image(); if (img) { - QImage *pix = img->nativeImageForCurrentFrame(); + QPixmap *pix = img->nativeImageForCurrentFrame(); if (pix) - pixmap = QPixmap::fromImage(*pix); + pixmap = *pix; } WebCore::Frame *wframe = hitTest.targetFrame(); if (wframe) diff --git a/Source/WebKit/qt/Api/qwebhistory.cpp b/Source/WebKit/qt/Api/qwebhistory.cpp index 4bf63583b..f7849666e 100644 --- a/Source/WebKit/qt/Api/qwebhistory.cpp +++ b/Source/WebKit/qt/Api/qwebhistory.cpp @@ -158,7 +158,7 @@ QDateTime QWebHistoryItem::lastVisited() const QIcon QWebHistoryItem::icon() const { if (d->item) - return QPixmap::fromImage(*WebCore::iconDatabase().synchronousNativeIconForPageURL(d->item->url(), WebCore::IntSize(16, 16))); + return *WebCore::iconDatabase().synchronousNativeIconForPageURL(d->item->url(), WebCore::IntSize(16, 16)); return QIcon(); } diff --git a/Source/WebKit/qt/Api/qwebpage.cpp b/Source/WebKit/qt/Api/qwebpage.cpp index 5a844be3d..9019f4688 100644 --- a/Source/WebKit/qt/Api/qwebpage.cpp +++ b/Source/WebKit/qt/Api/qwebpage.cpp @@ -757,21 +757,6 @@ void QWebPagePrivate::mouseTripleClickEvent(T *ev) ev->setAccepted(accepted); } -void QWebPagePrivate::handleClipboard(QEvent* ev, Qt::MouseButton button) -{ -#ifndef QT_NO_CLIPBOARD - if (QApplication::clipboard()->supportsSelection()) { - WebCore::Frame* focusFrame = page->focusController()->focusedOrMainFrame(); - if (button == Qt::MidButton) { - if (focusFrame) { - focusFrame->editor()->command(AtomicString("PasteGlobalSelection")).execute(); - ev->setAccepted(true); - } - } - } -#endif -} - template<class T> void QWebPagePrivate::mouseReleaseEvent(T *ev) { @@ -787,8 +772,6 @@ void QWebPagePrivate::mouseReleaseEvent(T *ev) accepted = frame->eventHandler()->handleMouseReleaseEvent(mev); ev->setAccepted(accepted); - if (!ev->isAccepted()) - handleClipboard(ev, ev->button()); handleSoftwareInputPanel(ev->button(), QPointF(ev->pos()).toPoint()); } @@ -2254,7 +2237,7 @@ static void extractContentTypeFromPluginVector(const Vector<PluginPackage*>& plu MIMEToDescriptionsMap::const_iterator map_it = plugins[i]->mimeToDescriptions().begin(); MIMEToDescriptionsMap::const_iterator map_end = plugins[i]->mimeToDescriptions().end(); for (; map_it != map_end; ++map_it) - *list << map_it->first; + *list << map_it->key; } } diff --git a/Source/WebKit/qt/Api/qwebpage_p.h b/Source/WebKit/qt/Api/qwebpage_p.h index a8e373bca..86577d351 100644 --- a/Source/WebKit/qt/Api/qwebpage_p.h +++ b/Source/WebKit/qt/Api/qwebpage_p.h @@ -127,7 +127,6 @@ public: void shortcutOverrideEvent(QKeyEvent*); void leaveEvent(QEvent*); - void handleClipboard(QEvent*, Qt::MouseButton); void handleSoftwareInputPanel(Qt::MouseButton, const QPoint&); bool handleScrolling(QKeyEvent*, WebCore::Frame*); diff --git a/Source/WebKit/qt/Api/qwebplugindatabase.cpp b/Source/WebKit/qt/Api/qwebplugindatabase.cpp index a7a3b5f2c..c5328c8f6 100644 --- a/Source/WebKit/qt/Api/qwebplugindatabase.cpp +++ b/Source/WebKit/qt/Api/qwebplugindatabase.cpp @@ -122,8 +122,8 @@ QList<QWebPluginInfo::MimeType> QWebPluginInfo::mimeTypes() const for (MIMEToDescriptionsMap::const_iterator it = mimeToDescriptions.begin(); it != end; ++it) { MimeType mimeType; - mimeType.name = it->first; - mimeType.description = it->second; + mimeType.name = it->key; + mimeType.description = it->value; QStringList fileExtensions; Vector<String> extensions = m_package->mimeToExtensions().get(mimeType.name); diff --git a/Source/WebKit/qt/Api/qwebsettings.cpp b/Source/WebKit/qt/Api/qwebsettings.cpp index ebecc7f5d..ba7187df7 100644 --- a/Source/WebKit/qt/Api/qwebsettings.cpp +++ b/Source/WebKit/qt/Api/qwebsettings.cpp @@ -723,12 +723,12 @@ void QWebSettings::clearIconDatabase() QIcon QWebSettings::iconForUrl(const QUrl& url) { WebCore::initializeWebCoreQt(); - QImage* icon = WebCore::iconDatabase().synchronousNativeIconForPageURL(WebCore::KURL(url).string(), + QPixmap* icon = WebCore::iconDatabase().synchronousNativeIconForPageURL(WebCore::KURL(url).string(), WebCore::IntSize(16, 16)); if (!icon) return QIcon(); - return QPixmap::fromImage(*icon); + return* icon; } /* @@ -771,7 +771,7 @@ static const char* resourceNameForWebGraphic(QWebSettings::WebGraphic type) void QWebSettings::setWebGraphic(WebGraphic type, const QPixmap& graphic) { WebCore::initializeWebCoreQt(); - WebCore::Image::setPlatformResource(resourceNameForWebGraphic(type), graphic.toImage()); + WebCore::Image::setPlatformResource(resourceNameForWebGraphic(type), graphic); } /*! @@ -786,10 +786,10 @@ QPixmap QWebSettings::webGraphic(WebGraphic type) RefPtr<WebCore::Image> img = WebCore::Image::loadPlatformResource(resourceNameForWebGraphic(type)); if (!img) return QPixmap(); - QImage* image = img->nativeImageForCurrentFrame(); - if (!image) + QPixmap* pixmap = img->nativeImageForCurrentFrame(); + if (!pixmap) return QPixmap(); - return QPixmap::fromImage(*image); + return *pixmap; } /*! |