diff options
author | Alexis Menard <alexis.menard@nokia.com> | 2009-04-17 12:01:04 (GMT) |
---|---|---|
committer | Alexis Menard <alexis.menard@nokia.com> | 2009-04-17 12:01:04 (GMT) |
commit | 198efeb27e5c2a87d0a2bb6859446cb1faf45ed8 (patch) | |
tree | e4c99e89cbecd2084a87a8c7a5d4877385fcec1c /src/3rdparty | |
parent | bb2e4df9bee3148e819c98410aa36e22dad95d7a (diff) | |
parent | e85867003ca1741f378b1f58f4dd9d48577a5d9b (diff) | |
download | Qt-198efeb27e5c2a87d0a2bb6859446cb1faf45ed8.zip Qt-198efeb27e5c2a87d0a2bb6859446cb1faf45ed8.tar.gz Qt-198efeb27e5c2a87d0a2bb6859446cb1faf45ed8.tar.bz2 |
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt into kinetic-animations
Conflicts:
src/gui/graphicsview/qgraphicsitem.cpp
Diffstat (limited to 'src/3rdparty')
30 files changed, 633 insertions, 120 deletions
diff --git a/src/3rdparty/phonon/gstreamer/audiooutput.cpp b/src/3rdparty/phonon/gstreamer/audiooutput.cpp index fcadac2..138a7e4 100644 --- a/src/3rdparty/phonon/gstreamer/audiooutput.cpp +++ b/src/3rdparty/phonon/gstreamer/audiooutput.cpp @@ -42,6 +42,7 @@ AudioOutput::AudioOutput(Backend *backend, QObject *parent) static int count = 0; m_name = "AudioOutput" + QString::number(count++); if (m_backend->isValid()) { + g_set_application_name(qApp->applicationName().toUtf8()); m_audioBin = gst_bin_new (NULL); gst_object_ref (GST_OBJECT (m_audioBin)); gst_object_sink (GST_OBJECT (m_audioBin)); diff --git a/src/3rdparty/phonon/gstreamer/mediaobject.cpp b/src/3rdparty/phonon/gstreamer/mediaobject.cpp index 5398f0c..74fc1b4 100644 --- a/src/3rdparty/phonon/gstreamer/mediaobject.cpp +++ b/src/3rdparty/phonon/gstreamer/mediaobject.cpp @@ -14,7 +14,6 @@ You should have received a copy of the GNU Lesser General Public License along with this library. If not, see <http://www.gnu.org/licenses/>. */ - #include <cmath> #include <gst/interfaces/propertyprobe.h> #include "common.h" @@ -24,7 +23,6 @@ #include "backend.h" #include "streamreader.h" #include "phononsrc.h" - #include <QtCore> #include <QtCore/QTimer> #include <QtCore/QVector> @@ -78,6 +76,9 @@ MediaObject::MediaObject(Backend *backend, QObject *parent) , m_videoGraph(0) , m_previousTickTime(-1) , m_resetNeeded(false) + , m_autoplayTitles(true) + , m_availableTitles(0) + , m_currentTitle(1) { qRegisterMetaType<GstCaps*>("GstCaps*"); qRegisterMetaType<State>("State"); @@ -902,8 +903,13 @@ void MediaObject::setSource(const MediaSource &source) break; case MediaSource::Disc: // CD tracks can be specified by setting the url in the following way uri=cdda:4 - m_backend->logMessage("Source type Disc not currently supported", Backend::Warning, this); - setError(tr("Could not open media source."), Phonon::NormalError); + { + QUrl cdurl(QLatin1String("cdda://")); + if (createPipefromURL(cdurl)) + m_loading = true; + else + setError(tr("Could not open media source.")); + } break; default: @@ -954,6 +960,19 @@ void MediaObject::getStreamInfo() m_hasVideo = m_videoStreamFound; emit hasVideoChanged(m_hasVideo); } + + m_availableTitles = 1; + gint64 titleCount; + GstFormat format = gst_format_get_by_nick("track"); + if (gst_element_query_duration (m_pipeline, &format, &titleCount)) { + int oldAvailableTitles = m_availableTitles; + m_availableTitles = (int)titleCount; + if (m_availableTitles != oldAvailableTitles) { + emit availableTitlesChanged(m_availableTitles); + m_backend->logMessage(QString("Available titles changed: %0").arg(m_availableTitles), Backend::Info, this); + } + } + } void MediaObject::setPrefinishMark(qint32 newPrefinishMark) @@ -1351,6 +1370,13 @@ void MediaObject::handleEndOfStream() if (!m_seekable) m_atEndOfStream = true; + if (m_autoplayTitles && + m_availableTitles > 1 && + m_currentTitle < m_availableTitles) { + _iface_setCurrentTitle(m_currentTitle + 1); + return; + } + if (m_nextSource.type() != MediaSource::Invalid && m_nextSource.type() != MediaSource::Empty) { // We only emit finish when the queue is actually empty QTimer::singleShot (qMax(0, transitionTime()), this, SLOT(beginPlay())); @@ -1379,6 +1405,72 @@ void MediaObject::notifyStateChange(Phonon::State newstate, Phonon::State oldsta notify(&event); } +#ifndef QT_NO_PHONON_MEDIACONTROLLER +//interface management +bool MediaObject::hasInterface(Interface iface) const +{ + return iface == AddonInterface::TitleInterface; +} + +QVariant MediaObject::interfaceCall(Interface iface, int command, const QList<QVariant> ¶ms) +{ + if (hasInterface(iface)) { + + switch (iface) + { + case TitleInterface: + switch (command) + { + case availableTitles: + return _iface_availableTitles(); + case title: + return _iface_currentTitle(); + case setTitle: + _iface_setCurrentTitle(params.first().toInt()); + break; + case autoplayTitles: + return m_autoplayTitles; + case setAutoplayTitles: + m_autoplayTitles = params.first().toBool(); + break; + } + break; + default: + break; + } + } + return QVariant(); +} +#endif + +int MediaObject::_iface_availableTitles() const +{ + return m_availableTitles; +} + +int MediaObject::_iface_currentTitle() const +{ + return m_currentTitle; +} + +void MediaObject::_iface_setCurrentTitle(int title) +{ + GstFormat trackFormat = gst_format_get_by_nick("track"); + m_backend->logMessage(QString("setCurrentTitle %0").arg(title), Backend::Info, this); + if ((title == m_currentTitle) || (title < 1) || (title > m_availableTitles)) + return; + + m_currentTitle = title; + + //let's seek to the beginning of the song + if (gst_element_seek_simple(m_pipeline, trackFormat, GST_SEEK_FLAG_FLUSH, m_currentTitle - 1)) { + updateTotalTime(); + m_atEndOfStream = false; + emit titleChanged(title); + emit totalTimeChanged(totalTime()); + } +} + } // ns Gstreamer } // ns Phonon diff --git a/src/3rdparty/phonon/gstreamer/mediaobject.h b/src/3rdparty/phonon/gstreamer/mediaobject.h index 4dc3f12..64b3510 100644 --- a/src/3rdparty/phonon/gstreamer/mediaobject.h +++ b/src/3rdparty/phonon/gstreamer/mediaobject.h @@ -21,7 +21,6 @@ #include "backend.h" #include "common.h" #include "medianode.h" - #include <phonon/mediaobjectinterface.h> #include <phonon/addoninterface.h> @@ -32,7 +31,6 @@ #include <QtCore/QDate> #include <QtCore/QEvent> #include <QtCore/QUrl> - #include <gst/gst.h> QT_BEGIN_NAMESPACE @@ -50,11 +48,20 @@ class AudioPath; class VideoPath; class AudioOutput; -class MediaObject : public QObject, public MediaObjectInterface, public AddonInterface, public MediaNode +class MediaObject : public QObject, public MediaObjectInterface +#ifndef QT_NO_PHONON_MEDIACONTROLLER + , public AddonInterface +#endif + , public MediaNode { friend class Stream; Q_OBJECT - Q_INTERFACES(Phonon::MediaObjectInterface Phonon::AddonInterface Phonon::Gstreamer::MediaNode) + Q_INTERFACES(Phonon::MediaObjectInterface +#ifndef QT_NO_PHONON_MEDIACONTROLLER + Phonon::AddonInterface +#endif + Phonon::Gstreamer::MediaNode + ) public: @@ -93,16 +100,10 @@ public: MediaSource source() const; // No additional interfaces currently supported - bool hasInterface(Interface) const - { - return false; - } - - QVariant interfaceCall(Interface, int, const QList<QVariant> &) - { - return QVariant(); - } - +#ifndef QT_NO_PHONON_MEDIACONTROLLER + bool hasInterface(Interface) const; + QVariant interfaceCall(Interface, int, const QList<QVariant> &); +#endif bool isLoading() { return m_loading; @@ -176,6 +177,19 @@ Q_SIGNALS: QMultiMap<QString, QString> metaData(); void setMetaData(QMultiMap<QString, QString> newData); + // AddonInterface: + void titleChanged(int); + void availableTitlesChanged(int); + + // Not implemented + void chapterChanged(int); + void availableChaptersChanged(int); + void angleChanged(int); + void availableAnglesChanged(int); + + void availableSubtitlesChanged(); + void availableAudioChannelsChanged(); + protected: void beginLoad(); void loadingComplete(); @@ -219,6 +233,10 @@ private: void updateSeekable(); qint64 getPipelinePos() const; + int _iface_availableTitles() const; + int _iface_currentTitle() const; + void _iface_setCurrentTitle(int title); + bool m_resumeState; State m_oldState; quint64 m_oldPos; @@ -264,6 +282,9 @@ private: bool m_resetNeeded; QStringList m_missingCodecs; QMultiMap<QString, QString> m_metaData; + bool m_autoplayTitles; + int m_availableTitles; + int m_currentTitle; }; } } //namespace Phonon::Gstreamer diff --git a/src/3rdparty/phonon/gstreamer/x11renderer.cpp b/src/3rdparty/phonon/gstreamer/x11renderer.cpp index 1de58b6..73877a8 100644 --- a/src/3rdparty/phonon/gstreamer/x11renderer.cpp +++ b/src/3rdparty/phonon/gstreamer/x11renderer.cpp @@ -137,6 +137,7 @@ void X11Renderer::scaleModeChanged(Phonon::VideoWidget::ScaleMode) void X11Renderer::movieSizeChanged(const QSize &movieSize) { + Q_UNUSED(movieSize); if (m_renderWidget) { m_renderWidget->setGeometry(m_videoWidget->calculateDrawFrameRect()); } diff --git a/src/3rdparty/phonon/qt7/audionode.mm b/src/3rdparty/phonon/qt7/audionode.mm index cb9e82f..961230c 100644 --- a/src/3rdparty/phonon/qt7/audionode.mm +++ b/src/3rdparty/phonon/qt7/audionode.mm @@ -68,13 +68,15 @@ void AudioNode::createAndConnectAUNodes() << QString(!FindNextComponent(0, &description) ? "ERROR: COMPONENT NOT FOUND!" : "OK!")) OSStatus err = noErr; -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 - if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5) - err = AUGraphAddNode(m_audioGraph->audioGraphRef(), &description, &m_auNode); - else -#endif - err = AUGraphNewNode(m_audioGraph->audioGraphRef(), &description, 0, 0, &m_auNode); - + + // The proper function to call here is AUGraphAddNode() but the type has + // changed between 10.5 and 10.6. it's still OK to call this function, but + // if we want to use the proper thing we need to move over to + // AudioComponentDescription everywhere, which is very similar to the + // ComponentDescription, but a different size. however, + // AudioComponentDescription only exists on 10.6+. More fun than we need to + // deal with at the moment, so we'll take the "deprecated" warning instead. + err = AUGraphNewNode(m_audioGraph->audioGraphRef(), &description, 0, 0, &m_auNode); BACKEND_ASSERT2(err != kAUGraphErr_OutputNodeErr, "A MediaObject can only be connected to one audio output device.", FATAL_ERROR) BACKEND_ASSERT2(err == noErr, "Could not create new AUNode.", FATAL_ERROR) } diff --git a/src/3rdparty/phonon/qt7/backendinfo.mm b/src/3rdparty/phonon/qt7/backendinfo.mm index e173f05..0d51db0 100644 --- a/src/3rdparty/phonon/qt7/backendinfo.mm +++ b/src/3rdparty/phonon/qt7/backendinfo.mm @@ -22,6 +22,7 @@ #include <AudioUnit/AudioUnit.h> #include <CoreServices/CoreServices.h> +#include <QtGui/qmacdefines_mac.h> #import <QTKit/QTMovie.h> #ifdef QUICKTIME_C_API_AVAILABLE diff --git a/src/3rdparty/phonon/qt7/quicktimevideoplayer.h b/src/3rdparty/phonon/qt7/quicktimevideoplayer.h index 0b3aec2..b80570a 100644 --- a/src/3rdparty/phonon/qt7/quicktimevideoplayer.h +++ b/src/3rdparty/phonon/qt7/quicktimevideoplayer.h @@ -20,6 +20,7 @@ #include "backendheader.h" +#include <QtGui/qmacdefines_mac.h> #import <QTKit/QTDataReference.h> #import <QTKit/QTMovie.h> diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index 5bb8a51..bfaefa2 100644 --- a/src/3rdparty/webkit/VERSION +++ b/src/3rdparty/webkit/VERSION @@ -8,4 +8,4 @@ The commit imported was from the and has the sha1 checksum - 0ba3dbe8c83850cd3c3874e3dca95b35b45fd86e + 450331808bfe11b1472c213a8cb311190355c2de diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog index 2e2ce52..9be6e72 100644 --- a/src/3rdparty/webkit/WebCore/ChangeLog +++ b/src/3rdparty/webkit/WebCore/ChangeLog @@ -1,3 +1,159 @@ +2009-02-04 Simon Hausmann <simon.hausmann@nokia.com> + + Unreviewed Qt build fix. + + Changed ASSERT(image) to ASSERT(!image.isNull()). + + * platform/graphics/qt/ImageBufferQt.cpp: + (WebCore::ImageBuffer::getImageData): + +2009-02-03 Dirk Schulze <krit@webkit.org> + + Reviewed by Sam Weinig. + + This is a follow up of r40546. Call toImage() once speeds up ImageBuffer::getImageData() + + * platform/graphics/qt/ImageBufferQt.cpp: + (WebCore::ImageBuffer::getImageData): + +2009-02-03 Dirk Schulze <krit@webkit.org> + + Reviewed by Sam Weinig and Oliver Hunt. + + Added getImageData() support for QtWebKit. + + [QT] lacks getImageData / putImageData support in Canvas + https://bugs.webkit.org/show_bug.cgi?id=22186 + + * platform/graphics/qt/ImageBufferQt.cpp: + (WebCore::ImageBuffer::getImageData): + +2009-04-14 Benjamin C Meyer <benjamin.meyer@torchmobile.com> + + Reviewed by George Staikos. + + https://bugs.webkit.org/show_bug.cgi?id=25099 + + When creating a QNetworkRequest make sure to populate the + CacheLoadControlAttribute with the value set by the ResourceRequest::cachePolicy() so that the cache will be used as WebKit expects. + + * WebKit/qt/tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::requestCache): + + * platform/network/qt/ResourceRequestQt.cpp: + (WebCore::ResourceRequest::toNetworkRequest): + +2009-04-07 Brady Eidson <beidson@apple.com> + + Reviewed by Darin Adler + + While working on <rdar://problem/5968249>, noticed some glaring problems with LocalStorage. + + * page/DOMWindow.cpp: + (WebCore::DOMWindow::localStorage): Return the cached m_localStorage object if it exists to + avoid creating multiple representations for the same underlying StorageArea. + * page/DOMWindow.h: + (WebCore::DOMWindow::optionalLocalStorage): Return m_localStorage, not m_sessionStorage. + +2009-04-06 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Don't show and hide the platformPluginWidget, as it's our QWebView + + * plugins/mac/PluginViewMac.cpp: + (WebCore::PluginView::show): + (WebCore::PluginView::hide): + (WebCore::PluginView::setParentVisible): + +2009-04-06 Mike Belshe <mike@belshe.com> + + Reviewed by Eric Seidel. + + HTMLCanvasElement crash when ImageBuffer creation fails. + https://bugs.webkit.org/show_bug.cgi?id=23212 + + Check for NULL before using the ImageBuffer as we might + be low on memory and creation may have failed. + + Test case creation blocked by: + https://bugs.webkit.org/show_bug.cgi?id=25055 + + * html/HTMLCanvasElement.cpp: + (WebCore::HTMLCanvasElement::createImageBuffer): + +2009-04-05 Erik L. Bunce <elbunce@xendom.com> + + Reviewed by Simon Hausmann. + + https://bugs.webkit.org/show_bug.cgi?id=25050 + + Fix an assert failure when dropping an 'empty' text/uri-list on a QWebView. + + * platform/qt/DragDataQt.cpp: + (WebCore::DragData::asURL): + +2009-03-27 Zack Rusin <zack@kde.org> + + Reviewed by Simon Hausmann. + + https://bugs.webkit.org/show_bug.cgi?id=24280 + + Fix propagation of fill rules when rendering paths in the Qt build. + + * platform/graphics/qt/GraphicsContextQt.cpp: + (WebCore::toQtFillRule): + (WebCore::GraphicsContext::fillPath): + (WebCore::GraphicsContext::strokePath): + +2009-03-27 Zack Rusin <zack@kde.org> + + Reviewed by Tor Arne Vestbø. + + https://bugs.webkit.org/show_bug.cgi?id=24275 + + Fix text field theming in the Qt build with the KDE 4 Oxygen + style by adjusting the size vertically and horizontally to + set padding on the element equal to the width of the style painted border. + + * platform/qt/RenderThemeQt.cpp: + (WebCore::RenderThemeQt::RenderThemeQt): + (WebCore::RenderThemeQt::computeSizeBasedOnStyle): + (WebCore::RenderThemeQt::adjustTextFieldStyle): + (WebCore::RenderThemeQt::paintTextField): + * platform/qt/RenderThemeQt.h: + +2009-02-06 Dirk Schulze <krit@webkit.org> + + Reviewed by Simon Hausmann. + + Fix bug in clearRect(). Use fillRect() instead of eraseRect() to get + the context transparent. + + [QT] clearRect fill's a given rect with white + https://bugs.webkit.org/show_bug.cgi?id=23728 + + * platform/graphics/qt/GraphicsContextQt.cpp: + (WebCore::GraphicsContext::clearRect): + +2009-03-19 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Tor Arne Vestbø. + + Fixed support for doing calls from JavaScript into NPAPI Plugins for the Qt port on Windows. + + Removed dead code for distinguishing between Widget and PluginView in the Qt port. + + * bindings/js/ScriptControllerQt.cpp: + (WebCore::ScriptController::createScriptInstanceForWidget): Removed incorrect isNPAPI check. + * plugins/PluginView.cpp: + (WebCore::PluginView::PluginView): Removed m_isNPAPIPlugin variable. + * plugins/PluginView.h: Removed setter/getter. + * plugins/mac/PluginViewMac.cpp: + (WebCore::PluginView::init): Removed call to setIsNPAPIPlugin. + * plugins/qt/PluginViewQt.cpp: + (WebCore::PluginView::init): Ditto. + 2009-02-26 Benjamin Meyer <benjamin.meyer@torchmobile.com> Reviewed by George Staikos. diff --git a/src/3rdparty/webkit/WebCore/bindings/js/ScriptControllerQt.cpp b/src/3rdparty/webkit/WebCore/bindings/js/ScriptControllerQt.cpp index 15593fc..6b14190 100644 --- a/src/3rdparty/webkit/WebCore/bindings/js/ScriptControllerQt.cpp +++ b/src/3rdparty/webkit/WebCore/bindings/js/ScriptControllerQt.cpp @@ -50,9 +50,7 @@ PassRefPtr<JSC::Bindings::Instance> ScriptController::createScriptInstanceForWid { if (widget->isPluginView()) { PluginView* pluginView = static_cast<PluginView*>(widget); - if (pluginView->isNPAPIPlugin()) - return pluginView->bindingInstance(); - return 0; + return pluginView->bindingInstance(); } QWidget* platformWidget = widget->platformWidget(); diff --git a/src/3rdparty/webkit/WebCore/html/HTMLCanvasElement.cpp b/src/3rdparty/webkit/WebCore/html/HTMLCanvasElement.cpp index fb6d9fe..76c3202 100644 --- a/src/3rdparty/webkit/WebCore/html/HTMLCanvasElement.cpp +++ b/src/3rdparty/webkit/WebCore/html/HTMLCanvasElement.cpp @@ -257,6 +257,10 @@ void HTMLCanvasElement::createImageBuffer() const return; m_imageBuffer.set(ImageBuffer::create(size, false).release()); + // The convertLogicalToDevice MaxCanvasArea check should prevent common cases + // where ImageBuffer::create() returns NULL, however we could still be low on memory. + if (!m_imageBuffer) + return; m_imageBuffer->context()->scale(FloatSize(size.width() / unscaledSize.width(), size.height() / unscaledSize.height())); m_imageBuffer->context()->setShadowsIgnoreTransforms(true); } diff --git a/src/3rdparty/webkit/WebCore/page/DOMWindow.cpp b/src/3rdparty/webkit/WebCore/page/DOMWindow.cpp index 42d2e90..dd14fb9 100644 --- a/src/3rdparty/webkit/WebCore/page/DOMWindow.cpp +++ b/src/3rdparty/webkit/WebCore/page/DOMWindow.cpp @@ -333,6 +333,9 @@ Storage* DOMWindow::sessionStorage() const Storage* DOMWindow::localStorage() const { + if (m_localStorage) + return m_localStorage.get(); + Document* document = this->document(); if (!document) return 0; diff --git a/src/3rdparty/webkit/WebCore/page/DOMWindow.h b/src/3rdparty/webkit/WebCore/page/DOMWindow.h index 0277441..e7fab18 100644 --- a/src/3rdparty/webkit/WebCore/page/DOMWindow.h +++ b/src/3rdparty/webkit/WebCore/page/DOMWindow.h @@ -265,7 +265,7 @@ namespace WebCore { Location* optionalLocation() const { return m_location.get(); } #if ENABLE(DOM_STORAGE) Storage* optionalSessionStorage() const { return m_sessionStorage.get(); } - Storage* optionalLocalStorage() const { return m_sessionStorage.get(); } + Storage* optionalLocalStorage() const { return m_localStorage.get(); } #endif #if ENABLE(OFFLINE_WEB_APPLICATIONS) DOMApplicationCache* optionalApplicationCache() const { return m_applicationCache.get(); } diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp index 80a6390..936c1ea 100644 --- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp @@ -168,6 +168,18 @@ static inline QGradient applySpreadMethod(QGradient gradient, GradientSpreadMeth return gradient; } +static inline Qt::FillRule toQtFillRule(WindRule rule) +{ + switch(rule) { + case RULE_EVENODD: + return Qt::OddEvenFill; + case RULE_NONZERO: + return Qt::WindingFill; + } + qDebug("Qt: unrecognized wind rule!"); + return Qt::OddEvenFill; +} + struct TransparencyLayer { TransparencyLayer(const QPainter* p, const QRect &rect) @@ -541,6 +553,7 @@ void GraphicsContext::fillPath() QPainter *p = m_data->p(); QPainterPath path = m_data->currentPath; + path.setFillRule(toQtFillRule(fillRule())); switch (m_common->state.fillColorSpace) { case SolidColorSpace: @@ -569,6 +582,7 @@ void GraphicsContext::strokePath() QPainter *p = m_data->p(); QPen pen = p->pen(); QPainterPath path = m_data->currentPath; + path.setFillRule(toQtFillRule(fillRule())); switch (m_common->state.strokeColorSpace) { case SolidColorSpace: @@ -815,7 +829,7 @@ void GraphicsContext::clearRect(const FloatRect& rect) QPainter::CompositionMode currentCompositionMode = p->compositionMode(); if (p->paintEngine()->hasFeature(QPaintEngine::PorterDuff)) p->setCompositionMode(QPainter::CompositionMode_Source); - p->eraseRect(rect); + p->fillRect(rect, Qt::transparent); if (p->paintEngine()->hasFeature(QPaintEngine::PorterDuff)) p->setCompositionMode(currentCompositionMode); } diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageBufferQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageBufferQt.cpp index d4ab59f..d1009b5 100644 --- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageBufferQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageBufferQt.cpp @@ -35,6 +35,8 @@ #include "StillImageQt.h" #include <QBuffer> +#include <QColor> +#include <QImage> #include <QImageWriter> #include <QPainter> #include <QPixmap> @@ -79,10 +81,57 @@ Image* ImageBuffer::image() const return m_image.get(); } -PassRefPtr<ImageData> ImageBuffer::getImageData(const IntRect&) const +PassRefPtr<ImageData> ImageBuffer::getImageData(const IntRect& rect) const { - notImplemented(); - return 0; + PassRefPtr<ImageData> result = ImageData::create(rect.width(), rect.height()); + unsigned char* data = result->data()->data(); + + if (rect.x() < 0 || rect.y() < 0 || (rect.x() + rect.width()) > m_size.width() || (rect.y() + rect.height()) > m_size.height()) + memset(data, 0, result->data()->length()); + + int originx = rect.x(); + int destx = 0; + if (originx < 0) { + destx = -originx; + originx = 0; + } + int endx = rect.x() + rect.width(); + if (endx > m_size.width()) + endx = m_size.width(); + int numColumns = endx - originx; + + int originy = rect.y(); + int desty = 0; + if (originy < 0) { + desty = -originy; + originy = 0; + } + int endy = rect.y() + rect.height(); + if (endy > m_size.height()) + endy = m_size.height(); + int numRows = endy - originy; + + QImage image = m_data.m_pixmap.toImage(); + if (image.format() != QImage::Format_ARGB32) + image = image.convertToFormat(QImage::Format_ARGB32); + ASSERT(!image.isNull()); + + unsigned destBytesPerRow = 4 * rect.width(); + unsigned char* destRows = data + desty * destBytesPerRow + destx * 4; + for (int y = 0; y < numRows; ++y) { + for (int x = 0; x < numColumns; x++) { + QRgb value = image.pixel(x + originx, y + originy); + int basex = x * 4; + + destRows[basex] = qRed(value); + destRows[basex + 1] = qGreen(value); + destRows[basex + 2] = qBlue(value); + destRows[basex + 3] = qAlpha(value); + } + destRows += destBytesPerRow; + } + + return result; } void ImageBuffer::putImageData(ImageData*, const IntRect&, const IntPoint&) diff --git a/src/3rdparty/webkit/WebCore/platform/network/qt/ResourceRequestQt.cpp b/src/3rdparty/webkit/WebCore/platform/network/qt/ResourceRequestQt.cpp index 9308878..c8f6ad5 100644 --- a/src/3rdparty/webkit/WebCore/platform/network/qt/ResourceRequestQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/network/qt/ResourceRequestQt.cpp @@ -41,6 +41,22 @@ QNetworkRequest ResourceRequest::toNetworkRequest() const request.setRawHeader(name, value); } + switch (cachePolicy()) { + case ReloadIgnoringCacheData: + request.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::AlwaysNetwork); + break; + case ReturnCacheDataElseLoad: + request.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferCache); + break; + case ReturnCacheDataDontLoad: + request.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::AlwaysCache); + break; + case UseProtocolCachePolicy: + // QNetworkRequest::PreferNetwork + default: + break; + } + return request; } diff --git a/src/3rdparty/webkit/WebCore/platform/qt/DragDataQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/DragDataQt.cpp index 9d95373..218f7be 100644 --- a/src/3rdparty/webkit/WebCore/platform/qt/DragDataQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/qt/DragDataQt.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -126,6 +126,10 @@ String DragData::asURL(String* title) const if (!m_platformDragData) return String(); QList<QUrl> urls = m_platformDragData->urls(); + + if (urls.isEmpty()) + return String(); + return urls.first().toString(); } diff --git a/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp index cc9d314..a9da76b 100644 --- a/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp @@ -41,6 +41,7 @@ #include <QWidget> #include <QPainter> #include <QPushButton> +#include <QLineEdit> #include <QStyleFactory> #include <QStyleOptionButton> #include <QStyleOptionFrameV2> @@ -123,6 +124,12 @@ RenderThemeQt::RenderThemeQt() #endif m_fallbackStyle = 0; + + // this will need to be regenerated when the style changes + QLineEdit lineEdit; + QStyleOptionFrameV2 opt; + m_frameLineWidth = QApplication::style()->pixelMetric(QStyle::PM_DefaultFrameWidth, + &opt, &lineEdit); } RenderThemeQt::~RenderThemeQt() @@ -268,7 +275,7 @@ int RenderThemeQt::minimumMenuListSize(RenderStyle*) const return 7 * fm.width(QLatin1Char('x')); } -static void computeSizeBasedOnStyle(RenderStyle* renderStyle) +void RenderThemeQt::computeSizeBasedOnStyle(RenderStyle* renderStyle) const { // If the width and height are both specified, then we have nothing to do. if (!renderStyle->width().isIntrinsicOrAuto() && !renderStyle->height().isAuto()) @@ -335,13 +342,15 @@ static void computeSizeBasedOnStyle(RenderStyle* renderStyle) int h = qMax(fm.lineSpacing(), 14) + 2*verticalMargin; int w = fm.width(QLatin1Char('x')) * 17 + 2*horizontalMargin; QStyleOptionFrameV2 opt; - opt.lineWidth = applicationStyle->pixelMetric(QStyle::PM_DefaultFrameWidth, - &opt, 0); + opt.lineWidth = m_frameLineWidth; QSize sz = applicationStyle->sizeFromContents(QStyle::CT_LineEdit, - &opt, - QSize(w, h).expandedTo(QApplication::globalStrut()), - 0); + &opt, + QSize(w, h).expandedTo(QApplication::globalStrut()), + 0); size.setHeight(sz.height()); + + renderStyle->setPaddingLeft(Length(opt.lineWidth, Fixed)); + renderStyle->setPaddingRight(Length(opt.lineWidth, Fixed)); break; } default: @@ -482,6 +491,9 @@ void RenderThemeQt::adjustTextFieldStyle(CSSStyleSelector*, RenderStyle* style, { style->setBackgroundColor(Color::transparent); style->setColor(QApplication::palette().text().color()); + style->resetBorder(); + style->resetPadding(); + computeSizeBasedOnStyle(style); } bool RenderThemeQt::paintTextField(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) @@ -495,7 +507,7 @@ bool RenderThemeQt::paintTextField(RenderObject* o, const RenderObject::PaintInf panel.initFrom(p.widget); panel.rect = r; - panel.lineWidth = p.style->pixelMetric(QStyle::PM_DefaultFrameWidth, &panel, p.widget); + panel.lineWidth = m_frameLineWidth; panel.state |= QStyle::State_Sunken; panel.features = QStyleOptionFrameV2::None; diff --git a/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.h b/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.h index b4a5064..5c78a72 100644 --- a/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.h +++ b/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.h @@ -128,6 +128,7 @@ private: void paintMediaBackground(QPainter* painter, const IntRect& r) const; QColor getMediaControlForegroundColor(RenderObject* o = 0) const; #endif + void computeSizeBasedOnStyle(RenderStyle* renderStyle) const; private: bool supportsFocus(ControlPart) const; @@ -144,6 +145,8 @@ private: QStyle* m_fallbackStyle; QStyle* fallbackStyle(); + + int m_frameLineWidth; }; class StylePainter diff --git a/src/3rdparty/webkit/WebCore/plugins/PluginView.cpp b/src/3rdparty/webkit/WebCore/plugins/PluginView.cpp index dbc090f..61d3157 100644 --- a/src/3rdparty/webkit/WebCore/plugins/PluginView.cpp +++ b/src/3rdparty/webkit/WebCore/plugins/PluginView.cpp @@ -559,9 +559,6 @@ PluginView::PluginView(Frame* parentFrame, const IntSize& size, PluginPackage* p #if PLATFORM(GTK) || defined(Q_WS_X11) , m_needsXEmbed(false) #endif -#if PLATFORM(QT) - , m_isNPAPIPlugin(false) -#endif #if PLATFORM(WIN_OS) && !PLATFORM(WX) && ENABLE(NETSCAPE_PLUGIN_API) , m_pluginWndProc(0) , m_lastMessage(0) diff --git a/src/3rdparty/webkit/WebCore/plugins/PluginView.h b/src/3rdparty/webkit/WebCore/plugins/PluginView.h index 0fe352f..44f2146 100644 --- a/src/3rdparty/webkit/WebCore/plugins/PluginView.h +++ b/src/3rdparty/webkit/WebCore/plugins/PluginView.h @@ -187,11 +187,6 @@ namespace WebCore { static bool isCallingPlugin(); -#if PLATFORM(QT) - bool isNPAPIPlugin() const { return m_isNPAPIPlugin; } - void setIsNPAPIPlugin(bool b) { m_isNPAPIPlugin = b; } -#endif - private: PluginView(Frame* parentFrame, const IntSize&, PluginPackage*, Element*, const KURL&, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually); @@ -257,10 +252,6 @@ namespace WebCore { bool m_isTransparent; bool m_haveInitialized; -#if PLATFORM(QT) - bool m_isNPAPIPlugin; -#endif - #if PLATFORM(GTK) || defined(Q_WS_X11) bool m_needsXEmbed; #endif diff --git a/src/3rdparty/webkit/WebCore/plugins/mac/PluginViewMac.cpp b/src/3rdparty/webkit/WebCore/plugins/mac/PluginViewMac.cpp index c95e854..1d7d570 100644 --- a/src/3rdparty/webkit/WebCore/plugins/mac/PluginViewMac.cpp +++ b/src/3rdparty/webkit/WebCore/plugins/mac/PluginViewMac.cpp @@ -158,8 +158,6 @@ void PluginView::init() m_npWindow.clipRect.right = 0; m_npWindow.clipRect.bottom = 0; - setIsNPAPIPlugin(true); - show(); m_status = PluginStatusLoadedSuccessfully; @@ -301,9 +299,6 @@ void PluginView::show() setSelfVisible(true); - if (isParentVisible() && platformPluginWidget()) - platformPluginWidget()->setVisible(true); - Widget::show(); } @@ -313,9 +308,6 @@ void PluginView::hide() setSelfVisible(false); - if (isParentVisible() && platformPluginWidget()) - platformPluginWidget()->setVisible(false); - Widget::hide(); } @@ -347,9 +339,6 @@ void PluginView::setParentVisible(bool visible) return; Widget::setParentVisible(visible); - - if (isSelfVisible() && platformPluginWidget()) - platformPluginWidget()->setVisible(visible); } void PluginView::setNPWindowRect(const IntRect&) diff --git a/src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp b/src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp index 4982d08..5aa8933 100644 --- a/src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp +++ b/src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp @@ -459,7 +459,6 @@ void PluginView::init() if (m_needsXEmbed) { setPlatformWidget(new QX11EmbedContainer(m_parentFrame->view()->hostWindow()->platformWindow())); - setIsNPAPIPlugin(true); } else { notImplemented(); m_status = PluginStatusCanNotLoadPlugin; diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.h index f4c368a..4e832bb 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.h +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebdatabase.h @@ -26,7 +26,7 @@ namespace WebCore { class DatabaseDetails; -}; +} class QWebDatabasePrivate; class QWebSecurityOrigin; diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp index ae71356..5dc6363 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp @@ -534,6 +534,8 @@ void QWebFrame::load(const QNetworkRequest &req, Sets the content of this frame to \a html. \a baseUrl is optional and used to resolve relative URLs in the document, such as referenced images or stylesheets. + The \a html is loaded immediately; external objects are loaded asynchronously. + When using this method WebKit assumes that external resources such as JavaScript programs or style sheets are encoded in UTF-8 unless otherwise specified. For example, the encoding of an external script can be specified through the charset attribute of the HTML script tag. It is also possible @@ -558,6 +560,8 @@ void QWebFrame::setHtml(const QString &html, const QUrl &baseUrl) External objects referenced in the content are located relative to \a baseUrl. + The \a data is loaded immediately; external objects are loaded asynchronously. + \sa toHtml() */ void QWebFrame::setContent(const QByteArray &data, const QString &mimeType, const QUrl &baseUrl) diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp index 0e5b5da..e17306d 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp @@ -451,60 +451,35 @@ void QWebPagePrivate::updateAction(QWebPage::WebAction action) case QWebPage::Reload: enabled = !loader->isLoading(); break; - case QWebPage::Cut: - enabled = editor->canCut(); - break; - case QWebPage::Copy: - enabled = editor->canCopy(); - break; - case QWebPage::Paste: - enabled = editor->canPaste(); - break; #ifndef QT_NO_UNDOSTACK case QWebPage::Undo: case QWebPage::Redo: // those two are handled by QUndoStack break; #endif // QT_NO_UNDOSTACK - case QWebPage::MoveToNextChar: - case QWebPage::MoveToPreviousChar: - case QWebPage::MoveToNextWord: - case QWebPage::MoveToPreviousWord: - case QWebPage::MoveToNextLine: - case QWebPage::MoveToPreviousLine: - case QWebPage::MoveToStartOfLine: - case QWebPage::MoveToEndOfLine: - case QWebPage::MoveToStartOfBlock: - case QWebPage::MoveToEndOfBlock: - case QWebPage::MoveToStartOfDocument: - case QWebPage::MoveToEndOfDocument: - case QWebPage::SelectNextChar: - case QWebPage::SelectPreviousChar: - case QWebPage::SelectNextWord: - case QWebPage::SelectPreviousWord: - case QWebPage::SelectNextLine: - case QWebPage::SelectPreviousLine: - case QWebPage::SelectStartOfLine: - case QWebPage::SelectEndOfLine: - case QWebPage::SelectStartOfBlock: - case QWebPage::SelectEndOfBlock: - case QWebPage::SelectStartOfDocument: - case QWebPage::SelectEndOfDocument: - case QWebPage::DeleteStartOfWord: - case QWebPage::DeleteEndOfWord: + case QWebPage::SelectAll: // editor command is always enabled + break; case QWebPage::SetTextDirectionDefault: case QWebPage::SetTextDirectionLeftToRight: case QWebPage::SetTextDirectionRightToLeft: - case QWebPage::ToggleBold: - case QWebPage::ToggleItalic: - case QWebPage::ToggleUnderline: - enabled = editor->canEditRichly(); - if (enabled) - checked = editor->command(editorCommandForWebActions(action)).state() != FalseTriState; - else - checked = false; + enabled = editor->canEdit(); + checked = false; + break; + default: { + // see if it's an editor command + const char* commandName = editorCommandForWebActions(action); + + // if it's an editor command, let it's logic determine state + if (commandName) { + Editor::Command command = editor->command(commandName); + enabled = command.isEnabled(); + if (enabled) + checked = command.state() != FalseTriState; + else + checked = false; + } break; - default: break; + } } a->setEnabled(enabled); @@ -558,6 +533,8 @@ void QWebPagePrivate::updateEditorActions() updateAction(QWebPage::ToggleBold); updateAction(QWebPage::ToggleItalic); updateAction(QWebPage::ToggleUnderline); + updateAction(QWebPage::InsertParagraphSeparator); + updateAction(QWebPage::InsertLineSeparator); } void QWebPagePrivate::timerEvent(QTimerEvent *ev) @@ -919,14 +896,14 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev) return; } - if (!ev->preeditString().isEmpty()) { + if (!ev->commitString().isEmpty()) + editor->confirmComposition(ev->commitString()); + else { QString preedit = ev->preeditString(); // ### FIXME: use the provided QTextCharFormat (use color at least) Vector<CompositionUnderline> underlines; underlines.append(CompositionUnderline(0, preedit.length(), Color(0,0,0), false)); editor->setComposition(preedit, underlines, preedit.length(), 0); - } else if (!ev->commitString().isEmpty()) { - editor->confirmComposition(ev->commitString()); } ev->accept(); } @@ -1116,8 +1093,13 @@ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const \enum QWebPage::WebAction This enum describes the types of action which can be performed on the web page. - Actions which are related to text editing, cursor movement, and text selection - only have an effect if \l contentEditable is true. + + Actions only have an effect when they are applicable. The availability of + actions can be be determined by checking \l{QAction::}{enabled()} on the + action returned by \l{QWebPage::}{action()}. + + One method of enabling the text editing, cursor movement, and text selection actions + is by setting \l contentEditable to true. \value NoWebAction No action is triggered. \value OpenLink Open the current link. @@ -1737,6 +1719,9 @@ QAction *QWebPage::action(WebAction action) const case MoveToEndOfDocument: text = tr("Move the cursor to the end of the document"); break; + case SelectAll: + text = tr("Select all"); + break; case SelectNextChar: text = tr("Select to the next character"); break; @@ -1809,6 +1794,13 @@ QAction *QWebPage::action(WebAction action) const text = contextMenuItemTagInspectElement(); break; + case InsertParagraphSeparator: + text = tr("Insert a new paragraph"); + break; + case InsertLineSeparator: + text = tr("Insert a new line"); + break; + case NoWebAction: return 0; } @@ -2336,7 +2328,8 @@ QWebPluginFactory *QWebPage::pluginFactory() const \list \o %Platform% and %Subplatform% are expanded to the windowing system and the operation system. \o %Security% expands to U if SSL is enabled, otherwise N. SSL is enabled if QSslSocket::supportsSsl() returns true. - \o %Locale% is replaced with QLocale::name(). + \o %Locale% is replaced with QLocale::name(). The locale is determined from the view of the QWebPage. If no view is set on the QWebPage, + then a default constructed QLocale is used instead. \o %WebKitVersion% currently expands to 527+ \o %AppVersion% expands to QCoreApplication::applicationName()/QCoreApplication::applicationVersion() if they're set; otherwise defaulting to Qt and the current Qt version. \endlist @@ -2524,7 +2517,7 @@ void QWebPagePrivate::_q_onLoadProgressChanged(int) { \sa bytesReceived() */ quint64 QWebPage::totalBytes() const { - return d->m_bytesReceived; + return d->m_totalBytes; } @@ -2534,7 +2527,7 @@ quint64 QWebPage::totalBytes() const { \sa totalBytes() */ quint64 QWebPage::bytesReceived() const { - return d->m_totalBytes; + return d->m_bytesReceived; } /*! diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.h index ebe4a77..b52194d 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.h +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.h @@ -28,7 +28,7 @@ namespace WebCore { class SecurityOrigin; class ChromeClientQt; -}; +} class QWebSecurityOriginPrivate; class QWebDatabase; diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp index ea503a1..a843eba 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp @@ -289,6 +289,8 @@ void QWebView::load(const QNetworkRequest &request, External objects such as stylesheets or images referenced in the HTML document are located relative to \a baseUrl. + The \a html is loaded immediately; external objects are loaded asynchronously. + When using this method, WebKit assumes that external resources such as JavaScript programs or style sheets are encoded in UTF-8 unless otherwise specified. For example, the encoding of an external script can be specified @@ -309,6 +311,8 @@ void QWebView::setHtml(const QString &html, const QUrl &baseUrl) External objects referenced in the content are located relative to \a baseUrl. + The \a data is loaded immediately; external objects are loaded asynchronously. + \sa load(), setHtml(), QWebFrame::toHtml() */ void QWebView::setContent(const QByteArray &data, const QString &mimeType, const QUrl &baseUrl) diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog index 8e0b50a..5a23200 100644 --- a/src/3rdparty/webkit/WebKit/qt/ChangeLog +++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog @@ -1,3 +1,122 @@ +2009-03-07 Adam Treat <adam.treat@torchmobile.com> + + Reviewed by Cameron Zwarich. + + These methods are clearly returning the wrong values as the two were + returning swapped information. + + * Api/qwebpage.cpp: + (QWebPage::totalBytes): + (QWebPage::bytesReceived): + +2009-04-02 Takumi Asaki <takumi.asaki@nokia.com> + + Reviewed by Simon Hausmann. + + Fix pre-edit handling of text fields with input methods. + + The input method sends an empty preeditString() if all characters of + the preedit should be deleted. So inputMethodEvent() has to use + preeditString() if it's empty. + + * Api/qwebpage.cpp: + (QWebPagePrivate::inputMethodEvent): + +2009-03-30 Simon Hausmann <simon.hausmann@nokia.com> + + Rubber-stamped by Tor Arne Vestbø. + + Document that setHtml/setContent loads only the html/data immediately, not external objects. + + * Api/qwebframe.cpp: + * Api/qwebview.cpp: + +2009-03-26 Simon Hausmann <simon.hausmann@nokia.com> + + Rubber-stamped by Tor Arne Vestbø. + + Fix the documentation of the QLocale usage in userAgentForUrl. + + * Api/qwebpage.cpp: + +2009-03-20 Erik L. Bunce <elbunce@xendom.com> + + Reviewed by Simon Hausmann. + + Fix for InsertParagraphSeparator and InsertLineSeparator so that + QWebPage::action() creates QActions for them. Also make sure they get + updated appropriately. + + * Api/qwebpage.cpp: + (QWebPagePrivate::updateEditorActions): + (QWebPage::action): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::textEditing): + +2009-03-20 Erik L. Bunce <elbunce@xendom.com> + + Reviewed by Tor Arne Vestbø. + + Fix QWebPage::WebActions action states to more closely match when they are + actually applicable and remove erroneous documentation. + + * Most WebActions implemented using editor commands now use the + Editor::Command::isEnabled() to control their availability. + * SelectAll is always enabled (since it's editor command is). + * SetTextDirection{} family of WebActions are available when canEdit() is true + and not just canEditRichly(). + + Fix and clarify documentation about the availability of various web actions. + + * Api/qwebpage.cpp: + (QWebPagePrivate::updateAction): + (QWebPagePrivate::updateEditorActions): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::textSelection): + +2009-03-19 Ariya Hidayat <ariya.hidayat@trolltech.com> + + Reviewed by Simon Hausmann. + + Fixes pedantic compilation in QtWebKit. + + There are no semi-colons after namespace declarations. + + * Api/qwebdatabase.h: + * Api/qwebsecurityorigin.h: + +2009-03-19 David Boddie <dboddie@trolltech.com> + + Reviewed by Simon Hausmann. + + Doc: Removed obsolete warning about Flash and other plugins. + + * Api/qwebsettings.cpp: + +2009-03-19 Paul Olav Tvete <paul.tvete@nokia.com> + + Reviewed by Simon Hausmann. + + Properly escape tooltip text + + ManualTest: http://xkcd.com/554/ + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::setToolTip): + +2009-03-03 Ariya Hidayat <ariya.hidayat@trolltech.com> + + Rubber-stamped by Simon Hausmann. + + [Qt] Create and update the action for SelectAll. + + * Api/qwebpage.cpp: + (QWebPagePrivate::updateAction): + (QWebPagePrivate::updateEditorActions): + (QWebPage::action): + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::textSelection): + 2009-02-25 Kavindra Palaraja <kavindra.palaraja@nokia.com> Reviewed by Simon Hausmann. diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp index 6f2ce3b..fe74fac 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp @@ -106,6 +106,8 @@ private slots: void textSelection(); void textEditing(); + void requestCache(); + private: @@ -879,6 +881,7 @@ void tst_QWebPage::textSelection() QCOMPARE(page->selectedText().trimmed(), QString::fromLatin1("The quick brown fox")); // these actions must exist + QVERIFY(page->action(QWebPage::SelectAll) != 0); QVERIFY(page->action(QWebPage::SelectNextChar) != 0); QVERIFY(page->action(QWebPage::SelectPreviousChar) != 0); QVERIFY(page->action(QWebPage::SelectNextWord) != 0); @@ -906,10 +909,14 @@ void tst_QWebPage::textSelection() QCOMPARE(page->action(QWebPage::SelectStartOfDocument)->isEnabled(), false); QCOMPARE(page->action(QWebPage::SelectEndOfDocument)->isEnabled(), false); + // ..but SelectAll is awalys enabled + QCOMPARE(page->action(QWebPage::SelectAll)->isEnabled(), true); + // make it editable before navigating the cursor page->setContentEditable(true); // here the actions are enabled after contentEditable is true + QCOMPARE(page->action(QWebPage::SelectAll)->isEnabled(), true); QCOMPARE(page->action(QWebPage::SelectNextChar)->isEnabled(), true); QCOMPARE(page->action(QWebPage::SelectPreviousChar)->isEnabled(), true); QCOMPARE(page->action(QWebPage::SelectNextWord)->isEnabled(), true); @@ -951,6 +958,8 @@ void tst_QWebPage::textEditing() QVERIFY(page->action(QWebPage::ToggleBold) != 0); QVERIFY(page->action(QWebPage::ToggleItalic) != 0); QVERIFY(page->action(QWebPage::ToggleUnderline) != 0); + QVERIFY(page->action(QWebPage::InsertParagraphSeparator) != 0); + QVERIFY(page->action(QWebPage::InsertLineSeparator) != 0); // right now they are disabled because contentEditable is false QCOMPARE(page->action(QWebPage::DeleteStartOfWord)->isEnabled(), false); @@ -961,6 +970,8 @@ void tst_QWebPage::textEditing() QCOMPARE(page->action(QWebPage::ToggleBold)->isEnabled(), false); QCOMPARE(page->action(QWebPage::ToggleItalic)->isEnabled(), false); QCOMPARE(page->action(QWebPage::ToggleUnderline)->isEnabled(), false); + QCOMPARE(page->action(QWebPage::InsertParagraphSeparator)->isEnabled(), false); + QCOMPARE(page->action(QWebPage::InsertLineSeparator)->isEnabled(), false); // make it editable before navigating the cursor page->setContentEditable(true); @@ -974,10 +985,38 @@ void tst_QWebPage::textEditing() QCOMPARE(page->action(QWebPage::ToggleBold)->isEnabled(), true); QCOMPARE(page->action(QWebPage::ToggleItalic)->isEnabled(), true); QCOMPARE(page->action(QWebPage::ToggleUnderline)->isEnabled(), true); + QCOMPARE(page->action(QWebPage::InsertParagraphSeparator)->isEnabled(), true); + QCOMPARE(page->action(QWebPage::InsertLineSeparator)->isEnabled(), true); delete page; } +void tst_QWebPage::requestCache() +{ + TestPage page; + QSignalSpy loadSpy(&page, SIGNAL(loadFinished(bool))); + + page.mainFrame()->setUrl(QString("data:text/html,<a href=\"data:text/html,Reached\" target=\"_blank\">Click me</a>")); + QTRY_COMPARE(loadSpy.count(), 1); + QTRY_COMPARE(page.navigations.count(), 1); + + page.mainFrame()->setUrl(QString("data:text/html,<a href=\"data:text/html,Reached\" target=\"_blank\">Click me2</a>")); + QTRY_COMPARE(loadSpy.count(), 2); + QTRY_COMPARE(page.navigations.count(), 2); + + page.triggerAction(QWebPage::Stop); + QVERIFY(page.history()->canGoBack()); + page.triggerAction(QWebPage::Back); + + QTRY_COMPARE(loadSpy.count(), 3); + QTRY_COMPARE(page.navigations.count(), 3); + QCOMPARE(page.navigations.at(0).request.attribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferNetwork).toInt(), + (int)QNetworkRequest::PreferNetwork); + QCOMPARE(page.navigations.at(1).request.attribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferNetwork).toInt(), + (int)QNetworkRequest::PreferNetwork); + QCOMPARE(page.navigations.at(2).request.attribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferNetwork).toInt(), + (int)QNetworkRequest::PreferCache); +} QTEST_MAIN(tst_QWebPage) #include "tst_qwebpage.moc" |