From b351f83fd55250d2e2e4beb38fbb427e0a7c8258 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Tue, 29 Sep 2009 09:46:01 +0100 Subject: Updated TODO list --- src/3rdparty/phonon/mmf/TODO.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/3rdparty/phonon/mmf/TODO.txt b/src/3rdparty/phonon/mmf/TODO.txt index 2c13632..ba15897 100644 --- a/src/3rdparty/phonon/mmf/TODO.txt +++ b/src/3rdparty/phonon/mmf/TODO.txt @@ -3,8 +3,16 @@ TODO list for MMF Phonon backend The following items are in rough order of priority. +* Seeking does not work for video playback +Do we need to pause/stop the CVideoPlayerUtility before calling SetPositionL? This is inconsistent with CMdaAudioPlayerUtility, but may be necessary - needs to be tested on target. + +* Activating full-screen video playback in qmediaplayer causes the app to crash +This may be symptomatic of more general problems with re-sizing / re-positioning video while playing. + * Implement audio effects +* Support for playing "file:" URLs + * Support for network streaming playback The main question here is how best to implement the MIME type detection for streams. The OpenUrlL functions only take a URL, whereas the corresponding OpenFileL functions have overloads for filenames and for open RFile handles. This is because files support random access whereas streams do not. A naieve approach to MIME type detection for streams is as follows; is there a more efficient approach? 1. Open network connection -- cgit v0.12 From 2245698c5cf69704d35478950aac61856a568e33 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Tue, 29 Sep 2009 14:11:34 +0100 Subject: Fixed problem which caused playback to always start at default volume. Volume changes made before playback starts are now correctly propagated. --- src/3rdparty/phonon/mmf/abstractmediaplayer.cpp | 28 +++++++++++++------------ src/3rdparty/phonon/mmf/abstractmediaplayer.h | 1 - src/3rdparty/phonon/mmf/abstractplayer.cpp | 14 ++++++++++++- src/3rdparty/phonon/mmf/abstractplayer.h | 7 ++++++- src/3rdparty/phonon/mmf/dummyplayer.cpp | 10 --------- src/3rdparty/phonon/mmf/dummyplayer.h | 3 --- 6 files changed, 34 insertions(+), 29 deletions(-) diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp index 82dcd7c..b9adbe5 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp @@ -41,7 +41,6 @@ MMF::AbstractMediaPlayer::AbstractMediaPlayer() : , m_error(NoError) , m_playPending(false) , m_tickTimer(new QTimer(this)) - , m_volume(InitialVolume) , m_mmfMaxVolume(NullMaxVolume) { connect(m_tickTimer.data(), SIGNAL(timeout()), this, SLOT(tick())); @@ -53,7 +52,6 @@ MMF::AbstractMediaPlayer::AbstractMediaPlayer(const AbstractPlayer& player) : , m_error(NoError) , m_playPending(false) , m_tickTimer(new QTimer(this)) - , m_volume(InitialVolume) , m_mmfMaxVolume(NullMaxVolume) { connect(m_tickTimer.data(), SIGNAL(timeout()), this, SLOT(tick())); @@ -330,7 +328,7 @@ void MMF::AbstractMediaPlayer::volumeChanged(qreal volume) TRACE_CONTEXT(AbstractMediaPlayer::volumeChanged, EAudioInternal); TRACE_ENTRY("state %d", m_state); - m_volume = volume; + AbstractPlayer::volumeChanged(volume); doVolumeChanged(); TRACE_EXIT_0(); @@ -418,17 +416,21 @@ void MMF::AbstractMediaPlayer::changeState(PrivateState newState) m_state = newState; - // Check whether play() was called while clip was being loaded. If so, - // playback should be started now if ( - LoadingState == oldPhononState - and StoppedState == newPhononState - and m_playPending - ) { - TRACE_0("play was called while loading; starting playback now"); - m_playPending = false; - play(); - } + LoadingState == oldPhononState + and StoppedState == newPhononState + ) { + // Ensure initial volume is set on MMF API before starting playback + doVolumeChanged(); + + // Check whether play() was called while clip was being loaded. If so, + // playback should be started now + if (m_playPending) { + TRACE_0("play was called while loading; starting playback now"); + m_playPending = false; + play(); + } + } TRACE_EXIT_0(); } diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.h b/src/3rdparty/phonon/mmf/abstractmediaplayer.h index e69f325..0487386 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.h +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.h @@ -139,7 +139,6 @@ private: QScopedPointer m_tickTimer; - qreal m_volume; int m_mmfMaxVolume; MediaSource m_source; diff --git a/src/3rdparty/phonon/mmf/abstractplayer.cpp b/src/3rdparty/phonon/mmf/abstractplayer.cpp index 6ed5d51..99393b2 100644 --- a/src/3rdparty/phonon/mmf/abstractplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractplayer.cpp @@ -31,15 +31,17 @@ using namespace Phonon::MMF; MMF::AbstractPlayer::AbstractPlayer() : m_videoOutput(0) + , m_volume(InitialVolume) , m_tickInterval(DefaultTickInterval) , m_transitionTime(0) - , m_prefinishMark(0) + , m_prefinishMark(0) { } MMF::AbstractPlayer::AbstractPlayer(const AbstractPlayer& player) : m_videoOutput(player.m_videoOutput) + , m_volume(player.m_volume) , m_tickInterval(player.tickInterval()) , m_transitionTime(player.transitionTime()) , m_prefinishMark(player.prefinishMark()) @@ -84,6 +86,16 @@ void MMF::AbstractPlayer::setTransitionTime(qint32 time) //----------------------------------------------------------------------------- +// VolumeObserver +//----------------------------------------------------------------------------- + +void MMF::AbstractPlayer::volumeChanged(qreal volume) +{ + m_volume = volume; +} + + +//----------------------------------------------------------------------------- // Video output //----------------------------------------------------------------------------- diff --git a/src/3rdparty/phonon/mmf/abstractplayer.h b/src/3rdparty/phonon/mmf/abstractplayer.h index 72d0a3b..f28322e 100644 --- a/src/3rdparty/phonon/mmf/abstractplayer.h +++ b/src/3rdparty/phonon/mmf/abstractplayer.h @@ -86,6 +86,9 @@ public: virtual void setFileSource(const Phonon::MediaSource&, RFile&) = 0; virtual void setNextSource(const Phonon::MediaSource &) = 0; + // VolumeObserver + virtual void volumeChanged(qreal volume); + void setVideoOutput(VideoOutput* videoOutput); Q_SIGNALS: @@ -105,7 +108,9 @@ private: protected: // Not owned VideoOutput* m_videoOutput; - + + qreal m_volume; + private: qint32 m_tickInterval; qint32 m_transitionTime; diff --git a/src/3rdparty/phonon/mmf/dummyplayer.cpp b/src/3rdparty/phonon/mmf/dummyplayer.cpp index dc55af7..688199a 100644 --- a/src/3rdparty/phonon/mmf/dummyplayer.cpp +++ b/src/3rdparty/phonon/mmf/dummyplayer.cpp @@ -115,16 +115,6 @@ void MMF::DummyPlayer::setNextSource(const MediaSource &) //----------------------------------------------------------------------------- -// VolumeObserver -//----------------------------------------------------------------------------- - -void MMF::DummyPlayer::volumeChanged(qreal) -{ - -} - - -//----------------------------------------------------------------------------- // AbstractPlayer //----------------------------------------------------------------------------- diff --git a/src/3rdparty/phonon/mmf/dummyplayer.h b/src/3rdparty/phonon/mmf/dummyplayer.h index b2725df..3b66f1a 100644 --- a/src/3rdparty/phonon/mmf/dummyplayer.h +++ b/src/3rdparty/phonon/mmf/dummyplayer.h @@ -62,9 +62,6 @@ public: virtual void setFileSource(const Phonon::MediaSource&, RFile&); virtual void setNextSource(const MediaSource &source); - // VolumeObserver - virtual void volumeChanged(qreal volume); - // AbstractPlayer virtual void doSetTickInterval(qint32 interval); -- cgit v0.12 From d34bbd852241fcd9ddf50c961b5e234f9de0b5ac Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Tue, 29 Sep 2009 14:26:58 +0100 Subject: Fixed seek during video playback --- src/3rdparty/phonon/mmf/TODO.txt | 3 --- src/3rdparty/phonon/mmf/mmf_videoplayer.cpp | 14 +++++++++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/3rdparty/phonon/mmf/TODO.txt b/src/3rdparty/phonon/mmf/TODO.txt index ba15897..a2b1865 100644 --- a/src/3rdparty/phonon/mmf/TODO.txt +++ b/src/3rdparty/phonon/mmf/TODO.txt @@ -3,9 +3,6 @@ TODO list for MMF Phonon backend The following items are in rough order of priority. -* Seeking does not work for video playback -Do we need to pause/stop the CVideoPlayerUtility before calling SetPositionL? This is inconsistent with CMdaAudioPlayerUtility, but may be necessary - needs to be tested on target. - * Activating full-screen video playback in qmediaplayer causes the app to crash This may be symptomatic of more general problems with re-sizing / re-positioning video while playing. diff --git a/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp b/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp index 8a38b76..64e6568 100644 --- a/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp +++ b/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp @@ -147,10 +147,22 @@ void MMF::VideoPlayer::doStop() void MMF::VideoPlayer::doSeek(qint64 ms) { TRACE_CONTEXT(VideoPlayer::doSeek, EVideoApi); + + bool wasPlaying = false; + if(state() == PlayingState) { + // The call to SetPositionL does not have any effect if playback is + // ongoing, so we pause before seeking. + doPause(); + wasPlaying = true; + } TRAPD(err, m_player->SetPositionL(TTimeIntervalMicroSeconds(ms * 1000))); - if (KErrNone != err) { + if(KErrNone == err) { + if(wasPlaying) + doPlay(); + } + else { TRACE("SetPositionL error %d", err); setError(NormalError); } -- cgit v0.12 From a9ea6e24db0e25ec8c84c9a29356aac999421d07 Mon Sep 17 00:00:00 2001 From: Frans Englich Date: Tue, 29 Sep 2009 10:40:42 +0200 Subject: Changes for fixing media object. This brings tst_MediaObject to 15/7, from previously not running. Changes involves: * Skipping .qrc related tests * Loading/mimetype detction from file:/ URIs * State fixes * As part of previous point, move state and error handling down in AbstractPlayer. --- src/3rdparty/phonon/mmf/abstractmediaplayer.cpp | 140 +++++++----------------- src/3rdparty/phonon/mmf/abstractmediaplayer.h | 45 +------- src/3rdparty/phonon/mmf/abstractplayer.cpp | 59 ++++++++++ src/3rdparty/phonon/mmf/abstractplayer.h | 46 +++++++- src/3rdparty/phonon/mmf/dummyplayer.cpp | 3 + src/3rdparty/phonon/mmf/dummyplayer.h | 2 + src/3rdparty/phonon/mmf/mediaobject.cpp | 40 +++---- tests/auto/mediaobject/tst_mediaobject.cpp | 7 +- 8 files changed, 177 insertions(+), 165 deletions(-) diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp index 82dcd7c..e8f8a67 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp @@ -16,6 +16,8 @@ along with this library. If not, see . */ +#include + #include "abstractmediaplayer.h" #include "defs.h" #include "utils.h" @@ -37,9 +39,7 @@ const int NullMaxVolume = -1; //----------------------------------------------------------------------------- MMF::AbstractMediaPlayer::AbstractMediaPlayer() : - m_state(GroundState) - , m_error(NoError) - , m_playPending(false) + m_playPending(false) , m_tickTimer(new QTimer(this)) , m_volume(InitialVolume) , m_mmfMaxVolume(NullMaxVolume) @@ -49,8 +49,6 @@ MMF::AbstractMediaPlayer::AbstractMediaPlayer() : MMF::AbstractMediaPlayer::AbstractMediaPlayer(const AbstractPlayer& player) : AbstractPlayer(player) - , m_state(GroundState) - , m_error(NoError) , m_playPending(false) , m_tickTimer(new QTimer(this)) , m_volume(InitialVolume) @@ -59,12 +57,6 @@ MMF::AbstractMediaPlayer::AbstractMediaPlayer(const AbstractPlayer& player) : connect(m_tickTimer.data(), SIGNAL(timeout()), this, SLOT(tick())); } -MMF::AbstractMediaPlayer::~AbstractMediaPlayer() -{ - -} - - //----------------------------------------------------------------------------- // MediaObjectInterface //----------------------------------------------------------------------------- @@ -72,12 +64,11 @@ MMF::AbstractMediaPlayer::~AbstractMediaPlayer() void MMF::AbstractMediaPlayer::play() { TRACE_CONTEXT(AbstractMediaPlayer::play, EAudioApi); - TRACE_ENTRY("state %d", m_state); + TRACE_ENTRY("state %d", privateState()); - switch (m_state) { + switch (privateState()) { case GroundState: - m_error = NormalError; - changeState(ErrorState); + setError(NormalError); break; case LoadingState: @@ -102,25 +93,25 @@ void MMF::AbstractMediaPlayer::play() TRACE_PANIC(InvalidStatePanic); } - TRACE_EXIT("state %d", m_state); + TRACE_EXIT("state %d", privateState()); } void MMF::AbstractMediaPlayer::pause() { TRACE_CONTEXT(AbstractMediaPlayer::pause, EAudioApi); - TRACE_ENTRY("state %d", m_state); + TRACE_ENTRY("state %d", privateState()); m_playPending = false; - switch (m_state) { + switch (privateState()) { case GroundState: case LoadingState: - case StoppedState: case PausedState: case ErrorState: // Do nothing break; + case StoppedState: case PlayingState: case BufferingState: doPause(); @@ -133,17 +124,17 @@ void MMF::AbstractMediaPlayer::pause() TRACE_PANIC(InvalidStatePanic); } - TRACE_EXIT("state %d", m_state); + TRACE_EXIT("state %d", privateState()); } void MMF::AbstractMediaPlayer::stop() { TRACE_CONTEXT(AbstractMediaPlayer::stop, EAudioApi); - TRACE_ENTRY("state %d", m_state); + TRACE_ENTRY("state %d", privateState()); m_playPending = false; - switch (m_state) { + switch (privateState()) { case GroundState: case LoadingState: case StoppedState: @@ -164,7 +155,7 @@ void MMF::AbstractMediaPlayer::stop() TRACE_PANIC(InvalidStatePanic); } - TRACE_EXIT("state %d", m_state); + TRACE_EXIT("state %d", privateState()); } void MMF::AbstractMediaPlayer::seek(qint64 ms) @@ -172,7 +163,7 @@ void MMF::AbstractMediaPlayer::seek(qint64 ms) TRACE_CONTEXT(AbstractMediaPlayer::seek, EAudioApi); TRACE_ENTRY("state %d pos %Ld", state(), ms); - switch (m_state) { + switch (privateState()) { // Fallthrough all these case GroundState: case StoppedState: @@ -208,32 +199,13 @@ bool MMF::AbstractMediaPlayer::isSeekable() const void MMF::AbstractMediaPlayer::doSetTickInterval(qint32 interval) { TRACE_CONTEXT(AbstractMediaPlayer::doSetTickInterval, EAudioApi); - TRACE_ENTRY("state %d m_interval %d interval %d", m_state, tickInterval(), interval); + TRACE_ENTRY("state %d m_interval %d interval %d", privateState(), tickInterval(), interval); m_tickTimer->setInterval(interval); TRACE_EXIT_0(); } -Phonon::ErrorType MMF::AbstractMediaPlayer::errorType() const -{ - const Phonon::ErrorType result = (ErrorState == m_state) - ? m_error : NoError; - return result; -} - -QString MMF::AbstractMediaPlayer::errorString() const -{ - // TODO: put in proper error strings - QString result; - return result; -} - -Phonon::State MMF::AbstractMediaPlayer::state() const -{ - return phononState(m_state); -} - MediaSource MMF::AbstractMediaPlayer::source() const { return m_source; @@ -242,7 +214,7 @@ MediaSource MMF::AbstractMediaPlayer::source() const void MMF::AbstractMediaPlayer::setFileSource(const MediaSource &source, RFile& file) { TRACE_CONTEXT(AbstractMediaPlayer::setFileSource, EAudioApi); - TRACE_ENTRY("state %d source.type %d", m_state, source.type()); + TRACE_ENTRY("state %d source.type %d", privateState(), source.type()); close(); changeState(GroundState); @@ -255,25 +227,22 @@ void MMF::AbstractMediaPlayer::setFileSource(const MediaSource &source, RFile& f switch (m_source.type()) { case MediaSource::LocalFile: { - // TODO: work out whose responsibility it is to ensure that paths - // are Symbian-style, i.e. have backslashes for path delimiters. - // Until then, use this utility function... - //const QHBufC filename = Utils::symbianFilename(m_source.fileName()); - //TRAP(symbianErr, m_player->OpenFileL(*filename)); - - // Open using shared filehandle - // This is a temporary hack to work around KErrInUse from MMF - // client utility OpenFileL calls - //TRAP(symbianErr, m_player->OpenFileL(file)); - symbianErr = openFile(file); break; } case MediaSource::Url: { - TRACE_0("Source type not supported"); - // TODO: support opening URLs - symbianErr = KErrNotSupported; + const QUrl url(source.url()); + + if (url.scheme() == QLatin1String("file")) { + symbianErr = openFile(file); + } + else { + TRACE_0("Source type not supported"); + // TODO: support network URLs + symbianErr = KErrNotSupported; + } + break; } @@ -298,10 +267,7 @@ void MMF::AbstractMediaPlayer::setFileSource(const MediaSource &source, RFile& f changeState(LoadingState); } else { TRACE("error %d", symbianErr) - - // TODO: do something with the value of symbianErr? - m_error = NormalError; - changeState(ErrorState); + setError(NormalError); } TRACE_EXIT_0(); @@ -310,7 +276,7 @@ void MMF::AbstractMediaPlayer::setFileSource(const MediaSource &source, RFile& f void MMF::AbstractMediaPlayer::setNextSource(const MediaSource &source) { TRACE_CONTEXT(AbstractMediaPlayer::setNextSource, EAudioApi); - TRACE_ENTRY("state %d", m_state); + TRACE_ENTRY("state %d", privateState()); // TODO: handle 'next source' @@ -328,7 +294,7 @@ void MMF::AbstractMediaPlayer::setNextSource(const MediaSource &source) void MMF::AbstractMediaPlayer::volumeChanged(qreal volume) { TRACE_CONTEXT(AbstractMediaPlayer::volumeChanged, EAudioInternal); - TRACE_ENTRY("state %d", m_state); + TRACE_ENTRY("state %d", privateState()); m_volume = volume; doVolumeChanged(); @@ -339,7 +305,7 @@ void MMF::AbstractMediaPlayer::volumeChanged(qreal volume) void MMF::AbstractMediaPlayer::doVolumeChanged() { - switch (m_state) { + switch (privateState()) { case GroundState: case LoadingState: case ErrorState: @@ -353,8 +319,7 @@ void MMF::AbstractMediaPlayer::doVolumeChanged() const int err = setDeviceVolume(m_volume * m_mmfMaxVolume); if (KErrNone != err) { - m_error = NormalError; - changeState(ErrorState); + setError(NormalError); } break; } @@ -387,36 +352,26 @@ void MMF::AbstractMediaPlayer::maxVolumeChanged(int mmfMaxVolume) doVolumeChanged(); } -Phonon::State MMF::AbstractMediaPlayer::phononState() const -{ - return phononState(m_state); -} - -Phonon::State MMF::AbstractMediaPlayer::phononState(PrivateState state) +qint64 MMF::AbstractMediaPlayer::toMilliSeconds(const TTimeIntervalMicroSeconds &in) { - const Phonon::State phononState = - GroundState == state - ? Phonon::LoadingState - : static_cast(state); - - return phononState; + return in.Int64() / 1000; } void MMF::AbstractMediaPlayer::changeState(PrivateState newState) { - TRACE_CONTEXT(AbstractMediaPlayer::changeState, EAudioInternal); - TRACE_ENTRY("state %d newState %d", m_state, newState); + TRACE_CONTEXT(AbstractPlayer::changeState, EAudioInternal); + TRACE_ENTRY("state %d newState %d", privateState(), newState); // TODO: add some invariants to check that the transition is valid - const Phonon::State oldPhononState = phononState(m_state); + const Phonon::State oldPhononState = phononState(privateState()); const Phonon::State newPhononState = phononState(newState); if (oldPhononState != newPhononState) { TRACE("emit stateChanged(%d, %d)", newPhononState, oldPhononState); emit stateChanged(newPhononState, oldPhononState); } - m_state = newState; + setState(newState); // Check whether play() was called while clip was being loaded. If so, // playback should be started now @@ -433,23 +388,6 @@ void MMF::AbstractMediaPlayer::changeState(PrivateState newState) TRACE_EXIT_0(); } -void MMF::AbstractMediaPlayer::setError(Phonon::ErrorType error) -{ - TRACE_CONTEXT(AbstractMediaPlayer::setError, EAudioInternal); - TRACE_ENTRY("state %d error %d", m_state, error); - - m_error = error; - changeState(ErrorState); - - TRACE_EXIT_0(); -} - -qint64 MMF::AbstractMediaPlayer::toMilliSeconds(const TTimeIntervalMicroSeconds &in) -{ - return in.Int64() / 1000; -} - - //----------------------------------------------------------------------------- // Slots //----------------------------------------------------------------------------- diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.h b/src/3rdparty/phonon/mmf/abstractmediaplayer.h index e69f325..20109ef 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.h +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.h @@ -45,7 +45,6 @@ class AbstractMediaPlayer : public AbstractPlayer protected: AbstractMediaPlayer(); explicit AbstractMediaPlayer(const AbstractPlayer& player); - ~AbstractMediaPlayer(); public: // MediaObjectInterface @@ -54,9 +53,6 @@ public: virtual void stop(); virtual void seek(qint64 milliseconds); virtual bool isSeekable() const; - virtual Phonon::ErrorType errorType() const; - virtual QString errorString() const; - virtual Phonon::State state() const; virtual MediaSource source() const; virtual void setFileSource(const Phonon::MediaSource&, RFile&); virtual void setNextSource(const MediaSource &source); @@ -76,45 +72,17 @@ protected: virtual int openFile(RFile& file) = 0; virtual void close() = 0; + /** + * Changes state and emits stateChanged() + */ + virtual void changeState(PrivateState newState); + protected: bool tickTimerRunning() const; void startTickTimer(); void stopTickTimer(); void maxVolumeChanged(int maxVolume); - /** - * Defined private state enumeration in order to add GroundState - */ - enum PrivateState { - LoadingState = Phonon::LoadingState, - StoppedState = Phonon::StoppedState, - PlayingState = Phonon::PlayingState, - BufferingState = Phonon::BufferingState, - PausedState = Phonon::PausedState, - ErrorState = Phonon::ErrorState, - GroundState - }; - - /** - * Converts PrivateState into the corresponding Phonon::State - */ - Phonon::State phononState() const; - - /** - * Converts PrivateState into the corresponding Phonon::State - */ - static Phonon::State phononState(PrivateState state); - - /** - * Changes state and emits stateChanged() - */ - void changeState(PrivateState newState); - - /** - * Records error and changes state to ErrorState - */ - void setError(Phonon::ErrorType error); - static qint64 toMilliSeconds(const TTimeIntervalMicroSeconds &); private: @@ -127,9 +95,6 @@ private Q_SLOTS: void tick(); private: - PrivateState m_state; - Phonon::ErrorType m_error; - /** * This flag is set to true if play is called when the object is * in a Loading state. Once loading is complete, playback will diff --git a/src/3rdparty/phonon/mmf/abstractplayer.cpp b/src/3rdparty/phonon/mmf/abstractplayer.cpp index 6ed5d51..0d97272 100644 --- a/src/3rdparty/phonon/mmf/abstractplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractplayer.cpp @@ -18,6 +18,7 @@ along with this library. If not, see . #include "abstractplayer.h" #include "defs.h" +#include "utils.h" QT_BEGIN_NAMESPACE @@ -31,6 +32,8 @@ using namespace Phonon::MMF; MMF::AbstractPlayer::AbstractPlayer() : m_videoOutput(0) + , m_state(GroundState) + , m_error(NoError) , m_tickInterval(DefaultTickInterval) , m_transitionTime(0) , m_prefinishMark(0) @@ -40,6 +43,8 @@ MMF::AbstractPlayer::AbstractPlayer() MMF::AbstractPlayer::AbstractPlayer(const AbstractPlayer& player) : m_videoOutput(player.m_videoOutput) + , m_state(GroundState) + , m_error(NoError) , m_tickInterval(player.tickInterval()) , m_transitionTime(player.transitionTime()) , m_prefinishMark(player.prefinishMark()) @@ -98,6 +103,60 @@ void MMF::AbstractPlayer::videoOutputChanged() // Default behaviour is empty - overridden by VideoPlayer } +void MMF::AbstractPlayer::setError(Phonon::ErrorType error) +{ + TRACE_CONTEXT(AbstractPlayer::setError, EAudioInternal); + TRACE_ENTRY("state %d error %d", m_state, error); + + m_error = error; + changeState(ErrorState); + + TRACE_EXIT_0(); +} + +Phonon::ErrorType MMF::AbstractPlayer::errorType() const +{ + const Phonon::ErrorType result = (ErrorState == m_state) + ? errorType() : NoError; + return result; +} + +QString MMF::AbstractPlayer::errorString() const +{ + // TODO: put in proper error strings + QString result; + return result; +} + +Phonon::State MMF::AbstractPlayer::phononState() const +{ + return phononState(m_state); +} + +Phonon::State MMF::AbstractPlayer::phononState(PrivateState state) +{ + const Phonon::State phononState = + GroundState == state + ? Phonon::LoadingState + : static_cast(state); + + return phononState; +} + +AbstractPlayer::PrivateState AbstractPlayer::privateState() const +{ + return m_state; +} + +Phonon::State MMF::AbstractPlayer::state() const +{ + return phononState(m_state); +} + +void MMF::AbstractPlayer::setState(PrivateState newState) +{ + m_state = newState; +} QT_END_NAMESPACE diff --git a/src/3rdparty/phonon/mmf/abstractplayer.h b/src/3rdparty/phonon/mmf/abstractplayer.h index 72d0a3b..9f9057d 100644 --- a/src/3rdparty/phonon/mmf/abstractplayer.h +++ b/src/3rdparty/phonon/mmf/abstractplayer.h @@ -75,9 +75,8 @@ public: virtual bool hasVideo() const = 0; virtual bool isSeekable() const = 0; virtual qint64 currentTime() const = 0; - virtual Phonon::State state() const = 0; - virtual QString errorString() const = 0; - virtual Phonon::ErrorType errorType() const = 0; + virtual Phonon::ErrorType errorType() const; + virtual QString errorString() const; virtual qint64 totalTime() const = 0; virtual Phonon::MediaSource source() const = 0; // This is a temporary hack to work around KErrInUse from MMF @@ -88,6 +87,12 @@ public: void setVideoOutput(VideoOutput* videoOutput); + /** + * Records error and changes state to ErrorState + */ + void setError(Phonon::ErrorType error); + + Phonon::State state() const; Q_SIGNALS: void totalTimeChanged(qint64 length); void finished(); @@ -97,8 +102,41 @@ Q_SIGNALS: protected: + /** + * Defined private state enumeration in order to add GroundState + */ + enum PrivateState { + LoadingState = Phonon::LoadingState, + StoppedState = Phonon::StoppedState, + PlayingState = Phonon::PlayingState, + BufferingState = Phonon::BufferingState, + PausedState = Phonon::PausedState, + ErrorState = Phonon::ErrorState, + GroundState + }; + + /** + * Converts PrivateState into the corresponding Phonon::State + */ + Phonon::State phononState() const; + + /** + * Converts PrivateState into the corresponding Phonon::State + */ + static Phonon::State phononState(PrivateState state); + virtual void videoOutputChanged(); + PrivateState privateState() const; + + virtual void changeState(PrivateState newState) = 0; + + /** + * Modifies m_state directly. Typically you want to call changeState(), + * which performs the business logic. + */ + void setState(PrivateState newState); + private: virtual void doSetTickInterval(qint32 interval) = 0; @@ -107,6 +145,8 @@ protected: VideoOutput* m_videoOutput; private: + PrivateState m_state; + Phonon::ErrorType m_error; qint32 m_tickInterval; qint32 m_transitionTime; qint32 m_prefinishMark; diff --git a/src/3rdparty/phonon/mmf/dummyplayer.cpp b/src/3rdparty/phonon/mmf/dummyplayer.cpp index dc55af7..afe4771 100644 --- a/src/3rdparty/phonon/mmf/dummyplayer.cpp +++ b/src/3rdparty/phonon/mmf/dummyplayer.cpp @@ -133,6 +133,9 @@ void MMF::DummyPlayer::doSetTickInterval(qint32) } +void MMF::DummyPlayer::changeState(PrivateState) +{ +} QT_END_NAMESPACE diff --git a/src/3rdparty/phonon/mmf/dummyplayer.h b/src/3rdparty/phonon/mmf/dummyplayer.h index b2725df..52399ba 100644 --- a/src/3rdparty/phonon/mmf/dummyplayer.h +++ b/src/3rdparty/phonon/mmf/dummyplayer.h @@ -68,6 +68,8 @@ public: // AbstractPlayer virtual void doSetTickInterval(qint32 interval); +protected: + virtual void changeState(PrivateState newState); }; } } diff --git a/src/3rdparty/phonon/mmf/mediaobject.cpp b/src/3rdparty/phonon/mmf/mediaobject.cpp index 5a5540c..f9bbb15 100644 --- a/src/3rdparty/phonon/mmf/mediaobject.cpp +++ b/src/3rdparty/phonon/mmf/mediaobject.cpp @@ -28,6 +28,7 @@ along with this library. If not, see . #include "mediaobject.h" #include +#include QT_BEGIN_NAMESPACE @@ -233,6 +234,8 @@ void MMF::MediaObject::createPlayer(const MediaSource &source) const bool oldPlayerHasVideo = oldPlayer->hasVideo(); const bool oldPlayerSeekable = oldPlayer->isSeekable(); + Phonon::ErrorType error = NoError; + // Determine media type switch (source.type()) { case MediaSource::LocalFile: @@ -240,26 +243,22 @@ void MMF::MediaObject::createPlayer(const MediaSource &source) break; case MediaSource::Url: - // TODO: support detection of media type from HTTP streams - TRACE_0("Network streaming not supported yet"); - /* - * TODO: handle error - * - m_error = NormalError; - changeState(ErrorState); - */ + const QUrl url(source.url()); + + if (url.scheme() == QLatin1String("file")) { + mediaType = fileMediaType(url.toLocalFile()); + } + else { + TRACE_0("Network streaming not supported yet"); + error = NormalError; + } break; case MediaSource::Invalid: case MediaSource::Disc: case MediaSource::Stream: TRACE_0("Unsupported media type"); - /* - * TODO: handle error - * - m_error = NormalError; - changeState(ErrorState); - */ + error = NormalError; break; case MediaSource::Empty: @@ -281,12 +280,8 @@ void MMF::MediaObject::createPlayer(const MediaSource &source) } else { newPlayer = new DummyPlayer(); } - /* - * TODO: handle error? - * - m_error = NormalError; - changeState(ErrorState); - */ + + newPlayer->setError(NormalError); break; case MediaTypeAudio: @@ -321,6 +316,11 @@ void MMF::MediaObject::createPlayer(const MediaSource &source) connect(m_player.data(), SIGNAL(finished()), SIGNAL(finished())); connect(m_player.data(), SIGNAL(tick(qint64)), SIGNAL(tick(qint64))); + if (error != NoError ) { + newPlayer = new DummyPlayer(); + newPlayer->setError(error); + } + TRACE_EXIT_0(); } diff --git a/tests/auto/mediaobject/tst_mediaobject.cpp b/tests/auto/mediaobject/tst_mediaobject.cpp index 556e465..16b2611 100644 --- a/tests/auto/mediaobject/tst_mediaobject.cpp +++ b/tests/auto/mediaobject/tst_mediaobject.cpp @@ -89,7 +89,7 @@ const qint64 SEEK_BACKWARDS = 2000; const qint64 ALLOWED_TIME_FOR_SEEKING = 1500; // 1.5s const qint64 SEEKING_TOLERANCE = 250; #else -#if defined(Q_OS_WIN) || defined(Q_OS_MAC) +#if defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(Q_OS_SYMBIAN) #define MEDIA_FILE "/sax.mp3" #define MEDIA_FILEPATH ":/media/sax.mp3" #else @@ -207,6 +207,11 @@ void tst_MediaObject::stateChanged(Phonon::State newstate, Phonon::State oldstat void tst_MediaObject::testPlayFromResource() { +#ifdef Q_OS_SYMBIAN + QSKIP("Not implemented yet.", SkipAll); + return; +#endif + QFile file(MEDIA_FILEPATH); MediaObject media; media.setCurrentSource(&file); -- cgit v0.12 From f8746c32ceba5ae6d82dc88058f7570c2c9e6102 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 30 Sep 2009 10:30:29 +0300 Subject: Added sql driver deployment for qsqldriver autotest in Symbian. The sqlite driver is required to run this autotest, and using cetest requires that all plugins are deployed with deployment statements. Reviewed-by: TrustMe --- tests/auto/qsqldriver/qsqldriver.pro | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/auto/qsqldriver/qsqldriver.pro b/tests/auto/qsqldriver/qsqldriver.pro index 84f1cb2..7f289a6 100644 --- a/tests/auto/qsqldriver/qsqldriver.pro +++ b/tests/auto/qsqldriver/qsqldriver.pro @@ -15,3 +15,11 @@ wince*: { LIBS += ws2_32.lib } } + +symbian { + contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { + sqlite.path = /sys/bin + sqlite.sources = sqlite3.dll + DEPLOYMENT += sqlite + } +} -- cgit v0.12 From 526aaab0ff8a1f4b878c224d54d11e565d345996 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Wed, 30 Sep 2009 08:37:24 +0100 Subject: Fixed compilation error and one warning, when building with RVCT --- src/3rdparty/phonon/mmf/abstractplayer.cpp | 4 ++-- src/3rdparty/phonon/mmf/abstractplayer.h | 2 +- src/3rdparty/phonon/mmf/mediaobject.cpp | 17 +++++++++-------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/3rdparty/phonon/mmf/abstractplayer.cpp b/src/3rdparty/phonon/mmf/abstractplayer.cpp index 62fccef..24ef20a 100644 --- a/src/3rdparty/phonon/mmf/abstractplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractplayer.cpp @@ -32,9 +32,9 @@ using namespace Phonon::MMF; MMF::AbstractPlayer::AbstractPlayer() : m_videoOutput(0) + , m_volume(InitialVolume) , m_state(GroundState) , m_error(NoError) - , m_volume(InitialVolume) , m_tickInterval(DefaultTickInterval) , m_transitionTime(0) , m_prefinishMark(0) @@ -44,9 +44,9 @@ MMF::AbstractPlayer::AbstractPlayer() MMF::AbstractPlayer::AbstractPlayer(const AbstractPlayer& player) : m_videoOutput(player.m_videoOutput) + , m_volume(player.m_volume) , m_state(GroundState) , m_error(NoError) - , m_volume(player.m_volume) , m_tickInterval(player.tickInterval()) , m_transitionTime(player.transitionTime()) , m_prefinishMark(player.prefinishMark()) diff --git a/src/3rdparty/phonon/mmf/abstractplayer.h b/src/3rdparty/phonon/mmf/abstractplayer.h index 276a47d..ec39ab1 100644 --- a/src/3rdparty/phonon/mmf/abstractplayer.h +++ b/src/3rdparty/phonon/mmf/abstractplayer.h @@ -147,7 +147,7 @@ protected: // Not owned VideoOutput* m_videoOutput; - qreal m_volume; + qreal m_volume; private: PrivateState m_state; diff --git a/src/3rdparty/phonon/mmf/mediaobject.cpp b/src/3rdparty/phonon/mmf/mediaobject.cpp index f9bbb15..0591e05 100644 --- a/src/3rdparty/phonon/mmf/mediaobject.cpp +++ b/src/3rdparty/phonon/mmf/mediaobject.cpp @@ -243,14 +243,15 @@ void MMF::MediaObject::createPlayer(const MediaSource &source) break; case MediaSource::Url: - const QUrl url(source.url()); - - if (url.scheme() == QLatin1String("file")) { - mediaType = fileMediaType(url.toLocalFile()); - } - else { - TRACE_0("Network streaming not supported yet"); - error = NormalError; + { + const QUrl url(source.url()); + if (url.scheme() == QLatin1String("file")) { + mediaType = fileMediaType(url.toLocalFile()); + } + else { + TRACE_0("Network streaming not supported yet"); + error = NormalError; + } } break; -- cgit v0.12 From 0c695b73f5bbc9122c8d3c61b883fa3f7fec7900 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 29 Sep 2009 11:49:53 +0200 Subject: fix string builder for QT_NO_CAST_FROM_ASCII on Windows Reviewed-by: thiago --- src/corelib/tools/qstringbuilder.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qstringbuilder.h b/src/corelib/tools/qstringbuilder.h index e1a0e06..efa39b5 100644 --- a/src/corelib/tools/qstringbuilder.h +++ b/src/corelib/tools/qstringbuilder.h @@ -198,6 +198,17 @@ template struct QConcatenable } }; +template struct QConcatenable +{ + typedef const char type[N]; + static int size(const char[N]) { return N - 1; } + static inline void appendTo(const char a[N], QChar *&out) + { + for (int i = 0; i < N - 1; ++i) + *out++ = QLatin1Char(a[i]); + } +}; + template <> struct QConcatenable { typedef char const *type; @@ -241,7 +252,7 @@ template QStringBuilder::type, typename QConcatenable::type> operator%(const A &a, const B &b) { - return QStringBuilder(a, b); + return QStringBuilder::type, typename QConcatenable::type>(a, b); } #ifdef QT_USE_FAST_OPERATOR_PLUS @@ -249,7 +260,7 @@ template QStringBuilder::type, typename QConcatenable::type> operator+(const A &a, const B &b) { - return QStringBuilder(a, b); + return QStringBuilder::type, typename QConcatenable::type>(a, b); } #endif -- cgit v0.12 From 4b4bea046f3a7e26f1c4bff97065a06b2d7f9dc1 Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Wed, 30 Sep 2009 10:24:02 +0200 Subject: Fix the sub-attaq menu (new game and quit). Now QStateMachine can be a child of a QState but here in sub-attaq the code was not design for that so the code breaks. Task-number:QT-665 Task-number:QT-914 Reviewed-by:TrustMe --- demos/sub-attaq/states.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/demos/sub-attaq/states.cpp b/demos/sub-attaq/states.cpp index 10c173e..7443ae7 100644 --- a/demos/sub-attaq/states.cpp +++ b/demos/sub-attaq/states.cpp @@ -67,6 +67,8 @@ PlayState::PlayState(GraphicsScene *scene, QState *parent) PlayState::~PlayState() { + if (machine) + delete machine; } void PlayState::onEntry(QEvent *) @@ -74,13 +76,15 @@ void PlayState::onEntry(QEvent *) //We are now playing? if (machine) { machine->stop(); + //we hide the information + scene->textInformationItem->hide(); scene->clearScene(); currentLevel = 0; score = 0; delete machine; } - machine = new QStateMachine(this); + machine = new QStateMachine; //This state is when player is playing LevelState *levelState = new LevelState(scene, this, machine); -- cgit v0.12 From 9c11d47d3d966bdb2e896e1347e22007c7922893 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Wed, 30 Sep 2009 10:35:59 +0200 Subject: Fix linking on windows, building qt in namespace RevBy: Thiago Macieira --- src/script/api/qscriptengine.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index ee25239..9604fff 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -1606,6 +1606,9 @@ QScriptValue QScriptEngine::newFunction(QScriptEngine::FunctionSignature fun, } #ifndef QT_NO_REGEXP + +extern QString qt_regexp_toCanonical(const QString &, QRegExp::PatternSyntax); + /*! Creates a QtScript object of class RegExp with the given \a regexp. @@ -1620,7 +1623,6 @@ QScriptValue QScriptEngine::newRegExp(const QRegExp ®exp) JSC::ArgList args(buf, sizeof(buf)); //convert the pattern to a ECMAScript pattern - extern QString qt_regexp_toCanonical(const QString &, QRegExp::PatternSyntax); QString pattern = qt_regexp_toCanonical(regexp.pattern(), regexp.patternSyntax()); if (regexp.isMinimal()) { QString ecmaPattern; -- cgit v0.12 From 5dfb58af381739e66422711f799d550eefc2dfbf Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Wed, 30 Sep 2009 10:33:01 +0200 Subject: Updated JavaScriptCore from /home/khansen/dev/qtwebkit to jsc-for-qtscript-4.6-staging-30092009 ( e8f42cf0203bee0ba89a05e0e773d713782129b4 ) --- .../javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp | 2 +- src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp | 9 +++++++-- src/3rdparty/javascriptcore/VERSION | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp index 4200023..76c8510 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.cpp @@ -3084,6 +3084,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi #else newCallFrame->init(0, vPC + 5, scopeChain, callFrame, dst, argCount, asObject(v)); #endif + Register* thisRegister = newCallFrame->registers() - RegisterFile::CallFrameHeaderSize - argCount; ArgList args(thisRegister + 1, argCount - 1); @@ -3242,7 +3243,6 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi newCallFrame->init(0, vPC + 5, scopeChain, callFrame, dst, argCount, asObject(v)); #endif - Register* thisRegister = newCallFrame->registers() - RegisterFile::CallFrameHeaderSize - argCount; ArgList args(thisRegister + 1, argCount - 1); diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp index 0b147df..08a4493 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp @@ -2429,8 +2429,13 @@ DEFINE_STUB_FUNCTION(int, op_eq) goto start; } - if (src2.isObject()) - return asObject(cell1) == asObject(src2); + if (src2.isObject()) { + return asObject(cell1) == asObject(src2) +#ifdef QT_BUILD_SCRIPT_LIB + || asObject(cell1)->compareToObject(stackFrame.callFrame, asObject(src2)) +#endif + ; + } src1 = asObject(cell1)->toPrimitive(stackFrame.callFrame); CHECK_FOR_EXCEPTION(); goto start; diff --git a/src/3rdparty/javascriptcore/VERSION b/src/3rdparty/javascriptcore/VERSION index ae70d26..edcf898 100644 --- a/src/3rdparty/javascriptcore/VERSION +++ b/src/3rdparty/javascriptcore/VERSION @@ -4,8 +4,8 @@ This is a snapshot of JavaScriptCore from The commit imported was from the - jsc-for-qtscript-4.6-staging-28092009 branch/tag + jsc-for-qtscript-4.6-staging-30092009 branch/tag and has the sha1 checksum - b98dec961e9389ddd5e10d7c4086de9a297cb984 + e8f42cf0203bee0ba89a05e0e773d713782129b4 -- cgit v0.12 From b35bbc064b967c6ec5522fe4e2e76522e92a0a96 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Wed, 30 Sep 2009 10:37:29 +0200 Subject: remove two expected failures The tests now pass after the last update of src/3rdparty/javascriptcore. --- tests/auto/qscriptvalue/tst_qscriptvalue.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp index 2148980..6b64e76 100644 --- a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp +++ b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp @@ -2890,8 +2890,6 @@ void tst_QScriptValue::equals() { QScriptValue ret = compareFun.call(QScriptValue(), QScriptValueList() << qobj1 << qobj2); QVERIFY(ret.isBool()); - if (QT_PREPEND_NAMESPACE(qt_script_isJITEnabled())) - QEXPECT_FAIL("", "With JIT enabled, == on QObject wrappers doesn't work", Continue); QVERIFY(ret.toBool()); ret = compareFun.call(QScriptValue(), QScriptValueList() << qobj1 << qobj3); QVERIFY(ret.isBool()); @@ -2911,8 +2909,6 @@ void tst_QScriptValue::equals() { QScriptValue ret = compareFun.call(QScriptValue(), QScriptValueList() << var1 << var2); QVERIFY(ret.isBool()); - if (QT_PREPEND_NAMESPACE(qt_script_isJITEnabled())) - QEXPECT_FAIL("", "With JIT enabled, == on QVariant wrappers doesn't work", Continue); QVERIFY(ret.toBool()); } } -- cgit v0.12 From 6889622da4d17e5cd97e483deb780d83e3bb4548 Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Wed, 30 Sep 2009 11:37:58 +0300 Subject: Symbian specific fixes to QComboBox Fixes QComboBox edit field geometry in s60style Fixes softkey crash when setting a custom itemview to QComboBox Fixes Symbian keyboard input interval in tst_QComboBox::virtualAutocompletion() Reviewed-by: Sami Merila --- src/gui/styles/qs60style.cpp | 19 ++++++++++--------- src/gui/widgets/qcombobox.cpp | 10 +++------- tests/auto/qcombobox/tst_qcombobox.cpp | 4 ++-- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 1e57167..6bdb79e 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2397,8 +2397,6 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple // lets use spinbox frame here as well, as no combobox specific value available. const int frameThickness = cmb->frame ? pixelMetric(PM_SpinBoxFrameWidth, cmb, widget) : 0; const int buttonWidth = QS60StylePrivate::pixelMetric(QStyle::PM_ButtonIconSize); - const int xposMod = (cmb->rect.x()) + width - buttonMargin - buttonWidth; - const int ypos = cmb->rect.y(); QSize buttonSize; buttonSize.setHeight(qMax(8, (cmb->rect.height()>>1) - frameThickness)); //minimum of 8 pixels @@ -2406,15 +2404,18 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple buttonSize = buttonSize.expandedTo(QApplication::globalStrut()); switch (scontrol) { case SC_ComboBoxArrow: - ret.setRect(xposMod, ypos + buttonMargin, buttonWidth, height - 2*buttonMargin); + ret.setRect( + ret.x() + ret.width() - buttonMargin - buttonWidth, + ret.y() + buttonMargin, + buttonWidth, + height - 2*buttonMargin); break; case SC_ComboBoxEditField: { - const int withFrameX = cmb->rect.x() + cmb->rect.width() - frameThickness - buttonSize.width(); - ret = QRect( - frameThickness, - frameThickness, - withFrameX - frameThickness, - cmb->rect.height() - 2*frameThickness); + ret.setRect( + ret.x() + frameThickness, + ret.y() + frameThickness, + ret.width() - 2*frameThickness - buttonSize.width(), + ret.height() - 2*frameThickness); } break; default: diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp index 61532b9..95ff4c1 100644 --- a/src/gui/widgets/qcombobox.cpp +++ b/src/gui/widgets/qcombobox.cpp @@ -403,8 +403,8 @@ QComboBoxPrivateContainer::QComboBoxPrivateContainer(QAbstractItemView *itemView layout->setMargin(0); #ifdef QT_SOFTKEYS_ENABLED - selectAction = QSoftKeyManager::createKeyedAction(QSoftKeyManager::SelectSoftKey, Qt::Key_Select, itemView); - cancelAction = QSoftKeyManager::createKeyedAction(QSoftKeyManager::CancelSoftKey, Qt::Key_Escape, itemView); + selectAction = QSoftKeyManager::createKeyedAction(QSoftKeyManager::SelectSoftKey, Qt::Key_Select, this); + cancelAction = QSoftKeyManager::createKeyedAction(QSoftKeyManager::CancelSoftKey, Qt::Key_Escape, this); addAction(selectAction); addAction(cancelAction); #endif @@ -534,6 +534,7 @@ void QComboBoxPrivateContainer::setItemView(QAbstractItemView *itemView) this, SLOT(setCurrentIndex(QModelIndex))); disconnect(view, SIGNAL(destroyed()), this, SLOT(viewDestroyed())); + delete view; view = 0; } @@ -571,11 +572,6 @@ void QComboBoxPrivateContainer::setItemView(QAbstractItemView *itemView) this, SLOT(setCurrentIndex(QModelIndex))); connect(view, SIGNAL(destroyed()), this, SLOT(viewDestroyed())); - -#ifdef QT_SOFTKEYS_ENABLED - selectAction->setParent(itemView); - cancelAction->setParent(itemView); -#endif } /*! diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp index 6984a88..e76f0f7 100644 --- a/tests/auto/qcombobox/tst_qcombobox.cpp +++ b/tests/auto/qcombobox/tst_qcombobox.cpp @@ -746,7 +746,7 @@ void tst_QComboBox::virtualAutocompletion() // We need to set the keyboard input interval to a higher value // as the processEvent() call takes too much time, so it restarts // the keyboard search then -#if defined(QT_ARCH_ARM) || defined(QT_ARCH_MIPS) +#if defined(QT_ARCH_ARM) || defined(QT_ARCH_MIPS) || defined(QT_ARCH_SYMBIAN) int oldInterval = QApplication::keyboardInputInterval(); QApplication::setKeyboardInputInterval(1500); #endif @@ -782,7 +782,7 @@ void tst_QComboBox::virtualAutocompletion() QApplication::sendEvent(testWidget, &kr2); qApp->processEvents(); // Process events to trigger autocompletion QTRY_COMPARE(testWidget->currentIndex(), 3); -#if defined(QT_ARCH_ARM) || defined(QT_ARCH_MIPS) +#if defined(QT_ARCH_ARM) || defined(QT_ARCH_MIPS) || defined(QT_ARCH_SYMBIAN) QApplication::setKeyboardInputInterval(oldInterval); #endif } -- cgit v0.12 From 7171983e8c9ca106952ecc09e540da4aab8b8b0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Wed, 30 Sep 2009 12:16:56 +0300 Subject: Ftp example application crashes (due to keypad navigation) Keypad navigation tries to calculate the minimal distance of next widget to the direction of pressed navigation key. This calculation in QWidgetPrivate::widgetInNavigationDirection dies not take into account that some widgets might have focusProxy setup. In the reported case, ignoring focus proxy means that QDialogButtonBox gets the focus and it hands it over to first button in its tab order. Unfortunately, this button is disabled 'Download' button. Now, when Select key is pressed, button action is triggered causing a crash. Solution is to skip widgets that have focus proxies in widgetInNavigationDirection. Task-number: QT-2177 Reviewed-by: Alessandro Portale --- src/gui/kernel/qwidget.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 08fe5b9..e2de148 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -11454,6 +11454,10 @@ QWidget *QWidgetPrivate::widgetInNavigationDirection(Direction direction) QWidget *targetWidget = 0; int shortestDistance = INT_MAX; foreach(QWidget *targetCandidate, QApplication::allWidgets()) { + + if (targetCandidate->focusProxy()) //skip if focus proxy set + continue; + const QRect targetCandidateRect = targetCandidate->rect().translated(targetCandidate->mapToGlobal(QPoint())); if ( targetCandidate != sourceWidget && targetCandidate->focusPolicy() & Qt::TabFocus -- cgit v0.12 From c33c3eab6fc510634f00eb001ce5c5860083ba82 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 29 Sep 2009 17:15:49 +0200 Subject: Stabilize listview test --- tests/auto/qlistview/tst_qlistview.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/auto/qlistview/tst_qlistview.cpp b/tests/auto/qlistview/tst_qlistview.cpp index b51434f..499fb0b 100644 --- a/tests/auto/qlistview/tst_qlistview.cpp +++ b/tests/auto/qlistview/tst_qlistview.cpp @@ -1630,7 +1630,9 @@ void tst_QListView::task254449_draggingItemToNegativeCoordinates() } delegate; list.setItemDelegate(&delegate); - QTest::qWait(200); //makes sure the layout is done + delegate.numPaints = 0; + QTest::qWaitForWindowShown(&list); //makes sure the layout is done + QTRY_VERIFY(delegate.numPaints > 0); const QPoint topLeft(-6, 0); list.setPositionForIndex(topLeft, index); -- cgit v0.12 From bc714d469487856c85a42ecb0ceb540420f3e7cc Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 29 Sep 2009 18:18:26 +0200 Subject: Fixed warning in public header: qcommonstyle.h:87: warning: virtual void QCommonStyle::polish(QPalette&) was hidden qs60style.h:77: warning: by QS60Style::polish Reviewed-by: Jeremy --- src/gui/styles/qs60style.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/styles/qs60style.h b/src/gui/styles/qs60style.h index fd18bc3..6be3197 100644 --- a/src/gui/styles/qs60style.h +++ b/src/gui/styles/qs60style.h @@ -76,6 +76,9 @@ public: void unpolish(QWidget *widget); void polish(QApplication *application); void unpolish(QApplication *application); +#ifndef Q_NO_USING_KEYWORD + using QCommonStyle::polish; +#endif void setStyleProperty(const char *name, const QVariant &value); QVariant styleProperty(const char *name) const; -- cgit v0.12 From 85b4c2a9e4c62a836819baf0669b91a3f30c9a4e Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 30 Sep 2009 10:38:09 +0200 Subject: Stabilize and speedup QGraphicsItem and QGraphicsView and QGraphicsProxyWidget test --- tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 371 ++++++++++----------- .../tst_qgraphicsproxywidget.cpp | 208 +++++------- tests/auto/qgraphicsview/tst_qgraphicsview.cpp | 64 ++-- 3 files changed, 309 insertions(+), 334 deletions(-) diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index d08e74b..ef9fe9e 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -1372,19 +1372,20 @@ void tst_QGraphicsItem::selected_textItem() QGraphicsView view(&scene); view.show(); - QTest::qWait(1000); + QTest::qWaitForWindowShown(&view); + QTest::qWait(20); - QVERIFY(!text->isSelected()); + QTRY_VERIFY(!text->isSelected()); QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(text->mapToScene(0, 0))); - QVERIFY(text->isSelected()); + QTRY_VERIFY(text->isSelected()); text->setSelected(false); text->setTextInteractionFlags(Qt::TextEditorInteraction); QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(text->mapToScene(0, 0))); - QVERIFY(text->isSelected()); + QTRY_VERIFY(text->isSelected()); } void tst_QGraphicsItem::selected_multi() @@ -1416,91 +1417,91 @@ void tst_QGraphicsItem::selected_multi() // Click on item1 QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(item1->scenePos())); - QTest::qWait(200); + QTest::qWait(20); QVERIFY(item1->isSelected()); QVERIFY(!item2->isSelected()); // Click on item2 QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(item2->scenePos())); - QTest::qWait(200); + QTest::qWait(20); QVERIFY(item2->isSelected()); QVERIFY(!item1->isSelected()); // Ctrl-click on item1 QTest::mouseClick(view.viewport(), Qt::LeftButton, Qt::ControlModifier, view.mapFromScene(item1->scenePos())); - QTest::qWait(200); + QTest::qWait(20); QVERIFY(item2->isSelected()); QVERIFY(item1->isSelected()); // Ctrl-click on item1 again QTest::mouseClick(view.viewport(), Qt::LeftButton, Qt::ControlModifier, view.mapFromScene(item1->scenePos())); - QTest::qWait(200); + QTest::qWait(20); QVERIFY(item2->isSelected()); QVERIFY(!item1->isSelected()); // Ctrl-click on item2 QTest::mouseClick(view.viewport(), Qt::LeftButton, Qt::ControlModifier, view.mapFromScene(item2->scenePos())); - QTest::qWait(200); + QTest::qWait(20); QVERIFY(!item2->isSelected()); QVERIFY(!item1->isSelected()); // Click on item1 QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(item1->scenePos())); - QTest::qWait(200); + QTest::qWait(20); QVERIFY(item1->isSelected()); QVERIFY(!item2->isSelected()); // Click on scene QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(0, 0)); - QTest::qWait(200); + QTest::qWait(20); QVERIFY(!item1->isSelected()); QVERIFY(!item2->isSelected()); // Click on item1 QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(item1->scenePos())); - QTest::qWait(200); + QTest::qWait(20); QVERIFY(item1->isSelected()); QVERIFY(!item2->isSelected()); // Ctrl-click on scene QTest::mouseClick(view.viewport(), Qt::LeftButton, Qt::ControlModifier, view.mapFromScene(0, 0)); - QTest::qWait(200); + QTest::qWait(20); QVERIFY(!item1->isSelected()); QVERIFY(!item2->isSelected()); // Click on item1 QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(item1->scenePos())); - QTest::qWait(200); + QTest::qWait(20); QVERIFY(item1->isSelected()); QVERIFY(!item2->isSelected()); // Press on item2 QTest::mousePress(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(item2->scenePos())); - QTest::qWait(200); + QTest::qWait(20); QVERIFY(!item1->isSelected()); QVERIFY(item2->isSelected()); // Release on item2 QTest::mouseRelease(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(item2->scenePos())); - QTest::qWait(200); + QTest::qWait(20); QVERIFY(!item1->isSelected()); QVERIFY(item2->isSelected()); // Click on item1 QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(item1->scenePos())); - QTest::qWait(200); + QTest::qWait(20); QVERIFY(item1->isSelected()); QVERIFY(!item2->isSelected()); // Ctrl-click on item1 QTest::mouseClick(view.viewport(), Qt::LeftButton, Qt::ControlModifier, view.mapFromScene(item1->scenePos())); - QTest::qWait(200); + QTest::qWait(20); QVERIFY(!item1->isSelected()); QVERIFY(!item2->isSelected()); // Ctrl-press on item1 QTest::mousePress(view.viewport(), Qt::LeftButton, Qt::ControlModifier, view.mapFromScene(item1->scenePos())); - QTest::qWait(200); + QTest::qWait(20); QVERIFY(!item1->isSelected()); QVERIFY(!item2->isSelected()); @@ -1508,14 +1509,14 @@ void tst_QGraphicsItem::selected_multi() // Ctrl-move on item1 QMouseEvent event(QEvent::MouseMove, view.mapFromScene(item1->scenePos()) + QPoint(1, 0), Qt::LeftButton, Qt::LeftButton, Qt::ControlModifier); QApplication::sendEvent(view.viewport(), &event); - QTest::qWait(200); + QTest::qWait(20); QVERIFY(!item1->isSelected()); QVERIFY(!item2->isSelected()); } // Release on item1 QTest::mouseRelease(view.viewport(), Qt::LeftButton, Qt::ControlModifier, view.mapFromScene(item1->scenePos())); - QTest::qWait(200); + QTest::qWait(20); QVERIFY(item1->isSelected()); QVERIFY(!item2->isSelected()); @@ -1524,7 +1525,7 @@ void tst_QGraphicsItem::selected_multi() // Ctrl-press on item1 QTest::mousePress(view.viewport(), Qt::LeftButton, Qt::ControlModifier, view.mapFromScene(item1->scenePos())); - QTest::qWait(200); + QTest::qWait(20); QVERIFY(!item1->isSelected()); QVERIFY(!item2->isSelected()); @@ -1532,14 +1533,14 @@ void tst_QGraphicsItem::selected_multi() // Ctrl-move on item1 QMouseEvent event(QEvent::MouseMove, view.mapFromScene(item1->scenePos()) + QPoint(1, 0), Qt::LeftButton, Qt::LeftButton, Qt::ControlModifier); QApplication::sendEvent(view.viewport(), &event); - QTest::qWait(200); + QTest::qWait(20); QVERIFY(item1->isSelected()); QVERIFY(!item2->isSelected()); } // Release on item1 QTest::mouseRelease(view.viewport(), Qt::LeftButton, Qt::ControlModifier, view.mapFromScene(item1->scenePos())); - QTest::qWait(200); + QTest::qWait(20); QVERIFY(item1->isSelected()); QVERIFY(!item2->isSelected()); } @@ -2927,7 +2928,7 @@ void tst_QGraphicsItem::hoverEventsGenerateRepaints() #ifdef Q_WS_X11 qt_x11_wait_for_window_manager(&view); #endif - QTest::qWait(250); + QTest::qWait(20); EventTester *tester = new EventTester; scene.addItem(tester); @@ -3059,7 +3060,8 @@ void tst_QGraphicsItem::childrenBoundingRect() QGraphicsView view(&scene); view.show(); - QTest::qWait(5000); + QTest::qWaitForWindowShown(&view); + QTest::qWait(30); QCOMPARE(parent->childrenBoundingRect(), QRectF(-500, -100, 600, 800)); } @@ -3164,7 +3166,8 @@ void tst_QGraphicsItem::group() QGraphicsView view(&scene); view.show(); - QTest::qWait(250); + QTest::qWaitForWindowShown(&view); + QApplication::processEvents(); QGraphicsItemGroup *group = new QGraphicsItemGroup; group->setSelected(true); @@ -3180,7 +3183,7 @@ void tst_QGraphicsItem::group() QCOMPARE(scene.items().size(), 4); QCOMPARE(scene.items(group->sceneBoundingRect()).size(), 3); - QTest::qWait(250); + QTest::qWait(25); QRectF parent2SceneBoundingRect = parent2->sceneBoundingRect(); group->addToGroup(parent2); @@ -3192,7 +3195,7 @@ void tst_QGraphicsItem::group() QCOMPARE(scene.items().size(), 4); QCOMPARE(scene.items(group->sceneBoundingRect()).size(), 4); - QTest::qWait(250); + QTest::qWait(25); QList newItems; for (int i = 0; i < 100; ++i) { @@ -3372,8 +3375,8 @@ void tst_QGraphicsItem::handlesChildEvents() QGraphicsView view(&scene); view.show(); - - QTest::qWait(1000); + QTest::qWaitForWindowShown(&view); + QTest::qWait(20); // Pull out the items, closest item first QList items = scene.items(scene.itemsBoundingRect()); @@ -3496,14 +3499,14 @@ void tst_QGraphicsItem::handlesChildEvents2() QGraphicsView view(&scene); view.show(); - - QTestEventLoop::instance().enterLoop(1); + QTest::qWaitForWindowShown(&view); + QApplication::processEvents(); QMouseEvent event(QEvent::MouseButtonPress, view.mapFromScene(5, 5), view.viewport()->mapToGlobal(view.mapFromScene(5, 5)), Qt::LeftButton, 0, 0); QApplication::sendEvent(view.viewport(), &event); - QCOMPARE(root->counter, 1); + QTRY_COMPARE(root->counter, 1); } void tst_QGraphicsItem::handlesChildEvents3() @@ -3585,8 +3588,8 @@ void tst_QGraphicsItem::filtersChildEvents() QGraphicsView view(&scene); view.show(); - - QTest::qWait(1000); + QTest::qWaitForWindowShown(&view); + QTest::qWait(20); QGraphicsSceneMouseEvent pressEvent(QEvent::GraphicsSceneMousePress); QGraphicsSceneMouseEvent releaseEvent(QEvent::GraphicsSceneMouseRelease); @@ -3601,7 +3604,7 @@ void tst_QGraphicsItem::filtersChildEvents() QApplication::sendEvent(&scene, &pressEvent); QApplication::sendEvent(&scene, &releaseEvent); - QCOMPARE(child->counter, 1); // mouse release is not filtered + QTRY_COMPARE(child->counter, 1); // mouse release is not filtered QCOMPARE(filter->counter, 1); // mouse press is filtered QCOMPARE(root->counter, 0); @@ -3656,17 +3659,18 @@ void tst_QGraphicsItem::filtersChildEvents2() QGraphicsView view(&scene); view.show(); - QTestEventLoop::instance().enterLoop(1); + QTest::qWaitForWindowShown(&view); + QApplication::processEvents(); QMouseEvent event(QEvent::MouseButtonPress, view.mapFromScene(5, 5), view.viewport()->mapToGlobal(view.mapFromScene(5, 5)), Qt::LeftButton, 0, 0); QApplication::sendEvent(view.viewport(), &event); + QTRY_COMPARE(root->counter, 1); QCOMPARE(child->counter, 0); QCOMPARE(child2->counter, 0); QCOMPARE(child3->counter, 0); QCOMPARE(child4->counter, 0); - QCOMPARE(root->counter, 1); } class CustomItem : public QGraphicsItem @@ -3703,21 +3707,22 @@ void tst_QGraphicsItem::ensureVisible() QGraphicsView view(&scene); view.setFixedSize(300, 300); view.show(); + QTest::qWaitForWindowShown(&view); for (int i = 0; i < 25; ++i) { view.scale(qreal(1.06), qreal(1.06)); - QTest::qWait(25); + QApplication::processEvents(); } item->ensureVisible(-100, -100, 25, 25); - QTest::qWait(250); + QTest::qWait(25); for (int x = -100; x < 100; x += 25) { for (int y = -100; y < 100; y += 25) { int xmargin = rand() % 75; int ymargin = rand() % 75; item->ensureVisible(x, y, 25, 25, xmargin, ymargin); - QTest::qWait(25); + QApplication::processEvents(); QPolygonF viewScenePoly; viewScenePoly << view.mapToScene(view.rect().topLeft()) @@ -3744,7 +3749,7 @@ void tst_QGraphicsItem::ensureVisible() } item->ensureVisible(100, 100, 25, 25); - QTest::qWait(250); + QTest::qWait(25); } void tst_QGraphicsItem::cursor() @@ -3785,7 +3790,7 @@ void tst_QGraphicsItem::cursor() view.show(); QTest::mouseMove(&view, view.rect().center()); - QTest::qWait(250); + QTest::qWait(25); QCursor cursor = view.viewport()->cursor(); @@ -3794,7 +3799,7 @@ void tst_QGraphicsItem::cursor() QApplication::sendEvent(view.viewport(), &event); } - QTest::qWait(250); + QTest::qWait(25); QCOMPARE(view.viewport()->cursor().shape(), cursor.shape()); @@ -3819,7 +3824,7 @@ void tst_QGraphicsItem::cursor() QApplication::sendEvent(view.viewport(), &event); } - QTest::qWait(250); + QTest::qWait(25); QCOMPARE(view.viewport()->cursor().shape(), item2->cursor().shape()); @@ -3829,7 +3834,7 @@ void tst_QGraphicsItem::cursor() QApplication::sendEvent(view.viewport(), &event); } - QTest::qWait(250); + QTest::qWait(25); QCOMPARE(view.viewport()->cursor().shape(), cursor.shape()); #endif @@ -4488,10 +4493,9 @@ void tst_QGraphicsItem::sceneEventFilter() QGraphicsView view(&scene); view.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&view); -#endif - QTest::qWait(250); + QApplication::setActiveWindow(&view); + QTest::qWaitForWindowShown(&view); + QTest::qWait(25); QGraphicsTextItem *text1 = scene.addText(QLatin1String("Text1")); QGraphicsTextItem *text2 = scene.addText(QLatin1String("Text2")); @@ -4503,10 +4507,10 @@ void tst_QGraphicsItem::sceneEventFilter() EventFilterTesterItem *tester = new EventFilterTesterItem; scene.addItem(tester); - QVERIFY(!text1->hasFocus()); + QTRY_VERIFY(!text1->hasFocus()); text1->installSceneEventFilter(tester); text1->setFocus(); - QVERIFY(text1->hasFocus()); + QTRY_VERIFY(text1->hasFocus()); QCOMPARE(tester->filteredEvents.size(), 1); QCOMPARE(tester->filteredEvents.at(0), QEvent::FocusIn); @@ -4554,13 +4558,14 @@ void tst_QGraphicsItem::sceneEventFilter() QGraphicsTextItem *ti3 = anotherScene->addText("This is a test #3"); gv.setScene(anotherScene); gv.show(); - QTest::qWait(250); + QTest::qWaitForWindowShown(&gv); + QTest::qWait(25); ti->installSceneEventFilter(ti2); ti3->installSceneEventFilter(ti); delete ti2; //we souldn't crash QTest::mouseMove(gv.viewport(), gv.mapFromScene(ti->scenePos())); - QTest::qWait(250); + QTest::qWait(30); delete ti; } @@ -4608,10 +4613,8 @@ void tst_QGraphicsItem::paint() QGraphicsView view(&scene); view.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&view); -#endif - QTest::qWait(250); + QTest::qWaitForWindowShown(&view); + QApplication::processEvents(); #ifdef Q_OS_WIN32 //we try to switch the desktop: if it fails, we skip the test if (::SwitchDesktop( ::GetThreadDesktop( ::GetCurrentThreadId() ) ) == 0) { @@ -4619,14 +4622,15 @@ void tst_QGraphicsItem::paint() } #endif - QCOMPARE(paintTester.widget, view.viewport()); + QTRY_COMPARE(paintTester.widget, view.viewport()); view.hide(); QGraphicsScene scene2; QGraphicsView view2(&scene2); view2.show(); - QTest::qWait(250); + QTest::qWaitForWindowShown(&view2); + QTest::qWait(25); PaintTester tester2; scene2.addItem(&tester2); @@ -4638,22 +4642,19 @@ void tst_QGraphicsItem::paint() //nominal case, update call paint tester2.update(); qApp->processEvents(); - QTest::qWait(250); - QVERIFY(tester2.painted == 2); + QTRY_VERIFY(tester2.painted == 2); //we remove the item from the scene, number of updates is still the same tester2.update(); scene2.removeItem(&tester2); qApp->processEvents(); - QTest::qWait(250); - QVERIFY(tester2.painted == 2); + QTRY_VERIFY(tester2.painted == 2); //We re-add the item, the number of paint should increase scene2.addItem(&tester2); tester2.update(); qApp->processEvents(); - QTest::qWait(250); - QVERIFY(tester2.painted == 3); + QTRY_VERIFY(tester2.painted == 3); } class HarakiriItem : public QGraphicsRectItem @@ -5414,6 +5415,8 @@ void tst_QGraphicsItem::untransformable() view.setBackgroundBrush(QBrush(Qt::black, Qt::DiagCrossPattern)); #endif + QTest::qWaitForWindowShown(&view); + for (int i = 0; i < 10; ++i) { QPoint center = view.viewport()->rect().center(); QCOMPARE(view.itemAt(center), item1); @@ -5438,7 +5441,7 @@ void tst_QGraphicsItem::untransformable() view.rotate(13); view.shear(qreal(0.01), qreal(0.01)); view.translate(10, 10); - QTest::qWait(250); + QTest::qWait(25); } } @@ -5474,11 +5477,9 @@ void tst_QGraphicsItem::contextMenuEventPropagation() QGraphicsView view(&scene); view.setAlignment(Qt::AlignLeft | Qt::AlignTop); view.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&view); -#endif view.resize(200, 200); - QTest::qWait(250); + QTest::qWaitForWindowShown(&view); + QTest::qWait(20); QContextMenuEvent event(QContextMenuEvent::Mouse, QPoint(10, 10), view.viewport()->mapToGlobal(QPoint(10, 10))); @@ -5579,15 +5580,16 @@ void tst_QGraphicsItem::task141694_textItemEnsureVisible() QGraphicsView view(&scene); view.setFixedSize(200, 200); view.show(); + QTest::qWaitForWindowShown(&view); view.ensureVisible(-1000, -1000, 5, 5); int hscroll = view.horizontalScrollBar()->value(); int vscroll = view.verticalScrollBar()->value(); - QTestEventLoop::instance().enterLoop(1); + QTest::qWait(10); // This should not cause the view to scroll - QCOMPARE(view.horizontalScrollBar()->value(), hscroll); + QTRY_COMPARE(view.horizontalScrollBar()->value(), hscroll); QCOMPARE(view.verticalScrollBar()->value(), vscroll); } @@ -5752,16 +5754,17 @@ void tst_QGraphicsItem::ensureUpdateOnTextItem() QGraphicsScene scene; QGraphicsView view(&scene); view.show(); - QTest::qWait(250); + QTest::qWaitForWindowShown(&view); + QTest::qWait(25); TextItem *text1 = new TextItem(QLatin1String("123")); scene.addItem(text1); qApp->processEvents(); - QCOMPARE(text1->updates,1); + QTRY_COMPARE(text1->updates,1); //same bouding rect but we have to update text1->setText(QLatin1String("321")); - QTest::qWait(250); - QCOMPARE(text1->updates,2); + qApp->processEvents(); + QTRY_COMPARE(text1->updates,2); } void tst_QGraphicsItem::task243707_addChildBeforeParent() @@ -6049,10 +6052,8 @@ void tst_QGraphicsItem::opacity2() MyGraphicsView view(&scene); view.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&view); -#endif - QTest::qWait(250); + QTest::qWaitForWindowShown(&view); + QTRY_COMPARE(view.repaints, 1); #define RESET_REPAINT_COUNTERS \ parent->repaints = 0; \ @@ -6063,8 +6064,8 @@ void tst_QGraphicsItem::opacity2() RESET_REPAINT_COUNTERS child->setOpacity(0.0); - QTest::qWait(100); - QCOMPARE(view.repaints, 1); + QTest::qWait(10); + QTRY_COMPARE(view.repaints, 1); QCOMPARE(parent->repaints, 1); QCOMPARE(child->repaints, 0); QCOMPARE(grandChild->repaints, 0); @@ -6072,8 +6073,8 @@ void tst_QGraphicsItem::opacity2() RESET_REPAINT_COUNTERS child->setOpacity(1.0); - QTest::qWait(100); - QCOMPARE(view.repaints, 1); + QTest::qWait(10); + QTRY_COMPARE(view.repaints, 1); QCOMPARE(parent->repaints, 1); QCOMPARE(child->repaints, 1); QCOMPARE(grandChild->repaints, 1); @@ -6081,8 +6082,8 @@ void tst_QGraphicsItem::opacity2() RESET_REPAINT_COUNTERS parent->setOpacity(0.0); - QTest::qWait(100); - QCOMPARE(view.repaints, 1); + QTest::qWait(10); + QTRY_COMPARE(view.repaints, 1); QCOMPARE(parent->repaints, 0); QCOMPARE(child->repaints, 0); QCOMPARE(grandChild->repaints, 0); @@ -6090,8 +6091,8 @@ void tst_QGraphicsItem::opacity2() RESET_REPAINT_COUNTERS parent->setOpacity(1.0); - QTest::qWait(100); - QCOMPARE(view.repaints, 1); + QTest::qWait(10); + QTRY_COMPARE(view.repaints, 1); QCOMPARE(parent->repaints, 1); QCOMPARE(child->repaints, 1); QCOMPARE(grandChild->repaints, 1); @@ -6100,8 +6101,8 @@ void tst_QGraphicsItem::opacity2() RESET_REPAINT_COUNTERS child->setOpacity(0.0); - QTest::qWait(100); - QCOMPARE(view.repaints, 1); + QTest::qWait(10); + QTRY_COMPARE(view.repaints, 1); QCOMPARE(parent->repaints, 1); QCOMPARE(child->repaints, 0); QCOMPARE(grandChild->repaints, 1); @@ -6109,8 +6110,8 @@ void tst_QGraphicsItem::opacity2() RESET_REPAINT_COUNTERS child->setOpacity(0.0); // Already 0.0; no change. - QTest::qWait(100); - QCOMPARE(view.repaints, 0); + QTest::qWait(10); + QTRY_COMPARE(view.repaints, 0); QCOMPARE(parent->repaints, 0); QCOMPARE(child->repaints, 0); QCOMPARE(grandChild->repaints, 0); @@ -6142,15 +6143,13 @@ void tst_QGraphicsItem::opacityZeroUpdates() MyGraphicsView view(&scene); view.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&view); -#endif - QTest::qWait(250); + QTest::qWaitForWindowShown(&view); + QTRY_VERIFY(view.repaints > 0); view.reset(); parent->setOpacity(0.0); - QTest::qWait(200); + QTest::qWait(20); // transforming items bounding rect to view coordinates const QRect childDeviceBoundingRect = child->deviceTransform(view.viewportTransform()) @@ -6161,7 +6160,7 @@ void tst_QGraphicsItem::opacityZeroUpdates() QRegion expectedRegion = parentDeviceBoundingRect.adjusted(-2, -2, 2, 2); expectedRegion += childDeviceBoundingRect.adjusted(-2, -2, 2, 2); - QCOMPARE(view.paintedRegion, expectedRegion); + QTRY_COMPARE(view.paintedRegion, expectedRegion); } class StacksBehindParentHelper : public QGraphicsRectItem @@ -6217,15 +6216,12 @@ void tst_QGraphicsItem::itemStacksBehindParent() QGraphicsView view(&scene); view.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&view); -#endif - QTest::qWait(250); + QTest::qWaitForWindowShown(&view); + QTest::qWait(100); paintedItems.clear(); view.viewport()->update(); - QTest::qWait(100); - - QCOMPARE(scene.items(0, 0, 100, 100), (QList() + QApplication::processEvents(); + QTRY_COMPARE(scene.items(0, 0, 100, 100), (QList() << grandChild111 << child11 << grandChild121 << child12 << parent1 << grandChild211 << child21 @@ -6239,9 +6235,9 @@ void tst_QGraphicsItem::itemStacksBehindParent() child11->setFlag(QGraphicsItem::ItemStacksBehindParent); scene.update(); paintedItems.clear(); - QTest::qWait(250); + QApplication::processEvents(); - QCOMPARE(scene.items(0, 0, 100, 100), (QList() + QTRY_COMPARE(scene.items(0, 0, 100, 100), (QList() << grandChild121 << child12 << parent1 << grandChild111 << child11 << grandChild211 << child21 @@ -6255,9 +6251,9 @@ void tst_QGraphicsItem::itemStacksBehindParent() child12->setFlag(QGraphicsItem::ItemStacksBehindParent); paintedItems.clear(); scene.update(); - QTest::qWait(250); + QApplication::processEvents(); - QCOMPARE(scene.items(0, 0, 100, 100), (QList() + QTRY_COMPARE(scene.items(0, 0, 100, 100), (QList() << parent1 << grandChild111 << child11 << grandChild121 << child12 << grandChild211 << child21 @@ -6503,31 +6499,29 @@ void tst_QGraphicsItem::tabChangesFocus() QWidget widget; widget.setLayout(layout); widget.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&widget); -#endif - QTest::qWait(250); - QVERIFY(scene.isActive()); + QTest::qWaitForWindowShown(&widget); + + QTRY_VERIFY(scene.isActive()); dial1->setFocus(); - QTest::qWait(125); - QVERIFY(dial1->hasFocus()); + QTest::qWait(15); + QTRY_VERIFY(dial1->hasFocus()); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); - QVERIFY(view->hasFocus()); - QVERIFY(item->hasFocus()); + QTest::qWait(15); + QTRY_VERIFY(view->hasFocus()); + QTRY_VERIFY(item->hasFocus()); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); + QTest::qWait(15); if (tabChangesFocus) { - QVERIFY(!view->hasFocus()); - QVERIFY(!item->hasFocus()); - QVERIFY(dial2->hasFocus()); + QTRY_VERIFY(!view->hasFocus()); + QTRY_VERIFY(!item->hasFocus()); + QTRY_VERIFY(dial2->hasFocus()); } else { - QVERIFY(view->hasFocus()); - QVERIFY(item->hasFocus()); + QTRY_VERIFY(view->hasFocus()); + QTRY_VERIFY(item->hasFocus()); QCOMPARE(item->toPlainText(), QString("\tHello")); } } @@ -6538,12 +6532,12 @@ void tst_QGraphicsItem::cacheMode() QGraphicsView view(&scene); view.resize(150, 150); view.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&view); -#endif + QApplication::setActiveWindow(&view); + QTest::qWaitForWindowShown(&view); + // Increase the probability of window activation // not causing another repaint of test items. - QTest::qWait(250); + QTest::qWait(50); EventTester *tester = new EventTester; EventTester *testerChild = new EventTester; @@ -6553,24 +6547,24 @@ void tst_QGraphicsItem::cacheMode() testerChild2->setFlag(QGraphicsItem::ItemIgnoresTransformations); scene.addItem(tester); - QTest::qWait(250); + QTest::qWait(10); for (int i = 0; i < 2; ++i) { // No visual change. - QCOMPARE(tester->repaints, 1); + QTRY_COMPARE(tester->repaints, 1); QCOMPARE(testerChild->repaints, 1); QCOMPARE(testerChild2->repaints, 1); tester->setCacheMode(QGraphicsItem::NoCache); testerChild->setCacheMode(QGraphicsItem::NoCache); testerChild2->setCacheMode(QGraphicsItem::NoCache); - QTest::qWait(250); - QCOMPARE(tester->repaints, 1); + QTest::qWait(25); + QTRY_COMPARE(tester->repaints, 1); QCOMPARE(testerChild->repaints, 1); QCOMPARE(testerChild2->repaints, 1); tester->setCacheMode(QGraphicsItem::DeviceCoordinateCache); testerChild->setCacheMode(QGraphicsItem::DeviceCoordinateCache); testerChild2->setCacheMode(QGraphicsItem::DeviceCoordinateCache); - QTest::qWait(250); + QTest::qWait(25); } // The first move causes a repaint as the item is painted into its pixmap. @@ -6578,8 +6572,8 @@ void tst_QGraphicsItem::cacheMode() tester->setPos(10, 10); testerChild->setPos(10, 10); testerChild2->setPos(10, 10); - QTest::qWait(250); - QCOMPARE(tester->repaints, 2); + QTest::qWait(25); + QTRY_COMPARE(tester->repaints, 2); QCOMPARE(testerChild->repaints, 2); QCOMPARE(testerChild2->repaints, 2); @@ -6594,15 +6588,15 @@ void tst_QGraphicsItem::cacheMode() // Translating does not result in a repaint. tester->translate(10, 10); - QTest::qWait(250); - QCOMPARE(tester->repaints, 2); + QTest::qWait(25); + QTRY_COMPARE(tester->repaints, 2); QCOMPARE(testerChild->repaints, 2); QCOMPARE(testerChild2->repaints, 2); // Rotating results in a repaint. tester->rotate(45); - QTest::qWait(250); - QCOMPARE(tester->repaints, 3); + QTest::qWait(25); + QTRY_COMPARE(tester->repaints, 3); QCOMPARE(testerChild->repaints, 3); QCOMPARE(testerChild2->repaints, 2); @@ -6610,8 +6604,8 @@ void tst_QGraphicsItem::cacheMode() tester->setCacheMode(QGraphicsItem::ItemCoordinateCache); // autosize testerChild->setCacheMode(QGraphicsItem::ItemCoordinateCache); // autosize testerChild2->setCacheMode(QGraphicsItem::ItemCoordinateCache); // autosize - QTest::qWait(250); - QCOMPARE(tester->repaints, 4); + QTest::qWait(25); + QTRY_COMPARE(tester->repaints, 4); QCOMPARE(testerChild->repaints, 4); QCOMPARE(testerChild2->repaints, 3); @@ -6619,30 +6613,30 @@ void tst_QGraphicsItem::cacheMode() tester->rotate(22); testerChild->rotate(22); testerChild2->rotate(22); - QTest::qWait(250); - QCOMPARE(tester->repaints, 4); + QTest::qWait(25); + QTRY_COMPARE(tester->repaints, 4); QCOMPARE(testerChild->repaints, 4); QCOMPARE(testerChild2->repaints, 3); // Explicit update causes a repaint. tester->update(0, 0, 5, 5); - QTest::qWait(250); - QCOMPARE(tester->repaints, 5); + QTest::qWait(25); + QTRY_COMPARE(tester->repaints, 5); QCOMPARE(testerChild->repaints, 4); QCOMPARE(testerChild2->repaints, 3); // Updating outside the item's bounds does not cause a repaint. tester->update(10, 10, 5, 5); - QTest::qWait(250); - QCOMPARE(tester->repaints, 5); + QTest::qWait(25); + QTRY_COMPARE(tester->repaints, 5); QCOMPARE(testerChild->repaints, 4); QCOMPARE(testerChild2->repaints, 3); // Resizing an item should cause a repaint of that item. (because of // autosize). tester->setGeometry(QRectF(-15, -15, 30, 30)); - QTest::qWait(250); - QCOMPARE(tester->repaints, 6); + QTest::qWait(25); + QTRY_COMPARE(tester->repaints, 6); QCOMPARE(testerChild->repaints, 4); QCOMPARE(testerChild2->repaints, 3); @@ -6650,22 +6644,22 @@ void tst_QGraphicsItem::cacheMode() tester->setCacheMode(QGraphicsItem::ItemCoordinateCache, QSize(30, 30)); testerChild->setCacheMode(QGraphicsItem::ItemCoordinateCache, QSize(30, 30)); testerChild2->setCacheMode(QGraphicsItem::ItemCoordinateCache, QSize(30, 30)); - QTest::qWait(250); - QCOMPARE(tester->repaints, 7); + QTest::qWait(20); + QTRY_COMPARE(tester->repaints, 7); QCOMPARE(testerChild->repaints, 5); QCOMPARE(testerChild2->repaints, 4); // Resizing the item should cause a repaint. testerChild->setGeometry(QRectF(-15, -15, 30, 30)); - QTest::qWait(250); - QCOMPARE(tester->repaints, 7); + QTest::qWait(25); + QTRY_COMPARE(tester->repaints, 7); QCOMPARE(testerChild->repaints, 6); QCOMPARE(testerChild2->repaints, 4); // Scaling the view does not cause a repaint. view.scale(0.7, 0.7); - QTest::qWait(250); - QCOMPARE(tester->repaints, 7); + QTest::qWait(25); + QTRY_COMPARE(tester->repaints, 7); QCOMPARE(testerChild->repaints, 6); QCOMPARE(testerChild2->repaints, 4); @@ -6673,54 +6667,54 @@ void tst_QGraphicsItem::cacheMode() tester->setCacheMode(QGraphicsItem::DeviceCoordinateCache); testerChild->setCacheMode(QGraphicsItem::DeviceCoordinateCache); testerChild2->setCacheMode(QGraphicsItem::DeviceCoordinateCache); - QTest::qWait(250); - QCOMPARE(tester->repaints, 8); + QTest::qWait(25); + QTRY_COMPARE(tester->repaints, 8); QCOMPARE(testerChild->repaints, 7); QCOMPARE(testerChild2->repaints, 5); // Scaling the view back should cause repaints for two of the items. view.setTransform(QTransform()); - QTest::qWait(250); - QCOMPARE(tester->repaints, 9); + QTest::qWait(25); + QTRY_COMPARE(tester->repaints, 9); QCOMPARE(testerChild->repaints, 8); QCOMPARE(testerChild2->repaints, 5); // Rotating the base item (perspective) should repaint two items. tester->setTransform(QTransform().rotate(10, Qt::XAxis)); - QTest::qWait(250); - QCOMPARE(tester->repaints, 10); + QTest::qWait(25); + QTRY_COMPARE(tester->repaints, 10); QCOMPARE(testerChild->repaints, 9); QCOMPARE(testerChild2->repaints, 5); // Moving the middle item should case a repaint even if it's a move, // because the parent is rotated with a perspective. testerChild->setPos(1, 1); - QTest::qWait(250); - QCOMPARE(tester->repaints, 10); + QTest::qWait(25); + QTRY_COMPARE(tester->repaints, 10); QCOMPARE(testerChild->repaints, 10); QCOMPARE(testerChild2->repaints, 5); // Make a huge item tester->setGeometry(QRectF(-4000, -4000, 8000, 8000)); - QTest::qWait(250); - QCOMPARE(tester->repaints, 11); + QTest::qWait(25); + QTRY_COMPARE(tester->repaints, 11); QCOMPARE(testerChild->repaints, 10); QCOMPARE(testerChild2->repaints, 5); // Move the large item - will cause a repaint as the // cache is clipped. tester->setPos(5, 0); - QTest::qWait(250); - QCOMPARE(tester->repaints, 12); + QTest::qWait(25); + QTRY_COMPARE(tester->repaints, 12); QCOMPARE(testerChild->repaints, 10); QCOMPARE(testerChild2->repaints, 5); // Hiding and showing should invalidate the cache tester->hide(); - QTest::qWait(250); + QTest::qWait(25); tester->show(); - QTest::qWait(250); - QCOMPARE(tester->repaints, 13); + QTest::qWait(25); + QTRY_COMPARE(tester->repaints, 13); QCOMPARE(testerChild->repaints, 11); QCOMPARE(testerChild2->repaints, 6); } @@ -6739,30 +6733,30 @@ void tst_QGraphicsItem::updateCachedItemAfterMove() view.show(); QTest::qWaitForWindowShown(&view); - QTest::qWait(125); + QTest::qWait(12); QTRY_VERIFY(tester->repaints > 0); tester->repaints = 0; // Move the item, should not cause repaints tester->setPos(10, 0); - QTest::qWait(125); + QTest::qWait(12); QCOMPARE(tester->repaints, 0); // Move then update, should cause one repaint tester->setPos(20, 0); tester->update(); - QTest::qWait(125); + QTest::qWait(12); QCOMPARE(tester->repaints, 1); // Hiding the item doesn't cause a repaint tester->hide(); - QTest::qWait(125); + QTest::qWait(12); QCOMPARE(tester->repaints, 1); // Moving a hidden item doesn't cause a repaint tester->setPos(30, 0); tester->update(); - QTest::qWait(125); + QTest::qWait(12); QCOMPARE(tester->repaints, 1); } @@ -7177,17 +7171,17 @@ void tst_QGraphicsItem::itemUsesExtendedStyleOption() QGraphicsView view(&scene); rect->startTrack = false; view.show(); - QTest::qWait(500); + QTest::qWaitForWindowShown(&view); rect->startTrack = true; rect->update(10, 10, 10, 10); - QTest::qWait(125); + QTest::qWait(12); rect->startTrack = false; rect->setFlag(QGraphicsItem::ItemUsesExtendedStyleOption, true); QVERIFY((rect->flags() & QGraphicsItem::ItemUsesExtendedStyleOption)); - QTest::qWait(125); + QTest::qWait(12); rect->startTrack = true; rect->update(10, 10, 10, 10); - QTest::qWait(125); + QTest::qWait(12); } void tst_QGraphicsItem::itemSendsGeometryChanges() @@ -7379,10 +7373,8 @@ void tst_QGraphicsItem::itemHasNoContents() QGraphicsView view(&scene); view.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&view); -#endif - QTest::qWait(100); + QTest::qWaitForWindowShown(&view); + QTRY_VERIFY(!_paintedItems.isEmpty()); _paintedItems.clear(); @@ -7390,10 +7382,10 @@ void tst_QGraphicsItem::itemHasNoContents() #ifdef Q_WS_MAC // There's no difference between update() and repaint() on the Mac, // so we have to process events here to make sure we get the event. - QTest::qWait(100); + QTest::qWait(10); #endif - QCOMPARE(_paintedItems, QList() << item2); + QTRY_COMPARE(_paintedItems, QList() << item2); } void tst_QGraphicsItem::hitTestUntransformableItem() @@ -8474,9 +8466,10 @@ void tst_QGraphicsItem::QTBUG_4233_updateCachedWithSceneRect() QGraphicsView view(&scene); view.show(); + QTest::qWaitForWindowShown(&view); QTRY_COMPARE(QApplication::activeWindow(), (QWidget *)&view); - QCOMPARE(tester->repaints, 1); + QTRY_COMPARE(tester->repaints, 1); scene.update(); // triggers "updateAll" optimization qApp->processEvents(); diff --git a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp index a289257..5c0073c 100644 --- a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp +++ b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp @@ -783,11 +783,9 @@ void tst_QGraphicsProxyWidget::focusNextPrevChild() QGraphicsScene scene; QGraphicsView view(&scene); view.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&view); -#endif QApplication::setActiveWindow(&view); - QTest::qWait(250); + QTest::qWaitForWindowShown(&view); + QApplication::processEvents(); QTRY_COMPARE(QApplication::activeWindow(), &view); if (hasScene) { scene.addItem(proxy); @@ -832,13 +830,11 @@ void tst_QGraphicsProxyWidget::focusOutEvent() SubQGraphicsProxyWidget *proxy = new SubQGraphicsProxyWidget; scene.addItem(proxy); view.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&view); -#endif QApplication::setActiveWindow(&view); view.activateWindow(); view.setFocus(); - QTest::qWait(125); + QTest::qWaitForWindowShown(&view); + QApplication::processEvents(); QTRY_VERIFY(view.isVisible()); QTRY_COMPARE(QApplication::activeWindow(), &view); @@ -856,11 +852,10 @@ void tst_QGraphicsProxyWidget::focusOutEvent() if (!call) { QWidget *other = new QLineEdit(&view); other->show(); - QTest::qWait(125); + QApplication::processEvents(); QTRY_VERIFY(other->isVisible()); other->setFocus(); QTRY_VERIFY(other->hasFocus()); - QTest::qWait(125); qApp->processEvents(); QTRY_COMPARE(proxy->hasFocus(), false); QVERIFY(proxy->focusOut); @@ -992,7 +987,7 @@ void tst_QGraphicsProxyWidget::hoverEnterLeaveEvent() // in QTest::mouseMove(&view, QPoint(50, 50)); - QTest::qWait(250); + QTest::qWait(25); QTRY_COMPARE(widget->testAttribute(Qt::WA_UnderMouse), hasWidget ? true : false); // ### this attribute isn't supported QCOMPARE(widget->enterCount, hasWidget ? 1 : 0); @@ -1002,7 +997,7 @@ void tst_QGraphicsProxyWidget::hoverEnterLeaveEvent() // out QTest::mouseMove(&view, QPoint(10, 10)); - QTest::qWait(250); + QTest::qWait(25); // QTRY_COMPARE(widget->testAttribute(Qt::WA_UnderMouse), false); // ### this attribute isn't supported QCOMPARE(widget->leaveCount, hasWidget ? 1 : 0); @@ -1067,14 +1062,14 @@ void tst_QGraphicsProxyWidget::hoverMoveEvent() // in QTest::mouseMove(&view, QPoint(50, 50)); - QTest::qWait(125); + QTest::qWait(12); if (mouseDown) QTest::mousePress(view.viewport(), Qt::LeftButton); // move a little bit QTest::mouseMove(&view, QPoint(60, 60)); - QTest::qWait(125); + QTest::qWait(12); QTRY_COMPARE(widget->hoverEnter, (hasWidget && hoverEnabled) ? 1 : 0); QCOMPARE(widget->moveCount, (hasWidget && mouseTracking) || (hasWidget && mouseDown) ? 1 : 0); @@ -1098,11 +1093,9 @@ void tst_QGraphicsProxyWidget::keyPressEvent() QGraphicsView view(&scene); view.show(); view.viewport()->setFocus(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&view); -#endif QApplication::setActiveWindow(&view); - QTest::qWait(250); + QTest::qWaitForWindowShown(&view); + QApplication::processEvents(); QTRY_COMPARE(QApplication::activeWindow(), &view); SubQGraphicsProxyWidget *proxy = new SubQGraphicsProxyWidget; @@ -1142,11 +1135,8 @@ void tst_QGraphicsProxyWidget::keyReleaseEvent() QGraphicsScene scene; QGraphicsView view(&scene); view.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&view); -#endif QApplication::setActiveWindow(&view); - QTest::qWait(250); + QTest::qWaitForWindowShown(&view); QTRY_COMPARE(QApplication::activeWindow(), &view); @@ -1190,7 +1180,7 @@ void tst_QGraphicsProxyWidget::mouseDoubleClickEvent() view.show(); QApplication::setActiveWindow(&view); - QTest::qWait(250); + QTest::qWaitForWindowShown(&view); QTRY_COMPARE(QApplication::activeWindow(), &view); SubQGraphicsProxyWidget *proxy = new SubQGraphicsProxyWidget; @@ -1234,7 +1224,7 @@ void tst_QGraphicsProxyWidget::mousePressReleaseEvent() QGraphicsScene scene; QGraphicsView view(&scene); view.show(); - QTest::qWait(125); + QTest::qWaitForWindowShown(&view); SubQGraphicsProxyWidget *proxy = new SubQGraphicsProxyWidget; proxy->setFlag(QGraphicsItem::ItemIsFocusable, true); // ### remove me!!! @@ -1305,19 +1295,18 @@ void tst_QGraphicsProxyWidget::paintEvent() w->show(); QTest::qWaitForWindowShown(w); - - QTest::qWait(100); + QApplication::processEvents(); proxy.setWidget(w); scene.addItem(&proxy); //make sure we flush all the paint events - QTest::qWait(250); + QApplication::processEvents(); QTRY_VERIFY(proxy.paintCount > 1); proxy.paintCount = 0; w->update(); - QTest::qWait(100); + QApplication::processEvents(); QTRY_COMPARE(proxy.paintCount, 1); //the widget should have been painted now } @@ -1711,24 +1700,21 @@ void tst_QGraphicsProxyWidget::tabFocus_simpleWidget() window.setLayout(layout); window.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&window); -#endif QApplication::setActiveWindow(&window); window.activateWindow(); - QTest::qWait(125); + QTest::qWaitForWindowShown(&window); leftDial->setFocus(); - QTest::qWait(125); + QApplication::processEvents(); QTRY_VERIFY(leftDial->hasFocus()); EventSpy eventSpy(edit); // Tab into line edit QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); - QVERIFY(!leftDial->hasFocus()); - QVERIFY(view->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(!leftDial->hasFocus()); + QTRY_VERIFY(view->hasFocus()); QVERIFY(view->viewport()->hasFocus()); QVERIFY(scene.hasFocus()); QVERIFY(editProxy->hasFocus()); @@ -1738,22 +1724,22 @@ void tst_QGraphicsProxyWidget::tabFocus_simpleWidget() // Tab into right dial QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); - QVERIFY(!view->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(!view->hasFocus()); QVERIFY(!view->viewport()->hasFocus()); QVERIFY(!scene.hasFocus()); QVERIFY(!editProxy->hasFocus()); QVERIFY(!edit->hasFocus()); - QVERIFY(rightDial->hasFocus()); + QTRY_VERIFY(rightDial->hasFocus()); QCOMPARE(eventSpy.counts[QEvent::FocusIn], 1); QCOMPARE(eventSpy.counts[QEvent::FocusOut], 1); // Backtab into line edit QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); - QVERIFY(view->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(view->hasFocus()); QVERIFY(view->viewport()->hasFocus()); - QVERIFY(scene.hasFocus()); + QTRY_VERIFY(scene.hasFocus()); QVERIFY(editProxy->hasFocus()); QVERIFY(edit->hasFocus()); QVERIFY(!rightDial->hasFocus()); @@ -1762,13 +1748,13 @@ void tst_QGraphicsProxyWidget::tabFocus_simpleWidget() // Backtab into left dial QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); - QVERIFY(!view->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(!view->hasFocus()); QVERIFY(!view->viewport()->hasFocus()); QVERIFY(!scene.hasFocus()); QVERIFY(!editProxy->hasFocus()); QVERIFY(!edit->hasFocus()); - QVERIFY(leftDial->hasFocus()); + QTRY_VERIFY(leftDial->hasFocus()); QCOMPARE(eventSpy.counts[QEvent::FocusIn], 2); QCOMPARE(eventSpy.counts[QEvent::FocusOut], 2); } @@ -1796,14 +1782,12 @@ void tst_QGraphicsProxyWidget::tabFocus_simpleTwoWidgets() window.setLayout(layout); window.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&window); -#endif QApplication::setActiveWindow(&window); window.activateWindow(); + QTest::qWaitForWindowShown(&window); leftDial->setFocus(); - QTest::qWait(125); + QApplication::processEvents(); QTRY_VERIFY(leftDial->hasFocus()); EventSpy eventSpy(edit); @@ -1811,7 +1795,7 @@ void tst_QGraphicsProxyWidget::tabFocus_simpleTwoWidgets() // Tab into line edit QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); + QApplication::processEvents(); QVERIFY(!leftDial->hasFocus()); QVERIFY(view->hasFocus()); QVERIFY(view->viewport()->hasFocus()); @@ -1823,7 +1807,7 @@ void tst_QGraphicsProxyWidget::tabFocus_simpleTwoWidgets() // Tab into second line edit QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); + QApplication::processEvents(); QVERIFY(view->hasFocus()); QVERIFY(view->viewport()->hasFocus()); QVERIFY(scene.hasFocus()); @@ -1838,7 +1822,7 @@ void tst_QGraphicsProxyWidget::tabFocus_simpleTwoWidgets() // Tab into right dial QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); + QApplication::processEvents(); QVERIFY(!view->hasFocus()); QVERIFY(!view->viewport()->hasFocus()); QVERIFY(!scene.hasFocus()); @@ -1854,7 +1838,7 @@ void tst_QGraphicsProxyWidget::tabFocus_simpleTwoWidgets() // Backtab into line edit 2 QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); + QApplication::processEvents(); QVERIFY(view->hasFocus()); QVERIFY(view->viewport()->hasFocus()); QVERIFY(scene.hasFocus()); @@ -1870,7 +1854,7 @@ void tst_QGraphicsProxyWidget::tabFocus_simpleTwoWidgets() // Backtab into line edit 1 QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); + QApplication::processEvents(); QVERIFY(view->hasFocus()); QVERIFY(view->viewport()->hasFocus()); QVERIFY(scene.hasFocus()); @@ -1886,7 +1870,7 @@ void tst_QGraphicsProxyWidget::tabFocus_simpleTwoWidgets() // Backtab into left dial QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); + QApplication::processEvents(); QVERIFY(!view->hasFocus()); QVERIFY(!view->viewport()->hasFocus()); QVERIFY(!scene.hasFocus()); @@ -1929,15 +1913,12 @@ void tst_QGraphicsProxyWidget::tabFocus_complexWidget() window.setLayout(layout); window.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&window); -#endif QApplication::setActiveWindow(&window); window.activateWindow(); - QTest::qWait(125); + QTest::qWaitForWindowShown(&window); leftDial->setFocus(); - QTest::qWait(125); + QApplication::processEvents(); QTRY_VERIFY(leftDial->hasFocus()); EventSpy eventSpy(edit1); @@ -1946,7 +1927,7 @@ void tst_QGraphicsProxyWidget::tabFocus_complexWidget() // Tab into group box QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); + QApplication::processEvents(); QVERIFY(!leftDial->hasFocus()); QVERIFY(view->hasFocus()); QVERIFY(view->viewport()->hasFocus()); @@ -1956,7 +1937,7 @@ void tst_QGraphicsProxyWidget::tabFocus_complexWidget() // Tab into line edit QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); + QApplication::processEvents(); edit1->hasFocus(); QVERIFY(!box->hasFocus()); QCOMPARE(eventSpy.counts[QEvent::FocusIn], 1); @@ -1964,7 +1945,7 @@ void tst_QGraphicsProxyWidget::tabFocus_complexWidget() // Tab into line edit 2 QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); + QApplication::processEvents(); edit2->hasFocus(); QVERIFY(!edit1->hasFocus()); QCOMPARE(eventSpy.counts[QEvent::FocusIn], 1); @@ -1974,7 +1955,7 @@ void tst_QGraphicsProxyWidget::tabFocus_complexWidget() // Tab into right dial QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); + QApplication::processEvents(); QVERIFY(!edit2->hasFocus()); rightDial->hasFocus(); QCOMPARE(eventSpy2.counts[QEvent::FocusIn], 1); @@ -1982,7 +1963,7 @@ void tst_QGraphicsProxyWidget::tabFocus_complexWidget() // Backtab into line edit 2 QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); + QApplication::processEvents(); QVERIFY(!rightDial->hasFocus()); edit2->hasFocus(); QCOMPARE(eventSpy2.counts[QEvent::FocusIn], 2); @@ -1990,7 +1971,7 @@ void tst_QGraphicsProxyWidget::tabFocus_complexWidget() // Backtab into line edit 1 QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); + QApplication::processEvents(); QVERIFY(!edit2->hasFocus()); edit1->hasFocus(); QCOMPARE(eventSpy2.counts[QEvent::FocusOut], 2); @@ -1998,14 +1979,14 @@ void tst_QGraphicsProxyWidget::tabFocus_complexWidget() // Backtab into line box QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); + QApplication::processEvents(); QVERIFY(!edit1->hasFocus()); box->hasFocus(); QCOMPARE(eventSpy.counts[QEvent::FocusOut], 2); // Backtab into left dial QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); + QApplication::processEvents(); QVERIFY(!box->hasFocus()); leftDial->hasFocus(); } @@ -2063,16 +2044,13 @@ void tst_QGraphicsProxyWidget::tabFocus_complexTwoWidgets() window.setLayout(layout); window.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&window); -#endif QApplication::setActiveWindow(&window); window.activateWindow(); - QTest::qWait(125); + QTest::qWaitForWindowShown(&window); QTRY_COMPARE(QApplication::activeWindow(), &window); leftDial->setFocus(); - QTest::qWait(125); + QApplication::processEvents(); QTRY_VERIFY(leftDial->hasFocus()); EventSpy eventSpy(edit1); @@ -2083,7 +2061,7 @@ void tst_QGraphicsProxyWidget::tabFocus_complexTwoWidgets() // Tab into group box QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); + QApplication::processEvents(); QVERIFY(!leftDial->hasFocus()); QVERIFY(view->hasFocus()); QVERIFY(view->viewport()->hasFocus()); @@ -2093,7 +2071,7 @@ void tst_QGraphicsProxyWidget::tabFocus_complexTwoWidgets() // Tab into line edit QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); + QApplication::processEvents(); edit1->hasFocus(); QVERIFY(!box->hasFocus()); QCOMPARE(eventSpy.counts[QEvent::FocusIn], 1); @@ -2101,7 +2079,7 @@ void tst_QGraphicsProxyWidget::tabFocus_complexTwoWidgets() // Tab into line edit 2 QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); + QApplication::processEvents(); edit2->hasFocus(); QVERIFY(!edit1->hasFocus()); QCOMPARE(eventSpy.counts[QEvent::FocusIn], 1); @@ -2109,13 +2087,13 @@ void tst_QGraphicsProxyWidget::tabFocus_complexTwoWidgets() // Tab into right box QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); + QApplication::processEvents(); QVERIFY(!edit2->hasFocus()); box_2->hasFocus(); // Tab into right top line edit QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); + QApplication::processEvents(); QVERIFY(!box_2->hasFocus()); edit1_2->hasFocus(); QCOMPARE(eventSpy1_2.counts[QEvent::FocusIn], 1); @@ -2123,7 +2101,7 @@ void tst_QGraphicsProxyWidget::tabFocus_complexTwoWidgets() // Tab into right bottom line edit QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); + QApplication::processEvents(); QVERIFY(!edit1_2->hasFocus()); edit2_2->hasFocus(); QCOMPARE(eventSpy1_2.counts[QEvent::FocusIn], 1); @@ -2133,50 +2111,50 @@ void tst_QGraphicsProxyWidget::tabFocus_complexTwoWidgets() // Tab into right dial QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); + QApplication::processEvents(); QVERIFY(!edit2->hasFocus()); rightDial->hasFocus(); QCOMPARE(eventSpy2_2.counts[QEvent::FocusOut], 1); // Backtab into line edit 2 QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); + QApplication::processEvents(); QVERIFY(!rightDial->hasFocus()); edit2_2->hasFocus(); // Backtab into line edit 1 QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); + QApplication::processEvents(); QVERIFY(!edit2_2->hasFocus()); edit1_2->hasFocus(); // Backtab into line box QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); + QApplication::processEvents(); QVERIFY(!edit1_2->hasFocus()); box_2->hasFocus(); // Backtab into line edit 2 QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); + QApplication::processEvents(); QVERIFY(!rightDial->hasFocus()); edit2->hasFocus(); // Backtab into line edit 1 QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); + QApplication::processEvents(); QVERIFY(!edit2->hasFocus()); edit1->hasFocus(); // Backtab into line box QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); + QApplication::processEvents(); QVERIFY(!edit1->hasFocus()); box->hasFocus(); // Backtab into left dial QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); + QApplication::processEvents(); QVERIFY(!box->hasFocus()); leftDial->hasFocus(); } @@ -2200,16 +2178,13 @@ void tst_QGraphicsProxyWidget::setFocus_simpleWidget() window.setLayout(layout); window.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&window); -#endif QApplication::setActiveWindow(&window); window.activateWindow(); - QTest::qWait(125); + QTest::qWaitForWindowShown(&window); QTRY_COMPARE(QApplication::activeWindow(), &window); leftDial->setFocus(); - QTest::qWait(125); + QApplication::processEvents(); QTRY_VERIFY(leftDial->hasFocus()); EventSpy eventSpy(edit); @@ -2273,16 +2248,13 @@ void tst_QGraphicsProxyWidget::setFocus_simpleTwoWidgets() window.setLayout(layout); window.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&window); -#endif QApplication::setActiveWindow(&window); window.activateWindow(); - QTest::qWait(125); + QTest::qWaitForWindowShown(&window); QTRY_COMPARE(QApplication::activeWindow(), &window); leftDial->setFocus(); - QTest::qWait(125); + QApplication::processEvents(); QTRY_VERIFY(leftDial->hasFocus()); EventSpy eventSpy(edit); @@ -2353,16 +2325,13 @@ void tst_QGraphicsProxyWidget::setFocus_complexTwoWidgets() window.setLayout(layout); window.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&window); -#endif QApplication::setActiveWindow(&window); window.activateWindow(); - QTest::qWait(125); + QTest::qWaitForWindowShown(&window); QTRY_COMPARE(QApplication::activeWindow(), &window); leftDial->setFocus(); - QTest::qWait(125); + QApplication::processEvents(); QTRY_VERIFY(leftDial->hasFocus()); EventSpy eventSpy(edit1); @@ -2377,7 +2346,7 @@ void tst_QGraphicsProxyWidget::setFocus_complexTwoWidgets() QCOMPARE(eventSpy.counts[QEvent::FocusIn], 0); edit1->setFocus(); - QTest::qWait(125); + QApplication::processEvents(); QVERIFY(scene.hasFocus()); QVERIFY(edit1->hasFocus()); QVERIFY(!box->hasFocus()); @@ -2385,7 +2354,7 @@ void tst_QGraphicsProxyWidget::setFocus_complexTwoWidgets() QCOMPARE(eventSpyBox.counts[QEvent::FocusIn], 0); edit2_2->setFocus(); - QTest::qWait(125); + QApplication::processEvents(); QVERIFY(!edit1->hasFocus()); QVERIFY(!box_2->hasFocus()); QVERIFY(edit2_2->hasFocus()); @@ -2396,7 +2365,7 @@ void tst_QGraphicsProxyWidget::setFocus_complexTwoWidgets() QCOMPARE(eventSpyBox_2.counts[QEvent::FocusIn], 0); box->setFocus(); - QTest::qWait(125); + QApplication::processEvents(); QVERIFY(!edit2_2->hasFocus()); QVERIFY(!edit1->hasFocus()); QVERIFY(box->hasFocus()); @@ -2410,7 +2379,7 @@ void tst_QGraphicsProxyWidget::setFocus_complexTwoWidgets() QCOMPARE(eventSpyBox_2.counts[QEvent::FocusOut], 0); edit2_2->setFocus(); - QTest::qWait(125); + QApplication::processEvents(); QVERIFY(edit2_2->hasFocus()); QVERIFY(!edit1->hasFocus()); QVERIFY(!box->hasFocus()); @@ -2447,12 +2416,14 @@ void tst_QGraphicsProxyWidget::popup_basic() QCOMPARE(box->pos(), QPoint()); QCOMPARE(proxy->pos(), QPointF()); + QTest::qWaitForWindowShown(&view); QTest::qWait(125); + QApplication::processEvents(); QTest::mousePress(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(proxy->mapToScene(proxy->boundingRect().center()))); - QTest::qWait(125); + QTest::qWait(12); QCOMPARE(box->pos(), QPoint()); @@ -2467,8 +2438,8 @@ void tst_QGraphicsProxyWidget::popup_basic() QSKIP("Does not work due to SH_Combobox_Popup", SkipAll); QCOMPARE(child->widget()->parent(), static_cast(box)); - QTest::qWait(125); - QCOMPARE(proxy->pos(), QPointF(box->pos())); + QTest::qWait(12); + QTRY_COMPARE(proxy->pos(), QPointF(box->pos())); QCOMPARE(child->x(), qreal(box->x())); QCOMPARE(child->y(), qreal(box->rect().bottom())); #ifndef Q_OS_WIN @@ -2478,7 +2449,7 @@ void tst_QGraphicsProxyWidget::popup_basic() QCOMPARE(child->widget()->y(), box->rect().bottom()); QCOMPARE(child->geometry().toRect(), child->widget()->geometry()); #endif - QTest::qWait(125); + QTest::qWait(12); } void tst_QGraphicsProxyWidget::popup_subwidget() @@ -2544,7 +2515,8 @@ void tst_QGraphicsProxyWidget::changingCursor_basic() proxy->setWidget(widget); proxy->show(); scene.addItem(proxy); - QTest::qWait(125); + QTest::qWaitForWindowShown(&view); + QApplication::processEvents(); // in QTest::mouseMove(view.viewport(), view.mapFromScene(proxy->mapToScene(proxy->boundingRect().center()))); @@ -2653,7 +2625,8 @@ void tst_QGraphicsProxyWidget::childPos() for (int i = 0; i < 2; ++i) { box->showPopup(); - QTest::qWait(50); + QApplication::processEvents(); + QApplication::processEvents(); QWidget *menu = 0; foreach (QObject *child, box->children()) { @@ -2718,7 +2691,7 @@ void tst_QGraphicsProxyWidget::windowOpacity() view.show(); QTest::qWaitForWindowShown(&view); QApplication::sendPostedEvents(); - QTest::qWait(100); + QTest::qWait(50); qRegisterMetaType >("QList"); QSignalSpy signalSpy(&scene, SIGNAL(changed(const QList &))); @@ -2727,7 +2700,7 @@ void tst_QGraphicsProxyWidget::windowOpacity() QVERIFY(widget->isVisible()); widget->setWindowOpacity(0.5); - QTest::qWait(100); + QApplication::processEvents(); // Make sure setWindowOpacity triggers an update on the scene, // and not on the widget or the proxy itself. The entire proxy needs an update @@ -2738,8 +2711,8 @@ void tst_QGraphicsProxyWidget::windowOpacity() #ifdef Q_WS_X11 paints = !X11->use_xrender; #endif - QCOMPARE(eventSpy.counts[QEvent::UpdateRequest], 0); - QCOMPARE(eventSpy.counts[QEvent::Paint], paints); + QTRY_COMPARE(eventSpy.counts[QEvent::UpdateRequest], 0); + QTRY_COMPARE(eventSpy.counts[QEvent::Paint], paints); QCOMPARE(signalSpy.count(), 1); const QList arguments = signalSpy.takeFirst(); @@ -2920,7 +2893,8 @@ void tst_QGraphicsProxyWidget::dontCrashWhenDie() { MainWidget *w = new MainWidget(); w->show(); - QTest::qWait(200); + QTest::qWaitForWindowShown(w); + QTest::qWait(100); QTest::mouseMove(w->view->viewport(), w->view->mapFromScene(w->widget->mapToScene(w->widget->boundingRect().center()))); delete w->item; } diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp index 95a038b..0c27079 100644 --- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp @@ -363,7 +363,7 @@ void tst_QGraphicsView::alignment() for (int k = 0; k < 3; ++k) { view.resize(100 + k * 25, 100 + k * 25); - QTest::qWait(25); + QApplication::processEvents(); } } } @@ -455,7 +455,7 @@ void tst_QGraphicsView::setScene() view.setScene(0); - QTest::qWait(250); + QTest::qWait(25); QVERIFY(!view.horizontalScrollBar()->isVisible()); QVERIFY(!view.verticalScrollBar()->isVisible()); @@ -530,7 +530,7 @@ void tst_QGraphicsView::sceneRect_growing() size *= 2; scene.setSceneRect(-size, -size, size * 2, size * 2); - QTest::qWait(25); + QApplication::processEvents(); QCOMPARE(view.sceneRect(), scene.sceneRect()); QCOMPARE(view.mapToScene(0, 0), topLeft); @@ -614,7 +614,8 @@ void tst_QGraphicsView::dragMode_scrollHand() view.setFixedSize(100, 100); view.show(); - QTest::qWait(25); + QTest::qWaitForWindowShown(&view); + QApplication::processEvents(); view.setInteractive(j ? false : true); @@ -646,9 +647,9 @@ void tst_QGraphicsView::dragMode_scrollHand() QApplication::sendEvent(view.viewport(), &event); QVERIFY(event.isAccepted()); } - QTest::qWait(250); + QApplication::processEvents(); - QVERIFY(item->isSelected()); + QTRY_VERIFY(item->isSelected()); for (int k = 0; k < 4; ++k) { #ifndef QT_NO_CURSOR @@ -689,9 +690,9 @@ void tst_QGraphicsView::dragMode_scrollHand() QApplication::sendEvent(view.viewport(), &event); QVERIFY(event.isAccepted()); } - QTest::qWait(250); + QApplication::processEvents(); - QVERIFY(item->isSelected()); + QTRY_VERIFY(item->isSelected()); QCOMPARE(view.horizontalScrollBar()->value(), horizontalScrollBarValue - 10); QCOMPARE(view.verticalScrollBar()->value(), verticalScrollBarValue - 10); #ifndef QT_NO_CURSOR @@ -749,6 +750,9 @@ void tst_QGraphicsView::dragMode_rubberBand() view.setDragMode(QGraphicsView::RubberBandDrag); + QTest::qWaitForWindowShown(&view); + QApplication::processEvents(); + for (int i = 0; i < 2; ++i) { // RubberBandDrag #ifndef QT_NO_CURSOR @@ -769,7 +773,7 @@ void tst_QGraphicsView::dragMode_rubberBand() QCOMPARE(view.viewport()->cursor().shape(), cursorShape); #endif - QTest::qWait(25); + QApplication::processEvents(); { // Move @@ -1073,7 +1077,7 @@ void tst_QGraphicsView::centerOnPoint() QFAIL(qPrintable(error)); } - QTest::qWait(1); + QApplication::processEvents(); } } @@ -2095,7 +2099,7 @@ void tst_QGraphicsView::transformationAnchor() } view.centerOn(0, 0); view.horizontalScrollBar()->setValue(100); - QTest::qWait(100); + QApplication::processEvents(); QPointF center = view.mapToScene(view.viewport()->rect().center()); @@ -2125,6 +2129,8 @@ void tst_QGraphicsView::resizeAnchor() for (int i = 0; i < 2; ++i) { view.resize(100, 100); view.show(); + QTest::qWaitForWindowShown(&view); + QApplication::processEvents(); if (i == 0) { QCOMPARE(view.resizeAnchor(), QGraphicsView::NoAnchor); @@ -2132,12 +2138,12 @@ void tst_QGraphicsView::resizeAnchor() view.setResizeAnchor(QGraphicsView::AnchorViewCenter); } view.centerOn(0, 0); - QTest::qWait(250); + QTest::qWait(25); QPointF f = view.mapToScene(50, 50); QPointF center = view.mapToScene(view.viewport()->rect().center()); - QTest::qWait(250); + QApplication::processEvents(); for (int size = 200; size <= 400; size += 25) { view.resize(size, size); @@ -2152,7 +2158,7 @@ void tst_QGraphicsView::resizeAnchor() QVERIFY(qAbs(newCenter.x() - center.x()) < slack); QVERIFY(qAbs(newCenter.y() - center.y()) < slack); } - QTest::qWait(20); + QApplication::processEvents(); } } } @@ -2760,11 +2766,11 @@ void tst_QGraphicsView::task187791_setSceneCausesUpdate() QCOMPARE(updateSpy.count(), 0); view.setScene(0); - QTest::qWait(125); - QCOMPARE(updateSpy.count(), 1); + QApplication::processEvents(); + QTRY_COMPARE(updateSpy.count(), 1); view.setScene(&scene); - QTest::qWait(125); - QCOMPARE(updateSpy.count(), 2); + QApplication::processEvents(); + QTRY_COMPARE(updateSpy.count(), 2); } class MouseMoveCounter : public QGraphicsView @@ -2808,15 +2814,15 @@ void tst_QGraphicsView::task186827_deleteReplayedItem() QApplication::sendEvent(view.viewport(), &event); } QCOMPARE(view.mouseMoves, 1); - QTest::qWait(125); - QCOMPARE(view.mouseMoves, 1); - QTest::qWait(125); + QTest::qWait(25); + QTRY_COMPARE(view.mouseMoves, 1); + QTest::qWait(25); { QMouseEvent event(QEvent::MouseMove, view.mapFromScene(25, 25), Qt::NoButton, 0, 0); QApplication::sendEvent(view.viewport(), &event); } QCOMPARE(view.mouseMoves, 2); - QTest::qWait(125); + QTest::qWait(15); } void tst_QGraphicsView::task207546_focusCrash() @@ -3412,11 +3418,11 @@ void tst_QGraphicsView::exposeRegion() QRegion expectedExposeRegion = QRect(0, 0, 5, 5); expectedExposeRegion += QRect(viewport->rect().bottomRight() - QPoint(5, 5), QSize(5, 5)); viewport->update(expectedExposeRegion); - QTest::qWait(125); + QApplication::processEvents(); // Make sure it triggers correct repaint on the view. - QCOMPARE(view.lastUpdateRegions.size(), 1); - QCOMPARE(view.lastUpdateRegions.at(0), expectedExposeRegion); + QTRY_COMPARE(view.lastUpdateRegions.size(), 1); + QTRY_COMPARE(view.lastUpdateRegions.at(0), expectedExposeRegion); // Make sure the item didn't get any repaints. QCOMPARE(item->paints, 0); @@ -3473,7 +3479,7 @@ void tst_QGraphicsView::update() #if defined QT_BUILD_INTERNAL const bool intersects = updateRect.intersects(viewportRect); QGraphicsViewPrivate *viewPrivate = static_cast(qt_widget_private(&view)); - QCOMPARE(viewPrivate->updateRect(updateRect), intersects); + QTRY_COMPARE(viewPrivate->updateRect(updateRect), intersects); QCOMPARE(viewPrivate->updateRegion(updateRect), intersects); view.lastUpdateRegions.clear(); @@ -3631,13 +3637,13 @@ void tst_QGraphicsView::task253415_reconnectUpdateSceneOnSceneChanged() QObject::connect(&scene1, SIGNAL(changed(QList)), &dummyView, SLOT(updateScene(QList))); view.setScene(&scene1); - QTest::qWait(125); + QTest::qWait(12); QGraphicsScene scene2; QObject::connect(&scene2, SIGNAL(changed(QList)), &dummyView, SLOT(updateScene(QList))); view.setScene(&scene2); - QTest::qWait(125); + QTest::qWait(12); bool wasConnected2 = QObject::disconnect(&scene2, SIGNAL(changed(QList)), &view, 0); QVERIFY(wasConnected2); @@ -3661,8 +3667,10 @@ void tst_QGraphicsView::task255529_transformationAnchorMouseAndViewportMargins() }; VpGraphicsView view(&scene); + view.setWindowFlags(Qt::X11BypassWindowManagerHint); view.show(); QTest::qWaitForWindowShown(&view); + QTest::qWait(50); QPoint mouseViewPos(20, 20); sendMouseMove(view.viewport(), mouseViewPos); -- cgit v0.12 From f16330e8d7f0e15d79b17a162a77044da57bb748 Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Wed, 30 Sep 2009 10:22:29 +0200 Subject: Fix tst_QFontDialog::task256466_wrongStyle() autotest failure in Cocoa. Some fonts contain only styles other than Normal (or Regualr). If we try to retrive the font sizes for such fonts by passing an empty style string, the QFontDatabase will return a null list. This was causing the autotest to fail. This patch will make sure that a style is always selected in the QFontDialog. Reviewed-by: Olivier --- src/gui/dialogs/qfontdialog.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/dialogs/qfontdialog.cpp b/src/gui/dialogs/qfontdialog.cpp index ca882c5..60fae27 100644 --- a/src/gui/dialogs/qfontdialog.cpp +++ b/src/gui/dialogs/qfontdialog.cpp @@ -602,6 +602,8 @@ void QFontDialogPrivate::updateStyles() } if (!found) styleList->setCurrentItem(0); + } else { + styleList->setCurrentItem(0); } styleEdit->setText(styleList->currentText()); -- cgit v0.12 From 8d3d7d411491e50c1c6a62f473a1fa69a3ca2773 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 30 Sep 2009 11:26:04 +0200 Subject: Compile when one includes without putting explicitly all Qt subdirs in the include path --- src/gui/s60framework/qs60mainapplication.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/s60framework/qs60mainapplication.h b/src/gui/s60framework/qs60mainapplication.h index 457764c..5f621e0 100644 --- a/src/gui/s60framework/qs60mainapplication.h +++ b/src/gui/s60framework/qs60mainapplication.h @@ -42,7 +42,7 @@ #ifndef QS60MAINAPPLICATION_H #define QS60MAINAPPLICATION_H -#include +#include #ifdef Q_WS_S60 -- cgit v0.12 From 7250463b2b67eac69b5f56fdefdbf9727c6d53af Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Wed, 30 Sep 2009 11:33:30 +0200 Subject: Install sub-attaq in the correct place. Reviewed-by:TrustMe --- demos/sub-attaq/sub-attaq.pro | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demos/sub-attaq/sub-attaq.pro b/demos/sub-attaq/sub-attaq.pro index ba2b54b..8677ff5 100644 --- a/demos/sub-attaq/sub-attaq.pro +++ b/demos/sub-attaq/sub-attaq.pro @@ -31,13 +31,13 @@ SOURCES += boat.cpp \ RESOURCES += subattaq.qrc # install -target.path = $$[QT_INSTALL_DEMOS]/animation/sub-attaq +target.path = $$[QT_INSTALL_DEMOS]/sub-attaq sources.files = $$SOURCES \ $$HEADERS \ $$RESOURCES \ $$FORMS \ sub-attaq.pro \ pics -sources.path = $$[QT_INSTALL_DEMOS]/animation/sub-attaq +sources.path = $$[QT_INSTALL_DEMOS]/sub-attaq INSTALLS += target \ sources -- cgit v0.12 From b0aca8ecf7ff70c83ade9009fb0e7c0c8137abf7 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 30 Sep 2009 11:48:36 +0200 Subject: Phonon/EffectFactory: Remove calls to QObject tr(). Replace them by calls to QCoreApplication::translate() to provide translators with context information. Reviewed-by: Frans Englich --- src/3rdparty/phonon/mmf/effectfactory.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/3rdparty/phonon/mmf/effectfactory.cpp b/src/3rdparty/phonon/mmf/effectfactory.cpp index 4acaaa4..9843a6c 100644 --- a/src/3rdparty/phonon/mmf/effectfactory.cpp +++ b/src/3rdparty/phonon/mmf/effectfactory.cpp @@ -17,6 +17,7 @@ along with this library. If not, see . */ #include +#include #include #include @@ -57,21 +58,21 @@ QHash EffectFactory::audioEffectDescriptions(AbstractAudio switch (type) { case AbstractAudioEffect::EffectAudioEqualizer: - return constructEffectDescription(QObject::tr("audio equalizer"), "Audio equalizer."); + return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "audio equalizer"), "Audio equalizer."); case AbstractAudioEffect::EffectBassBoost: - return constructEffectDescription(QObject::tr("Bass boost"), "Bass boost."); + return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Bass boost"), "Bass boost."); case AbstractAudioEffect::EffectDistanceAttenuation: - return constructEffectDescription(QObject::tr("Distance Attenuation"), "Distance Attenuation."); + return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Distance Attenuation"), "Distance Attenuation."); case AbstractAudioEffect::EffectEnvironmentalReverb: - return constructEffectDescription(QObject::tr("Environmental Reverb"), "Environmental Reverb."); + return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Environmental Reverb"), "Environmental Reverb."); case AbstractAudioEffect::EffectListenerOrientation: - return constructEffectDescription(QObject::tr("Environmental Reverb"), "Environmental Reverb."); + return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Environmental Reverb"), "Environmental Reverb."); case AbstractAudioEffect::EffectLoudness: - return constructEffectDescription(QObject::tr("Loudness"), "Loudness."); + return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Loudness"), "Loudness."); case AbstractAudioEffect::EffectSourceOrientation: - return constructEffectDescription(QObject::tr("Source Orientation"), "Source Orientation."); + return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Source Orientation"), "Source Orientation."); case AbstractAudioEffect::EffectStereoWidening: - return constructEffectDescription(QObject::tr("Stereo Widening"), "Stereo Widening."); + return constructEffectDescription(QCoreApplication::translate("Phonon::MMF::EffectFactory", "Stereo Widening"), "Stereo Widening."); } Q_ASSERT_X(false, Q_FUNC_INFO, "Unknown effect type."); -- cgit v0.12 From 45d5832a504516219167f0205901c56035118944 Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Wed, 30 Sep 2009 11:58:31 +0200 Subject: Make the test more robust because pulse doesn't clean the temp dir. I clean the directory i will use to be sure it is clean. Reviewed-by:TrustMe --- tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp index 63bc90c..ea9304d 100644 --- a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp +++ b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp @@ -806,6 +806,16 @@ void tst_QFileSystemModel::sort() QDir dir(QDir::tempPath()); dir.mkdir("sortTemp"); dir.cd("sortTemp"); + QDirIterator it(dir); + while(it.hasNext()) + { + it.next(); + QFileInfo info = it.fileInfo(); + if (info.isDir()) + dir.rmdir(info.fileName()); + else + QFile::remove(info.absoluteFilePath()); + } const QString dirPath = dir.absolutePath(); QVERIFY(dir.exists()); -- cgit v0.12 From 5170432e7cb2d0d1adf7ac2ec1ece627c75470f3 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 30 Sep 2009 12:41:58 +0200 Subject: Fix floating point precision when using qreal with QDataStream A frequent bug when using QDataStream across platforms where the size of qreal is different (such as any desktop platform and an ARM device) is that you end up using different overloads for streaming the value in and out (e.g. operator>>(double) on desktop and operator<<(float) on ARM.) This can leads to crashes and data corruption. To avoid the problem, we define a single floating point precision for the entire data stream and allow this to be set by the user. The default is to use 64-bit precision for all floating point numbers. Reviewed-by: Samuel Reviewed-by: Thiago --- src/corelib/io/io.pri | 1 + src/corelib/io/qdatastream.cpp | 102 +++++++++++++++++++++++++++-- src/corelib/io/qdatastream.h | 13 +++- tests/auto/qdatastream/tst_qdatastream.cpp | 58 +++++++++++++++- 4 files changed, 164 insertions(+), 10 deletions(-) diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri index bca9baa..02a1586 100644 --- a/src/corelib/io/io.pri +++ b/src/corelib/io/io.pri @@ -5,6 +5,7 @@ HEADERS += \ io/qabstractfileengine_p.h \ io/qbuffer.h \ io/qdatastream.h \ + io/qdatastream_p.h \ io/qdebug.h \ io/qdir.h \ io/qdiriterator.h \ diff --git a/src/corelib/io/qdatastream.cpp b/src/corelib/io/qdatastream.cpp index 9339b8e..cc62201 100644 --- a/src/corelib/io/qdatastream.cpp +++ b/src/corelib/io/qdatastream.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ #include "qdatastream.h" +#include "qdatastream_p.h" #ifndef QT_NO_DATASTREAM #include "qbuffer.h" @@ -193,6 +194,21 @@ QT_BEGIN_NAMESPACE */ /*! + \enum QDataStream::FloatingPointPrecision + + The precision of floating point numbers used for reading/writing the data. This will only have + an effect if the version of the data stream is Qt_4_6 or higher. + + \warning The floating point precision must be set to the same value on the object that writes + and the object that reads the data stream. + + \value SinglePrecision All floating point numbers in the data stream have 32-bit precision. + \value DoublePrecision All floating point numbers in the data stream have 64-bit precision. + + \sa setFloatingPointPrecision(), floatingPointPrecision() +*/ + +/*! \enum QDataStream::Status This enum describes the current status of the data stream. @@ -222,7 +238,7 @@ QT_BEGIN_NAMESPACE #endif enum { - DefaultStreamVersion = QDataStream::Qt_4_5 + DefaultStreamVersion = QDataStream::Qt_4_6 }; // ### 5.0: when streaming invalid QVariants, just the type should @@ -414,6 +430,42 @@ bool QDataStream::atEnd() const } /*! + Returns the floating point precision of the data stream. + + \since 4.6 + + \sa FloatingPointPrecision setFloatingPointPrecision() +*/ +QDataStream::FloatingPointPrecision QDataStream::floatingPointPrecision() const +{ + return d == 0 ? QDataStream::DoublePrecision : d->floatingPointPrecision; +} + +/*! + Sets the floating point precision of the data stream. If the floating point precision is + DoublePrecision and the version of the data stream is Qt_4_6 or higher, all floating point + numbers will be written and read with 64-bit precision. If the floating point precision is + SinglePrecision and the version is Qt_4_6 or higher, all floating point numbers will be written + and read with 32-bit precision. + + For versions prior to Qt_4_6, the precision of floating point numbers in the data stream depends + on the stream operator called. + + The default is DoublePrecision. + + \warning This property must be set to the same value on the object that writes and the object + that reads the data stream. + + \since 4.6 +*/ +void QDataStream::setFloatingPointPrecision(QDataStream::FloatingPointPrecision precision) +{ + if (d == 0) + d.reset(new QDataStreamPrivate()); + d->floatingPointPrecision = precision; +} + +/*! Returns the status of the data stream. \sa Status setStatus() resetStatus() @@ -517,7 +569,7 @@ void QDataStream::setByteOrder(ByteOrder bo) \value Qt_4_3 Version 9 (Qt 4.3) \value Qt_4_4 Version 10 (Qt 4.4) \value Qt_4_5 Version 11 (Qt 4.5) - \omitvalue Qt_4_6 + \value Qt_4_6 Version 12 (Qt 4.6) \sa setVersion(), version() */ @@ -754,13 +806,23 @@ QDataStream &QDataStream::operator>>(bool &i) /*! \overload - Reads a 32-bit floating point number from the stream into \a f, + Reads a floating point number from the stream into \a f, using the standard IEEE 754 format. Returns a reference to the stream. + + \sa setFloatingPointPrecision() */ QDataStream &QDataStream::operator>>(float &f) -{ +{ + if (version() >= QDataStream::Qt_4_6 + && floatingPointPrecision() == QDataStream::DoublePrecision) { + double d; + *this >> d; + f = d; + return *this; + } + f = 0.0f; CHECK_STREAM_PRECOND(*this) if (noswap) { @@ -796,13 +858,23 @@ QDataStream &QDataStream::operator>>(float &f) /*! \overload - Reads a 64-bit floating point number from the stream into \a f, + Reads a floating point number from the stream into \a f, using the standard IEEE 754 format. Returns a reference to the stream. + + \sa setFloatingPointPrecision() */ QDataStream &QDataStream::operator>>(double &f) { + if (version() >= QDataStream::Qt_4_6 + && floatingPointPrecision() == QDataStream::SinglePrecision) { + float d; + *this >> d; + f = d; + return *this; + } + f = 0.0; CHECK_STREAM_PRECOND(*this) #ifndef Q_DOUBLE_FORMAT @@ -1115,12 +1187,20 @@ QDataStream &QDataStream::operator<<(bool i) /*! \overload - Writes a 32-bit floating point number, \a f, to the stream using + Writes a floating point number, \a f, to the stream using the standard IEEE 754 format. Returns a reference to the stream. + + \sa setFloatingPointPrecision() */ QDataStream &QDataStream::operator<<(float f) { + if (version() >= QDataStream::Qt_4_6 + && floatingPointPrecision() == QDataStream::DoublePrecision) { + *this << double(f); + return *this; + } + CHECK_STREAM_PRECOND(*this) float g = f; // fixes float-on-stack problem if (noswap) { // no conversion needed @@ -1146,12 +1226,20 @@ QDataStream &QDataStream::operator<<(float f) /*! \overload - Writes a 64-bit floating point number, \a f, to the stream using + Writes a floating point number, \a f, to the stream using the standard IEEE 754 format. Returns a reference to the stream. + + \sa setFloatingPointPrecision() */ QDataStream &QDataStream::operator<<(double f) { + if (version() >= QDataStream::Qt_4_6 + && floatingPointPrecision() == QDataStream::SinglePrecision) { + *this << float(f); + return *this; + } + CHECK_STREAM_PRECOND(*this) #ifndef Q_DOUBLE_FORMAT if (noswap) { diff --git a/src/corelib/io/qdatastream.h b/src/corelib/io/qdatastream.h index b376de6..6e83204 100644 --- a/src/corelib/io/qdatastream.h +++ b/src/corelib/io/qdatastream.h @@ -42,6 +42,7 @@ #ifndef QDATASTREAM_H #define QDATASTREAM_H +#include #include #include @@ -83,7 +84,7 @@ public: Qt_4_3 = 9, Qt_4_4 = 10, Qt_4_5 = 11, - Qt_4_6 = Qt_4_5 + Qt_4_6 = 12, #if QT_VERSION >= 0x040700 #error Add the datastream version for this Qt version Qt_4_7 = Qt_4_6 @@ -101,6 +102,11 @@ public: ReadCorruptData }; + enum FloatingPointPrecision { + SinglePrecision, + DoublePrecision + }; + QDataStream(); explicit QDataStream(QIODevice *); #ifdef QT3_SUPPORT @@ -123,6 +129,9 @@ public: void setStatus(Status status); void resetStatus(); + FloatingPointPrecision floatingPointPrecision() const; + void setFloatingPointPrecision(FloatingPointPrecision precision); + ByteOrder byteOrder() const; void setByteOrder(ByteOrder); @@ -176,7 +185,7 @@ public: private: Q_DISABLE_COPY(QDataStream) - QDataStreamPrivate *d; + QScopedPointer d; QIODevice *dev; bool owndev; diff --git a/tests/auto/qdatastream/tst_qdatastream.cpp b/tests/auto/qdatastream/tst_qdatastream.cpp index 4f7b34e..add0945 100644 --- a/tests/auto/qdatastream/tst_qdatastream.cpp +++ b/tests/auto/qdatastream/tst_qdatastream.cpp @@ -204,6 +204,8 @@ private slots: void streamRealDataTypes(); + void floatingPointPrecision(); + #ifdef QT3_SUPPORT void task_224283(); #endif @@ -288,7 +290,8 @@ static int NColorRoles[] = { QPalette::AlternateBase + 1, // Qt_4_3 QPalette::ToolTipText + 1, // Qt_4_4 QPalette::ToolTipText + 1, // Qt_4_5 - 0 // add the correct value for Qt_4_6 here later + QPalette::ToolTipText + 1, // Qt_4_6 + 0 // add the correct value for Qt_4_7 here later }; // Testing get/set functions @@ -2538,9 +2541,12 @@ void tst_QDataStream::skipRawData() QFETCH(QByteArray, littleEndianData); \ QFETCH(int, expectedStatus); \ QFETCH(double, expectedValue); \ + \ + QDataStream::FloatingPointPrecision prec = sizeof(T) == sizeof(double) ? QDataStream::DoublePrecision : QDataStream::SinglePrecision; \ \ { \ QDataStream stream(&bigEndianData, QIODevice::ReadOnly); \ + stream.setFloatingPointPrecision(prec); \ T i; \ stream >> i; \ QCOMPARE((int) stream.status(), expectedStatus); \ @@ -2549,6 +2555,7 @@ void tst_QDataStream::skipRawData() { \ QDataStream stream(&littleEndianData, QIODevice::ReadOnly); \ stream.setByteOrder(QDataStream::LittleEndian); \ + stream.setFloatingPointPrecision(prec); \ T i; \ stream >> i; \ QCOMPARE((int) stream.status(), expectedStatus); \ @@ -3359,6 +3366,55 @@ void tst_QDataStream::compatibility_Qt2() QVERIFY(in_palette.color(QPalette::Light) == Qt::green); } +void tst_QDataStream::floatingPointPrecision() +{ + QByteArray ba; + { + QDataStream stream(&ba, QIODevice::WriteOnly); + QCOMPARE(QDataStream::DoublePrecision, stream.floatingPointPrecision()); + + float f = 123.0f; + stream << f; + QCOMPARE(ba.size(), int(sizeof(double))); + + double d = 234.0; + stream << d; + QCOMPARE(ba.size(), int(sizeof(double)*2)); + + stream.setFloatingPointPrecision(QDataStream::SinglePrecision); + + f = 123.0f; + stream << f; + QCOMPARE(ba.size(), int(sizeof(double)*2 + sizeof(float))); + + d = 234.0; + stream << d; + QCOMPARE(ba.size(), int(sizeof(double)*2 + sizeof(float)*2)); + } + + { + QDataStream stream(ba); + + float f = 0.0f; + stream >> f; + QCOMPARE(123.0f, f); + + double d = 0.0; + stream >> d; + QCOMPARE(234.0, d); + + f = 0.0f; + stream.setFloatingPointPrecision(QDataStream::SinglePrecision); + stream >> f; + QCOMPARE(123.0f, f); + + d = 0.0; + stream >> d; + QCOMPARE(234.0, d); + } + +} + QTEST_MAIN(tst_QDataStream) #include "tst_qdatastream.moc" -- cgit v0.12 From bbdb460ef1778298908ae677684e5855c25d0ce5 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 30 Sep 2009 12:23:16 +0200 Subject: Fix googlechat example when Qt is lacking SSL support. Don't build the googlechat example if QSslSocket isn't available. And even then also perform a run-time check and display an error page if SSL is not available. This is because the login into Google Chat works through an https website. Reviewed-by: Jesper --- examples/webkit/googlechat/googlechat.cpp | 6 ++++++ examples/webkit/webkit.pro | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/examples/webkit/googlechat/googlechat.cpp b/examples/webkit/googlechat/googlechat.cpp index a4a19a4..af567d1 100644 --- a/examples/webkit/googlechat/googlechat.cpp +++ b/examples/webkit/googlechat/googlechat.cpp @@ -41,6 +41,7 @@ #include #include +#include #include "googlechat.h" @@ -118,6 +119,11 @@ void GoogleChat::doLogin() { void GoogleChat::initialPage(bool ok) { if (ok) { + if (!QSslSocket::supportsSsl()) { + showError("This example requires SSL support."); + return; + } + QString s1 = evalJS("document.getElementById('Email').name"); QString s2 = evalJS("document.getElementById('Passwd').name"); QString s3 = evalJS("document.getElementById('gaia_loginform').id"); diff --git a/examples/webkit/webkit.pro b/examples/webkit/webkit.pro index 9ad6789..0a1d6bd 100644 --- a/examples/webkit/webkit.pro +++ b/examples/webkit/webkit.pro @@ -1,8 +1,9 @@ TEMPLATE = subdirs SUBDIRS += formextractor \ previewer \ - fancybrowser \ - googlechat + fancybrowser + +contains(QT_CONFIG, openssl):SUBDIRS += googlechat # install target.path = $$[QT_INSTALL_EXAMPLES]/webkit -- cgit v0.12 From 3cbde9651eab58c56b62d65b6fa4d9269bde0844 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 30 Sep 2009 13:01:45 +0200 Subject: Compile. Missed qdatastream_p.h in last commit. --- src/corelib/io/qdatastream_p.h | 72 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 src/corelib/io/qdatastream_p.h diff --git a/src/corelib/io/qdatastream_p.h b/src/corelib/io/qdatastream_p.h new file mode 100644 index 0000000..157fee9 --- /dev/null +++ b/src/corelib/io/qdatastream_p.h @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QDATASTREAM_P_H +#define QDATASTREAM_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include + +QT_BEGIN_NAMESPACE + +#ifndef QT_NO_DATASTREAM +class QDataStreamPrivate +{ +public: + QDataStreamPrivate() : floatingPointPrecision(QDataStream::DoublePrecision) { } + + QDataStream::FloatingPointPrecision floatingPointPrecision; +}; +#endif + +QT_END_NAMESPACE + +#endif // QDATASTREAM_P_H -- cgit v0.12 From d6244e6e5f8bb769176e07e957ec5ce93be72b55 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Wed, 30 Sep 2009 13:21:29 +0200 Subject: Compile on VS2003 The compiler complained about ambiguity in calls to make_pair because there is also a "using std::make_pair" in the WTF namespace (wtf/HashTraits.h). Reviewed-by: Simon Hausmann --- src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.cpp index 05e3d7b..f7bda9e 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Structure.cpp @@ -46,7 +46,6 @@ #define DO_PROPERTYMAP_CONSTENCY_CHECK 0 #endif -using namespace std; using namespace WTF; namespace JSC { -- cgit v0.12 From bdf7020103bc9698584005935f00cd874f841a49 Mon Sep 17 00:00:00 2001 From: Jan-Arve Date: Wed, 30 Sep 2009 13:39:49 +0200 Subject: Make the automaticReparenting autotest pass on Mac. On Mac, all autotests will use the release version of Qt, regardless of how the autotest was built --- tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp b/tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp index feaedd9..69a64ee 100644 --- a/tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp +++ b/tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp @@ -153,7 +153,7 @@ void tst_QGraphicsLayout::automaticReparenting() QGraphicsWidget *ww = new QGraphicsWidget(); QGraphicsLinearLayout *l1 = new QGraphicsLinearLayout(ww); -#ifdef QT_DEBUG +#if !defined(Q_OS_MAC) && defined(QT_DEBUG) QTest::ignoreMessage(QtWarningMsg, "QGraphicsLayout::addChildLayoutItem: QGraphicsWidget \"\"" " in wrong parent; moved to correct parent"); #endif -- cgit v0.12 From 849e46599f0751ba5994d036df140d10e76e223c Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 30 Sep 2009 14:48:48 +0300 Subject: Fixed qdoublespinbox undoRedo test case for Symbian. Symbian does not have keysequene associated to redo functionality. Changed the test so that it checks if key sequence is associated to needed functionality and if not test is skipped and warning printed. Reviewed-by: Aleksandar Sasha Babic --- tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp | 30 ++++++++++++++++-------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp b/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp index f4ea985..3d2fa42 100644 --- a/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp +++ b/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp @@ -936,19 +936,29 @@ void tst_QDoubleSpinBox::undoRedo() //testing CTRL+Z (undo) int val = QKeySequence(QKeySequence::Undo)[0]; - Qt::KeyboardModifiers mods = (Qt::KeyboardModifiers)(val & Qt::KeyboardModifierMask); - QTest::keyClick(&spin, val & ~mods, mods); - QCOMPARE(spin.value(), 0.0); - QVERIFY(!spin.lineEdit()->isUndoAvailable()); - QVERIFY(spin.lineEdit()->isRedoAvailable()); + if (val != 0) { + Qt::KeyboardModifiers mods = (Qt::KeyboardModifiers)(val & Qt::KeyboardModifierMask); + QTest::keyClick(&spin, val & ~mods, mods); + QCOMPARE(spin.value(), 0.0); + QVERIFY(!spin.lineEdit()->isUndoAvailable()); + QVERIFY(spin.lineEdit()->isRedoAvailable()); + } else { + QWARN("Undo not tested because no key sequence associated to QKeySequence::Redo"); + } + //testing CTRL+Y (redo) val = QKeySequence(QKeySequence::Redo)[0]; - mods = (Qt::KeyboardModifiers)(val & Qt::KeyboardModifierMask); - QTest::keyClick(&spin, val & ~mods, mods); - QCOMPARE(spin.value(), 1.0); - QVERIFY(!spin.lineEdit()->isRedoAvailable()); - QVERIFY(spin.lineEdit()->isUndoAvailable()); + if (val != 0) { + Qt::KeyboardModifiers mods = (Qt::KeyboardModifiers)(val & Qt::KeyboardModifierMask); + QTest::keyClick(&spin, val & ~mods, mods); + QCOMPARE(spin.value(), 1.0); + QVERIFY(!spin.lineEdit()->isRedoAvailable()); + QVERIFY(spin.lineEdit()->isUndoAvailable()); + } else { + QWARN("Redo not tested because no key sequence associated to QKeySequence::Redo"); + } + spin.setValue(55.0); QVERIFY(!spin.lineEdit()->isUndoAvailable()); -- cgit v0.12 From decaf4fe6e5270efaec6c51c4bc28664b2dbb3be Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Wed, 30 Sep 2009 13:54:04 +0200 Subject: avoid JavaScriptCore C API functions being exported from QtScript library Reviewed-by: Simon Hausmann --- src/script/script.pro | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/script/script.pro b/src/script/script.pro index 6c6b701..659aa26 100644 --- a/src/script/script.pro +++ b/src/script/script.pro @@ -62,6 +62,9 @@ DEFINES += WTF_USE_JAVASCRIPTCORE_BINDINGS=1 WTF_CHANGES=1 DEFINES += NDEBUG +# Avoid JSC C API functions being exported. +DEFINES += JS_EXPORT="" JS_EXPORTDATA="" + INCLUDEPATH += $$PWD include(script.pri) -- cgit v0.12 From d48b960a20c125a4cd7f906a89046116e3c8b376 Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Wed, 30 Sep 2009 13:57:33 +0200 Subject: Fix auto-test build. Reviewed-by:jesper --- tests/auto/qlistview/tst_qlistview.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/auto/qlistview/tst_qlistview.cpp b/tests/auto/qlistview/tst_qlistview.cpp index 499fb0b..d9cab02 100644 --- a/tests/auto/qlistview/tst_qlistview.cpp +++ b/tests/auto/qlistview/tst_qlistview.cpp @@ -59,6 +59,8 @@ #include #endif +#include "../../shared/util.h" + //TESTED_CLASS= //TESTED_FILES= -- cgit v0.12 From 21cfe5bf6550ae359d6bfa937b1308891954e9bb Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Wed, 30 Sep 2009 14:03:45 +0200 Subject: Make the test fail, not crash for now. A task is already open to fix it. Reviewed-by:jesper --- tests/auto/qdom/tst_qdom.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/auto/qdom/tst_qdom.cpp b/tests/auto/qdom/tst_qdom.cpp index 6637202..6987186 100644 --- a/tests/auto/qdom/tst_qdom.cpp +++ b/tests/auto/qdom/tst_qdom.cpp @@ -1908,7 +1908,8 @@ void tst_QDom::taskQTBUG4595_dontAssertWhenDocumentSpecifiesUnknownEncoding() co QDomDocument d; QVERIFY(d.setContent(xmlWithUnknownEncoding)); - QString dontAssert = d.toString(); // this should not assert + //QString dontAssert = d.toString(); // this should not assert + QVERIFY2(false, "Line above crashes but we still want to run all tests."); QVERIFY(true); } -- cgit v0.12 From 3868e92de3b27f3e030b77cfa746888a0dbb39e7 Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Wed, 30 Sep 2009 15:21:02 +0300 Subject: Add redo keyboard shortcut for Symbian. Symbian had undo shortcut already defined so this will add redo shortcut to get symmetrical undo-redo Reviewed-by: axis --- src/gui/kernel/qkeysequence.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp index aec757f..b44ef7f 100644 --- a/src/gui/kernel/qkeysequence.cpp +++ b/src/gui/kernel/qkeysequence.cpp @@ -571,7 +571,7 @@ const QKeyBinding QKeySequencePrivate::keyBindings[] = { {QKeySequence::Close, 0, Qt::CTRL | Qt::Key_W, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11}, {QKeySequence::Close, 1, Qt::CTRL | Qt::Key_W, QApplicationPrivate::KB_Mac}, {QKeySequence::Cut, 1, Qt::CTRL | Qt::Key_X, QApplicationPrivate::KB_All}, - {QKeySequence::Redo, 1, Qt::CTRL | Qt::Key_Y, QApplicationPrivate::KB_Win}, + {QKeySequence::Redo, 1, Qt::CTRL | Qt::Key_Y, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_S60}, {QKeySequence::Redo, 0, Qt::CTRL | Qt::Key_Y, QApplicationPrivate::KB_Mac},//different priority from above {QKeySequence::Undo, 1, Qt::CTRL | Qt::Key_Z, QApplicationPrivate::KB_All}, {QKeySequence::Back, 1, Qt::CTRL | Qt::Key_BracketLeft, QApplicationPrivate::KB_Mac}, @@ -600,7 +600,7 @@ const QKeyBinding QKeySequencePrivate::keyBindings[] = { {QKeySequence::FindPrevious, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_G, QApplicationPrivate::KB_Win}, {QKeySequence::AddTab, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_N, QApplicationPrivate::KB_KDE}, {QKeySequence::SaveAs, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_S, QApplicationPrivate::KB_Gnome | QApplicationPrivate::KB_Mac}, - {QKeySequence::Redo, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Z, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11}, + {QKeySequence::Redo, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Z, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11 | QApplicationPrivate::KB_S60}, {QKeySequence::Redo, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_Z, QApplicationPrivate::KB_Mac}, //different priority from above {QKeySequence::PreviousChild, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_Backtab, QApplicationPrivate::KB_Win | QApplicationPrivate::KB_X11}, {QKeySequence::PreviousChild, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Backtab, QApplicationPrivate::KB_Mac },//different priority from above -- cgit v0.12 From 71b3a015d5f051c732646ead395e56a609cc51af Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Wed, 30 Sep 2009 14:30:12 +0200 Subject: Be consistant between static method and regular QFileDialog contructor. The protected constructor of QFileDialog call selectAll() on the line edit. This constructor is only called by static methods. But the regular constructor didn't behave the same. Now it does :D. Task-number:QTBUG-4419 Reviewed-by:jasplin --- src/gui/dialogs/qfiledialog.cpp | 2 ++ tests/auto/qfiledialog/tst_qfiledialog.cpp | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index 14f19f2..297c900 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -317,6 +317,7 @@ QFileDialog::QFileDialog(QWidget *parent, Qt::WindowFlags f) { Q_D(QFileDialog); d->init(); + d->lineEdit()->selectAll(); } /*! @@ -334,6 +335,7 @@ QFileDialog::QFileDialog(QWidget *parent, { Q_D(QFileDialog); d->init(directory, filter, caption); + d->lineEdit()->selectAll(); } /*! diff --git a/tests/auto/qfiledialog/tst_qfiledialog.cpp b/tests/auto/qfiledialog/tst_qfiledialog.cpp index 1aa5ee1..9b083ea 100644 --- a/tests/auto/qfiledialog/tst_qfiledialog.cpp +++ b/tests/auto/qfiledialog/tst_qfiledialog.cpp @@ -169,6 +169,8 @@ private slots: void task257579_sideBarWithNonCleanUrls(); void task259105_filtersCornerCases(); + void QTBUG4419_lineEditSelectAll(); + private: QByteArray userSettings; }; @@ -2153,5 +2155,32 @@ void tst_QFiledialog::task259105_filtersCornerCases() filters->setCurrentIndex(1); QCOMPARE(filters->currentText(), QLatin1String("Text Files")); } + +void tst_QFiledialog::QTBUG4419_lineEditSelectAll() +{ + QString tempPath = QDir::tempPath(); + QTemporaryFile *t; + t = new QTemporaryFile; + t->open(); + QNonNativeFileDialog fd(0, "TestFileDialog", t->fileName()); + + fd.setDirectory(tempPath); + fd.setViewMode(QFileDialog::List); + fd.setAcceptMode(QFileDialog::AcceptSave); + fd.setFileMode(QFileDialog::AnyFile); + + fd.show(); + QApplication::setActiveWindow(&fd); + QTest::qWaitForWindowShown(&fd); + QTRY_COMPARE(fd.isVisible(), true); + QTRY_COMPARE(QApplication::activeWindow(), static_cast(&fd)); + + QTest::qWait(500); + QLineEdit *lineEdit = qFindChild(&fd, "fileNameEdit"); + + QCOMPARE(tempPath + QChar('/') + lineEdit->text(), t->fileName()); + QCOMPARE(tempPath + QChar('/') + lineEdit->selectedText(), t->fileName()); +} + QTEST_MAIN(tst_QFiledialog) #include "tst_qfiledialog.moc" -- cgit v0.12 From ca2834b0056b301f1d1b732840fcb106fdd477ac Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Wed, 30 Sep 2009 14:34:50 +0200 Subject: Don't need to wait that much. Reviewed-by:TrustMe --- tests/auto/qfiledialog/tst_qfiledialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qfiledialog/tst_qfiledialog.cpp b/tests/auto/qfiledialog/tst_qfiledialog.cpp index 9b083ea..f6b082f 100644 --- a/tests/auto/qfiledialog/tst_qfiledialog.cpp +++ b/tests/auto/qfiledialog/tst_qfiledialog.cpp @@ -2175,7 +2175,7 @@ void tst_QFiledialog::QTBUG4419_lineEditSelectAll() QTRY_COMPARE(fd.isVisible(), true); QTRY_COMPARE(QApplication::activeWindow(), static_cast(&fd)); - QTest::qWait(500); + QTest::qWait(250); QLineEdit *lineEdit = qFindChild(&fd, "fileNameEdit"); QCOMPARE(tempPath + QChar('/') + lineEdit->text(), t->fileName()); -- cgit v0.12 From dcbba3c0b603ad3b38c0d3ed128b230857cb38be Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 30 Sep 2009 14:37:29 +0200 Subject: qdoc: Modified the support for \sincelist. It now finds a lot more \since 4.6 stuff. --- doc/src/qt4-intro.qdoc | 17 ++---- tools/qdoc3/htmlgenerator.cpp | 132 ++++++++++++++++++++++++++++++++++-------- tools/qdoc3/htmlgenerator.h | 8 ++- tools/qdoc3/node.cpp | 17 ++++++ tools/qdoc3/node.h | 9 ++- 5 files changed, 141 insertions(+), 42 deletions(-) diff --git a/doc/src/qt4-intro.qdoc b/doc/src/qt4-intro.qdoc index 03d9b29..eafae14 100644 --- a/doc/src/qt4-intro.qdoc +++ b/doc/src/qt4-intro.qdoc @@ -605,21 +605,12 @@ functions to query audio devices for which audio formats they support. - \section1 Classes and Functions Introduced in 4.6 + \section1 Classes, functions, and other items introduced in 4.6 - Links to class, function, and macro documentation. + Links to classes, function, and other items that were added in + 4.6. - \section2 Classes - - Classes introduced in Qt 4.6. - - \sincelist classes - - \section2 Functions & Macros - - Fuctions and macros introduced in Qt 4.6. - - \sincelist functions + \sincelist 4.6 */ diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 5406017..2757cd8 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -330,7 +330,65 @@ void HtmlGenerator::generateTree(const Tree *tree, CodeMarker *marker) #ifdef ZZZ_QDOC_QML findAllQmlClasses(tree->root()); #endif - findAllSince(tree->root(),tree->version()); + findAllSince(tree->root()); + +#if 0 + if (!sinceVersions.isEmpty()) { + SinceVersionMap::const_iterator v = sinceVersions.constEnd(); + do { + --v; + qDebug() << "SINCE:" << v.key(); + if (!v.value().isEmpty()) { + QString type; + SinceNodeMultiMap::const_iterator n = v.value().constBegin(); + while (n != v.value().constEnd()) { + switch (n.value()->type()) { + case Node::Namespace: + type = "namespace"; + break; + case Node::Class: + type = "class"; + break; + case Node::Fake: + type = "fake"; + break; + case Node::Enum: + type = "enum"; + break; + case Node::Typedef: + type = "typedef"; + break; + case Node::Function: + type = "function"; + break; + case Node::Property: + type = "property"; + break; + case Node::Variable: + type = "variable"; + break; + case Node::Target: + type = "target"; + break; + case Node::QmlProperty: + type = "QML property"; + break; + case Node::QmlSignal: + type = "QML signal"; + break; + case Node::QmlMethod: + type = "QML method"; + break; + default: + type = "No type"; + } + qDebug() << " " << type << n.key(); + ++n; + } + } + } while (v != sinceVersions.constBegin()); + } +#endif PageGenerator::generateTree(tree, marker); @@ -655,21 +713,32 @@ int HtmlGenerator::generateAtom(const Atom *atom, break; case Atom::SinceList: { - QList values; - if (atom->string() == "classes") { - values = sinceClasses.values(); - } - else if (atom->string() == "functions") { - values = sinceFunctions.values(); - } - if (!values.isEmpty()) { - QMap nodeMap; - for (int i=0; inameForLists(),n); + QList nodes; + SinceVersionMap::const_iterator v; + v = sinceVersions.find(atom->string()); + if ((v != sinceVersions.constEnd()) && !v.value().isEmpty()) { + for (int i=0; !Node::typeName(i).isEmpty(); i++) { + Node::Type t = (Node::Type) i; + SinceNodeMultiMap::const_iterator n=v.value().constBegin(); + QMultiMap nodeMap; + while (n != v.value().constEnd()) { + const Node* node = n.value(); + if (node->type() == t) + nodeMap.insert(node->nameForLists(),node); + ++n; + } + if (!nodeMap.isEmpty()) { + out() << "

" + << Node::typeName(i) + << " new in Qt " + << atom->string() + << "

"; + generateAnnotatedList(relative, marker, nodeMap); + nodeMap.clear(); + } } - generateAnnotatedList(relative, marker, nodeMap); } + } break; case Atom::Image: @@ -3517,22 +3586,21 @@ void HtmlGenerator::findAllClasses(const InnerNode *node) /*! For generating the "Since x.y" page. */ -void HtmlGenerator::findAllSince(const InnerNode *node, QString version) +void HtmlGenerator::findAllSince(const InnerNode *node) { - const QRegExp versionSeparator("[\\-\\.]"); - const int minorIndex = version.indexOf(versionSeparator); - const int patchIndex = version.indexOf(versionSeparator, minorIndex+1); - version = version.left(patchIndex); - NodeList::const_iterator c = node->childNodes().constBegin(); while (c != node->childNodes().constEnd()) { - if (((*c)->access() != Node::Private) && ((*c)->since() == version)) { + QString sinceVersion = (*c)->since(); + if (((*c)->access() != Node::Private) && !sinceVersion.isEmpty()) { + SinceVersionMap::iterator vmap = sinceVersions.find(sinceVersion); + if (vmap == sinceVersions.end()) + vmap = sinceVersions.insert(sinceVersion,SinceNodeMultiMap()); if ((*c)->type() == Node::Function) { FunctionNode *func = static_cast(*c); if ((func->status() > Node::Obsolete) && (func->metaness() != FunctionNode::Ctor) && (func->metaness() != FunctionNode::Dtor)) { - sinceFunctions.insert(func->name(), func); + vmap.value().insert(func->name(),(*c)); } } else if ((*c)->url().isEmpty()) { @@ -3542,17 +3610,33 @@ void HtmlGenerator::findAllSince(const InnerNode *node, QString version) (*c)->parent()->type() == Node::Namespace && !(*c)->parent()->name().isEmpty()) className = (*c)->parent()->name()+"::"+className; - sinceClasses.insert(className, *c); + vmap.value().insert(className,(*c)); } } + else { + QString name = (*c)->name(); + if ((*c)->parent() && + (*c)->parent()->type() == Node::Namespace && + !(*c)->parent()->name().isEmpty()) + name = (*c)->parent()->name()+"::"+name; + vmap.value().insert(name,(*c)); + qDebug() << "GOT HEAH" << name; + } if ((*c)->isInnerNode()) { - findAllSince(static_cast(*c),version); + findAllSince(static_cast(*c)); } } ++c; } } +#if 0 + const QRegExp versionSeparator("[\\-\\.]"); + const int minorIndex = version.indexOf(versionSeparator); + const int patchIndex = version.indexOf(versionSeparator, minorIndex+1); + version = version.left(patchIndex); +#endif + void HtmlGenerator::findAllFunctions(const InnerNode *node) { NodeList::ConstIterator c = node->childNodes().begin(); diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h index 24e2986..3f6e564 100644 --- a/tools/qdoc3/htmlgenerator.h +++ b/tools/qdoc3/htmlgenerator.h @@ -67,6 +67,9 @@ struct NavigationBar }; #endif +typedef QMultiMap SinceNodeMultiMap; +typedef QMap SinceVersionMap; + class HelpProjectWriter; class HtmlGenerator : public PageGenerator @@ -216,7 +219,7 @@ class HtmlGenerator : public PageGenerator #ifdef ZZZ_QDOC_QML void findAllQmlClasses(const InnerNode *node); #endif - void findAllSince(const InnerNode *node, QString version); + void findAllSince(const InnerNode *node); static int hOffset(const Node *node); static bool isThreeColumnEnumValueTable(const Atom *atom); virtual QString getLink(const Atom *atom, @@ -286,8 +289,7 @@ class HtmlGenerator : public PageGenerator #endif QMap > funcIndex; QMap legaleseTexts; - QMap sinceClasses; - QMap sinceFunctions; + SinceVersionMap sinceVersions; }; #define HTMLGENERATOR_ADDRESS "address" diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp index b44ede0..d547d20 100644 --- a/tools/qdoc3/node.cpp +++ b/tools/qdoc3/node.cpp @@ -48,6 +48,23 @@ QT_BEGIN_NAMESPACE +QString Node::typeNames[] = + { + "Namespaces", + "Classes", + "Fake", + "Enums", + "Typedefs", + "Functions and Macros", + "Properties", + "Variables", + "Targets", + "Qml Properties", + "Qml Signals", + "Qml Methods", + "" + }; + /*! \class Node \brief A node in a Tree. diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h index fdef920..09f38d2 100644 --- a/tools/qdoc3/node.h +++ b/tools/qdoc3/node.h @@ -76,9 +76,11 @@ class Node Target, QmlProperty, QmlSignal, - QmlMethod + QmlMethod, + LastType #else - Target + Target, + LastType #endif }; @@ -173,10 +175,13 @@ class Node virtual QString fileBase() const; + static QString typeName(int i) { return typeNames[i]; } + protected: Node(Type type, InnerNode *parent, const QString& name); private: + static QString typeNames[]; #ifdef Q_WS_WIN Type typ; Access acc; -- cgit v0.12 From 59623e45ee31892c9ef210f8d7e396ccb0fe31a5 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Wed, 30 Sep 2009 14:38:03 +0200 Subject: Google Chat example: state that SSL is required MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bail out if SSL is not supported; before it only showed "service unavailable", which was somewhat confusing. Reviewed-by: Tor Arne Vestbø --- examples/webkit/googlechat/main.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/examples/webkit/googlechat/main.cpp b/examples/webkit/googlechat/main.cpp index fd08114..9e235a9 100644 --- a/examples/webkit/googlechat/main.cpp +++ b/examples/webkit/googlechat/main.cpp @@ -43,10 +43,25 @@ #include #include "googlechat.h" +#ifndef QT_NO_OPENSSL +#include +#endif + int main(int argc, char * argv[]) { QApplication app(argc, argv); +#ifndef QT_NO_OPENSSL + if (!QSslSocket::supportsSsl()) { +#endif + QMessageBox::information(0, "Google Talk client", + "Your system does not support SSL, " + "which is required to run this example."); + return -1; +#ifndef QT_NO_OPENSSL + } +#endif + QNetworkProxyFactory::setUseSystemConfigurationEnabled(true); GoogleChat *chat = new GoogleChat; -- cgit v0.12 From af1e344ac6046640ddb728f6017b3181469c241d Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 30 Sep 2009 15:56:43 +0300 Subject: Making tst_QListWidget::closePersistentEditor work for Symbian. The persistent editor was not closed in time, as events from Symbian app start up had not had time to be flushed through. The addition of a 1s QTest::qWait gives plenty of time for the app to settle. Probably the better fix would be to add piece of code to testlib which would empty the event queue before executing each test case. However this was seen as an risky solution. Reviewed-by: mread --- tests/auto/qlistwidget/tst_qlistwidget.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/auto/qlistwidget/tst_qlistwidget.cpp b/tests/auto/qlistwidget/tst_qlistwidget.cpp index d31b07f..e825c8f 100644 --- a/tests/auto/qlistwidget/tst_qlistwidget.cpp +++ b/tests/auto/qlistwidget/tst_qlistwidget.cpp @@ -302,6 +302,11 @@ void tst_QListWidget::openPersistentEditor() void tst_QListWidget::closePersistentEditor() { +#if defined(Q_OS_SYMBIAN) + //give the Symbian app start event queue time to clear + QTest::qWait(1000); +#endif + // Boundry checking int childCount = testWidget->viewport()->children().count(); testWidget->closePersistentEditor(0); -- cgit v0.12 From da935e9df4c63490a7d2a716236f1e781c2d75a6 Mon Sep 17 00:00:00 2001 From: Frans Englich Date: Wed, 30 Sep 2009 14:57:58 +0200 Subject: Install the qmediaplayer.exe too. --- demos/embedded/fluidlauncher/fluidlauncher.pro | 1 + 1 file changed, 1 insertion(+) diff --git a/demos/embedded/fluidlauncher/fluidlauncher.pro b/demos/embedded/fluidlauncher/fluidlauncher.pro index 62791f1..408bf53 100644 --- a/demos/embedded/fluidlauncher/fluidlauncher.pro +++ b/demos/embedded/fluidlauncher/fluidlauncher.pro @@ -143,6 +143,7 @@ symbian { } contains(QT_CONFIG, phonon) { + executables.sources += qmediaplayer.exe resource.sources += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/qmediaplayer.rsc } -- cgit v0.12 From 0963768ba79b6304c27c9ea293c71824e77a64ef Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Thu, 3 Sep 2009 16:42:47 +0200 Subject: Make itemviews use gradient selection on Vista by default We postponed this in 4.3 when the vista style was introduced since a lot of microsoft apps still used the legacy style and microsoft did not enable it by default. It has been reported as bugs a few times and it seems increasingly odd that we are not using the more modern look and feel when we can. Instead of only enabling it for QTreeView, we now only disable it for QTableView as the look still cannot be used to span vertical cells. Task-number: QTBUG-3746 Reviewed-by: prasanth --- src/gui/styles/qwindowsvistastyle.cpp | 22 ++++++++-------------- src/gui/styles/qwindowsvistastyle_p.h | 1 + 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/gui/styles/qwindowsvistastyle.cpp b/src/gui/styles/qwindowsvistastyle.cpp index b062a3f..6cb8b40 100644 --- a/src/gui/styles/qwindowsvistastyle.cpp +++ b/src/gui/styles/qwindowsvistastyle.cpp @@ -731,14 +731,11 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt { const QStyleOptionViewItemV4 *vopt; const QAbstractItemView *view = qobject_cast(widget); - bool newStyle = false; + bool newStyle = true; + + if (qobject_cast(widget)) + newStyle = false; - if (const QListView *listview = qobject_cast(widget)) { - if (listview->viewMode() == QListView::IconMode) - newStyle = true; - } else if (qobject_cast(widget)) { - newStyle = true; - } if (newStyle && view && (vopt = qstyleoption_cast(option))) { bool selected = vopt->state & QStyle::State_Selected; bool hover = vopt->state & QStyle::State_MouseOver; @@ -1496,14 +1493,11 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption { const QStyleOptionViewItemV4 *vopt; const QAbstractItemView *view = qobject_cast(widget); - bool newStyle = false; + bool newStyle = true; + + if (qobject_cast(widget)) + newStyle = false; - if (const QListView *listview = qobject_cast(widget)) { - if (listview->viewMode() == QListView::IconMode) - newStyle = true; - } else if (qobject_cast(widget)) { - newStyle = true; - } if (newStyle && view && (vopt = qstyleoption_cast(option))) { /* // We cannot currently get the correct selection color for "explorer style" views diff --git a/src/gui/styles/qwindowsvistastyle_p.h b/src/gui/styles/qwindowsvistastyle_p.h index d4170aa..e9bbb77 100644 --- a/src/gui/styles/qwindowsvistastyle_p.h +++ b/src/gui/styles/qwindowsvistastyle_p.h @@ -84,6 +84,7 @@ #include #include #include +#include #include #include -- cgit v0.12 From 4cc9fcac3ef66987b95a5589f10f3a0d82a778f4 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Fri, 4 Sep 2009 17:16:18 +0200 Subject: Fix duplicate key events from extended media keys on Windows We handle WM_APPCOMMAND to generate keyEvents separate from normal key events. However when we already have virtual key mappings for the same keys the events got delivered twice. Hence we have now removed WM_APPCOMMAND handling for all such keys. Task-number: QTBUG-4124 Reviewed-by: prasanth --- src/gui/kernel/qapplication_win.cpp | 61 ------------------------------------- 1 file changed, 61 deletions(-) diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index 6ecd535..eb9e276 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -1752,79 +1752,18 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam case APPCOMMAND_BASS_UP: key = Qt::Key_BassUp; break; - case APPCOMMAND_BROWSER_BACKWARD: - key = Qt::Key_Back; - break; - case APPCOMMAND_BROWSER_FAVORITES: - key = Qt::Key_Favorites; - break; - case APPCOMMAND_BROWSER_FORWARD: - key = Qt::Key_Forward; - break; - case APPCOMMAND_BROWSER_HOME: - key = Qt::Key_HomePage; - break; - case APPCOMMAND_BROWSER_REFRESH: - key = Qt::Key_Refresh; - break; - case APPCOMMAND_BROWSER_SEARCH: - key = Qt::Key_Search; - break; - case APPCOMMAND_BROWSER_STOP: - key = Qt::Key_Stop; - break; - case APPCOMMAND_LAUNCH_APP1: - key = Qt::Key_Launch0; - break; - case APPCOMMAND_LAUNCH_APP2: - key = Qt::Key_Launch1; - break; - case APPCOMMAND_LAUNCH_MAIL: - key = Qt::Key_LaunchMail; - break; - case APPCOMMAND_LAUNCH_MEDIA_SELECT: - key = Qt::Key_LaunchMedia; - break; - case APPCOMMAND_MEDIA_NEXTTRACK: - key = Qt::Key_MediaNext; - break; - case APPCOMMAND_MEDIA_PLAY_PAUSE: - key = Qt::Key_MediaPlay; - break; - case APPCOMMAND_MEDIA_PREVIOUSTRACK: - key = Qt::Key_MediaPrevious; - break; - case APPCOMMAND_MEDIA_STOP: - key = Qt::Key_MediaStop; - break; case APPCOMMAND_TREBLE_DOWN: key = Qt::Key_TrebleDown; break; case APPCOMMAND_TREBLE_UP: key = Qt::Key_TrebleUp; break; - case APPCOMMAND_VOLUME_DOWN: - key = Qt::Key_VolumeDown; - break; - case APPCOMMAND_VOLUME_MUTE: - key = Qt::Key_VolumeMute; - break; - case APPCOMMAND_VOLUME_UP: - key = Qt::Key_VolumeUp; - break; - // Commands new in Windows XP case APPCOMMAND_HELP: key = Qt::Key_Help; break; case APPCOMMAND_FIND: key = Qt::Key_Search; break; - case APPCOMMAND_PRINT: - key = Qt::Key_Print; - break; - case APPCOMMAND_MEDIA_PLAY: - key = Qt::Key_MediaPlay; - break; default: break; } -- cgit v0.12 From c5c58c2368f71c5d0067c9389c8ad04c41b66db5 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Wed, 9 Sep 2009 15:09:34 +0200 Subject: Fix regression in Command link button font size Since vista style polish sets the font on polish, the check for WA_SetFont will succeed, hence we never set the actual font. I replaced the check with a full resolve. However since the resolve would clear the resolve_mask, from the widget font it has to be restored manually so that QPainter:setFont can resolve it later. Task-number: QTBUG-4646 Reviewed-by: trond --- src/gui/text/qfont.h | 1 + src/gui/widgets/qcommandlinkbutton.cpp | 27 +++++++++++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/gui/text/qfont.h b/src/gui/text/qfont.h index ef91983..d73e1c4 100644 --- a/src/gui/text/qfont.h +++ b/src/gui/text/qfont.h @@ -309,6 +309,7 @@ private: friend class QPicturePaintEngine; friend class QPainterReplayer; friend class QPaintBufferEngine; + friend class QCommandLinkButtonPrivate; #ifndef QT_NO_DATASTREAM friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QFont &); diff --git a/src/gui/widgets/qcommandlinkbutton.cpp b/src/gui/widgets/qcommandlinkbutton.cpp index e64f687..9adf280 100644 --- a/src/gui/widgets/qcommandlinkbutton.cpp +++ b/src/gui/widgets/qcommandlinkbutton.cpp @@ -140,23 +140,34 @@ QFont QCommandLinkButtonPrivate::titleFont() const Q_Q(const QCommandLinkButton); QFont font = q->font(); if (usingVistaStyle()) { - if (!q->testAttribute(Qt::WA_SetFont)) - font.setPointSizeF(12.0); + font.setPointSizeF(12.0); } else { font.setBold(true); - if (!q->testAttribute(Qt::WA_SetFont)) - font.setPointSizeF(9.0); + font.setPointSizeF(9.0); } - return font; + + // Note the font will be resolved against + // QPainters font, so we need to restore the mask + int resolve_mask = font.resolve_mask; + QFont modifiedFont = q->font().resolve(font); + modifiedFont.detach(); + modifiedFont.resolve_mask = resolve_mask; + return modifiedFont; } QFont QCommandLinkButtonPrivate::descriptionFont() const { Q_Q(const QCommandLinkButton); QFont font = q->font(); - if (!q->testAttribute(Qt::WA_SetFont)) - font.setPointSizeF(9.0); - return font; + font.setPointSizeF(9.0); + + // Note the font will be resolved against + // QPainters font, so we need to restore the mask + int resolve_mask = font.resolve_mask; + QFont modifiedFont = q->font().resolve(font); + modifiedFont.detach(); + modifiedFont.resolve_mask = resolve_mask; + return modifiedFont; } QRect QCommandLinkButtonPrivate::titleRect() const -- cgit v0.12 From 9a7624ce5c4f78f89408eb0d9a33b1cd1569eb3c Mon Sep 17 00:00:00 2001 From: Bill King Date: Wed, 30 Sep 2009 15:26:42 +1000 Subject: (TDS) Fixes missing field/table name escaping. --- src/sql/drivers/tds/qsql_tds.cpp | 11 +++++++++++ src/sql/drivers/tds/qsql_tds.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/src/sql/drivers/tds/qsql_tds.cpp b/src/sql/drivers/tds/qsql_tds.cpp index 005905b..dddc1b4 100644 --- a/src/sql/drivers/tds/qsql_tds.cpp +++ b/src/sql/drivers/tds/qsql_tds.cpp @@ -794,4 +794,15 @@ QSqlIndex QTDSDriver::primaryIndex(const QString& tablename) const return idx; } +QString QTDSDriver::escapeIdentifier(const QString &identifier, IdentifierType type) const +{ + QString res = identifier; + if(!identifier.isEmpty() && !identifier.startsWith(QLatin1Char('"')) && !identifier.endsWith(QLatin1Char('"')) ) { + res.replace(QLatin1Char('"'), QLatin1String("\"\"")); + res.prepend(QLatin1Char('"')).append(QLatin1Char('"')); + res.replace(QLatin1Char('.'), QLatin1String("\".\"")); + } + return res; +} + QT_END_NAMESPACE diff --git a/src/sql/drivers/tds/qsql_tds.h b/src/sql/drivers/tds/qsql_tds.h index 6001106..0ceae6d 100644 --- a/src/sql/drivers/tds/qsql_tds.h +++ b/src/sql/drivers/tds/qsql_tds.h @@ -116,6 +116,8 @@ public: bool trimStrings) const; QVariant handle() const; + QString escapeIdentifier(const QString &identifier, IdentifierType type) const; + protected: bool beginTransaction(); bool commitTransaction(); -- cgit v0.12 From 1ceaa588f254888e0d9cf73e8d094dfdb8f3b8ab Mon Sep 17 00:00:00 2001 From: Bill King Date: Wed, 30 Sep 2009 15:31:48 +1000 Subject: (TDS) Fixes improper formatting of date values Task-number: QT-754 --- src/sql/drivers/tds/qsql_tds.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sql/drivers/tds/qsql_tds.cpp b/src/sql/drivers/tds/qsql_tds.cpp index dddc1b4..8acd599 100644 --- a/src/sql/drivers/tds/qsql_tds.cpp +++ b/src/sql/drivers/tds/qsql_tds.cpp @@ -747,7 +747,9 @@ QString QTDSDriver::formatValue(const QSqlField &field, r = QLatin1String("NULL"); else if (field.type() == QVariant::DateTime) { if (field.value().toDateTime().isValid()){ - r = field.value().toDateTime().toString(QLatin1String("'yyyyMMdd hh:mm:ss'")); + r = field.value().toDateTime().toString(QLatin1String("yyyyMMdd hh:mm:ss")); + r.prepend(QLatin1String("'")); + r.append(QLatin1String("'")); } else r = QLatin1String("NULL"); } else if (field.type() == QVariant::ByteArray) { -- cgit v0.12 From 343eb73edaa4a05860bf8749a2ff70359f45eb78 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 30 Sep 2009 14:36:22 +0200 Subject: Fix reader.google.com crashes Revert this change: ---- 2008-12-18 Bernhard Rosenkraenzer Reviewed by Darin Adler. https://bugs.webkit.org/show_bug.cgi?id=22205 Fix compatibility with bison 2.4, partially based on older patch by Priit Laes * WebCore/css/CSSGrammar.y: Made compatible with bison 2.4 ----- Cherry-picked from qtwebkit.git 4.5 repository/branch with commit 23d13ba45ee59379c04afdef8472acc8611bb36a --- src/3rdparty/webkit/WebCore/css/CSSGrammar.y | 10 +- .../webkit/WebCore/generated/CSSGrammar.cpp | 2342 ++++++++------------ src/3rdparty/webkit/WebCore/generated/CSSGrammar.h | 231 +- 3 files changed, 1133 insertions(+), 1450 deletions(-) diff --git a/src/3rdparty/webkit/WebCore/css/CSSGrammar.y b/src/3rdparty/webkit/WebCore/css/CSSGrammar.y index 31f1c8b..9ee9c93 100644 --- a/src/3rdparty/webkit/WebCore/css/CSSGrammar.y +++ b/src/3rdparty/webkit/WebCore/css/CSSGrammar.y @@ -94,8 +94,6 @@ static int cssyylex(YYSTYPE* yylval, void* parser) %expect 49 -%nonassoc LOWEST_PREC - %left UNIMPORTANT_TOK %token WHITESPACE SGML_CD @@ -351,7 +349,7 @@ maybe_charset: closing_brace: '}' - | %prec LOWEST_PREC TOKEN_EOF + | %prec maybe_sgml TOKEN_EOF ; charset: @@ -1357,10 +1355,10 @@ term: $$.string = $1; } /* We might need to actually parse the number from a dimension, but we can't just put something that uses $$.string into unary_term. */ - | DIMEN maybe_space { $$.id = 0; $$.string = $1; $$.unit = CSSPrimitiveValue::CSS_DIMENSION; } - | unary_operator DIMEN maybe_space { $$.id = 0; $$.string = $2; $$.unit = CSSPrimitiveValue::CSS_DIMENSION; } + | DIMEN maybe_space { $$.id = 0; $$.string = $1; $$.unit = CSSPrimitiveValue::CSS_DIMENSION } + | unary_operator DIMEN maybe_space { $$.id = 0; $$.string = $2; $$.unit = CSSPrimitiveValue::CSS_DIMENSION } | URI maybe_space { $$.id = 0; $$.string = $1; $$.unit = CSSPrimitiveValue::CSS_URI; } - | UNICODERANGE maybe_space { $$.id = 0; $$.string = $1; $$.unit = CSSPrimitiveValue::CSS_UNICODE_RANGE; } + | UNICODERANGE maybe_space { $$.id = 0; $$.string = $1; $$.unit = CSSPrimitiveValue::CSS_UNICODE_RANGE } | hexcolor { $$.id = 0; $$.string = $1; $$.unit = CSSPrimitiveValue::CSS_PARSER_HEXCOLOR; } | '#' maybe_space { $$.id = 0; $$.string = CSSParserString(); $$.unit = CSSPrimitiveValue::CSS_PARSER_HEXCOLOR; } /* Handle error case: "color: #;" */ /* FIXME: according to the specs a function can have a unary_operator in front. I know no case where this makes sense */ diff --git a/src/3rdparty/webkit/WebCore/generated/CSSGrammar.cpp b/src/3rdparty/webkit/WebCore/generated/CSSGrammar.cpp index 03a7829..b980a0a 100644 --- a/src/3rdparty/webkit/WebCore/generated/CSSGrammar.cpp +++ b/src/3rdparty/webkit/WebCore/generated/CSSGrammar.cpp @@ -1,23 +1,24 @@ - -/* A Bison parser, made by GNU Bison 2.4.1. */ +/* A Bison parser, made by GNU Bison 2.3. */ /* Skeleton implementation for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify + + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - + the Free Software Foundation; either version 2, or (at your option) + any later version. + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License - along with this program. If not, see . */ + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -28,7 +29,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -46,7 +47,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.4.1" +#define YYBISON_VERSION "2.3" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -54,28 +55,157 @@ /* Pure parsers. */ #define YYPURE 1 -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - /* Using locations. */ #define YYLSP_NEEDED 0 /* Substitute the variable and function names. */ -#define yyparse cssyyparse -#define yylex cssyylex -#define yyerror cssyyerror -#define yylval cssyylval -#define yychar cssyychar -#define yydebug cssyydebug -#define yynerrs cssyynerrs +#define yyparse cssyyparse +#define yylex cssyylex +#define yyerror cssyyerror +#define yylval cssyylval +#define yychar cssyychar +#define yydebug cssyydebug +#define yynerrs cssyynerrs -/* Copy the first part of user declarations. */ +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + TOKEN_EOF = 0, + UNIMPORTANT_TOK = 258, + WHITESPACE = 259, + SGML_CD = 260, + INCLUDES = 261, + DASHMATCH = 262, + BEGINSWITH = 263, + ENDSWITH = 264, + CONTAINS = 265, + STRING = 266, + IDENT = 267, + NTH = 268, + HEX = 269, + IDSEL = 270, + IMPORT_SYM = 271, + PAGE_SYM = 272, + MEDIA_SYM = 273, + FONT_FACE_SYM = 274, + CHARSET_SYM = 275, + NAMESPACE_SYM = 276, + WEBKIT_RULE_SYM = 277, + WEBKIT_DECLS_SYM = 278, + WEBKIT_KEYFRAME_RULE_SYM = 279, + WEBKIT_KEYFRAMES_SYM = 280, + WEBKIT_VALUE_SYM = 281, + WEBKIT_MEDIAQUERY_SYM = 282, + WEBKIT_SELECTOR_SYM = 283, + WEBKIT_VARIABLES_SYM = 284, + WEBKIT_DEFINE_SYM = 285, + VARIABLES_FOR = 286, + WEBKIT_VARIABLES_DECLS_SYM = 287, + ATKEYWORD = 288, + IMPORTANT_SYM = 289, + MEDIA_ONLY = 290, + MEDIA_NOT = 291, + MEDIA_AND = 292, + QEMS = 293, + EMS = 294, + EXS = 295, + PXS = 296, + CMS = 297, + MMS = 298, + INS = 299, + PTS = 300, + PCS = 301, + DEGS = 302, + RADS = 303, + GRADS = 304, + TURNS = 305, + MSECS = 306, + SECS = 307, + HERZ = 308, + KHERZ = 309, + DIMEN = 310, + PERCENTAGE = 311, + FLOATTOKEN = 312, + INTEGER = 313, + URI = 314, + FUNCTION = 315, + NOTFUNCTION = 316, + UNICODERANGE = 317, + VARCALL = 318 + }; +#endif +/* Tokens. */ +#define TOKEN_EOF 0 +#define UNIMPORTANT_TOK 258 +#define WHITESPACE 259 +#define SGML_CD 260 +#define INCLUDES 261 +#define DASHMATCH 262 +#define BEGINSWITH 263 +#define ENDSWITH 264 +#define CONTAINS 265 +#define STRING 266 +#define IDENT 267 +#define NTH 268 +#define HEX 269 +#define IDSEL 270 +#define IMPORT_SYM 271 +#define PAGE_SYM 272 +#define MEDIA_SYM 273 +#define FONT_FACE_SYM 274 +#define CHARSET_SYM 275 +#define NAMESPACE_SYM 276 +#define WEBKIT_RULE_SYM 277 +#define WEBKIT_DECLS_SYM 278 +#define WEBKIT_KEYFRAME_RULE_SYM 279 +#define WEBKIT_KEYFRAMES_SYM 280 +#define WEBKIT_VALUE_SYM 281 +#define WEBKIT_MEDIAQUERY_SYM 282 +#define WEBKIT_SELECTOR_SYM 283 +#define WEBKIT_VARIABLES_SYM 284 +#define WEBKIT_DEFINE_SYM 285 +#define VARIABLES_FOR 286 +#define WEBKIT_VARIABLES_DECLS_SYM 287 +#define ATKEYWORD 288 +#define IMPORTANT_SYM 289 +#define MEDIA_ONLY 290 +#define MEDIA_NOT 291 +#define MEDIA_AND 292 +#define QEMS 293 +#define EMS 294 +#define EXS 295 +#define PXS 296 +#define CMS 297 +#define MMS 298 +#define INS 299 +#define PTS 300 +#define PCS 301 +#define DEGS 302 +#define RADS 303 +#define GRADS 304 +#define TURNS 305 +#define MSECS 306 +#define SECS 307 +#define HERZ 308 +#define KHERZ 309 +#define DIMEN 310 +#define PERCENTAGE 311 +#define FLOATTOKEN 312 +#define INTEGER 313 +#define URI 314 +#define FUNCTION 315 +#define NOTFUNCTION 316 +#define UNICODERANGE 317 +#define VARCALL 318 -/* Line 189 of yacc.c */ + + + +/* Copy the first part of user declarations. */ #line 1 "../css/CSSGrammar.y" @@ -131,9 +261,6 @@ using namespace HTMLNames; -/* Line 189 of yacc.c */ -#line 136 "WebCore/tmp/../generated/CSSGrammar.tab.c" - /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 @@ -152,88 +279,10 @@ using namespace HTMLNames; # define YYTOKEN_TABLE 0 #endif - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - TOKEN_EOF = 0, - LOWEST_PREC = 258, - UNIMPORTANT_TOK = 259, - WHITESPACE = 260, - SGML_CD = 261, - INCLUDES = 262, - DASHMATCH = 263, - BEGINSWITH = 264, - ENDSWITH = 265, - CONTAINS = 266, - STRING = 267, - IDENT = 268, - NTH = 269, - HEX = 270, - IDSEL = 271, - IMPORT_SYM = 272, - PAGE_SYM = 273, - MEDIA_SYM = 274, - FONT_FACE_SYM = 275, - CHARSET_SYM = 276, - NAMESPACE_SYM = 277, - WEBKIT_RULE_SYM = 278, - WEBKIT_DECLS_SYM = 279, - WEBKIT_KEYFRAME_RULE_SYM = 280, - WEBKIT_KEYFRAMES_SYM = 281, - WEBKIT_VALUE_SYM = 282, - WEBKIT_MEDIAQUERY_SYM = 283, - WEBKIT_SELECTOR_SYM = 284, - WEBKIT_VARIABLES_SYM = 285, - WEBKIT_DEFINE_SYM = 286, - VARIABLES_FOR = 287, - WEBKIT_VARIABLES_DECLS_SYM = 288, - ATKEYWORD = 289, - IMPORTANT_SYM = 290, - MEDIA_ONLY = 291, - MEDIA_NOT = 292, - MEDIA_AND = 293, - QEMS = 294, - EMS = 295, - EXS = 296, - PXS = 297, - CMS = 298, - MMS = 299, - INS = 300, - PTS = 301, - PCS = 302, - DEGS = 303, - RADS = 304, - GRADS = 305, - TURNS = 306, - MSECS = 307, - SECS = 308, - HERZ = 309, - KHERZ = 310, - DIMEN = 311, - PERCENTAGE = 312, - FLOATTOKEN = 313, - INTEGER = 314, - URI = 315, - FUNCTION = 316, - NOTFUNCTION = 317, - UNICODERANGE = 318, - VARCALL = 319 - }; -#endif - - - #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -{ - -/* Line 214 of yacc.c */ #line 57 "../css/CSSGrammar.y" - +{ bool boolean; char character; int integer; @@ -255,21 +304,18 @@ typedef union YYSTYPE WebKitCSSKeyframeRule* keyframeRule; WebKitCSSKeyframesRule* keyframesRule; float val; - - - -/* Line 214 of yacc.c */ -#line 263 "WebCore/tmp/../generated/CSSGrammar.tab.c" -} YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 +} +/* Line 187 of yacc.c. */ +#line 310 "WebCore/tmp/../generated/CSSGrammar.tab.c" + YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 #endif -/* Copy the second part of user declarations. */ -/* Line 264 of yacc.c */ +/* Copy the second part of user declarations. */ #line 81 "../css/CSSGrammar.y" @@ -285,8 +331,8 @@ static int cssyylex(YYSTYPE* yylval, void* parser) -/* Line 264 of yacc.c */ -#line 290 "WebCore/tmp/../generated/CSSGrammar.tab.c" +/* Line 216 of yacc.c. */ +#line 336 "WebCore/tmp/../generated/CSSGrammar.tab.c" #ifdef short # undef short @@ -361,14 +407,14 @@ typedef short int yytype_int16; #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int -YYID (int yyi) +YYID (int i) #else static int -YYID (yyi) - int yyi; +YYID (i) + int i; #endif { - return yyi; + return i; } #endif @@ -449,9 +495,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ /* A type that is properly aligned for any stack member. */ union yyalloc { - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; + yytype_int16 yyss; + YYSTYPE yyvs; + }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) @@ -485,12 +531,12 @@ union yyalloc elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ +# define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ @@ -501,10 +547,10 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 28 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1315 +#define YYLAST 1274 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 85 +#define YYNTOKENS 84 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 90 /* YYNRULES -- Number of rules. */ @@ -514,7 +560,7 @@ union yyalloc /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 319 +#define YYMAXUTOK 318 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -525,16 +571,16 @@ static const yytype_uint8 yytranslate[] = 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 83, 2, 84, 2, 2, - 73, 74, 20, 76, 75, 79, 18, 82, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 17, 72, - 2, 81, 78, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 82, 2, 83, 2, 2, + 72, 73, 19, 75, 74, 78, 17, 81, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 16, 71, + 2, 80, 77, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 19, 2, 80, 2, 2, 2, 2, 2, 2, + 2, 18, 2, 79, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 70, 21, 71, 77, 2, 2, 2, + 2, 2, 2, 69, 20, 70, 76, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -549,11 +595,11 @@ static const yytype_uint8 yytranslate[] = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 22, 23, 24, 25, 26, 27, 28, 29, + 15, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69 + 60, 61, 62, 63, 64, 65, 66, 67, 68 }; #if YYDEBUG @@ -593,130 +639,130 @@ static const yytype_uint16 yyprhs[] = /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int16 yyrhs[] = { - 86, 0, -1, 97, 96, 100, 101, 102, 103, -1, - 88, 95, -1, 90, 95, -1, 92, 95, -1, 93, - 95, -1, 94, 95, -1, 91, 95, -1, 89, 95, - -1, 104, -1, 109, -1, 28, 70, 95, 87, 95, - 71, -1, 30, 70, 95, 133, 95, 71, -1, 29, - 70, 95, 155, 71, -1, 38, 70, 95, 112, 71, - -1, 32, 70, 95, 160, 71, -1, 33, 5, 95, - 125, 71, -1, 34, 70, 95, 141, 71, -1, -1, - 95, 5, -1, -1, 96, 6, -1, 96, 5, -1, - -1, 99, -1, 71, -1, 0, -1, 26, 95, 12, - 95, 72, -1, 26, 1, 173, -1, 26, 1, 72, - -1, -1, 100, 109, 96, -1, 169, -1, -1, 101, - 110, 96, -1, -1, 102, 116, 96, -1, -1, 103, - 105, 96, -1, 140, -1, 128, -1, 136, -1, 137, - -1, 130, -1, 104, -1, 172, -1, 168, -1, 170, - -1, -1, 106, 108, 96, -1, 140, -1, 136, -1, - 137, -1, 130, -1, 107, -1, 172, -1, 168, -1, - 170, -1, 171, -1, 22, 95, 118, 95, 126, 72, - -1, 22, 95, 118, 95, 126, 173, -1, 22, 1, - 72, -1, 22, 1, 173, -1, 35, 95, 126, 70, - 95, 112, 71, -1, 36, 95, 111, 70, 95, 112, - 71, -1, -1, 37, 5, 127, -1, 114, -1, 113, - 114, -1, 113, -1, 1, 174, 1, -1, 1, -1, - 113, 1, -1, 114, 72, 95, -1, 114, 174, 72, - 95, -1, 1, 72, 95, -1, 1, 174, 1, 72, - 95, -1, 113, 114, 72, 95, -1, 113, 1, 72, - 95, -1, 113, 1, 174, 1, 72, 95, -1, 115, - 17, 95, 160, -1, 115, 95, 70, 95, 155, 71, - 95, -1, 115, 1, -1, 115, 17, 95, 1, 160, - -1, 115, 17, 95, -1, 115, 17, 95, 1, -1, - 13, 95, -1, 27, 95, 117, 118, 95, 72, -1, - 27, 1, 173, -1, 27, 1, 72, -1, -1, 13, - 5, -1, 12, -1, 65, -1, 13, 95, -1, -1, - 17, 95, 160, 95, -1, 73, 95, 119, 95, 120, - 74, 95, -1, 121, -1, 122, 95, 43, 95, 121, - -1, -1, 43, 95, 122, -1, -1, 41, -1, 42, - -1, 122, -1, 124, 95, 129, 123, -1, -1, 127, - -1, 125, -1, 127, 75, 95, 125, -1, 127, 1, - -1, 24, 95, 127, 70, 95, 106, 167, -1, 24, - 95, 70, 95, 106, 167, -1, 13, 95, -1, 31, - 95, 131, 95, 70, 95, 132, 71, -1, 13, -1, - 12, -1, -1, 132, 133, 95, -1, 134, 95, 70, - 95, 155, 71, -1, 135, -1, 134, 95, 75, 95, - 135, -1, 62, -1, 13, -1, 23, 1, 173, -1, - 23, 1, 72, -1, 25, 95, 70, 95, 155, 71, - 95, -1, 25, 1, 173, -1, 25, 1, 72, -1, - 76, 95, -1, 77, 95, -1, 78, 95, -1, 79, - -1, 76, -1, 141, 70, 95, 155, 98, -1, 143, - -1, 141, 75, 95, 143, -1, 141, 1, -1, 143, - 5, -1, 145, -1, 142, -1, 142, 145, -1, 143, - 138, 145, -1, 143, 1, -1, 21, -1, 20, 21, - -1, 13, 21, -1, 146, -1, 146, 147, -1, 147, - -1, 144, 146, -1, 144, 146, 147, -1, 144, 147, - -1, 13, -1, 20, -1, 148, -1, 147, 148, -1, - 147, 1, -1, 16, -1, 15, -1, 149, -1, 151, - -1, 154, -1, 18, 13, -1, 13, 95, -1, 19, - 95, 150, 80, -1, 19, 95, 150, 152, 95, 153, - 95, 80, -1, 19, 95, 144, 150, 80, -1, 19, - 95, 144, 150, 152, 95, 153, 95, 80, -1, 81, - -1, 7, -1, 8, -1, 9, -1, 10, -1, 11, - -1, 13, -1, 12, -1, 17, 13, -1, 17, 17, - 13, -1, 17, 66, 14, 74, -1, 17, 66, 64, - 74, -1, 17, 66, 13, 74, -1, 17, 67, 95, - 145, 95, 74, -1, 157, -1, 156, 157, -1, 156, - -1, 1, 174, 1, -1, 1, -1, 156, 1, -1, - 156, 174, -1, 157, 72, 95, -1, 157, 174, 72, - 95, -1, 1, 72, 95, -1, 1, 174, 1, 72, - 95, -1, 156, 157, 72, 95, -1, 156, 1, 72, - 95, -1, 156, 1, 174, 1, 72, 95, -1, 158, - 17, 95, 160, 159, -1, 164, 95, -1, 158, 1, - -1, 158, 17, 95, 1, 160, 159, -1, 158, 17, - 95, 160, 159, 1, -1, 40, 95, -1, 158, 17, - 95, -1, 158, 17, 95, 1, -1, 158, 173, -1, - 13, 95, -1, 40, 95, -1, -1, 162, -1, 160, - 161, 162, -1, 160, 1, -1, 82, 95, -1, 75, - 95, -1, -1, 163, -1, 139, 163, -1, 12, 95, - -1, 13, 95, -1, 61, 95, -1, 139, 61, 95, - -1, 65, 95, -1, 68, 95, -1, 166, -1, 83, - 95, -1, 165, -1, 164, 95, -1, 84, 95, -1, - 64, 95, -1, 63, 95, -1, 62, 95, -1, 47, - 95, -1, 48, 95, -1, 49, 95, -1, 50, 95, - -1, 51, 95, -1, 52, 95, -1, 53, 95, -1, - 54, 95, -1, 55, 95, -1, 56, 95, -1, 57, - 95, -1, 58, 95, -1, 59, 95, -1, 60, 95, - -1, 45, 95, -1, 44, 95, -1, 46, 95, -1, - 69, -1, 66, 95, 160, 74, 95, -1, 66, 95, - 1, -1, 15, 95, -1, 16, 95, -1, 98, -1, - 1, 98, -1, 39, 1, 173, -1, 39, 1, 72, - -1, 168, 96, -1, 169, 168, 96, -1, 109, -1, - 128, -1, 1, 173, -1, 70, 1, 174, 1, 98, - -1, 70, 1, 98, -1, 173, -1, 174, 1, 173, + 85, 0, -1, 96, 95, 99, 100, 101, 102, -1, + 87, 94, -1, 89, 94, -1, 91, 94, -1, 92, + 94, -1, 93, 94, -1, 90, 94, -1, 88, 94, + -1, 103, -1, 108, -1, 27, 69, 94, 86, 94, + 70, -1, 29, 69, 94, 132, 94, 70, -1, 28, + 69, 94, 154, 70, -1, 37, 69, 94, 111, 70, + -1, 31, 69, 94, 159, 70, -1, 32, 4, 94, + 124, 70, -1, 33, 69, 94, 140, 70, -1, -1, + 94, 4, -1, -1, 95, 5, -1, 95, 4, -1, + -1, 98, -1, 70, -1, 0, -1, 25, 94, 11, + 94, 71, -1, 25, 1, 172, -1, 25, 1, 71, + -1, -1, 99, 108, 95, -1, 168, -1, -1, 100, + 109, 95, -1, -1, 101, 115, 95, -1, -1, 102, + 104, 95, -1, 139, -1, 127, -1, 135, -1, 136, + -1, 129, -1, 103, -1, 171, -1, 167, -1, 169, + -1, -1, 105, 107, 95, -1, 139, -1, 135, -1, + 136, -1, 129, -1, 106, -1, 171, -1, 167, -1, + 169, -1, 170, -1, 21, 94, 117, 94, 125, 71, + -1, 21, 94, 117, 94, 125, 172, -1, 21, 1, + 71, -1, 21, 1, 172, -1, 34, 94, 125, 69, + 94, 111, 70, -1, 35, 94, 110, 69, 94, 111, + 70, -1, -1, 36, 4, 126, -1, 113, -1, 112, + 113, -1, 112, -1, 1, 173, 1, -1, 1, -1, + 112, 1, -1, 113, 71, 94, -1, 113, 173, 71, + 94, -1, 1, 71, 94, -1, 1, 173, 1, 71, + 94, -1, 112, 113, 71, 94, -1, 112, 1, 71, + 94, -1, 112, 1, 173, 1, 71, 94, -1, 114, + 16, 94, 159, -1, 114, 94, 69, 94, 154, 70, + 94, -1, 114, 1, -1, 114, 16, 94, 1, 159, + -1, 114, 16, 94, -1, 114, 16, 94, 1, -1, + 12, 94, -1, 26, 94, 116, 117, 94, 71, -1, + 26, 1, 172, -1, 26, 1, 71, -1, -1, 12, + 4, -1, 11, -1, 64, -1, 12, 94, -1, -1, + 16, 94, 159, 94, -1, 72, 94, 118, 94, 119, + 73, 94, -1, 120, -1, 121, 94, 42, 94, 120, + -1, -1, 42, 94, 121, -1, -1, 40, -1, 41, + -1, 121, -1, 123, 94, 128, 122, -1, -1, 126, + -1, 124, -1, 126, 74, 94, 124, -1, 126, 1, + -1, 23, 94, 126, 69, 94, 105, 166, -1, 23, + 94, 69, 94, 105, 166, -1, 12, 94, -1, 30, + 94, 130, 94, 69, 94, 131, 70, -1, 12, -1, + 11, -1, -1, 131, 132, 94, -1, 133, 94, 69, + 94, 154, 70, -1, 134, -1, 133, 94, 74, 94, + 134, -1, 61, -1, 12, -1, 22, 1, 172, -1, + 22, 1, 71, -1, 24, 94, 69, 94, 154, 70, + 94, -1, 24, 1, 172, -1, 24, 1, 71, -1, + 75, 94, -1, 76, 94, -1, 77, 94, -1, 78, + -1, 75, -1, 140, 69, 94, 154, 97, -1, 142, + -1, 140, 74, 94, 142, -1, 140, 1, -1, 142, + 4, -1, 144, -1, 141, -1, 141, 144, -1, 142, + 137, 144, -1, 142, 1, -1, 20, -1, 19, 20, + -1, 12, 20, -1, 145, -1, 145, 146, -1, 146, + -1, 143, 145, -1, 143, 145, 146, -1, 143, 146, + -1, 12, -1, 19, -1, 147, -1, 146, 147, -1, + 146, 1, -1, 15, -1, 14, -1, 148, -1, 150, + -1, 153, -1, 17, 12, -1, 12, 94, -1, 18, + 94, 149, 79, -1, 18, 94, 149, 151, 94, 152, + 94, 79, -1, 18, 94, 143, 149, 79, -1, 18, + 94, 143, 149, 151, 94, 152, 94, 79, -1, 80, + -1, 6, -1, 7, -1, 8, -1, 9, -1, 10, + -1, 12, -1, 11, -1, 16, 12, -1, 16, 16, + 12, -1, 16, 65, 13, 73, -1, 16, 65, 63, + 73, -1, 16, 65, 12, 73, -1, 16, 66, 94, + 144, 94, 73, -1, 156, -1, 155, 156, -1, 155, + -1, 1, 173, 1, -1, 1, -1, 155, 1, -1, + 155, 173, -1, 156, 71, 94, -1, 156, 173, 71, + 94, -1, 1, 71, 94, -1, 1, 173, 1, 71, + 94, -1, 155, 156, 71, 94, -1, 155, 1, 71, + 94, -1, 155, 1, 173, 1, 71, 94, -1, 157, + 16, 94, 159, 158, -1, 163, 94, -1, 157, 1, + -1, 157, 16, 94, 1, 159, 158, -1, 157, 16, + 94, 159, 158, 1, -1, 39, 94, -1, 157, 16, + 94, -1, 157, 16, 94, 1, -1, 157, 172, -1, + 12, 94, -1, 39, 94, -1, -1, 161, -1, 159, + 160, 161, -1, 159, 1, -1, 81, 94, -1, 74, + 94, -1, -1, 162, -1, 138, 162, -1, 11, 94, + -1, 12, 94, -1, 60, 94, -1, 138, 60, 94, + -1, 64, 94, -1, 67, 94, -1, 165, -1, 82, + 94, -1, 164, -1, 163, 94, -1, 83, 94, -1, + 63, 94, -1, 62, 94, -1, 61, 94, -1, 46, + 94, -1, 47, 94, -1, 48, 94, -1, 49, 94, + -1, 50, 94, -1, 51, 94, -1, 52, 94, -1, + 53, 94, -1, 54, 94, -1, 55, 94, -1, 56, + 94, -1, 57, 94, -1, 58, 94, -1, 59, 94, + -1, 44, 94, -1, 43, 94, -1, 45, 94, -1, + 68, -1, 65, 94, 159, 73, 94, -1, 65, 94, + 1, -1, 14, 94, -1, 15, 94, -1, 97, -1, + 1, 97, -1, 38, 1, 172, -1, 38, 1, 71, + -1, 167, 95, -1, 168, 167, 95, -1, 108, -1, + 127, -1, 1, 172, -1, 69, 1, 173, 1, 97, + -1, 69, 1, 97, -1, 172, -1, 173, 1, 172, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 265, 265, 266, 267, 268, 269, 270, 271, 272, - 276, 277, 281, 287, 293, 299, 305, 319, 326, 336, - 337, 340, 342, 343, 346, 348, 353, 354, 358, 364, - 366, 370, 372, 377, 381, 383, 390, 392, 395, 397, - 405, 406, 407, 408, 409, 413, 414, 415, 416, 420, - 421, 432, 433, 434, 435, 439, 440, 441, 442, 443, - 448, 451, 454, 457, 463, 467, 473, 477, 483, 486, - 491, 494, 497, 500, 506, 509, 512, 515, 518, 523, - 526, 532, 536, 540, 544, 548, 553, 560, 566, 571, - 572, 576, 577, 581, 582, 586, 592, 595, 601, 608, - 613, 620, 623, 629, 632, 635, 641, 646, 654, 657, - 661, 666, 671, 677, 680, 686, 692, 699, 700, 704, - 705, 713, 719, 724, 733, 734, 758, 761, 767, 771, - 774, 780, 781, 782, 786, 787, 791, 797, 806, 814, - 820, 826, 829, 833, 849, 869, 875, 876, 877, 881, - 886, 893, 899, 909, 921, 934, 942, 950, 953, 966, - 972, 980, 992, 993, 994, 998, 1009, 1020, 1025, 1031, - 1039, 1051, 1054, 1057, 1060, 1063, 1066, 1072, 1073, 1077, - 1102, 1117, 1135, 1153, 1172, 1187, 1190, 1195, 1198, 1201, - 1204, 1207, 1213, 1216, 1219, 1222, 1225, 1230, 1233, 1239, - 1253, 1265, 1269, 1276, 1281, 1286, 1291, 1296, 1303, 1309, - 1310, 1314, 1319, 1333, 1339, 1342, 1345, 1351, 1352, 1353, - 1354, 1360, 1361, 1362, 1363, 1364, 1365, 1367, 1370, 1373, - 1377, 1378, 1379, 1380, 1381, 1382, 1383, 1384, 1385, 1386, - 1387, 1388, 1389, 1390, 1391, 1392, 1393, 1394, 1395, 1396, - 1400, 1408, 1417, 1433, 1434, 1441, 1444, 1450, 1453, 1459, - 1460, 1464, 1470, 1476, 1494, 1495, 1499, 1500 + 0, 263, 263, 264, 265, 266, 267, 268, 269, 270, + 274, 275, 279, 285, 291, 297, 303, 317, 324, 334, + 335, 338, 340, 341, 344, 346, 351, 352, 356, 362, + 364, 368, 370, 375, 379, 381, 388, 390, 393, 395, + 403, 404, 405, 406, 407, 411, 412, 413, 414, 418, + 419, 430, 431, 432, 433, 437, 438, 439, 440, 441, + 446, 449, 452, 455, 461, 465, 471, 475, 481, 484, + 489, 492, 495, 498, 504, 507, 510, 513, 516, 521, + 524, 530, 534, 538, 542, 546, 551, 558, 564, 569, + 570, 574, 575, 579, 580, 584, 590, 593, 599, 606, + 611, 618, 621, 627, 630, 633, 639, 644, 652, 655, + 659, 664, 669, 675, 678, 684, 690, 697, 698, 702, + 703, 711, 717, 722, 731, 732, 756, 759, 765, 769, + 772, 778, 779, 780, 784, 785, 789, 795, 804, 812, + 818, 824, 827, 831, 847, 867, 873, 874, 875, 879, + 884, 891, 897, 907, 919, 932, 940, 948, 951, 964, + 970, 978, 990, 991, 992, 996, 1007, 1018, 1023, 1029, + 1037, 1049, 1052, 1055, 1058, 1061, 1064, 1070, 1071, 1075, + 1100, 1115, 1133, 1151, 1170, 1185, 1188, 1193, 1196, 1199, + 1202, 1205, 1211, 1214, 1217, 1220, 1223, 1228, 1231, 1237, + 1251, 1263, 1267, 1274, 1279, 1284, 1289, 1294, 1301, 1307, + 1308, 1312, 1317, 1331, 1337, 1340, 1343, 1349, 1350, 1351, + 1352, 1358, 1359, 1360, 1361, 1362, 1363, 1365, 1368, 1371, + 1375, 1376, 1377, 1378, 1379, 1380, 1381, 1382, 1383, 1384, + 1385, 1386, 1387, 1388, 1389, 1390, 1391, 1392, 1393, 1394, + 1398, 1406, 1415, 1431, 1432, 1439, 1442, 1448, 1451, 1457, + 1458, 1462, 1468, 1474, 1492, 1493, 1497, 1498 }; #endif @@ -725,28 +771,27 @@ static const yytype_uint16 yyrline[] = First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "TOKEN_EOF", "error", "$undefined", "LOWEST_PREC", "UNIMPORTANT_TOK", - "WHITESPACE", "SGML_CD", "INCLUDES", "DASHMATCH", "BEGINSWITH", - "ENDSWITH", "CONTAINS", "STRING", "IDENT", "NTH", "HEX", "IDSEL", "':'", - "'.'", "'['", "'*'", "'|'", "IMPORT_SYM", "PAGE_SYM", "MEDIA_SYM", - "FONT_FACE_SYM", "CHARSET_SYM", "NAMESPACE_SYM", "WEBKIT_RULE_SYM", - "WEBKIT_DECLS_SYM", "WEBKIT_KEYFRAME_RULE_SYM", "WEBKIT_KEYFRAMES_SYM", - "WEBKIT_VALUE_SYM", "WEBKIT_MEDIAQUERY_SYM", "WEBKIT_SELECTOR_SYM", - "WEBKIT_VARIABLES_SYM", "WEBKIT_DEFINE_SYM", "VARIABLES_FOR", - "WEBKIT_VARIABLES_DECLS_SYM", "ATKEYWORD", "IMPORTANT_SYM", "MEDIA_ONLY", - "MEDIA_NOT", "MEDIA_AND", "QEMS", "EMS", "EXS", "PXS", "CMS", "MMS", - "INS", "PTS", "PCS", "DEGS", "RADS", "GRADS", "TURNS", "MSECS", "SECS", - "HERZ", "KHERZ", "DIMEN", "PERCENTAGE", "FLOATTOKEN", "INTEGER", "URI", - "FUNCTION", "NOTFUNCTION", "UNICODERANGE", "VARCALL", "'{'", "'}'", - "';'", "'('", "')'", "','", "'+'", "'~'", "'>'", "'-'", "']'", "'='", - "'/'", "'#'", "'%'", "$accept", "stylesheet", "valid_rule_or_import", - "webkit_rule", "webkit_keyframe_rule", "webkit_decls", - "webkit_variables_decls", "webkit_value", "webkit_mediaquery", - "webkit_selector", "maybe_space", "maybe_sgml", "maybe_charset", - "closing_brace", "charset", "import_list", "variables_list", - "namespace_list", "rule_list", "valid_rule", "rule", "block_rule_list", - "block_valid_rule", "block_rule", "import", "variables_rule", - "variables_media_list", "variables_declaration_list", + "TOKEN_EOF", "error", "$undefined", "UNIMPORTANT_TOK", "WHITESPACE", + "SGML_CD", "INCLUDES", "DASHMATCH", "BEGINSWITH", "ENDSWITH", "CONTAINS", + "STRING", "IDENT", "NTH", "HEX", "IDSEL", "':'", "'.'", "'['", "'*'", + "'|'", "IMPORT_SYM", "PAGE_SYM", "MEDIA_SYM", "FONT_FACE_SYM", + "CHARSET_SYM", "NAMESPACE_SYM", "WEBKIT_RULE_SYM", "WEBKIT_DECLS_SYM", + "WEBKIT_KEYFRAME_RULE_SYM", "WEBKIT_KEYFRAMES_SYM", "WEBKIT_VALUE_SYM", + "WEBKIT_MEDIAQUERY_SYM", "WEBKIT_SELECTOR_SYM", "WEBKIT_VARIABLES_SYM", + "WEBKIT_DEFINE_SYM", "VARIABLES_FOR", "WEBKIT_VARIABLES_DECLS_SYM", + "ATKEYWORD", "IMPORTANT_SYM", "MEDIA_ONLY", "MEDIA_NOT", "MEDIA_AND", + "QEMS", "EMS", "EXS", "PXS", "CMS", "MMS", "INS", "PTS", "PCS", "DEGS", + "RADS", "GRADS", "TURNS", "MSECS", "SECS", "HERZ", "KHERZ", "DIMEN", + "PERCENTAGE", "FLOATTOKEN", "INTEGER", "URI", "FUNCTION", "NOTFUNCTION", + "UNICODERANGE", "VARCALL", "'{'", "'}'", "';'", "'('", "')'", "','", + "'+'", "'~'", "'>'", "'-'", "']'", "'='", "'/'", "'#'", "'%'", "$accept", + "stylesheet", "valid_rule_or_import", "webkit_rule", + "webkit_keyframe_rule", "webkit_decls", "webkit_variables_decls", + "webkit_value", "webkit_mediaquery", "webkit_selector", "maybe_space", + "maybe_sgml", "maybe_charset", "closing_brace", "charset", "import_list", + "variables_list", "namespace_list", "rule_list", "valid_rule", "rule", + "block_rule_list", "block_valid_rule", "block_rule", "import", + "variables_rule", "variables_media_list", "variables_declaration_list", "variables_decl_list", "variables_declaration", "variable_name", "namespace", "maybe_ns_prefix", "string_or_uri", "media_feature", "maybe_media_value", "media_query_exp", "media_query_exp_list", @@ -771,47 +816,47 @@ static const char *const yytname[] = static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 58, 46, 91, - 42, 124, 272, 273, 274, 275, 276, 277, 278, 279, + 265, 266, 267, 268, 269, 270, 58, 46, 91, 42, + 124, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, - 123, 125, 59, 40, 41, 44, 43, 126, 62, 45, - 93, 61, 47, 35, 37 + 310, 311, 312, 313, 314, 315, 316, 317, 318, 123, + 125, 59, 40, 41, 44, 43, 126, 62, 45, 93, + 61, 47, 35, 37 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 85, 86, 86, 86, 86, 86, 86, 86, 86, - 87, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 95, 96, 96, 96, 97, 97, 98, 98, 99, 99, - 99, 100, 100, 100, 101, 101, 102, 102, 103, 103, - 104, 104, 104, 104, 104, 105, 105, 105, 105, 106, - 106, 107, 107, 107, 107, 108, 108, 108, 108, 108, - 109, 109, 109, 109, 110, 110, 111, 111, 112, 112, - 112, 112, 112, 112, 113, 113, 113, 113, 113, 113, - 113, 114, 114, 114, 114, 114, 114, 115, 116, 116, - 116, 117, 117, 118, 118, 119, 120, 120, 121, 122, - 122, 123, 123, 124, 124, 124, 125, 125, 126, 126, - 127, 127, 127, 128, 128, 129, 130, 131, 131, 132, - 132, 133, 134, 134, 135, 135, 136, 136, 137, 137, - 137, 138, 138, 138, 139, 139, 140, 141, 141, 141, - 142, 143, 143, 143, 143, 143, 144, 144, 144, 145, - 145, 145, 145, 145, 145, 146, 146, 147, 147, 147, - 148, 148, 148, 148, 148, 149, 150, 151, 151, 151, - 151, 152, 152, 152, 152, 152, 152, 153, 153, 154, - 154, 154, 154, 154, 154, 155, 155, 155, 155, 155, - 155, 155, 156, 156, 156, 156, 156, 156, 156, 157, - 157, 157, 157, 157, 157, 157, 157, 157, 158, 159, - 159, 160, 160, 160, 161, 161, 161, 162, 162, 162, + 0, 84, 85, 85, 85, 85, 85, 85, 85, 85, + 86, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 94, 95, 95, 95, 96, 96, 97, 97, 98, 98, + 98, 99, 99, 99, 100, 100, 101, 101, 102, 102, + 103, 103, 103, 103, 103, 104, 104, 104, 104, 105, + 105, 106, 106, 106, 106, 107, 107, 107, 107, 107, + 108, 108, 108, 108, 109, 109, 110, 110, 111, 111, + 111, 111, 111, 111, 112, 112, 112, 112, 112, 112, + 112, 113, 113, 113, 113, 113, 113, 114, 115, 115, + 115, 116, 116, 117, 117, 118, 119, 119, 120, 121, + 121, 122, 122, 123, 123, 123, 124, 124, 125, 125, + 126, 126, 126, 127, 127, 128, 129, 130, 130, 131, + 131, 132, 133, 133, 134, 134, 135, 135, 136, 136, + 136, 137, 137, 137, 138, 138, 139, 140, 140, 140, + 141, 142, 142, 142, 142, 142, 143, 143, 143, 144, + 144, 144, 144, 144, 144, 145, 145, 146, 146, 146, + 147, 147, 147, 147, 147, 148, 149, 150, 150, 150, + 150, 151, 151, 151, 151, 151, 151, 152, 152, 153, + 153, 153, 153, 153, 153, 154, 154, 154, 154, 154, + 154, 154, 155, 155, 155, 155, 155, 155, 155, 156, + 156, 156, 156, 156, 156, 156, 156, 156, 157, 158, + 158, 159, 159, 159, 160, 160, 160, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 164, 165, 165, 166, 166, 167, 167, 168, 168, 169, - 169, 170, 171, 172, 173, 173, 174, 174 + 163, 164, 164, 165, 165, 166, 166, 167, 167, 168, + 168, 169, 170, 171, 172, 172, 173, 173 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -921,75 +966,75 @@ static const yytype_int16 yydefgoto[] = /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -435 +#define YYPACT_NINF -299 static const yytype_int16 yypact[] = { - 818, 44, -36, -18, 112, 127, 66, 141, 162, 243, - -435, -435, -435, -435, -435, -435, -435, -435, -435, 239, - 43, -435, -435, -435, -435, -435, -435, -435, -435, 250, - 250, 250, 250, 250, 250, 250, 37, 304, -435, -435, - -435, -435, 763, 354, 31, 1114, 144, 622, 49, -435, - -435, 346, 344, -435, 332, 27, 23, 358, -435, -435, - 401, 370, -435, 371, -435, 381, 406, -435, 193, -435, - -435, -435, -435, -435, -435, -435, -435, -435, 171, 702, - 143, 631, -435, 756, 159, -435, -435, -435, -435, 240, - -435, -435, -435, 329, 303, 254, 199, -435, -435, -435, - -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, - -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, - -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, - -435, -435, -435, -435, -435, 949, 903, -435, -435, -435, - -435, -435, -435, -435, -435, -435, 34, -435, 342, 4, - 274, -435, 353, 59, 291, 223, 331, 395, -435, 438, - -435, -435, -435, -435, -435, 437, -435, -435, -435, 448, - 24, -435, -435, 415, -435, 349, 295, 377, 375, 399, - 198, 421, 190, -435, -435, -435, -435, -435, -435, -435, - -435, -435, 702, -435, -435, 756, 334, 380, -435, -435, - -435, 463, 250, 250, -435, 409, 398, 180, -435, 15, - -435, -435, -435, 250, 221, 182, 250, 250, 250, 250, - 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, - 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, - 250, 250, 1052, 250, 250, 250, -435, -435, -435, -435, - -435, -435, 1172, 250, 188, 166, 301, -435, -435, -435, - 472, 250, -435, 412, 404, -435, 62, -435, -435, 220, - -435, -435, -435, -435, 458, -435, 438, 438, 27, -435, - 413, 417, 430, 622, 358, 371, 473, 158, -435, -435, - -435, -435, -435, -435, -435, -435, -435, 172, -435, -435, - -435, -435, -435, -435, -435, 354, 622, 250, 250, 250, - -435, 555, 250, 420, -435, 502, -435, 459, 250, -435, - 535, -435, -435, -435, -435, 976, 250, 250, 250, -435, - -435, -435, -435, -435, 496, 250, 423, -435, 541, -435, - 250, -435, 754, -435, 424, 36, 552, 685, -435, 438, - -435, -435, -435, -435, -435, -435, 250, -435, 277, -435, - -435, -435, -435, -435, -435, -435, -435, 856, 250, -435, - -435, -435, 354, 226, 65, 203, -435, 250, 428, 250, - 250, 1172, 462, 354, 31, -435, 250, 53, 186, 250, - -435, -435, -435, 250, 429, 250, 250, 1172, 608, 354, - 479, 83, 538, 485, 482, 320, 459, -435, -435, -435, - -435, -435, -435, 438, 78, -435, -435, 447, 489, 1244, - 250, 144, 487, -435, -435, 250, -435, 462, -435, 205, - 491, -435, 250, -435, 492, -435, 186, 250, -435, 681, - 497, -435, 5, -435, -435, -435, 558, 150, -435, 438, - -435, 447, -435, -435, -435, -435, -435, 27, -435, -435, - -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, - -435, 1244, -435, -435, 250, 250, -435, 250, -435, -435, - 1114, -435, 34, 250, -435, 49, 178, 49, -435, -435, - -435, 1, -435, 438, -435, 250, 306, 827, 250, 250, - 498, 504, 151, 14, -435, -435, -435, 250, -435, -435, - -435, -435, 250 + 466, 425, -26, -20, 75, 118, 189, 139, 151, 263, + -299, -299, -299, -299, -299, -299, -299, -299, -299, 359, + 300, -299, -299, -299, -299, -299, -299, -299, -299, 278, + 278, 278, 278, 278, 278, 278, 33, 338, -299, -299, + -299, -299, 749, 313, 32, 1074, 12, 545, 44, -299, + -299, 345, 346, -299, 335, 223, 194, 354, -299, -299, + 419, 380, -299, 383, -299, 403, 408, -299, 163, -299, + -299, -299, -299, -299, -299, -299, -299, -299, 86, 561, + 199, 620, -299, 626, 161, -299, -299, -299, -299, 374, + -299, -299, -299, 351, 239, 378, 179, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, -299, -299, -299, -299, 645, 882, -299, -299, -299, + -299, -299, -299, -299, -299, -299, 30, -299, 363, 82, + 402, -299, 364, 185, 410, 190, 421, 28, -299, 301, + -299, -299, -299, -299, -299, 423, -299, -299, -299, 426, + 337, -299, -299, 35, -299, 542, 397, 640, 1, 691, + 26, 448, 220, -299, -299, -299, -299, -299, -299, -299, + -299, -299, 561, -299, -299, 626, 343, 381, -299, -299, + -299, 443, 278, 278, -299, 705, 377, 27, -299, 59, + -299, -299, -299, 278, 242, 178, 278, 278, 278, 278, + 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + 278, 278, 1012, 278, 278, 278, -299, -299, -299, -299, + -299, -299, 1132, 278, 201, 368, 312, -299, -299, -299, + 464, 278, -299, 706, 395, -299, 87, -299, -299, 188, + -299, -299, -299, -299, 442, -299, 301, 301, 223, -299, + 409, 413, 414, 545, 354, 383, 488, 69, -299, -299, + -299, -299, -299, -299, -299, -299, -299, 135, -299, -299, + -299, -299, -299, -299, -299, 313, 545, 278, 278, 278, + -299, 554, 278, 709, -299, 475, -299, 432, 278, -299, + 539, -299, -299, -299, -299, 947, 278, 278, 278, -299, + -299, -299, -299, -299, 462, 278, 712, -299, 528, -299, + 278, -299, 744, -299, 294, 165, 382, 1229, -299, 301, + -299, -299, -299, -299, -299, -299, 278, -299, 209, -299, + -299, -299, -299, -299, -299, -299, -299, 339, 278, -299, + -299, -299, 313, 257, 174, 210, -299, 278, 713, 278, + 278, 1132, 463, 313, 32, -299, 278, 42, 181, 278, + -299, -299, -299, 278, 754, 278, 278, 1132, 604, 313, + 467, 97, 531, 473, 764, 329, 432, -299, -299, -299, + -299, -299, -299, 301, 61, -299, -299, 458, 765, 1204, + 278, 12, 477, -299, -299, 278, -299, 463, -299, 172, + 478, -299, 278, -299, 479, -299, 181, 278, -299, 669, + 486, -299, 10, -299, -299, -299, 562, 217, -299, 301, + -299, 458, -299, -299, -299, -299, -299, 223, -299, -299, + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -299, 1204, -299, -299, 278, 278, -299, 278, -299, -299, + 1074, -299, 30, 278, -299, 44, 152, 44, -299, -299, + -299, 2, -299, 301, -299, 278, 307, 817, 278, 278, + 497, 504, 225, 15, -299, -299, -299, 278, -299, -299, + -299, -299, 278 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -435, -435, -435, -435, -435, -435, -435, -435, -435, -435, - -1, -21, -435, -51, -435, -435, -435, -435, -435, 229, - -435, 147, -435, -435, 256, -435, -435, -434, -435, 425, - -435, -435, -435, 130, -435, -435, 214, 174, -435, -435, - -45, 241, -176, -389, -435, -227, -435, -435, 116, -435, - 231, -154, -137, -435, -435, -130, 566, -435, 310, 449, - -61, 547, -50, -55, -435, 348, -435, 278, 194, -435, - -298, -435, 581, -435, 261, -185, -435, 443, 546, -35, - -435, -435, 218, -19, -435, 352, -435, 364, -16, -3 + -299, -299, -299, -299, -299, -299, -299, -299, -299, -299, + -1, -21, -299, -51, -299, -299, -299, -299, -299, 265, + -299, 200, -299, -299, 258, -299, -299, 352, -299, 472, + -299, -299, -299, 186, -299, -299, 238, 240, -299, -299, + -45, 279, -176, -238, -299, -194, -299, -299, 149, -299, + 293, -116, -66, -299, -299, -48, 663, -299, 429, 568, + -61, 661, -50, -55, -299, 460, -299, 391, 303, -299, + -298, -299, 692, -299, 330, -185, -299, 533, 675, -35, + -299, -299, 349, -19, -299, 469, -299, 470, -16, -3 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -999,332 +1044,324 @@ static const yytype_int16 yypgoto[] = #define YYTABLE_NINF -217 static const yytype_int16 yytable[] = { - 20, 148, 297, 39, 163, 183, 40, 374, 97, 29, - 30, 31, 32, 33, 34, 35, 317, 53, 186, 40, - 42, 43, 44, 45, 46, 47, 48, 161, 40, 199, - 461, 196, 159, 197, 21, 160, 40, 280, 281, -19, - 56, 40, 49, 50, 98, 19, 142, 143, 40, -19, - 150, 500, 22, 501, 40, 41, -19, 325, 40, 97, - 263, 173, 151, 317, 176, 161, 178, 180, 181, 182, - 433, 25, 151, 402, 422, 258, 51, -19, 144, 185, - 212, 504, 461, 40, 369, 430, 201, 319, 282, 202, - 203, 207, 209, 99, 511, 166, 213, 37, 162, 214, + 20, 148, 297, 39, 163, 40, 40, 374, 97, 29, + 30, 31, 32, 33, 34, 35, 40, 53, 186, 40, + 42, 43, 44, 45, 46, 47, 48, -191, 317, 199, + 40, 196, 159, 197, -19, 160, 40, 49, 50, 40, + 56, 142, 143, 21, 98, 150, 40, 284, 40, 22, + 142, 143, 142, 143, 285, 64, 151, 325, 433, 97, + 317, 173, 272, 273, 176, 40, 178, 180, 181, 182, + 295, 51, -19, 144, 422, 359, 360, 361, 362, 363, + 212, 504, 144, 183, 144, 430, 201, 183, 317, 202, + 203, 207, 209, 99, 511, 300, 213, -191, 369, 214, 215, 440, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - -70, 310, 244, 245, 341, 382, 162, 276, 253, 277, - 271, 199, 199, 254, 187, 311, 256, 260, 188, 40, - 261, 266, 450, -109, 269, -109, 40, 398, 371, 289, - 198, 294, 290, 299, -151, 359, 360, 361, 362, 363, - 283, 40, 183, 369, 58, 59, 60, 61, 62, 369, - -191, 317, 23, 305, 306, 142, 143, 40, 307, 308, - 309, 40, 462, 40, 179, 40, 427, 24, -19, 312, - 210, 330, 315, 40, 187, -199, 478, 318, 188, 332, - 320, 26, 439, -137, -137, 291, 211, 144, -137, 189, - 190, 191, 355, 510, 267, 40, 40, 350, -19, -151, - -151, 40, 27, -151, -151, -151, -151, -151, 364, 365, - 268, 184, 370, 28, 462, 326, 185, 371, -67, 327, - 328, -191, 322, 371, 349, 40, 199, 323, 335, 144, - 338, 304, 351, -19, 340, 463, 486, 342, 300, 37, - 97, 344, 345, -138, -138, -199, -199, -199, -138, 189, - 190, 191, 464, 356, 359, 360, 361, 362, 363, 465, - 343, 367, 321, -19, 368, 497, 423, 351, 72, 372, - 40, 351, 373, -187, 205, 55, 40, 290, 158, 37, - 37, 38, 200, 377, 333, 379, 90, 463, 380, 98, - 351, 383, 384, 424, 37, 40, 208, 413, 410, 386, - 387, 388, 389, 446, 464, 198, 393, 97, 395, -154, - 396, 465, 399, 91, 37, 405, 259, 156, 97, 58, - 59, 60, 61, 62, 414, 89, 356, 415, 365, 40, - 291, 37, 351, 265, 97, 417, 65, 90, 99, 420, - 421, 51, 92, 37, -187, 425, 472, 505, 351, 167, - 40, 198, 175, 172, 432, -150, -19, 449, 445, 436, - 448, 437, 174, -19, 91, 58, 59, 60, 61, 62, - 204, 37, 456, 270, -154, -154, 492, 177, -154, -154, - -154, -154, -154, 257, 168, 451, 142, 143, 169, 37, - 40, 288, 474, 92, 262, 475, 40, 477, 284, 40, - 272, 273, 480, 301, 302, 285, 64, 483, 278, 493, - 485, 448, 487, 49, 50, 295, -19, 37, 144, 293, - -150, -150, 40, 491, -150, -150, -150, -150, -150, 452, - 453, 279, -210, 248, 313, 142, 143, 170, 171, 37, - 316, 298, 495, 336, -216, -216, 339, -216, -216, 37, - 498, 314, 37, 499, 337, 346, 357, 352, 502, 503, - 37, 353, 376, 37, -108, 392, 507, 144, 37, 37, - 426, 438, 428, 378, 354, 512, -216, -216, -216, -216, + 319, 310, 244, 245, 450, 382, 369, 276, 253, 277, + 271, 199, 199, 254, 23, 311, 256, 260, 364, 365, + 261, 266, 258, 369, 269, 184, 185, 398, 341, 289, + 185, 294, 198, 299, 179, -151, -109, -19, -109, 40, + 283, 371, -199, 478, 161, 58, 59, 60, 61, 62, + 210, 461, 40, 305, 306, 40, 263, 24, 307, 308, + 309, 267, 40, 25, -19, 211, 427, 151, 40, 312, + 187, 402, 315, 188, 370, 40, 268, 318, 26, 371, + 320, 187, 439, 330, 188, 359, 360, 361, 362, 363, + 27, -67, 355, 161, 40, 462, 371, 350, 290, 40, + -151, -151, -19, 461, -151, -151, -151, -151, -151, -187, + 205, -199, -199, -199, 162, 326, 40, 322, 37, 327, + 328, 90, 323, 144, 349, -70, 199, 343, 335, -19, + 338, 40, 351, 28, 340, 166, 486, 342, -137, -137, + 97, 344, 345, -137, 189, 190, 191, 462, 91, -138, + -138, 291, 40, 356, -138, 189, 190, 191, 415, 365, + 304, 367, 37, 162, 368, 497, 510, 351, 40, 372, + 72, 351, 373, 463, 40, 49, 50, 92, 37, -187, + 158, 41, 321, 377, 89, 379, 40, 40, 380, 98, + 351, 383, 384, 424, 333, 90, 423, 413, 410, 386, + 387, 388, 389, 40, 142, 143, 393, 97, 395, 55, + 396, 446, 399, 40, 198, 405, 156, -154, 97, 280, + 281, -103, 91, 464, 414, 463, 356, 58, 59, 60, + 61, 62, 351, -108, 97, 417, 144, 65, 99, 420, + 421, 465, 40, 51, 167, 425, 472, 505, 351, 142, + 143, 92, 198, 404, 432, -150, -19, 449, 445, 436, + 448, 437, 172, -19, -19, 58, 59, 60, 61, 62, + 282, 40, 456, 174, 175, 464, 492, -19, 290, 177, + 332, 144, -154, -154, -19, 451, -154, -154, -154, -154, + -154, 204, 474, 465, 278, 475, 19, 477, 37, -19, + 38, 168, 480, 257, 262, 169, -19, 483, 279, 493, + 485, 448, 487, 37, 313, 200, -19, 37, 316, 208, + -150, -150, 40, 491, -150, -150, -150, -150, -150, 301, + 302, 291, 40, -210, 248, 336, 339, -19, 346, 452, + 453, 37, 495, 259, -216, -216, 378, -216, -216, 37, + 498, 265, 352, 499, 170, 171, 353, 354, 502, 503, + 37, 1, 270, 2, 3, 4, 507, 5, 6, 7, + 357, 37, 428, 8, 390, 512, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, - -216, -216, -216, -216, -216, -216, -216, -216, -216, 37, - -216, -216, -210, -210, -210, -205, 381, 250, -216, 390, - 40, -216, 394, 442, 251, -216, -216, 103, 104, 441, - 105, 106, 37, 404, 444, 443, 198, -19, 473, 37, - -153, 455, 479, 488, -19, -19, 481, 471, 484, 508, - 58, 59, 60, 61, 62, 509, 407, 489, 264, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 435, 130, 92, -205, -205, -205, 418, 248, - 482, 131, 506, 149, 132, 431, 375, -19, 133, 134, - -216, -216, 286, -216, -216, -153, -153, 40, 195, -153, - -153, -153, -153, -153, 358, 57, 416, 58, 59, 60, - 61, 62, 63, 64, 193, 490, 58, 59, 60, 61, - 62, 194, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, 394, + -216, -216, -210, -210, -210, 442, 441, 250, -216, -205, + 381, -216, 443, 40, 251, -216, -216, 473, 479, 40, + 103, 104, 481, 105, 106, 198, 484, 57, -153, 58, + 59, 60, 61, 62, 63, 64, 488, 508, 58, 59, + 60, 61, 62, 57, 509, 58, 59, 60, 61, 62, + 63, 64, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 248, 130, 92, -205, -205, + -205, 37, 407, 288, 131, -216, -216, 132, -216, -216, + 471, 133, 134, -153, -153, 264, 435, -153, -153, -153, + -153, -153, 193, 489, 58, 59, 60, 61, 62, 194, + 58, 59, 60, 61, 62, 506, 418, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, - -216, -216, -216, -216, -216, 206, -216, -216, -81, -81, - -81, 247, 248, 250, -216, -2, 406, -216, 476, 494, - 251, -216, -216, -216, -216, 329, -216, -216, 57, 411, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 412, 0, 0, 0, 57, 69, 58, 59, 60, - 61, 62, 63, 64, 51, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, - -216, -216, -216, -216, -216, -216, -216, -216, 0, -216, - -216, -84, -84, -84, 0, 397, 250, -216, 0, 40, - -216, 0, 0, 251, -216, -216, 103, 104, 40, 105, - 106, 58, 59, 60, 61, 62, 57, 0, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 0, - 0, 0, 0, 0, 69, 0, 0, 0, 107, 108, + 248, -216, -216, -81, -81, -81, 482, 431, 250, -216, + -216, -216, -216, -216, -216, 251, -216, -216, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 0, 130, 92, -85, -85, -85, 0, 248, 0, - 131, 0, -19, 132, 0, 0, 0, 133, 134, -216, - -216, 0, -216, -216, 1, 0, 2, 3, 4, 0, - 5, 6, 7, 0, 0, 0, 8, 0, 0, 0, - 0, 40, 0, 0, 0, 0, 0, 0, 0, -103, - 0, -216, -216, -216, -216, -216, -216, -216, -216, -216, + 119, 120, 121, 122, 123, 246, 125, 126, 127, 37, + 149, 293, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, - -216, -216, -216, -216, 0, -216, -216, 142, 143, 0, - 0, -19, 250, -216, 248, 0, -216, 0, 0, 251, - -216, -216, 0, 0, 0, -216, -216, 0, -216, -216, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 144, + -216, -216, -216, -216, -216, 375, -216, -216, -84, -84, + -84, 286, 195, 250, -216, 397, 358, -216, 40, 416, + 251, -216, -216, 40, 490, 103, 104, 476, 105, 106, + 37, 57, 298, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 37, 37, 314, 337, 37, 69, + 376, 37, 37, 392, 426, 329, 206, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 247, 130, 92, -85, -85, -85, 411, 412, 248, 131, + 494, -19, 132, 37, 0, 438, 133, 134, -216, -216, + 0, -216, -216, 37, 37, 444, 455, 500, 0, 501, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -216, -216, -216, - -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, - -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, - 0, -216, -216, 0, 249, 0, 0, 248, 250, -216, - 0, 0, -216, 0, 0, 251, -216, -216, -216, -216, - 0, -216, -216, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 246, 125, 126, 127, 0, 0, 0, 0, 0, 0, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, - -216, -216, -216, 0, -216, -216, 0, 0, 0, 0, - 385, 250, -216, 324, 0, -216, 0, 40, 251, -216, - -216, 0, 0, 0, 103, 104, 0, 105, 106, 0, + -216, -216, -216, 248, -216, -216, 0, 0, 0, 0, + -19, 250, -216, -216, -216, -216, -216, -216, 251, -216, + -216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, 248, -216, + -216, 0, 249, 0, 0, 0, 250, -216, -216, -216, + -216, -216, -216, 251, -216, -216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 40, - 130, 92, 0, 0, 0, 0, 103, 104, 131, 105, - 106, 132, 0, 0, 0, 133, 134, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 0, 130, 92, 103, 104, 0, 105, 106, 0, - 131, 0, 0, 132, 0, 0, 0, 133, 134, 0, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, -216, -216, -216, -216, -216, -216, -216, + -216, -216, -216, 324, -216, -216, 40, 0, 0, 0, + 385, 250, -216, 103, 104, -216, 105, 106, 251, -216, + -216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 0, - 130, 92, 0, 0, 161, 457, 0, 0, 131, 0, - 0, 132, 0, 0, 0, 133, 134, 57, 0, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, - 0, 0, 0, 51, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 40, 130, + 92, 0, 0, 0, 0, 103, 104, 131, 105, 106, + 132, 0, 0, 0, 133, 134, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 0, 130, 92, 103, 104, 0, 105, 106, 0, 131, + 0, 0, 132, 0, 0, 0, 133, 134, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 162 + 0, 0, 0, 0, 0, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 0, 130, + 92, 0, 0, 0, 161, 457, 0, 131, 0, 0, + 132, 0, 0, 0, 133, 134, 57, 0, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, -2, + 406, 0, 0, 0, 69, 0, 0, 0, 0, 0, + 0, 57, 51, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 0, 0, 0, 0, 0, 69, + 0, 0, 0, 0, 0, 0, 0, 51, 0, 0, + 0, 0, 0, 0, 162 }; static const yytype_int16 yycheck[] = { - 1, 46, 178, 19, 55, 1, 5, 305, 43, 10, - 11, 12, 13, 14, 15, 16, 1, 36, 79, 5, - 21, 22, 23, 24, 25, 26, 27, 0, 5, 84, - 419, 81, 53, 83, 70, 54, 5, 13, 14, 5, - 41, 5, 5, 6, 13, 1, 41, 42, 5, 5, - 1, 485, 70, 487, 5, 12, 12, 242, 5, 94, - 1, 62, 13, 1, 65, 0, 67, 68, 69, 70, - 17, 5, 13, 37, 372, 71, 39, 43, 73, 75, - 96, 80, 471, 5, 1, 383, 89, 72, 64, 90, - 91, 94, 95, 62, 80, 72, 97, 70, 71, 100, + 1, 46, 178, 19, 55, 4, 4, 305, 43, 10, + 11, 12, 13, 14, 15, 16, 4, 36, 79, 4, + 21, 22, 23, 24, 25, 26, 27, 0, 1, 84, + 4, 81, 53, 83, 4, 54, 4, 4, 5, 4, + 41, 40, 41, 69, 12, 1, 4, 12, 4, 69, + 40, 41, 40, 41, 19, 20, 12, 242, 16, 94, + 1, 62, 34, 35, 65, 4, 67, 68, 69, 70, + 69, 38, 42, 72, 372, 6, 7, 8, 9, 10, + 96, 79, 72, 1, 72, 383, 89, 1, 1, 90, + 91, 94, 95, 61, 79, 69, 97, 70, 1, 100, 101, 399, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 71, 192, 133, 134, 72, 320, 71, 158, 139, 160, - 156, 196, 197, 144, 1, 195, 147, 150, 5, 5, - 151, 154, 74, 70, 155, 72, 5, 342, 75, 175, - 1, 177, 12, 179, 5, 7, 8, 9, 10, 11, - 171, 5, 1, 1, 15, 16, 17, 18, 19, 1, - 0, 1, 70, 184, 185, 41, 42, 5, 189, 190, - 191, 5, 419, 5, 1, 5, 381, 70, 5, 200, - 1, 13, 205, 5, 1, 0, 1, 208, 5, 43, - 211, 70, 397, 70, 71, 65, 17, 73, 75, 76, - 77, 78, 283, 72, 1, 5, 5, 278, 5, 70, - 71, 5, 70, 74, 75, 76, 77, 78, 80, 81, - 17, 70, 70, 0, 471, 246, 75, 75, 70, 250, - 251, 71, 70, 75, 275, 5, 311, 75, 259, 73, - 263, 71, 278, 70, 265, 419, 442, 268, 70, 70, - 305, 272, 273, 70, 71, 70, 71, 72, 75, 76, - 77, 78, 419, 284, 7, 8, 9, 10, 11, 419, - 70, 292, 71, 70, 295, 480, 70, 313, 42, 300, - 5, 317, 303, 0, 1, 1, 5, 12, 52, 70, - 70, 72, 72, 314, 13, 316, 13, 471, 319, 13, - 336, 322, 323, 374, 70, 5, 72, 348, 347, 330, - 331, 332, 333, 13, 471, 1, 337, 372, 339, 5, - 341, 471, 343, 40, 70, 346, 72, 1, 383, 15, - 16, 17, 18, 19, 355, 1, 357, 80, 81, 5, - 65, 70, 378, 72, 399, 366, 22, 13, 62, 370, - 371, 39, 69, 70, 71, 376, 421, 71, 394, 21, - 5, 1, 1, 13, 385, 5, 5, 408, 404, 390, - 406, 392, 21, 12, 40, 15, 16, 17, 18, 19, - 71, 70, 418, 72, 70, 71, 457, 1, 74, 75, - 76, 77, 78, 71, 13, 416, 41, 42, 17, 70, - 5, 72, 423, 69, 71, 426, 5, 428, 13, 5, - 35, 36, 433, 12, 13, 20, 21, 438, 1, 460, - 441, 457, 443, 5, 6, 70, 65, 70, 73, 72, - 70, 71, 5, 454, 74, 75, 76, 77, 78, 12, - 13, 13, 0, 1, 1, 41, 42, 66, 67, 70, - 72, 72, 473, 1, 12, 13, 72, 15, 16, 70, - 481, 72, 70, 484, 72, 27, 13, 74, 489, 490, - 70, 74, 72, 70, 70, 72, 497, 73, 70, 70, - 72, 72, 40, 1, 74, 506, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 70, - 68, 69, 70, 71, 72, 0, 1, 75, 76, 43, - 5, 79, 1, 5, 82, 83, 84, 12, 13, 70, - 15, 16, 70, 1, 72, 70, 1, 5, 71, 70, - 5, 72, 71, 5, 12, 13, 74, 420, 71, 71, - 15, 16, 17, 18, 19, 71, 347, 447, 153, 44, + 71, 192, 133, 134, 73, 320, 1, 158, 139, 160, + 156, 196, 197, 144, 69, 195, 147, 150, 79, 80, + 151, 154, 70, 1, 155, 69, 74, 342, 71, 175, + 74, 177, 1, 179, 1, 4, 69, 4, 71, 4, + 171, 74, 0, 1, 0, 14, 15, 16, 17, 18, + 1, 419, 4, 184, 185, 4, 1, 69, 189, 190, + 191, 1, 4, 4, 4, 16, 381, 12, 4, 200, + 1, 36, 205, 4, 69, 4, 16, 208, 69, 74, + 211, 1, 397, 12, 4, 6, 7, 8, 9, 10, + 69, 69, 283, 0, 4, 419, 74, 278, 11, 4, + 69, 70, 69, 471, 73, 74, 75, 76, 77, 0, + 1, 69, 70, 71, 70, 246, 4, 69, 69, 250, + 251, 12, 74, 72, 275, 70, 311, 69, 259, 69, + 263, 4, 278, 0, 265, 71, 442, 268, 69, 70, + 305, 272, 273, 74, 75, 76, 77, 471, 39, 69, + 70, 64, 4, 284, 74, 75, 76, 77, 79, 80, + 70, 292, 69, 70, 295, 480, 71, 313, 4, 300, + 42, 317, 303, 419, 4, 4, 5, 68, 69, 70, + 52, 11, 70, 314, 1, 316, 4, 4, 319, 12, + 336, 322, 323, 374, 12, 12, 69, 348, 347, 330, + 331, 332, 333, 4, 40, 41, 337, 372, 339, 1, + 341, 12, 343, 4, 1, 346, 1, 4, 383, 12, + 13, 12, 39, 419, 355, 471, 357, 14, 15, 16, + 17, 18, 378, 69, 399, 366, 72, 21, 61, 370, + 371, 419, 4, 38, 20, 376, 421, 70, 394, 40, + 41, 68, 1, 1, 385, 4, 4, 408, 404, 390, + 406, 392, 12, 11, 12, 14, 15, 16, 17, 18, + 63, 4, 418, 20, 1, 471, 457, 4, 11, 1, + 42, 72, 69, 70, 11, 416, 73, 74, 75, 76, + 77, 70, 423, 471, 1, 426, 1, 428, 69, 4, + 71, 12, 433, 70, 70, 16, 11, 438, 12, 460, + 441, 457, 443, 69, 1, 71, 64, 69, 71, 71, + 69, 70, 4, 454, 73, 74, 75, 76, 77, 11, + 12, 64, 4, 0, 1, 1, 71, 64, 26, 11, + 12, 69, 473, 71, 11, 12, 1, 14, 15, 69, + 481, 71, 73, 484, 65, 66, 73, 73, 489, 490, + 69, 25, 71, 27, 28, 29, 497, 31, 32, 33, + 12, 69, 39, 37, 42, 506, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 1, + 67, 68, 69, 70, 71, 4, 69, 74, 75, 0, + 1, 78, 69, 4, 81, 82, 83, 70, 70, 4, + 11, 12, 73, 14, 15, 1, 70, 12, 4, 14, + 15, 16, 17, 18, 19, 20, 4, 70, 14, 15, + 16, 17, 18, 12, 70, 14, 15, 16, 17, 18, + 19, 20, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 1, 67, 68, 69, 70, + 71, 69, 347, 71, 75, 11, 12, 78, 14, 15, + 420, 82, 83, 69, 70, 153, 388, 73, 74, 75, + 76, 77, 12, 447, 14, 15, 16, 17, 18, 19, + 14, 15, 16, 17, 18, 496, 367, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 1, 67, 68, 69, 70, 71, 436, 384, 74, 75, + 11, 12, 78, 14, 15, 81, 82, 83, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 388, 68, 69, 70, 71, 72, 367, 1, - 436, 76, 496, 47, 79, 384, 306, 65, 83, 84, - 12, 13, 173, 15, 16, 70, 71, 5, 81, 74, - 75, 76, 77, 78, 286, 13, 358, 15, 16, 17, - 18, 19, 20, 21, 13, 451, 15, 16, 17, 18, - 19, 20, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 94, 68, 69, 70, 71, - 72, 135, 1, 75, 76, 0, 1, 79, 427, 471, - 82, 83, 84, 12, 13, 252, 15, 16, 13, 347, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 347, -1, -1, -1, 13, 31, 15, 16, 17, - 18, 19, 20, 21, 39, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, -1, 68, - 69, 70, 71, 72, -1, 1, 75, 76, -1, 5, - 79, -1, -1, 82, 83, 84, 12, 13, 5, 15, - 16, 15, 16, 17, 18, 19, 13, -1, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, - -1, -1, -1, -1, 31, -1, -1, -1, 44, 45, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 69, + 47, 71, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 306, 67, 68, 69, 70, + 71, 173, 81, 74, 75, 1, 286, 78, 4, 358, + 81, 82, 83, 4, 451, 11, 12, 427, 14, 15, + 69, 12, 71, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 69, 69, 71, 71, 69, 30, + 71, 69, 69, 71, 71, 252, 94, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, -1, 68, 69, 70, 71, 72, -1, 1, -1, - 76, -1, 5, 79, -1, -1, -1, 83, 84, 12, - 13, -1, 15, 16, 26, -1, 28, 29, 30, -1, - 32, 33, 34, -1, -1, -1, 38, -1, -1, -1, - -1, 5, -1, -1, -1, -1, -1, -1, -1, 13, - -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 135, 67, 68, 69, 70, 71, 347, 347, 1, 75, + 471, 4, 78, 69, -1, 71, 82, 83, 11, 12, + -1, 14, 15, 69, 69, 71, 71, 485, -1, 487, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, -1, 68, 69, 41, 42, -1, - -1, 74, 75, 76, 1, -1, 79, -1, -1, 82, - 83, 84, -1, -1, -1, 12, 13, -1, 15, 16, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 73, + 63, 64, 65, 1, 67, 68, -1, -1, -1, -1, + 73, 74, 75, 11, 12, 78, 14, 15, 81, 82, + 83, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 1, 67, + 68, -1, 70, -1, -1, -1, 74, 75, 11, 12, + 78, 14, 15, 81, 82, 83, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - -1, 68, 69, -1, 71, -1, -1, 1, 75, 76, - -1, -1, 79, -1, -1, 82, 83, 84, 12, 13, - -1, 15, 16, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, -1, -1, -1, -1, -1, -1, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, -1, 68, 69, -1, -1, -1, -1, - 74, 75, 76, 1, -1, 79, -1, 5, 82, 83, - 84, -1, -1, -1, 12, 13, -1, 15, 16, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 1, 67, 68, 4, -1, -1, -1, + 73, 74, 75, 11, 12, 78, 14, 15, 81, 82, + 83, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 44, 45, 46, 47, + -1, -1, -1, -1, -1, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 5, - 68, 69, -1, -1, -1, -1, 12, 13, 76, 15, - 16, 79, -1, -1, -1, 83, 84, -1, -1, -1, + 58, 59, 60, 61, 62, 63, 64, 65, 4, 67, + 68, -1, -1, -1, -1, 11, 12, 75, 14, 15, + 78, -1, -1, -1, 82, 83, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 44, 45, + -1, -1, -1, -1, -1, -1, -1, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, -1, 68, 69, 12, 13, -1, 15, 16, -1, - 76, -1, -1, 79, -1, -1, -1, 83, 84, -1, + -1, 67, 68, 11, 12, -1, 14, 15, -1, 75, + -1, -1, 78, -1, -1, -1, 82, 83, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 44, 45, 46, 47, + -1, -1, -1, -1, -1, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, -1, - 68, 69, -1, -1, 0, 1, -1, -1, 76, -1, - -1, 79, -1, -1, -1, 83, 84, 13, -1, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - -1, -1, -1, -1, -1, 31, -1, -1, -1, -1, - -1, -1, -1, 39, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 71 + 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, + 68, -1, -1, -1, 0, 1, -1, 75, -1, -1, + 78, -1, -1, -1, 82, 83, 12, -1, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 0, + 1, -1, -1, -1, 30, -1, -1, -1, -1, -1, + -1, 12, 38, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, -1, -1, -1, -1, -1, 30, + -1, -1, -1, -1, -1, -1, -1, 38, -1, -1, + -1, -1, -1, -1, 70 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 26, 28, 29, 30, 32, 33, 34, 38, 86, - 88, 89, 90, 91, 92, 93, 94, 97, 99, 1, - 95, 70, 70, 70, 70, 5, 70, 70, 0, 95, - 95, 95, 95, 95, 95, 95, 96, 70, 72, 173, - 5, 12, 95, 95, 95, 95, 95, 95, 95, 5, - 6, 39, 100, 168, 169, 1, 95, 13, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 31, - 87, 104, 109, 128, 130, 136, 137, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 151, 154, 1, - 13, 40, 69, 155, 156, 157, 158, 164, 13, 62, - 133, 134, 135, 12, 13, 15, 16, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 68, 76, 79, 83, 84, 139, 160, 162, 163, 164, - 165, 166, 41, 42, 73, 121, 122, 124, 125, 141, - 1, 13, 112, 113, 114, 115, 1, 101, 109, 96, - 168, 0, 71, 98, 173, 174, 72, 21, 13, 17, - 66, 67, 13, 95, 21, 1, 95, 1, 95, 1, - 95, 95, 95, 1, 70, 75, 145, 1, 5, 76, - 77, 78, 138, 13, 20, 146, 147, 147, 1, 148, - 72, 174, 95, 95, 71, 1, 157, 174, 72, 174, - 1, 17, 173, 95, 95, 95, 95, 95, 95, 95, - 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, - 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, - 95, 95, 95, 95, 95, 95, 61, 163, 1, 71, - 75, 82, 161, 95, 95, 95, 95, 71, 71, 72, - 174, 95, 71, 1, 114, 72, 174, 1, 17, 95, - 72, 173, 35, 36, 102, 110, 96, 96, 1, 13, - 13, 14, 64, 95, 13, 20, 144, 150, 72, 173, - 12, 65, 118, 72, 173, 70, 125, 127, 72, 173, - 70, 12, 13, 131, 71, 95, 95, 95, 95, 95, - 145, 147, 95, 1, 72, 174, 72, 1, 95, 72, - 95, 71, 70, 75, 1, 160, 95, 95, 95, 162, - 13, 119, 43, 13, 129, 95, 1, 72, 174, 72, - 95, 72, 95, 70, 95, 95, 27, 103, 116, 96, - 98, 173, 74, 74, 74, 145, 95, 13, 150, 7, - 8, 9, 10, 11, 80, 81, 152, 95, 95, 1, - 70, 75, 95, 95, 155, 143, 72, 95, 1, 95, - 95, 1, 160, 95, 95, 74, 95, 95, 95, 95, - 43, 123, 72, 95, 1, 95, 95, 1, 160, 95, - 126, 127, 37, 111, 1, 95, 1, 104, 105, 109, - 168, 170, 172, 96, 95, 80, 152, 95, 126, 106, - 95, 95, 155, 70, 98, 95, 72, 160, 40, 159, - 155, 135, 95, 17, 120, 121, 95, 95, 72, 160, - 155, 70, 5, 70, 72, 173, 13, 117, 173, 96, - 74, 95, 12, 13, 153, 72, 173, 1, 98, 107, - 108, 128, 130, 136, 137, 140, 167, 168, 170, 171, - 172, 106, 125, 71, 95, 95, 159, 95, 1, 71, - 95, 74, 122, 95, 71, 95, 127, 95, 5, 118, - 153, 95, 98, 96, 167, 95, 132, 160, 95, 95, - 112, 112, 95, 95, 80, 71, 133, 95, 71, 71, - 72, 80, 95 + 0, 25, 27, 28, 29, 31, 32, 33, 37, 85, + 87, 88, 89, 90, 91, 92, 93, 96, 98, 1, + 94, 69, 69, 69, 69, 4, 69, 69, 0, 94, + 94, 94, 94, 94, 94, 94, 95, 69, 71, 172, + 4, 11, 94, 94, 94, 94, 94, 94, 94, 4, + 5, 38, 99, 167, 168, 1, 94, 12, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 30, + 86, 103, 108, 127, 129, 135, 136, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 150, 153, 1, + 12, 39, 68, 154, 155, 156, 157, 163, 12, 61, + 132, 133, 134, 11, 12, 14, 15, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 67, 75, 78, 82, 83, 138, 159, 161, 162, 163, + 164, 165, 40, 41, 72, 120, 121, 123, 124, 140, + 1, 12, 111, 112, 113, 114, 1, 100, 108, 95, + 167, 0, 70, 97, 172, 173, 71, 20, 12, 16, + 65, 66, 12, 94, 20, 1, 94, 1, 94, 1, + 94, 94, 94, 1, 69, 74, 144, 1, 4, 75, + 76, 77, 137, 12, 19, 145, 146, 146, 1, 147, + 71, 173, 94, 94, 70, 1, 156, 173, 71, 173, + 1, 16, 172, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 60, 162, 1, 70, + 74, 81, 160, 94, 94, 94, 94, 70, 70, 71, + 173, 94, 70, 1, 113, 71, 173, 1, 16, 94, + 71, 172, 34, 35, 101, 109, 95, 95, 1, 12, + 12, 13, 63, 94, 12, 19, 143, 149, 71, 172, + 11, 64, 117, 71, 172, 69, 124, 126, 71, 172, + 69, 11, 12, 130, 70, 94, 94, 94, 94, 94, + 144, 146, 94, 1, 71, 173, 71, 1, 94, 71, + 94, 70, 69, 74, 1, 159, 94, 94, 94, 161, + 12, 118, 42, 12, 128, 94, 1, 71, 173, 71, + 94, 71, 94, 69, 94, 94, 26, 102, 115, 95, + 97, 172, 73, 73, 73, 144, 94, 12, 149, 6, + 7, 8, 9, 10, 79, 80, 151, 94, 94, 1, + 69, 74, 94, 94, 154, 142, 71, 94, 1, 94, + 94, 1, 159, 94, 94, 73, 94, 94, 94, 94, + 42, 122, 71, 94, 1, 94, 94, 1, 159, 94, + 125, 126, 36, 110, 1, 94, 1, 103, 104, 108, + 167, 169, 171, 95, 94, 79, 151, 94, 125, 105, + 94, 94, 154, 69, 97, 94, 71, 159, 39, 158, + 154, 134, 94, 16, 119, 120, 94, 94, 71, 159, + 154, 69, 4, 69, 71, 172, 12, 116, 172, 95, + 73, 94, 11, 12, 152, 71, 172, 1, 97, 106, + 107, 127, 129, 135, 136, 139, 166, 167, 169, 170, + 171, 105, 124, 70, 94, 94, 158, 94, 1, 70, + 94, 73, 121, 94, 70, 94, 126, 94, 4, 117, + 152, 94, 97, 95, 166, 94, 131, 159, 94, 94, + 111, 111, 94, 94, 79, 70, 132, 94, 70, 70, + 71, 79, 94 }; #define yyerrok (yyerrstatus = 0) @@ -1509,20 +1546,17 @@ yy_symbol_print (yyoutput, yytype, yyvaluep) #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) #else static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; +yy_stack_print (bottom, top) + yytype_int16 *bottom; + yytype_int16 *top; #endif { YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } + for (; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } @@ -1556,11 +1590,11 @@ yy_reduce_print (yyvsp, yyrule) /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { - YYFPRINTF (stderr, " $%d = ", yyi + 1); + fprintf (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) ); - YYFPRINTF (stderr, "\n"); + fprintf (stderr, "\n"); } } @@ -1840,8 +1874,10 @@ yydestruct (yymsg, yytype, yyvaluep) break; } } + /* Prevent warnings from -Wmissing-prototypes. */ + #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); @@ -1860,9 +1896,10 @@ int yyparse (); -/*-------------------------. -| yyparse or yypush_parse. | -`-------------------------*/ + +/*----------. +| yyparse. | +`----------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ @@ -1886,46 +1923,22 @@ yyparse () #endif #endif { -/* The lookahead symbol. */ + /* The look-ahead symbol. */ int yychar; -/* The semantic value of the lookahead symbol. */ +/* The semantic value of the look-ahead symbol. */ YYSTYPE yylval; - /* Number of syntax errors so far. */ - int yynerrs; - - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - YYSIZE_T yystacksize; +/* Number of syntax errors so far. */ +int yynerrs; + int yystate; int yyn; int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Look-ahead token as an internal (translated) token number. */ + int yytoken = 0; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; @@ -1933,28 +1946,51 @@ YYSTYPE yylval; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss = yyssa; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp; + + + #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + YYSIZE_T yystacksize = YYINITDEPTH; + + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + + /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; - yytoken = 0; - yyss = yyssa; - yyvs = yyvsa; - yystacksize = YYINITDEPTH; - YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ + yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ + yyssp = yyss; yyvsp = yyvs; @@ -1984,6 +2020,7 @@ YYSTYPE yylval; YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; + /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might @@ -1991,6 +2028,7 @@ YYSTYPE yylval; yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); yyss = yyss1; @@ -2013,8 +2051,9 @@ YYSTYPE yylval; (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); + # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); @@ -2025,6 +2064,7 @@ YYSTYPE yylval; yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; + YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); @@ -2034,9 +2074,6 @@ YYSTYPE yylval; YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - if (yystate == YYFINAL) - YYACCEPT; - goto yybackup; /*-----------. @@ -2045,16 +2082,16 @@ YYSTYPE yylval; yybackup: /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ + look-ahead token if we need one and don't already have one. */ - /* First try to decide what to do without reference to lookahead token. */ + /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; - /* Not known => get a lookahead token if don't already have one. */ + /* Not known => get a look-ahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); @@ -2086,16 +2123,20 @@ yybackup: goto yyreduce; } + if (yyn == YYFINAL) + YYACCEPT; + /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; - /* Shift the lookahead token. */ + /* Shift the look-ahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - /* Discard the shifted token. */ - yychar = YYEMPTY; + /* Discard the shifted token unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; @@ -2135,45 +2176,35 @@ yyreduce: switch (yyn) { case 12: - -/* Line 1455 of yacc.c */ -#line 281 "../css/CSSGrammar.y" +#line 279 "../css/CSSGrammar.y" { static_cast(parser)->m_rule = (yyvsp[(4) - (6)].rule); ;} break; case 13: - -/* Line 1455 of yacc.c */ -#line 287 "../css/CSSGrammar.y" +#line 285 "../css/CSSGrammar.y" { static_cast(parser)->m_keyframe = (yyvsp[(4) - (6)].keyframeRule); ;} break; case 14: - -/* Line 1455 of yacc.c */ -#line 293 "../css/CSSGrammar.y" +#line 291 "../css/CSSGrammar.y" { /* can be empty */ ;} break; case 15: - -/* Line 1455 of yacc.c */ -#line 299 "../css/CSSGrammar.y" +#line 297 "../css/CSSGrammar.y" { /* can be empty */ ;} break; case 16: - -/* Line 1455 of yacc.c */ -#line 305 "../css/CSSGrammar.y" +#line 303 "../css/CSSGrammar.y" { CSSParser* p = static_cast(parser); if ((yyvsp[(4) - (5)].valueList)) { @@ -2188,9 +2219,7 @@ yyreduce: break; case 17: - -/* Line 1455 of yacc.c */ -#line 319 "../css/CSSGrammar.y" +#line 317 "../css/CSSGrammar.y" { CSSParser* p = static_cast(parser); p->m_mediaQuery = p->sinkFloatingMediaQuery((yyvsp[(4) - (5)].mediaQuery)); @@ -2198,9 +2227,7 @@ yyreduce: break; case 18: - -/* Line 1455 of yacc.c */ -#line 326 "../css/CSSGrammar.y" +#line 324 "../css/CSSGrammar.y" { if ((yyvsp[(4) - (5)].selectorList)) { CSSParser* p = static_cast(parser); @@ -2211,17 +2238,13 @@ yyreduce: break; case 25: - -/* Line 1455 of yacc.c */ -#line 348 "../css/CSSGrammar.y" +#line 346 "../css/CSSGrammar.y" { ;} break; case 28: - -/* Line 1455 of yacc.c */ -#line 358 "../css/CSSGrammar.y" +#line 356 "../css/CSSGrammar.y" { CSSParser* p = static_cast(parser); (yyval.rule) = static_cast(parser)->createCharsetRule((yyvsp[(3) - (5)].string)); @@ -2231,25 +2254,19 @@ yyreduce: break; case 29: - -/* Line 1455 of yacc.c */ -#line 364 "../css/CSSGrammar.y" +#line 362 "../css/CSSGrammar.y" { ;} break; case 30: - -/* Line 1455 of yacc.c */ -#line 366 "../css/CSSGrammar.y" +#line 364 "../css/CSSGrammar.y" { ;} break; case 32: - -/* Line 1455 of yacc.c */ -#line 372 "../css/CSSGrammar.y" +#line 370 "../css/CSSGrammar.y" { CSSParser* p = static_cast(parser); if ((yyvsp[(2) - (3)].rule) && p->m_styleSheet) @@ -2258,17 +2275,13 @@ yyreduce: break; case 33: - -/* Line 1455 of yacc.c */ -#line 377 "../css/CSSGrammar.y" +#line 375 "../css/CSSGrammar.y" { ;} break; case 35: - -/* Line 1455 of yacc.c */ -#line 383 "../css/CSSGrammar.y" +#line 381 "../css/CSSGrammar.y" { CSSParser* p = static_cast(parser); if ((yyvsp[(2) - (3)].rule) && p->m_styleSheet) @@ -2277,9 +2290,7 @@ yyreduce: break; case 39: - -/* Line 1455 of yacc.c */ -#line 397 "../css/CSSGrammar.y" +#line 395 "../css/CSSGrammar.y" { CSSParser* p = static_cast(parser); if ((yyvsp[(2) - (3)].rule) && p->m_styleSheet) @@ -2288,16 +2299,12 @@ yyreduce: break; case 49: - -/* Line 1455 of yacc.c */ -#line 420 "../css/CSSGrammar.y" +#line 418 "../css/CSSGrammar.y" { (yyval.ruleList) = 0; ;} break; case 50: - -/* Line 1455 of yacc.c */ -#line 421 "../css/CSSGrammar.y" +#line 419 "../css/CSSGrammar.y" { (yyval.ruleList) = (yyvsp[(1) - (3)].ruleList); if ((yyvsp[(2) - (3)].rule)) { @@ -2309,90 +2316,70 @@ yyreduce: break; case 60: - -/* Line 1455 of yacc.c */ -#line 448 "../css/CSSGrammar.y" +#line 446 "../css/CSSGrammar.y" { (yyval.rule) = static_cast(parser)->createImportRule((yyvsp[(3) - (6)].string), (yyvsp[(5) - (6)].mediaList)); ;} break; case 61: - -/* Line 1455 of yacc.c */ -#line 451 "../css/CSSGrammar.y" +#line 449 "../css/CSSGrammar.y" { (yyval.rule) = 0; ;} break; case 62: - -/* Line 1455 of yacc.c */ -#line 454 "../css/CSSGrammar.y" +#line 452 "../css/CSSGrammar.y" { (yyval.rule) = 0; ;} break; case 63: - -/* Line 1455 of yacc.c */ -#line 457 "../css/CSSGrammar.y" +#line 455 "../css/CSSGrammar.y" { (yyval.rule) = 0; ;} break; case 64: - -/* Line 1455 of yacc.c */ -#line 463 "../css/CSSGrammar.y" +#line 461 "../css/CSSGrammar.y" { (yyval.rule) = static_cast(parser)->createVariablesRule((yyvsp[(3) - (7)].mediaList), true); ;} break; case 65: - -/* Line 1455 of yacc.c */ -#line 467 "../css/CSSGrammar.y" +#line 465 "../css/CSSGrammar.y" { (yyval.rule) = static_cast(parser)->createVariablesRule((yyvsp[(3) - (7)].mediaList), false); ;} break; case 66: - -/* Line 1455 of yacc.c */ -#line 473 "../css/CSSGrammar.y" +#line 471 "../css/CSSGrammar.y" { (yyval.mediaList) = static_cast(parser)->createMediaList(); ;} break; case 67: - -/* Line 1455 of yacc.c */ -#line 477 "../css/CSSGrammar.y" +#line 475 "../css/CSSGrammar.y" { (yyval.mediaList) = (yyvsp[(3) - (3)].mediaList); ;} break; case 68: - -/* Line 1455 of yacc.c */ -#line 483 "../css/CSSGrammar.y" +#line 481 "../css/CSSGrammar.y" { (yyval.boolean) = (yyvsp[(1) - (1)].boolean); ;} break; case 69: - -/* Line 1455 of yacc.c */ -#line 486 "../css/CSSGrammar.y" +#line 484 "../css/CSSGrammar.y" { (yyval.boolean) = (yyvsp[(1) - (2)].boolean); if ((yyvsp[(2) - (2)].boolean)) @@ -2401,81 +2388,63 @@ yyreduce: break; case 70: - -/* Line 1455 of yacc.c */ -#line 491 "../css/CSSGrammar.y" +#line 489 "../css/CSSGrammar.y" { (yyval.boolean) = (yyvsp[(1) - (1)].boolean); ;} break; case 71: - -/* Line 1455 of yacc.c */ -#line 494 "../css/CSSGrammar.y" +#line 492 "../css/CSSGrammar.y" { (yyval.boolean) = false; ;} break; case 72: - -/* Line 1455 of yacc.c */ -#line 497 "../css/CSSGrammar.y" +#line 495 "../css/CSSGrammar.y" { (yyval.boolean) = false; ;} break; case 73: - -/* Line 1455 of yacc.c */ -#line 500 "../css/CSSGrammar.y" +#line 498 "../css/CSSGrammar.y" { (yyval.boolean) = (yyvsp[(1) - (2)].boolean); ;} break; case 74: - -/* Line 1455 of yacc.c */ -#line 506 "../css/CSSGrammar.y" +#line 504 "../css/CSSGrammar.y" { (yyval.boolean) = (yyvsp[(1) - (3)].boolean); ;} break; case 75: - -/* Line 1455 of yacc.c */ -#line 509 "../css/CSSGrammar.y" +#line 507 "../css/CSSGrammar.y" { (yyval.boolean) = false; ;} break; case 76: - -/* Line 1455 of yacc.c */ -#line 512 "../css/CSSGrammar.y" +#line 510 "../css/CSSGrammar.y" { (yyval.boolean) = false; ;} break; case 77: - -/* Line 1455 of yacc.c */ -#line 515 "../css/CSSGrammar.y" +#line 513 "../css/CSSGrammar.y" { (yyval.boolean) = false; ;} break; case 78: - -/* Line 1455 of yacc.c */ -#line 518 "../css/CSSGrammar.y" +#line 516 "../css/CSSGrammar.y" { (yyval.boolean) = (yyvsp[(1) - (4)].boolean); if ((yyvsp[(2) - (4)].boolean)) @@ -2484,63 +2453,49 @@ yyreduce: break; case 79: - -/* Line 1455 of yacc.c */ -#line 523 "../css/CSSGrammar.y" +#line 521 "../css/CSSGrammar.y" { (yyval.boolean) = (yyvsp[(1) - (4)].boolean); ;} break; case 80: - -/* Line 1455 of yacc.c */ -#line 526 "../css/CSSGrammar.y" +#line 524 "../css/CSSGrammar.y" { (yyval.boolean) = (yyvsp[(1) - (6)].boolean); ;} break; case 81: - -/* Line 1455 of yacc.c */ -#line 532 "../css/CSSGrammar.y" +#line 530 "../css/CSSGrammar.y" { (yyval.boolean) = static_cast(parser)->addVariable((yyvsp[(1) - (4)].string), (yyvsp[(4) - (4)].valueList)); ;} break; case 82: - -/* Line 1455 of yacc.c */ -#line 536 "../css/CSSGrammar.y" +#line 534 "../css/CSSGrammar.y" { (yyval.boolean) = static_cast(parser)->addVariableDeclarationBlock((yyvsp[(1) - (7)].string)); ;} break; case 83: - -/* Line 1455 of yacc.c */ -#line 540 "../css/CSSGrammar.y" +#line 538 "../css/CSSGrammar.y" { (yyval.boolean) = false; ;} break; case 84: - -/* Line 1455 of yacc.c */ -#line 544 "../css/CSSGrammar.y" +#line 542 "../css/CSSGrammar.y" { (yyval.boolean) = false; ;} break; case 85: - -/* Line 1455 of yacc.c */ -#line 548 "../css/CSSGrammar.y" +#line 546 "../css/CSSGrammar.y" { /* @variables { varname: } Just reduce away this variable with no value. */ (yyval.boolean) = false; @@ -2548,9 +2503,7 @@ yyreduce: break; case 86: - -/* Line 1455 of yacc.c */ -#line 553 "../css/CSSGrammar.y" +#line 551 "../css/CSSGrammar.y" { /* if we come across rules with invalid values like this case: @variables { varname: *; }, just discard the property/value pair */ (yyval.boolean) = false; @@ -2558,18 +2511,14 @@ yyreduce: break; case 87: - -/* Line 1455 of yacc.c */ -#line 560 "../css/CSSGrammar.y" +#line 558 "../css/CSSGrammar.y" { (yyval.string) = (yyvsp[(1) - (2)].string); ;} break; case 88: - -/* Line 1455 of yacc.c */ -#line 566 "../css/CSSGrammar.y" +#line 564 "../css/CSSGrammar.y" { CSSParser* p = static_cast(parser); if (p->m_styleSheet) @@ -2578,50 +2527,38 @@ yyreduce: break; case 91: - -/* Line 1455 of yacc.c */ -#line 576 "../css/CSSGrammar.y" +#line 574 "../css/CSSGrammar.y" { (yyval.string).characters = 0; ;} break; case 92: - -/* Line 1455 of yacc.c */ -#line 577 "../css/CSSGrammar.y" +#line 575 "../css/CSSGrammar.y" { (yyval.string) = (yyvsp[(1) - (2)].string); ;} break; case 95: - -/* Line 1455 of yacc.c */ -#line 586 "../css/CSSGrammar.y" +#line 584 "../css/CSSGrammar.y" { (yyval.string) = (yyvsp[(1) - (2)].string); ;} break; case 96: - -/* Line 1455 of yacc.c */ -#line 592 "../css/CSSGrammar.y" +#line 590 "../css/CSSGrammar.y" { (yyval.valueList) = 0; ;} break; case 97: - -/* Line 1455 of yacc.c */ -#line 595 "../css/CSSGrammar.y" +#line 593 "../css/CSSGrammar.y" { (yyval.valueList) = (yyvsp[(3) - (4)].valueList); ;} break; case 98: - -/* Line 1455 of yacc.c */ -#line 601 "../css/CSSGrammar.y" +#line 599 "../css/CSSGrammar.y" { (yyvsp[(3) - (7)].string).lower(); (yyval.mediaQueryExp) = static_cast(parser)->createFloatingMediaQueryExp((yyvsp[(3) - (7)].string), (yyvsp[(5) - (7)].valueList)); @@ -2629,9 +2566,7 @@ yyreduce: break; case 99: - -/* Line 1455 of yacc.c */ -#line 608 "../css/CSSGrammar.y" +#line 606 "../css/CSSGrammar.y" { CSSParser* p = static_cast(parser); (yyval.mediaQueryExpList) = p->createFloatingMediaQueryExpList(); @@ -2640,9 +2575,7 @@ yyreduce: break; case 100: - -/* Line 1455 of yacc.c */ -#line 613 "../css/CSSGrammar.y" +#line 611 "../css/CSSGrammar.y" { (yyval.mediaQueryExpList) = (yyvsp[(1) - (5)].mediaQueryExpList); (yyval.mediaQueryExpList)->append(static_cast(parser)->sinkFloatingMediaQueryExp((yyvsp[(5) - (5)].mediaQueryExp))); @@ -2650,54 +2583,42 @@ yyreduce: break; case 101: - -/* Line 1455 of yacc.c */ -#line 620 "../css/CSSGrammar.y" +#line 618 "../css/CSSGrammar.y" { (yyval.mediaQueryExpList) = static_cast(parser)->createFloatingMediaQueryExpList(); ;} break; case 102: - -/* Line 1455 of yacc.c */ -#line 623 "../css/CSSGrammar.y" +#line 621 "../css/CSSGrammar.y" { (yyval.mediaQueryExpList) = (yyvsp[(3) - (3)].mediaQueryExpList); ;} break; case 103: - -/* Line 1455 of yacc.c */ -#line 629 "../css/CSSGrammar.y" +#line 627 "../css/CSSGrammar.y" { (yyval.mediaQueryRestrictor) = MediaQuery::None; ;} break; case 104: - -/* Line 1455 of yacc.c */ -#line 632 "../css/CSSGrammar.y" +#line 630 "../css/CSSGrammar.y" { (yyval.mediaQueryRestrictor) = MediaQuery::Only; ;} break; case 105: - -/* Line 1455 of yacc.c */ -#line 635 "../css/CSSGrammar.y" +#line 633 "../css/CSSGrammar.y" { (yyval.mediaQueryRestrictor) = MediaQuery::Not; ;} break; case 106: - -/* Line 1455 of yacc.c */ -#line 641 "../css/CSSGrammar.y" +#line 639 "../css/CSSGrammar.y" { CSSParser* p = static_cast(parser); (yyval.mediaQuery) = p->createFloatingMediaQuery(p->sinkFloatingMediaQueryExpList((yyvsp[(1) - (1)].mediaQueryExpList))); @@ -2705,9 +2626,7 @@ yyreduce: break; case 107: - -/* Line 1455 of yacc.c */ -#line 646 "../css/CSSGrammar.y" +#line 644 "../css/CSSGrammar.y" { CSSParser* p = static_cast(parser); (yyvsp[(3) - (4)].string).lower(); @@ -2716,18 +2635,14 @@ yyreduce: break; case 108: - -/* Line 1455 of yacc.c */ -#line 654 "../css/CSSGrammar.y" +#line 652 "../css/CSSGrammar.y" { (yyval.mediaList) = static_cast(parser)->createMediaList(); ;} break; case 110: - -/* Line 1455 of yacc.c */ -#line 661 "../css/CSSGrammar.y" +#line 659 "../css/CSSGrammar.y" { CSSParser* p = static_cast(parser); (yyval.mediaList) = p->createMediaList(); @@ -2736,9 +2651,7 @@ yyreduce: break; case 111: - -/* Line 1455 of yacc.c */ -#line 666 "../css/CSSGrammar.y" +#line 664 "../css/CSSGrammar.y" { (yyval.mediaList) = (yyvsp[(1) - (4)].mediaList); if ((yyval.mediaList)) @@ -2747,45 +2660,35 @@ yyreduce: break; case 112: - -/* Line 1455 of yacc.c */ -#line 671 "../css/CSSGrammar.y" +#line 669 "../css/CSSGrammar.y" { (yyval.mediaList) = 0; ;} break; case 113: - -/* Line 1455 of yacc.c */ -#line 677 "../css/CSSGrammar.y" +#line 675 "../css/CSSGrammar.y" { (yyval.rule) = static_cast(parser)->createMediaRule((yyvsp[(3) - (7)].mediaList), (yyvsp[(6) - (7)].ruleList)); ;} break; case 114: - -/* Line 1455 of yacc.c */ -#line 680 "../css/CSSGrammar.y" +#line 678 "../css/CSSGrammar.y" { (yyval.rule) = static_cast(parser)->createMediaRule(0, (yyvsp[(5) - (6)].ruleList)); ;} break; case 115: - -/* Line 1455 of yacc.c */ -#line 686 "../css/CSSGrammar.y" +#line 684 "../css/CSSGrammar.y" { (yyval.string) = (yyvsp[(1) - (2)].string); ;} break; case 116: - -/* Line 1455 of yacc.c */ -#line 692 "../css/CSSGrammar.y" +#line 690 "../css/CSSGrammar.y" { (yyval.rule) = (yyvsp[(7) - (8)].keyframesRule); (yyvsp[(7) - (8)].keyframesRule)->setNameInternal((yyvsp[(3) - (8)].string)); @@ -2793,16 +2696,12 @@ yyreduce: break; case 119: - -/* Line 1455 of yacc.c */ -#line 704 "../css/CSSGrammar.y" +#line 702 "../css/CSSGrammar.y" { (yyval.keyframesRule) = static_cast(parser)->createKeyframesRule(); ;} break; case 120: - -/* Line 1455 of yacc.c */ -#line 705 "../css/CSSGrammar.y" +#line 703 "../css/CSSGrammar.y" { (yyval.keyframesRule) = (yyvsp[(1) - (3)].keyframesRule); if ((yyvsp[(2) - (3)].keyframeRule)) @@ -2811,18 +2710,14 @@ yyreduce: break; case 121: - -/* Line 1455 of yacc.c */ -#line 713 "../css/CSSGrammar.y" +#line 711 "../css/CSSGrammar.y" { (yyval.keyframeRule) = static_cast(parser)->createKeyframeRule((yyvsp[(1) - (6)].valueList)); ;} break; case 122: - -/* Line 1455 of yacc.c */ -#line 719 "../css/CSSGrammar.y" +#line 717 "../css/CSSGrammar.y" { CSSParser* p = static_cast(parser); (yyval.valueList) = p->createFloatingValueList(); @@ -2831,9 +2726,7 @@ yyreduce: break; case 123: - -/* Line 1455 of yacc.c */ -#line 724 "../css/CSSGrammar.y" +#line 722 "../css/CSSGrammar.y" { CSSParser* p = static_cast(parser); (yyval.valueList) = (yyvsp[(1) - (5)].valueList); @@ -2843,16 +2736,12 @@ yyreduce: break; case 124: - -/* Line 1455 of yacc.c */ -#line 733 "../css/CSSGrammar.y" +#line 731 "../css/CSSGrammar.y" { (yyval.value).id = 0; (yyval.value).isInt = false; (yyval.value).fValue = (yyvsp[(1) - (1)].number); (yyval.value).unit = CSSPrimitiveValue::CSS_NUMBER; ;} break; case 125: - -/* Line 1455 of yacc.c */ -#line 734 "../css/CSSGrammar.y" +#line 732 "../css/CSSGrammar.y" { (yyval.value).id = 0; (yyval.value).isInt = false; (yyval.value).unit = CSSPrimitiveValue::CSS_NUMBER; CSSParserString& str = (yyvsp[(1) - (1)].string); @@ -2866,98 +2755,74 @@ yyreduce: break; case 126: - -/* Line 1455 of yacc.c */ -#line 758 "../css/CSSGrammar.y" +#line 756 "../css/CSSGrammar.y" { (yyval.rule) = 0; ;} break; case 127: - -/* Line 1455 of yacc.c */ -#line 761 "../css/CSSGrammar.y" +#line 759 "../css/CSSGrammar.y" { (yyval.rule) = 0; ;} break; case 128: - -/* Line 1455 of yacc.c */ -#line 768 "../css/CSSGrammar.y" +#line 766 "../css/CSSGrammar.y" { (yyval.rule) = static_cast(parser)->createFontFaceRule(); ;} break; case 129: - -/* Line 1455 of yacc.c */ -#line 771 "../css/CSSGrammar.y" +#line 769 "../css/CSSGrammar.y" { (yyval.rule) = 0; ;} break; case 130: - -/* Line 1455 of yacc.c */ -#line 774 "../css/CSSGrammar.y" +#line 772 "../css/CSSGrammar.y" { (yyval.rule) = 0; ;} break; case 131: - -/* Line 1455 of yacc.c */ -#line 780 "../css/CSSGrammar.y" +#line 778 "../css/CSSGrammar.y" { (yyval.relation) = CSSSelector::DirectAdjacent; ;} break; case 132: - -/* Line 1455 of yacc.c */ -#line 781 "../css/CSSGrammar.y" +#line 779 "../css/CSSGrammar.y" { (yyval.relation) = CSSSelector::IndirectAdjacent; ;} break; case 133: - -/* Line 1455 of yacc.c */ -#line 782 "../css/CSSGrammar.y" +#line 780 "../css/CSSGrammar.y" { (yyval.relation) = CSSSelector::Child; ;} break; case 134: - -/* Line 1455 of yacc.c */ -#line 786 "../css/CSSGrammar.y" +#line 784 "../css/CSSGrammar.y" { (yyval.integer) = -1; ;} break; case 135: - -/* Line 1455 of yacc.c */ -#line 787 "../css/CSSGrammar.y" +#line 785 "../css/CSSGrammar.y" { (yyval.integer) = 1; ;} break; case 136: - -/* Line 1455 of yacc.c */ -#line 791 "../css/CSSGrammar.y" +#line 789 "../css/CSSGrammar.y" { (yyval.rule) = static_cast(parser)->createStyleRule((yyvsp[(1) - (5)].selectorList)); ;} break; case 137: - -/* Line 1455 of yacc.c */ -#line 797 "../css/CSSGrammar.y" +#line 795 "../css/CSSGrammar.y" { if ((yyvsp[(1) - (1)].selector)) { CSSParser* p = static_cast(parser); @@ -2970,9 +2835,7 @@ yyreduce: break; case 138: - -/* Line 1455 of yacc.c */ -#line 806 "../css/CSSGrammar.y" +#line 804 "../css/CSSGrammar.y" { if ((yyvsp[(1) - (4)].selectorList) && (yyvsp[(4) - (4)].selector)) { CSSParser* p = static_cast(parser); @@ -2984,45 +2847,35 @@ yyreduce: break; case 139: - -/* Line 1455 of yacc.c */ -#line 814 "../css/CSSGrammar.y" +#line 812 "../css/CSSGrammar.y" { (yyval.selectorList) = 0; ;} break; case 140: - -/* Line 1455 of yacc.c */ -#line 820 "../css/CSSGrammar.y" +#line 818 "../css/CSSGrammar.y" { (yyval.selector) = (yyvsp[(1) - (2)].selector); ;} break; case 141: - -/* Line 1455 of yacc.c */ -#line 826 "../css/CSSGrammar.y" +#line 824 "../css/CSSGrammar.y" { (yyval.selector) = (yyvsp[(1) - (1)].selector); ;} break; case 142: - -/* Line 1455 of yacc.c */ -#line 830 "../css/CSSGrammar.y" +#line 828 "../css/CSSGrammar.y" { (yyval.selector) = (yyvsp[(1) - (1)].selector); ;} break; case 143: - -/* Line 1455 of yacc.c */ -#line 834 "../css/CSSGrammar.y" +#line 832 "../css/CSSGrammar.y" { (yyval.selector) = (yyvsp[(2) - (2)].selector); if (!(yyvsp[(1) - (2)].selector)) @@ -3041,9 +2894,7 @@ yyreduce: break; case 144: - -/* Line 1455 of yacc.c */ -#line 849 "../css/CSSGrammar.y" +#line 847 "../css/CSSGrammar.y" { (yyval.selector) = (yyvsp[(3) - (3)].selector); if (!(yyvsp[(1) - (3)].selector)) @@ -3067,39 +2918,29 @@ yyreduce: break; case 145: - -/* Line 1455 of yacc.c */ -#line 869 "../css/CSSGrammar.y" +#line 867 "../css/CSSGrammar.y" { (yyval.selector) = 0; ;} break; case 146: - -/* Line 1455 of yacc.c */ -#line 875 "../css/CSSGrammar.y" +#line 873 "../css/CSSGrammar.y" { (yyval.string).characters = 0; (yyval.string).length = 0; ;} break; case 147: - -/* Line 1455 of yacc.c */ -#line 876 "../css/CSSGrammar.y" +#line 874 "../css/CSSGrammar.y" { static UChar star = '*'; (yyval.string).characters = ☆ (yyval.string).length = 1; ;} break; case 148: - -/* Line 1455 of yacc.c */ -#line 877 "../css/CSSGrammar.y" +#line 875 "../css/CSSGrammar.y" { (yyval.string) = (yyvsp[(1) - (2)].string); ;} break; case 149: - -/* Line 1455 of yacc.c */ -#line 881 "../css/CSSGrammar.y" +#line 879 "../css/CSSGrammar.y" { CSSParser* p = static_cast(parser); (yyval.selector) = p->createFloatingSelector(); @@ -3108,9 +2949,7 @@ yyreduce: break; case 150: - -/* Line 1455 of yacc.c */ -#line 886 "../css/CSSGrammar.y" +#line 884 "../css/CSSGrammar.y" { (yyval.selector) = (yyvsp[(2) - (2)].selector); if ((yyval.selector)) { @@ -3121,9 +2960,7 @@ yyreduce: break; case 151: - -/* Line 1455 of yacc.c */ -#line 893 "../css/CSSGrammar.y" +#line 891 "../css/CSSGrammar.y" { (yyval.selector) = (yyvsp[(1) - (1)].selector); CSSParser* p = static_cast(parser); @@ -3133,9 +2970,7 @@ yyreduce: break; case 152: - -/* Line 1455 of yacc.c */ -#line 899 "../css/CSSGrammar.y" +#line 897 "../css/CSSGrammar.y" { AtomicString namespacePrefix = (yyvsp[(1) - (2)].string); CSSParser* p = static_cast(parser); @@ -3149,9 +2984,7 @@ yyreduce: break; case 153: - -/* Line 1455 of yacc.c */ -#line 909 "../css/CSSGrammar.y" +#line 907 "../css/CSSGrammar.y" { (yyval.selector) = (yyvsp[(3) - (3)].selector); if ((yyval.selector)) { @@ -3167,9 +3000,7 @@ yyreduce: break; case 154: - -/* Line 1455 of yacc.c */ -#line 921 "../css/CSSGrammar.y" +#line 919 "../css/CSSGrammar.y" { (yyval.selector) = (yyvsp[(2) - (2)].selector); if ((yyval.selector)) { @@ -3183,9 +3014,7 @@ yyreduce: break; case 155: - -/* Line 1455 of yacc.c */ -#line 934 "../css/CSSGrammar.y" +#line 932 "../css/CSSGrammar.y" { CSSParserString& str = (yyvsp[(1) - (1)].string); CSSParser* p = static_cast(parser); @@ -3197,9 +3026,7 @@ yyreduce: break; case 156: - -/* Line 1455 of yacc.c */ -#line 942 "../css/CSSGrammar.y" +#line 940 "../css/CSSGrammar.y" { static UChar star = '*'; (yyval.string).characters = ☆ @@ -3208,18 +3035,14 @@ yyreduce: break; case 157: - -/* Line 1455 of yacc.c */ -#line 950 "../css/CSSGrammar.y" +#line 948 "../css/CSSGrammar.y" { (yyval.selector) = (yyvsp[(1) - (1)].selector); ;} break; case 158: - -/* Line 1455 of yacc.c */ -#line 953 "../css/CSSGrammar.y" +#line 951 "../css/CSSGrammar.y" { if (!(yyvsp[(2) - (2)].selector)) (yyval.selector) = 0; @@ -3236,18 +3059,14 @@ yyreduce: break; case 159: - -/* Line 1455 of yacc.c */ -#line 966 "../css/CSSGrammar.y" +#line 964 "../css/CSSGrammar.y" { (yyval.selector) = 0; ;} break; case 160: - -/* Line 1455 of yacc.c */ -#line 972 "../css/CSSGrammar.y" +#line 970 "../css/CSSGrammar.y" { CSSParser* p = static_cast(parser); (yyval.selector) = p->createFloatingSelector(); @@ -3259,9 +3078,7 @@ yyreduce: break; case 161: - -/* Line 1455 of yacc.c */ -#line 980 "../css/CSSGrammar.y" +#line 978 "../css/CSSGrammar.y" { if ((yyvsp[(1) - (1)].string).characters[0] >= '0' && (yyvsp[(1) - (1)].string).characters[0] <= '9') { (yyval.selector) = 0; @@ -3277,9 +3094,7 @@ yyreduce: break; case 165: - -/* Line 1455 of yacc.c */ -#line 998 "../css/CSSGrammar.y" +#line 996 "../css/CSSGrammar.y" { CSSParser* p = static_cast(parser); (yyval.selector) = p->createFloatingSelector(); @@ -3291,9 +3106,7 @@ yyreduce: break; case 166: - -/* Line 1455 of yacc.c */ -#line 1009 "../css/CSSGrammar.y" +#line 1007 "../css/CSSGrammar.y" { CSSParserString& str = (yyvsp[(1) - (2)].string); CSSParser* p = static_cast(parser); @@ -3305,9 +3118,7 @@ yyreduce: break; case 167: - -/* Line 1455 of yacc.c */ -#line 1020 "../css/CSSGrammar.y" +#line 1018 "../css/CSSGrammar.y" { (yyval.selector) = static_cast(parser)->createFloatingSelector(); (yyval.selector)->setAttribute(QualifiedName(nullAtom, (yyvsp[(3) - (4)].string), nullAtom)); @@ -3316,9 +3127,7 @@ yyreduce: break; case 168: - -/* Line 1455 of yacc.c */ -#line 1025 "../css/CSSGrammar.y" +#line 1023 "../css/CSSGrammar.y" { (yyval.selector) = static_cast(parser)->createFloatingSelector(); (yyval.selector)->setAttribute(QualifiedName(nullAtom, (yyvsp[(3) - (8)].string), nullAtom)); @@ -3328,9 +3137,7 @@ yyreduce: break; case 169: - -/* Line 1455 of yacc.c */ -#line 1031 "../css/CSSGrammar.y" +#line 1029 "../css/CSSGrammar.y" { AtomicString namespacePrefix = (yyvsp[(3) - (5)].string); CSSParser* p = static_cast(parser); @@ -3342,9 +3149,7 @@ yyreduce: break; case 170: - -/* Line 1455 of yacc.c */ -#line 1039 "../css/CSSGrammar.y" +#line 1037 "../css/CSSGrammar.y" { AtomicString namespacePrefix = (yyvsp[(3) - (9)].string); CSSParser* p = static_cast(parser); @@ -3357,63 +3162,49 @@ yyreduce: break; case 171: - -/* Line 1455 of yacc.c */ -#line 1051 "../css/CSSGrammar.y" +#line 1049 "../css/CSSGrammar.y" { (yyval.integer) = CSSSelector::Exact; ;} break; case 172: - -/* Line 1455 of yacc.c */ -#line 1054 "../css/CSSGrammar.y" +#line 1052 "../css/CSSGrammar.y" { (yyval.integer) = CSSSelector::List; ;} break; case 173: - -/* Line 1455 of yacc.c */ -#line 1057 "../css/CSSGrammar.y" +#line 1055 "../css/CSSGrammar.y" { (yyval.integer) = CSSSelector::Hyphen; ;} break; case 174: - -/* Line 1455 of yacc.c */ -#line 1060 "../css/CSSGrammar.y" +#line 1058 "../css/CSSGrammar.y" { (yyval.integer) = CSSSelector::Begin; ;} break; case 175: - -/* Line 1455 of yacc.c */ -#line 1063 "../css/CSSGrammar.y" +#line 1061 "../css/CSSGrammar.y" { (yyval.integer) = CSSSelector::End; ;} break; case 176: - -/* Line 1455 of yacc.c */ -#line 1066 "../css/CSSGrammar.y" +#line 1064 "../css/CSSGrammar.y" { (yyval.integer) = CSSSelector::Contain; ;} break; case 179: - -/* Line 1455 of yacc.c */ -#line 1077 "../css/CSSGrammar.y" +#line 1075 "../css/CSSGrammar.y" { (yyval.selector) = static_cast(parser)->createFloatingSelector(); (yyval.selector)->m_match = CSSSelector::PseudoClass; @@ -3442,9 +3233,7 @@ yyreduce: break; case 180: - -/* Line 1455 of yacc.c */ -#line 1102 "../css/CSSGrammar.y" +#line 1100 "../css/CSSGrammar.y" { (yyval.selector) = static_cast(parser)->createFloatingSelector(); (yyval.selector)->m_match = CSSSelector::PseudoElement; @@ -3462,9 +3251,7 @@ yyreduce: break; case 181: - -/* Line 1455 of yacc.c */ -#line 1117 "../css/CSSGrammar.y" +#line 1115 "../css/CSSGrammar.y" { CSSParser *p = static_cast(parser); (yyval.selector) = p->createFloatingSelector(); @@ -3485,9 +3272,7 @@ yyreduce: break; case 182: - -/* Line 1455 of yacc.c */ -#line 1135 "../css/CSSGrammar.y" +#line 1133 "../css/CSSGrammar.y" { CSSParser *p = static_cast(parser); (yyval.selector) = p->createFloatingSelector(); @@ -3508,9 +3293,7 @@ yyreduce: break; case 183: - -/* Line 1455 of yacc.c */ -#line 1153 "../css/CSSGrammar.y" +#line 1151 "../css/CSSGrammar.y" { CSSParser *p = static_cast(parser); (yyval.selector) = p->createFloatingSelector(); @@ -3532,9 +3315,7 @@ yyreduce: break; case 184: - -/* Line 1455 of yacc.c */ -#line 1172 "../css/CSSGrammar.y" +#line 1170 "../css/CSSGrammar.y" { if (!(yyvsp[(4) - (6)].selector)) (yyval.selector) = 0; @@ -3550,18 +3331,14 @@ yyreduce: break; case 185: - -/* Line 1455 of yacc.c */ -#line 1187 "../css/CSSGrammar.y" +#line 1185 "../css/CSSGrammar.y" { (yyval.boolean) = (yyvsp[(1) - (1)].boolean); ;} break; case 186: - -/* Line 1455 of yacc.c */ -#line 1190 "../css/CSSGrammar.y" +#line 1188 "../css/CSSGrammar.y" { (yyval.boolean) = (yyvsp[(1) - (2)].boolean); if ( (yyvsp[(2) - (2)].boolean) ) @@ -3570,90 +3347,70 @@ yyreduce: break; case 187: - -/* Line 1455 of yacc.c */ -#line 1195 "../css/CSSGrammar.y" +#line 1193 "../css/CSSGrammar.y" { (yyval.boolean) = (yyvsp[(1) - (1)].boolean); ;} break; case 188: - -/* Line 1455 of yacc.c */ -#line 1198 "../css/CSSGrammar.y" +#line 1196 "../css/CSSGrammar.y" { (yyval.boolean) = false; ;} break; case 189: - -/* Line 1455 of yacc.c */ -#line 1201 "../css/CSSGrammar.y" +#line 1199 "../css/CSSGrammar.y" { (yyval.boolean) = false; ;} break; case 190: - -/* Line 1455 of yacc.c */ -#line 1204 "../css/CSSGrammar.y" +#line 1202 "../css/CSSGrammar.y" { (yyval.boolean) = (yyvsp[(1) - (2)].boolean); ;} break; case 191: - -/* Line 1455 of yacc.c */ -#line 1207 "../css/CSSGrammar.y" +#line 1205 "../css/CSSGrammar.y" { (yyval.boolean) = (yyvsp[(1) - (2)].boolean); ;} break; case 192: - -/* Line 1455 of yacc.c */ -#line 1213 "../css/CSSGrammar.y" +#line 1211 "../css/CSSGrammar.y" { (yyval.boolean) = (yyvsp[(1) - (3)].boolean); ;} break; case 193: - -/* Line 1455 of yacc.c */ -#line 1216 "../css/CSSGrammar.y" +#line 1214 "../css/CSSGrammar.y" { (yyval.boolean) = false; ;} break; case 194: - -/* Line 1455 of yacc.c */ -#line 1219 "../css/CSSGrammar.y" +#line 1217 "../css/CSSGrammar.y" { (yyval.boolean) = false; ;} break; case 195: - -/* Line 1455 of yacc.c */ -#line 1222 "../css/CSSGrammar.y" +#line 1220 "../css/CSSGrammar.y" { (yyval.boolean) = false; ;} break; case 196: - -/* Line 1455 of yacc.c */ -#line 1225 "../css/CSSGrammar.y" +#line 1223 "../css/CSSGrammar.y" { (yyval.boolean) = (yyvsp[(1) - (4)].boolean); if ((yyvsp[(2) - (4)].boolean)) @@ -3662,27 +3419,21 @@ yyreduce: break; case 197: - -/* Line 1455 of yacc.c */ -#line 1230 "../css/CSSGrammar.y" +#line 1228 "../css/CSSGrammar.y" { (yyval.boolean) = (yyvsp[(1) - (4)].boolean); ;} break; case 198: - -/* Line 1455 of yacc.c */ -#line 1233 "../css/CSSGrammar.y" +#line 1231 "../css/CSSGrammar.y" { (yyval.boolean) = (yyvsp[(1) - (6)].boolean); ;} break; case 199: - -/* Line 1455 of yacc.c */ -#line 1239 "../css/CSSGrammar.y" +#line 1237 "../css/CSSGrammar.y" { (yyval.boolean) = false; CSSParser* p = static_cast(parser); @@ -3699,9 +3450,7 @@ yyreduce: break; case 200: - -/* Line 1455 of yacc.c */ -#line 1253 "../css/CSSGrammar.y" +#line 1251 "../css/CSSGrammar.y" { CSSParser* p = static_cast(parser); p->m_valueList = new CSSParserValueList; @@ -3716,18 +3465,14 @@ yyreduce: break; case 201: - -/* Line 1455 of yacc.c */ -#line 1265 "../css/CSSGrammar.y" +#line 1263 "../css/CSSGrammar.y" { (yyval.boolean) = false; ;} break; case 202: - -/* Line 1455 of yacc.c */ -#line 1269 "../css/CSSGrammar.y" +#line 1267 "../css/CSSGrammar.y" { /* The default movable type template has letter-spacing: .none; Handle this by looking for error tokens at the start of an expr, recover the expr and then treat as an error, cleaning @@ -3737,9 +3482,7 @@ yyreduce: break; case 203: - -/* Line 1455 of yacc.c */ -#line 1276 "../css/CSSGrammar.y" +#line 1274 "../css/CSSGrammar.y" { /* When we encounter something like p {color: red !important fail;} we should drop the declaration */ (yyval.boolean) = false; @@ -3747,9 +3490,7 @@ yyreduce: break; case 204: - -/* Line 1455 of yacc.c */ -#line 1281 "../css/CSSGrammar.y" +#line 1279 "../css/CSSGrammar.y" { /* Handle this case: div { text-align: center; !important } Just reduce away the stray !important. */ (yyval.boolean) = false; @@ -3757,9 +3498,7 @@ yyreduce: break; case 205: - -/* Line 1455 of yacc.c */ -#line 1286 "../css/CSSGrammar.y" +#line 1284 "../css/CSSGrammar.y" { /* div { font-family: } Just reduce away this property with no value. */ (yyval.boolean) = false; @@ -3767,9 +3506,7 @@ yyreduce: break; case 206: - -/* Line 1455 of yacc.c */ -#line 1291 "../css/CSSGrammar.y" +#line 1289 "../css/CSSGrammar.y" { /* if we come across rules with invalid values like this case: p { weight: *; }, just discard the rule */ (yyval.boolean) = false; @@ -3777,9 +3514,7 @@ yyreduce: break; case 207: - -/* Line 1455 of yacc.c */ -#line 1296 "../css/CSSGrammar.y" +#line 1294 "../css/CSSGrammar.y" { /* if we come across: div { color{;color:maroon} }, ignore everything within curly brackets */ (yyval.boolean) = false; @@ -3787,32 +3522,24 @@ yyreduce: break; case 208: - -/* Line 1455 of yacc.c */ -#line 1303 "../css/CSSGrammar.y" +#line 1301 "../css/CSSGrammar.y" { (yyval.integer) = cssPropertyID((yyvsp[(1) - (2)].string)); ;} break; case 209: - -/* Line 1455 of yacc.c */ -#line 1309 "../css/CSSGrammar.y" +#line 1307 "../css/CSSGrammar.y" { (yyval.boolean) = true; ;} break; case 210: - -/* Line 1455 of yacc.c */ -#line 1310 "../css/CSSGrammar.y" +#line 1308 "../css/CSSGrammar.y" { (yyval.boolean) = false; ;} break; case 211: - -/* Line 1455 of yacc.c */ -#line 1314 "../css/CSSGrammar.y" +#line 1312 "../css/CSSGrammar.y" { CSSParser* p = static_cast(parser); (yyval.valueList) = p->createFloatingValueList(); @@ -3821,9 +3548,7 @@ yyreduce: break; case 212: - -/* Line 1455 of yacc.c */ -#line 1319 "../css/CSSGrammar.y" +#line 1317 "../css/CSSGrammar.y" { CSSParser* p = static_cast(parser); (yyval.valueList) = (yyvsp[(1) - (3)].valueList); @@ -3841,66 +3566,50 @@ yyreduce: break; case 213: - -/* Line 1455 of yacc.c */ -#line 1333 "../css/CSSGrammar.y" +#line 1331 "../css/CSSGrammar.y" { (yyval.valueList) = 0; ;} break; case 214: - -/* Line 1455 of yacc.c */ -#line 1339 "../css/CSSGrammar.y" +#line 1337 "../css/CSSGrammar.y" { (yyval.character) = '/'; ;} break; case 215: - -/* Line 1455 of yacc.c */ -#line 1342 "../css/CSSGrammar.y" +#line 1340 "../css/CSSGrammar.y" { (yyval.character) = ','; ;} break; case 216: - -/* Line 1455 of yacc.c */ -#line 1345 "../css/CSSGrammar.y" +#line 1343 "../css/CSSGrammar.y" { (yyval.character) = 0; ;} break; case 217: - -/* Line 1455 of yacc.c */ -#line 1351 "../css/CSSGrammar.y" +#line 1349 "../css/CSSGrammar.y" { (yyval.value) = (yyvsp[(1) - (1)].value); ;} break; case 218: - -/* Line 1455 of yacc.c */ -#line 1352 "../css/CSSGrammar.y" +#line 1350 "../css/CSSGrammar.y" { (yyval.value) = (yyvsp[(2) - (2)].value); (yyval.value).fValue *= (yyvsp[(1) - (2)].integer); ;} break; case 219: - -/* Line 1455 of yacc.c */ -#line 1353 "../css/CSSGrammar.y" +#line 1351 "../css/CSSGrammar.y" { (yyval.value).id = 0; (yyval.value).string = (yyvsp[(1) - (2)].string); (yyval.value).unit = CSSPrimitiveValue::CSS_STRING; ;} break; case 220: - -/* Line 1455 of yacc.c */ -#line 1354 "../css/CSSGrammar.y" +#line 1352 "../css/CSSGrammar.y" { (yyval.value).id = cssValueKeywordID((yyvsp[(1) - (2)].string)); (yyval.value).unit = CSSPrimitiveValue::CSS_IDENT; @@ -3909,216 +3618,156 @@ yyreduce: break; case 221: - -/* Line 1455 of yacc.c */ -#line 1360 "../css/CSSGrammar.y" - { (yyval.value).id = 0; (yyval.value).string = (yyvsp[(1) - (2)].string); (yyval.value).unit = CSSPrimitiveValue::CSS_DIMENSION; ;} +#line 1358 "../css/CSSGrammar.y" + { (yyval.value).id = 0; (yyval.value).string = (yyvsp[(1) - (2)].string); (yyval.value).unit = CSSPrimitiveValue::CSS_DIMENSION ;} break; case 222: - -/* Line 1455 of yacc.c */ -#line 1361 "../css/CSSGrammar.y" - { (yyval.value).id = 0; (yyval.value).string = (yyvsp[(2) - (3)].string); (yyval.value).unit = CSSPrimitiveValue::CSS_DIMENSION; ;} +#line 1359 "../css/CSSGrammar.y" + { (yyval.value).id = 0; (yyval.value).string = (yyvsp[(2) - (3)].string); (yyval.value).unit = CSSPrimitiveValue::CSS_DIMENSION ;} break; case 223: - -/* Line 1455 of yacc.c */ -#line 1362 "../css/CSSGrammar.y" +#line 1360 "../css/CSSGrammar.y" { (yyval.value).id = 0; (yyval.value).string = (yyvsp[(1) - (2)].string); (yyval.value).unit = CSSPrimitiveValue::CSS_URI; ;} break; case 224: - -/* Line 1455 of yacc.c */ -#line 1363 "../css/CSSGrammar.y" - { (yyval.value).id = 0; (yyval.value).string = (yyvsp[(1) - (2)].string); (yyval.value).unit = CSSPrimitiveValue::CSS_UNICODE_RANGE; ;} +#line 1361 "../css/CSSGrammar.y" + { (yyval.value).id = 0; (yyval.value).string = (yyvsp[(1) - (2)].string); (yyval.value).unit = CSSPrimitiveValue::CSS_UNICODE_RANGE ;} break; case 225: - -/* Line 1455 of yacc.c */ -#line 1364 "../css/CSSGrammar.y" +#line 1362 "../css/CSSGrammar.y" { (yyval.value).id = 0; (yyval.value).string = (yyvsp[(1) - (1)].string); (yyval.value).unit = CSSPrimitiveValue::CSS_PARSER_HEXCOLOR; ;} break; case 226: - -/* Line 1455 of yacc.c */ -#line 1365 "../css/CSSGrammar.y" +#line 1363 "../css/CSSGrammar.y" { (yyval.value).id = 0; (yyval.value).string = CSSParserString(); (yyval.value).unit = CSSPrimitiveValue::CSS_PARSER_HEXCOLOR; ;} break; case 227: - -/* Line 1455 of yacc.c */ -#line 1367 "../css/CSSGrammar.y" +#line 1365 "../css/CSSGrammar.y" { (yyval.value) = (yyvsp[(1) - (1)].value); ;} break; case 228: - -/* Line 1455 of yacc.c */ -#line 1370 "../css/CSSGrammar.y" +#line 1368 "../css/CSSGrammar.y" { (yyval.value) = (yyvsp[(1) - (2)].value); ;} break; case 229: - -/* Line 1455 of yacc.c */ -#line 1373 "../css/CSSGrammar.y" +#line 1371 "../css/CSSGrammar.y" {;} break; case 230: - -/* Line 1455 of yacc.c */ -#line 1377 "../css/CSSGrammar.y" +#line 1375 "../css/CSSGrammar.y" { (yyval.value).id = 0; (yyval.value).isInt = true; (yyval.value).fValue = (yyvsp[(1) - (2)].number); (yyval.value).unit = CSSPrimitiveValue::CSS_NUMBER; ;} break; case 231: - -/* Line 1455 of yacc.c */ -#line 1378 "../css/CSSGrammar.y" +#line 1376 "../css/CSSGrammar.y" { (yyval.value).id = 0; (yyval.value).isInt = false; (yyval.value).fValue = (yyvsp[(1) - (2)].number); (yyval.value).unit = CSSPrimitiveValue::CSS_NUMBER; ;} break; case 232: - -/* Line 1455 of yacc.c */ -#line 1379 "../css/CSSGrammar.y" +#line 1377 "../css/CSSGrammar.y" { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].number); (yyval.value).unit = CSSPrimitiveValue::CSS_PERCENTAGE; ;} break; case 233: - -/* Line 1455 of yacc.c */ -#line 1380 "../css/CSSGrammar.y" +#line 1378 "../css/CSSGrammar.y" { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].number); (yyval.value).unit = CSSPrimitiveValue::CSS_PX; ;} break; case 234: - -/* Line 1455 of yacc.c */ -#line 1381 "../css/CSSGrammar.y" +#line 1379 "../css/CSSGrammar.y" { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].number); (yyval.value).unit = CSSPrimitiveValue::CSS_CM; ;} break; case 235: - -/* Line 1455 of yacc.c */ -#line 1382 "../css/CSSGrammar.y" +#line 1380 "../css/CSSGrammar.y" { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].number); (yyval.value).unit = CSSPrimitiveValue::CSS_MM; ;} break; case 236: - -/* Line 1455 of yacc.c */ -#line 1383 "../css/CSSGrammar.y" +#line 1381 "../css/CSSGrammar.y" { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].number); (yyval.value).unit = CSSPrimitiveValue::CSS_IN; ;} break; case 237: - -/* Line 1455 of yacc.c */ -#line 1384 "../css/CSSGrammar.y" +#line 1382 "../css/CSSGrammar.y" { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].number); (yyval.value).unit = CSSPrimitiveValue::CSS_PT; ;} break; case 238: - -/* Line 1455 of yacc.c */ -#line 1385 "../css/CSSGrammar.y" +#line 1383 "../css/CSSGrammar.y" { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].number); (yyval.value).unit = CSSPrimitiveValue::CSS_PC; ;} break; case 239: - -/* Line 1455 of yacc.c */ -#line 1386 "../css/CSSGrammar.y" +#line 1384 "../css/CSSGrammar.y" { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].number); (yyval.value).unit = CSSPrimitiveValue::CSS_DEG; ;} break; case 240: - -/* Line 1455 of yacc.c */ -#line 1387 "../css/CSSGrammar.y" +#line 1385 "../css/CSSGrammar.y" { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].number); (yyval.value).unit = CSSPrimitiveValue::CSS_RAD; ;} break; case 241: - -/* Line 1455 of yacc.c */ -#line 1388 "../css/CSSGrammar.y" +#line 1386 "../css/CSSGrammar.y" { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].number); (yyval.value).unit = CSSPrimitiveValue::CSS_GRAD; ;} break; case 242: - -/* Line 1455 of yacc.c */ -#line 1389 "../css/CSSGrammar.y" +#line 1387 "../css/CSSGrammar.y" { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].number); (yyval.value).unit = CSSPrimitiveValue::CSS_TURN; ;} break; case 243: - -/* Line 1455 of yacc.c */ -#line 1390 "../css/CSSGrammar.y" +#line 1388 "../css/CSSGrammar.y" { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].number); (yyval.value).unit = CSSPrimitiveValue::CSS_MS; ;} break; case 244: - -/* Line 1455 of yacc.c */ -#line 1391 "../css/CSSGrammar.y" +#line 1389 "../css/CSSGrammar.y" { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].number); (yyval.value).unit = CSSPrimitiveValue::CSS_S; ;} break; case 245: - -/* Line 1455 of yacc.c */ -#line 1392 "../css/CSSGrammar.y" +#line 1390 "../css/CSSGrammar.y" { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].number); (yyval.value).unit = CSSPrimitiveValue::CSS_HZ; ;} break; case 246: - -/* Line 1455 of yacc.c */ -#line 1393 "../css/CSSGrammar.y" +#line 1391 "../css/CSSGrammar.y" { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].number); (yyval.value).unit = CSSPrimitiveValue::CSS_KHZ; ;} break; case 247: - -/* Line 1455 of yacc.c */ -#line 1394 "../css/CSSGrammar.y" +#line 1392 "../css/CSSGrammar.y" { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].number); (yyval.value).unit = CSSPrimitiveValue::CSS_EMS; ;} break; case 248: - -/* Line 1455 of yacc.c */ -#line 1395 "../css/CSSGrammar.y" +#line 1393 "../css/CSSGrammar.y" { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].number); (yyval.value).unit = CSSParserValue::Q_EMS; ;} break; case 249: - -/* Line 1455 of yacc.c */ -#line 1396 "../css/CSSGrammar.y" +#line 1394 "../css/CSSGrammar.y" { (yyval.value).id = 0; (yyval.value).fValue = (yyvsp[(1) - (2)].number); (yyval.value).unit = CSSPrimitiveValue::CSS_EXS; ;} break; case 250: - -/* Line 1455 of yacc.c */ -#line 1400 "../css/CSSGrammar.y" +#line 1398 "../css/CSSGrammar.y" { (yyval.value).id = 0; (yyval.value).string = (yyvsp[(1) - (1)].string); @@ -4127,9 +3776,7 @@ yyreduce: break; case 251: - -/* Line 1455 of yacc.c */ -#line 1408 "../css/CSSGrammar.y" +#line 1406 "../css/CSSGrammar.y" { CSSParser* p = static_cast(parser); CSSParserFunction* f = p->createFloatingFunction(); @@ -4142,9 +3789,7 @@ yyreduce: break; case 252: - -/* Line 1455 of yacc.c */ -#line 1417 "../css/CSSGrammar.y" +#line 1415 "../css/CSSGrammar.y" { CSSParser* p = static_cast(parser); CSSParserFunction* f = p->createFloatingFunction(); @@ -4157,86 +3802,67 @@ yyreduce: break; case 253: - -/* Line 1455 of yacc.c */ -#line 1433 "../css/CSSGrammar.y" +#line 1431 "../css/CSSGrammar.y" { (yyval.string) = (yyvsp[(1) - (2)].string); ;} break; case 254: - -/* Line 1455 of yacc.c */ -#line 1434 "../css/CSSGrammar.y" +#line 1432 "../css/CSSGrammar.y" { (yyval.string) = (yyvsp[(1) - (2)].string); ;} break; case 255: - -/* Line 1455 of yacc.c */ -#line 1441 "../css/CSSGrammar.y" +#line 1439 "../css/CSSGrammar.y" { (yyval.rule) = 0; ;} break; case 256: - -/* Line 1455 of yacc.c */ -#line 1444 "../css/CSSGrammar.y" +#line 1442 "../css/CSSGrammar.y" { (yyval.rule) = 0; ;} break; case 257: - -/* Line 1455 of yacc.c */ -#line 1450 "../css/CSSGrammar.y" +#line 1448 "../css/CSSGrammar.y" { (yyval.rule) = 0; ;} break; case 258: - -/* Line 1455 of yacc.c */ -#line 1453 "../css/CSSGrammar.y" +#line 1451 "../css/CSSGrammar.y" { (yyval.rule) = 0; ;} break; case 261: - -/* Line 1455 of yacc.c */ -#line 1464 "../css/CSSGrammar.y" +#line 1462 "../css/CSSGrammar.y" { (yyval.rule) = 0; ;} break; case 262: - -/* Line 1455 of yacc.c */ -#line 1470 "../css/CSSGrammar.y" +#line 1468 "../css/CSSGrammar.y" { (yyval.rule) = 0; ;} break; case 263: - -/* Line 1455 of yacc.c */ -#line 1476 "../css/CSSGrammar.y" +#line 1474 "../css/CSSGrammar.y" { (yyval.rule) = 0; ;} break; - -/* Line 1455 of yacc.c */ -#line 4240 "WebCore/tmp/../generated/CSSGrammar.tab.c" +/* Line 1267 of yacc.c. */ +#line 3866 "WebCore/tmp/../generated/CSSGrammar.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -4247,6 +3873,7 @@ yyreduce: *++yyvsp = yyval; + /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -4311,7 +3938,7 @@ yyerrlab: if (yyerrstatus == 3) { - /* If just tried and failed to reuse lookahead token after an + /* If just tried and failed to reuse look-ahead token after an error, discard it. */ if (yychar <= YYEOF) @@ -4328,7 +3955,7 @@ yyerrlab: } } - /* Else will try to reuse lookahead token after shifting the error + /* Else will try to reuse look-ahead token after shifting the error token. */ goto yyerrlab1; @@ -4385,6 +4012,9 @@ yyerrlab1: YY_STACK_PRINT (yyss, yyssp); } + if (yyn == YYFINAL) + YYACCEPT; + *++yyvsp = yylval; @@ -4409,7 +4039,7 @@ yyabortlab: yyresult = 1; goto yyreturn; -#if !defined(yyoverflow) || YYERROR_VERBOSE +#ifndef yyoverflow /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ @@ -4420,7 +4050,7 @@ yyexhaustedlab: #endif yyreturn: - if (yychar != YYEMPTY) + if (yychar != YYEOF && yychar != YYEMPTY) yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); /* Do not reclaim the symbols of the rule which action triggered @@ -4446,8 +4076,6 @@ yyreturn: } - -/* Line 1675 of yacc.c */ -#line 1503 "../css/CSSGrammar.y" +#line 1501 "../css/CSSGrammar.y" diff --git a/src/3rdparty/webkit/WebCore/generated/CSSGrammar.h b/src/3rdparty/webkit/WebCore/generated/CSSGrammar.h index 84ad511..1b60c68 100644 --- a/src/3rdparty/webkit/WebCore/generated/CSSGrammar.h +++ b/src/3rdparty/webkit/WebCore/generated/CSSGrammar.h @@ -1,25 +1,26 @@ #ifndef CSSGRAMMAR_H #define CSSGRAMMAR_H - -/* A Bison parser, made by GNU Bison 2.4.1. */ +/* A Bison parser, made by GNU Bison 2.3. */ /* Skeleton interface for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify + + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - + the Free Software Foundation; either version 2, or (at your option) + any later version. + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License - along with this program. If not, see . */ + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -30,11 +31,10 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ - /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE @@ -42,80 +42,140 @@ know about them. */ enum yytokentype { TOKEN_EOF = 0, - LOWEST_PREC = 258, - UNIMPORTANT_TOK = 259, - WHITESPACE = 260, - SGML_CD = 261, - INCLUDES = 262, - DASHMATCH = 263, - BEGINSWITH = 264, - ENDSWITH = 265, - CONTAINS = 266, - STRING = 267, - IDENT = 268, - NTH = 269, - HEX = 270, - IDSEL = 271, - IMPORT_SYM = 272, - PAGE_SYM = 273, - MEDIA_SYM = 274, - FONT_FACE_SYM = 275, - CHARSET_SYM = 276, - NAMESPACE_SYM = 277, - WEBKIT_RULE_SYM = 278, - WEBKIT_DECLS_SYM = 279, - WEBKIT_KEYFRAME_RULE_SYM = 280, - WEBKIT_KEYFRAMES_SYM = 281, - WEBKIT_VALUE_SYM = 282, - WEBKIT_MEDIAQUERY_SYM = 283, - WEBKIT_SELECTOR_SYM = 284, - WEBKIT_VARIABLES_SYM = 285, - WEBKIT_DEFINE_SYM = 286, - VARIABLES_FOR = 287, - WEBKIT_VARIABLES_DECLS_SYM = 288, - ATKEYWORD = 289, - IMPORTANT_SYM = 290, - MEDIA_ONLY = 291, - MEDIA_NOT = 292, - MEDIA_AND = 293, - QEMS = 294, - EMS = 295, - EXS = 296, - PXS = 297, - CMS = 298, - MMS = 299, - INS = 300, - PTS = 301, - PCS = 302, - DEGS = 303, - RADS = 304, - GRADS = 305, - TURNS = 306, - MSECS = 307, - SECS = 308, - HERZ = 309, - KHERZ = 310, - DIMEN = 311, - PERCENTAGE = 312, - FLOATTOKEN = 313, - INTEGER = 314, - URI = 315, - FUNCTION = 316, - NOTFUNCTION = 317, - UNICODERANGE = 318, - VARCALL = 319 + UNIMPORTANT_TOK = 258, + WHITESPACE = 259, + SGML_CD = 260, + INCLUDES = 261, + DASHMATCH = 262, + BEGINSWITH = 263, + ENDSWITH = 264, + CONTAINS = 265, + STRING = 266, + IDENT = 267, + NTH = 268, + HEX = 269, + IDSEL = 270, + IMPORT_SYM = 271, + PAGE_SYM = 272, + MEDIA_SYM = 273, + FONT_FACE_SYM = 274, + CHARSET_SYM = 275, + NAMESPACE_SYM = 276, + WEBKIT_RULE_SYM = 277, + WEBKIT_DECLS_SYM = 278, + WEBKIT_KEYFRAME_RULE_SYM = 279, + WEBKIT_KEYFRAMES_SYM = 280, + WEBKIT_VALUE_SYM = 281, + WEBKIT_MEDIAQUERY_SYM = 282, + WEBKIT_SELECTOR_SYM = 283, + WEBKIT_VARIABLES_SYM = 284, + WEBKIT_DEFINE_SYM = 285, + VARIABLES_FOR = 286, + WEBKIT_VARIABLES_DECLS_SYM = 287, + ATKEYWORD = 288, + IMPORTANT_SYM = 289, + MEDIA_ONLY = 290, + MEDIA_NOT = 291, + MEDIA_AND = 292, + QEMS = 293, + EMS = 294, + EXS = 295, + PXS = 296, + CMS = 297, + MMS = 298, + INS = 299, + PTS = 300, + PCS = 301, + DEGS = 302, + RADS = 303, + GRADS = 304, + TURNS = 305, + MSECS = 306, + SECS = 307, + HERZ = 308, + KHERZ = 309, + DIMEN = 310, + PERCENTAGE = 311, + FLOATTOKEN = 312, + INTEGER = 313, + URI = 314, + FUNCTION = 315, + NOTFUNCTION = 316, + UNICODERANGE = 317, + VARCALL = 318 }; #endif +/* Tokens. */ +#define TOKEN_EOF 0 +#define UNIMPORTANT_TOK 258 +#define WHITESPACE 259 +#define SGML_CD 260 +#define INCLUDES 261 +#define DASHMATCH 262 +#define BEGINSWITH 263 +#define ENDSWITH 264 +#define CONTAINS 265 +#define STRING 266 +#define IDENT 267 +#define NTH 268 +#define HEX 269 +#define IDSEL 270 +#define IMPORT_SYM 271 +#define PAGE_SYM 272 +#define MEDIA_SYM 273 +#define FONT_FACE_SYM 274 +#define CHARSET_SYM 275 +#define NAMESPACE_SYM 276 +#define WEBKIT_RULE_SYM 277 +#define WEBKIT_DECLS_SYM 278 +#define WEBKIT_KEYFRAME_RULE_SYM 279 +#define WEBKIT_KEYFRAMES_SYM 280 +#define WEBKIT_VALUE_SYM 281 +#define WEBKIT_MEDIAQUERY_SYM 282 +#define WEBKIT_SELECTOR_SYM 283 +#define WEBKIT_VARIABLES_SYM 284 +#define WEBKIT_DEFINE_SYM 285 +#define VARIABLES_FOR 286 +#define WEBKIT_VARIABLES_DECLS_SYM 287 +#define ATKEYWORD 288 +#define IMPORTANT_SYM 289 +#define MEDIA_ONLY 290 +#define MEDIA_NOT 291 +#define MEDIA_AND 292 +#define QEMS 293 +#define EMS 294 +#define EXS 295 +#define PXS 296 +#define CMS 297 +#define MMS 298 +#define INS 299 +#define PTS 300 +#define PCS 301 +#define DEGS 302 +#define RADS 303 +#define GRADS 304 +#define TURNS 305 +#define MSECS 306 +#define SECS 307 +#define HERZ 308 +#define KHERZ 309 +#define DIMEN 310 +#define PERCENTAGE 311 +#define FLOATTOKEN 312 +#define INTEGER 313 +#define URI 314 +#define FUNCTION 315 +#define NOTFUNCTION 316 +#define UNICODERANGE 317 +#define VARCALL 318 + #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -{ - -/* Line 1676 of yacc.c */ #line 57 "../css/CSSGrammar.y" - +{ bool boolean; char character; int integer; @@ -137,18 +197,15 @@ typedef union YYSTYPE WebKitCSSKeyframeRule* keyframeRule; WebKitCSSKeyframesRule* keyframesRule; float val; - - - -/* Line 1676 of yacc.c */ -#line 143 "WebCore/tmp/../generated/CSSGrammar.tab.h" -} YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 +} +/* Line 1489 of yacc.c. */ +#line 201 "WebCore/tmp/../generated/CSSGrammar.tab.h" + YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 #endif - #endif -- cgit v0.12 From cf8dcda1316198f2e54195cf7b7137c7ae05f91b Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 30 Sep 2009 14:46:40 +0200 Subject: Stabilize graphicsview test --- tests/auto/qgraphicsview/tst_qgraphicsview.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp index 0c27079..78fb4f3 100644 --- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp @@ -3160,11 +3160,12 @@ void tst_QGraphicsView::moveItemWhileScrolling() if (!adjustForAntialiasing) view.setOptimizationFlag(QGraphicsView::DontAdjustForAntialiasing); view.resize(200, 200); + view.painted = false; view.show(); QTest::qWaitForWindowShown(&view); + QApplication::processEvents(); QTRY_VERIFY(view.painted); view.painted = false; - view.lastPaintedRegion = QRegion(); view.horizontalScrollBar()->setValue(view.horizontalScrollBar()->value() + 10); view.rect->moveBy(0, 10); @@ -3366,6 +3367,7 @@ void tst_QGraphicsView::render() view.painted = false; view.show(); QTest::qWaitForWindowShown(&view); + QApplication::processEvents(); QTRY_VERIFY(view.painted > 0); RenderTester *r1 = new RenderTester(QRectF(0, 0, 50, 50)); -- cgit v0.12 From 0986dab7c77fced09ddb4400b20d3939f4ba1002 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 30 Sep 2009 14:47:15 +0200 Subject: Add more debug information to the QPrinterInfo test Reviewed-by: Paul --- tests/auto/qprinterinfo/tst_qprinterinfo.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/tests/auto/qprinterinfo/tst_qprinterinfo.cpp b/tests/auto/qprinterinfo/tst_qprinterinfo.cpp index e397b76..2fa7515 100644 --- a/tests/auto/qprinterinfo/tst_qprinterinfo.cpp +++ b/tests/auto/qprinterinfo/tst_qprinterinfo.cpp @@ -101,6 +101,8 @@ void tst_QPrinterInfo::macFixNameFormat(QString *printerName) #ifdef Q_WS_MAC printerName->replace(QLatin1String("___"), QLatin1String(" @ ")); printerName->replace(QLatin1String("_"), QLatin1String(".")); +#else + Q_UNUSED(printerName); #endif } @@ -282,16 +284,17 @@ void tst_QPrinterInfo::testForPrinters() QCOMPARE(printers.size(), sysPrinters.size()); + QHash qtPrinters; + + for (int j = 0; j < printers.size(); ++j) { + qtPrinters.insert(printers.at(j).printerName(), !printers.at(j).isNull()); + } + for (int i = 0; i < sysPrinters.size(); ++i) { - bool found = false; - for (int j = 0; j < printers.size(); ++j) { - if (sysPrinters.at(i) == printers.at(j).printerName()) { - QVERIFY(!printers.at(j).isNull()); - found = true; - break; - } + if (!qtPrinters.value(sysPrinters.at(i))) { + qDebug() << "Avaliable printers: " << qtPrinters; + QFAIL(qPrintable(QString("Printer '%1' reported by system, but not reported by Qt").arg(sysPrinters.at(i)))); } - if (!found) QFAIL("Printer reported by system, but not reported by Qt"); } #else QSKIP("Test doesn't work on non-Unix", SkipAll); -- cgit v0.12 From a93d0d1f970689991dd113d696e922854ff9ec6a Mon Sep 17 00:00:00 2001 From: axis Date: Tue, 29 Sep 2009 12:53:32 +0200 Subject: Revert "Switched to asynchronous focus handling on Symbian." This reverts commit b6377f43410b14125a66ffd02acde69cfb6e455e. The asynchronous handling caused too many headaches with input methods, which expect the focus status to be updated immediately. This may break the test case that was originally fixed by this patch (I cannot find out which one at the moment), but that will have to be solved in a different way. Conflicts: src/corelib/kernel/qcoreevent.cpp src/corelib/kernel/qcoreevent.h src/gui/kernel/qwidget.cpp src/gui/kernel/qwidget_p.h src/gui/kernel/qwidget_s60.cpp --- src/corelib/kernel/qcoreevent.cpp | 1 - src/corelib/kernel/qcoreevent.h | 4 +--- src/gui/kernel/qapplication_s60.cpp | 18 ++++++++++++++++-- src/gui/kernel/qwidget.cpp | 6 ------ src/gui/kernel/qwidget_p.h | 3 --- src/gui/kernel/qwidget_s60.cpp | 28 ---------------------------- tests/auto/qwidget/tst_qwidget.cpp | 9 --------- 7 files changed, 17 insertions(+), 52 deletions(-) diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp index 185c305..3bef0d4 100644 --- a/src/corelib/kernel/qcoreevent.cpp +++ b/src/corelib/kernel/qcoreevent.cpp @@ -270,7 +270,6 @@ QT_BEGIN_NAMESPACE \omitvalue NetworkReplyUpdated \omitvalue FutureCallOut \omitvalue CocoaRequestModal - \omitvalue SymbianDeferredFocusChanged \omitvalue UpdateSoftKeys \omitvalue NativeGesture */ diff --git a/src/corelib/kernel/qcoreevent.h b/src/corelib/kernel/qcoreevent.h index bc96918..be25b41 100644 --- a/src/corelib/kernel/qcoreevent.h +++ b/src/corelib/kernel/qcoreevent.h @@ -281,9 +281,7 @@ public: RequestSoftwareInputPanel = 199, CloseSoftwareInputPanel = 200, - SymbianDeferredFocusChanged = 201, // Internal for generating asynchronous focus events on Symbian - - UpdateSoftKeys = 202, // Internal for compressing soft key updates + UpdateSoftKeys = 201, // Internal for compressing soft key updates // 512 reserved for Qt Jambi's MetaCall event // 513 reserved for Qt Jambi's DeleteOnMainThread event diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 0650f6c..498b1e7 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -845,8 +845,22 @@ void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */) || (qwidget->windowType() & Qt::Popup) == Qt::Popup) return; - QEvent *deferredFocusEvent = new QEvent(QEvent::SymbianDeferredFocusChanged); - QApplication::postEvent(qwidget, deferredFocusEvent); + if (IsFocused()) { + QApplication::setActiveWindow(qwidget); +#ifdef Q_WS_S60 + // If widget is fullscreen, hide status pane and button container + // otherwise show them. + CEikStatusPane* statusPane = S60->statusPane(); + CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer(); + bool isFullscreen = qwidget->windowState() & Qt::WindowFullScreen; + if (statusPane && (statusPane->IsVisible() == isFullscreen)) + statusPane->MakeVisible(!isFullscreen); + if (buttonGroup && (buttonGroup->IsVisible() == isFullscreen)) + buttonGroup->MakeVisible(!isFullscreen); +#endif + } else { + QApplication::setActiveWindow(0); + } } void QSymbianControl::HandleResourceChange(int resourceType) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 08fe5b9..45b0dac 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -8336,12 +8336,6 @@ bool QWidget::event(QEvent *event) (void) QApplication::sendEvent(this, &mouseEvent); break; } - case QEvent::SymbianDeferredFocusChanged: { -#ifdef Q_OS_SYMBIAN - d->handleSymbianDeferredFocusChanged(); -#endif - break; - } #ifndef QT_NO_PROPERTIES case QEvent::DynamicPropertyChange: { const QByteArray &propName = static_cast(event)->propertyName(); diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index 296c5b1..15f316d 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -286,9 +286,6 @@ public: QPalette naturalWidgetPalette(uint inheritedMask) const; void setMask_sys(const QRegion &); -#ifdef Q_OS_SYMBIAN - void handleSymbianDeferredFocusChanged(); -#endif void raise_sys(); void lower_sys(); diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 6b5e9b7..f64263b 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -367,34 +367,6 @@ void QWidgetPrivate::setFocus_sys() q->effectiveWinId()->SetFocus(true); } -void QWidgetPrivate::handleSymbianDeferredFocusChanged() -{ - Q_Q(QWidget); - WId control = q->internalWinId(); - if (!control) { - // This could happen if the widget was reparented, while the focuschange - // was in the event queue. - return; - } - - if (control->IsFocused()) { - QApplication::setActiveWindow(q); -#ifdef Q_WS_S60 - // If widget is fullscreen, hide status pane and button container - // otherwise show them. - CEikStatusPane* statusPane = S60->statusPane(); - CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer(); - bool isFullscreen = q->windowState() & Qt::WindowFullScreen; - if (statusPane && (statusPane->IsVisible() == isFullscreen)) - statusPane->MakeVisible(!isFullscreen); - if (buttonGroup && (buttonGroup->IsVisible() == isFullscreen)) - buttonGroup->MakeVisible(!isFullscreen); -#endif - } else { - QApplication::setActiveWindow(0); - } -} - void QWidgetPrivate::raise_sys() { Q_Q(QWidget); diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index 4cf9e8f..3918eff 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -6151,9 +6151,6 @@ void tst_QWidget::compatibilityChildInsertedEvents() EventRecorder::EventList() << qMakePair(&widget, QEvent::PolishRequest) << qMakePair(&widget, QEvent::Type(QEvent::User + 1)) -#ifdef Q_OS_SYMBIAN - << qMakePair(&widget, QEvent::SymbianDeferredFocusChanged) -#endif #if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_S60) << qMakePair(&widget, QEvent::UpdateRequest) #endif @@ -6249,9 +6246,6 @@ void tst_QWidget::compatibilityChildInsertedEvents() << qMakePair(&widget, QEvent::PolishRequest) << qMakePair(&widget, QEvent::Type(QEvent::User + 1)) << qMakePair(&widget, QEvent::Type(QEvent::User + 2)) -#ifdef Q_OS_SYMBIAN - << qMakePair(&widget, QEvent::SymbianDeferredFocusChanged) -#endif #if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_S60) << qMakePair(&widget, QEvent::UpdateRequest) #endif @@ -6347,9 +6341,6 @@ void tst_QWidget::compatibilityChildInsertedEvents() << qMakePair(&widget, QEvent::PolishRequest) << qMakePair(&widget, QEvent::Type(QEvent::User + 1)) << qMakePair(&widget, QEvent::Type(QEvent::User + 2)) -#ifdef Q_OS_SYMBIAN - << qMakePair(&widget, QEvent::SymbianDeferredFocusChanged) -#endif #if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_S60) << qMakePair(&widget, QEvent::UpdateRequest) #endif -- cgit v0.12 From 3fa5162526a2d0dba0abd00c52f44ac93f9d78f3 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 30 Sep 2009 15:25:28 +0200 Subject: Prospective solaris-g++-sparc build fix g++ on sparc appears to have problems inlining functions when Qt is compiled in debug. ("sorry: unimplemented blah blah") We're not entirely sure, but we suspect that removing -g might help avoid this compiler bug. Reviewed-by: Kent Hansen --- src/script/script.pro | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/script/script.pro b/src/script/script.pro index 659aa26..008c556 100644 --- a/src/script/script.pro +++ b/src/script/script.pro @@ -62,6 +62,11 @@ DEFINES += WTF_USE_JAVASCRIPTCORE_BINDINGS=1 WTF_CHANGES=1 DEFINES += NDEBUG +solaris-g++:isEqual(QT_ARCH,sparc) { + CONFIG -= separate_debug_info + CONFIG += no_debug_info +} + # Avoid JSC C API functions being exported. DEFINES += JS_EXPORT="" JS_EXPORTDATA="" -- cgit v0.12 From c3cce20dd24ee110d4a8b434ea0623fd8c07ed68 Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 30 Sep 2009 10:27:15 +0200 Subject: Helped out the Symbian compiler to avoid build error. RevBy: Trust me --- tests/auto/qwidget/tst_qwidget.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index 3918eff..8860924 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -5500,14 +5500,14 @@ void tst_QWidget::multipleToplevelFocusCheck() w1.activateWindow(); QApplication::setActiveWindow(&w1); QApplication::processEvents(); - QTRY_COMPARE(QApplication::activeWindow(), &w1); + QTRY_COMPARE(QApplication::activeWindow(), static_cast(&w1)); QTest::mouseDClick(&w1, Qt::LeftButton); QTRY_COMPARE(QApplication::focusWidget(), static_cast(w1.edit)); w2.activateWindow(); QApplication::setActiveWindow(&w2); QApplication::processEvents(); - QTRY_COMPARE(QApplication::activeWindow(), &w2); + QTRY_COMPARE(QApplication::activeWindow(), static_cast(&w2)); QTest::mouseClick(&w2, Qt::LeftButton); #ifdef Q_WS_QWS QEXPECT_FAIL("", "embedded toplevels take focus anyway", Continue); @@ -5520,14 +5520,14 @@ void tst_QWidget::multipleToplevelFocusCheck() w1.activateWindow(); QApplication::setActiveWindow(&w1); QApplication::processEvents(); - QTRY_COMPARE(QApplication::activeWindow(), &w1); + QTRY_COMPARE(QApplication::activeWindow(), static_cast(&w1)); QTest::mouseDClick(&w1, Qt::LeftButton); QTRY_COMPARE(QApplication::focusWidget(), static_cast(w1.edit)); w2.activateWindow(); QApplication::setActiveWindow(&w2); QApplication::processEvents(); - QTRY_COMPARE(QApplication::activeWindow(), &w2); + QTRY_COMPARE(QApplication::activeWindow(), static_cast(&w2)); QTest::mouseClick(&w2, Qt::LeftButton); QTRY_COMPARE(QApplication::focusWidget(), (QWidget *)0); } -- cgit v0.12 From 0728fa73b83e7f29990eae2520f0994e413264c2 Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 30 Sep 2009 11:21:41 +0200 Subject: Avoided qt3support constructor (S60 port doesn't have it). RevBy: Paul Olav Tvete --- tests/auto/qwidget/tst_qwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index 8860924..309b818 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -9146,7 +9146,7 @@ void tst_QWidget::destroyBackingStore() void tst_QWidget::rectOutsideCoordinatesLimit_task144779() { QApplication::setOverrideCursor(Qt::BlankCursor); //keep the cursor out of screen grabs - QWidget main(0,0,Qt::FramelessWindowHint); //don't get confused by the size of the window frame + QWidget main(0,Qt::FramelessWindowHint); //don't get confused by the size of the window frame QPalette palette; palette.setColor(QPalette::Window, Qt::red); main.setPalette(palette); -- cgit v0.12 From 8c4b3937511c8e960f9c03f1c711005aef49d982 Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 30 Sep 2009 11:34:55 +0200 Subject: Fixed some uncommon codepaths to compile. RevBy: Trust me --- src/corelib/io/qfsfileengine_unix.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp index 4ec5772..114da3b 100644 --- a/src/corelib/io/qfsfileengine_unix.cpp +++ b/src/corelib/io/qfsfileengine_unix.cpp @@ -595,7 +595,7 @@ QString QFSFileEngine::rootPath() return QDir::cleanPath(QDir::fromNativeSeparators(qt_TDesC2QString(symbianPath))); # else # warning No fallback implementation of QFSFileEngine::rootPath() - return QLatin1String(); + return QString(); # endif #else return QLatin1String("/"); @@ -614,7 +614,7 @@ QString QFSFileEngine::tempPath() QT_MKDIR(QFile::encodeName(temp), 0777); # else # warning No fallback implementation of QFSFileEngine::tempPath() - return QString(); + QString temp; # endif #else QString temp = QFile::decodeName(qgetenv("TMPDIR")); -- cgit v0.12 From 5dadf715a40189c94235e8445dc79f0270b0a87e Mon Sep 17 00:00:00 2001 From: axis Date: Wed, 30 Sep 2009 11:41:09 +0200 Subject: Fixed some focus issues on Symbian. There are really two bugs that are fixed in this commit: - SetFocus() in Symbian does not automatically clear focus on the previously focused control, so we have to remember that control and clear it ourselves. - Symbian assumes that it is always the control at the top of the control stack that should have focus, and if this isn't the case, focus may or may not work depending on whether Symbian has had a chance to reset the focus or not. Therefore, whenever we change focus on a control, we have to also readd that control to the top of the stack, to ensure that it stays focused. RevBy: Janne Anttila --- src/gui/kernel/qapplication_s60.cpp | 35 ++++++++++++++++++++++++++++++++--- src/gui/kernel/qt_s60_p.h | 5 +++++ src/gui/kernel/qwidget_s60.cpp | 36 +++++++++++++++++++++--------------- 3 files changed, 58 insertions(+), 18 deletions(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 498b1e7..1e78079 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -91,6 +91,8 @@ extern QDesktopWidget *qt_desktopWidget; // qapplication.cpp QWidget *qt_button_down = 0; // widget got last button-down +QSymbianControl *QSymbianControl::lastFocusedControl = 0; + QS60Data* qGlobalS60Data() { return qt_s60Data(); @@ -337,6 +339,7 @@ QSymbianControl::~QSymbianControl() { if (S60->curWin == this) S60->curWin = 0; + setFocusSafely(false); S60->appUi()->RemoveFromStack(this); delete m_longTapDetector; } @@ -845,8 +848,8 @@ void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */) || (qwidget->windowType() & Qt::Popup) == Qt::Popup) return; - if (IsFocused()) { - QApplication::setActiveWindow(qwidget); + if (IsFocused() && IsVisible()) { + QApplication::setActiveWindow(qwidget->window()); #ifdef Q_WS_S60 // If widget is fullscreen, hide status pane and button container // otherwise show them. @@ -858,9 +861,10 @@ void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */) if (buttonGroup && (buttonGroup->IsVisible() == isFullscreen)) buttonGroup->MakeVisible(!isFullscreen); #endif - } else { + } else if (QApplication::activeWindow() == qwidget->window()) { QApplication::setActiveWindow(0); } + // else { We don't touch the active window unless we were explicitly activated or deactivated } } void QSymbianControl::HandleResourceChange(int resourceType) @@ -904,6 +908,31 @@ TTypeUid::Ptr QSymbianControl::MopSupplyObject(TTypeUid id) return CCoeControl::MopSupplyObject(id); } +void QSymbianControl::setFocusSafely(bool focus) +{ + // The stack hack in here is very unfortunate, but it is the only way to ensure proper + // focus in Symbian. If this is not executed, the control which happens to be on + // the top of the stack may randomly be assigned focus by Symbian, for example + // when creating new windows (specifically in CCoeAppUi::HandleStackChanged()). + if (focus) { + S60->appUi()->RemoveFromStack(this); + // Symbian doesn't automatically remove focus from the last focused control, so we need to + // remember it and clear focus ourselves. + if (lastFocusedControl && lastFocusedControl != this) + lastFocusedControl->SetFocus(false); + QT_TRAP_THROWING(S60->appUi()->AddToStackL(this, + ECoeStackPriorityDefault + 1, ECoeStackFlagStandard)); // Note the + 1 + lastFocusedControl = this; + this->SetFocus(true); + } else { + S60->appUi()->RemoveFromStack(this); + QT_TRAP_THROWING(S60->appUi()->AddToStackL(this, + ECoeStackPriorityDefault, ECoeStackFlagStandard)); + lastFocusedControl = 0; + this->SetFocus(false); + } +} + /*! \typedef QApplication::QS60MainApplicationFactory diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h index 0d48634..92e695f 100644 --- a/src/gui/kernel/qt_s60_p.h +++ b/src/gui/kernel/qt_s60_p.h @@ -157,6 +157,8 @@ public: void setIgnoreFocusChanged(bool enabled) { m_ignoreFocusChanged = enabled; } void CancelLongTapTimer(); + void setFocusSafely(bool focus); + protected: void Draw(const TRect& aRect) const; void SizeChanged(); @@ -174,6 +176,9 @@ private: #endif private: + static QSymbianControl *lastFocusedControl; + +private: QWidget *qwidget; bool m_ignoreFocusChanged; QLongTapTimer* m_longTapDetector; diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index f64263b..699f778 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -251,7 +251,10 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de } else { stackingFlags = ECoeStackFlagStandard; } + control->MakeVisible(false); QT_TRAP_THROWING(control->ControlEnv()->AppUi()->AddToStackL(control, ECoeStackPriorityDefault, stackingFlags)); + // Avoid keyboard focus to a hidden window. + control->setFocusSafely(false); QTLWExtra *topExtra = topData(); topExtra->rwindow = control->DrawableWindow(); @@ -284,7 +287,10 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de } else { stackingFlags = ECoeStackFlagStandard; } + control->MakeVisible(false); QT_TRAP_THROWING(control->ControlEnv()->AppUi()->AddToStackL(control, ECoeStackPriorityDefault, stackingFlags)); + // Avoid keyboard focus to a hidden window. + control->setFocusSafely(false); WId parentw = parentWidget->effectiveWinId(); QT_TRAP_THROWING(control->SetContainerWindowL(*parentw)); @@ -323,13 +329,13 @@ void QWidgetPrivate::show_sys() if (q->isWindow() && q->internalWinId()) { - WId id = q->internalWinId(); + QSymbianControl *id = static_cast(q->internalWinId()); if (!extra->topextra->activated) { QT_TRAP_THROWING(id->ActivateL()); extra->topextra->activated = 1; } id->MakeVisible(true); - id->SetFocus(true); + id->setFocusSafely(true); // Force setting of the icon after window is made visible, // this is needed even WA_SetWindowIcon is not set, as in that case we need @@ -345,10 +351,10 @@ void QWidgetPrivate::hide_sys() Q_Q(QWidget); Q_ASSERT(q->testAttribute(Qt::WA_WState_Created)); deactivateWidgetCleanup(); - WId id = q->internalWinId(); + QSymbianControl *id = static_cast(q->internalWinId()); if (q->isWindow() && id) { if (id->IsFocused()) // Avoid unnecessary calls to FocusChanged() - id->SetFocus(false); + id->setFocusSafely(false); id->MakeVisible(false); if (QWidgetBackingStore *bs = maybeBackingStore()) bs->releaseBuffer(); @@ -364,7 +370,7 @@ void QWidgetPrivate::setFocus_sys() Q_Q(QWidget); if (q->testAttribute(Qt::WA_WState_Created) && q->window()->windowType() != Qt::Popup) if (!q->effectiveWinId()->IsFocused()) // Avoid unnecessry calls to FocusChanged() - q->effectiveWinId()->SetFocus(true); + static_cast(q->effectiveWinId())->setFocusSafely(true); } void QWidgetPrivate::raise_sys() @@ -447,7 +453,7 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f) if (q->testAttribute(Qt::WA_DropSiteRegistered)) q->setAttribute(Qt::WA_DropSiteRegistered, false); - WId old_winid = wasCreated ? data.winid : 0; + QSymbianControl *old_winid = static_cast(wasCreated ? data.winid : 0); if ((q->windowType() == Qt::Desktop)) old_winid = 0; setWinId(0); @@ -457,7 +463,7 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f) if (wasCreated && old_winid) { old_winid->MakeVisible(false); if (old_winid->IsFocused()) // Avoid unnecessary calls to FocusChanged() - old_winid->SetFocus(false); + old_winid->setFocusSafely(false); old_winid->SetParent(0); } @@ -974,17 +980,17 @@ void QWidget::setWindowState(Qt::WindowStates newstate) if ((oldstate & Qt::WindowMinimized) != (newstate & Qt::WindowMinimized)) { if (newstate & Qt::WindowMinimized) { if (isVisible()) { - WId id = effectiveWinId(); + QSymbianControl *id = static_cast(effectiveWinId()); if (id->IsFocused()) // Avoid unnecessary calls to FocusChanged() - id->SetFocus(false); + id->setFocusSafely(false); id->MakeVisible(false); } } else { if (isVisible()) { - WId id = effectiveWinId(); + QSymbianControl *id = static_cast(effectiveWinId()); id->MakeVisible(true); if (!id->IsFocused()) // Avoid unnecessary calls to FocusChanged() - id->SetFocus(true); + id->setFocusSafely(true); } const QRect normalGeometry = geometry(); const QRect r = top->normalGeometry; @@ -1011,7 +1017,7 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows) if (!isWindow() && parentWidget()) parentWidget()->d_func()->invalidateBuffer(geometry()); d->deactivateWidgetCleanup(); - WId id = internalWinId(); + QSymbianControl *id = static_cast(internalWinId()); if (testAttribute(Qt::WA_WState_Created)) { #ifndef QT_NO_IM @@ -1039,7 +1045,7 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows) } if (destroyWindow && !(windowType() == Qt::Desktop) && id) { if (id->IsFocused()) // Avoid unnecessry calls to FocusChanged() - id->SetFocus(false); + id->setFocusSafely(false); id->ControlEnv()->AppUi()->RemoveFromStack(id); // Hack to activate window under destroyed one. With this activation @@ -1148,8 +1154,8 @@ void QWidget::activateWindow() QWidget *tlw = window(); if (tlw->isVisible()) { window()->createWinId(); - WId id = tlw->internalWinId(); - id->SetFocus(true); + QSymbianControl *id = static_cast(tlw->internalWinId()); + id->setFocusSafely(true); } } -- cgit v0.12 From fa3cda0324324f595d0d1231027443673b7c05ea Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 30 Sep 2009 15:57:35 +0200 Subject: Stabilize more test on X11 Each times the test are run, pulse show different failures. --- tests/auto/qbuttongroup/tst_qbuttongroup.cpp | 3 +- tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 8 +- .../tst_qgraphicsproxywidget.cpp | 4 +- tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp | 192 +++++++++++---------- tests/auto/qstatusbar/tst_qstatusbar.cpp | 9 +- tests/auto/qwindowsurface/tst_qwindowsurface.cpp | 2 +- 6 files changed, 108 insertions(+), 110 deletions(-) diff --git a/tests/auto/qbuttongroup/tst_qbuttongroup.cpp b/tests/auto/qbuttongroup/tst_qbuttongroup.cpp index 502c2d1..11c1f47 100644 --- a/tests/auto/qbuttongroup/tst_qbuttongroup.cpp +++ b/tests/auto/qbuttongroup/tst_qbuttongroup.cpp @@ -173,10 +173,11 @@ void tst_QButtonGroup::arrowKeyNavigation() dlg.show(); qApp->setActiveWindow(&dlg); + QTest::qWaitForWindowShown(&dlg); bt1.setFocus(); - QVERIFY(bt1.hasFocus()); + QTRY_VERIFY(bt1.hasFocus()); QTest::keyClick(&bt1, Qt::Key_Right); QVERIFY(pb.hasFocus()); diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index ef9fe9e..bbf19f2 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -2925,10 +2925,8 @@ void tst_QGraphicsItem::hoverEventsGenerateRepaints() QGraphicsScene scene; QGraphicsView view(&scene); view.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&view); -#endif - QTest::qWait(20); + QTest::qWaitForWindowShown(&view); + QTest::qWait(100); EventTester *tester = new EventTester; scene.addItem(tester); @@ -4637,7 +4635,7 @@ void tst_QGraphicsItem::paint() qApp->processEvents(); //First show one paint - QVERIFY(tester2.painted == 1); + QTRY_COMPARE(tester2.painted, 1); //nominal case, update call paint tester2.update(); diff --git a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp index 5c0073c..6e60516 100644 --- a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp +++ b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp @@ -1491,9 +1491,7 @@ void tst_QGraphicsProxyWidget::scrollUpdate() View view(&scene); view.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&view); -#endif + QTest::qWaitForWindowShown(&view); QTRY_VERIFY(view.npaints >= 1); QTest::qWait(20); widget->paintEventRegion = QRegion(); diff --git a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp index 07d7cce..864076f 100644 --- a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp +++ b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp @@ -1702,9 +1702,8 @@ void tst_QGraphicsScene::hoverEvents_parentChild() view.rotate(10); view.scale(1.7, 1.7); view.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&view); -#endif + QTest::qWaitForWindowShown(&view); + QTest::qWait(50); QGraphicsSceneMouseEvent mouseEvent(QEvent::GraphicsSceneMouseMove); mouseEvent.setScenePos(QPointF(-1000, -1000)); @@ -3060,52 +3059,53 @@ void tst_QGraphicsScene::tabFocus_sceneWithFocusableItems() widget.show(); qApp->setActiveWindow(&widget); widget.activateWindow(); - QTest::qWait(125); + QTest::qWaitForWindowShown(&widget); + QApplication::processEvents(); dial1->setFocus(); - QVERIFY(dial1->hasFocus()); + QTRY_VERIFY(dial1->hasFocus()); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); - QVERIFY(view->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(view->hasFocus()); QVERIFY(view->viewport()->hasFocus()); QVERIFY(scene.hasFocus()); QVERIFY(item->hasFocus()); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); - QVERIFY(dial2->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(dial2->hasFocus()); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); - QVERIFY(view->hasFocus()); - QVERIFY(view->viewport()->hasFocus()); - QVERIFY(scene.hasFocus()); - QVERIFY(item->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(view->hasFocus()); + QTRY_VERIFY(view->viewport()->hasFocus()); + QTRY_VERIFY(scene.hasFocus()); + QTRY_VERIFY(item->hasFocus()); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); - QVERIFY(dial1->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(dial1->hasFocus()); // If the item requests input focus, it can only ensure that the scene // sets focus on itself, but the scene cannot request focus from any view. item->setFocus(); - QTest::qWait(125); - QVERIFY(!view->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(!view->hasFocus()); QVERIFY(!view->viewport()->hasFocus()); - QVERIFY(scene.hasFocus()); + QTRY_VERIFY(scene.hasFocus()); QVERIFY(item->hasFocus()); view->setFocus(); - QTest::qWait(125); - QVERIFY(view->hasFocus()); - QVERIFY(view->viewport()->hasFocus()); - QVERIFY(scene.hasFocus()); - QVERIFY(item->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(view->hasFocus()); + QTRY_VERIFY(view->viewport()->hasFocus()); + QTRY_VERIFY(scene.hasFocus()); + QTRY_VERIFY(item->hasFocus()); // Check that everyone loses focus when the widget is hidden. widget.hide(); - QTest::qWait(125); - QVERIFY(!view->hasFocus()); + QTest::qWait(15); + QTRY_VERIFY(!view->hasFocus()); QVERIFY(!view->viewport()->hasFocus()); QVERIFY(!scene.hasFocus()); QVERIFY(!item->hasFocus()); @@ -3114,8 +3114,8 @@ void tst_QGraphicsScene::tabFocus_sceneWithFocusableItems() widget.show(); qApp->setActiveWindow(&widget); widget.activateWindow(); - QTest::qWait(125); - QVERIFY(view->hasFocus()); + QTest::qWaitForWindowShown(&widget); + QTRY_VERIFY(view->hasFocus()); QVERIFY(view->viewport()->hasFocus()); QVERIFY(scene.hasFocus()); QVERIFY(item->hasFocus()); @@ -3193,47 +3193,48 @@ void tst_QGraphicsScene::tabFocus_sceneWithFocusWidgets() widget.show(); qApp->setActiveWindow(&widget); widget.activateWindow(); - QTest::qWait(125); + QTest::qWaitForWindowShown(&widget); + QApplication::processEvents(); dial1->setFocus(); - QVERIFY(dial1->hasFocus()); + QTRY_VERIFY(dial1->hasFocus()); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); - QVERIFY(view->hasFocus()); - QVERIFY(view->viewport()->hasFocus()); - QVERIFY(scene.hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(view->hasFocus()); + QTRY_VERIFY(view->viewport()->hasFocus()); + QTRY_VERIFY(scene.hasFocus()); QCOMPARE(widget1->tabs, 0); QVERIFY(widget1->hasFocus()); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); - QCOMPARE(widget1->tabs, 1); - QVERIFY(widget2->hasFocus()); + QApplication::processEvents(); + QTRY_COMPARE(widget1->tabs, 1); + QTRY_VERIFY(widget2->hasFocus()); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); - QCOMPARE(widget2->tabs, 1); - QVERIFY(dial2->hasFocus()); + QApplication::processEvents(); + QTRY_COMPARE(widget2->tabs, 1); + QTRY_VERIFY(dial2->hasFocus()); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); - QVERIFY(widget2->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(widget2->hasFocus()); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); - QCOMPARE(widget2->backTabs, 1); - QVERIFY(widget1->hasFocus()); + QApplication::processEvents(); + QTRY_COMPARE(widget2->backTabs, 1); + QTRY_VERIFY(widget1->hasFocus()); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); - QCOMPARE(widget1->backTabs, 1); - QVERIFY(dial1->hasFocus()); + QApplication::processEvents(); + QTRY_COMPARE(widget1->backTabs, 1); + QTRY_VERIFY(dial1->hasFocus()); widget1->setFocus(); view->viewport()->setFocus(); widget.hide(); - QTest::qWait(125); + QTest::qWait(15); widget.show(); qApp->setActiveWindow(&widget); widget.activateWindow(); - QTest::qWait(125); - QVERIFY(widget1->hasFocus()); + QTest::qWaitForWindowShown(&widget); + QTRY_VERIFY(widget1->hasFocus()); } void tst_QGraphicsScene::tabFocus_sceneWithNestedFocusWidgets() @@ -3276,10 +3277,10 @@ void tst_QGraphicsScene::tabFocus_sceneWithNestedFocusWidgets() widget.show(); qApp->setActiveWindow(&widget); widget.activateWindow(); - QTest::qWait(125); + QTest::qWaitForWindowShown(&widget); dial1->setFocus(); - QVERIFY(dial1->hasFocus()); + QTRY_VERIFY(dial1->hasFocus()); EventSpy focusInSpy_1(widget1, QEvent::FocusIn); EventSpy focusOutSpy_1(widget1, QEvent::FocusOut); @@ -3291,78 +3292,79 @@ void tst_QGraphicsScene::tabFocus_sceneWithNestedFocusWidgets() EventSpy focusOutSpy_2(widget2, QEvent::FocusOut); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); - QVERIFY(widget1->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(widget1->hasFocus()); QCOMPARE(focusInSpy_1.count(), 1); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); - QVERIFY(!widget1->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(!widget1->hasFocus()); QVERIFY(widget1_1->hasFocus()); QCOMPARE(focusOutSpy_1.count(), 1); QCOMPARE(focusInSpy_1_1.count(), 1); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); - QVERIFY(!widget1_1->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(!widget1_1->hasFocus()); QVERIFY(widget1_2->hasFocus()); QCOMPARE(focusOutSpy_1_1.count(), 1); QCOMPARE(focusInSpy_1_2.count(), 1); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); - QVERIFY(!widget1_2->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(!widget1_2->hasFocus()); QVERIFY(widget2->hasFocus()); QCOMPARE(focusOutSpy_1_2.count(), 1); QCOMPARE(focusInSpy_2.count(), 1); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab); - QTest::qWait(125); - QVERIFY(!widget2->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(!widget2->hasFocus()); QVERIFY(dial2->hasFocus()); QCOMPARE(focusOutSpy_2.count(), 1); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); - QVERIFY(widget2->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(widget2->hasFocus()); QCOMPARE(focusInSpy_2.count(), 2); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); - QVERIFY(!widget2->hasFocus()); - QVERIFY(widget1_2->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(!widget2->hasFocus()); + QTRY_VERIFY(widget1_2->hasFocus()); QCOMPARE(focusOutSpy_2.count(), 2); QCOMPARE(focusInSpy_1_2.count(), 2); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); - QVERIFY(!widget1_2->hasFocus()); - QVERIFY(widget1_1->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(!widget1_2->hasFocus()); + QTRY_VERIFY(widget1_1->hasFocus()); QCOMPARE(focusOutSpy_1_2.count(), 2); QCOMPARE(focusInSpy_1_1.count(), 2); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); - QVERIFY(!widget1_1->hasFocus()); - QVERIFY(widget1->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(!widget1_1->hasFocus()); + QTRY_VERIFY(widget1->hasFocus()); QCOMPARE(focusOutSpy_1_1.count(), 2); QCOMPARE(focusInSpy_1.count(), 2); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); - QTest::qWait(125); - QVERIFY(!widget1->hasFocus()); - QVERIFY(dial1->hasFocus()); + QApplication::processEvents(); + QTRY_VERIFY(!widget1->hasFocus()); + QTRY_VERIFY(dial1->hasFocus()); QCOMPARE(focusOutSpy_1.count(), 2); widget1->setFocus(); view->viewport()->setFocus(); widget.hide(); - QTest::qWait(125); + QTest::qWait(12); widget.show(); qApp->setActiveWindow(&widget); widget.activateWindow(); - QTest::qWait(125); - QVERIFY(widget1->hasFocus()); + QTest::qWaitForWindowShown(&widget); + QApplication::processEvents(); + QTRY_VERIFY(widget1->hasFocus()); } void tst_QGraphicsScene::style() @@ -3454,10 +3456,10 @@ void tst_QGraphicsScene::task139782_containsItemBoundingRect() void tst_QGraphicsScene::task176178_itemIndexMethodBreaksSceneRect() { - QGraphicsScene scene; - scene.setItemIndexMethod(QGraphicsScene::NoIndex); - QGraphicsRectItem *rect = new QGraphicsRectItem; - rect->setRect(0,0,100,100); + QGraphicsScene scene; + scene.setItemIndexMethod(QGraphicsScene::NoIndex); + QGraphicsRectItem *rect = new QGraphicsRectItem; + rect->setRect(0,0,100,100); scene.addItem(rect); QCOMPARE(scene.sceneRect(), rect->rect()); } @@ -3518,7 +3520,7 @@ void tst_QGraphicsScene::sorting_data() void tst_QGraphicsScene::sorting() { QFETCH(bool, cache); - + QGraphicsScene scene; scene.setSortCacheEnabled(cache); @@ -3552,15 +3554,15 @@ void tst_QGraphicsScene::sorting() c_2_1_1->setPos(-16, 16); c_2_2->setPos(-16, 28); c_2_2->setZValue(1); - - c_1->setFlag(QGraphicsItem::ItemIsMovable); - c_1_1->setFlag(QGraphicsItem::ItemIsMovable); - c_1_1_1->setFlag(QGraphicsItem::ItemIsMovable); - c_1_2->setFlag(QGraphicsItem::ItemIsMovable); - c_2->setFlag(QGraphicsItem::ItemIsMovable); - c_2_1->setFlag(QGraphicsItem::ItemIsMovable); - c_2_1_1->setFlag(QGraphicsItem::ItemIsMovable); - c_2_2->setFlag(QGraphicsItem::ItemIsMovable); + + c_1->setFlag(QGraphicsItem::ItemIsMovable); + c_1_1->setFlag(QGraphicsItem::ItemIsMovable); + c_1_1_1->setFlag(QGraphicsItem::ItemIsMovable); + c_1_2->setFlag(QGraphicsItem::ItemIsMovable); + c_2->setFlag(QGraphicsItem::ItemIsMovable); + c_2_1->setFlag(QGraphicsItem::ItemIsMovable); + c_2_1_1->setFlag(QGraphicsItem::ItemIsMovable); + c_2_2->setFlag(QGraphicsItem::ItemIsMovable); t_1->setData(0, "t_1"); c_1->setData(0, "c_1"); @@ -3585,7 +3587,7 @@ void tst_QGraphicsScene::sorting() foreach (QGraphicsItem *item, scene.items(32, 31, 4, 55)) qDebug() << "\t" << item->data(0).toString(); qDebug() << "}"; - + QCOMPARE(scene.items(32, 31, 4, 55), QList() << c_1_2 << c_1_1_1 << c_1 << t_1); diff --git a/tests/auto/qstatusbar/tst_qstatusbar.cpp b/tests/auto/qstatusbar/tst_qstatusbar.cpp index 3727882..9774559 100644 --- a/tests/auto/qstatusbar/tst_qstatusbar.cpp +++ b/tests/auto/qstatusbar/tst_qstatusbar.cpp @@ -48,6 +48,8 @@ #include #include +#include "../../shared/util.h" + //TESTED_CLASS= //TESTED_FILES= @@ -177,7 +179,7 @@ void tst_QStatusBar::setSizeGripEnabled() qt_x11_wait_for_window_manager(&mainWindow); #endif - QVERIFY(statusBar->isVisible()); + QTRY_VERIFY(statusBar->isVisible()); QPointer sizeGrip = qFindChild(statusBar); QVERIFY(sizeGrip); QVERIFY(sizeGrip->isVisible()); @@ -223,11 +225,8 @@ void tst_QStatusBar::setSizeGripEnabled() qApp->processEvents(); mainWindow.showNormal(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&mainWindow); -#endif qApp->processEvents(); - QVERIFY(sizeGrip->isVisible()); + QTRY_VERIFY(sizeGrip->isVisible()); } void tst_QStatusBar::task194017_hiddenWidget() diff --git a/tests/auto/qwindowsurface/tst_qwindowsurface.cpp b/tests/auto/qwindowsurface/tst_qwindowsurface.cpp index 0a6b7ad..e96bcf9 100644 --- a/tests/auto/qwindowsurface/tst_qwindowsurface.cpp +++ b/tests/auto/qwindowsurface/tst_qwindowsurface.cpp @@ -230,7 +230,7 @@ void tst_QWindowSurface::grabWidget() parentWidget.show(); QTest::qWaitForWindowShown(&parentWidget); - QTest::qWait(120); + QTest::qWait(220); QPixmap parentPixmap = parentWidget.windowSurface()->grabWidget(&parentWidget); QPixmap childPixmap = childWidget.windowSurface()->grabWidget(&childWidget); -- cgit v0.12 From 68f709fb180af94af259a9afb873b9548c97c0fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Wed, 30 Sep 2009 16:05:23 +0200 Subject: Moving some QVFB stuff out of the configure script and into .pro files Reviewed-by: Paul Olav Tvete --- configure | 10 ---------- tools/qvfb/qvfb.pro | 11 ++++++----- tools/qvfb/translations/translations.pro | 12 ++++++------ 3 files changed, 12 insertions(+), 21 deletions(-) diff --git a/configure b/configure index f89da70..e86d008 100755 --- a/configure +++ b/configure @@ -2232,16 +2232,6 @@ if [ "$OPT_SHADOW" = "yes" ]; then ln -s "$relpath/tools/porting/src/q3porting.xml" "$outpath/tools/porting/src" fi -# symlink files from src/gui/embedded neccessary to build qvfb -if [ "$CFG_DEV" = "yes" ]; then - mkdir -p "$outpath/tools/qvfb" - for f in qvfbhdr.h qlock_p.h qlock.cpp qwssignalhandler_p.h qwssignalhandler.cpp; do - dest="${outpath}/tools/qvfb/${f}" - rm -f "$dest" - ln -s "${relpath}/src/gui/embedded/${f}" "${dest}" - done -fi - # symlink fonts to be able to run application from build directory if [ "$PLATFORM_QWS" = "yes" ] && [ ! -e "${outpath}/lib/fonts" ]; then if [ "$PLATFORM" = "$XPLATFORM" ]; then diff --git a/tools/qvfb/qvfb.pro b/tools/qvfb/qvfb.pro index 247337a..dde7e8d 100644 --- a/tools/qvfb/qvfb.pro +++ b/tools/qvfb/qvfb.pro @@ -9,6 +9,7 @@ target.path=$$[QT_INSTALL_BINS] INSTALLS += target DEPENDPATH = ../../include +INCLUDEPATH += ../../src/gui/embedded FORMS = config.ui HEADERS = qvfb.h \ @@ -19,9 +20,9 @@ HEADERS = qvfb.h \ qvfbprotocol.h \ qvfbshmem.h \ qvfbmmap.h \ - qvfbhdr.h \ - qlock_p.h \ - qwssignalhandler_p.h + ../../src/gui/embedded/qvfbhdr.h \ + ../../src/gui/embedded/qlock_p.h \ + ../../src/gui/embedded/qwssignalhandler_p.h SOURCES = qvfb.cpp \ qvfbview.cpp \ @@ -31,8 +32,8 @@ SOURCES = qvfb.cpp \ qvfbprotocol.cpp \ qvfbshmem.cpp \ qvfbmmap.cpp \ - qlock.cpp \ - qwssignalhandler.cpp + ../../src/gui/embedded/qlock.cpp \ + ../../src/gui/embedded/qwssignalhandler.cpp include($$QT_SOURCE_TREE/tools/shared/deviceskin/deviceskin.pri) diff --git a/tools/qvfb/translations/translations.pro b/tools/qvfb/translations/translations.pro index f667bb8..17579f7 100644 --- a/tools/qvfb/translations/translations.pro +++ b/tools/qvfb/translations/translations.pro @@ -9,10 +9,10 @@ HEADERS = ../qvfb.h \ ../qvfbprotocol.h \ ../qvfbshmem.h \ ../qvfbmmap.h \ - ../qvfbhdr.h \ - ../qlock_p.h \ - ../qwssignalhandler_p.h \ - ../../shared/deviceskin/deviceskin.cpp + ../../../src/gui/embedded/qvfbhdr.h \ + ../../../src/gui/embedded/qlock_p.h \ + ../../../src/gui/embedded/qwssignalhandler_p.h \ + ../../shared/deviceskin/deviceskin.h SOURCES = ../qvfb.cpp \ ../qvfbview.cpp \ @@ -22,8 +22,8 @@ SOURCES = ../qvfb.cpp \ ../qvfbprotocol.cpp \ ../qvfbshmem.cpp \ ../qvfbmmap.cpp \ - ../qlock.cpp \ - ../qwssignalhandler.cpp \ + ../../../src/gui/embedded/qlock.cpp \ + ../../../src/gui/embedded/qwssignalhandler.cpp \ ../../shared/deviceskin/deviceskin.cpp TRANSLATIONS=$$[QT_INSTALL_TRANSLATIONS]/qvfb_pl.ts \ -- cgit v0.12 From 28c61efdd823cb5fa93f4ab2ef3109bb01c56ed5 Mon Sep 17 00:00:00 2001 From: Janne Koskinen Date: Wed, 30 Sep 2009 16:23:23 +0200 Subject: Make it possible to debug JSC in the Symbian emulator. Cherry-picked-by: Simon Hausmann http://trac.webkit.org/changeset/48928 This is not a perfect fix, it requires more fine tuning. But this makes it possible again to debug in the emulator, which is more important in order to be able to fix other run-time issues. --- src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.h | 2 +- src/3rdparty/webkit/JavaScriptCore/runtime/Collector.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.h b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.h index 1a55bb5..0ecff19 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.h @@ -181,7 +181,7 @@ namespace JSC { #endif template<> struct CellSize { static const size_t m_value = 64; }; -#if PLATFORM(WINCE) +#if PLATFORM(WINCE) || PLATFORM(SYMBIAN) const size_t BLOCK_SIZE = 64 * 1024; // 64k #else const size_t BLOCK_SIZE = 64 * 4096; // 256k diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.h b/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.h index 1a55bb5..0ecff19 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.h +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/Collector.h @@ -181,7 +181,7 @@ namespace JSC { #endif template<> struct CellSize { static const size_t m_value = 64; }; -#if PLATFORM(WINCE) +#if PLATFORM(WINCE) || PLATFORM(SYMBIAN) const size_t BLOCK_SIZE = 64 * 1024; // 64k #else const size_t BLOCK_SIZE = 64 * 4096; // 256k -- cgit v0.12 From 76b8df83645c66c15d58bf12d7ffa3ea944ecb07 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 30 Sep 2009 16:35:12 +0200 Subject: Make sure to process the events in QTest::qWaitForWindowShown on X11 qt_x11_wait_for_window_manager doesn't necesserly process the events Reviewed-by: Denis --- src/testlib/qtestsystem.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/testlib/qtestsystem.h b/src/testlib/qtestsystem.h index a9a2193..e8b8359 100644 --- a/src/testlib/qtestsystem.h +++ b/src/testlib/qtestsystem.h @@ -75,6 +75,7 @@ namespace QTest { #if defined(Q_WS_X11) qt_x11_wait_for_window_manager(window); + QApplication::processEvents(); #elif defined(Q_WS_QWS) Q_UNUSED(window); qWait(100); -- cgit v0.12 From 5022e56d71237292138cc8c912a467049c538445 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 30 Sep 2009 16:39:57 +0200 Subject: Compilation fix for tests thas doesn't include qapplication.h --- src/testlib/qtestsystem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/testlib/qtestsystem.h b/src/testlib/qtestsystem.h index e8b8359..8caec76 100644 --- a/src/testlib/qtestsystem.h +++ b/src/testlib/qtestsystem.h @@ -75,7 +75,7 @@ namespace QTest { #if defined(Q_WS_X11) qt_x11_wait_for_window_manager(window); - QApplication::processEvents(); + QCoreApplication::processEvents(); #elif defined(Q_WS_QWS) Q_UNUSED(window); qWait(100); -- cgit v0.12 From 2bb2a8a184b0e0f1816822e244cf9bd8e122a16a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Tue, 29 Sep 2009 14:04:06 +0200 Subject: Readd QGraphicsBloomEffect. This effect was removed in 1c9a28ea64cc53e61a64644dc5a4ff121b475bc5, but has now been readded on request from a couple of customers. Andreas also agreed we should provide this effect. Reviewed-by: Andreas --- doc/src/images/graphicseffect-bloom.png | Bin 0 -> 79982 bytes doc/src/images/graphicseffect-effects.png | Bin 395669 -> 486123 bytes src/gui/effects/qgraphicseffect.cpp | 178 ++++++++++++++++++++++++++++++ src/gui/effects/qgraphicseffect.h | 34 ++++++ src/gui/effects/qgraphicseffect_p.h | 12 ++ 5 files changed, 224 insertions(+) create mode 100644 doc/src/images/graphicseffect-bloom.png diff --git a/doc/src/images/graphicseffect-bloom.png b/doc/src/images/graphicseffect-bloom.png new file mode 100644 index 0000000..dace7eb Binary files /dev/null and b/doc/src/images/graphicseffect-bloom.png differ diff --git a/doc/src/images/graphicseffect-effects.png b/doc/src/images/graphicseffect-effects.png index 3709014..609bef9 100644 Binary files a/doc/src/images/graphicseffect-effects.png and b/doc/src/images/graphicseffect-effects.png differ diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp index eee9bbf..474af53 100644 --- a/src/gui/effects/qgraphicseffect.cpp +++ b/src/gui/effects/qgraphicseffect.cpp @@ -67,6 +67,7 @@ \o QGraphicsOpacityEffect - renders the item with an opacity \o QGraphicsPixelizeEffect - pixelizes the item with any pixel size \o QGraphicsGrayscaleEffect - renders the item in shades of gray + \o QGraphicsBloomEffect - applies a blooming / glowing effect \endlist \img graphicseffect-effects.png @@ -1305,5 +1306,182 @@ void QGraphicsOpacityEffect::draw(QPainter *painter, QGraphicsEffectSource *sour painter->restore(); } +/*! + \class QGraphicsBloomEffect + \brief The QGraphicsBloomEffect class provides a bloom/glow effect. + \since 4.6 + + A bloom/glow effect adds fringes of light around bright areas in the source. + + \img graphicseffect-bloom.png + + \sa QGraphicsDropShadowEffect, QGraphicsBlurEffect, QGraphicsPixelizeEffect, + QGraphicsGrayscaleEffect, QGraphicsColorizeEffect +*/ + +/*! + Constructs a new QGraphicsBloomEffect instance. + The \a parent parameter is passed to QGraphicsEffect's constructor. +*/ +QGraphicsBloomEffect::QGraphicsBloomEffect(QObject *parent) + : QGraphicsEffect(*new QGraphicsBloomEffectPrivate, parent) +{ + Q_D(QGraphicsBloomEffect); + for (int i = 0; i < 256; ++i) + d->colorTable[i] = qMin(i + d->brightness, 255); +} + +/*! + Destroys the effect. +*/ +QGraphicsBloomEffect::~QGraphicsBloomEffect() +{ +} + +/*! + \reimp +*/ +QRectF QGraphicsBloomEffect::boundingRectFor(const QRectF &rect) const +{ + Q_D(const QGraphicsBloomEffect); + const qreal delta = d->blurFilter.radius() * 2; + return rect.adjusted(-delta, -delta, delta, delta); +} + +/*! + \property QGraphicsBloomEffect::blurRadius + \brief the blur radius in pixels of the effect. + + Using a smaller radius results in a sharper appearance, whereas a bigger + radius results in a more blurred appearance. + + By default, the blur radius is 5 pixels. + + \sa strength(), brightness() +*/ +int QGraphicsBloomEffect::blurRadius() const +{ + Q_D(const QGraphicsBloomEffect); + return d->blurFilter.radius(); +} + +void QGraphicsBloomEffect::setBlurRadius(int radius) +{ + Q_D(QGraphicsBloomEffect); + if (d->blurFilter.radius() == radius) + return; + + d->blurFilter.setRadius(radius); + updateBoundingRect(); + emit blurRadiusChanged(radius); +} + +/*! + \property QGraphicsBloomEffect::brightness + \brief the brightness of the glow. + + The value should be in the range of 0 to 255, where 0 is dark + and 255 is bright. + + By default, the brightness is 70. + + \sa strength(), blurRadius() +*/ +int QGraphicsBloomEffect::brightness() const +{ + Q_D(const QGraphicsBloomEffect); + return d->brightness; +} + +void QGraphicsBloomEffect::setBrightness(int brightness) +{ + Q_D(QGraphicsBloomEffect); + brightness = qBound(0, brightness, 255); + if (d->brightness == brightness) + return; + + d->brightness = brightness; + for (int i = 0; i < 256; ++i) + d->colorTable[i] = qMin(i + brightness, 255); + + update(); + emit brightnessChanged(brightness); +} + +/*! + \property QGraphicsBloomEffect::strength + \brief the strength of the effect. + + A strength 0.0 equals to no effect, while 1.0 means maximum glow. + + By default, the strength is 0.7. +*/ +qreal QGraphicsBloomEffect::strength() const +{ + Q_D(const QGraphicsBloomEffect); + return d->strength; +} + +void QGraphicsBloomEffect::setStrength(qreal strength) +{ + Q_D(QGraphicsBloomEffect); + strength = qBound(qreal(0.0), strength, qreal(1.0)); + if (qFuzzyCompare(d->strength, strength)) + return; + + d->strength = strength; + update(); + emit strengthChanged(strength); +} + +/*! + \reimp +*/ +void QGraphicsBloomEffect::draw(QPainter *painter, QGraphicsEffectSource *source) +{ + Q_D(QGraphicsBloomEffect); + if (d->strength < 0.001) { + source->draw(painter); + return; + } + + const Qt::CoordinateSystem system = source->isPixmap() + ? Qt::LogicalCoordinates : Qt::DeviceCoordinates; + QPoint offset; + QPixmap pixmap = source->pixmap(system, &offset); + QImage result = pixmap.toImage().convertToFormat(QImage::Format_ARGB32_Premultiplied); + + // Blur. + QPainter blurPainter(&pixmap); + d->blurFilter.draw(&blurPainter, QPointF(), pixmap); + blurPainter.end(); + + // Brighten. + QImage overlay = pixmap.toImage().convertToFormat(QImage::Format_ARGB32); + const int numBits = overlay.width() * overlay.height(); + QRgb *bits = reinterpret_cast(overlay.bits()); + for (int i = 0; i < numBits; ++i) { + const QRgb bit = bits[i]; + bits[i] = qRgba(d->colorTable[qRed(bit)], d->colorTable[qGreen(bit)], + d->colorTable[qBlue(bit)], qAlpha(bit)); + } + + // Composite. + QPainter compPainter(&result); + compPainter.setCompositionMode(QPainter::CompositionMode_Overlay); + compPainter.setOpacity(d->strength); + compPainter.drawImage(0, 0, overlay); + compPainter.end(); + + if (system == Qt::DeviceCoordinates) { + QTransform restoreTransform = painter->worldTransform(); + painter->setWorldTransform(QTransform()); + painter->drawImage(offset, result); + painter->setWorldTransform(restoreTransform); + } else { + painter->drawImage(offset, result); + } +} + QT_END_NAMESPACE diff --git a/src/gui/effects/qgraphicseffect.h b/src/gui/effects/qgraphicseffect.h index c256381..c2bb9b0 100644 --- a/src/gui/effects/qgraphicseffect.h +++ b/src/gui/effects/qgraphicseffect.h @@ -339,6 +339,40 @@ private: Q_DISABLE_COPY(QGraphicsOpacityEffect) }; +class QGraphicsBloomEffectPrivate; +class Q_GUI_EXPORT QGraphicsBloomEffect: public QGraphicsEffect +{ + Q_OBJECT + Q_PROPERTY(int blurRadius READ blurRadius WRITE setBlurRadius NOTIFY blurRadiusChanged) + Q_PROPERTY(int brightness READ brightness WRITE setBrightness NOTIFY brightnessChanged) + Q_PROPERTY(qreal strength READ strength WRITE setStrength NOTIFY strengthChanged) +public: + QGraphicsBloomEffect(QObject *parent = 0); + ~QGraphicsBloomEffect(); + + QRectF boundingRectFor(const QRectF &rect) const; + int blurRadius() const; + int brightness() const; + qreal strength() const; + +public Q_SLOTS: + void setBlurRadius(int blurRadius); + void setBrightness(int brightness); + void setStrength(qreal strength); + +Q_SIGNALS: + void blurRadiusChanged(int blurRadius); + void brightnessChanged(int brightness); + void strengthChanged(qreal strength); + +protected: + void draw(QPainter *painter, QGraphicsEffectSource *source); + +private: + Q_DECLARE_PRIVATE(QGraphicsBloomEffect) + Q_DISABLE_COPY(QGraphicsBloomEffect) +}; + QT_END_NAMESPACE QT_END_HEADER diff --git a/src/gui/effects/qgraphicseffect_p.h b/src/gui/effects/qgraphicseffect_p.h index e109790..96eda0e 100644 --- a/src/gui/effects/qgraphicseffect_p.h +++ b/src/gui/effects/qgraphicseffect_p.h @@ -185,6 +185,18 @@ public: uint hasOpacityMask : 1; }; +class QGraphicsBloomEffectPrivate : public QGraphicsEffectPrivate +{ + Q_DECLARE_PUBLIC(QGraphicsBlurEffect) +public: + QGraphicsBloomEffectPrivate() : brightness(70), strength(0.7) {} + + QPixmapBlurFilter blurFilter; + int colorTable[256]; + int brightness; + qreal strength; +}; + QT_END_NAMESPACE #endif // QGRAPHICSEFFECT_P_H -- cgit v0.12 From 53dd13e439932cb234fbfff9d0dcd97d67334329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Wed, 30 Sep 2009 14:25:05 +0200 Subject: Add Qt::RenderHint to control rendering operations. We need a way to control various rendering operations. For example, whether quality is more important than performance, or the other way around. This change also replaces occurences of QPixmapFilter/QGraphicsEffect::BlurHint (introduced in 1a431e850893b6b162c833f4f148f090e2427dda) with Qt::RenderHint. Reviewed-by: Samuel --- src/corelib/global/qnamespace.h | 5 +++++ src/corelib/global/qnamespace.qdoc | 15 +++++++++++++++ src/gui/effects/qgraphicseffect.cpp | 36 +++++++++++------------------------- src/gui/effects/qgraphicseffect.h | 13 ++++--------- src/gui/image/qpixmapfilter.cpp | 8 ++++---- src/gui/image/qpixmapfilter_p.h | 9 ++------- src/opengl/qglpixmapfilter.cpp | 18 +++++++++--------- 7 files changed, 50 insertions(+), 54 deletions(-) diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 741c06f..473398b 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -1627,6 +1627,11 @@ public: NavigationModeCursorAuto, NavigationModeCursorForceVisible }; + + enum RenderHint { + QualityHint, + PerformanceHint + }; } #ifdef Q_MOC_RUN ; diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 40dd1d2..1833b96 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -2814,3 +2814,18 @@ \sa QApplication::setNavigationMode() \sa QApplication::navigationMode() */ + +/*! + \enum Qt::RenderHint + \since 4.6 + + This enum describes the possible hints that can be used to control various + rendering operations. + + \value QualityHint Indicates that rendering quality is the most important factor, + at the potential cost of lower performance. + + \value PerformanceHint Indicates that rendering performance is the most important factor, + at the potential cost of lower quality. +*/ + diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp index 474af53..5fc61d7 100644 --- a/src/gui/effects/qgraphicseffect.cpp +++ b/src/gui/effects/qgraphicseffect.cpp @@ -796,7 +796,7 @@ QGraphicsBlurEffect::QGraphicsBlurEffect(QObject *parent) : QGraphicsEffect(*new QGraphicsBlurEffectPrivate, parent) { Q_D(QGraphicsBlurEffect); - d->filter->setBlurHint(QPixmapBlurFilter::PerformanceHint); + d->filter->setBlurHint(Qt::PerformanceHint); } /*! @@ -840,48 +840,34 @@ void QGraphicsBlurEffect::setBlurRadius(int radius) */ /*! - \enum QGraphicsBlurEffect::BlurHint - - \since 4.6 - - This enum describes the hint of a blur graphics effect. - - \value PerformanceHint Using this value hints that performance is the - most important factor, at the potential cost of lower quality. - - \value QualityHint Using this value hints that a higher quality blur is - preferred over a fast blur. -*/ - -/*! \property QGraphicsBlurEffect::blurHint \brief the blur hint of the effect. - Use the PerformanceHint blur hint to say that you want a faster blur, - and the QualityHint blur hint to say that you prefer a higher quality blur. + Use the Qt::PerformanceHint hint to say that you want a faster blur, + and the Qt::QualityHint hint to say that you prefer a higher quality blur. - When animating the blur radius it's recommended to use the PerformanceHint. + When animating the blur radius it's recommended to use Qt::PerformanceHint. - By default, the blur hint is PerformanceHint. + By default, the blur hint is Qt::PerformanceHint. */ -QGraphicsBlurEffect::BlurHint QGraphicsBlurEffect::blurHint() const +Qt::RenderHint QGraphicsBlurEffect::blurHint() const { Q_D(const QGraphicsBlurEffect); - return BlurHint(d->filter->blurHint()); + return d->filter->blurHint(); } -void QGraphicsBlurEffect::setBlurHint(QGraphicsBlurEffect::BlurHint hint) +void QGraphicsBlurEffect::setBlurHint(Qt::RenderHint hint) { Q_D(QGraphicsBlurEffect); - if (BlurHint(d->filter->blurHint()) == hint) + if (d->filter->blurHint() == hint) return; - d->filter->setBlurHint(QPixmapBlurFilter::BlurHint(hint)); + d->filter->setBlurHint(hint); emit blurHintChanged(hint); } /*! - \fn void QGraphicsBlurEffect::blurHintChanged(QGraphicsBlurEffect::BlurHint hint) + \fn void QGraphicsBlurEffect::blurHintChanged(Qt::RenderHint hint) This signal is emitted whenever the effect's blur hint changes. The \a hint parameter holds the effect's new blur hint. diff --git a/src/gui/effects/qgraphicseffect.h b/src/gui/effects/qgraphicseffect.h index c2bb9b0..a92ce13 100644 --- a/src/gui/effects/qgraphicseffect.h +++ b/src/gui/effects/qgraphicseffect.h @@ -224,27 +224,22 @@ class Q_GUI_EXPORT QGraphicsBlurEffect: public QGraphicsEffect { Q_OBJECT Q_PROPERTY(int blurRadius READ blurRadius WRITE setBlurRadius NOTIFY blurRadiusChanged) - Q_PROPERTY(BlurHint blurHint READ blurHint WRITE setBlurHint NOTIFY blurHintChanged) + Q_PROPERTY(Qt::RenderHint blurHint READ blurHint WRITE setBlurHint NOTIFY blurHintChanged) public: - enum BlurHint { - PerformanceHint, - QualityHint - }; - QGraphicsBlurEffect(QObject *parent = 0); ~QGraphicsBlurEffect(); QRectF boundingRectFor(const QRectF &rect) const; int blurRadius() const; - BlurHint blurHint() const; + Qt::RenderHint blurHint() const; public Q_SLOTS: void setBlurRadius(int blurRadius); - void setBlurHint(BlurHint blurHint); + void setBlurHint(Qt::RenderHint hint); Q_SIGNALS: void blurRadiusChanged(int blurRadius); - void blurHintChanged(BlurHint blurHint); + void blurHintChanged(Qt::RenderHint hint); protected: void draw(QPainter *painter, QGraphicsEffectSource *source); diff --git a/src/gui/image/qpixmapfilter.cpp b/src/gui/image/qpixmapfilter.cpp index ba9a1e2..749b8f3 100644 --- a/src/gui/image/qpixmapfilter.cpp +++ b/src/gui/image/qpixmapfilter.cpp @@ -504,10 +504,10 @@ void QPixmapConvolutionFilter::draw(QPainter *painter, const QPointF &p, const Q class QPixmapBlurFilterPrivate : public QPixmapFilterPrivate { public: - QPixmapBlurFilterPrivate() : radius(5), hint(QPixmapBlurFilter::PerformanceHint) {} + QPixmapBlurFilterPrivate() : radius(5), hint(Qt::PerformanceHint) {} int radius; - QPixmapBlurFilter::BlurHint hint; + Qt::RenderHint hint; }; @@ -561,7 +561,7 @@ int QPixmapBlurFilter::radius() const \internal */ -void QPixmapBlurFilter::setBlurHint(QPixmapBlurFilter::BlurHint hint) +void QPixmapBlurFilter::setBlurHint(Qt::RenderHint hint) { Q_D(QPixmapBlurFilter); d->hint = hint; @@ -572,7 +572,7 @@ void QPixmapBlurFilter::setBlurHint(QPixmapBlurFilter::BlurHint hint) \internal */ -QPixmapBlurFilter::BlurHint QPixmapBlurFilter::blurHint() const +Qt::RenderHint QPixmapBlurFilter::blurHint() const { Q_D(const QPixmapBlurFilter); return d->hint; diff --git a/src/gui/image/qpixmapfilter_p.h b/src/gui/image/qpixmapfilter_p.h index 92c8e56..8a2207a 100644 --- a/src/gui/image/qpixmapfilter_p.h +++ b/src/gui/image/qpixmapfilter_p.h @@ -126,19 +126,14 @@ class Q_GUI_EXPORT QPixmapBlurFilter : public QPixmapFilter Q_DECLARE_PRIVATE(QPixmapBlurFilter) public: - enum BlurHint { - PerformanceHint, - QualityHint - }; - QPixmapBlurFilter(QObject *parent = 0); ~QPixmapBlurFilter(); void setRadius(int radius); - void setBlurHint(BlurHint hint); + void setBlurHint(Qt::RenderHint hint); int radius() const; - BlurHint blurHint() const; + Qt::RenderHint blurHint() const; QRectF boundingRectFor(const QRectF &rect) const; void draw(QPainter *painter, const QPointF &dest, const QPixmap &src, const QRectF &srcRect = QRectF()) const; diff --git a/src/opengl/qglpixmapfilter.cpp b/src/opengl/qglpixmapfilter.cpp index 15714c2..1ae3866 100644 --- a/src/opengl/qglpixmapfilter.cpp +++ b/src/opengl/qglpixmapfilter.cpp @@ -100,7 +100,7 @@ private: class QGLPixmapBlurFilter : public QGLCustomShaderStage, public QGLPixmapFilter { public: - QGLPixmapBlurFilter(QPixmapBlurFilter::BlurHint hint); + QGLPixmapBlurFilter(Qt::RenderHint hint); void setUniforms(QGLShaderProgram *program); @@ -115,7 +115,7 @@ private: mutable bool m_haveCached; mutable int m_cachedRadius; - mutable QPixmapBlurFilter::BlurHint m_hint; + mutable Qt::RenderHint m_hint; }; extern QGLWidget *qt_gl_share_widget(); @@ -131,13 +131,13 @@ QPixmapFilter *QGL2PaintEngineEx::pixmapFilter(int type, const QPixmapFilter *pr case QPixmapFilter::BlurFilter: { const QPixmapBlurFilter *proto = static_cast(prototype); - if (proto->blurHint() == QPixmapBlurFilter::PerformanceHint || proto->radius() <= 5) { + if (proto->blurHint() == Qt::PerformanceHint || proto->radius() <= 5) { if (!d->fastBlurFilter) - d->fastBlurFilter.reset(new QGLPixmapBlurFilter(QPixmapBlurFilter::PerformanceHint)); + d->fastBlurFilter.reset(new QGLPixmapBlurFilter(Qt::PerformanceHint)); return d->fastBlurFilter.data(); } if (!d->blurFilter) - d->blurFilter.reset(new QGLPixmapBlurFilter(QPixmapBlurFilter::QualityHint)); + d->blurFilter.reset(new QGLPixmapBlurFilter(Qt::QualityHint)); return d->blurFilter.data(); } @@ -279,12 +279,12 @@ static const char *qt_gl_blur_filter_fast = " return color * (1.0 / float(samples));" "}"; -QGLPixmapBlurFilter::QGLPixmapBlurFilter(QPixmapBlurFilter::BlurHint hint) +QGLPixmapBlurFilter::QGLPixmapBlurFilter(Qt::RenderHint hint) : m_haveCached(false) , m_cachedRadius(5) , m_hint(hint) { - if (hint == PerformanceHint) { + if (hint == Qt::PerformanceHint) { QGLPixmapBlurFilter *filter = const_cast(this); filter->setSource(qt_gl_blur_filter_fast); m_haveCached = true; @@ -296,7 +296,7 @@ bool QGLPixmapBlurFilter::processGL(QPainter *painter, const QPointF &pos, const QGLPixmapBlurFilter *filter = const_cast(this); int radius = this->radius(); - if (!m_haveCached || (m_hint == QualityHint && radius != m_cachedRadius)) { + if (!m_haveCached || (m_hint == Qt::QualityHint && radius != m_cachedRadius)) { // Only regenerate the shader from source if parameters have changed. m_haveCached = true; m_cachedRadius = radius; @@ -358,7 +358,7 @@ bool QGLPixmapBlurFilter::processGL(QPainter *painter, const QPointF &pos, const void QGLPixmapBlurFilter::setUniforms(QGLShaderProgram *program) { - if (m_hint == QualityHint) { + if (m_hint == Qt::QualityHint) { if (m_horizontalBlur) program->setUniformValue("delta", 1.0 / m_textureSize.width(), 0.0); else -- cgit v0.12 From 7ca2f8ee15fbac8dce815678d7d63748d3187cb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Wed, 30 Sep 2009 14:57:08 +0200 Subject: Added QGraphicsBloomEffect::blurHint. This allows the user to control whether to use a fast dynamic blur or a static high quality blur. Reviewed-by: Samuel --- src/gui/effects/qgraphicseffect.cpp | 34 ++++++++++++++++++++++++++++++++++ src/gui/effects/qgraphicseffect.h | 4 ++++ 2 files changed, 38 insertions(+) diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp index 5fc61d7..4a59301 100644 --- a/src/gui/effects/qgraphicseffect.cpp +++ b/src/gui/effects/qgraphicseffect.cpp @@ -1363,6 +1363,40 @@ void QGraphicsBloomEffect::setBlurRadius(int radius) } /*! + \property QGraphicsBloomEffect::blurHint + \brief the blur hint of the effect. + + Use the Qt::PerformanceHint hint to say that you want a faster blur, + and the Qt::QualityHint hint to say that you prefer a higher quality blur. + + When animating the blur radius it's recommended to use Qt::PerformanceHint. + + By default, the blur hint is Qt::PerformanceHint. +*/ +Qt::RenderHint QGraphicsBloomEffect::blurHint() const +{ + Q_D(const QGraphicsBloomEffect); + return d->blurFilter.blurHint(); +} + +void QGraphicsBloomEffect::setBlurHint(Qt::RenderHint hint) +{ + Q_D(QGraphicsBloomEffect); + if (d->blurFilter.blurHint() == hint) + return; + + d->blurFilter.setBlurHint(hint); + emit blurHintChanged(hint); +} + +/*! + \fn void QGraphicsBloomEffect::blurHintChanged(Qt::RenderHint hint) + + This signal is emitted whenever the effect's blur hint changes. + The \a hint parameter holds the effect's new blur hint. +*/ + +/*! \property QGraphicsBloomEffect::brightness \brief the brightness of the glow. diff --git a/src/gui/effects/qgraphicseffect.h b/src/gui/effects/qgraphicseffect.h index a92ce13..c5d3ede 100644 --- a/src/gui/effects/qgraphicseffect.h +++ b/src/gui/effects/qgraphicseffect.h @@ -339,6 +339,7 @@ class Q_GUI_EXPORT QGraphicsBloomEffect: public QGraphicsEffect { Q_OBJECT Q_PROPERTY(int blurRadius READ blurRadius WRITE setBlurRadius NOTIFY blurRadiusChanged) + Q_PROPERTY(Qt::RenderHint blurHint READ blurHint WRITE setBlurHint NOTIFY blurHintChanged) Q_PROPERTY(int brightness READ brightness WRITE setBrightness NOTIFY brightnessChanged) Q_PROPERTY(qreal strength READ strength WRITE setStrength NOTIFY strengthChanged) public: @@ -347,16 +348,19 @@ public: QRectF boundingRectFor(const QRectF &rect) const; int blurRadius() const; + Qt::RenderHint blurHint() const; int brightness() const; qreal strength() const; public Q_SLOTS: void setBlurRadius(int blurRadius); + void setBlurHint(Qt::RenderHint hint); void setBrightness(int brightness); void setStrength(qreal strength); Q_SIGNALS: void blurRadiusChanged(int blurRadius); + void blurHintChanged(Qt::RenderHint hint); void brightnessChanged(int brightness); void strengthChanged(qreal strength); -- cgit v0.12 From ad2a693584bd2892a568e3830b1c390d6e5f012a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Wed, 30 Sep 2009 15:12:46 +0200 Subject: Doc: Remaining pieces of the Graphics effect documentation. --- src/corelib/global/qnamespace.qdoc | 13 +++++++++++++ src/gui/effects/qgraphicseffect.cpp | 21 +++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 1833b96..684ebca 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -2776,6 +2776,19 @@ */ /*! + \enum Qt::CoordinateSystem + \since 4.6 + + This enum specifies the coordinate system. + + \value DeviceCoordinates Coordinates are relative to the upper-left corner + of the object's paint device. + + \value LogicalCoordinates Coordinates are relative to the upper-left corner + of the object. +*/ + +/*! \enum Qt::GestureState \since 4.6 diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp index 4a59301..e971fd8 100644 --- a/src/gui/effects/qgraphicseffect.cpp +++ b/src/gui/effects/qgraphicseffect.cpp @@ -1363,6 +1363,13 @@ void QGraphicsBloomEffect::setBlurRadius(int radius) } /*! + \fn void QGraphicsBloomEffect::blurRadiusChanged(int blurRadius) + + This signal is emitted whenever the effect's blur radius changes. + The \a blurRadius parameter holds the effect's new blur radius. +*/ + +/*! \property QGraphicsBloomEffect::blurHint \brief the blur hint of the effect. @@ -1429,6 +1436,13 @@ void QGraphicsBloomEffect::setBrightness(int brightness) } /*! + \fn void QGraphicsBloomEffect::brightnessChanged(int brightness) + + This signal is emitted whenever the effect's brightness changes. + The \a brightness parameter holds the effect's new brightness. +*/ + +/*! \property QGraphicsBloomEffect::strength \brief the strength of the effect. @@ -1455,6 +1469,13 @@ void QGraphicsBloomEffect::setStrength(qreal strength) } /*! + \fn void QGraphicsBloomEffect::strengthChanged(qreal strength) + + This signal is emitted whenever the effect's strength changes. + The \a strength parameter holds the effect's new strength. +*/ + +/*! \reimp */ void QGraphicsBloomEffect::draw(QPainter *painter, QGraphicsEffectSource *source) -- cgit v0.12 From 571cb24e2c142b4089d1a263b9f3f97f5e211b51 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Wed, 30 Sep 2009 16:42:37 +0200 Subject: Revert "Google Chat example: state that SSL is required" This reverts commit 59623e45ee31892c9ef210f8d7e396ccb0fe31a5. A fix for the same problem had been pushed by Simon shortly before that one. --- examples/webkit/googlechat/main.cpp | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/examples/webkit/googlechat/main.cpp b/examples/webkit/googlechat/main.cpp index 9e235a9..fd08114 100644 --- a/examples/webkit/googlechat/main.cpp +++ b/examples/webkit/googlechat/main.cpp @@ -43,25 +43,10 @@ #include #include "googlechat.h" -#ifndef QT_NO_OPENSSL -#include -#endif - int main(int argc, char * argv[]) { QApplication app(argc, argv); -#ifndef QT_NO_OPENSSL - if (!QSslSocket::supportsSsl()) { -#endif - QMessageBox::information(0, "Google Talk client", - "Your system does not support SSL, " - "which is required to run this example."); - return -1; -#ifndef QT_NO_OPENSSL - } -#endif - QNetworkProxyFactory::setUseSystemConfigurationEnabled(true); GoogleChat *chat = new GoogleChat; -- cgit v0.12 From 6fb1e687310f3f70c2f0bd3f25e91b65e65cafd2 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Wed, 30 Sep 2009 16:51:27 +0200 Subject: Google Chat example: always bail out if SSL not available Reviewed-by: Simon Hausmann --- examples/webkit/googlechat/googlechat.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/webkit/googlechat/googlechat.cpp b/examples/webkit/googlechat/googlechat.cpp index af567d1..d2307d9 100644 --- a/examples/webkit/googlechat/googlechat.cpp +++ b/examples/webkit/googlechat/googlechat.cpp @@ -118,12 +118,12 @@ void GoogleChat::doLogin() { } void GoogleChat::initialPage(bool ok) { - if (ok) { - if (!QSslSocket::supportsSsl()) { - showError("This example requires SSL support."); - return; - } + if (!QSslSocket::supportsSsl()) { + showError("This example requires SSL support."); + return; + } + if (ok) { QString s1 = evalJS("document.getElementById('Email').name"); QString s2 = evalJS("document.getElementById('Passwd').name"); QString s3 = evalJS("document.getElementById('gaia_loginform').id"); -- cgit v0.12 From 3b8c67a07acd049035ac67c6ff981939f357473c Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 30 Sep 2009 17:03:59 +0200 Subject: Fix locale encoding in XLIFF files xlf uses xx-YY notation instead of xx_YY Reviewed-by: ossi --- tools/linguist/shared/xliff.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tools/linguist/shared/xliff.cpp b/tools/linguist/shared/xliff.cpp index b0c7546..696c930 100644 --- a/tools/linguist/shared/xliff.cpp +++ b/tools/linguist/shared/xliff.cpp @@ -498,7 +498,9 @@ bool XLIFFHandler::startElement(const QString& namespaceURI, } else if (localName == QLatin1String("file")) { m_fileName = atts.value(QLatin1String("original")); m_language = atts.value(QLatin1String("target-language")); + m_language.replace(QLatin1Char('-'), QLatin1Char('_')); m_sourceLanguage = atts.value(QLatin1String("source-language")); + m_sourceLanguage.replace(QLatin1Char('-'), QLatin1Char('_')); } else if (localName == QLatin1String("group")) { if (atts.value(QLatin1String("restype")) == QLatin1String(restypeContext)) { m_context = atts.value(QLatin1String("resname")); @@ -768,14 +770,19 @@ bool saveXLIFF(const Translator &translator, QIODevice &dev, ConversionData &cd) << "\" xmlns:trolltech=\"" << TrollTsNamespaceURI << "\">\n"; ++indent; writeExtras(ts, indent, translator.extras(), drops); + QString sourceLanguageCode = translator.sourceLanguageCode(); + if (sourceLanguageCode.isEmpty() || sourceLanguageCode == QLatin1String("C")) + sourceLanguageCode = QLatin1String("en"); + else + sourceLanguageCode.replace(QLatin1Char('_'), QLatin1Char('-')); + QString languageCode = translator.languageCode(); + languageCode.replace(QLatin1Char('_'), QLatin1Char('-')); foreach (const QString &fn, fileOrder) { writeIndent(ts, indent); ts << "first()) << "\"" - << " source-language=\"" - << (translator.sourceLanguageCode().isEmpty() ? - QByteArray("en") : translator.sourceLanguageCode().toLatin1()) << "\"" - << " target-language=\"" << translator.languageCode() << "\"" + << " source-language=\"" << sourceLanguageCode.toLatin1() << "\"" + << " target-language=\"" << languageCode.toLatin1() << "\"" << ">\n"; ++indent; -- cgit v0.12 From 40909863e9eb17e0d0469ade608426dbbd08b43e Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Tue, 29 Sep 2009 11:29:01 +0200 Subject: QDom: set the codec to UTF-8 if codec not present or unknown we were trying to get a codec even for unknown names. Now, we always set the codec to UTF8 if the field is not present or we do not know the codec. Reviewed-by: Paul --- src/xml/dom/qdom.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp index 3ae91d3..b06fbeb 100644 --- a/src/xml/dom/qdom.cpp +++ b/src/xml/dom/qdom.cpp @@ -6438,22 +6438,23 @@ void QDomDocumentPrivate::saveDocument(QTextStream& s, const int indent, QDomNod #ifndef QT_NO_TEXTCODEC const QDomNodePrivate* n = first; + QTextCodec *codec = 0; + if (n && n->isProcessingInstruction() && n->nodeName() == QLatin1String("xml")) { // we have an XML declaration QString data = n->nodeValue(); QRegExp encoding(QString::fromLatin1("encoding\\s*=\\s*((\"([^\"]*)\")|('([^']*)'))")); encoding.indexIn(data); QString enc = encoding.cap(3); - if (enc.isEmpty()) { - enc = encoding.cap(5); - } if (enc.isEmpty()) - s.setCodec(QTextCodec::codecForName("UTF-8")); - else - s.setCodec(QTextCodec::codecForName(enc.toLatin1().data())); - } else { - s.setCodec(QTextCodec::codecForName("UTF-8")); + enc = encoding.cap(5); + if (!enc.isEmpty()) + codec = QTextCodec::codecForName(enc.toLatin1().data()); } + if (!codec) + codec = QTextCodec::codecForName("UTF-8"); + if (codec) + s.setCodec(codec); #endif bool doc = false; -- cgit v0.12 From ea533924ddc8a1f4d0c2d400aacee98aff952a00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Wed, 30 Sep 2009 16:09:38 +0200 Subject: Cleaning up usage of examples/{examplebase,symbianpkgrules}.pri examplebase.pri was renamed to symbianpkgrules, but some project files were not updated to reflect the change. Since it doesn't make sense to have this in non-portable examples, the include is removed in those cases. Reviewed-by: Espen Riskedal --- examples/activeqt/activeqt.pro | 2 -- examples/activeqt/comapp/comapp.pro | 2 -- examples/activeqt/hierarchy/hierarchy.pro | 2 -- examples/activeqt/menus/menus.pro | 2 -- examples/activeqt/multiple/multiple.pro | 2 -- examples/activeqt/opengl/opengl.pro | 2 -- examples/activeqt/qutlook/qutlook.pro | 2 -- examples/activeqt/simple/simple.pro | 2 -- examples/activeqt/webbrowser/webbrowser.pro | 2 -- examples/activeqt/wrapper/wrapper.pro | 2 -- examples/qws/ahigl/ahigl.pro | 2 -- examples/qws/dbscreen/dbscreen.pro | 2 -- examples/qws/framebuffer/framebuffer.pro | 2 -- examples/qws/mousecalibration/mousecalibration.pro | 2 -- examples/qws/qws.pro | 2 -- examples/qws/svgalib/svgalib.pro | 2 -- examples/script/qsdbg/qsdbg.pro | 4 +--- 17 files changed, 1 insertion(+), 35 deletions(-) diff --git a/examples/activeqt/activeqt.pro b/examples/activeqt/activeqt.pro index db63104..262e1a1 100644 --- a/examples/activeqt/activeqt.pro +++ b/examples/activeqt/activeqt.pro @@ -18,5 +18,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS activeqt.pro sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt INSTALLS += target sources - -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/activeqt/comapp/comapp.pro b/examples/activeqt/comapp/comapp.pro index 99b8933..84ce072 100644 --- a/examples/activeqt/comapp/comapp.pro +++ b/examples/activeqt/comapp/comapp.pro @@ -11,5 +11,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/comapp sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS comapp.pro sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/comapp INSTALLS += target sources - -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/activeqt/hierarchy/hierarchy.pro b/examples/activeqt/hierarchy/hierarchy.pro index cd1d754..abe5f1b 100644 --- a/examples/activeqt/hierarchy/hierarchy.pro +++ b/examples/activeqt/hierarchy/hierarchy.pro @@ -14,5 +14,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/hierarchy sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS hierarchy.pro sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/hierarchy INSTALLS += target sources - -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/activeqt/menus/menus.pro b/examples/activeqt/menus/menus.pro index f197833..c962b6b 100644 --- a/examples/activeqt/menus/menus.pro +++ b/examples/activeqt/menus/menus.pro @@ -12,5 +12,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/menus sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS menus.pro sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/menus INSTALLS += target sources - -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/activeqt/multiple/multiple.pro b/examples/activeqt/multiple/multiple.pro index 9c95921..7b86950 100644 --- a/examples/activeqt/multiple/multiple.pro +++ b/examples/activeqt/multiple/multiple.pro @@ -14,5 +14,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/multiple sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS multiple.pro sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/multiple INSTALLS += target sources - -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/activeqt/opengl/opengl.pro b/examples/activeqt/opengl/opengl.pro index 978bd66..8eb81be 100644 --- a/examples/activeqt/opengl/opengl.pro +++ b/examples/activeqt/opengl/opengl.pro @@ -17,5 +17,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/opengl sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS opengl.pro sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/opengl INSTALLS += target sources - -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/activeqt/qutlook/qutlook.pro b/examples/activeqt/qutlook/qutlook.pro index 0387735..c1154e0 100644 --- a/examples/activeqt/qutlook/qutlook.pro +++ b/examples/activeqt/qutlook/qutlook.pro @@ -21,5 +21,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/qutlook sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS qutlook.pro sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/qutlook INSTALLS += target sources - -include($$QT_SOURCE_TREE/examples/examplebase.pri) diff --git a/examples/activeqt/simple/simple.pro b/examples/activeqt/simple/simple.pro index 243d06a..d0f2019 100644 --- a/examples/activeqt/simple/simple.pro +++ b/examples/activeqt/simple/simple.pro @@ -11,5 +11,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/simple sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS simple.pro sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/simple INSTALLS += target sources - -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/activeqt/webbrowser/webbrowser.pro b/examples/activeqt/webbrowser/webbrowser.pro index 13b1983..32eac71 100644 --- a/examples/activeqt/webbrowser/webbrowser.pro +++ b/examples/activeqt/webbrowser/webbrowser.pro @@ -15,5 +15,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/webbrowser sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS webbrowser.pro sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/webbrowser INSTALLS += target sources - -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/activeqt/wrapper/wrapper.pro b/examples/activeqt/wrapper/wrapper.pro index a207f2e..4eb6baf 100644 --- a/examples/activeqt/wrapper/wrapper.pro +++ b/examples/activeqt/wrapper/wrapper.pro @@ -13,5 +13,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/activeqt/wrapper sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS wrapper.pro sources.path = $$[QT_INSTALL_EXAMPLES]/activeqt/wrapper INSTALLS += target sources - -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/qws/ahigl/ahigl.pro b/examples/qws/ahigl/ahigl.pro index c831335..1ee8e6e 100644 --- a/examples/qws/ahigl/ahigl.pro +++ b/examples/qws/ahigl/ahigl.pro @@ -7,8 +7,6 @@ TARGET = qahiglscreen target.path = $$[QT_INSTALL_PLUGINS]/gfxdrivers INSTALLS += target -include($$QT_SOURCE_TREE/examples/examplebase.pri) - HEADERS = qwindowsurface_ahigl_p.h \ qscreenahigl_qws.h diff --git a/examples/qws/dbscreen/dbscreen.pro b/examples/qws/dbscreen/dbscreen.pro index 86152ab..172a02a 100644 --- a/examples/qws/dbscreen/dbscreen.pro +++ b/examples/qws/dbscreen/dbscreen.pro @@ -5,8 +5,6 @@ TARGET = dbscreen target.path += $$[QT_INSTALL_PLUGINS]/gfxdrivers INSTALLS += target -include($$QT_SOURCE_TREE/examples/examplebase.pri) - HEADERS = dbscreen.h SOURCES = dbscreendriverplugin.cpp \ dbscreen.cpp diff --git a/examples/qws/framebuffer/framebuffer.pro b/examples/qws/framebuffer/framebuffer.pro index 3fd0975..f9fe850 100644 --- a/examples/qws/framebuffer/framebuffer.pro +++ b/examples/qws/framebuffer/framebuffer.pro @@ -9,5 +9,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qws/framebuffer sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS framebuffer.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qws/framebuffer INSTALLS += target sources - -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/qws/mousecalibration/mousecalibration.pro b/examples/qws/mousecalibration/mousecalibration.pro index fc1c469..bd31853 100644 --- a/examples/qws/mousecalibration/mousecalibration.pro +++ b/examples/qws/mousecalibration/mousecalibration.pro @@ -9,5 +9,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qws/mousecalibration sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qws/mousecalibration INSTALLS += target sources - -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/qws/qws.pro b/examples/qws/qws.pro index 48c59c1..95e1b44 100644 --- a/examples/qws/qws.pro +++ b/examples/qws/qws.pro @@ -7,5 +7,3 @@ SUBDIRS += mousecalibration simpledecoration sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS README *.pro sources.path = $$[QT_INSTALL_EXAMPLES]/qws INSTALLS += sources - -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/qws/svgalib/svgalib.pro b/examples/qws/svgalib/svgalib.pro index 3ab5a19..8a47c1d 100644 --- a/examples/qws/svgalib/svgalib.pro +++ b/examples/qws/svgalib/svgalib.pro @@ -7,8 +7,6 @@ TARGET = svgalibscreen target.path = $$[QT_INSTALL_PLUGINS]/gfxdrivers INSTALLS += target -include($$QT_SOURCE_TREE/examples/examplebase.pri) - HEADERS = svgalibscreen.h \ svgalibpaintengine.h \ svgalibsurface.h \ diff --git a/examples/script/qsdbg/qsdbg.pro b/examples/script/qsdbg/qsdbg.pro index 77b55a2..424e0fb 100644 --- a/examples/script/qsdbg/qsdbg.pro +++ b/examples/script/qsdbg/qsdbg.pro @@ -16,6 +16,4 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS qsdbg.pro sources.path = $$[QT_INSTALL_EXAMPLES]/script/qsdbg INSTALLS += target sources -include($$QT_SOURCE_TREE/examples/examplebase.pri) - - +symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -- cgit v0.12 From 71de0671ba5e57c7eb34a09d24e08c8926630e0f Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 18 Aug 2009 11:29:01 +0200 Subject: improve condition nesting compilers might or might not have been clever enough to optimize it. better safe than sorry. Reviewed-By: mariusSO --- src/corelib/io/qtextstream.cpp | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp index 5931267..eafc561 100644 --- a/src/corelib/io/qtextstream.cpp +++ b/src/corelib/io/qtextstream.cpp @@ -736,16 +736,28 @@ bool QTextStreamPrivate::scan(const QChar **ptr, int *length, int maxlen, TokenD const QChar ch = *chPtr++; ++totalSize; - if (delimiter == Space && ch.isSpace()) { - foundToken = true; - delimSize = 1; - } else if (delimiter == NotSpace && !ch.isSpace()) { - foundToken = true; - delimSize = 1; - } else if (delimiter == EndOfLine && ch == QLatin1Char('\n')) { - foundToken = true; - delimSize = (lastChar == QLatin1Char('\r')) ? 2 : 1; - consumeDelimiter = true; + switch (delimiter) { + case Space: + if (ch.isSpace()) { + foundToken = true; + delimSize = 1; + } + break; + case NotSpace: + if (!ch.isSpace()) { + foundToken = true; + delimSize = 1; + } + break; + case EndOfLine: + if (ch == QLatin1Char('\n')) { + foundToken = true; + delimSize = (lastChar == QLatin1Char('\r')) ? 2 : 1; + consumeDelimiter = true; + } + break; + default: + break; } lastChar = ch; @@ -769,7 +781,7 @@ bool QTextStreamPrivate::scan(const QChar **ptr, int *length, int maxlen, TokenD // if we find a '\r' at the end of the data when reading lines, // don't make it part of the line. - if (totalSize > 0 && !foundToken && delimiter == EndOfLine) { + if (delimiter == EndOfLine && totalSize > 0 && !foundToken) { if (((string && stringOffset + totalSize == string->size()) || (device && device->atEnd())) && lastChar == QLatin1Char('\r')) { consumeDelimiter = true; -- cgit v0.12 From 607df95ef6ca5c5a2632d3befbf604dfcfbed530 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 18 Aug 2009 11:34:03 +0200 Subject: optimize scan() lastChar needs to be set only when in line mode Reviewed-By: mariusSO --- src/corelib/io/qtextstream.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp index eafc561..415ba60 100644 --- a/src/corelib/io/qtextstream.cpp +++ b/src/corelib/io/qtextstream.cpp @@ -755,12 +755,11 @@ bool QTextStreamPrivate::scan(const QChar **ptr, int *length, int maxlen, TokenD delimSize = (lastChar == QLatin1Char('\r')) ? 2 : 1; consumeDelimiter = true; } + lastChar = ch; break; default: break; } - - lastChar = ch; } } while (!foundToken && (!maxlen || totalSize < maxlen) -- cgit v0.12 From 27b3784bf84ecd7c760b4d3ec47a657a1f3a0d40 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 18 Aug 2009 16:43:34 +0200 Subject: optimize read() and readAll() factor out a dedicated private::read() function based on private::scan(). this avoids making the latter even more complex in the process of optimizing it. Reviewed-By: mariusSO --- src/corelib/io/qtextstream.cpp | 44 +++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp index 415ba60..594718e 100644 --- a/src/corelib/io/qtextstream.cpp +++ b/src/corelib/io/qtextstream.cpp @@ -241,6 +241,7 @@ static const int QTEXTSTREAM_BUFFERSIZE = 16384; #include "private/qlocale_p.h" #include +#include #include #if defined QTEXTSTREAM_DEBUG @@ -375,10 +376,10 @@ public: enum TokenDelimiter { Space, NotSpace, - EndOfLine, - EndOfFile + EndOfLine }; + QString read(int maxlen); bool scan(const QChar **ptr, int *tokenLength, int maxlen, TokenDelimiter delimiter); inline const QChar *readPtr() const; @@ -704,6 +705,25 @@ bool QTextStreamPrivate::flushWriteBuffer() return flushed && bytesWritten == qint64(data.size()); } +QString QTextStreamPrivate::read(int maxlen) +{ + QString ret; + if (string) { + lastTokenSize = qMin(maxlen, string->size() - stringOffset); + ret = string->mid(stringOffset, lastTokenSize); + } else { + while (readBuffer.size() - readBufferOffset < maxlen && fillReadBuffer()) ; + lastTokenSize = qMin(maxlen, readBuffer.size() - readBufferOffset); + ret = readBuffer.mid(readBufferOffset, lastTokenSize); + } + consumeLastToken(); + +#if defined (QTEXTSTREAM_DEBUG) + qDebug("QTextStreamPrivate::read() maxlen = %d, token length = %d", maxlen, ret.length()); +#endif + return ret; +} + /*! \internal Scans no more than \a maxlen QChars in the current buffer for the @@ -757,8 +777,6 @@ bool QTextStreamPrivate::scan(const QChar **ptr, int *length, int maxlen, TokenD } lastChar = ch; break; - default: - break; } } } while (!foundToken @@ -1614,14 +1632,7 @@ QString QTextStream::readAll() Q_D(QTextStream); CHECK_VALID_STREAM(QString()); - const QChar *readPtr; - int length; - if (!d->scan(&readPtr, &length, /* maxlen = */ 0, QTextStreamPrivate::EndOfFile)) - return QString(); - - QString tmp = QString(readPtr, length); - d->consumeLastToken(); - return tmp; + return d->read(INT_MAX); } /*! @@ -1673,14 +1684,7 @@ QString QTextStream::read(qint64 maxlen) if (maxlen <= 0) return QString::fromLatin1(""); // empty, not null - const QChar *readPtr; - int length; - if (!d->scan(&readPtr, &length, int(maxlen), QTextStreamPrivate::EndOfFile)) - return QString(); - - QString tmp = QString(readPtr, length); - d->consumeLastToken(); - return tmp; + return d->read(int(maxlen)); } /*! \internal -- cgit v0.12 From 12eae101aa19fd7a4c7862188c16134ca51f3fd4 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Wed, 30 Sep 2009 17:13:21 +0200 Subject: Revert "Make the test fail, not crash for now. A task is already open to fix it." This reverts commit 21cfe5bf6550ae359d6bfa937b1308891954e9bb. The bug is fixed now. Reviewed-By: Alexis --- tests/auto/qdom/tst_qdom.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/auto/qdom/tst_qdom.cpp b/tests/auto/qdom/tst_qdom.cpp index 6987186..6637202 100644 --- a/tests/auto/qdom/tst_qdom.cpp +++ b/tests/auto/qdom/tst_qdom.cpp @@ -1908,8 +1908,7 @@ void tst_QDom::taskQTBUG4595_dontAssertWhenDocumentSpecifiesUnknownEncoding() co QDomDocument d; QVERIFY(d.setContent(xmlWithUnknownEncoding)); - //QString dontAssert = d.toString(); // this should not assert - QVERIFY2(false, "Line above crashes but we still want to run all tests."); + QString dontAssert = d.toString(); // this should not assert QVERIFY(true); } -- cgit v0.12 From 5e107b788caa416068c64349ed23f8d82cb26785 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Wed, 30 Sep 2009 17:47:01 +0200 Subject: Avoid warnings in the states example We now have the animations directly added to the transition --- examples/animation/states/main.cpp | 135 +++++++++++++++++-------------------- 1 file changed, 63 insertions(+), 72 deletions(-) diff --git a/examples/animation/states/main.cpp b/examples/animation/states/main.cpp index dafa8ad..85e28e1 100644 --- a/examples/animation/states/main.cpp +++ b/examples/animation/states/main.cpp @@ -194,83 +194,74 @@ int main(int argc, char *argv[]) state3->assignProperty(p5, "opacity", qreal(1)); state3->assignProperty(p6, "opacity", qreal(1)); - QParallelAnimationGroup animation1; - - QSequentialAnimationGroup *animation1SubGroup; - animation1SubGroup = new QSequentialAnimationGroup(&animation1); + QAbstractTransition *t1 = state1->addTransition(button, SIGNAL(clicked()), state2); + QSequentialAnimationGroup *animation1SubGroup = new QSequentialAnimationGroup; animation1SubGroup->addPause(250); animation1SubGroup->addAnimation(new QPropertyAnimation(box, "geometry")); + t1->addAnimation(animation1SubGroup); + t1->addAnimation(new QPropertyAnimation(widget, "geometry")); + t1->addAnimation(new QPropertyAnimation(p1, "geometry")); + t1->addAnimation(new QPropertyAnimation(p2, "geometry")); + t1->addAnimation(new QPropertyAnimation(p3, "geometry")); + t1->addAnimation(new QPropertyAnimation(p4, "geometry")); + t1->addAnimation(new QPropertyAnimation(p5, "geometry")); + t1->addAnimation(new QPropertyAnimation(p6, "geometry")); + t1->addAnimation(new QPropertyAnimation(p1, "rotation")); + t1->addAnimation(new QPropertyAnimation(p2, "rotation")); + t1->addAnimation(new QPropertyAnimation(p3, "rotation")); + t1->addAnimation(new QPropertyAnimation(p4, "rotation")); + t1->addAnimation(new QPropertyAnimation(p5, "rotation")); + t1->addAnimation(new QPropertyAnimation(p6, "rotation")); + t1->addAnimation(new QPropertyAnimation(p1, "opacity")); + t1->addAnimation(new QPropertyAnimation(p2, "opacity")); + t1->addAnimation(new QPropertyAnimation(p3, "opacity")); + t1->addAnimation(new QPropertyAnimation(p4, "opacity")); + t1->addAnimation(new QPropertyAnimation(p5, "opacity")); + t1->addAnimation(new QPropertyAnimation(p6, "opacity")); - animation1.addAnimation(new QPropertyAnimation(widget, "geometry")); - animation1.addAnimation(new QPropertyAnimation(p1, "geometry")); - animation1.addAnimation(new QPropertyAnimation(p2, "geometry")); - animation1.addAnimation(new QPropertyAnimation(p3, "geometry")); - animation1.addAnimation(new QPropertyAnimation(p4, "geometry")); - animation1.addAnimation(new QPropertyAnimation(p5, "geometry")); - animation1.addAnimation(new QPropertyAnimation(p6, "geometry")); - animation1.addAnimation(new QPropertyAnimation(p1, "rotation")); - animation1.addAnimation(new QPropertyAnimation(p2, "rotation")); - animation1.addAnimation(new QPropertyAnimation(p3, "rotation")); - animation1.addAnimation(new QPropertyAnimation(p4, "rotation")); - animation1.addAnimation(new QPropertyAnimation(p5, "rotation")); - animation1.addAnimation(new QPropertyAnimation(p6, "rotation")); - animation1.addAnimation(new QPropertyAnimation(p1, "opacity")); - animation1.addAnimation(new QPropertyAnimation(p2, "opacity")); - animation1.addAnimation(new QPropertyAnimation(p3, "opacity")); - animation1.addAnimation(new QPropertyAnimation(p4, "opacity")); - animation1.addAnimation(new QPropertyAnimation(p5, "opacity")); - animation1.addAnimation(new QPropertyAnimation(p6, "opacity")); - - QParallelAnimationGroup animation2; - animation2.addAnimation(new QPropertyAnimation(box, "geometry")); - animation2.addAnimation(new QPropertyAnimation(widget, "geometry")); - animation2.addAnimation(new QPropertyAnimation(p1, "geometry")); - animation2.addAnimation(new QPropertyAnimation(p2, "geometry")); - animation2.addAnimation(new QPropertyAnimation(p3, "geometry")); - animation2.addAnimation(new QPropertyAnimation(p4, "geometry")); - animation2.addAnimation(new QPropertyAnimation(p5, "geometry")); - animation2.addAnimation(new QPropertyAnimation(p6, "geometry")); - animation2.addAnimation(new QPropertyAnimation(p1, "rotation")); - animation2.addAnimation(new QPropertyAnimation(p2, "rotation")); - animation2.addAnimation(new QPropertyAnimation(p3, "rotation")); - animation2.addAnimation(new QPropertyAnimation(p4, "rotation")); - animation2.addAnimation(new QPropertyAnimation(p5, "rotation")); - animation2.addAnimation(new QPropertyAnimation(p6, "rotation")); - animation2.addAnimation(new QPropertyAnimation(p1, "opacity")); - animation2.addAnimation(new QPropertyAnimation(p2, "opacity")); - animation2.addAnimation(new QPropertyAnimation(p3, "opacity")); - animation2.addAnimation(new QPropertyAnimation(p4, "opacity")); - animation2.addAnimation(new QPropertyAnimation(p5, "opacity")); - animation2.addAnimation(new QPropertyAnimation(p6, "opacity")); - - QParallelAnimationGroup animation3; - animation3.addAnimation(new QPropertyAnimation(box, "geometry")); - animation3.addAnimation(new QPropertyAnimation(widget, "geometry")); - animation3.addAnimation(new QPropertyAnimation(p1, "geometry")); - animation3.addAnimation(new QPropertyAnimation(p2, "geometry")); - animation3.addAnimation(new QPropertyAnimation(p3, "geometry")); - animation3.addAnimation(new QPropertyAnimation(p4, "geometry")); - animation3.addAnimation(new QPropertyAnimation(p5, "geometry")); - animation3.addAnimation(new QPropertyAnimation(p6, "geometry")); - animation3.addAnimation(new QPropertyAnimation(p1, "rotation")); - animation3.addAnimation(new QPropertyAnimation(p2, "rotation")); - animation3.addAnimation(new QPropertyAnimation(p3, "rotation")); - animation3.addAnimation(new QPropertyAnimation(p4, "rotation")); - animation3.addAnimation(new QPropertyAnimation(p5, "rotation")); - animation3.addAnimation(new QPropertyAnimation(p6, "rotation")); - animation3.addAnimation(new QPropertyAnimation(p1, "opacity")); - animation3.addAnimation(new QPropertyAnimation(p2, "opacity")); - animation3.addAnimation(new QPropertyAnimation(p3, "opacity")); - animation3.addAnimation(new QPropertyAnimation(p4, "opacity")); - animation3.addAnimation(new QPropertyAnimation(p5, "opacity")); - animation3.addAnimation(new QPropertyAnimation(p6, "opacity")); - - QAbstractTransition *t1 = state1->addTransition(button, SIGNAL(clicked()), state2); - t1->addAnimation(&animation1); QAbstractTransition *t2 = state2->addTransition(button, SIGNAL(clicked()), state3); - t2->addAnimation(&animation2); + t2->addAnimation(new QPropertyAnimation(box, "geometry")); + t2->addAnimation(new QPropertyAnimation(widget, "geometry")); + t2->addAnimation(new QPropertyAnimation(p1, "geometry")); + t2->addAnimation(new QPropertyAnimation(p2, "geometry")); + t2->addAnimation(new QPropertyAnimation(p3, "geometry")); + t2->addAnimation(new QPropertyAnimation(p4, "geometry")); + t2->addAnimation(new QPropertyAnimation(p5, "geometry")); + t2->addAnimation(new QPropertyAnimation(p6, "geometry")); + t2->addAnimation(new QPropertyAnimation(p1, "rotation")); + t2->addAnimation(new QPropertyAnimation(p2, "rotation")); + t2->addAnimation(new QPropertyAnimation(p3, "rotation")); + t2->addAnimation(new QPropertyAnimation(p4, "rotation")); + t2->addAnimation(new QPropertyAnimation(p5, "rotation")); + t2->addAnimation(new QPropertyAnimation(p6, "rotation")); + t2->addAnimation(new QPropertyAnimation(p1, "opacity")); + t2->addAnimation(new QPropertyAnimation(p2, "opacity")); + t2->addAnimation(new QPropertyAnimation(p3, "opacity")); + t2->addAnimation(new QPropertyAnimation(p4, "opacity")); + t2->addAnimation(new QPropertyAnimation(p5, "opacity")); + t2->addAnimation(new QPropertyAnimation(p6, "opacity")); + QAbstractTransition *t3 = state3->addTransition(button, SIGNAL(clicked()), state1); - t3->addAnimation(&animation3); + t3->addAnimation(new QPropertyAnimation(box, "geometry")); + t3->addAnimation(new QPropertyAnimation(widget, "geometry")); + t3->addAnimation(new QPropertyAnimation(p1, "geometry")); + t3->addAnimation(new QPropertyAnimation(p2, "geometry")); + t3->addAnimation(new QPropertyAnimation(p3, "geometry")); + t3->addAnimation(new QPropertyAnimation(p4, "geometry")); + t3->addAnimation(new QPropertyAnimation(p5, "geometry")); + t3->addAnimation(new QPropertyAnimation(p6, "geometry")); + t3->addAnimation(new QPropertyAnimation(p1, "rotation")); + t3->addAnimation(new QPropertyAnimation(p2, "rotation")); + t3->addAnimation(new QPropertyAnimation(p3, "rotation")); + t3->addAnimation(new QPropertyAnimation(p4, "rotation")); + t3->addAnimation(new QPropertyAnimation(p5, "rotation")); + t3->addAnimation(new QPropertyAnimation(p6, "rotation")); + t3->addAnimation(new QPropertyAnimation(p1, "opacity")); + t3->addAnimation(new QPropertyAnimation(p2, "opacity")); + t3->addAnimation(new QPropertyAnimation(p3, "opacity")); + t3->addAnimation(new QPropertyAnimation(p4, "opacity")); + t3->addAnimation(new QPropertyAnimation(p5, "opacity")); + t3->addAnimation(new QPropertyAnimation(p6, "opacity")); machine.start(); -- cgit v0.12 From 1827669c08580ec309ac6e13c6684e6dbcf18ec4 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Wed, 30 Sep 2009 18:02:37 +0200 Subject: Simplify code of states example We're not using QGraphicsWidget any more --- examples/animation/states/main.cpp | 82 +++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 42 deletions(-) diff --git a/examples/animation/states/main.cpp b/examples/animation/states/main.cpp index 85e28e1..f9d654a 100644 --- a/examples/animation/states/main.cpp +++ b/examples/animation/states/main.cpp @@ -41,13 +41,12 @@ #include -class Pixmap : public QGraphicsWidget +class Pixmap : public QGraphicsObject { Q_OBJECT public: - Pixmap(const QPixmap &pix) : QGraphicsWidget(), p(pix) + Pixmap(const QPixmap &pix) : QGraphicsObject(), p(pix) { - setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); } void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) @@ -55,10 +54,9 @@ public: painter->drawPixmap(QPointF(), p); } -protected: - QSizeF sizeHint(Qt::SizeHint, const QSizeF & = QSizeF()) + QRectF boundingRect() const { - return QSizeF(p.width(), p.height()); + return QRectF( QPointF(0, 0), p.size()); } private: @@ -133,12 +131,12 @@ int main(int argc, char *argv[]) state1->assignProperty(button, "text", "Switch to state 2"); state1->assignProperty(widget, "geometry", QRectF(0, 0, 400, 150)); state1->assignProperty(box, "geometry", QRect(-200, 150, 200, 150)); - state1->assignProperty(p1, "geometry", QRectF(68, 185, 64, 64)); - state1->assignProperty(p2, "geometry", QRectF(168, 185, 64, 64)); - state1->assignProperty(p3, "geometry", QRectF(268, 185, 64, 64)); - state1->assignProperty(p4, "geometry", QRectF(68-150, 48-150, 64, 64)); - state1->assignProperty(p5, "geometry", QRectF(168, 48-150, 64, 64)); - state1->assignProperty(p6, "geometry", QRectF(268+150, 48-150, 64, 64)); + state1->assignProperty(p1, "pos", QPointF(68, 185)); + state1->assignProperty(p2, "pos", QPointF(168, 185)); + state1->assignProperty(p3, "pos", QPointF(268, 185)); + state1->assignProperty(p4, "pos", QPointF(68-150, 48-150)); + state1->assignProperty(p5, "pos", QPointF(168, 48-150)); + state1->assignProperty(p6, "pos", QPointF(268+150, 48-150)); state1->assignProperty(p1, "rotation", qreal(0)); state1->assignProperty(p2, "rotation", qreal(0)); state1->assignProperty(p3, "rotation", qreal(0)); @@ -157,12 +155,12 @@ int main(int argc, char *argv[]) state2->assignProperty(button, "text", "Switch to state 3"); state2->assignProperty(widget, "geometry", QRectF(200, 150, 200, 150)); state2->assignProperty(box, "geometry", QRect(9, 150, 190, 150)); - state2->assignProperty(p1, "geometry", QRectF(68-150, 185+150, 64, 64)); - state2->assignProperty(p2, "geometry", QRectF(168, 185+150, 64, 64)); - state2->assignProperty(p3, "geometry", QRectF(268+150, 185+150, 64, 64)); - state2->assignProperty(p4, "geometry", QRectF(64, 48, 64, 64)); - state2->assignProperty(p5, "geometry", QRectF(168, 48, 64, 64)); - state2->assignProperty(p6, "geometry", QRectF(268, 48, 64, 64)); + state2->assignProperty(p1, "pos", QPointF(68-150, 185+150)); + state2->assignProperty(p2, "pos", QPointF(168, 185+150)); + state2->assignProperty(p3, "pos", QPointF(268+150, 185+150)); + state2->assignProperty(p4, "pos", QPointF(64, 48)); + state2->assignProperty(p5, "pos", QPointF(168, 48)); + state2->assignProperty(p6, "pos", QPointF(268, 48)); state2->assignProperty(p1, "rotation", qreal(-270)); state2->assignProperty(p2, "rotation", qreal(90)); state2->assignProperty(p3, "rotation", qreal(270)); @@ -179,12 +177,12 @@ int main(int argc, char *argv[]) // State 3 state3->assignProperty(button, "text", "Switch to state 1"); - state3->assignProperty(p1, "geometry", QRectF(0, 5, 64, 64)); - state3->assignProperty(p2, "geometry", QRectF(0, 5 + 64 + 5, 64, 64)); - state3->assignProperty(p3, "geometry", QRectF(5, 5 + (64 + 5) + 64, 64, 64)); - state3->assignProperty(p4, "geometry", QRectF(5 + 64 + 5, 5, 64, 64)); - state3->assignProperty(p5, "geometry", QRectF(5 + 64 + 5, 5 + 64 + 5, 64, 64)); - state3->assignProperty(p6, "geometry", QRectF(5 + 64 + 5, 5 + (64 + 5) + 64, 64, 64)); + state3->assignProperty(p1, "pos", QPointF(0, 5)); + state3->assignProperty(p2, "pos", QPointF(0, 5 + 64 + 5)); + state3->assignProperty(p3, "pos", QPointF(5, 5 + (64 + 5) + 64)); + state3->assignProperty(p4, "pos", QPointF(5 + 64 + 5, 5)); + state3->assignProperty(p5, "pos", QPointF(5 + 64 + 5, 5 + 64 + 5)); + state3->assignProperty(p6, "pos", QPointF(5 + 64 + 5, 5 + (64 + 5) + 64)); state3->assignProperty(widget, "geometry", QRectF(138, 5, 400 - 138, 200)); state3->assignProperty(box, "geometry", QRect(5, 205, 400, 90)); state3->assignProperty(p1, "opacity", qreal(1)); @@ -200,12 +198,12 @@ int main(int argc, char *argv[]) animation1SubGroup->addAnimation(new QPropertyAnimation(box, "geometry")); t1->addAnimation(animation1SubGroup); t1->addAnimation(new QPropertyAnimation(widget, "geometry")); - t1->addAnimation(new QPropertyAnimation(p1, "geometry")); - t1->addAnimation(new QPropertyAnimation(p2, "geometry")); - t1->addAnimation(new QPropertyAnimation(p3, "geometry")); - t1->addAnimation(new QPropertyAnimation(p4, "geometry")); - t1->addAnimation(new QPropertyAnimation(p5, "geometry")); - t1->addAnimation(new QPropertyAnimation(p6, "geometry")); + t1->addAnimation(new QPropertyAnimation(p1, "pos")); + t1->addAnimation(new QPropertyAnimation(p2, "pos")); + t1->addAnimation(new QPropertyAnimation(p3, "pos")); + t1->addAnimation(new QPropertyAnimation(p4, "pos")); + t1->addAnimation(new QPropertyAnimation(p5, "pos")); + t1->addAnimation(new QPropertyAnimation(p6, "pos")); t1->addAnimation(new QPropertyAnimation(p1, "rotation")); t1->addAnimation(new QPropertyAnimation(p2, "rotation")); t1->addAnimation(new QPropertyAnimation(p3, "rotation")); @@ -222,12 +220,12 @@ int main(int argc, char *argv[]) QAbstractTransition *t2 = state2->addTransition(button, SIGNAL(clicked()), state3); t2->addAnimation(new QPropertyAnimation(box, "geometry")); t2->addAnimation(new QPropertyAnimation(widget, "geometry")); - t2->addAnimation(new QPropertyAnimation(p1, "geometry")); - t2->addAnimation(new QPropertyAnimation(p2, "geometry")); - t2->addAnimation(new QPropertyAnimation(p3, "geometry")); - t2->addAnimation(new QPropertyAnimation(p4, "geometry")); - t2->addAnimation(new QPropertyAnimation(p5, "geometry")); - t2->addAnimation(new QPropertyAnimation(p6, "geometry")); + t2->addAnimation(new QPropertyAnimation(p1, "pos")); + t2->addAnimation(new QPropertyAnimation(p2, "pos")); + t2->addAnimation(new QPropertyAnimation(p3, "pos")); + t2->addAnimation(new QPropertyAnimation(p4, "pos")); + t2->addAnimation(new QPropertyAnimation(p5, "pos")); + t2->addAnimation(new QPropertyAnimation(p6, "pos")); t2->addAnimation(new QPropertyAnimation(p1, "rotation")); t2->addAnimation(new QPropertyAnimation(p2, "rotation")); t2->addAnimation(new QPropertyAnimation(p3, "rotation")); @@ -244,12 +242,12 @@ int main(int argc, char *argv[]) QAbstractTransition *t3 = state3->addTransition(button, SIGNAL(clicked()), state1); t3->addAnimation(new QPropertyAnimation(box, "geometry")); t3->addAnimation(new QPropertyAnimation(widget, "geometry")); - t3->addAnimation(new QPropertyAnimation(p1, "geometry")); - t3->addAnimation(new QPropertyAnimation(p2, "geometry")); - t3->addAnimation(new QPropertyAnimation(p3, "geometry")); - t3->addAnimation(new QPropertyAnimation(p4, "geometry")); - t3->addAnimation(new QPropertyAnimation(p5, "geometry")); - t3->addAnimation(new QPropertyAnimation(p6, "geometry")); + t3->addAnimation(new QPropertyAnimation(p1, "pos")); + t3->addAnimation(new QPropertyAnimation(p2, "pos")); + t3->addAnimation(new QPropertyAnimation(p3, "pos")); + t3->addAnimation(new QPropertyAnimation(p4, "pos")); + t3->addAnimation(new QPropertyAnimation(p5, "pos")); + t3->addAnimation(new QPropertyAnimation(p6, "pos")); t3->addAnimation(new QPropertyAnimation(p1, "rotation")); t3->addAnimation(new QPropertyAnimation(p2, "rotation")); t3->addAnimation(new QPropertyAnimation(p3, "rotation")); -- cgit v0.12 From e8fc662c4b5a0fa5da6f0d47e1dbb5b2640d7001 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 30 Sep 2009 19:38:46 +0200 Subject: Stabilize tests on X11 --- tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp | 2 +- tests/auto/qtreeview/tst_qtreeview.cpp | 4 +- tests/auto/qwidget/tst_qwidget.cpp | 44 +++++++++++----------- tests/auto/qwindowsurface/tst_qwindowsurface.cpp | 32 ++++++++++------ 4 files changed, 45 insertions(+), 37 deletions(-) diff --git a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp index b6750ea..0b73733 100644 --- a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp +++ b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp @@ -1456,7 +1456,7 @@ void tst_QGraphicsWidget::verifyFocusChain() scene.addItem(w1_4); QTRY_VERIFY(w1_3->hasFocus()); QTest::qWait(25); - QVERIFY(compareFocusChain(view, QList() << w1_3 << w1_4)); + QTRY_VERIFY(compareFocusChain(view, QList() << w1_3 << w1_4)); QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab); QTest::qWait(25); QTRY_VERIFY(lineEdit->hasFocus()); diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp index 112bcc8..91b2cc5 100644 --- a/tests/auto/qtreeview/tst_qtreeview.cpp +++ b/tests/auto/qtreeview/tst_qtreeview.cpp @@ -3113,7 +3113,7 @@ void tst_QTreeView::task224091_appendColumns() treeView->show(); treeView->resize(50,50); - QTest::qWait(50); + QTest::qWaitForWindowShown(treeView); qApp->processEvents(); QList projlist; @@ -3125,7 +3125,7 @@ void tst_QTreeView::task224091_appendColumns() QTest::qWait(50); qApp->processEvents(); - QVERIFY(treeView->verticalScrollBar()->isVisible()); + QTRY_VERIFY(treeView->verticalScrollBar()->isVisible()); delete treeView; delete model; diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index 019887d..c08d601 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -3127,7 +3127,7 @@ void tst_QWidget::saveRestoreGeometry() geom = widget.geometry(); widget.setWindowState(widget.windowState() | Qt::WindowFullScreen); QTRY_VERIFY((widget.windowState() & Qt::WindowFullScreen)); - QTest::qWait(200); + QTest::qWait(500); QVERIFY(widget.restoreGeometry(savedGeometry)); QTest::qWait(120); QTRY_VERIFY(!(widget.windowState() & Qt::WindowFullScreen)); @@ -3137,55 +3137,55 @@ void tst_QWidget::saveRestoreGeometry() widget.setWindowState(widget.windowState() | Qt::WindowFullScreen); QTest::qWait(120); QTRY_VERIFY((widget.windowState() & Qt::WindowFullScreen)); - QTest::qWait(200); + QTest::qWait(400); savedGeometry = widget.saveGeometry(); geom = widget.geometry(); widget.setWindowState(widget.windowState() ^ Qt::WindowFullScreen); - QTest::qWait(20); + QTest::qWait(120); QTRY_VERIFY(!(widget.windowState() & Qt::WindowFullScreen)); - QTest::qWait(200); + QTest::qWait(400); QVERIFY(widget.restoreGeometry(savedGeometry)); - QTest::qWait(20); + QTest::qWait(120); QTRY_VERIFY((widget.windowState() & Qt::WindowFullScreen)); QTRY_COMPARE(widget.geometry(), geom); QVERIFY((widget.windowState() & Qt::WindowFullScreen)); widget.setWindowState(widget.windowState() ^ Qt::WindowFullScreen); - QTest::qWait(20); + QTest::qWait(120); QTRY_VERIFY(!(widget.windowState() & Qt::WindowFullScreen)); - QTest::qWait(20); + QTest::qWait(120); //Restore from Maximised widget.move(position); widget.resize(size); - QTest::qWait(20); + QTest::qWait(10); QTRY_COMPARE(widget.size(), size); - QTest::qWait(200); + QTest::qWait(400); savedGeometry = widget.saveGeometry(); geom = widget.geometry(); widget.setWindowState(widget.windowState() | Qt::WindowMaximized); - QTest::qWait(20); + QTest::qWait(120); QTRY_VERIFY((widget.windowState() & Qt::WindowMaximized)); QTRY_VERIFY(widget.geometry() != geom); - QTest::qWait(200); + QTest::qWait(400); QVERIFY(widget.restoreGeometry(savedGeometry)); - QTest::qWait(20); + QTest::qWait(120); QTRY_COMPARE(widget.geometry(), geom); QVERIFY(!(widget.windowState() & Qt::WindowMaximized)); //Restore to maximised widget.setWindowState(widget.windowState() | Qt::WindowMaximized); - QTest::qWait(20); + QTest::qWait(120); QTRY_VERIFY((widget.windowState() & Qt::WindowMaximized)); - QTest::qWait(200); + QTest::qWait(400); geom = widget.geometry(); savedGeometry = widget.saveGeometry(); widget.setWindowState(widget.windowState() ^ Qt::WindowMaximized); - QTest::qWait(20); + QTest::qWait(120); QTRY_VERIFY(!(widget.windowState() & Qt::WindowMaximized)); - QTest::qWait(200); + QTest::qWait(400); QVERIFY(widget.restoreGeometry(savedGeometry)); - QTest::qWait(20); + QTest::qWait(120); QTRY_VERIFY((widget.windowState() & Qt::WindowMaximized)); QTRY_COMPARE(widget.geometry(), geom); } @@ -8683,7 +8683,7 @@ void tst_QWidget::setClearAndResizeMask() QTRY_COMPARE(child.numPaintEvents, 1); #else // and ensure that we don't get any updates at all. - QCOMPARE(child.numPaintEvents, 0); + QTRY_COMPARE(child.numPaintEvents, 0); #endif QCOMPARE(topLevel.numPaintEvents, 0); @@ -8720,9 +8720,9 @@ void tst_QWidget::setClearAndResizeMask() QTest::qWait(200); #ifdef Q_WS_MAC // Mac always issues a full update when calling setMask, and we cannot force it to not do so. - QCOMPARE(resizeChild.paintedRegion, resizeChild.mask()); + QTRY_COMPARE(resizeChild.paintedRegion, resizeChild.mask()); #else - QCOMPARE(resizeChild.paintedRegion, QRegion()); + QTRY_COMPARE(resizeChild.paintedRegion, QRegion()); #endif resizeChild.paintedRegion = QRegion(); @@ -8731,9 +8731,9 @@ void tst_QWidget::setClearAndResizeMask() QTest::qWait(100); #ifdef Q_WS_MAC // Mac always issues a full update when calling setMask, and we cannot force it to not do so. - QCOMPARE(resizeChild.paintedRegion, resizeChild.mask()); + QTRY_COMPARE(resizeChild.paintedRegion, resizeChild.mask()); #else - QCOMPARE(resizeChild.paintedRegion, resizeChild.mask() - oldMask); + QTRY_COMPARE(resizeChild.paintedRegion, resizeChild.mask() - oldMask); #endif } diff --git a/tests/auto/qwindowsurface/tst_qwindowsurface.cpp b/tests/auto/qwindowsurface/tst_qwindowsurface.cpp index e96bcf9..2490a65 100644 --- a/tests/auto/qwindowsurface/tst_qwindowsurface.cpp +++ b/tests/auto/qwindowsurface/tst_qwindowsurface.cpp @@ -106,18 +106,26 @@ public: QRegion r; }; -#define VERIFY_COLOR(region, color) { \ - const QRegion r = QRegion(region); \ - for (int i = 0; i < r.rects().size(); ++i) { \ - const QRect rect = r.rects().at(i); \ - const QPixmap pixmap = QPixmap::grabWindow(QDesktopWidget().winId(), \ - rect.left(), rect.top(), \ - rect.width(), rect.height()); \ - QCOMPARE(pixmap.size(), rect.size()); \ - QPixmap expectedPixmap(pixmap); /* ensure equal formats */ \ - expectedPixmap.fill(color); \ - QCOMPARE(pixmap, expectedPixmap); \ - } \ +//from tst_qwidget.cpp +static void VERIFY_COLOR(const QRegion ®ion, const QColor &color) +{ + const QRegion r = QRegion(region); + for (int i = 0; i < r.rects().size(); ++i) { + const QRect rect = r.rects().at(i); + for (int t = 0; t < 5; t++) { + const QPixmap pixmap = QPixmap::grabWindow(QDesktopWidget().winId(), + rect.left(), rect.top(), + rect.width(), rect.height()); + QCOMPARE(pixmap.size(), rect.size()); + QPixmap expectedPixmap(pixmap); /* ensure equal formats */ + expectedPixmap.fill(color); + if (pixmap.toImage().pixel(0,0) != QColor(color).rgb() && t < 4 ) + { QTest::qWait(200); continue; } + QCOMPARE(pixmap.toImage().pixel(0,0), QColor(color).rgb()); + QCOMPARE(pixmap, expectedPixmap); + break; + } + } } void tst_QWindowSurface::getSetWindowSurface() -- cgit v0.12 From a73213cf5acdaabcd61245a6882e608b2337da3c Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Wed, 30 Sep 2009 11:07:55 -0700 Subject: Clean up releaseSurface in QDirectFBPaintDevice Instead of having to call unlockSurface/releaseSubSurface and releaseSurface to release the surface in QDirectFBWindowSurface make releaseSurface do all three things. Reviewed-by: Donald Carr --- src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp | 1 + src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp | 11 ++++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp index 46cf65b..cb4fb88 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp @@ -209,6 +209,7 @@ void QDirectFBPaintDevice::releaseSubSurface() { Q_ASSERT(QDirectFBScreen::instance()); if (subSurface) { + unlockSurface(); screen->releaseDFBSurface(subSurface); subSurface = 0; } diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp index 19103cb..51afcc7 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp @@ -200,10 +200,6 @@ void QDirectFBWindowSurface::setGeometry(const QRect &rect) if (sizeChanged) { delete engine; engine = 0; - unlockSurface(); -#ifdef QT_DIRECTFB_SUBSURFACE - releaseSubSurface(); -#endif releaseSurface(); Q_ASSERT(!dfbSurface); } @@ -430,9 +426,10 @@ void QDirectFBWindowSurface::updateFormat() void QDirectFBWindowSurface::releaseSurface() { if (dfbSurface) { -#ifdef QT_NO_DIRECTFB_SUBSURFACE - if (lockFlgs) - unlockSurface(); +#ifdef QT_DIRECTFB_SUBSURFACE + releaseSubSurface(); +#else + unlockSurface(); #endif #ifdef QT_NO_DIRECTFB_WM Q_ASSERT(screen->primarySurface()); -- cgit v0.12 From ab4bd7df83519fee126c4dfba0ed923ecc0a0963 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Wed, 30 Sep 2009 15:02:35 -0700 Subject: Make sure gccaps is properly initialized for dfbpe Reviewed-by: Noam Rosenthal --- src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index a9ae72c..dd6b0d3 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -284,7 +284,9 @@ bool QDirectFBPaintEngine::begin(QPaintDevice *device) } d->prepare(d->dfbDevice); + gccaps = AllFeatures; d->setCompositionMode(state()->composition_mode); + return QRasterPaintEngine::begin(device); } -- cgit v0.12 From 533f71abae2ecf05a217e63e9695647eb9e9a3ca Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Wed, 30 Sep 2009 11:00:39 -0700 Subject: Fix a window opacity bug with DirectFB Initialize IDirectFBWindows with the correct capabilities/options when supporting top level transparency. Also, properly deal with runtime changes of top level transparency. Reviewed-by: Noam Rosenthal --- .../gfxdrivers/directfb/qdirectfbwindowsurface.cpp | 110 +++++++++++---------- .../gfxdrivers/directfb/qdirectfbwindowsurface.h | 2 + 2 files changed, 60 insertions(+), 52 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp index 51afcc7..f33e820 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp @@ -81,18 +81,23 @@ QDirectFBWindowSurface::QDirectFBWindowSurface(DFBSurfaceFlipFlags flip, QDirect , flipFlags(flip) , boundingRectFlip(scr->directFBFlags() & QDirectFBScreen::BoundingRectFlip) { + SurfaceFlags flags = 0; + if (!widget || widget->window()->windowOpacity() == 0xff) + flags |= Opaque; #ifdef QT_NO_DIRECTFB_WM if (widget && widget->testAttribute(Qt::WA_PaintOnScreen)) { - setSurfaceFlags(Opaque | RegionReserved); + flags = RegionReserved; mode = Primary; } else { mode = Offscreen; - setSurfaceFlags(Opaque | Buffered); + flags = Buffered; } #else - setSurfaceFlags(Opaque | Buffered); + noSystemBackground = widget && widget->testAttribute(Qt::WA_NoSystemBackground); + if (noSystemBackground) + flags &= ~Opaque; #endif - + setSurfaceFlags(flags); #ifdef QT_DIRECTFB_TIMING frames = 0; timer.start(); @@ -135,6 +140,16 @@ void QDirectFBWindowSurface::createWindow(const QRect &rect) description.caps = DWCAPS_NODECORATION|DWCAPS_DOUBLEBUFFER; description.flags = DWDESC_CAPS|DWDESC_SURFACE_CAPS|DWDESC_PIXELFORMAT|DWDESC_HEIGHT|DWDESC_WIDTH|DWDESC_POSX|DWDESC_POSY; +#if (Q_DIRECTFB_VERSION >= 0x010200) + description.flags |= DWDESC_OPTIONS; +#endif + + if (noSystemBackground) { + description.caps |= DWCAPS_ALPHACHANNEL; +#if (Q_DIRECTFB_VERSION >= 0x010200) + description.options |= DWOP_ALPHACHANNEL; +#endif + } description.posx = rect.x(); description.posy = rect.y(); @@ -143,7 +158,7 @@ void QDirectFBWindowSurface::createWindow(const QRect &rect) description.surface_caps = DSCAPS_NONE; if (screen->directFBFlags() & QDirectFBScreen::VideoOnly) description.surface_caps |= DSCAPS_VIDEOONLY; - const QImage::Format format = screen->pixelFormat(); + const QImage::Format format = (noSystemBackground ? screen->alphaPixmapFormat() : screen->pixelFormat()); description.pixelformat = QDirectFBScreen::getSurfacePixelFormat(format); if (QDirectFBScreen::isPremultiplied(format)) description.surface_caps = DSCAPS_PREMULTIPLIED; @@ -153,9 +168,7 @@ void QDirectFBWindowSurface::createWindow(const QRect &rect) if (result != DFB_OK) DirectFBErrorFatal("QDirectFBWindowSurface::createWindow", result); - if (dfbSurface) - dfbSurface->Release(dfbSurface); - + Q_ASSERT(!dfbSurface); dfbWindow->GetSurface(dfbWindow, &dfbSurface); updateFormat(); } @@ -297,29 +310,20 @@ bool QDirectFBWindowSurface::move(const QPoint &moveBy) return true; } -// hw: XXX: copied from QWidgetPrivate::isOpaque() -inline bool isWidgetOpaque(const QWidget *w) +void QDirectFBWindowSurface::setOpaque(bool opaque) { - if (w->testAttribute(Qt::WA_OpaquePaintEvent) - || w->testAttribute(Qt::WA_PaintOnScreen)) - return true; - - const QPalette &pal = w->palette(); - - if (w->autoFillBackground()) { - const QBrush &autoFillBrush = pal.brush(w->backgroundRole()); - if (autoFillBrush.style() != Qt::NoBrush && autoFillBrush.isOpaque()) - return true; + SurfaceFlags flags = surfaceFlags(); + if (opaque != (flags & Opaque)) { + if (opaque) { + flags |= Opaque; + } else { + flags &= ~Opaque; + } + setSurfaceFlags(flags); } +} - if (!w->testAttribute(Qt::WA_NoSystemBackground)) { - const QBrush &windowBrush = w->palette().brush(QPalette::Window); - if (windowBrush.style() != Qt::NoBrush && windowBrush.isOpaque()) - return true; - } - return false; -} void QDirectFBWindowSurface::flush(QWidget *widget, const QRegion ®ion, const QPoint &offset) { @@ -331,37 +335,39 @@ void QDirectFBWindowSurface::flush(QWidget *widget, const QRegion ®ion, if (extra && extra->proxyWidget) return; - // hw: make sure opacity information is updated before compositing - const bool opaque = isWidgetOpaque(win); - if (opaque != isOpaque()) { - SurfaceFlags flags = surfaceFlags(); - if (opaque) { - flags |= Opaque; - } else { - flags &= ~Opaque; - } - setSurfaceFlags(flags); + const quint8 windowOpacity = quint8(win->windowOpacity() * 0xff); + const QRect windowGeometry = geometry(); +#ifdef QT_DIRECTFB_WM + const bool wasNoSystemBackground = noSystemBackground; + noSystemBackground = win->testAttribute(Qt::WA_NoSystemBackground); + quint8 currentOpacity; + Q_ASSERT(dfbWindow); + dfbWindow->GetOpacity(dfbWindow, ¤tOpacity); + if (currentOpacity != windowOpacity) { + dfbWindow->SetOpacity(dfbWindow, windowOpacity); } -#ifndef QT_NO_DIRECTFB_WM - const quint8 winOpacity = quint8(win->windowOpacity() * 255); - quint8 opacity; - - if (dfbWindow) { - dfbWindow->GetOpacity(dfbWindow, &opacity); - if (winOpacity != opacity) - dfbWindow->SetOpacity(dfbWindow, winOpacity); + setOpaque(noSystemBackground || windowOpacity != 0xff); + if (wasNoSystemBackground != noSystemBackground) { + releaseSurface(); + dfbWindow->Release(dfbWindow); + dfbWindow = 0; + createWindow(windowGeometry); + win->update(); + return; } -#endif - - const QRect windowGeometry = QDirectFBWindowSurface::geometry(); -#ifdef QT_NO_DIRECTFB_WM + screen->flipSurface(dfbSurface, flipFlags, region, offset); + if (noSystemBackground) { + dfbSurface->Clear(dfbSurface, 0, 0, 0, 0); + } +#else + setOpaque(windowOpacity != 0xff); if (mode == Offscreen) { screen->exposeRegion(region.translated(offset + geometry().topLeft()), 0); - - } else -#endif + } else { screen->flipSurface(dfbSurface, flipFlags, region, offset); + } +#endif #ifdef QT_DIRECTFB_TIMING enum { Secs = 3 }; diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h index 0dd3a3b..2f78179 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h +++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h @@ -97,6 +97,7 @@ public: IDirectFBWindow *directFBWindow() const; #endif private: + void setOpaque(bool opaque); void updateFormat(); void releaseSurface(); QDirectFBWindowSurface *sibling; @@ -112,6 +113,7 @@ private: #endif DFBSurfaceFlipFlags flipFlags; + bool noSystemBackground; bool boundingRectFlip; #ifdef QT_DIRECTFB_TIMING int frames; -- cgit v0.12 From 69e8fd3359a72230d377513b0314e64b5b83b712 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Thu, 1 Oct 2009 13:02:49 +1000 Subject: Make QGLFramebufferObject crash-proof if QGLContext destroyed first Sometimes it isn't possible to arrange for the QGLFramebufferObject to be destroyed before the QGLContext group in which it was created. Especially during application shutdown or in applications with multiple shared contexts. This change modifies QGLFramebufferObject to use QGLSharedResourceGuard, which ensures that when the last QGLContext in a sharing group is destroyed, any remaining FBO's will revert to !isValid(). It is now safe to destroy the context before the FBO, or the FBO before the context. Unit test included. Reviewed-by: Sarah Smith --- src/opengl/qglframebufferobject.cpp | 58 ++++++++++++++++++++++--------------- src/opengl/qglframebufferobject_p.h | 7 +++-- tests/auto/qgl/tst_qgl.cpp | 28 ++++++++++++++++++ 3 files changed, 67 insertions(+), 26 deletions(-) diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index c728902..3e54b35 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -64,7 +64,8 @@ QT_BEGIN_NAMESPACE extern QImage qt_gl_read_framebuffer(const QSize&, bool, bool); -#define QGL_FUNC_CONTEXT QGLContextGroup *ctx = d_ptr->ctx; +#define QGL_FUNC_CONTEXT const QGLContext *ctx = d_ptr->fbo_guard.context(); +#define QGL_FUNCP_CONTEXT const QGLContext *ctx = fbo_guard.context(); #ifndef QT_NO_DEBUG #define QT_RESET_GLERROR() \ @@ -317,7 +318,7 @@ void QGLFBOGLPaintDevice::setFBO(QGLFramebufferObject* f, QGLFramebufferObject::Attachment attachment) { fbo = f; - m_thisFBO = fbo->d_func()->fbo; // This shouldn't be needed + m_thisFBO = fbo->d_func()->fbo(); // This shouldn't be needed // The context that the fbo was created in may not have depth // and stencil buffers, but the fbo itself might. @@ -334,7 +335,7 @@ void QGLFBOGLPaintDevice::ensureActiveTarget() { QGLContext* ctx = const_cast(QGLContext::currentContext()); Q_ASSERT(ctx); - const GLuint fboId = fbo->d_func()->fbo; + const GLuint fboId = fbo->d_func()->fbo(); if (ctx->d_func()->current_fbo != fboId) { ctx->d_func()->current_fbo = fboId; glBindFramebuffer(GL_FRAMEBUFFER_EXT, fboId); @@ -359,6 +360,9 @@ void QGLFBOGLPaintDevice::endPaint() bool QGLFramebufferObjectPrivate::checkFramebufferStatus() const { + QGL_FUNCP_CONTEXT; + if (!ctx) + return false; // Context no longer exists. GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER_EXT); switch(status) { case GL_NO_ERROR: @@ -405,11 +409,11 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz, QGLFramebufferObject::Attachment attachment, GLenum texture_target, GLenum internal_format, GLint samples) { - QGLContext *currentContext = const_cast(QGLContext::currentContext()); - ctx = QGLContextPrivate::contextGroup(currentContext); + QGLContext *ctx = const_cast(QGLContext::currentContext()); + fbo_guard.setContext(ctx); bool ext_detected = (QGLExtensions::glExtensions & QGLExtensions::FramebufferObject); - if (!ext_detected || (ext_detected && !qt_resolve_framebufferobject_extensions(currentContext))) + if (!ext_detected || (ext_detected && !qt_resolve_framebufferobject_extensions(ctx))) return; size = sz; @@ -417,8 +421,10 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz, // texture dimensions QT_RESET_GLERROR(); // reset error state + GLuint fbo = 0; glGenFramebuffers(1, &fbo); glBindFramebuffer(GL_FRAMEBUFFER_EXT, fbo); + fbo_guard.setId(fbo); glDevice.setFBO(q, attachment); @@ -535,13 +541,14 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz, fbo_attachment = QGLFramebufferObject::NoAttachment; } - glBindFramebuffer(GL_FRAMEBUFFER_EXT, currentContext->d_ptr->current_fbo); + glBindFramebuffer(GL_FRAMEBUFFER_EXT, ctx->d_ptr->current_fbo); if (!valid) { if (color_buffer) glDeleteRenderbuffers(1, &color_buffer); else glDeleteTextures(1, &texture); glDeleteFramebuffers(1, &fbo); + fbo_guard.setId(0); } QT_CHECK_GLERROR(); @@ -810,19 +817,15 @@ QGLFramebufferObject::~QGLFramebufferObject() delete d->engine; - if (isValid()) { - const QGLContext *oldContext = QGLContext::currentContext(); - bool switchContext = !oldContext || QGLContextPrivate::contextGroup(oldContext) != ctx; - if (switchContext) - const_cast(ctx->context())->makeCurrent(); + if (isValid() && ctx) { + QGLShareContextScope scope(ctx); glDeleteTextures(1, &d->texture); if (d->color_buffer) glDeleteRenderbuffers(1, &d->color_buffer); if (d->depth_stencil_buffer) glDeleteRenderbuffers(1, &d->depth_stencil_buffer); - glDeleteFramebuffers(1, &d->fbo); - if (oldContext && switchContext) - const_cast(oldContext)->makeCurrent(); + GLuint fbo = d->fbo(); + glDeleteFramebuffers(1, &fbo); } } @@ -838,11 +841,16 @@ QGLFramebufferObject::~QGLFramebufferObject() The non-power of two limitation does not apply if the OpenGL version is 2.0 or higher, or if the GL_ARB_texture_non_power_of_two extension is present. + + The framebuffer can also become invalid if the QGLContext that + the framebuffer was created within is destroyed and there are + no other shared contexts that can take over ownership of the + framebuffer. */ bool QGLFramebufferObject::isValid() const { Q_D(const QGLFramebufferObject); - return d->valid; + return d->valid && d->fbo_guard.context(); } /*! @@ -867,15 +875,17 @@ bool QGLFramebufferObject::bind() return false; Q_D(QGLFramebufferObject); QGL_FUNC_CONTEXT; - glBindFramebuffer(GL_FRAMEBUFFER_EXT, d->fbo); + if (!ctx) + return false; // Context no longer exists. + glBindFramebuffer(GL_FRAMEBUFFER_EXT, d->fbo()); d->valid = d->checkFramebufferStatus(); const QGLContext *context = QGLContext::currentContext(); if (d->valid && context) { - Q_ASSERT(QGLContextPrivate::contextGroup(context) == ctx); + Q_ASSERT(QGLContextPrivate::contextGroup(context) == QGLContextPrivate::contextGroup(ctx)); // Save the previous setting to automatically restore in release(). - if (context->d_ptr->current_fbo != d->fbo) { + if (context->d_ptr->current_fbo != d->fbo()) { d->previous_fbo = context->d_ptr->current_fbo; - context->d_ptr->current_fbo = d->fbo; + context->d_ptr->current_fbo = d->fbo(); } } return d->valid; @@ -900,10 +910,12 @@ bool QGLFramebufferObject::release() return false; Q_D(QGLFramebufferObject); QGL_FUNC_CONTEXT; + if (!ctx) + return false; // Context no longer exists. const QGLContext *context = QGLContext::currentContext(); if (context) { - Q_ASSERT(QGLContextPrivate::contextGroup(context) == ctx); + Q_ASSERT(QGLContextPrivate::contextGroup(context) == QGLContextPrivate::contextGroup(ctx)); // Restore the previous setting for stacked framebuffer objects. if (d->previous_fbo != context->d_ptr->current_fbo) { context->d_ptr->current_fbo = d->previous_fbo; @@ -1144,7 +1156,7 @@ int QGLFramebufferObject::metric(PaintDeviceMetric metric) const GLuint QGLFramebufferObject::handle() const { Q_D(const QGLFramebufferObject); - return d->fbo; + return d->fbo(); } /*! \fn int QGLFramebufferObject::devType() const @@ -1175,7 +1187,7 @@ QGLFramebufferObject::Attachment QGLFramebufferObject::attachment() const bool QGLFramebufferObject::isBound() const { Q_D(const QGLFramebufferObject); - return QGLContext::currentContext()->d_ptr->current_fbo == d->fbo; + return QGLContext::currentContext()->d_ptr->current_fbo == d->fbo(); } /*! diff --git a/src/opengl/qglframebufferobject_p.h b/src/opengl/qglframebufferobject_p.h index f80209d..055a752 100644 --- a/src/opengl/qglframebufferobject_p.h +++ b/src/opengl/qglframebufferobject_p.h @@ -127,15 +127,15 @@ private: class QGLFramebufferObjectPrivate { public: - QGLFramebufferObjectPrivate() : depth_stencil_buffer(0), valid(false), ctx(0), previous_fbo(0), engine(0) {} + QGLFramebufferObjectPrivate() : fbo_guard(0), depth_stencil_buffer(0), valid(false), previous_fbo(0), engine(0) {} ~QGLFramebufferObjectPrivate() {} void init(QGLFramebufferObject *q, const QSize& sz, QGLFramebufferObject::Attachment attachment, GLenum internal_format, GLenum texture_target, GLint samples = 0); bool checkFramebufferStatus() const; + QGLSharedResourceGuard fbo_guard; GLuint texture; - GLuint fbo; GLuint depth_stencil_buffer; GLuint color_buffer; GLenum target; @@ -143,10 +143,11 @@ public: QGLFramebufferObjectFormat format; uint valid : 1; QGLFramebufferObject::Attachment fbo_attachment; - QGLContextGroup *ctx; // for Windows extension ptrs GLuint previous_fbo; mutable QPaintEngine *engine; QGLFBOGLPaintDevice glDevice; + + inline GLuint fbo() const { return fbo_guard.id(); } }; diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp index 999d119..8027e9b 100644 --- a/tests/auto/qgl/tst_qgl.cpp +++ b/tests/auto/qgl/tst_qgl.cpp @@ -84,6 +84,7 @@ private slots: void testDontCrashOnDanglingResources(); void replaceClipping(); void clipTest(); + void destroyFBOAfterContext(); }; tst_QGL::tst_QGL() @@ -1720,6 +1721,33 @@ void tst_QGL::clipTest() QCOMPARE(widgetFB, reference); } +void tst_QGL::destroyFBOAfterContext() +{ + if (!QGLFramebufferObject::hasOpenGLFramebufferObjects()) + QSKIP("QGLFramebufferObject not supported on this platform", SkipSingle); + + QGLWidget *glw = new QGLWidget(); + glw->makeCurrent(); + + // No multisample with combined depth/stencil attachment: + QGLFramebufferObjectFormat fboFormat; + fboFormat.setAttachment(QGLFramebufferObject::CombinedDepthStencil); + + // Don't complicate things by using NPOT: + QGLFramebufferObject *fbo = new QGLFramebufferObject(256, 128, fboFormat); + + // The handle should be valid until the context is destroyed. + QVERIFY(fbo->handle() != 0); + QVERIFY(fbo->isValid()); + + delete glw; + + // The handle should now be zero. + QVERIFY(fbo->handle() == 0); + QVERIFY(!fbo->isValid()); + + delete fbo; +} QTEST_MAIN(tst_QGL) #include "tst_qgl.moc" -- cgit v0.12 From 9dc9084a2ede875495e078e6998476f2ae5ea4e5 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Thu, 1 Oct 2009 14:26:34 +1000 Subject: Use QGLSharedResourceGuard to track contexts in the shader manager Reviewed-by: Sarah Smith --- src/opengl/gl2paintengineex/qglengineshadermanager.cpp | 8 ++++---- src/opengl/gl2paintengineex/qglengineshadermanager_p.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp index eceed06..fcb20b4 100644 --- a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp +++ b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp @@ -78,7 +78,7 @@ const char* QGLEngineSharedShaders::qglEngineShaderSourceCode[] = { }; QGLEngineSharedShaders::QGLEngineSharedShaders(const QGLContext* context) - : ctx(QGLContextPrivate::contextGroup(context)) + : ctxGuard(context) , blitShaderProg(0) , simpleShaderProg(0) { @@ -223,7 +223,7 @@ QGLShader *QGLEngineSharedShaders::compileNamedShader(ShaderName name, QGLShader return compiledShaders[name]; QByteArray source = qglEngineShaderSourceCode[name]; - QGLShader *newShader = new QGLShader(type, ctx->context(), this); + QGLShader *newShader = new QGLShader(type, ctxGuard.context(), this); newShader->compile(source); #if defined(QT_DEBUG) @@ -245,7 +245,7 @@ QGLShader *QGLEngineSharedShaders::compileCustomShader(QGLCustomShaderStage *sta if (newShader) return newShader; - newShader = new QGLShader(type, ctx->context(), this); + newShader = new QGLShader(type, ctxGuard.context(), this); newShader->compile(source); customShaderCache.insert(source, newShader); @@ -273,7 +273,7 @@ QGLEngineShaderProg *QGLEngineSharedShaders::findProgramInCache(const QGLEngineS QGLEngineShaderProg &cached = cachedPrograms.last(); // If the shader program's not found in the cache, create it now. - cached.program = new QGLShaderProgram(ctx->context(), this); + cached.program = new QGLShaderProgram(ctxGuard.context(), this); cached.program->addShader(cached.mainVertexShader); cached.program->addShader(cached.positionVertexShader); cached.program->addShader(cached.mainFragShader); diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h index 47d9a2a..fbb6d9c 100644 --- a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h +++ b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h @@ -361,7 +361,7 @@ private slots: void shaderDestroyed(QObject *shader); private: - QGLContextGroup *ctx; + QGLSharedResourceGuard ctxGuard; QGLShaderProgram *blitShaderProg; QGLShaderProgram *simpleShaderProg; QList cachedPrograms; -- cgit v0.12 From 5da322990a5002d8c827578efad7b210716f1c15 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 1 Oct 2009 06:42:27 +0200 Subject: Revert "qmake - add error message if files for deployment are missing" This reverts commit aed3faca7dafdc697402cfc99dc5e9ad2fcbdd45. Using wildcards in the DEPLOYMENT variable like in tests/auto/qpixmap/qpixmap.pro was completely broken. Additional gimmick: replaced hand-crafted string chopping with QString::chop(1). --- qmake/generators/win32/msvc_vcproj.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 0fedbec..c8bb26d 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -1172,7 +1172,7 @@ void VcprojGenerator::initDeploymentTool() if (targetPath.isEmpty()) targetPath = QString("%CSIDL_PROGRAM_FILES%\\") + project->first("TARGET"); if (targetPath.endsWith("/") || targetPath.endsWith("\\")) - targetPath = targetPath.mid(0,targetPath.size()-1); + targetPath.chop(1); // Only deploy Qt libs for shared build if (!project->values("QMAKE_QT_DLL").isEmpty()) { @@ -1261,13 +1261,7 @@ void VcprojGenerator::initDeploymentTool() searchPath = info.absoluteFilePath(); } else { nameFilter = source.split('\\').last(); - if (source.contains('*')) { - source = source.split('*').first(); - info = QFileInfo(source); - } - searchPath = info.absolutePath(); - if (!info.exists()) - fprintf(stderr, "Deployment file is missing %s\n", source.toLatin1().constData()); + searchPath = info.absolutePath(); } int pathSize = searchPath.size(); -- cgit v0.12 From 059d40d3f918f658041ec20ba04f9d010cfc0fa7 Mon Sep 17 00:00:00 2001 From: Sarah Smith Date: Thu, 1 Oct 2009 15:49:32 +1000 Subject: Remove display lists and refactor ready for ES/ES2 port Display lists, and a few other features dont work in ES/ES2. Refaoctor to allow redo of lighting and other non-fixed-function pipeline features. Also use QAnimation* classes instead of timers, and correct a few minor bugs (flipped texture). Include new screenshot (old one manifested bug). Reviewed-by: Rhys Weatherley --- doc/src/images/pbuffers-example.png | Bin 203754 -> 192554 bytes examples/opengl/pbuffers/cube.cpp | 332 ++++++++++++++++++++++++++++++++++ examples/opengl/pbuffers/cube.h | 147 +++++++++++++++ examples/opengl/pbuffers/glwidget.cpp | 273 +++++++++++++--------------- examples/opengl/pbuffers/glwidget.h | 43 +++-- examples/opengl/pbuffers/main.cpp | 2 + examples/opengl/pbuffers/pbuffers.pro | 20 +- 7 files changed, 649 insertions(+), 168 deletions(-) create mode 100644 examples/opengl/pbuffers/cube.cpp create mode 100644 examples/opengl/pbuffers/cube.h diff --git a/doc/src/images/pbuffers-example.png b/doc/src/images/pbuffers-example.png index bafb05a..c34a6fd 100644 Binary files a/doc/src/images/pbuffers-example.png and b/doc/src/images/pbuffers-example.png differ diff --git a/examples/opengl/pbuffers/cube.cpp b/examples/opengl/pbuffers/cube.cpp new file mode 100644 index 0000000..0f6d15f --- /dev/null +++ b/examples/opengl/pbuffers/cube.cpp @@ -0,0 +1,332 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "cube.h" +#include "glwidget.h" + +#include +#include + +static const qreal FACE_SIZE = 0.4; + +static const qreal speeds[] = { 1.8f, 2.4f, 3.6f }; +static const qreal amplitudes[] = { 2.0f, 2.5f, 3.0f }; + +static inline void qSetColor(float colorVec[], QColor c) +{ + colorVec[0] = c.redF(); + colorVec[1] = c.greenF(); + colorVec[2] = c.blueF(); + colorVec[3] = c.alphaF(); +} + +int Geometry::append(const QVector3D &a, const QVector3D &n, const QVector2D &t) +{ + int v = vertices.count(); + vertices.append(a); + normals.append(n); + texCoords.append(t); + faces.append(v); + colors.append(QVector4D(0.6f, 0.6f, 0.6f, 1.0f)); + return v; +} + +void Geometry::addQuad(const QVector3D &a, const QVector3D &b, + const QVector3D &c, const QVector3D &d, + const QVector &tex) +{ + QVector3D norm = QVector3D::normal(a, b, c); + // append first triangle + int aref = append(a, norm, tex[0]); + append(b, norm, tex[1]); + int cref = append(c, norm, tex[2]); + // append second triangle + faces.append(aref); + faces.append(cref); + append(d, norm, tex[3]); +} + +void Geometry::loadArrays() const +{ + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_NORMAL_ARRAY); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + glEnableClientState(GL_COLOR_ARRAY); + glVertexPointer(3, GL_FLOAT, 0, vertices.constData()); + glNormalPointer(GL_FLOAT, 0, normals.constData()); + glTexCoordPointer(2, GL_FLOAT, 0, texCoords.constData()); + glColorPointer(4, GL_FLOAT, 0, colors.constData()); +} + +void Geometry::setColors(int start, GLfloat colorArray[4][4]) +{ + int off = faces[start]; + for (int i = 0; i < 4; ++i) + colors[i + off] = QVector4D(colorArray[i][0], + colorArray[i][1], + colorArray[i][2], + colorArray[i][3]); +} + +Tile::Tile(const QVector3D &loc) + : location(loc) + , start(0) + , count(0) + , useFlatColor(false) + , geom(0) +{ + qSetColor(faceColor, QColor(Qt::darkGray)); +} + +void Tile::setColors(GLfloat colorArray[4][4]) +{ + useFlatColor = true; + geom->setColors(start, colorArray); +} + +static inline void qMultMatrix(const QMatrix4x4 &mat) +{ + if (sizeof(qreal) == sizeof(GLfloat)) + glMultMatrixf((GLfloat*)mat.constData()); +#ifndef QT_OPENGL_ES + else if (sizeof(qreal) == sizeof(GLdouble)) + glMultMatrixd((GLdouble*)mat.constData()); +#endif + else + { + GLfloat fmat[16]; + qreal const *r = mat.constData(); + for (int i = 0; i < 16; ++i) + fmat[i] = r[i]; + glMultMatrixf(fmat); + } +} + +void Tile::draw() const +{ + QMatrix4x4 mat; + mat.translate(location); + mat.rotate(orientation); + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + qMultMatrix(mat); + glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, faceColor); + glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, geom->indices() + start); + glPopMatrix(); +} + +TileBuilder::TileBuilder(Geometry *g, qreal depth, qreal size) + : verts(4) + , tex(4) + , start(g->count()) + , count(0) + , geom(g) +{ + // front face - make a square with bottom-left at origin + verts[br].setX(size); + verts[tr].setX(size); + verts[tr].setY(size); + verts[tl].setY(size); + + // these vert numbers are good for the tex-coords + for (int i = 0; i < 4; ++i) + tex[i] = verts[i].toVector2D(); + + // now move verts half cube width across so cube is centered on origin + for (int i = 0; i < 4; ++i) + verts[i] -= QVector3D(size / 2.0f, size / 2.0f, -depth); + + // add the front face + g->addQuad(verts[bl], verts[br], verts[tr], verts[tl], tex); + + count = g->count() - start; +} + +void TileBuilder::initialize(Tile *tile) const +{ + tile->start = start; + tile->count = count; + tile->geom = geom; + qSetColor(tile->faceColor, color); +} + +Tile *TileBuilder::newTile(const QVector3D &loc) const +{ + Tile *tile = new Tile(loc); + initialize(tile); + return tile; +} + +Cube::Cube(const QVector3D &loc) + : Tile(loc) + , rot(0.0f) + , r(0), a(0) +{ +} + +Cube::~Cube() +{ +} + +void Cube::setAltitude(qreal a) +{ + if (location.y() != a) + { + location.setY(a); + emit changed(); + } +} + +void Cube::setRange(qreal r) +{ + if (location.x() != r) + { + location.setX(r); + emit changed(); + } +} + +void Cube::setRotation(qreal r) +{ + if (r != rot) + { + orientation = QQuaternion::fromAxisAndAngle(QVector3D(1.0f, 1.0f, 1.0f), r); + emit changed(); + } +} + +void Cube::removeBounce() +{ + delete a; + a = 0; + delete r; + r = 0; +} + +void Cube::startAnimation() +{ + if (r) + { + r->start(); + r->setCurrentTime(startx); + } + if (a) + a->start(); + if (rtn) + rtn->start(); +} + +void Cube::setAnimationPaused(bool paused) +{ + if (paused) + { + if (r) + r->pause(); + if (a) + a->pause(); + if (rtn) + rtn->pause(); + } + else + { + if (r) + r->resume(); + if (a) + a->resume(); + if (rtn) + rtn->resume(); + } +} + +CubeBuilder::CubeBuilder(Geometry *g, qreal depth, qreal size) + : TileBuilder(g, depth) + , ix(0) +{ + for (int i = 0; i < 4; ++i) + verts[i].setZ(size / 2.0f); + // back face - "extrude" verts down + QVector back(verts); + for (int i = 0; i < 4; ++i) + back[i].setZ(-size / 2.0f); + + // add the back face + g->addQuad(back[br], back[bl], back[tl], back[tr], tex); + + // add the sides + g->addQuad(back[bl], back[br], verts[br], verts[bl], tex); + g->addQuad(back[br], back[tr], verts[tr], verts[br], tex); + g->addQuad(back[tr], back[tl], verts[tl], verts[tr], tex); + g->addQuad(back[tl], back[bl], verts[bl], verts[tl], tex); + + count = g->count() - start; +} + +Cube *CubeBuilder::newCube(const QVector3D &loc) const +{ + Cube *c = new Cube(loc); + initialize(c); + qreal d = 4000.0f; + qreal d3 = d / 3.0f; + // Animate movement from left to right + c->r = new QPropertyAnimation(c, "range"); + c->r->setStartValue(-1.3f); + c->r->setEndValue(1.3f); + c->startx = ix * d3 * 3.0f; + c->r->setDuration(d * 4.0f); + c->r->setLoopCount(-1); + c->r->setEasingCurve(QEasingCurve(QEasingCurve::CosineCurve)); + // Animate movement from bottom to top + c->a = new QPropertyAnimation(c, "altitude"); + c->a->setEndValue(loc.y()); + c->a->setStartValue(loc.y() + amplitudes[ix]); + c->a->setDuration(d / speeds[ix]); + c->a->setLoopCount(-1); + c->a->setEasingCurve(QEasingCurve(QEasingCurve::CosineCurve)); + // Animate rotation + c->rtn = new QPropertyAnimation(c, "rotation"); + c->rtn->setStartValue(c->rot); + c->rtn->setEndValue(359.0f); + c->rtn->setDuration(d * 2.0f); + c->rtn->setLoopCount(-1); + c->rtn->setDuration(d / 2); + ix = (ix + 1) % 3; + return c; +} diff --git a/examples/opengl/pbuffers/cube.h b/examples/opengl/pbuffers/cube.h new file mode 100644 index 0000000..4f29b7d --- /dev/null +++ b/examples/opengl/pbuffers/cube.h @@ -0,0 +1,147 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef CUBE_H +#define CUBE_H + +#include +#include +#include +#include +#include + +class QPropertyAnimation; + +class Geometry +{ +public: + void loadArrays() const; + void addQuad(const QVector3D &a, const QVector3D &b, + const QVector3D &c, const QVector3D &d, + const QVector &tex); + void setColors(int start, GLfloat colors[4][4]); + const GLushort *indices() const { return faces.constData(); } + int count() const { return faces.count(); } +private: + QVector faces; + QVector vertices; + QVector normals; + QVector texCoords; + QVector colors; + int append(const QVector3D &a, const QVector3D &n, const QVector2D &t); + void addTri(const QVector3D &a, const QVector3D &b, const QVector3D &c, const QVector3D &n); + friend class Tile; +}; + +class Tile +{ +public: + void draw() const; + void setColors(GLfloat[4][4]); +protected: + Tile(const QVector3D &loc = QVector3D()); + QVector3D location; + QQuaternion orientation; +private: + int start; + int count; + bool useFlatColor; + GLfloat faceColor[4]; + Geometry *geom; + friend class TileBuilder; +}; + +class TileBuilder +{ +public: + enum { bl, br, tr, tl }; + TileBuilder(Geometry *, qreal depth = 0.0f, qreal size = 1.0f); + Tile *newTile(const QVector3D &loc = QVector3D()) const; + void setColor(QColor c) { color = c; } +protected: + void initialize(Tile *) const; + QVector verts; + QVector tex; + int start; + int count; + Geometry *geom; + QColor color; +}; + +class Cube : public QObject, public Tile +{ + Q_OBJECT + Q_PROPERTY(qreal range READ range WRITE setRange); + Q_PROPERTY(qreal altitude READ altitude WRITE setAltitude); + Q_PROPERTY(qreal rotation READ rotation WRITE setRotation); +public: + Cube(const QVector3D &loc = QVector3D()); + ~Cube(); + qreal range() { return location.x(); } + void setRange(qreal r); + qreal altitude() { return location.y(); } + void setAltitude(qreal a); + qreal rotation() { return rot; } + void setRotation(qreal r); + void removeBounce(); + void startAnimation(); + void setAnimationPaused(bool paused); +signals: + void changed(); +private: + qreal rot; + QPropertyAnimation *r; + QPropertyAnimation *a; + QPropertyAnimation *rtn; + qreal startx; + friend class CubeBuilder; +}; + +class CubeBuilder : public TileBuilder +{ +public: + CubeBuilder(Geometry *, qreal depth = 0.0f, qreal size = 1.0f); + Cube *newCube(const QVector3D &loc = QVector3D()) const; +private: + mutable int ix; +}; + +#endif // CUBE_H diff --git a/examples/opengl/pbuffers/glwidget.cpp b/examples/opengl/pbuffers/glwidget.cpp index fbd5518..56ba65b 100644 --- a/examples/opengl/pbuffers/glwidget.cpp +++ b/examples/opengl/pbuffers/glwidget.cpp @@ -40,216 +40,187 @@ ****************************************************************************/ #include "glwidget.h" -#include - #include -static GLint cubeArray[][3] = { - {0, 0, 0}, {0, 1, 0}, {1, 1, 0}, {1, 0, 0}, - {0, 0, 1}, {1, 0, 1}, {1, 1, 1}, {0, 1, 1}, - {0, 0, 0}, {1, 0, 0}, {1, 0, 1}, {0, 0, 1}, - {0, 1, 0}, {0, 1, 1}, {1, 1, 1}, {1, 1, 0}, - {0, 1, 0}, {0, 0, 0}, {0, 0, 1}, {0, 1, 1}, - {1, 0, 0}, {1, 1, 0}, {1, 1, 1}, {1, 0, 1} -}; +#include "cube.h" -static GLint cubeTextureArray[][2] = { - {0, 0}, {1, 0}, {1, 1}, {0, 1}, - {0, 0}, {0, 1}, {1, 1}, {1, 0}, - {0, 0}, {1, 0}, {1, 1}, {0, 1}, - {1, 0}, {0, 0}, {0, 1}, {1, 1}, - {0, 0}, {1, 0}, {1, 1}, {0, 1}, - {1, 0}, {0, 0}, {0, 1}, {1, 1} -}; +#include -static GLint faceArray[][2] = { - {1, -1}, {1, 1}, {-1, 1}, {-1, -1} -}; +#ifndef GL_MULTISAMPLE +#define GL_MULTISAMPLE 0x809D +#endif -static GLubyte colorArray[][4] = { - {102, 176, 54, 255}, - {81, 141, 41, 255}, - {62, 108, 32, 255}, - {45, 79, 23, 255} +static GLfloat colorArray[][4] = { + {0.243f, 0.423f, 0.125f, 1.0f}, + {0.176f, 0.31f, 0.09f, 1.0f}, + {0.4f, 0.69f, 0.212f, 1.0f}, + {0.317f, 0.553f, 0.161f, 1.0f} }; GLWidget::GLWidget(QWidget *parent) - : QGLWidget(QGLFormat(QGL::SampleBuffers), parent) + : QGLWidget(QGLFormat(QGL::SampleBuffers), parent) + , geom(0) + , cube(0) { // create the pbuffer pbuffer = new QGLPixelBuffer(QSize(512, 512), format(), this); - timerId = startTimer(20); setWindowTitle(tr("OpenGL pbuffers")); + initializeGeometry(); } GLWidget::~GLWidget() { pbuffer->releaseFromDynamicTexture(); glDeleteTextures(1, &dynamicTexture); - glDeleteLists(pbufferList, 1); delete pbuffer; + + qDeleteAll(cubes); + qDeleteAll(tiles); + delete cube; } void GLWidget::initializeGL() { - glMatrixMode(GL_MODELVIEW); - - glEnable(GL_CULL_FACE); initCommon(); + glShadeModel(GL_SMOOTH); + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + static GLfloat lightPosition[4] = { 0.5, 5.0, 7.0, 1.0 }; + glLightfv(GL_LIGHT0, GL_POSITION, lightPosition); initPbuffer(); - - for (int i = 0; i < 3; ++i) { - yOffs[i] = 0.0f; - xInc[i] = 0.005f; - rot[i] = 0.0f; + cube->startAnimation(); + connect(cube, SIGNAL(changed()), this, SLOT(update())); + for (int i = 0; i < 3; ++i) + { + cubes[i]->startAnimation(); + connect(cubes[i], SIGNAL(changed()), this, SLOT(update())); } - xOffs[0]= 0.0f; - xOffs[1]= 0.5f; - xOffs[2]= 1.0f; - - cubeTexture = bindTexture(QImage(":res/cubelogo.png")); -} - -void GLWidget::resizeGL(int w, int h) -{ - glViewport(0, 0, w, h); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - float aspect = w/(float)(h ? h : 1); - glFrustum(-aspect, aspect, -1, 1, 10, 100); - glTranslatef(-0.5f, -0.5f, -0.5f); - glTranslatef(0.0f, 0.0f, -15.0f); } void GLWidget::paintGL() { - // draw a spinning cube into the pbuffer.. pbuffer->makeCurrent(); - glBindTexture(GL_TEXTURE_2D, cubeTexture); - glCallList(pbufferList); - glFlush(); - - // rendering directly to a texture is not supported on X11 and - // some Windows implementations, unfortunately + drawPbuffer(); + // On direct render platforms, drawing onto the pbuffer context above + // automatically updates the dynamic texture. For cases where rendering + // directly to a texture is not supported, explicitly copy. if (!hasDynamicTextureUpdate) pbuffer->updateDynamicTexture(dynamicTexture); - - // ..and use the pbuffer contents as a texture when rendering the - // background and the bouncing cubes makeCurrent(); + + // Use the pbuffer as a texture to render the scene glBindTexture(GL_TEXTURE_2D, dynamicTexture); + + // set up to render the scene glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glLoadIdentity(); + glTranslatef(0.0f, 0.0f, -10.0f); // draw the background - glMatrixMode(GL_MODELVIEW); glPushMatrix(); - glLoadIdentity(); - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glLoadIdentity(); - - glVertexPointer(2, GL_INT, 0, faceArray); - glTranslatef(-1.2f, -0.8f, 0.0f); - glScalef(0.2f, 0.2f, 0.2f); - for (int y = 0; y < 5; ++y) { - for (int x = 0; x < 5; ++x) { - glTranslatef(2.0f, 0, 0); - glColor4f(0.8f, 0.8f, 0.8f, 1.0f); - glDrawArrays(GL_QUADS, 0, 4); - } - glTranslatef(-10.0f, 2.0f, 0); - } - glVertexPointer(3, GL_INT, 0, cubeArray); - - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); + glScalef(aspect, 1.0f, 1.0f); + for (int i = 0; i < tiles.count(); ++i) + tiles[i]->draw(); glPopMatrix(); // draw the bouncing cubes - drawCube(0, 0.0f, 1.5f, 2.5f, 1.5f); - drawCube(1, 1.0f, 2.0f, 2.5f, 2.0f); - drawCube(2, 2.0f, 3.5f, 2.5f, 2.5f); + for (int i = 0; i < cubes.count(); ++i) + cubes[i]->draw(); } -void GLWidget::drawCube(int i, GLfloat z, GLfloat rotation, GLfloat jmp, GLfloat amp) +void GLWidget::initializeGeometry() { - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glTranslatef(xOffs[i], yOffs[i], z); - glTranslatef(0.5f, 0.5f, 0.5f); - GLfloat scale = 0.75 + i*(0.25f/2); - glScalef(scale, scale, scale); - glRotatef(rot[i], 1.0f, 1.0f, 1.0f); - glTranslatef(-0.5f, -0.5f, -0.5f); - - glColor4f(1.0f, 1.0f, 1.0f, 0.8f); - glDrawArrays(GL_QUADS, 0, 24); - - if (xOffs[i] > 1.0f || xOffs[i] < -1.0f) { - xInc[i] = -xInc[i]; - xOffs[i] = xOffs[i] > 1.0f ? 1.0f : -1.0f; - } - xOffs[i] += xInc[i]; - yOffs[i] = qAbs(cos((-3.141592f * jmp) * xOffs[i]) * amp) - 1; - rot[i] += rotation; + geom = new Geometry(); + CubeBuilder cBuilder(geom, 0.5); + cBuilder.setColor(QColor(255, 255, 255, 212)); + // build the 3 bouncing, spinning cubes + for (int i = 0; i < 3; ++i) + cubes.append(cBuilder.newCube(QVector3D((float)(i-1), -1.5f, 5 - i))); + + // build the spinning cube which goes in the dynamic texture + cube = cBuilder.newCube(); + cube->removeBounce(); + + // build the background tiles + TileBuilder tBuilder(geom); + tBuilder.setColor(QColor(Qt::white)); + for (int c = -2; c <= +2; ++c) + for (int r = -2; r <= +2; ++r) + tiles.append(tBuilder.newTile(QVector3D(c, r, 0))); + + // graded backdrop for the pbuffer scene + TileBuilder bBuilder(geom, 0.0f, 2.0f); + bBuilder.setColor(QColor(102, 176, 54, 210)); + backdrop = bBuilder.newTile(QVector3D(0.0f, 0.0f, -1.5f)); + backdrop->setColors(colorArray); } void GLWidget::initCommon() { - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glVertexPointer(3, GL_INT, 0, cubeArray); - glTexCoordPointer(2, GL_INT, 0, cubeTextureArray); - glColorPointer(4, GL_UNSIGNED_BYTE, 0, colorArray); + qglClearColor(QColor(Qt::darkGray)); + + glEnable(GL_DEPTH_TEST); + glEnable(GL_CULL_FACE); + glEnable(GL_MULTISAMPLE); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); + glEnable(GL_TEXTURE_2D); - glEnable(GL_DEPTH_TEST); - glClearColor(1.0f, 1.0f, 1.0f, 1.0f); + geom->loadArrays(); } -void GLWidget::initPbuffer() +void GLWidget::perspectiveProjection() { - // set up the pbuffer context - pbuffer->makeCurrent(); - initCommon(); - - glViewport(0, 0, pbuffer->size().width(), pbuffer->size().height()); glMatrixMode(GL_PROJECTION); glLoadIdentity(); - glOrtho(-1, 1, -1, 1, -99, 99); - glTranslatef(-0.5f, -0.5f, 0.0f); + glFrustum(-aspect, +aspect, -1.0, +1.0, 4.0, 15.0); glMatrixMode(GL_MODELVIEW); +} + +void GLWidget::orthographicProjection() +{ + glMatrixMode(GL_PROJECTION); glLoadIdentity(); + glOrtho(-1.0, +1.0, -1.0, +1.0, -90.0, +90.0); + glMatrixMode(GL_MODELVIEW); +} + +void GLWidget::resizeGL(int width, int height) +{ + glViewport(0, 0, width, height); + aspect = (qreal)width / (qreal)(height ? height : 1); + perspectiveProjection(); +} + +void GLWidget::drawPbuffer() +{ + orthographicProjection(); + + glClearColor(0.0f, 0.0f, 0.0f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glDisable(GL_TEXTURE_2D); + backdrop->draw(); + glEnable(GL_TEXTURE_2D); + + glBindTexture(GL_TEXTURE_2D, cubeTexture); + glDisable(GL_CULL_FACE); + cube->draw(); + glEnable(GL_CULL_FACE); + + glFlush(); +} + +void GLWidget::initPbuffer() +{ + pbuffer->makeCurrent(); + + cubeTexture = bindTexture(QImage(":res/cubelogo.png")); + + initCommon(); - pbufferList = glGenLists(1); - glNewList(pbufferList, GL_COMPILE); - { - glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT); - - // draw cube background - glPushMatrix(); - glLoadIdentity(); - glTranslatef(0.5f, 0.5f, -2.0f); - glDisable(GL_TEXTURE_2D); - glEnableClientState(GL_COLOR_ARRAY); - glVertexPointer(2, GL_INT, 0, faceArray); - glDrawArrays(GL_QUADS, 0, 4); - glVertexPointer(3, GL_INT, 0, cubeArray); - glDisableClientState(GL_COLOR_ARRAY); - glEnable(GL_TEXTURE_2D); - glPopMatrix(); - - // draw cube - glTranslatef(0.5f, 0.5f, 0.5f); - glRotatef(3.0f, 1.0f, 1.0f, 1.0f); - glTranslatef(-0.5f, -0.5f, -0.5f); - glColor4f(0.9f, 0.9f, 0.9f, 1.0f); - glDrawArrays(GL_QUADS, 0, 24); - } - glEndList(); // generate a texture that has the same size/format as the pbuffer dynamicTexture = pbuffer->generateDynamicTexture(); @@ -258,3 +229,9 @@ void GLWidget::initPbuffer() makeCurrent(); } +void GLWidget::setAnimationPaused(bool enable) +{ + cube->setAnimationPaused(enable); + for (int i = 0; i < 3; ++i) + cubes[i]->setAnimationPaused(enable); +} diff --git a/examples/opengl/pbuffers/glwidget.h b/examples/opengl/pbuffers/glwidget.h index 5b64b08..991e8b9 100644 --- a/examples/opengl/pbuffers/glwidget.h +++ b/examples/opengl/pbuffers/glwidget.h @@ -39,32 +39,49 @@ ** ****************************************************************************/ -#include +#ifndef GLWIDGET_H +#define GLWIDGET_H + +#include + +class Geometry; +class Cube; +class Tile; class GLWidget : public QGLWidget { public: - GLWidget(QWidget *parent); + GLWidget(QWidget *parent = 0); ~GLWidget(); + +protected: void initializeGL(); - void resizeGL(int w, int h); void paintGL(); - void timerEvent(QTimerEvent *) { update(); } - void mousePressEvent(QMouseEvent *) { killTimer(timerId); } - void mouseReleaseEvent(QMouseEvent *) { timerId = startTimer(20); } + void resizeGL(int width, int height); + void mousePressEvent(QMouseEvent *) { setAnimationPaused(true); } + void mouseReleaseEvent(QMouseEvent *) { setAnimationPaused(false); } - void drawCube(int i, GLfloat z, GLfloat ri, GLfloat jmp, GLfloat amp); - void initCommon(); +private: + void initializeGeometry(); void initPbuffer(); + void initCommon(); + void perspectiveProjection(); + void orthographicProjection(); + void drawPbuffer(); + void setAnimationPaused(bool enable); -private: - GLfloat rot[3], xOffs[3], yOffs[3], xInc[3]; - GLuint pbufferList; + qreal aspect; GLuint dynamicTexture; GLuint cubeTexture; - int timerId; bool hasDynamicTextureUpdate; - QGLPixelBuffer *pbuffer; + Geometry *geom; + Cube *cube; + Tile *backdrop; + QList cubes; + QList tiles; + }; +//! [3] +#endif diff --git a/examples/opengl/pbuffers/main.cpp b/examples/opengl/pbuffers/main.cpp index cb9e161..4efe9a8 100644 --- a/examples/opengl/pbuffers/main.cpp +++ b/examples/opengl/pbuffers/main.cpp @@ -41,6 +41,8 @@ #include #include +#include + #include "glwidget.h" int main(int argc, char **argv) diff --git a/examples/opengl/pbuffers/pbuffers.pro b/examples/opengl/pbuffers/pbuffers.pro index 4f7740e..1c21596 100644 --- a/examples/opengl/pbuffers/pbuffers.pro +++ b/examples/opengl/pbuffers/pbuffers.pro @@ -1,13 +1,19 @@ -HEADERS += glwidget.h -SOURCES += glwidget.cpp main.cpp +HEADERS += glwidget.h \ + cube.h +SOURCES += glwidget.cpp \ + main.cpp \ + cube.cpp RESOURCES += pbuffers.qrc - QT += opengl # install target.path = $$[QT_INSTALL_EXAMPLES]/opengl/pbuffers -sources.files = $$SOURCES $$HEADERS $$RESOURCES pbuffers.pro *.png +sources.files = $$SOURCES \ + $$HEADERS \ + $$RESOURCES \ + pbuffers.pro \ + *.png sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/pbuffers -INSTALLS += target sources - -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) +INSTALLS += target \ + sources +symbian:include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) -- cgit v0.12 From 360d3c70fd4f29a800982c7b2cdbab761350cd16 Mon Sep 17 00:00:00 2001 From: Justin McPherson Date: Thu, 1 Oct 2009 16:19:22 +1000 Subject: Fix qwidget auto test failing to build on OSX/carbon. Reviewed-by: Sarah Smith --- tests/auto/qwidget/qwidget.pro | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/qwidget/qwidget.pro b/tests/auto/qwidget/qwidget.pro index def28f5..61db2ee 100644 --- a/tests/auto/qwidget/qwidget.pro +++ b/tests/auto/qwidget/qwidget.pro @@ -10,8 +10,8 @@ aix-g++*:QMAKE_CXXFLAGS+=-fpermissive CONFIG += x11inc mac { -LIBS += -framework Security -framework AppKit -OBJECTIVE_SOURCES += tst_qwidget_mac_helpers.mm + LIBS += -framework Security -framework AppKit -framework Carbon + OBJECTIVE_SOURCES += tst_qwidget_mac_helpers.mm } symbian { -- cgit v0.12 From 9341ac7d2f04d6f36b6b23b654e3cb3db42ed027 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Thu, 1 Oct 2009 16:36:05 +1000 Subject: Add unit tests for QGLShareRegister Reviewed-by: Sarah Smith --- src/opengl/qgl_p.h | 2 +- tests/auto/qgl/tst_qgl.cpp | 122 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 123 insertions(+), 1 deletion(-) diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index 2e8ac88..a113b0f 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -399,7 +399,7 @@ public: Q_DECLARE_OPERATORS_FOR_FLAGS(QGLExtensions::Extensions) -class QGLShareRegister +class Q_AUTOTEST_EXPORT QGLShareRegister { public: QGLShareRegister() {} diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp index 8027e9b..a49f543 100644 --- a/tests/auto/qgl/tst_qgl.cpp +++ b/tests/auto/qgl/tst_qgl.cpp @@ -54,6 +54,10 @@ #include #include +#ifdef QT_BUILD_INTERNAL +#include +#endif + //TESTED_CLASS= //TESTED_FILES= @@ -85,6 +89,7 @@ private slots: void replaceClipping(); void clipTest(); void destroyFBOAfterContext(); + void shareRegister(); }; tst_QGL::tst_QGL() @@ -1749,5 +1754,122 @@ void tst_QGL::destroyFBOAfterContext() delete fbo; } +void tst_QGL::shareRegister() +{ +#ifdef QT_BUILD_INTERNAL + QGLShareRegister *shareReg = qgl_share_reg(); + QVERIFY(shareReg != 0); + + // Create a context. + QGLWidget *glw1 = new QGLWidget(); + glw1->makeCurrent(); + + // Nothing should be sharing with glw1's context yet. + QList list; + list = shareReg->shares(glw1->context()); + QCOMPARE(list.size(), 0); + + // Create a guard for the first context. + QGLSharedResourceGuard guard(glw1->context()); + QVERIFY(guard.id() == 0); + guard.setId(3); + QVERIFY(guard.id() == 3); + + // Create another context that shares with the first. + QGLWidget *glw2 = new QGLWidget(0, glw1); + if (!glw2->isSharing()) { + delete glw2; + delete glw1; + QSKIP("Context sharing is not supported", SkipSingle); + } + QVERIFY(glw1->context() != glw2->context()); + + // Guard should still be the same. + QVERIFY(guard.context() == glw1->context()); + QVERIFY(guard.id() == 3); + + // Now there are two items in the share lists. + list = shareReg->shares(glw1->context()); + QCOMPARE(list.size(), 2); + QVERIFY(list.contains(glw1->context())); + QVERIFY(list.contains(glw2->context())); + list = shareReg->shares(glw2->context()); + QCOMPARE(list.size(), 2); + QVERIFY(list.contains(glw1->context())); + QVERIFY(list.contains(glw2->context())); + + // Check the sharing relationships. + QVERIFY(shareReg->checkSharing(glw1->context(), glw1->context())); + QVERIFY(shareReg->checkSharing(glw2->context(), glw2->context())); + QVERIFY(shareReg->checkSharing(glw1->context(), glw2->context())); + QVERIFY(shareReg->checkSharing(glw2->context(), glw1->context())); + QVERIFY(!shareReg->checkSharing(0, glw2->context())); + QVERIFY(!shareReg->checkSharing(glw1->context(), 0)); + QVERIFY(!shareReg->checkSharing(0, 0)); + + // Create a third context, not sharing with the others. + QGLWidget *glw3 = new QGLWidget(); + + // Create a guard on the standalone context. + QGLSharedResourceGuard guard3(glw3->context()); + guard3.setId(5); + + // First two should still be sharing, but third is in its own list. + list = shareReg->shares(glw1->context()); + QCOMPARE(list.size(), 2); + QVERIFY(list.contains(glw1->context())); + QVERIFY(list.contains(glw2->context())); + list = shareReg->shares(glw2->context()); + QCOMPARE(list.size(), 2); + QVERIFY(list.contains(glw1->context())); + QVERIFY(list.contains(glw2->context())); + list = shareReg->shares(glw3->context()); + QCOMPARE(list.size(), 0); + + // Check the sharing relationships again. + QVERIFY(shareReg->checkSharing(glw1->context(), glw1->context())); + QVERIFY(shareReg->checkSharing(glw2->context(), glw2->context())); + QVERIFY(shareReg->checkSharing(glw1->context(), glw2->context())); + QVERIFY(shareReg->checkSharing(glw2->context(), glw1->context())); + QVERIFY(!shareReg->checkSharing(glw1->context(), glw3->context())); + QVERIFY(!shareReg->checkSharing(glw2->context(), glw3->context())); + QVERIFY(!shareReg->checkSharing(glw3->context(), glw1->context())); + QVERIFY(!shareReg->checkSharing(glw3->context(), glw2->context())); + QVERIFY(shareReg->checkSharing(glw3->context(), glw3->context())); + QVERIFY(!shareReg->checkSharing(0, glw2->context())); + QVERIFY(!shareReg->checkSharing(glw1->context(), 0)); + QVERIFY(!shareReg->checkSharing(0, glw3->context())); + QVERIFY(!shareReg->checkSharing(glw3->context(), 0)); + QVERIFY(!shareReg->checkSharing(0, 0)); + + // Shared guard should still be the same. + QVERIFY(guard.context() == glw1->context()); + QVERIFY(guard.id() == 3); + + // Delete the first context. + delete glw1; + + // Shared guard should now be the second context, with the id the same. + QVERIFY(guard.context() == glw2->context()); + QVERIFY(guard.id() == 3); + QVERIFY(guard3.context() == glw3->context()); + QVERIFY(guard3.id() == 5); + + // Re-check the share list for the second context (should be empty now). + list = shareReg->shares(glw2->context()); + QCOMPARE(list.size(), 0); + + // Clean up. + delete glw2; + delete glw3; + + // Guards should now be null and the id zero. + QVERIFY(guard.context() == 0); + QVERIFY(guard.id() == 0); + QVERIFY(guard3.context() == 0); + QVERIFY(guard3.id() == 0); +#endif +} + QTEST_MAIN(tst_QGL) #include "tst_qgl.moc" -- cgit v0.12 From f23ab31348bb6d3c6b7cb1ccf429ea932824e4e4 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Thu, 1 Oct 2009 16:39:05 +1000 Subject: Compile fix for pbuffers under Linux Reviewed-by: Sarah Smith --- examples/opengl/pbuffers/cube.h | 2 +- examples/opengl/pbuffers/glwidget.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/opengl/pbuffers/cube.h b/examples/opengl/pbuffers/cube.h index 4f29b7d..1974f4f 100644 --- a/examples/opengl/pbuffers/cube.h +++ b/examples/opengl/pbuffers/cube.h @@ -42,7 +42,7 @@ #ifndef CUBE_H #define CUBE_H -#include +#include #include #include #include diff --git a/examples/opengl/pbuffers/glwidget.h b/examples/opengl/pbuffers/glwidget.h index 991e8b9..c019abe 100644 --- a/examples/opengl/pbuffers/glwidget.h +++ b/examples/opengl/pbuffers/glwidget.h @@ -47,6 +47,7 @@ class Geometry; class Cube; class Tile; +class QGLPixelBuffer; class GLWidget : public QGLWidget { -- cgit v0.12 From a2376870b03d694bcc5b614c8f949e497a11b95c Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 1 Oct 2009 10:27:18 +0300 Subject: Made qpluginbase.pri include properly relative to s60pluginbase.pri Previously, include was relative to each version plugin's .pro file. Reviewed-by: axis --- src/plugins/s60/s60pluginbase.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/s60/s60pluginbase.pri b/src/plugins/s60/s60pluginbase.pri index 29e8eb3..c1aa4ef 100644 --- a/src/plugins/s60/s60pluginbase.pri +++ b/src/plugins/s60/s60pluginbase.pri @@ -1,6 +1,6 @@ # Note: These version based 'plugins' are not an actual Qt plugins, # they are just regular runtime loaded libraries -include(../../qpluginbase.pri) +include(../qpluginbase.pri) CONFIG -= plugin -- cgit v0.12 From 871bdaff6d7ae05571830ae87d9de6ef4e2cdb9f Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Thu, 1 Oct 2009 17:52:09 +1000 Subject: QGLContext::areSharing() to check for GL share relationships Reviewed-by: Samuel --- src/opengl/qgl.cpp | 21 +++++++++++++------ src/opengl/qgl.h | 2 ++ src/opengl/qgl_p.h | 5 ++--- src/opengl/qglshaderprogram.cpp | 8 ++++---- src/opengl/qpaintengine_opengl.cpp | 10 ++++----- src/opengl/qpixmapdata_gl.cpp | 2 +- tests/auto/qgl/tst_qgl.cpp | 42 +++++++++++++++++++------------------- 7 files changed, 50 insertions(+), 40 deletions(-) diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 1276443..bfb004e 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -2254,7 +2254,7 @@ QGLTexture *QGLContextPrivate::textureCacheLookup(const qint64 key, GLenum targe Q_Q(QGLContext); QGLTexture *texture = QGLTextureCache::instance()->getTexture(key); if (texture && texture->target == target - && (texture->context == q || qgl_share_reg()->checkSharing(q, texture->context))) + && (texture->context == q || QGLContext::areSharing(q, texture->context))) { return texture; } @@ -2755,6 +2755,20 @@ void QGLContext::setDevice(QPaintDevice *pDev) */ /*! + Returns true if \a context1 and \a context2 are sharing their + GL resources such as textures, shader programs, etc; + otherwise returns false. + + \since 4.6 +*/ +bool QGLContext::areSharing(const QGLContext *context1, const QGLContext *context2) +{ + if (!context1 || !context2) + return false; + return context1->d_ptr->group == context2->d_ptr->group; +} + +/*! \fn bool QGLContext::deviceIsPixmap() const Returns true if the paint device of this context is a pixmap; @@ -4835,11 +4849,6 @@ Q_OPENGL_EXPORT const QString qt_gl_library_name() } #endif -bool QGLShareRegister::checkSharing(const QGLContext *context1, const QGLContext *context2) { - bool sharing = (context1 && context2 && context1->d_ptr->group == context2->d_ptr->group); - return sharing; -} - void QGLShareRegister::addShare(const QGLContext *context, const QGLContext *share) { Q_ASSERT(context && share); if (context->d_ptr->group == share->d_ptr->group) diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index 1776004..b1c1317 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -282,6 +282,8 @@ public: bool isSharing() const; void reset(); + static bool areSharing(const QGLContext *context1, const QGLContext *context2); + QGLFormat format() const; QGLFormat requestedFormat() const; void setFormat(const QGLFormat& format); diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index a113b0f..9b09c7c 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -405,7 +405,6 @@ public: QGLShareRegister() {} ~QGLShareRegister() { reg.clear(); } - bool checkSharing(const QGLContext *context1, const QGLContext *context2); void addShare(const QGLContext *context, const QGLContext *share); QList shares(const QGLContext *context); void removeShare(const QGLContext *context); @@ -436,7 +435,7 @@ public: QGLContext *current = const_cast(QGLContext::currentContext()); QGLContext *ctx = const_cast(context); Q_ASSERT(ctx); - bool switch_context = current != ctx && !qgl_share_reg()->checkSharing(current, ctx); + bool switch_context = current != ctx && !QGLContext::areSharing(current, ctx); if (switch_context) ctx->makeCurrent(); #if defined(Q_WS_X11) @@ -547,7 +546,7 @@ public: : m_oldContext(0) { QGLContext *currentContext = const_cast(QGLContext::currentContext()); - if (currentContext != ctx && !qgl_share_reg()->checkSharing(ctx, currentContext)) { + if (currentContext != ctx && !QGLContext::areSharing(ctx, currentContext)) { m_oldContext = currentContext; m_ctx = const_cast(ctx); m_ctx->makeCurrent(); diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp index ebcd723..dfa6c40 100644 --- a/src/opengl/qglshaderprogram.cpp +++ b/src/opengl/qglshaderprogram.cpp @@ -349,7 +349,7 @@ QGLShader::QGLShader(QGLShader::ShaderType type, const QGLContext *context, QObj context = QGLContext::currentContext(); d = new QGLShaderPrivate(context, type); #ifndef QT_NO_DEBUG - if (context && !qgl_share_reg()->checkSharing(context, QGLContext::currentContext())) { + if (context && !QGLContext::areSharing(context, QGLContext::currentContext())) { qWarning("QGLShader::QGLShader: \'context\' must be the currect context or sharing with it."); return; } @@ -374,7 +374,7 @@ QGLShader::QGLShader context = QGLContext::currentContext(); d = new QGLShaderPrivate(context, type); #ifndef QT_NO_DEBUG - if (context && !qgl_share_reg()->checkSharing(context, QGLContext::currentContext())) { + if (context && !QGLContext::areSharing(context, QGLContext::currentContext())) { qWarning("QGLShader::QGLShader: \'context\' must be currect context or sharing with it."); return; } @@ -806,8 +806,8 @@ bool QGLShaderProgram::addShader(QGLShader *shader) if (d->shaders.contains(shader)) return true; // Already added to this shader program. if (d->programGuard.id() && shader) { - if (!qgl_share_reg()->checkSharing(shader->d->shaderGuard.context(), - d->programGuard.context())) { + if (!QGLContext::areSharing(shader->d->shaderGuard.context(), + d->programGuard.context())) { qWarning("QGLShaderProgram::addShader: Program and shader are not associated with same context."); return false; } diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp index a904064..da490c0 100644 --- a/src/opengl/qpaintengine_opengl.cpp +++ b/src/opengl/qpaintengine_opengl.cpp @@ -338,7 +338,7 @@ void QGLOffscreen::initialize() int dim = qMax(2048, static_cast(qt_next_power_of_two(qMax(device->size().width(), device->size().height())))); - bool shared_context = qgl_share_reg()->checkSharing(device->context(), ctx); + bool shared_context = QGLContext::areSharing(device->context(), ctx); bool would_fail = last_failed_size.isValid() && (device->size().width() >= last_failed_size.width() || device->size().height() >= last_failed_size.height()); @@ -555,7 +555,7 @@ public: QList contexts = programs.uniqueKeys(); for (int i=0; icheckSharing(cx, ctx)) { + if (cx != ctx && QGLContext::areSharing(cx, ctx)) { QList progs = programs.values(cx); for (int k=0; kcheckSharing(buffer_ctx, ctx)) + if (buffer_ctx && !QGLContext::areSharing(buffer_ctx, ctx)) cleanCache(); buffer_ctx = ctx; @@ -1365,7 +1365,7 @@ bool QOpenGLPaintEngine::begin(QPaintDevice *pdev) #ifdef QT_OPENGL_ES d->max_texture_size = ctx->d_func()->maxTextureSize(); #else - bool shared_ctx = qgl_share_reg()->checkSharing(d->device->context(), d->shader_ctx); + bool shared_ctx = QGLContext::areSharing(d->device->context(), d->shader_ctx); if (shared_ctx) { d->max_texture_size = d->shader_ctx->d_func()->maxTextureSize(); @@ -4683,7 +4683,7 @@ void QGLGlyphCache::cacheGlyphs(QGLContext *context, const QTextItemInt &ti, QList contexts = qt_context_cache.keys(); for (int i=0; icheckSharing(context, ctx)) { + if (ctx != context && QGLContext::areSharing(context, ctx)) { context_key = ctx; dev_it = qt_context_cache.constFind(context_key); break; diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp index 2331c6d..1ee3bbf 100644 --- a/src/opengl/qpixmapdata_gl.cpp +++ b/src/opengl/qpixmapdata_gl.cpp @@ -248,7 +248,7 @@ bool QGLPixmapData::isValidContext(const QGLContext *ctx) const return true; const QGLContext *share_ctx = qt_gl_share_widget()->context(); - return ctx == share_ctx || qgl_share_reg()->checkSharing(ctx, share_ctx); + return ctx == share_ctx || QGLContext::areSharing(ctx, share_ctx); } void QGLPixmapData::resize(int width, int height) diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp index a49f543..f15b249 100644 --- a/tests/auto/qgl/tst_qgl.cpp +++ b/tests/auto/qgl/tst_qgl.cpp @@ -1799,13 +1799,13 @@ void tst_QGL::shareRegister() QVERIFY(list.contains(glw2->context())); // Check the sharing relationships. - QVERIFY(shareReg->checkSharing(glw1->context(), glw1->context())); - QVERIFY(shareReg->checkSharing(glw2->context(), glw2->context())); - QVERIFY(shareReg->checkSharing(glw1->context(), glw2->context())); - QVERIFY(shareReg->checkSharing(glw2->context(), glw1->context())); - QVERIFY(!shareReg->checkSharing(0, glw2->context())); - QVERIFY(!shareReg->checkSharing(glw1->context(), 0)); - QVERIFY(!shareReg->checkSharing(0, 0)); + QVERIFY(QGLContext::areSharing(glw1->context(), glw1->context())); + QVERIFY(QGLContext::areSharing(glw2->context(), glw2->context())); + QVERIFY(QGLContext::areSharing(glw1->context(), glw2->context())); + QVERIFY(QGLContext::areSharing(glw2->context(), glw1->context())); + QVERIFY(!QGLContext::areSharing(0, glw2->context())); + QVERIFY(!QGLContext::areSharing(glw1->context(), 0)); + QVERIFY(!QGLContext::areSharing(0, 0)); // Create a third context, not sharing with the others. QGLWidget *glw3 = new QGLWidget(); @@ -1827,20 +1827,20 @@ void tst_QGL::shareRegister() QCOMPARE(list.size(), 0); // Check the sharing relationships again. - QVERIFY(shareReg->checkSharing(glw1->context(), glw1->context())); - QVERIFY(shareReg->checkSharing(glw2->context(), glw2->context())); - QVERIFY(shareReg->checkSharing(glw1->context(), glw2->context())); - QVERIFY(shareReg->checkSharing(glw2->context(), glw1->context())); - QVERIFY(!shareReg->checkSharing(glw1->context(), glw3->context())); - QVERIFY(!shareReg->checkSharing(glw2->context(), glw3->context())); - QVERIFY(!shareReg->checkSharing(glw3->context(), glw1->context())); - QVERIFY(!shareReg->checkSharing(glw3->context(), glw2->context())); - QVERIFY(shareReg->checkSharing(glw3->context(), glw3->context())); - QVERIFY(!shareReg->checkSharing(0, glw2->context())); - QVERIFY(!shareReg->checkSharing(glw1->context(), 0)); - QVERIFY(!shareReg->checkSharing(0, glw3->context())); - QVERIFY(!shareReg->checkSharing(glw3->context(), 0)); - QVERIFY(!shareReg->checkSharing(0, 0)); + QVERIFY(QGLContext::areSharing(glw1->context(), glw1->context())); + QVERIFY(QGLContext::areSharing(glw2->context(), glw2->context())); + QVERIFY(QGLContext::areSharing(glw1->context(), glw2->context())); + QVERIFY(QGLContext::areSharing(glw2->context(), glw1->context())); + QVERIFY(!QGLContext::areSharing(glw1->context(), glw3->context())); + QVERIFY(!QGLContext::areSharing(glw2->context(), glw3->context())); + QVERIFY(!QGLContext::areSharing(glw3->context(), glw1->context())); + QVERIFY(!QGLContext::areSharing(glw3->context(), glw2->context())); + QVERIFY(QGLContext::areSharing(glw3->context(), glw3->context())); + QVERIFY(!QGLContext::areSharing(0, glw2->context())); + QVERIFY(!QGLContext::areSharing(glw1->context(), 0)); + QVERIFY(!QGLContext::areSharing(0, glw3->context())); + QVERIFY(!QGLContext::areSharing(glw3->context(), 0)); + QVERIFY(!QGLContext::areSharing(0, 0)); // Shared guard should still be the same. QVERIFY(guard.context() == glw1->context()); -- cgit v0.12 From 91b58202c089ea8f4e150717cee8dbc40b8f903c Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 1 Oct 2009 10:03:26 +0200 Subject: Stabilize tests on X11 --- tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp | 4 ++-- tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp | 3 ++- tests/auto/qmdiarea/tst_qmdiarea.cpp | 1 + tests/auto/qmdisubwindow/tst_qmdisubwindow.cpp | 1 + tests/auto/qmessagebox/tst_qmessagebox.cpp | 3 ++- tests/auto/qwidget/tst_qwidget.cpp | 2 +- 6 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp index 6e60516..00fae2f 100644 --- a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp +++ b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp @@ -1301,12 +1301,12 @@ void tst_QGraphicsProxyWidget::paintEvent() scene.addItem(&proxy); //make sure we flush all the paint events - QApplication::processEvents(); + QTest::qWait(70); QTRY_VERIFY(proxy.paintCount > 1); proxy.paintCount = 0; w->update(); - QApplication::processEvents(); + QTest::qWait(30); QTRY_COMPARE(proxy.paintCount, 1); //the widget should have been painted now } diff --git a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp index 864076f..90477f0 100644 --- a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp +++ b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp @@ -1357,8 +1357,9 @@ void tst_QGraphicsScene::removeItem() QVERIFY(!hoverItem->isHovered); { - QTest::mouseMove(view.viewport(), view.mapFromScene(hoverItem->scenePos()), Qt::NoButton); QTest::qWait(250); + QTest::mouseMove(view.viewport(), view.mapFromScene(hoverItem->scenePos()), Qt::NoButton); + QTest::qWait(10); QMouseEvent moveEvent(QEvent::MouseMove, view.mapFromScene(hoverItem->scenePos()), Qt::NoButton, 0, 0); QApplication::sendEvent(view.viewport(), &moveEvent); } diff --git a/tests/auto/qmdiarea/tst_qmdiarea.cpp b/tests/auto/qmdiarea/tst_qmdiarea.cpp index b110114..725c31e 100644 --- a/tests/auto/qmdiarea/tst_qmdiarea.cpp +++ b/tests/auto/qmdiarea/tst_qmdiarea.cpp @@ -468,6 +468,7 @@ void tst_QMdiArea::subWindowActivated2() #ifdef Q_WS_X11 qt_x11_wait_for_window_manager(&mdiArea); #endif + QTest::qWait(100); QTRY_COMPARE(spy.count(), 5); QCOMPARE(mdiArea.activeSubWindow(), mdiArea.subWindowList().back()); diff --git a/tests/auto/qmdisubwindow/tst_qmdisubwindow.cpp b/tests/auto/qmdisubwindow/tst_qmdisubwindow.cpp index b897d8f..2d70bef 100644 --- a/tests/auto/qmdisubwindow/tst_qmdisubwindow.cpp +++ b/tests/auto/qmdisubwindow/tst_qmdisubwindow.cpp @@ -1065,6 +1065,7 @@ void tst_QMdiSubWindow::setSystemMenu() qApp->setLayoutDirection(Qt::RightToLeft); qApp->processEvents(); mainWindow.updateGeometry(); + QTest::qWait(150); subWindow->showSystemMenu(); QTest::qWait(250); diff --git a/tests/auto/qmessagebox/tst_qmessagebox.cpp b/tests/auto/qmessagebox/tst_qmessagebox.cpp index 5607fbd..12858d7 100644 --- a/tests/auto/qmessagebox/tst_qmessagebox.cpp +++ b/tests/auto/qmessagebox/tst_qmessagebox.cpp @@ -714,7 +714,8 @@ void tst_QMessageBox::setInformativeText() msgbox.setInformativeText(itext); msgbox.show(); QCOMPARE(msgbox.informativeText(), itext); - QVERIFY(msgbox.width() > 200); //verify it's big enough (task181688) + QVERIFY2(msgbox.width() > 200, //verify it's big enough (task181688) + qPrintable(QString("%1 > 200").arg(msgbox.width()))); } void tst_QMessageBox::iconPixmap() diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index c08d601..94e67a4 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -8196,7 +8196,7 @@ void tst_QWidget::moveInResizeEvent() testWidget.setGeometry(50, 50, 200, 200); testWidget.show(); QTest::qWaitForWindowShown(&testWidget); - QTest::qWait(10); + QTest::qWait(120); QRect expectedGeometry(100,100, 100, 100); QTRY_COMPARE(testWidget.geometry(), expectedGeometry); -- cgit v0.12 From 790583dc16a89ed77954c096aae52bf9f91aec09 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Thu, 1 Oct 2009 09:21:02 +0200 Subject: Add support for modality to QGraphicsItem panels. This add QGraphicsItem::setPanelModality(), panelModality(), isBlockedByModalPanel() and the QGraphicsItem::PanelModality enum (enumerators are either SceneModal, PanelModal, or NonModal, which mirror Qt::ApplicationModal, Qt::WindowModal, and Qt::NonModal). Reviewed-by: ahanssen Squashed commit of the following: commit a980a1b9c2972c676f3a70e8577d4eace54a25b3 Author: Bradley T. Hughes Date: Wed Sep 30 14:42:01 2009 +0200 Fix tst_QGraphicsItem::modality_hover() test failures As pointed out by Andreas, QGraphicsScenePrivate::dispatchHoverEvent() already has all the logic needed to correctly dispatch the hover events when changing modality. All we need to do is store the last known mouse position, and call dispatchHoverEvent() when entering, changing, and leaving the modal state. commit ba41633c96ece8da3a8bbf9c7491c15b14f83f76 Author: Bradley T. Hughes Date: Wed Sep 30 14:40:59 2009 +0200 Fix tst_QGraphicsItem::mixedModality() failure When changing modality from SceneModal to PanelModal, we may need to send WindowUnblocked events in addition to the WindowBlocked events. commit d1076e315de10b1b2fb7617ebaee552c14e49c8b Author: Bradley T. Hughes Date: Wed Sep 30 14:33:21 2009 +0200 Update the expected events counts in tst_QGraphicsItem::modality_hover() HoverEnter and HoverMove always come in pairs, and should do so when entering or leaving modality as well. This means though that changing modality can cause spurious HoverMove events (as seen in this test). commit a29b098e4c391651ef61dd4714a66b22654e4628 Author: Bradley T. Hughes Date: Wed Sep 30 14:20:25 2009 +0200 Update tst_QGraphicsItem::mixedModality() to do more detailed checking The test looks for unwanted WindowBlocked/WindowUnblocked events now, making it easier to spot where the failure comes from. commit c1ae96126ed01d0e662bddf38ff161e50a804b1c Author: Bradley T. Hughes Date: Tue Sep 29 12:17:17 2009 +0200 Documentation for QGraphicsItem::PanelModality Document the behavior of the QGraphicsItem::NonModal, PanelModal, and SceneModal enumerators. Corrected a qdoc error in the isBlockedByModalPanel() documentation commit 02fec999e660180ff65bbbf79c8085e582879ed1 Author: Bradley T. Hughes Date: Thu Sep 17 10:31:44 2009 +0200 Add bool QGraphicsItem::isBlockedByModalPanel() This function can be used to figure out 1) if an item is modally shadowed and 2) which panel is blocking the item in question. This will make it possible to implement window-manager like behavior of activating/highlighting/animating modal panels when the user tries to interact with a blocked item (this will most likely need to be done by reimplementing QGraphicsScene::event()). commit eab9a975dcd71b68135325d479374108bd7f3b2a Author: Bradley T. Hughes Date: Wed Sep 16 14:38:55 2009 +0200 Block key events to the focus item if it is blocked by a modal panel. We don't want the event to propagate either, just stop propagating once we reach an item that is blocked. commit 038b61a10bb837b353f988cb0d1665dd53656cdb Author: Bradley T. Hughes Date: Tue Sep 15 12:40:27 2009 +0200 Add a test for click-to-focus behavior in the presence of modality Clicking on a widget should neither give it focus nor set it as the sub-focus item. commit 3bb3662556efe8d76af5a56e65b1df7a9f4b476a Author: Bradley T. Hughes Date: Tue Sep 8 09:08:42 2009 +0200 Newly blocked QGraphicsItem panels should lose implicit grabs when modality is enabled. If an item has an implicit grab when blocked by a modal panel, this grab is lost and no mouse events are sent until the mouse is released and re- commit 3be51be3da36e782a5a1f282c552064d5d490a71 Author: Bradley T. Hughes Date: Thu Sep 3 13:39:14 2009 +0200 Support changing modality from PanelModal to SceneModal or vice-versa Don't leave modality first, and then re-enter... this sends unnecessary events. commit bb0aea559ba01a8bbb03c0370a247ab902f561f5 Author: Bradley T. Hughes Date: Wed Sep 2 16:58:23 2009 +0200 Fix hover event delivery in the presence of modal panels Panels that are modally shadowed should not get hover events. When entering and leaving the modal state, GraphicsSceneHoverEnter and GraphicsSceneHoverLeave event should be send to the widgets that become or are no longer blocked. Auto-test included. commit cad00b1d9da19565e2d7ea2d30d37eb45005b5ae Author: Bradley T. Hughes Date: Wed Sep 2 10:45:20 2009 +0200 Fix tst_QGraphicsItem::modality_hover() test Don't send hover events to items that are modally shadowed. commit ae15df331901110e19eb2037f37ff7f84cd7cd16 Author: Bradley T. Hughes Date: Wed Sep 2 10:44:14 2009 +0200 Enable the ItemIsPanel flag in the modality_hover() test Otherwise the modality settings are ignored. commit 1580f43c8feabc3a2bf9c1450e1a8916e8940a4c Author: Andreas Aardal Hanssen Date: Fri Aug 28 15:20:37 2009 +0200 More work on QGraphicsItem::PanelModality. Added many tests. commit ed2064ad2ec8bc06d62cf1e931b973d5d92c0563 Author: Bradley T. Hughes Date: Thu Aug 27 13:45:11 2009 +0200 Add support for modality to QGraphicsItem panels. This add QGraphicsItem::setPanelModality() and the QGraphicsItem::PanelModality enum (enumerators are either SceneModal, PanelModal, or NonModal, which mirror Qt::ApplicationModal, Qt::WindowModal, and Qt::NonModal). Reviewed-by: ahanssen --- src/gui/graphicsview/qgraphicsitem.cpp | 139 +++- src/gui/graphicsview/qgraphicsitem.h | 11 + src/gui/graphicsview/qgraphicsitem_p.h | 2 + src/gui/graphicsview/qgraphicsscene.cpp | 164 +++- src/gui/graphicsview/qgraphicsscene_p.h | 6 + tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 1017 +++++++++++++++++++++++- 6 files changed, 1314 insertions(+), 25 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index d7a7bd2..bc9c73f 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -564,6 +564,21 @@ supportsExtension() and setExtension(). */ +/*! + \enum QGraphicsItem::PanelModality + + This enum specifies the behavior of a modal panel. A modal panel + is one that blocks input to other panels. Note that items that + are children of a modal panel are not blocked. + + The values are: + \value NonModal The panel is not modal and does not block input to other panels. + \value PanelModal The panel is modal to a single item hierarchy and blocks input to its parent pane, all grandparent panels, and all siblings of its parent and grandparent panels. + \value SceneModal The window is modal to the entire scene and blocks input to all panels. + + \sa QGraphicsItem::setPanelModality(), QGraphicsItem::panelModality(), QGraphicsItem::ItemIsPanel +*/ + #include "qgraphicsitem.h" #ifndef QT_NO_GRAPHICSVIEW @@ -1649,6 +1664,16 @@ void QGraphicsItem::setFlags(GraphicsItemFlags flags) setFlag(ItemStacksBehindParent, d_ptr->z < qreal(0.0)); } + if ((d_ptr->panelModality != NonModal) + && d_ptr->scene + && (flags & ItemIsPanel) != (oldFlags & ItemIsPanel)) { + // update the panel's modal state + if (flags & ItemIsPanel) + d_ptr->scene->d_func()->enterModal(this); + else + d_ptr->scene->d_func()->leaveModal(this); + } + if (d_ptr->scene) { d_ptr->scene->d_func()->markDirty(this, QRectF(), /*invalidateChildren=*/true, @@ -1725,6 +1750,87 @@ void QGraphicsItem::setCacheMode(CacheMode mode, const QSize &logicalCacheSize) update(); } +/*! + \since 4.6 + + Returns the modality for this item. +*/ +QGraphicsItem::PanelModality QGraphicsItem::panelModality() const +{ + return d_ptr->panelModality; +} + +/*! + \since 4.6 + + Sets the modality for this item to \a panelModality. + + Changing the modality of a visible item takes effect immediately. +*/ +void QGraphicsItem::setPanelModality(PanelModality panelModality) +{ + if (d_ptr->panelModality == panelModality) + return; + + PanelModality previousModality = d_ptr->panelModality; + bool enterLeaveModal = (isPanel() && d_ptr->scene && isVisible()); + if (enterLeaveModal && panelModality == NonModal) + d_ptr->scene->d_func()->leaveModal(this); + d_ptr->panelModality = panelModality; + if (enterLeaveModal && d_ptr->panelModality != NonModal) + d_ptr->scene->d_func()->enterModal(this, previousModality); +} + +/*! + \since 4.6 + + Returns true if this item is blocked by a modal panel, false otherwise. If \a blockingPanel is + non-zero, \a blockingPanel will be set to the modal panel that is blocking this item. If this + item is not blocked, \a blockingPanel will not be set by this function. + + This function always returns false for items not in a scene. + + \sa panelModality() setPanelModality() PanelModality +*/ +bool QGraphicsItem::isBlockedByModalPanel(QGraphicsItem **blockingPanel) const +{ + if (!d_ptr->scene) + return false; + + + QGraphicsItem *dummy = 0; + if (!blockingPanel) + blockingPanel = &dummy; + + QGraphicsScenePrivate *scene_d = d_ptr->scene->d_func(); + if (scene_d->modalPanels.isEmpty()) + return false; + + // ### + if (!scene_d->popupWidgets.isEmpty() && scene_d->popupWidgets.first() == this) + return false; + + for (int i = 0; i < scene_d->modalPanels.count(); ++i) { + QGraphicsItem *modalPanel = scene_d->modalPanels.at(i); + if (modalPanel->panelModality() == QGraphicsItem::SceneModal) { + // Scene modal panels block all non-descendents. + if (modalPanel != this && !modalPanel->isAncestorOf(this)) { + *blockingPanel = modalPanel; + return true; + } + } else { + // Window modal panels block ancestors and siblings/cousins. + if (modalPanel != this + && !modalPanel->isAncestorOf(this) + && commonAncestorItem(modalPanel)) { + *blockingPanel = modalPanel; + return true; + } + } + } + return false; +} + #ifndef QT_NO_TOOLTIP /*! Returns the item's tool tip, or an empty QString if no tool tip has been @@ -1934,6 +2040,8 @@ void QGraphicsItemPrivate::setVisibleHelper(bool newVisible, bool explicitly, bo q->ungrabMouse(); if (scene->d_func()->keyboardGrabberItems.contains(q)) q->ungrabKeyboard(); + if (q->isPanel() && panelModality != QGraphicsItem::NonModal) + scene->d_func()->leaveModal(q_ptr); } if (q_ptr->hasFocus() && scene) { // Hiding the closest non-panel ancestor of the focus item @@ -1955,10 +2063,15 @@ void QGraphicsItemPrivate::setVisibleHelper(bool newVisible, bool explicitly, bo } else { geometryChanged = 1; paintedViewBoundingRectsNeedRepaint = 1; - if (isWidget && scene) { - QGraphicsWidget *widget = static_cast(q_ptr); - if (widget->windowType() == Qt::Popup) - scene->d_func()->addPopup(widget); + if (scene) { + if (isWidget) { + QGraphicsWidget *widget = static_cast(q_ptr); + if (widget->windowType() == Qt::Popup) + scene->d_func()->addPopup(widget); + } + if (q->isPanel() && panelModality != QGraphicsItem::NonModal) { + scene->d_func()->enterModal(q_ptr); + } } } @@ -2781,7 +2894,7 @@ bool QGraphicsItem::hasFocus() const the preferred focus item for its subtree of items, should it later become visible. - As a result of calling this function, this item will receive a + As a result of calling this function, this item will receive a \l{focusInEvent()}{focus in event} with \a focusReason. If another item already has focus, that item will first receive a \l{focusOutEvent()} {focus out event} indicating that it has lost input focus. @@ -3299,7 +3412,7 @@ QMatrix QGraphicsItem::matrix() const The transformation matrix is combined with the item's rotation(), scale() and transformations() into a combined transformations for the item. - + The default transformation matrix is an identity matrix. \sa setTransform(), sceneTransform() @@ -3780,7 +3893,7 @@ void QGraphicsItem::setMatrix(const QMatrix &matrix, bool combine) // Update and set the new transformation. d_ptr->setTransformHelper(newTransform); - + // Send post-notification. itemChange(ItemTransformHasChanged, qVariantFromValue(newTransform)); } @@ -3914,7 +4027,7 @@ void QGraphicsItem::scale(qreal sx, qreal sy) /*! \obsolete - Use + Use \code setTransform(QTransform().shear(sh, sv), true); @@ -3936,7 +4049,7 @@ void QGraphicsItem::shear(qreal sh, qreal sv) Use setPos() or setTransformOriginPoint() instead. For identical behavior, use - + \code setTransform(QTransform::fromTranslate(dx, dy), true); \endcode @@ -4446,7 +4559,7 @@ bool QGraphicsItem::collidesWithItem(const QGraphicsItem *other, Qt::ItemSelecti Note that this function checks whether the item's shape or bounding rectangle (depending on \a mode) is contained within \a path, and not whether \a path is contained within the items shape - or bounding rectangle. + or bounding rectangle. \sa collidesWithItem(), contains(), shape() */ @@ -6595,7 +6708,7 @@ void QGraphicsItem::mousePressEvent(QGraphicsSceneMouseEvent *event) if (d_ptr->isWidget) { // Qt::Popup closes when you click outside. QGraphicsWidget *w = static_cast(this); - if (w->windowFlags() & Qt::Popup) { + if ((w->windowFlags() & Qt::Popup) == Qt::Popup) { event->accept(); if (!w->rect().contains(event->pos())) w->close(); @@ -7020,7 +7133,7 @@ void QGraphicsItem::prepareGeometryChange() // if someone is connected to the changed signal or the scene has no views. // Note that this has to be done *after* markDirty to ensure that // _q_processDirtyItems is called before _q_emitUpdated. - if (scenePrivate->isSignalConnected(scenePrivate->changedSignalIndex) + if (scenePrivate->isSignalConnected(scenePrivate->changedSignalIndex) || scenePrivate->views.isEmpty()) { if (d_ptr->hasTranslateOnlySceneTransform()) { d_ptr->scene->update(boundingRect().translated(d_ptr->sceneTransform.dx(), @@ -10524,7 +10637,7 @@ QPixmap QGraphicsItemEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QP effectRect.setRight(deviceWidth - 1); if (bottom + 1 > deviceHeight) effectRect.setBottom(deviceHeight -1); - + } if (effectRect.isEmpty()) diff --git a/src/gui/graphicsview/qgraphicsitem.h b/src/gui/graphicsview/qgraphicsitem.h index 99d2e12..e6e324a 100644 --- a/src/gui/graphicsview/qgraphicsitem.h +++ b/src/gui/graphicsview/qgraphicsitem.h @@ -146,6 +146,13 @@ public: DeviceCoordinateCache }; + enum PanelModality + { + NonModal, + PanelModal, + SceneModal + }; + QGraphicsItem(QGraphicsItem *parent = 0 #ifndef Q_QDOC // ### obsolete argument @@ -183,6 +190,10 @@ public: CacheMode cacheMode() const; void setCacheMode(CacheMode mode, const QSize &cacheSize = QSize()); + PanelModality panelModality() const; + void setPanelModality(PanelModality panelModality); + bool isBlockedByModalPanel(QGraphicsItem **blockingPanel = 0) const; + #ifndef QT_NO_TOOLTIP QString toolTip() const; void setToolTip(const QString &toolTip); diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h index 3feccdc..51bfea1 100644 --- a/src/gui/graphicsview/qgraphicsitem_p.h +++ b/src/gui/graphicsview/qgraphicsitem_p.h @@ -131,6 +131,7 @@ public: subFocusItem(0), focusScopeItem(0), imHints(Qt::ImhNone), + panelModality(QGraphicsItem::NonModal), acceptedMouseButtons(0x1f), visible(1), explicitlyHidden(0), @@ -448,6 +449,7 @@ public: QGraphicsItem *subFocusItem; QGraphicsItem *focusScopeItem; Qt::InputMethodHints imHints; + QGraphicsItem::PanelModality panelModality; // Packed 32 bits quint32 acceptedMouseButtons : 5; diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 4b74b67..0acef0b 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -565,6 +565,9 @@ void QGraphicsScenePrivate::removeItemHelper(QGraphicsItem *item) q->removeItem(item->d_ptr->children.at(i)); } + if (item->isPanel() && item->isVisible() && item->panelModality() != QGraphicsItem::NonModal) + leaveModal(item); + // Reset the mouse grabber and focus item data. if (mouseGrabberItems.contains(item)) ungrabMouse(item, /* item is dying */ item->d_ptr->inDestructor); @@ -1111,6 +1114,9 @@ void QGraphicsScenePrivate::sendMouseEvent(QGraphicsSceneMouseEvent *mouseEvent) } QGraphicsItem *item = mouseGrabberItems.last(); + if (item->isBlockedByModalPanel()) + return; + for (int i = 0x1; i <= 0x10; i <<= 1) { Qt::MouseButton button = Qt::MouseButton(i); mouseEvent->setButtonDownPos(button, mouseGrabberButtonDownPos.value(button, item->d_ptr->genericMapFromScene(mouseEvent->scenePos(), mouseEvent->widget()))); @@ -1134,6 +1140,8 @@ void QGraphicsScenePrivate::mousePressEventHandler(QGraphicsSceneMouseEvent *mou // Deliver to any existing mouse grabber. if (!mouseGrabberItems.isEmpty()) { + if (mouseGrabberItems.last()->isBlockedByModalPanel()) + return; // The event is ignored by default, but we disregard the event's // accepted state after delivery; the mouse is grabbed, after all. sendMouseEvent(mouseEvent); @@ -1151,12 +1159,22 @@ void QGraphicsScenePrivate::mousePressEventHandler(QGraphicsSceneMouseEvent *mou // Update window activation. QGraphicsItem *topItem = cachedItemsUnderMouse.value(0); QGraphicsWidget *newActiveWindow = topItem ? topItem->window() : 0; + if (newActiveWindow && newActiveWindow->isBlockedByModalPanel(&topItem)) { + // pass activation to the blocking modal window + newActiveWindow = topItem ? topItem->window() : 0; + } + if (newActiveWindow != q->activeWindow()) q->setActiveWindow(newActiveWindow); // Set focus on the topmost enabled item that can take focus. bool setFocus = false; foreach (QGraphicsItem *item, cachedItemsUnderMouse) { + if (item->isBlockedByModalPanel()) { + // Make sure we don't clear focus. + setFocus = true; + break; + } if (item->isEnabled() && ((item->flags() & QGraphicsItem::ItemIsFocusable) && item->d_ptr->mouseSetsFocus)) { if (!item->isWidget() || ((QGraphicsWidget *)item)->focusPolicy() & Qt::ClickFocus) { setFocus = true; @@ -1165,12 +1183,27 @@ void QGraphicsScenePrivate::mousePressEventHandler(QGraphicsSceneMouseEvent *mou break; } } + if (item->isPanel()) + break; + } + + // Check for scene modality. + bool sceneModality = false; + for (int i = 0; i < modalPanels.size(); ++i) { + if (modalPanels.at(i)->panelModality() == QGraphicsItem::SceneModal) { + sceneModality = true; + break; + } } // If nobody could take focus, clear it. - if (!stickyFocus && !setFocus) + if (!stickyFocus && !setFocus && !sceneModality) q->setFocusItem(0, Qt::MouseFocusReason); + // Any item will do. + if (sceneModality && cachedItemsUnderMouse.isEmpty()) + cachedItemsUnderMouse << modalPanels.first(); + // Find a mouse grabber by sending mouse press events to all mouse grabber // candidates one at a time, until the event is accepted. It's accepted by // default, so the receiver has to explicitly ignore it for it to pass @@ -1181,6 +1214,10 @@ void QGraphicsScenePrivate::mousePressEventHandler(QGraphicsSceneMouseEvent *mou continue; } + // Check if this item is blocked by a modal panel and deliver the mouse event to the + // blocking panel instead of this item if blocked. + (void) item->isBlockedByModalPanel(&item); + grabMouse(item, /* implicit = */ true); mouseEvent->accept(); @@ -2403,6 +2440,8 @@ void QGraphicsScene::addItem(QGraphicsItem *item) d->selectedItems << item; if (item->isWidget() && item->isVisible() && static_cast(item)->windowType() == Qt::Popup) d->addPopup(static_cast(item)); + if (item->isPanel() && item->isVisible() && item->panelModality() != QGraphicsItem::NonModal) + d->enterModal(item); // Update creation order focus chain. Make sure to leave the widget's // internal tab order intact. @@ -3205,8 +3244,12 @@ bool QGraphicsScene::event(QEvent *event) } return false; case QEvent::GraphicsSceneMouseMove: - mouseMoveEvent(static_cast(event)); + { + QGraphicsSceneMouseEvent *mouseEvent = static_cast(event); + d->lastSceneMousePos = mouseEvent->scenePos(); + mouseMoveEvent(mouseEvent); break; + } case QEvent::GraphicsSceneMousePress: mousePressEvent(static_cast(event)); break; @@ -3228,8 +3271,12 @@ bool QGraphicsScene::event(QEvent *event) case QEvent::GraphicsSceneHoverEnter: case QEvent::GraphicsSceneHoverLeave: case QEvent::GraphicsSceneHoverMove: - d->dispatchHoverEvent(static_cast(event)); + { + QGraphicsSceneHoverEvent *hoverEvent = static_cast(event); + d->lastSceneMousePos = hoverEvent->scenePos(); + d->dispatchHoverEvent(hoverEvent); break; + } case QEvent::Leave: d->leaveScene(); break; @@ -3599,8 +3646,10 @@ void QGraphicsScene::helpEvent(QGraphicsSceneHelpEvent *helpEvent) bool QGraphicsScenePrivate::itemAcceptsHoverEvents_helper(const QGraphicsItem *item) const { - return item->acceptHoverEvents() - || (item->isWidget() && static_cast(item)->d_func()->hasDecoration()); + return (!item->isBlockedByModalPanel() && + (item->acceptHoverEvents() + || (item->isWidget() + && static_cast(item)->d_func()->hasDecoration()))); } /*! @@ -3674,7 +3723,9 @@ bool QGraphicsScenePrivate::dispatchHoverEvent(QGraphicsSceneHoverEvent *hoverEv } // Generate a move event for the item itself - if (item && !hoverItems.isEmpty() && item == hoverItems.last()) { + if (item + && !hoverItems.isEmpty() + && item == hoverItems.last()) { sendHoverEvent(QEvent::GraphicsSceneHoverMove, item, hoverEvent); return true; } @@ -3708,8 +3759,7 @@ void QGraphicsScenePrivate::leaveScene() while (!hoverItems.isEmpty()) { QGraphicsItem *lastItem = hoverItems.takeLast(); - if (lastItem->acceptHoverEvents() - || (lastItem->isWidget() && static_cast(lastItem)->d_func()->hasDecoration())) + if (itemAcceptsHoverEvents_helper(lastItem)) sendHoverEvent(QEvent::GraphicsSceneHoverLeave, lastItem, &hoverEvent); } } @@ -3736,6 +3786,8 @@ void QGraphicsScene::keyPressEvent(QKeyEvent *keyEvent) keyEvent->accept(); // Send it; QGraphicsItem::keyPressEvent ignores it. If the event // is filtered out, stop propagating it. + if (p->isBlockedByModalPanel()) + break; if (!d->sendEvent(p, keyEvent)) break; } while (!keyEvent->isAccepted() && !p->isPanel() && (p = p->parentItem())); @@ -3766,6 +3818,8 @@ void QGraphicsScene::keyReleaseEvent(QKeyEvent *keyEvent) keyEvent->accept(); // Send it; QGraphicsItem::keyPressEvent ignores it. If the event // is filtered out, stop propagating it. + if (p->isBlockedByModalPanel()) + break; if (!d->sendEvent(p, keyEvent)) break; } while (!keyEvent->isAccepted() && !p->isPanel() && (p = p->parentItem())); @@ -5420,6 +5474,8 @@ void QGraphicsScenePrivate::touchEventHandler(QTouchEvent *sceneTouchEvent) for (; it != end; ++it) { QGraphicsItem *item = it.key(); + (void) item->isBlockedByModalPanel(&item); + // determine event type from the state mask QEvent::Type eventType; switch (it.value().first) { @@ -5493,6 +5549,8 @@ bool QGraphicsScenePrivate::sendTouchBeginEvent(QGraphicsItem *origin, QTouchEve break; } } + if (item->isPanel()) + break; } // If nobody could take focus, clear it. @@ -5518,6 +5576,8 @@ bool QGraphicsScenePrivate::sendTouchBeginEvent(QGraphicsItem *origin, QTouchEve } break; } + if (item->isPanel()) + break; } touchEvent->setAccepted(eventAccepted); @@ -5536,6 +5596,94 @@ void QGraphicsScenePrivate::updateInputMethodSensitivityInViews() views.at(i)->d_func()->updateInputMethodSensitivity(); } +void QGraphicsScenePrivate::enterModal(QGraphicsItem *panel, QGraphicsItem::PanelModality previousModality) +{ + Q_Q(QGraphicsScene); + Q_ASSERT(panel && panel->isPanel()); + + QGraphicsItem::PanelModality panelModality = panel->d_ptr->panelModality; + if (previousModality != QGraphicsItem::NonModal) { + // the panel is changing from one modality type to another... temporarily set it back so + // that blockedPanels is populated correctly + panel->d_ptr->panelModality = previousModality; + } + + QSet blockedPanels; + QList items = q->items(); // ### store panels separately + for (int i = 0; i < items.count(); ++i) { + QGraphicsItem *item = items.at(i); + if (item->isPanel() && item->isBlockedByModalPanel()) + blockedPanels.insert(item); + } + // blockedPanels contains all currently blocked panels + + if (previousModality != QGraphicsItem::NonModal) { + // reset the modality to the proper value, since we changed it above + panel->d_ptr->panelModality = panelModality; + // remove this panel so that it will be reinserted at the front of the stack + modalPanels.removeAll(panel); + } + + modalPanels.prepend(panel); + + if (!hoverItems.isEmpty()) { + // send GraphicsSceneHoverLeave events to newly blocked hoverItems + QGraphicsSceneHoverEvent hoverEvent; + hoverEvent.setScenePos(lastSceneMousePos); + dispatchHoverEvent(&hoverEvent); + } + + if (!mouseGrabberItems.isEmpty() && lastMouseGrabberItemHasImplicitMouseGrab) { + QGraphicsItem *item = mouseGrabberItems.last(); + if (item->isBlockedByModalPanel()) + ungrabMouse(item, /*itemIsDying =*/ false); + } + + QEvent windowBlockedEvent(QEvent::WindowBlocked); + QEvent windowUnblockedEvent(QEvent::WindowUnblocked); + for (int i = 0; i < items.count(); ++i) { + QGraphicsItem *item = items.at(i); + if (item->isPanel()) { + if (!blockedPanels.contains(item) && item->isBlockedByModalPanel()) { + // send QEvent::WindowBlocked to newly blocked panels + sendEvent(item, &windowBlockedEvent); + } else if (blockedPanels.contains(item) && !item->isBlockedByModalPanel()) { + // send QEvent::WindowUnblocked to unblocked panels when downgrading + // a panel from SceneModal to PanelModal + sendEvent(item, &windowUnblockedEvent); + } + } + } +} + +void QGraphicsScenePrivate::leaveModal(QGraphicsItem *panel) +{ + Q_Q(QGraphicsScene); + Q_ASSERT(panel && panel->isPanel()); + + QSet blockedPanels; + QList items = q->items(); // ### same as above + for (int i = 0; i < items.count(); ++i) { + QGraphicsItem *item = items.at(i); + if (item->isPanel() && item->isBlockedByModalPanel()) + blockedPanels.insert(item); + } + + modalPanels.removeAll(panel); + + QEvent e(QEvent::WindowUnblocked); + for (int i = 0; i < items.count(); ++i) { + QGraphicsItem *item = items.at(i); + if (item->isPanel() && blockedPanels.contains(item) && !item->isBlockedByModalPanel()) + sendEvent(item, &e); + } + + // send GraphicsSceneHoverEnter events to newly unblocked items + QGraphicsSceneHoverEvent hoverEvent; + hoverEvent.setScenePos(lastSceneMousePos); + dispatchHoverEvent(&hoverEvent); +} + QT_END_NAMESPACE #include "moc_qgraphicsscene.cpp" diff --git a/src/gui/graphicsview/qgraphicsscene_p.h b/src/gui/graphicsview/qgraphicsscene_p.h index 46917ce..5000860 100644 --- a/src/gui/graphicsview/qgraphicsscene_p.h +++ b/src/gui/graphicsview/qgraphicsscene_p.h @@ -160,6 +160,7 @@ public: Qt::DropAction lastDropAction; QList cachedItemsUnderMouse; QList hoverItems; + QPointF lastSceneMousePos; bool allItemsIgnoreHoverEvents; bool allItemsUseDefaultCursor; void enableMouseTrackingOnViews(); @@ -282,6 +283,11 @@ public: void enableTouchEventsOnViews(); void updateInputMethodSensitivityInViews(); + + QList modalPanels; + void enterModal(QGraphicsItem *item, + QGraphicsItem::PanelModality panelModality = QGraphicsItem::NonModal); + void leaveModal(QGraphicsItem *item); }; // QRectF::intersects() returns false always if either the source or target diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index bbf19f2..20dc0a4 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -80,6 +80,57 @@ Q_DECLARE_METATYPE(QRectF) #define Q_CHECK_PAINTEVENTS #endif +static void sendMousePress(QGraphicsScene *scene, const QPointF &point, Qt::MouseButton button = Qt::LeftButton) +{ + QGraphicsSceneMouseEvent event(QEvent::GraphicsSceneMousePress); + event.setScenePos(point); + event.setButton(button); + event.setButtons(button); + QApplication::sendEvent(scene, &event); +} + +static void sendMouseMove(QGraphicsScene *scene, const QPointF &point, + Qt::MouseButton button = Qt::NoButton, Qt::MouseButtons buttons = 0) +{ + QGraphicsSceneMouseEvent event(QEvent::GraphicsSceneMouseMove); + event.setScenePos(point); + event.setButton(button); + event.setButtons(button); + QApplication::sendEvent(scene, &event); +} + +static void sendMouseRelease(QGraphicsScene *scene, const QPointF &point, Qt::MouseButton button = Qt::LeftButton) +{ + QGraphicsSceneMouseEvent event(QEvent::GraphicsSceneMouseRelease); + event.setScenePos(point); + event.setButton(button); + QApplication::sendEvent(scene, &event); +} + +static void sendMouseClick(QGraphicsScene *scene, const QPointF &point, Qt::MouseButton button = Qt::LeftButton) +{ + sendMousePress(scene, point, button); + sendMouseRelease(scene, point, button); +} + +static void sendKeyPress(QGraphicsScene *scene, Qt::Key key) +{ + QKeyEvent keyEvent(QEvent::KeyPress, key, Qt::NoModifier); + QApplication::sendEvent(scene, &keyEvent); +} + +static void sendKeyRelease(QGraphicsScene *scene, Qt::Key key) +{ + QKeyEvent keyEvent(QEvent::KeyRelease, key, Qt::NoModifier); + QApplication::sendEvent(scene, &keyEvent); +} + +static void sendKeyClick(QGraphicsScene *scene, Qt::Key key) +{ + sendKeyPress(scene, key); + sendKeyRelease(scene, key); +} + class EventSpy : public QGraphicsWidget { Q_OBJECT @@ -120,6 +171,39 @@ protected: QEvent::Type spied; }; +class EventSpy2 : public QGraphicsWidget +{ + Q_OBJECT +public: + EventSpy2(QObject *watched) + { + watched->installEventFilter(this); + } + + EventSpy2(QGraphicsScene *scene, QGraphicsItem *watched) + { + scene->addItem(this); + watched->installSceneEventFilter(this); + } + + QMap counts; + +protected: + bool eventFilter(QObject *watched, QEvent *event) + { + Q_UNUSED(watched); + ++counts[event->type()]; + return false; + } + + bool sceneEventFilter(QGraphicsItem *watched, QEvent *event) + { + Q_UNUSED(watched); + ++counts[event->type()]; + return false; + } +}; + class EventTester : public QGraphicsItem { public: @@ -296,6 +380,13 @@ private slots: void ensureDirtySceneTransform(); void focusScope(); void stackBefore(); + void sceneModality(); + void panelModality(); + void mixedModality(); + void modality_hover(); + void modality_mouseGrabber(); + void modality_clickFocus(); + void modality_keyEvents(); // task specific tests below me void task141694_textItemEnsureVisible(); @@ -4668,11 +4759,11 @@ public: { QGraphicsRectItem::paint(painter, option, widget); if (harakiri == 0) { - // delete unsupported since 4.5 - /* + // delete unsupported since 4.5 + /* dead = 1; - delete this; - */ + delete this; + */ } } @@ -8483,5 +8574,923 @@ void tst_QGraphicsItem::QTBUG_4233_updateCachedWithSceneRect() QCOMPARE(tester->repaints, 2); } +void tst_QGraphicsItem::sceneModality() +{ + // 1) Test mouse events (delivery/propagation/redirection) + // 2) Test hover events (incl. leave on block, enter on unblock) + // 3) Test cursor stuff (incl. unset on block, set on unblock) + // 4) Test clickfocus + // 5) Test grab/ungrab events (possibly ungrab on block, regrab on unblock) + // 6) ### modality for non-panels is unsupported for now + QGraphicsScene scene; + + QGraphicsRectItem *bottomItem = scene.addRect(-150, -100, 300, 200); + bottomItem->setFlag(QGraphicsItem::ItemIsFocusable); + bottomItem->setBrush(Qt::yellow); + + QGraphicsRectItem *leftParent = scene.addRect(-50, -50, 100, 100); + leftParent->setFlag(QGraphicsItem::ItemIsPanel); + leftParent->setBrush(Qt::blue); + + QGraphicsRectItem *leftChild = scene.addRect(-25, -25, 50, 50); + leftChild->setFlag(QGraphicsItem::ItemIsPanel); + leftChild->setBrush(Qt::green); + leftChild->setParentItem(leftParent); + + QGraphicsRectItem *rightParent = scene.addRect(-50, -50, 100, 100); + rightParent->setFlag(QGraphicsItem::ItemIsPanel); + rightParent->setBrush(Qt::red); + QGraphicsRectItem *rightChild = scene.addRect(-25, -25, 50, 50); + rightChild->setFlag(QGraphicsItem::ItemIsPanel); + rightChild->setBrush(Qt::gray); + rightChild->setParentItem(rightParent); + + leftParent->setPos(-75, 0); + rightParent->setPos(75, 0); + + bottomItem->setData(0, "bottomItem"); + leftParent->setData(0, "leftParent"); + leftChild->setData(0, "leftChild"); + rightParent->setData(0, "rightParent"); + rightChild->setData(0, "rightChild"); + + scene.setSceneRect(scene.itemsBoundingRect().adjusted(-50, -50, 50, 50)); + + EventSpy2 leftParentSpy(&scene, leftParent); + EventSpy2 leftChildSpy(&scene, leftChild); + EventSpy2 rightParentSpy(&scene, rightParent); + EventSpy2 rightChildSpy(&scene, rightChild); + EventSpy2 bottomItemSpy(&scene, bottomItem); + + // Scene modality, also test multiple scene modal items + leftChild->setPanelModality(QGraphicsItem::SceneModal); + QCOMPARE(leftChildSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(leftParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightChildSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(bottomItemSpy.counts[QEvent::WindowBlocked], 0); // not a panel + + // Click inside left child + sendMouseClick(&scene, leftChild->scenePos(), Qt::LeftButton); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMousePress], 1); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMouseRelease], 0); // no grab + QCOMPARE(leftParentSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(rightParentSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(rightChildSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(bottomItemSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + + // Click on left parent, event goes to modal child + sendMouseClick(&scene, leftParent->sceneBoundingRect().topLeft() + QPointF(5, 5), Qt::LeftButton); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMousePress], 2); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMouseRelease], 0); // no grab + QCOMPARE(leftParentSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(rightParentSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(rightChildSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(bottomItemSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + + // Click on all other items and outside the items + sendMouseClick(&scene, rightParent->sceneBoundingRect().topLeft() + QPointF(5, 5), Qt::LeftButton); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMousePress], 3); + sendMouseClick(&scene, rightChild->scenePos(), Qt::LeftButton); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMousePress], 4); + sendMouseClick(&scene, bottomItem->scenePos(), Qt::LeftButton); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMousePress], 5); + sendMouseClick(&scene, QPointF(10000, 10000), Qt::LeftButton); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMousePress], 6); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMouseRelease], 0); // no grab + QCOMPARE(leftParentSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(rightParentSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(rightChildSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(bottomItemSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + + leftChildSpy.counts.clear(); + rightChildSpy.counts.clear(); + leftParentSpy.counts.clear(); + rightParentSpy.counts.clear(); + bottomItemSpy.counts.clear(); + + leftChild->setPanelModality(QGraphicsItem::NonModal); + QCOMPARE(leftChildSpy.counts[QEvent::WindowUnblocked], 0); + QCOMPARE(rightChildSpy.counts[QEvent::WindowUnblocked], 1); + QCOMPARE(leftParentSpy.counts[QEvent::WindowUnblocked], 1); + QCOMPARE(rightParentSpy.counts[QEvent::WindowUnblocked], 1); + QCOMPARE(bottomItemSpy.counts[QEvent::WindowUnblocked], 0); + + // Left parent enters scene modality. + leftParent->setPanelModality(QGraphicsItem::SceneModal); + QCOMPARE(leftChildSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(rightChildSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(leftParentSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(rightParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(bottomItemSpy.counts[QEvent::WindowBlocked], 0); + + // Click inside left child. + sendMouseClick(&scene, leftChild->scenePos(), Qt::LeftButton); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMousePress], 1); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMouseRelease], 0); + QCOMPARE(leftParentSpy.counts[QEvent::GraphicsSceneMousePress], 0); // panel stops propagation + QCOMPARE(rightParentSpy.counts[QEvent::GraphicsSceneMousePress], 0); + QCOMPARE(rightChildSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(bottomItemSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + + // Click on left parent. + sendMouseClick(&scene, leftParent->sceneBoundingRect().topLeft() + QPointF(5, 5), Qt::LeftButton); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMousePress], 1); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMouseRelease], 0); + QCOMPARE(leftParentSpy.counts[QEvent::GraphicsSceneMousePress], 1); + QCOMPARE(rightParentSpy.counts[QEvent::GraphicsSceneMousePress], 0); + QCOMPARE(rightChildSpy.counts[QEvent::GraphicsSceneMousePress], 0); + QCOMPARE(bottomItemSpy.counts[QEvent::GraphicsSceneMousePress], 0); + + // Click on all other items and outside the items + sendMouseClick(&scene, rightParent->sceneBoundingRect().topLeft() + QPointF(5, 5), Qt::LeftButton); + QCOMPARE(leftParentSpy.counts[QEvent::GraphicsSceneMousePress], 2); + sendMouseClick(&scene, rightChild->scenePos(), Qt::LeftButton); + QCOMPARE(leftParentSpy.counts[QEvent::GraphicsSceneMousePress], 3); + sendMouseClick(&scene, bottomItem->scenePos(), Qt::LeftButton); + QCOMPARE(leftParentSpy.counts[QEvent::GraphicsSceneMousePress], 4); + sendMouseClick(&scene, QPointF(10000, 10000), Qt::LeftButton); + QCOMPARE(leftParentSpy.counts[QEvent::GraphicsSceneMousePress], 5); + QCOMPARE(leftParentSpy.counts[QEvent::GraphicsSceneMouseRelease], 0); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMousePress], 1); + QCOMPARE(rightParentSpy.counts[QEvent::GraphicsSceneMousePress], 0); + QCOMPARE(rightChildSpy.counts[QEvent::GraphicsSceneMousePress], 0); + QCOMPARE(bottomItemSpy.counts[QEvent::GraphicsSceneMousePress], 0); + + leftChildSpy.counts.clear(); + rightChildSpy.counts.clear(); + leftParentSpy.counts.clear(); + rightParentSpy.counts.clear(); + bottomItemSpy.counts.clear(); + + // Now both left parent and child are scene modal. Left parent is blocked. + leftChild->setPanelModality(QGraphicsItem::SceneModal); + QCOMPARE(leftChildSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(rightChildSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(leftParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightParentSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(bottomItemSpy.counts[QEvent::WindowBlocked], 0); + + // Click inside left child + sendMouseClick(&scene, leftChild->scenePos(), Qt::LeftButton); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMousePress], 1); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMouseRelease], 0); // no grab + QCOMPARE(leftParentSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(rightParentSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(rightChildSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(bottomItemSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + + // Click on left parent, event goes to modal child + sendMouseClick(&scene, leftParent->sceneBoundingRect().topLeft() + QPointF(5, 5), Qt::LeftButton); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMousePress], 2); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMouseRelease], 0); // no grab + QCOMPARE(leftParentSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(rightParentSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(rightChildSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(bottomItemSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + + // Click on all other items and outside the items + sendMouseClick(&scene, rightParent->sceneBoundingRect().topLeft() + QPointF(5, 5), Qt::LeftButton); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMousePress], 3); + sendMouseClick(&scene, rightChild->scenePos(), Qt::LeftButton); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMousePress], 4); + sendMouseClick(&scene, bottomItem->scenePos(), Qt::LeftButton); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMousePress], 5); + sendMouseClick(&scene, QPointF(10000, 10000), Qt::LeftButton); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMousePress], 6); + QCOMPARE(leftChildSpy.counts[QEvent::GraphicsSceneMouseRelease], 0); // no grab + QCOMPARE(leftParentSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(rightParentSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(rightChildSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + QCOMPARE(bottomItemSpy.counts[QEvent::GraphicsSceneMousePress], 0); // blocked + + leftChildSpy.counts.clear(); + rightChildSpy.counts.clear(); + leftParentSpy.counts.clear(); + rightParentSpy.counts.clear(); + bottomItemSpy.counts.clear(); + + // Right child enters scene modality, only left child is blocked. + rightChild->setPanelModality(QGraphicsItem::SceneModal); + QCOMPARE(leftChildSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightChildSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(leftParentSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(rightParentSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(bottomItemSpy.counts[QEvent::WindowBlocked], 0); +} + +void tst_QGraphicsItem::panelModality() +{ + // 1) Test mouse events (delivery/propagation/redirection) + // 2) Test hover events (incl. leave on block, enter on unblock) + // 3) Test cursor stuff (incl. unset on block, set on unblock) + // 4) Test clickfocus + // 5) Test grab/ungrab events (possibly ungrab on block, regrab on unblock) + // 6) ### modality for non-panels is unsupported for now + QGraphicsScene scene; + + QGraphicsRectItem *bottomItem = scene.addRect(-150, -100, 300, 200); + bottomItem->setFlag(QGraphicsItem::ItemIsFocusable); + bottomItem->setBrush(Qt::yellow); + + QGraphicsRectItem *leftParent = scene.addRect(-50, -50, 100, 100); + leftParent->setFlag(QGraphicsItem::ItemIsPanel); + leftParent->setBrush(Qt::blue); + + QGraphicsRectItem *leftChild = scene.addRect(-25, -25, 50, 50); + leftChild->setFlag(QGraphicsItem::ItemIsPanel); + leftChild->setBrush(Qt::green); + leftChild->setParentItem(leftParent); + + QGraphicsRectItem *rightParent = scene.addRect(-50, -50, 100, 100); + rightParent->setFlag(QGraphicsItem::ItemIsPanel); + rightParent->setBrush(Qt::red); + QGraphicsRectItem *rightChild = scene.addRect(-25, -25, 50, 50); + rightChild->setFlag(QGraphicsItem::ItemIsPanel); + rightChild->setBrush(Qt::gray); + rightChild->setParentItem(rightParent); + + leftParent->setPos(-75, 0); + rightParent->setPos(75, 0); + + bottomItem->setData(0, "bottomItem"); + leftParent->setData(0, "leftParent"); + leftChild->setData(0, "leftChild"); + rightParent->setData(0, "rightParent"); + rightChild->setData(0, "rightChild"); + + scene.setSceneRect(scene.itemsBoundingRect().adjusted(-50, -50, 50, 50)); + + EventSpy2 leftParentSpy(&scene, leftParent); + EventSpy2 leftChildSpy(&scene, leftChild); + EventSpy2 rightParentSpy(&scene, rightParent); + EventSpy2 rightChildSpy(&scene, rightChild); + EventSpy2 bottomItemSpy(&scene, bottomItem); + + // Left Child enters panel modality, only left parent is blocked. + leftChild->setPanelModality(QGraphicsItem::PanelModal); + QCOMPARE(leftChildSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(rightChildSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(leftParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightParentSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(bottomItemSpy.counts[QEvent::WindowBlocked], 0); + + leftChild->setPanelModality(QGraphicsItem::NonModal); + leftChildSpy.counts.clear(); + rightChildSpy.counts.clear(); + leftParentSpy.counts.clear(); + rightParentSpy.counts.clear(); + bottomItemSpy.counts.clear(); + + // Left parent enter panel modality, nothing is blocked. + leftParent->setPanelModality(QGraphicsItem::PanelModal); + QCOMPARE(leftChildSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(rightChildSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(leftParentSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(rightParentSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(bottomItemSpy.counts[QEvent::WindowBlocked], 0); + + // Left child enters panel modality, left parent is blocked again. + leftChild->setPanelModality(QGraphicsItem::PanelModal); + QCOMPARE(leftChildSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(rightChildSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(leftParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightParentSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(bottomItemSpy.counts[QEvent::WindowBlocked], 0); + + leftChildSpy.counts.clear(); + rightChildSpy.counts.clear(); + leftParentSpy.counts.clear(); + rightParentSpy.counts.clear(); + bottomItemSpy.counts.clear(); + + leftChild->setPanelModality(QGraphicsItem::NonModal); + QCOMPARE(leftParentSpy.counts[QEvent::WindowUnblocked], 1); + leftParent->setPanelModality(QGraphicsItem::NonModal); + QCOMPARE(leftChildSpy.counts[QEvent::WindowUnblocked], 0); + QCOMPARE(rightChildSpy.counts[QEvent::WindowUnblocked], 0); + QCOMPARE(leftParentSpy.counts[QEvent::WindowUnblocked], 1); + QCOMPARE(rightParentSpy.counts[QEvent::WindowUnblocked], 0); + QCOMPARE(bottomItemSpy.counts[QEvent::WindowUnblocked], 0); + + leftChildSpy.counts.clear(); + rightChildSpy.counts.clear(); + leftParentSpy.counts.clear(); + rightParentSpy.counts.clear(); + bottomItemSpy.counts.clear(); + + // Left and right child enter panel modality, both parents are blocked. + rightChild->setPanelModality(QGraphicsItem::PanelModal); + QCOMPARE(leftParentSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(rightParentSpy.counts[QEvent::WindowBlocked], 1); + leftChild->setPanelModality(QGraphicsItem::PanelModal); + QCOMPARE(leftParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightParentSpy.counts[QEvent::WindowBlocked], 1); +} + +void tst_QGraphicsItem::mixedModality() +{ + // 1) Test mouse events (delivery/propagation/redirection) + // 2) Test hover events (incl. leave on block, enter on unblock) + // 3) Test cursor stuff (incl. unset on block, set on unblock) + // 4) Test clickfocus + // 5) Test grab/ungrab events (possibly ungrab on block, regrab on unblock) + // 6) ### modality for non-panels is unsupported for now + QGraphicsScene scene; + + QGraphicsRectItem *bottomItem = scene.addRect(-150, -100, 300, 200); + bottomItem->setFlag(QGraphicsItem::ItemIsFocusable); + bottomItem->setBrush(Qt::yellow); + + QGraphicsRectItem *leftParent = scene.addRect(-50, -50, 100, 100); + leftParent->setFlag(QGraphicsItem::ItemIsPanel); + leftParent->setBrush(Qt::blue); + + QGraphicsRectItem *leftChild = scene.addRect(-25, -25, 50, 50); + leftChild->setFlag(QGraphicsItem::ItemIsPanel); + leftChild->setBrush(Qt::green); + leftChild->setParentItem(leftParent); + + QGraphicsRectItem *rightParent = scene.addRect(-50, -50, 100, 100); + rightParent->setFlag(QGraphicsItem::ItemIsPanel); + rightParent->setBrush(Qt::red); + QGraphicsRectItem *rightChild = scene.addRect(-25, -25, 50, 50); + rightChild->setFlag(QGraphicsItem::ItemIsPanel); + rightChild->setBrush(Qt::gray); + rightChild->setParentItem(rightParent); + + leftParent->setPos(-75, 0); + rightParent->setPos(75, 0); + + bottomItem->setData(0, "bottomItem"); + leftParent->setData(0, "leftParent"); + leftChild->setData(0, "leftChild"); + rightParent->setData(0, "rightParent"); + rightChild->setData(0, "rightChild"); + + scene.setSceneRect(scene.itemsBoundingRect().adjusted(-50, -50, 50, 50)); + + EventSpy2 leftParentSpy(&scene, leftParent); + EventSpy2 leftChildSpy(&scene, leftChild); + EventSpy2 rightParentSpy(&scene, rightParent); + EventSpy2 rightChildSpy(&scene, rightChild); + EventSpy2 bottomItemSpy(&scene, bottomItem); + + // Left Child enters panel modality, only left parent is blocked. + leftChild->setPanelModality(QGraphicsItem::PanelModal); + QCOMPARE(leftChildSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(rightChildSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(leftParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightParentSpy.counts[QEvent::WindowBlocked], 0); + + // Left parent enters scene modality, which blocks everything except the child. + leftParent->setPanelModality(QGraphicsItem::SceneModal); + QCOMPARE(leftChildSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(leftChildSpy.counts[QEvent::WindowUnblocked], 0); + QCOMPARE(rightChildSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightChildSpy.counts[QEvent::WindowUnblocked], 0); + QCOMPARE(leftParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(leftParentSpy.counts[QEvent::WindowUnblocked], 0); + QCOMPARE(rightParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightParentSpy.counts[QEvent::WindowUnblocked], 0); + + // Right child enters panel modality (changes nothing). + rightChild->setPanelModality(QGraphicsItem::PanelModal); + QCOMPARE(leftChildSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(leftChildSpy.counts[QEvent::WindowUnblocked], 0); + QCOMPARE(rightChildSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightChildSpy.counts[QEvent::WindowUnblocked], 0); + QCOMPARE(leftParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(leftParentSpy.counts[QEvent::WindowUnblocked], 0); + QCOMPARE(rightParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightParentSpy.counts[QEvent::WindowUnblocked], 0); + + // Left parent leaves modality. Right child is unblocked. + leftParent->setPanelModality(QGraphicsItem::NonModal); + QCOMPARE(leftChildSpy.counts[QEvent::WindowBlocked], 0); + QCOMPARE(leftChildSpy.counts[QEvent::WindowUnblocked], 0); + QCOMPARE(rightChildSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightChildSpy.counts[QEvent::WindowUnblocked], 1); + QCOMPARE(leftParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(leftParentSpy.counts[QEvent::WindowUnblocked], 0); + QCOMPARE(rightParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightParentSpy.counts[QEvent::WindowUnblocked], 0); + + // Right child "upgrades" its modality to scene modal. Left child is blocked. + // Right parent is unaffected. + rightChild->setPanelModality(QGraphicsItem::SceneModal); + QCOMPARE(leftChildSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(leftChildSpy.counts[QEvent::WindowUnblocked], 0); + QCOMPARE(rightChildSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightChildSpy.counts[QEvent::WindowUnblocked], 1); + QCOMPARE(leftParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(leftParentSpy.counts[QEvent::WindowUnblocked], 0); + QCOMPARE(rightParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightParentSpy.counts[QEvent::WindowUnblocked], 0); + + // "downgrade" right child back to panel modal, left child is unblocked + rightChild->setPanelModality(QGraphicsItem::PanelModal); + QCOMPARE(leftChildSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(leftChildSpy.counts[QEvent::WindowUnblocked], 1); + QCOMPARE(rightChildSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightChildSpy.counts[QEvent::WindowUnblocked], 1); + QCOMPARE(leftParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(leftParentSpy.counts[QEvent::WindowUnblocked], 0); + QCOMPARE(rightParentSpy.counts[QEvent::WindowBlocked], 1); + QCOMPARE(rightParentSpy.counts[QEvent::WindowUnblocked], 0); +} + +void tst_QGraphicsItem::modality_hover() +{ + QGraphicsScene scene; + QGraphicsRectItem *rect1 = scene.addRect(-50, -50, 100, 100); + rect1->setFlag(QGraphicsItem::ItemIsPanel); + rect1->setAcceptHoverEvents(true); + rect1->setData(0, "rect1"); + + QGraphicsRectItem *rect2 = scene.addRect(-50, -50, 100, 100); + rect2->setParentItem(rect1); + rect2->setFlag(QGraphicsItem::ItemIsPanel); + rect2->setAcceptHoverEvents(true); + rect2->setPos(50, 50); + rect2->setPanelModality(QGraphicsItem::SceneModal); + rect2->setData(0, "rect2"); + + EventSpy2 rect1Spy(&scene, rect1); + EventSpy2 rect2Spy(&scene, rect2); + + sendMouseMove(&scene, QPointF(-25, -25)); + + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverEnter], 0); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverMove], 0); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverLeave], 0); + + sendMouseMove(&scene, QPointF(75, 75)); + + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverEnter], 0); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverMove], 0); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverLeave], 0); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneHoverEnter], 1); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneHoverMove], 1); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneHoverLeave], 0); + + sendMouseMove(&scene, QPointF(-25, -25)); + + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneHoverLeave], 1); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverEnter], 0); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverMove], 0); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverLeave], 0); + + rect2->setPanelModality(QGraphicsItem::NonModal); + + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverEnter], 1); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverMove], 1); + + sendMouseMove(&scene, QPointF(75, 75)); + + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneHoverEnter], 2); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneHoverMove], 2); + + rect2->setPanelModality(QGraphicsItem::SceneModal); + + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverLeave], 1); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneHoverEnter], 2); + // changing modality causes a spurious GraphicsSceneHoveMove, even though the mouse didn't + // actually move + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneHoverMove], 3); + + sendMouseMove(&scene, QPointF(-25, -25)); + + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneHoverLeave], 2); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverEnter], 1); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverMove], 1); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverLeave], 1); + + rect2->setPanelModality(QGraphicsItem::PanelModal); + + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverEnter], 1); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverMove], 1); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverLeave], 1); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneHoverEnter], 2); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneHoverMove], 3); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneHoverLeave], 2); + + rect2->setPanelModality(QGraphicsItem::NonModal); + + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverEnter], 2); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneHoverMove], 2); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneHoverEnter], 2); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneHoverMove], 3); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneHoverLeave], 2); +} + +void tst_QGraphicsItem::modality_mouseGrabber() +{ + QGraphicsScene scene; + QGraphicsRectItem *rect1 = scene.addRect(-50, -50, 100, 100); + rect1->setFlag(QGraphicsItem::ItemIsPanel); + rect1->setFlag(QGraphicsItem::ItemIsMovable); + rect1->setData(0, "rect1"); + + QGraphicsRectItem *rect2 = scene.addRect(-50, -50, 100, 100); + rect2->setParentItem(rect1); + rect2->setFlag(QGraphicsItem::ItemIsPanel); + rect2->setFlag(QGraphicsItem::ItemIsMovable); + rect2->setPos(50, 50); + rect2->setData(0, "rect2"); + + EventSpy2 rect1Spy(&scene, rect1); + EventSpy2 rect2Spy(&scene, rect2); + + { + // pressing mouse on rect1 starts implicit grab + sendMousePress(&scene, QPoint(-25, -25)); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneMousePress], 1); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) rect1); + + // grab lost when rect1 is modally shadowed + rect2->setPanelModality(QGraphicsItem::SceneModal); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) 0); + + // releasing goes nowhere + sendMouseRelease(&scene, QPoint(-25, -25)); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneMouseRelease], 0); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneMouseRelease], 0); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) 0); + + // pressing mouse on rect1 starts implicit grab on rect2 (since it is modal) + sendMouseClick(&scene, QPoint(-25, -25)); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneMousePress], 1); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneMouseRelease], 0); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneMousePress], 1); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneMouseRelease], 1); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 1); + + rect2->setPanelModality(QGraphicsItem::NonModal); + + // pressing mouse on rect1 starts implicit grab + sendMousePress(&scene, QPoint(-25, -25)); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 2); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneMousePress], 2); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) rect1); + + // grab lost to rect2 when rect1 is modally shadowed + rect2->setPanelModality(QGraphicsItem::SceneModal); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 2); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 2); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) 0); + + // rect1 does *not* re-grab when rect2 is no longer modal + rect2->setPanelModality(QGraphicsItem::NonModal); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 2); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 2); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) 0); + + // release goes nowhere + sendMouseRelease(&scene, QPoint(-25, -25)); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 2); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneMouseRelease], 0); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 2); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) 0); + } + { + // repeat the test using PanelModal + rect2->setPanelModality(QGraphicsItem::NonModal); + rect1Spy.counts.clear(); + rect2Spy.counts.clear(); + + // pressing mouse on rect1 starts implicit grab + sendMousePress(&scene, QPoint(-25, -25)); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneMousePress], 1); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) rect1); + + // grab lost when rect1 is modally shadowed + rect2->setPanelModality(QGraphicsItem::PanelModal); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) 0); + + // releasing goes nowhere + sendMouseRelease(&scene, QPoint(-25, -25)); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneMouseRelease], 0); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneMouseRelease], 0); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) 0); + + // pressing mouse on rect1 starts implicit grab on rect2 (since it is modal) + sendMouseClick(&scene, QPoint(-25, -25)); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneMousePress], 1); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneMouseRelease], 0); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneMousePress], 1); + QCOMPARE(rect2Spy.counts[QEvent::GraphicsSceneMouseRelease], 1); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 1); + + rect2->setPanelModality(QGraphicsItem::NonModal); + + // pressing mouse on rect1 starts implicit grab + sendMousePress(&scene, QPoint(-25, -25)); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 2); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneMousePress], 2); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) rect1); + + // grab lost to rect2 when rect1 is modally shadowed + rect2->setPanelModality(QGraphicsItem::PanelModal); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 2); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 2); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) 0); + + // rect1 does *not* re-grab when rect2 is no longer modal + rect2->setPanelModality(QGraphicsItem::NonModal); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 2); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 2); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) 0); + + // release goes nowhere + sendMouseRelease(&scene, QPoint(-25, -25)); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 2); + QCOMPARE(rect1Spy.counts[QEvent::GraphicsSceneMouseRelease], 0); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 2); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) 0); + } + + { + // repeat the PanelModal tests, but this time the mouse events will be on a non-modal item, + // meaning normal grabbing should work + rect2->setPanelModality(QGraphicsItem::NonModal); + rect1Spy.counts.clear(); + rect2Spy.counts.clear(); + + QGraphicsRectItem *rect3 = scene.addRect(-50, -50, 100, 100); + rect3->setFlag(QGraphicsItem::ItemIsPanel); + rect3->setFlag(QGraphicsItem::ItemIsMovable); + rect3->setPos(150, 50); + rect3->setData(0, "rect3"); + + EventSpy2 rect3Spy(&scene, rect3); + + // pressing mouse on rect3 starts implicit grab + sendMousePress(&scene, QPoint(150, 50)); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(rect3Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect3Spy.counts[QEvent::GraphicsSceneMousePress], 1); + QCOMPARE(rect3Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) rect3); + + // grab is *not* lost when rect1 is modally shadowed by rect2 + rect2->setPanelModality(QGraphicsItem::PanelModal); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(rect3Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect3Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) rect3); + + // releasing goes to rect3 + sendMouseRelease(&scene, QPoint(150, 50)); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(rect3Spy.counts[QEvent::GrabMouse], 1); + QCOMPARE(rect3Spy.counts[QEvent::GraphicsSceneMouseRelease], 1); + QCOMPARE(rect3Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) 0); + + rect2->setPanelModality(QGraphicsItem::NonModal); + + // pressing mouse on rect3 starts implicit grab + sendMousePress(&scene, QPoint(150, 50)); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(rect3Spy.counts[QEvent::GrabMouse], 2); + QCOMPARE(rect3Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) rect3); + + // grab is not lost + rect2->setPanelModality(QGraphicsItem::PanelModal); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(rect3Spy.counts[QEvent::GrabMouse], 2); + QCOMPARE(rect3Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) rect3); + + // grab stays on rect3 + rect2->setPanelModality(QGraphicsItem::NonModal); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(rect3Spy.counts[QEvent::GrabMouse], 2); + QCOMPARE(rect3Spy.counts[QEvent::UngrabMouse], 1); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) rect3); + + // release goes to rect3 + sendMouseRelease(&scene, QPoint(150, 50)); + QCOMPARE(rect1Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect1Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::GrabMouse], 0); + QCOMPARE(rect2Spy.counts[QEvent::UngrabMouse], 0); + QCOMPARE(rect3Spy.counts[QEvent::GrabMouse], 2); + QCOMPARE(rect3Spy.counts[QEvent::UngrabMouse], 2); + QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *) 0); + } +} + +void tst_QGraphicsItem::modality_clickFocus() +{ + QGraphicsScene scene; + QGraphicsRectItem *rect1 = scene.addRect(-50, -50, 100, 100); + rect1->setFlag(QGraphicsItem::ItemIsPanel); + rect1->setFlag(QGraphicsItem::ItemIsFocusable); + rect1->setData(0, "rect1"); + + QGraphicsRectItem *rect2 = scene.addRect(-50, -50, 100, 100); + rect2->setParentItem(rect1); + rect2->setFlag(QGraphicsItem::ItemIsPanel); + rect2->setFlag(QGraphicsItem::ItemIsFocusable); + rect2->setPos(50, 50); + rect2->setData(0, "rect2"); + + QEvent windowActivateEvent(QEvent::WindowActivate); + QApplication::sendEvent(&scene, &windowActivateEvent); + + EventSpy2 rect1Spy(&scene, rect1); + EventSpy2 rect2Spy(&scene, rect2); + + // activate rect1, it should not get focus + rect1->setActive(true); + QCOMPARE(scene.focusItem(), (QGraphicsItem *) 0); + + // focus stays unset when rect2 becomes modal + rect2->setPanelModality(QGraphicsItem::SceneModal); + QCOMPARE(scene.focusItem(), (QGraphicsItem *) 0); + QCOMPARE(rect1Spy.counts[QEvent::FocusIn], 0); + QCOMPARE(rect1Spy.counts[QEvent::FocusOut], 0); + QCOMPARE(rect2Spy.counts[QEvent::FocusIn], 0); + QCOMPARE(rect2Spy.counts[QEvent::FocusOut], 0); + + // clicking on rect1 should not set it's focus item + sendMouseClick(&scene, QPointF(-25, -25)); + QCOMPARE(rect1->focusItem(), (QGraphicsItem *) 0); + QCOMPARE(rect1Spy.counts[QEvent::FocusIn], 0); + QCOMPARE(rect1Spy.counts[QEvent::FocusOut], 0); + QCOMPARE(rect2Spy.counts[QEvent::FocusIn], 0); + QCOMPARE(rect2Spy.counts[QEvent::FocusOut], 0); + + // clicking on rect2 gives it focus + rect2->setActive(true); + sendMouseClick(&scene, QPointF(75, 75)); + QCOMPARE(scene.focusItem(), (QGraphicsItem *) rect2); + QCOMPARE(rect1Spy.counts[QEvent::FocusIn], 0); + QCOMPARE(rect1Spy.counts[QEvent::FocusOut], 0); + QCOMPARE(rect2Spy.counts[QEvent::FocusIn], 1); + QCOMPARE(rect2Spy.counts[QEvent::FocusOut], 0); + + // clicking on rect1 does *not* give it focus + rect1->setActive(true); + sendMouseClick(&scene, QPointF(-25, -25)); + QCOMPARE(scene.focusItem(), (QGraphicsItem *) 0); + QCOMPARE(rect1Spy.counts[QEvent::FocusIn], 0); + QCOMPARE(rect1Spy.counts[QEvent::FocusOut], 0); + QCOMPARE(rect2Spy.counts[QEvent::FocusIn], 1); + QCOMPARE(rect2Spy.counts[QEvent::FocusOut], 1); + + // focus doesn't change when leaving modality either + rect2->setPanelModality(QGraphicsItem::NonModal); + QCOMPARE(scene.focusItem(), (QGraphicsItem *) 0); + QCOMPARE(rect1Spy.counts[QEvent::FocusIn], 0); + QCOMPARE(rect1Spy.counts[QEvent::FocusOut], 0); + QCOMPARE(rect2Spy.counts[QEvent::FocusIn], 1); + QCOMPARE(rect2Spy.counts[QEvent::FocusOut], 1); + + // click on rect1, it should get focus now + sendMouseClick(&scene, QPointF(-25, -25)); + QCOMPARE(scene.focusItem(), (QGraphicsItem *) rect1); + QCOMPARE(rect1Spy.counts[QEvent::FocusIn], 1); + QCOMPARE(rect1Spy.counts[QEvent::FocusOut], 0); + QCOMPARE(rect2Spy.counts[QEvent::FocusIn], 1); + QCOMPARE(rect2Spy.counts[QEvent::FocusOut], 1); +} + +void tst_QGraphicsItem::modality_keyEvents() +{ + QGraphicsScene scene; + QGraphicsRectItem *rect1 = scene.addRect(-50, -50, 100, 100); + rect1->setFlag(QGraphicsItem::ItemIsPanel); + rect1->setFlag(QGraphicsItem::ItemIsFocusable); + rect1->setData(0, "rect1"); + + QGraphicsRectItem *rect1child = scene.addRect(-10, -10, 20, 20); + rect1child->setParentItem(rect1); + rect1child->setFlag(QGraphicsItem::ItemIsFocusable); + rect1child->setData(0, "rect1child1"); + + QGraphicsRectItem *rect2 = scene.addRect(-50, -50, 100, 100); + rect2->setParentItem(rect1); + rect2->setFlag(QGraphicsItem::ItemIsPanel); + rect2->setFlag(QGraphicsItem::ItemIsFocusable); + rect2->setPos(50, 50); + rect2->setData(0, "rect2"); + + QGraphicsRectItem *rect2child = scene.addRect(-10, -10, 20, 20); + rect2child->setParentItem(rect2); + rect2child->setFlag(QGraphicsItem::ItemIsFocusable); + rect2child->setData(0, "rect2child1"); + + QEvent windowActivateEvent(QEvent::WindowActivate); + QApplication::sendEvent(&scene, &windowActivateEvent); + + EventSpy2 rect1Spy(&scene, rect1); + EventSpy2 rect1childSpy(&scene, rect1child); + EventSpy2 rect2Spy(&scene, rect2); + EventSpy2 rect2childSpy(&scene, rect2child); + + // activate rect1 and give it rect1child focus + rect1->setActive(true); + rect1child->setFocus(); + QCOMPARE(scene.focusItem(), (QGraphicsItem *) rect1child); + + // focus stays on rect1child when rect2 becomes modal + rect2->setPanelModality(QGraphicsItem::SceneModal); + QCOMPARE(scene.focusItem(), (QGraphicsItem *) rect1child); + + // but key events to rect1child should be neither delivered nor propagated + sendKeyClick(&scene, Qt::Key_A); + sendKeyClick(&scene, Qt::Key_S); + sendKeyClick(&scene, Qt::Key_D); + sendKeyClick(&scene, Qt::Key_F); + QCOMPARE(rect1childSpy.counts[QEvent::KeyPress], 0); + QCOMPARE(rect1childSpy.counts[QEvent::KeyRelease], 0); + QCOMPARE(rect1Spy.counts[QEvent::KeyPress], 0); + QCOMPARE(rect1Spy.counts[QEvent::KeyRelease], 0); + + // change to panel modality, rect1child1 keeps focus + rect2->setPanelModality(QGraphicsItem::PanelModal); + QCOMPARE(scene.focusItem(), (QGraphicsItem *) rect1child); + + // still no key events + sendKeyClick(&scene, Qt::Key_J); + sendKeyClick(&scene, Qt::Key_K); + sendKeyClick(&scene, Qt::Key_L); + sendKeyClick(&scene, Qt::Key_Semicolon); + QCOMPARE(rect1childSpy.counts[QEvent::KeyPress], 0); + QCOMPARE(rect1childSpy.counts[QEvent::KeyRelease], 0); + QCOMPARE(rect1Spy.counts[QEvent::KeyPress], 0); + QCOMPARE(rect1Spy.counts[QEvent::KeyRelease], 0); +} + QTEST_MAIN(tst_QGraphicsItem) #include "tst_qgraphicsitem.moc" -- cgit v0.12 From 9c0b1db38f7ad8b6b0d51410033854be72146e74 Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Thu, 1 Oct 2009 08:54:02 +0200 Subject: Split EGL config selection & surface creation into seperate functions This is needed to implement render-to-pixmap on x11/EGL, which will also need to create an EGL surface for pixmaps. --- src/gui/image/qpixmap_x11_p.h | 2 + src/gui/image/qpixmapdata_p.h | 1 + src/opengl/qgl_x11egl.cpp | 175 ++++++++++++++++++++++++------------------ 3 files changed, 105 insertions(+), 73 deletions(-) diff --git a/src/gui/image/qpixmap_x11_p.h b/src/gui/image/qpixmap_x11_p.h index ed8678d..e34e690 100644 --- a/src/gui/image/qpixmap_x11_p.h +++ b/src/gui/image/qpixmap_x11_p.h @@ -100,6 +100,8 @@ private: friend class QX11WindowSurface; friend class QRasterWindowSurface; friend class QGLContextPrivate; // Needs to access xinfo, gl_surface & flags + friend class QEglContext; // Needs gl_surface + friend bool qt_createEGLSurfaceForPixmap(QPixmapData*, bool); // Needs gl_surface void release(); diff --git a/src/gui/image/qpixmapdata_p.h b/src/gui/image/qpixmapdata_p.h index 3e85236..c26fba3 100644 --- a/src/gui/image/qpixmapdata_p.h +++ b/src/gui/image/qpixmapdata_p.h @@ -134,6 +134,7 @@ private: friend class QS60PixmapData; friend class QGLTextureCache; //Needs to check the reference count friend class QExplicitlySharedDataPointer; + friend bool qt_createEGLSurfaceForPixmap(QPixmapData*, bool); // Needs to set is_cached QAtomicInt ref; int detach_no; diff --git a/src/opengl/qgl_x11egl.cpp b/src/opengl/qgl_x11egl.cpp index 67f391b..d4bf4da 100644 --- a/src/opengl/qgl_x11egl.cpp +++ b/src/opengl/qgl_x11egl.cpp @@ -408,6 +408,103 @@ void QGLWidgetPrivate::recreateEglSurface(bool force) } } +// Selects which configs should be used +EGLConfig Q_OPENGL_EXPORT qt_chooseEGLConfigForPixmap(bool hasAlpha, bool readOnly) +{ + // Cache the configs we select as they wont change: + static EGLConfig roPixmapRGBConfig = 0; + static EGLConfig roPixmapRGBAConfig = 0; + static EGLConfig rwPixmapRGBConfig = 0; + static EGLConfig rwPixmapRGBAConfig = 0; + + EGLConfig* targetConfig; + + if (hasAlpha) { + if (readOnly) + targetConfig = &roPixmapRGBAConfig; + else + targetConfig = &rwPixmapRGBAConfig; + } + else { + if (readOnly) + targetConfig = &roPixmapRGBConfig; + else + targetConfig = &rwPixmapRGBConfig; + } + + if (*targetConfig == 0) { + QEglProperties configAttribs; + configAttribs.setValue(EGL_SURFACE_TYPE, EGL_PIXMAP_BIT); + configAttribs.setRenderableType(QEgl::OpenGL); + if (hasAlpha) + configAttribs.setValue(EGL_BIND_TO_TEXTURE_RGBA, EGL_TRUE); + else + configAttribs.setValue(EGL_BIND_TO_TEXTURE_RGB, EGL_TRUE); + + // If this is going to be a render target, it needs to have a depth, stencil & sample buffer + if (!readOnly) { + configAttribs.setValue(EGL_DEPTH_SIZE, 1); + configAttribs.setValue(EGL_STENCIL_SIZE, 1); + configAttribs.setValue(EGL_SAMPLE_BUFFERS, 1); + } + + EGLint configCount = 0; + do { + eglChooseConfig(QEglContext::defaultDisplay(0), configAttribs.properties(), targetConfig, 1, &configCount); + if (configCount > 0) { + // Got one + qDebug() << "Found an" << (hasAlpha ? "ARGB" : "RGB") << (readOnly ? "readonly" : "target" ) + << "config (" << int(*targetConfig) << ") to create a pixmap surface:"; + +// QEglProperties configProps(*targetConfig); +// qDebug() << configProps.toString(); + break; + } + qWarning("choosePixmapConfig() - No suitible config found, reducing requirements"); + } while (configAttribs.reduceConfiguration()); + } + + if (*targetConfig == 0) + qWarning("choosePixmapConfig() - Couldn't find a suitable config"); + + return *targetConfig; +} + +bool Q_OPENGL_EXPORT qt_createEGLSurfaceForPixmap(QPixmapData* pmd, bool readOnly) +{ + Q_ASSERT(pmd->classId() == QPixmapData::X11Class); + QX11PixmapData* pixmapData = static_cast(pmd); + + bool hasAlpha = pixmapData->hasAlphaChannel(); + + EGLConfig pixmapConfig = qt_chooseEGLConfigForPixmap(hasAlpha, readOnly); + + QEglProperties pixmapAttribs; + + // If the pixmap can't be bound to a texture, it's pretty useless + pixmapAttribs.setValue(EGL_TEXTURE_TARGET, EGL_TEXTURE_2D); + if (hasAlpha) + pixmapAttribs.setValue(EGL_TEXTURE_FORMAT, EGL_TEXTURE_RGBA); + else + pixmapAttribs.setValue(EGL_TEXTURE_FORMAT, EGL_TEXTURE_RGB); + + EGLSurface pixmapSurface; + pixmapSurface = eglCreatePixmapSurface(QEglContext::defaultDisplay(0), + pixmapConfig, + (EGLNativePixmapType) pixmapData->handle(), + pixmapAttribs.properties()); + if (pixmapSurface == EGL_NO_SURFACE) { + qWarning("Failed to create a pixmap surface using config %d", (int)pixmapConfig); + return false; + } + + Q_ASSERT(sizeof(Qt::HANDLE) >= sizeof(EGLSurface)); // Just to make totally sure! + pixmapData->gl_surface = (Qt::HANDLE)pixmapSurface; + pixmapData->is_cached = true; // Make sure the cleanup hook gets called + + return true; +} + QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmapData* pd, const qint64 key, QGLContext::BindOptions options) @@ -449,82 +546,14 @@ QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmapData* pd, cons destroyGlSurfaceForPixmap(pixmapData); } - EGLint pixmapAttribs[] = { - EGL_TEXTURE_TARGET, EGL_TEXTURE_2D, - EGL_TEXTURE_FORMAT, hasAlpha ? EGL_TEXTURE_RGBA : EGL_TEXTURE_RGB, - EGL_NONE - }; - Q_ASSERT(sizeof(Qt::HANDLE) >= sizeof(EGLSurface)); // Just to make totally sure! - if (pixmapData->gl_surface == 0) - pixmapData->gl_surface = (Qt::HANDLE)EGL_NO_SURFACE; - EGLSurface pixmapSurface = (EGLSurface)pixmapData->gl_surface; - static EGLConfig pixmapRGBConfig = 0; - static EGLConfig pixmapRGBAConfig = 0; - - // Check to see if we need to find a config - if ((hasAlpha && !pixmapRGBAConfig) || (!hasAlpha && !pixmapRGBConfig) ) { - const EGLint configAttribs[] = { - EGL_SURFACE_TYPE, EGL_PIXMAP_BIT, - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, - EGL_DEPTH_SIZE, 0, - hasAlpha ? EGL_BIND_TO_TEXTURE_RGBA : EGL_BIND_TO_TEXTURE_RGB, EGL_TRUE, - EGL_NONE - }; - - EGLint configCount = 0; - eglChooseConfig(eglContext->display(), configAttribs, 0, 256, &configCount); - if (configCount == 0) { - haveTFP = false; - qWarning("bindTextureFromNativePixmap() - Couldn't find a suitable config"); - return 0; - } - - EGLConfig *configList = new EGLConfig[configCount]; - eglChooseConfig(eglContext->display(), configAttribs, configList, configCount, &configCount); - Q_ASSERT(configCount); - - // Try to create a pixmap surface for each config until one works - for (int i = 0; i < configCount; ++i) { - pixmapSurface = eglCreatePixmapSurface(eglContext->display(), configList[i], - (EGLNativePixmapType) pixmapData->handle(), - pixmapAttribs); - if (pixmapSurface != EGL_NO_SURFACE) { - // Got one! - qDebug() << "Found an" << (hasAlpha ? "ARGB" : "RGB") - << "config (" << int(configList[i]) << ") to create a pixmap surface"; - if (hasAlpha) - pixmapRGBAConfig = configList[i]; - else - pixmapRGBConfig = configList[i]; - pixmapData->gl_surface = (Qt::HANDLE)pixmapSurface; - break; - } - } - delete configList; - - if ((hasAlpha && !pixmapRGBAConfig) || (!hasAlpha && !pixmapRGBConfig) ) { - qDebug("Couldn't create a pixmap surface with any of the provided configs"); - haveTFP = false; - return 0; - } - } - - if (pixmapSurface == EGL_NO_SURFACE) { - pixmapSurface = eglCreatePixmapSurface(eglContext->display(), - hasAlpha? pixmapRGBAConfig : pixmapRGBConfig, - (EGLNativePixmapType) pixmapData->handle(), - pixmapAttribs); - if (pixmapSurface == EGL_NO_SURFACE) { - qWarning("Failed to create a pixmap surface using config %d", - (int)(hasAlpha? pixmapRGBAConfig : pixmapRGBConfig)); + if (pixmapData->gl_surface == 0) { + bool success = qt_createEGLSurfaceForPixmap(pixmapData, true); + if (!success) { haveTFP = false; return 0; } - pixmapData->gl_surface = (Qt::HANDLE)pixmapSurface; } - // Make sure the cleanup hook gets called so we can delete the glx pixmap - pixmapData->is_cached = true; Q_ASSERT(pixmapData->gl_surface); GLuint textureId; @@ -534,10 +563,10 @@ QGLTexture *QGLContextPrivate::bindTextureFromNativePixmap(QPixmapData* pd, cons // bind the egl pixmap surface to a texture EGLBoolean success; - success = eglBindTexImage(eglContext->display(), pixmapSurface, EGL_BACK_BUFFER); + success = eglBindTexImage(eglContext->display(), (EGLSurface)pixmapData->gl_surface, EGL_BACK_BUFFER); if (success == EGL_FALSE) { qWarning() << "eglBindTexImage() failed:" << eglContext->errorString(eglGetError()); - eglDestroySurface(eglContext->display(), pixmapSurface); + eglDestroySurface(eglContext->display(), (EGLSurface)pixmapData->gl_surface); pixmapData->gl_surface = (Qt::HANDLE)EGL_NO_SURFACE; haveTFP = false; return 0; -- cgit v0.12 From d6cb9ed0b44118c7f9045559a300ea14985f0103 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Wed, 30 Sep 2009 15:55:29 +0200 Subject: Fix warnings on mingw Reviewed-by: trust me --- src/gui/kernel/qsoftkeymanager.cpp | 1 + src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 1 + src/svg/qsvghandler.cpp | 2 ++ src/xmlpatterns/functions/qsequencefns_p.h | 4 ++-- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp index 45695d9..265f971 100644 --- a/src/gui/kernel/qsoftkeymanager.cpp +++ b/src/gui/kernel/qsoftkeymanager.cpp @@ -121,6 +121,7 @@ QAction *QSoftKeyManager::createAction(StandardSoftKey standardKey, QWidget *act softKeyRole = QAction::PositiveSoftKey; break; case CancelSoftKey: + default: softKeyRole = QAction::NegativeSoftKey; break; } diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 7e45fd9..f612bc0 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1452,6 +1452,7 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev) #if !defined(QT_OPENGL_ES_2) bool success = qt_resolve_version_2_0_functions(d->ctx); Q_ASSERT(success); + Q_UNUSED(success); #endif d->shaderManager = new QGLEngineShaderManager(d->ctx); diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp index a6e4855..6d2a0f9 100644 --- a/src/svg/qsvghandler.cpp +++ b/src/svg/qsvghandler.cpp @@ -3551,6 +3551,8 @@ void QSvgHandler::parse() case QXmlStreamReader::ProcessingInstruction: processingInstruction(xml->processingInstructionTarget().toString(), xml->processingInstructionData().toString()); break; + default: + break; } } resolveGradients(m_doc); diff --git a/src/xmlpatterns/functions/qsequencefns_p.h b/src/xmlpatterns/functions/qsequencefns_p.h index a9a1765..e406b95 100644 --- a/src/xmlpatterns/functions/qsequencefns_p.h +++ b/src/xmlpatterns/functions/qsequencefns_p.h @@ -148,8 +148,8 @@ namespace QPatternist { // RVCT doesn't like using template parameter in trinary operator when the trinary operator result is // passed directly into another constructor. - bool tempAssert = (Id == IDExistsFN || Id == IDEmptyFN); - Q_ASSERT(tempAssert); + Q_ASSERT(Id == IDExistsFN || Id == IDEmptyFN); + const Expression::Ptr me(FunctionCall::compress(context)); -- cgit v0.12 From e58293b3b0cb4664efca10229ae2e6556185e8a7 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 1 Oct 2009 10:32:08 +0200 Subject: Compilation with pedantic or when QtCore is not specified in the include path Note that i also removed the #error since the enum is already updated in master Reviewed-by: Gabi --- src/corelib/io/qdatastream.h | 6 +----- src/gui/s60framework/qs60mainappui.h | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/corelib/io/qdatastream.h b/src/corelib/io/qdatastream.h index 6e83204..7cf22f2 100644 --- a/src/corelib/io/qdatastream.h +++ b/src/corelib/io/qdatastream.h @@ -84,11 +84,7 @@ public: Qt_4_3 = 9, Qt_4_4 = 10, Qt_4_5 = 11, - Qt_4_6 = 12, -#if QT_VERSION >= 0x040700 -#error Add the datastream version for this Qt version - Qt_4_7 = Qt_4_6 -#endif + Qt_4_6 = 12 }; enum ByteOrder { diff --git a/src/gui/s60framework/qs60mainappui.h b/src/gui/s60framework/qs60mainappui.h index c2c6ef2..321d8d6 100644 --- a/src/gui/s60framework/qs60mainappui.h +++ b/src/gui/s60framework/qs60mainappui.h @@ -42,7 +42,7 @@ #ifndef QS60MAINAPPUI_H #define QS60MAINAPPUI_H -#include +#include #ifdef Q_WS_S60 -- cgit v0.12 From 9c34f75dedddea2e84432dc6f173389a1814d0f9 Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Thu, 1 Oct 2009 10:37:44 +0200 Subject: Make this test pass on Windows. Calling rm on . remove the dir on Windows. Reviewed-by:TrustMe --- tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp index ea9304d..2cc2558 100644 --- a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp +++ b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp @@ -806,7 +806,10 @@ void tst_QFileSystemModel::sort() QDir dir(QDir::tempPath()); dir.mkdir("sortTemp"); dir.cd("sortTemp"); - QDirIterator it(dir); + QTRY_VERIFY(dir.exists()); + + //To be sure we clean the dir if it was there before + QDirIterator it(dir.absolutePath(), QDir::NoDotAndDotDot); while(it.hasNext()) { it.next(); -- cgit v0.12 From f289576105f2c560d23d91d4078b832bbd19dc70 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Thu, 1 Oct 2009 10:37:15 +0200 Subject: Threaded Fortune server example: fix displayed IP listen to the first non-local IPv4 address found, as in commit 5e3775ae4c5263a25e63868e8a3f16244e4dde02 Reviewed-by: Aleksandar Babic --- examples/network/fortuneserver/server.cpp | 2 +- examples/network/threadedfortuneserver/dialog.cpp | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/examples/network/fortuneserver/server.cpp b/examples/network/fortuneserver/server.cpp index 016fa78..52b7d61 100644 --- a/examples/network/fortuneserver/server.cpp +++ b/examples/network/fortuneserver/server.cpp @@ -74,7 +74,7 @@ Server::Server(QWidget *parent) // if we did not find one, use IPv4 localhost if (ipAddress.isEmpty()) ipAddress = QHostAddress(QHostAddress::LocalHost).toString(); - statusLabel->setText(tr("The server is running on\nIP: \n%1 port:\n%2\n" + statusLabel->setText(tr("The server is running on\n\nIP: %1\nport: %2\n\n" "Run the Fortune Client example now.") .arg(ipAddress).arg(tcpServer->serverPort())); //! [1] diff --git a/examples/network/threadedfortuneserver/dialog.cpp b/examples/network/threadedfortuneserver/dialog.cpp index 51ae0d3..b1ea395 100644 --- a/examples/network/threadedfortuneserver/dialog.cpp +++ b/examples/network/threadedfortuneserver/dialog.cpp @@ -62,9 +62,20 @@ Dialog::Dialog(QWidget *parent) return; } - statusLabel->setText(tr("The server is running on port %1.\n" + QString ipAddress; + QList ipAddressesList = QNetworkInterface::allAddresses(); + // use the first non-localhost IPv4 address + for (int i = 0; i < ipAddressesList.size(); ++i) { + if (ipAddressesList.at(i) != QHostAddress::LocalHost && + ipAddressesList.at(i).toIPv4Address()) + ipAddress = ipAddressesList.at(i).toString(); + } + // if we did not find one, use IPv4 localhost + if (ipAddress.isEmpty()) + ipAddress = QHostAddress(QHostAddress::LocalHost).toString(); + statusLabel->setText(tr("The server is running on\n\nIP: %1\nport: %2\n\n" "Run the Fortune Client example now.") - .arg(server.serverPort())); + .arg(ipAddress).arg(server.serverPort())); connect(quitButton, SIGNAL(clicked()), this, SLOT(close())); -- cgit v0.12 From 9a5442b732592f2ed474e705b7ea29776d96a83b Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 1 Oct 2009 10:38:35 +0200 Subject: Compile if QtCore is not in the include path when one includes --- src/gui/s60framework/qs60maindocument.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/s60framework/qs60maindocument.h b/src/gui/s60framework/qs60maindocument.h index 366d311..1327349 100644 --- a/src/gui/s60framework/qs60maindocument.h +++ b/src/gui/s60framework/qs60maindocument.h @@ -42,7 +42,7 @@ #ifndef QS60MAINDOCUMENT_H #define QS60MAINDOCUMENT_H -#include +#include #ifdef Q_WS_S60 -- cgit v0.12 From f0183775d1575a4537bed8c10e9c757ffa66fe03 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 1 Oct 2009 10:43:09 +0200 Subject: Fix the compilerwarning test on GCC Don't issue this warning: comparing floating point with == or != is unsafe There is many of them and the Qt code is correct (it has to be fast comparison to know if fast code path must be taken) Reviewed-by: Jeremy --- tests/auto/compilerwarnings/tst_compilerwarnings.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/auto/compilerwarnings/tst_compilerwarnings.cpp b/tests/auto/compilerwarnings/tst_compilerwarnings.cpp index 907aade..0be5cb0 100644 --- a/tests/auto/compilerwarnings/tst_compilerwarnings.cpp +++ b/tests/auto/compilerwarnings/tst_compilerwarnings.cpp @@ -179,7 +179,6 @@ void tst_CompilerWarnings::warnings() << "-Wno-long-long" << "-Wshadow" << "-Wpacked" << "-Wunreachable-code" << "-Wundef" << "-Wchar-subscripts" << "-Wformat-nonliteral" << "-Wformat-security" << "-Wcast-align" - << "-Wfloat-equal" << "-o" << tmpFile << tmpSourceFile; #elif defined(Q_CC_XLC) -- cgit v0.12 From fafd16474aee5bbf47ee37e1ba739f3b3ceb9c33 Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Thu, 1 Oct 2009 11:30:20 +0300 Subject: Fix for Symbian window activation/focus problem. When dialog is shown on top of a top level window, the focus does not get back to top level window when dialog is closed. This is a fix for that. Reviewed-by: Shane Kearns --- src/gui/kernel/qwidget_s60.cpp | 59 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 05db8ca..6ba693c 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -490,6 +490,65 @@ void QWidgetPrivate::setFocus_sys() static_cast(q->effectiveWinId())->setFocusSafely(true); } +void QWidgetPrivate::handleSymbianDeferredFocusChanged() +{ + Q_Q(QWidget); + WId control = q->internalWinId(); + + if (!control) { + // This could happen if the widget was reparented, while the focuschange + // was in the event queue. + return; + } + + if (control->IsFocused()) { + QApplication::setActiveWindow(q); +#ifdef Q_WS_S60 + // If widget is fullscreen, hide status pane and button container + // otherwise show them. + CEikStatusPane* statusPane = S60->statusPane(); + CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer(); + bool isFullscreen = q->windowState() & Qt::WindowFullScreen; + if (statusPane && (statusPane->IsVisible() == isFullscreen)) + statusPane->MakeVisible(!isFullscreen); + if (buttonGroup && (buttonGroup->IsVisible() == isFullscreen)) + buttonGroup->MakeVisible(!isFullscreen); +#endif + } else { + + QWidget *nextActiveWindow = 0; + + if (q->isWindow()) { + + // Try to activate possible parent window first. + QWidget *parent = q->parentWidget(); + if(parent + && parent->isWindow() + && parent->isVisible() + && !parent->isActiveWindow()) { + + nextActiveWindow = parent; + } else { + // Activate next possible top level window. + QWidgetList topLevelWidgets = QApplication::topLevelWidgets(); + for (int i = 0; i < topLevelWidgets.size(); ++i) { + QWidget *w = topLevelWidgets.at(i); + if (w != q && w->isVisible() && !w->isActiveWindow()) { + nextActiveWindow = w; + break; + } + } + } + + if (nextActiveWindow) + nextActiveWindow->activateWindow(); + } + + QApplication::setActiveWindow(nextActiveWindow); + } +>>>>>>> Fix for Symbian window activation/focus problem.:src/gui/kernel/qwidget_s60.cpp +} + void QWidgetPrivate::raise_sys() { Q_Q(QWidget); -- cgit v0.12 From c7e91e208642d3ddea5d69142c978310b289ba88 Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Thu, 1 Oct 2009 12:23:11 +0300 Subject: Revert "Fix for Symbian window activation/focus problem." This reverts commit fafd16474aee5bbf47ee37e1ba739f3b3ceb9c33. --- src/gui/kernel/qwidget_s60.cpp | 59 ------------------------------------------ 1 file changed, 59 deletions(-) diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 6ba693c..05db8ca 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -490,65 +490,6 @@ void QWidgetPrivate::setFocus_sys() static_cast(q->effectiveWinId())->setFocusSafely(true); } -void QWidgetPrivate::handleSymbianDeferredFocusChanged() -{ - Q_Q(QWidget); - WId control = q->internalWinId(); - - if (!control) { - // This could happen if the widget was reparented, while the focuschange - // was in the event queue. - return; - } - - if (control->IsFocused()) { - QApplication::setActiveWindow(q); -#ifdef Q_WS_S60 - // If widget is fullscreen, hide status pane and button container - // otherwise show them. - CEikStatusPane* statusPane = S60->statusPane(); - CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer(); - bool isFullscreen = q->windowState() & Qt::WindowFullScreen; - if (statusPane && (statusPane->IsVisible() == isFullscreen)) - statusPane->MakeVisible(!isFullscreen); - if (buttonGroup && (buttonGroup->IsVisible() == isFullscreen)) - buttonGroup->MakeVisible(!isFullscreen); -#endif - } else { - - QWidget *nextActiveWindow = 0; - - if (q->isWindow()) { - - // Try to activate possible parent window first. - QWidget *parent = q->parentWidget(); - if(parent - && parent->isWindow() - && parent->isVisible() - && !parent->isActiveWindow()) { - - nextActiveWindow = parent; - } else { - // Activate next possible top level window. - QWidgetList topLevelWidgets = QApplication::topLevelWidgets(); - for (int i = 0; i < topLevelWidgets.size(); ++i) { - QWidget *w = topLevelWidgets.at(i); - if (w != q && w->isVisible() && !w->isActiveWindow()) { - nextActiveWindow = w; - break; - } - } - } - - if (nextActiveWindow) - nextActiveWindow->activateWindow(); - } - - QApplication::setActiveWindow(nextActiveWindow); - } ->>>>>>> Fix for Symbian window activation/focus problem.:src/gui/kernel/qwidget_s60.cpp -} - void QWidgetPrivate::raise_sys() { Q_Q(QWidget); -- cgit v0.12 From 686cf8fdaf7fa762a125443fb6ed7913ce2fb93b Mon Sep 17 00:00:00 2001 From: Frans Englich Date: Thu, 1 Oct 2009 11:14:55 +0200 Subject: Silence compiler warning. --- src/xmlpatterns/type/qanytype.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xmlpatterns/type/qanytype.cpp b/src/xmlpatterns/type/qanytype.cpp index cb9ef37..8966220 100644 --- a/src/xmlpatterns/type/qanytype.cpp +++ b/src/xmlpatterns/type/qanytype.cpp @@ -69,7 +69,7 @@ QXmlName AnyType::name(const NamePool::Ptr &np) const return np->allocateQName(StandardNamespaces::xs, QLatin1String("anyType")); } -QString AnyType::displayName(const NamePool::Ptr &np) const +QString AnyType::displayName(const NamePool::Ptr &) const { /* A bit faster than calling name()->displayName() */ return QLatin1String("xs:anyType"); -- cgit v0.12 From 4b3e0adec89e2d0ce4024d764e7856a077302e28 Mon Sep 17 00:00:00 2001 From: Frans Englich Date: Thu, 1 Oct 2009 11:16:20 +0200 Subject: Fix translation strings. This change cleans up schema translation comments by having customary copy editing for sentences: starts with a capital letter and ends with a full stop. Pointed out by Friedemann. Reviewed-by: Friedemann Kleint --- src/xmlpatterns/schema/qxsdparticlechecker.cpp | 28 +-- src/xmlpatterns/schema/qxsdschemachecker.cpp | 206 ++++++++++----------- src/xmlpatterns/schema/qxsdschemahelper.cpp | 26 +-- src/xmlpatterns/schema/qxsdschemaparser.cpp | 148 +++++++-------- src/xmlpatterns/schema/qxsdschemaresolver.cpp | 72 +++---- src/xmlpatterns/schema/qxsdtypechecker.cpp | 118 ++++++------ .../schema/qxsdvalidatinginstancereader.cpp | 100 +++++----- 7 files changed, 349 insertions(+), 349 deletions(-) diff --git a/src/xmlpatterns/schema/qxsdparticlechecker.cpp b/src/xmlpatterns/schema/qxsdparticlechecker.cpp index 64e995e..3fdfb33 100644 --- a/src/xmlpatterns/schema/qxsdparticlechecker.cpp +++ b/src/xmlpatterns/schema/qxsdparticlechecker.cpp @@ -162,7 +162,7 @@ static bool derivedTermValid(const XsdTerm::Ptr &baseTerm, const XsdTerm::Ptr &d // check that an empty particle can not be derived from a non-empty particle if (derivedParticle && baseParticle) { if (XsdSchemaHelper::isParticleEmptiable(derivedParticle) && !XsdSchemaHelper::isParticleEmptiable(baseParticle)) { - errorMsg = QtXmlPatterns::tr("empty particle cannot be derived from non-empty particle"); + errorMsg = QtXmlPatterns::tr("Empty particle cannot be derived from non-empty particle."); return false; } } @@ -177,33 +177,33 @@ static bool derivedTermValid(const XsdTerm::Ptr &baseTerm, const XsdTerm::Ptr &d // check names are equal if (element->name(namePool) != derivedElement->name(namePool)) { - errorMsg = QtXmlPatterns::tr("derived particle is missing element %1").arg(formatKeyword(element->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Derived particle is missing element %1.").arg(formatKeyword(element->displayName(namePool))); return false; } // check value constraints are equal (if available) if (element->valueConstraint() && element->valueConstraint()->variety() == XsdElement::ValueConstraint::Fixed) { if (!derivedElement->valueConstraint()) { - errorMsg = QtXmlPatterns::tr("derived element %1 is missing value constraint as defined in base particle").arg(formatKeyword(derivedElement->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Derived element %1 is missing value constraint as defined in base particle.").arg(formatKeyword(derivedElement->displayName(namePool))); return false; } if (derivedElement->valueConstraint()->variety() != XsdElement::ValueConstraint::Fixed) { - errorMsg = QtXmlPatterns::tr("derived element %1 has weaker value constraint than base particle").arg(formatKeyword(derivedElement->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Derived element %1 has weaker value constraint than base particle.").arg(formatKeyword(derivedElement->displayName(namePool))); return false; } const QSourceLocation dummyLocation(QUrl(QLatin1String("http://dummy.org")), 1, 1); const XsdTypeChecker checker(context, QVector(), dummyLocation); if (!checker.valuesAreEqual(element->valueConstraint()->value(), derivedElement->valueConstraint()->value(), derivedElement->type())) { - errorMsg = QtXmlPatterns::tr("fixed value constraint of element %1 differs from value constraint in base particle").arg(formatKeyword(derivedElement->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Fixed value constraint of element %1 differs from value constraint in base particle.").arg(formatKeyword(derivedElement->displayName(namePool))); return false; } } // check that a derived element can not be nillable if the base element is not nillable if (!element->isNillable() && derivedElement->isNillable()) { - errorMsg = QtXmlPatterns::tr("derived element %1 cannot be nillable as base element is not nillable").arg(formatKeyword(derivedElement->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Derived element %1 cannot be nillable as base element is not nillable.").arg(formatKeyword(derivedElement->displayName(namePool))); return false; } @@ -213,7 +213,7 @@ static bool derivedTermValid(const XsdTerm::Ptr &baseTerm, const XsdTerm::Ptr &d if (((baseConstraints & XsdElement::RestrictionConstraint) && !(derivedConstraints & XsdElement::RestrictionConstraint)) || ((baseConstraints & XsdElement::ExtensionConstraint) && !(derivedConstraints & XsdElement::ExtensionConstraint)) || ((baseConstraints & XsdElement::SubstitutionConstraint) && !(derivedConstraints & XsdElement::SubstitutionConstraint))) { - errorMsg = QtXmlPatterns::tr("block constraints of derived element %1 must not be more weaker than in the base element").arg(formatKeyword(derivedElement->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Block constraints of derived element %1 must not be more weaker than in the base element.").arg(formatKeyword(derivedElement->displayName(namePool))); return false; } @@ -224,12 +224,12 @@ static bool derivedTermValid(const XsdTerm::Ptr &baseTerm, const XsdTerm::Ptr &d // check that the type of the derived element can validly derived from the type of the base element if (derivedElement->type()->isSimpleType()) { if (!XsdSchemaHelper::isSimpleDerivationOk(derivedElement->type(), element->type(), SchemaType::DerivationConstraints())) { - errorMsg = QtXmlPatterns::tr("simple type of derived element %1 cannot be validly derived from base element").arg(formatKeyword(derivedElement->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Simple type of derived element %1 cannot be validly derived from base element.").arg(formatKeyword(derivedElement->displayName(namePool))); return false; } } else if (derivedElement->type()->isComplexType()) { if (!XsdSchemaHelper::isComplexDerivationOk(derivedElement->type(), element->type(), SchemaType::DerivationConstraints())) { - errorMsg = QtXmlPatterns::tr("complex type of derived element %1 cannot be validly derived from base element").arg(formatKeyword(derivedElement->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Complex type of derived element %1 cannot be validly derived from base element.").arg(formatKeyword(derivedElement->displayName(namePool))); return false; } } @@ -253,7 +253,7 @@ static bool derivedTermValid(const XsdTerm::Ptr &baseTerm, const XsdTerm::Ptr &d return true; } else if (derivedTerm->isWildcard()) { // derive a wildcard from an element is not allowed - errorMsg = QtXmlPatterns::tr("element %1 is missing in derived particle").arg(formatKeyword(element->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Element %1 is missing in derived particle.").arg(formatKeyword(element->displayName(namePool))); return false; } } else if (baseTerm->isWildcard()) { @@ -271,7 +271,7 @@ static bool derivedTermValid(const XsdTerm::Ptr &baseTerm, const XsdTerm::Ptr &d // check that name of the element is allowed by the wildcards namespace constraint if (!XsdSchemaHelper::wildcardAllowsExpandedName(name, wildcard, namePool)) { - errorMsg = QtXmlPatterns::tr("element %1 does not match namespace constraint of wildcard in base particle").arg(formatKeyword(derivedElement->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Element %1 does not match namespace constraint of wildcard in base particle.").arg(formatKeyword(derivedElement->displayName(namePool))); return false; } @@ -282,12 +282,12 @@ static bool derivedTermValid(const XsdTerm::Ptr &baseTerm, const XsdTerm::Ptr &d // check that the derived wildcard is a valid subset of the base wildcard if (!XsdSchemaHelper::isWildcardSubset(derivedWildcard, wildcard)) { - errorMsg = QtXmlPatterns::tr("wildcard in derived particle is not a valid subset of wildcard in base particle"); + errorMsg = QtXmlPatterns::tr("Wildcard in derived particle is not a valid subset of wildcard in base particle."); return false; } if (!XsdSchemaHelper::checkWildcardProcessContents(wildcard, derivedWildcard)) { - errorMsg = QtXmlPatterns::tr("processContent of wildcard in derived particle is weaker than wildcard in base particle"); + errorMsg = QtXmlPatterns::tr("processContent of wildcard in derived particle is weaker than wildcard in base particle."); return false; } } @@ -527,7 +527,7 @@ bool XsdParticleChecker::subsumes(const XsdParticle::Ptr &particle, const XsdPar if (processedSet.at(i).second == it.key() && (baseStates.value(processedSet.at(i).first) != XsdStateMachine::EndState && baseStates.value(processedSet.at(i).first) != XsdStateMachine::StartEndState)) { - errorMsg = QtXmlPatterns::tr("derived particle allows content that is not allowed in the base particle"); + errorMsg = QtXmlPatterns::tr("Derived particle allows content that is not allowed in the base particle."); return false; } } diff --git a/src/xmlpatterns/schema/qxsdschemachecker.cpp b/src/xmlpatterns/schema/qxsdschemachecker.cpp index fc62ebb..dde72f5 100644 --- a/src/xmlpatterns/schema/qxsdschemachecker.cpp +++ b/src/xmlpatterns/schema/qxsdschemachecker.cpp @@ -224,12 +224,12 @@ void XsdSchemaChecker::checkBasicCircularInheritances() if (wxsTypeMatches(type, type->wxsSuperType(), visitedTypes, conflictingType)) { if (conflictingType) - m_context->error(QtXmlPatterns::tr("%1 has inheritance loop in its base type %2") + m_context->error(QtXmlPatterns::tr("%1 has inheritance loop in its base type %2.") .arg(formatType(m_namePool, type)) .arg(formatType(m_namePool, conflictingType)), XsdSchemaContext::XSDError, location); else - m_context->error(QtXmlPatterns::tr("circular inheritance of base type %1").arg(formatType(m_namePool, type)), XsdSchemaContext::XSDError, location); + m_context->error(QtXmlPatterns::tr("Circular inheritance of base type %1.").arg(formatType(m_namePool, type)), XsdSchemaContext::XSDError, location); return; } @@ -253,7 +253,7 @@ void XsdSchemaChecker::checkCircularInheritances() // check normal base type inheritance QSet visitedTypes; if (matchesType(type, type->wxsSuperType(), visitedTypes)) { - m_context->error(QtXmlPatterns::tr("circular inheritance of base type %1").arg(formatType(m_namePool, type)), XsdSchemaContext::XSDError, location); + m_context->error(QtXmlPatterns::tr("Circular inheritance of base type %1.").arg(formatType(m_namePool, type)), XsdSchemaContext::XSDError, location); return; } @@ -264,7 +264,7 @@ void XsdSchemaChecker::checkCircularInheritances() const XsdSimpleType::List memberTypes = simpleType->memberTypes(); for (int j = 0; j < memberTypes.count(); ++j) { if (hasCircularUnionInheritance(simpleType, memberTypes.at(j), m_namePool)) { - m_context->error(QtXmlPatterns::tr("circular inheritance of union %1").arg(formatType(m_namePool, type)), XsdSchemaContext::XSDError, location); + m_context->error(QtXmlPatterns::tr("Circular inheritance of union %1.").arg(formatType(m_namePool, type)), XsdSchemaContext::XSDError, location); return; } } @@ -289,12 +289,12 @@ void XsdSchemaChecker::checkInheritanceRestrictions() const SchemaType::Ptr baseType = type->wxsSuperType(); if (baseType->isDefinedBySchema()) { if ((type->derivationMethod() == SchemaType::DerivationRestriction) && (baseType->derivationConstraints() & SchemaType::RestrictionConstraint)) { - m_context->error(QtXmlPatterns::tr("%1 is not allowed to derive from %2 by restriction as the latter defines it as final") + m_context->error(QtXmlPatterns::tr("%1 is not allowed to derive from %2 by restriction as the latter defines it as final.") .arg(formatType(m_namePool, type)) .arg(formatType(m_namePool, baseType)), XsdSchemaContext::XSDError, location); return; } else if ((type->derivationMethod() == SchemaType::DerivationExtension) && (baseType->derivationConstraints() & SchemaType::ExtensionConstraint)) { - m_context->error(QtXmlPatterns::tr("%1 is not allowed to derive from %2 by extension as the latter defines it as final") + m_context->error(QtXmlPatterns::tr("%1 is not allowed to derive from %2 by extension as the latter defines it as final.") .arg(formatType(m_namePool, type)) .arg(formatType(m_namePool, baseType)), XsdSchemaContext::XSDError, location); return; @@ -325,7 +325,7 @@ void XsdSchemaChecker::checkBasicSimpleTypeConstraints() const SchemaType::Ptr baseType = simpleType->wxsSuperType(); if (baseType->isComplexType() && (simpleType->name(m_namePool) != BuiltinTypes::xsAnySimpleType->name(m_namePool))) { - m_context->error(QtXmlPatterns::tr("base type of simple type %1 cannot be complex type %2") + m_context->error(QtXmlPatterns::tr("Base type of simple type %1 cannot be complex type %2.") .arg(formatType(m_namePool, simpleType)) .arg(formatType(m_namePool, baseType)), XsdSchemaContext::XSDError, location); @@ -334,7 +334,7 @@ void XsdSchemaChecker::checkBasicSimpleTypeConstraints() if (baseType == BuiltinTypes::xsAnyType) { if (type->name(m_namePool) != BuiltinTypes::xsAnySimpleType->name(m_namePool)) { - m_context->error(QtXmlPatterns::tr("simple type %1 cannot have direct base type %2") + m_context->error(QtXmlPatterns::tr("Simple type %1 cannot have direct base type %2.") .arg(formatType(m_namePool, simpleType)) .arg(formatType(m_namePool, BuiltinTypes::xsAnyType)), XsdSchemaContext::XSDError, location); @@ -367,7 +367,7 @@ void XsdSchemaChecker::checkSimpleTypeConstraints() // check that no user defined type has xs:AnySimpleType as base type (except xs:AnyAtomicType) if (simpleType->wxsSuperType()->name(m_namePool) == BuiltinTypes::xsAnySimpleType->name(m_namePool)) { if (simpleType->name(m_namePool) != BuiltinTypes::xsAnyAtomicType->name(m_namePool)) { - m_context->error(QtXmlPatterns::tr("simple type %1 is not allowed to have base type %2") + m_context->error(QtXmlPatterns::tr("Simple type %1 is not allowed to have base type %2.") .arg(formatType(m_namePool, simpleType)) .arg(formatType(m_namePool, simpleType->wxsSuperType())), XsdSchemaContext::XSDError, location); @@ -376,7 +376,7 @@ void XsdSchemaChecker::checkSimpleTypeConstraints() } // check that no user defined type has xs:AnyAtomicType as base type if (simpleType->wxsSuperType()->name(m_namePool) == BuiltinTypes::xsAnyAtomicType->name(m_namePool)) { - m_context->error(QtXmlPatterns::tr("simple type %1 is not allowed to have base type %2") + m_context->error(QtXmlPatterns::tr("Simple type %1 is not allowed to have base type %2.") .arg(formatType(m_namePool, simpleType)) .arg(formatType(m_namePool, simpleType->wxsSuperType())), XsdSchemaContext::XSDError, location); @@ -388,13 +388,13 @@ void XsdSchemaChecker::checkSimpleTypeConstraints() if (simpleType->category() == XsdSimpleType::SimpleTypeAtomic) { // 1.1 if ((simpleType->wxsSuperType()->category() != XsdSimpleType::SimpleTypeAtomic) && (simpleType->name(m_namePool) != BuiltinTypes::xsAnyAtomicType->name(m_namePool))) { - m_context->error(QtXmlPatterns::tr("simple type %1 can only have simple atomic type as base type") + m_context->error(QtXmlPatterns::tr("Simple type %1 can only have simple atomic type as base type.") .arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); } // 1.2 if (simpleType->wxsSuperType()->derivationConstraints() & SchemaType::RestrictionConstraint) { - m_context->error(QtXmlPatterns::tr("simple type %1 cannot derive from %2 as the latter defines restriction as final") + m_context->error(QtXmlPatterns::tr("Simple type %1 cannot derive from %2 as the latter defines restriction as final.") .arg(formatType(m_namePool, simpleType->wxsSuperType())) .arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); @@ -407,7 +407,7 @@ void XsdSchemaChecker::checkSimpleTypeConstraints() // 2.1 or @see http://www.w3.org/TR/xmlschema-2/#cos-list-of-atomic if (itemType->category() != SchemaType::SimpleTypeAtomic && itemType->category() != SchemaType::SimpleTypeUnion) { - m_context->error(QtXmlPatterns::tr("variety of item type of %1 must be either atomic or union").arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); + m_context->error(QtXmlPatterns::tr("Variety of item type of %1 must be either atomic or union.").arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); return; } @@ -417,7 +417,7 @@ void XsdSchemaChecker::checkSimpleTypeConstraints() const AnySimpleType::List memberTypes = simpleItemType->memberTypes(); for (int j = 0; j < memberTypes.count(); ++j) { if (memberTypes.at(j)->category() != SchemaType::SimpleTypeAtomic) { - m_context->error(QtXmlPatterns::tr("variety of member types of %1 must be atomic").arg(formatType(m_namePool, simpleItemType)), XsdSchemaContext::XSDError, location); + m_context->error(QtXmlPatterns::tr("Variety of member types of %1 must be atomic.").arg(formatType(m_namePool, simpleItemType)), XsdSchemaContext::XSDError, location); return; } } @@ -430,7 +430,7 @@ void XsdSchemaChecker::checkSimpleTypeConstraints() // 2.2.1.1 if (simpleItemType->derivationConstraints() & XsdSimpleType::ListConstraint) { - m_context->error(QtXmlPatterns::tr("%1 is not allowed to derive from %2 by list as the latter defines it as final") + m_context->error(QtXmlPatterns::tr("%1 is not allowed to derive from %2 by list as the latter defines it as final.") .arg(formatType(m_namePool, simpleType)) .arg(formatType(m_namePool, simpleItemType)), XsdSchemaContext::XSDError, location); return; @@ -450,7 +450,7 @@ void XsdSchemaChecker::checkSimpleTypeConstraints() } if (invalidFacetFound) { - m_context->error(QtXmlPatterns::tr("simple type %1 is only allowed to have %2 facet") + m_context->error(QtXmlPatterns::tr("Simple type %1 is only allowed to have %2 facet.") .arg(formatType(m_namePool, simpleType)) .arg(formatKeyword("whiteSpace")), XsdSchemaContext::XSDError, location); @@ -460,19 +460,19 @@ void XsdSchemaChecker::checkSimpleTypeConstraints() } else { // 2.2.2 // 2.2.2.1 if (simpleType->wxsSuperType()->category() != XsdSimpleType::SimpleTypeList) { - m_context->error(QtXmlPatterns::tr("base type of simple type %1 must have variety of type list").arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); + m_context->error(QtXmlPatterns::tr("Base type of simple type %1 must have variety of type list.").arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); return; } // 2.2.2.2 if (simpleType->wxsSuperType()->derivationConstraints() & SchemaType::RestrictionConstraint) { - m_context->error(QtXmlPatterns::tr("base type of simple type %1 has defined derivation by restriction as final").arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); + m_context->error(QtXmlPatterns::tr("Base type of simple type %1 has defined derivation by restriction as final.").arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); return; } // 2.2.2.3 if (!XsdSchemaHelper::isSimpleDerivationOk(itemType, XsdSimpleType::Ptr(simpleType->wxsSuperType())->itemType(), SchemaType::DerivationConstraints())) { - m_context->error(QtXmlPatterns::tr("item type of base type does not match item type of %1").arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); + m_context->error(QtXmlPatterns::tr("Item type of base type does not match item type of %1.").arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); return; } @@ -498,7 +498,7 @@ void XsdSchemaChecker::checkSimpleTypeConstraints() } if (invalidFacetFound) { - m_context->error(QtXmlPatterns::tr("simple type %1 contains not allowed facet type %2") + m_context->error(QtXmlPatterns::tr("Simple type %1 contains not allowed facet type %2.") .arg(formatType(m_namePool, simpleType)) .arg(formatKeyword(XsdFacet::typeName(invalidFacetType))), XsdSchemaContext::XSDError, location); @@ -519,7 +519,7 @@ void XsdSchemaChecker::checkSimpleTypeConstraints() const AnySimpleType::Ptr memberType = memberTypes.at(i); if (memberType->derivationConstraints() & XsdSimpleType::UnionConstraint) { - m_context->error(QtXmlPatterns::tr("%1 is not allowed to derive from %2 by union as the latter defines it as final") + m_context->error(QtXmlPatterns::tr("%1 is not allowed to derive from %2 by union as the latter defines it as final.") .arg(formatType(m_namePool, simpleType)) .arg(formatType(m_namePool, memberType)), XsdSchemaContext::XSDError, location); return; @@ -528,7 +528,7 @@ void XsdSchemaChecker::checkSimpleTypeConstraints() // 3.3.1.2 if (!simpleType->facets().isEmpty()) { - m_context->error(QtXmlPatterns::tr("%1 is not allowed to have any facets") + m_context->error(QtXmlPatterns::tr("%1 is not allowed to have any facets.") .arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); return; @@ -536,7 +536,7 @@ void XsdSchemaChecker::checkSimpleTypeConstraints() } else { // 3.1.2.1 if (simpleType->wxsSuperType()->category() != SchemaType::SimpleTypeUnion) { - m_context->error(QtXmlPatterns::tr("base type %1 of simple type %2 must have variety of union") + m_context->error(QtXmlPatterns::tr("Base type %1 of simple type %2 must have variety of union.") .arg(formatType(m_namePool, simpleType->wxsSuperType())) .arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); @@ -545,7 +545,7 @@ void XsdSchemaChecker::checkSimpleTypeConstraints() // 3.1.2.2 if (simpleType->wxsSuperType()->derivationConstraints() & SchemaType::DerivationRestriction) { - m_context->error(QtXmlPatterns::tr("base type %1 of simple type %2 is not allowed to have restriction in %3 attribute") + m_context->error(QtXmlPatterns::tr("Base type %1 of simple type %2 is not allowed to have restriction in %3 attribute.") .arg(formatType(m_namePool, simpleType->wxsSuperType())) .arg(formatType(m_namePool, simpleType)) .arg(formatAttribute("final")), @@ -563,7 +563,7 @@ void XsdSchemaChecker::checkSimpleTypeConstraints() const AnySimpleType::Ptr baseMemberType = baseMemberTypes.at(i); if (!XsdSchemaHelper::isSimpleDerivationOk(memberType, baseMemberType, SchemaType::DerivationConstraints())) { - m_context->error(QtXmlPatterns::tr("member type %1 cannot be derived from member type %2 of %3's base type %4") + m_context->error(QtXmlPatterns::tr("Member type %1 cannot be derived from member type %2 of %3's base type %4.") .arg(formatType(m_namePool, memberType)) .arg(formatType(m_namePool, baseMemberType)) .arg(formatType(m_namePool, simpleType)) @@ -591,7 +591,7 @@ void XsdSchemaChecker::checkSimpleTypeConstraints() } if (invalidFacetFound) { - m_context->error(QtXmlPatterns::tr("simple type %1 contains not allowed facet type %2") + m_context->error(QtXmlPatterns::tr("Simple type %1 contains not allowed facet type %2.") .arg(formatType(m_namePool, simpleType)) .arg(formatKeyword(XsdFacet::typeName(invalidFacetType))), XsdSchemaContext::XSDError, location); @@ -628,7 +628,7 @@ void XsdSchemaChecker::checkBasicComplexTypeConstraints() // @see http://www.w3.org/TR/xmlschema11-1/#ct-props-correct 2) if (baseType->isSimpleType() && (complexType->derivationMethod() != XsdComplexType::DerivationExtension)) { - m_context->error(QtXmlPatterns::tr("derivation method of %1 must be extension because the base type %2 is a simple type") + m_context->error(QtXmlPatterns::tr("Derivation method of %1 must be extension because the base type %2 is a simple type.") .arg(formatType(m_namePool, complexType)) .arg(formatType(m_namePool, baseType)), XsdSchemaContext::XSDError, location); @@ -658,7 +658,7 @@ void XsdSchemaChecker::checkComplexTypeConstraints() if (complexType->contentType()->particle()) { XsdElement::Ptr duplicatedElement; if (XsdParticleChecker::hasDuplicatedElements(complexType->contentType()->particle(), m_namePool, duplicatedElement)) { - m_context->error(QtXmlPatterns::tr("complex type %1 has duplicated element %2 in its content model") + m_context->error(QtXmlPatterns::tr("Complex type %1 has duplicated element %2 in its content model.") .arg(formatType(m_namePool, complexType)) .arg(formatKeyword(duplicatedElement->displayName(m_namePool))), XsdSchemaContext::XSDError, location); @@ -666,7 +666,7 @@ void XsdSchemaChecker::checkComplexTypeConstraints() } if (!XsdParticleChecker::isUPAConform(complexType->contentType()->particle(), m_namePool)) { - m_context->error(QtXmlPatterns::tr("complex type %1 has non-deterministic content") + m_context->error(QtXmlPatterns::tr("Complex type %1 has non-deterministic content.") .arg(formatType(m_namePool, complexType)), XsdSchemaContext::XSDError, location); return; @@ -687,7 +687,7 @@ void XsdSchemaChecker::checkComplexTypeConstraints() QString errorMsg; if (!XsdSchemaHelper::isValidAttributeUsesExtension(complexType->attributeUses(), complexBaseType->attributeUses(), complexType->attributeWildcard(), complexBaseType->attributeWildcard(), m_context, errorMsg)) { - m_context->error(QtXmlPatterns::tr("attributes of complex type %1 are not a valid extension of the attributes of base type %2: %3") + m_context->error(QtXmlPatterns::tr("Attributes of complex type %1 are not a valid extension of the attributes of base type %2: %3.") .arg(formatType(m_namePool, complexType)) .arg(formatType(m_namePool, baseType)) .arg(errorMsg), @@ -724,7 +724,7 @@ void XsdSchemaChecker::checkComplexTypeConstraints() // 1.5 WTF?!? if (!validContentType) { - m_context->error(QtXmlPatterns::tr("content model of complex type %1 is not a valid extension of content model of %2") + m_context->error(QtXmlPatterns::tr("Content model of complex type %1 is not a valid extension of content model of %2.") .arg(formatType(m_namePool, complexType)) .arg(formatType(m_namePool, complexBaseType)), XsdSchemaContext::XSDError, location); @@ -734,14 +734,14 @@ void XsdSchemaChecker::checkComplexTypeConstraints() } else if (baseType->isSimpleType()) { // 2.1 if (complexType->contentType()->variety() != XsdComplexType::ContentType::Simple) { - m_context->error(QtXmlPatterns::tr("complex type %1 must have simple content") + m_context->error(QtXmlPatterns::tr("Complex type %1 must have simple content.") .arg(formatType(m_namePool, complexType)), XsdSchemaContext::XSDError, location); return; } if (complexType->contentType()->simpleType() != baseType) { - m_context->error(QtXmlPatterns::tr("complex type %1 must have the same simple type as its base class %2") + m_context->error(QtXmlPatterns::tr("Complex type %1 must have the same simple type as its base class %2.") .arg(formatType(m_namePool, complexType)) .arg(formatType(m_namePool, baseType)), XsdSchemaContext::XSDError, location); @@ -808,7 +808,7 @@ void XsdSchemaChecker::checkComplexTypeConstraints() } if (!derivationOk) { - m_context->error(QtXmlPatterns::tr("complex type %1 cannot be derived from base type %2%3") + m_context->error(QtXmlPatterns::tr("Complex type %1 cannot be derived from base type %2%3.") .arg(formatType(m_namePool, complexType)) .arg(formatType(m_namePool, baseType)) .arg(errorMsg.isEmpty() ? QString() : QLatin1String(": ") + errorMsg), @@ -822,7 +822,7 @@ void XsdSchemaChecker::checkComplexTypeConstraints() QString errorMsg; if (!XsdSchemaHelper::isValidAttributeUsesRestriction(complexType->attributeUses(), complexBaseType->attributeUses(), complexType->attributeWildcard(), complexBaseType->attributeWildcard(), m_context, errorMsg)) { - m_context->error(QtXmlPatterns::tr("attributes of complex type %1 are not a valid restriction from the attributes of base type %2: %3") + m_context->error(QtXmlPatterns::tr("Attributes of complex type %1 are not a valid restriction from the attributes of base type %2: %3.") .arg(formatType(m_namePool, complexType)) .arg(formatType(m_namePool, baseType)) .arg(errorMsg), @@ -836,7 +836,7 @@ void XsdSchemaChecker::checkComplexTypeConstraints() // built in complex type xs:AnyType if (complexType->contentType()->variety() == XsdComplexType::ContentType::Simple) { if (baseType->name(m_namePool) == BuiltinTypes::xsAnyType->name(m_namePool)) { - m_context->error(QtXmlPatterns::tr("complex type %1 with simple content cannot be derived from complex base type %2") + m_context->error(QtXmlPatterns::tr("Complex type %1 with simple content cannot be derived from complex base type %2.") .arg(formatType(m_namePool, complexType)) .arg(formatType(m_namePool, baseType)), XsdSchemaContext::XSDError, location); @@ -871,7 +871,7 @@ void XsdSchemaChecker::checkSimpleDerivationRestrictions() const AnySimpleType::Ptr itemType = simpleType->itemType(); if (itemType->isComplexType()) { - m_context->error(QtXmlPatterns::tr("item type of simple type %1 cannot be a complex type") + m_context->error(QtXmlPatterns::tr("Item type of simple type %1 cannot be a complex type.") .arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); return; @@ -881,7 +881,7 @@ void XsdSchemaChecker::checkSimpleDerivationRestrictions() if (itemType->isSimpleType() && itemType->isDefinedBySchema()) { const XsdSimpleType::Ptr simpleItemType = itemType; if (simpleItemType->derivationConstraints() & XsdSimpleType::ListConstraint) { - m_context->error(QtXmlPatterns::tr("%1 is not allowed to derive from %2 by list as the latter defines it as final") + m_context->error(QtXmlPatterns::tr("%1 is not allowed to derive from %2 by list as the latter defines it as final.") .arg(formatType(m_namePool, simpleType)) .arg(formatType(m_namePool, simpleItemType)), XsdSchemaContext::XSDError, location); @@ -891,7 +891,7 @@ void XsdSchemaChecker::checkSimpleDerivationRestrictions() // @see http://www.w3.org/TR/xmlschema-2/#cos-list-of-atomic if (itemType->category() != SchemaType::SimpleTypeAtomic && itemType->category() != SchemaType::SimpleTypeUnion) { - m_context->error(QtXmlPatterns::tr("variety of item type of %1 must be either atomic or union").arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); + m_context->error(QtXmlPatterns::tr("Variety of item type of %1 must be either atomic or union.").arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); return; } @@ -900,7 +900,7 @@ void XsdSchemaChecker::checkSimpleDerivationRestrictions() const AnySimpleType::List memberTypes = simpleItemType->memberTypes(); for (int j = 0; j < memberTypes.count(); ++j) { if (memberTypes.at(j)->category() != SchemaType::SimpleTypeAtomic) { - m_context->error(QtXmlPatterns::tr("variety of member types of %1 must be atomic").arg(formatType(m_namePool, simpleItemType)), XsdSchemaContext::XSDError, location); + m_context->error(QtXmlPatterns::tr("Variety of member types of %1 must be atomic.").arg(formatType(m_namePool, simpleItemType)), XsdSchemaContext::XSDError, location); return; } } @@ -915,7 +915,7 @@ void XsdSchemaChecker::checkSimpleDerivationRestrictions() const AnySimpleType::Ptr memberType = memberTypes.at(i); if (memberType->isComplexType()) { - m_context->error(QtXmlPatterns::tr("member type of simple type %1 cannot be a complex type") + m_context->error(QtXmlPatterns::tr("Member type of simple type %1 cannot be a complex type.") .arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); return; @@ -923,7 +923,7 @@ void XsdSchemaChecker::checkSimpleDerivationRestrictions() // @see http://www.w3.org/TR/xmlschema-2/#cos-no-circular-unions if (simpleType->name(m_namePool) == memberType->name(m_namePool)) { - m_context->error(QtXmlPatterns::tr("%1 is not allowed to have a member type with the same name as itself") + m_context->error(QtXmlPatterns::tr("%1 is not allowed to have a member type with the same name as itself.") .arg(formatType(m_namePool, simpleType)), XsdSchemaContext::XSDError, location); return; @@ -932,7 +932,7 @@ void XsdSchemaChecker::checkSimpleDerivationRestrictions() if (memberType->isSimpleType() && memberType->isDefinedBySchema()) { const XsdSimpleType::Ptr simpleMemberType = memberType; if (simpleMemberType->derivationConstraints() & XsdSimpleType::UnionConstraint) { - m_context->error(QtXmlPatterns::tr("%1 is not allowed to derive from %2 by union as the latter defines it as final") + m_context->error(QtXmlPatterns::tr("%1 is not allowed to derive from %2 by union as the latter defines it as final.") .arg(formatType(m_namePool, simpleType)) .arg(formatType(m_namePool, simpleMemberType)), XsdSchemaContext::XSDError, location); @@ -1006,7 +1006,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con } if ((minLengthValue->toInteger() > lengthValue->toInteger()) || !foundSuperMinimumLength) { - m_context->error(QtXmlPatterns::tr("%1 facet collides with %2 facet") + m_context->error(QtXmlPatterns::tr("%1 facet collides with %2 facet.") .arg(formatKeyword("length")) .arg(formatKeyword("minLength")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1035,7 +1035,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con } if ((maxLengthValue->toInteger() < lengthValue->toInteger()) || !foundSuperMaximumLength) { - m_context->error(QtXmlPatterns::tr("%1 facet collides with %2 facet") + m_context->error(QtXmlPatterns::tr("%1 facet collides with %2 facet.") .arg(formatKeyword("length")) .arg(formatKeyword("maxLength")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1049,7 +1049,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con if (baseFacets.contains(XsdFacet::Length)) { const DerivedInteger::Ptr baseValue = baseFacets.value(XsdFacet::Length)->value(); if (lengthValue->toInteger() != baseValue->toInteger()) { - m_context->error(QtXmlPatterns::tr("%1 facet must have the same value as %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must have the same value as %2 facet of base type.") .arg(formatKeyword("length")) .arg(formatKeyword("length")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1069,7 +1069,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con // @see http://www.w3.org/TR/xmlschema-2/#minLength-less-than-equal-to-maxLength if (maxLengthValue->toInteger() < minLengthValue->toInteger()) { - m_context->error(QtXmlPatterns::tr("%1 facet collides with %2 facet") + m_context->error(QtXmlPatterns::tr("%1 facet collides with %2 facet.") .arg(formatKeyword("minLength")) .arg(formatKeyword("maxLength")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1086,7 +1086,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con if (baseFacets.contains(XsdFacet::MinimumLength)) { const DerivedInteger::Ptr baseValue = baseFacets.value(XsdFacet::MinimumLength)->value(); if (minLengthValue->toInteger() < baseValue->toInteger()) { - m_context->error(QtXmlPatterns::tr("%1 facet must be equal or greater than %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be equal or greater than %2 facet of base type.") .arg(formatKeyword("minLength")) .arg(formatKeyword("minLength")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1105,7 +1105,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con if (baseFacets.contains(XsdFacet::MaximumLength)) { const DerivedInteger::Ptr baseValue(baseFacets.value(XsdFacet::MaximumLength)->value()); if (maxLengthValue->toInteger() > baseValue->toInteger()) { - m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet of base type.") .arg(formatKeyword("maxLength")) .arg(formatKeyword("maxLength")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1126,7 +1126,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const DerivedString::Ptr value = multiValue.at(i); const QRegExp exp = PatternPlatform::parsePattern(value->stringValue(), m_context, &reflection); if (!exp.isValid()) { - m_context->error(QtXmlPatterns::tr("%1 facet contains invalid regular expression").arg(formatKeyword("pattern")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); + m_context->error(QtXmlPatterns::tr("%1 facet contains invalid regular expression").arg(formatKeyword("pattern.")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); return; } } @@ -1141,7 +1141,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con for (int k = 0; k < notationNames.count(); ++k) { const QNameValue::Ptr notationName = notationNames.at(k); if (!m_schema->notation(notationName->qName())) { - m_context->error(QtXmlPatterns::tr("unknown notation %1 used in %2 facet") + m_context->error(QtXmlPatterns::tr("Unknown notation %1 used in %2 facet.") .arg(formatKeyword(m_namePool, notationName->qName())) .arg(formatKeyword("enumeration")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1161,7 +1161,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con QString errorMsg; if (!checker.isValidString(actualValue, baseType, errorMsg)) { - m_context->error(QtXmlPatterns::tr("%1 facet contains invalid value %2: %3") + m_context->error(QtXmlPatterns::tr("%1 facet contains invalid value %2: %3.") .arg(formatKeyword("enumeration")) .arg(formatData(stringValue)) .arg(errorMsg), @@ -1183,7 +1183,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const QString baseValue = DerivedString::Ptr(baseFacets.value(XsdFacet::WhiteSpace)->value())->stringValue(); if (value == XsdSchemaToken::toString(XsdSchemaToken::Replace) || value == XsdSchemaToken::toString(XsdSchemaToken::Preserve)) { if (baseValue == XsdSchemaToken::toString(XsdSchemaToken::Collapse)) { - m_context->error(QtXmlPatterns::tr("%1 facet cannot be %2 or %3 if %4 facet of base type is %5") + m_context->error(QtXmlPatterns::tr("%1 facet cannot be %2 or %3 if %4 facet of base type is %5.") .arg(formatKeyword("whiteSpace")) .arg(formatData("replace")) .arg(formatData("preserve")) @@ -1194,7 +1194,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con } } if (value == XsdSchemaToken::toString(XsdSchemaToken::Preserve) && baseValue == XsdSchemaToken::toString(XsdSchemaToken::Replace)) { - m_context->error(QtXmlPatterns::tr("%1 facet cannot be %2 if %3 facet of base type is %4") + m_context->error(QtXmlPatterns::tr("%1 facet cannot be %2 if %3 facet of base type is %4.") .arg(formatKeyword("whiteSpace")) .arg(formatData("preserve")) .arg(formatKeyword("whiteSpace")) @@ -1214,7 +1214,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(minFacet->value(), AtomicComparator::OperatorGreaterThan, maxFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet") + m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet.") .arg(formatKeyword("minInclusive")) .arg(formatKeyword("maxInclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1230,7 +1230,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const XsdFacet::Ptr baseFacet = baseFacets.value(XsdFacet::MaximumInclusive); if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(maxFacet->value(), AtomicComparator::OperatorGreaterThan, baseFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet of base type.") .arg(formatKeyword("maxInclusive")) .arg(formatKeyword("maxInclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1242,7 +1242,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const XsdFacet::Ptr baseFacet = baseFacets.value(XsdFacet::MaximumExclusive); if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(maxFacet->value(), AtomicComparator::OperatorGreaterOrEqual, baseFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be less than %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be less than %2 facet of base type.") .arg(formatKeyword("maxInclusive")) .arg(formatKeyword("maxExclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1257,7 +1257,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con // @see http://www.w3.org/TR/xmlschema-2/#maxInclusive-maxExclusive if (facets.contains(XsdFacet::MaximumInclusive)) { - m_context->error(QtXmlPatterns::tr("%1 facet and %2 facet cannot appear together") + m_context->error(QtXmlPatterns::tr("%1 facet and %2 facet cannot appear together.") .arg(formatKeyword("maxExclusive")) .arg(formatKeyword("maxInclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1269,7 +1269,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const XsdFacet::Ptr minFacet = facets.value(XsdFacet::MinimumExclusive); if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(minFacet->value(), AtomicComparator::OperatorGreaterThan, maxFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet") + m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet.") .arg(formatKeyword("minExclusive")) .arg(formatKeyword("maxExclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1285,7 +1285,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const XsdFacet::Ptr baseFacet = baseFacets.value(XsdFacet::MaximumExclusive); if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(maxFacet->value(), AtomicComparator::OperatorGreaterThan, baseFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet of base type.") .arg(formatKeyword("maxExclusive")) .arg(formatKeyword("maxExclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1297,7 +1297,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const XsdFacet::Ptr baseFacet = baseFacets.value(XsdFacet::MaximumInclusive); if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(maxFacet->value(), AtomicComparator::OperatorGreaterThan, baseFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet of base type.") .arg(formatKeyword("maxExclusive")) .arg(formatKeyword("maxInclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1309,7 +1309,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const XsdFacet::Ptr baseFacet = baseFacets.value(XsdFacet::MinimumInclusive); if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(maxFacet->value(), AtomicComparator::OperatorLessOrEqual, baseFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be greater than %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be greater than %2 facet of base type.") .arg(formatKeyword("maxExclusive")) .arg(formatKeyword("minInclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1321,7 +1321,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const XsdFacet::Ptr baseFacet = baseFacets.value(XsdFacet::MinimumExclusive); if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(maxFacet->value(), AtomicComparator::OperatorLessOrEqual, baseFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be greater than %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be greater than %2 facet of base type.") .arg(formatKeyword("maxExclusive")) .arg(formatKeyword("minExclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1336,7 +1336,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con // @see http://www.w3.org/TR/xmlschema-2/#minInclusive-minExclusive if (facets.contains(XsdFacet::MinimumInclusive)) { - m_context->error(QtXmlPatterns::tr("%1 facet and %2 facet cannot appear together") + m_context->error(QtXmlPatterns::tr("%1 facet and %2 facet cannot appear together.") .arg(formatKeyword("minExclusive")) .arg(formatKeyword("minInclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1348,7 +1348,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const XsdFacet::Ptr maxFacet = facets.value(XsdFacet::MaximumInclusive); if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(minFacet->value(), AtomicComparator::OperatorGreaterOrEqual, maxFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be less than %2 facet") + m_context->error(QtXmlPatterns::tr("%1 facet must be less than %2 facet.") .arg(formatKeyword("minExclusive")) .arg(formatKeyword("maxInclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1364,7 +1364,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const XsdFacet::Ptr baseFacet = baseFacets.value(XsdFacet::MinimumExclusive); if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(minFacet->value(), AtomicComparator::OperatorLessThan, baseFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be greater than or equal to %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be greater than or equal to %2 facet of base type.") .arg(formatKeyword("minExclusive")) .arg(formatKeyword("minExclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1376,7 +1376,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const XsdFacet::Ptr baseFacet = baseFacets.value(XsdFacet::MaximumExclusive); if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(minFacet->value(), AtomicComparator::OperatorGreaterOrEqual, baseFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be less than %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be less than %2 facet of base type.") .arg(formatKeyword("minExclusive")) .arg(formatKeyword("maxExclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1388,7 +1388,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const XsdFacet::Ptr baseFacet = baseFacets.value(XsdFacet::MaximumInclusive); if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(minFacet->value(), AtomicComparator::OperatorGreaterThan, baseFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet of base type.") .arg(formatKeyword("minExclusive")) .arg(formatKeyword("maxInclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1406,7 +1406,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const XsdFacet::Ptr maxFacet = facets.value(XsdFacet::MaximumExclusive); if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(minFacet->value(), AtomicComparator::OperatorGreaterOrEqual, maxFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be less than %2 facet") + m_context->error(QtXmlPatterns::tr("%1 facet must be less than %2 facet.") .arg(formatKeyword("minInclusive")) .arg(formatKeyword("maxExclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1422,7 +1422,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const XsdFacet::Ptr baseFacet = baseFacets.value(XsdFacet::MinimumInclusive); if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(minFacet->value(), AtomicComparator::OperatorLessThan, baseFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be greater than or equal to %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be greater than or equal to %2 facet of base type.") .arg(formatKeyword("minInclusive")) .arg(formatKeyword("minInclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1434,7 +1434,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const XsdFacet::Ptr baseFacet = baseFacets.value(XsdFacet::MinimumExclusive); if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(minFacet->value(), AtomicComparator::OperatorLessOrEqual, baseFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be greater than %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be greater than %2 facet of base type.") .arg(formatKeyword("minInclusive")) .arg(formatKeyword("minExclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1446,7 +1446,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const XsdFacet::Ptr baseFacet = baseFacets.value(XsdFacet::MaximumInclusive); if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(minFacet->value(), AtomicComparator::OperatorGreaterThan, baseFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet of base type.") .arg(formatKeyword("minInclusive")) .arg(formatKeyword("maxInclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1458,7 +1458,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const XsdFacet::Ptr baseFacet = baseFacets.value(XsdFacet::MaximumExclusive); if (comparableBaseType) { if (XsdSchemaHelper::constructAndCompare(minFacet->value(), AtomicComparator::OperatorGreaterOrEqual, baseFacet->value(), comparableBaseType, m_context, &reflection)) { - m_context->error(QtXmlPatterns::tr("%1 facet must be less than %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be less than %2 facet of base type.") .arg(formatKeyword("minInclusive")) .arg(formatKeyword("maxExclusive")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1480,7 +1480,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const DerivedInteger::Ptr baseValue = baseFacet->value(); if (totalDigitsValue->toInteger() > baseValue->toInteger()) { - m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet of base type.") .arg(formatKeyword("totalDigits")) .arg(formatKeyword("totalDigits")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1499,7 +1499,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const DerivedInteger::Ptr totalDigitsValue = totalDigitsFacet->value(); if (fractionDigitsValue->toInteger() > totalDigitsValue->toInteger()) { - m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet") + m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet.") .arg(formatKeyword("fractionDigits")) .arg(formatKeyword("totalDigits")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1515,7 +1515,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const DerivedInteger::Ptr baseValue = baseFacet->value(); if (fractionDigitsValue->toInteger() > baseValue->toInteger()) { - m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet of base type") + m_context->error(QtXmlPatterns::tr("%1 facet must be less than or equal to %2 facet of base type.") .arg(formatKeyword("fractionDigits")) .arg(formatKeyword("fractionDigits")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1535,7 +1535,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con QSet availableFacets = facets.keys().toSet(); if (!availableFacets.subtract(allowedFacets).isEmpty()) { - m_context->error(QtXmlPatterns::tr("simple type contains not allowed facet %1") + m_context->error(QtXmlPatterns::tr("Simple type contains not allowed facet %1.") .arg(formatKeyword(XsdFacet::typeName(availableFacets.toList().first()))), XsdSchemaContext::XSDError, sourceLocation(simpleType)); return; @@ -1547,7 +1547,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con facets.contains(XsdFacet::MaximumExclusive) || facets.contains(XsdFacet::MinimumExclusive) || facets.contains(XsdFacet::TotalDigits) || facets.contains(XsdFacet::FractionDigits)) { - m_context->error(QtXmlPatterns::tr("%1, %2, %3, %4, %5 and %6 facets are not allowed when derived by list") + m_context->error(QtXmlPatterns::tr("%1, %2, %3, %4, %5 and %6 facets are not allowed when derived by list.") .arg(formatKeyword("maxInclusive")) .arg(formatKeyword("maxExclusive")) .arg(formatKeyword("minInclusive")) @@ -1563,7 +1563,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con facets.contains(XsdFacet::MinimumLength) || facets.contains(XsdFacet::MaximumLength) || facets.contains(XsdFacet::Length) || facets.contains(XsdFacet::WhiteSpace)) { - m_context->error(QtXmlPatterns::tr("only %1 and %2 facets are allowed when derived by union") + m_context->error(QtXmlPatterns::tr("Only %1 and %2 facets are allowed when derived by union.") .arg(formatKeyword("pattern")) .arg(formatKeyword("enumeration")), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1586,7 +1586,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const DerivedString::Ptr stringValue = facet->value(); const AtomicValue::Ptr value = ValueFactory::fromLexical(stringValue->stringValue(), baseType, m_context, &reflection); if (value->hasError()) { - m_context->error(QtXmlPatterns::tr("%1 contains %2 facet with invalid data: %3") + m_context->error(QtXmlPatterns::tr("%1 contains %2 facet with invalid data: %3.") .arg(formatType(m_namePool, simpleType)) .arg(formatKeyword(XsdFacet::typeName(facet->type()))) .arg(formatData(stringValue->stringValue())), @@ -1602,7 +1602,7 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con const QString stringValue = DerivedString::Ptr(multiValue.at(j))->stringValue(); const AtomicValue::Ptr value = ValueFactory::fromLexical(stringValue, baseType, m_context, &reflection); if (value->hasError()) { - m_context->error(QtXmlPatterns::tr("%1 contains %2 facet with invalid data: %3") + m_context->error(QtXmlPatterns::tr("%1 contains %2 facet with invalid data: %3.") .arg(formatType(m_namePool, simpleType)) .arg(formatKeyword(XsdFacet::typeName(XsdFacet::Enumeration))) .arg(formatData(stringValue)), @@ -1626,7 +1626,7 @@ void XsdSchemaChecker::checkDuplicatedAttributeUses() // @see http://www.w3.org/TR/xmlschema11-1/#ct-props-correct 4) XsdAttribute::Ptr conflictingAttribute; if (hasDuplicatedAttributeUses(uses, conflictingAttribute)) { - m_context->error(QtXmlPatterns::tr("attribute group %1 contains attribute %2 twice") + m_context->error(QtXmlPatterns::tr("Attribute group %1 contains attribute %2 twice.") .arg(formatKeyword(attributeGroup->displayName(m_namePool))) .arg(formatKeyword(conflictingAttribute->displayName(m_namePool))), XsdSchemaContext::XSDError, sourceLocation(attributeGroup)); @@ -1635,7 +1635,7 @@ void XsdSchemaChecker::checkDuplicatedAttributeUses() // @see http://www.w3.org/TR/xmlschema11-1/#ct-props-correct 5) if (hasMultipleIDAttributeUses(uses)) { - m_context->error(QtXmlPatterns::tr("attribute group %1 contains two different attributes that both have types derived from %2") + m_context->error(QtXmlPatterns::tr("Attribute group %1 contains two different attributes that both have types derived from %2.") .arg(formatKeyword(attributeGroup->displayName(m_namePool))) .arg(formatType(m_namePool, BuiltinTypes::xsID)), XsdSchemaContext::XSDError, sourceLocation(attributeGroup)); @@ -1643,7 +1643,7 @@ void XsdSchemaChecker::checkDuplicatedAttributeUses() } if (hasConstraintIDAttributeUse(uses, conflictingAttribute)) { - m_context->error(QtXmlPatterns::tr("attribute group %1 contains attribute %2 that has value constraint but type that inherits from %3") + m_context->error(QtXmlPatterns::tr("Attribute group %1 contains attribute %2 that has value constraint but type that inherits from %3.") .arg(formatKeyword(attributeGroup->displayName(m_namePool))) .arg(formatKeyword(conflictingAttribute->displayName(m_namePool))) .arg(formatType(m_namePool, BuiltinTypes::xsID)), @@ -1666,7 +1666,7 @@ void XsdSchemaChecker::checkDuplicatedAttributeUses() // @see http://www.w3.org/TR/xmlschema11-1/#ct-props-correct 4) XsdAttribute::Ptr conflictingAttribute; if (hasDuplicatedAttributeUses(attributeUses, conflictingAttribute)) { - m_context->error(QtXmlPatterns::tr("complex type %1 contains attribute %2 twice") + m_context->error(QtXmlPatterns::tr("Complex type %1 contains attribute %2 twice.") .arg(formatType(m_namePool, complexType)) .arg(formatKeyword(conflictingAttribute->displayName(m_namePool))), XsdSchemaContext::XSDError, sourceLocation(complexType)); @@ -1675,7 +1675,7 @@ void XsdSchemaChecker::checkDuplicatedAttributeUses() // @see http://www.w3.org/TR/xmlschema11-1/#ct-props-correct 5) if (hasMultipleIDAttributeUses(attributeUses)) { - m_context->error(QtXmlPatterns::tr("complex type %1 contains two different attributes that both have types derived from %2") + m_context->error(QtXmlPatterns::tr("Complex type %1 contains two different attributes that both have types derived from %2.") .arg(formatType(m_namePool, complexType)) .arg(formatType(m_namePool, BuiltinTypes::xsID)), XsdSchemaContext::XSDError, sourceLocation(complexType)); @@ -1683,7 +1683,7 @@ void XsdSchemaChecker::checkDuplicatedAttributeUses() } if (hasConstraintIDAttributeUse(attributeUses, conflictingAttribute)) { - m_context->error(QtXmlPatterns::tr("complex type %1 contains attribute %2 that has value constraint but type that inherits from %3") + m_context->error(QtXmlPatterns::tr("Complex type %1 contains attribute %2 that has value constraint but type that inherits from %3.") .arg(formatType(m_namePool, complexType)) .arg(formatKeyword(conflictingAttribute->displayName(m_namePool))) .arg(formatType(m_namePool, BuiltinTypes::xsID)), @@ -1726,14 +1726,14 @@ void XsdSchemaChecker::checkElementConstraints() targetType = XsdSimpleType::Ptr(simpleType)->primitiveType(); } } else if (complexType->contentType()->variety() != XsdComplexType::ContentType::Mixed) { - m_context->error(QtXmlPatterns::tr("element %1 is not allowed to have a value constraint if its base type is complex") + m_context->error(QtXmlPatterns::tr("Element %1 is not allowed to have a value constraint if its base type is complex.") .arg(formatKeyword(element->displayName(m_namePool))), XsdSchemaContext::XSDError, sourceLocation(element)); return; } } if ((targetType == BuiltinTypes::xsID) || BuiltinTypes::xsID->wxsTypeMatches(type)) { - m_context->error(QtXmlPatterns::tr("element %1 is not allowed to have a value constraint if its type is derived from %2") + m_context->error(QtXmlPatterns::tr("Element %1 is not allowed to have a value constraint if its type is derived from %2.") .arg(formatKeyword(element->displayName(m_namePool))) .arg(formatType(m_namePool, BuiltinTypes::xsID)), XsdSchemaContext::XSDError, sourceLocation(element)); @@ -1743,7 +1743,7 @@ void XsdSchemaChecker::checkElementConstraints() if (type->isSimpleType()) { QString errorMsg; if (!isValidValue(element->valueConstraint()->value(), type, errorMsg)) { - m_context->error(QtXmlPatterns::tr("value constraint of element %1 is not of elements type: %2") + m_context->error(QtXmlPatterns::tr("Value constraint of element %1 is not of elements type: %2.") .arg(formatKeyword(element->displayName(m_namePool))) .arg(errorMsg), XsdSchemaContext::XSDError, sourceLocation(element)); @@ -1754,7 +1754,7 @@ void XsdSchemaChecker::checkElementConstraints() if (complexType->contentType()->variety() == XsdComplexType::ContentType::Simple) { QString errorMsg; if (!isValidValue(element->valueConstraint()->value(), complexType->contentType()->simpleType(), errorMsg)) { - m_context->error(QtXmlPatterns::tr("value constraint of element %1 is not of elements type: %2") + m_context->error(QtXmlPatterns::tr("Value constraint of element %1 is not of elements type: %2.") .arg(formatKeyword(element->displayName(m_namePool))) .arg(errorMsg), XsdSchemaContext::XSDError, sourceLocation(element)); @@ -1767,7 +1767,7 @@ void XsdSchemaChecker::checkElementConstraints() if (!element->substitutionGroupAffiliations().isEmpty()) { // 3 if (!element->scope() || element->scope()->variety() != XsdElement::Scope::Global) { - m_context->error(QtXmlPatterns::tr("element %1 is not allowed to have substitution group affiliation as it is no global element").arg(formatKeyword(element->displayName(m_namePool))), + m_context->error(QtXmlPatterns::tr("Element %1 is not allowed to have substitution group affiliation as it is no global element.").arg(formatKeyword(element->displayName(m_namePool))), XsdSchemaContext::XSDError, sourceLocation(element)); return; } @@ -1795,7 +1795,7 @@ void XsdSchemaChecker::checkElementConstraints() } if (!derivationOk) { - m_context->error(QtXmlPatterns::tr("type of element %1 cannot be derived from type of substitution group affiliation").arg(formatKeyword(element->displayName(m_namePool))), + m_context->error(QtXmlPatterns::tr("Type of element %1 cannot be derived from type of substitution group affiliation.").arg(formatKeyword(element->displayName(m_namePool))), XsdSchemaContext::XSDError, sourceLocation(element)); return; } @@ -1836,7 +1836,7 @@ void XsdSchemaChecker::checkAttributeConstraints() QString errorMsg; if (!isValidValue(attribute->valueConstraint()->value(), attribute->type(), errorMsg)) { - m_context->error(QtXmlPatterns::tr("value constraint of attribute %1 is not of attributes type: %2") + m_context->error(QtXmlPatterns::tr("Value constraint of attribute %1 is not of attributes type: %2.") .arg(formatKeyword(attribute->displayName(m_namePool))) .arg(errorMsg), XsdSchemaContext::XSDError, sourceLocation(attribute)); @@ -1845,7 +1845,7 @@ void XsdSchemaChecker::checkAttributeConstraints() } if (BuiltinTypes::xsID->wxsTypeMatches(attribute->type())) { - m_context->error(QtXmlPatterns::tr("attribute %1 has value constraint but has type derived from %2") + m_context->error(QtXmlPatterns::tr("Attribute %1 has value constraint but has type derived from %2.") .arg(formatKeyword(attribute->displayName(m_namePool))) .arg(formatType(m_namePool, BuiltinTypes::xsID)), XsdSchemaContext::XSDError, sourceLocation(attribute)); @@ -1901,7 +1901,7 @@ void XsdSchemaChecker::checkAttributeUseConstraints() if (baseAttributeUse->useType() == XsdAttributeUse::RequiredUse) { if (attributeUse->useType() == XsdAttributeUse::OptionalUse || attributeUse->useType() == XsdAttributeUse::ProhibitedUse) { - m_context->error(QtXmlPatterns::tr("%1 attribute in derived complex type must be %2 like in base type") + m_context->error(QtXmlPatterns::tr("%1 attribute in derived complex type must be %2 like in base type.") .arg(formatAttribute("use")) .arg(formatData("required")), XsdSchemaContext::XSDError, sourceLocation(complexType)); @@ -1912,7 +1912,7 @@ void XsdSchemaChecker::checkAttributeUseConstraints() if (baseAttributeUse->valueConstraint()) { if (baseAttributeUse->valueConstraint()->variety() == XsdAttributeUse::ValueConstraint::Fixed) { if (!attributeUse->valueConstraint()) { - m_context->error(QtXmlPatterns::tr("attribute %1 in derived complex type must have %2 value constraint like in base type") + m_context->error(QtXmlPatterns::tr("Attribute %1 in derived complex type must have %2 value constraint like in base type.") .arg(formatKeyword(attributeUse->attribute()->displayName(m_namePool))) .arg(formatData("fixed")), XsdSchemaContext::XSDError, sourceLocation(complexType)); @@ -1921,14 +1921,14 @@ void XsdSchemaChecker::checkAttributeUseConstraints() if (attributeUse->valueConstraint()->variety() == XsdAttributeUse::ValueConstraint::Fixed) { const XsdTypeChecker checker(m_context, QVector(), sourceLocation(complexType)); if (!checker.valuesAreEqual(attributeUse->valueConstraint()->value(), baseAttributeUse->valueConstraint()->value(), attributeUse->attribute()->type())) { - m_context->error(QtXmlPatterns::tr("attribute %1 in derived complex type must have the same %2 value constraint like in base type") + m_context->error(QtXmlPatterns::tr("Attribute %1 in derived complex type must have the same %2 value constraint like in base type.") .arg(formatKeyword(attributeUse->attribute()->displayName(m_namePool))) .arg(formatData("fixed")), XsdSchemaContext::XSDError, sourceLocation(complexType)); return; } } else { - m_context->error(QtXmlPatterns::tr("attribute %1 in derived complex type must have %2 value constraint") + m_context->error(QtXmlPatterns::tr("Attribute %1 in derived complex type must have %2 value constraint.") .arg(formatKeyword(attributeUse->attribute()->displayName(m_namePool))) .arg(formatData("fixed")), XsdSchemaContext::XSDError, sourceLocation(complexType)); @@ -1946,7 +1946,7 @@ void XsdSchemaChecker::checkAttributeUseConstraints() const XsdWildcard::Ptr derivedWildcard(complexType->attributeWildcard()); if (baseWildcard && derivedWildcard) { if (!XsdSchemaHelper::checkWildcardProcessContents(baseWildcard, derivedWildcard)) { - m_context->error(QtXmlPatterns::tr("processContent of base wildcard must be weaker than derived wildcard"), XsdSchemaContext::XSDError, sourceLocation(complexType)); + m_context->error(QtXmlPatterns::tr("processContent of base wildcard must be weaker than derived wildcard."), XsdSchemaContext::XSDError, sourceLocation(complexType)); return; } } @@ -1985,7 +1985,7 @@ void XsdSchemaChecker::checkElementDuplicates(const XsdParticle::Ptr &particle, if (elementMap.contains(element->name(m_namePool))) { if (element->type() != elementMap.value(element->name(m_namePool))) { - m_context->error(QtXmlPatterns::tr("element %1 exists twice with different types") + m_context->error(QtXmlPatterns::tr("Element %1 exists twice with different types.") .arg(formatKeyword(element->displayName(m_namePool))), XsdSchemaContext::XSDError, sourceLocation(element)); return; @@ -2000,7 +2000,7 @@ void XsdSchemaChecker::checkElementDuplicates(const XsdParticle::Ptr &particle, const XsdElement::Ptr substElement = substElements.at(i); if (elementMap.contains(substElement->name(m_namePool))) { if (substElement->type() != elementMap.value(substElement->name(m_namePool))) { - m_context->error(QtXmlPatterns::tr("element %1 exists twice with different types") + m_context->error(QtXmlPatterns::tr("Element %1 exists twice with different types.") .arg(formatKeyword(substElement->displayName(m_namePool))), XsdSchemaContext::XSDError, sourceLocation(element)); return; @@ -2028,7 +2028,7 @@ void XsdSchemaChecker::checkElementDuplicates(const XsdParticle::Ptr &particle, } if (error) { - m_context->error(QtXmlPatterns::tr("particle contains non-deterministic wildcards"), XsdSchemaContext::XSDError, sourceLocation(wildcard)); + m_context->error(QtXmlPatterns::tr("Particle contains non-deterministic wildcards."), XsdSchemaContext::XSDError, sourceLocation(wildcard)); return; } else { wildcardMap.insert(wildcard->namespaceConstraint()->variety(), wildcard); diff --git a/src/xmlpatterns/schema/qxsdschemahelper.cpp b/src/xmlpatterns/schema/qxsdschemahelper.cpp index 3173498..a56f3ef 100644 --- a/src/xmlpatterns/schema/qxsdschemahelper.cpp +++ b/src/xmlpatterns/schema/qxsdschemahelper.cpp @@ -688,13 +688,13 @@ bool XsdSchemaHelper::isValidAttributeUsesRestriction(const XsdAttributeUse::Lis // 2.1.1 if (baseAttributeUse->isRequired() == true && derivedAttributeUse->isRequired() == false) { - errorMsg = QtXmlPatterns::tr("base attribute %1 is required but derived attribute is not").arg(formatAttribute(baseAttributeUse->attribute()->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Base attribute %1 is required but derived attribute is not.").arg(formatAttribute(baseAttributeUse->attribute()->displayName(namePool))); return false; } // 2.1.2 if (!isSimpleDerivationOk(derivedAttributeUse->attribute()->type(), baseAttributeUse->attribute()->type(), SchemaType::DerivationConstraints())) { - errorMsg = QtXmlPatterns::tr("type of derived attribute %1 cannot be validly derived from type of base attribute").arg(formatAttribute(derivedAttributeUse->attribute()->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Type of derived attribute %1 cannot be validly derived from type of base attribute.").arg(formatAttribute(derivedAttributeUse->attribute()->displayName(namePool))); return false; } @@ -722,12 +722,12 @@ bool XsdSchemaHelper::isValidAttributeUsesRestriction(const XsdAttributeUse::Lis } if (!ok) { - errorMsg = QtXmlPatterns::tr("value constraint of derived attribute %1 does not match value constraint of base attribute").arg(formatAttribute(derivedAttributeUse->attribute()->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Value constraint of derived attribute %1 does not match value constraint of base attribute.").arg(formatAttribute(derivedAttributeUse->attribute()->displayName(namePool))); return false; } } else { if (!wildcard) { - errorMsg = QtXmlPatterns::tr("derived attribute %1 does not exists in the base definition").arg(formatAttribute(derivedAttributeUse->attribute()->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Derived attribute %1 does not exists in the base definition.").arg(formatAttribute(derivedAttributeUse->attribute()->displayName(namePool))); return false; } @@ -738,7 +738,7 @@ bool XsdSchemaHelper::isValidAttributeUsesRestriction(const XsdAttributeUse::Lis name.setNamespaceURI(namePool->allocateNamespace(XsdWildcard::absentNamespace())); if (!wildcardAllowsExpandedName(name, wildcard, namePool)) { - errorMsg = QtXmlPatterns::tr("derived attribute %1 does not match the wildcard in the base definition").arg(formatAttribute(derivedAttributeUse->attribute()->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Derived attribute %1 does not match the wildcard in the base definition.").arg(formatAttribute(derivedAttributeUse->attribute()->displayName(namePool))); return false; } } @@ -751,11 +751,11 @@ bool XsdSchemaHelper::isValidAttributeUsesRestriction(const XsdAttributeUse::Lis if (baseAttributeUse->isRequired()) { if (derivedAttributeUsesLookup.contains(baseAttributeUse->attribute()->name(namePool))) { if (!derivedAttributeUsesLookup.value(baseAttributeUse->attribute()->name(namePool))->isRequired()) { - errorMsg = QtXmlPatterns::tr("base attribute %1 is required but derived attribute is not").arg(formatAttribute(baseAttributeUse->attribute()->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Base attribute %1 is required but derived attribute is not.").arg(formatAttribute(baseAttributeUse->attribute()->displayName(namePool))); return false; } } else { - errorMsg = QtXmlPatterns::tr("base attribute %1 is required but missing in derived definition").arg(formatAttribute(baseAttributeUse->attribute()->displayName(namePool))); + errorMsg = QtXmlPatterns::tr("Base attribute %1 is required but missing in derived definition.").arg(formatAttribute(baseAttributeUse->attribute()->displayName(namePool))); return false; } } @@ -764,17 +764,17 @@ bool XsdSchemaHelper::isValidAttributeUsesRestriction(const XsdAttributeUse::Lis // 4 if (derivedWildcard) { if (!wildcard) { - errorMsg = QtXmlPatterns::tr("derived definition contains an %1 element that does not exists in the base definition").arg(formatElement("anyAttribute")); + errorMsg = QtXmlPatterns::tr("Derived definition contains an %1 element that does not exists in the base definition").arg(formatElement("anyAttribute.")); return false; } if (!isWildcardSubset(derivedWildcard, wildcard)) { - errorMsg = QtXmlPatterns::tr("derived wildcard is not a subset of the base wildcard"); + errorMsg = QtXmlPatterns::tr("Derived wildcard is not a subset of the base wildcard."); return false; } if (!checkWildcardProcessContents(wildcard, derivedWildcard)) { - errorMsg = QtXmlPatterns::tr("%1 of derived wildcard is not a valid restriction of %2 of base wildcard").arg(formatKeyword("processContents")).arg(formatKeyword("processContents")); + errorMsg = QtXmlPatterns::tr("%1 of derived wildcard is not a valid restriction of %2 of base wildcard").arg(formatKeyword("processContents")).arg(formatKeyword("processContents.")); return false; } } @@ -797,12 +797,12 @@ bool XsdSchemaHelper::isValidAttributeUsesExtension(const XsdAttributeUse::List for (int i = 0; i < attributeUses.count(); ++i) { const QXmlName attributeName = attributeUses.at(i)->attribute()->name(namePool); if (!lookupHash.contains(attributeName)) { - errorMsg = QtXmlPatterns::tr("attribute %1 from base type is missing in derived type").arg(formatKeyword(namePool->displayName(attributeName))); + errorMsg = QtXmlPatterns::tr("Attribute %1 from base type is missing in derived type.").arg(formatKeyword(namePool->displayName(attributeName))); return false; } if (lookupHash.value(attributeName)->type() != attributeUses.at(i)->attribute()->type()) { - errorMsg = QtXmlPatterns::tr("type of derived attribute %1 differs from type of base attribute").arg(formatKeyword(namePool->displayName(attributeName))); + errorMsg = QtXmlPatterns::tr("Type of derived attribute %1 differs from type of base attribute.").arg(formatKeyword(namePool->displayName(attributeName))); return false; } } @@ -810,7 +810,7 @@ bool XsdSchemaHelper::isValidAttributeUsesExtension(const XsdAttributeUse::List // 1.3 if (wildcard) { if (!derivedWildcard) { - errorMsg = QtXmlPatterns::tr("base definition contains an %1 element that is missing in the derived definition").arg(formatElement("anyAttribute")); + errorMsg = QtXmlPatterns::tr("Base definition contains an %1 element that is missing in the derived definition").arg(formatElement("anyAttribute.")); return false; } } diff --git a/src/xmlpatterns/schema/qxsdschemaparser.cpp b/src/xmlpatterns/schema/qxsdschemaparser.cpp index 19a8425..8f7b6af 100644 --- a/src/xmlpatterns/schema/qxsdschemaparser.cpp +++ b/src/xmlpatterns/schema/qxsdschemaparser.cpp @@ -166,7 +166,7 @@ class TagValidationHandler for (int i = 0; i < tokens.count(); ++i) elementNames.append(formatElement(XsdSchemaToken::toString(tokens.at(i)))); - m_parser->error(QtXmlPatterns::tr("can not process unknown element %1, expected elements are: %2") + m_parser->error(QtXmlPatterns::tr("Can not process unknown element %1, expected elements are: %2.") .arg(formatElement(m_parser->name().toString())) .arg(elementNames.join(QLatin1String(", ")))); return; @@ -179,7 +179,7 @@ class TagValidationHandler for (int i = 0; i < tokens.count(); ++i) elementNames.append(formatElement(XsdSchemaToken::toString(tokens.at(i)))); - m_parser->error(QtXmlPatterns::tr("element %1 is not allowed in this scope, possible elements are: %2") + m_parser->error(QtXmlPatterns::tr("Element %1 is not allowed in this scope, possible elements are: %2.") .arg(formatElement(XsdSchemaToken::toString(token))) .arg(elementNames.join(QLatin1String(", ")))); return; @@ -195,7 +195,7 @@ class TagValidationHandler for (int i = 0; i < tokens.count(); ++i) elementNames.append(formatElement(XsdSchemaToken::toString(tokens.at(i)))); - m_parser->error(QtXmlPatterns::tr("child element is missing in that scope, possible child elements are: %1") + m_parser->error(QtXmlPatterns::tr("Child element is missing in that scope, possible child elements are: %1.") .arg(elementNames.join(QLatin1String(", ")))); } } @@ -322,7 +322,7 @@ bool XsdSchemaParser::parse(ParserType parserType) if (isSchemaTag(XsdSchemaToken::Schema, token, namespaceToken)) { parseSchema(parserType); } else { - error(QtXmlPatterns::tr("document is not a XML schema")); + error(QtXmlPatterns::tr("Document is not a XML schema.")); } } } @@ -344,13 +344,13 @@ void XsdSchemaParser::error(const QString &msg) void XsdSchemaParser::attributeContentError(const char *attributeName, const char *elementName, const QString &value, const SchemaType::Ptr &type) { if (type) { - error(QtXmlPatterns::tr("%1 attribute of %2 element contains invalid content: {%3} is not a value of type %4") + error(QtXmlPatterns::tr("%1 attribute of %2 element contains invalid content: {%3} is not a value of type %4.") .arg(formatAttribute(attributeName)) .arg(formatElement(elementName)) .arg(formatData(value)) .arg(formatType(m_namePool, type))); } else { - error(QtXmlPatterns::tr("%1 attribute of %2 element contains invalid content: {%3}") + error(QtXmlPatterns::tr("%1 attribute of %2 element contains invalid content: {%3}.") .arg(formatAttribute(attributeName)) .arg(formatElement(elementName)) .arg(formatData(value))); @@ -376,7 +376,7 @@ void XsdSchemaParser::parseSchema(ParserType parserType) const QString targetNamespace = readNamespaceAttribute(QString::fromLatin1("targetNamespace"), "schema"); if (m_targetNamespace != targetNamespace) { - error(QtXmlPatterns::tr("target namespace %1 of included schema is different from the target namespace %2 as defined by the including schema") + error(QtXmlPatterns::tr("Target namespace %1 of included schema is different from the target namespace %2 as defined by the including schema.") .arg(formatURI(targetNamespace)).arg(formatURI(m_targetNamespace))); return; } @@ -390,7 +390,7 @@ void XsdSchemaParser::parseSchema(ParserType parserType) } if (m_targetNamespace != targetNamespace) { - error(QtXmlPatterns::tr("target namespace %1 of imported schema is different from the target namespace %2 as defined by the importing schema") + error(QtXmlPatterns::tr("Target namespace %1 of imported schema is different from the target namespace %2 as defined by the importing schema.") .arg(formatURI(targetNamespace)).arg(formatURI(m_targetNamespace))); return; } @@ -401,7 +401,7 @@ void XsdSchemaParser::parseSchema(ParserType parserType) const QString targetNamespace = readNamespaceAttribute(QString::fromLatin1("targetNamespace"), "schema"); if (m_targetNamespace != targetNamespace) { - error(QtXmlPatterns::tr("target namespace %1 of imported schema is different from the target namespace %2 as defined by the importing schema") + error(QtXmlPatterns::tr("Target namespace %1 of imported schema is different from the target namespace %2 as defined by the importing schema.") .arg(formatURI(targetNamespace)).arg(formatURI(m_targetNamespace))); return; } @@ -638,7 +638,7 @@ void XsdSchemaParser::parseImport() if (hasAttribute(QString::fromLatin1("namespace"))) { importNamespace = readAttribute(QString::fromLatin1("namespace")); if (importNamespace == m_targetNamespace) { - error(QtXmlPatterns::tr("%1 element is not allowed to have the same %2 attribute value as the target namespace %3") + error(QtXmlPatterns::tr("%1 element is not allowed to have the same %2 attribute value as the target namespace %3.") .arg(formatElement("import")) .arg(formatAttribute("namespace")) .arg(formatURI(m_targetNamespace))); @@ -646,7 +646,7 @@ void XsdSchemaParser::parseImport() } } else { if (m_targetNamespace.isEmpty()) { - error(QtXmlPatterns::tr("%1 element without %2 attribute is not allowed inside schema without target namespace") + error(QtXmlPatterns::tr("%1 element without %2 attribute is not allowed inside schema without target namespace.") .arg(formatElement("import")) .arg(formatAttribute("namespace"))); return; @@ -1479,7 +1479,7 @@ void XsdSchemaParser::parseSimpleRestriction(const XsdSimpleType::Ptr &ptr) ptr->addAnnotation(annotation); } else if (isSchemaTag(XsdSchemaToken::SimpleType, token, namespaceToken)) { if (hasBaseAttribute) { - error(QtXmlPatterns::tr("%1 element is not allowed inside %2 element if %3 attribute is present") + error(QtXmlPatterns::tr("%1 element is not allowed inside %2 element if %3 attribute is present.") .arg(formatElement("simpleType")) .arg(formatElement("restriction")) .arg(formatAttribute("base"))); @@ -1540,7 +1540,7 @@ void XsdSchemaParser::parseSimpleRestriction(const XsdSimpleType::Ptr &ptr) } if (!hasBaseTypeSpecified) { - error(QtXmlPatterns::tr("%1 element has neither %2 attribute nor %3 child element") + error(QtXmlPatterns::tr("%1 element has neither %2 attribute nor %3 child element.") .arg(formatElement("restriction")) .arg(formatAttribute("base")) .arg(formatElement("simpleType"))); @@ -1637,7 +1637,7 @@ void XsdSchemaParser::parseList(const XsdSimpleType::Ptr &ptr) ptr->addAnnotation(annotation); } else if (isSchemaTag(XsdSchemaToken::SimpleType, token, namespaceToken)) { if (hasItemTypeAttribute) { - error(QtXmlPatterns::tr("%1 element is not allowed inside %2 element if %3 attribute is present") + error(QtXmlPatterns::tr("%1 element is not allowed inside %2 element if %3 attribute is present.") .arg(formatElement("simpleType")) .arg(formatElement("list")) .arg(formatAttribute("itemType"))); @@ -1659,7 +1659,7 @@ void XsdSchemaParser::parseList(const XsdSimpleType::Ptr &ptr) } if (!hasItemTypeSpecified) { - error(QtXmlPatterns::tr("%1 element has neither %2 attribute nor %3 child element") + error(QtXmlPatterns::tr("%1 element has neither %2 attribute nor %3 child element.") .arg(formatElement("list")) .arg(formatAttribute("itemType")) .arg(formatElement("simpleType"))); @@ -1751,7 +1751,7 @@ void XsdSchemaParser::parseUnion(const XsdSimpleType::Ptr &ptr) } if (!hasMemberTypesSpecified) { - error(QtXmlPatterns::tr("%1 element has neither %2 attribute nor %3 child element") + error(QtXmlPatterns::tr("%1 element has neither %2 attribute nor %3 child element.") .arg(formatElement("union")) .arg(formatAttribute("memberTypes")) .arg(formatElement("simpleType"))); @@ -2586,7 +2586,7 @@ XsdComplexType::Ptr XsdSchemaParser::parseGlobalComplexType() complexType->addAnnotation(annotation); } else if (isSchemaTag(XsdSchemaToken::SimpleContent, token, namespaceToken)) { if (effectiveMixed) { - error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute") + error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute.") .arg(formatElement("complexType")) .arg(formatElement("simpleContent")) .arg(formatAttribute("mixed"))); @@ -3588,7 +3588,7 @@ XsdModelGroup::Ptr XsdSchemaParser::parseAll(const NamedSchemaComponent::Ptr &pa particle->setTerm(term); if (particle->maximumOccursUnbounded() || particle->maximumOccurs() > 1) { - error(QtXmlPatterns::tr("%1 attribute of %2 element must be %3 or %4") + error(QtXmlPatterns::tr("%1 attribute of %2 element must be %3 or %4.") .arg(formatAttribute("maxOccurs")) .arg(formatElement("all")) .arg(formatData("0")) @@ -3624,14 +3624,14 @@ XsdModelGroup::Ptr XsdSchemaParser::parseLocalAll(const XsdParticle::Ptr &partic return modelGroup; } if (particle->maximumOccursUnbounded() || particle->maximumOccurs() != 1) { - error(QtXmlPatterns::tr("%1 attribute of %2 element must have a value of %3") + error(QtXmlPatterns::tr("%1 attribute of %2 element must have a value of %3.") .arg(formatAttribute("maxOccurs")) .arg(formatElement("all")) .arg(formatData("1"))); return modelGroup; } if (particle->minimumOccurs() != 0 && particle->minimumOccurs() != 1) { - error(QtXmlPatterns::tr("%1 attribute of %2 element must have a value of %3 or %4") + error(QtXmlPatterns::tr("%1 attribute of %2 element must have a value of %3 or %4.") .arg(formatAttribute("minOccurs")) .arg(formatElement("all")) .arg(formatData("0")) @@ -3665,7 +3665,7 @@ XsdModelGroup::Ptr XsdSchemaParser::parseLocalAll(const XsdParticle::Ptr &partic particle->setTerm(term); if (particle->maximumOccursUnbounded() || particle->maximumOccurs() > 1) { - error(QtXmlPatterns::tr("%1 attribute of %2 element must have a value of %3 or %4") + error(QtXmlPatterns::tr("%1 attribute of %2 element must have a value of %3 or %4.") .arg(formatAttribute("maxOccurs")) .arg(formatElement("all")) .arg(formatData("0")) @@ -3984,7 +3984,7 @@ XsdAttribute::Ptr XsdSchemaParser::parseGlobalAttribute() attribute->scope()->setVariety(XsdAttribute::Scope::Global); if (hasAttribute(QString::fromLatin1("default")) && hasAttribute(QString::fromLatin1("fixed"))) { - error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together") + error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together.") .arg(formatElement("attribute")) .arg(formatAttribute("default")) .arg(formatAttribute("fixed"))); @@ -4011,14 +4011,14 @@ XsdAttribute::Ptr XsdSchemaParser::parseGlobalAttribute() (m_namePool->stringForLocalName(objectName.localName()) != QString::fromLatin1("schemaLocation")) && (m_namePool->stringForLocalName(objectName.localName()) != QString::fromLatin1("noNamespaceSchemaLocation"))) { - error(QtXmlPatterns::tr("content of %1 attribute of %2 element must not be from namespace %3") + error(QtXmlPatterns::tr("Content of %1 attribute of %2 element must not be from namespace %3.") .arg(formatAttribute("name")) .arg(formatElement("attribute")) .arg(formatURI(CommonNamespaces::XSI))); return attribute; } if (m_namePool->stringForLocalName(objectName.localName()) == QString::fromLatin1("xmlns")) { - error(QtXmlPatterns::tr("%1 attribute of %2 element must not be %3") + error(QtXmlPatterns::tr("%1 attribute of %2 element must not be %3.") .arg(formatAttribute("name")) .arg(formatElement("attribute")) .arg(formatData("xmlns"))); @@ -4060,7 +4060,7 @@ XsdAttribute::Ptr XsdSchemaParser::parseGlobalAttribute() attribute->addAnnotation(annotation); } else if (isSchemaTag(XsdSchemaToken::SimpleType, token, namespaceToken)) { if (hasTypeAttribute) { - error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute") + error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute.") .arg(formatElement("attribute")) .arg(formatElement("simpleType")) .arg(formatAttribute("type"))); @@ -4113,7 +4113,7 @@ XsdAttributeUse::Ptr XsdSchemaParser::parseLocalAttribute(const NamedSchemaCompo } if (hasAttribute(QString::fromLatin1("default")) && hasAttribute(QString::fromLatin1("fixed"))) { - error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together") + error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together.") .arg(formatElement("attribute")) .arg(formatAttribute("default")) .arg(formatAttribute("fixed"))); @@ -4122,21 +4122,21 @@ XsdAttributeUse::Ptr XsdSchemaParser::parseLocalAttribute(const NamedSchemaCompo if (hasRefAttribute) { if (hasAttribute(QString::fromLatin1("form"))) { - error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together") + error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together.") .arg(formatElement("attribute")) .arg(formatAttribute("ref")) .arg(formatAttribute("form"))); return attributeUse; } if (hasAttribute(QString::fromLatin1("name"))) { - error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together") + error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together.") .arg(formatElement("attribute")) .arg(formatAttribute("ref")) .arg(formatAttribute("name"))); return attributeUse; } if (hasAttribute(QString::fromLatin1("type"))) { - error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together") + error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together.") .arg(formatElement("attribute")) .arg(formatAttribute("ref")) .arg(formatAttribute("type"))); @@ -4176,7 +4176,7 @@ XsdAttributeUse::Ptr XsdSchemaParser::parseLocalAttribute(const NamedSchemaCompo attributeUse->setUseType(XsdAttributeUse::RequiredUse); if (attributeUse->valueConstraint() && attributeUse->valueConstraint()->variety() == XsdAttributeUse::ValueConstraint::Default && value != QString::fromLatin1("optional")) { - error(QtXmlPatterns::tr("%1 attribute of %2 element must have the value %3 because the %4 attribute is set") + error(QtXmlPatterns::tr("%1 attribute of %2 element must have the value %3 because the %4 attribute is set.") .arg(formatAttribute("use")) .arg(formatElement("attribute")) .arg(formatData("optional")) @@ -4233,14 +4233,14 @@ XsdAttributeUse::Ptr XsdSchemaParser::parseLocalAttribute(const NamedSchemaCompo (m_namePool->stringForLocalName(objectName.localName()) != QString::fromLatin1("schemaLocation")) && (m_namePool->stringForLocalName(objectName.localName()) != QString::fromLatin1("noNamespaceSchemaLocation"))) { - error(QtXmlPatterns::tr("content of %1 attribute of %2 element must not be from namespace %3") + error(QtXmlPatterns::tr("Content of %1 attribute of %2 element must not be from namespace %3.") .arg(formatAttribute("name")) .arg(formatElement("attribute")) .arg(formatURI(CommonNamespaces::XSI))); return attributeUse; } if (m_namePool->stringForLocalName(objectName.localName()) == QString::fromLatin1("xmlns")) { - error(QtXmlPatterns::tr("%1 attribute of %2 element must not be %3") + error(QtXmlPatterns::tr("%1 attribute of %2 element must not be %3.") .arg(formatAttribute("name")) .arg(formatElement("attribute")) .arg(formatData("xmlns"))); @@ -4292,14 +4292,14 @@ XsdAttributeUse::Ptr XsdSchemaParser::parseLocalAttribute(const NamedSchemaCompo attribute->addAnnotation(annotation); } else if (isSchemaTag(XsdSchemaToken::SimpleType, token, namespaceToken)) { if (hasTypeAttribute) { - error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute") + error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute.") .arg(formatElement("attribute")) .arg(formatElement("simpleType")) .arg(formatAttribute("type"))); break; } if (hasRefAttribute) { - error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute") + error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute.") .arg(formatElement("attribute")) .arg(formatElement("simpleType")) .arg(formatAttribute("ref"))); @@ -4363,7 +4363,7 @@ XsdAttributeGroup::Ptr XsdSchemaParser::parseNamedAttributeGroup() const XsdAttributeUse::Ptr attributeUse = parseLocalAttribute(attributeGroup); if (attributeUse->useType() == XsdAttributeUse::ProhibitedUse) { - warning(QtXmlPatterns::tr("specifying use='prohibited' inside an attribute group has no effect")); + warning(QtXmlPatterns::tr("Specifying use='prohibited' inside an attribute group has no effect.")); } else { attributeGroup->addAttributeUse(attributeUse); } @@ -4463,7 +4463,7 @@ XsdElement::Ptr XsdSchemaParser::parseGlobalElement() } if (hasAttribute(QString::fromLatin1("default")) && hasAttribute(QString::fromLatin1("fixed"))) { - error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together") + error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together.") .arg(formatElement("element")) .arg(formatAttribute("default")) .arg(formatAttribute("fixed"))); @@ -4559,7 +4559,7 @@ XsdElement::Ptr XsdSchemaParser::parseGlobalElement() element->addAnnotation(annotation); } else if (isSchemaTag(XsdSchemaToken::SimpleType, token, namespaceToken)) { if (hasTypeAttribute) { - error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute") + error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute.") .arg(formatElement("element")) .arg(formatElement("simpleType")) .arg(formatAttribute("type"))); @@ -4576,7 +4576,7 @@ XsdElement::Ptr XsdSchemaParser::parseGlobalElement() hasTypeSpecified = true; } else if (isSchemaTag(XsdSchemaToken::ComplexType, token, namespaceToken)) { if (hasTypeAttribute) { - error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute") + error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute.") .arg(formatElement("element")) .arg(formatElement("complexType")) .arg(formatAttribute("type"))); @@ -4666,43 +4666,43 @@ XsdTerm::Ptr XsdSchemaParser::parseLocalElement(const XsdParticle::Ptr &particle if (hasRefAttribute) { if (hasAttribute(QString::fromLatin1("name"))) { - error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together") + error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together.") .arg(formatElement("element")) .arg(formatAttribute("ref")) .arg(formatAttribute("name"))); return term; } else if (hasAttribute(QString::fromLatin1("block"))) { - error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together") + error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together.") .arg(formatElement("element")) .arg(formatAttribute("ref")) .arg(formatAttribute("block"))); return term; } else if (hasAttribute(QString::fromLatin1("nillable"))) { - error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together") + error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together.") .arg(formatElement("element")) .arg(formatAttribute("ref")) .arg(formatAttribute("nillable"))); return term; } else if (hasAttribute(QString::fromLatin1("default"))) { - error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together") + error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together.") .arg(formatElement("element")) .arg(formatAttribute("ref")) .arg(formatAttribute("default"))); return term; } else if (hasAttribute(QString::fromLatin1("fixed"))) { - error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together") + error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together.") .arg(formatElement("element")) .arg(formatAttribute("ref")) .arg(formatAttribute("fixed"))); return term; } else if (hasAttribute(QString::fromLatin1("form"))) { - error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together") + error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together.") .arg(formatElement("element")) .arg(formatAttribute("ref")) .arg(formatAttribute("form"))); return term; } else if (hasAttribute(QString::fromLatin1("type"))) { - error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together") + error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together.") .arg(formatElement("element")) .arg(formatAttribute("ref")) .arg(formatAttribute("type"))); @@ -4716,7 +4716,7 @@ XsdTerm::Ptr XsdSchemaParser::parseLocalElement(const XsdParticle::Ptr &particle } if (!hasAttribute(QString::fromLatin1("name")) && !hasAttribute(QString::fromLatin1("ref"))) { - error(QtXmlPatterns::tr("%1 element must have either %2 or %3 attribute") + error(QtXmlPatterns::tr("%1 element must have either %2 or %3 attribute.") .arg(formatElement("element")) .arg(formatAttribute("name")) .arg(formatAttribute("ref"))); @@ -4779,7 +4779,7 @@ XsdTerm::Ptr XsdSchemaParser::parseLocalElement(const XsdParticle::Ptr &particle } if (hasAttribute(QString::fromLatin1("default")) && hasAttribute(QString::fromLatin1("fixed"))) { - error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together") + error(QtXmlPatterns::tr("%1 element must not have %2 and %3 attribute together.") .arg(formatElement("element")) .arg(formatAttribute("default")) .arg(formatAttribute("fixed"))); @@ -4834,13 +4834,13 @@ XsdTerm::Ptr XsdSchemaParser::parseLocalElement(const XsdParticle::Ptr &particle element->addAnnotation(annotation); } else if (isSchemaTag(XsdSchemaToken::SimpleType, token, namespaceToken)) { if (hasRefAttribute) { - error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute") + error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute.") .arg(formatElement("element")) .arg(formatElement("simpleType")) .arg(formatAttribute("ref"))); return term; } else if (hasTypeAttribute) { - error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute") + error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute.") .arg(formatElement("element")) .arg(formatElement("simpleType")) .arg(formatAttribute("type"))); @@ -4857,13 +4857,13 @@ XsdTerm::Ptr XsdSchemaParser::parseLocalElement(const XsdParticle::Ptr &particle hasTypeSpecified = true; } else if (isSchemaTag(XsdSchemaToken::ComplexType, token, namespaceToken)) { if (hasRefAttribute) { - error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute") + error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute.") .arg(formatElement("element")) .arg(formatElement("complexType")) .arg(formatAttribute("ref"))); return term; } else if (hasTypeAttribute) { - error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute") + error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute.") .arg(formatElement("element")) .arg(formatElement("complexType")) .arg(formatAttribute("type"))); @@ -4880,7 +4880,7 @@ XsdTerm::Ptr XsdSchemaParser::parseLocalElement(const XsdParticle::Ptr &particle hasTypeSpecified = true; } else if (isSchemaTag(XsdSchemaToken::Alternative, token, namespaceToken)) { if (hasRefAttribute) { - error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute") + error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute.") .arg(formatElement("element")) .arg(formatElement("alternative")) .arg(formatAttribute("ref"))); @@ -4891,7 +4891,7 @@ XsdTerm::Ptr XsdSchemaParser::parseLocalElement(const XsdParticle::Ptr &particle alternatives.append(alternative); } else if (isSchemaTag(XsdSchemaToken::Unique, token, namespaceToken)) { if (hasRefAttribute) { - error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute") + error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute.") .arg(formatElement("element")) .arg(formatElement("unique")) .arg(formatAttribute("ref"))); @@ -4902,7 +4902,7 @@ XsdTerm::Ptr XsdSchemaParser::parseLocalElement(const XsdParticle::Ptr &particle element->addIdentityConstraint(constraint); } else if (isSchemaTag(XsdSchemaToken::Key, token, namespaceToken)) { if (hasRefAttribute) { - error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute") + error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute.") .arg(formatElement("element")) .arg(formatElement("key")) .arg(formatAttribute("ref"))); @@ -4913,7 +4913,7 @@ XsdTerm::Ptr XsdSchemaParser::parseLocalElement(const XsdParticle::Ptr &particle element->addIdentityConstraint(constraint); } else if (isSchemaTag(XsdSchemaToken::Keyref, token, namespaceToken)) { if (hasRefAttribute) { - error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute") + error(QtXmlPatterns::tr("%1 element with %2 child element must not have a %3 attribute.") .arg(formatElement("element")) .arg(formatElement("keyref")) .arg(formatAttribute("ref"))); @@ -5270,7 +5270,7 @@ XsdAlternative::Ptr XsdSchemaParser::parseAlternative() tagValidator.finalize(); if (!hasTypeSpecified) { - error(QtXmlPatterns::tr("%1 element must have either %2 attribute or %3 or %4 as child element") + error(QtXmlPatterns::tr("%1 element must have either %2 attribute or %3 or %4 as child element.") .arg(formatElement("alternative")) .arg(formatAttribute("type")) .arg(formatElement("simpleType")) @@ -5325,7 +5325,7 @@ XsdNotation::Ptr XsdSchemaParser::parseNotation() } if (!hasOptionalAttribute) { - error(QtXmlPatterns::tr("%1 element requires either %2 or %3 attribute") + error(QtXmlPatterns::tr("%1 element requires either %2 or %3 attribute.") .arg(formatElement("notation")) .arg(formatAttribute("public")) .arg(formatAttribute("system"))); @@ -5344,7 +5344,7 @@ XsdNotation::Ptr XsdSchemaParser::parseNotation() if (isCharacters() || isEntityReference()) { if (!text().toString().trimmed().isEmpty()) { - error(QtXmlPatterns::tr("text or entity references not allowed inside %1 element").arg(formatElement("notation"))); + error(QtXmlPatterns::tr("Text or entity references not allowed inside %1 element").arg(formatElement("notation."))); return notation; } } @@ -5385,7 +5385,7 @@ XsdWildcard::Ptr XsdSchemaParser::parseAny(const XsdParticle::Ptr &particle) if (hasAttribute(QString::fromLatin1("namespace"))) { const QSet values = readAttribute(QString::fromLatin1("namespace")).split(QLatin1Char(' '), QString::SkipEmptyParts).toSet(); if ((values.contains(QString::fromLatin1("##any")) || values.contains(QString::fromLatin1("##other"))) && values.count() != 1) { - error(QtXmlPatterns::tr("%1 attribute of %2 element must contain %3, %4 or a list of URIs") + error(QtXmlPatterns::tr("%1 attribute of %2 element must contain %3, %4 or a list of URIs.") .arg(formatAttribute("namespace")) .arg(formatElement("any")) .arg(formatData("##any")) @@ -5497,7 +5497,7 @@ XsdWildcard::Ptr XsdSchemaParser::parseAnyAttribute() if (hasAttribute(QString::fromLatin1("namespace"))) { const QSet values = readAttribute(QString::fromLatin1("namespace")).split(QLatin1Char(' '), QString::SkipEmptyParts).toSet(); if ((values.contains(QString::fromLatin1("##any")) || values.contains(QString::fromLatin1("##other"))) && values.count() != 1) { - error(QtXmlPatterns::tr("%1 attribute of %2 element must contain %3, %4 or a list of URIs") + error(QtXmlPatterns::tr("%1 attribute of %2 element must contain %3, %4 or a list of URIs.") .arg(formatAttribute("namespace")) .arg(formatElement("anyAttribute")) .arg(formatData("##any")) @@ -5623,7 +5623,7 @@ void XsdSchemaParser::parseUnknown() m_namespaceSupport.pushContext(); m_namespaceSupport.setPrefixes(namespaceDeclarations()); - error(QtXmlPatterns::tr("%1 element is not allowed in this context").arg(formatElement(name().toString()))); + error(QtXmlPatterns::tr("%1 element is not allowed in this context.").arg(formatElement(name().toString()))); while (!atEnd()) { readNext(); @@ -5676,7 +5676,7 @@ bool XsdSchemaParser::parseMinMaxConstraint(const XsdParticle::Ptr &particle, co if (!particle->maximumOccursUnbounded()) { if (particle->maximumOccurs() < particle->minimumOccurs()) { - error(QtXmlPatterns::tr("%1 attribute of %2 element has larger value than %3 attribute") + error(QtXmlPatterns::tr("%1 attribute of %2 element has larger value than %3 attribute.") .arg(formatAttribute("minOccurs")) .arg(formatElement(elementName)) .arg(formatAttribute("maxOccurs"))); @@ -5701,7 +5701,7 @@ void XsdSchemaParser::convertName(const QString &qualifiedName, NamespaceSupport { bool result = m_namespaceSupport.processName(qualifiedName, type, name); if (!result) { - error(QtXmlPatterns::tr("prefix of qualified name %1 is not defined").arg(formatKeyword(qualifiedName))); + error(QtXmlPatterns::tr("Prefix of qualified name %1 is not defined.").arg(formatKeyword(qualifiedName))); } } @@ -5766,7 +5766,7 @@ SchemaType::DerivationConstraints XsdSchemaParser::readDerivationConstraintAttri } if ((value == QString::fromLatin1("#all")) && values.count() != 1) { - error(QtXmlPatterns::tr("%1 attribute of %2 element must either contain %3 or the other values") + error(QtXmlPatterns::tr("%1 attribute of %2 element must either contain %3 or the other values.") .arg(formatAttribute("final")) .arg(formatElement(elementName)) .arg(formatData("#all"))); @@ -5827,7 +5827,7 @@ NamedSchemaComponent::BlockingConstraints XsdSchemaParser::readBlockingConstrain } if ((value == QString::fromLatin1("#all")) && values.count() != 1) { - error(QtXmlPatterns::tr("%1 attribute of %2 element must either contain %3 or the other values") + error(QtXmlPatterns::tr("%1 attribute of %2 element must either contain %3 or the other values.") .arg(formatAttribute("block")) .arg(formatElement(elementName)) .arg(formatData("#all"))); @@ -5958,7 +5958,7 @@ void XsdSchemaParser::validateIdAttribute(const char *elementName) attributeContentError("id", elementName, value, BuiltinTypes::xsID); } else { if (m_idCache->hasId(value)) { - error(QtXmlPatterns::tr("component with id %1 has been defined previously").arg(formatData(value))); + error(QtXmlPatterns::tr("Component with id %1 has been defined previously.").arg(formatData(value))); } else { m_idCache->addId(value); } @@ -5975,7 +5975,7 @@ void XsdSchemaParser::addElement(const XsdElement::Ptr &element) { const QXmlName objectName = element->name(m_namePool); if (m_schema->element(objectName)) { - error(QtXmlPatterns::tr("element %1 already defined").arg(formatElement(m_namePool->displayName(objectName)))); + error(QtXmlPatterns::tr("Element %1 already defined.").arg(formatElement(m_namePool->displayName(objectName)))); } else { m_schema->addElement(element); m_componentLocationHash.insert(element, currentSourceLocation()); @@ -5986,7 +5986,7 @@ void XsdSchemaParser::addAttribute(const XsdAttribute::Ptr &attribute) { const QXmlName objectName = attribute->name(m_namePool); if (m_schema->attribute(objectName)) { - error(QtXmlPatterns::tr("attribute %1 already defined").arg(formatAttribute(m_namePool->displayName(objectName)))); + error(QtXmlPatterns::tr("Attribute %1 already defined.").arg(formatAttribute(m_namePool->displayName(objectName)))); } else { m_schema->addAttribute(attribute); m_componentLocationHash.insert(attribute, currentSourceLocation()); @@ -6001,7 +6001,7 @@ void XsdSchemaParser::addType(const SchemaType::Ptr &type) const QXmlName objectName = type->name(m_namePool); if (m_schema->type(objectName)) { - error(QtXmlPatterns::tr("type %1 already defined").arg(formatType(m_namePool, objectName))); + error(QtXmlPatterns::tr("Type %1 already defined.").arg(formatType(m_namePool, objectName))); } else { m_schema->addType(type); if (type->isSimpleType()) @@ -6024,7 +6024,7 @@ void XsdSchemaParser::addAttributeGroup(const XsdAttributeGroup::Ptr &group) { const QXmlName objectName = group->name(m_namePool); if (m_schema->attributeGroup(objectName)) { - error(QtXmlPatterns::tr("attribute group %1 already defined").arg(formatKeyword(m_namePool, objectName))); + error(QtXmlPatterns::tr("Attribute group %1 already defined.").arg(formatKeyword(m_namePool, objectName))); } else { m_schema->addAttributeGroup(group); m_componentLocationHash.insert(group, currentSourceLocation()); @@ -6035,7 +6035,7 @@ void XsdSchemaParser::addElementGroup(const XsdModelGroup::Ptr &group) { const QXmlName objectName = group->name(m_namePool); if (m_schema->elementGroup(objectName)) { - error(QtXmlPatterns::tr("element group %1 already defined").arg(formatKeyword(m_namePool, objectName))); + error(QtXmlPatterns::tr("Element group %1 already defined.").arg(formatKeyword(m_namePool, objectName))); } else { m_schema->addElementGroup(group); m_componentLocationHash.insert(group, currentSourceLocation()); @@ -6046,7 +6046,7 @@ void XsdSchemaParser::addNotation(const XsdNotation::Ptr ¬ation) { const QXmlName objectName = notation->name(m_namePool); if (m_schema->notation(objectName)) { - error(QtXmlPatterns::tr("notation %1 already defined").arg(formatKeyword(m_namePool, objectName))); + error(QtXmlPatterns::tr("Notation %1 already defined.").arg(formatKeyword(m_namePool, objectName))); } else { m_schema->addNotation(notation); m_componentLocationHash.insert(notation, currentSourceLocation()); @@ -6057,7 +6057,7 @@ void XsdSchemaParser::addIdentityConstraint(const XsdIdentityConstraint::Ptr &co { const QXmlName objectName = constraint->name(m_namePool); if (m_schema->identityConstraint(objectName)) { - error(QtXmlPatterns::tr("identity constraint %1 already defined").arg(formatKeyword(m_namePool, objectName))); + error(QtXmlPatterns::tr("Identity constraint %1 already defined.").arg(formatKeyword(m_namePool, objectName))); } else { m_schema->addIdentityConstraint(constraint); m_componentLocationHash.insert(constraint, currentSourceLocation()); @@ -6068,7 +6068,7 @@ void XsdSchemaParser::addFacet(const XsdFacet::Ptr &facet, XsdFacet::Hash &facet { // @see http://www.w3.org/TR/xmlschema-2/#src-single-facet-value if (facets.contains(facet->type())) { - error(QtXmlPatterns::tr("duplicated facets in simple type %1").arg(formatType(m_namePool, type))); + error(QtXmlPatterns::tr("Duplicated facets in simple type %1.").arg(formatType(m_namePool, type))); return; } diff --git a/src/xmlpatterns/schema/qxsdschemaresolver.cpp b/src/xmlpatterns/schema/qxsdschemaresolver.cpp index d71f482..3ec598d 100644 --- a/src/xmlpatterns/schema/qxsdschemaresolver.cpp +++ b/src/xmlpatterns/schema/qxsdschemaresolver.cpp @@ -351,7 +351,7 @@ void XsdSchemaResolver::resolveKeyReferences() const XsdIdentityConstraint::Ptr constraint = m_schema->identityConstraint(ref.reference); if (!constraint) { - m_context->error(QtXmlPatterns::tr("%1 references unknown %2 or %3 element %4") + m_context->error(QtXmlPatterns::tr("%1 references unknown %2 or %3 element %4.") .arg(formatKeyword(ref.keyRef->displayName(m_namePool))) .arg(formatElement("key")) .arg(formatElement("unique")) @@ -361,7 +361,7 @@ void XsdSchemaResolver::resolveKeyReferences() } if (constraint->category() != XsdIdentityConstraint::Key && constraint->category() != XsdIdentityConstraint::Unique) { // only key and unique can be referenced - m_context->error(QtXmlPatterns::tr("%1 references identity constraint %2 that is no %3 or %4 element") + m_context->error(QtXmlPatterns::tr("%1 references identity constraint %2 that is no %3 or %4 element.") .arg(formatKeyword(ref.keyRef->displayName(m_namePool))) .arg(formatKeyword(m_namePool, ref.reference)) .arg(formatElement("key")) @@ -371,7 +371,7 @@ void XsdSchemaResolver::resolveKeyReferences() } if (constraint->fields().count() != ref.keyRef->fields().count()) { - m_context->error(QtXmlPatterns::tr("%1 has a different number of fields from the identity constraint %2 that it references") + m_context->error(QtXmlPatterns::tr("%1 has a different number of fields from the identity constraint %2 that it references.") .arg(formatKeyword(ref.keyRef->displayName(m_namePool))) .arg(formatKeyword(m_namePool, ref.reference)), XsdSchemaContext::XSDError, ref.location); @@ -394,7 +394,7 @@ void XsdSchemaResolver::resolveSimpleRestrictionBaseTypes() // maybe it's a basic type... type = m_context->schemaTypeFactory()->createSchemaType(item.baseName); if (!type) { - m_context->error(QtXmlPatterns::tr("base type %1 of %2 element cannot be resolved") + m_context->error(QtXmlPatterns::tr("Base type %1 of %2 element cannot be resolved.") .arg(formatType(m_namePool, item.baseName)) .arg(formatElement("restriction")), XsdSchemaContext::XSDError, item.location); @@ -478,7 +478,7 @@ void XsdSchemaResolver::resolveSimpleListType() // maybe it's a basic type... type = m_context->schemaTypeFactory()->createSchemaType(item.typeName); if (!type) { - m_context->error(QtXmlPatterns::tr("item type %1 of %2 element cannot be resolved") + m_context->error(QtXmlPatterns::tr("Item type %1 of %2 element cannot be resolved.") .arg(formatType(m_namePool, item.typeName)) .arg(formatElement("list")), XsdSchemaContext::XSDError, item.location); @@ -509,7 +509,7 @@ void XsdSchemaResolver::resolveSimpleUnionTypes() // maybe it's a basic type... type = m_context->schemaTypeFactory()->createSchemaType(typeName); if (!type) { - m_context->error(QtXmlPatterns::tr("member type %1 of %2 element cannot be resolved") + m_context->error(QtXmlPatterns::tr("Member type %1 of %2 element cannot be resolved.") .arg(formatType(m_namePool, typeName)) .arg(formatElement("union")), XsdSchemaContext::XSDError, item.location); @@ -537,7 +537,7 @@ void XsdSchemaResolver::resolveElementTypes() // maybe it's a basic type... type = m_context->schemaTypeFactory()->createSchemaType(item.typeName); if (!type) { - m_context->error(QtXmlPatterns::tr("type %1 of %2 element cannot be resolved") + m_context->error(QtXmlPatterns::tr("Type %1 of %2 element cannot be resolved.") .arg(formatType(m_namePool, item.typeName)) .arg(formatElement("element")), XsdSchemaContext::XSDError, item.location); @@ -559,7 +559,7 @@ void XsdSchemaResolver::resolveComplexBaseTypes() // maybe it's a basic type... type = m_context->schemaTypeFactory()->createSchemaType(item.baseName); if (!type) { - m_context->error(QtXmlPatterns::tr("base type %1 of complex type cannot be resolved").arg(formatType(m_namePool, item.baseName)), XsdSchemaContext::XSDError, item.location); + m_context->error(QtXmlPatterns::tr("Base type %1 of complex type cannot be resolved.").arg(formatType(m_namePool, item.baseName)), XsdSchemaContext::XSDError, item.location); return; } } @@ -568,7 +568,7 @@ void XsdSchemaResolver::resolveComplexBaseTypes() if (type->isComplexType() && type->isDefinedBySchema()) { const XsdComplexType::Ptr baseType = type; if (baseType->contentType()->variety() != XsdComplexType::ContentType::Simple) { - m_context->error(QtXmlPatterns::tr("%1 cannot have complex base type that has a %2") + m_context->error(QtXmlPatterns::tr("%1 cannot have complex base type that has a %2.") .arg(formatElement("simpleContent")) .arg(formatElement("complexContent")), XsdSchemaContext::XSDError, item.location); @@ -847,13 +847,13 @@ void XsdSchemaResolver::resolveComplexContentComplexTypes(const XsdComplexType:: group->setCompositor(XsdModelGroup::SequenceCompositor); if (effectiveContent && effectiveContent->term()->isModelGroup() && XsdModelGroup::Ptr(effectiveContent->term())->compositor() == XsdModelGroup::AllCompositor) { - m_context->error(QtXmlPatterns::tr("content model of complex type %1 contains %2 element so it cannot be derived by extension from a non-empty type") + m_context->error(QtXmlPatterns::tr("Content model of complex type %1 contains %2 element so it cannot be derived by extension from a non-empty type.") .arg(formatType(m_namePool, complexType)).arg(formatKeyword("all")), XsdSchemaContext::XSDError, sourceLocation(complexType)); return; } if (baseParticle && baseParticle->term()->isModelGroup() && XsdModelGroup::Ptr(baseParticle->term())->compositor() == XsdModelGroup::AllCompositor) { - m_context->error(QtXmlPatterns::tr("complex type %1 cannot be derived by extension from %2 as the latter contains %3 element in its content model") + m_context->error(QtXmlPatterns::tr("Complex type %1 cannot be derived by extension from %2 as the latter contains %3 element in its content model.") .arg(formatType(m_namePool, complexType)) .arg(formatType(m_namePool, baseType)) .arg(formatKeyword("all")), XsdSchemaContext::XSDError, sourceLocation(complexType)); @@ -945,7 +945,7 @@ void XsdSchemaResolver::resolveAttributeTypes() // maybe it's a basic type... type = m_context->schemaTypeFactory()->createSchemaType(item.typeName); if (!type) { - m_context->error(QtXmlPatterns::tr("type %1 of %2 element cannot be resolved") + m_context->error(QtXmlPatterns::tr("Type %1 of %2 element cannot be resolved.") .arg(formatType(m_namePool, item.typeName)) .arg(formatElement("attribute")), XsdSchemaContext::XSDError, item.location); @@ -954,7 +954,7 @@ void XsdSchemaResolver::resolveAttributeTypes() } if (!type->isSimpleType() && type->category() != SchemaType::None) { - m_context->error(QtXmlPatterns::tr("type of %1 element must be a simple type, %2 is not") + m_context->error(QtXmlPatterns::tr("Type of %1 element must be a simple type, %2 is not.") .arg(formatElement("attribute")) .arg(formatType(m_namePool, item.typeName)), XsdSchemaContext::XSDError, item.location); @@ -975,7 +975,7 @@ void XsdSchemaResolver::resolveAlternativeTypes() // maybe it's a basic type... type = m_context->schemaTypeFactory()->createSchemaType(item.typeName); if (!type) { - m_context->error(QtXmlPatterns::tr("type %1 of %2 element cannot be resolved") + m_context->error(QtXmlPatterns::tr("Type %1 of %2 element cannot be resolved.") .arg(formatType(m_namePool, item.typeName)) .arg(formatElement("alternative")), XsdSchemaContext::XSDError, item.location); @@ -1016,7 +1016,7 @@ void XsdSchemaResolver::resolveSubstitutionGroupAffiliations() for (int j = 0; j < item.elementNames.count(); ++j) { const XsdElement::Ptr element = m_schema->element(item.elementNames.at(j)); if (!element) { - m_context->error(QtXmlPatterns::tr("substitution group %1 of %2 element cannot be resolved") + m_context->error(QtXmlPatterns::tr("Substitution group %1 of %2 element cannot be resolved.") .arg(formatKeyword(m_namePool, item.elementNames.at(j))) .arg(formatElement("element")), XsdSchemaContext::XSDError, item.location); @@ -1025,7 +1025,7 @@ void XsdSchemaResolver::resolveSubstitutionGroupAffiliations() // @see http://www.w3.org/TR/xmlschema11-1/#e-props-correct 5) if (hasCircularSubstitutionGroup(element, item.element, m_namePool)) { - m_context->error(QtXmlPatterns::tr("substitution group %1 has circular definition").arg(formatKeyword(m_namePool, item.elementNames.at(j))), XsdSchemaContext::XSDError, item.location); + m_context->error(QtXmlPatterns::tr("Substitution group %1 has circular definition.").arg(formatKeyword(m_namePool, item.elementNames.at(j))), XsdSchemaContext::XSDError, item.location); return; } @@ -1145,14 +1145,14 @@ void XsdSchemaResolver::resolveTermReference(const XsdParticle::Ptr &particle, Q if (element->name(m_namePool) == otherElement->name(m_namePool)) { if (modelGroup->compositor() == XsdModelGroup::AllCompositor) { - m_context->error(QtXmlPatterns::tr("duplicated element names %1 in %2 element") + m_context->error(QtXmlPatterns::tr("Duplicated element names %1 in %2 element.") .arg(formatKeyword(element->displayName(m_namePool))) .arg(formatElement("all")), XsdSchemaContext::XSDError, sourceLocation(modelGroup)); return; } else if (modelGroup->compositor() == XsdModelGroup::SequenceCompositor) { if (element->type() != otherElement->type()) { // not same variety - m_context->error(QtXmlPatterns::tr("duplicated element names %1 in %2 element") + m_context->error(QtXmlPatterns::tr("Duplicated element names %1 in %2 element.") .arg(formatKeyword(element->displayName(m_namePool))) .arg(formatElement("sequence")), XsdSchemaContext::XSDError, sourceLocation(modelGroup)); @@ -1181,7 +1181,7 @@ void XsdSchemaResolver::resolveTermReference(const XsdParticle::Ptr &particle, Q if (element) { particle->setTerm(element); } else { - m_context->error(QtXmlPatterns::tr("reference %1 of %2 element cannot be resolved") + m_context->error(QtXmlPatterns::tr("Reference %1 of %2 element cannot be resolved.") .arg(formatKeyword(m_namePool, reference->referenceName())) .arg(formatElement("element")), XsdSchemaContext::XSDError, reference->sourceLocation()); @@ -1194,7 +1194,7 @@ void XsdSchemaResolver::resolveTermReference(const XsdParticle::Ptr &particle, Q const XsdModelGroup::Ptr modelGroup = m_schema->elementGroup(reference->referenceName()); if (modelGroup) { if (visitedGroups.contains(modelGroup->name(m_namePool))) { - m_context->error(QtXmlPatterns::tr("circular group reference for %1").arg(formatKeyword(modelGroup->displayName(m_namePool))), + m_context->error(QtXmlPatterns::tr("Circular group reference for %1.").arg(formatKeyword(modelGroup->displayName(m_namePool))), XsdSchemaContext::XSDError, reference->sourceLocation()); } else { visitedGroups.insert(modelGroup->name(m_namePool)); @@ -1210,12 +1210,12 @@ void XsdSchemaResolver::resolveTermReference(const XsdParticle::Ptr &particle, Q if (modelGroup->compositor() == XsdModelGroup::AllCompositor) { if (m_allGroups.contains(reference)) { - m_context->error(QtXmlPatterns::tr("%1 element is not allowed in this scope").arg(formatElement("all")), + m_context->error(QtXmlPatterns::tr("%1 element is not allowed in this scope").arg(formatElement("all.")), XsdSchemaContext::XSDError, reference->sourceLocation()); return; } if (particle->maximumOccursUnbounded() || particle->maximumOccurs() != 1) { - m_context->error(QtXmlPatterns::tr("%1 element cannot have %2 attribute with value other than %3") + m_context->error(QtXmlPatterns::tr("%1 element cannot have %2 attribute with value other than %3.") .arg(formatElement("all")) .arg(formatAttribute("maxOccurs")) .arg(formatData("1")), @@ -1223,7 +1223,7 @@ void XsdSchemaResolver::resolveTermReference(const XsdParticle::Ptr &particle, Q return; } if (particle->minimumOccurs() != 0 && particle->minimumOccurs() != 1) { - m_context->error(QtXmlPatterns::tr("%1 element cannot have %2 attribute with value other than %3 or %4") + m_context->error(QtXmlPatterns::tr("%1 element cannot have %2 attribute with value other than %3 or %4.") .arg(formatElement("all")) .arg(formatAttribute("minOccurs")) .arg(formatData("0")) @@ -1233,7 +1233,7 @@ void XsdSchemaResolver::resolveTermReference(const XsdParticle::Ptr &particle, Q } } } else { - m_context->error(QtXmlPatterns::tr("reference %1 of %2 element cannot be resolved") + m_context->error(QtXmlPatterns::tr("Reference %1 of %2 element cannot be resolved.") .arg(formatKeyword(m_namePool, reference->referenceName())) .arg(formatElement("group")), XsdSchemaContext::XSDError, reference->sourceLocation()); @@ -1304,7 +1304,7 @@ XsdAttributeUse::List XsdSchemaResolver::resolveAttributeTermReferences(const Xs // lookup the real attribute const XsdAttribute::Ptr attribute = m_schema->attribute(reference->referenceName()); if (!attribute) { - m_context->error(QtXmlPatterns::tr("reference %1 of %2 element cannot be resolved") + m_context->error(QtXmlPatterns::tr("Reference %1 of %2 element cannot be resolved.") .arg(formatKeyword(m_namePool, reference->referenceName())) .arg(formatElement("attribute")), XsdSchemaContext::XSDError, reference->sourceLocation()); @@ -1314,7 +1314,7 @@ XsdAttributeUse::List XsdSchemaResolver::resolveAttributeTermReferences(const Xs // if both, reference and definition have a fixed or default value set, then they must be equal if (attribute->valueConstraint() && attributeUse->valueConstraint()) { if (attribute->valueConstraint()->value() != attributeUse->valueConstraint()->value()) { - m_context->error(QtXmlPatterns::tr("%1 or %2 attribute of reference %3 does not match with the attribute declaration %4") + m_context->error(QtXmlPatterns::tr("%1 or %2 attribute of reference %3 does not match with the attribute declaration %4.") .arg(formatAttribute("fixed")) .arg(formatAttribute("default")) .arg(formatKeyword(m_namePool, reference->referenceName())) @@ -1332,14 +1332,14 @@ XsdAttributeUse::List XsdSchemaResolver::resolveAttributeTermReferences(const Xs } else if (reference->type() == XsdAttributeReference::AttributeGroup) { const XsdAttributeGroup::Ptr attributeGroup = m_schema->attributeGroup(reference->referenceName()); if (!attributeGroup) { - m_context->error(QtXmlPatterns::tr("reference %1 of %2 element cannot be resolved") + m_context->error(QtXmlPatterns::tr("Reference %1 of %2 element cannot be resolved.") .arg(formatKeyword(m_namePool, reference->referenceName())) .arg(formatElement("attributeGroup")), XsdSchemaContext::XSDError, reference->sourceLocation()); return XsdAttributeUse::List(); } if (visitedAttributeGroups.contains(attributeGroup->name(m_namePool))) { - m_context->error(QtXmlPatterns::tr("attribute group %1 has circular reference").arg(formatKeyword(m_namePool, reference->referenceName())), + m_context->error(QtXmlPatterns::tr("Attribute group %1 has circular reference.").arg(formatKeyword(m_namePool, reference->referenceName())), XsdSchemaContext::XSDError, reference->sourceLocation()); return XsdAttributeUse::List(); } else { @@ -1470,7 +1470,7 @@ void XsdSchemaResolver::resolveAttributeInheritance(const XsdComplexType::Ptr &c // check if prohibited usage is violated if ((use->useType() == XsdAttributeUse::ProhibitedUse) && (currentUses.at(k)->useType() != XsdAttributeUse::ProhibitedUse)) { - m_context->error(QtXmlPatterns::tr("%1 attribute in %2 must have %3 use like in base type %4") + m_context->error(QtXmlPatterns::tr("%1 attribute in %2 must have %3 use like in base type %4.") .arg(formatAttribute(use->attribute()->displayName(m_namePool))) .arg(formatType(m_namePool, complexType)) .arg(formatData("prohibited")) @@ -1522,14 +1522,14 @@ void XsdSchemaResolver::resolveAttributeInheritance(const XsdComplexType::Ptr &c if (complexType->attributeWildcard()) { if (complexBaseType->attributeWildcard()) { if (!isValidWildcardRestriction(complexType->attributeWildcard(), complexBaseType->attributeWildcard())) { - m_context->error(QtXmlPatterns::tr("attribute wildcard of %1 is not a valid restriction of attribute wildcard of base type %2") + m_context->error(QtXmlPatterns::tr("Attribute wildcard of %1 is not a valid restriction of attribute wildcard of base type %2.") .arg(formatType(m_namePool, complexType)) .arg(formatType(m_namePool, complexBaseType)), XsdSchemaContext::XSDError, sourceLocation(complexType)); return; } } else { - m_context->error(QtXmlPatterns::tr("%1 has attribute wildcard but its base type %2 has not") + m_context->error(QtXmlPatterns::tr("%1 has attribute wildcard but its base type %2 has not.") .arg(formatType(m_namePool, complexType)) .arg(formatType(m_namePool, complexBaseType)), XsdSchemaContext::XSDError, sourceLocation(complexType)); @@ -1555,7 +1555,7 @@ void XsdSchemaResolver::resolveAttributeInheritance(const XsdComplexType::Ptr &c unionWildcard->setProcessContents(completeWildcard->processContents()); complexType->setAttributeWildcard(unionWildcard); // 2.2.2.3 } else { - m_context->error(QtXmlPatterns::tr("union of attribute wildcard of type %1 and attribute wildcard of its base type %2 is not expressible") + m_context->error(QtXmlPatterns::tr("Union of attribute wildcard of type %1 and attribute wildcard of its base type %2 is not expressible.") .arg(formatType(m_namePool, complexType)) .arg(formatType(m_namePool, complexBaseType)), XsdSchemaContext::XSDError, sourceLocation(complexType)); @@ -1603,7 +1603,7 @@ void XsdSchemaResolver::resolveEnumerationFacetValues() const QString qualifiedName = value->as >()->stringValue(); if (!XPathHelper::isQName(qualifiedName)) { - m_context->error(QtXmlPatterns::tr("enumeration facet contains invalid content: {%1} is not a value of type %2") + m_context->error(QtXmlPatterns::tr("Enumeration facet contains invalid content: {%1} is not a value of type %2.") .arg(formatData(qualifiedName)) .arg(formatType(m_namePool, BuiltinTypes::xsQName)), XsdSchemaContext::XSDError, sourceLocation(simpleType)); @@ -1613,7 +1613,7 @@ void XsdSchemaResolver::resolveEnumerationFacetValues() QXmlName qNameValue; bool result = support.processName(qualifiedName, NamespaceSupport::ElementName, qNameValue); if (!result) { - m_context->error(QtXmlPatterns::tr("namespace prefix of qualified name %1 is not defined").arg(formatData(qualifiedName)), + m_context->error(QtXmlPatterns::tr("Namespace prefix of qualified name %1 is not defined.").arg(formatData(qualifiedName)), XsdSchemaContext::XSDError, sourceLocation(simpleType)); return; } @@ -1664,7 +1664,7 @@ void XsdSchemaResolver::checkRedefinedGroups() // so that we can pass them to XsdParticleChecker::subsumes() QString errorMsg; if (!XsdParticleChecker::subsumes(particle, redefinedParticle, m_context, errorMsg)) { - m_context->error(QtXmlPatterns::tr("%1 element %2 is not a valid restriction of the %3 element it redefines: %4") + m_context->error(QtXmlPatterns::tr("%1 element %2 is not a valid restriction of the %3 element it redefines: %4.") .arg(formatElement("group")) .arg(formatData(item.redefinedGroup->displayName(m_namePool))) .arg(formatElement("group")) @@ -1682,7 +1682,7 @@ void XsdSchemaResolver::checkRedefinedAttributeGroups() QString errorMsg; if (!XsdSchemaHelper::isValidAttributeGroupRestriction(item.redefinedGroup, item.group, m_context, errorMsg)) { - m_context->error(QtXmlPatterns::tr("%1 element %2 is not a valid restriction of the %3 element it redefines: %4") + m_context->error(QtXmlPatterns::tr("%1 element %2 is not a valid restriction of the %3 element it redefines: %4.") .arg(formatElement("attributeGroup")) .arg(formatData(item.redefinedGroup->displayName(m_namePool))) .arg(formatElement("attributeGroup")) diff --git a/src/xmlpatterns/schema/qxsdtypechecker.cpp b/src/xmlpatterns/schema/qxsdtypechecker.cpp index 0d957b6..4eb10dc 100644 --- a/src/xmlpatterns/schema/qxsdtypechecker.cpp +++ b/src/xmlpatterns/schema/qxsdtypechecker.cpp @@ -230,14 +230,14 @@ bool XsdTypeChecker::isValidString(const QString &normalizedString, const AnySim // special QName check if (BuiltinTypes::xsQName->wxsTypeMatches(type)) { if (!XPathHelper::isQName(normalizedString)) { - errorMsg = QtXmlPatterns::tr("%1 is not valid according to %2").arg(formatData(normalizedString)).arg(formatType(m_namePool, type)); + errorMsg = QtXmlPatterns::tr("%1 is not valid according to %2.").arg(formatData(normalizedString)).arg(formatType(m_namePool, type)); return false; } } const AtomicValue::Ptr value = fromLexical(normalizedString, type, m_context, m_reflection); if (value->hasError()) { - errorMsg = QtXmlPatterns::tr("%1 is not valid according to %2").arg(formatData(normalizedString)).arg(formatType(m_namePool, type)); + errorMsg = QtXmlPatterns::tr("%1 is not valid according to %2.").arg(formatData(normalizedString)).arg(formatType(m_namePool, type)); return false; } @@ -258,7 +258,7 @@ bool XsdTypeChecker::isValidString(const QString &normalizedString, const AnySim const AtomicValue::Ptr value = fromLexical(normalizedString, targetType, m_context, m_reflection); if (value->hasError()) { - errorMsg = QtXmlPatterns::tr("%1 is not valid according to %2").arg(formatData(normalizedString)).arg(formatType(m_namePool, targetType)); + errorMsg = QtXmlPatterns::tr("%1 is not valid according to %2.").arg(formatData(normalizedString)).arg(formatType(m_namePool, targetType)); return false; } @@ -425,7 +425,7 @@ bool XsdTypeChecker::checkConstrainingFacetsString(const QString &value, const X const XsdFacet::Ptr facet = facets.value(XsdFacet::Length); const DerivedInteger::Ptr length = facet->value(); if (length->toInteger() != value.length()) { - errorMsg = QtXmlPatterns::tr("string content does not match the length facet"); + errorMsg = QtXmlPatterns::tr("String content does not match the length facet."); return false; } } @@ -433,7 +433,7 @@ bool XsdTypeChecker::checkConstrainingFacetsString(const QString &value, const X const XsdFacet::Ptr facet = facets.value(XsdFacet::MinimumLength); const DerivedInteger::Ptr length = facet->value(); if (length->toInteger() > value.length()) { - errorMsg = QtXmlPatterns::tr("string content does not match the minLength facet"); + errorMsg = QtXmlPatterns::tr("String content does not match the minLength facet."); return false; } } @@ -441,7 +441,7 @@ bool XsdTypeChecker::checkConstrainingFacetsString(const QString &value, const X const XsdFacet::Ptr facet = facets.value(XsdFacet::MaximumLength); const DerivedInteger::Ptr length = facet->value(); if (length->toInteger() < value.length()) { - errorMsg = QtXmlPatterns::tr("string content does not match the maxLength facet"); + errorMsg = QtXmlPatterns::tr("String content does not match the maxLength facet."); return false; } } @@ -459,7 +459,7 @@ bool XsdTypeChecker::checkConstrainingFacetsString(const QString &value, const X } if (!found) { - errorMsg = QtXmlPatterns::tr("string content does not match pattern facet"); + errorMsg = QtXmlPatterns::tr("String content does not match pattern facet."); return false; } } @@ -477,7 +477,7 @@ bool XsdTypeChecker::checkConstrainingFacetsString(const QString &value, const X } if (!found) { - errorMsg = QtXmlPatterns::tr("string content is not listed in the enumeration facet"); + errorMsg = QtXmlPatterns::tr("String content is not listed in the enumeration facet."); return false; } } @@ -494,7 +494,7 @@ bool XsdTypeChecker::checkConstrainingFacetsSignedInteger(long long value, const const XsdFacet::Ptr facet = facets.value(XsdFacet::MaximumInclusive); const Numeric::Ptr facetValue = ValueFactory::fromLexical(facet->value()->as >()->stringValue(), BuiltinTypes::xsLong, m_context, m_reflection); if (facetValue->toInteger() < value) { - errorMsg = QtXmlPatterns::tr("signed integer content does not match the maxInclusive facet"); + errorMsg = QtXmlPatterns::tr("Signed integer content does not match the maxInclusive facet."); return false; } } @@ -502,7 +502,7 @@ bool XsdTypeChecker::checkConstrainingFacetsSignedInteger(long long value, const const XsdFacet::Ptr facet = facets.value(XsdFacet::MaximumExclusive); const Numeric::Ptr facetValue = ValueFactory::fromLexical(facet->value()->as >()->stringValue(), BuiltinTypes::xsLong, m_context, m_reflection); if (facetValue->toInteger() <= value) { - errorMsg = QtXmlPatterns::tr("signed integer content does not match the maxExclusive facet"); + errorMsg = QtXmlPatterns::tr("Signed integer content does not match the maxExclusive facet."); return false; } } @@ -510,7 +510,7 @@ bool XsdTypeChecker::checkConstrainingFacetsSignedInteger(long long value, const const XsdFacet::Ptr facet = facets.value(XsdFacet::MinimumInclusive); const Numeric::Ptr facetValue = ValueFactory::fromLexical(facet->value()->as >()->stringValue(), BuiltinTypes::xsLong, m_context, m_reflection); if (facetValue->toInteger() > value) { - errorMsg = QtXmlPatterns::tr("signed integer content does not match the minInclusive facet"); + errorMsg = QtXmlPatterns::tr("Signed integer content does not match the minInclusive facet."); return false; } } @@ -518,7 +518,7 @@ bool XsdTypeChecker::checkConstrainingFacetsSignedInteger(long long value, const const XsdFacet::Ptr facet = facets.value(XsdFacet::MinimumExclusive); const Numeric::Ptr facetValue = ValueFactory::fromLexical(facet->value()->as >()->stringValue(), BuiltinTypes::xsLong, m_context, m_reflection); if (facetValue->toInteger() >= value) { - errorMsg = QtXmlPatterns::tr("signed integer content does not match the minExclusive facet"); + errorMsg = QtXmlPatterns::tr("Signed integer content does not match the minExclusive facet."); return false; } } @@ -536,7 +536,7 @@ bool XsdTypeChecker::checkConstrainingFacetsSignedInteger(long long value, const } if (!found) { - errorMsg = QtXmlPatterns::tr("signed integer content is not listed in the enumeration facet"); + errorMsg = QtXmlPatterns::tr("Signed integer content is not listed in the enumeration facet."); return false; } } @@ -554,7 +554,7 @@ bool XsdTypeChecker::checkConstrainingFacetsSignedInteger(long long value, const } if (!found) { - errorMsg = QtXmlPatterns::tr("signed integer content does not match pattern facet"); + errorMsg = QtXmlPatterns::tr("Signed integer content does not match pattern facet."); return false; } } @@ -563,7 +563,7 @@ bool XsdTypeChecker::checkConstrainingFacetsSignedInteger(long long value, const const DerivedInteger::Ptr facetValue = facet->value(); if (totalDigitsForSignedLongLong(value) > facetValue->toInteger()) { - errorMsg = QtXmlPatterns::tr("signed integer content does not match in the totalDigits facet"); + errorMsg = QtXmlPatterns::tr("Signed integer content does not match in the totalDigits facet."); return false; } } @@ -580,7 +580,7 @@ bool XsdTypeChecker::checkConstrainingFacetsUnsignedInteger(unsigned long long v const XsdFacet::Ptr facet = facets.value(XsdFacet::MaximumInclusive); const Numeric::Ptr facetValue = ValueFactory::fromLexical(facet->value()->as >()->stringValue(), BuiltinTypes::xsUnsignedLong, m_context, m_reflection); if (facetValue->toUnsignedInteger() < value) { - errorMsg = QtXmlPatterns::tr("unsigned integer content does not match the maxInclusive facet"); + errorMsg = QtXmlPatterns::tr("Unsigned integer content does not match the maxInclusive facet."); return false; } } @@ -588,7 +588,7 @@ bool XsdTypeChecker::checkConstrainingFacetsUnsignedInteger(unsigned long long v const XsdFacet::Ptr facet = facets.value(XsdFacet::MaximumExclusive); const Numeric::Ptr facetValue = ValueFactory::fromLexical(facet->value()->as >()->stringValue(), BuiltinTypes::xsUnsignedLong, m_context, m_reflection); if (facetValue->toUnsignedInteger() <= value) { - errorMsg = QtXmlPatterns::tr("unsigned integer content does not match the maxExclusive facet"); + errorMsg = QtXmlPatterns::tr("Unsigned integer content does not match the maxExclusive facet."); return false; } } @@ -596,7 +596,7 @@ bool XsdTypeChecker::checkConstrainingFacetsUnsignedInteger(unsigned long long v const XsdFacet::Ptr facet = facets.value(XsdFacet::MinimumInclusive); const Numeric::Ptr facetValue = ValueFactory::fromLexical(facet->value()->as >()->stringValue(), BuiltinTypes::xsUnsignedLong, m_context, m_reflection); if (facetValue->toUnsignedInteger() > value) { - errorMsg = QtXmlPatterns::tr("unsigned integer content does not match the minInclusive facet"); + errorMsg = QtXmlPatterns::tr("Unsigned integer content does not match the minInclusive facet."); return false; } } @@ -604,7 +604,7 @@ bool XsdTypeChecker::checkConstrainingFacetsUnsignedInteger(unsigned long long v const XsdFacet::Ptr facet = facets.value(XsdFacet::MinimumExclusive); const Numeric::Ptr facetValue = ValueFactory::fromLexical(facet->value()->as >()->stringValue(), BuiltinTypes::xsUnsignedLong, m_context, m_reflection); if (facetValue->toUnsignedInteger() >= value) { - errorMsg = QtXmlPatterns::tr("unsigned integer content does not match the minExclusive facet"); + errorMsg = QtXmlPatterns::tr("Unsigned integer content does not match the minExclusive facet."); return false; } } @@ -622,7 +622,7 @@ bool XsdTypeChecker::checkConstrainingFacetsUnsignedInteger(unsigned long long v } if (!found) { - errorMsg = QtXmlPatterns::tr("unsigned integer content is not listed in the enumeration facet"); + errorMsg = QtXmlPatterns::tr("Unsigned integer content is not listed in the enumeration facet."); return false; } } @@ -640,7 +640,7 @@ bool XsdTypeChecker::checkConstrainingFacetsUnsignedInteger(unsigned long long v } if (!found) { - errorMsg = QtXmlPatterns::tr("unsigned integer content does not match pattern facet"); + errorMsg = QtXmlPatterns::tr("Unsigned integer content does not match pattern facet."); return false; } } @@ -649,7 +649,7 @@ bool XsdTypeChecker::checkConstrainingFacetsUnsignedInteger(unsigned long long v const DerivedInteger::Ptr facetValue = facet->value(); if (totalDigitsForUnsignedLongLong(value) > facetValue->toInteger()) { - errorMsg = QtXmlPatterns::tr("unsigned integer content does not match in the totalDigits facet"); + errorMsg = QtXmlPatterns::tr("Unsigned integer content does not match in the totalDigits facet."); return false; } } @@ -666,7 +666,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDouble(double value, const QString & const XsdFacet::Ptr facet = facets.value(XsdFacet::MaximumInclusive); const Numeric::Ptr facetValue = ValueFactory::fromLexical(facet->value()->as >()->stringValue(), BuiltinTypes::xsDouble, m_context, m_reflection); if (facetValue->toDouble() < value) { - errorMsg = QtXmlPatterns::tr("double content does not match the maxInclusive facet"); + errorMsg = QtXmlPatterns::tr("Double content does not match the maxInclusive facet."); return false; } } @@ -674,7 +674,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDouble(double value, const QString & const XsdFacet::Ptr facet = facets.value(XsdFacet::MaximumExclusive); const Numeric::Ptr facetValue = ValueFactory::fromLexical(facet->value()->as >()->stringValue(), BuiltinTypes::xsDouble, m_context, m_reflection); if (facetValue->toDouble() <= value) { - errorMsg = QtXmlPatterns::tr("double content does not match the maxExclusive facet"); + errorMsg = QtXmlPatterns::tr("Double content does not match the maxExclusive facet."); return false; } } @@ -682,7 +682,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDouble(double value, const QString & const XsdFacet::Ptr facet = facets.value(XsdFacet::MinimumInclusive); const Numeric::Ptr facetValue = ValueFactory::fromLexical(facet->value()->as >()->stringValue(), BuiltinTypes::xsDouble, m_context, m_reflection); if (facetValue->toDouble() > value) { - errorMsg = QtXmlPatterns::tr("double content does not match the minInclusive facet"); + errorMsg = QtXmlPatterns::tr("Double content does not match the minInclusive facet."); return false; } } @@ -690,7 +690,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDouble(double value, const QString & const XsdFacet::Ptr facet = facets.value(XsdFacet::MinimumExclusive); const Numeric::Ptr facetValue = ValueFactory::fromLexical(facet->value()->as >()->stringValue(), BuiltinTypes::xsDouble, m_context, m_reflection); if (facetValue->toDouble() >= value) { - errorMsg = QtXmlPatterns::tr("double content does not match the minExclusive facet"); + errorMsg = QtXmlPatterns::tr("Double content does not match the minExclusive facet."); return false; } } @@ -708,7 +708,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDouble(double value, const QString & } if (!found) { - errorMsg = QtXmlPatterns::tr("double content is not listed in the enumeration facet"); + errorMsg = QtXmlPatterns::tr("Double content is not listed in the enumeration facet."); return false; } } @@ -726,7 +726,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDouble(double value, const QString & } if (!found) { - errorMsg = QtXmlPatterns::tr("double content does not match pattern facet"); + errorMsg = QtXmlPatterns::tr("Double content does not match pattern facet."); return false; } } @@ -744,7 +744,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDecimal(const AtomicValue::Ptr &valu const DerivedInteger::Ptr facetValue = facet->value(); if (fractionDigitsForDecimal(lexicalValue) > facetValue->toInteger()) { - errorMsg = QtXmlPatterns::tr("decimal content does not match in the fractionDigits facet"); + errorMsg = QtXmlPatterns::tr("Decimal content does not match in the fractionDigits facet."); return false; } } @@ -753,7 +753,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDecimal(const AtomicValue::Ptr &valu const DerivedInteger::Ptr facetValue = facet->value(); if (totalDigitsForDecimal(lexicalValue) > facetValue->toInteger()) { - errorMsg = QtXmlPatterns::tr("decimal content does not match in the totalDigits facet"); + errorMsg = QtXmlPatterns::tr("Decimal content does not match in the totalDigits facet."); return false; } } @@ -767,7 +767,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDateTime(const QDateTime &value, con const XsdFacet::Ptr facet = facets.value(XsdFacet::MaximumInclusive); const AbstractDateTime::Ptr facetValue = ValueFactory::fromLexical(facet->value()->as >()->stringValue(), type, m_context, m_reflection); if (facetValue->toDateTime() < value) { - errorMsg = QtXmlPatterns::tr("date time content does not match the maxInclusive facet"); + errorMsg = QtXmlPatterns::tr("Date time content does not match the maxInclusive facet."); return false; } } @@ -775,7 +775,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDateTime(const QDateTime &value, con const XsdFacet::Ptr facet = facets.value(XsdFacet::MaximumExclusive); const AbstractDateTime::Ptr facetValue = ValueFactory::fromLexical(facet->value()->as >()->stringValue(), type, m_context, m_reflection); if (facetValue->toDateTime() <= value) { - errorMsg = QtXmlPatterns::tr("date time content does not match the maxExclusive facet"); + errorMsg = QtXmlPatterns::tr("Date time content does not match the maxExclusive facet."); return false; } } @@ -783,7 +783,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDateTime(const QDateTime &value, con const XsdFacet::Ptr facet = facets.value(XsdFacet::MinimumInclusive); const AbstractDateTime::Ptr facetValue = ValueFactory::fromLexical(facet->value()->as >()->stringValue(), type, m_context, m_reflection); if (facetValue->toDateTime() > value) { - errorMsg = QtXmlPatterns::tr("date time content does not match the minInclusive facet"); + errorMsg = QtXmlPatterns::tr("Date time content does not match the minInclusive facet."); return false; } } @@ -791,7 +791,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDateTime(const QDateTime &value, con const XsdFacet::Ptr facet = facets.value(XsdFacet::MinimumExclusive); const AbstractDateTime::Ptr facetValue = ValueFactory::fromLexical(facet->value()->as >()->stringValue(), type, m_context, m_reflection); if (facetValue->toDateTime() >= value) { - errorMsg = QtXmlPatterns::tr("date time content does not match the minExclusive facet"); + errorMsg = QtXmlPatterns::tr("Date time content does not match the minExclusive facet."); return false; } } @@ -809,7 +809,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDateTime(const QDateTime &value, con } if (!found) { - errorMsg = QtXmlPatterns::tr("date time content is not listed in the enumeration facet"); + errorMsg = QtXmlPatterns::tr("Date time content is not listed in the enumeration facet."); return false; } } @@ -827,7 +827,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDateTime(const QDateTime &value, con } if (!found) { - errorMsg = QtXmlPatterns::tr("date time content does not match pattern facet"); + errorMsg = QtXmlPatterns::tr("Date time content does not match pattern facet."); return false; } } @@ -842,7 +842,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDuration(const AtomicValue::Ptr&, co const DerivedString::Ptr value = DerivedString::fromLexical(m_namePool, lexicalValue); if (XsdSchemaHelper::constructAndCompare(facets.value(XsdFacet::MaximumInclusive)->value(), AtomicComparator::OperatorLessThan, value, BuiltinTypes::xsDuration, m_context, m_reflection)) { - errorMsg = QtXmlPatterns::tr("duration content does not match the maxInclusive facet"); + errorMsg = QtXmlPatterns::tr("Duration content does not match the maxInclusive facet."); return false; } } @@ -851,7 +851,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDuration(const AtomicValue::Ptr&, co const DerivedString::Ptr value = DerivedString::fromLexical(m_namePool, lexicalValue); if (XsdSchemaHelper::constructAndCompare(facets.value(XsdFacet::MaximumExclusive)->value(), AtomicComparator::OperatorLessOrEqual, value, BuiltinTypes::xsDuration, m_context, m_reflection)) { - errorMsg = QtXmlPatterns::tr("duration content does not match the maxExclusive facet"); + errorMsg = QtXmlPatterns::tr("Duration content does not match the maxExclusive facet."); return false; } } @@ -860,7 +860,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDuration(const AtomicValue::Ptr&, co const DerivedString::Ptr value = DerivedString::fromLexical(m_namePool, lexicalValue); if (XsdSchemaHelper::constructAndCompare(facets.value(XsdFacet::MinimumInclusive)->value(), AtomicComparator::OperatorGreaterThan, value, BuiltinTypes::xsDuration, m_context, m_reflection)) { - errorMsg = QtXmlPatterns::tr("duration content does not match the minInclusive facet"); + errorMsg = QtXmlPatterns::tr("Duration content does not match the minInclusive facet."); return false; } } @@ -869,7 +869,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDuration(const AtomicValue::Ptr&, co const DerivedString::Ptr value = DerivedString::fromLexical(m_namePool, lexicalValue); if (XsdSchemaHelper::constructAndCompare(facets.value(XsdFacet::MinimumExclusive)->value(), AtomicComparator::OperatorGreaterOrEqual, value, BuiltinTypes::xsDuration, m_context, m_reflection)) { - errorMsg = QtXmlPatterns::tr("duration content does not match the minExclusive facet"); + errorMsg = QtXmlPatterns::tr("Duration content does not match the minExclusive facet."); return false; } } @@ -887,7 +887,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDuration(const AtomicValue::Ptr&, co } if (!found) { - errorMsg = QtXmlPatterns::tr("duration content is not listed in the enumeration facet"); + errorMsg = QtXmlPatterns::tr("Duration content is not listed in the enumeration facet."); return false; } } @@ -905,7 +905,7 @@ bool XsdTypeChecker::checkConstrainingFacetsDuration(const AtomicValue::Ptr&, co } if (!found) { - errorMsg = QtXmlPatterns::tr("duration content does not match pattern facet"); + errorMsg = QtXmlPatterns::tr("Duration content does not match pattern facet."); return false; } } @@ -932,7 +932,7 @@ bool XsdTypeChecker::checkConstrainingFacetsBoolean(bool, const QString &lexical } if (!found) { - errorMsg = QtXmlPatterns::tr("boolean content does not match pattern facet"); + errorMsg = QtXmlPatterns::tr("Boolean content does not match pattern facet."); return false; } } @@ -949,7 +949,7 @@ bool XsdTypeChecker::checkConstrainingFacetsBinary(const QByteArray &value, cons const XsdFacet::Ptr facet = facets.value(XsdFacet::Length); const DerivedInteger::Ptr length = facet->value(); if (length->toInteger() != value.length()) { - errorMsg = QtXmlPatterns::tr("binary content does not match the length facet"); + errorMsg = QtXmlPatterns::tr("Binary content does not match the length facet."); return false; } } @@ -957,7 +957,7 @@ bool XsdTypeChecker::checkConstrainingFacetsBinary(const QByteArray &value, cons const XsdFacet::Ptr facet = facets.value(XsdFacet::MinimumLength); const DerivedInteger::Ptr length = facet->value(); if (length->toInteger() > value.length()) { - errorMsg = QtXmlPatterns::tr("binary content does not match the minLength facet"); + errorMsg = QtXmlPatterns::tr("Binary content does not match the minLength facet."); return false; } } @@ -965,7 +965,7 @@ bool XsdTypeChecker::checkConstrainingFacetsBinary(const QByteArray &value, cons const XsdFacet::Ptr facet = facets.value(XsdFacet::MaximumLength); const DerivedInteger::Ptr length = facet->value(); if (length->toInteger() < value.length()) { - errorMsg = QtXmlPatterns::tr("binary content does not match the maxLength facet"); + errorMsg = QtXmlPatterns::tr("Binary content does not match the maxLength facet."); return false; } } @@ -983,7 +983,7 @@ bool XsdTypeChecker::checkConstrainingFacetsBinary(const QByteArray &value, cons } if (!found) { - errorMsg = QtXmlPatterns::tr("binary content is not listed in the enumeration facet"); + errorMsg = QtXmlPatterns::tr("Binary content is not listed in the enumeration facet."); return false; } } @@ -1010,7 +1010,7 @@ bool XsdTypeChecker::checkConstrainingFacetsQName(const QXmlName &value, const Q } if (facets.contains(XsdFacet::Enumeration)) { if (!XPathHelper::isQName(lexicalValue)) { - errorMsg = QtXmlPatterns::tr("invalid QName content: %1").arg(formatData(lexicalValue)); + errorMsg = QtXmlPatterns::tr("Invalid QName content: %1.").arg(formatData(lexicalValue)); return false; } @@ -1027,7 +1027,7 @@ bool XsdTypeChecker::checkConstrainingFacetsQName(const QXmlName &value, const Q } if (!found) { - errorMsg = QtXmlPatterns::tr("QName content is not listed in the enumeration facet"); + errorMsg = QtXmlPatterns::tr("QName content is not listed in the enumeration facet."); return false; } } @@ -1045,7 +1045,7 @@ bool XsdTypeChecker::checkConstrainingFacetsQName(const QXmlName &value, const Q } if (!found) { - errorMsg = QtXmlPatterns::tr("QName content does not match pattern facet"); + errorMsg = QtXmlPatterns::tr("QName content does not match pattern facet."); return false; } } @@ -1081,7 +1081,7 @@ bool XsdTypeChecker::checkConstrainingFacetsNotation(const QXmlName &value, cons } if (!found) { - errorMsg = QtXmlPatterns::tr("notation content is not listed in the enumeration facet"); + errorMsg = QtXmlPatterns::tr("Notation content is not listed in the enumeration facet."); return false; } } @@ -1100,21 +1100,21 @@ bool XsdTypeChecker::checkConstrainingFacetsList(const QStringList &values, cons if (facets.contains(XsdFacet::Length)) { const DerivedInteger::Ptr value = facets.value(XsdFacet::Length)->value(); if (value->toInteger() != values.count()) { - errorMsg = QtXmlPatterns::tr("list content does not match length facet"); + errorMsg = QtXmlPatterns::tr("List content does not match length facet."); return false; } } if (facets.contains(XsdFacet::MinimumLength)) { const DerivedInteger::Ptr value = facets.value(XsdFacet::MinimumLength)->value(); if (value->toInteger() > values.count()) { - errorMsg = QtXmlPatterns::tr("list content does not match minLength facet"); + errorMsg = QtXmlPatterns::tr("List content does not match minLength facet."); return false; } } if (facets.contains(XsdFacet::MaximumLength)) { const DerivedInteger::Ptr value = facets.value(XsdFacet::MaximumLength)->value(); if (value->toInteger() < values.count()) { - errorMsg = QtXmlPatterns::tr("list content does not match maxLength facet"); + errorMsg = QtXmlPatterns::tr("List content does not match maxLength facet."); return false; } } @@ -1204,7 +1204,7 @@ bool XsdTypeChecker::checkConstrainingFacetsList(const QStringList &values, cons } if (!found) { - errorMsg = QtXmlPatterns::tr("list content is not listed in the enumeration facet"); + errorMsg = QtXmlPatterns::tr("List content is not listed in the enumeration facet."); return false; } } @@ -1222,7 +1222,7 @@ bool XsdTypeChecker::checkConstrainingFacetsList(const QStringList &values, cons } if (!found) { - errorMsg = QtXmlPatterns::tr("list content does not match pattern facet"); + errorMsg = QtXmlPatterns::tr("List content does not match pattern facet."); return false; } } @@ -1261,7 +1261,7 @@ bool XsdTypeChecker::checkConstrainingFacetsUnion(const QString &value, const QS } if (!found) { - errorMsg = QtXmlPatterns::tr("union content is not listed in the enumeration facet"); + errorMsg = QtXmlPatterns::tr("Union content is not listed in the enumeration facet."); return false; } } @@ -1279,7 +1279,7 @@ bool XsdTypeChecker::checkConstrainingFacetsUnion(const QString &value, const QS } if (!found) { - errorMsg = QtXmlPatterns::tr("union content does not match pattern facet"); + errorMsg = QtXmlPatterns::tr("Union content does not match pattern facet."); return false; } } @@ -1294,7 +1294,7 @@ AtomicValue::Ptr XsdTypeChecker::fromLexical(const QString &value, const SchemaT { if (type->name(m_namePool) == BuiltinTypes::xsNOTATION->name(m_namePool) || type->name(m_namePool) == BuiltinTypes::xsQName->name(m_namePool)) { if (value.simplified().isEmpty()) - return ValidationError::createError(QtXmlPatterns::tr("data of type %1 are not allowed to be empty").arg(formatType(m_namePool, BuiltinTypes::xsNOTATION))); + return ValidationError::createError(QtXmlPatterns::tr("Data of type %1 are not allowed to be empty.").arg(formatType(m_namePool, BuiltinTypes::xsNOTATION))); const QXmlName valueName = convertToQName(value); return QNameValue::fromValue(m_namePool, valueName); diff --git a/src/xmlpatterns/schema/qxsdvalidatinginstancereader.cpp b/src/xmlpatterns/schema/qxsdvalidatinginstancereader.cpp index 0980777..7552c41 100644 --- a/src/xmlpatterns/schema/qxsdvalidatinginstancereader.cpp +++ b/src/xmlpatterns/schema/qxsdvalidatinginstancereader.cpp @@ -157,7 +157,7 @@ bool XsdValidatingInstanceReader::read() if (!m_stateMachines.isEmpty() && hasStateMachine) { if (!m_stateMachines.top().inEndState()) { - error(QtXmlPatterns::tr("element %1 is missing child element").arg(formatKeyword(m_namePool->displayName(elementName)))); + error(QtXmlPatterns::tr("Element %1 is missing child element.").arg(formatKeyword(m_namePool->displayName(elementName)))); return false; } m_stateMachines.pop(); @@ -173,7 +173,7 @@ bool XsdValidatingInstanceReader::read() while (it.hasNext()) { const QString id = it.next(); if (!ids.contains(id)) { - error(QtXmlPatterns::tr("there is one IDREF value with no corresponding ID: %1").arg(formatKeyword(id))); + error(QtXmlPatterns::tr("There is one IDREF value with no corresponding ID: %1.").arg(formatKeyword(id))); return false; } } @@ -200,7 +200,7 @@ bool XsdValidatingInstanceReader::loadSchema(const QString &targetNamespace, con QXmlSchemaPrivate schema(context); schema.load(reply.data(), location, targetNamespace); if (!schema.isValid()) { - error(QtXmlPatterns::tr("loaded schema file is invalid")); + error(QtXmlPatterns::tr("Loaded schema file is invalid.")); return false; } @@ -216,7 +216,7 @@ bool XsdValidatingInstanceReader::validate(bool &hasStateMachine, XsdElement::Pt const QString schemaLocation = attribute(m_xsiSchemaLocationName); const QStringList parts = schemaLocation.split(QLatin1Char(' '), QString::SkipEmptyParts); if ((parts.count()%2) == 1) { - error(QtXmlPatterns::tr("%1 contains invalid data").arg(formatKeyword(m_namePool, m_xsiSchemaLocationName))); + error(QtXmlPatterns::tr("%1 contains invalid data.").arg(formatKeyword(m_namePool, m_xsiSchemaLocationName))); return false; } @@ -229,7 +229,7 @@ bool XsdValidatingInstanceReader::validate(bool &hasStateMachine, XsdElement::Pt // check constraint 4) from http://www.w3.org/TR/xmlschema-1/#schema-loc (only valid for XML Schema 1.0?) if (m_processedNamespaces.contains(parts.at(i))) { - error(QtXmlPatterns::tr("xsi:schemaLocation namespace %1 has already appeared earlier in the instance document").arg(formatKeyword(parts.at(i)))); + error(QtXmlPatterns::tr("xsi:schemaLocation namespace %1 has already appeared earlier in the instance document.").arg(formatKeyword(parts.at(i)))); return false; } @@ -251,7 +251,7 @@ bool XsdValidatingInstanceReader::validate(bool &hasStateMachine, XsdElement::Pt m_processedSchemaLocations.insert(schemaLocation); if (m_processedNamespaces.contains(QString())) { - error(QtXmlPatterns::tr("xsi:noNamespaceSchemaLocation cannot appear after the first no-namespace element or attribute")); + error(QtXmlPatterns::tr("xsi:noNamespaceSchemaLocation cannot appear after the first no-namespace element or attribute.")); return false; } @@ -269,7 +269,7 @@ bool XsdValidatingInstanceReader::validate(bool &hasStateMachine, XsdElement::Pt m_processedNamespaces.insert(m_namePool->stringForNamespace(name().namespaceURI())); if (!m_schema) { - error(QtXmlPatterns::tr("no schema defined for validation")); + error(QtXmlPatterns::tr("No schema defined for validation.")); return false; } @@ -279,7 +279,7 @@ bool XsdValidatingInstanceReader::validate(bool &hasStateMachine, XsdElement::Pt XsdElement::Ptr element = elementByName(name()); if (!element) { if (!hasAttribute(m_xsiTypeName)) { - error(QtXmlPatterns::tr("no definition for element %1 available").arg(formatKeyword(m_namePool, name()))); + error(QtXmlPatterns::tr("No definition for element %1 available.").arg(formatKeyword(m_namePool, name()))); return false; } @@ -297,7 +297,7 @@ bool XsdValidatingInstanceReader::validate(bool &hasStateMachine, XsdElement::Pt const SchemaType::Ptr elementType = typeByName(typeName); if (!elementType) { - error(QtXmlPatterns::tr("specified type %1 is not known to the schema").arg(formatType(m_namePool, typeName))); + error(QtXmlPatterns::tr("Specified type %1 is not known to the schema.").arg(formatType(m_namePool, typeName))); return false; } element->setType(elementType); @@ -312,7 +312,7 @@ bool XsdValidatingInstanceReader::validate(bool &hasStateMachine, XsdElement::Pt } else { if (!m_stateMachines.top().proceed(name())) { - error(QtXmlPatterns::tr("element %1 is not defined in this scope").arg(formatKeyword(m_namePool, name()))); + error(QtXmlPatterns::tr("Element %1 is not defined in this scope.").arg(formatKeyword(m_namePool, name()))); return false; } @@ -346,7 +346,7 @@ bool XsdValidatingInstanceReader::validate(bool &hasStateMachine, XsdElement::Pt const SchemaType::Ptr elementType = typeByName(typeName); if (!elementType) { - error(QtXmlPatterns::tr("specified type %1 is not known to the schema").arg(formatType(m_namePool, typeName))); + error(QtXmlPatterns::tr("Specified type %1 is not known to the schema.").arg(formatType(m_namePool, typeName))); return false; } elementDeclaration->setType(elementType); @@ -355,7 +355,7 @@ bool XsdValidatingInstanceReader::validate(bool &hasStateMachine, XsdElement::Pt if (!elementDeclaration) { if (wildcard->processContents() == XsdWildcard::Strict) { - error(QtXmlPatterns::tr("declaration for element %1 does not exist").arg(formatKeyword(m_namePool->displayName(name())))); + error(QtXmlPatterns::tr("Declaration for element %1 does not exist.").arg(formatKeyword(m_namePool->displayName(name())))); return false; } else { // in this case we put a state machine for the xs:anyType on the statemachine stack, @@ -367,7 +367,7 @@ bool XsdValidatingInstanceReader::validate(bool &hasStateMachine, XsdElement::Pt } else { if (!validateElement(elementDeclaration, hasStateMachine)) { if (wildcard->processContents() == XsdWildcard::Strict) { - error(QtXmlPatterns::tr("element %1 contains invalid content").arg(formatKeyword(m_namePool->displayName(name())))); + error(QtXmlPatterns::tr("Element %1 contains invalid content.").arg(formatKeyword(m_namePool->displayName(name())))); return false; } } @@ -440,14 +440,14 @@ bool XsdValidatingInstanceReader::validateElement(const XsdElement::Ptr &declara // 2 if (declaration->isAbstract()) { - error(QtXmlPatterns::tr("element %1 is declared as abstract").arg(formatKeyword(declaration->displayName(m_namePool)))); + error(QtXmlPatterns::tr("Element %1 is declared as abstract.").arg(formatKeyword(declaration->displayName(m_namePool)))); return false; } // 3 if (!declaration->isNillable()) { if (hasAttribute(m_xsiNilName)) { - error(QtXmlPatterns::tr("element %1 is not nillable").arg(formatKeyword(declaration->displayName(m_namePool)))); + error(QtXmlPatterns::tr("Element %1 is not nillable.").arg(formatKeyword(declaration->displayName(m_namePool)))); return false; // 3.1 } } else { @@ -455,7 +455,7 @@ bool XsdValidatingInstanceReader::validateElement(const XsdElement::Ptr &declara const QString value = attribute(m_xsiNilName); const Boolean::Ptr nil = Boolean::fromLexical(value); if (nil->hasError()) { - error(QtXmlPatterns::tr("attribute %1 contains invalid data: %2").arg(formatKeyword(QLatin1String("nil"))).arg(formatData(value))); + error(QtXmlPatterns::tr("Attribute %1 contains invalid data: %2").arg(formatKeyword(QLatin1String("nil."))).arg(formatData(value))); return false; } @@ -463,13 +463,13 @@ bool XsdValidatingInstanceReader::validateElement(const XsdElement::Ptr &declara if (nil->as()->value() == true) { // 3.2.3.1 if (hasChildElement() || hasChildText()) { - error(QtXmlPatterns::tr("element contains content although it is nillable")); + error(QtXmlPatterns::tr("Element contains content although it is nillable.")); return false; } // 3.2.3.2 if (declaration->valueConstraint() && declaration->valueConstraint()->variety() == XsdElement::ValueConstraint::Fixed) { - error(QtXmlPatterns::tr("fixed value constrained not allowed if element is nillable")); + error(QtXmlPatterns::tr("Fixed value constrained not allowed if element is nillable.")); return false; } } @@ -488,7 +488,7 @@ bool XsdValidatingInstanceReader::validateElement(const XsdElement::Ptr &declara const SchemaType::Ptr elementType = typeByName(typeName); // 4.1 if (!elementType) { - error(QtXmlPatterns::tr("specified type %1 is not known to the schema").arg(formatType(m_namePool, typeName))); + error(QtXmlPatterns::tr("Specified type %1 is not known to the schema.").arg(formatType(m_namePool, typeName))); return false; } @@ -501,7 +501,7 @@ bool XsdValidatingInstanceReader::validateElement(const XsdElement::Ptr &declara if (!XsdSchemaHelper::isValidlySubstitutable(elementType, declaration->type(), constraints)) { if (declaration->type()->name(m_namePool) != BuiltinTypes::xsAnyType->name(m_namePool)) { // xs:anyType is a valid substitutable type here - error(QtXmlPatterns::tr("specified type %1 is not validly substitutable with element type %2").arg(formatType(m_namePool, elementType)).arg(formatType(m_namePool, declaration->type()))); + error(QtXmlPatterns::tr("Specified type %1 is not validly substitutable with element type %2.").arg(formatType(m_namePool, elementType)).arg(formatType(m_namePool, declaration->type()))); return false; } } @@ -524,7 +524,7 @@ bool XsdValidatingInstanceReader::validateElementType(const XsdElement::Ptr &dec // 2 if (type->isComplexType() && type->isDefinedBySchema()) { if (XsdComplexType::Ptr(type)->isAbstract()) { - error(QtXmlPatterns::tr("complex type %1 is not allowed to be abstract").arg(formatType(m_namePool, type))); + error(QtXmlPatterns::tr("Complex type %1 is not allowed to be abstract.").arg(formatType(m_namePool, type))); return false; } } @@ -545,13 +545,13 @@ bool XsdValidatingInstanceReader::validateElementSimpleType(const XsdElement::Pt QSet elementAttributes = attributeNames(); elementAttributes.subtract(allowedAttributes); if (!elementAttributes.isEmpty()) { - error(QtXmlPatterns::tr("element %1 contains not allowed attributes").arg(formatKeyword(declaration->displayName(m_namePool)))); + error(QtXmlPatterns::tr("Element %1 contains not allowed attributes.").arg(formatKeyword(declaration->displayName(m_namePool)))); return false; } // 3.1.2 if (hasChildElement()) { - error(QtXmlPatterns::tr("element %1 contains not allowed child element").arg(formatKeyword(declaration->displayName(m_namePool)))); + error(QtXmlPatterns::tr("Element %1 contains not allowed child element.").arg(formatKeyword(declaration->displayName(m_namePool)))); return false; } @@ -572,7 +572,7 @@ bool XsdValidatingInstanceReader::validateElementSimpleType(const XsdElement::Pt const XsdTypeChecker checker(m_context, namespaceBindings(item().toNodeModelIndex()), sourceLocation()); if (!checker.isValidString(actualValue, type, errorMsg, &boundType)) { - error(QtXmlPatterns::tr("content of element %1 does not match its type definition: %2").arg(formatKeyword(declaration->displayName(m_namePool))).arg(errorMsg)); + error(QtXmlPatterns::tr("Content of element %1 does not match its type definition: %2.").arg(formatKeyword(declaration->displayName(m_namePool))).arg(errorMsg)); return false; } @@ -580,7 +580,7 @@ bool XsdValidatingInstanceReader::validateElementSimpleType(const XsdElement::Pt if (declaration->valueConstraint() && declaration->valueConstraint()->variety() == XsdElement::ValueConstraint::Fixed) { const QString actualConstraintValue = XsdTypeChecker::normalizedValue(declaration->valueConstraint()->value(), facets); if (!text().isEmpty() && !checker.valuesAreEqual(actualValue, actualConstraintValue, type)) { - error(QtXmlPatterns::tr("content of element %1 does not match defined value constraint").arg(formatKeyword(declaration->displayName(m_namePool)))); + error(QtXmlPatterns::tr("Content of element %1 does not match defined value constraint.").arg(formatKeyword(declaration->displayName(m_namePool)))); return false; } } @@ -640,7 +640,7 @@ bool XsdValidatingInstanceReader::validateElementComplexType(const XsdElement::P // 1.1 if (complexType->contentType()->variety() == XsdComplexType::ContentType::Empty) { if (hasChildText() || hasChildElement()) { - error(QtXmlPatterns::tr("element %1 contains not allowed child content").arg(formatKeyword(declaration->displayName(m_namePool)))); + error(QtXmlPatterns::tr("Element %1 contains not allowed child content.").arg(formatKeyword(declaration->displayName(m_namePool)))); return false; } } @@ -648,7 +648,7 @@ bool XsdValidatingInstanceReader::validateElementComplexType(const XsdElement::P // 1.2 if (complexType->contentType()->variety() == XsdComplexType::ContentType::Simple) { if (hasChildElement()) { - error(QtXmlPatterns::tr("element %1 contains not allowed child element").arg(formatKeyword(declaration->displayName(m_namePool)))); + error(QtXmlPatterns::tr("Element %1 contains not allowed child element.").arg(formatKeyword(declaration->displayName(m_namePool)))); return false; } @@ -665,14 +665,14 @@ bool XsdValidatingInstanceReader::validateElementComplexType(const XsdElement::P AnySimpleType::Ptr boundType; const XsdTypeChecker checker(m_context, namespaceBindings(item().toNodeModelIndex()), sourceLocation()); if (!checker.isValidString(actualValue, complexType->contentType()->simpleType(), errorMsg, &boundType)) { - error(QtXmlPatterns::tr("content of element %1 does not match its type definition: %2").arg(formatKeyword(declaration->displayName(m_namePool))).arg(errorMsg)); + error(QtXmlPatterns::tr("Content of element %1 does not match its type definition: %2.").arg(formatKeyword(declaration->displayName(m_namePool))).arg(errorMsg)); return false; } // additional check if (declaration->valueConstraint() && declaration->valueConstraint()->variety() == XsdElement::ValueConstraint::Fixed) { if (!checker.valuesAreEqual(actualValue, declaration->valueConstraint()->value(), boundType)) { - error(QtXmlPatterns::tr("content of element %1 does not match defined value constraint").arg(formatKeyword(declaration->displayName(m_namePool)))); + error(QtXmlPatterns::tr("Content of element %1 does not match defined value constraint.").arg(formatKeyword(declaration->displayName(m_namePool)))); return false; } } @@ -681,7 +681,7 @@ bool XsdValidatingInstanceReader::validateElementComplexType(const XsdElement::P // 1.3 if (complexType->contentType()->variety() == XsdComplexType::ContentType::ElementOnly) { if (!text().simplified().isEmpty()) { - error(QtXmlPatterns::tr("element %1 contains not allowed text content").arg(formatKeyword(declaration->displayName(m_namePool)))); + error(QtXmlPatterns::tr("Element %1 contains not allowed text content.").arg(formatKeyword(declaration->displayName(m_namePool)))); return false; } } @@ -699,7 +699,7 @@ bool XsdValidatingInstanceReader::validateElementComplexType(const XsdElement::P if (complexType->contentType()->variety() == XsdComplexType::ContentType::Mixed) { if (declaration->valueConstraint() && declaration->valueConstraint()->variety() == XsdElement::ValueConstraint::Fixed) { if (hasChildElement()) { - error(QtXmlPatterns::tr("element %1 can not contain other elements, as it has a fixed content").arg(formatKeyword(declaration->displayName(m_namePool)))); + error(QtXmlPatterns::tr("Element %1 can not contain other elements, as it has a fixed content.").arg(formatKeyword(declaration->displayName(m_namePool)))); return false; } @@ -713,7 +713,7 @@ bool XsdValidatingInstanceReader::validateElementComplexType(const XsdElement::P } if (actualValue != declaration->valueConstraint()->value()) { - error(QtXmlPatterns::tr("content of element %1 does not match defined value constraint").arg(formatKeyword(declaration->displayName(m_namePool)))); + error(QtXmlPatterns::tr("Content of element %1 does not match defined value constraint.").arg(formatKeyword(declaration->displayName(m_namePool)))); return false; } } @@ -742,7 +742,7 @@ bool XsdValidatingInstanceReader::validateElementComplexType(const XsdElement::P if (usesIt.value()->isRequired()) { if (!attributes.contains(usesIt.key())) { - error(QtXmlPatterns::tr("element %1 is missing required attribute %2").arg(formatKeyword(declaration->displayName(m_namePool))) + error(QtXmlPatterns::tr("Element %1 is missing required attribute %2.").arg(formatKeyword(declaration->displayName(m_namePool))) .arg(formatKeyword(m_namePool->displayName(usesIt.key())))); return false; } @@ -771,7 +771,7 @@ bool XsdValidatingInstanceReader::validateElementComplexType(const XsdElement::P if (complexType->attributeWildcard()) { const XsdWildcard::Ptr wildcard(complexType->attributeWildcard()); if (!validateAttributeWildcard(attributeName, wildcard)) { - error(QtXmlPatterns::tr("attribute %1 does not match the attribute wildcard").arg(formatKeyword(m_namePool->displayName(attributeName)))); + error(QtXmlPatterns::tr("Attribute %1 does not match the attribute wildcard.").arg(formatKeyword(m_namePool->displayName(attributeName)))); return false; } @@ -780,13 +780,13 @@ bool XsdValidatingInstanceReader::validateElementComplexType(const XsdElement::P if (!attributeDeclaration) { if (wildcard->processContents() == XsdWildcard::Strict) { - error(QtXmlPatterns::tr("declaration for attribute %1 does not exist").arg(formatKeyword(m_namePool->displayName(attributeName)))); + error(QtXmlPatterns::tr("Declaration for attribute %1 does not exist.").arg(formatKeyword(m_namePool->displayName(attributeName)))); return false; } } else { if (BuiltinTypes::xsID->wxsTypeMatches(attributeDeclaration->type())) { if (hasIDAttribute) { - error(QtXmlPatterns::tr("element %1 contains two attributes of type %2") + error(QtXmlPatterns::tr("Element %1 contains two attributes of type %2.") .arg(formatKeyword(declaration->displayName(m_namePool))) .arg(formatKeyword("ID"))); return false; @@ -797,14 +797,14 @@ bool XsdValidatingInstanceReader::validateElementComplexType(const XsdElement::P if (!validateAttribute(attributeDeclaration, attribute(attributeName))) { if (wildcard->processContents() == XsdWildcard::Strict) { - error(QtXmlPatterns::tr("attribute %1 contains invalid content").arg(formatKeyword(m_namePool->displayName(attributeName)))); + error(QtXmlPatterns::tr("Attribute %1 contains invalid content.").arg(formatKeyword(m_namePool->displayName(attributeName)))); return false; } } } } } else { - error(QtXmlPatterns::tr("element %1 contains unknown attribute %2").arg(formatKeyword(declaration->displayName(m_namePool))) + error(QtXmlPatterns::tr("Element %1 contains unknown attribute %2.").arg(formatKeyword(declaration->displayName(m_namePool))) .arg(formatKeyword(m_namePool->displayName(attributeName)))); return false; } @@ -844,7 +844,7 @@ bool XsdValidatingInstanceReader::validateAttribute(const XsdAttributeUse::Ptr & const XsdTypeChecker checker(m_context, namespaceBindings(index), sourceLocation()); if (!checker.isValidString(actualValue, attributeType, errorMsg, &boundType)) { - error(QtXmlPatterns::tr("content of attribute %1 does not match its type definition: %2").arg(formatKeyword(declaration->attribute()->displayName(m_namePool))).arg(errorMsg)); + error(QtXmlPatterns::tr("Content of attribute %1 does not match its type definition: %2.").arg(formatKeyword(declaration->attribute()->displayName(m_namePool))).arg(errorMsg)); return false; } @@ -852,7 +852,7 @@ bool XsdValidatingInstanceReader::validateAttribute(const XsdAttributeUse::Ptr & if (declaration->valueConstraint() && declaration->valueConstraint()->variety() == XsdAttributeUse::ValueConstraint::Fixed) { const QString actualConstraintValue = XsdTypeChecker::normalizedValue(declaration->valueConstraint()->value(), facets); if (!checker.valuesAreEqual(actualValue, actualConstraintValue, attributeType)) { - error(QtXmlPatterns::tr("content of attribute %1 does not match defined value constraint").arg(formatKeyword(declaration->attribute()->displayName(m_namePool)))); + error(QtXmlPatterns::tr("Content of attribute %1 does not match defined value constraint.").arg(formatKeyword(declaration->attribute()->displayName(m_namePool)))); return false; } } @@ -890,7 +890,7 @@ bool XsdValidatingInstanceReader::validateAttribute(const XsdAttribute::Ptr &dec const XsdTypeChecker checker(m_context, namespaceBindings(index), sourceLocation()); if (!checker.isValidString(actualValue, attributeType, errorMsg, &boundType)) { - error(QtXmlPatterns::tr("content of attribute %1 does not match its type definition: %2").arg(formatKeyword(declaration->displayName(m_namePool))).arg(errorMsg)); + error(QtXmlPatterns::tr("Content of attribute %1 does not match its type definition: %2.").arg(formatKeyword(declaration->displayName(m_namePool))).arg(errorMsg)); return false; } @@ -898,7 +898,7 @@ bool XsdValidatingInstanceReader::validateAttribute(const XsdAttribute::Ptr &dec if (declaration->valueConstraint() && declaration->valueConstraint()->variety() == XsdAttribute::ValueConstraint::Fixed) { const QString actualConstraintValue = XsdTypeChecker::normalizedValue(declaration->valueConstraint()->value(), facets); if (!checker.valuesAreEqual(actualValue, actualConstraintValue, attributeType)) { - error(QtXmlPatterns::tr("content of attribute %1 does not match defined value constraint").arg(formatKeyword(declaration->displayName(m_namePool)))); + error(QtXmlPatterns::tr("Content of attribute %1 does not match defined value constraint.").arg(formatKeyword(declaration->displayName(m_namePool)))); return false; } } @@ -986,7 +986,7 @@ bool XsdValidatingInstanceReader::validateUniqueIdentityConstraint(const XsdElem continue; if (node.fieldsAreEqual(innerNode, m_namePool, m_context, &reflection)) { - error(QtXmlPatterns::tr("non-unique value found for constraint %1").arg(formatKeyword(constraint->displayName(m_namePool)))); + error(QtXmlPatterns::tr("Non-unique value found for constraint %1.").arg(formatKeyword(constraint->displayName(m_namePool)))); return false; } } @@ -1006,7 +1006,7 @@ bool XsdValidatingInstanceReader::validateKeyIdentityConstraint(const XsdElement // 4.2.1 if (targetNodeSet.count() != qualifiedNodeSet.count()) { - error(QtXmlPatterns::tr("key constraint %1 contains absent fields").arg(formatKeyword(constraint->displayName(m_namePool)))); + error(QtXmlPatterns::tr("Key constraint %1 contains absent fields.").arg(formatKeyword(constraint->displayName(m_namePool)))); return false; } @@ -1024,7 +1024,7 @@ bool XsdValidatingInstanceReader::validateKeyIdentityConstraint(const XsdElement if (m_model->kind(index) == QXmlNodeModelIndex::Element) { const XsdElement::Ptr declaration = m_model->assignedElement(index); if (declaration && declaration->isNillable()) { - error(QtXmlPatterns::tr("key constraint %1 contains references nillable element %2") + error(QtXmlPatterns::tr("Key constraint %1 contains references nillable element %2.") .arg(formatKeyword(constraint->displayName(m_namePool))) .arg(formatKeyword(declaration->displayName(m_namePool)))); return false; @@ -1064,7 +1064,7 @@ bool XsdValidatingInstanceReader::validateKeyRefIdentityConstraint(const XsdElem } if (!foundMatching) { - error(QtXmlPatterns::tr("no referenced value found for key reference %1").arg(formatKeyword(constraint->displayName(m_namePool)))); + error(QtXmlPatterns::tr("No referenced value found for key reference %1.").arg(formatKeyword(constraint->displayName(m_namePool)))); return false; } } @@ -1128,7 +1128,7 @@ bool XsdValidatingInstanceReader::selectNodeSets(const XsdElement::Ptr&, const Q } if (fieldVector.count() > 1) { - error(QtXmlPatterns::tr("more than one value found for field %1").arg(formatData(field->expression()))); + error(QtXmlPatterns::tr("More than one value found for field %1.").arg(formatData(field->expression()))); return false; } @@ -1148,7 +1148,7 @@ bool XsdValidatingInstanceReader::selectNodeSets(const XsdElement::Ptr&, const Q } } if (!typeOk) { - error(QtXmlPatterns::tr("field %1 has no simple type").arg(formatData(field->expression()))); + error(QtXmlPatterns::tr("Field %1 has no simple type.").arg(formatData(field->expression()))); return false; } @@ -1221,7 +1221,7 @@ SchemaType::Ptr XsdValidatingInstanceReader::typeByName(const QXmlName &name) co void XsdValidatingInstanceReader::addIdIdRefBinding(const QString &id, const NamedSchemaComponent::Ptr &binding) { if (!m_model->idIdRefBindings(id).isEmpty()) { - error(QtXmlPatterns::tr("ID value '%1' is not unique").arg(formatKeyword(id))); + error(QtXmlPatterns::tr("ID value '%1' is not unique.").arg(formatKeyword(id))); return; } @@ -1232,7 +1232,7 @@ QString XsdValidatingInstanceReader::qNameAttribute(const QXmlName &attributeNam { const QString value = attribute(attributeName).simplified(); if (!XPathHelper::isQName(value)) { - error(QtXmlPatterns::tr("'%1' attribute contains invalid QName content: %2").arg(m_namePool->displayName(attributeName)).arg(formatData(value))); + error(QtXmlPatterns::tr("'%1' attribute contains invalid QName content: %2.").arg(m_namePool->displayName(attributeName)).arg(formatData(value))); return QString(); } else { return value; -- cgit v0.12 From d59e1d8491b3590145e5da0d8b81dc78cc353137 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 1 Oct 2009 11:32:27 +0200 Subject: Fix tst_QPixmap on 16bit display Pulse machine runs a 16bit display, some comparisons fails. Reviewed-by: Samuel --- tests/auto/qpixmap/tst_qpixmap.cpp | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp index 1bfddc1..8151e62 100644 --- a/tests/auto/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/qpixmap/tst_qpixmap.cpp @@ -67,6 +67,9 @@ #include #endif +#ifdef Q_WS_X11 +#include +#endif //TESTED_CLASS= //TESTED_FILES= @@ -175,6 +178,12 @@ static bool lenientCompare(const QPixmap &actual, const QPixmap &expected) int size = actual.width() * actual.height(); + int threshold = 2; +#ifdef Q_WS_X11 + if (QX11Info::appDepth() == 16) + threshold = 10; +#endif + QRgb *a = (QRgb *)actualImage.bits(); QRgb *e = (QRgb *)expectedImage.bits(); for (int i = 0; i < size; ++i) { @@ -183,11 +192,11 @@ static bool lenientCompare(const QPixmap &actual, const QPixmap &expected) bool result = true; - if (qAbs(ca.red() - ce.red()) > 2) + if (qAbs(ca.red() - ce.red()) > threshold) result = false; - if (qAbs(ca.green() - ce.green()) > 2) + if (qAbs(ca.green() - ce.green()) > threshold) result = false; - if (qAbs(ca.blue() - ce.blue()) > 2) + if (qAbs(ca.blue() - ce.blue()) > threshold) result = false; if (!result) @@ -293,15 +302,23 @@ void tst_QPixmap::setAlphaChannel() void tst_QPixmap::fromImage_data() { + bool is16bit = false; +#ifdef Q_WS_X11 + if (QX11Info::appDepth() == 16) + is16bit = true; +#endif + QTest::addColumn("format"); QTest::newRow("Format_Mono") << QImage::Format_Mono; QTest::newRow("Format_MonoLSB") << QImage::Format_MonoLSB; // QTest::newRow("Format_Indexed8") << QImage::Format_Indexed8; - QTest::newRow("Format_RGB32") << QImage::Format_RGB32; + if (!is16bit) + QTest::newRow("Format_RGB32") << QImage::Format_RGB32; QTest::newRow("Format_ARGB32") << QImage::Format_ARGB32; QTest::newRow("Format_ARGB32_Premultiplied") << QImage::Format_ARGB32_Premultiplied; - QTest::newRow("Format_RGB16") << QImage::Format_RGB16; + if (!is16bit) + QTest::newRow("Format_RGB16") << QImage::Format_RGB16; } void tst_QPixmap::fromImage() @@ -986,7 +1003,7 @@ static void compareImages(const QImage &image1, const QImage &image2) QRgb p1 = image1.pixel(x, y); QRgb p2 = image2.pixel(x, y); - bool pixelMatches = + bool pixelMatches = qAbs(qRed(p1) - qRed(p2)) <= fuzz && qAbs(qGreen(p1) - qGreen(p2)) <= fuzz && qAbs(qBlue(p1) - qBlue(p2)) <= fuzz -- cgit v0.12 From 0ec49eca052e452a20d0ab7219c3a42589745ba5 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Thu, 1 Oct 2009 11:42:15 +0200 Subject: Update mkdist-webkit script with latest tag --- util/webkit/mkdist-webkit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/webkit/mkdist-webkit b/util/webkit/mkdist-webkit index b1efe91..34a2ec7 100755 --- a/util/webkit/mkdist-webkit +++ b/util/webkit/mkdist-webkit @@ -5,7 +5,7 @@ die() { exit 1 } -default_tag="qtwebkit-4.6-snapshot-29092009-2" +default_tag="qtwebkit-4.6-snapshot-30092009-2" if [ $# -eq 0 ]; then tag="$default_tag" -- cgit v0.12 From 34bd937aea27fabbfac964b80bc0ab50d677277e Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Thu, 1 Oct 2009 11:45:01 +0200 Subject: Updated WebKit from /home/joce/dev/qtwebkit/ to qtwebkit-4.6-snapshot-30092009-2 ( 284ebfc0df42d408d99838507c1ed335fba9bcf0 ) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes in WebKit/qt since the last update: ++ b/WebKit/qt/ChangeLog 2009-09-29 Andras Becsi Reviewed by Tor Arne Vestbø. [Qt] Default font size reconciliation to 16px/13px to match other platform's de-facto standard. This fixes https://bugs.webkit.org/show_bug.cgi?id=19674. * Api/qwebsettings.cpp: (QWebSettings::QWebSettings): 2009-09-29 Jedrzej Nowacki Reviewed by Simon Hausmann. https://bugs.webkit.org/show_bug.cgi?id=29844 QWebPage dependency autotest fix. Fix for database() autotest. All opened databases should be removed at end of test. * tests/qwebpage/tst_qwebpage.cpp: (tst_QWebPage::database): 2009-09-29 Jedrzej Nowacki Reviewed by Simon Hausmann. Some QWebHistory and QWebPage autotest crash fixes. Some checking for m_mainFrame were added. MainFrame should be created at some point of QWebPage live cicle. https://bugs.webkit.org/show_bug.cgi?id=29803 * Api/qwebpage.cpp: (QWebPage::~QWebPage): (QWebPage::currentFrame): (QWebPage::history): (QWebPage::selectedText): (QWebPage::updatePositionDependentActions): * tests/qwebpage/tst_qwebpage.cpp: (tst_QWebPage::crashTests_LazyInitializationOfMainFrame): 2009-09-29 Kenneth Rohde Christiansen Reviewed by Simon Hausmann and Tor Arne Vestbø. Implement QWebPage Extension for error pages, incl. an example on how to use it in QtLauncher. Correct our use of ResourceError. * Api/qwebpage.h: (ExtensionOption::): (ExtensionOption::ErrorPageExtensionReturn::ErrorPageExtensionReturn): * QtLauncher/main.cpp: (WebPage::supportsExtension): (MainWindow::MainWindow): (MainWindow::selectElements): (WebPage::extension): * WebCoreSupport/FrameLoaderClientQt.cpp: (WebCore::FrameLoaderClientQt::cancelledError): (WebCore::FrameLoaderClientQt::blockedError): (WebCore::FrameLoaderClientQt::cannotShowURLError): (WebCore::FrameLoaderClientQt::interruptForPolicyChangeError): (WebCore::FrameLoaderClientQt::cannotShowMIMETypeError): (WebCore::FrameLoaderClientQt::fileDoesNotExistError): (WebCore::FrameLoaderClientQt::callErrorPageExtension): (WebCore::FrameLoaderClientQt::dispatchDidFailProvisionalLoad): (WebCore::FrameLoaderClientQt::dispatchDidFailLoad): * WebCoreSupport/FrameLoaderClientQt.h: --- .../JavaScriptCore/API/JSCallbackConstructor.cpp | 2 +- .../JavaScriptCore/API/JSCallbackConstructor.h | 2 +- .../webkit/JavaScriptCore/API/JSCallbackObject.h | 2 +- .../JavaScriptCore/API/JSCallbackObjectFunctions.h | 2 +- src/3rdparty/webkit/JavaScriptCore/ChangeLog | 428 ++++++++ .../webkit/JavaScriptCore/bytecode/CodeBlock.h | 4 +- .../webkit/JavaScriptCore/bytecode/SamplingTool.h | 2 +- .../webkit/JavaScriptCore/debugger/Debugger.cpp | 6 +- .../JavaScriptCore/debugger/DebuggerCallFrame.cpp | 6 +- .../JavaScriptCore/interpreter/Interpreter.cpp | 55 +- .../JavaScriptCore/interpreter/Interpreter.h | 10 +- src/3rdparty/webkit/JavaScriptCore/jit/JIT.h | 8 +- .../webkit/JavaScriptCore/jit/JITArithmetic.cpp | 160 +-- .../webkit/JavaScriptCore/jit/JITOpcodes.cpp | 30 +- src/3rdparty/webkit/JavaScriptCore/jsc.cpp | 21 +- .../JavaScriptCore/runtime/ArrayConstructor.cpp | 2 +- .../JavaScriptCore/runtime/ArrayConstructor.h | 2 +- .../JavaScriptCore/runtime/ArrayPrototype.cpp | 2 +- .../webkit/JavaScriptCore/runtime/ArrayPrototype.h | 2 +- .../JavaScriptCore/runtime/BooleanConstructor.cpp | 2 +- .../JavaScriptCore/runtime/BooleanConstructor.h | 2 +- .../JavaScriptCore/runtime/BooleanObject.cpp | 2 +- .../webkit/JavaScriptCore/runtime/BooleanObject.h | 2 +- .../JavaScriptCore/runtime/BooleanPrototype.cpp | 2 +- .../JavaScriptCore/runtime/BooleanPrototype.h | 2 +- .../webkit/JavaScriptCore/runtime/Collector.cpp | 8 +- .../webkit/JavaScriptCore/runtime/Completion.cpp | 10 +- .../JavaScriptCore/runtime/DateConstructor.cpp | 2 +- .../JavaScriptCore/runtime/DateConstructor.h | 2 +- .../webkit/JavaScriptCore/runtime/DateInstance.cpp | 2 +- .../webkit/JavaScriptCore/runtime/DateInstance.h | 2 +- .../JavaScriptCore/runtime/DatePrototype.cpp | 2 +- .../webkit/JavaScriptCore/runtime/DatePrototype.h | 2 +- .../JavaScriptCore/runtime/ErrorConstructor.cpp | 2 +- .../JavaScriptCore/runtime/ErrorConstructor.h | 2 +- .../JavaScriptCore/runtime/ErrorInstance.cpp | 2 +- .../webkit/JavaScriptCore/runtime/ErrorInstance.h | 2 +- .../JavaScriptCore/runtime/ErrorPrototype.cpp | 2 +- .../webkit/JavaScriptCore/runtime/ErrorPrototype.h | 2 +- .../webkit/JavaScriptCore/runtime/Executable.h | 22 +- .../JavaScriptCore/runtime/FunctionConstructor.cpp | 2 +- .../JavaScriptCore/runtime/FunctionConstructor.h | 2 +- .../JavaScriptCore/runtime/FunctionPrototype.cpp | 2 +- .../JavaScriptCore/runtime/FunctionPrototype.h | 2 +- .../JavaScriptCore/runtime/GlobalEvalFunction.cpp | 2 +- .../JavaScriptCore/runtime/GlobalEvalFunction.h | 2 +- .../JavaScriptCore/runtime/InternalFunction.cpp | 2 +- .../JavaScriptCore/runtime/InternalFunction.h | 4 +- .../webkit/JavaScriptCore/runtime/JSActivation.cpp | 2 +- .../webkit/JavaScriptCore/runtime/JSActivation.h | 4 +- .../webkit/JavaScriptCore/runtime/JSArray.cpp | 6 +- .../webkit/JavaScriptCore/runtime/JSArray.h | 6 +- .../webkit/JavaScriptCore/runtime/JSByteArray.cpp | 2 +- .../webkit/JavaScriptCore/runtime/JSByteArray.h | 2 +- .../webkit/JavaScriptCore/runtime/JSFunction.cpp | 6 +- .../webkit/JavaScriptCore/runtime/JSFunction.h | 6 +- .../webkit/JavaScriptCore/runtime/JSGlobalData.cpp | 15 + .../webkit/JavaScriptCore/runtime/JSGlobalData.h | 3 + .../JavaScriptCore/runtime/JSGlobalObject.cpp | 7 +- .../webkit/JavaScriptCore/runtime/JSGlobalObject.h | 24 +- .../runtime/JSGlobalObjectFunctions.cpp | 6 +- .../webkit/JavaScriptCore/runtime/JSONObject.h | 2 +- .../webkit/JavaScriptCore/runtime/JSObject.h | 9 +- .../JavaScriptCore/runtime/JSVariableObject.h | 2 +- .../JavaScriptCore/runtime/JSWrapperObject.h | 4 +- .../webkit/JavaScriptCore/runtime/MathObject.cpp | 2 +- .../webkit/JavaScriptCore/runtime/MathObject.h | 2 +- .../runtime/NativeErrorConstructor.cpp | 2 +- .../runtime/NativeErrorConstructor.h | 2 +- .../runtime/NativeErrorPrototype.cpp | 2 +- .../JavaScriptCore/runtime/NativeErrorPrototype.h | 2 +- .../JavaScriptCore/runtime/NumberConstructor.cpp | 2 +- .../JavaScriptCore/runtime/NumberConstructor.h | 2 +- .../webkit/JavaScriptCore/runtime/NumberObject.cpp | 2 +- .../webkit/JavaScriptCore/runtime/NumberObject.h | 2 +- .../JavaScriptCore/runtime/NumberPrototype.cpp | 2 +- .../JavaScriptCore/runtime/NumberPrototype.h | 2 +- .../JavaScriptCore/runtime/ObjectConstructor.cpp | 2 +- .../JavaScriptCore/runtime/ObjectConstructor.h | 2 +- .../JavaScriptCore/runtime/ObjectPrototype.cpp | 2 +- .../JavaScriptCore/runtime/ObjectPrototype.h | 2 +- .../JavaScriptCore/runtime/PropertyNameArray.h | 2 +- .../JavaScriptCore/runtime/PrototypeFunction.cpp | 2 +- .../JavaScriptCore/runtime/PrototypeFunction.h | 2 +- .../JavaScriptCore/runtime/RegExpConstructor.cpp | 2 +- .../JavaScriptCore/runtime/RegExpConstructor.h | 2 +- .../webkit/JavaScriptCore/runtime/RegExpObject.cpp | 2 +- .../webkit/JavaScriptCore/runtime/RegExpObject.h | 4 +- .../JavaScriptCore/runtime/RegExpPrototype.cpp | 2 +- .../JavaScriptCore/runtime/RegExpPrototype.h | 2 +- .../JavaScriptCore/runtime/StringConstructor.cpp | 2 +- .../JavaScriptCore/runtime/StringConstructor.h | 2 +- .../webkit/JavaScriptCore/runtime/StringObject.cpp | 6 +- .../webkit/JavaScriptCore/runtime/StringObject.h | 6 +- .../StringObjectThatMasqueradesAsUndefined.h | 2 +- .../JavaScriptCore/runtime/StringPrototype.cpp | 2 +- .../JavaScriptCore/runtime/StringPrototype.h | 2 +- .../webkit/JavaScriptCore/wtf/Assertions.cpp | 4 + .../webkit/JavaScriptCore/wtf/Assertions.h | 12 + .../webkit/JavaScriptCore/wtf/PassRefPtr.h | 58 +- src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h | 6 +- src/3rdparty/webkit/JavaScriptCore/wtf/RefPtr.h | 27 + src/3rdparty/webkit/VERSION | 4 +- src/3rdparty/webkit/WebCore/ChangeLog | 1100 ++++++++++++++++++++ src/3rdparty/webkit/WebCore/WebCore.gypi | 36 +- src/3rdparty/webkit/WebCore/WebCore.pro | 28 +- .../WebCore/bindings/js/DOMObjectWithSVGContext.h | 2 +- .../WebCore/bindings/js/JSAbstractWorkerCustom.cpp | 4 +- .../bindings/js/JSDOMApplicationCacheCustom.cpp | 4 +- .../webkit/WebCore/bindings/js/JSDOMBinding.cpp | 4 +- .../webkit/WebCore/bindings/js/JSDOMBinding.h | 12 +- .../WebCore/bindings/js/JSDOMGlobalObject.cpp | 14 +- .../webkit/WebCore/bindings/js/JSDOMGlobalObject.h | 10 +- .../webkit/WebCore/bindings/js/JSDOMWindowBase.cpp | 2 +- .../webkit/WebCore/bindings/js/JSDOMWindowBase.h | 2 +- .../WebCore/bindings/js/JSDOMWindowCustom.cpp | 12 +- .../webkit/WebCore/bindings/js/JSEventListener.cpp | 26 +- .../webkit/WebCore/bindings/js/JSEventListener.h | 13 +- .../WebCore/bindings/js/JSEventSourceCustom.cpp | 4 +- .../WebCore/bindings/js/JSHTMLAllCollection.h | 2 +- .../bindings/js/JSInspectedObjectWrapper.cpp | 2 +- .../WebCore/bindings/js/JSInspectedObjectWrapper.h | 2 +- .../bindings/js/JSInspectorCallbackWrapper.cpp | 2 +- .../bindings/js/JSInspectorCallbackWrapper.h | 2 +- .../WebCore/bindings/js/JSLazyEventListener.cpp | 49 +- .../WebCore/bindings/js/JSLazyEventListener.h | 11 +- .../WebCore/bindings/js/JSMessagePortCustom.cpp | 4 +- .../webkit/WebCore/bindings/js/JSNodeCustom.cpp | 4 +- .../bindings/js/JSQuarantinedObjectWrapper.cpp | 2 +- .../bindings/js/JSQuarantinedObjectWrapper.h | 2 +- .../bindings/js/JSSVGElementInstanceCustom.cpp | 4 +- .../WebCore/bindings/js/JSWorkerContextBase.cpp | 2 +- .../WebCore/bindings/js/JSWorkerContextBase.h | 2 +- .../WebCore/bindings/js/JSWorkerContextCustom.cpp | 4 +- .../WebCore/bindings/js/JSXMLHttpRequestCustom.cpp | 4 +- .../bindings/js/JSXMLHttpRequestUploadCustom.cpp | 4 +- .../WebCore/bindings/js/ScriptEventListener.cpp | 57 +- .../WebCore/bindings/js/ScriptEventListener.h | 3 + .../WebCore/bindings/scripts/CodeGeneratorCOM.pm | 3 +- .../WebCore/bindings/scripts/CodeGeneratorJS.pm | 22 +- .../WebCore/bindings/scripts/CodeGeneratorV8.pm | 8 +- .../webkit/WebCore/bridge/runtime_object.cpp | 2 +- .../webkit/WebCore/bridge/runtime_object.h | 2 +- src/3rdparty/webkit/WebCore/dom/Document.cpp | 19 +- src/3rdparty/webkit/WebCore/dom/Document.h | 13 +- src/3rdparty/webkit/WebCore/dom/EventListener.h | 7 +- src/3rdparty/webkit/WebCore/dom/EventListener.idl | 2 +- src/3rdparty/webkit/WebCore/dom/EventTarget.cpp | 2 +- src/3rdparty/webkit/WebCore/dom/Node.cpp | 25 +- src/3rdparty/webkit/WebCore/dom/Node.h | 3 + src/3rdparty/webkit/WebCore/dom/TransformSource.h | 51 + .../webkit/WebCore/dom/TransformSourceLibxslt.cpp | 43 + .../webkit/WebCore/dom/TransformSourceQt.cpp | 34 + .../webkit/WebCore/dom/XMLTokenizerLibxml2.cpp | 4 +- src/3rdparty/webkit/WebCore/dom/XMLTokenizerQt.cpp | 49 +- .../WebCore/editing/BreakBlockquoteCommand.cpp | 9 + .../WebCore/editing/DeleteSelectionCommand.cpp | 2 - .../webkit/WebCore/generated/JSAbstractWorker.cpp | 4 +- .../webkit/WebCore/generated/JSAbstractWorker.h | 4 +- src/3rdparty/webkit/WebCore/generated/JSAttr.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSAttr.h | 4 +- .../webkit/WebCore/generated/JSBarInfo.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSBarInfo.h | 4 +- .../webkit/WebCore/generated/JSCDATASection.cpp | 2 +- .../webkit/WebCore/generated/JSCDATASection.h | 4 +- .../webkit/WebCore/generated/JSCSSCharsetRule.cpp | 2 +- .../webkit/WebCore/generated/JSCSSCharsetRule.h | 4 +- .../webkit/WebCore/generated/JSCSSFontFaceRule.cpp | 2 +- .../webkit/WebCore/generated/JSCSSFontFaceRule.h | 4 +- .../webkit/WebCore/generated/JSCSSImportRule.cpp | 2 +- .../webkit/WebCore/generated/JSCSSImportRule.h | 4 +- .../webkit/WebCore/generated/JSCSSMediaRule.cpp | 2 +- .../webkit/WebCore/generated/JSCSSMediaRule.h | 4 +- .../webkit/WebCore/generated/JSCSSPageRule.cpp | 2 +- .../webkit/WebCore/generated/JSCSSPageRule.h | 4 +- .../WebCore/generated/JSCSSPrimitiveValue.cpp | 2 +- .../webkit/WebCore/generated/JSCSSPrimitiveValue.h | 4 +- .../webkit/WebCore/generated/JSCSSRule.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSCSSRule.h | 4 +- .../webkit/WebCore/generated/JSCSSRuleList.cpp | 2 +- .../webkit/WebCore/generated/JSCSSRuleList.h | 4 +- .../WebCore/generated/JSCSSStyleDeclaration.cpp | 2 +- .../WebCore/generated/JSCSSStyleDeclaration.h | 4 +- .../webkit/WebCore/generated/JSCSSStyleRule.cpp | 2 +- .../webkit/WebCore/generated/JSCSSStyleRule.h | 4 +- .../webkit/WebCore/generated/JSCSSStyleSheet.cpp | 2 +- .../webkit/WebCore/generated/JSCSSStyleSheet.h | 4 +- .../webkit/WebCore/generated/JSCSSValue.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSCSSValue.h | 4 +- .../webkit/WebCore/generated/JSCSSValueList.cpp | 2 +- .../webkit/WebCore/generated/JSCSSValueList.h | 4 +- .../generated/JSCSSVariablesDeclaration.cpp | 2 +- .../WebCore/generated/JSCSSVariablesDeclaration.h | 4 +- .../WebCore/generated/JSCSSVariablesRule.cpp | 2 +- .../webkit/WebCore/generated/JSCSSVariablesRule.h | 4 +- .../webkit/WebCore/generated/JSCanvasArray.cpp | 2 +- .../webkit/WebCore/generated/JSCanvasArray.h | 4 +- .../WebCore/generated/JSCanvasArrayBuffer.cpp | 2 +- .../webkit/WebCore/generated/JSCanvasArrayBuffer.h | 4 +- .../webkit/WebCore/generated/JSCanvasByteArray.cpp | 2 +- .../webkit/WebCore/generated/JSCanvasByteArray.h | 4 +- .../WebCore/generated/JSCanvasFloatArray.cpp | 2 +- .../webkit/WebCore/generated/JSCanvasFloatArray.h | 4 +- .../webkit/WebCore/generated/JSCanvasGradient.cpp | 2 +- .../webkit/WebCore/generated/JSCanvasGradient.h | 4 +- .../webkit/WebCore/generated/JSCanvasIntArray.cpp | 2 +- .../webkit/WebCore/generated/JSCanvasIntArray.h | 4 +- .../webkit/WebCore/generated/JSCanvasPattern.cpp | 2 +- .../webkit/WebCore/generated/JSCanvasPattern.h | 4 +- .../WebCore/generated/JSCanvasRenderingContext.cpp | 2 +- .../WebCore/generated/JSCanvasRenderingContext.h | 4 +- .../generated/JSCanvasRenderingContext2D.cpp | 2 +- .../WebCore/generated/JSCanvasRenderingContext2D.h | 4 +- .../generated/JSCanvasRenderingContext3D.cpp | 2 +- .../WebCore/generated/JSCanvasRenderingContext3D.h | 4 +- .../WebCore/generated/JSCanvasShortArray.cpp | 2 +- .../webkit/WebCore/generated/JSCanvasShortArray.h | 4 +- .../generated/JSCanvasUnsignedByteArray.cpp | 2 +- .../WebCore/generated/JSCanvasUnsignedByteArray.h | 4 +- .../WebCore/generated/JSCanvasUnsignedIntArray.cpp | 2 +- .../WebCore/generated/JSCanvasUnsignedIntArray.h | 4 +- .../generated/JSCanvasUnsignedShortArray.cpp | 2 +- .../WebCore/generated/JSCanvasUnsignedShortArray.h | 4 +- .../webkit/WebCore/generated/JSCharacterData.cpp | 2 +- .../webkit/WebCore/generated/JSCharacterData.h | 4 +- .../webkit/WebCore/generated/JSClientRect.cpp | 2 +- .../webkit/WebCore/generated/JSClientRect.h | 4 +- .../webkit/WebCore/generated/JSClientRectList.cpp | 2 +- .../webkit/WebCore/generated/JSClientRectList.h | 4 +- .../webkit/WebCore/generated/JSClipboard.cpp | 2 +- .../webkit/WebCore/generated/JSClipboard.h | 4 +- .../webkit/WebCore/generated/JSComment.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSComment.h | 4 +- .../webkit/WebCore/generated/JSConsole.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSConsole.h | 4 +- .../webkit/WebCore/generated/JSCoordinates.cpp | 2 +- .../webkit/WebCore/generated/JSCoordinates.h | 4 +- .../webkit/WebCore/generated/JSCounter.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSCounter.h | 4 +- .../WebCore/generated/JSDOMApplicationCache.cpp | 18 +- .../WebCore/generated/JSDOMApplicationCache.h | 4 +- .../WebCore/generated/JSDOMCoreException.cpp | 2 +- .../webkit/WebCore/generated/JSDOMCoreException.h | 4 +- .../WebCore/generated/JSDOMImplementation.cpp | 2 +- .../webkit/WebCore/generated/JSDOMImplementation.h | 4 +- .../webkit/WebCore/generated/JSDOMParser.cpp | 2 +- .../webkit/WebCore/generated/JSDOMParser.h | 4 +- .../webkit/WebCore/generated/JSDOMSelection.cpp | 2 +- .../webkit/WebCore/generated/JSDOMSelection.h | 4 +- .../webkit/WebCore/generated/JSDOMWindow.cpp | 158 +-- .../webkit/WebCore/generated/JSDOMWindow.h | 7 +- .../webkit/WebCore/generated/JSDataGridColumn.cpp | 2 +- .../webkit/WebCore/generated/JSDataGridColumn.h | 4 +- .../WebCore/generated/JSDataGridColumnList.cpp | 2 +- .../WebCore/generated/JSDataGridColumnList.h | 4 +- .../webkit/WebCore/generated/JSDatabase.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSDatabase.h | 4 +- .../WebCore/generated/JSDedicatedWorkerContext.cpp | 4 +- .../WebCore/generated/JSDedicatedWorkerContext.h | 4 +- .../webkit/WebCore/generated/JSDocument.cpp | 80 +- src/3rdparty/webkit/WebCore/generated/JSDocument.h | 4 +- .../WebCore/generated/JSDocumentFragment.cpp | 2 +- .../webkit/WebCore/generated/JSDocumentFragment.h | 4 +- .../webkit/WebCore/generated/JSDocumentType.cpp | 2 +- .../webkit/WebCore/generated/JSDocumentType.h | 4 +- .../webkit/WebCore/generated/JSElement.cpp | 80 +- src/3rdparty/webkit/WebCore/generated/JSElement.h | 4 +- src/3rdparty/webkit/WebCore/generated/JSEntity.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSEntity.h | 4 +- .../webkit/WebCore/generated/JSEntityReference.cpp | 2 +- .../webkit/WebCore/generated/JSEntityReference.h | 4 +- .../webkit/WebCore/generated/JSErrorEvent.cpp | 2 +- .../webkit/WebCore/generated/JSErrorEvent.h | 4 +- src/3rdparty/webkit/WebCore/generated/JSEvent.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSEvent.h | 4 +- .../webkit/WebCore/generated/JSEventException.cpp | 2 +- .../webkit/WebCore/generated/JSEventException.h | 4 +- .../webkit/WebCore/generated/JSEventSource.cpp | 8 +- .../webkit/WebCore/generated/JSEventSource.h | 4 +- src/3rdparty/webkit/WebCore/generated/JSFile.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSFile.h | 4 +- .../webkit/WebCore/generated/JSFileList.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSFileList.h | 4 +- .../webkit/WebCore/generated/JSGeolocation.cpp | 2 +- .../webkit/WebCore/generated/JSGeolocation.h | 4 +- .../webkit/WebCore/generated/JSGeoposition.cpp | 2 +- .../webkit/WebCore/generated/JSGeoposition.h | 4 +- .../WebCore/generated/JSHTMLAnchorElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLAnchorElement.h | 4 +- .../WebCore/generated/JSHTMLAppletElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLAppletElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLAreaElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLAreaElement.h | 4 +- .../WebCore/generated/JSHTMLAudioElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLAudioElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLBRElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLBRElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLBaseElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLBaseElement.h | 4 +- .../WebCore/generated/JSHTMLBaseFontElement.cpp | 2 +- .../WebCore/generated/JSHTMLBaseFontElement.h | 4 +- .../WebCore/generated/JSHTMLBlockquoteElement.cpp | 2 +- .../WebCore/generated/JSHTMLBlockquoteElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLBodyElement.cpp | 18 +- .../webkit/WebCore/generated/JSHTMLBodyElement.h | 4 +- .../WebCore/generated/JSHTMLButtonElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLButtonElement.h | 4 +- .../WebCore/generated/JSHTMLCanvasElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLCanvasElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLCollection.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLCollection.h | 4 +- .../WebCore/generated/JSHTMLDListElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLDListElement.h | 4 +- .../generated/JSHTMLDataGridCellElement.cpp | 2 +- .../WebCore/generated/JSHTMLDataGridCellElement.h | 4 +- .../WebCore/generated/JSHTMLDataGridColElement.cpp | 2 +- .../WebCore/generated/JSHTMLDataGridColElement.h | 4 +- .../WebCore/generated/JSHTMLDataGridElement.cpp | 2 +- .../WebCore/generated/JSHTMLDataGridElement.h | 4 +- .../WebCore/generated/JSHTMLDataGridRowElement.cpp | 2 +- .../WebCore/generated/JSHTMLDataGridRowElement.h | 4 +- .../WebCore/generated/JSHTMLDataListElement.cpp | 2 +- .../WebCore/generated/JSHTMLDataListElement.h | 4 +- .../WebCore/generated/JSHTMLDirectoryElement.cpp | 2 +- .../WebCore/generated/JSHTMLDirectoryElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLDivElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLDivElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLDocument.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLDocument.h | 4 +- .../webkit/WebCore/generated/JSHTMLElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLElement.h | 4 +- .../WebCore/generated/JSHTMLEmbedElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLEmbedElement.h | 4 +- .../WebCore/generated/JSHTMLFieldSetElement.cpp | 2 +- .../WebCore/generated/JSHTMLFieldSetElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLFontElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLFontElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLFormElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLFormElement.h | 4 +- .../WebCore/generated/JSHTMLFrameElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLFrameElement.h | 4 +- .../WebCore/generated/JSHTMLFrameSetElement.cpp | 18 +- .../WebCore/generated/JSHTMLFrameSetElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLHRElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLHRElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLHeadElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLHeadElement.h | 4 +- .../WebCore/generated/JSHTMLHeadingElement.cpp | 2 +- .../WebCore/generated/JSHTMLHeadingElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLHtmlElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLHtmlElement.h | 4 +- .../WebCore/generated/JSHTMLIFrameElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLIFrameElement.h | 4 +- .../WebCore/generated/JSHTMLImageElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLImageElement.h | 4 +- .../WebCore/generated/JSHTMLInputElement.cpp | 6 +- .../webkit/WebCore/generated/JSHTMLInputElement.h | 4 +- .../WebCore/generated/JSHTMLIsIndexElement.cpp | 2 +- .../WebCore/generated/JSHTMLIsIndexElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLLIElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLLIElement.h | 4 +- .../WebCore/generated/JSHTMLLabelElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLLabelElement.h | 4 +- .../WebCore/generated/JSHTMLLegendElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLLegendElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLLinkElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLLinkElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLMapElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLMapElement.h | 4 +- .../WebCore/generated/JSHTMLMarqueeElement.cpp | 2 +- .../WebCore/generated/JSHTMLMarqueeElement.h | 4 +- .../WebCore/generated/JSHTMLMediaElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLMediaElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLMenuElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLMenuElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLMetaElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLMetaElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLModElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLModElement.h | 4 +- .../WebCore/generated/JSHTMLOListElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLOListElement.h | 4 +- .../WebCore/generated/JSHTMLObjectElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLObjectElement.h | 4 +- .../WebCore/generated/JSHTMLOptGroupElement.cpp | 2 +- .../WebCore/generated/JSHTMLOptGroupElement.h | 4 +- .../WebCore/generated/JSHTMLOptionElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLOptionElement.h | 4 +- .../WebCore/generated/JSHTMLOptionsCollection.cpp | 2 +- .../WebCore/generated/JSHTMLOptionsCollection.h | 4 +- .../WebCore/generated/JSHTMLParagraphElement.cpp | 2 +- .../WebCore/generated/JSHTMLParagraphElement.h | 4 +- .../WebCore/generated/JSHTMLParamElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLParamElement.h | 4 +- .../webkit/WebCore/generated/JSHTMLPreElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLPreElement.h | 4 +- .../WebCore/generated/JSHTMLQuoteElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLQuoteElement.h | 4 +- .../WebCore/generated/JSHTMLScriptElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLScriptElement.h | 4 +- .../WebCore/generated/JSHTMLSelectElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLSelectElement.h | 4 +- .../WebCore/generated/JSHTMLSourceElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLSourceElement.h | 4 +- .../WebCore/generated/JSHTMLStyleElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLStyleElement.h | 4 +- .../generated/JSHTMLTableCaptionElement.cpp | 2 +- .../WebCore/generated/JSHTMLTableCaptionElement.h | 4 +- .../WebCore/generated/JSHTMLTableCellElement.cpp | 2 +- .../WebCore/generated/JSHTMLTableCellElement.h | 4 +- .../WebCore/generated/JSHTMLTableColElement.cpp | 2 +- .../WebCore/generated/JSHTMLTableColElement.h | 4 +- .../WebCore/generated/JSHTMLTableElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLTableElement.h | 4 +- .../WebCore/generated/JSHTMLTableRowElement.cpp | 2 +- .../WebCore/generated/JSHTMLTableRowElement.h | 4 +- .../generated/JSHTMLTableSectionElement.cpp | 2 +- .../WebCore/generated/JSHTMLTableSectionElement.h | 4 +- .../WebCore/generated/JSHTMLTextAreaElement.cpp | 6 +- .../WebCore/generated/JSHTMLTextAreaElement.h | 4 +- .../WebCore/generated/JSHTMLTitleElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLTitleElement.h | 4 +- .../WebCore/generated/JSHTMLUListElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLUListElement.h | 4 +- .../WebCore/generated/JSHTMLVideoElement.cpp | 2 +- .../webkit/WebCore/generated/JSHTMLVideoElement.h | 4 +- .../webkit/WebCore/generated/JSHistory.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSHistory.h | 4 +- .../webkit/WebCore/generated/JSImageData.cpp | 2 +- .../webkit/WebCore/generated/JSImageData.h | 4 +- .../WebCore/generated/JSInspectorBackend.cpp | 75 +- .../webkit/WebCore/generated/JSInspectorBackend.h | 9 +- .../WebCore/generated/JSJavaScriptCallFrame.cpp | 2 +- .../WebCore/generated/JSJavaScriptCallFrame.h | 4 +- .../webkit/WebCore/generated/JSKeyboardEvent.cpp | 2 +- .../webkit/WebCore/generated/JSKeyboardEvent.h | 4 +- .../webkit/WebCore/generated/JSLocation.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSLocation.h | 4 +- src/3rdparty/webkit/WebCore/generated/JSMedia.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSMedia.h | 4 +- .../webkit/WebCore/generated/JSMediaError.cpp | 2 +- .../webkit/WebCore/generated/JSMediaError.h | 4 +- .../webkit/WebCore/generated/JSMediaList.cpp | 2 +- .../webkit/WebCore/generated/JSMediaList.h | 4 +- .../webkit/WebCore/generated/JSMessageChannel.cpp | 2 +- .../webkit/WebCore/generated/JSMessageChannel.h | 4 +- .../webkit/WebCore/generated/JSMessageEvent.cpp | 2 +- .../webkit/WebCore/generated/JSMessageEvent.h | 4 +- .../webkit/WebCore/generated/JSMessagePort.cpp | 4 +- .../webkit/WebCore/generated/JSMessagePort.h | 4 +- .../webkit/WebCore/generated/JSMimeType.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSMimeType.h | 4 +- .../webkit/WebCore/generated/JSMimeTypeArray.cpp | 2 +- .../webkit/WebCore/generated/JSMimeTypeArray.h | 4 +- .../webkit/WebCore/generated/JSMouseEvent.cpp | 2 +- .../webkit/WebCore/generated/JSMouseEvent.h | 4 +- .../webkit/WebCore/generated/JSMutationEvent.cpp | 2 +- .../webkit/WebCore/generated/JSMutationEvent.h | 4 +- .../webkit/WebCore/generated/JSNamedNodeMap.cpp | 2 +- .../webkit/WebCore/generated/JSNamedNodeMap.h | 4 +- .../webkit/WebCore/generated/JSNavigator.cpp | 2 +- .../webkit/WebCore/generated/JSNavigator.h | 4 +- src/3rdparty/webkit/WebCore/generated/JSNode.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSNode.h | 4 +- .../webkit/WebCore/generated/JSNodeFilter.cpp | 2 +- .../webkit/WebCore/generated/JSNodeFilter.h | 4 +- .../webkit/WebCore/generated/JSNodeIterator.cpp | 2 +- .../webkit/WebCore/generated/JSNodeIterator.h | 4 +- .../webkit/WebCore/generated/JSNodeList.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSNodeList.h | 4 +- .../webkit/WebCore/generated/JSNotation.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSNotation.h | 4 +- .../webkit/WebCore/generated/JSOverflowEvent.cpp | 2 +- .../webkit/WebCore/generated/JSOverflowEvent.h | 4 +- .../WebCore/generated/JSPageTransitionEvent.cpp | 2 +- .../WebCore/generated/JSPageTransitionEvent.h | 4 +- src/3rdparty/webkit/WebCore/generated/JSPlugin.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSPlugin.h | 4 +- .../webkit/WebCore/generated/JSPluginArray.cpp | 2 +- .../webkit/WebCore/generated/JSPluginArray.h | 4 +- .../webkit/WebCore/generated/JSPositionError.cpp | 2 +- .../webkit/WebCore/generated/JSPositionError.h | 4 +- .../WebCore/generated/JSProcessingInstruction.cpp | 2 +- .../WebCore/generated/JSProcessingInstruction.h | 4 +- .../webkit/WebCore/generated/JSProgressEvent.cpp | 2 +- .../webkit/WebCore/generated/JSProgressEvent.h | 4 +- .../webkit/WebCore/generated/JSRGBColor.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSRGBColor.h | 4 +- src/3rdparty/webkit/WebCore/generated/JSRange.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSRange.h | 4 +- .../webkit/WebCore/generated/JSRangeException.cpp | 2 +- .../webkit/WebCore/generated/JSRangeException.h | 4 +- src/3rdparty/webkit/WebCore/generated/JSRect.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSRect.h | 4 +- .../webkit/WebCore/generated/JSSQLError.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSSQLError.h | 4 +- .../webkit/WebCore/generated/JSSQLResultSet.cpp | 2 +- .../webkit/WebCore/generated/JSSQLResultSet.h | 4 +- .../WebCore/generated/JSSQLResultSetRowList.cpp | 2 +- .../WebCore/generated/JSSQLResultSetRowList.h | 4 +- .../webkit/WebCore/generated/JSSQLTransaction.cpp | 2 +- .../webkit/WebCore/generated/JSSQLTransaction.h | 4 +- .../webkit/WebCore/generated/JSSVGAElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGAElement.h | 4 +- .../WebCore/generated/JSSVGAltGlyphElement.cpp | 2 +- .../WebCore/generated/JSSVGAltGlyphElement.h | 4 +- .../webkit/WebCore/generated/JSSVGAngle.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSSVGAngle.h | 4 +- .../WebCore/generated/JSSVGAnimateColorElement.cpp | 2 +- .../WebCore/generated/JSSVGAnimateColorElement.h | 4 +- .../WebCore/generated/JSSVGAnimateElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGAnimateElement.h | 4 +- .../generated/JSSVGAnimateTransformElement.cpp | 2 +- .../generated/JSSVGAnimateTransformElement.h | 4 +- .../WebCore/generated/JSSVGAnimatedAngle.cpp | 2 +- .../webkit/WebCore/generated/JSSVGAnimatedAngle.h | 4 +- .../WebCore/generated/JSSVGAnimatedBoolean.cpp | 2 +- .../WebCore/generated/JSSVGAnimatedBoolean.h | 4 +- .../WebCore/generated/JSSVGAnimatedEnumeration.cpp | 2 +- .../WebCore/generated/JSSVGAnimatedEnumeration.h | 4 +- .../WebCore/generated/JSSVGAnimatedInteger.cpp | 2 +- .../WebCore/generated/JSSVGAnimatedInteger.h | 4 +- .../WebCore/generated/JSSVGAnimatedLength.cpp | 2 +- .../webkit/WebCore/generated/JSSVGAnimatedLength.h | 4 +- .../WebCore/generated/JSSVGAnimatedLengthList.cpp | 2 +- .../WebCore/generated/JSSVGAnimatedLengthList.h | 4 +- .../WebCore/generated/JSSVGAnimatedNumber.cpp | 2 +- .../webkit/WebCore/generated/JSSVGAnimatedNumber.h | 4 +- .../WebCore/generated/JSSVGAnimatedNumberList.cpp | 2 +- .../WebCore/generated/JSSVGAnimatedNumberList.h | 4 +- .../generated/JSSVGAnimatedPreserveAspectRatio.cpp | 2 +- .../generated/JSSVGAnimatedPreserveAspectRatio.h | 4 +- .../webkit/WebCore/generated/JSSVGAnimatedRect.cpp | 2 +- .../webkit/WebCore/generated/JSSVGAnimatedRect.h | 4 +- .../WebCore/generated/JSSVGAnimatedString.cpp | 2 +- .../webkit/WebCore/generated/JSSVGAnimatedString.h | 4 +- .../generated/JSSVGAnimatedTransformList.cpp | 2 +- .../WebCore/generated/JSSVGAnimatedTransformList.h | 4 +- .../WebCore/generated/JSSVGAnimationElement.cpp | 2 +- .../WebCore/generated/JSSVGAnimationElement.h | 4 +- .../WebCore/generated/JSSVGCircleElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGCircleElement.h | 4 +- .../WebCore/generated/JSSVGClipPathElement.cpp | 2 +- .../WebCore/generated/JSSVGClipPathElement.h | 4 +- .../webkit/WebCore/generated/JSSVGColor.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSSVGColor.h | 4 +- .../JSSVGComponentTransferFunctionElement.cpp | 2 +- .../JSSVGComponentTransferFunctionElement.h | 4 +- .../WebCore/generated/JSSVGCursorElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGCursorElement.h | 4 +- .../webkit/WebCore/generated/JSSVGDefsElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGDefsElement.h | 4 +- .../webkit/WebCore/generated/JSSVGDescElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGDescElement.h | 4 +- .../webkit/WebCore/generated/JSSVGDocument.cpp | 2 +- .../webkit/WebCore/generated/JSSVGDocument.h | 4 +- .../webkit/WebCore/generated/JSSVGElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGElement.h | 4 +- .../WebCore/generated/JSSVGElementInstance.cpp | 82 +- .../WebCore/generated/JSSVGElementInstance.h | 4 +- .../WebCore/generated/JSSVGElementInstanceList.cpp | 2 +- .../WebCore/generated/JSSVGElementInstanceList.h | 4 +- .../WebCore/generated/JSSVGEllipseElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGEllipseElement.h | 4 +- .../webkit/WebCore/generated/JSSVGException.cpp | 2 +- .../webkit/WebCore/generated/JSSVGException.h | 4 +- .../WebCore/generated/JSSVGFEBlendElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGFEBlendElement.h | 4 +- .../generated/JSSVGFEColorMatrixElement.cpp | 2 +- .../WebCore/generated/JSSVGFEColorMatrixElement.h | 4 +- .../generated/JSSVGFEComponentTransferElement.cpp | 2 +- .../generated/JSSVGFEComponentTransferElement.h | 4 +- .../WebCore/generated/JSSVGFECompositeElement.cpp | 2 +- .../WebCore/generated/JSSVGFECompositeElement.h | 4 +- .../generated/JSSVGFEDiffuseLightingElement.cpp | 2 +- .../generated/JSSVGFEDiffuseLightingElement.h | 4 +- .../generated/JSSVGFEDisplacementMapElement.cpp | 2 +- .../generated/JSSVGFEDisplacementMapElement.h | 4 +- .../generated/JSSVGFEDistantLightElement.cpp | 2 +- .../WebCore/generated/JSSVGFEDistantLightElement.h | 4 +- .../WebCore/generated/JSSVGFEFloodElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGFEFloodElement.h | 4 +- .../WebCore/generated/JSSVGFEFuncAElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGFEFuncAElement.h | 4 +- .../WebCore/generated/JSSVGFEFuncBElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGFEFuncBElement.h | 4 +- .../WebCore/generated/JSSVGFEFuncGElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGFEFuncGElement.h | 4 +- .../WebCore/generated/JSSVGFEFuncRElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGFEFuncRElement.h | 4 +- .../generated/JSSVGFEGaussianBlurElement.cpp | 2 +- .../WebCore/generated/JSSVGFEGaussianBlurElement.h | 4 +- .../WebCore/generated/JSSVGFEImageElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGFEImageElement.h | 4 +- .../WebCore/generated/JSSVGFEMergeElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGFEMergeElement.h | 4 +- .../WebCore/generated/JSSVGFEMergeNodeElement.cpp | 2 +- .../WebCore/generated/JSSVGFEMergeNodeElement.h | 4 +- .../WebCore/generated/JSSVGFEOffsetElement.cpp | 2 +- .../WebCore/generated/JSSVGFEOffsetElement.h | 4 +- .../WebCore/generated/JSSVGFEPointLightElement.cpp | 2 +- .../WebCore/generated/JSSVGFEPointLightElement.h | 4 +- .../generated/JSSVGFESpecularLightingElement.cpp | 2 +- .../generated/JSSVGFESpecularLightingElement.h | 4 +- .../WebCore/generated/JSSVGFESpotLightElement.cpp | 2 +- .../WebCore/generated/JSSVGFESpotLightElement.h | 4 +- .../WebCore/generated/JSSVGFETileElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGFETileElement.h | 4 +- .../WebCore/generated/JSSVGFETurbulenceElement.cpp | 2 +- .../WebCore/generated/JSSVGFETurbulenceElement.h | 4 +- .../WebCore/generated/JSSVGFilterElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGFilterElement.h | 4 +- .../webkit/WebCore/generated/JSSVGFontElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGFontElement.h | 4 +- .../WebCore/generated/JSSVGFontFaceElement.cpp | 2 +- .../WebCore/generated/JSSVGFontFaceElement.h | 4 +- .../generated/JSSVGFontFaceFormatElement.cpp | 2 +- .../WebCore/generated/JSSVGFontFaceFormatElement.h | 4 +- .../WebCore/generated/JSSVGFontFaceNameElement.cpp | 2 +- .../WebCore/generated/JSSVGFontFaceNameElement.h | 4 +- .../WebCore/generated/JSSVGFontFaceSrcElement.cpp | 2 +- .../WebCore/generated/JSSVGFontFaceSrcElement.h | 4 +- .../WebCore/generated/JSSVGFontFaceUriElement.cpp | 2 +- .../WebCore/generated/JSSVGFontFaceUriElement.h | 4 +- .../generated/JSSVGForeignObjectElement.cpp | 2 +- .../WebCore/generated/JSSVGForeignObjectElement.h | 4 +- .../webkit/WebCore/generated/JSSVGGElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGGElement.h | 4 +- .../webkit/WebCore/generated/JSSVGGlyphElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGGlyphElement.h | 4 +- .../WebCore/generated/JSSVGGradientElement.cpp | 2 +- .../WebCore/generated/JSSVGGradientElement.h | 4 +- .../webkit/WebCore/generated/JSSVGHKernElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGHKernElement.h | 4 +- .../webkit/WebCore/generated/JSSVGImageElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGImageElement.h | 4 +- .../webkit/WebCore/generated/JSSVGLength.cpp | 2 +- .../webkit/WebCore/generated/JSSVGLength.h | 4 +- .../webkit/WebCore/generated/JSSVGLengthList.cpp | 2 +- .../webkit/WebCore/generated/JSSVGLengthList.h | 4 +- .../webkit/WebCore/generated/JSSVGLineElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGLineElement.h | 4 +- .../generated/JSSVGLinearGradientElement.cpp | 2 +- .../WebCore/generated/JSSVGLinearGradientElement.h | 4 +- .../WebCore/generated/JSSVGMarkerElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGMarkerElement.h | 4 +- .../webkit/WebCore/generated/JSSVGMaskElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGMaskElement.h | 4 +- .../webkit/WebCore/generated/JSSVGMatrix.cpp | 2 +- .../webkit/WebCore/generated/JSSVGMatrix.h | 4 +- .../WebCore/generated/JSSVGMetadataElement.cpp | 2 +- .../WebCore/generated/JSSVGMetadataElement.h | 4 +- .../WebCore/generated/JSSVGMissingGlyphElement.cpp | 2 +- .../WebCore/generated/JSSVGMissingGlyphElement.h | 4 +- .../webkit/WebCore/generated/JSSVGNumber.cpp | 2 +- .../webkit/WebCore/generated/JSSVGNumber.h | 4 +- .../webkit/WebCore/generated/JSSVGNumberList.cpp | 2 +- .../webkit/WebCore/generated/JSSVGNumberList.h | 4 +- .../webkit/WebCore/generated/JSSVGPaint.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSSVGPaint.h | 4 +- .../webkit/WebCore/generated/JSSVGPathElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGPathElement.h | 4 +- .../webkit/WebCore/generated/JSSVGPathSeg.cpp | 2 +- .../webkit/WebCore/generated/JSSVGPathSeg.h | 4 +- .../WebCore/generated/JSSVGPathSegArcAbs.cpp | 2 +- .../webkit/WebCore/generated/JSSVGPathSegArcAbs.h | 4 +- .../WebCore/generated/JSSVGPathSegArcRel.cpp | 2 +- .../webkit/WebCore/generated/JSSVGPathSegArcRel.h | 4 +- .../WebCore/generated/JSSVGPathSegClosePath.cpp | 2 +- .../WebCore/generated/JSSVGPathSegClosePath.h | 4 +- .../generated/JSSVGPathSegCurvetoCubicAbs.cpp | 2 +- .../generated/JSSVGPathSegCurvetoCubicAbs.h | 4 +- .../generated/JSSVGPathSegCurvetoCubicRel.cpp | 2 +- .../generated/JSSVGPathSegCurvetoCubicRel.h | 4 +- .../JSSVGPathSegCurvetoCubicSmoothAbs.cpp | 2 +- .../generated/JSSVGPathSegCurvetoCubicSmoothAbs.h | 4 +- .../JSSVGPathSegCurvetoCubicSmoothRel.cpp | 2 +- .../generated/JSSVGPathSegCurvetoCubicSmoothRel.h | 4 +- .../generated/JSSVGPathSegCurvetoQuadraticAbs.cpp | 2 +- .../generated/JSSVGPathSegCurvetoQuadraticAbs.h | 4 +- .../generated/JSSVGPathSegCurvetoQuadraticRel.cpp | 2 +- .../generated/JSSVGPathSegCurvetoQuadraticRel.h | 4 +- .../JSSVGPathSegCurvetoQuadraticSmoothAbs.cpp | 2 +- .../JSSVGPathSegCurvetoQuadraticSmoothAbs.h | 4 +- .../JSSVGPathSegCurvetoQuadraticSmoothRel.cpp | 2 +- .../JSSVGPathSegCurvetoQuadraticSmoothRel.h | 4 +- .../WebCore/generated/JSSVGPathSegLinetoAbs.cpp | 2 +- .../WebCore/generated/JSSVGPathSegLinetoAbs.h | 4 +- .../generated/JSSVGPathSegLinetoHorizontalAbs.cpp | 2 +- .../generated/JSSVGPathSegLinetoHorizontalAbs.h | 4 +- .../generated/JSSVGPathSegLinetoHorizontalRel.cpp | 2 +- .../generated/JSSVGPathSegLinetoHorizontalRel.h | 4 +- .../WebCore/generated/JSSVGPathSegLinetoRel.cpp | 2 +- .../WebCore/generated/JSSVGPathSegLinetoRel.h | 4 +- .../generated/JSSVGPathSegLinetoVerticalAbs.cpp | 2 +- .../generated/JSSVGPathSegLinetoVerticalAbs.h | 4 +- .../generated/JSSVGPathSegLinetoVerticalRel.cpp | 2 +- .../generated/JSSVGPathSegLinetoVerticalRel.h | 4 +- .../webkit/WebCore/generated/JSSVGPathSegList.cpp | 2 +- .../webkit/WebCore/generated/JSSVGPathSegList.h | 4 +- .../WebCore/generated/JSSVGPathSegMovetoAbs.cpp | 2 +- .../WebCore/generated/JSSVGPathSegMovetoAbs.h | 4 +- .../WebCore/generated/JSSVGPathSegMovetoRel.cpp | 2 +- .../WebCore/generated/JSSVGPathSegMovetoRel.h | 4 +- .../WebCore/generated/JSSVGPatternElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGPatternElement.h | 4 +- .../webkit/WebCore/generated/JSSVGPoint.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSSVGPoint.h | 4 +- .../webkit/WebCore/generated/JSSVGPointList.cpp | 2 +- .../webkit/WebCore/generated/JSSVGPointList.h | 4 +- .../WebCore/generated/JSSVGPolygonElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGPolygonElement.h | 4 +- .../WebCore/generated/JSSVGPolylineElement.cpp | 2 +- .../WebCore/generated/JSSVGPolylineElement.h | 4 +- .../WebCore/generated/JSSVGPreserveAspectRatio.cpp | 2 +- .../WebCore/generated/JSSVGPreserveAspectRatio.h | 4 +- .../generated/JSSVGRadialGradientElement.cpp | 2 +- .../WebCore/generated/JSSVGRadialGradientElement.h | 4 +- .../webkit/WebCore/generated/JSSVGRect.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSSVGRect.h | 4 +- .../webkit/WebCore/generated/JSSVGRectElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGRectElement.h | 4 +- .../WebCore/generated/JSSVGRenderingIntent.cpp | 2 +- .../WebCore/generated/JSSVGRenderingIntent.h | 4 +- .../webkit/WebCore/generated/JSSVGSVGElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGSVGElement.h | 4 +- .../WebCore/generated/JSSVGScriptElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGScriptElement.h | 4 +- .../webkit/WebCore/generated/JSSVGSetElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGSetElement.h | 4 +- .../webkit/WebCore/generated/JSSVGStopElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGStopElement.h | 4 +- .../webkit/WebCore/generated/JSSVGStringList.cpp | 2 +- .../webkit/WebCore/generated/JSSVGStringList.h | 4 +- .../webkit/WebCore/generated/JSSVGStyleElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGStyleElement.h | 4 +- .../WebCore/generated/JSSVGSwitchElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGSwitchElement.h | 4 +- .../WebCore/generated/JSSVGSymbolElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGSymbolElement.h | 4 +- .../webkit/WebCore/generated/JSSVGTRefElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGTRefElement.h | 4 +- .../webkit/WebCore/generated/JSSVGTSpanElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGTSpanElement.h | 4 +- .../WebCore/generated/JSSVGTextContentElement.cpp | 2 +- .../WebCore/generated/JSSVGTextContentElement.h | 4 +- .../webkit/WebCore/generated/JSSVGTextElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGTextElement.h | 4 +- .../WebCore/generated/JSSVGTextPathElement.cpp | 2 +- .../WebCore/generated/JSSVGTextPathElement.h | 4 +- .../generated/JSSVGTextPositioningElement.cpp | 2 +- .../generated/JSSVGTextPositioningElement.h | 4 +- .../webkit/WebCore/generated/JSSVGTitleElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGTitleElement.h | 4 +- .../webkit/WebCore/generated/JSSVGTransform.cpp | 2 +- .../webkit/WebCore/generated/JSSVGTransform.h | 4 +- .../WebCore/generated/JSSVGTransformList.cpp | 2 +- .../webkit/WebCore/generated/JSSVGTransformList.h | 4 +- .../webkit/WebCore/generated/JSSVGUnitTypes.cpp | 2 +- .../webkit/WebCore/generated/JSSVGUnitTypes.h | 4 +- .../webkit/WebCore/generated/JSSVGUseElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGUseElement.h | 4 +- .../webkit/WebCore/generated/JSSVGViewElement.cpp | 2 +- .../webkit/WebCore/generated/JSSVGViewElement.h | 4 +- .../webkit/WebCore/generated/JSSVGZoomEvent.cpp | 2 +- .../webkit/WebCore/generated/JSSVGZoomEvent.h | 4 +- src/3rdparty/webkit/WebCore/generated/JSScreen.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSScreen.h | 4 +- .../webkit/WebCore/generated/JSSharedWorker.cpp | 2 +- .../webkit/WebCore/generated/JSSharedWorker.h | 4 +- .../WebCore/generated/JSSharedWorkerContext.cpp | 4 +- .../WebCore/generated/JSSharedWorkerContext.h | 4 +- .../webkit/WebCore/generated/JSStorage.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSStorage.h | 4 +- .../webkit/WebCore/generated/JSStorageEvent.cpp | 2 +- .../webkit/WebCore/generated/JSStorageEvent.h | 4 +- .../webkit/WebCore/generated/JSStyleSheet.cpp | 2 +- .../webkit/WebCore/generated/JSStyleSheet.h | 4 +- .../webkit/WebCore/generated/JSStyleSheetList.cpp | 2 +- .../webkit/WebCore/generated/JSStyleSheetList.h | 4 +- src/3rdparty/webkit/WebCore/generated/JSText.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSText.h | 4 +- .../webkit/WebCore/generated/JSTextEvent.cpp | 2 +- .../webkit/WebCore/generated/JSTextEvent.h | 4 +- .../webkit/WebCore/generated/JSTextMetrics.cpp | 2 +- .../webkit/WebCore/generated/JSTextMetrics.h | 4 +- .../webkit/WebCore/generated/JSTimeRanges.cpp | 2 +- .../webkit/WebCore/generated/JSTimeRanges.h | 4 +- .../webkit/WebCore/generated/JSTreeWalker.cpp | 2 +- .../webkit/WebCore/generated/JSTreeWalker.h | 4 +- .../webkit/WebCore/generated/JSUIEvent.cpp | 2 +- src/3rdparty/webkit/WebCore/generated/JSUIEvent.h | 4 +- .../webkit/WebCore/generated/JSValidityState.cpp | 2 +- .../webkit/WebCore/generated/JSValidityState.h | 4 +- .../webkit/WebCore/generated/JSVoidCallback.cpp | 2 +- .../webkit/WebCore/generated/JSVoidCallback.h | 4 +- .../WebCore/generated/JSWebKitAnimationEvent.cpp | 2 +- .../WebCore/generated/JSWebKitAnimationEvent.h | 4 +- .../WebCore/generated/JSWebKitCSSKeyframeRule.cpp | 2 +- .../WebCore/generated/JSWebKitCSSKeyframeRule.h | 4 +- .../WebCore/generated/JSWebKitCSSKeyframesRule.cpp | 2 +- .../WebCore/generated/JSWebKitCSSKeyframesRule.h | 4 +- .../webkit/WebCore/generated/JSWebKitCSSMatrix.cpp | 2 +- .../webkit/WebCore/generated/JSWebKitCSSMatrix.h | 4 +- .../generated/JSWebKitCSSTransformValue.cpp | 2 +- .../WebCore/generated/JSWebKitCSSTransformValue.h | 4 +- .../webkit/WebCore/generated/JSWebKitPoint.cpp | 2 +- .../webkit/WebCore/generated/JSWebKitPoint.h | 4 +- .../WebCore/generated/JSWebKitTransitionEvent.cpp | 2 +- .../WebCore/generated/JSWebKitTransitionEvent.h | 4 +- .../webkit/WebCore/generated/JSWebSocket.cpp | 8 +- .../webkit/WebCore/generated/JSWebSocket.h | 4 +- .../webkit/WebCore/generated/JSWheelEvent.cpp | 2 +- .../webkit/WebCore/generated/JSWheelEvent.h | 4 +- src/3rdparty/webkit/WebCore/generated/JSWorker.cpp | 4 +- src/3rdparty/webkit/WebCore/generated/JSWorker.h | 4 +- .../webkit/WebCore/generated/JSWorkerContext.cpp | 4 +- .../webkit/WebCore/generated/JSWorkerContext.h | 4 +- .../webkit/WebCore/generated/JSWorkerLocation.cpp | 2 +- .../webkit/WebCore/generated/JSWorkerLocation.h | 4 +- .../webkit/WebCore/generated/JSWorkerNavigator.cpp | 2 +- .../webkit/WebCore/generated/JSWorkerNavigator.h | 4 +- .../webkit/WebCore/generated/JSXMLHttpRequest.cpp | 14 +- .../webkit/WebCore/generated/JSXMLHttpRequest.h | 4 +- .../generated/JSXMLHttpRequestException.cpp | 2 +- .../WebCore/generated/JSXMLHttpRequestException.h | 4 +- .../generated/JSXMLHttpRequestProgressEvent.cpp | 2 +- .../generated/JSXMLHttpRequestProgressEvent.h | 4 +- .../WebCore/generated/JSXMLHttpRequestUpload.cpp | 12 +- .../WebCore/generated/JSXMLHttpRequestUpload.h | 4 +- .../webkit/WebCore/generated/JSXMLSerializer.cpp | 2 +- .../webkit/WebCore/generated/JSXMLSerializer.h | 4 +- .../webkit/WebCore/generated/JSXPathEvaluator.cpp | 2 +- .../webkit/WebCore/generated/JSXPathEvaluator.h | 4 +- .../webkit/WebCore/generated/JSXPathException.cpp | 2 +- .../webkit/WebCore/generated/JSXPathException.h | 4 +- .../webkit/WebCore/generated/JSXPathExpression.cpp | 2 +- .../webkit/WebCore/generated/JSXPathExpression.h | 4 +- .../webkit/WebCore/generated/JSXPathNSResolver.cpp | 2 +- .../webkit/WebCore/generated/JSXPathNSResolver.h | 4 +- .../webkit/WebCore/generated/JSXPathResult.cpp | 2 +- .../webkit/WebCore/generated/JSXPathResult.h | 4 +- .../webkit/WebCore/generated/JSXSLTProcessor.cpp | 2 +- .../webkit/WebCore/generated/JSXSLTProcessor.h | 4 +- .../webkit/WebCore/html/HTMLCanvasElement.cpp | 23 +- .../webkit/WebCore/html/HTMLInputElement.cpp | 8 +- .../webkit/WebCore/html/HTMLInputElement.h | 2 +- .../webkit/WebCore/html/HTMLInputElement.idl | 3 +- .../webkit/WebCore/html/HTMLLinkElement.cpp | 18 +- .../webkit/WebCore/html/HTMLTextAreaElement.cpp | 22 +- .../webkit/WebCore/html/HTMLTextAreaElement.h | 4 +- .../webkit/WebCore/html/HTMLTextAreaElement.idl | 3 +- .../webkit/WebCore/inspector/InspectorBackend.cpp | 32 +- .../webkit/WebCore/inspector/InspectorBackend.h | 7 +- .../webkit/WebCore/inspector/InspectorBackend.idl | 7 +- .../WebCore/inspector/InspectorController.cpp | 4 +- .../webkit/WebCore/inspector/InspectorDOMAgent.cpp | 94 +- .../webkit/WebCore/inspector/InspectorDOMAgent.h | 20 +- .../inspector/InspectorDOMStorageResource.cpp | 2 +- .../inspector/InspectorDOMStorageResource.h | 2 +- .../webkit/WebCore/inspector/InspectorFrontend.cpp | 14 + .../webkit/WebCore/inspector/InspectorFrontend.h | 4 + .../webkit/WebCore/inspector/front-end/DOMAgent.js | 24 +- .../WebCore/inspector/front-end/ElementsPanel.js | 14 + .../front-end/EventListenersSidebarPane.js | 221 ++++ .../front-end/Images/grayConnectorPoint.png | Bin 0 -> 236 bytes .../front-end/Images/whiteConnectorPoint.png | Bin 0 -> 225 bytes .../WebCore/inspector/front-end/ProfilesPanel.js | 9 +- .../inspector/front-end/StylesSidebarPane.js | 23 +- .../webkit/WebCore/inspector/front-end/WebKit.qrc | 3 + .../WebCore/inspector/front-end/inspector.css | 107 +- .../WebCore/inspector/front-end/inspector.html | 1 + .../WebCore/inspector/front-end/inspector.js | 17 +- .../WebCore/inspector/front-end/utilities.js | 31 +- src/3rdparty/webkit/WebCore/loader/FrameLoader.cpp | 2 +- .../webkit/WebCore/loader/ImageDocument.cpp | 4 +- src/3rdparty/webkit/WebCore/page/DOMWindow.idl | 4 +- src/3rdparty/webkit/WebCore/page/EventHandler.cpp | 21 +- src/3rdparty/webkit/WebCore/page/EventHandler.h | 2 + src/3rdparty/webkit/WebCore/page/Frame.cpp | 7 +- src/3rdparty/webkit/WebCore/page/Settings.cpp | 16 + src/3rdparty/webkit/WebCore/page/Settings.h | 15 + .../webkit/WebCore/page/UserContentURLPattern.cpp | 212 ++++ .../webkit/WebCore/page/UserContentURLPattern.h | 72 ++ .../platform/graphics/filters/FEComposite.cpp | 72 +- .../WebCore/platform/network/CredentialStorage.cpp | 18 +- .../platform/network/qt/QNetworkReplyHandler.cpp | 49 +- .../webkit/WebCore/platform/qt/Localizations.cpp | 2 +- .../webkit/WebCore/platform/text/CString.cpp | 14 - .../webkit/WebCore/platform/text/CString.h | 5 - .../webkit/WebCore/platform/text/TextEncoding.cpp | 1 + .../WebCore/rendering/MediaControlElements.cpp | 34 +- .../WebCore/rendering/MediaControlElements.h | 8 - .../webkit/WebCore/rendering/RenderBox.cpp | 21 +- .../webkit/WebCore/rendering/RenderInline.cpp | 10 +- .../webkit/WebCore/rendering/RenderObject.cpp | 15 +- .../webkit/WebCore/rendering/RenderObject.h | 10 +- .../webkit/WebCore/rendering/RenderTheme.cpp | 18 + .../webkit/WebCore/rendering/RenderTheme.h | 1 + .../WebCore/rendering/RenderThemeChromiumSkia.cpp | 13 + .../WebCore/rendering/RenderThemeChromiumSkia.h | 5 + .../WebCore/storage/StorageEventDispatcher.h | 54 + src/3rdparty/webkit/WebCore/svg/SVGUseElement.cpp | 4 + .../WebCore/svg/animation/SVGSMILElement.cpp | 4 +- .../webkit/WebCore/workers/WorkerContext.cpp | 2 +- src/3rdparty/webkit/WebCore/xml/XSLStyleSheet.cpp | 312 ------ src/3rdparty/webkit/WebCore/xml/XSLStyleSheet.h | 26 +- .../webkit/WebCore/xml/XSLStyleSheetLibxslt.cpp | 313 ++++++ .../webkit/WebCore/xml/XSLStyleSheetQt.cpp | 103 ++ src/3rdparty/webkit/WebCore/xml/XSLTProcessor.cpp | 315 +----- src/3rdparty/webkit/WebCore/xml/XSLTProcessor.h | 10 +- .../webkit/WebCore/xml/XSLTProcessorLibxslt.cpp | 335 ++++++ .../webkit/WebCore/xml/XSLTProcessorQt.cpp | 149 +++ src/3rdparty/webkit/WebKit/ChangeLog | 20 + src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp | 11 +- src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h | 23 +- src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp | 4 +- src/3rdparty/webkit/WebKit/qt/ChangeLog | 73 ++ .../qt/WebCoreSupport/FrameLoaderClientQt.cpp | 50 +- .../WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h | 1 + .../webkitsnippets/qtwebkit_qwebview_snippet.cpp | 8 +- .../WebKit/qt/tests/qwebpage/tst_qwebpage.cpp | 36 +- 921 files changed, 6113 insertions(+), 2609 deletions(-) create mode 100644 src/3rdparty/webkit/WebCore/dom/TransformSource.h create mode 100644 src/3rdparty/webkit/WebCore/dom/TransformSourceLibxslt.cpp create mode 100644 src/3rdparty/webkit/WebCore/dom/TransformSourceQt.cpp create mode 100644 src/3rdparty/webkit/WebCore/inspector/front-end/EventListenersSidebarPane.js create mode 100644 src/3rdparty/webkit/WebCore/inspector/front-end/Images/grayConnectorPoint.png create mode 100644 src/3rdparty/webkit/WebCore/inspector/front-end/Images/whiteConnectorPoint.png create mode 100644 src/3rdparty/webkit/WebCore/page/UserContentURLPattern.cpp create mode 100644 src/3rdparty/webkit/WebCore/page/UserContentURLPattern.h create mode 100644 src/3rdparty/webkit/WebCore/storage/StorageEventDispatcher.h delete mode 100644 src/3rdparty/webkit/WebCore/xml/XSLStyleSheet.cpp create mode 100644 src/3rdparty/webkit/WebCore/xml/XSLStyleSheetLibxslt.cpp create mode 100644 src/3rdparty/webkit/WebCore/xml/XSLStyleSheetQt.cpp create mode 100644 src/3rdparty/webkit/WebCore/xml/XSLTProcessorLibxslt.cpp create mode 100644 src/3rdparty/webkit/WebCore/xml/XSLTProcessorQt.cpp diff --git a/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackConstructor.cpp b/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackConstructor.cpp index 64c83cb..1c33962 100644 --- a/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackConstructor.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackConstructor.cpp @@ -36,7 +36,7 @@ namespace JSC { const ClassInfo JSCallbackConstructor::info = { "CallbackConstructor", 0, 0, 0 }; -JSCallbackConstructor::JSCallbackConstructor(PassRefPtr structure, JSClassRef jsClass, JSObjectCallAsConstructorCallback callback) +JSCallbackConstructor::JSCallbackConstructor(NonNullPassRefPtr structure, JSClassRef jsClass, JSObjectCallAsConstructorCallback callback) : JSObject(structure) , m_class(jsClass) , m_callback(callback) diff --git a/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackConstructor.h b/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackConstructor.h index 0497aa2..202b119 100644 --- a/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackConstructor.h +++ b/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackConstructor.h @@ -33,7 +33,7 @@ namespace JSC { class JSCallbackConstructor : public JSObject { public: - JSCallbackConstructor(PassRefPtr, JSClassRef, JSObjectCallAsConstructorCallback); + JSCallbackConstructor(NonNullPassRefPtr, JSClassRef, JSObjectCallAsConstructorCallback); virtual ~JSCallbackConstructor(); JSClassRef classRef() const { return m_class; } JSObjectCallAsConstructorCallback callback() const { return m_callback; } diff --git a/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackObject.h b/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackObject.h index 47fd6c3..86f2f32 100644 --- a/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackObject.h +++ b/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackObject.h @@ -36,7 +36,7 @@ namespace JSC { template class JSCallbackObject : public Base { public: - JSCallbackObject(ExecState*, PassRefPtr, JSClassRef, void* data); + JSCallbackObject(ExecState*, NonNullPassRefPtr, JSClassRef, void* data); JSCallbackObject(JSClassRef); virtual ~JSCallbackObject(); diff --git a/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackObjectFunctions.h b/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackObjectFunctions.h index 4d113fe..9b726e8 100644 --- a/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackObjectFunctions.h +++ b/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackObjectFunctions.h @@ -47,7 +47,7 @@ inline JSCallbackObject* JSCallbackObject::asCallbackObject(JSValue } template -JSCallbackObject::JSCallbackObject(ExecState* exec, PassRefPtr structure, JSClassRef jsClass, void* data) +JSCallbackObject::JSCallbackObject(ExecState* exec, NonNullPassRefPtr structure, JSClassRef jsClass, void* data) : Base(structure) , m_callbackObjectData(new JSCallbackObjectData(data, jsClass)) { diff --git a/src/3rdparty/webkit/JavaScriptCore/ChangeLog b/src/3rdparty/webkit/JavaScriptCore/ChangeLog index f6a644a..05f90b9 100644 --- a/src/3rdparty/webkit/JavaScriptCore/ChangeLog +++ b/src/3rdparty/webkit/JavaScriptCore/ChangeLog @@ -1,3 +1,431 @@ +2009-09-30 Csaba Osztrogonac + + Reviewed by NOBODY (OOPS!). + + Buildfix for platforms using JSVALUE32. + https://bugs.webkit.org/show_bug.cgi?id=29915 + + After http://trac.webkit.org/changeset/48905 the build broke in JSVALUE32 case. + + * jit/JITArithmetic.cpp: + (JSC::JIT::emit_op_add): + - Declaration of "OperandTypes types" moved before first use. + - Typos fixed: dst modified to result, regT2 added. + - Unnecessary code removed. + (JSC::JIT::emitSlow_op_add): + - Missing declaration of "OperandTypes types" added. + +2009-09-30 Janne Koskinen + + Reviewed by Simon Hausmann. + + Reduce heap size on Symbian from 64MB to 8MB. + + This is not a perfect fix, it requires more fine tuning. + But this makes it possible again to debug in the emulator, + which is more important in order to be able to fix other + run-time issues. + + * runtime/Collector.h: + +2009-09-30 Janne Koskinen + + Reviewed by Simon Hausmann. + + Fix CRASH() macro for Symbian build. + + * wtf/Assertions.h: Added missing } + +2009-09-29 Geoffrey Garen + + Reviewed by Gavin Barraclough. + + Inlined a few math operations. + + ~1% SunSpider speedup. + + * jit/JIT.h: + * jit/JITArithmetic.cpp: + (JSC::JIT::compileBinaryArithOpSlowCase): + (JSC::JIT::emitSlow_op_add): + (JSC::JIT::emitSlow_op_mul): + (JSC::JIT::emit_op_sub): + (JSC::JIT::emitSlow_op_sub): Don't take a stub call when operating on + a constant int and a double. + +2009-09-28 Oliver Hunt + + Reviewed by Gavin Barraclough. + + Tidy up codeblock sampler + https://bugs.webkit.org/show_bug.cgi?id=29836 + + Some rather simple refactoring of codeblock sampler so that + it's easier for us to use it to find problems in non-jsc + environments + + * JavaScriptCore.exp: + * bytecode/SamplingTool.h: + * debugger/Debugger.cpp: + (JSC::evaluateInGlobalCallFrame): + * debugger/DebuggerCallFrame.cpp: + (JSC::DebuggerCallFrame::evaluate): + * interpreter/Interpreter.cpp: + (JSC::Interpreter::Interpreter): + (JSC::Interpreter::execute): + (JSC::Interpreter::privateExecute): + (JSC::Interpreter::enableSampler): + (JSC::Interpreter::dumpSampleData): + (JSC::Interpreter::startSampling): + (JSC::Interpreter::stopSampling): + * interpreter/Interpreter.h: + (JSC::Interpreter::sampler): + * jit/JIT.h: + * jsc.cpp: + (runWithScripts): + * runtime/Completion.cpp: + (JSC::checkSyntax): + (JSC::evaluate): + * runtime/Executable.h: + (JSC::EvalExecutable::EvalExecutable): + (JSC::ProgramExecutable::create): + (JSC::ProgramExecutable::ProgramExecutable): + * runtime/JSGlobalData.cpp: + (JSC::JSGlobalData::startSampling): + (JSC::JSGlobalData::stopSampling): + (JSC::JSGlobalData::dumpSampleData): + * runtime/JSGlobalData.h: + * runtime/JSGlobalObjectFunctions.cpp: + (JSC::globalFuncEval): + +2009-09-29 Jeremy Orlow + + Reviewed by Dimitri Glazkov. + + Add GYP generated files to svn:ignore + https://bugs.webkit.org/show_bug.cgi?id=29895 + + The following files are generated by JavaScriptCore's GYP file and should be ignored: + + pcre.mk + wtf.scons + wtf.mk + SConstruct + wtf_config.scons + wtf_config.mk + pcre.scons + + * JavaScriptCore.gyp: Changed property svn:ignore. + +2009-09-29 Geoffrey Garen + + Reviewed by Sam Weinig. + + Standardized an optimization for adding non-numbers. + + SunSpider says maybe a tiny speedup. + + * jit/JITArithmetic.cpp: + (JSC::JIT::emit_op_add): + (JSC::JIT::emitSlow_op_add): + +2009-09-29 Geoffrey Garen + + Windows build fix: export a new symbol. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: + +2009-09-28 Geoffrey Garen + + Reviewed by Sam Weinig. + + Removed virtual destructor from JSGlobalObjectData to eliminate pointer + fix-ups when accessing JSGlobalObject::d. + + Replaced with an explicit destructor function pointer. + + 6% speedup on bench-alloc-nonretained.js. + + * JavaScriptCore.exp: + * runtime/JSGlobalObject.cpp: + (JSC::JSGlobalObject::~JSGlobalObject): + (JSC::JSGlobalObject::destroyJSGlobalObjectData): + * runtime/JSGlobalObject.h: + (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): + (JSC::JSGlobalObject::JSGlobalObject): + +2009-09-29 Janne Koskinen + + Reviewed by David Kilzer. + + [Qt] Assert messages prints visible in Symbian + https://bugs.webkit.org/show_bug.cgi?id=29808 + + Asserts use vprintf to print the messages to stderr. + In Symbian Open C it is not possible to see stderr so + I routed the messages to stdout instead. + + * wtf/Assertions.cpp: + +2009-09-29 Janne Koskinen + + Reviewed by Darin Adler. + + [Qt] Symbian CRASH macro implementation + + Added Symbian specific crash macro that + stops to crash line if JIT debugging is used. + Additional differentiation of access violation + (KERN-EXEC 3) and CRASH panic. + + * wtf/Assertions.h: + +2009-09-28 Mark Rowe + + Fix the PowerPC build. + + * JavaScriptCore.exp: + +2009-09-28 Mark Rowe + + Reviewed by Gavin Barraclough. + + JavaScriptCore fails to mark registers when built for x86_64 using LLVM GCC. + + * runtime/Collector.cpp: + (JSC::Heap::markCurrentThreadConservatively): Force jmp_buf to use the appropriate alignment for a pointer + to ensure that we correctly interpret the contents of registers during marking. + +2009-09-28 Geoffrey Garen + + Windows build fix: added new exports. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: + +2009-09-28 Geoffrey Garen + + Windows build fix: removed exports that no longer exist. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: + +2009-09-28 Geoffrey Garen + + Reviewed by Darin Adler. + + NotNullPassRefPtr: smart pointer optimized for passing references that are not null + https://bugs.webkit.org/show_bug.cgi?id=29822 + + Added NotNullPassRefPtr, and deployed it in all places that initialize + JavaScript objects. + + 2.2% speedup on bench-allocate-nonretained.js. + + * API/JSCallbackConstructor.cpp: + (JSC::JSCallbackConstructor::JSCallbackConstructor): + * API/JSCallbackConstructor.h: + * API/JSCallbackObject.h: + * API/JSCallbackObjectFunctions.h: + (JSC::JSCallbackObject::JSCallbackObject): + * JavaScriptCore.exp: + * bytecode/CodeBlock.h: + (JSC::CodeBlock::addFunctionDecl): + (JSC::CodeBlock::addFunctionExpr): + * runtime/ArrayConstructor.cpp: + (JSC::ArrayConstructor::ArrayConstructor): + * runtime/ArrayConstructor.h: + * runtime/ArrayPrototype.cpp: + (JSC::ArrayPrototype::ArrayPrototype): + * runtime/ArrayPrototype.h: + * runtime/BooleanConstructor.cpp: + (JSC::BooleanConstructor::BooleanConstructor): + * runtime/BooleanConstructor.h: + * runtime/BooleanObject.cpp: + (JSC::BooleanObject::BooleanObject): + * runtime/BooleanObject.h: + * runtime/BooleanPrototype.cpp: + (JSC::BooleanPrototype::BooleanPrototype): + * runtime/BooleanPrototype.h: + * runtime/DateConstructor.cpp: + (JSC::DateConstructor::DateConstructor): + * runtime/DateConstructor.h: + * runtime/DateInstance.cpp: + (JSC::DateInstance::DateInstance): + * runtime/DateInstance.h: + * runtime/DatePrototype.cpp: + (JSC::DatePrototype::DatePrototype): + * runtime/DatePrototype.h: + * runtime/ErrorConstructor.cpp: + (JSC::ErrorConstructor::ErrorConstructor): + * runtime/ErrorConstructor.h: + * runtime/ErrorInstance.cpp: + (JSC::ErrorInstance::ErrorInstance): + * runtime/ErrorInstance.h: + * runtime/ErrorPrototype.cpp: + (JSC::ErrorPrototype::ErrorPrototype): + * runtime/ErrorPrototype.h: + * runtime/FunctionConstructor.cpp: + (JSC::FunctionConstructor::FunctionConstructor): + * runtime/FunctionConstructor.h: + * runtime/FunctionPrototype.cpp: + (JSC::FunctionPrototype::FunctionPrototype): + * runtime/FunctionPrototype.h: + * runtime/GlobalEvalFunction.cpp: + (JSC::GlobalEvalFunction::GlobalEvalFunction): + * runtime/GlobalEvalFunction.h: + * runtime/InternalFunction.cpp: + (JSC::InternalFunction::InternalFunction): + * runtime/InternalFunction.h: + (JSC::InternalFunction::InternalFunction): + * runtime/JSActivation.cpp: + (JSC::JSActivation::JSActivation): + * runtime/JSActivation.h: + (JSC::JSActivation::JSActivationData::JSActivationData): + * runtime/JSArray.cpp: + (JSC::JSArray::JSArray): + * runtime/JSArray.h: + * runtime/JSByteArray.cpp: + (JSC::JSByteArray::JSByteArray): + * runtime/JSByteArray.h: + * runtime/JSFunction.cpp: + (JSC::JSFunction::JSFunction): + * runtime/JSFunction.h: + * runtime/JSGlobalObject.h: + (JSC::JSGlobalObject::JSGlobalObject): + * runtime/JSONObject.h: + (JSC::JSONObject::JSONObject): + * runtime/JSObject.h: + (JSC::JSObject::JSObject): + (JSC::JSObject::setStructure): + * runtime/JSVariableObject.h: + (JSC::JSVariableObject::JSVariableObject): + * runtime/JSWrapperObject.h: + (JSC::JSWrapperObject::JSWrapperObject): + * runtime/MathObject.cpp: + (JSC::MathObject::MathObject): + * runtime/MathObject.h: + * runtime/NativeErrorConstructor.cpp: + (JSC::NativeErrorConstructor::NativeErrorConstructor): + * runtime/NativeErrorConstructor.h: + * runtime/NativeErrorPrototype.cpp: + (JSC::NativeErrorPrototype::NativeErrorPrototype): + * runtime/NativeErrorPrototype.h: + * runtime/NumberConstructor.cpp: + (JSC::NumberConstructor::NumberConstructor): + * runtime/NumberConstructor.h: + * runtime/NumberObject.cpp: + (JSC::NumberObject::NumberObject): + * runtime/NumberObject.h: + * runtime/NumberPrototype.cpp: + (JSC::NumberPrototype::NumberPrototype): + * runtime/NumberPrototype.h: + * runtime/ObjectConstructor.cpp: + (JSC::ObjectConstructor::ObjectConstructor): + * runtime/ObjectConstructor.h: + * runtime/ObjectPrototype.cpp: + (JSC::ObjectPrototype::ObjectPrototype): + * runtime/ObjectPrototype.h: + * runtime/PropertyNameArray.h: + (JSC::PropertyNameArrayData::setCachedPrototypeChain): + * runtime/PrototypeFunction.cpp: + (JSC::PrototypeFunction::PrototypeFunction): + * runtime/PrototypeFunction.h: + * runtime/RegExpConstructor.cpp: + (JSC::RegExpConstructor::RegExpConstructor): + * runtime/RegExpConstructor.h: + * runtime/RegExpObject.cpp: + (JSC::RegExpObject::RegExpObject): + * runtime/RegExpObject.h: + (JSC::RegExpObject::RegExpObjectData::RegExpObjectData): + * runtime/RegExpPrototype.cpp: + (JSC::RegExpPrototype::RegExpPrototype): + * runtime/RegExpPrototype.h: + * runtime/StringConstructor.cpp: + (JSC::StringConstructor::StringConstructor): + * runtime/StringConstructor.h: + * runtime/StringObject.cpp: + (JSC::StringObject::StringObject): + * runtime/StringObject.h: + * runtime/StringObjectThatMasqueradesAsUndefined.h: + (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined): + * runtime/StringPrototype.cpp: + (JSC::StringPrototype::StringPrototype): + * runtime/StringPrototype.h: + * wtf/PassRefPtr.h: + (WTF::NotNullPassRefPtr::NotNullPassRefPtr): + (WTF::NotNullPassRefPtr::~NotNullPassRefPtr): + (WTF::NotNullPassRefPtr::get): + (WTF::NotNullPassRefPtr::clear): + (WTF::NotNullPassRefPtr::releaseRef): + (WTF::NotNullPassRefPtr::operator*): + (WTF::NotNullPassRefPtr::operator->): + (WTF::NotNullPassRefPtr::operator!): + (WTF::NotNullPassRefPtr::operator UnspecifiedBoolType): + * wtf/RefPtr.h: + (WTF::RefPtr::RefPtr): + (WTF::operator==): + +2009-09-28 Oliver Hunt + + Reviewed by Geoff Garen. + + Hard dependency on SSE2 instruction set with JIT + https://bugs.webkit.org/show_bug.cgi?id=29779 + + Add floating point support checks to op_jfalse and op_jtrue, and + fix the logic for the slow case of op_add + + * jit/JITArithmetic.cpp: + (JSC::JIT::emitSlow_op_add): + * jit/JITOpcodes.cpp: + (JSC::JIT::emit_op_jfalse): + (JSC::JIT::emit_op_jtrue): + +2009-09-28 Yaar Schnitman + + Reviewed by Dimitri Glazkov. + + Chromium port - recognize we are being built independently + of chromium and look for dependencies under webkit/chromium rather + than chromium/src. + + https://bugs.webkit.org/show_bug.cgi?id=29722 + + * JavaScriptCore.gyp/JavaScriptCore.gyp: + +2009-09-28 Jakub Wieczorek + + Reviewed by Simon Hausmann. + + [Qt] Implement XSLT support with QtXmlPatterns. + https://bugs.webkit.org/show_bug.cgi?id=28303 + + * wtf/Platform.h: Add a WTF_USE_QXMLQUERY #define. + +2009-09-28 Gabor Loki + + Reviewed by Simon Hausmann. + + Remove __clear_cache which is an internal function of GCC + https://bugs.webkit.org/show_bug.cgi?id=28886 + + Although __clear_cache is exported from GCC, this is an internal + function. GCC makes no promises about it. + + * jit/ExecutableAllocator.h: + (JSC::ExecutableAllocator::cacheFlush): + +2009-09-28 Sam Weinig + + Reviewed by Oliver Hunt. + + Fix an absolute path to somewhere in Oliver's machine to a relative path + for derived JSONObject.lut.h. + + * JavaScriptCore.xcodeproj/project.pbxproj: + 2009-09-28 Joerg Bornemann Reviewed by Simon Hausmann. diff --git a/src/3rdparty/webkit/JavaScriptCore/bytecode/CodeBlock.h b/src/3rdparty/webkit/JavaScriptCore/bytecode/CodeBlock.h index 0163540..4ba58d7 100644 --- a/src/3rdparty/webkit/JavaScriptCore/bytecode/CodeBlock.h +++ b/src/3rdparty/webkit/JavaScriptCore/bytecode/CodeBlock.h @@ -441,10 +441,10 @@ namespace JSC { ALWAYS_INLINE bool isConstantRegisterIndex(int index) { return index >= FirstConstantRegisterIndex; } ALWAYS_INLINE JSValue getConstant(int index) const { return m_constantRegisters[index - FirstConstantRegisterIndex].jsValue(); } - unsigned addFunctionDecl(PassRefPtr n) { unsigned size = m_functionDecls.size(); m_functionDecls.append(n); return size; } + unsigned addFunctionDecl(NonNullPassRefPtr n) { unsigned size = m_functionDecls.size(); m_functionDecls.append(n); return size; } FunctionExecutable* functionDecl(int index) { return m_functionDecls[index].get(); } int numberOfFunctionDecls() { return m_functionDecls.size(); } - unsigned addFunctionExpr(PassRefPtr n) { unsigned size = m_functionExprs.size(); m_functionExprs.append(n); return size; } + unsigned addFunctionExpr(NonNullPassRefPtr n) { unsigned size = m_functionExprs.size(); m_functionExprs.append(n); return size; } FunctionExecutable* functionExpr(int index) { return m_functionExprs[index].get(); } unsigned addRegExp(RegExp* r) { createRareDataIfNecessary(); unsigned size = m_rareData->m_regexps.size(); m_rareData->m_regexps.append(r); return size; } diff --git a/src/3rdparty/webkit/JavaScriptCore/bytecode/SamplingTool.h b/src/3rdparty/webkit/JavaScriptCore/bytecode/SamplingTool.h index 711b086..8e3ed9e 100644 --- a/src/3rdparty/webkit/JavaScriptCore/bytecode/SamplingTool.h +++ b/src/3rdparty/webkit/JavaScriptCore/bytecode/SamplingTool.h @@ -113,7 +113,7 @@ namespace JSC { void sample(CodeBlock*, Instruction*); - ScriptExecutable* m_executable; + RefPtr m_executable; CodeBlock* m_codeBlock; int m_sampleCount; int m_opcodeSampleCount; diff --git a/src/3rdparty/webkit/JavaScriptCore/debugger/Debugger.cpp b/src/3rdparty/webkit/JavaScriptCore/debugger/Debugger.cpp index db02329..902a802 100644 --- a/src/3rdparty/webkit/JavaScriptCore/debugger/Debugger.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/debugger/Debugger.cpp @@ -100,12 +100,12 @@ JSValue evaluateInGlobalCallFrame(const UString& script, JSValue& exception, JSG { CallFrame* globalCallFrame = globalObject->globalExec(); - EvalExecutable eval(globalCallFrame, makeSource(script)); - JSObject* error = eval.compile(globalCallFrame, globalCallFrame->scopeChain()); + RefPtr eval = EvalExecutable::create(globalCallFrame, makeSource(script)); + JSObject* error = eval->compile(globalCallFrame, globalCallFrame->scopeChain()); if (error) return error; - return globalObject->globalData()->interpreter->execute(&eval, globalCallFrame, globalObject, globalCallFrame->scopeChain(), &exception); + return globalObject->globalData()->interpreter->execute(eval.get(), globalCallFrame, globalObject, globalCallFrame->scopeChain(), &exception); } } // namespace JSC diff --git a/src/3rdparty/webkit/JavaScriptCore/debugger/DebuggerCallFrame.cpp b/src/3rdparty/webkit/JavaScriptCore/debugger/DebuggerCallFrame.cpp index 88b14e6..c9d7cc6 100644 --- a/src/3rdparty/webkit/JavaScriptCore/debugger/DebuggerCallFrame.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/debugger/DebuggerCallFrame.cpp @@ -79,12 +79,12 @@ JSValue DebuggerCallFrame::evaluate(const UString& script, JSValue& exception) c if (!m_callFrame->codeBlock()) return JSValue(); - EvalExecutable eval(m_callFrame, makeSource(script)); - JSObject* error = eval.compile(m_callFrame, m_callFrame->scopeChain()); + RefPtr eval = EvalExecutable::create(m_callFrame, makeSource(script)); + JSObject* error = eval->compile(m_callFrame, m_callFrame->scopeChain()); if (error) return error; - return m_callFrame->scopeChain()->globalData->interpreter->execute(&eval, m_callFrame, thisObject(), m_callFrame->scopeChain(), &exception); + return m_callFrame->scopeChain()->globalData->interpreter->execute(eval.get(), m_callFrame, thisObject(), m_callFrame->scopeChain(), &exception); } } // namespace JSC diff --git a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp index 2aaa325..847b1fa 100644 --- a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp @@ -363,10 +363,13 @@ NEVER_INLINE JSValue Interpreter::callEval(CallFrame* callFrame, RegisterFile* r } Interpreter::Interpreter() - : m_sampler(0) + : m_sampleEntryDepth(0) , m_reentryDepth(0) { privateExecute(InitializeAndReturn, 0, 0, 0); +#if ENABLE(OPCODE_SAMPLING) + enableSampler(); +#endif } #ifndef NDEBUG @@ -648,7 +651,7 @@ JSValue Interpreter::execute(ProgramExecutable* program, CallFrame* callFrame, S JSValue result; { - SamplingTool::CallRecord callRecord(m_sampler); + SamplingTool::CallRecord callRecord(m_sampler.get()); m_reentryDepth++; #if ENABLE(JIT) @@ -714,7 +717,7 @@ JSValue Interpreter::execute(FunctionExecutable* functionExecutable, CallFrame* JSValue result; { - SamplingTool::CallRecord callRecord(m_sampler); + SamplingTool::CallRecord callRecord(m_sampler.get()); m_reentryDepth++; #if ENABLE(JIT) @@ -782,7 +785,7 @@ JSValue Interpreter::execute(CallFrameClosure& closure, JSValue* exception) JSValue result; { - SamplingTool::CallRecord callRecord(m_sampler); + SamplingTool::CallRecord callRecord(m_sampler.get()); m_reentryDepth++; #if ENABLE(JIT) @@ -876,7 +879,7 @@ JSValue Interpreter::execute(EvalExecutable* eval, CallFrame* callFrame, JSObjec JSValue result; { - SamplingTool::CallRecord callRecord(m_sampler); + SamplingTool::CallRecord callRecord(m_sampler.get()); m_reentryDepth++; #if ENABLE(JIT) @@ -3056,7 +3059,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi JSValue returnValue; { - SamplingTool::HostCallRecord callRecord(m_sampler); + SamplingTool::HostCallRecord callRecord(m_sampler.get()); returnValue = callData.native.function(newCallFrame, asObject(v), thisValue, args); } CHECK_FOR_EXCEPTION(); @@ -3210,7 +3213,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi JSValue returnValue; { - SamplingTool::HostCallRecord callRecord(m_sampler); + SamplingTool::HostCallRecord callRecord(m_sampler.get()); returnValue = callData.native.function(newCallFrame, asObject(v), thisValue, args); } CHECK_FOR_EXCEPTION(); @@ -3462,7 +3465,7 @@ JSValue Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registerFi JSValue returnValue; { - SamplingTool::HostCallRecord callRecord(m_sampler); + SamplingTool::HostCallRecord callRecord(m_sampler.get()); returnValue = constructData.native.function(newCallFrame, asObject(v), args); } CHECK_FOR_EXCEPTION(); @@ -3914,4 +3917,40 @@ CallFrame* Interpreter::findFunctionCallFrame(CallFrame* callFrame, InternalFunc return 0; } +void Interpreter::enableSampler() +{ +#if ENABLE(OPCODE_SAMPLING) + if (!m_sampler) { + m_sampler.set(new SamplingTool(this)); + m_sampler->setup(); + } +#endif +} +void Interpreter::dumpSampleData(ExecState* exec) +{ +#if ENABLE(OPCODE_SAMPLING) + if (m_sampler) + m_sampler->dump(exec); +#else + UNUSED_PARAM(exec); +#endif +} +void Interpreter::startSampling() +{ +#if ENABLE(SAMPLING_THREAD) + if (!m_sampleEntryDepth) + SamplingThread::start(); + + m_sampleEntryDepth++; +#endif +} +void Interpreter::stopSampling() +{ +#if ENABLE(SAMPLING_THREAD) + m_sampleEntryDepth--; + if (!m_sampleEntryDepth) + SamplingThread::stop(); +#endif +} + } // namespace JSC diff --git a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.h b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.h index 8cb75d2..3046b28 100644 --- a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.h +++ b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.h @@ -105,13 +105,15 @@ namespace JSC { void getArgumentsData(CallFrame*, JSFunction*&, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc); - void setSampler(SamplingTool* sampler) { m_sampler = sampler; } - SamplingTool* sampler() { return m_sampler; } + SamplingTool* sampler() { return m_sampler.get(); } NEVER_INLINE JSValue callEval(CallFrame*, RegisterFile*, Register* argv, int argc, int registerOffset, JSValue& exceptionValue); NEVER_INLINE HandlerInfo* throwException(CallFrame*&, JSValue&, unsigned bytecodeOffset, bool); NEVER_INLINE void debug(CallFrame*, DebugHookID, int firstLine, int lastLine); + void dumpSampleData(ExecState* exec); + void startSampling(); + void stopSampling(); private: enum ExecutionFlag { Normal, InitializeAndReturn }; @@ -149,7 +151,9 @@ namespace JSC { bool isCallBytecode(Opcode opcode) { return opcode == getOpcode(op_call) || opcode == getOpcode(op_construct) || opcode == getOpcode(op_call_eval); } - SamplingTool* m_sampler; + void enableSampler(); + int m_sampleEntryDepth; + OwnPtr m_sampler; int m_reentryDepth; diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JIT.h b/src/3rdparty/webkit/JavaScriptCore/jit/JIT.h index 3b35935..0712743 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jit/JIT.h +++ b/src/3rdparty/webkit/JavaScriptCore/jit/JIT.h @@ -514,7 +514,11 @@ namespace JSC { void emitTagAsBoolImmediate(RegisterID reg); void compileBinaryArithOp(OpcodeID, unsigned dst, unsigned src1, unsigned src2, OperandTypes opi); - void compileBinaryArithOpSlowCase(OpcodeID, Vector::iterator&, unsigned dst, unsigned src1, unsigned src2, OperandTypes opi); +#if USE(JSVALUE64) + void compileBinaryArithOpSlowCase(OpcodeID, Vector::iterator&, unsigned dst, unsigned src1, unsigned src2, OperandTypes, bool op1HasImmediateIntFastCase, bool op2HasImmediateIntFastCase); +#else + void compileBinaryArithOpSlowCase(OpcodeID, Vector::iterator&, unsigned dst, unsigned src1, unsigned src2, OperandTypes); +#endif #if ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS) void compileGetByIdHotPath(int resultVReg, int baseVReg, Identifier* ident, unsigned propertyAccessInstructionIndex); @@ -538,7 +542,7 @@ namespace JSC { static const int patchOffsetGetByIdPropertyMapOffset = 31; static const int patchOffsetGetByIdPutResult = 31; #if ENABLE(OPCODE_SAMPLING) - static const int patchOffsetGetByIdSlowCaseCall = 63; + static const int patchOffsetGetByIdSlowCaseCall = 64; #else static const int patchOffsetGetByIdSlowCaseCall = 41; #endif diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITArithmetic.cpp b/src/3rdparty/webkit/JavaScriptCore/jit/JITArithmetic.cpp index fb44386..7afc1f2 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jit/JITArithmetic.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITArithmetic.cpp @@ -566,6 +566,14 @@ void JIT::emit_op_add(Instruction* currentInstruction) unsigned op2 = currentInstruction[3].u.operand; OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); + if (!types.first().mightBeNumber() || !types.second().mightBeNumber()) { + JITStubCall stubCall(this, cti_op_add); + stubCall.addArgument(op1); + stubCall.addArgument(op2); + stubCall.call(dst); + return; + } + JumpList notInt32Op1; JumpList notInt32Op2; @@ -630,19 +638,21 @@ void JIT::emitSlow_op_add(Instruction* currentInstruction, Vector unsigned op2 = currentInstruction[3].u.operand; OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); + if (!types.first().mightBeNumber() || !types.second().mightBeNumber()) + return; + unsigned op; int32_t constant; if (getOperandConstantImmediateInt(op1, op2, op, constant)) { linkSlowCase(iter); // overflow check - if (!supportsFloatingPoint()) { + if (!supportsFloatingPoint()) linkSlowCase(iter); // non-sse case - return; + else { + ResultType opType = op == op1 ? types.first() : types.second(); + if (!opType.definitelyIsNumber()) + linkSlowCase(iter); // double check } - - ResultType opType = op == op1 ? types.first() : types.second(); - if (!opType.definitelyIsNumber()) - linkSlowCase(iter); // double check } else { linkSlowCase(iter); // overflow check @@ -1932,47 +1942,77 @@ void JIT::compileBinaryArithOp(OpcodeID opcodeID, unsigned, unsigned op1, unsign emitFastArithIntToImmNoCheck(regT0, regT0); } -void JIT::compileBinaryArithOpSlowCase(OpcodeID opcodeID, Vector::iterator& iter, unsigned result, unsigned op1, unsigned, OperandTypes types) +void JIT::compileBinaryArithOpSlowCase(OpcodeID opcodeID, Vector::iterator& iter, unsigned result, unsigned op1, unsigned op2, OperandTypes types, bool op1HasImmediateIntFastCase, bool op2HasImmediateIntFastCase) { // We assume that subtracting TagTypeNumber is equivalent to adding DoubleEncodeOffset. COMPILE_ASSERT(((JSImmediate::TagTypeNumber + JSImmediate::DoubleEncodeOffset) == 0), TagTypeNumber_PLUS_DoubleEncodeOffset_EQUALS_0); - - Jump notImm1 = getSlowCase(iter); - Jump notImm2 = getSlowCase(iter); + + Jump notImm1; + Jump notImm2; + if (op1HasImmediateIntFastCase) { + notImm2 = getSlowCase(iter); + } else if (op2HasImmediateIntFastCase) { + notImm1 = getSlowCase(iter); + } else { + notImm1 = getSlowCase(iter); + notImm2 = getSlowCase(iter); + } linkSlowCase(iter); // Integer overflow case - we could handle this in JIT code, but this is likely rare. - if (opcodeID == op_mul) // op_mul has an extra slow case to handle 0 * negative number. + if (opcodeID == op_mul && !op1HasImmediateIntFastCase && !op2HasImmediateIntFastCase) // op_mul has an extra slow case to handle 0 * negative number. linkSlowCase(iter); emitGetVirtualRegister(op1, regT0); Label stubFunctionCall(this); JITStubCall stubCall(this, opcodeID == op_add ? cti_op_add : opcodeID == op_sub ? cti_op_sub : cti_op_mul); + if (op1HasImmediateIntFastCase || op2HasImmediateIntFastCase) { + emitGetVirtualRegister(op1, regT0); + emitGetVirtualRegister(op2, regT1); + } stubCall.addArgument(regT0); stubCall.addArgument(regT1); stubCall.call(result); Jump end = jump(); - // if we get here, eax is not an int32, edx not yet checked. - notImm1.link(this); - if (!types.first().definitelyIsNumber()) - emitJumpIfNotImmediateNumber(regT0).linkTo(stubFunctionCall, this); - if (!types.second().definitelyIsNumber()) - emitJumpIfNotImmediateNumber(regT1).linkTo(stubFunctionCall, this); - addPtr(tagTypeNumberRegister, regT0); - movePtrToDouble(regT0, fpRegT1); - Jump op2isDouble = emitJumpIfNotImmediateInteger(regT1); - convertInt32ToDouble(regT1, fpRegT2); - Jump op2wasInteger = jump(); - - // if we get here, eax IS an int32, edx is not. - notImm2.link(this); - if (!types.second().definitelyIsNumber()) - emitJumpIfNotImmediateNumber(regT1).linkTo(stubFunctionCall, this); - convertInt32ToDouble(regT0, fpRegT1); - op2isDouble.link(this); - addPtr(tagTypeNumberRegister, regT1); - movePtrToDouble(regT1, fpRegT2); - op2wasInteger.link(this); + if (op1HasImmediateIntFastCase) { + notImm2.link(this); + if (!types.second().definitelyIsNumber()) + emitJumpIfNotImmediateNumber(regT0).linkTo(stubFunctionCall, this); + emitGetVirtualRegister(op1, regT1); + convertInt32ToDouble(regT1, fpRegT1); + addPtr(tagTypeNumberRegister, regT0); + movePtrToDouble(regT0, fpRegT2); + } else if (op2HasImmediateIntFastCase) { + notImm1.link(this); + if (!types.first().definitelyIsNumber()) + emitJumpIfNotImmediateNumber(regT0).linkTo(stubFunctionCall, this); + emitGetVirtualRegister(op2, regT1); + convertInt32ToDouble(regT1, fpRegT1); + addPtr(tagTypeNumberRegister, regT0); + movePtrToDouble(regT0, fpRegT2); + } else { + // if we get here, eax is not an int32, edx not yet checked. + notImm1.link(this); + if (!types.first().definitelyIsNumber()) + emitJumpIfNotImmediateNumber(regT0).linkTo(stubFunctionCall, this); + if (!types.second().definitelyIsNumber()) + emitJumpIfNotImmediateNumber(regT1).linkTo(stubFunctionCall, this); + addPtr(tagTypeNumberRegister, regT0); + movePtrToDouble(regT0, fpRegT1); + Jump op2isDouble = emitJumpIfNotImmediateInteger(regT1); + convertInt32ToDouble(regT1, fpRegT2); + Jump op2wasInteger = jump(); + + // if we get here, eax IS an int32, edx is not. + notImm2.link(this); + if (!types.second().definitelyIsNumber()) + emitJumpIfNotImmediateNumber(regT1).linkTo(stubFunctionCall, this); + convertInt32ToDouble(regT0, fpRegT1); + op2isDouble.link(this); + addPtr(tagTypeNumberRegister, regT1); + movePtrToDouble(regT1, fpRegT2); + op2wasInteger.link(this); + } if (opcodeID == op_add) addDouble(fpRegT2, fpRegT1); @@ -2027,16 +2067,14 @@ void JIT::emitSlow_op_add(Instruction* currentInstruction, Vector unsigned result = currentInstruction[1].u.operand; unsigned op1 = currentInstruction[2].u.operand; unsigned op2 = currentInstruction[3].u.operand; + OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); - if (isOperandConstantImmediateInt(op1) || isOperandConstantImmediateInt(op2)) { - linkSlowCase(iter); - linkSlowCase(iter); - JITStubCall stubCall(this, cti_op_add); - stubCall.addArgument(op1, regT2); - stubCall.addArgument(op2, regT2); - stubCall.call(result); - } else - compileBinaryArithOpSlowCase(op_add, iter, result, op1, op2, OperandTypes::fromInt(currentInstruction[4].u.operand)); + if (!types.first().mightBeNumber() || !types.second().mightBeNumber()) + return; + + bool op1HasImmediateIntFastCase = isOperandConstantImmediateInt(op1); + bool op2HasImmediateIntFastCase = !op1HasImmediateIntFastCase && isOperandConstantImmediateInt(op2); + compileBinaryArithOpSlowCase(op_add, iter, result, op1, op2, OperandTypes::fromInt(currentInstruction[4].u.operand), op1HasImmediateIntFastCase, op2HasImmediateIntFastCase); } void JIT::emit_op_mul(Instruction* currentInstruction) @@ -2071,17 +2109,9 @@ void JIT::emitSlow_op_mul(Instruction* currentInstruction, Vector unsigned op2 = currentInstruction[3].u.operand; OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); - if ((isOperandConstantImmediateInt(op1) && (getConstantOperandImmediateInt(op1) > 0)) - || (isOperandConstantImmediateInt(op2) && (getConstantOperandImmediateInt(op2) > 0))) { - linkSlowCase(iter); - linkSlowCase(iter); - // There is an extra slow case for (op1 * -N) or (-N * op2), to check for 0 since this should produce a result of -0. - JITStubCall stubCall(this, cti_op_mul); - stubCall.addArgument(op1, regT2); - stubCall.addArgument(op2, regT2); - stubCall.call(result); - } else - compileBinaryArithOpSlowCase(op_mul, iter, result, op1, op2, types); + bool op1HasImmediateIntFastCase = isOperandConstantImmediateInt(op1) && getConstantOperandImmediateInt(op1) > 0; + bool op2HasImmediateIntFastCase = !op1HasImmediateIntFastCase && isOperandConstantImmediateInt(op2) && getConstantOperandImmediateInt(op2) > 0; + compileBinaryArithOpSlowCase(op_mul, iter, result, op1, op2, OperandTypes::fromInt(currentInstruction[4].u.operand), op1HasImmediateIntFastCase, op2HasImmediateIntFastCase); } void JIT::emit_op_div(Instruction* currentInstruction) @@ -2189,7 +2219,6 @@ void JIT::emit_op_sub(Instruction* currentInstruction) OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); compileBinaryArithOp(op_sub, result, op1, op2, types); - emitPutVirtualRegister(result); } @@ -2200,7 +2229,7 @@ void JIT::emitSlow_op_sub(Instruction* currentInstruction, Vector unsigned op2 = currentInstruction[3].u.operand; OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); - compileBinaryArithOpSlowCase(op_sub, iter, result, op1, op2, types); + compileBinaryArithOpSlowCase(op_sub, iter, result, op1, op2, types, false, false); } #else // USE(JSVALUE64) @@ -2383,6 +2412,15 @@ void JIT::emit_op_add(Instruction* currentInstruction) unsigned result = currentInstruction[1].u.operand; unsigned op1 = currentInstruction[2].u.operand; unsigned op2 = currentInstruction[3].u.operand; + OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); + + if (!types.first().mightBeNumber() || !types.second().mightBeNumber()) { + JITStubCall stubCall(this, cti_op_add); + stubCall.addArgument(op1, regT2); + stubCall.addArgument(op2, regT2); + stubCall.call(result); + return; + } if (isOperandConstantImmediateInt(op1)) { emitGetVirtualRegister(op2, regT0); @@ -2397,15 +2435,7 @@ void JIT::emit_op_add(Instruction* currentInstruction) signExtend32ToPtr(regT0, regT0); emitPutVirtualRegister(result); } else { - OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); - if (types.first().mightBeNumber() && types.second().mightBeNumber()) - compileBinaryArithOp(op_add, result, op1, op2, OperandTypes::fromInt(currentInstruction[4].u.operand)); - else { - JITStubCall stubCall(this, cti_op_add); - stubCall.addArgument(op1, regT2); - stubCall.addArgument(op2, regT2); - stubCall.call(result); - } + compileBinaryArithOp(op_add, result, op1, op2, OperandTypes::fromInt(currentInstruction[4].u.operand)); } } @@ -2415,6 +2445,10 @@ void JIT::emitSlow_op_add(Instruction* currentInstruction, Vector unsigned op1 = currentInstruction[2].u.operand; unsigned op2 = currentInstruction[3].u.operand; + OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand); + if (!types.first().mightBeNumber() || !types.second().mightBeNumber()) + return; + if (isOperandConstantImmediateInt(op1)) { Jump notImm = getSlowCase(iter); linkSlowCase(iter); diff --git a/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp b/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp index 28d630b..7059cc8 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/jit/JITOpcodes.cpp @@ -794,14 +794,17 @@ void JIT::emit_op_jfalse(Instruction* currentInstruction) Jump isTrue2 = branch32(NotEqual, regT0, Imm32(0)); addJump(jump(), target + 2); - isNotInteger.link(this); + if (supportsFloatingPoint()) { + isNotInteger.link(this); - addSlowCase(branch32(Above, regT1, Imm32(JSValue::LowestTag))); + addSlowCase(branch32(Above, regT1, Imm32(JSValue::LowestTag))); + + zeroDouble(fpRegT0); + emitLoadDouble(cond, fpRegT1); + addJump(branchDouble(DoubleEqual, fpRegT0, fpRegT1), target + 2); + } else + addSlowCase(isNotInteger); - zeroDouble(fpRegT0); - emitLoadDouble(cond, fpRegT1); - addJump(branchDouble(DoubleEqual, fpRegT0, fpRegT1), target + 2); - isTrue.link(this); isTrue2.link(this); } @@ -832,14 +835,17 @@ void JIT::emit_op_jtrue(Instruction* currentInstruction) Jump isFalse2 = branch32(Equal, regT0, Imm32(0)); addJump(jump(), target + 2); - isNotInteger.link(this); + if (supportsFloatingPoint()) { + isNotInteger.link(this); - addSlowCase(branch32(Above, regT1, Imm32(JSValue::LowestTag))); + addSlowCase(branch32(Above, regT1, Imm32(JSValue::LowestTag))); + + zeroDouble(fpRegT0); + emitLoadDouble(cond, fpRegT1); + addJump(branchDouble(DoubleNotEqual, fpRegT0, fpRegT1), target + 2); + } else + addSlowCase(isNotInteger); - zeroDouble(fpRegT0); - emitLoadDouble(cond, fpRegT1); - addJump(branchDouble(DoubleNotEqual, fpRegT0, fpRegT1), target + 2); - isFalse.link(this); isFalse2.link(this); } diff --git a/src/3rdparty/webkit/JavaScriptCore/jsc.cpp b/src/3rdparty/webkit/JavaScriptCore/jsc.cpp index ee4e393..9399b1a 100644 --- a/src/3rdparty/webkit/JavaScriptCore/jsc.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/jsc.cpp @@ -360,11 +360,8 @@ static bool runWithScripts(GlobalObject* globalObject, const Vector + diff --git a/src/3rdparty/webkit/WebCore/inspector/front-end/inspector.js b/src/3rdparty/webkit/WebCore/inspector/front-end/inspector.js index 921bb7a..de4f4fb 100644 --- a/src/3rdparty/webkit/WebCore/inspector/front-end/inspector.js +++ b/src/3rdparty/webkit/WebCore/inspector/front-end/inspector.js @@ -42,7 +42,8 @@ var Preferences = { heapProfilerPresent: false, samplingCPUProfiler: false, showColorNicknames: true, - colorFormat: "hex" + colorFormat: "hex", + eventListenersFilter: "all" } var WebInspector = { @@ -354,6 +355,10 @@ WebInspector.loaded = function() if (colorFormat) Preferences.colorFormat = colorFormat; + var eventListenersFilter = InspectorController.setting("event-listeners-filter"); + if (eventListenersFilter) + Preferences.eventListenersFilter = eventListenersFilter; + this.drawer = new WebInspector.Drawer(); this.console = new WebInspector.ConsoleView(this.drawer); // TODO: Uncomment when enabling the Changes Panel @@ -914,10 +919,8 @@ WebInspector.addResource = function(identifier, payload) this.resources[identifier] = resource; this.resourceURLMap[resource.url] = resource; - if (resource.mainResource) { + if (resource.mainResource) this.mainResource = resource; - this.panels.elements.reset(); - } if (this.panels.resources) this.panels.resources.addResource(resource); @@ -1117,6 +1120,12 @@ WebInspector.resourceURLChanged = function(resource, oldURL) this.resourceURLMap[resource.url] = resource; } +WebInspector.didCommitLoad = function() +{ + // Cleanup elements panel early on inspected page refresh. + WebInspector.setDocument(null); +} + WebInspector.addMessageToConsole = function(payload) { var consoleMessage = new WebInspector.ConsoleMessage( diff --git a/src/3rdparty/webkit/WebCore/inspector/front-end/utilities.js b/src/3rdparty/webkit/WebCore/inspector/front-end/utilities.js index e83c7c0..5f41b56 100644 --- a/src/3rdparty/webkit/WebCore/inspector/front-end/utilities.js +++ b/src/3rdparty/webkit/WebCore/inspector/front-end/utilities.js @@ -621,11 +621,38 @@ function nodeTitleInfo(hasChildren, linkify) return info; } -function getDocumentForNode(node) { +function appropriateSelectorForNode(node, justSelector) +{ + if (!node) + return ""; + + var lowerCaseName = node.localName || node.nodeName.toLowerCase(); + + var id = node.getAttribute("id"); + if (id) { + var selector = "#" + id; + return (justSelector ? selector : lowerCaseName + selector); + } + + var className = node.getAttribute("class"); + if (className) { + var selector = "." + className.replace(/\s+/, "."); + return (justSelector ? selector : lowerCaseName + selector); + } + + if (lowerCaseName === "input" && node.getAttribute("type")) + return lowerCaseName + "[type=\"" + node.getAttribute("type") + "\"]"; + + return lowerCaseName; +} + +function getDocumentForNode(node) +{ return node.nodeType == Node.DOCUMENT_NODE ? node : node.ownerDocument; } -function parentNode(node) { +function parentNode(node) +{ return node.parentNode; } diff --git a/src/3rdparty/webkit/WebCore/loader/FrameLoader.cpp b/src/3rdparty/webkit/WebCore/loader/FrameLoader.cpp index 57cf85a..93a1f10 100644 --- a/src/3rdparty/webkit/WebCore/loader/FrameLoader.cpp +++ b/src/3rdparty/webkit/WebCore/loader/FrameLoader.cpp @@ -947,9 +947,9 @@ void FrameLoader::begin(const KURL& url, bool dispatch, SecurityOrigin* origin) m_outgoingReferrer = ref.string(); m_URL = url; + document->setURL(m_URL); m_frame->setDocument(document); - document->setURL(m_URL); if (m_decoder) document->setDecoder(m_decoder.get()); if (forcedSecurityOrigin) diff --git a/src/3rdparty/webkit/WebCore/loader/ImageDocument.cpp b/src/3rdparty/webkit/WebCore/loader/ImageDocument.cpp index 8078ccd..9b5598d 100644 --- a/src/3rdparty/webkit/WebCore/loader/ImageDocument.cpp +++ b/src/3rdparty/webkit/WebCore/loader/ImageDocument.cpp @@ -70,7 +70,7 @@ private: { } - virtual void handleEvent(Event*); + virtual void handleEvent(ScriptExecutionContext*, Event*); ImageDocument* m_doc; }; @@ -358,7 +358,7 @@ bool ImageDocument::shouldShrinkToFit() const // -------- -void ImageEventListener::handleEvent(Event* event) +void ImageEventListener::handleEvent(ScriptExecutionContext*, Event* event) { if (event->type() == eventNames().resizeEvent) m_doc->windowSizeChanged(); diff --git a/src/3rdparty/webkit/WebCore/page/DOMWindow.idl b/src/3rdparty/webkit/WebCore/page/DOMWindow.idl index f36175e..4e3a03e 100644 --- a/src/3rdparty/webkit/WebCore/page/DOMWindow.idl +++ b/src/3rdparty/webkit/WebCore/page/DOMWindow.idl @@ -489,9 +489,7 @@ module window { attribute XMLHttpRequestUploadConstructor XMLHttpRequestUpload; attribute XMLHttpRequestExceptionConstructor XMLHttpRequestException; -#if defined(ENABLE_XSLT) && ENABLE_XSLT - attribute [JSCCustomGetter] XSLTProcessorConstructor XSLTProcessor; // Usable with the new operator -#endif + attribute [JSCCustomGetter,Conditional=XSLT] XSLTProcessorConstructor XSLTProcessor; // Usable with the new operator #if defined(ENABLE_CHANNEL_MESSAGING) && ENABLE_CHANNEL_MESSAGING attribute MessagePortConstructor MessagePort; diff --git a/src/3rdparty/webkit/WebCore/page/EventHandler.cpp b/src/3rdparty/webkit/WebCore/page/EventHandler.cpp index 3772d65..1075e72 100644 --- a/src/3rdparty/webkit/WebCore/page/EventHandler.cpp +++ b/src/3rdparty/webkit/WebCore/page/EventHandler.cpp @@ -894,8 +894,10 @@ bool EventHandler::scrollOverflow(ScrollDirection direction, ScrollGranularity g if (node) { RenderObject* r = node->renderer(); - if (r && !r->isListBox()) - return r->enclosingBox()->scroll(direction, granularity); + if (r && !r->isListBox() && r->enclosingBox()->scroll(direction, granularity)) { + setFrameWasScrolledByUser(); + return true; + } } return false; @@ -1778,6 +1780,7 @@ bool EventHandler::handleWheelEvent(PlatformWheelEvent& e) FrameView* view = m_frame->view(); if (!view) return false; + setFrameWasScrolledByUser(); IntPoint vPoint = view->windowToContents(e.pos()); Node* node; @@ -2479,17 +2482,23 @@ void EventHandler::sendResizeEvent() void EventHandler::sendScrollEvent() { + setFrameWasScrolledByUser(); + if (m_frame->view()) + m_frame->document()->dispatchEvent(Event::create(eventNames().scrollEvent, true, false)); +} + +void EventHandler::setFrameWasScrolledByUser() +{ FrameView* v = m_frame->view(); - if (!v) - return; - v->setWasScrolledByUser(true); - m_frame->document()->dispatchEvent(Event::create(eventNames().scrollEvent, true, false)); + if (v) + v->setWasScrolledByUser(true); } bool EventHandler::passMousePressEventToScrollbar(MouseEventWithHitTestResults& mev, Scrollbar* scrollbar) { if (!scrollbar || !scrollbar->enabled()) return false; + setFrameWasScrolledByUser(); return scrollbar->mouseDown(mev.event()); } diff --git a/src/3rdparty/webkit/WebCore/page/EventHandler.h b/src/3rdparty/webkit/WebCore/page/EventHandler.h index e1a02db..0221397 100644 --- a/src/3rdparty/webkit/WebCore/page/EventHandler.h +++ b/src/3rdparty/webkit/WebCore/page/EventHandler.h @@ -306,6 +306,8 @@ private: #endif void updateLastScrollbarUnderMouse(Scrollbar*, bool); + + void setFrameWasScrolledByUser(); bool capturesDragging() const { return m_capturesDragging; } diff --git a/src/3rdparty/webkit/WebCore/page/Frame.cpp b/src/3rdparty/webkit/WebCore/page/Frame.cpp index 28e6a9e..e8e796f 100644 --- a/src/3rdparty/webkit/WebCore/page/Frame.cpp +++ b/src/3rdparty/webkit/WebCore/page/Frame.cpp @@ -73,6 +73,7 @@ #include "Settings.h" #include "TextIterator.h" #include "TextResourceDecoder.h" +#include "UserContentURLPattern.h" #include "XMLNames.h" #include "htmlediting.h" #include "markup.h" @@ -870,12 +871,16 @@ void Frame::injectUserScriptsForWorld(unsigned worldID, const UserScriptVector& if (userScripts.isEmpty()) return; + Document* doc = document(); + if (!doc) + return; + // FIXME: Need to implement pattern checking. Vector sourceCode; unsigned count = userScripts.size(); for (unsigned i = 0; i < count; ++i) { UserScript* script = userScripts[i].get(); - if (script->injectionTime() == injectionTime) + if (script->injectionTime() == injectionTime && UserContentURLPattern::matchesPatterns(doc->url(), script->patterns())) sourceCode.append(ScriptSourceCode(script->source(), script->url())); } script()->evaluateInIsolatedWorld(worldID, sourceCode); diff --git a/src/3rdparty/webkit/WebCore/page/Settings.cpp b/src/3rdparty/webkit/WebCore/page/Settings.cpp index 708d595..ab438a1 100644 --- a/src/3rdparty/webkit/WebCore/page/Settings.cpp +++ b/src/3rdparty/webkit/WebCore/page/Settings.cpp @@ -117,6 +117,10 @@ Settings::Settings(Page* page) , m_acceleratedCompositingEnabled(true) , m_experimentalNotificationsEnabled(false) , m_pluginHalterEnabled(false) + , m_experimentalWebGLEnabled(false) +#if ENABLE(WEB_SOCKETS) + , m_experimentalWebSocketsEnabled(false) +#endif { // A Frame may not have been created yet, so we initialize the AtomicString // hash before trying to use it. @@ -528,4 +532,16 @@ void Settings::setShouldUseHighResolutionTimers(bool shouldUseHighResolutionTime } #endif +void Settings::setExperimentalWebGLEnabled(bool enabled) +{ + m_experimentalWebGLEnabled = enabled; +} + +#if ENABLE(WEB_SOCKETS) +void Settings::setExperimentalWebSocketsEnabled(bool enabled) +{ + m_experimentalWebSocketsEnabled = enabled; +} +#endif + } // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/page/Settings.h b/src/3rdparty/webkit/WebCore/page/Settings.h index b3daf19..ec9c8f9 100644 --- a/src/3rdparty/webkit/WebCore/page/Settings.h +++ b/src/3rdparty/webkit/WebCore/page/Settings.h @@ -267,6 +267,16 @@ namespace WebCore { void setPluginAllowedRunTime(unsigned); unsigned pluginAllowedRunTime() const { return m_pluginAllowedRunTime; } + // This run-time flag is only temporary while the WebGL + // specification is being developed. + void setExperimentalWebGLEnabled(bool); + bool experimentalWebGLEnabled() const { return m_experimentalWebGLEnabled; } + +#if ENABLE(WEB_SOCKETS) + void setExperimentalWebSocketsEnabled(bool); + bool experimentalWebSocketsEnabled() const { return m_experimentalWebSocketsEnabled; } +#endif + private: Page* m_page; @@ -334,6 +344,11 @@ namespace WebCore { bool m_acceleratedCompositingEnabled : 1; bool m_experimentalNotificationsEnabled : 1; bool m_pluginHalterEnabled : 1; + bool m_experimentalWebGLEnabled : 1; + +#if ENABLE(WEB_SOCKETS) + bool m_experimentalWebSocketsEnabled : 1; +#endif #if USE(SAFARI_THEME) static bool gShouldPaintNativeControls; diff --git a/src/3rdparty/webkit/WebCore/page/UserContentURLPattern.cpp b/src/3rdparty/webkit/WebCore/page/UserContentURLPattern.cpp new file mode 100644 index 0000000..1960131 --- /dev/null +++ b/src/3rdparty/webkit/WebCore/page/UserContentURLPattern.cpp @@ -0,0 +1,212 @@ +/* + * Copyright (C) 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 + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "UserContentURLPattern.h" +#include "KURL.h" +#include + +namespace WebCore { + +bool UserContentURLPattern::matchesPatterns(const KURL& url, const Vector& patterns) +{ + // Treat no patterns at all as though a pattern of * was specified. + if (patterns.isEmpty()) + return true; + + for (unsigned i = 0; i < patterns.size(); ++i) { + UserContentURLPattern contentPattern(patterns[i]); + if (contentPattern.matches(url)) + return true; + } + + return false; +} + +bool UserContentURLPattern::parse(const String& pattern) +{ + DEFINE_STATIC_LOCAL(const String, schemeSeparator, ("://")); + + int schemeEndPos = pattern.find(schemeSeparator); + if (schemeEndPos == -1) + return false; + + m_scheme = pattern.left(schemeEndPos); + + int hostStartPos = schemeEndPos + schemeSeparator.length(); + if (hostStartPos >= static_cast(pattern.length())) + return false; + + int pathStartPos = 0; + + if (m_scheme == "file") + pathStartPos = hostStartPos; + else { + int hostEndPos = pattern.find("/", hostStartPos); + if (hostEndPos == -1) + return false; + + m_host = pattern.substring(hostStartPos, hostEndPos - hostStartPos); + + // The first component can be '*', which means to match all subdomains. + Vector hostComponents; + m_host.split(".", hostComponents); + if (hostComponents[0] == "*") { + m_matchSubdomains = true; + m_host = ""; + for (unsigned i = 1; i < hostComponents.size(); ++i) { + m_host = m_host + hostComponents[i]; + if (i < hostComponents.size() - 1) + m_host = m_host + "."; + } + } + + // No other '*' can occur in the host. + if (m_host.find("*") != -1) + return false; + + pathStartPos = hostEndPos; + } + + m_path = pattern.right(pattern.length() - pathStartPos); + + return true; +} + +bool UserContentURLPattern::matches(const KURL& test) const +{ + if (m_invalid) + return false; + + if (test.protocol() != m_scheme) + return false; + + if (!matchesHost(test)) + return false; + + return matchesPath(test); +} + +bool UserContentURLPattern::matchesHost(const KURL& test) const +{ + if (test.host() == m_host) + return true; + + if (!m_matchSubdomains) + return false; + + // If we're matching subdomains, and we have no host, that means the pattern + // was ://*/, so we match anything. + if (!m_host.length()) + return true; + + // Check if the test host is a subdomain of our host. + return test.host().endsWith(m_host, false); +} + +struct MatchTester +{ + const String m_pattern; + unsigned m_patternIndex; + + const String m_test; + unsigned m_testIndex; + + MatchTester(const String& pattern, const String& test) + : m_pattern(pattern) + , m_patternIndex(0) + , m_test(test) + , m_testIndex(0) + { + } + + bool testStringFinished() const { return m_testIndex >= m_test.length(); } + bool patternStringFinished() const { return m_patternIndex >= m_pattern.length(); } + + void eatWildcard() + { + while (!patternStringFinished()) { + if (m_pattern[m_patternIndex] != '*') + return; + m_patternIndex++; + } + } + + void eatSameChars() + { + while (!patternStringFinished() && !testStringFinished()) { + if (m_pattern[m_patternIndex] == '*') + return; + if (m_pattern[m_patternIndex] != m_test[m_testIndex]) + return; + m_patternIndex++; + m_testIndex++; + } + } + + bool test() + { + // Eat all the matching chars. + eatSameChars(); + + // If the string is finished, then the pattern must be empty too, or contains + // only wildcards. + if (testStringFinished()) { + eatWildcard(); + if (patternStringFinished()) + return true; + return false; + } + + // Pattern is empty but not string, this is not a match. + if (patternStringFinished()) + return false; + + // If we don't encounter a *, then we're hosed. + if (m_pattern[m_patternIndex] != '*') + return false; + + while (!testStringFinished()) { + MatchTester nextMatch(*this); + nextMatch.m_patternIndex++; + if (nextMatch.test()) + return true; + m_testIndex++; + } + + // We reached the end of the string. Let's see if the pattern contains only + // wildcards. + eatWildcard(); + return patternStringFinished(); + } +}; + +bool UserContentURLPattern::matchesPath(const KURL& test) const +{ + MatchTester match(m_path, test.path()); + return match.test(); +} + +} // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/page/UserContentURLPattern.h b/src/3rdparty/webkit/WebCore/page/UserContentURLPattern.h new file mode 100644 index 0000000..bc87f55 --- /dev/null +++ b/src/3rdparty/webkit/WebCore/page/UserContentURLPattern.h @@ -0,0 +1,72 @@ +/* + * Copyright (C) 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 + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UserContentURLPattern_h +#define UserContentURLPattern_h + +#include "PlatformString.h" +#include + +namespace WebCore { + +class KURL; + +class UserContentURLPattern { +public: + UserContentURLPattern(const String& pattern) + : m_matchSubdomains(false) + { + m_invalid = !parse(pattern); + } + + bool matches(const KURL&) const; + + const String& scheme() const { return m_scheme; } + const String& host() const { return m_host; } + const String& path() const { return m_path; } + + bool matchSubdomains() const { return m_matchSubdomains; } + + static bool matchesPatterns(const KURL&, const Vector&); + +private: + bool parse(const String& pattern); + + bool matchesHost(const KURL&) const; + bool matchesPath(const KURL&) const; + + bool m_invalid; + + String m_scheme; + String m_host; + String m_path; + + bool m_matchSubdomains; +}; + + +} // namespace WebCore + +#endif // UserContentURLPattern_h diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/filters/FEComposite.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/filters/FEComposite.cpp index 0706358..f452a2d 100644 --- a/src/3rdparty/webkit/WebCore/platform/graphics/filters/FEComposite.cpp +++ b/src/3rdparty/webkit/WebCore/platform/graphics/filters/FEComposite.cpp @@ -2,6 +2,7 @@ Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann 2004, 2005 Rob Buis 2005 Eric Seidel + 2009 Dirk Schulze This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -24,7 +25,10 @@ #if ENABLE(FILTERS) #include "FEComposite.h" +#include "CanvasPixelArray.h" #include "Filter.h" +#include "GraphicsContext.h" +#include "ImageData.h" namespace WebCore { @@ -97,8 +101,74 @@ void FEComposite::setK4(float k4) m_k4 = k4; } -void FEComposite::apply(Filter*) +inline void arithmetic(const RefPtr& srcPixelArrayA, CanvasPixelArray*& srcPixelArrayB, + float k1, float k2, float k3, float k4) { + float scaledK1 = k1 / 255.f; + float scaledK4 = k4 * 255.f; + for (unsigned pixelOffset = 0; pixelOffset < srcPixelArrayA->length(); pixelOffset += 4) { + for (unsigned channel = 0; channel < 4; ++channel) { + unsigned char i1 = srcPixelArrayA->get(pixelOffset + channel); + unsigned char i2 = srcPixelArrayB->get(pixelOffset + channel); + + unsigned char result = scaledK1 * i1 * i2 + k2 * i1 + k3 * i2 + scaledK4; + if (channel == 3 && i1 == 0 && i2 == 0) + result = 0; + srcPixelArrayB->set(pixelOffset + channel, result); + } + } +} + +void FEComposite::apply(Filter* filter) +{ + m_in->apply(filter); + m_in2->apply(filter); + if (!m_in->resultImage() || !m_in2->resultImage()) + return; + + GraphicsContext* filterContext = getEffectContext(); + if (!filterContext) + return; + + FloatRect srcRect = FloatRect(0.f, 0.f, -1.f, -1.f); + switch (m_type) { + case FECOMPOSITE_OPERATOR_OVER: + filterContext->drawImage(m_in->resultImage()->image(), calculateDrawingRect(m_in->subRegion())); + filterContext->drawImage(m_in2->resultImage()->image(), calculateDrawingRect(m_in2->subRegion())); + break; + case FECOMPOSITE_OPERATOR_IN: + filterContext->save(); + filterContext->clipToImageBuffer(calculateDrawingRect(m_in2->subRegion()), m_in2->resultImage()); + filterContext->drawImage(m_in->resultImage()->image(), calculateDrawingRect(m_in->subRegion())); + filterContext->restore(); + break; + case FECOMPOSITE_OPERATOR_OUT: + filterContext->drawImage(m_in->resultImage()->image(), calculateDrawingRect(m_in->subRegion())); + filterContext->drawImage(m_in2->resultImage()->image(), calculateDrawingRect(m_in2->subRegion()), srcRect, CompositeDestinationOut); + break; + case FECOMPOSITE_OPERATOR_ATOP: + filterContext->drawImage(m_in2->resultImage()->image(), calculateDrawingRect(m_in2->subRegion())); + filterContext->drawImage(m_in->resultImage()->image(), calculateDrawingRect(m_in->subRegion()), srcRect, CompositeSourceAtop); + break; + case FECOMPOSITE_OPERATOR_XOR: + filterContext->drawImage(m_in2->resultImage()->image(), calculateDrawingRect(m_in2->subRegion())); + filterContext->drawImage(m_in->resultImage()->image(), calculateDrawingRect(m_in->subRegion()), srcRect, CompositeXOR); + break; + case FECOMPOSITE_OPERATOR_ARITHMETIC: { + IntRect effectADrawingRect = calculateDrawingIntRect(m_in->subRegion()); + RefPtr srcPixelArrayA(m_in->resultImage()->getPremultipliedImageData(effectADrawingRect)->data()); + + IntRect effectBDrawingRect = calculateDrawingIntRect(m_in2->subRegion()); + RefPtr imageData(m_in2->resultImage()->getPremultipliedImageData(effectBDrawingRect)); + CanvasPixelArray* srcPixelArrayB(imageData->data()); + + arithmetic(srcPixelArrayA, srcPixelArrayB, m_k1, m_k2, m_k3, m_k4); + resultImage()->putPremultipliedImageData(imageData.get(), IntRect(IntPoint(), resultImage()->size()), IntPoint()); + } + break; + default: + break; + } } void FEComposite::dump() diff --git a/src/3rdparty/webkit/WebCore/platform/network/CredentialStorage.cpp b/src/3rdparty/webkit/WebCore/platform/network/CredentialStorage.cpp index b7f4c01..407ed5b 100644 --- a/src/3rdparty/webkit/WebCore/platform/network/CredentialStorage.cpp +++ b/src/3rdparty/webkit/WebCore/platform/network/CredentialStorage.cpp @@ -60,6 +60,9 @@ static String originStringFromURL(const KURL& url) void CredentialStorage::set(const Credential& credential, const ProtectionSpace& protectionSpace, const KURL& url) { + ASSERT(url.protocolInHTTPFamily()); + ASSERT(url.isValid()); + protectionSpaceToCredentialMap().set(protectionSpace, credential); ProtectionSpaceAuthenticationScheme scheme = protectionSpace.authenticationScheme(); @@ -70,14 +73,15 @@ void CredentialStorage::set(const Credential& credential, const ProtectionSpace& pair >::iterator, bool> result = originToDefaultBasicCredentialMap().add(origin, pathToCredentialMap); // Remove the last path component that is not a directory to determine the subpath for which this credential applies. + // We keep a leading slash, but remove a trailing one. String path = url.path(); - if (!path.endsWith("/")) { + ASSERT(path.length() > 0); + ASSERT(path[0] == '/'); + if (path.length() > 1) { int index = path.reverseFind('/'); - if (index != -1) - path = path.substring(0, index); + path = path.substring(0, index ? index : 1); } - if (path.endsWith("/") && path.length() > 1) - path = path.substring(0, path.length() - 1); + ASSERT(path.length() == 1 || path[path.length() - 1] != '/'); result.first->second.set(path, credential); } @@ -102,13 +106,13 @@ Credential CredentialStorage::getDefaultAuthenticationCredential(const KURL& url while (credential.isEmpty() && !path.isNull()) { int index = path.reverseFind('/'); if (index == 0) { - path = String(); credential = pathToCredentialMap.get("/"); + break; } else if (index == -1) { // This case should never happen, as all HTTP URL paths should start with a leading / ASSERT_NOT_REACHED(); credential = pathToCredentialMap.get(path); - path = String(); + break; } else { path = path.substring(0, index); credential = pathToCredentialMap.get(path); diff --git a/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp b/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp index eac430f..3303b34 100644 --- a/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp +++ b/src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp @@ -205,13 +205,28 @@ QNetworkReply* QNetworkReplyHandler::release() return reply; } +static bool ignoreHttpError(QNetworkReply* reply, bool receivedData) +{ + int httpStatusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); + + if (httpStatusCode == 401 || httpStatusCode == 407) + return true; + + if (receivedData && (httpStatusCode >= 400 && httpStatusCode < 600)) + return true; + + return false; +} + void QNetworkReplyHandler::finish() { m_shouldFinish = (m_loadMode != LoadNormal); if (m_shouldFinish) return; - sendResponseIfNeeded(); + // FIXME: Investigate if this check should be moved into sendResponseIfNeeded() + if (!m_reply->error()) + sendResponseIfNeeded(); if (!m_resourceHandle) return; @@ -225,23 +240,22 @@ void QNetworkReplyHandler::finish() if (m_redirected) { resetState(); start(); - } else if (m_reply->error() != QNetworkReply::NoError - // a web page that returns 401/403/404 can still have content - && ((m_reply->error() != QNetworkReply::ContentOperationNotPermittedError - && m_reply->error() != QNetworkReply::ContentNotFoundError - && m_reply->error() != QNetworkReply::ProtocolUnknownError - && m_reply->error() != QNetworkReply::UnknownContentError) - // If the web page sent content, let's give it to the user. - || !m_responseDataSent) - && m_reply->error() != QNetworkReply::AuthenticationRequiredError - && m_reply->error() != QNetworkReply::ProxyAuthenticationRequiredError) { - QUrl url = m_reply->url(); - ResourceError error(url.host(), m_reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), - url.toString(), m_reply->errorString()); - client->didFail(m_resourceHandle, error); - } else { + } else if (!m_reply->error() || ignoreHttpError(m_reply, m_responseDataSent)) { client->didFinishLoading(m_resourceHandle); + } else { + int code = m_reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); + + QUrl url = m_reply->url(); + + if (code) { + ResourceError error("HTTP", code, url.toString(), m_reply->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toString()); + client->didFail(m_resourceHandle, error); + } else { + ResourceError error("QtNetwork", m_reply->error(), url.toString(), m_reply->errorString()); + client->didFail(m_resourceHandle, error); + } } + oldReply->deleteLater(); if (oldReply == m_reply) m_reply = 0; @@ -300,8 +314,7 @@ void QNetworkReplyHandler::sendResponseIfNeeded() * For local file requests remove the content length and the last-modified * headers as required by fast/dom/xmlhttprequest-get.xhtml */ - foreach (QByteArray headerName, m_reply->rawHeaderList()) { - + foreach (const QByteArray& headerName, m_reply->rawHeaderList()) { if (isLocalFileReply && (headerName == "Content-Length" || headerName == "Last-Modified")) continue; diff --git a/src/3rdparty/webkit/WebCore/platform/qt/Localizations.cpp b/src/3rdparty/webkit/WebCore/platform/qt/Localizations.cpp index 977b284..77cac57 100644 --- a/src/3rdparty/webkit/WebCore/platform/qt/Localizations.cpp +++ b/src/3rdparty/webkit/WebCore/platform/qt/Localizations.cpp @@ -427,7 +427,7 @@ String localizedMediaControlElementHelpText(const String& name) if (name == "CurrentTimeDisplay") return QCoreApplication::translate("QWebPage", "Current movie time", "Media controller element"); if (name == "TimeRemainingDisplay") - return QCoreApplication::translate("QWebPage", "Remaining move time", "Media controller element"); + return QCoreApplication::translate("QWebPage", "Remaining movie time", "Media controller element"); if (name == "StatusDisplay") return QCoreApplication::translate("QWebPage", "Current movie status", "Media controller element"); if (name == "FullscreenButton") diff --git a/src/3rdparty/webkit/WebCore/platform/text/CString.cpp b/src/3rdparty/webkit/WebCore/platform/text/CString.cpp index 5b8ac58..25f5fa1 100644 --- a/src/3rdparty/webkit/WebCore/platform/text/CString.cpp +++ b/src/3rdparty/webkit/WebCore/platform/text/CString.cpp @@ -27,19 +27,10 @@ #include "config.h" #include "CString.h" -#include "Base64.h" - using std::min; namespace WebCore { -PassRefPtr CStringBuffer::base64Encode() -{ - Vector encoded; - WebCore::base64Encode(m_vector, encoded); - return CStringBuffer::create(encoded); -} - CString::CString(const char* str) { init(str, strlen(str)); @@ -99,11 +90,6 @@ void CString::copyBufferIfNeeded() memcpy(m_buffer->mutableData(), m_temp->data(), len); } -CString CString::base64Encode() -{ - return CString(m_buffer->base64Encode().get()); -} - bool operator==(const CString& a, const CString& b) { if (a.isNull() != b.isNull()) diff --git a/src/3rdparty/webkit/WebCore/platform/text/CString.h b/src/3rdparty/webkit/WebCore/platform/text/CString.h index 2d1cc2b..b9030d6 100644 --- a/src/3rdparty/webkit/WebCore/platform/text/CString.h +++ b/src/3rdparty/webkit/WebCore/platform/text/CString.h @@ -43,12 +43,9 @@ namespace WebCore { friend class CString; static PassRefPtr create(unsigned length) { return adoptRef(new CStringBuffer(length)); } - static PassRefPtr create(const Vector& vectorToAdopt) { return adoptRef(new CStringBuffer(vectorToAdopt)); } CStringBuffer(unsigned length) : m_vector(length) { } - CStringBuffer(const Vector& vectorToAdopt) : m_vector(vectorToAdopt) { } char* mutableData() { return m_vector.data(); } - PassRefPtr base64Encode(); Vector m_vector; }; @@ -62,8 +59,6 @@ namespace WebCore { CString(CStringBuffer* buffer) : m_buffer(buffer) { } static CString newUninitialized(size_t length, char*& characterBuffer); - CString base64Encode(); - const char* data() const; char* mutableData(); unsigned length() const; diff --git a/src/3rdparty/webkit/WebCore/platform/text/TextEncoding.cpp b/src/3rdparty/webkit/WebCore/platform/text/TextEncoding.cpp index b76f739..c5c8cfd 100644 --- a/src/3rdparty/webkit/WebCore/platform/text/TextEncoding.cpp +++ b/src/3rdparty/webkit/WebCore/platform/text/TextEncoding.cpp @@ -264,6 +264,7 @@ const TextEncoding& UTF32LittleEndianEncoding() const TextEncoding& UTF8Encoding() { static TextEncoding globalUTF8Encoding("UTF-8"); + ASSERT(globalUTF8Encoding.isValid()); return globalUTF8Encoding; } diff --git a/src/3rdparty/webkit/WebCore/rendering/MediaControlElements.cpp b/src/3rdparty/webkit/WebCore/rendering/MediaControlElements.cpp index 969716f..29e2e57 100644 --- a/src/3rdparty/webkit/WebCore/rendering/MediaControlElements.cpp +++ b/src/3rdparty/webkit/WebCore/rendering/MediaControlElements.cpp @@ -135,7 +135,10 @@ PassRefPtr MediaControlElement::styleForElement() bool MediaControlElement::rendererIsNeeded(RenderStyle* style) { - return HTMLDivElement::rendererIsNeeded(style) && parent() && parent()->renderer(); + ASSERT(document()->page()); + + return HTMLDivElement::rendererIsNeeded(style) && parent() && parent()->renderer() + && document()->page()->theme()->shouldRenderMediaControlPart(style->appearance(), m_mediaElement); } void MediaControlElement::attach() @@ -360,7 +363,10 @@ PassRefPtr MediaControlInputElement::styleForElement() bool MediaControlInputElement::rendererIsNeeded(RenderStyle* style) { - return HTMLInputElement::rendererIsNeeded(style) && parent() && parent()->renderer(); + ASSERT(document()->page()); + + return HTMLInputElement::rendererIsNeeded(style) && parent() && parent()->renderer() + && document()->page()->theme()->shouldRenderMediaControlPart(style->appearance(), m_mediaElement); } void MediaControlInputElement::attach() @@ -444,16 +450,6 @@ void MediaControlMuteButtonElement::updateDisplayType() setDisplayType(m_mediaElement->muted() ? MediaUnMuteButton : MediaMuteButton); } -bool MediaControlMuteButtonElement::disabled() const -{ - return !m_mediaElement->hasAudio(); -} - -bool MediaControlMuteButtonElement::rendererIsNeeded(RenderStyle* style) -{ - return MediaControlInputElement::rendererIsNeeded(style) && !disabled(); -} - // ---------------------------- MediaControlPlayButtonElement::MediaControlPlayButtonElement(Document* document, HTMLMediaElement* element) @@ -551,11 +547,6 @@ void MediaControlRewindButtonElement::defaultEventHandler(Event* event) HTMLInputElement::defaultEventHandler(event); } -bool MediaControlRewindButtonElement::rendererIsNeeded(RenderStyle* style) -{ - return MediaControlInputElement::rendererIsNeeded(style) && m_mediaElement->movieLoadType() != MediaPlayer::LiveStream; -} - // ---------------------------- @@ -573,10 +564,6 @@ void MediaControlReturnToRealtimeButtonElement::defaultEventHandler(Event* event HTMLInputElement::defaultEventHandler(event); } -bool MediaControlReturnToRealtimeButtonElement::rendererIsNeeded(RenderStyle* style) -{ - return MediaControlInputElement::rendererIsNeeded(style) && m_mediaElement->movieLoadType() == MediaPlayer::LiveStream; -} // ---------------------------- @@ -664,11 +651,6 @@ void MediaControlFullscreenButtonElement::defaultEventHandler(Event* event) HTMLInputElement::defaultEventHandler(event); } -bool MediaControlFullscreenButtonElement::rendererIsNeeded(RenderStyle* style) -{ - return MediaControlInputElement::rendererIsNeeded(style) && m_mediaElement->supportsFullscreen(); -} - // ---------------------------- diff --git a/src/3rdparty/webkit/WebCore/rendering/MediaControlElements.h b/src/3rdparty/webkit/WebCore/rendering/MediaControlElements.h index e80f7fa..f692485 100644 --- a/src/3rdparty/webkit/WebCore/rendering/MediaControlElements.h +++ b/src/3rdparty/webkit/WebCore/rendering/MediaControlElements.h @@ -155,9 +155,6 @@ public: bool hitTest(const IntPoint& absPoint); MediaControlElementType displayType() const { return m_displayType; } - // Some elements are disabled by movie state (eg. mute if no audio). - virtual bool disabled() const { return false; } - HTMLMediaElement* mediaElement() const { return m_mediaElement; } virtual bool isMediaControlElement() const { return true; } @@ -177,8 +174,6 @@ public: MediaControlMuteButtonElement(Document*, HTMLMediaElement*); virtual void defaultEventHandler(Event*); virtual void updateDisplayType(); - virtual bool disabled() const; - virtual bool rendererIsNeeded(RenderStyle*); }; // ---------------------------- @@ -212,7 +207,6 @@ class MediaControlRewindButtonElement : public MediaControlInputElement { public: MediaControlRewindButtonElement(Document*, HTMLMediaElement*); virtual void defaultEventHandler(Event*); - virtual bool rendererIsNeeded(RenderStyle*); }; // ---------------------------- @@ -221,7 +215,6 @@ class MediaControlReturnToRealtimeButtonElement : public MediaControlInputElemen public: MediaControlReturnToRealtimeButtonElement(Document*, HTMLMediaElement*); virtual void defaultEventHandler(Event*); - virtual bool rendererIsNeeded(RenderStyle*); }; // ---------------------------- @@ -247,7 +240,6 @@ class MediaControlFullscreenButtonElement : public MediaControlInputElement { public: MediaControlFullscreenButtonElement(Document*, HTMLMediaElement*); virtual void defaultEventHandler(Event*); - virtual bool rendererIsNeeded(RenderStyle*); }; // ---------------------------- diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderBox.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderBox.cpp index dd58ed1..c8d3037 100644 --- a/src/3rdparty/webkit/WebCore/rendering/RenderBox.cpp +++ b/src/3rdparty/webkit/WebCore/rendering/RenderBox.cpp @@ -941,7 +941,8 @@ void RenderBox::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool if (style()->position() == FixedPosition) fixed = true; - RenderObject* o = container(); + bool containerSkipped; + RenderObject* o = container(repaintContainer, &containerSkipped); if (!o) return; @@ -959,6 +960,14 @@ void RenderBox::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool } else transformState.move(containerOffset.width(), containerOffset.height(), preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform); + if (containerSkipped) { + // There can't be a transfrom between repaintContainer and o, because transforms create containers, so it should be safe + // to just subtract the delta between the repaintContainer and o. + IntSize repaintContainerOffset = repaintContainer->offsetFromContainer(o); + transformState.move(-repaintContainerOffset.width(), -repaintContainerOffset.height(), preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform); + return; + } + o->mapLocalToContainer(repaintContainer, fixed, useTransforms, transformState); } @@ -1131,7 +1140,8 @@ void RenderBox::computeRectForRepaint(RenderBoxModelObject* repaintContainer, In if (repaintContainer == this) return; - RenderObject* o = container(); + bool containerSkipped; + RenderObject* o = container(repaintContainer, &containerSkipped); if (!o) return; @@ -1188,6 +1198,13 @@ void RenderBox::computeRectForRepaint(RenderBoxModelObject* repaintContainer, In return; } else rect.setLocation(topLeft); + + if (containerSkipped) { + // If the repaintContainer is below o, then we need to map the rect into repaintContainer's coordinates. + IntSize containerOffset = repaintContainer->offsetFromContainer(o); + rect.move(-containerOffset); + return; + } o->computeRectForRepaint(repaintContainer, rect, fixed); } diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderInline.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderInline.cpp index 07b28cc..a5e973e 100644 --- a/src/3rdparty/webkit/WebCore/rendering/RenderInline.cpp +++ b/src/3rdparty/webkit/WebCore/rendering/RenderInline.cpp @@ -652,7 +652,8 @@ void RenderInline::computeRectForRepaint(RenderBoxModelObject* repaintContainer, if (repaintContainer == this) return; - RenderObject* o = container(); + bool containerSkipped; + RenderObject* o = container(repaintContainer, &containerSkipped); if (!o) return; @@ -693,6 +694,13 @@ void RenderInline::computeRectForRepaint(RenderBoxModelObject* repaintContainer, return; } else rect.setLocation(topLeft); + + if (containerSkipped) { + // If the repaintContainer is below o, then we need to map the rect into repaintContainer's coordinates. + IntSize containerOffset = repaintContainer->offsetFromContainer(o); + rect.move(-containerOffset); + return; + } o->computeRectForRepaint(repaintContainer, rect, fixed); } diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderObject.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderObject.cpp index 1d5ed0c..b7f59e1 100644 --- a/src/3rdparty/webkit/WebCore/rendering/RenderObject.cpp +++ b/src/3rdparty/webkit/WebCore/rendering/RenderObject.cpp @@ -1788,8 +1788,11 @@ bool RenderObject::hasOutlineAnnotation() const return node() && node()->isLink() && document()->printing(); } -RenderObject* RenderObject::container() const +RenderObject* RenderObject::container(RenderBoxModelObject* repaintContainer, bool* repaintContainerSkipped) const { + if (repaintContainerSkipped) + *repaintContainerSkipped = false; + // This method is extremely similar to containingBlock(), but with a few notable // exceptions. // (1) It can be used on orphaned subtrees, i.e., it can be called safely even when @@ -1814,14 +1817,20 @@ RenderObject* RenderObject::container() const // we'll just return 0). // FIXME: The definition of view() has changed to not crawl up the render tree. It might // be safe now to use it. - while (o && o->parent() && !(o->hasTransform() && o->isRenderBlock())) + while (o && o->parent() && !(o->hasTransform() && o->isRenderBlock())) { + if (repaintContainerSkipped && o == repaintContainer) + *repaintContainerSkipped = true; o = o->parent(); + } } else if (pos == AbsolutePosition) { // Same goes here. We technically just want our containing block, but // we may not have one if we're part of an uninstalled subtree. We'll // climb as high as we can though. - while (o && o->style()->position() == StaticPosition && !o->isRenderView() && !(o->hasTransform() && o->isRenderBlock())) + while (o && o->style()->position() == StaticPosition && !o->isRenderView() && !(o->hasTransform() && o->isRenderBlock())) { + if (repaintContainerSkipped && o == repaintContainer) + *repaintContainerSkipped = true; o = o->parent(); + } } return o; diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderObject.h b/src/3rdparty/webkit/WebCore/rendering/RenderObject.h index 34f2b8b..367eaa6 100644 --- a/src/3rdparty/webkit/WebCore/rendering/RenderObject.h +++ b/src/3rdparty/webkit/WebCore/rendering/RenderObject.h @@ -403,11 +403,11 @@ public: bool hasOutlineAnnotation() const; bool hasOutline() const { return style()->hasOutline() || hasOutlineAnnotation(); } - /** - * returns the object containing this one. can be different from parent for - * positioned elements - */ - RenderObject* container() const; + // Returns the object containing this one. Can be different from parent for positioned elements. + // If repaintContainer and repaintContainerSkipped are not null, on return *repaintContainerSkipped + // is true if the renderer returned is an ancestor of repaintContainer. + RenderObject* container(RenderBoxModelObject* repaintContainer = 0, bool* repaintContainerSkipped = 0) const; + virtual RenderObject* hoverAncestor() const { return parent(); } // IE Extension that can be called on any RenderObject. See the implementation for the details. diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderTheme.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderTheme.cpp index 7b4dfe3..b5826cd 100644 --- a/src/3rdparty/webkit/WebCore/rendering/RenderTheme.cpp +++ b/src/3rdparty/webkit/WebCore/rendering/RenderTheme.cpp @@ -30,6 +30,7 @@ #include "GraphicsContext.h" #include "HTMLInputElement.h" #include "HTMLNames.h" +#include "MediaControlElements.h" #include "Page.h" #include "RenderStyle.h" #include "RenderView.h" @@ -396,6 +397,23 @@ bool RenderTheme::hitTestMediaControlPart(RenderObject* o, const IntPoint& absPo FloatPoint localPoint = o->absoluteToLocal(absPoint, false, true); // respect transforms return toRenderBox(o)->borderBoxRect().contains(roundedIntPoint(localPoint)); } + +bool RenderTheme::shouldRenderMediaControlPart(ControlPart part, Element* e) +{ + HTMLMediaElement* mediaElement = static_cast(e); + switch (part) { + case MediaMuteButtonPart: + return mediaElement->hasAudio(); + case MediaRewindButtonPart: + return mediaElement->movieLoadType() != MediaPlayer::LiveStream; + case MediaReturnToRealtimeButtonPart: + return mediaElement->movieLoadType() == MediaPlayer::LiveStream; + case MediaFullscreenButtonPart: + return mediaElement->supportsFullscreen(); + default: + return true; + } +} #endif Color RenderTheme::activeSelectionBackgroundColor() const diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderTheme.h b/src/3rdparty/webkit/WebCore/rendering/RenderTheme.h index c00c2eb..1b6a7e4 100644 --- a/src/3rdparty/webkit/WebCore/rendering/RenderTheme.h +++ b/src/3rdparty/webkit/WebCore/rendering/RenderTheme.h @@ -172,6 +172,7 @@ public: #if ENABLE(VIDEO) // Media controls virtual bool hitTestMediaControlPart(RenderObject*, const IntPoint& absPoint); + virtual bool shouldRenderMediaControlPart(ControlPart, Element*); #endif protected: diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumSkia.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumSkia.cpp index 82e633b..4f486d5 100644 --- a/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumSkia.cpp +++ b/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumSkia.cpp @@ -868,6 +868,19 @@ int RenderThemeChromiumSkia::buttonInternalPaddingBottom() const return 1; } +#if ENABLE(VIDEO) +bool RenderThemeChromiumSkia::shouldRenderMediaControlPart(ControlPart part, Element* e) +{ + HTMLMediaElement* mediaElement = static_cast(e); + switch (part) { + case MediaMuteButtonPart: + return true; + default: + return RenderTheme::shouldRenderMediaControlPart(part, e); + } +} +#endif + // static void RenderThemeChromiumSkia::setDefaultFontSize(int fontSize) { diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumSkia.h b/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumSkia.h index 37e656f..98e3a35 100644 --- a/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumSkia.h +++ b/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumSkia.h @@ -126,6 +126,11 @@ namespace WebCore { virtual int buttonInternalPaddingTop() const; virtual int buttonInternalPaddingBottom() const; +#if ENABLE(VIDEO) + // Media controls + virtual bool shouldRenderMediaControlPart(ControlPart, Element*); +#endif + // Provide a way to pass the default font size from the Settings object // to the render theme. FIXME: http://b/1129186 A cleaner way would be // to remove the default font size from this object and have callers diff --git a/src/3rdparty/webkit/WebCore/storage/StorageEventDispatcher.h b/src/3rdparty/webkit/WebCore/storage/StorageEventDispatcher.h new file mode 100644 index 0000000..f4a98ef --- /dev/null +++ b/src/3rdparty/webkit/WebCore/storage/StorageEventDispatcher.h @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2008 Apple Inc. All rights reserved. + * Copyright (C) 2009 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef StorageEventDispatcher_h +#define StorageEventDispatcher_h + +#if ENABLE(DOM_STORAGE) + +#include "PlatformString.h" +#include "StorageArea.h" + +namespace WebCore { + + // This is in its own class since Chromium must override it. + class StorageEventDispatcher { + public: + static void dispatch(const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*, Frame* sourceFrame); + + private: + // Do not instantiate. + StorageEventDispatcher(); + }; + +} // namespace WebCore + +#endif // ENABLE(DOM_STORAGE) + +#endif // StorageEventDispatcher_h diff --git a/src/3rdparty/webkit/WebCore/svg/SVGUseElement.cpp b/src/3rdparty/webkit/WebCore/svg/SVGUseElement.cpp index 4b66e03..0c2abe0 100644 --- a/src/3rdparty/webkit/WebCore/svg/SVGUseElement.cpp +++ b/src/3rdparty/webkit/WebCore/svg/SVGUseElement.cpp @@ -1,6 +1,7 @@ /* Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann 2004, 2005, 2006, 2007 Rob Buis + Copyright (C) Research In Motion Limited 2009. All rights reserved. This file is part of the KDE project @@ -158,6 +159,9 @@ void SVGUseElement::childrenChanged(bool changedByParser, Node* beforeChange, No static bool shadowTreeContainsChangedNodes(SVGElementInstance* target) { + if (!target) // when use is referencing an non-existing element, there will be no Instance tree built + return false; + if (target->needsUpdate()) return true; diff --git a/src/3rdparty/webkit/WebCore/svg/animation/SVGSMILElement.cpp b/src/3rdparty/webkit/WebCore/svg/animation/SVGSMILElement.cpp index 8ec9435..3957b81 100644 --- a/src/3rdparty/webkit/WebCore/svg/animation/SVGSMILElement.cpp +++ b/src/3rdparty/webkit/WebCore/svg/animation/SVGSMILElement.cpp @@ -87,7 +87,7 @@ private: m_eventBase->addEventListener(m_condition->m_name, this, false); } - virtual void handleEvent(Event*); + virtual void handleEvent(ScriptExecutionContext*, Event*); SVGSMILElement* m_animation; SVGSMILElement::Condition* m_condition; @@ -103,7 +103,7 @@ bool ConditionEventListener::operator==(const EventListener& listener) return false; } -void ConditionEventListener::handleEvent(Event* event) +void ConditionEventListener::handleEvent(ScriptExecutionContext*, Event* event) { m_animation->handleConditionEvent(event, m_condition); } diff --git a/src/3rdparty/webkit/WebCore/workers/WorkerContext.cpp b/src/3rdparty/webkit/WebCore/workers/WorkerContext.cpp index 22e5b56..f4d795b 100644 --- a/src/3rdparty/webkit/WebCore/workers/WorkerContext.cpp +++ b/src/3rdparty/webkit/WebCore/workers/WorkerContext.cpp @@ -233,7 +233,7 @@ void WorkerContext::reportException(const String& errorMessage, int lineNumber, { bool errorHandled = false; if (onerror()) - errorHandled = onerror()->reportError(errorMessage, sourceURL, lineNumber); + errorHandled = onerror()->reportError(this, errorMessage, sourceURL, lineNumber); if (!errorHandled) thread()->workerReportingProxy().postExceptionToWorkerObject(errorMessage, lineNumber, sourceURL); diff --git a/src/3rdparty/webkit/WebCore/xml/XSLStyleSheet.cpp b/src/3rdparty/webkit/WebCore/xml/XSLStyleSheet.cpp deleted file mode 100644 index b7d52f8..0000000 --- a/src/3rdparty/webkit/WebCore/xml/XSLStyleSheet.cpp +++ /dev/null @@ -1,312 +0,0 @@ -/* - * This file is part of the XSL implementation. - * - * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "config.h" -#include "XSLStyleSheet.h" - -#if ENABLE(XSLT) - -#include "CString.h" -#include "Console.h" -#include "DOMWindow.h" -#include "DocLoader.h" -#include "Document.h" -#include "Frame.h" -#include "Node.h" -#include "XMLTokenizer.h" -#include "XMLTokenizerScope.h" -#include "XSLImportRule.h" -#include "XSLTProcessor.h" -#include "loader.h" - -#include -#include - -#if PLATFORM(MAC) -#include "SoftLinking.h" -#endif - -#if PLATFORM(MAC) -SOFT_LINK_LIBRARY(libxslt) -SOFT_LINK(libxslt, xsltIsBlank, int, (xmlChar *str), (str)) -SOFT_LINK(libxslt, xsltGetNsProp, xmlChar *, (xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace), (node, name, nameSpace)) -SOFT_LINK(libxslt, xsltParseStylesheetDoc, xsltStylesheetPtr, (xmlDocPtr doc), (doc)) -SOFT_LINK(libxslt, xsltLoadStylesheetPI, xsltStylesheetPtr, (xmlDocPtr doc), (doc)) -#endif - -namespace WebCore { - -XSLStyleSheet::XSLStyleSheet(XSLImportRule* parentRule, const String& href) - : StyleSheet(parentRule, href) - , m_ownerDocument(0) - , m_stylesheetDoc(0) - , m_embedded(false) - , m_processed(false) // Child sheets get marked as processed when the libxslt engine has finally seen them. - , m_stylesheetDocTaken(false) - , m_parentStyleSheet(0) -{ -} - -XSLStyleSheet::XSLStyleSheet(Node* parentNode, const String& href, bool embedded) - : StyleSheet(parentNode, href) - , m_ownerDocument(parentNode->document()) - , m_stylesheetDoc(0) - , m_embedded(embedded) - , m_processed(true) // The root sheet starts off processed. - , m_stylesheetDocTaken(false) - , m_parentStyleSheet(0) -{ -} - -XSLStyleSheet::~XSLStyleSheet() -{ - if (!m_stylesheetDocTaken) - xmlFreeDoc(m_stylesheetDoc); -} - -bool XSLStyleSheet::isLoading() -{ - unsigned len = length(); - for (unsigned i = 0; i < len; ++i) { - StyleBase* rule = item(i); - if (rule->isImportRule()) { - XSLImportRule* import = static_cast(rule); - if (import->isLoading()) - return true; - } - } - return false; -} - -void XSLStyleSheet::checkLoaded() -{ - if (isLoading()) - return; - if (parent()) - parent()->checkLoaded(); - if (ownerNode()) - ownerNode()->sheetLoaded(); -} - -xmlDocPtr XSLStyleSheet::document() -{ - if (m_embedded && ownerDocument()) - return (xmlDocPtr)ownerDocument()->transformSource(); - return m_stylesheetDoc; -} - -void XSLStyleSheet::clearDocuments() -{ - m_stylesheetDoc = 0; - unsigned len = length(); - for (unsigned i = 0; i < len; ++i) { - StyleBase* rule = item(i); - if (rule->isImportRule()) { - XSLImportRule* import = static_cast(rule); - if (import->styleSheet()) - import->styleSheet()->clearDocuments(); - } - } -} - -DocLoader* XSLStyleSheet::docLoader() -{ - if (!m_ownerDocument) - return 0; - return m_ownerDocument->docLoader(); -} - -bool XSLStyleSheet::parseString(const String& string, bool) -{ - // Parse in a single chunk into an xmlDocPtr - const UChar BOM = 0xFEFF; - const unsigned char BOMHighByte = *reinterpret_cast(&BOM); - if (!m_stylesheetDocTaken) - xmlFreeDoc(m_stylesheetDoc); - m_stylesheetDocTaken = false; - - Console* console = 0; - if (Frame* frame = ownerDocument()->frame()) - console = frame->domWindow()->console(); - - XMLTokenizerScope scope(docLoader(), XSLTProcessor::genericErrorFunc, XSLTProcessor::parseErrorFunc, console); - - const char* buffer = reinterpret_cast(string.characters()); - int size = string.length() * sizeof(UChar); - - xmlParserCtxtPtr ctxt = xmlCreateMemoryParserCtxt(buffer, size); - - if (m_parentStyleSheet) { - // The XSL transform may leave the newly-transformed document - // with references to the symbol dictionaries of the style sheet - // and any of its children. XML document disposal can corrupt memory - // if a document uses more than one symbol dictionary, so we - // ensure that all child stylesheets use the same dictionaries as their - // parents. - xmlDictFree(ctxt->dict); - ctxt->dict = m_parentStyleSheet->m_stylesheetDoc->dict; - xmlDictReference(ctxt->dict); - } - - m_stylesheetDoc = xmlCtxtReadMemory(ctxt, buffer, size, - href().utf8().data(), - BOMHighByte == 0xFF ? "UTF-16LE" : "UTF-16BE", - XML_PARSE_NOENT | XML_PARSE_DTDATTR | XML_PARSE_NOWARNING | XML_PARSE_NOCDATA); - xmlFreeParserCtxt(ctxt); - - loadChildSheets(); - - return m_stylesheetDoc; -} - -void XSLStyleSheet::loadChildSheets() -{ - if (!document()) - return; - - xmlNodePtr stylesheetRoot = document()->children; - - // Top level children may include other things such as DTD nodes, we ignore those. - while (stylesheetRoot && stylesheetRoot->type != XML_ELEMENT_NODE) - stylesheetRoot = stylesheetRoot->next; - - if (m_embedded) { - // We have to locate (by ID) the appropriate embedded stylesheet element, so that we can walk the - // import/include list. - xmlAttrPtr idNode = xmlGetID(document(), (const xmlChar*)(href().utf8().data())); - if (!idNode) - return; - stylesheetRoot = idNode->parent; - } else { - // FIXME: Need to handle an external URI with a # in it. This is a pretty minor edge case, so we'll deal - // with it later. - } - - if (stylesheetRoot) { - // Walk the children of the root element and look for import/include elements. - // Imports must occur first. - xmlNodePtr curr = stylesheetRoot->children; - while (curr) { - if (curr->type != XML_ELEMENT_NODE) { - curr = curr->next; - continue; - } - if (IS_XSLT_ELEM(curr) && IS_XSLT_NAME(curr, "import")) { - xmlChar* uriRef = xsltGetNsProp(curr, (const xmlChar*)"href", XSLT_NAMESPACE); - loadChildSheet(String::fromUTF8((const char*)uriRef)); - xmlFree(uriRef); - } else - break; - curr = curr->next; - } - - // Now handle includes. - while (curr) { - if (curr->type == XML_ELEMENT_NODE && IS_XSLT_ELEM(curr) && IS_XSLT_NAME(curr, "include")) { - xmlChar* uriRef = xsltGetNsProp(curr, (const xmlChar*)"href", XSLT_NAMESPACE); - loadChildSheet(String::fromUTF8((const char*)uriRef)); - xmlFree(uriRef); - } - curr = curr->next; - } - } -} - -void XSLStyleSheet::loadChildSheet(const String& href) -{ - RefPtr childRule = XSLImportRule::create(this, href); - append(childRule); - childRule->loadSheet(); -} - -xsltStylesheetPtr XSLStyleSheet::compileStyleSheet() -{ - // FIXME: Hook up error reporting for the stylesheet compilation process. - if (m_embedded) - return xsltLoadStylesheetPI(document()); - - // xsltParseStylesheetDoc makes the document part of the stylesheet - // so we have to release our pointer to it. - ASSERT(!m_stylesheetDocTaken); - xsltStylesheetPtr result = xsltParseStylesheetDoc(m_stylesheetDoc); - if (result) - m_stylesheetDocTaken = true; - return result; -} - -void XSLStyleSheet::setParentStyleSheet(XSLStyleSheet* parent) -{ - m_parentStyleSheet = parent; - if (parent) - m_ownerDocument = parent->ownerDocument(); -} - -xmlDocPtr XSLStyleSheet::locateStylesheetSubResource(xmlDocPtr parentDoc, const xmlChar* uri) -{ - bool matchedParent = (parentDoc == document()); - unsigned len = length(); - for (unsigned i = 0; i < len; ++i) { - StyleBase* rule = item(i); - if (rule->isImportRule()) { - XSLImportRule* import = static_cast(rule); - XSLStyleSheet* child = import->styleSheet(); - if (!child) - continue; - if (matchedParent) { - if (child->processed()) - continue; // libxslt has been given this sheet already. - - // Check the URI of the child stylesheet against the doc URI. - // In order to ensure that libxml canonicalized both URLs, we get the original href - // string from the import rule and canonicalize it using libxml before comparing it - // with the URI argument. - CString importHref = import->href().utf8(); - xmlChar* base = xmlNodeGetBase(parentDoc, (xmlNodePtr)parentDoc); - xmlChar* childURI = xmlBuildURI((const xmlChar*)importHref.data(), base); - bool equalURIs = xmlStrEqual(uri, childURI); - xmlFree(base); - xmlFree(childURI); - if (equalURIs) { - child->markAsProcessed(); - return child->document(); - } - } else { - xmlDocPtr result = import->styleSheet()->locateStylesheetSubResource(parentDoc, uri); - if (result) - return result; - } - } - } - - return 0; -} - -void XSLStyleSheet::markAsProcessed() -{ - ASSERT(!m_processed); - ASSERT(!m_stylesheetDocTaken); - m_processed = true; - m_stylesheetDocTaken = true; -} - -} // namespace WebCore - -#endif // ENABLE(XSLT) diff --git a/src/3rdparty/webkit/WebCore/xml/XSLStyleSheet.h b/src/3rdparty/webkit/WebCore/xml/XSLStyleSheet.h index fe97b54..c9729bb 100644 --- a/src/3rdparty/webkit/WebCore/xml/XSLStyleSheet.h +++ b/src/3rdparty/webkit/WebCore/xml/XSLStyleSheet.h @@ -26,8 +26,12 @@ #if ENABLE(XSLT) #include "StyleSheet.h" + +#if !USE(QXMLQUERY) #include #include +#endif + #include namespace WebCore { @@ -38,10 +42,12 @@ class XSLImportRule; class XSLStyleSheet : public StyleSheet { public: +#if !USE(QXMLQUERY) static PassRefPtr create(XSLImportRule* parentImport, const String& href) { return adoptRef(new XSLStyleSheet(parentImport, href)); } +#endif static PassRefPtr create(Node* parentNode, const String& href) { return adoptRef(new XSLStyleSheet(parentNode, href, false)); @@ -65,31 +71,41 @@ public: void loadChildSheets(); void loadChildSheet(const String& href); - xsltStylesheetPtr compileStyleSheet(); - DocLoader* docLoader(); Document* ownerDocument() { return m_ownerDocument; } void setParentStyleSheet(XSLStyleSheet* parent); +#if USE(QXMLQUERY) + String sheetString() const { return m_sheetString; } +#else xmlDocPtr document(); + xsltStylesheetPtr compileStyleSheet(); + xmlDocPtr locateStylesheetSubResource(xmlDocPtr parentDoc, const xmlChar* uri); +#endif void clearDocuments(); - xmlDocPtr locateStylesheetSubResource(xmlDocPtr parentDoc, const xmlChar* uri); - void markAsProcessed(); bool processed() const { return m_processed; } private: XSLStyleSheet(Node* parentNode, const String& href, bool embedded); +#if !USE(QXMLQUERY) XSLStyleSheet(XSLImportRule* parentImport, const String& href); +#endif Document* m_ownerDocument; - xmlDocPtr m_stylesheetDoc; bool m_embedded; bool m_processed; + +#if USE(QXMLQUERY) + String m_sheetString; +#else + xmlDocPtr m_stylesheetDoc; bool m_stylesheetDocTaken; +#endif + XSLStyleSheet* m_parentStyleSheet; }; diff --git a/src/3rdparty/webkit/WebCore/xml/XSLStyleSheetLibxslt.cpp b/src/3rdparty/webkit/WebCore/xml/XSLStyleSheetLibxslt.cpp new file mode 100644 index 0000000..2ae8b82 --- /dev/null +++ b/src/3rdparty/webkit/WebCore/xml/XSLStyleSheetLibxslt.cpp @@ -0,0 +1,313 @@ +/* + * This file is part of the XSL implementation. + * + * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include "config.h" +#include "XSLStyleSheet.h" + +#if ENABLE(XSLT) + +#include "CString.h" +#include "Console.h" +#include "DOMWindow.h" +#include "DocLoader.h" +#include "Document.h" +#include "Frame.h" +#include "Node.h" +#include "TransformSource.h" +#include "XMLTokenizer.h" +#include "XMLTokenizerScope.h" +#include "XSLImportRule.h" +#include "XSLTProcessor.h" +#include "loader.h" + +#include +#include + +#if PLATFORM(MAC) +#include "SoftLinking.h" +#endif + +#if PLATFORM(MAC) +SOFT_LINK_LIBRARY(libxslt) +SOFT_LINK(libxslt, xsltIsBlank, int, (xmlChar *str), (str)) +SOFT_LINK(libxslt, xsltGetNsProp, xmlChar *, (xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace), (node, name, nameSpace)) +SOFT_LINK(libxslt, xsltParseStylesheetDoc, xsltStylesheetPtr, (xmlDocPtr doc), (doc)) +SOFT_LINK(libxslt, xsltLoadStylesheetPI, xsltStylesheetPtr, (xmlDocPtr doc), (doc)) +#endif + +namespace WebCore { + +XSLStyleSheet::XSLStyleSheet(XSLImportRule* parentRule, const String& href) + : StyleSheet(parentRule, href) + , m_ownerDocument(0) + , m_embedded(false) + , m_processed(false) // Child sheets get marked as processed when the libxslt engine has finally seen them. + , m_stylesheetDoc(0) + , m_stylesheetDocTaken(false) + , m_parentStyleSheet(0) +{ +} + +XSLStyleSheet::XSLStyleSheet(Node* parentNode, const String& href, bool embedded) + : StyleSheet(parentNode, href) + , m_ownerDocument(parentNode->document()) + , m_embedded(embedded) + , m_processed(true) // The root sheet starts off processed. + , m_stylesheetDoc(0) + , m_stylesheetDocTaken(false) + , m_parentStyleSheet(0) +{ +} + +XSLStyleSheet::~XSLStyleSheet() +{ + if (!m_stylesheetDocTaken) + xmlFreeDoc(m_stylesheetDoc); +} + +bool XSLStyleSheet::isLoading() +{ + unsigned len = length(); + for (unsigned i = 0; i < len; ++i) { + StyleBase* rule = item(i); + if (rule->isImportRule()) { + XSLImportRule* import = static_cast(rule); + if (import->isLoading()) + return true; + } + } + return false; +} + +void XSLStyleSheet::checkLoaded() +{ + if (isLoading()) + return; + if (parent()) + parent()->checkLoaded(); + if (ownerNode()) + ownerNode()->sheetLoaded(); +} + +xmlDocPtr XSLStyleSheet::document() +{ + if (m_embedded && ownerDocument() && ownerDocument()->transformSource()) + return (xmlDocPtr)ownerDocument()->transformSource()->platformSource(); + return m_stylesheetDoc; +} + +void XSLStyleSheet::clearDocuments() +{ + m_stylesheetDoc = 0; + unsigned len = length(); + for (unsigned i = 0; i < len; ++i) { + StyleBase* rule = item(i); + if (rule->isImportRule()) { + XSLImportRule* import = static_cast(rule); + if (import->styleSheet()) + import->styleSheet()->clearDocuments(); + } + } +} + +DocLoader* XSLStyleSheet::docLoader() +{ + if (!m_ownerDocument) + return 0; + return m_ownerDocument->docLoader(); +} + +bool XSLStyleSheet::parseString(const String& string, bool) +{ + // Parse in a single chunk into an xmlDocPtr + const UChar BOM = 0xFEFF; + const unsigned char BOMHighByte = *reinterpret_cast(&BOM); + if (!m_stylesheetDocTaken) + xmlFreeDoc(m_stylesheetDoc); + m_stylesheetDocTaken = false; + + Console* console = 0; + if (Frame* frame = ownerDocument()->frame()) + console = frame->domWindow()->console(); + + XMLTokenizerScope scope(docLoader(), XSLTProcessor::genericErrorFunc, XSLTProcessor::parseErrorFunc, console); + + const char* buffer = reinterpret_cast(string.characters()); + int size = string.length() * sizeof(UChar); + + xmlParserCtxtPtr ctxt = xmlCreateMemoryParserCtxt(buffer, size); + + if (m_parentStyleSheet) { + // The XSL transform may leave the newly-transformed document + // with references to the symbol dictionaries of the style sheet + // and any of its children. XML document disposal can corrupt memory + // if a document uses more than one symbol dictionary, so we + // ensure that all child stylesheets use the same dictionaries as their + // parents. + xmlDictFree(ctxt->dict); + ctxt->dict = m_parentStyleSheet->m_stylesheetDoc->dict; + xmlDictReference(ctxt->dict); + } + + m_stylesheetDoc = xmlCtxtReadMemory(ctxt, buffer, size, + href().utf8().data(), + BOMHighByte == 0xFF ? "UTF-16LE" : "UTF-16BE", + XML_PARSE_NOENT | XML_PARSE_DTDATTR | XML_PARSE_NOWARNING | XML_PARSE_NOCDATA); + xmlFreeParserCtxt(ctxt); + + loadChildSheets(); + + return m_stylesheetDoc; +} + +void XSLStyleSheet::loadChildSheets() +{ + if (!document()) + return; + + xmlNodePtr stylesheetRoot = document()->children; + + // Top level children may include other things such as DTD nodes, we ignore those. + while (stylesheetRoot && stylesheetRoot->type != XML_ELEMENT_NODE) + stylesheetRoot = stylesheetRoot->next; + + if (m_embedded) { + // We have to locate (by ID) the appropriate embedded stylesheet element, so that we can walk the + // import/include list. + xmlAttrPtr idNode = xmlGetID(document(), (const xmlChar*)(href().utf8().data())); + if (!idNode) + return; + stylesheetRoot = idNode->parent; + } else { + // FIXME: Need to handle an external URI with a # in it. This is a pretty minor edge case, so we'll deal + // with it later. + } + + if (stylesheetRoot) { + // Walk the children of the root element and look for import/include elements. + // Imports must occur first. + xmlNodePtr curr = stylesheetRoot->children; + while (curr) { + if (curr->type != XML_ELEMENT_NODE) { + curr = curr->next; + continue; + } + if (IS_XSLT_ELEM(curr) && IS_XSLT_NAME(curr, "import")) { + xmlChar* uriRef = xsltGetNsProp(curr, (const xmlChar*)"href", XSLT_NAMESPACE); + loadChildSheet(String::fromUTF8((const char*)uriRef)); + xmlFree(uriRef); + } else + break; + curr = curr->next; + } + + // Now handle includes. + while (curr) { + if (curr->type == XML_ELEMENT_NODE && IS_XSLT_ELEM(curr) && IS_XSLT_NAME(curr, "include")) { + xmlChar* uriRef = xsltGetNsProp(curr, (const xmlChar*)"href", XSLT_NAMESPACE); + loadChildSheet(String::fromUTF8((const char*)uriRef)); + xmlFree(uriRef); + } + curr = curr->next; + } + } +} + +void XSLStyleSheet::loadChildSheet(const String& href) +{ + RefPtr childRule = XSLImportRule::create(this, href); + append(childRule); + childRule->loadSheet(); +} + +xsltStylesheetPtr XSLStyleSheet::compileStyleSheet() +{ + // FIXME: Hook up error reporting for the stylesheet compilation process. + if (m_embedded) + return xsltLoadStylesheetPI(document()); + + // xsltParseStylesheetDoc makes the document part of the stylesheet + // so we have to release our pointer to it. + ASSERT(!m_stylesheetDocTaken); + xsltStylesheetPtr result = xsltParseStylesheetDoc(m_stylesheetDoc); + if (result) + m_stylesheetDocTaken = true; + return result; +} + +void XSLStyleSheet::setParentStyleSheet(XSLStyleSheet* parent) +{ + m_parentStyleSheet = parent; + if (parent) + m_ownerDocument = parent->ownerDocument(); +} + +xmlDocPtr XSLStyleSheet::locateStylesheetSubResource(xmlDocPtr parentDoc, const xmlChar* uri) +{ + bool matchedParent = (parentDoc == document()); + unsigned len = length(); + for (unsigned i = 0; i < len; ++i) { + StyleBase* rule = item(i); + if (rule->isImportRule()) { + XSLImportRule* import = static_cast(rule); + XSLStyleSheet* child = import->styleSheet(); + if (!child) + continue; + if (matchedParent) { + if (child->processed()) + continue; // libxslt has been given this sheet already. + + // Check the URI of the child stylesheet against the doc URI. + // In order to ensure that libxml canonicalized both URLs, we get the original href + // string from the import rule and canonicalize it using libxml before comparing it + // with the URI argument. + CString importHref = import->href().utf8(); + xmlChar* base = xmlNodeGetBase(parentDoc, (xmlNodePtr)parentDoc); + xmlChar* childURI = xmlBuildURI((const xmlChar*)importHref.data(), base); + bool equalURIs = xmlStrEqual(uri, childURI); + xmlFree(base); + xmlFree(childURI); + if (equalURIs) { + child->markAsProcessed(); + return child->document(); + } + } else { + xmlDocPtr result = import->styleSheet()->locateStylesheetSubResource(parentDoc, uri); + if (result) + return result; + } + } + } + + return 0; +} + +void XSLStyleSheet::markAsProcessed() +{ + ASSERT(!m_processed); + ASSERT(!m_stylesheetDocTaken); + m_processed = true; + m_stylesheetDocTaken = true; +} + +} // namespace WebCore + +#endif // ENABLE(XSLT) diff --git a/src/3rdparty/webkit/WebCore/xml/XSLStyleSheetQt.cpp b/src/3rdparty/webkit/WebCore/xml/XSLStyleSheetQt.cpp new file mode 100644 index 0000000..9fada0e --- /dev/null +++ b/src/3rdparty/webkit/WebCore/xml/XSLStyleSheetQt.cpp @@ -0,0 +1,103 @@ +/* + * This file is part of the XSL implementation. + * + * Copyright (C) 2009 Jakub Wieczorek + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include "config.h" +#include "XSLStyleSheet.h" + +#if ENABLE(XSLT) + +#include "DOMWindow.h" +#include "Document.h" +#include "Node.h" +#include "NotImplemented.h" +#include "XSLTProcessor.h" +#include "loader.h" + +namespace WebCore { + +XSLStyleSheet::XSLStyleSheet(Node* parentNode, const String& href, bool embedded) + : StyleSheet(parentNode, href) + , m_ownerDocument(parentNode->document()) + , m_embedded(embedded) +{ +} + +XSLStyleSheet::~XSLStyleSheet() +{ +} + +bool XSLStyleSheet::isLoading() +{ + notImplemented(); + return false; +} + +void XSLStyleSheet::checkLoaded() +{ + if (ownerNode()) + ownerNode()->sheetLoaded(); +} + +void XSLStyleSheet::clearDocuments() +{ + notImplemented(); +} + +DocLoader* XSLStyleSheet::docLoader() +{ + if (!m_ownerDocument) + return 0; + return m_ownerDocument->docLoader(); +} + +bool XSLStyleSheet::parseString(const String& string, bool) +{ + // FIXME: Fix QXmlQuery so that it allows compiling the stylesheet before setting the document + // to be transformed. This way we could not only check if the stylesheet is correct before using it + // but also turn XSLStyleSheet::sheetString() into XSLStyleSheet::query() that returns a QXmlQuery. + + m_sheetString = string; + return !m_sheetString.isEmpty(); +} + +void XSLStyleSheet::loadChildSheets() +{ + notImplemented(); +} + +void XSLStyleSheet::loadChildSheet(const String& href) +{ + notImplemented(); +} + +void XSLStyleSheet::setParentStyleSheet(XSLStyleSheet* parent) +{ + notImplemented(); +} + +void XSLStyleSheet::markAsProcessed() +{ + notImplemented(); +} + +} // namespace WebCore + +#endif // ENABLE(XSLT) diff --git a/src/3rdparty/webkit/WebCore/xml/XSLTProcessor.cpp b/src/3rdparty/webkit/WebCore/xml/XSLTProcessor.cpp index 8eaef67..b182243 100644 --- a/src/3rdparty/webkit/WebCore/xml/XSLTProcessor.cpp +++ b/src/3rdparty/webkit/WebCore/xml/XSLTProcessor.cpp @@ -26,10 +26,7 @@ #include "XSLTProcessor.h" -#include "CString.h" -#include "Console.h" #include "DOMImplementation.h" -#include "DOMWindow.h" #include "DocLoader.h" #include "DocumentFragment.h" #include "Frame.h" @@ -38,166 +35,17 @@ #include "HTMLDocument.h" #include "HTMLTokenizer.h" // for parseHTMLDocumentFragment #include "Page.h" -#include "ResourceError.h" -#include "ResourceHandle.h" -#include "ResourceRequest.h" -#include "ResourceResponse.h" #include "Text.h" #include "TextResourceDecoder.h" #include "XMLTokenizer.h" -#include "XSLTExtensions.h" -#include "XSLTUnicodeSort.h" #include "loader.h" #include "markup.h" -#include -#include -#include #include #include #include -#if PLATFORM(MAC) -#include "SoftLinking.h" - -SOFT_LINK_LIBRARY(libxslt); -SOFT_LINK(libxslt, xsltFreeStylesheet, void, (xsltStylesheetPtr sheet), (sheet)) -SOFT_LINK(libxslt, xsltFreeTransformContext, void, (xsltTransformContextPtr ctxt), (ctxt)) -SOFT_LINK(libxslt, xsltNewTransformContext, xsltTransformContextPtr, (xsltStylesheetPtr style, xmlDocPtr doc), (style, doc)) -SOFT_LINK(libxslt, xsltApplyStylesheetUser, xmlDocPtr, (xsltStylesheetPtr style, xmlDocPtr doc, const char** params, const char* output, FILE* profile, xsltTransformContextPtr userCtxt), (style, doc, params, output, profile, userCtxt)) -SOFT_LINK(libxslt, xsltQuoteUserParams, int, (xsltTransformContextPtr ctxt, const char** params), (ctxt, params)) -SOFT_LINK(libxslt, xsltSetCtxtSortFunc, void, (xsltTransformContextPtr ctxt, xsltSortFunc handler), (ctxt, handler)) -SOFT_LINK(libxslt, xsltSetLoaderFunc, void, (xsltDocLoaderFunc f), (f)) -SOFT_LINK(libxslt, xsltSaveResultTo, int, (xmlOutputBufferPtr buf, xmlDocPtr result, xsltStylesheetPtr style), (buf, result, style)) -SOFT_LINK(libxslt, xsltNextImport, xsltStylesheetPtr, (xsltStylesheetPtr style), (style)) -#endif - namespace WebCore { -void XSLTProcessor::genericErrorFunc(void*, const char*, ...) -{ - // It would be nice to do something with this error message. -} - -void XSLTProcessor::parseErrorFunc(void* userData, xmlError* error) -{ - Console* console = static_cast(userData); - if (!console) - return; - - MessageLevel level; - switch (error->level) { - case XML_ERR_NONE: - level = TipMessageLevel; - break; - case XML_ERR_WARNING: - level = WarningMessageLevel; - break; - case XML_ERR_ERROR: - case XML_ERR_FATAL: - default: - level = ErrorMessageLevel; - break; - } - - console->addMessage(XMLMessageSource, LogMessageType, level, error->message, error->line, error->file); -} - -// FIXME: There seems to be no way to control the ctxt pointer for loading here, thus we have globals. -static XSLTProcessor* globalProcessor = 0; -static DocLoader* globalDocLoader = 0; -static xmlDocPtr docLoaderFunc(const xmlChar* uri, - xmlDictPtr, - int options, - void* ctxt, - xsltLoadType type) -{ - if (!globalProcessor) - return 0; - - switch (type) { - case XSLT_LOAD_DOCUMENT: { - xsltTransformContextPtr context = (xsltTransformContextPtr)ctxt; - xmlChar* base = xmlNodeGetBase(context->document->doc, context->node); - KURL url(KURL(ParsedURLString, reinterpret_cast(base)), reinterpret_cast(uri)); - xmlFree(base); - ResourceError error; - ResourceResponse response; - - Vector data; - - bool requestAllowed = globalDocLoader->frame() && globalDocLoader->doc()->securityOrigin()->canRequest(url); - if (requestAllowed) { - globalDocLoader->frame()->loader()->loadResourceSynchronously(url, AllowStoredCredentials, error, response, data); - requestAllowed = globalDocLoader->doc()->securityOrigin()->canRequest(response.url()); - } - if (!requestAllowed) { - data.clear(); - globalDocLoader->printAccessDeniedMessage(url); - } - - Console* console = 0; - if (Frame* frame = globalProcessor->xslStylesheet()->ownerDocument()->frame()) - console = frame->domWindow()->console(); - xmlSetStructuredErrorFunc(console, XSLTProcessor::parseErrorFunc); - xmlSetGenericErrorFunc(console, XSLTProcessor::genericErrorFunc); - - // We don't specify an encoding here. Neither Gecko nor WinIE respects - // the encoding specified in the HTTP headers. - xmlDocPtr doc = xmlReadMemory(data.data(), data.size(), (const char*)uri, 0, options); - - xmlSetStructuredErrorFunc(0, 0); - xmlSetGenericErrorFunc(0, 0); - - return doc; - } - case XSLT_LOAD_STYLESHEET: - return globalProcessor->xslStylesheet()->locateStylesheetSubResource(((xsltStylesheetPtr)ctxt)->doc, uri); - default: - break; - } - - return 0; -} - -static inline void setXSLTLoadCallBack(xsltDocLoaderFunc func, XSLTProcessor* processor, DocLoader* loader) -{ - xsltSetLoaderFunc(func); - globalProcessor = processor; - globalDocLoader = loader; -} - -static int writeToVector(void* context, const char* buffer, int len) -{ - Vector& resultOutput = *static_cast*>(context); - String decodedChunk = String::fromUTF8(buffer, len); - resultOutput.append(decodedChunk.characters(), decodedChunk.length()); - return len; -} - -static bool saveResultToString(xmlDocPtr resultDoc, xsltStylesheetPtr sheet, String& resultString) -{ - xmlOutputBufferPtr outputBuf = xmlAllocOutputBuffer(0); - if (!outputBuf) - return false; - - Vector resultVector; - outputBuf->context = &resultVector; - outputBuf->writecallback = writeToVector; - - int retval = xsltSaveResultTo(outputBuf, resultDoc, sheet); - xmlOutputBufferClose(outputBuf); - if (retval < 0) - return false; - - // Workaround for : libxslt appends an extra line feed to the result. - if (resultVector.size() > 0 && resultVector[resultVector.size() - 1] == '\n') - resultVector.removeLast(); - - resultString = String::adopt(resultVector); - - return true; -} - static inline void transformTextStringToXHTMLDocumentString(String& text) { // Modify the output so that it is a well-formed XHTML document with a
 tag enclosing the text.
@@ -213,38 +61,6 @@ static inline void transformTextStringToXHTMLDocumentString(String& text)
         "\n";
 }
 
-static const char** xsltParamArrayFromParameterMap(XSLTProcessor::ParameterMap& parameters)
-{
-    if (parameters.isEmpty())
-        return 0;
-
-    const char** parameterArray = (const char**)fastMalloc(((parameters.size() * 2) + 1) * sizeof(char*));
-
-    XSLTProcessor::ParameterMap::iterator end = parameters.end();
-    unsigned index = 0;
-    for (XSLTProcessor::ParameterMap::iterator it = parameters.begin(); it != end; ++it) {
-        parameterArray[index++] = strdup(it->first.utf8().data());
-        parameterArray[index++] = strdup(it->second.utf8().data());
-    }
-    parameterArray[index] = 0;
-
-    return parameterArray;
-}
-
-static void freeXsltParamArray(const char** params)
-{
-    const char** temp = params;
-    if (!params)
-        return;
-    
-    while (*temp) {
-        free((void*)*(temp++)); // strdup returns malloc'd blocks, so we have to use free() here
-        free((void*)*(temp++));
-    }
-    fastFree(params);
-}
-
-
 PassRefPtr XSLTProcessor::createDocumentFromSource(const String& sourceString,
     const String& sourceEncoding, const String& sourceMIMEType, Node* sourceNode, Frame* frame)
 {
@@ -258,7 +74,7 @@ PassRefPtr XSLTProcessor::createDocumentFromSource(const String& sourc
         transformTextStringToXHTMLDocumentString(documentSource);
     } else
         result = ownerDocument->implementation()->createDocument(sourceMIMEType, frame, false);
-    
+
     // Before parsing, we need to save & detach the old document and get the new document
     // in place. We have to do this only if we're rendering the result document.
     if (frame) {
@@ -267,15 +83,15 @@ PassRefPtr XSLTProcessor::createDocumentFromSource(const String& sourc
         result->setTransformSourceDocument(frame->document());
         frame->setDocument(result);
     }
-    
+
     if (sourceIsDocument)
         result->setURL(ownerDocument->url());
     result->open();
-    
+
     RefPtr decoder = TextResourceDecoder::create(sourceMIMEType);
     decoder->setEncoding(sourceEncoding.isEmpty() ? UTF8Encoding() : TextEncoding(sourceEncoding), TextResourceDecoder::EncodingFromXMLHeader);
     result->setDecoder(decoder.release());
-    
+
     result->write(documentSource);
     result->finishParsing();
     result->close();
@@ -286,7 +102,7 @@ PassRefPtr XSLTProcessor::createDocumentFromSource(const String& sourc
 static inline RefPtr createFragmentFromSource(const String& sourceString, const String& sourceMIMEType, Document* outputDoc)
 {
     RefPtr fragment = DocumentFragment::create(outputDoc);
-    
+
     if (sourceMIMEType == "text/html")
         parseHTMLDocumentFragment(sourceString, fragment.get());
     else if (sourceMIMEType == "text/plain")
@@ -296,118 +112,10 @@ static inline RefPtr createFragmentFromSource(const String& so
         if (!successfulParse)
             return 0;
     }
-    
-    // FIXME: Do we need to mess with URLs here?
-        
-    return fragment;
-}
-
-static xsltStylesheetPtr xsltStylesheetPointer(RefPtr& cachedStylesheet, Node* stylesheetRootNode)
-{
-    if (!cachedStylesheet && stylesheetRootNode) {
-        cachedStylesheet = XSLStyleSheet::create(stylesheetRootNode->parent() ? stylesheetRootNode->parent() : stylesheetRootNode,
-            stylesheetRootNode->document()->url().string());
-        cachedStylesheet->parseString(createMarkup(stylesheetRootNode));
-    }
-    
-    if (!cachedStylesheet || !cachedStylesheet->document())
-        return 0;
-    
-    return cachedStylesheet->compileStyleSheet();
-}
 
-static inline xmlDocPtr xmlDocPtrFromNode(Node* sourceNode, bool& shouldDelete)
-{
-    RefPtr ownerDocument = sourceNode->document();
-    bool sourceIsDocument = (sourceNode == ownerDocument.get());
-    
-    xmlDocPtr sourceDoc = 0;
-    if (sourceIsDocument)
-        sourceDoc = (xmlDocPtr)ownerDocument->transformSource();
-    if (!sourceDoc) {
-        sourceDoc = (xmlDocPtr)xmlDocPtrForString(ownerDocument->docLoader(), createMarkup(sourceNode),
-            sourceIsDocument ? ownerDocument->url().string() : String());
-        shouldDelete = (sourceDoc != 0);
-    }
-    return sourceDoc;
-}
-
-static inline String resultMIMEType(xmlDocPtr resultDoc, xsltStylesheetPtr sheet)
-{
-    // There are three types of output we need to be able to deal with:
-    // HTML (create an HTML document), XML (create an XML document),
-    // and text (wrap in a 
 and create an XML document).
-
-    const xmlChar* resultType = 0;
-    XSLT_GET_IMPORT_PTR(resultType, sheet, method);
-    if (resultType == 0 && resultDoc->type == XML_HTML_DOCUMENT_NODE)
-        resultType = (const xmlChar*)"html";
-    
-    if (xmlStrEqual(resultType, (const xmlChar*)"html"))
-        return "text/html";
-    else if (xmlStrEqual(resultType, (const xmlChar*)"text"))
-        return "text/plain";
-        
-    return "application/xml";
-}
-
-bool XSLTProcessor::transformToString(Node* sourceNode, String& mimeType, String& resultString, String& resultEncoding)
-{
-    RefPtr ownerDocument = sourceNode->document();
-    
-    setXSLTLoadCallBack(docLoaderFunc, this, ownerDocument->docLoader());
-    xsltStylesheetPtr sheet = xsltStylesheetPointer(m_stylesheet, m_stylesheetRootNode.get());
-    if (!sheet) {
-        setXSLTLoadCallBack(0, 0, 0);
-        return false;
-    }
-    m_stylesheet->clearDocuments();
-
-    xmlChar* origMethod = sheet->method;
-    if (!origMethod && mimeType == "text/html")
-        sheet->method = (xmlChar*)"html";
-
-    bool success = false;
-    bool shouldFreeSourceDoc = false;
-    if (xmlDocPtr sourceDoc = xmlDocPtrFromNode(sourceNode, shouldFreeSourceDoc)) {
-        // The XML declaration would prevent parsing the result as a fragment, and it's not needed even for documents, 
-        // as the result of this function is always immediately parsed.
-        sheet->omitXmlDeclaration = true;
-
-        xsltTransformContextPtr transformContext = xsltNewTransformContext(sheet, sourceDoc);
-        registerXSLTExtensions(transformContext);
-
-        // : XSLT processor  algorithm only compares by code point
-        xsltSetCtxtSortFunc(transformContext, xsltUnicodeSortFunction);
-
-        // This is a workaround for a bug in libxslt. 
-        // The bug has been fixed in version 1.1.13, so once we ship that this can be removed.
-        if (transformContext->globalVars == NULL)
-           transformContext->globalVars = xmlHashCreate(20);
-
-        const char** params = xsltParamArrayFromParameterMap(m_parameters);
-        xsltQuoteUserParams(transformContext, params);
-        xmlDocPtr resultDoc = xsltApplyStylesheetUser(sheet, sourceDoc, 0, 0, 0, transformContext);
-        
-        xsltFreeTransformContext(transformContext);        
-        freeXsltParamArray(params);
-        
-        if (shouldFreeSourceDoc)
-            xmlFreeDoc(sourceDoc);
-        
-        if (success = saveResultToString(resultDoc, sheet, resultString)) {
-            mimeType = resultMIMEType(resultDoc, sheet);
-            resultEncoding = (char*)resultDoc->encoding;
-        }
-        xmlFreeDoc(resultDoc);
-    }
-    
-    sheet->method = origMethod;
-    setXSLTLoadCallBack(0, 0, 0);
-    xsltFreeStylesheet(sheet);
-    m_stylesheet = 0;
+    // FIXME: Do we need to mess with URLs here?
 
-    return success;
+    return fragment;
 }
 
 PassRefPtr XSLTProcessor::transformToDocument(Node* sourceNode)
@@ -429,7 +137,7 @@ PassRefPtr XSLTProcessor::transformToFragment(Node* sourceNode
     // If the output document is HTML, default to HTML method.
     if (outputDoc->isHTMLDocument())
         resultMIMEType = "text/html";
-    
+
     if (!transformToString(sourceNode, resultMIMEType, resultString, resultEncoding))
         return 0;
     return createFragmentFromSource(resultString, resultMIMEType, outputDoc);
@@ -455,6 +163,13 @@ void XSLTProcessor::removeParameter(const String& /*namespaceURI*/, const String
     m_parameters.remove(localName);
 }
 
+void XSLTProcessor::reset()
+{
+    m_stylesheet.clear();
+    m_stylesheetRootNode.clear();
+    m_parameters.clear();
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(XSLT)
diff --git a/src/3rdparty/webkit/WebCore/xml/XSLTProcessor.h b/src/3rdparty/webkit/WebCore/xml/XSLTProcessor.h
index 9ee2aad..9b91017 100644
--- a/src/3rdparty/webkit/WebCore/xml/XSLTProcessor.h
+++ b/src/3rdparty/webkit/WebCore/xml/XSLTProcessor.h
@@ -28,9 +28,12 @@
 #include "Node.h"
 #include "StringHash.h"
 #include "XSLStyleSheet.h"
+#include 
+
+#if !USE(QXMLQUERY)
 #include 
 #include 
-#include 
+#endif
 
 namespace WebCore {
 
@@ -56,14 +59,15 @@ public:
     void removeParameter(const String& namespaceURI, const String& localName);
     void clearParameters() { m_parameters.clear(); }
 
-    void reset() { m_stylesheet.clear(); m_stylesheetRootNode.clear();  m_parameters.clear(); }
+    void reset();
 
+#if !USE(QXMLQUERY)
     static void parseErrorFunc(void* userData, xmlError*);
     static void genericErrorFunc(void* userData, const char* msg, ...);
     
-public:
     // Only for libXSLT callbacks
     XSLStyleSheet* xslStylesheet() const { return m_stylesheet.get(); }
+#endif
 
     typedef HashMap ParameterMap;
 
diff --git a/src/3rdparty/webkit/WebCore/xml/XSLTProcessorLibxslt.cpp b/src/3rdparty/webkit/WebCore/xml/XSLTProcessorLibxslt.cpp
new file mode 100644
index 0000000..200c56b
--- /dev/null
+++ b/src/3rdparty/webkit/WebCore/xml/XSLTProcessorLibxslt.cpp
@@ -0,0 +1,335 @@
+/*
+ * This file is part of the XSL implementation.
+ *
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple, Inc. All rights reserved.
+ * Copyright (C) 2005, 2006 Alexey Proskuryakov 
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+
+#if ENABLE(XSLT)
+
+#include "XSLTProcessor.h"
+
+#include "Console.h"
+#include "CString.h"
+#include "DOMWindow.h"
+#include "DocLoader.h"
+#include "Frame.h"
+#include "ResourceError.h"
+#include "ResourceHandle.h"
+#include "ResourceRequest.h"
+#include "ResourceResponse.h"
+#include "TransformSource.h"
+#include "XMLTokenizer.h"
+#include "XSLStyleSheet.h"
+#include "XSLTExtensions.h"
+#include "XSLTUnicodeSort.h"
+#include "loader.h"
+#include "markup.h"
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#if PLATFORM(MAC)
+#include "SoftLinking.h"
+
+SOFT_LINK_LIBRARY(libxslt);
+SOFT_LINK(libxslt, xsltFreeStylesheet, void, (xsltStylesheetPtr sheet), (sheet))
+SOFT_LINK(libxslt, xsltFreeTransformContext, void, (xsltTransformContextPtr ctxt), (ctxt))
+SOFT_LINK(libxslt, xsltNewTransformContext, xsltTransformContextPtr, (xsltStylesheetPtr style, xmlDocPtr doc), (style, doc))
+SOFT_LINK(libxslt, xsltApplyStylesheetUser, xmlDocPtr, (xsltStylesheetPtr style, xmlDocPtr doc, const char** params, const char* output, FILE* profile, xsltTransformContextPtr userCtxt), (style, doc, params, output, profile, userCtxt))
+SOFT_LINK(libxslt, xsltQuoteUserParams, int, (xsltTransformContextPtr ctxt, const char** params), (ctxt, params))
+SOFT_LINK(libxslt, xsltSetCtxtSortFunc, void, (xsltTransformContextPtr ctxt, xsltSortFunc handler), (ctxt, handler))
+SOFT_LINK(libxslt, xsltSetLoaderFunc, void, (xsltDocLoaderFunc f), (f))
+SOFT_LINK(libxslt, xsltSaveResultTo, int, (xmlOutputBufferPtr buf, xmlDocPtr result, xsltStylesheetPtr style), (buf, result, style))
+SOFT_LINK(libxslt, xsltNextImport, xsltStylesheetPtr, (xsltStylesheetPtr style), (style))
+#endif
+
+namespace WebCore {
+
+void XSLTProcessor::genericErrorFunc(void*, const char*, ...)
+{
+    // It would be nice to do something with this error message.
+}
+
+void XSLTProcessor::parseErrorFunc(void* userData, xmlError* error)
+{
+    Console* console = static_cast(userData);
+    if (!console)
+        return;
+
+    MessageLevel level;
+    switch (error->level) {
+    case XML_ERR_NONE:
+        level = TipMessageLevel;
+        break;
+    case XML_ERR_WARNING:
+        level = WarningMessageLevel;
+        break;
+    case XML_ERR_ERROR:
+    case XML_ERR_FATAL:
+    default:
+        level = ErrorMessageLevel;
+        break;
+    }
+
+    console->addMessage(XMLMessageSource, LogMessageType, level, error->message, error->line, error->file);
+}
+
+// FIXME: There seems to be no way to control the ctxt pointer for loading here, thus we have globals.
+static XSLTProcessor* globalProcessor = 0;
+static DocLoader* globalDocLoader = 0;
+static xmlDocPtr docLoaderFunc(const xmlChar* uri,
+                                    xmlDictPtr,
+                                    int options,
+                                    void* ctxt,
+                                    xsltLoadType type)
+{
+    if (!globalProcessor)
+        return 0;
+
+    switch (type) {
+    case XSLT_LOAD_DOCUMENT: {
+        xsltTransformContextPtr context = (xsltTransformContextPtr)ctxt;
+        xmlChar* base = xmlNodeGetBase(context->document->doc, context->node);
+        KURL url(KURL(ParsedURLString, reinterpret_cast(base)), reinterpret_cast(uri));
+        xmlFree(base);
+        ResourceError error;
+        ResourceResponse response;
+
+        Vector data;
+
+        bool requestAllowed = globalDocLoader->frame() && globalDocLoader->doc()->securityOrigin()->canRequest(url);
+        if (requestAllowed) {
+            globalDocLoader->frame()->loader()->loadResourceSynchronously(url, AllowStoredCredentials, error, response, data);
+            requestAllowed = globalDocLoader->doc()->securityOrigin()->canRequest(response.url());
+        }
+        if (!requestAllowed) {
+            data.clear();
+            globalDocLoader->printAccessDeniedMessage(url);
+        }
+
+        Console* console = 0;
+        if (Frame* frame = globalProcessor->xslStylesheet()->ownerDocument()->frame())
+            console = frame->domWindow()->console();
+        xmlSetStructuredErrorFunc(console, XSLTProcessor::parseErrorFunc);
+        xmlSetGenericErrorFunc(console, XSLTProcessor::genericErrorFunc);
+
+        // We don't specify an encoding here. Neither Gecko nor WinIE respects
+        // the encoding specified in the HTTP headers.
+        xmlDocPtr doc = xmlReadMemory(data.data(), data.size(), (const char*)uri, 0, options);
+
+        xmlSetStructuredErrorFunc(0, 0);
+        xmlSetGenericErrorFunc(0, 0);
+
+        return doc;
+    }
+    case XSLT_LOAD_STYLESHEET:
+        return globalProcessor->xslStylesheet()->locateStylesheetSubResource(((xsltStylesheetPtr)ctxt)->doc, uri);
+    default:
+        break;
+    }
+
+    return 0;
+}
+
+static inline void setXSLTLoadCallBack(xsltDocLoaderFunc func, XSLTProcessor* processor, DocLoader* loader)
+{
+    xsltSetLoaderFunc(func);
+    globalProcessor = processor;
+    globalDocLoader = loader;
+}
+
+static int writeToVector(void* context, const char* buffer, int len)
+{
+    Vector& resultOutput = *static_cast*>(context);
+    String decodedChunk = String::fromUTF8(buffer, len);
+    resultOutput.append(decodedChunk.characters(), decodedChunk.length());
+    return len;
+}
+
+static bool saveResultToString(xmlDocPtr resultDoc, xsltStylesheetPtr sheet, String& resultString)
+{
+    xmlOutputBufferPtr outputBuf = xmlAllocOutputBuffer(0);
+    if (!outputBuf)
+        return false;
+
+    Vector resultVector;
+    outputBuf->context = &resultVector;
+    outputBuf->writecallback = writeToVector;
+
+    int retval = xsltSaveResultTo(outputBuf, resultDoc, sheet);
+    xmlOutputBufferClose(outputBuf);
+    if (retval < 0)
+        return false;
+
+    // Workaround for : libxslt appends an extra line feed to the result.
+    if (resultVector.size() > 0 && resultVector[resultVector.size() - 1] == '\n')
+        resultVector.removeLast();
+
+    resultString = String::adopt(resultVector);
+
+    return true;
+}
+
+static const char** xsltParamArrayFromParameterMap(XSLTProcessor::ParameterMap& parameters)
+{
+    if (parameters.isEmpty())
+        return 0;
+
+    const char** parameterArray = (const char**)fastMalloc(((parameters.size() * 2) + 1) * sizeof(char*));
+
+    XSLTProcessor::ParameterMap::iterator end = parameters.end();
+    unsigned index = 0;
+    for (XSLTProcessor::ParameterMap::iterator it = parameters.begin(); it != end; ++it) {
+        parameterArray[index++] = strdup(it->first.utf8().data());
+        parameterArray[index++] = strdup(it->second.utf8().data());
+    }
+    parameterArray[index] = 0;
+
+    return parameterArray;
+}
+
+static void freeXsltParamArray(const char** params)
+{
+    const char** temp = params;
+    if (!params)
+        return;
+
+    while (*temp) {
+        free((void*)*(temp++)); // strdup returns malloc'd blocks, so we have to use free() here
+        free((void*)*(temp++));
+    }
+    fastFree(params);
+}
+
+static xsltStylesheetPtr xsltStylesheetPointer(RefPtr& cachedStylesheet, Node* stylesheetRootNode)
+{
+    if (!cachedStylesheet && stylesheetRootNode) {
+        cachedStylesheet = XSLStyleSheet::create(stylesheetRootNode->parent() ? stylesheetRootNode->parent() : stylesheetRootNode,
+            stylesheetRootNode->document()->url().string());
+        cachedStylesheet->parseString(createMarkup(stylesheetRootNode));
+    }
+
+    if (!cachedStylesheet || !cachedStylesheet->document())
+        return 0;
+
+    return cachedStylesheet->compileStyleSheet();
+}
+
+static inline xmlDocPtr xmlDocPtrFromNode(Node* sourceNode, bool& shouldDelete)
+{
+    RefPtr ownerDocument = sourceNode->document();
+    bool sourceIsDocument = (sourceNode == ownerDocument.get());
+
+    xmlDocPtr sourceDoc = 0;
+    if (sourceIsDocument && ownerDocument->transformSource())
+        sourceDoc = (xmlDocPtr)ownerDocument->transformSource()->platformSource();
+    if (!sourceDoc) {
+        sourceDoc = (xmlDocPtr)xmlDocPtrForString(ownerDocument->docLoader(), createMarkup(sourceNode),
+            sourceIsDocument ? ownerDocument->url().string() : String());
+        shouldDelete = sourceDoc;
+    }
+    return sourceDoc;
+}
+
+static inline String resultMIMEType(xmlDocPtr resultDoc, xsltStylesheetPtr sheet)
+{
+    // There are three types of output we need to be able to deal with:
+    // HTML (create an HTML document), XML (create an XML document),
+    // and text (wrap in a 
 and create an XML document).
+
+    const xmlChar* resultType = 0;
+    XSLT_GET_IMPORT_PTR(resultType, sheet, method);
+    if (!resultType && resultDoc->type == XML_HTML_DOCUMENT_NODE)
+        resultType = (const xmlChar*)"html";
+
+    if (xmlStrEqual(resultType, (const xmlChar*)"html"))
+        return "text/html";
+    if (xmlStrEqual(resultType, (const xmlChar*)"text"))
+        return "text/plain";
+
+    return "application/xml";
+}
+
+bool XSLTProcessor::transformToString(Node* sourceNode, String& mimeType, String& resultString, String& resultEncoding)
+{
+    RefPtr ownerDocument = sourceNode->document();
+
+    setXSLTLoadCallBack(docLoaderFunc, this, ownerDocument->docLoader());
+    xsltStylesheetPtr sheet = xsltStylesheetPointer(m_stylesheet, m_stylesheetRootNode.get());
+    if (!sheet) {
+        setXSLTLoadCallBack(0, 0, 0);
+        return false;
+    }
+    m_stylesheet->clearDocuments();
+
+    xmlChar* origMethod = sheet->method;
+    if (!origMethod && mimeType == "text/html")
+        sheet->method = (xmlChar*)"html";
+
+    bool success = false;
+    bool shouldFreeSourceDoc = false;
+    if (xmlDocPtr sourceDoc = xmlDocPtrFromNode(sourceNode, shouldFreeSourceDoc)) {
+        // The XML declaration would prevent parsing the result as a fragment, and it's not needed even for documents,
+        // as the result of this function is always immediately parsed.
+        sheet->omitXmlDeclaration = true;
+
+        xsltTransformContextPtr transformContext = xsltNewTransformContext(sheet, sourceDoc);
+        registerXSLTExtensions(transformContext);
+
+        // : XSLT processor  algorithm only compares by code point
+        xsltSetCtxtSortFunc(transformContext, xsltUnicodeSortFunction);
+
+        // This is a workaround for a bug in libxslt.
+        // The bug has been fixed in version 1.1.13, so once we ship that this can be removed.
+        if (!transformContext->globalVars)
+           transformContext->globalVars = xmlHashCreate(20);
+
+        const char** params = xsltParamArrayFromParameterMap(m_parameters);
+        xsltQuoteUserParams(transformContext, params);
+        xmlDocPtr resultDoc = xsltApplyStylesheetUser(sheet, sourceDoc, 0, 0, 0, transformContext);
+
+        xsltFreeTransformContext(transformContext);
+        freeXsltParamArray(params);
+
+        if (shouldFreeSourceDoc)
+            xmlFreeDoc(sourceDoc);
+
+        if (success = saveResultToString(resultDoc, sheet, resultString)) {
+            mimeType = resultMIMEType(resultDoc, sheet);
+            resultEncoding = (char*)resultDoc->encoding;
+        }
+        xmlFreeDoc(resultDoc);
+    }
+
+    sheet->method = origMethod;
+    setXSLTLoadCallBack(0, 0, 0);
+    xsltFreeStylesheet(sheet);
+    m_stylesheet = 0;
+
+    return success;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(XSLT)
diff --git a/src/3rdparty/webkit/WebCore/xml/XSLTProcessorQt.cpp b/src/3rdparty/webkit/WebCore/xml/XSLTProcessorQt.cpp
new file mode 100644
index 0000000..523306a
--- /dev/null
+++ b/src/3rdparty/webkit/WebCore/xml/XSLTProcessorQt.cpp
@@ -0,0 +1,149 @@
+/*
+ * This file is part of the XSL implementation.
+ *
+ * Copyright (C) 2009 Jakub Wieczorek 
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+
+#if ENABLE(XSLT)
+
+#include "XSLTProcessor.h"
+
+#include "Console.h"
+#include "DOMWindow.h"
+#include "Frame.h"
+#include "TransformSource.h"
+#include "loader.h"
+#include "markup.h"
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+namespace WebCore {
+
+class XSLTMessageHandler : public QAbstractMessageHandler {
+
+public:
+    XSLTMessageHandler(Document* document = 0);
+    virtual void handleMessage(QtMsgType type, const QString& description,
+                               const QUrl& identifier, const QSourceLocation& sourceLocation);
+
+private:
+    Document* m_document;
+};
+
+XSLTMessageHandler::XSLTMessageHandler(Document* document)
+    : QAbstractMessageHandler()
+    , m_document(document)
+{
+}
+
+void XSLTMessageHandler::handleMessage(QtMsgType type, const QString& description,
+                                       const QUrl& identifier, const QSourceLocation& sourceLocation)
+{
+    if (!m_document->frame())
+        return;
+
+    MessageLevel level;
+    switch (type) {
+    case QtDebugMsg:
+        level = TipMessageLevel;
+        break;
+    case QtWarningMsg:
+        level = WarningMessageLevel;
+        break;
+    case QtCriticalMsg:
+    case QtFatalMsg:
+        level = ErrorMessageLevel;
+        break;
+    default:
+        level = LogMessageLevel;
+        break;
+    }
+
+    Console* console = m_document->frame()->domWindow()->console();
+    console->addMessage(XMLMessageSource, LogMessageType, level, description,
+                        sourceLocation.line(), sourceLocation.uri().toString());
+}
+
+bool XSLTProcessor::transformToString(Node* sourceNode, String& mimeType, String& resultString, String& resultEncoding)
+{
+    bool success = false;
+
+    RefPtr stylesheet = m_stylesheet;
+    if (!stylesheet && m_stylesheetRootNode) {
+        Node* node = m_stylesheetRootNode.get();
+        stylesheet = XSLStyleSheet::create(node->parent() ? node->parent() : node, node->document()->url().string());
+        stylesheet->parseString(createMarkup(node));
+    }
+
+    if (!stylesheet || stylesheet->sheetString().isEmpty())
+        return success;
+
+    RefPtr ownerDocument = sourceNode->document();
+    bool sourceIsDocument = (sourceNode == ownerDocument.get());
+
+    QXmlQuery query(QXmlQuery::XSLT20);
+
+    XSLTMessageHandler messageHandler(ownerDocument.get());
+    query.setMessageHandler(&messageHandler);
+
+    XSLTProcessor::ParameterMap::iterator end = m_parameters.end();
+    for (XSLTProcessor::ParameterMap::iterator it = m_parameters.begin(); it != end; ++it)
+        query.bindVariable(QString(it->first), QXmlItem(QVariant(it->second)));
+
+    QString source;
+    if (sourceIsDocument && ownerDocument->transformSource())
+        source = ownerDocument->transformSource()->platformSource();
+    if (!sourceIsDocument || source.isEmpty())
+        source = createMarkup(sourceNode);
+
+    QBuffer inputBuffer;
+    QBuffer styleSheetBuffer;
+    QBuffer outputBuffer;
+
+    inputBuffer.setData(source.toUtf8());
+    styleSheetBuffer.setData(QString(stylesheet->sheetString()).toUtf8());
+
+    inputBuffer.open(QIODevice::ReadOnly);
+    styleSheetBuffer.open(QIODevice::ReadOnly);
+    outputBuffer.open(QIODevice::ReadWrite);
+
+    query.setFocus(&inputBuffer);
+    query.setQuery(&styleSheetBuffer, QUrl(stylesheet->href()));
+    success = query.evaluateTo(&outputBuffer);
+    outputBuffer.reset();
+    resultString = QString::fromUtf8(outputBuffer.readAll()).trimmed();
+
+    if (m_stylesheet) {
+        m_stylesheet->clearDocuments();
+        m_stylesheet = 0;
+    }
+
+    return success;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(XSLT)
diff --git a/src/3rdparty/webkit/WebKit/ChangeLog b/src/3rdparty/webkit/WebKit/ChangeLog
index 7d55d82..2f8f18f 100644
--- a/src/3rdparty/webkit/WebKit/ChangeLog
+++ b/src/3rdparty/webkit/WebKit/ChangeLog
@@ -1,3 +1,23 @@
+2009-09-29  Brady Eidson  
+
+        Reviewed by John Sullivan.
+
+        WebKit Mac API should provide a delegate interface for global history.
+         and https://webkit.org/b/29904
+
+        * WebKit.xcodeproj/project.pbxproj:
+
+2009-09-28  Yaar Schnitman  
+
+        Reviewed by Dimitri Glazkov.
+
+        https://bugs.webkit.org/show_bug.cgi?id=29722
+
+        * chromium/DEPS: Describes the chromium port's dependencies and
+          is used by gclient to fetch them.
+        * chromium/webkit.gyp: Currently only builds webcore but in
+          the future will also build the webkit api.
+
 2009-09-26  David Kilzer  
 
         Part 2 of 2:  DerivedSources.make broken for non-Mac targets
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
index 45a38c6..4b6248a 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
@@ -1491,11 +1491,10 @@ QWebPage::QWebPage(QObject *parent)
 */
 QWebPage::~QWebPage()
 {
-    if (d->mainFrame) {
-        FrameLoader *loader = d->mainFrame->d->frame->loader();
-        if (loader)
-            loader->detachFromParent();
-    }
+    d->createMainFrame();
+    FrameLoader *loader = d->mainFrame->d->frame->loader();
+    if (loader)
+        loader->detachFromParent();
     if (d->inspector)
         d->inspector->setPage(0);
     delete d;
@@ -1936,6 +1935,7 @@ bool QWebPage::acceptNavigationRequest(QWebFrame *frame, const QWebNetworkReques
 */
 QString QWebPage::selectedText() const
 {
+    d->createMainFrame();
     return d->page->focusController()->focusedOrMainFrame()->selectedText();
 }
 
@@ -2491,6 +2491,7 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
         }
     }
 
+    d->createMainFrame();
     WebCore::Frame* focusedFrame = d->page->focusController()->focusedOrMainFrame();
     HitTestResult result = focusedFrame->eventHandler()->hitTestResultAtPoint(focusedFrame->view()->windowToContents(pos), /*allowShadowContent*/ false);
 
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h
index aecd860..b024997 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h
@@ -25,12 +25,12 @@
 #include "qwebkitglobal.h"
 
 #include 
+#include 
 #include 
 
 QT_BEGIN_NAMESPACE
 class QNetworkProxy;
 class QUndoStack;
-class QUrl;
 class QMenu;
 class QNetworkRequest;
 class QNetworkReply;
@@ -266,7 +266,8 @@ public:
     QMenu *createStandardContextMenu();
 
     enum Extension {
-        ChooseMultipleFilesExtension
+        ChooseMultipleFilesExtension,
+        ErrorPageExtension
     };
     class ExtensionOption
     {};
@@ -284,6 +285,24 @@ public:
         QStringList fileNames;
     };
 
+    enum ErrorDomain { QtNetwork, Http, WebKit };
+    class ErrorPageExtensionOption : public ExtensionOption {
+    public:
+        ErrorDomain domain;
+        int error;
+        QString errorString;
+    };
+
+    class ErrorPageExtensionReturn : public ExtensionReturn {
+    public:
+        ErrorPageExtensionReturn() : contentType(QLatin1String("text/html")), encoding(QLatin1String("utf-8")) {};
+        QString contentType;
+        QString encoding;
+        QUrl baseUrl;
+        QByteArray content;
+    };
+
+
     virtual bool extension(Extension extension, const ExtensionOption *option = 0, ExtensionReturn *output = 0);
     virtual bool supportsExtension(Extension extension) const;
 
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp
index 5f74f36..eedf7d1 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp
@@ -356,8 +356,8 @@ QWebSettings::QWebSettings()
     // Initialize our global defaults
     d->fontSizes.insert(QWebSettings::MinimumFontSize, 0);
     d->fontSizes.insert(QWebSettings::MinimumLogicalFontSize, 0);
-    d->fontSizes.insert(QWebSettings::DefaultFontSize, 14);
-    d->fontSizes.insert(QWebSettings::DefaultFixedFontSize, 14);
+    d->fontSizes.insert(QWebSettings::DefaultFontSize, 16);
+    d->fontSizes.insert(QWebSettings::DefaultFixedFontSize, 13);
     d->fontFamilies.insert(QWebSettings::StandardFont, QLatin1String("Arial"));
     d->fontFamilies.insert(QWebSettings::FixedFont, QLatin1String("Courier New"));
     d->fontFamilies.insert(QWebSettings::SerifFont, QLatin1String("Times New Roman"));
diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog
index a8b5c38..b252d8c 100644
--- a/src/3rdparty/webkit/WebKit/qt/ChangeLog
+++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog
@@ -1,3 +1,76 @@
+2009-09-29  Andras Becsi  
+
+        Reviewed by Tor Arne Vestbø.
+
+        [Qt] Default font size reconciliation to 16px/13px to match other platform's de-facto standard.
+        This fixes https://bugs.webkit.org/show_bug.cgi?id=19674.
+
+        * Api/qwebsettings.cpp:
+        (QWebSettings::QWebSettings):
+
+2009-09-29  Jedrzej Nowacki  
+
+        Reviewed by Simon Hausmann.
+
+        https://bugs.webkit.org/show_bug.cgi?id=29844
+
+        QWebPage dependency autotest fix.
+
+        Fix for database() autotest. All opened databases should be removed at
+        end of test.
+
+        * tests/qwebpage/tst_qwebpage.cpp:
+        (tst_QWebPage::database):
+
+2009-09-29  Jedrzej Nowacki  
+
+        Reviewed by Simon Hausmann.
+
+        Some QWebHistory and QWebPage autotest crash fixes.
+
+        Some checking for m_mainFrame were added. MainFrame should be created
+        at some point of QWebPage live cicle.
+
+        https://bugs.webkit.org/show_bug.cgi?id=29803
+
+        * Api/qwebpage.cpp:
+        (QWebPage::~QWebPage):
+        (QWebPage::currentFrame):
+        (QWebPage::history):
+        (QWebPage::selectedText):
+        (QWebPage::updatePositionDependentActions):
+        * tests/qwebpage/tst_qwebpage.cpp:
+        (tst_QWebPage::crashTests_LazyInitializationOfMainFrame):
+
+2009-09-29  Kenneth Rohde Christiansen  
+
+        Reviewed by Simon Hausmann and Tor Arne Vestbø.
+
+        Implement QWebPage Extension for error pages, incl.
+        an example on how to use it in QtLauncher.
+
+        Correct our use of ResourceError.
+
+        * Api/qwebpage.h:
+        (ExtensionOption::):
+        (ExtensionOption::ErrorPageExtensionReturn::ErrorPageExtensionReturn):
+        * QtLauncher/main.cpp:
+        (WebPage::supportsExtension):
+        (MainWindow::MainWindow):
+        (MainWindow::selectElements):
+        (WebPage::extension):
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::cancelledError):
+        (WebCore::FrameLoaderClientQt::blockedError):
+        (WebCore::FrameLoaderClientQt::cannotShowURLError):
+        (WebCore::FrameLoaderClientQt::interruptForPolicyChangeError):
+        (WebCore::FrameLoaderClientQt::cannotShowMIMETypeError):
+        (WebCore::FrameLoaderClientQt::fileDoesNotExistError):
+        (WebCore::FrameLoaderClientQt::callErrorPageExtension):
+        (WebCore::FrameLoaderClientQt::dispatchDidFailProvisionalLoad):
+        (WebCore::FrameLoaderClientQt::dispatchDidFailLoad):
+        * WebCoreSupport/FrameLoaderClientQt.h:
+
 2009-09-28  Andre Poenitz  
 
         Reviewed by Simon Hausmann.
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index 0c636f6..67d974c 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -702,8 +702,10 @@ void FrameLoaderClientQt::committedLoad(WebCore::DocumentLoader* loader, const c
 
 WebCore::ResourceError FrameLoaderClientQt::cancelledError(const WebCore::ResourceRequest& request)
 {
-    return ResourceError("Error", -999, request.url().prettyURL(),
+    ResourceError error = ResourceError("QtNetwork", QNetworkReply::OperationCanceledError, request.url().prettyURL(),
             QCoreApplication::translate("QWebFrame", "Request cancelled", 0, QCoreApplication::UnicodeUTF8));
+    error.setIsCancellation(true);
+    return error;
 }
 
 // copied from WebKit/Misc/WebKitErrors[Private].h
@@ -719,32 +721,32 @@ enum {
 
 WebCore::ResourceError FrameLoaderClientQt::blockedError(const WebCore::ResourceRequest& request)
 {
-    return ResourceError("Error", WebKitErrorCannotUseRestrictedPort, request.url().prettyURL(),
+    return ResourceError("WebKit", WebKitErrorCannotUseRestrictedPort, request.url().prettyURL(),
             QCoreApplication::translate("QWebFrame", "Request blocked", 0, QCoreApplication::UnicodeUTF8));
 }
 
 
 WebCore::ResourceError FrameLoaderClientQt::cannotShowURLError(const WebCore::ResourceRequest& request)
 {
-    return ResourceError("Error", WebKitErrorCannotShowURL, request.url().string(),
+    return ResourceError("WebKit", WebKitErrorCannotShowURL, request.url().string(),
             QCoreApplication::translate("QWebFrame", "Cannot show URL", 0, QCoreApplication::UnicodeUTF8));
 }
 
 WebCore::ResourceError FrameLoaderClientQt::interruptForPolicyChangeError(const WebCore::ResourceRequest& request)
 {
-    return ResourceError("Error", WebKitErrorFrameLoadInterruptedByPolicyChange, request.url().string(),
+    return ResourceError("WebKit", WebKitErrorFrameLoadInterruptedByPolicyChange, request.url().string(),
             QCoreApplication::translate("QWebFrame", "Frame load interrupted by policy change", 0, QCoreApplication::UnicodeUTF8));
 }
 
 WebCore::ResourceError FrameLoaderClientQt::cannotShowMIMETypeError(const WebCore::ResourceResponse& response)
 {
-    return ResourceError("Error", WebKitErrorCannotShowMIMEType, response.url().string(),
+    return ResourceError("WebKit", WebKitErrorCannotShowMIMEType, response.url().string(),
             QCoreApplication::translate("QWebFrame", "Cannot show mimetype", 0, QCoreApplication::UnicodeUTF8));
 }
 
 WebCore::ResourceError FrameLoaderClientQt::fileDoesNotExistError(const WebCore::ResourceResponse& response)
 {
-    return ResourceError("Error", -998 /* ### */, response.url().string(),
+    return ResourceError("QtNetwork", QNetworkReply::ContentNotFoundError, response.url().string(),
             QCoreApplication::translate("QWebFrame", "File does not exist", 0, QCoreApplication::UnicodeUTF8));
 }
 
@@ -860,12 +862,46 @@ void FrameLoaderClientQt::dispatchDidLoadResourceByXMLHttpRequest(unsigned long,
     notImplemented();
 }
 
+void FrameLoaderClientQt::callErrorPageExtension(const WebCore::ResourceError& error)
+{
+    QWebPage* page = m_webFrame->page();
+    if (page->supportsExtension(QWebPage::ErrorPageExtension)) {
+        QWebPage::ErrorPageExtensionOption option;
+
+        if (error.domain() == "QtNetwork")
+            option.domain = QWebPage::QtNetwork;
+        else if (error.domain() == "HTTP")
+            option.domain = QWebPage::Http;
+        else if (error.domain() == "WebKit")
+            option.domain = QWebPage::WebKit;
+        else
+            return;
+
+        option.error = error.errorCode();
+        option.errorString = error.localizedDescription();
+
+        QWebPage::ErrorPageExtensionReturn output;
+        if (!page->extension(QWebPage::ErrorPageExtension, &option, &output))
+            return;
+
+        KURL baseUrl(output.baseUrl);
+        KURL failingUrl(QUrl(error.failingURL()));
+
+        WebCore::ResourceRequest request(baseUrl);
+        WTF::RefPtr buffer = WebCore::SharedBuffer::create(output.content.constData(), output.content.length());
+        WebCore::SubstituteData substituteData(buffer, output.contentType, output.encoding, failingUrl);
+        m_frame->loader()->load(request, substituteData, false);
+    }
+}
+
 void FrameLoaderClientQt::dispatchDidFailProvisionalLoad(const WebCore::ResourceError& error)
 {
     if (dumpFrameLoaderCallbacks)
         printf("%s - didFailProvisionalLoadWithError\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
 
     m_loadError = error;
+    if (!error.isNull() && !error.isCancellation())
+        callErrorPageExtension(error);
 }
 
 void FrameLoaderClientQt::dispatchDidFailLoad(const WebCore::ResourceError& error)
@@ -874,6 +910,8 @@ void FrameLoaderClientQt::dispatchDidFailLoad(const WebCore::ResourceError& erro
         printf("%s - didFailLoadWithError\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
 
     m_loadError = error;
+    if (!error.isNull() && !error.isCancellation())
+        callErrorPageExtension(error);
 }
 
 WebCore::Frame* FrameLoaderClientQt::dispatchCreatePage()
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
index 8a7e428..66c4252 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
@@ -59,6 +59,7 @@ namespace WebCore {
 
         friend class ::QWebFrame;
         void callPolicyFunction(FramePolicyFunction function, PolicyAction action);
+        void callErrorPageExtension(const ResourceError&);
     signals:
         void loadStarted();
         void loadProgress(int d);
diff --git a/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/qtwebkit_qwebview_snippet.cpp b/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/qtwebkit_qwebview_snippet.cpp
index 069bea2..f04cd29 100644
--- a/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/qtwebkit_qwebview_snippet.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/qtwebkit_qwebview_snippet.cpp
@@ -13,22 +13,22 @@ void wrapInFunction()
 
 
 //! [2]
-    view->triggerPageAction(QWebPage::Copy);
+    view->triggerAction(QWebPage::Copy);
 //! [2]
 
 
 //! [3]
-    view->page()->triggerAction(QWebPage::Stop);
+    view->page()->triggerPageAction(QWebPage::Stop);
 //! [3]
 
 
 //! [4]
-    view->page()->triggerAction(QWebPage::GoBack);
+    view->page()->triggerPageAction(QWebPage::GoBack);
 //! [4]
 
 
 //! [5]
-    view->page()->triggerAction(QWebPage::GoForward);
+    view->page()->triggerPageAction(QWebPage::GoForward);
 //! [5]
 
 }
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 0fb05b8..283950e 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -113,11 +113,9 @@ private slots:
     void localURLSchemes();
     void testOptionalJSObjects();
     void testEnablePersistentStorage();
-
     void consoleOutput();
 
-private:
-
+    void crashTests_LazyInitializationOfMainFrame();
 
 private:
     QWebView* m_view;
@@ -466,14 +464,19 @@ void tst_QWebPage::database()
     m_page->mainFrame()->evaluateJavaScript("var db3; db3=openDatabase('testdb', '1.0', 'test database API', 50000);db3.transaction(function(tx) { tx.executeSql('CREATE TABLE IF NOT EXISTS Test (text TEXT)', []); }, function(tx, result) { }, function(tx, error) { });");
     QTest::qWait(200);
 
+    // Remove all databases.
     QWebSecurityOrigin origin = m_page->mainFrame()->securityOrigin();
     QList dbs = origin.databases();
-    if (dbs.count() > 0) {
-        QString fileName = dbs[0].fileName();
+    for (int i = 0; i < dbs.count(); i++) {
+        QString fileName = dbs[i].fileName();
         QVERIFY(QFile::exists(fileName));
-        QWebDatabase::removeDatabase(dbs[0]);
+        QWebDatabase::removeDatabase(dbs[i]);
         QVERIFY(!QFile::exists(fileName));
     }
+    QVERIFY(!origin.databases().size());
+    // Remove removed test :-)
+    QWebDatabase::removeAllDatabases();
+    QVERIFY(!origin.databases().size());
     QTest::qWait(1000);
 }
 
@@ -1301,5 +1304,26 @@ void tst_QWebPage::testEnablePersistentStorage()
     QVERIFY(!webPage.settings()->iconDatabasePath().isEmpty());
 }
 
+void tst_QWebPage::crashTests_LazyInitializationOfMainFrame()
+{
+    {
+        QWebPage webPage;
+    }
+    {
+        QWebPage webPage;
+        webPage.selectedText();
+    }
+    {
+        QWebPage webPage;
+        webPage.triggerAction(QWebPage::Back, true);
+    }
+    {
+        QWebPage webPage;
+        QPoint pos(10,10);
+        webPage.updatePositionDependentActions(pos);
+    }
+}
+
+
 QTEST_MAIN(tst_QWebPage)
 #include "tst_qwebpage.moc"
-- 
cgit v0.12


From c40702827c53cea1f4e3d7fbcd060d9548cfd1a4 Mon Sep 17 00:00:00 2001
From: Volker Hilsheimer 
Date: Thu, 1 Oct 2009 10:56:13 +0200
Subject: Doc: gcc 3.4-based MinGW is downgraded to Tier 2 support, gcc 4.4 is
 Tier 1

---
 doc/src/platforms/supported-platforms.qdoc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/doc/src/platforms/supported-platforms.qdoc b/doc/src/platforms/supported-platforms.qdoc
index 5f72ce3..f03f758 100644
--- a/doc/src/platforms/supported-platforms.qdoc
+++ b/doc/src/platforms/supported-platforms.qdoc
@@ -78,7 +78,7 @@
     \row    \o Linux (32 and 64-bit)
                                      \o gcc 4.2
     \row    \o Microsoft Windows XP
-                                     \o gcc 3.4.2 (MinGW) (32-bit), MSVC 2003, 2005 (32 and 64-bit)
+                                     \o gcc 4.4 (MinGW) (32-bit), MSVC 2003, 2005 (32 and 64-bit)
     \row    \o Microsoft Windows Vista
                                      \o MSVC 2005, 2008
     \row    \o Microsoft Windows Vista 64bit
@@ -104,6 +104,8 @@
     \table
     \header \o Platform
                                      \o Compilers
+    \row    \o Windows XP, Vista
+                                     \o gcc 3.4.2 (MinGW)
     \omit
     \row    \o Windows 7
                                      \o MSVC 2008
-- 
cgit v0.12


From e1496edf9e4dcec0f4e55fb320ec49dba9e548d5 Mon Sep 17 00:00:00 2001
From: Volker Hilsheimer 
Date: Thu, 1 Oct 2009 11:54:28 +0200
Subject: Doc: add graphics effects and XML Schema Validation support.

Also add links to relevant APIs or documents for each block.

Missing: Qt on Symbian
---
 doc/src/qt4-intro.qdoc | 65 ++++++++++++++++++++++++++++++++++++++------------
 1 file changed, 50 insertions(+), 15 deletions(-)

diff --git a/doc/src/qt4-intro.qdoc b/doc/src/qt4-intro.qdoc
index eafae14..be4cb48 100644
--- a/doc/src/qt4-intro.qdoc
+++ b/doc/src/qt4-intro.qdoc
@@ -464,6 +464,7 @@
     previous releases in the Qt 4 series. This document covers the
     most important features in this release, separated by category.
 
+\omit
     A comprehensive list of changes between Qt 4.5 and Qt 4.6 is
     included in the \c changes-4.6.0 file
     \l{http://qt.nokia.com/developer/changes/changes-4.6.0}{available
@@ -473,6 +474,7 @@
     Changes between this release and the previous release are provided
     in the \c{changes-%VERSION%} file (also
     \l{http://qt.nokia.com/developer/changes/changes-%VERSION%}{available online}).
+\endomit
 
     A list of other Qt 4 features can be found on the \bold{\l{What's
     New in Qt 4}} page.
@@ -508,6 +510,8 @@
     The state machine framework is introduced in 4.6 and is described
     below.
 
+    See \l{The Animation Framework} documentation for more information.
+
     \section1 State Machine Framework
 
     The state machine framework provides a robust state chart
@@ -533,6 +537,8 @@
     trigger on signals and \l{QEvent}s. By inserting animations into
     the state machine, it is also easier to use the framework for
     animating GUIs, for instance.
+    
+    See \l{The State Machine Framework} documentation for more infromation.
 
     \section1 Multi-touch & Gestures
 
@@ -552,6 +558,8 @@
         \o Enable extensibility.
     \endlist
 
+    See the QTouchEvent and QGesture class documentation for more information.
+
     \section1 DOM access API
 
     Web pages and XML both have very complex document object models.
@@ -566,20 +574,7 @@
         QList introSpans = document.findAll("p.intro span");
     \endcode
 
-    \section1 Qt3D enablers
-
-    As more of Qt, and more of the applications built on Qt go 3D,
-    API's should be provided to simplify this. Mainly, the new API
-    aims to make it more easy to create 3D applications with OpenGL.
-    It will also unify the Qt OpenGL codebase, and enable
-    cross-platform 3D codebase.
-
-    The main features of the Qt3D enablers are currently: Math
-    primitives for matrix multiplication, vectors, quaternions
-    (client-side), and API for vertex and fragment shaders, GLSL/ES.
-    Future research will, among other things include stencils,
-    scissors, vertex buffers and arrays, texture manipulation, and
-    geometry shaders.
+    See the QWebElement class documentation for more information.
 
     \section1 Performance Optimizations
 
@@ -592,10 +587,48 @@
         \o Reduced overhead in QNetworkAccessManager.
         \o Added the QContiguousCache class, which provides efficient caching of
            contiguous data.
+        \o Added support for hardware-accelerated rendering through
+        \l{OpenVG Rendering in Qt}{OpenVG}
         \o Removed Win9x support.
     \endlist
 
-    \section1 Multimedia Audio Services
+    \section1 Graphics Effects
+
+    Effects can be used to alter the appearance of UI elements such as
+    \l{QGraphicsItem}s and \l{QWidget}s. A range of standard effects such
+    as blurring, colorizing or blooming is provided, and it is possible to
+    implement custom effects.
+
+    \img graphicseffect-widget.png
+
+    See the QGraphicsEffect class documentation for more information.
+
+    \section1 XML Schema Validation
+
+    The QtXmlPatterns module can now be used to validate schemas, either
+    through C++ APIs in the Qt application, or using the xmlpatternsvalidator
+    command line utility. The implementation of XML Schema Validation supports
+    the specification version 1.0 in large parts.
+
+    See the \l{XML Processing} and QXmlSchema class documentation for more
+    information.
+
+    \section1 Qt3D enablers
+
+    As more of Qt, and more of the applications built on Qt go 3D,
+    API's should be provided to simplify this. Mainly, the new API
+    aims to make it more easy to create 3D applications with OpenGL.
+    It will also unify the Qt OpenGL codebase, and enable
+    cross-platform 3D codebase.
+
+    The main features of the Qt3D enablers are currently: Math
+    primitives for matrix multiplication, vectors, quaternions
+    (client-side), and API for vertex and fragment shaders, GLSL/ES.
+    Future research will, among other things include stencils,
+    scissors, vertex buffers and arrays, texture manipulation, and
+    geometry shaders.
+
+    \section1 Multimedia Services
 
     Qt 4.6 comes with new classes for handling audio. These classes
     provide low-level access to the system's audio system. By
@@ -605,6 +638,8 @@
     functions to query audio devices for which audio formats they
     support.
 
+    See the \l{QtMultimedia Module} documentation for more information.
+
     \section1 Classes, functions, and other items introduced in 4.6
 
     Links to classes, function, and other items that were added in
-- 
cgit v0.12


From 997cb3006a8dfeea71132f9593c7421ca151f009 Mon Sep 17 00:00:00 2001
From: Alessandro Portale 
Date: Thu, 1 Oct 2009 11:42:37 +0200
Subject: Fix an issue that was uncovered by two tst_QAbstractItemView fails.

tst_QAbstractItemView::shiftArrowSelectionAfterScrolling() and
tst_QAbstractItemView::shiftSelectionAfterRubberbandSelection() are two
relatively new test cases that always failed when Qt was configured
with QT_KEYPAD_NAVIGATION. And that even though we set the navigation
mode to Qt::NavigationModeNone when running autotests for Symbian.

Fix: in QAbstractItemViewPrivate::extendedSelectionCommand(), we make
sure that even with keypad navigation enabled, the shift-arrow feature
is available.

Reviewed-by: Jani Hautakangas

	modified:   src/gui/itemviews/qabstractitemview.cpp
---
 src/gui/itemviews/qabstractitemview.cpp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index 303f45b..0fae959 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -3626,12 +3626,13 @@ QItemSelectionModel::SelectionFlags QAbstractItemViewPrivate::extendedSelectionC
             case Qt::Key_PageUp:
             case Qt::Key_PageDown:
             case Qt::Key_Tab:
+                if (modifiers & Qt::ControlModifier
 #ifdef QT_KEYPAD_NAVIGATION
-                return QItemSelectionModel::NoUpdate;
-#else
-                if (modifiers & Qt::ControlModifier)
-                    return QItemSelectionModel::NoUpdate;
+                    // Preserve historical tab order navigation behavior
+                    || QApplication::navigationMode() == Qt::NavigationModeKeypadTabOrder
 #endif
+                    )
+                    return QItemSelectionModel::NoUpdate;
                 break;
             case Qt::Key_Select:
                 return QItemSelectionModel::Toggle|selectionBehaviorFlags();
-- 
cgit v0.12


From 4ba85ab41513851236d62225b244b4364b825eaf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= 
Date: Thu, 1 Oct 2009 12:11:43 +0200
Subject: doc: Fixed ending of header in the HTML generated for \sincelist

---
 tools/qdoc3/htmlgenerator.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index 2757cd8..291f60b 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -732,13 +732,12 @@ int HtmlGenerator::generateAtom(const Atom *atom,
                               << Node::typeName(i)
                               << " new in Qt "
                               << atom->string()
-                              << "

"; + << "

"; generateAnnotatedList(relative, marker, nodeMap); nodeMap.clear(); } } } - } break; case Atom::Image: -- cgit v0.12 From a9d47220b9f0936550522d9a34748692701a2acf Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Thu, 1 Oct 2009 12:11:11 +0200 Subject: Updated JavaScriptCore from /home/khansen/dev/qtwebkit to jsc-for-qtscript-4.6-staging-01102009 ( 79e88e90aab6674098b6d73b1b41998117164499 ) --- src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog | 13 +++++++++++++ .../javascriptcore/JavaScriptCore/generated/Grammar.cpp | 2 +- src/3rdparty/javascriptcore/JavaScriptCore/parser/Grammar.y | 2 +- src/3rdparty/javascriptcore/JavaScriptCore/parser/Lexer.cpp | 12 +++++------- src/3rdparty/javascriptcore/JavaScriptCore/parser/Lexer.h | 4 ---- src/3rdparty/javascriptcore/VERSION | 4 ++-- 6 files changed, 22 insertions(+), 15 deletions(-) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog b/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog index 20bfc23..84a2935 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog +++ b/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog @@ -2,6 +2,19 @@ Reviewed by Gavin Barraclough. + Reduce heap size on Symbian from 64MB to 8MB. + + This is not a perfect fix, it requires more fine tuning. + But this makes it possible again to debug in the emulator, + which is more important in order to be able to fix other + run-time issues. + + * runtime/Collector.h: + +2009-09-30 Janne Koskinen + + Reviewed by Simon Hausmann. + Avoid __clear_cache built-in function if DISABLE_BUILTIN_CLEAR_CACHE define is set https://bugs.webkit.org/show_bug.cgi?id=28886 diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/generated/Grammar.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/generated/Grammar.cpp index 44559a8..f1fa708 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/generated/Grammar.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/generated/Grammar.cpp @@ -432,7 +432,7 @@ typedef struct YYLTYPE template inline void setStatementLocation(StatementNode* statement, const T& start, const T& end) { - statement->setLoc(start.first_line, end.last_line, start.first_column + 1); + statement->setLoc(start.first_line, end.last_line, start.first_column); } static inline void setExceptionLocation(ThrowableExpressionData* node, unsigned start, unsigned divot, unsigned end) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/parser/Grammar.y b/src/3rdparty/javascriptcore/JavaScriptCore/parser/Grammar.y index ffed3bb..fa4ffd0 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/parser/Grammar.y +++ b/src/3rdparty/javascriptcore/JavaScriptCore/parser/Grammar.y @@ -179,7 +179,7 @@ static inline void appendToVarDeclarationList(JSGlobalData* globalData, ParserAr template inline void setStatementLocation(StatementNode* statement, const T& start, const T& end) { - statement->setLoc(start.first_line, end.last_line, start.first_column + 1); + statement->setLoc(start.first_line, end.last_line, start.first_column); } static inline void setExceptionLocation(ThrowableExpressionData* node, unsigned start, unsigned divot, unsigned end) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/parser/Lexer.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/parser/Lexer.cpp index ec700bd..a85ed3d 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/parser/Lexer.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/parser/Lexer.cpp @@ -59,7 +59,6 @@ static const UChar byteOrderMark = 0xFEFF; Lexer::Lexer(JSGlobalData* globalData) : m_isReparsing(false) , m_globalData(globalData) - , m_startColumnNumberCorrection(0) , m_keywordTable(JSC::mainTable) { m_buffer8.reserveInitialCapacity(initialReadBufferCapacity); @@ -204,7 +203,6 @@ void Lexer::shiftLineTerminator() else shift1(); - m_startColumnNumberCorrection = currentOffset(); ++m_lineNumber; } @@ -900,11 +898,11 @@ doneString: // Fall through into returnToken. returnToken: { - llocp->first_line = m_lineNumber; - llocp->last_line = m_lineNumber; - - llocp->first_column = startOffset - m_startColumnNumberCorrection; - llocp->last_column = currentOffset() - m_startColumnNumberCorrection; + int lineNumber = m_lineNumber; + llocp->first_line = lineNumber; + llocp->last_line = lineNumber; + llocp->first_column = startOffset; + llocp->last_column = currentOffset(); m_lastToken = token; return token; diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/parser/Lexer.h b/src/3rdparty/javascriptcore/JavaScriptCore/parser/Lexer.h index 885e4d9..174e05a 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/parser/Lexer.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/parser/Lexer.h @@ -86,10 +86,6 @@ namespace JSC { static const size_t initialReadBufferCapacity = 32; int m_lineNumber; - // this variable is supposed to keep index of last new line character ('\n' or '\r\n'or '\n\r'...) - // it is importent to calculate correct first_column in parser - int m_startColumnNumberCorrection; - Vector m_buffer8; Vector m_buffer16; diff --git a/src/3rdparty/javascriptcore/VERSION b/src/3rdparty/javascriptcore/VERSION index edcf898..3d9c27c 100644 --- a/src/3rdparty/javascriptcore/VERSION +++ b/src/3rdparty/javascriptcore/VERSION @@ -4,8 +4,8 @@ This is a snapshot of JavaScriptCore from The commit imported was from the - jsc-for-qtscript-4.6-staging-30092009 branch/tag + jsc-for-qtscript-4.6-staging-01102009 branch/tag and has the sha1 checksum - e8f42cf0203bee0ba89a05e0e773d713782129b4 + 79e88e90aab6674098b6d73b1b41998117164499 -- cgit v0.12 From 0ae74e4c267c7b15a405240ec4dc038374d95bd2 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Thu, 1 Oct 2009 12:14:12 +0200 Subject: Fix column number provided to QScriptEngineAgent Introduced a helper function in our custom source provider, columnNumberFromOffset(), that maps an absolute offset in the source input to a relative column number. Reviewed-by: Jedrzej Nowacki --- src/script/api/qscriptengine.cpp | 67 +------------------- src/script/api/qscriptengine_p.h | 73 +++++++++++++++++++++- src/script/api/qscriptengineagent.cpp | 6 ++ tests/auto/qscriptengine/tst_qscriptengine.cpp | 1 - .../qscriptengineagent/tst_qscriptengineagent.cpp | 9 ++- 5 files changed, 88 insertions(+), 68 deletions(-) diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index 9604fff..059b102 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -382,65 +382,6 @@ private: bool m_shouldAbortEvaluation; }; -/*Helper class. Main purpose is to give debugger feedback about unloading and loading scripts. - It keeps pointer to JSGlobalObject assuming that it is always the same - there is no way to update - this data. Class is internal and used as an implementation detail in and only in QScriptEngine::evaluate.*/ -class UStringSourceProviderWithFeedback: public JSC::UStringSourceProvider -{ -public: - - static PassRefPtr create(const JSC::UString& source, const JSC::UString& url, int lineNumber, QScriptEnginePrivate* engine) - { - return adoptRef(new UStringSourceProviderWithFeedback(source, url, lineNumber, engine)); - } - - /* Destruction means that there is no more copies of script so create scriptUnload event - and unregister script in QScriptEnginePrivate::loadedScripts */ - virtual ~UStringSourceProviderWithFeedback() - { - if (m_ptr) { - if (JSC::Debugger* debugger = this->debugger()) - debugger->scriptUnload(asID()); - m_ptr->loadedScripts.remove(this); - } - } - - /* set internal QScriptEnginePrivate pointer to null and create unloadScript event, should be called - only if QScriptEnginePrivate is about to be destroyed.*/ - void disconnectFromEngine() - { - if (JSC::Debugger* debugger = this->debugger()) - debugger->scriptUnload(asID()); - m_ptr = 0; - } - -protected: - UStringSourceProviderWithFeedback(const JSC::UString& source, const JSC::UString& url, int lineNumber, QScriptEnginePrivate* engine) - : UStringSourceProvider(source, url), - m_ptr(engine) - { - if (JSC::Debugger* debugger = this->debugger()) - debugger->scriptLoad(asID(), source, url, lineNumber); - if (m_ptr) - m_ptr->loadedScripts.insert(this); - } - - JSC::Debugger* debugger() - { - //if m_ptr is null it mean that QScriptEnginePrivate was destroyed and scriptUnload was called - //else m_ptr is stable and we can use it as normal pointer without hesitation - if(!m_ptr) - return 0; //we are in ~QScriptEnginePrivate - else - return m_ptr->originalGlobalObject()->debugger(); //QScriptEnginePrivate is still alive - } - - //trace global object and debugger instance - QScriptEnginePrivate* m_ptr; -}; - - - static int toDigit(char c) { if ((c >= '0') && (c <= '9')) @@ -900,11 +841,9 @@ QScriptEnginePrivate::QScriptEnginePrivate() QScriptEnginePrivate::~QScriptEnginePrivate() { //disconnect all loadedScripts and generate all jsc::debugger::scriptUnload events - QSet::const_iterator i = loadedScripts.constBegin(); - while(i!=loadedScripts.constEnd()) { - (*i)->disconnectFromEngine(); - i++; - } + QHash::const_iterator it; + for (it = loadedScripts.constBegin(); it != loadedScripts.constEnd(); ++it) + it.value()->disconnectFromEngine(); while (!ownedAgents.isEmpty()) delete ownedAgents.takeFirst(); diff --git a/src/script/api/qscriptengine_p.h b/src/script/api/qscriptengine_p.h index b8b805e..5f31054 100644 --- a/src/script/api/qscriptengine_p.h +++ b/src/script/api/qscriptengine_p.h @@ -60,7 +60,10 @@ #include "qscriptvalue_p.h" #include "qscriptstring_p.h" +#include "Debugger.h" +#include "Lexer.h" #include "RefPtr.h" +#include "SourceProvider.h" #include "Structure.h" #include "JSGlobalObject.h" #include "JSValue.h" @@ -259,7 +262,7 @@ public: QSet importedExtensions; QSet extensionsBeingImported; - QSet loadedScripts; + QHash loadedScripts; #ifndef QT_NO_QOBJECT QHash m_qobjectData; @@ -273,6 +276,74 @@ public: namespace QScript { +/*Helper class. Main purpose is to give debugger feedback about unloading and loading scripts. + It keeps pointer to JSGlobalObject assuming that it is always the same - there is no way to update + this data. Class is internal and used as an implementation detail in and only in QScriptEngine::evaluate.*/ +class UStringSourceProviderWithFeedback: public JSC::UStringSourceProvider +{ +public: + static PassRefPtr create( + const JSC::UString& source, const JSC::UString& url, + int lineNumber, QScriptEnginePrivate* engine) + { + return adoptRef(new UStringSourceProviderWithFeedback(source, url, lineNumber, engine)); + } + + /* Destruction means that there is no more copies of script so create scriptUnload event + and unregister script in QScriptEnginePrivate::loadedScripts */ + virtual ~UStringSourceProviderWithFeedback() + { + if (m_ptr) { + if (JSC::Debugger* debugger = this->debugger()) + debugger->scriptUnload(asID()); + m_ptr->loadedScripts.remove(asID()); + } + } + + /* set internal QScriptEnginePrivate pointer to null and create unloadScript event, should be called + only if QScriptEnginePrivate is about to be destroyed.*/ + void disconnectFromEngine() + { + if (JSC::Debugger* debugger = this->debugger()) + debugger->scriptUnload(asID()); + m_ptr = 0; + } + + int columnNumberFromOffset(int offset) const + { + for (const UChar *c = m_source.data() + offset; c >= m_source.data(); --c) { + if (JSC::Lexer::isLineTerminator(*c)) + return offset - static_cast(c - data()); + } + return offset + 1; + } + +protected: + UStringSourceProviderWithFeedback(const JSC::UString& source, const JSC::UString& url, + int lineNumber, QScriptEnginePrivate* engine) + : UStringSourceProvider(source, url), + m_ptr(engine) + { + if (JSC::Debugger* debugger = this->debugger()) + debugger->scriptLoad(asID(), source, url, lineNumber); + if (m_ptr) + m_ptr->loadedScripts.insert(asID(), this); + } + + JSC::Debugger* debugger() + { + //if m_ptr is null it mean that QScriptEnginePrivate was destroyed and scriptUnload was called + //else m_ptr is stable and we can use it as normal pointer without hesitation + if(!m_ptr) + return 0; //we are in ~QScriptEnginePrivate + else + return m_ptr->originalGlobalObject()->debugger(); //QScriptEnginePrivate is still alive + } + + //trace global object and debugger instance + QScriptEnginePrivate* m_ptr; +}; + class SaveFrameHelper { public: diff --git a/src/script/api/qscriptengineagent.cpp b/src/script/api/qscriptengineagent.cpp index 84ae380..bc2eea2 100644 --- a/src/script/api/qscriptengineagent.cpp +++ b/src/script/api/qscriptengineagent.cpp @@ -169,6 +169,9 @@ void QScriptEngineAgentPrivate::exceptionCatch(const JSC::DebuggerCallFrame& fra void QScriptEngineAgentPrivate::atStatement(const JSC::DebuggerCallFrame& frame, intptr_t sourceID, int lineno, int column) { + QScript::UStringSourceProviderWithFeedback *source = engine->loadedScripts.value(sourceID); + Q_ASSERT(source != 0); + column = source->columnNumberFromOffset(column); JSC::CallFrame *oldFrame = engine->currentFrame; int oldAgentLineNumber = engine->agentLineNumber; engine->currentFrame = frame.callFrame(); @@ -195,6 +198,9 @@ void QScriptEngineAgentPrivate::didReachBreakpoint(const JSC::DebuggerCallFrame& intptr_t sourceID, int lineno, int column) { if (q_ptr->supportsExtension(QScriptEngineAgent::DebuggerInvocationRequest)) { + QScript::UStringSourceProviderWithFeedback *source = engine->loadedScripts.value(sourceID); + Q_ASSERT(source != 0); + column = source->columnNumberFromOffset(column); JSC::CallFrame *oldFrame = engine->currentFrame; int oldAgentLineNumber = engine->agentLineNumber; engine->currentFrame = frame.callFrame(); diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp index 183aa3f..f2c7157 100644 --- a/tests/auto/qscriptengine/tst_qscriptengine.cpp +++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp @@ -1632,7 +1632,6 @@ void tst_QScriptEngine::errorMessage_QT679() engine.globalObject().setProperty("foo", 15); QScriptValue error = engine.evaluate("'hello world';\nfoo.bar.blah"); QVERIFY(error.isError()); - QEXPECT_FAIL("", "Task QT-679: the error message always contains the first line of the script, even if the error was on a different line", Continue); QCOMPARE(error.toString(), QString::fromLatin1("TypeError: Result of expression 'foo.bar' [undefined] is not an object.")); } diff --git a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp index 82bca8f..283e489 100644 --- a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp +++ b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp @@ -1193,10 +1193,15 @@ void tst_QScriptEngineAgent::positionChange_1() QCOMPARE(spy->at(0).columnNumber, 1); } - { + QStringList lineTerminators; + lineTerminators << "\n" << "\r" << "\n\r" << "\r\n"; + for (int i = 0; i < lineTerminators.size(); ++i) { spy->clear(); int lineNumber = 456; - eng.evaluate("1 + 2; 3 + 4;\n5 + 6", "foo.qs", lineNumber); + QString code = "1 + 2; 3 + 4;"; + code.append(lineTerminators.at(i)); + code.append("5 + 6"); + eng.evaluate(code, "foo.qs", lineNumber); QCOMPARE(spy->count(), 3); // 1 + 2 -- cgit v0.12 From 91c7b2d6cfa4f8ac63d12c1da131e1813a3c690c Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 1 Oct 2009 12:19:06 +0200 Subject: qdoc: Added a missing "/" in a "

". --- src/gui/graphicsview/qgraphicsscene.cpp | 212 ++++++++++++++++---------------- tools/qdoc3/doc.cpp | 83 +++++++------ 2 files changed, 152 insertions(+), 143 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 0acef0b..a1ff6d2 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -1759,10 +1759,10 @@ QRectF QGraphicsScene::itemsBoundingRect() const return boundingRect; } -/*! - Returns a list of all items on the scene, in no particular order. +/*! \fn QList QGraphicsScene::items() const + Returns a list of all items on the scene, in no particular order. - \sa addItem(), removeItem() + \sa addItem(), removeItem() */ QList QGraphicsScene::items() const { @@ -1770,11 +1770,11 @@ QList QGraphicsScene::items() const return d->index->items(Qt::DescendingOrder); } -/*! - Returns an ordered list of all items on the scene. \a order decides the - sorting. +/*! \fn QList QGraphicsScene::items(Qt::SortOrder order) const + Returns an ordered list of all items on the scene. \a order decides the + sorting. - \sa addItem(), removeItem() + \sa addItem(), removeItem() */ QList QGraphicsScene::items(Qt::SortOrder order) const { @@ -1782,18 +1782,18 @@ QList QGraphicsScene::items(Qt::SortOrder order) const return d->index->items(order); } -/*! - \obsolete +/*! \fn QList QGraphicsScene::items(const QPointF &pos) const + \obsolete - Returns all visible items at position \a pos in the scene. The items are - listed in descending stacking order (i.e., the first item in the list is the - top-most item, and the last item is the bottom-most item). + Returns all visible items at position \a pos in the scene. The items are + listed in descending stacking order (i.e., the first item in the list is the + top-most item, and the last item is the bottom-most item). - This function is deprecated and returns incorrect results if the scene - contains items that ignore transformations. Use the overload that takes - a QTransform instead. + This function is deprecated and returns incorrect results if the scene + contains items that ignore transformations. Use the overload that takes + a QTransform instead. - \sa itemAt() + \sa itemAt() */ QList QGraphicsScene::items(const QPointF &pos) const { @@ -1801,21 +1801,21 @@ QList QGraphicsScene::items(const QPointF &pos) const return d->index->items(pos, Qt::IntersectsItemShape, Qt::DescendingOrder); } -/*! - \overload - \obsolete +/*! \fn QList QGraphicsScene::items(const QRectF &rectangle, Qt::ItemSelectionMode mode) const + \overload + \obsolete - Returns all visible items that, depending on \a mode, are either inside or - intersect with the specified \a rectangle. + Returns all visible items that, depending on \a mode, are either inside or + intersect with the specified \a rectangle. - The default value for \a mode is Qt::IntersectsItemShape; all items whose - exact shape intersects with or is contained by \a rectangle are returned. + The default value for \a mode is Qt::IntersectsItemShape; all items whose + exact shape intersects with or is contained by \a rectangle are returned. - This function is deprecated and returns incorrect results if the scene - contains items that ignore transformations. Use the overload that takes - a QTransform instead. + This function is deprecated and returns incorrect results if the scene + contains items that ignore transformations. Use the overload that takes + a QTransform instead. - \sa itemAt() + \sa itemAt() */ QList QGraphicsScene::items(const QRectF &rectangle, Qt::ItemSelectionMode mode) const { @@ -1823,47 +1823,45 @@ QList QGraphicsScene::items(const QRectF &rectangle, Qt::ItemSe return d->index->items(rectangle, mode, Qt::DescendingOrder); } -/*! - \fn QList QGraphicsScene::items(qreal x, qreal y, qreal w, qreal h, Qt::ItemSelectionMode mode) const - \obsolete - \since 4.3 +/*! \fn QList QGraphicsScene::items(qreal x, qreal y, qreal w, qreal h, Qt::ItemSelectionMode mode) const + \obsolete + \since 4.3 - This convenience function is equivalent to calling items(QRectF(\a x, \a y, \a w, \a h), \a mode). + This convenience function is equivalent to calling items(QRectF(\a x, \a y, \a w, \a h), \a mode). - This function is deprecated and returns incorrect results if the scene - contains items that ignore transformations. Use the overload that takes - a QTransform instead. + This function is deprecated and returns incorrect results if the scene + contains items that ignore transformations. Use the overload that takes + a QTransform instead. */ /*! - \fn QList QGraphicsScene::items(qreal x, qreal y, qreal w, qreal h, - Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const - \overload - \since 4.6 + \fn QList QGraphicsScene::items(qreal x, qreal y, qreal w, qreal h, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const + \overload + \since 4.6 - Returns all visible items that, depending on \a mode, are either inside or - intersect with the rectangle defined by \a x, \a y, \a w and \a h, in a list - sorted using \a order. + \brief Returns all visible items that, depending on \a mode, are + either inside or intersect with the rectangle defined by \a x, \a y, + \a w and \a h, in a list sorted using \a order. - \a deviceTransform is the transformation that applies to the view, and needs to - be provided if the scene contains items that ignore transformations. + \a deviceTransform is the transformation that applies to the view, and needs to + be provided if the scene contains items that ignore transformations. */ -/*! - \overload - \obsolete +/*! \fn QList QGraphicsScene::items(const QPolygonF &polygon, Qt::ItemSelectionMode mode) const + \overload + \obsolete - Returns all visible items that, depending on \a mode, are either inside or - intersect with the polygon \a polygon. + Returns all visible items that, depending on \a mode, are either inside or + intersect with the polygon \a polygon. - The default value for \a mode is Qt::IntersectsItemShape; all items whose - exact shape intersects with or is contained by \a polygon are returned. + The default value for \a mode is Qt::IntersectsItemShape; all items whose + exact shape intersects with or is contained by \a polygon are returned. - This function is deprecated and returns incorrect results if the scene - contains items that ignore transformations. Use the overload that takes - a QTransform instead. + This function is deprecated and returns incorrect results if the scene + contains items that ignore transformations. Use the overload that takes + a QTransform instead. - \sa itemAt() + \sa itemAt() */ QList QGraphicsScene::items(const QPolygonF &polygon, Qt::ItemSelectionMode mode) const { @@ -1871,21 +1869,21 @@ QList QGraphicsScene::items(const QPolygonF &polygon, Qt::ItemS return d->index->items(polygon, mode, Qt::DescendingOrder); } -/*! - \overload - \obsolete +/*! \fn QList QGraphicsScene::items(const QPainterPath &path, Qt::ItemSelectionMode mode) const + \overload + \obsolete - Returns all visible items that, depending on \a path, are either inside or - intersect with the path \a path. + Returns all visible items that, depending on \a path, are either inside or + intersect with the path \a path. - The default value for \a mode is Qt::IntersectsItemShape; all items whose - exact shape intersects with or is contained by \a path are returned. + The default value for \a mode is Qt::IntersectsItemShape; all items whose + exact shape intersects with or is contained by \a path are returned. - This function is deprecated and returns incorrect results if the scene - contains items that ignore transformations. Use the overload that takes - a QTransform instead. + This function is deprecated and returns incorrect results if the scene + contains items that ignore transformations. Use the overload that takes + a QTransform instead. - \sa itemAt() + \sa itemAt() */ QList QGraphicsScene::items(const QPainterPath &path, Qt::ItemSelectionMode mode) const { @@ -1893,19 +1891,20 @@ QList QGraphicsScene::items(const QPainterPath &path, Qt::ItemS return d->index->items(path, mode, Qt::DescendingOrder); } -/*! - \since 4.6 +/*! \fn QList QGraphicsScene::items(const QPointF &pos, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const - Returns all visible items that, depending on \a mode, are at the specified \a pos - in a list sorted using \a order. + \since 4.6 - The default value for \a mode is Qt::IntersectsItemShape; all items whose - exact shape intersects with \a pos are returned. + \brief Returns all visible items that, depending on \a mode, are at + the specified \a pos in a list sorted using \a order. - \a deviceTransform is the transformation that applies to the view, and needs to - be provided if the scene contains items that ignore transformations. + The default value for \a mode is Qt::IntersectsItemShape; all items whose + exact shape intersects with \a pos are returned. - \sa itemAt() + \a deviceTransform is the transformation that applies to the view, and needs to + be provided if the scene contains items that ignore transformations. + + \sa itemAt() */ QList QGraphicsScene::items(const QPointF &pos, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const @@ -1914,20 +1913,21 @@ QList QGraphicsScene::items(const QPointF &pos, Qt::ItemSelecti return d->index->items(pos, mode, order, deviceTransform); } -/*! - \overload - \since 4.6 +/*! \fn QList QGraphicsScene::items(const QRectF &rect, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const + \overload + \since 4.6 - Returns all visible items that, depending on \a mode, are either inside or - intersect with the specified \a rect and return a list sorted using \a order. + \brief Returns all visible items that, depending on \a mode, are + either inside or intersect with the specified \a rect and return a + list sorted using \a order. - The default value for \a mode is Qt::IntersectsItemShape; all items whose - exact shape intersects with or is contained by \a rect are returned. + The default value for \a mode is Qt::IntersectsItemShape; all items whose + exact shape intersects with or is contained by \a rect are returned. - \a deviceTransform is the transformation that applies to the view, and needs to - be provided if the scene contains items that ignore transformations. + \a deviceTransform is the transformation that applies to the view, and needs to + be provided if the scene contains items that ignore transformations. - \sa itemAt() + \sa itemAt() */ QList QGraphicsScene::items(const QRectF &rect, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const @@ -1936,20 +1936,21 @@ QList QGraphicsScene::items(const QRectF &rect, Qt::ItemSelecti return d->index->items(rect, mode, order, deviceTransform); } -/*! - \overload - \since 4.6 +/*! \fn QList QGraphicsScene::items(const QPolygonF &polygon, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const + \overload + \since 4.6 - Returns all visible items that, depending on \a mode, are either inside or - intersect with the specified \a polygon and return a list sorted using \a order. + \brief Returns all visible items that, depending on \a mode, are + either inside or intersect with the specified \a polygon and return + a list sorted using \a order. - The default value for \a mode is Qt::IntersectsItemShape; all items whose - exact shape intersects with or is contained by \a polygon are returned. + The default value for \a mode is Qt::IntersectsItemShape; all items whose + exact shape intersects with or is contained by \a polygon are returned. - \a deviceTransform is the transformation that applies to the view, and needs to - be provided if the scene contains items that ignore transformations. + \a deviceTransform is the transformation that applies to the view, and needs to + be provided if the scene contains items that ignore transformations. - \sa itemAt() + \sa itemAt() */ QList QGraphicsScene::items(const QPolygonF &polygon, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const @@ -1958,20 +1959,21 @@ QList QGraphicsScene::items(const QPolygonF &polygon, Qt::ItemS return d->index->items(polygon, mode, order, deviceTransform); } -/*! - \overload - \since 4.6 +/*! \fn QList QGraphicsScene::items(const QPainterPath &path, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const + \overload + \since 4.6 - Returns all visible items that, depending on \a mode, are either inside or - intersect with the specified \a path and return a list sorted using \a order. + \brief Returns all visible items that, depending on \a mode, are + either inside or intersect with the specified \a path and return a + list sorted using \a order. - The default value for \a mode is Qt::IntersectsItemShape; all items whose - exact shape intersects with or is contained by \a path are returned. + The default value for \a mode is Qt::IntersectsItemShape; all items whose + exact shape intersects with or is contained by \a path are returned. - \a deviceTransform is the transformation that applies to the view, and needs to - be provided if the scene contains items that ignore transformations. + \a deviceTransform is the transformation that applies to the view, and needs to + be provided if the scene contains items that ignore transformations. - \sa itemAt() + \sa itemAt() */ QList QGraphicsScene::items(const QPainterPath &path, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const diff --git a/tools/qdoc3/doc.cpp b/tools/qdoc3/doc.cpp index c202d71..748390f 100644 --- a/tools/qdoc3/doc.cpp +++ b/tools/qdoc3/doc.cpp @@ -2641,56 +2641,63 @@ Text Doc::trimmedBriefText(const QString &className) const bool standardWording = true; /* - This code is really ugly. The entire \brief business - should be rethought. + This code is really ugly. The entire \brief business + should be rethought. */ - while (atom && (atom->type() == Atom::AutoLink || atom->type() == Atom::String)) { - briefStr += atom->string(); + while (atom) { + if (atom->type() == Atom::AutoLink || atom->type() == Atom::String) { + briefStr += atom->string(); + } atom = atom->next(); } QStringList w = briefStr.split(" "); - if (!w.isEmpty() && w.first() == "The") - w.removeFirst(); - else { - location().warning( - tr("Nonstandard wording in '\\%1' text for '%2' (expected 'The')") - .arg(COMMAND_BRIEF).arg(className)); - standardWording = false; + if (!w.isEmpty() && w.first() == "Returns") { } - - if (!w.isEmpty() && (w.first() == className || w.first() == classNameOnly)) - w.removeFirst(); else { - location().warning( - tr("Nonstandard wording in '\\%1' text for '%2' (expected '%3')") - .arg(COMMAND_BRIEF).arg(className).arg(className)); - standardWording = false; - } + if (!w.isEmpty() && w.first() == "The") + w.removeFirst(); + else { + location().warning( + tr("Nonstandard wording in '\\%1' text for '%2' (expected 'The')") + .arg(COMMAND_BRIEF).arg(className)); + standardWording = false; + } - if (!w.isEmpty() && ((w.first() == "class") || - (w.first() == "function") || - (w.first() == "macro") || - (w.first() == "widget") || - (w.first() == "namespace") || - (w.first() == "header"))) - w.removeFirst(); - else { - location().warning( - tr("Nonstandard wording in '\\%1' text for '%2' (" - "expected 'class', 'function', 'macro', 'widget', " - "'namespace' or 'header')") - .arg(COMMAND_BRIEF).arg(className)); - standardWording = false; - } + if (!w.isEmpty() && (w.first() == className || w.first() == classNameOnly)) + w.removeFirst(); + else { + location().warning( + tr("Nonstandard wording in '\\%1' text for '%2' (expected '%3')") + .arg(COMMAND_BRIEF).arg(className).arg(className)); + standardWording = false; + } - if (!w.isEmpty() && (w.first() == "is" || w.first() == "provides")) - w.removeFirst(); + if (!w.isEmpty() && ((w.first() == "class") || + (w.first() == "function") || + (w.first() == "macro") || + (w.first() == "widget") || + (w.first() == "namespace") || + (w.first() == "header"))) + w.removeFirst(); + else { + location().warning( + tr("Nonstandard wording in '\\%1' text for '%2' (" + "expected 'class', 'function', 'macro', 'widget', " + "'namespace' or 'header')") + .arg(COMMAND_BRIEF).arg(className)); + standardWording = false; + } - if (!w.isEmpty() && (w.first() == "a" || w.first() == "an")) - w.removeFirst(); + if (!w.isEmpty() && (w.first() == "is" || w.first() == "provides")) + w.removeFirst(); + + if (!w.isEmpty() && (w.first() == "a" || w.first() == "an")) + w.removeFirst(); + } whats = w.join(" "); + if (whats.endsWith(".")) whats.truncate(whats.length() - 1); -- cgit v0.12 From dde7e6835ddaa8e1531de57887686c6c4f89d83d Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 1 Oct 2009 12:40:56 +0200 Subject: Fix tst_QIcon::isNull The test tries to load a file from an unsuported format. The problem is that tga is a supported format if KDE plugins are installed It is unlikely that cpp will ever be a supported image format Reviewed-by: paul --- tests/auto/qicon/image.tga | Bin 51708 -> 0 bytes tests/auto/qicon/qicon.pro | 4 ++-- tests/auto/qicon/tst_qicon.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 tests/auto/qicon/image.tga diff --git a/tests/auto/qicon/image.tga b/tests/auto/qicon/image.tga deleted file mode 100644 index 0cd507d..0000000 Binary files a/tests/auto/qicon/image.tga and /dev/null differ diff --git a/tests/auto/qicon/qicon.pro b/tests/auto/qicon/qicon.pro index 0c9c7e9..8ae252f 100644 --- a/tests/auto/qicon/qicon.pro +++ b/tests/auto/qicon/qicon.pro @@ -6,9 +6,9 @@ RESOURCES = tst_qicon.qrc wince* { QT += xml svg addFiles.sources += $$_PRO_FILE_PWD_/*.png - addFiles.sources += $$_PRO_FILE_PWD_/*.tga addFiles.sources += $$_PRO_FILE_PWD_/*.svg addFiles.sources += $$_PRO_FILE_PWD_/*.svgz + addFiles.sources += $$_PRO_FILE_PWD_/tst_qicon.cpp addFiles.path = . DEPLOYMENT += addFiles @@ -16,7 +16,7 @@ wince* { DEFINES += SRCDIR=\\\".\\\" } else:symbian { QT += xml svg - addFiles.sources = *.png *.tga *.svg *.svgz + addFiles.sources = *.png tst_qicon.cpp *.svg *.svgz addFiles.path = . plugins.sources = qsvgicon.dll plugins.path = iconengines diff --git a/tests/auto/qicon/tst_qicon.cpp b/tests/auto/qicon/tst_qicon.cpp index 96d1d6c..f5baeaa 100644 --- a/tests/auto/qicon/tst_qicon.cpp +++ b/tests/auto/qicon/tst_qicon.cpp @@ -242,7 +242,7 @@ void tst_QIcon::isNull() { const QString prefix = QLatin1String(SRCDIR) + QLatin1String("/"); // test string constructor with existing file but unsupported format - QIcon iconUnsupportedFormat = QIcon(prefix + "image.tga"); + QIcon iconUnsupportedFormat = QIcon(prefix + "tst_qicon.cpp"); QVERIFY(!iconUnsupportedFormat.isNull()); QVERIFY(!iconUnsupportedFormat.actualSize(QSize(32, 32)).isValid()); -- cgit v0.12 From a542c1c7f5f49b0b5feb85d6ea56155e0cec411b Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Thu, 1 Oct 2009 12:39:33 +0200 Subject: Skip unstable test The test relies on wall-clock time. --- tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp b/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp index 94f08d9..4f4c547 100644 --- a/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp +++ b/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp @@ -649,6 +649,8 @@ tst_Suite::tst_Suite() addFileExclusion("regress-322135-04.js", "takes forever"); addFileExclusion("ecma_3/RegExp/regress-375715-04.js", "bug"); + addFileExclusion("ecma_3/RegExp/regress-289669.js", "Can fail due to relying on wall-clock time"); + // Failures due to switch to JSC as back-end addExpectedFailure("ecma/Array/15.4.3.1-2.js", "var props = ''; for ( p in Array ) { props += p } props", willFixInNextReleaseMessage); addExpectedFailure("ecma/Boolean/15.6.3.1-1.js", "var str='';for ( p in Boolean ) { str += p } str;", willFixInNextReleaseMessage); -- cgit v0.12 From a7273386adb9399ecdc7b7c8f4b041099db042ef Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Thu, 1 Oct 2009 12:41:23 +0200 Subject: Fix crash in S60 input methods after task switching When switching away from the application, the focused widget is set to null. When switching back, there are callbacks from S60 before the focus has been restored. These functions check for null widget, but the output function parameters are left uninitialised, which causes a crash inside the S60 FEP. 1) GetXYZ functions now initialise the output parameters even when the focused widget is null. 2) Return no input capability when there is no focused widget, as was already done during destruction. This stops most of the callbacks from S60. Task-number: QTBUG-4618 Reviewed-by: axis --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index fc55a0f..c4d17ff 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -222,7 +222,7 @@ void QCoeFepInputContext::mouseHandler( int x, QMouseEvent *event) TCoeInputCapabilities QCoeFepInputContext::inputCapabilities() { - if (m_inDestruction) { + if (m_inDestruction || !focusWidget()) { return TCoeInputCapabilities(TCoeInputCapabilities::ENone, 0, 0); } @@ -554,8 +554,10 @@ void QCoeFepInputContext::SetCursorSelectionForFepL(const TCursorSelection& aCur void QCoeFepInputContext::GetCursorSelectionForFep(TCursorSelection& aCursorSelection) const { QWidget *w = focusWidget(); - if (!w) + if (!w) { + aCursorSelection.SetSelection(0,0); return; + } int cursor = w->inputMethodQuery(Qt::ImCursorPosition).toInt() + m_preeditString.size(); int anchor = w->inputMethodQuery(Qt::ImAnchorPosition).toInt() + m_preeditString.size(); @@ -567,8 +569,10 @@ void QCoeFepInputContext::GetEditorContentForFep(TDes& aEditorContent, TInt aDoc TInt aLengthToRetrieve) const { QWidget *w = focusWidget(); - if (!w) + if (!w) { + aEditorContent.FillZ(aLengthToRetrieve); return; + } QString text = w->inputMethodQuery(Qt::ImSurroundingText).value(); // FEP expects the preedit string to be part of the editor content, so let's mix it in. @@ -580,8 +584,10 @@ void QCoeFepInputContext::GetEditorContentForFep(TDes& aEditorContent, TInt aDoc void QCoeFepInputContext::GetFormatForFep(TCharFormat& aFormat, TInt /* aDocumentPosition */) const { QWidget *w = focusWidget(); - if (!w) + if (!w) { + aFormat = TCharFormat(); return; + } QFont font = w->inputMethodQuery(Qt::ImFont).value(); QFontMetrics metrics(font); @@ -595,8 +601,12 @@ void QCoeFepInputContext::GetScreenCoordinatesForFepL(TPoint& aLeftSideOfBaseLin TInt& aAscent, TInt /* aDocumentPosition */) const { QWidget *w = focusWidget(); - if (!w) + if (!w) { + aLeftSideOfBaseLine = TPoint(0,0); + aHeight = 0; + aAscent = 0; return; + } QRect rect = w->inputMethodQuery(Qt::ImMicroFocus).value(); aLeftSideOfBaseLine.iX = rect.left(); -- cgit v0.12 From 3b37aff1e6c641290c155a6aa14d83167725556b Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Thu, 1 Oct 2009 12:45:52 +0200 Subject: Fix auto-test that was crashing on Mac Carbon. If you let top level widget hanging around with a broken state it may crash when a process event is triggered. Reviewed-by:ogoffart --- tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp index 00fae2f..e70d286 100644 --- a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp +++ b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp @@ -3059,6 +3059,8 @@ void tst_QGraphicsProxyWidget::deleteProxyForChildWidget() proxy->setWidget(0); //just don't crash + QApplication::processEvents(); + delete combo; } void tst_QGraphicsProxyWidget::bypassGraphicsProxyWidget_data() @@ -3090,11 +3092,17 @@ void tst_QGraphicsProxyWidget::bypassGraphicsProxyWidget() if (bypass) flags |= Qt::BypassGraphicsProxyWidget; QFileDialog *dialog = new QFileDialog(widget, flags); + dialog->setOption(QFileDialog::DontUseNativeDialog, true); dialog->show(); QCOMPARE(proxy->childItems().size(), bypass ? 0 : 1); if (!bypass) QCOMPARE(((QGraphicsProxyWidget *)proxy->childItems().first())->widget(), (QWidget *)dialog); + + dialog->hide(); + QApplication::processEvents(); + delete dialog; + delete widget; } static void makeDndEvent(QGraphicsSceneDragDropEvent *event, QGraphicsView *view, const QPointF &pos) -- cgit v0.12 From 973adfb8272c95bd197af8b0afc9c1a9095552cb Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Thu, 1 Oct 2009 12:58:08 +0200 Subject: Doc: A bit of text for example categories. IPC is missing. --- doc/src/getting-started/examples.qdoc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc index 543a2e1..d80308a 100644 --- a/doc/src/getting-started/examples.qdoc +++ b/doc/src/getting-started/examples.qdoc @@ -295,6 +295,8 @@ \o \image animation-examples.png \o + These examples show to to use the \l{The Animation Framework}{animation framework} + to build highly animated, high-performance GUIs. \row \o{2,1} \l{Gestures Examples}{\bold{Gestures}} @@ -322,6 +324,8 @@ \o \image activeqt-examples.png ActiveQt \o + These examples demonstrate how to write ActiveX controls and control servers + with Qt, and how to use ActiveX controls and COM objects in a Qt application. \row \o{2,1} \l{Qt Quarterly}{\bold{Qt Quarterly}} -- cgit v0.12 From 17fc5f3f3bb358049ac49e6b2ae2f3e277fee595 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Thu, 1 Oct 2009 13:13:25 +0200 Subject: Doc: nicer screenshots for Graphics Effects section in "What's New" --- doc/src/images/graphicseffect-plain.png | Bin 0 -> 68763 bytes doc/src/qt4-intro.qdoc | 11 ++++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 doc/src/images/graphicseffect-plain.png diff --git a/doc/src/images/graphicseffect-plain.png b/doc/src/images/graphicseffect-plain.png new file mode 100644 index 0000000..8b4c1c4 Binary files /dev/null and b/doc/src/images/graphicseffect-plain.png differ diff --git a/doc/src/qt4-intro.qdoc b/doc/src/qt4-intro.qdoc index be4cb48..aff0a76 100644 --- a/doc/src/qt4-intro.qdoc +++ b/doc/src/qt4-intro.qdoc @@ -599,7 +599,16 @@ as blurring, colorizing or blooming is provided, and it is possible to implement custom effects. - \img graphicseffect-widget.png + \table + \row + \o + \o \img graphicseffect-plain.png + \o + \row + \o \img graphicseffect-blur.png + \o \img graphicseffect-colorize.png + \o \img graphicseffect-bloom.png + \endtable See the QGraphicsEffect class documentation for more information. -- cgit v0.12 From b8544f961ea8b5b2aee49aec330883191d2c910c Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Thu, 1 Oct 2009 13:14:11 +0200 Subject: Doc: A short paragraph about Symbian support. Needs a screenshot or picture. --- doc/src/qt4-intro.qdoc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/src/qt4-intro.qdoc b/doc/src/qt4-intro.qdoc index aff0a76..e273c6e 100644 --- a/doc/src/qt4-intro.qdoc +++ b/doc/src/qt4-intro.qdoc @@ -483,6 +483,14 @@ \tableofcontents + \section1 Support for Symbian + + Qt 4.6 is the first release to include support for the Symbian + platform, with integration into the S60 framework. The port to + Symbian and S60 provides all functionality required to develop + rich end-user applications for devices running Symbian 3.1 and + later. + \section1 Animation Framework The animation framework helps build highly animated, -- cgit v0.12 From 7edd3d86530ed4036482d05e2791569f3f53afa6 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Thu, 1 Oct 2009 12:56:31 +0200 Subject: Fixes clipboard handling on X11. This fixes handling selection requests for invalid targets - when someone asks for a target that is not supported by the clipboard content we shouldn't do anything (unless it's MULTIPLE). Fixes copying data when using Synergy which tries to get all targets it knows about even if they are not listed in TARGETS. Task-number: QTBUG-4652 Reviewed-by: Bradley T. Hughes --- src/gui/kernel/qdnd_x11.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qdnd_x11.cpp b/src/gui/kernel/qdnd_x11.cpp index 33da0f3..da150fb 100644 --- a/src/gui/kernel/qdnd_x11.cpp +++ b/src/gui/kernel/qdnd_x11.cpp @@ -506,6 +506,7 @@ bool QX11Data::xdndMimeDataForAtom(Atom a, QMimeData *mimeData, QByteArray *data *atomFormat = textprop.encoding; *dataFormat = textprop.format; *data = QByteArray((const char *) textprop.value, textprop.nitems * textprop.format / 8); + ret = true; DEBUG(" textprop type %lx\n" " textprop name '%s'\n" @@ -541,12 +542,13 @@ bool QX11Data::xdndMimeDataForAtom(Atom a, QMimeData *mimeData, QByteArray *data dm->xdndMimeTransferedPixmap[dm->xdndMimeTransferedPixmapIndex] = pm; dm->xdndMimeTransferedPixmapIndex = (dm->xdndMimeTransferedPixmapIndex + 1) % 2; + ret = true; } } else { DEBUG("QClipboard: xdndMimeDataForAtom(): converting to type '%s' is not supported", qPrintable(atomName)); } } - return data; + return ret && data != 0; } //$$$ -- cgit v0.12 From 3f711d2a40224f7f4d609fdb60d26ad79998da59 Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Thu, 1 Oct 2009 13:16:17 +0200 Subject: Doc fix on QGraphicsWidget and QGraphicsObject. Reviewed-by:David Boddie --- doc/src/qt4-intro.qdoc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/src/qt4-intro.qdoc b/doc/src/qt4-intro.qdoc index e273c6e..47eab16 100644 --- a/doc/src/qt4-intro.qdoc +++ b/doc/src/qt4-intro.qdoc @@ -501,8 +501,9 @@ The framework makes it easy to animate \l{QObject}s, including QWidgets, by allowing Qt properties to be animated. It also allows creating custom animations and interpolation functions. Graphics - views are not left out--one can animate \l{QGraphicsWidget}s, - which inherits from QObject (and thereby enables properties). + views are not left out; one can animate \l{QGraphicsWidget}s and + new \l{QGraphicsObject}s which inherit from QGraphicsItem + (and thereby enable properties). Animations are controlled using easing curves and can be grouped together. This enables animations of arbitrary complexity. -- cgit v0.12