From 0ba83b99916177a5146ef1c26b88863354751a13 Mon Sep 17 00:00:00 2001 From: Ting-Yu Chou Date: Mon, 1 Sep 2014 10:43:39 +0800 Subject: [PATCH 01/66] Bug 1050122 - Enable Nuwa on debug builds, and kill it if the preference is false. r=khuey --- b2g/app/B2GLoader.cpp | 7 +++++++ b2g/app/b2g.js | 2 -- ipc/glue/ProcessUtils_linux.cpp | 9 +++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/b2g/app/B2GLoader.cpp b/b2g/app/B2GLoader.cpp index 7e0aa962784..6359331c2d4 100644 --- a/b2g/app/B2GLoader.cpp +++ b/b2g/app/B2GLoader.cpp @@ -215,6 +215,13 @@ RunProcesses(int argc, const char *argv[]) return XRE_ProcLoaderServiceRun(getppid(), childSock, argc, argv); } + // Reap zombie child process. + struct sigaction sa; + sa.sa_handler = SIG_IGN; + sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; + sigaction(SIGCHLD, &sa, nullptr); + // The b2g process int childPid = pid; XRE_ProcLoaderClientInit(childPid, parentSock); diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js index d002a1c69fb..9a2d221082c 100644 --- a/b2g/app/b2g.js +++ b/b2g/app/b2g.js @@ -754,13 +754,11 @@ pref("hal.processPriorityManager.gonk.notifyLowMemUnderKB", 14336); // blocked on a poll(), and this pref has no effect.) pref("gonk.systemMemoryPressureRecoveryPollMS", 5000); -#ifndef DEBUG // Enable pre-launching content processes for improved startup time // (hiding latency). pref("dom.ipc.processPrelaunch.enabled", true); // Wait this long before pre-launching a new subprocess. pref("dom.ipc.processPrelaunch.delayMs", 5000); -#endif pref("dom.ipc.reuse_parent_app", false); diff --git a/ipc/glue/ProcessUtils_linux.cpp b/ipc/glue/ProcessUtils_linux.cpp index 42998991bd7..4a071d0baea 100644 --- a/ipc/glue/ProcessUtils_linux.cpp +++ b/ipc/glue/ProcessUtils_linux.cpp @@ -28,6 +28,7 @@ #include "mozilla/BackgroundHangMonitor.h" #include "mozilla/DebugOnly.h" #include "base/process_util.h" +#include "mozilla/Preferences.h" #include "prenv.h" @@ -181,6 +182,14 @@ ProcLoaderClientGeckoInit() MOZ_ASSERT(!sProcLoaderClientGeckoInitialized, "call ProcLoaderClientGeckoInit() more than once"); + if (!Preferences::GetBool("dom.ipc.processPrelaunch.enabled", false)) { + kill(sProcLoaderPid, SIGKILL); + sProcLoaderPid = 0; + close(sProcLoaderChannelFd); + sProcLoaderChannelFd = -1; + return; + } + sProcLoaderClientGeckoInitialized = true; FileDescriptor *fd = new FileDescriptor(sProcLoaderChannelFd); From 8f08b97df12bd065a90774652609f7feee294e8e Mon Sep 17 00:00:00 2001 From: Bruce Sun Date: Mon, 1 Sep 2014 18:04:36 +0800 Subject: [PATCH 02/66] Bug 1033915 - Integrate MP3FrameParser into MediaCodecReader. r=cajbir --- content/media/omx/MediaCodecReader.cpp | 320 +++++++++++++++++++++++-- content/media/omx/MediaCodecReader.h | 140 ++++++++++- 2 files changed, 443 insertions(+), 17 deletions(-) diff --git a/content/media/omx/MediaCodecReader.cpp b/content/media/omx/MediaCodecReader.cpp index 7c07cbff79f..d6713eef98b 100644 --- a/content/media/omx/MediaCodecReader.cpp +++ b/content/media/omx/MediaCodecReader.cpp @@ -29,6 +29,7 @@ #include "MediaStreamSource.h" #include "MediaTaskQueue.h" +#include "MP3FrameParser.h" #include "nsThreadUtils.h" #include "ImageContainer.h" #include "SharedThreadPool.h" @@ -131,6 +132,7 @@ MediaCodecReader::TrackInputCopier::Copy(MediaBuffer* aSourceBuffer, MediaCodecReader::Track::Track() : mSourceIsStopped(true) + , mDurationLock("MediaCodecReader::Track::mDurationLock") , mDurationUs(INT64_C(0)) , mInputIndex(sInvalidInputIndex) , mInputEndOfStream(false) @@ -193,10 +195,96 @@ MediaCodecReader::CodecBufferInfo::CodecBufferInfo() { } +MediaCodecReader::SignalObject::SignalObject(const char* aName) + : mMonitor(aName) + , mSignaled(false) +{ +} + +MediaCodecReader::SignalObject::~SignalObject() +{ +} + +void +MediaCodecReader::SignalObject::Wait() +{ + MonitorAutoLock al(mMonitor); + if (!mSignaled) { + mMonitor.Wait(); + } +} + +void +MediaCodecReader::SignalObject::Signal() +{ + MonitorAutoLock al(mMonitor); + mSignaled = true; + mMonitor.Notify(); +} + +MediaCodecReader::ParseCachedDataRunnable::ParseCachedDataRunnable(nsRefPtr aReader, + const char* aBuffer, + uint32_t aLength, + int64_t aOffset, + nsRefPtr aSignal) + : mReader(aReader) + , mBuffer(aBuffer) + , mLength(aLength) + , mOffset(aOffset) + , mSignal(aSignal) +{ + MOZ_ASSERT(mReader, "Should have a valid MediaCodecReader."); + MOZ_ASSERT(mBuffer, "Should have a valid buffer."); + MOZ_ASSERT(mOffset >= INT64_C(0), "Should have a valid offset."); +} + +NS_IMETHODIMP +MediaCodecReader::ParseCachedDataRunnable::Run() +{ + NS_ASSERTION(NS_IsMainThread(), "Should be on main thread."); + + if (mReader->ParseDataSegment(mBuffer, mLength, mOffset)) { + MonitorAutoLock monLock(mReader->mParserMonitor); + if (mReader->mNextParserPosition >= mOffset + mLength && + mReader->mParsedDataLength < mOffset + mLength) { + mReader->mParsedDataLength = mOffset + mLength; + } + } + + if (mSignal != nullptr) { + mSignal->Signal(); + } + + return NS_OK; +} + +MediaCodecReader::ProcessCachedDataTask::ProcessCachedDataTask(nsRefPtr aReader, + int64_t aOffset) + : mReader(aReader) + , mOffset(aOffset) +{ + MOZ_ASSERT(mReader, "Should have a valid MediaCodecReader."); + MOZ_ASSERT(mOffset >= INT64_C(0), "Should have a valid offset."); +} + +void +MediaCodecReader::ProcessCachedDataTask::Run() +{ + mReader->ProcessCachedData(mOffset, nullptr); + nsRefPtr> runnable( + new ReferenceKeeperRunnable(mReader)); + mReader = nullptr; + NS_DispatchToMainThread(runnable.get()); +} + MediaCodecReader::MediaCodecReader(AbstractMediaDecoder* aDecoder) : MediaOmxCommonReader(aDecoder) , mColorConverterBufferSize(0) , mExtractor(nullptr) + , mParserMonitor("MediaCodecReader::mParserMonitor") + , mParseDataFromCache(true) + , mNextParserPosition(INT64_C(0)) + , mParsedDataLength(INT64_C(0)) { mHandler = new MessageHandler(this); mVideoListener = new VideoResourceListener(this); @@ -421,6 +509,144 @@ MediaCodecReader::HasVideo() return mInfo.mVideo.mHasVideo; } +void +MediaCodecReader::NotifyDataArrived(const char* aBuffer, + uint32_t aLength, + int64_t aOffset) +{ + MonitorAutoLock monLock(mParserMonitor); + if (mNextParserPosition == mParsedDataLength && + mNextParserPosition >= aOffset && + mNextParserPosition <= aOffset + aLength) { + // No pending parsing runnable currently. And available data are adjacent to + // parsed data. + int64_t shift = mNextParserPosition - aOffset; + const char* buffer = aBuffer + shift; + uint32_t length = aLength - shift; + int64_t offset = mNextParserPosition; + if (length > 0) { + MonitorAutoUnlock monUnlock(mParserMonitor); + ParseDataSegment(buffer, length, offset); + } + mParseDataFromCache = false; + mParsedDataLength = offset + length; + mNextParserPosition = mParsedDataLength; + } +} + +int64_t +MediaCodecReader::ProcessCachedData(int64_t aOffset, + nsRefPtr aSignal) +{ + // We read data in chunks of 32 KiB. We can reduce this + // value if media, such as sdcards, is too slow. + // Because of SD card's slowness, need to keep sReadSize to small size. + // See Bug 914870. + static const int64_t sReadSize = 32 * 1024; + + MOZ_ASSERT(!NS_IsMainThread(), "Should not be on main thread."); + + { + MonitorAutoLock monLock(mParserMonitor); + if (!mParseDataFromCache) { + // Skip cache processing since data can be continuously be parsed by + // ParseDataSegment() from NotifyDataArrived() directly. + return INT64_C(0); + } + } + + MediaResource *resource = mDecoder->GetResource(); + MOZ_ASSERT(resource); + + int64_t resourceLength = resource->GetCachedDataEnd(0); + NS_ENSURE_TRUE(resourceLength >= 0, INT64_C(-1)); + + if (aOffset >= resourceLength) { + return INT64_C(0); // Cache is empty, nothing to do + } + + int64_t bufferLength = std::min(resourceLength - aOffset, sReadSize); + + nsAutoArrayPtr buffer(new char[bufferLength]); + + nsresult rv = resource->ReadFromCache(buffer.get(), aOffset, bufferLength); + NS_ENSURE_SUCCESS(rv, INT64_C(-1)); + + MonitorAutoLock monLock(mParserMonitor); + if (mParseDataFromCache) { + nsRefPtr runnable( + new ParseCachedDataRunnable(this, + buffer.forget(), + bufferLength, + aOffset, + aSignal)); + + rv = NS_DispatchToMainThread(runnable.get()); + NS_ENSURE_SUCCESS(rv, INT64_C(-1)); + + mNextParserPosition = aOffset + bufferLength; + if (mNextParserPosition < resource->GetCachedDataEnd(0)) { + // We cannot read data in the main thread because it + // might block for too long. Instead we post an IO task + // to the IO thread if there is more data available. + XRE_GetIOMessageLoop()->PostTask(FROM_HERE, + new ProcessCachedDataTask(this, mNextParserPosition)); + } + } + + return bufferLength; +} + +bool +MediaCodecReader::ParseDataSegment(const char* aBuffer, + uint32_t aLength, + int64_t aOffset) +{ + NS_ASSERTION(NS_IsMainThread(), "Should be on main thread."); + + int64_t duration = INT64_C(-1); + + { + MonitorAutoLock monLock(mParserMonitor); + + // currently only mp3 files are supported for incremental parsing + if (mMP3FrameParser == nullptr) { + return false; + } + + if (!mMP3FrameParser->IsMP3()) { + return true; // NO-OP + } + + mMP3FrameParser->Parse(aBuffer, aLength, aOffset); + + duration = mMP3FrameParser->GetDuration(); + } + + bool durationUpdateRequired = false; + + { + MutexAutoLock al(mAudioTrack.mDurationLock); + if (duration > mAudioTrack.mDurationUs) { + mAudioTrack.mDurationUs = duration; + durationUpdateRequired = true; + } + } + + if (durationUpdateRequired && HasVideo()) { + MutexAutoLock al(mVideoTrack.mDurationLock); + durationUpdateRequired = duration > mVideoTrack.mDurationUs; + } + + if (durationUpdateRequired) { + MOZ_ASSERT(mDecoder); + ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor()); + mDecoder->UpdateEstimatedMediaDuration(duration); + } + + return true; +} + nsresult MediaCodecReader::ReadMetadata(MediaInfo* aInfo, MetadataTags** aTags) @@ -435,6 +661,10 @@ MediaCodecReader::ReadMetadata(MediaInfo* aInfo, CheckAudioOffload(); #endif + if (!TriggerIncrementalParser()) { + return NS_ERROR_FAILURE; + } + if (IsWaitingMediaResources()) { return NS_OK; } @@ -454,9 +684,18 @@ MediaCodecReader::ReadMetadata(MediaInfo* aInfo, } // Set the total duration (the max of the audio and video track). - int64_t duration = mAudioTrack.mDurationUs > mVideoTrack.mDurationUs ? - mAudioTrack.mDurationUs : mVideoTrack.mDurationUs; - if (duration >= 0LL) { + int64_t audioDuration = INT64_C(-1); + { + MutexAutoLock al(mAudioTrack.mDurationLock); + audioDuration = mAudioTrack.mDurationUs; + } + int64_t videoDuration = INT64_C(-1); + { + MutexAutoLock al(mVideoTrack.mDurationLock); + videoDuration = mVideoTrack.mDurationUs; + } + int64_t duration = audioDuration > videoDuration ? audioDuration : videoDuration; + if (duration >= INT64_C(0)) { ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor()); mDecoder->SetMediaDuration(duration); } @@ -814,8 +1053,7 @@ MediaCodecReader::CreateMediaSources() return false; } - sp extractorMetaData = mExtractor->getMetaData(); - // TODO: Check MP3 file format + mMetaData = mExtractor->getMetaData(); const ssize_t invalidTrackIndex = -1; ssize_t audioTrackIndex = invalidTrackIndex; @@ -960,7 +1198,6 @@ MediaCodecReader::CreateMediaCodec(sp& aLooper, bool MediaCodecReader::ConfigureMediaCodec(Track& aTrack) { - if (aTrack.mSource != nullptr && aTrack.mCodec != nullptr) { if (!aTrack.mCodec->allocated()) { return false; @@ -1009,6 +1246,54 @@ MediaCodecReader::DestroyMediaCodecs(Track& aTrack) aTrack.mCodec = nullptr; } +bool +MediaCodecReader::TriggerIncrementalParser() +{ + if (mMetaData == nullptr) { + return false; + } + + int64_t duration = INT64_C(-1); + + { + MonitorAutoLock monLock(mParserMonitor); + + // only support incremental parsing for mp3 currently. + if (mMP3FrameParser != nullptr) { + return true; + } + + mParseDataFromCache = true; + mNextParserPosition = INT64_C(0); + mParsedDataLength = INT64_C(0); + + // MP3 file duration + mMP3FrameParser = new MP3FrameParser(mDecoder->GetResource()->GetLength()); + const char* mime = nullptr; + if (mMetaData->findCString(kKeyMIMEType, &mime) && + !strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_MPEG)) { + { + MonitorAutoUnlock monUnlock(mParserMonitor); + // trigger parsing logic and wait for finishing parsing data in the beginning. + nsRefPtr signalObject = new SignalObject("MediaCodecReader::UpdateDuration()"); + if (ProcessCachedData(INT64_C(0), signalObject) > INT64_C(0)) { + signalObject->Wait(); + } + } + duration = mMP3FrameParser->GetDuration(); + } + } + + { + MutexAutoLock al(mAudioTrack.mDurationLock); + if (duration > mAudioTrack.mDurationUs) { + mAudioTrack.mDurationUs = duration; + } + } + + return true; +} + bool MediaCodecReader::UpdateDuration() { @@ -1016,23 +1301,26 @@ MediaCodecReader::UpdateDuration() if (mAudioTrack.mSource != nullptr) { sp audioFormat = mAudioTrack.mSource->getFormat(); if (audioFormat != nullptr) { - int64_t audioDurationUs = 0LL; - if (audioFormat->findInt64(kKeyDuration, &audioDurationUs) && - audioDurationUs > mAudioTrack.mDurationUs) { - mAudioTrack.mDurationUs = audioDurationUs; + int64_t duration = INT64_C(0); + if (audioFormat->findInt64(kKeyDuration, &duration)) { + MutexAutoLock al(mAudioTrack.mDurationLock); + if (duration > mAudioTrack.mDurationUs) { + mAudioTrack.mDurationUs = duration; + } } } } - // TODO: MP3 file duration // read video duration if (mVideoTrack.mSource != nullptr) { sp videoFormat = mVideoTrack.mSource->getFormat(); if (videoFormat != nullptr) { - int64_t videoDurationUs = 0LL; - if (videoFormat->findInt64(kKeyDuration, &videoDurationUs) && - videoDurationUs > mVideoTrack.mDurationUs) { - mVideoTrack.mDurationUs = videoDurationUs; + int64_t duration = INT64_C(0); + if (videoFormat->findInt64(kKeyDuration, &duration)) { + MutexAutoLock al(mVideoTrack.mDurationLock); + if (duration > mVideoTrack.mDurationUs) { + mVideoTrack.mDurationUs = duration; + } } } } @@ -1396,7 +1684,7 @@ MediaCodecReader::EnsureCodecFormatParsed(Track& aTrack) size_t index = 0; size_t offset = 0; size_t size = 0; - int64_t timeUs = 0LL; + int64_t timeUs = INT64_C(0); uint32_t flags = 0; while ((status = aTrack.mCodec->dequeueOutputBuffer(&index, &offset, &size, &timeUs, &flags)) != INFO_FORMAT_CHANGED) { diff --git a/content/media/omx/MediaCodecReader.h b/content/media/omx/MediaCodecReader.h index 53cf89f1ac1..48b14c2940b 100644 --- a/content/media/omx/MediaCodecReader.h +++ b/content/media/omx/MediaCodecReader.h @@ -9,7 +9,11 @@ #include +#include + #include +#include +#include #include "MediaData.h" @@ -22,14 +26,15 @@ struct ALooper; struct AMessage; class MOZ_EXPORT MediaExtractor; +class MOZ_EXPORT MetaData; class MOZ_EXPORT MediaBuffer; struct MOZ_EXPORT MediaSource; -struct MediaCodec; } // namespace android namespace mozilla { class MediaTaskQueue; +class MP3FrameParser; class MediaCodecReader : public MediaOmxCommonReader { @@ -55,6 +60,11 @@ public: // irreversible, whereas ReleaseMediaResources() is reversible. virtual void Shutdown(); + // Used to retrieve some special information that can only be retrieved after + // all contents have been continuously parsed. (ex. total duration of some + // variable-bit-rate MP3 files.) + virtual void NotifyDataArrived(const char* aBuffer, uint32_t aLength, int64_t aOffset); + // Flush the MediaTaskQueue, flush MediaCodec and raise the mDiscontinuity. virtual nsresult ResetDecode() MOZ_OVERRIDE; @@ -109,6 +119,8 @@ protected: nsAutoPtr mInputCopier; // media parameters + Mutex mDurationLock; // mDurationUs might be read or updated from multiple + // threads. int64_t mDurationUs; // playback parameters @@ -122,6 +134,11 @@ protected: bool mFlushed; // meaningless when mSeekTimeUs is invalid. bool mDiscontinuity; nsRefPtr mTaskQueue; + + private: + // Forbidden + Track(const Track &rhs) MOZ_DELETE; + const Track &operator=(const Track&) MOZ_DELETE; }; // Receive a message from MessageHandler. @@ -188,6 +205,11 @@ private: struct AudioTrack : public Track { AudioTrack(); + + private: + // Forbidden + AudioTrack(const AudioTrack &rhs) MOZ_DELETE; + const AudioTrack &operator=(const AudioTrack &rhs) MOZ_DELETE; }; struct VideoTrack : public Track @@ -203,6 +225,11 @@ private: nsIntSize mFrameSize; nsIntRect mPictureRect; gfx::IntRect mRelativePictureRect; + + private: + // Forbidden + VideoTrack(const VideoTrack &rhs) MOZ_DELETE; + const VideoTrack &operator=(const VideoTrack &rhs) MOZ_DELETE; }; struct CodecBufferInfo @@ -217,6 +244,101 @@ private: uint32_t mFlags; }; + class SignalObject + { + public: + NS_INLINE_DECL_THREADSAFE_REFCOUNTING(SignalObject) + + SignalObject(const char* aName); + ~SignalObject(); + void Wait(); + void Signal(); + + private: + // Forbidden + SignalObject() MOZ_DELETE; + SignalObject(const SignalObject &rhs) MOZ_DELETE; + const SignalObject &operator=(const SignalObject &rhs) MOZ_DELETE; + + Monitor mMonitor; + bool mSignaled; + }; + + class ParseCachedDataRunnable : public nsRunnable + { + public: + ParseCachedDataRunnable(nsRefPtr aReader, + const char* aBuffer, + uint32_t aLength, + int64_t aOffset, + nsRefPtr aSignal); + + NS_IMETHOD Run() MOZ_OVERRIDE; + + private: + // Forbidden + ParseCachedDataRunnable() MOZ_DELETE; + ParseCachedDataRunnable(const ParseCachedDataRunnable &rhs) MOZ_DELETE; + const ParseCachedDataRunnable &operator=(const ParseCachedDataRunnable &rhs) MOZ_DELETE; + + nsRefPtr mReader; + nsAutoArrayPtr mBuffer; + uint32_t mLength; + int64_t mOffset; + nsRefPtr mSignal; + }; + friend class ParseCachedDataRunnable; + + class ProcessCachedDataTask : public Task + { + public: + ProcessCachedDataTask(nsRefPtr aReader, + int64_t aOffset); + + void Run() MOZ_OVERRIDE; + + private: + // Forbidden + ProcessCachedDataTask() MOZ_DELETE; + ProcessCachedDataTask(const ProcessCachedDataTask &rhs) MOZ_DELETE; + const ProcessCachedDataTask &operator=(const ProcessCachedDataTask &rhs) MOZ_DELETE; + + nsRefPtr mReader; + int64_t mOffset; + }; + friend class ProcessCachedDataTask; + + // This class is used to keep one reference count of T in it. And this class + // can make sure the stored reference count will be released on the dispatched + // thread. By using this class properly (ex. passing the pointer into this + // runnable first, then releasing the original pointer held by ourselves, and + // then dispatching this runnable onto the desired thread), we can avoid + // running the destructor of the referenced object on any other threads + // unexpectedly before this runnable has been executed. + template + class ReferenceKeeperRunnable : public nsRunnable + { + public: + ReferenceKeeperRunnable(nsRefPtr aPointer) + : mPointer(aPointer) + { + } + + NS_IMETHOD Run() MOZ_OVERRIDE + { + mPointer = nullptr; + return NS_OK; + } + + private: + // Forbidden + ReferenceKeeperRunnable() MOZ_DELETE; + ReferenceKeeperRunnable(const ReferenceKeeperRunnable &rhs) MOZ_DELETE; + const ReferenceKeeperRunnable &operator=(const ReferenceKeeperRunnable &rhs) MOZ_DELETE; + + nsRefPtr mPointer; + }; + // Forbidden MediaCodecReader() MOZ_DELETE; const MediaCodecReader& operator=(const MediaCodecReader& rhs) MOZ_DELETE; @@ -260,6 +382,8 @@ private: mAudioTrack.mTaskQueue); } + bool TriggerIncrementalParser(); + bool UpdateDuration(); bool UpdateAudioInfo(); bool UpdateVideoInfo(); @@ -275,10 +399,17 @@ private: uint8_t* GetColorConverterBuffer(int32_t aWidth, int32_t aHeight); void ClearColorConverterBuffer(); + int64_t ProcessCachedData(int64_t aOffset, + nsRefPtr aSignal); + bool ParseDataSegment(const char* aBuffer, + uint32_t aLength, + int64_t aOffset); + android::sp mHandler; android::sp mVideoListener; android::sp mLooper; + android::sp mMetaData; // media tracks AudioTrack mAudioTrack; @@ -289,6 +420,13 @@ private: android::I420ColorConverterHelper mColorConverter; nsAutoArrayPtr mColorConverterBuffer; size_t mColorConverterBufferSize; + + // incremental parser + Monitor mParserMonitor; + bool mParseDataFromCache; + int64_t mNextParserPosition; + int64_t mParsedDataLength; + nsAutoPtr mMP3FrameParser; }; } // namespace mozilla From 8e92503f67cebf0d01ce496f3df5a4d7c86048fd Mon Sep 17 00:00:00 2001 From: Martin Thomson Date: Fri, 29 Aug 2014 14:59:00 +0200 Subject: [PATCH 03/66] Bug 1036737 - Adding fallback SCSV use. r=dkeeler --- security/manager/ssl/src/nsNSSIOLayer.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/security/manager/ssl/src/nsNSSIOLayer.cpp b/security/manager/ssl/src/nsNSSIOLayer.cpp index 88b6cbbdb0f..5d73577f547 100644 --- a/security/manager/ssl/src/nsNSSIOLayer.cpp +++ b/security/manager/ssl/src/nsNSSIOLayer.cpp @@ -1800,16 +1800,16 @@ nsGetUserCertChoice(SSM_UserCertChoice* certChoice) { char* mode = nullptr; nsresult ret; - + NS_ENSURE_ARG_POINTER(certChoice); - + nsCOMPtr pref = do_GetService(NS_PREFSERVICE_CONTRACTID); - + ret = pref->GetCharPref("security.default_personal_cert", &mode); if (NS_FAILED(ret)) { goto loser; } - + if (PL_strcmp(mode, "Select Automatically") == 0) { *certChoice = AUTO; } else if (PL_strcmp(mode, "Ask Every Time") == 0) { @@ -2394,6 +2394,8 @@ nsSSLIOLayerSetOptions(PRFileDesc* fd, bool forSTARTTLS, return NS_ERROR_FAILURE; } + uint16_t maxEnabledVersion = range.max; + infoObject->SharedState().IOLayerHelpers() .adjustForTLSIntolerance(infoObject->GetHostName(), infoObject->GetPort(), range); @@ -2407,6 +2409,16 @@ nsSSLIOLayerSetOptions(PRFileDesc* fd, bool forSTARTTLS, } infoObject->SetTLSVersionRange(range); + // when adjustForTLSIntolerance tweaks the maximum version downward, + // we tell the server using this SCSV so they can detect a downgrade attack + if (range.max < maxEnabledVersion) { + PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, + ("[%p] nsSSLIOLayerSetOptions: enabling TLS_FALLBACK_SCSV\n", fd)); + if (SECSuccess != SSL_OptionSet(fd, SSL_ENABLE_FALLBACK_SCSV, true)) { + return NS_ERROR_FAILURE; + } + } + bool enabled = infoObject->SharedState().IsOCSPStaplingEnabled(); if (SECSuccess != SSL_OptionSet(fd, SSL_ENABLE_OCSP_STAPLING, enabled)) { return NS_ERROR_FAILURE; From e3ed8213b61e2be4ee92002ba407c989629e0798 Mon Sep 17 00:00:00 2001 From: Zac Campbell Date: Fri, 29 Aug 2014 14:20:30 +0100 Subject: [PATCH 04/66] Bug 1060279 - Update marionette client b2g mixin to return DM only when session exists. r=mdas --- testing/marionette/client/marionette/runner/mixins/b2g.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/marionette/client/marionette/runner/mixins/b2g.py b/testing/marionette/client/marionette/runner/mixins/b2g.py index 129fb882c4f..0adbc30f072 100644 --- a/testing/marionette/client/marionette/runner/mixins/b2g.py +++ b/testing/marionette/client/marionette/runner/mixins/b2g.py @@ -43,7 +43,7 @@ class B2GTestCaseMixin(object): capabilities = self.marionette.session and \ self.marionette.session_capabilities or {} if not self._device_manager and \ - capabilities.get('device') != 'desktop': + capabilities.get('platform').lower() == 'android': self._device_manager = get_dm(self.marionette, **kwargs) return self._device_manager From 139f4f62ce0f3f265600b2d3b4b7c6f1de1a78c1 Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Tue, 2 Sep 2014 08:36:48 +0100 Subject: [PATCH 05/66] Bug 1046578 - HTMLMediaElement has to change the audioChannel of the MediaStream, r=roc --- content/html/content/src/HTMLMediaElement.cpp | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/content/html/content/src/HTMLMediaElement.cpp b/content/html/content/src/HTMLMediaElement.cpp index 270fe914ad0..b27532f7199 100755 --- a/content/html/content/src/HTMLMediaElement.cpp +++ b/content/html/content/src/HTMLMediaElement.cpp @@ -2358,10 +2358,23 @@ bool HTMLMediaElement::ParseAttribute(int32_t aNamespaceID, AudioChannel audioChannel = static_cast(aResult.GetEnumValue()); - if (audioChannel != mAudioChannel && - !mDecoder && - CheckAudioChannelPermissions(aValue)) { - mAudioChannel = audioChannel; + if (audioChannel == mAudioChannel || + !CheckAudioChannelPermissions(aValue)) { + return true; + } + + // We cannot change the AudioChannel of a decoder. + if (mDecoder) { + return true; + } + + mAudioChannel = audioChannel; + + if (mSrcStream) { + nsRefPtr stream = mSrcStream->GetStream(); + if (stream) { + stream->SetAudioChannelType(mAudioChannel); + } } return true; @@ -2822,6 +2835,12 @@ void HTMLMediaElement::SetupSrcMediaStreamPlayback(DOMMediaStream* aStream) NS_ASSERTION(!mSrcStream && !mSrcStreamListener, "Should have been ended already"); mSrcStream = aStream; + + nsRefPtr stream = mSrcStream->GetStream(); + if (stream) { + stream->SetAudioChannelType(mAudioChannel); + } + // XXX if we ever support capturing the output of a media element which is // playing a stream, we'll need to add a CombineWithPrincipal call here. mSrcStreamListener = new StreamListener(this); From 4ed3b76f1043ce726d569b8de88b0a60a152487d Mon Sep 17 00:00:00 2001 From: Blake Wu Date: Mon, 1 Sep 2014 13:32:47 +0800 Subject: [PATCH 06/66] Bug 1036775 - Add one more define check to separate omx decoder mp4 decoder. r=edwin --- content/media/DecoderTraits.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/content/media/DecoderTraits.cpp b/content/media/DecoderTraits.cpp index 1f045795e31..d4c191d9cfe 100644 --- a/content/media/DecoderTraits.cpp +++ b/content/media/DecoderTraits.cpp @@ -324,10 +324,18 @@ IsDirectShowSupportedType(const nsACString& aType) #ifdef MOZ_FMP4 static bool -IsMP4SupportedType(const nsACString& aType) +IsMP4SupportedType(const nsACString& aType, + const nsAString& aCodecs = EmptyString()) { +// Currently on B2G, FMP4 is only working for MSE playback. +// For other normal MP4, it still uses current omx decoder. +// Bug 1061034 is a follow-up bug to enable all MP4s with MOZ_FMP4 +#ifdef MOZ_OMX_DECODER + return false; +#else return Preferences::GetBool("media.fragmented-mp4.exposed", false) && - MP4Decoder::CanHandleMediaType(aType); + MP4Decoder::CanHandleMediaType(aType, aCodecs); +#endif } #endif @@ -410,7 +418,7 @@ DecoderTraits::CanHandleMediaType(const char* aMIMEType, } #endif #ifdef MOZ_FMP4 - if (MP4Decoder::CanHandleMediaType(nsDependentCString(aMIMEType), + if (IsMP4SupportedType(nsDependentCString(aMIMEType), aRequestedCodecs)) { return aHaveRequestedCodecs ? CANPLAY_YES : CANPLAY_MAYBE; } From d956f98bcbfdb1599fc113bbbedcc8c3291bc809 Mon Sep 17 00:00:00 2001 From: Alex Bardas Date: Fri, 29 Aug 2014 11:13:00 +0200 Subject: [PATCH 07/66] Bug 1042521 - Use original input when calling KeywordToURI and do not trim the input before calling urifixup in tests. r=Gijs --- docshell/base/nsDefaultURIFixup.cpp | 5 +++-- .../test/unit/test_nsDefaultURIFixup_info.js | 17 ++++++++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/docshell/base/nsDefaultURIFixup.cpp b/docshell/base/nsDefaultURIFixup.cpp index b7e053357fe..0061f3ea886 100644 --- a/docshell/base/nsDefaultURIFixup.cpp +++ b/docshell/base/nsDefaultURIFixup.cpp @@ -142,10 +142,11 @@ nsDefaultURIFixup::GetFixupURIInfo(const nsACString& aStringURI, uint32_t aFixup nsresult rv; nsAutoCString uriString(aStringURI); - uriString.Trim(" "); // Cleanup the empty spaces that might be on each end. // Eliminate embedded newlines, which single-line text fields now allow: uriString.StripChars("\r\n"); + // Cleanup the empty spaces that might be on each end: + uriString.Trim(" "); NS_ENSURE_TRUE(!uriString.IsEmpty(), NS_ERROR_FAILURE); @@ -950,7 +951,7 @@ void nsDefaultURIFixup::KeywordURIFixup(const nsACString & aURIString, (spaceLoc < qMarkLoc || quoteLoc < qMarkLoc)) || qMarkLoc == 0) { - rv = KeywordToURI(aURIString, aPostData, + rv = KeywordToURI(aFixupInfo->mOriginalInput, aPostData, getter_AddRefs(aFixupInfo->mPreferredURI)); if (NS_SUCCEEDED(rv) && aFixupInfo->mPreferredURI) { diff --git a/docshell/test/unit/test_nsDefaultURIFixup_info.js b/docshell/test/unit/test_nsDefaultURIFixup_info.js index f7d14c71e69..c63f5cb2207 100644 --- a/docshell/test/unit/test_nsDefaultURIFixup_info.js +++ b/docshell/test/unit/test_nsDefaultURIFixup_info.js @@ -60,6 +60,14 @@ let testcases = [ [".test", "http://.test/", "http://www..test/", true, true], ["mozilla is amazing", null, null, true, true], ["mozilla ", "http://mozilla/", "http://www.mozilla.com/", true, true], + [" mozilla ", "http://mozilla/", "http://www.mozilla.com/", true, true], + ["mozilla \\", null, null, true, true], + ["mozilla \\ foo.txt", null, null, true, true], + ["mozilla \\\r foo.txt", null, null, true, true], + ["mozilla\n", "http://mozilla/", "http://www.mozilla.com/", true, true], + ["mozilla \r\n", "http://mozilla/", "http://www.mozilla.com/", true, true], + ["moz\r\nfirefox\nos\r", "http://mozfirefoxos/", "http://www.mozfirefoxos.com/", true, true], + ["moz\r\n firefox\n", null, null, true, true], ["", null, null, true, true], ["[]", null, null, true, true] ]; @@ -74,10 +82,13 @@ if (Services.appinfo.OS.toLowerCase().startsWith("win")) { testcases.push(["mozilla\\", "http://mozilla\\/", "http://www.mozilla/", true, true]); } +function sanitize(input) { + return input.replace(/\r|\n/g, "").trim(); +} + function run_test() { for (let [testInput, expectedFixedURI, alternativeURI, expectKeywordLookup, expectProtocolChange] of testcases) { - testInput = testInput.trim(); for (let flags of flagInputs) { let info; let fixupURIOnly = null; @@ -121,7 +132,7 @@ function run_test() { // Check the preferred URI if (couldDoKeywordLookup && expectKeywordLookup) { - let urlparamInput = encodeURIComponent(testInput).replace("%20", "+", "g"); + let urlparamInput = encodeURIComponent(sanitize(testInput)).replace("%20", "+", "g"); let searchURL = kSearchEngineURL.replace("{searchTerms}", urlparamInput); do_check_eq(info.preferredURI.spec, searchURL); } else { @@ -129,7 +140,7 @@ function run_test() { // the fixed URI should be preferred: do_check_eq(info.preferredURI.spec, info.fixedURI.spec); } - do_check_eq(testInput, info.originalInput); + do_check_eq(sanitize(testInput), info.originalInput); } } } From 667bcd280f2dc6c30b60929d804f8571996ac754 Mon Sep 17 00:00:00 2001 From: Nathan Yee Date: Thu, 28 Aug 2014 22:37:00 +0200 Subject: [PATCH 08/66] Bug 1025173 - Nullable copy, move, and assignment should not transfer |mValue| if |mIsNull|. r=bz --- dom/bindings/Nullable.h | 63 +++++++++++++---------------------------- 1 file changed, 20 insertions(+), 43 deletions(-) diff --git a/dom/bindings/Nullable.h b/dom/bindings/Nullable.h index dfbf7f90a1c..b5f394701a6 100644 --- a/dom/bindings/Nullable.h +++ b/dom/bindings/Nullable.h @@ -10,6 +10,7 @@ #include "mozilla/Assertions.h" #include "nsTArrayForwardDeclare.h" #include "mozilla/Move.h" +#include "mozilla/Maybe.h" class nsCycleCollectionTraversalCallback; @@ -21,73 +22,66 @@ template struct Nullable { private: - // mIsNull MUST COME FIRST because otherwise the casting in our array - // conversion operators would shift where it is found in the struct. - bool mIsNull; - T mValue; + Maybe mValue; public: Nullable() - : mIsNull(true) + : mValue() {} explicit Nullable(T aValue) - : mIsNull(false) - , mValue(aValue) - {} + : mValue() + { + mValue.emplace(aValue); + } explicit Nullable(Nullable&& aOther) - : mIsNull(aOther.mIsNull) - , mValue(mozilla::Move(aOther.mValue)) + : mValue(mozilla::Move(aOther.mValue)) {} Nullable(const Nullable& aOther) - : mIsNull(aOther.mIsNull) - , mValue(aOther.mValue) + : mValue(aOther.mValue) {} void operator=(const Nullable& aOther) { - mIsNull = aOther.mIsNull; mValue = aOther.mValue; } void SetValue(T aValue) { - mValue = aValue; - mIsNull = false; + mValue.reset(); + mValue.emplace(aValue); } // For cases when |T| is some type with nontrivial copy behavior, we may want // to get a reference to our internal copy of T and work with it directly // instead of relying on the copying version of SetValue(). T& SetValue() { - mIsNull = false; - return mValue; + if (mValue.isNothing()) { + mValue.emplace(); + } + return mValue.ref(); } void SetNull() { - mIsNull = true; + mValue.reset(); } const T& Value() const { - MOZ_ASSERT(!mIsNull); - return mValue; + return mValue.ref(); } T& Value() { - MOZ_ASSERT(!mIsNull); - return mValue; + return mValue.ref(); } bool IsNull() const { - return mIsNull; + return mValue.isNothing(); } bool Equals(const Nullable& aOtherNullable) const { - return (mIsNull && aOtherNullable.mIsNull) || - (!mIsNull && !aOtherNullable.mIsNull && - mValue == aOtherNullable.mValue); + return mValue == aOtherNullable.mValue; } bool operator==(const Nullable& aOtherNullable) const @@ -99,23 +93,6 @@ public: { return !Equals(aOtherNullable); } - - // Make it possible to use a const Nullable of an array type with other - // array types. - template - operator const Nullable< nsTArray >&() const { - // Make sure that T is ok to reinterpret to nsTArray - const nsTArray& arr = mValue; - (void)arr; - return *reinterpret_cast >*>(this); - } - template - operator const Nullable< FallibleTArray >&() const { - // Make sure that T is ok to reinterpret to FallibleTArray - const FallibleTArray& arr = mValue; - (void)arr; - return *reinterpret_cast >*>(this); - } }; From 438928e59fe04e34ba28b5a3a7765177eb6af8c4 Mon Sep 17 00:00:00 2001 From: Vincent Liu Date: Mon, 1 Sep 2014 13:52:03 +0800 Subject: [PATCH 09/66] Bug 1060811 - PlanarYCbCrData contains null for color conversion if the output format of HW decoder is YV12. r=Sotaro --- gfx/layers/GrallocImages.cpp | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/gfx/layers/GrallocImages.cpp b/gfx/layers/GrallocImages.cpp index 1d1de1b5044..ff1375a231f 100644 --- a/gfx/layers/GrallocImages.cpp +++ b/gfx/layers/GrallocImages.cpp @@ -317,11 +317,30 @@ ConvertOmxYUVFormatToRGB565(android::sp& aBuffer, } if (format == HAL_PIXEL_FORMAT_YV12) { - gfx::ConvertYCbCrToRGB(aYcbcrData, + // Depend on platforms, it is possible for HW decoder to output YV12 format. + // It means the mData won't be configured during the SetData API because the + // yuv data has already stored in GraphicBuffer. Here we try to confgiure the + // mData if it doesn't contain valid configuration. + layers::PlanarYCbCrData ycbcrData = aYcbcrData; + if (!ycbcrData.mYChannel) { + ycbcrData.mYChannel = buffer; + ycbcrData.mYSkip = 0; + ycbcrData.mYStride = aBuffer->getStride(); + ycbcrData.mYSize = aSurface->GetSize(); + ycbcrData.mCbSkip = 0; + ycbcrData.mCbCrSize = aSurface->GetSize() / 2; + ycbcrData.mPicSize = aSurface->GetSize(); + ycbcrData.mCrChannel = buffer + ycbcrData.mYStride * ycbcrData.mYSize.height; + ycbcrData.mCrSkip = 0; + // Align to 16 bytes boundary + ycbcrData.mCbCrStride = ((ycbcrData.mYStride / 2) + 15) & ~0x0F; + ycbcrData.mCbChannel = ycbcrData.mCrChannel + (ycbcrData.mCbCrStride * ycbcrData.mCbCrSize.height); + } + gfx::ConvertYCbCrToRGB(ycbcrData, aSurface->GetFormat(), aSurface->GetSize(), - aSurface->GetData(), - aSurface->Stride()); + aMappedSurface->mData, + aMappedSurface->mStride); return OK; } From f10fc56d28ce624f852c0ebfb6bdbc1f2db89e3c Mon Sep 17 00:00:00 2001 From: Alexandre Poirot Date: Thu, 28 Aug 2014 10:10:00 +0200 Subject: [PATCH 10/66] Bug 1043699 - Fix command line arguments handling on desktop. r=fabrice --- b2g/chrome/content/desktop.js | 12 ++++++++---- b2g/chrome/content/runapp.js | 11 ++++++++--- b2g/chrome/content/screen.js | 4 ++-- b2g/components/B2GComponents.manifest | 6 +++++- b2g/components/CommandLine.js | 25 +++++++++++++++++++++++++ b2g/components/moz.build | 1 + b2g/installer/package-manifest.in | 1 + 7 files changed, 50 insertions(+), 10 deletions(-) create mode 100644 b2g/components/CommandLine.js diff --git a/b2g/chrome/content/desktop.js b/b2g/chrome/content/desktop.js index 3f345238a5e..8071aa9b751 100644 --- a/b2g/chrome/content/desktop.js +++ b/b2g/chrome/content/desktop.js @@ -55,13 +55,17 @@ function checkDebuggerPort() { // DebuggerServer.openListener detects that it isn't a file path (string), // and starts listening on the tcp port given here as command line argument. - if (!window.arguments) { + // Get the command line arguments that were passed to the b2g client + let args; + try { + let service = Cc["@mozilla.org/commandlinehandler/general-startup;1?type=b2gcmds"].getService(Ci.nsISupports); + args = service.wrappedJSObject.cmdLine; + } catch(e) {} + + if (!args) { return; } - // Get the command line arguments that were passed to the b2g client - let args = window.arguments[0].QueryInterface(Ci.nsICommandLine); - let dbgport; try { dbgport = args.handleFlagWithParam('start-debugger-server', false); diff --git a/b2g/chrome/content/runapp.js b/b2g/chrome/content/runapp.js index 70274b30fd5..dc851db11bc 100644 --- a/b2g/chrome/content/runapp.js +++ b/b2g/chrome/content/runapp.js @@ -5,12 +5,17 @@ let runAppObj; window.addEventListener('load', function() { - if (!window.arguments) { + // Get the command line arguments that were passed to the b2g client + let args; + try { + let service = Cc["@mozilla.org/commandlinehandler/general-startup;1?type=b2gcmds"].getService(Ci.nsISupports); + args = service.wrappedJSObject.cmdLine; + } catch(e) {} + + if (!args) { return; } - // Get the command line arguments that were passed to the b2g client - let args = window.arguments[0].QueryInterface(Ci.nsICommandLine); let appname; // - Check if the argument is present before doing any work. diff --git a/b2g/chrome/content/screen.js b/b2g/chrome/content/screen.js index cfdbc0cde68..f49e56c88ab 100644 --- a/b2g/chrome/content/screen.js +++ b/b2g/chrome/content/screen.js @@ -62,8 +62,8 @@ window.addEventListener('ContentStart', function() { // Get the command line arguments that were passed to the b2g client let args; try { - // On Firefox Mulet, we don't always have a command line argument - args = window.arguments[0].QueryInterface(Ci.nsICommandLine); + let service = Cc["@mozilla.org/commandlinehandler/general-startup;1?type=b2gcmds"].getService(Ci.nsISupports); + args = service.wrappedJSObject.cmdLine; } catch(e) {} let screenarg = null; diff --git a/b2g/components/B2GComponents.manifest b/b2g/components/B2GComponents.manifest index 2fe7b730eaf..4cda97cac48 100644 --- a/b2g/components/B2GComponents.manifest +++ b/b2g/components/B2GComponents.manifest @@ -96,6 +96,10 @@ category profile-after-change SimulatorScreen @mozilla.org/simulator-screen;1 component {e30b0e13-2d12-4cb0-bc4c-4e617a1bf76e} OopCommandLine.js contract @mozilla.org/commandlinehandler/general-startup;1?type=b2goop {e30b0e13-2d12-4cb0-bc4c-4e617a1bf76e} category command-line-handler m-b2goop @mozilla.org/commandlinehandler/general-startup;1?type=b2goop + +component {385993fe-8710-4621-9fb1-00a09d8bec37} CommandLine.js +contract @mozilla.org/commandlinehandler/general-startup;1?type=b2gcmds {385993fe-8710-4621-9fb1-00a09d8bec37} +category command-line-handler m-b2gcmds @mozilla.org/commandlinehandler/general-startup;1?type=b2gcmds #endif # MobileIdentityUIGlue.js @@ -105,4 +109,4 @@ contract @mozilla.org/services/mobileid-ui-glue;1 {83dbe26a-81f3-4a75-9541-3d0b7 # B2GAppMigrator.js component {7211ece0-b458-4635-9afc-f8d7f376ee95} B2GAppMigrator.js contract @mozilla.org/b2g-app-migrator;1 {7211ece0-b458-4635-9afc-f8d7f376ee95} -category profile-after-change B2GAppMigrator @mozilla.org/b2g-app-migrator;1 \ No newline at end of file +category profile-after-change B2GAppMigrator @mozilla.org/b2g-app-migrator;1 diff --git a/b2g/components/CommandLine.js b/b2g/components/CommandLine.js new file mode 100644 index 00000000000..bdb1221e8b7 --- /dev/null +++ b/b2g/components/CommandLine.js @@ -0,0 +1,25 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +const { classes: Cc, interfaces: Ci, utils: Cu } = Components; +Cu.import("resource://gre/modules/XPCOMUtils.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "Services", "resource://gre/modules/Services.jsm"); + +// Small helper to expose nsICommandLine object to chrome code + +function CommandlineHandler() { + this.wrappedJSObject = this; +} + +CommandlineHandler.prototype = { + handle: function(cmdLine) { + this.cmdLine = cmdLine; + }, + + helpInfo: "", + classID: Components.ID("{385993fe-8710-4621-9fb1-00a09d8bec37}"), + QueryInterface: XPCOMUtils.generateQI([Ci.nsICommandLineHandler]), +}; + +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([CommandlineHandler]); diff --git a/b2g/components/moz.build b/b2g/components/moz.build index 79ccff80c86..856d9d898c4 100644 --- a/b2g/components/moz.build +++ b/b2g/components/moz.build @@ -30,6 +30,7 @@ EXTRA_COMPONENTS += [ if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk': EXTRA_COMPONENTS += [ + 'CommandLine.js', 'OopCommandLine.js', 'SimulatorScreen.js' ] diff --git a/b2g/installer/package-manifest.in b/b2g/installer/package-manifest.in index 1636ed37f49..42af31c5530 100644 --- a/b2g/installer/package-manifest.in +++ b/b2g/installer/package-manifest.in @@ -451,6 +451,7 @@ @BINPATH@/components/amWebInstallListener.js @BINPATH@/components/nsBlocklistService.js @BINPATH@/components/OopCommandLine.js +@BINPATH@/components/CommandLine.js #endif #ifdef MOZ_UPDATER From 9e74981de059212bbd81b497c721082deab44443 Mon Sep 17 00:00:00 2001 From: Chris Manchester Date: Fri, 29 Aug 2014 14:43:28 -0400 Subject: [PATCH 11/66] Bug 1060523 - Omit extra newlines when logging exception messages in moztest. r=jgraham --- testing/mozbase/moztest/moztest/adapters/unit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testing/mozbase/moztest/moztest/adapters/unit.py b/testing/mozbase/moztest/moztest/adapters/unit.py index 52317c8d045..9ba905781f8 100644 --- a/testing/mozbase/moztest/moztest/adapters/unit.py +++ b/testing/mozbase/moztest/moztest/adapters/unit.py @@ -60,8 +60,8 @@ class StructuredTestResult(TextTestResult): exc_msg = "".join(traceback.format_exception_only(exc_ty, val)) if self.buffer: output_msg = "\n".join([sys.stdout.getvalue(), sys.stderr.getvalue()]) - return "\n".join([exc_msg, output_msg]) - return exc_msg + return "".join([exc_msg, output_msg]) + return exc_msg.rstrip() def _extract_stacktrace(self, err, test): # Format an exception stack in the style of unittest's _exc_info_to_string From e8b73b5ff53feca0137d21065aa7a74f538c4196 Mon Sep 17 00:00:00 2001 From: Dirk Schulze Date: Thu, 28 Aug 2014 03:09:00 +0200 Subject: [PATCH 12/66] Bug 1058519 - Ship mask-type CSS property. r=heycam --- modules/libpref/init/all.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 16621b564de..d70262747fd 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -1963,11 +1963,7 @@ pref("layout.css.dpi", -1); pref("layout.css.devPixelsPerPx", "-1.0"); // Is support for CSS Masking features enabled? -#ifdef RELEASE_BUILD -pref("layout.css.masking.enabled", false); -#else pref("layout.css.masking.enabled", true); -#endif // Is support for mix-blend-mode enabled? pref("layout.css.mix-blend-mode.enabled", true); From d3b9a0a59f30c3fd18e4e931052c69b2bc1f3c02 Mon Sep 17 00:00:00 2001 From: Jonathan Kew Date: Tue, 2 Sep 2014 09:01:06 +0100 Subject: [PATCH 13/66] bug 1060791 - support cmap subtable format 10, for the Apple Symbols font. r=jdaggett --- gfx/thebes/gfxFontUtils.cpp | 103 ++++++++++++++++++++++++++++++++++-- gfx/thebes/gfxFontUtils.h | 7 +++ 2 files changed, 105 insertions(+), 5 deletions(-) diff --git a/gfx/thebes/gfxFontUtils.cpp b/gfx/thebes/gfxFontUtils.cpp index 491ba5f0958..8a0f678ce83 100644 --- a/gfx/thebes/gfxFontUtils.cpp +++ b/gfx/thebes/gfxFontUtils.cpp @@ -41,6 +41,15 @@ using namespace mozilla; #pragma pack(1) +typedef struct { + AutoSwap_PRUint16 format; + AutoSwap_PRUint16 reserved; + AutoSwap_PRUint32 length; + AutoSwap_PRUint32 language; + AutoSwap_PRUint32 startCharCode; + AutoSwap_PRUint32 numChars; +} Format10CmapHeader; + typedef struct { AutoSwap_PRUint16 format; AutoSwap_PRUint16 reserved; @@ -87,6 +96,53 @@ gfxSparseBitSet::Dump(const char* aPrefix, eGfxLog aWhichLog) const } #endif +nsresult +gfxFontUtils::ReadCMAPTableFormat10(const uint8_t *aBuf, uint32_t aLength, + gfxSparseBitSet& aCharacterMap) +{ + // Ensure table is large enough that we can safely read the header + NS_ENSURE_TRUE(aLength >= sizeof(Format10CmapHeader), + NS_ERROR_GFX_CMAP_MALFORMED); + + // Sanity-check header fields + const Format10CmapHeader *cmap10 = + reinterpret_cast(aBuf); + NS_ENSURE_TRUE(uint16_t(cmap10->format) == 10, + NS_ERROR_GFX_CMAP_MALFORMED); + NS_ENSURE_TRUE(uint16_t(cmap10->reserved) == 0, + NS_ERROR_GFX_CMAP_MALFORMED); + + uint32_t tablelen = cmap10->length; + NS_ENSURE_TRUE(tablelen >= sizeof(Format10CmapHeader) && + tablelen <= aLength, NS_ERROR_GFX_CMAP_MALFORMED); + + NS_ENSURE_TRUE(cmap10->language == 0, NS_ERROR_GFX_CMAP_MALFORMED); + + uint32_t numChars = cmap10->numChars; + NS_ENSURE_TRUE(tablelen == sizeof(Format10CmapHeader) + + numChars * sizeof(uint16_t), NS_ERROR_GFX_CMAP_MALFORMED); + + uint32_t charCode = cmap10->startCharCode; + NS_ENSURE_TRUE(charCode <= CMAP_MAX_CODEPOINT && + charCode + numChars <= CMAP_MAX_CODEPOINT, + NS_ERROR_GFX_CMAP_MALFORMED); + + // glyphs[] array immediately follows the subtable header + const AutoSwap_PRUint16 *glyphs = + reinterpret_cast(cmap10 + 1); + + for (uint32_t i = 0; i < numChars; ++i) { + if (uint16_t(*glyphs) != 0) { + aCharacterMap.set(charCode); + } + ++charCode; + ++glyphs; + } + + aCharacterMap.Compact(); + + return NS_OK; +} nsresult gfxFontUtils::ReadCMAPTableFormat12(const uint8_t *aBuf, uint32_t aLength, @@ -422,7 +478,8 @@ gfxFontUtils::FindPreferredSubtable(const uint8_t *aBuf, uint32_t aBufLength, keepFormat = format; *aTableOffset = offset; *aSymbolEncoding = false; - } else if (format == 12 && acceptableUCS4Encoding(platformID, encodingID, keepFormat)) { + } else if ((format == 10 || format == 12) && + acceptableUCS4Encoding(platformID, encodingID, keepFormat)) { keepFormat = format; *aTableOffset = offset; *aSymbolEncoding = false; @@ -431,7 +488,7 @@ gfxFontUtils::FindPreferredSubtable(const uint8_t *aBuf, uint32_t aBufLength, } } else if (format == 14 && isUVSEncoding(platformID, encodingID) && aUVSTableOffset) { *aUVSTableOffset = offset; - if (keepFormat == 12) { + if (keepFormat == 10 || keepFormat == 12) { break; } } @@ -451,7 +508,8 @@ gfxFontUtils::ReadCMAP(const uint8_t *aBuf, uint32_t aBufLength, uint32_t format = FindPreferredSubtable(aBuf, aBufLength, &offset, &aUVSOffset, &symbol); - if (format == 4) { + switch (format) { + case 4: if (symbol) { aUnicodeFont = false; aSymbolFont = true; @@ -461,13 +519,21 @@ gfxFontUtils::ReadCMAP(const uint8_t *aBuf, uint32_t aBufLength, } return ReadCMAPTableFormat4(aBuf + offset, aBufLength - offset, aCharacterMap); - } - if (format == 12) { + case 10: + aUnicodeFont = true; + aSymbolFont = false; + return ReadCMAPTableFormat10(aBuf + offset, aBufLength - offset, + aCharacterMap); + + case 12: aUnicodeFont = true; aSymbolFont = false; return ReadCMAPTableFormat12(aBuf + offset, aBufLength - offset, aCharacterMap); + + default: + break; } return NS_ERROR_FAILURE; @@ -570,6 +636,26 @@ gfxFontUtils::MapCharToGlyphFormat4(const uint8_t *aBuf, char16_t aCh) return 0; } +uint32_t +gfxFontUtils::MapCharToGlyphFormat10(const uint8_t *aBuf, uint32_t aCh) +{ + const Format10CmapHeader *cmap10 = + reinterpret_cast(aBuf); + + uint32_t startChar = cmap10->startCharCode; + uint32_t numChars = cmap10->numChars; + + if (aCh < startChar || aCh >= startChar + numChars) { + return 0; + } + + const AutoSwap_PRUint16 *glyphs = + reinterpret_cast(cmap10 + 1); + + uint16_t glyph = glyphs[aCh - startChar]; + return glyph; +} + uint32_t gfxFontUtils::MapCharToGlyphFormat12(const uint8_t *aBuf, uint32_t aCh) { @@ -681,6 +767,9 @@ gfxFontUtils::MapCharToGlyph(const uint8_t *aCmapBuf, uint32_t aBufLength, gid = aUnicode < UNICODE_BMP_LIMIT ? MapCharToGlyphFormat4(aCmapBuf + offset, char16_t(aUnicode)) : 0; break; + case 10: + gid = MapCharToGlyphFormat10(aCmapBuf + offset, aUnicode); + break; case 12: gid = MapCharToGlyphFormat12(aCmapBuf + offset, aUnicode); break; @@ -703,6 +792,10 @@ gfxFontUtils::MapCharToGlyph(const uint8_t *aCmapBuf, uint32_t aBufLength, char16_t(aUnicode)); } break; + case 10: + varGID = MapCharToGlyphFormat10(aCmapBuf + offset, + aUnicode); + break; case 12: varGID = MapCharToGlyphFormat12(aCmapBuf + offset, aUnicode); diff --git a/gfx/thebes/gfxFontUtils.h b/gfx/thebes/gfxFontUtils.h index a19ca0457ca..c677bbb4ad5 100644 --- a/gfx/thebes/gfxFontUtils.h +++ b/gfx/thebes/gfxFontUtils.h @@ -770,6 +770,10 @@ public: (aBuf[aIndex + 2] << 8) | (aBuf[aIndex + 3])); } + static nsresult + ReadCMAPTableFormat10(const uint8_t *aBuf, uint32_t aLength, + gfxSparseBitSet& aCharacterMap); + static nsresult ReadCMAPTableFormat12(const uint8_t *aBuf, uint32_t aLength, gfxSparseBitSet& aCharacterMap); @@ -796,6 +800,9 @@ public: static uint32_t MapCharToGlyphFormat4(const uint8_t *aBuf, char16_t aCh); + static uint32_t + MapCharToGlyphFormat10(const uint8_t *aBuf, uint32_t aCh); + static uint32_t MapCharToGlyphFormat12(const uint8_t *aBuf, uint32_t aCh); From f6e68d7b184083efe6d4e6656b2fee15c3221890 Mon Sep 17 00:00:00 2001 From: Jonathan Kew Date: Tue, 2 Sep 2014 09:01:08 +0100 Subject: [PATCH 14/66] bug 1060791 - reftest for support of Apple Symbols font. r=jdaggett --- .../font-matching/apple-symbols-1-notref.html | 25 +++++++++++++++++++ .../font-matching/apple-symbols-1.html | 25 +++++++++++++++++++ layout/reftests/font-matching/reftest.list | 4 +++ 3 files changed, 54 insertions(+) create mode 100644 layout/reftests/font-matching/apple-symbols-1-notref.html create mode 100644 layout/reftests/font-matching/apple-symbols-1.html diff --git a/layout/reftests/font-matching/apple-symbols-1-notref.html b/layout/reftests/font-matching/apple-symbols-1-notref.html new file mode 100644 index 00000000000..b216a4ff502 --- /dev/null +++ b/layout/reftests/font-matching/apple-symbols-1-notref.html @@ -0,0 +1,25 @@ + + + + +Apple Symbols test + + + +∙◦◎☑☞ + + diff --git a/layout/reftests/font-matching/apple-symbols-1.html b/layout/reftests/font-matching/apple-symbols-1.html new file mode 100644 index 00000000000..ba92206f177 --- /dev/null +++ b/layout/reftests/font-matching/apple-symbols-1.html @@ -0,0 +1,25 @@ + + + + +Apple Symbols test + + + +∙◦◎☑☞ + + diff --git a/layout/reftests/font-matching/reftest.list b/layout/reftests/font-matching/reftest.list index e3271cfdfeb..d03606ed89b 100644 --- a/layout/reftests/font-matching/reftest.list +++ b/layout/reftests/font-matching/reftest.list @@ -93,3 +93,7 @@ random-if(!(cocoaWidget||winWidget)) == arial-arabic.html arial-arabic-ref.html HTTP(..) == font-synthesis-1.html font-synthesis-1-ref.html HTTP(..) == font-synthesis-2.html font-synthesis-2-ref.html + +# Bug 1060791 - support for format 10 cmap in Apple Symbols; +# relevant fonts not present on other platforms. +skip-if(!cocoaWidget) HTTP(..) != apple-symbols-1.html apple-symbols-1-notref.html From d63623ee3a513a83a6f0919b72785a2ead2ea058 Mon Sep 17 00:00:00 2001 From: Theodore Kokkoris Date: Mon, 25 Aug 2014 18:12:36 +0300 Subject: [PATCH 15/66] Bug 1057626 - Use ConnectivityManagerCompat instead of ConnectivityManager. r=snorp --- mobile/android/base/updater/UpdateService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mobile/android/base/updater/UpdateService.java b/mobile/android/base/updater/UpdateService.java index 9a48b6bee26..67f573498ae 100644 --- a/mobile/android/base/updater/UpdateService.java +++ b/mobile/android/base/updater/UpdateService.java @@ -27,6 +27,7 @@ import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.net.Uri; import android.os.Environment; +import android.support.v4.net.ConnectivityManagerCompat; import android.support.v4.app.NotificationCompat; import android.support.v4.app.NotificationCompat.Builder; import android.util.Log; @@ -220,7 +221,7 @@ public class UpdateService extends IntentService { */ boolean shouldStartDownload = hasFlag(flags, UpdateServiceHelper.FLAG_FORCE_DOWNLOAD) || autoDownloadPolicy == UpdateServiceHelper.AUTODOWNLOAD_ENABLED || - (autoDownloadPolicy == UpdateServiceHelper.AUTODOWNLOAD_WIFI && !mConnectivityManager.isActiveNetworkMetered()); + (autoDownloadPolicy == UpdateServiceHelper.AUTODOWNLOAD_WIFI && !ConnectivityManagerCompat.isActiveNetworkMetered(mConnectivityManager)); if (!shouldStartDownload) { Log.i(LOGTAG, "not initiating automatic update download due to policy " + autoDownloadPolicy); From a5374b9caf0a6de3add37e85bcdfb54b30bb9ba2 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Tue, 2 Sep 2014 10:25:38 +0200 Subject: [PATCH 16/66] Bug 1059710: OdinMonkey SIMD: add support for comparisons; r=luke --- js/src/asmjs/AsmJSLink.cpp | 16 +++- js/src/asmjs/AsmJSModule.h | 8 +- js/src/asmjs/AsmJSValidate.cpp | 95 +++++++++++++++++++++--- js/src/jit-test/tests/asm.js/testSIMD.js | 67 +++++++++++++++++ 4 files changed, 172 insertions(+), 14 deletions(-) diff --git a/js/src/asmjs/AsmJSLink.cpp b/js/src/asmjs/AsmJSLink.cpp index 4cba533f577..d49ce564980 100644 --- a/js/src/asmjs/AsmJSLink.cpp +++ b/js/src/asmjs/AsmJSLink.cpp @@ -345,10 +345,16 @@ ValidateSimdOperation(JSContext *cx, AsmJSModule::Global &global, HandleValue gl switch (global.simdOperation()) { case AsmJSSimdOperation_add: native = simd_int32x4_add; break; case AsmJSSimdOperation_sub: native = simd_int32x4_sub; break; + case AsmJSSimdOperation_lessThan: native = simd_int32x4_lessThan; break; + case AsmJSSimdOperation_greaterThan: native = simd_int32x4_greaterThan; break; + case AsmJSSimdOperation_equal: native = simd_int32x4_equal; break; + case AsmJSSimdOperation_lessThanOrEqual: + case AsmJSSimdOperation_greaterThanOrEqual: + case AsmJSSimdOperation_notEqual: case AsmJSSimdOperation_mul: case AsmJSSimdOperation_div: - MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("Mul and div shouldn't have been validated in " - "the first place"); + MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("shouldn't have been validated in the first " + "place"); } break; case AsmJSSimdType_float32x4: @@ -357,6 +363,12 @@ ValidateSimdOperation(JSContext *cx, AsmJSModule::Global &global, HandleValue gl case AsmJSSimdOperation_sub: native = simd_float32x4_sub; break; case AsmJSSimdOperation_mul: native = simd_float32x4_mul; break; case AsmJSSimdOperation_div: native = simd_float32x4_div; break; + case AsmJSSimdOperation_lessThan: native = simd_float32x4_lessThan ; break; + case AsmJSSimdOperation_lessThanOrEqual: native = simd_float32x4_lessThanOrEqual; break; + case AsmJSSimdOperation_equal: native = simd_float32x4_equal; break; + case AsmJSSimdOperation_notEqual: native = simd_float32x4_notEqual ; break; + case AsmJSSimdOperation_greaterThan: native = simd_float32x4_greaterThan; break; + case AsmJSSimdOperation_greaterThanOrEqual: native = simd_float32x4_greaterThanOrEqual ; break; } break; } diff --git a/js/src/asmjs/AsmJSModule.h b/js/src/asmjs/AsmJSModule.h index f47d4ba86e0..eb617552c31 100644 --- a/js/src/asmjs/AsmJSModule.h +++ b/js/src/asmjs/AsmJSModule.h @@ -79,7 +79,13 @@ enum AsmJSSimdOperation AsmJSSimdOperation_add, AsmJSSimdOperation_sub, AsmJSSimdOperation_mul, - AsmJSSimdOperation_div + AsmJSSimdOperation_div, + AsmJSSimdOperation_lessThan, + AsmJSSimdOperation_lessThanOrEqual, + AsmJSSimdOperation_equal, + AsmJSSimdOperation_notEqual, + AsmJSSimdOperation_greaterThan, + AsmJSSimdOperation_greaterThanOrEqual, }; // These labels describe positions in the prologue/epilogue of functions while diff --git a/js/src/asmjs/AsmJSValidate.cpp b/js/src/asmjs/AsmJSValidate.cpp index bbd89b87500..242a696d3a5 100644 --- a/js/src/asmjs/AsmJSValidate.cpp +++ b/js/src/asmjs/AsmJSValidate.cpp @@ -1368,7 +1368,13 @@ class MOZ_STACK_CLASS ModuleCompiler !addStandardLibrarySimdOpName("add", AsmJSSimdOperation_add) || !addStandardLibrarySimdOpName("sub", AsmJSSimdOperation_sub) || !addStandardLibrarySimdOpName("mul", AsmJSSimdOperation_mul) || - !addStandardLibrarySimdOpName("div", AsmJSSimdOperation_div)) + !addStandardLibrarySimdOpName("div", AsmJSSimdOperation_div) || + !addStandardLibrarySimdOpName("lessThanOrEqual", AsmJSSimdOperation_lessThanOrEqual) || + !addStandardLibrarySimdOpName("lessThan", AsmJSSimdOperation_lessThan) || + !addStandardLibrarySimdOpName("equal", AsmJSSimdOperation_equal) || + !addStandardLibrarySimdOpName("notEqual", AsmJSSimdOperation_notEqual) || + !addStandardLibrarySimdOpName("greaterThan", AsmJSSimdOperation_greaterThan) || + !addStandardLibrarySimdOpName("greaterThanOrEqual", AsmJSSimdOperation_greaterThanOrEqual)) { return false; } @@ -2401,6 +2407,17 @@ class FunctionCompiler return ins; } + MDefinition *binarySimd(MDefinition *lhs, MDefinition *rhs, MSimdBinaryComp::Operation op) + { + if (inDeadCode()) + return nullptr; + + JS_ASSERT(IsSimdType(lhs->type()) && rhs->type() == lhs->type()); + MSimdBinaryComp *ins = MSimdBinaryComp::NewAsmJS(alloc(), lhs, rhs, op); + curBlock_->add(ins); + return ins; + } + MDefinition *minMax(MDefinition *lhs, MDefinition *rhs, MIRType type, bool isMax) { if (inDeadCode()) return nullptr; @@ -3457,9 +3474,15 @@ IsSimdValidOperationType(AsmJSSimdType type, AsmJSSimdOperation op) switch (op) { case AsmJSSimdOperation_add: case AsmJSSimdOperation_sub: + case AsmJSSimdOperation_lessThan: + case AsmJSSimdOperation_equal: + case AsmJSSimdOperation_greaterThan: return true; case AsmJSSimdOperation_mul: case AsmJSSimdOperation_div: + case AsmJSSimdOperation_lessThanOrEqual: + case AsmJSSimdOperation_notEqual: + case AsmJSSimdOperation_greaterThanOrEqual: return type == AsmJSSimdType_float32x4; } return false; @@ -4616,8 +4639,8 @@ CheckMathBuiltinCall(FunctionCompiler &f, ParseNode *callNode, AsmJSMathBuiltinF } static bool -CheckBinarySimd(FunctionCompiler &f, ParseNode *call, AsmJSSimdType simdType, - MSimdBinaryArith::Operation op, MDefinition **def, Type *type) +CheckBinarySimd(FunctionCompiler &f, ParseNode *call, const ModuleCompiler::Global *global, + MDefinition **def, Type *type) { unsigned numArgs = CallArgListLength(call); if (numArgs != 2) @@ -4633,13 +4656,60 @@ CheckBinarySimd(FunctionCompiler &f, ParseNode *call, AsmJSSimdType simdType, if (!CheckExpr(f, rhs, &rhsDef, &rhsType)) return false; - Type retType = simdType; - JS_ASSERT_IF(retType.isInt32x4(), op != MSimdBinaryArith::Mul && op != MSimdBinaryArith::Div); + Type retType = global->simdOperationType(); if (lhsType != retType || rhsType != retType) return f.failf(lhs, "arguments to SIMD binary op should both be %s", retType.toChars()); - *type = retType; - *def = f.binarySimd(lhsDef, rhsDef, op, retType.toMIRType()); + + MIRType opType = retType.toMIRType(); + switch (global->simdOperation()) { + case AsmJSSimdOperation_add: + *def = f.binarySimd(lhsDef, rhsDef, MSimdBinaryArith::Add, opType); + *type = retType; + break; + case AsmJSSimdOperation_sub: + *def = f.binarySimd(lhsDef, rhsDef, MSimdBinaryArith::Sub, opType); + *type = retType; + break; + case AsmJSSimdOperation_mul: + JS_ASSERT(!retType.isInt32x4()); + *def = f.binarySimd(lhsDef, rhsDef, MSimdBinaryArith::Mul, opType); + *type = retType; + break; + case AsmJSSimdOperation_div: + JS_ASSERT(!retType.isInt32x4()); + *def = f.binarySimd(lhsDef, rhsDef, MSimdBinaryArith::Div, opType); + *type = retType; + break; + case AsmJSSimdOperation_lessThan: + *def = f.binarySimd(lhsDef, rhsDef, MSimdBinaryComp::lessThan); + *type = Type::Int32x4; + break; + case AsmJSSimdOperation_lessThanOrEqual: + JS_ASSERT(!retType.isInt32x4()); + *def = f.binarySimd(lhsDef, rhsDef, MSimdBinaryComp::lessThanOrEqual); + *type = Type::Int32x4; + break; + case AsmJSSimdOperation_equal: + *def = f.binarySimd(lhsDef, rhsDef, MSimdBinaryComp::equal); + *type = Type::Int32x4; + break; + case AsmJSSimdOperation_notEqual: + JS_ASSERT(!retType.isInt32x4()); + *def = f.binarySimd(lhsDef, rhsDef, MSimdBinaryComp::notEqual); + *type = Type::Int32x4; + break; + case AsmJSSimdOperation_greaterThan: + *def = f.binarySimd(lhsDef, rhsDef, MSimdBinaryComp::greaterThan); + *type = Type::Int32x4; + break; + case AsmJSSimdOperation_greaterThanOrEqual: + JS_ASSERT(!retType.isInt32x4()); + *def = f.binarySimd(lhsDef, rhsDef, MSimdBinaryComp::greaterThanOrEqual); + *type = Type::Int32x4; + break; + } + return true; } @@ -4650,13 +4720,16 @@ CheckSimdOperationCall(FunctionCompiler &f, ParseNode *call, const ModuleCompile JS_ASSERT(global->isSimdOperation()); switch (global->simdOperation()) { case AsmJSSimdOperation_add: - return CheckBinarySimd(f, call, global->simdOperationType(), MSimdBinaryArith::Add, def, type); case AsmJSSimdOperation_sub: - return CheckBinarySimd(f, call, global->simdOperationType(), MSimdBinaryArith::Sub, def, type); case AsmJSSimdOperation_mul: - return CheckBinarySimd(f, call, global->simdOperationType(), MSimdBinaryArith::Mul, def, type); case AsmJSSimdOperation_div: - return CheckBinarySimd(f, call, global->simdOperationType(), MSimdBinaryArith::Div, def, type); + case AsmJSSimdOperation_lessThan: + case AsmJSSimdOperation_lessThanOrEqual: + case AsmJSSimdOperation_equal: + case AsmJSSimdOperation_notEqual: + case AsmJSSimdOperation_greaterThan: + case AsmJSSimdOperation_greaterThanOrEqual: + return CheckBinarySimd(f, call, global, def, type); } MOZ_CRASH("unexpected simd operation in CheckSimdOperationCall"); } diff --git a/js/src/jit-test/tests/asm.js/testSIMD.js b/js/src/jit-test/tests/asm.js/testSIMD.js index a09beeef097..7b1ed0a199c 100644 --- a/js/src/jit-test/tests/asm.js/testSIMD.js +++ b/js/src/jit-test/tests/asm.js/testSIMD.js @@ -51,6 +51,17 @@ function CheckF4(header, code, expected) { } } +function CheckF4Comp(header, code, expected) { + // code needs to contain a local called x containing the result of the + // comparison + var lanes = ['x', 'y', 'z', 'w']; + header = USE_ASM + F32 + I32 + header; + for (var i = 0; i < 4; ++i) { + var lane = lanes[i]; + assertEq(asmLink(asmCompile('glob', header + ';function f() {' + code + ';return x.' + lane + '|0} return f'), this)(), expected[i]); + } +} + try { // 1. Constructors @@ -406,6 +417,62 @@ var f32x4 = SIMD.float32x4(0, 0, -0, NaN); var another = SIMD.float32x4(0, -0, 0, 0); assertEqX4(asmLink(asmCompile('glob', USE_ASM + F32 + F32D + "function f(x,y) {x=f4(x); y=f4(y); x=f4d(x,y); return f4(x);} return f"), this)(f32x4, another), [NaN, NaN, NaN, NaN]); +// Comparisons +// True yields all bits set to 1 (i.e as an int32, 0xFFFFFFFF === -1), false +// yields all bits set to 0 (i.e 0). +const T = -1; +const F = 0; +assertAsmTypeFail('glob', USE_ASM + I32 + "var lt=i4.lessThanOrEqual; function f() {} return f"); +assertAsmTypeFail('glob', USE_ASM + I32 + "var ge=i4.greaterThanOrEqual; function f() {} return f"); +assertAsmTypeFail('glob', USE_ASM + I32 + "var ne=i4.notEqual; function f() {} return f"); + +const LTI32 = 'var lt = i4.lessThan'; +const GTI32 = 'var gt = i4.greaterThan'; +const EQI32 = 'var eq = i4.equal'; + +CheckI4(LTI32, 'var x=i4(1,2,3,4); var y=i4(-1,1,0,2); x=lt(x,y)', [F, F, F, F]); +CheckI4(LTI32, 'var x=i4(-1,1,0,2); var y=i4(1,2,3,4); x=lt(x,y)', [T, T, T, T]); +CheckI4(LTI32, 'var x=i4(1,0,3,4); var y=i4(1,1,7,0); x=lt(x,y)', [F, T, T, F]); + +CheckI4(EQI32, 'var x=i4(1,2,3,4); var y=i4(-1,1,0,2); x=eq(x,y)', [F, F, F, F]); +CheckI4(EQI32, 'var x=i4(-1,1,0,2); var y=i4(1,2,3,4); x=eq(x,y)', [F, F, F, F]); +CheckI4(EQI32, 'var x=i4(1,0,3,4); var y=i4(1,1,7,0); x=eq(x,y)', [T, F, F, F]); + +CheckI4(GTI32, 'var x=i4(1,2,3,4); var y=i4(-1,1,0,2); x=gt(x,y)', [T, T, T, T]); +CheckI4(GTI32, 'var x=i4(-1,1,0,2); var y=i4(1,2,3,4); x=gt(x,y)', [F, F, F, F]); +CheckI4(GTI32, 'var x=i4(1,0,3,4); var y=i4(1,1,7,0); x=gt(x,y)', [F, F, F, T]); + +const LTF32 = 'var lt=f4.lessThan'; +const LEF32 = 'var le=f4.lessThanOrEqual'; +const GTF32 = 'var gt=f4.greaterThan'; +const GEF32 = 'var ge=f4.greaterThanOrEqual'; +const EQF32 = 'var eq=f4.equal'; +const NEF32 = 'var ne=f4.notEqual'; + +CheckF4Comp(LTF32, 'var y=f4(1,2,3,4); var z=f4(-1,1,0,2); var x=i4(0,0,0,0); x=lt(y,z)', [F, F, F, F]); +CheckF4Comp(LTF32, 'var y=f4(-1,1,0,2); var z=f4(1,2,3,4); var x=i4(0,0,0,0); x=lt(y,z)', [T, T, T, T]); +CheckF4Comp(LTF32, 'var y=f4(1,0,3,4); var z=f4(1,1,7,0); var x=i4(0,0,0,0); x=lt(y,z)', [F, T, T, F]); + +CheckF4Comp(LEF32, 'var y=f4(1,2,3,4); var z=f4(-1,1,0,2); var x=i4(0,0,0,0); x=le(y,z)', [F, F, F, F]); +CheckF4Comp(LEF32, 'var y=f4(-1,1,0,2); var z=f4(1,2,3,4); var x=i4(0,0,0,0); x=le(y,z)', [T, T, T, T]); +CheckF4Comp(LEF32, 'var y=f4(1,0,3,4); var z=f4(1,1,7,0); var x=i4(0,0,0,0); x=le(y,z)', [T, T, T, F]); + +CheckF4Comp(EQF32, 'var y=f4(1,2,3,4); var z=f4(-1,1,0,2); var x=i4(0,0,0,0); x=eq(y,z)', [F, F, F, F]); +CheckF4Comp(EQF32, 'var y=f4(-1,1,0,2); var z=f4(1,2,3,4); var x=i4(0,0,0,0); x=eq(y,z)', [F, F, F, F]); +CheckF4Comp(EQF32, 'var y=f4(1,0,3,4); var z=f4(1,1,7,0); var x=i4(0,0,0,0); x=eq(y,z)', [T, F, F, F]); + +CheckF4Comp(NEF32, 'var y=f4(1,2,3,4); var z=f4(-1,1,0,2); var x=i4(0,0,0,0); x=ne(y,z)', [T, T, T, T]); +CheckF4Comp(NEF32, 'var y=f4(-1,1,0,2); var z=f4(1,2,3,4); var x=i4(0,0,0,0); x=ne(y,z)', [T, T, T, T]); +CheckF4Comp(NEF32, 'var y=f4(1,0,3,4); var z=f4(1,1,7,0); var x=i4(0,0,0,0); x=ne(y,z)', [F, T, T, T]); + +CheckF4Comp(GTF32, 'var y=f4(1,2,3,4); var z=f4(-1,1,0,2); var x=i4(0,0,0,0); x=gt(y,z)', [T, T, T, T]); +CheckF4Comp(GTF32, 'var y=f4(-1,1,0,2); var z=f4(1,2,3,4); var x=i4(0,0,0,0); x=gt(y,z)', [F, F, F, F]); +CheckF4Comp(GTF32, 'var y=f4(1,0,3,4); var z=f4(1,1,7,0); var x=i4(0,0,0,0); x=gt(y,z)', [F, F, F, T]); + +CheckF4Comp(GEF32, 'var y=f4(1,2,3,4); var z=f4(-1,1,0,2); var x=i4(0,0,0,0); x=ge(y,z)', [T, T, T, T]); +CheckF4Comp(GEF32, 'var y=f4(-1,1,0,2); var z=f4(1,2,3,4); var x=i4(0,0,0,0); x=ge(y,z)', [F, F, F, F]); +CheckF4Comp(GEF32, 'var y=f4(1,0,3,4); var z=f4(1,1,7,0); var x=i4(0,0,0,0); x=ge(y,z)', [T, F, F, T]); + // Dead code assertEqX4(asmLink(asmCompile('glob', USE_ASM + I32 + 'function f(){var x=i4(1,2,3,4); return i4(x); x=i4(5,6,7,8); return i4(x);} return f'), this)(), [1, 2, 3, 4]); assertEqX4(asmLink(asmCompile('glob', USE_ASM + I32 + 'function f(){var x=i4(1,2,3,4); var c=0; return i4(x); c=x.x|0; return i4(x);} return f'), this)(), [1, 2, 3, 4]); From edd045a2f7e5442f7d1a1cc24b01e1f6258066b6 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Tue, 2 Sep 2014 10:25:43 +0200 Subject: [PATCH 17/66] Bug 1059733: OdinMonkey SIMD: add support for bitwise operations; r=luke --- js/src/asmjs/AsmJSLink.cpp | 6 ++++ js/src/asmjs/AsmJSModule.h | 3 ++ js/src/asmjs/AsmJSValidate.cpp | 36 +++++++++++++++++++++++- js/src/jit-test/tests/asm.js/testSIMD.js | 36 ++++++++++++++++++++++++ 4 files changed, 80 insertions(+), 1 deletion(-) diff --git a/js/src/asmjs/AsmJSLink.cpp b/js/src/asmjs/AsmJSLink.cpp index d49ce564980..47ca731c58f 100644 --- a/js/src/asmjs/AsmJSLink.cpp +++ b/js/src/asmjs/AsmJSLink.cpp @@ -348,6 +348,9 @@ ValidateSimdOperation(JSContext *cx, AsmJSModule::Global &global, HandleValue gl case AsmJSSimdOperation_lessThan: native = simd_int32x4_lessThan; break; case AsmJSSimdOperation_greaterThan: native = simd_int32x4_greaterThan; break; case AsmJSSimdOperation_equal: native = simd_int32x4_equal; break; + case AsmJSSimdOperation_and: native = simd_int32x4_and; break; + case AsmJSSimdOperation_or: native = simd_int32x4_or; break; + case AsmJSSimdOperation_xor: native = simd_int32x4_xor; break; case AsmJSSimdOperation_lessThanOrEqual: case AsmJSSimdOperation_greaterThanOrEqual: case AsmJSSimdOperation_notEqual: @@ -369,6 +372,9 @@ ValidateSimdOperation(JSContext *cx, AsmJSModule::Global &global, HandleValue gl case AsmJSSimdOperation_notEqual: native = simd_float32x4_notEqual ; break; case AsmJSSimdOperation_greaterThan: native = simd_float32x4_greaterThan; break; case AsmJSSimdOperation_greaterThanOrEqual: native = simd_float32x4_greaterThanOrEqual ; break; + case AsmJSSimdOperation_and: native = simd_float32x4_and; break; + case AsmJSSimdOperation_or: native = simd_float32x4_or; break; + case AsmJSSimdOperation_xor: native = simd_float32x4_xor; break; } break; } diff --git a/js/src/asmjs/AsmJSModule.h b/js/src/asmjs/AsmJSModule.h index eb617552c31..31432c46f95 100644 --- a/js/src/asmjs/AsmJSModule.h +++ b/js/src/asmjs/AsmJSModule.h @@ -86,6 +86,9 @@ enum AsmJSSimdOperation AsmJSSimdOperation_notEqual, AsmJSSimdOperation_greaterThan, AsmJSSimdOperation_greaterThanOrEqual, + AsmJSSimdOperation_and, + AsmJSSimdOperation_or, + AsmJSSimdOperation_xor, }; // These labels describe positions in the prologue/epilogue of functions while diff --git a/js/src/asmjs/AsmJSValidate.cpp b/js/src/asmjs/AsmJSValidate.cpp index 242a696d3a5..e4b034c9bb5 100644 --- a/js/src/asmjs/AsmJSValidate.cpp +++ b/js/src/asmjs/AsmJSValidate.cpp @@ -1374,7 +1374,10 @@ class MOZ_STACK_CLASS ModuleCompiler !addStandardLibrarySimdOpName("equal", AsmJSSimdOperation_equal) || !addStandardLibrarySimdOpName("notEqual", AsmJSSimdOperation_notEqual) || !addStandardLibrarySimdOpName("greaterThan", AsmJSSimdOperation_greaterThan) || - !addStandardLibrarySimdOpName("greaterThanOrEqual", AsmJSSimdOperation_greaterThanOrEqual)) + !addStandardLibrarySimdOpName("greaterThanOrEqual", AsmJSSimdOperation_greaterThanOrEqual) || + !addStandardLibrarySimdOpName("and", AsmJSSimdOperation_and) || + !addStandardLibrarySimdOpName("or", AsmJSSimdOperation_or) || + !addStandardLibrarySimdOpName("xor", AsmJSSimdOperation_xor)) { return false; } @@ -2407,6 +2410,19 @@ class FunctionCompiler return ins; } + MDefinition *binarySimd(MDefinition *lhs, MDefinition *rhs, MSimdBinaryBitwise::Operation op, + MIRType type) + { + if (inDeadCode()) + return nullptr; + + JS_ASSERT(IsSimdType(lhs->type()) && rhs->type() == lhs->type()); + JS_ASSERT(lhs->type() == type); + MSimdBinaryBitwise *ins = MSimdBinaryBitwise::NewAsmJS(alloc(), lhs, rhs, op, type); + curBlock_->add(ins); + return ins; + } + MDefinition *binarySimd(MDefinition *lhs, MDefinition *rhs, MSimdBinaryComp::Operation op) { if (inDeadCode()) @@ -3477,6 +3493,9 @@ IsSimdValidOperationType(AsmJSSimdType type, AsmJSSimdOperation op) case AsmJSSimdOperation_lessThan: case AsmJSSimdOperation_equal: case AsmJSSimdOperation_greaterThan: + case AsmJSSimdOperation_and: + case AsmJSSimdOperation_or: + case AsmJSSimdOperation_xor: return true; case AsmJSSimdOperation_mul: case AsmJSSimdOperation_div: @@ -4708,6 +4727,18 @@ CheckBinarySimd(FunctionCompiler &f, ParseNode *call, const ModuleCompiler::Glob *def = f.binarySimd(lhsDef, rhsDef, MSimdBinaryComp::greaterThanOrEqual); *type = Type::Int32x4; break; + case AsmJSSimdOperation_and: + *def = f.binarySimd(lhsDef, rhsDef, MSimdBinaryBitwise::and_, opType); + *type = retType; + break; + case AsmJSSimdOperation_or: + *def = f.binarySimd(lhsDef, rhsDef, MSimdBinaryBitwise::or_, opType); + *type = retType; + break; + case AsmJSSimdOperation_xor: + *def = f.binarySimd(lhsDef, rhsDef, MSimdBinaryBitwise::xor_, opType); + *type = retType; + break; } return true; @@ -4729,6 +4760,9 @@ CheckSimdOperationCall(FunctionCompiler &f, ParseNode *call, const ModuleCompile case AsmJSSimdOperation_notEqual: case AsmJSSimdOperation_greaterThan: case AsmJSSimdOperation_greaterThanOrEqual: + case AsmJSSimdOperation_and: + case AsmJSSimdOperation_or: + case AsmJSSimdOperation_xor: return CheckBinarySimd(f, call, global, def, type); } MOZ_CRASH("unexpected simd operation in CheckSimdOperationCall"); diff --git a/js/src/jit-test/tests/asm.js/testSIMD.js b/js/src/jit-test/tests/asm.js/testSIMD.js index 7b1ed0a199c..35f3d1499bc 100644 --- a/js/src/jit-test/tests/asm.js/testSIMD.js +++ b/js/src/jit-test/tests/asm.js/testSIMD.js @@ -449,6 +449,8 @@ const GEF32 = 'var ge=f4.greaterThanOrEqual'; const EQF32 = 'var eq=f4.equal'; const NEF32 = 'var ne=f4.notEqual'; +assertAsmTypeFail('glob', USE_ASM + F32 + "var lt=f4.lessThan; function f() {var x=f4(1,2,3,4); var y=f4(5,6,7,8); x=lt(x,y);} return f"); + CheckF4Comp(LTF32, 'var y=f4(1,2,3,4); var z=f4(-1,1,0,2); var x=i4(0,0,0,0); x=lt(y,z)', [F, F, F, F]); CheckF4Comp(LTF32, 'var y=f4(-1,1,0,2); var z=f4(1,2,3,4); var x=i4(0,0,0,0); x=lt(y,z)', [T, T, T, T]); CheckF4Comp(LTF32, 'var y=f4(1,0,3,4); var z=f4(1,1,7,0); var x=i4(0,0,0,0); x=lt(y,z)', [F, T, T, F]); @@ -473,6 +475,40 @@ CheckF4Comp(GEF32, 'var y=f4(1,2,3,4); var z=f4(-1,1,0,2); var x=i4(0,0,0,0); x CheckF4Comp(GEF32, 'var y=f4(-1,1,0,2); var z=f4(1,2,3,4); var x=i4(0,0,0,0); x=ge(y,z)', [F, F, F, F]); CheckF4Comp(GEF32, 'var y=f4(1,0,3,4); var z=f4(1,1,7,0); var x=i4(0,0,0,0); x=ge(y,z)', [T, F, F, T]); +// Bitwise ops +const ANDI32 = 'var andd=i4.and;'; +const ORI32 = 'var orr=i4.or;'; +const XORI32 = 'var xorr=i4.xor;'; + +CheckI4(ANDI32, 'var x=i4(42,1337,-1,13); var y=i4(2, 4, 7, 15); x=andd(x,y)', [42 & 2, 1337 & 4, -1 & 7, 13 & 15]); +CheckI4(ORI32, ' var x=i4(42,1337,-1,13); var y=i4(2, 4, 7, 15); x=orr(x,y)', [42 | 2, 1337 | 4, -1 | 7, 13 | 15]); +CheckI4(XORI32, 'var x=i4(42,1337,-1,13); var y=i4(2, 4, 7, 15); x=xorr(x,y)', [42 ^ 2, 1337 ^ 4, -1 ^ 7, 13 ^ 15]); + +const ANDF32 = 'var andd=f4.and;'; +const ORF32 = 'var orr=f4.or;'; +const XORF32 = 'var xorr=f4.xor;'; + +var bitwise = (function() { + var asf32 = new Float32Array(2); + var asi32 = new Int32Array(asf32.buffer); + function andd(x, y) { asf32[0] = x; asf32[1] = y; asi32[0] = asi32[0] & asi32[1]; return asf32[0]; } + function orr(x, y) { asf32[0] = x; asf32[1] = y; asi32[0] = asi32[0] | asi32[1]; return asf32[0]; } + function xorr(x, y) { asf32[0] = x; asf32[1] = y; asi32[0] = asi32[0] ^ asi32[1]; return asf32[0]; } + + function andx4(x, y) { var res = []; for (var i = 0; i < 4; i++) res[i] = andd(x[i], y[i]); return res; } + function orx4(x, y) { var res = []; for (var i = 0; i < 4; i++) res[i] = orr(x[i], y[i]); return res; } + function xorx4(x, y) { var res = []; for (var i = 0; i < 4; i++) res[i] = xorr(x[i], y[i]); return res; } + return { + and: andx4, + or: orx4, + xor: xorx4 + } +})(); + +CheckF4(ANDF32, 'var x=f4(42, 13.37,-1.42, 23.10); var y=f4(19.89, 2.4, 8.15, 16.36); x=andd(x,y)', bitwise.and([42, 13.37, -1.42, 23.10], [19.89, 2.4, 8.15, 16.36])); +CheckF4(ORF32, 'var x=f4(42, 13.37,-1.42, 23.10); var y=f4(19.89, 2.4, 8.15, 16.36); x=orr(x,y)', bitwise.or( [42, 13.37, -1.42, 23.10], [19.89, 2.4, 8.15, 16.36])); +CheckF4(XORF32, 'var x=f4(42, 13.37,-1.42, 23.10); var y=f4(19.89, 2.4, 8.15, 16.36); x=xorr(x,y)', bitwise.xor([42, 13.37, -1.42, 23.10], [19.89, 2.4, 8.15, 16.36])); + // Dead code assertEqX4(asmLink(asmCompile('glob', USE_ASM + I32 + 'function f(){var x=i4(1,2,3,4); return i4(x); x=i4(5,6,7,8); return i4(x);} return f'), this)(), [1, 2, 3, 4]); assertEqX4(asmLink(asmCompile('glob', USE_ASM + I32 + 'function f(){var x=i4(1,2,3,4); var c=0; return i4(x); c=x.x|0; return i4(x);} return f'), this)(), [1, 2, 3, 4]); From 81a9fcef979008de60f6a877cac075b9c5cc51c4 Mon Sep 17 00:00:00 2001 From: Douglas Crosher Date: Fri, 29 Aug 2014 22:42:06 +1000 Subject: [PATCH 18/66] Bug 1060087 - OdinMonkey SIMD: add support for signMask; r=luke --- js/src/asmjs/AsmJSValidate.cpp | 20 +++++++++++++++++++- js/src/jit-test/tests/asm.js/testSIMD.js | 15 +++++++++++++++ js/src/vm/CommonPropertyNames.h | 1 + 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/js/src/asmjs/AsmJSValidate.cpp b/js/src/asmjs/AsmJSValidate.cpp index e4b034c9bb5..b8f25dd6b21 100644 --- a/js/src/asmjs/AsmJSValidate.cpp +++ b/js/src/asmjs/AsmJSValidate.cpp @@ -2586,6 +2586,17 @@ class FunctionCompiler return ins; } + MDefinition *extractSignMask(MDefinition *base) + { + if (inDeadCode()) + return nullptr; + + JS_ASSERT(IsSimdType(base->type())); + MSimdSignMask *ins = MSimdSignMask::NewAsmJS(alloc(), base); + curBlock_->add(ins); + return ins; + } + template MDefinition *constructSimd(MDefinition *x, MDefinition *y, MDefinition *z, MDefinition *w, MIRType type) @@ -4027,6 +4038,13 @@ CheckDotAccess(FunctionCompiler &f, ParseNode *elem, MDefinition **def, Type *ty SimdLane lane; JSAtomState &names = m.cx()->names(); + + if (field == names.signMask) { + *type = Type::Int; + *def = f.extractSignMask(baseDef); + return true; + } + if (field == names.x) lane = LaneX; else if (field == names.y) @@ -4036,7 +4054,7 @@ CheckDotAccess(FunctionCompiler &f, ParseNode *elem, MDefinition **def, Type *ty else if (field == names.w) lane = LaneW; else - return f.fail(base, "dot access field must be a lane name (x, y, z, w)"); + return f.fail(base, "dot access field must be a lane name (x, y, z, w) or signMask"); *type = baseType.simdToScalarType(); *def = f.extractSimdElement(lane, baseDef, type->toMIRType()); diff --git a/js/src/jit-test/tests/asm.js/testSIMD.js b/js/src/jit-test/tests/asm.js/testSIMD.js index 35f3d1499bc..eff82d52710 100644 --- a/js/src/jit-test/tests/asm.js/testSIMD.js +++ b/js/src/jit-test/tests/asm.js/testSIMD.js @@ -161,6 +161,21 @@ CheckF4('', 'var x=f4(' + (INT32_MAX + 1) + ', 2, 3, 4)', [INT32_MAX + 1, 2, 3, CheckF4('', 'var x=f4(1.3, 2.4, 3.5, 98.76)', [1.3, 2.4, 3.5, 98.76]); CheckF4('', 'var x=f4(13.37, 2., 3., -0)', [13.37, 2, 3, -0]); +// signMask +assertAsmTypeFail('glob', USE_ASM + I32 + "function f() {var x=i4(1,2,3,4); var y=0.0; y=x.signMask;} return f"); +assertAsmTypeFail('glob', USE_ASM + I32 + FROUND + "function f() {var x=i4(1,2,3,4); var y=f32(0.0); y=x.signMask;} return f"); + +assertAsmTypeFail('glob', USE_ASM + "function f() {var x=42; return x.signMask;} return f"); +assertAsmTypeFail('glob', USE_ASM + "function f() {var x=42.; return x.signMask;} return f"); +assertAsmTypeFail('glob', USE_ASM + FROUND + "function f() {var x=f32(42.); return x.signMask;} return f"); + +assertEq(asmLink(asmCompile('glob', USE_ASM + I32 + 'function f() { var x=i4(1,2,3,4); return x.signMask | 0 } return f'), this)(), 0b0000); +assertEq(asmLink(asmCompile('glob', USE_ASM + I32 + 'function f() { var x=i4(0,-1, ' + INT32_MAX + ',' + INT32_MIN + '); return x.signMask | 0 } return f'), this)(), 0b1010); + +assertEq(asmLink(asmCompile('glob', USE_ASM + F32 + 'var Infinity = glob.Infinity; function f() { var x=f4(0,0,0,0); x=f4(1, -13.37, 42, -Infinity); return x.signMask | 0 } return f'), this)(), 0b1010); +assertEq(asmLink(asmCompile('glob', USE_ASM + F32 + 'var Infinity = glob.Infinity; function f() { var x=f4(0,0,0,0); x=f4(-1, 0, -0.000001, Infinity); return x.signMask | 0 } return f'), this)(), 0b0101); +assertEq(asmLink(asmCompile('glob', USE_ASM + F32 + 'var NaN = glob.NaN; function f() { var x=f4(0,0,0,0); x=f4(-1, NaN, 3., 4.); return x.signMask | 0 } return f'), this)(), 0b0001); + // 1.3.3. Variable assignments assertAsmTypeFail('glob', USE_ASM + I32 + I32A + "function f() {var x=i4(1,2,3,4); x=i4();} return f"); assertAsmTypeFail('glob', USE_ASM + I32 + I32A + "function f() {var x=i4(1,2,3,4); x=i4(1);} return f"); diff --git a/js/src/vm/CommonPropertyNames.h b/js/src/vm/CommonPropertyNames.h index 5ffe30645eb..2ec45e86ab4 100644 --- a/js/src/vm/CommonPropertyNames.h +++ b/js/src/vm/CommonPropertyNames.h @@ -166,6 +166,7 @@ macro(sensitivity, sensitivity, "sensitivity") \ macro(set, set, "set") \ macro(shape, shape, "shape") \ + macro(signMask, signMask, "signMask") \ macro(source, source, "source") \ macro(stack, stack, "stack") \ macro(sticky, sticky, "sticky") \ From d15966db69a70735123e532ab0d8619b386cf3be Mon Sep 17 00:00:00 2001 From: Jon Coppeard Date: Tue, 2 Sep 2014 10:30:37 +0200 Subject: [PATCH 19/66] Bug 1061214 r=terrence --- js/src/jit/VMFunctions.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/js/src/jit/VMFunctions.h b/js/src/jit/VMFunctions.h index 5de18ff6c06..792cb26f68a 100644 --- a/js/src/jit/VMFunctions.h +++ b/js/src/jit/VMFunctions.h @@ -380,6 +380,18 @@ template <> struct TypeToRootType { template <> struct TypeToRootType { static const uint32_t result = VMFunction::RootCell; }; +template <> struct TypeToRootType { + static const uint32_t result = VMFunction::RootCell; +}; +template <> struct TypeToRootType > { + static const uint32_t result = VMFunction::RootObject; +}; +template <> struct TypeToRootType > { + static const uint32_t result = VMFunction::RootCell; +}; +template struct TypeToRootType > { + // Fail for Handle types that aren't specialized above. +}; template struct OutParamToDataType { static const DataType result = Type_Void; }; template <> struct OutParamToDataType { static const DataType result = Type_Value; }; From e3d6879f3e09e14358a7667587f5e16b7aad6846 Mon Sep 17 00:00:00 2001 From: Douglas Crosher Date: Tue, 2 Sep 2014 01:49:20 +1000 Subject: [PATCH 20/66] Bug 1060437 - SIMD: Implement float32x4.select in the interpreter; r=bbouvier --- js/src/builtin/SIMD.cpp | 29 ++++++++++++++ js/src/builtin/SIMD.h | 1 + .../TypedObject/simd/float32x4select.js | 38 +++++++++++++++++++ .../ecma_6/TypedObject/simd/int32x4select.js | 27 +++++++++---- 4 files changed, 88 insertions(+), 7 deletions(-) create mode 100644 js/src/tests/ecma_6/TypedObject/simd/float32x4select.js diff --git a/js/src/builtin/SIMD.cpp b/js/src/builtin/SIMD.cpp index 337bb908bb5..069a9b3d019 100644 --- a/js/src/builtin/SIMD.cpp +++ b/js/src/builtin/SIMD.cpp @@ -875,6 +875,35 @@ Float32x4Clamp(JSContext *cx, unsigned argc, Value *vp) static bool Int32x4Select(JSContext *cx, unsigned argc, Value *vp) +{ + CallArgs args = CallArgsFromVp(argc, vp); + if (args.length() != 3 || !IsVectorObject(args[0]) || + !IsVectorObject(args[1]) || !IsVectorObject(args[2])) + { + return ErrorBadArgs(cx); + } + + int32_t *val = TypedObjectMemory(args[0]); + int32_t *tv = TypedObjectMemory(args[1]); + int32_t *fv = TypedObjectMemory(args[2]); + + int32_t tr[Int32x4::lanes]; + for (unsigned i = 0; i < Int32x4::lanes; i++) + tr[i] = And::apply(val[i], tv[i]); + + int32_t fr[Int32x4::lanes]; + for (unsigned i = 0; i < Int32x4::lanes; i++) + fr[i] = And::apply(Not::apply(val[i]), fv[i]); + + int32_t orInt[Int32x4::lanes]; + for (unsigned i = 0; i < Int32x4::lanes; i++) + orInt[i] = Or::apply(tr[i], fr[i]); + + return StoreResult(cx, args, orInt); +} + +static bool +Float32x4Select(JSContext *cx, unsigned argc, Value *vp) { CallArgs args = CallArgsFromVp(argc, vp); if (args.length() != 3 || !IsVectorObject(args[0]) || diff --git a/js/src/builtin/SIMD.h b/js/src/builtin/SIMD.h index ea7d8324447..e4371b243ca 100644 --- a/js/src/builtin/SIMD.h +++ b/js/src/builtin/SIMD.h @@ -57,6 +57,7 @@ #define FLOAT32X4_TERNARY_FUNCTION_LIST(V) \ V(clamp, Float32x4Clamp, 3, 0) \ + V(select, Float32x4Select, 3, 0) \ V(shuffleMix, FuncShuffle, 3, 0) #define FLOAT32X4_FUNCTION_LIST(V) \ diff --git a/js/src/tests/ecma_6/TypedObject/simd/float32x4select.js b/js/src/tests/ecma_6/TypedObject/simd/float32x4select.js new file mode 100644 index 00000000000..4ab4f71cbe6 --- /dev/null +++ b/js/src/tests/ecma_6/TypedObject/simd/float32x4select.js @@ -0,0 +1,38 @@ +// |reftest| skip-if(!this.hasOwnProperty("SIMD")) +var BUGNUMBER = 1060437; +var float32x4 = SIMD.float32x4; +var int32x4 = SIMD.int32x4; + +var summary = 'float32x4 select'; + +function test() { + print(BUGNUMBER + ": " + summary); + + var a = float32x4(0.125,4.25,9.75,16.125); + var b = float32x4(1.5,2.75,3.25,4.5); + var sel_ttff = int32x4.bool(true, true, false, false); + var c = SIMD.float32x4.select(sel_ttff,a,b); + assertEq(c.x, 0.125); + assertEq(c.y, 4.25); + assertEq(c.z, 3.25); + assertEq(c.w, 4.5); + + var b2 = float32x4(1.5,2.75,NaN,Infinity); + var c = SIMD.float32x4.select(sel_ttff,a,b2); + assertEq(c.x, 0.125); + assertEq(c.y, 4.25); + assertEq(c.z, NaN); + assertEq(c.w, Infinity); + + var a2 = float32x4(-NaN,-Infinity,9.75,16.125); + var c = SIMD.float32x4.select(sel_ttff,a2,b2); + assertEq(c.x, -NaN); + assertEq(c.y, -Infinity); + assertEq(c.z, NaN); + assertEq(c.w, Infinity); + + if (typeof reportCompare === "function") + reportCompare(true, true); +} + +test(); diff --git a/js/src/tests/ecma_6/TypedObject/simd/int32x4select.js b/js/src/tests/ecma_6/TypedObject/simd/int32x4select.js index 7d3582dc5de..fbba6ff332e 100644 --- a/js/src/tests/ecma_6/TypedObject/simd/int32x4select.js +++ b/js/src/tests/ecma_6/TypedObject/simd/int32x4select.js @@ -1,17 +1,17 @@ // |reftest| skip-if(!this.hasOwnProperty("SIMD")) -var BUGNUMBER = 946042; -var float32x4 = SIMD.float32x4; +var BUGNUMBER = 1060437; var int32x4 = SIMD.int32x4; var summary = 'int32x4 select'; +const INT32_MAX = Math.pow(2, 31) - 1; +const INT32_MIN = INT32_MAX + 1 | 0; + function test() { print(BUGNUMBER + ": " + summary); - // FIXME -- Bug 948379: Amend to check for correctness of border cases. - - var a = float32x4(0.0,4.0,9.0,16.0) - var b = float32x4(1.0,2.0,3.0,4.0) + var a = int32x4(0,4,9,16) + var b = int32x4(1,2,3,4) var sel_ttff = int32x4.bool(true, true, false, false); var c = SIMD.int32x4.select(sel_ttff,a,b); assertEq(c.x, 0); @@ -19,9 +19,22 @@ function test() { assertEq(c.z, 3); assertEq(c.w, 4); + var a2 = int32x4(INT32_MAX,INT32_MIN,9,16) + var c = SIMD.int32x4.select(sel_ttff,a2,b); + assertEq(c.x, INT32_MAX); + assertEq(c.y, INT32_MIN); + assertEq(c.z, 3); + assertEq(c.w, 4); + + var b2 = int32x4(1,2,INT32_MAX,INT32_MIN) + var c = SIMD.int32x4.select(sel_ttff,a2,b2); + assertEq(c.x, INT32_MAX); + assertEq(c.y, INT32_MIN); + assertEq(c.z, INT32_MAX); + assertEq(c.w, INT32_MIN); + if (typeof reportCompare === "function") reportCompare(true, true); } test(); - From 53ea58236763c37ac8329a7ac0fcdc004437e5db Mon Sep 17 00:00:00 2001 From: Douglas Crosher Date: Tue, 2 Sep 2014 17:49:17 +1000 Subject: [PATCH 21/66] Bug 1060437 - SIMD backend: Implement the select operation; r=bbouvier --- js/src/jit/LIR-Common.h | 20 +++++++++++ js/src/jit/LOpcodes.h | 1 + js/src/jit/MIR.h | 36 +++++++++++++++++++ js/src/jit/MOpcodes.h | 1 + js/src/jit/ParallelSafetyAnalysis.cpp | 1 + js/src/jit/arm/Lowering-arm.cpp | 6 ++++ js/src/jit/arm/Lowering-arm.h | 1 + js/src/jit/mips/Lowering-mips.cpp | 6 ++++ js/src/jit/mips/Lowering-mips.h | 1 + js/src/jit/none/Lowering-none.h | 1 + js/src/jit/shared/Assembler-x86-shared.h | 16 +++++++++ js/src/jit/shared/BaseAssembler-x86-shared.h | 22 ++++++++++++ .../jit/shared/CodeGenerator-x86-shared.cpp | 16 +++++++++ js/src/jit/shared/CodeGenerator-x86-shared.h | 1 + js/src/jit/shared/Lowering-x86-shared.cpp | 25 +++++++++++++ js/src/jit/shared/Lowering-x86-shared.h | 1 + js/src/jit/shared/MacroAssembler-x86-shared.h | 3 ++ 17 files changed, 158 insertions(+) diff --git a/js/src/jit/LIR-Common.h b/js/src/jit/LIR-Common.h index f277e93fb33..9822bf61c20 100644 --- a/js/src/jit/LIR-Common.h +++ b/js/src/jit/LIR-Common.h @@ -307,6 +307,26 @@ class LSimdBinaryBitwiseX4 : public LInstructionHelper<1, 2, 0> } }; +// SIMD selection of lanes from two int32x4 or float32x4 arguments based on a +// int32x4 argument. +class LSimdSelect : public LInstructionHelper<1, 3, 0> +{ + public: + LIR_HEADER(SimdSelect); + const LAllocation *mask() { + return getOperand(0); + } + const LAllocation *lhs() { + return getOperand(1); + } + const LAllocation *rhs() { + return getOperand(2); + } + MSimdTernaryBitwise::Operation operation() const { + return mir_->toSimdTernaryBitwise()->operation(); + } +}; + // Constant 32-bit integer. class LInteger : public LInstructionHelper<1, 0, 0> { diff --git a/js/src/jit/LOpcodes.h b/js/src/jit/LOpcodes.h index 1e49a60c8f7..dae2c0661a9 100644 --- a/js/src/jit/LOpcodes.h +++ b/js/src/jit/LOpcodes.h @@ -28,6 +28,7 @@ _(SimdBinaryArithIx4) \ _(SimdBinaryArithFx4) \ _(SimdBinaryBitwiseX4) \ + _(SimdSelect) \ _(Value) \ _(CloneLiteral) \ _(Parameter) \ diff --git a/js/src/jit/MIR.h b/js/src/jit/MIR.h index c5c436f57b5..7290bd984e0 100644 --- a/js/src/jit/MIR.h +++ b/js/src/jit/MIR.h @@ -1587,6 +1587,42 @@ class MSimdBinaryBitwise : public MBinaryInstruction } }; +class MSimdTernaryBitwise : public MTernaryInstruction +{ + public: + enum Operation { + select + }; + + private: + Operation operation_; + + MSimdTernaryBitwise(MDefinition *mask, MDefinition *lhs, MDefinition *rhs, Operation op, MIRType type) + : MTernaryInstruction(mask, lhs, rhs), operation_(op) + { + MOZ_ASSERT(IsSimdType(type)); + MOZ_ASSERT(mask->type() == MIRType_Int32x4); + MOZ_ASSERT(lhs->type() == rhs->type()); + MOZ_ASSERT(lhs->type() == type); + setResultType(type); + setMovable(); + } + + public: + INSTRUCTION_HEADER(SimdTernaryBitwise); + static MSimdTernaryBitwise *NewAsmJS(TempAllocator &alloc, MDefinition *mask, MDefinition *lhs, + MDefinition *rhs, Operation op, MIRType t) + { + return new(alloc) MSimdTernaryBitwise(mask, lhs, rhs, op, t); + } + + AliasSet getAliasSet() const { + return AliasSet::None(); + } + + Operation operation() const { return operation_; } +}; + // Deep clone a constant JSObject. class MCloneLiteral : public MUnaryInstruction, diff --git a/js/src/jit/MOpcodes.h b/js/src/jit/MOpcodes.h index 949038b3b31..9f7b8f81053 100644 --- a/js/src/jit/MOpcodes.h +++ b/js/src/jit/MOpcodes.h @@ -20,6 +20,7 @@ namespace jit { _(SimdBinaryComp) \ _(SimdBinaryArith) \ _(SimdBinaryBitwise) \ + _(SimdTernaryBitwise) \ _(CloneLiteral) \ _(Parameter) \ _(Callee) \ diff --git a/js/src/jit/ParallelSafetyAnalysis.cpp b/js/src/jit/ParallelSafetyAnalysis.cpp index baebcf932c4..05c6906e6f0 100644 --- a/js/src/jit/ParallelSafetyAnalysis.cpp +++ b/js/src/jit/ParallelSafetyAnalysis.cpp @@ -120,6 +120,7 @@ class ParallelSafetyVisitor : public MDefinitionVisitor SAFE_OP(SimdBinaryComp) SAFE_OP(SimdBinaryArith) SAFE_OP(SimdBinaryBitwise) + SAFE_OP(SimdTernaryBitwise) UNSAFE_OP(CloneLiteral) SAFE_OP(Parameter) SAFE_OP(Callee) diff --git a/js/src/jit/arm/Lowering-arm.cpp b/js/src/jit/arm/Lowering-arm.cpp index 55d502c4fa0..498543335c6 100644 --- a/js/src/jit/arm/Lowering-arm.cpp +++ b/js/src/jit/arm/Lowering-arm.cpp @@ -549,6 +549,12 @@ LIRGeneratorARM::visitForkJoinGetSlice(MForkJoinGetSlice *ins) MOZ_CRASH("NYI"); } +bool +LIRGeneratorARM::visitSimdTernaryBitwise(MSimdTernaryBitwise *ins) +{ + MOZ_CRASH("NYI"); +} + bool LIRGeneratorARM::visitSimdSplatX4(MSimdSplatX4 *ins) { diff --git a/js/src/jit/arm/Lowering-arm.h b/js/src/jit/arm/Lowering-arm.h index 1b267ae8514..94d466633f5 100644 --- a/js/src/jit/arm/Lowering-arm.h +++ b/js/src/jit/arm/Lowering-arm.h @@ -91,6 +91,7 @@ class LIRGeneratorARM : public LIRGeneratorShared bool visitAsmJSLoadFuncPtr(MAsmJSLoadFuncPtr *ins); bool visitStoreTypedArrayElementStatic(MStoreTypedArrayElementStatic *ins); bool visitForkJoinGetSlice(MForkJoinGetSlice *ins); + bool visitSimdTernaryBitwise(MSimdTernaryBitwise *ins); bool visitSimdSplatX4(MSimdSplatX4 *ins); }; diff --git a/js/src/jit/mips/Lowering-mips.cpp b/js/src/jit/mips/Lowering-mips.cpp index c1a741c84a9..fc890ea4e4b 100644 --- a/js/src/jit/mips/Lowering-mips.cpp +++ b/js/src/jit/mips/Lowering-mips.cpp @@ -531,6 +531,12 @@ LIRGeneratorMIPS::visitForkJoinGetSlice(MForkJoinGetSlice *ins) MOZ_CRASH("NYI"); } +bool +LIRGeneratorMIPS::visitSimdTernaryBitwise(MSimdTernaryBitwise *ins) +{ + MOZ_CRASH("NYI"); +} + bool LIRGeneratorMIPS::visitSimdSplatX4(MSimdSplatX4 *ins) { diff --git a/js/src/jit/mips/Lowering-mips.h b/js/src/jit/mips/Lowering-mips.h index 0ecfaa73c6d..ec6b0646b0f 100644 --- a/js/src/jit/mips/Lowering-mips.h +++ b/js/src/jit/mips/Lowering-mips.h @@ -91,6 +91,7 @@ class LIRGeneratorMIPS : public LIRGeneratorShared bool visitAsmJSLoadFuncPtr(MAsmJSLoadFuncPtr *ins); bool visitStoreTypedArrayElementStatic(MStoreTypedArrayElementStatic *ins); bool visitForkJoinGetSlice(MForkJoinGetSlice *ins); + bool visitSimdTernaryBitwise(MSimdTernaryBitwise *ins); bool visitSimdSplatX4(MSimdSplatX4 *ins); }; diff --git a/js/src/jit/none/Lowering-none.h b/js/src/jit/none/Lowering-none.h index 56f881756a5..7e5c8d943bb 100644 --- a/js/src/jit/none/Lowering-none.h +++ b/js/src/jit/none/Lowering-none.h @@ -73,6 +73,7 @@ class LIRGeneratorNone : public LIRGeneratorShared LTableSwitch *newLTableSwitch(LAllocation, LDefinition, MTableSwitch *) { MOZ_CRASH(); } LTableSwitchV *newLTableSwitchV(MTableSwitch *) { MOZ_CRASH(); } + bool visitSimdTernaryBitwise(MSimdTernaryBitwise *ins) { MOZ_CRASH(); } bool visitSimdSplatX4(MSimdSplatX4 *ins) { MOZ_CRASH(); } }; diff --git a/js/src/jit/shared/Assembler-x86-shared.h b/js/src/jit/shared/Assembler-x86-shared.h index 1172495d1ca..8acc2b2b67c 100644 --- a/js/src/jit/shared/Assembler-x86-shared.h +++ b/js/src/jit/shared/Assembler-x86-shared.h @@ -1681,6 +1681,22 @@ class AssemblerX86Shared : public AssemblerShared MOZ_CRASH("unexpected operand kind"); } } + void andnps(const Operand &src, FloatRegister dest) { + JS_ASSERT(HasSSE2()); + switch (src.kind()) { + case Operand::FPREG: + masm.andnps_rr(src.fpu(), dest.code()); + break; + case Operand::MEM_REG_DISP: + masm.andnps_mr(src.disp(), src.base(), dest.code()); + break; + case Operand::MEM_ADDRESS32: + masm.andnps_mr(src.address(), dest.code()); + break; + default: + MOZ_CRASH("unexpected operand kind"); + } + } void orps(const Operand &src, FloatRegister dest) { MOZ_ASSERT(HasSSE2()); switch (src.kind()) { diff --git a/js/src/jit/shared/BaseAssembler-x86-shared.h b/js/src/jit/shared/BaseAssembler-x86-shared.h index dab227f1810..5ca53ffb192 100644 --- a/js/src/jit/shared/BaseAssembler-x86-shared.h +++ b/js/src/jit/shared/BaseAssembler-x86-shared.h @@ -296,6 +296,7 @@ private: OP2_UCOMISD_VsdWsd = 0x2E, OP2_MOVMSKPD_EdVd = 0x50, OP2_ANDPS_VpsWps = 0x54, + OP2_ANDNPS_VpsWps = 0x55, OP2_ORPS_VpsWps = 0x56, OP2_XORPS_VpsWps = 0x57, OP2_ADDSD_VsdWsd = 0x58, @@ -3464,6 +3465,27 @@ public: m_formatter.twoByteOp(OP2_ANDPS_VpsWps, (RegisterID)dst, address); } + void andnps_rr(XMMRegisterID src, XMMRegisterID dst) + { + spew("andnps %s, %s", + nameFPReg(src), nameFPReg(dst)); + m_formatter.twoByteOp(OP2_ANDNPS_VpsWps, (RegisterID)dst, (RegisterID)src); + } + + void andnps_mr(int offset, RegisterID base, XMMRegisterID dst) + { + spew("andnps %s0x%x(%s), %s", + PRETTY_PRINT_OFFSET(offset), nameIReg(base), nameFPReg(dst)); + m_formatter.twoByteOp(OP2_ANDNPS_VpsWps, (RegisterID)dst, base, offset); + } + + void andnps_mr(const void* address, XMMRegisterID dst) + { + spew("andnps %p, %s", + address, nameFPReg(dst)); + m_formatter.twoByteOp(OP2_ANDPS_VpsWps, (RegisterID)dst, address); + } + void orps_rr(XMMRegisterID src, XMMRegisterID dst) { spew("orps %s, %s", diff --git a/js/src/jit/shared/CodeGenerator-x86-shared.cpp b/js/src/jit/shared/CodeGenerator-x86-shared.cpp index 56f9cb574ea..7a51064e096 100644 --- a/js/src/jit/shared/CodeGenerator-x86-shared.cpp +++ b/js/src/jit/shared/CodeGenerator-x86-shared.cpp @@ -2371,6 +2371,22 @@ CodeGeneratorX86Shared::visitSimdBinaryBitwiseX4(LSimdBinaryBitwiseX4 *ins) MOZ_CRASH("unexpected SIMD bitwise op"); } +bool +CodeGeneratorX86Shared::visitSimdSelect(LSimdSelect *ins) +{ + FloatRegister mask = ToFloatRegister(ins->mask()); + FloatRegister onTrue = ToFloatRegister(ins->lhs()); + FloatRegister onFalse = ToFloatRegister(ins->rhs()); + + MOZ_ASSERT(onTrue == ToFloatRegister(ins->output())); + // The onFalse argument is not destroyed but due to limitations of the + // register allocator its life ends at the start of the operation. + masm.bitwiseAndX4(Operand(mask), onTrue); + masm.bitwiseAndNotX4(Operand(onFalse), mask); + masm.bitwiseOrX4(Operand(mask), onTrue); + return true; +} + bool CodeGeneratorX86Shared::visitForkJoinGetSlice(LForkJoinGetSlice *ins) { diff --git a/js/src/jit/shared/CodeGenerator-x86-shared.h b/js/src/jit/shared/CodeGenerator-x86-shared.h index 30444e9c291..46fa417f4ce 100644 --- a/js/src/jit/shared/CodeGenerator-x86-shared.h +++ b/js/src/jit/shared/CodeGenerator-x86-shared.h @@ -218,6 +218,7 @@ class CodeGeneratorX86Shared : public CodeGeneratorShared bool visitSimdBinaryArithIx4(LSimdBinaryArithIx4 *lir); bool visitSimdBinaryArithFx4(LSimdBinaryArithFx4 *lir); bool visitSimdBinaryBitwiseX4(LSimdBinaryBitwiseX4 *lir); + bool visitSimdSelect(LSimdSelect *ins); // Out of line visitors. bool visitOutOfLineBailout(OutOfLineBailout *ool); diff --git a/js/src/jit/shared/Lowering-x86-shared.cpp b/js/src/jit/shared/Lowering-x86-shared.cpp index 36e40df2e08..a718b9b6b93 100644 --- a/js/src/jit/shared/Lowering-x86-shared.cpp +++ b/js/src/jit/shared/Lowering-x86-shared.cpp @@ -307,6 +307,31 @@ LIRGeneratorX86Shared::visitForkJoinGetSlice(MForkJoinGetSlice *ins) return defineFixed(lir, ins, LAllocation(AnyRegister(ForkJoinGetSliceReg_output))); } +bool +LIRGeneratorX86Shared::visitSimdTernaryBitwise(MSimdTernaryBitwise *ins) +{ + MOZ_ASSERT(IsSimdType(ins->type())); + + if (ins->type() == MIRType_Int32x4 || ins->type() == MIRType_Float32x4) { + LSimdSelect *lins = new(alloc()) LSimdSelect; + + // This must be useRegisterAtStart() because it is destroyed. + lins->setOperand(0, useRegisterAtStart(ins->getOperand(0))); + // This must be useRegisterAtStart() because it is destroyed. + lins->setOperand(1, useRegisterAtStart(ins->getOperand(1))); + // This could be useRegister(), but combining it with + // useRegisterAtStart() is broken see bug 772830. + lins->setOperand(2, useRegisterAtStart(ins->getOperand(2))); + // The output is constrained to be in the same register as the second + // argument to avoid redundantly copying the result into place. The + // register allocator will move the result if necessary. + return defineReuseInput(lins, ins, 1); + } + + MOZ_CRASH("Unknown SIMD kind when doing bitwise operations"); + return false; +} + bool LIRGeneratorX86Shared::visitSimdSplatX4(MSimdSplatX4 *ins) { diff --git a/js/src/jit/shared/Lowering-x86-shared.h b/js/src/jit/shared/Lowering-x86-shared.h index 808aff067ad..1b0aa4cef6e 100644 --- a/js/src/jit/shared/Lowering-x86-shared.h +++ b/js/src/jit/shared/Lowering-x86-shared.h @@ -48,6 +48,7 @@ class LIRGeneratorX86Shared : public LIRGeneratorShared bool lowerTruncateDToInt32(MTruncateToInt32 *ins); bool lowerTruncateFToInt32(MTruncateToInt32 *ins); bool visitForkJoinGetSlice(MForkJoinGetSlice *ins); + bool visitSimdTernaryBitwise(MSimdTernaryBitwise *ins); bool visitSimdSplatX4(MSimdSplatX4 *ins); }; diff --git a/js/src/jit/shared/MacroAssembler-x86-shared.h b/js/src/jit/shared/MacroAssembler-x86-shared.h index 8890afeaace..4f50303e40c 100644 --- a/js/src/jit/shared/MacroAssembler-x86-shared.h +++ b/js/src/jit/shared/MacroAssembler-x86-shared.h @@ -472,6 +472,9 @@ class MacroAssemblerX86Shared : public Assembler // penalty for integer types and double. andps(src, dest); } + void bitwiseAndNotX4(const Operand &src, FloatRegister dest) { + andnps(src, dest); + } void bitwiseOrX4(const Operand &src, FloatRegister dest) { orps(src, dest); } From 248136ca220c197a3e42c8388eba8acd43ffbdc7 Mon Sep 17 00:00:00 2001 From: Jon Coppeard Date: Tue, 2 Sep 2014 11:07:21 +0200 Subject: [PATCH 22/66] Bug 650161 - Fix some jit-test failures when compacting GC enabled r=terrence --- js/src/gc/GCInternals.h | 12 ++++++++++++ js/src/gc/Marking.cpp | 4 ++++ js/src/jsgc.cpp | 20 ++++++++------------ js/src/jspropertytree.cpp | 8 ++++++++ 4 files changed, 32 insertions(+), 12 deletions(-) diff --git a/js/src/gc/GCInternals.h b/js/src/gc/GCInternals.h index 3712af87288..66b66c2b679 100644 --- a/js/src/gc/GCInternals.h +++ b/js/src/gc/GCInternals.h @@ -136,6 +136,18 @@ void CheckHashTablesAfterMovingGC(JSRuntime *rt); #endif +#ifdef JSGC_COMPACTING +struct MovingTracer : JSTracer { + MovingTracer(JSRuntime *rt) : JSTracer(rt, Visit, TraceWeakMapValues) {} + + static void Visit(JSTracer *jstrc, void **thingp, JSGCTraceKind kind); + static void Sweep(JSTracer *jstrc); + static bool IsMovingTracer(JSTracer *trc) { + return trc->callback == Visit; + } +}; +#endif + } /* namespace gc */ } /* namespace js */ diff --git a/js/src/gc/Marking.cpp b/js/src/gc/Marking.cpp index 3fe44579268..102d22b8611 100644 --- a/js/src/gc/Marking.cpp +++ b/js/src/gc/Marking.cpp @@ -182,6 +182,10 @@ CheckMarkedThing(JSTracer *trc, T **thingp) if (IsInsideNursery(thing)) return; +#ifdef JSGC_COMPACTING + JS_ASSERT_IF(!MovingTracer::IsMovingTracer(trc), !IsForwarded(*thingp)); +#endif + /* * Permanent atoms are not associated with this runtime, but will be ignored * during marking. diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp index ef0e91855a6..9533952d991 100644 --- a/js/src/jsgc.cpp +++ b/js/src/jsgc.cpp @@ -2134,7 +2134,7 @@ ArenaList::pickArenasToRelocate() #ifdef DEBUG inline bool -PtrIsInRange(void *ptr, void *start, size_t length) +PtrIsInRange(const void *ptr, const void *start, size_t length) { return uintptr_t(ptr) - uintptr_t(start) < length; } @@ -2176,7 +2176,7 @@ RelocateCell(Zone *zone, Cell *src, AllocKind thingKind, size_t thingSize) JS_ASSERT_IF(dstObj->isNative(), - !PtrIsInRange((HeapSlot*)dstObj->getDenseElements(), src, thingSize)); + !PtrIsInRange((const Value*)dstObj->getDenseElements(), src, thingSize)); } // Copy the mark bits. @@ -2293,13 +2293,6 @@ GCRuntime::relocateArenas() return relocatedList; } -struct MovingTracer : JSTracer { - MovingTracer(JSRuntime *rt) : JSTracer(rt, Visit, TraceWeakMapValues) {} - - static void Visit(JSTracer *jstrc, void **thingp, JSGCTraceKind kind); - static void Sweep(JSTracer *jstrc); -}; - void MovingTracer::Visit(JSTracer *jstrc, void **thingp, JSGCTraceKind kind) { @@ -2346,8 +2339,11 @@ MovingTracer::Sweep(JSTracer *jstrc) /* Type inference may put more blocks here to free. */ rt->freeLifoAlloc.freeAll(); - /* Clear the new object cache as this can contain cell pointers. */ + /* Clear runtime caches that can contain cell pointers. */ + // TODO: Should possibly just call PurgeRuntime() here. rt->newObjectCache.purge(); + rt->nativeIterCache.purge(); + rt->regExpTestCache.purge(); } /* @@ -2423,8 +2419,8 @@ GCRuntime::updatePointersToRelocatedCells() // Mark all gray roots, making sure we call the trace callback to get the // current set. - marker.resetBufferedGrayRoots(); - markAllGrayReferences(gcstats::PHASE_COMPACT_UPDATE_GRAY); + if (JSTraceDataOp op = grayRootTracer.op) + (*op)(&trc, grayRootTracer.data); MovingTracer::Sweep(&trc); } diff --git a/js/src/jspropertytree.cpp b/js/src/jspropertytree.cpp index 8c338e22b3c..e046cf12817 100644 --- a/js/src/jspropertytree.cpp +++ b/js/src/jspropertytree.cpp @@ -277,6 +277,14 @@ Shape::fixupDictionaryShapeAfterMovingGC() if (!listp) return; + // It's possible that this shape is unreachable and that listp points to the + // location of a dead object in the nursery. In this case we should never + // touch it again, so poison it for good measure. + if (IsInsideNursery(reinterpret_cast(listp))) { + JS_POISON(reinterpret_cast(this), JS_SWEPT_TENURED_PATTERN, sizeof(Shape)); + return; + } + JS_ASSERT(!IsInsideNursery(reinterpret_cast(listp))); AllocKind kind = reinterpret_cast(listp)->tenuredGetAllocKind(); JS_ASSERT(kind == FINALIZE_SHAPE || kind <= FINALIZE_OBJECT_LAST); From 814fc8ee718ed7bb6f01b0c17ef76aa621a325c0 Mon Sep 17 00:00:00 2001 From: Jon Coppeard Date: Tue, 2 Sep 2014 11:07:22 +0200 Subject: [PATCH 23/66] Bug 650161 - Fix up shared object elements from copy on write arrays r=terrence --- js/src/jsarray.cpp | 4 +--- js/src/jsgc.cpp | 9 +++++--- js/src/jsobj.cpp | 19 ++++++++++++++++ js/src/jsobj.h | 11 ++++++++++ js/src/jsobjinlines.h | 51 +++++++++++++++++++++++++++++++------------ 5 files changed, 74 insertions(+), 20 deletions(-) diff --git a/js/src/jsarray.cpp b/js/src/jsarray.cpp index 464b53e5d12..a33cbb6fa19 100644 --- a/js/src/jsarray.cpp +++ b/js/src/jsarray.cpp @@ -3380,11 +3380,9 @@ js::NewDenseAllocatedArrayWithTemplate(JSContext *cx, uint32_t length, JSObject JSObject * js::NewDenseCopyOnWriteArray(JSContext *cx, HandleObject templateObject, gc::InitialHeap heap) { - RootedTypeObject type(cx, templateObject->type()); RootedShape shape(cx, templateObject->lastProperty()); JS_ASSERT(!gc::IsInsideNursery(templateObject)); - HeapSlot *elements = templateObject->getDenseElementsAllowCopyOnWrite(); JSObject *metadata = nullptr; if (!NewObjectMetadata(cx, &metadata)) @@ -3395,7 +3393,7 @@ js::NewDenseCopyOnWriteArray(JSContext *cx, HandleObject templateObject, gc::Ini return nullptr; } - Rooted arr(cx, JSObject::createArray(cx, heap, shape, type, elements)); + Rooted arr(cx, JSObject::createCopyOnWriteArray(cx, heap, shape, templateObject)); if (!arr) return nullptr; diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp index 9533952d991..38b6d959da8 100644 --- a/js/src/jsgc.cpp +++ b/js/src/jsgc.cpp @@ -2351,15 +2351,18 @@ MovingTracer::Sweep(JSTracer *jstrc) */ static void UpdateCellPointers(MovingTracer *trc, Cell *cell, JSGCTraceKind traceKind) { - TraceChildren(trc, cell, traceKind); - - if (traceKind == JSTRACE_SHAPE) { + if (traceKind == JSTRACE_OBJECT) { + JSObject *obj = static_cast(cell); + obj->fixupAfterMovingGC(); + } else if (traceKind == JSTRACE_SHAPE) { Shape *shape = static_cast(cell); shape->fixupAfterMovingGC(); } else if (traceKind == JSTRACE_BASE_SHAPE) { BaseShape *base = static_cast(cell); base->fixupAfterMovingGC(); } + + TraceChildren(trc, cell, traceKind); } /* diff --git a/js/src/jsobj.cpp b/js/src/jsobj.cpp index a1f91d9cd7a..0eda57dc41d 100644 --- a/js/src/jsobj.cpp +++ b/js/src/jsobj.cpp @@ -3555,6 +3555,25 @@ JSObject::CopyElementsForWrite(ThreadSafeContext *cx, JSObject *obj) return true; } +void +JSObject::fixupAfterMovingGC() +{ + /* + * If this is a copy-on-write elements we may need to fix up both the + * elements' pointer back to the owner object, and the elements pointer + * itself if it points to inline elements in another object. + */ + if (hasDynamicElements()) { + ObjectElements *header = getElementsHeader(); + if (header->isCopyOnWrite()) { + HeapPtrObject &owner = header->ownerObject(); + if (IsForwarded(owner.get())) + owner = Forwarded(owner.get()); + elements = owner->getElementsHeader()->elements(); + } + } +} + bool js::SetClassAndProto(JSContext *cx, HandleObject obj, const Class *clasp, Handle proto, diff --git a/js/src/jsobj.h b/js/src/jsobj.h index 9d122c7f31a..bd6412ea35b 100644 --- a/js/src/jsobj.h +++ b/js/src/jsobj.h @@ -253,11 +253,20 @@ class JSObject : public js::ObjectImpl js::HandleTypeObject type, js::HeapSlot *elements); + /* Make an copy-on-write array object which shares the elements of an existing object. */ + static inline js::ArrayObject *createCopyOnWriteArray(js::ExclusiveContext *cx, + js::gc::InitialHeap heap, + js::HandleShape shape, + js::HandleObject sharedElementsOwner); + private: // Helper for the above two methods. static inline JSObject * createArrayInternal(js::ExclusiveContext *cx, js::gc::AllocKind kind, js::gc::InitialHeap heap, js::HandleShape shape, js::HandleTypeObject type); + + static inline js::ArrayObject *finishCreateArray(JSObject *obj, + js::HandleShape shape); public: /* @@ -773,6 +782,8 @@ class JSObject : public js::ObjectImpl return getElementsHeader()->isCopyOnWrite(); } + void fixupAfterMovingGC(); + /* Packed information for this object's elements. */ inline bool writeToIndexWouldMarkNotPacked(uint32_t index); inline void markDenseElementsNotPacked(js::ExclusiveContext *cx); diff --git a/js/src/jsobjinlines.h b/js/src/jsobjinlines.h index 3bf981263a1..39ee8d923d1 100644 --- a/js/src/jsobjinlines.h +++ b/js/src/jsobjinlines.h @@ -581,6 +581,18 @@ JSObject::createArrayInternal(js::ExclusiveContext *cx, js::gc::AllocKind kind, return obj; } +/* static */ inline js::ArrayObject * +JSObject::finishCreateArray(JSObject *obj, js::HandleShape shape) +{ + size_t span = shape->slotSpan(); + if (span) + obj->initializeSlotRange(0, span); + + js::gc::TraceCreateObject(obj); + + return &obj->as(); +} + /* static */ inline js::ArrayObject * JSObject::createArray(js::ExclusiveContext *cx, js::gc::AllocKind kind, js::gc::InitialHeap heap, js::HandleShape shape, js::HandleTypeObject type, @@ -595,13 +607,7 @@ JSObject::createArray(js::ExclusiveContext *cx, js::gc::AllocKind kind, js::gc:: obj->setFixedElements(); new (obj->getElementsHeader()) js::ObjectElements(capacity, length); - size_t span = shape->slotSpan(); - if (span) - obj->initializeSlotRange(0, span); - - js::gc::TraceCreateObject(obj); - - return &obj->as(); + return finishCreateArray(obj, shape); } /* static */ inline js::ArrayObject * @@ -610,8 +616,8 @@ JSObject::createArray(js::ExclusiveContext *cx, js::gc::InitialHeap heap, js::HeapSlot *elements) { // Use the smallest allocation kind for the array, as it can't have any - // fixed slots (see assert in the above function) and will not be using its - // fixed elements. + // fixed slots (see the assert in createArrayInternal) and will not be using + // its fixed elements. js::gc::AllocKind kind = js::gc::FINALIZE_OBJECT0_BACKGROUND; JSObject *obj = createArrayInternal(cx, kind, heap, shape, type); @@ -620,13 +626,30 @@ JSObject::createArray(js::ExclusiveContext *cx, js::gc::InitialHeap heap, obj->elements = elements; - size_t span = shape->slotSpan(); - if (span) - obj->initializeSlotRange(0, span); + return finishCreateArray(obj, shape); +} - js::gc::TraceCreateObject(obj); +/* static */ inline js::ArrayObject * +JSObject::createCopyOnWriteArray(js::ExclusiveContext *cx, js::gc::InitialHeap heap, + js::HandleShape shape, + js::HandleObject sharedElementsOwner) +{ + MOZ_ASSERT(sharedElementsOwner->getElementsHeader()->isCopyOnWrite()); + MOZ_ASSERT(sharedElementsOwner->getElementsHeader()->ownerObject() == sharedElementsOwner); - return &obj->as(); + // Use the smallest allocation kind for the array, as it can't have any + // fixed slots (see the assert in createArrayInternal) and will not be using + // its fixed elements. + js::gc::AllocKind kind = js::gc::FINALIZE_OBJECT0_BACKGROUND; + + js::RootedTypeObject type(cx, sharedElementsOwner->type()); + JSObject *obj = createArrayInternal(cx, kind, heap, shape, type); + if (!obj) + return nullptr; + + obj->elements = sharedElementsOwner->getDenseElementsAllowCopyOnWrite(); + + return finishCreateArray(obj, shape); } inline void From 8a2d317b16b4879c44242282cbf97ee5dcd110fb Mon Sep 17 00:00:00 2001 From: Jon Coppeard Date: Tue, 2 Sep 2014 11:07:22 +0200 Subject: [PATCH 24/66] Bug 650161 - Add moving GC callback and use it to fix up ipc CPOW tables r=terrence --- js/ipc/JavaScriptChild.cpp | 16 ++++++++++++---- js/ipc/JavaScriptChild.h | 2 +- js/ipc/JavaScriptParent.cpp | 8 ++++++++ js/ipc/JavaScriptShared.cpp | 16 ++++++++++------ js/ipc/JavaScriptShared.h | 10 ++++++++-- js/src/gc/GCRuntime.h | 3 +++ js/src/jsapi.cpp | 13 +++++++++++++ js/src/jsapi.h | 9 +++++++++ js/src/jsgc.cpp | 26 ++++++++++++++++++++++++++ 9 files changed, 90 insertions(+), 13 deletions(-) diff --git a/js/ipc/JavaScriptChild.cpp b/js/ipc/JavaScriptChild.cpp index 294be407703..90289446fe2 100644 --- a/js/ipc/JavaScriptChild.cpp +++ b/js/ipc/JavaScriptChild.cpp @@ -24,10 +24,16 @@ static void FinalizeChild(JSFreeOp *fop, JSFinalizeStatus status, bool isCompartment, void *data) { if (status == JSFINALIZE_GROUP_START) { - static_cast(data)->finalize(fop); + static_cast(data)->finalize(); } } +static void +FixupChildAfterMovingGC(JSRuntime *rt, void *data) +{ + static_cast(data)->fixupAfterMovingGC(); +} + JavaScriptChild::JavaScriptChild(JSRuntime *rt) : JavaScriptShared(rt), JavaScriptBase(rt) @@ -37,6 +43,7 @@ JavaScriptChild::JavaScriptChild(JSRuntime *rt) JavaScriptChild::~JavaScriptChild() { JS_RemoveFinalizeCallback(rt_, FinalizeChild); + JS_RemoveMovingGCCallback(rt_, FixupChildAfterMovingGC); } bool @@ -48,14 +55,15 @@ JavaScriptChild::init() return false; JS_AddFinalizeCallback(rt_, FinalizeChild, this); + JS_AddMovingGCCallback(rt_, FixupChildAfterMovingGC, this); return true; } void -JavaScriptChild::finalize(JSFreeOp *fop) +JavaScriptChild::finalize() { - objects_.finalize(fop); - objectIds_.finalize(fop); + objects_.sweep(); + objectIds_.sweep(); } JSObject * diff --git a/js/ipc/JavaScriptChild.h b/js/ipc/JavaScriptChild.h index 609b680dd5c..fc6081f8c77 100644 --- a/js/ipc/JavaScriptChild.h +++ b/js/ipc/JavaScriptChild.h @@ -21,7 +21,7 @@ class JavaScriptChild : public JavaScriptBase virtual ~JavaScriptChild(); bool init(); - void finalize(JSFreeOp *fop); + void finalize(); void drop(JSObject *obj); diff --git a/js/ipc/JavaScriptParent.cpp b/js/ipc/JavaScriptParent.cpp index 8bd2086fa3b..d05af7ee5ff 100644 --- a/js/ipc/JavaScriptParent.cpp +++ b/js/ipc/JavaScriptParent.cpp @@ -27,6 +27,12 @@ TraceParent(JSTracer *trc, void *data) static_cast(data)->trace(trc); } +static void +FixupParentAfterMovingGC(JSRuntime *rt, void *data) +{ + static_cast(data)->fixupAfterMovingGC(); +} + JavaScriptParent::JavaScriptParent(JSRuntime *rt) : JavaScriptShared(rt), JavaScriptBase(rt) @@ -36,6 +42,7 @@ JavaScriptParent::JavaScriptParent(JSRuntime *rt) JavaScriptParent::~JavaScriptParent() { JS_RemoveExtraGCRootsTracer(rt_, TraceParent, this); + JS_RemoveMovingGCCallback(rt_, FixupParentAfterMovingGC); } bool @@ -45,6 +52,7 @@ JavaScriptParent::init() return false; JS_AddExtraGCRootsTracer(rt_, TraceParent, this); + JS_AddMovingGCCallback(rt_, FixupParentAfterMovingGC, this); return true; } diff --git a/js/ipc/JavaScriptShared.cpp b/js/ipc/JavaScriptShared.cpp index c63d6ac2b9a..54092cd4fab 100644 --- a/js/ipc/JavaScriptShared.cpp +++ b/js/ipc/JavaScriptShared.cpp @@ -41,14 +41,12 @@ IdToObjectMap::trace(JSTracer *trc) } void -IdToObjectMap::finalize(JSFreeOp *fop) +IdToObjectMap::sweep() { for (Table::Enum e(table_); !e.empty(); e.popFront()) { DebugOnly prior = e.front().value().get(); if (JS_IsAboutToBeFinalized(&e.front().value())) e.removeFront(); - else - MOZ_ASSERT(e.front().value() == prior); } } @@ -97,14 +95,14 @@ ObjectToIdMap::init() } void -ObjectToIdMap::finalize(JSFreeOp *fop) +ObjectToIdMap::sweep() { for (Table::Enum e(*table_); !e.empty(); e.popFront()) { JSObject *obj = e.front().key(); if (JS_IsAboutToBeFinalizedUnbarriered(&obj)) e.removeFront(); - else - MOZ_ASSERT(obj == e.front().key()); + else if (obj != e.front().key()) + e.rekeyFront(obj); } } @@ -596,3 +594,9 @@ JavaScriptShared::Wrap(JSContext *cx, HandleObject aObj, InfallibleTArray &aCpows, JS::MutableHandleObject objp); bool Wrap(JSContext *cx, JS::HandleObject aObj, InfallibleTArray *outCpows); + void fixupAfterMovingGC(); + protected: bool toVariant(JSContext *cx, JS::HandleValue from, JSVariant *to); bool fromVariant(JSContext *cx, const JSVariant &from, JS::MutableHandleValue to); diff --git a/js/src/gc/GCRuntime.h b/js/src/gc/GCRuntime.h index 91daac090be..54d0cd63fc5 100644 --- a/js/src/gc/GCRuntime.h +++ b/js/src/gc/GCRuntime.h @@ -414,6 +414,8 @@ class GCRuntime void setGCCallback(JSGCCallback callback, void *data); bool addFinalizeCallback(JSFinalizeCallback callback, void *data); void removeFinalizeCallback(JSFinalizeCallback func); + bool addMovingGCCallback(JSMovingGCCallback callback, void *data); + void removeMovingGCCallback(JSMovingGCCallback func); JS::GCSliceCallback setSliceCallback(JS::GCSliceCallback callback); void setValidate(bool enable); @@ -797,6 +799,7 @@ class GCRuntime Callback gcCallback; CallbackVector finalizeCallbacks; + CallbackVector movingCallbacks; /* * Malloc counter to measure memory pressure for GC scheduling. It runs diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index aab0c14dead..6e3cee2ff79 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -1888,6 +1888,19 @@ JS_RemoveFinalizeCallback(JSRuntime *rt, JSFinalizeCallback cb) rt->gc.removeFinalizeCallback(cb); } +JS_PUBLIC_API(bool) +JS_AddMovingGCCallback(JSRuntime *rt, JSMovingGCCallback cb, void *data) +{ + AssertHeapIsIdle(rt); + return rt->gc.addMovingGCCallback(cb, data); +} + +JS_PUBLIC_API(void) +JS_RemoveMovingGCCallback(JSRuntime *rt, JSMovingGCCallback cb) +{ + rt->gc.removeMovingGCCallback(cb); +} + JS_PUBLIC_API(bool) JS_IsAboutToBeFinalized(JS::Heap *objp) { diff --git a/js/src/jsapi.h b/js/src/jsapi.h index 0f1b2d1cba9..d12fc78fa9a 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -689,6 +689,9 @@ typedef enum JSFinalizeStatus { typedef void (* JSFinalizeCallback)(JSFreeOp *fop, JSFinalizeStatus status, bool isCompartment, void *data); +typedef void +(* JSMovingGCCallback)(JSRuntime *rt, void *data); + typedef bool (* JSInterruptCallback)(JSContext *cx); @@ -2025,6 +2028,12 @@ JS_AddFinalizeCallback(JSRuntime *rt, JSFinalizeCallback cb, void *data); extern JS_PUBLIC_API(void) JS_RemoveFinalizeCallback(JSRuntime *rt, JSFinalizeCallback cb); +extern JS_PUBLIC_API(bool) +JS_AddMovingGCCallback(JSRuntime *rt, JSMovingGCCallback cb, void *data); + +extern JS_PUBLIC_API(void) +JS_RemoveMovingGCCallback(JSRuntime *rt, JSMovingGCCallback cb); + extern JS_PUBLIC_API(bool) JS_IsGCMarkingTracer(JSTracer *trc); diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp index 38b6d959da8..852e692d8e5 100644 --- a/js/src/jsgc.cpp +++ b/js/src/jsgc.cpp @@ -1595,6 +1595,25 @@ GCRuntime::removeFinalizeCallback(JSFinalizeCallback callback) } } +bool +GCRuntime::addMovingGCCallback(JSMovingGCCallback callback, void *data) +{ + return movingCallbacks.append(Callback(callback, data)); +} + +void +GCRuntime::removeMovingGCCallback(JSMovingGCCallback callback) +{ + for (Callback *p = movingCallbacks.begin(); + p < movingCallbacks.end(); p++) + { + if (p->op == callback) { + movingCallbacks.erase(p); + break; + } + } +} + JS::GCSliceCallback GCRuntime::setSliceCallback(JS::GCSliceCallback callback) { return stats.setSliceCallback(callback); @@ -2426,6 +2445,13 @@ GCRuntime::updatePointersToRelocatedCells() (*op)(&trc, grayRootTracer.data); MovingTracer::Sweep(&trc); + + // Call callbacks to get the rest of the system to fixup other untraced pointers. + for (Callback *p = rt->gc.movingCallbacks.begin(); + p < rt->gc.movingCallbacks.end(); p++) + { + p->op(rt, p->data); + } } void From d8d02056fe11df30d1854d072a72ed936d94a8bd Mon Sep 17 00:00:00 2001 From: Jon Coppeard Date: Tue, 2 Sep 2014 11:07:22 +0200 Subject: [PATCH 25/66] Bug 650161 - Add a class hook that's called when an object is moved r=terrence --- js/public/Class.h | 23 ++++++++++++++++++++--- js/src/jsfriendapi.cpp | 5 +++++ js/src/jsfriendapi.h | 5 ++++- js/src/jsgc.cpp | 20 +++++--------------- js/src/jsproxy.cpp | 12 ++++++++++++ js/src/jsproxy.h | 1 + js/src/vm/ArrayBufferObject.cpp | 14 ++++++++++++-- js/src/vm/ArrayBufferObject.h | 2 +- js/src/vm/TypedArrayObject.cpp | 20 +++++++++++++++++++- js/src/vm/TypedArrayObject.h | 2 ++ 10 files changed, 81 insertions(+), 23 deletions(-) diff --git a/js/public/Class.h b/js/public/Class.h index bf96371a63e..e2172598c4f 100644 --- a/js/public/Class.h +++ b/js/public/Class.h @@ -10,7 +10,7 @@ #define js_Class_h #include "mozilla/NullPtr.h" - + #include "jstypes.h" #include "js/CallArgs.h" @@ -185,6 +185,9 @@ typedef JSObject * typedef JSObject * (* JSWeakmapKeyDelegateOp)(JSObject *obj); +typedef void +(* JSObjectMovedOp)(JSObject *obj, const JSObject *old); + /* js::Class operation signatures. */ namespace js { @@ -318,10 +321,19 @@ struct ClassExtension * wrapped object is collected. */ JSWeakmapKeyDelegateOp weakmapKeyDelegateOp; + + /* + * Optional hook called when an object is moved by a compacting GC. + * + * There may exist weak pointers to an object that are not traced through + * when the normal trace APIs are used, for example objects in the wrapper + * cache. This hook allows these pointers to be updated. + */ + JSObjectMovedOp objectMovedOp; }; #define JS_NULL_CLASS_SPEC {nullptr,nullptr,nullptr,nullptr,nullptr,nullptr} -#define JS_NULL_CLASS_EXT {nullptr,nullptr,nullptr,false,nullptr} +#define JS_NULL_CLASS_EXT {nullptr,nullptr,nullptr,false,nullptr,nullptr} struct ObjectOps { @@ -361,7 +373,7 @@ typedef void (*JSClassInternal)(); struct JSClass { JS_CLASS_MEMBERS(JSFinalizeOp); - void *reserved[31]; + void *reserved[32]; }; #define JSCLASS_HAS_PRIVATE (1<<0) // objects have private slot @@ -540,6 +552,11 @@ IsObjectWithClass(const JS::Value &v, ESClassValue classValue, JSContext *cx); inline bool Unbox(JSContext *cx, JS::HandleObject obj, JS::MutableHandleValue vp); +#ifdef DEBUG +JS_FRIEND_API(bool) +HasObjectMovedOp(JSObject *obj); +#endif + } /* namespace js */ #endif /* js_Class_h */ diff --git a/js/src/jsfriendapi.cpp b/js/src/jsfriendapi.cpp index e8e05cdb574..9ea44eef814 100644 --- a/js/src/jsfriendapi.cpp +++ b/js/src/jsfriendapi.cpp @@ -1195,6 +1195,11 @@ js::IsInRequest(JSContext *cx) { return !!cx->runtime()->requestDepth; } + +bool +js::HasObjectMovedOp(JSObject *obj) { + return !!GetObjectClass(obj)->ext.objectMovedOp; +} #endif #ifdef JSGC_GENERATIONAL diff --git a/js/src/jsfriendapi.h b/js/src/jsfriendapi.h index bc57f046c60..bb50ce6d803 100644 --- a/js/src/jsfriendapi.h +++ b/js/src/jsfriendapi.h @@ -262,7 +262,8 @@ namespace js { innerObject, \ iteratorObject, \ isWrappedNative, \ - js::proxy_WeakmapKeyDelegate \ + js::proxy_WeakmapKeyDelegate, \ + js::proxy_ObjectMoved \ } #define PROXY_CLASS_WITH_EXT(name, extraSlots, flags, callOp, constructOp, ext) \ @@ -377,6 +378,8 @@ extern JS_FRIEND_API(bool) proxy_Convert(JSContext *cx, JS::HandleObject proxy, JSType hint, JS::MutableHandleValue vp); extern JS_FRIEND_API(void) proxy_Finalize(FreeOp *fop, JSObject *obj); +extern JS_FRIEND_API(void) +proxy_ObjectMoved(JSObject *obj, const JSObject *old); extern JS_FRIEND_API(bool) proxy_HasInstance(JSContext *cx, JS::HandleObject proxy, JS::MutableHandleValue v, bool *bp); extern JS_FRIEND_API(bool) diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp index 852e692d8e5..f7509f682e1 100644 --- a/js/src/jsgc.cpp +++ b/js/src/jsgc.cpp @@ -2172,27 +2172,17 @@ RelocateCell(Zone *zone, Cell *src, AllocKind thingKind, size_t thingSize) // Copy source cell contents to destination. memcpy(dst, src, thingSize); - // Fixup the pointer to inline object elements if necessary. if (thingKind <= FINALIZE_OBJECT_LAST) { JSObject *srcObj = static_cast(src); JSObject *dstObj = static_cast(dst); + + // Fixup the pointer to inline object elements if necessary. if (srcObj->hasFixedElements()) dstObj->setFixedElements(); - if (srcObj->is()) { - // We must fix up any inline data pointers while we know the source - // object and before we mark any of the views. - ArrayBufferObject::fixupDataPointerAfterMovingGC( - srcObj->as(), dstObj->as()); - } else if (srcObj->is()) { - TypedArrayObject &typedArray = srcObj->as(); - if (!typedArray.hasBuffer()) { - JS_ASSERT(srcObj->getPrivate() == - srcObj->fixedData(TypedArrayObject::FIXED_DATA_START)); - dstObj->setPrivate(dstObj->fixedData(TypedArrayObject::FIXED_DATA_START)); - } - } - + // Call object moved hook if present. + if (JSObjectMovedOp op = srcObj->getClass()->ext.objectMovedOp) + op(dstObj, srcObj); JS_ASSERT_IF(dstObj->isNative(), !PtrIsInRange((const Value*)dstObj->getDenseElements(), src, thingSize)); diff --git a/js/src/jsproxy.cpp b/js/src/jsproxy.cpp index f27815523ec..b29c046d8fa 100644 --- a/js/src/jsproxy.cpp +++ b/js/src/jsproxy.cpp @@ -362,6 +362,11 @@ BaseProxyHandler::finalize(JSFreeOp *fop, JSObject *proxy) const { } +void +BaseProxyHandler::objectMoved(JSObject *proxy, const JSObject *old) const +{ +} + JSObject * BaseProxyHandler::weakmapKeyDelegate(JSObject *proxy) const { @@ -2878,6 +2883,13 @@ js::proxy_Finalize(FreeOp *fop, JSObject *obj) obj->as().handler()->finalize(fop, obj); } +void +js::proxy_ObjectMoved(JSObject *obj, const JSObject *old) +{ + JS_ASSERT(obj->is()); + obj->as().handler()->objectMoved(obj, old); +} + bool js::proxy_HasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v, bool *bp) { diff --git a/js/src/jsproxy.h b/js/src/jsproxy.h index 8f3a9b1b9f5..4be6da78d54 100644 --- a/js/src/jsproxy.h +++ b/js/src/jsproxy.h @@ -220,6 +220,7 @@ class JS_FRIEND_API(BaseProxyHandler) virtual bool boxedValue_unbox(JSContext *cx, HandleObject proxy, MutableHandleValue vp) const; virtual bool defaultValue(JSContext *cx, HandleObject obj, JSType hint, MutableHandleValue vp) const; virtual void finalize(JSFreeOp *fop, JSObject *proxy) const; + virtual void objectMoved(JSObject *proxy, const JSObject *old) const; virtual bool getPrototypeOf(JSContext *cx, HandleObject proxy, MutableHandleObject protop) const; virtual bool setPrototypeOf(JSContext *cx, HandleObject proxy, HandleObject proto, bool *bp) const; diff --git a/js/src/vm/ArrayBufferObject.cpp b/js/src/vm/ArrayBufferObject.cpp index 82983a7c864..9cc95337c71 100644 --- a/js/src/vm/ArrayBufferObject.cpp +++ b/js/src/vm/ArrayBufferObject.cpp @@ -122,7 +122,14 @@ const Class ArrayBufferObject::class_ = { nullptr, /* construct */ ArrayBufferObject::obj_trace, JS_NULL_CLASS_SPEC, - JS_NULL_CLASS_EXT + { + nullptr, /* outerObject */ + nullptr, /* innerObject */ + nullptr, /* iteratorObject */ + false, /* isWrappedNative */ + nullptr, /* weakmapKeyDelegateOp */ + ArrayBufferObject::objectMoved + } }; const JSFunctionSpec ArrayBufferObject::jsfuncs[] = { @@ -929,8 +936,11 @@ ArrayBufferObject::sweep(JSCompartment *compartment) } /* static */ void -ArrayBufferObject::fixupDataPointerAfterMovingGC(const ArrayBufferObject &src, ArrayBufferObject &dst) +ArrayBufferObject::objectMoved(JSObject *obj, const JSObject *old) { + ArrayBufferObject &dst = obj->as(); + const ArrayBufferObject &src = old->as(); + // Fix up possible inline data pointer. const size_t reservedSlots = JSCLASS_RESERVED_SLOTS(&ArrayBufferObject::class_); if (src.dataPointer() == src.fixedData(reservedSlots)) diff --git a/js/src/vm/ArrayBufferObject.h b/js/src/vm/ArrayBufferObject.h index fee20652000..da5f166224b 100644 --- a/js/src/vm/ArrayBufferObject.h +++ b/js/src/vm/ArrayBufferObject.h @@ -160,7 +160,7 @@ class ArrayBufferObject : public JSObject static void sweep(JSCompartment *rt); - static void fixupDataPointerAfterMovingGC(const ArrayBufferObject &src, ArrayBufferObject &dst); + static void objectMoved(JSObject *obj, const JSObject *old); static void resetArrayBufferList(JSCompartment *rt); static bool saveArrayBufferList(JSCompartment *c, ArrayBufferVector &vector); diff --git a/js/src/vm/TypedArrayObject.cpp b/js/src/vm/TypedArrayObject.cpp index fd12e0d3064..d9e7a58a45a 100644 --- a/js/src/vm/TypedArrayObject.cpp +++ b/js/src/vm/TypedArrayObject.cpp @@ -134,6 +134,16 @@ TypedArrayObject::dataOffset() return JSObject::getPrivateDataOffset(DATA_SLOT); } +/* static */ void +TypedArrayObject::ObjectMoved(JSObject *obj, const JSObject *old) +{ + const TypedArrayObject &src = old->as(); + if (!src.hasBuffer()) { + JS_ASSERT(old->getPrivate() == old->fixedData(FIXED_DATA_START)); + obj->setPrivate(obj->fixedData(FIXED_DATA_START)); + } +} + /* Helper clamped uint8_t type */ uint32_t JS_FASTCALL @@ -2222,7 +2232,15 @@ IMPL_TYPED_ARRAY_COMBINED_UNWRAPPERS(Float64, double, double) nullptr, /* hasInstance */ \ nullptr, /* construct */ \ ArrayBufferViewObject::trace, /* trace */ \ - TYPED_ARRAY_CLASS_SPEC(_typedArray) \ + TYPED_ARRAY_CLASS_SPEC(_typedArray), \ + { \ + nullptr, /* outerObject */ \ + nullptr, /* innerObject */ \ + nullptr, /* iteratorObject */ \ + false, /* isWrappedNative */ \ + nullptr, /* weakmapKeyDelegateOp */ \ + TypedArrayObject::ObjectMoved \ + } \ } template diff --git a/js/src/vm/TypedArrayObject.h b/js/src/vm/TypedArrayObject.h index 0fdbbba4a6d..35393fee8a6 100644 --- a/js/src/vm/TypedArrayObject.h +++ b/js/src/vm/TypedArrayObject.h @@ -125,6 +125,8 @@ class TypedArrayObject : public ArrayBufferViewObject static int dataOffset(); static bool isOriginalLengthGetter(Scalar::Type type, Native native); + + static void ObjectMoved(JSObject *obj, const JSObject *old); }; inline bool From ebad23c206ab279e9bff40a6476ae28c39558e16 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Tue, 2 Sep 2014 11:07:25 +0200 Subject: [PATCH 26/66] Bug 1055655 - Fix warnings turned to errors by bug 1018288 found by mingw build. r=ted,jmathies --HG-- extra : rebase_source : 2e1d8d0ae697515994b718634f8f8ae9b26b8d80 --- gfx/layers/d3d9/CompositorD3D9.cpp | 1 - hal/windows/WindowsGamepad.cpp | 19 ++++++++++--------- ipc/chromium/src/base/waitable_event_win.cc | 2 +- widget/windows/KeyboardLayout.cpp | 6 +++--- widget/windows/WindowHook.cpp | 2 +- widget/windows/nsDragService.cpp | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/gfx/layers/d3d9/CompositorD3D9.cpp b/gfx/layers/d3d9/CompositorD3D9.cpp index c8b1515a530..be92764754c 100644 --- a/gfx/layers/d3d9/CompositorD3D9.cpp +++ b/gfx/layers/d3d9/CompositorD3D9.cpp @@ -489,7 +489,6 @@ CompositorD3D9::SetMask(const EffectChain &aEffectChain, uint32_t aMaskTexture) TextureSourceD3D9 *source = maskEffect->mMaskTexture->AsSourceD3D9(); - MOZ_ASSERT(aMaskTexture >= 0); device()->SetTexture(aMaskTexture, source->GetD3D9Texture()); const gfx::Matrix4x4& maskTransform = maskEffect->mMaskTransform; diff --git a/hal/windows/WindowsGamepad.cpp b/hal/windows/WindowsGamepad.cpp index a1266c97a37..3419971d090 100644 --- a/hal/windows/WindowsGamepad.cpp +++ b/hal/windows/WindowsGamepad.cpp @@ -50,6 +50,8 @@ const uint32_t kDevicesChangedStableDelay = 200; // poll it periodically. 50ms is arbitrarily chosen. const uint32_t kXInputPollInterval = 50; +const UINT kRawInputError = (UINT)-1; + #ifndef XUSER_MAX_COUNT #define XUSER_MAX_COUNT 4 #endif @@ -178,7 +180,7 @@ bool GetPreparsedData(HANDLE handle, nsTArray& data) { UINT size; - if (GetRawInputDeviceInfo(handle, RIDI_PREPARSEDDATA, nullptr, &size) < 0) { + if (GetRawInputDeviceInfo(handle, RIDI_PREPARSEDDATA, nullptr, &size) == kRawInputError) { return false; } data.SetLength(size); @@ -418,13 +420,13 @@ WindowsGamepadService::ScanForRawInputDevices() UINT numDevices; if (GetRawInputDeviceList(nullptr, &numDevices, sizeof(RAWINPUTDEVICELIST)) - == -1) { + == kRawInputError) { return; } nsTArray devices(numDevices); devices.SetLength(numDevices); if (GetRawInputDeviceList(devices.Elements(), &numDevices, - sizeof(RAWINPUTDEVICELIST)) == -1) { + sizeof(RAWINPUTDEVICELIST)) == kRawInputError) { return; } @@ -631,7 +633,7 @@ WindowsGamepadService::GetRawGamepad(HANDLE handle) RID_DEVICE_INFO rdi = {}; UINT size = rdi.cbSize = sizeof(RID_DEVICE_INFO); - if (GetRawInputDeviceInfo(handle, RIDI_DEVICEINFO, &rdi, &size) < 0) { + if (GetRawInputDeviceInfo(handle, RIDI_DEVICEINFO, &rdi, &size) == kRawInputError) { return false; } // Ensure that this is a device we care about @@ -642,14 +644,13 @@ WindowsGamepadService::GetRawGamepad(HANDLE handle) Gamepad gamepad = {}; // Device name is a mostly-opaque string. - if (GetRawInputDeviceInfo(handle, RIDI_DEVICENAME, nullptr, &size) < 0) { + if (GetRawInputDeviceInfo(handle, RIDI_DEVICENAME, nullptr, &size) == kRawInputError) { return false; } nsTArray devname(size); devname.SetLength(size); - if (GetRawInputDeviceInfo(handle, RIDI_DEVICENAME, devname.Elements(), &size) - <= 0) { + if (GetRawInputDeviceInfo(handle, RIDI_DEVICENAME, devname.Elements(), &size) == kRawInputError) { return false; } @@ -667,7 +668,7 @@ WindowsGamepadService::GetRawGamepad(HANDLE handle) size = sizeof(name); nsTArray gamepad_name; HANDLE hid_handle = CreateFile(devname.Elements(), GENERIC_READ | GENERIC_WRITE, - FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, NULL, NULL); + FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); if (hid_handle) { if (mHID.mHidD_GetProductString(hid_handle, &name, size)) { int bytes = WideCharToMultiByte(CP_UTF8, 0, name, -1, nullptr, 0, nullptr, @@ -786,7 +787,7 @@ WindowsGamepadService::HandleRawInput(HRAWINPUT handle) nsTArray data(size); data.SetLength(size); if (GetRawInputData(handle, RID_INPUT, data.Elements(), &size, - sizeof(RAWINPUTHEADER)) < 0) { + sizeof(RAWINPUTHEADER)) == kRawInputError) { return false; } PRAWINPUT raw = reinterpret_cast(data.Elements()); diff --git a/ipc/chromium/src/base/waitable_event_win.cc b/ipc/chromium/src/base/waitable_event_win.cc index ac85c5c80d6..21ee0a90014 100644 --- a/ipc/chromium/src/base/waitable_event_win.cc +++ b/ipc/chromium/src/base/waitable_event_win.cc @@ -86,7 +86,7 @@ size_t WaitableEvent::WaitMany(WaitableEvent** events, size_t count) { WaitForMultipleObjects(count, handles, FALSE, // don't wait for all the objects INFINITE); // no timeout - if (result < WAIT_OBJECT_0 || result >= WAIT_OBJECT_0 + count) { + if (result >= WAIT_OBJECT_0 + count) { NOTREACHED() << "WaitForMultipleObjects failed: " << GetLastError(); return 0; } diff --git a/widget/windows/KeyboardLayout.cpp b/widget/windows/KeyboardLayout.cpp index e248235b9c7..162e4beffc1 100644 --- a/widget/windows/KeyboardLayout.cpp +++ b/widget/windows/KeyboardLayout.cpp @@ -606,7 +606,7 @@ UniCharsAndModifiers VirtualKey::GetNativeUniChars(ShiftState aShiftState) const { #ifdef DEBUG - if (aShiftState < 0 || aShiftState >= ArrayLength(mShiftStates)) { + if (aShiftState >= ArrayLength(mShiftStates)) { nsPrintfCString warning("Shift state is out of range: " "aShiftState=%d, ArrayLength(mShiftState)=%d", aShiftState, ArrayLength(mShiftStates)); @@ -2259,8 +2259,8 @@ KeyboardLayout::LoadLayout(HKL aLayout) static const UINT kMapType = IsVistaOrLater() ? MAPVK_VSC_TO_VK_EX : MAPVK_VSC_TO_VK; PR_LOG(sKeyboardLayoutLogger, PR_LOG_DEBUG, - ("Logging virtual keycode values for scancode (0x%08X)...", - reinterpret_cast(mKeyboardLayout))); + ("Logging virtual keycode values for scancode (0x%p)...", + mKeyboardLayout)); for (uint32_t i = 0; i < ArrayLength(kExtendedScanCode); i++) { for (uint32_t j = 1; j <= 0xFF; j++) { UINT scanCode = kExtendedScanCode[i] + j; diff --git a/widget/windows/WindowHook.cpp b/widget/windows/WindowHook.cpp index 2c3a533f34b..8e87a3a55ef 100644 --- a/widget/windows/WindowHook.cpp +++ b/widget/windows/WindowHook.cpp @@ -94,7 +94,7 @@ WindowHook::DeleteIfEmpty(MessageData *data) { MessageDataArray::index_type idx; idx = data - mMessageData.Elements(); - NS_ASSERTION(idx >= 0 && idx < mMessageData.Length(), "Attempted to delete MessageData that doesn't belong to this array!"); + NS_ASSERTION(idx < mMessageData.Length(), "Attempted to delete MessageData that doesn't belong to this array!"); mMessageData.RemoveElementAt(idx); } diff --git a/widget/windows/nsDragService.cpp b/widget/windows/nsDragService.cpp index 4d9016d612b..96c7c1c7a20 100644 --- a/widget/windows/nsDragService.cpp +++ b/widget/windows/nsDragService.cpp @@ -424,7 +424,7 @@ nsDragService::GetData(nsITransferable * aTransferable, uint32_t anItem) // multiple items, use |anItem| as an index into our collection nsDataObjCollection * dataObjCol = GetDataObjCollection(mDataObject); uint32_t cnt = dataObjCol->GetNumDataObjects(); - if (anItem >= 0 && anItem < cnt) { + if (anItem < cnt) { IDataObject * dataObj = dataObjCol->GetDataObjectAt(anItem); dataFound = nsClipboard::GetDataFromDataObject(dataObj, 0, nullptr, aTransferable); From 428e13ecf5202bef0a293a772951e299a21b804c Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Tue, 2 Sep 2014 11:10:12 +0200 Subject: [PATCH 27/66] Bug 286355 - Fixed char16_t/wchar_t mismatch for mingw. --HG-- extra : rebase_source : 285d1e36261ceab4cdf1be09024c4b7dbf907fd9 --- profile/dirserviceprovider/ProfileUnlockerWin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/profile/dirserviceprovider/ProfileUnlockerWin.cpp b/profile/dirserviceprovider/ProfileUnlockerWin.cpp index 705ee8524b2..02634960f3f 100644 --- a/profile/dirserviceprovider/ProfileUnlockerWin.cpp +++ b/profile/dirserviceprovider/ProfileUnlockerWin.cpp @@ -82,7 +82,7 @@ ProfileUnlockerWin::Init() return NS_ERROR_ILLEGAL_VALUE; } - nsModuleHandle module(::LoadLibraryW(MOZ_UTF16("Rstrtmgr.dll"))); + nsModuleHandle module(::LoadLibraryW(L"Rstrtmgr.dll")); if (!module) { return NS_ERROR_NOT_AVAILABLE; } @@ -110,7 +110,7 @@ ProfileUnlockerWin::Init() mQueryFullProcessImageName = reinterpret_cast(::GetProcAddress( - ::GetModuleHandleW(MOZ_UTF16("kernel32.dll")), + ::GetModuleHandleW(L"kernel32.dll"), "QueryFullProcessImageNameW")); if (!mQueryFullProcessImageName) { return NS_ERROR_NOT_AVAILABLE; From 1fdd859371f64ee85799f9b261bd14499f3a6460 Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Tue, 2 Sep 2014 11:13:44 +0200 Subject: [PATCH 28/66] Bug 1059498 - Use the inner dirty rect when initializing the visible rect of display items inside the SVG filter stacking context. r=roc --- layout/generic/nsFrame.cpp | 12 +++++----- layout/reftests/bugs/1059498-1-ref.html | 20 ++++++++++++++++ layout/reftests/bugs/1059498-1.html | 32 +++++++++++++++++++++++++ layout/reftests/bugs/reftest.list | 1 + 4 files changed, 59 insertions(+), 6 deletions(-) create mode 100644 layout/reftests/bugs/1059498-1-ref.html create mode 100644 layout/reftests/bugs/1059498-1.html diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 73ce24e0118..a72cb8eea92 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -1959,9 +1959,14 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder, inTransform = true; } + bool usingSVGEffects = nsSVGIntegrationUtils::UsingEffectsForFrame(this); + if (usingSVGEffects) { + dirtyRect = + nsSVGIntegrationUtils::GetRequiredSourceForInvalidArea(this, dirtyRect); + } + bool useOpacity = HasVisualOpacity() && !nsSVGUtils::CanOptimizeOpacity(this); bool useBlendMode = disp->mMixBlendMode != NS_STYLE_BLEND_NORMAL; - bool usingSVGEffects = nsSVGIntegrationUtils::UsingEffectsForFrame(this); bool useStickyPosition = disp->mPosition == NS_STYLE_POSITION_STICKY && IsScrollFrameActive(nsLayoutUtils::GetNearestScrollableFrame(GetParent(), nsLayoutUtils::SCROLLABLE_SAME_DOC | @@ -1987,11 +1992,6 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder, inTransformSetter(aBuilder, inTransform); CheckForTouchEventHandler(aBuilder, this); - if (usingSVGEffects) { - dirtyRect = - nsSVGIntegrationUtils::GetRequiredSourceForInvalidArea(this, dirtyRect); - } - nsRect clipPropClip; if (ApplyClipPropClipping(aBuilder, this, disp, &clipPropClip, nestedClipState)) { diff --git a/layout/reftests/bugs/1059498-1-ref.html b/layout/reftests/bugs/1059498-1-ref.html new file mode 100644 index 00000000000..f7ece299c58 --- /dev/null +++ b/layout/reftests/bugs/1059498-1-ref.html @@ -0,0 +1,20 @@ + + + +Test for bug 1059498 - Paint parts of the filter that are caused by parts of the source that are invisible + + + +
diff --git a/layout/reftests/bugs/1059498-1.html b/layout/reftests/bugs/1059498-1.html new file mode 100644 index 00000000000..4e3930bdbd5 --- /dev/null +++ b/layout/reftests/bugs/1059498-1.html @@ -0,0 +1,32 @@ + + + +Test for bug 1059498 - Paint parts of the filter that are caused by parts of the source that are invisible + + + +
+ + + + + + + + diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list index 0790810daee..eafcd03eaf9 100644 --- a/layout/reftests/bugs/reftest.list +++ b/layout/reftests/bugs/reftest.list @@ -1830,3 +1830,4 @@ pref(browser.display.use_document_fonts,0) == 1022481-1.html 1022481-1-ref.html == 1053035-1-flex.html 1053035-1-ref.html test-pref(layout.css.grid.enabled,true) == 1053035-1-grid.html 1053035-1-ref.html == 1059167-1.html 1059167-1-ref.html +== 1059498-1.html 1059498-1-ref.html From f25942deec20f6566ee53219407e35e23975f6b0 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Sat, 30 Aug 2014 00:23:25 +1200 Subject: [PATCH 29/66] Bug 967844. Part 1: Move mBackgroundColor from Layer to FrameMetrics. r=kats --HG-- extra : rebase_source : d7cf8756678cc342e1d648638dd867c5479b74ba --- gfx/ipc/GfxMessageUtils.h | 4 +++- gfx/layers/FrameMetrics.h | 18 +++++++++++++++++- gfx/layers/Layers.cpp | 3 +-- gfx/layers/Layers.h | 14 -------------- .../composite/ContainerLayerComposite.cpp | 3 ++- gfx/layers/composite/TiledContentHost.cpp | 6 +++--- gfx/layers/ipc/LayerTransactionParent.cpp | 1 - gfx/layers/ipc/LayersMessages.ipdlh | 1 - gfx/layers/ipc/ShadowLayers.cpp | 1 - layout/base/nsDisplayList.cpp | 10 +++++----- 10 files changed, 31 insertions(+), 30 deletions(-) diff --git a/gfx/ipc/GfxMessageUtils.h b/gfx/ipc/GfxMessageUtils.h index 865e9393893..9d7e71629d1 100644 --- a/gfx/ipc/GfxMessageUtils.h +++ b/gfx/ipc/GfxMessageUtils.h @@ -753,6 +753,7 @@ struct ParamTraits WriteParam(aMsg, aParam.mUpdateScrollOffset); WriteParam(aMsg, aParam.mScrollGeneration); WriteParam(aMsg, aParam.mTransformScale); + WriteParam(aMsg, aParam.mBackgroundColor); } static bool Read(const Message* aMsg, void** aIter, paramType* aResult) @@ -779,7 +780,8 @@ struct ParamTraits ReadParam(aMsg, aIter, &aResult->mHasScrollgrab) && ReadParam(aMsg, aIter, &aResult->mUpdateScrollOffset) && ReadParam(aMsg, aIter, &aResult->mScrollGeneration) && - ReadParam(aMsg, aIter, &aResult->mTransformScale)); + ReadParam(aMsg, aIter, &aResult->mTransformScale) && + ReadParam(aMsg, aIter, &aResult->mBackgroundColor)); } }; diff --git a/gfx/layers/FrameMetrics.h b/gfx/layers/FrameMetrics.h index bcf5e43b73f..8acd74aca76 100644 --- a/gfx/layers/FrameMetrics.h +++ b/gfx/layers/FrameMetrics.h @@ -12,6 +12,7 @@ #include "mozilla/gfx/Rect.h" // for RoundedIn #include "mozilla/gfx/ScaleFactor.h" // for ScaleFactor #include "mozilla/gfx/Logging.h" // for Log +#include "gfxColor.h" namespace IPC { template struct ParamTraits; @@ -97,6 +98,7 @@ public: , mUseDisplayPortMargins(false) , mPresShellId(-1) , mViewport(0, 0, 0, 0) + , mBackgroundColor(0, 0, 0, 0) {} // Default copy ctor and operator= are fine @@ -122,7 +124,8 @@ public: mScrollParentId == aOther.mScrollParentId && mScrollOffset == aOther.mScrollOffset && mHasScrollgrab == aOther.mHasScrollgrab && - mUpdateScrollOffset == aOther.mUpdateScrollOffset; + mUpdateScrollOffset == aOther.mUpdateScrollOffset && + mBackgroundColor == aOther.mBackgroundColor; } bool operator!=(const FrameMetrics& aOther) const { @@ -467,6 +470,16 @@ public: return mViewport; } + const gfxRGBA& GetBackgroundColor() const + { + return mBackgroundColor; + } + + void SetBackgroundColor(const gfxRGBA& aBackgroundColor) + { + mBackgroundColor = aBackgroundColor; + } + private: // New fields from now on should be made private and old fields should // be refactored to be private. @@ -535,6 +548,9 @@ private: // iframe. For layers that don't correspond to a document, this metric is // meaningless and invalid. CSSRect mViewport; + + // The background color to use when overscrolling. + gfxRGBA mBackgroundColor; }; /** diff --git a/gfx/layers/Layers.cpp b/gfx/layers/Layers.cpp index 47283390f8b..f83cf124dba 100644 --- a/gfx/layers/Layers.cpp +++ b/gfx/layers/Layers.cpp @@ -209,8 +209,7 @@ Layer::Layer(LayerManager* aManager, void* aImplData) : mScrollbarTargetId(FrameMetrics::NULL_SCROLL_ID), mScrollbarDirection(ScrollDirection::NONE), mDebugColorIndex(0), - mAnimationGeneration(0), - mBackgroundColor(0, 0, 0, 0) + mAnimationGeneration(0) {} Layer::~Layer() diff --git a/gfx/layers/Layers.h b/gfx/layers/Layers.h index 305a30fd6f9..c4b1e259fe5 100644 --- a/gfx/layers/Layers.h +++ b/gfx/layers/Layers.h @@ -1171,17 +1171,6 @@ public: } } - void SetBackgroundColor(const gfxRGBA& aColor) - { - if (mBackgroundColor == aColor) { - return; - } - - MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) BackgroundColor", this)); - mBackgroundColor = aColor; - Mutated(); - } - void SetContentDescription(const std::string& aContentDescription) { if (mContentDescription == aContentDescription) { @@ -1226,7 +1215,6 @@ public: FrameMetrics::ViewID GetScrollbarTargetContainerId() { return mScrollbarTargetId; } ScrollDirection GetScrollbarDirection() { return mScrollbarDirection; } Layer* GetMaskLayer() const { return mMaskLayer; } - gfxRGBA GetBackgroundColor() const { return mBackgroundColor; } const std::string& GetContentDescription() const { return mContentDescription; } @@ -1655,8 +1643,6 @@ protected: // If this layer is used for OMTA, then this counter is used to ensure we // stay in sync with the animation manager uint64_t mAnimationGeneration; - // This is currently set and used only for scrollable container layers. - gfxRGBA mBackgroundColor; // A description of the content element corresponding to this frame. // This is empty unless this is a scrollable ContainerLayer and the // apz.printtree pref is turned on. diff --git a/gfx/layers/composite/ContainerLayerComposite.cpp b/gfx/layers/composite/ContainerLayerComposite.cpp index babbbd2e076..4396c1d88c2 100644 --- a/gfx/layers/composite/ContainerLayerComposite.cpp +++ b/gfx/layers/composite/ContainerLayerComposite.cpp @@ -268,15 +268,16 @@ RenderLayers(ContainerT* aContainer, // placeholder for APZ purposes. if (aContainer->HasScrollableFrameMetrics() && !aContainer->IsScrollInfoLayer()) { bool overscrolled = false; + gfxRGBA color; for (uint32_t i = 0; i < aContainer->GetFrameMetricsCount(); i++) { AsyncPanZoomController* apzc = aContainer->GetAsyncPanZoomController(i); if (apzc && apzc->IsOverscrolled()) { overscrolled = true; + color = aContainer->GetFrameMetrics(i).GetBackgroundColor(); break; } } if (overscrolled) { - gfxRGBA color = aContainer->GetBackgroundColor(); // If the background is completely transparent, there's no point in // drawing anything for it. Hopefully the layers behind, if any, will // provide suitable content for the overscroll effect. diff --git a/gfx/layers/composite/TiledContentHost.cpp b/gfx/layers/composite/TiledContentHost.cpp index 02b97205e7f..49d9bbfdc19 100644 --- a/gfx/layers/composite/TiledContentHost.cpp +++ b/gfx/layers/composite/TiledContentHost.cpp @@ -367,9 +367,9 @@ TiledContentHost::Composite(EffectChain& aEffectChain, if (aOpacity == 1.0f && gfxPrefs::LowPrecisionOpacity() < 1.0f) { // Background colors are only stored on scrollable layers. Grab // the one from the nearest scrollable ancestor layer. - for (Layer* ancestor = GetLayer(); ancestor; ancestor = ancestor->GetParent()) { - if (ancestor->HasScrollableFrameMetrics()) { - backgroundColor = ancestor->GetBackgroundColor(); + for (LayerMetricsWrapper ancestor(GetLayer(), LayerMetricsWrapper::StartAt::BOTTOM); ancestor; ancestor = ancestor.GetParent()) { + if (ancestor.Metrics().IsScrollable()) { + backgroundColor = ancestor.Metrics().GetBackgroundColor(); break; } } diff --git a/gfx/layers/ipc/LayerTransactionParent.cpp b/gfx/layers/ipc/LayerTransactionParent.cpp index 6ae7f85f8e5..0a027df6bac 100644 --- a/gfx/layers/ipc/LayerTransactionParent.cpp +++ b/gfx/layers/ipc/LayerTransactionParent.cpp @@ -321,7 +321,6 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray& cset, layer->SetAnimations(common.animations()); layer->SetInvalidRegion(common.invalidRegion()); layer->SetFrameMetrics(common.metrics()); - layer->SetBackgroundColor(common.backgroundColor().value()); layer->SetContentDescription(common.contentDescription()); typedef SpecificLayerAttributes Specific; diff --git a/gfx/layers/ipc/LayersMessages.ipdlh b/gfx/layers/ipc/LayersMessages.ipdlh index 4ba3cd8b72f..cc956f97c58 100644 --- a/gfx/layers/ipc/LayersMessages.ipdlh +++ b/gfx/layers/ipc/LayersMessages.ipdlh @@ -216,7 +216,6 @@ struct CommonLayerAttributes { Animation[] animations; nsIntRegion invalidRegion; FrameMetrics[] metrics; - LayerColor backgroundColor; string contentDescription; }; diff --git a/gfx/layers/ipc/ShadowLayers.cpp b/gfx/layers/ipc/ShadowLayers.cpp index 5e9ce643720..fcbce592d22 100644 --- a/gfx/layers/ipc/ShadowLayers.cpp +++ b/gfx/layers/ipc/ShadowLayers.cpp @@ -609,7 +609,6 @@ ShadowLayerForwarder::EndTransaction(InfallibleTArray* aReplies, common.animations() = mutant->GetAnimations(); common.invalidRegion() = mutant->GetInvalidRegion(); common.metrics() = mutant->GetAllFrameMetrics(); - common.backgroundColor() = mutant->GetBackgroundColor(); common.contentDescription() = mutant->GetContentDescription(); attrs.specific() = null_t(); mutant->FillSpecificAttributes(attrs.specific()); diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index e2559f44068..b7670380e10 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -848,20 +848,20 @@ static void RecordFrameMetrics(nsIFrame* aForFrame, metrics.SetHasScrollgrab(true); } - aRoot->SetFrameMetrics(metrics); - - // Also compute and set the background color on the container. + // Also compute and set the background color. // This is needed for APZ overscrolling support. if (aScrollFrame) { if (isRootScrollFrame) { - aRoot->SetBackgroundColor(presShell->GetCanvasBackground()); + metrics.SetBackgroundColor(presShell->GetCanvasBackground()); } else { nsStyleContext* backgroundStyle; if (nsCSSRendering::FindBackground(aScrollFrame, &backgroundStyle)) { - aRoot->SetBackgroundColor(backgroundStyle->StyleBackground()->mBackgroundColor); + metrics.SetBackgroundColor(backgroundStyle->StyleBackground()->mBackgroundColor); } } } + + aRoot->SetFrameMetrics(metrics); } nsDisplayListBuilder::~nsDisplayListBuilder() { From 08fc3b57841f44ce9be5269b1c17e0ef08b66153 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Sat, 30 Aug 2014 00:23:25 +1200 Subject: [PATCH 30/66] Bug 967844. Part 2: Move mContentDescription from Layer to FrameMetrics. r=kats --HG-- extra : rebase_source : b616a0ab2e5bb203a66a5f0b3644bdcbe5f17ce7 --- gfx/ipc/GfxMessageUtils.h | 14 ++++++++++++- gfx/layers/FrameMetrics.h | 25 +++++++++++++++++++++-- gfx/layers/LayerMetricsWrapper.h | 7 ------- gfx/layers/Layers.h | 16 --------------- gfx/layers/apz/src/APZCTreeManager.cpp | 2 +- gfx/layers/ipc/LayerTransactionParent.cpp | 1 - gfx/layers/ipc/ShadowLayers.cpp | 1 - layout/base/nsDisplayList.cpp | 2 +- 8 files changed, 38 insertions(+), 30 deletions(-) diff --git a/gfx/ipc/GfxMessageUtils.h b/gfx/ipc/GfxMessageUtils.h index 9d7e71629d1..a929dbb1811 100644 --- a/gfx/ipc/GfxMessageUtils.h +++ b/gfx/ipc/GfxMessageUtils.h @@ -754,6 +754,17 @@ struct ParamTraits WriteParam(aMsg, aParam.mScrollGeneration); WriteParam(aMsg, aParam.mTransformScale); WriteParam(aMsg, aParam.mBackgroundColor); + WriteParam(aMsg, aParam.GetContentDescription()); + } + + static bool ReadContentDescription(const Message* aMsg, void** aIter, paramType* aResult) + { + nsCString str; + if (!ReadParam(aMsg, aIter, &str)) { + return false; + } + aResult->SetContentDescription(str); + return true; } static bool Read(const Message* aMsg, void** aIter, paramType* aResult) @@ -781,7 +792,8 @@ struct ParamTraits ReadParam(aMsg, aIter, &aResult->mUpdateScrollOffset) && ReadParam(aMsg, aIter, &aResult->mScrollGeneration) && ReadParam(aMsg, aIter, &aResult->mTransformScale) && - ReadParam(aMsg, aIter, &aResult->mBackgroundColor)); + ReadParam(aMsg, aIter, &aResult->mBackgroundColor) && + ReadContentDescription(aMsg, aIter, aResult)); } }; diff --git a/gfx/layers/FrameMetrics.h b/gfx/layers/FrameMetrics.h index 8acd74aca76..ea4e72f0bf3 100644 --- a/gfx/layers/FrameMetrics.h +++ b/gfx/layers/FrameMetrics.h @@ -13,6 +13,7 @@ #include "mozilla/gfx/ScaleFactor.h" // for ScaleFactor #include "mozilla/gfx/Logging.h" // for Log #include "gfxColor.h" +#include "nsString.h" namespace IPC { template struct ParamTraits; @@ -99,7 +100,9 @@ public: , mPresShellId(-1) , mViewport(0, 0, 0, 0) , mBackgroundColor(0, 0, 0, 0) - {} + { + mContentDescription[0] = '\0'; + } // Default copy ctor and operator= are fine @@ -125,7 +128,8 @@ public: mScrollOffset == aOther.mScrollOffset && mHasScrollgrab == aOther.mHasScrollgrab && mUpdateScrollOffset == aOther.mUpdateScrollOffset && - mBackgroundColor == aOther.mBackgroundColor; + mBackgroundColor == aOther.mBackgroundColor && + !strcmp(mContentDescription, aOther.mContentDescription); } bool operator!=(const FrameMetrics& aOther) const { @@ -480,6 +484,18 @@ public: mBackgroundColor = aBackgroundColor; } + nsCString GetContentDescription() const + { + return nsCString(mContentDescription); + } + + void SetContentDescription(const nsCString& aContentDescription) + { + strncpy(mContentDescription, aContentDescription.get(), + sizeof(mContentDescription)); + mContentDescription[sizeof(mContentDescription) - 1] = 0; + } + private: // New fields from now on should be made private and old fields should // be refactored to be private. @@ -551,6 +567,11 @@ private: // The background color to use when overscrolling. gfxRGBA mBackgroundColor; + + // A description of the content element corresponding to this frame. + // This is empty unless this is a scrollable ContainerLayer and the + // apz.printtree pref is turned on. + char mContentDescription[20]; }; /** diff --git a/gfx/layers/LayerMetricsWrapper.h b/gfx/layers/LayerMetricsWrapper.h index 40b6d6dbbf4..384c2843784 100644 --- a/gfx/layers/LayerMetricsWrapper.h +++ b/gfx/layers/LayerMetricsWrapper.h @@ -328,13 +328,6 @@ public: return mLayer->GetClipRect(); } - const std::string& GetContentDescription() const - { - MOZ_ASSERT(IsValid()); - - return mLayer->GetContentDescription(); - } - // Expose an opaque pointer to the layer. Mostly used for printf // purposes. This is not intended to be a general-purpose accessor // for the underlying layer. diff --git a/gfx/layers/Layers.h b/gfx/layers/Layers.h index c4b1e259fe5..590b69a5eaf 100644 --- a/gfx/layers/Layers.h +++ b/gfx/layers/Layers.h @@ -1171,17 +1171,6 @@ public: } } - void SetContentDescription(const std::string& aContentDescription) - { - if (mContentDescription == aContentDescription) { - return; - } - - MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) ContentDescription", this)); - mContentDescription = aContentDescription; - Mutated(); - } - // These getters can be used anytime. float GetOpacity() { return mOpacity; } gfx::CompositionOp GetMixBlendMode() const { return mMixBlendMode; } @@ -1215,7 +1204,6 @@ public: FrameMetrics::ViewID GetScrollbarTargetContainerId() { return mScrollbarTargetId; } ScrollDirection GetScrollbarDirection() { return mScrollbarDirection; } Layer* GetMaskLayer() const { return mMaskLayer; } - const std::string& GetContentDescription() const { return mContentDescription; } // Note that all lengths in animation data are either in CSS pixels or app @@ -1643,10 +1631,6 @@ protected: // If this layer is used for OMTA, then this counter is used to ensure we // stay in sync with the animation manager uint64_t mAnimationGeneration; - // A description of the content element corresponding to this frame. - // This is empty unless this is a scrollable ContainerLayer and the - // apz.printtree pref is turned on. - std::string mContentDescription; #ifdef MOZ_DUMP_PAINTING nsTArray mExtraDumpInfo; #endif diff --git a/gfx/layers/apz/src/APZCTreeManager.cpp b/gfx/layers/apz/src/APZCTreeManager.cpp index 167d7ce4d23..9fd2e71ee55 100644 --- a/gfx/layers/apz/src/APZCTreeManager.cpp +++ b/gfx/layers/apz/src/APZCTreeManager.cpp @@ -308,7 +308,7 @@ APZCTreeManager::PrepareAPZCForLayer(const LayerMetricsWrapper& aLayer, << "\tsr=" << aMetrics.mScrollableRect << (aLayer.GetVisibleRegion().IsEmpty() ? "\tscrollinfo" : "") << (apzc->HasScrollgrab() ? "\tscrollgrab" : "") - << "\t" << aLayer.GetContentDescription(); + << "\t" << aMetrics.GetContentDescription().get(); // Bind the APZC instance into the tree of APZCs if (aNextSibling) { diff --git a/gfx/layers/ipc/LayerTransactionParent.cpp b/gfx/layers/ipc/LayerTransactionParent.cpp index 0a027df6bac..90fb6c87f8c 100644 --- a/gfx/layers/ipc/LayerTransactionParent.cpp +++ b/gfx/layers/ipc/LayerTransactionParent.cpp @@ -321,7 +321,6 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray& cset, layer->SetAnimations(common.animations()); layer->SetInvalidRegion(common.invalidRegion()); layer->SetFrameMetrics(common.metrics()); - layer->SetContentDescription(common.contentDescription()); typedef SpecificLayerAttributes Specific; const SpecificLayerAttributes& specific = attrs.specific(); diff --git a/gfx/layers/ipc/ShadowLayers.cpp b/gfx/layers/ipc/ShadowLayers.cpp index fcbce592d22..ce56878b122 100644 --- a/gfx/layers/ipc/ShadowLayers.cpp +++ b/gfx/layers/ipc/ShadowLayers.cpp @@ -609,7 +609,6 @@ ShadowLayerForwarder::EndTransaction(InfallibleTArray* aReplies, common.animations() = mutant->GetAnimations(); common.invalidRegion() = mutant->GetInvalidRegion(); common.metrics() = mutant->GetAllFrameMetrics(); - common.contentDescription() = mutant->GetContentDescription(); attrs.specific() = null_t(); mutant->FillSpecificAttributes(attrs.specific()); diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index b7670380e10..32b707ce675 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -835,7 +835,7 @@ static void RecordFrameMetrics(nsIFrame* aForFrame, if (nsIContent* content = frameForCompositionBoundsCalculation->GetContent()) { nsAutoString contentDescription; content->Describe(contentDescription); - aRoot->SetContentDescription(NS_LossyConvertUTF16toASCII(contentDescription).get()); + metrics.SetContentDescription(NS_LossyConvertUTF16toASCII(contentDescription)); } } From 293fcf9eacae4552173761a3bbacd34e815efd69 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Sun, 31 Aug 2014 15:29:24 +1200 Subject: [PATCH 31/66] Bug 967844. Part 3: Setup FrameMetrics from FrameLayerBuilder based on animated geometry roots. r=mattwoodrow --HG-- extra : rebase_source : 19593cafc17053d450905161fa7d4ce8721c58a0 --- dom/base/nsDOMWindowUtils.cpp | 45 ++---- gfx/layers/LayersLogging.cpp | 1 + gfx/layers/ipc/LayerTransactionParent.cpp | 35 +++-- gfx/layers/ipc/LayerTransactionParent.h | 2 +- gfx/layers/ipc/PLayerTransaction.ipdl | 6 +- layout/base/FrameLayerBuilder.cpp | 134 +++++++++++++++--- layout/base/nsDisplayList.cpp | 113 ++++++++------- layout/base/nsDisplayList.h | 26 +++- layout/generic/nsGfxScrollFrame.cpp | 45 +++++- layout/generic/nsGfxScrollFrame.h | 25 ++++ layout/generic/nsIScrollableFrame.h | 19 +++ .../async-scrolling/nested-1-ref.html | 10 ++ layout/reftests/async-scrolling/nested-1.html | 17 +++ layout/reftests/async-scrolling/reftest.list | 36 +++-- .../async-scrolling/split-layers-1-ref.html | 13 ++ .../async-scrolling/split-layers-1.html | 16 +++ .../split-layers-multi-scrolling-1-ref.html | 14 ++ .../split-layers-multi-scrolling-1.html | 19 +++ .../split-opacity-layers-1-ref.html | 12 ++ .../split-opacity-layers-1.html | 15 ++ modules/libpref/init/all.js | 3 + 21 files changed, 472 insertions(+), 134 deletions(-) create mode 100644 layout/reftests/async-scrolling/nested-1-ref.html create mode 100644 layout/reftests/async-scrolling/nested-1.html create mode 100644 layout/reftests/async-scrolling/split-layers-1-ref.html create mode 100644 layout/reftests/async-scrolling/split-layers-1.html create mode 100644 layout/reftests/async-scrolling/split-layers-multi-scrolling-1-ref.html create mode 100644 layout/reftests/async-scrolling/split-layers-multi-scrolling-1.html create mode 100644 layout/reftests/async-scrolling/split-opacity-layers-1-ref.html create mode 100644 layout/reftests/async-scrolling/split-opacity-layers-1.html diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp index 00fd2d15958..311d2fb57a8 100644 --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -2670,48 +2670,23 @@ nsDOMWindowUtils::SetAsyncScrollOffset(nsIDOMNode* aNode, if (!element) { return NS_ERROR_INVALID_ARG; } - nsIFrame* frame = element->GetPrimaryFrame(); - if (!frame) { - return NS_ERROR_UNEXPECTED; - } - nsIScrollableFrame* scrollable = do_QueryFrame(frame); - nsPresContext* presContext = frame->PresContext(); - nsIFrame* rootScrollFrame = presContext->PresShell()->GetRootScrollFrame(); - if (!scrollable) { - if (rootScrollFrame && rootScrollFrame->GetContent() == element) { - frame = rootScrollFrame; - scrollable = do_QueryFrame(frame); - } - } - if (!scrollable) { - return NS_ERROR_UNEXPECTED; - } - Layer* layer = FrameLayerBuilder::GetDedicatedLayer(scrollable->GetScrolledFrame(), - nsDisplayItem::TYPE_SCROLL_LAYER); - if (!layer) { - if (rootScrollFrame == frame && !presContext->GetParentPresContext()) { - nsIWidget* widget = GetWidget(); - if (widget) { - LayerManager* manager = widget->GetLayerManager(); - if (manager) { - layer = manager->GetRoot(); - } - } - } - if (!layer) { - return NS_ERROR_UNEXPECTED; - } - } FrameMetrics::ViewID viewId; if (!nsLayoutUtils::FindIDFor(element, &viewId)) { return NS_ERROR_UNEXPECTED; } - ShadowLayerForwarder* forwarder = layer->Manager()->AsShadowForwarder(); + nsIWidget* widget = GetWidget(); + if (!widget) { + return NS_ERROR_FAILURE; + } + LayerManager* manager = widget->GetLayerManager(); + if (!manager) { + return NS_ERROR_FAILURE; + } + ShadowLayerForwarder* forwarder = manager->AsShadowForwarder(); if (!forwarder || !forwarder->HasShadowManager()) { return NS_ERROR_UNEXPECTED; } - forwarder->GetShadowManager()->SendSetAsyncScrollOffset( - layer->AsShadowableLayer()->GetShadow(), viewId, aX, aY); + forwarder->GetShadowManager()->SendSetAsyncScrollOffset(viewId, aX, aY); return NS_OK; } diff --git a/gfx/layers/LayersLogging.cpp b/gfx/layers/LayersLogging.cpp index 546fa33aedb..3c0b251af69 100644 --- a/gfx/layers/LayersLogging.cpp +++ b/gfx/layers/LayersLogging.cpp @@ -123,6 +123,7 @@ AppendToString(std::stringstream& aStream, const FrameMetrics& m, AppendToString(aStream, m.GetScrollOffset(), " s="); AppendToString(aStream, m.mDisplayPort, " dp="); AppendToString(aStream, m.mCriticalDisplayPort, " cdp="); + AppendToString(aStream, m.GetBackgroundColor(), " color="); if (!detailed) { AppendToString(aStream, m.GetScrollId(), " scrollId="); if (m.GetScrollParentId() != FrameMetrics::NULL_SCROLL_ID) { diff --git a/gfx/layers/ipc/LayerTransactionParent.cpp b/gfx/layers/ipc/LayerTransactionParent.cpp index 90fb6c87f8c..dde422e238f 100644 --- a/gfx/layers/ipc/LayerTransactionParent.cpp +++ b/gfx/layers/ipc/LayerTransactionParent.cpp @@ -687,26 +687,35 @@ LayerTransactionParent::RecvGetAnimationTransform(PLayerParent* aParent, return true; } +static AsyncPanZoomController* +GetAPZCForViewID(Layer* aLayer, FrameMetrics::ViewID aScrollID) +{ + for (uint32_t i = 0; i < aLayer->GetFrameMetricsCount(); i++) { + if (aLayer->GetFrameMetrics(i).GetScrollId() == aScrollID) { + return aLayer->GetAsyncPanZoomController(i); + } + } + ContainerLayer* container = aLayer->AsContainerLayer(); + if (container) { + for (Layer* l = container->GetFirstChild(); l; l = l->GetNextSibling()) { + AsyncPanZoomController* c = GetAPZCForViewID(l, aScrollID); + if (c) { + return c; + } + } + } + return nullptr; +} + bool -LayerTransactionParent::RecvSetAsyncScrollOffset(PLayerParent* aLayer, - const FrameMetrics::ViewID& aId, +LayerTransactionParent::RecvSetAsyncScrollOffset(const FrameMetrics::ViewID& aScrollID, const int32_t& aX, const int32_t& aY) { if (mDestroyed || !layer_manager() || layer_manager()->IsDestroyed()) { return false; } - Layer* layer = cast(aLayer)->AsLayer(); - if (!layer) { - return false; - } - AsyncPanZoomController* controller = nullptr; - for (uint32_t i = 0; i < layer->GetFrameMetricsCount(); i++) { - if (layer->GetFrameMetrics(i).GetScrollId() == aId) { - controller = layer->GetAsyncPanZoomController(i); - break; - } - } + AsyncPanZoomController* controller = GetAPZCForViewID(mRoot, aScrollID); if (!controller) { return false; } diff --git a/gfx/layers/ipc/LayerTransactionParent.h b/gfx/layers/ipc/LayerTransactionParent.h index b2ae6662058..fef3c3b876f 100644 --- a/gfx/layers/ipc/LayerTransactionParent.h +++ b/gfx/layers/ipc/LayerTransactionParent.h @@ -126,7 +126,7 @@ protected: virtual bool RecvGetAnimationTransform(PLayerParent* aParent, MaybeTransform* aTransform) MOZ_OVERRIDE; - virtual bool RecvSetAsyncScrollOffset(PLayerParent* aLayer, const FrameMetrics::ViewID& aId, + virtual bool RecvSetAsyncScrollOffset(const FrameMetrics::ViewID& aId, const int32_t& aX, const int32_t& aY) MOZ_OVERRIDE; virtual bool RecvGetAPZTestData(APZTestData* aOutData); diff --git a/gfx/layers/ipc/PLayerTransaction.ipdl b/gfx/layers/ipc/PLayerTransaction.ipdl index 33872880a78..e5e72ca6754 100644 --- a/gfx/layers/ipc/PLayerTransaction.ipdl +++ b/gfx/layers/ipc/PLayerTransaction.ipdl @@ -81,10 +81,10 @@ parent: // be void_t. sync GetAnimationTransform(PLayer layer) returns (MaybeTransform transform); - // The next time this layer is composited, add this async scroll offset in - // CSS pixels. + // The next time the layer tree is composited, add this async scroll offset in + // CSS pixels for the given ViewID. // Useful for testing rendering of async scrolling. - async SetAsyncScrollOffset(PLayer layer, ViewID id, int32_t x, int32_t y); + async SetAsyncScrollOffset(ViewID id, int32_t x, int32_t y); // Drop any front buffers that might be retained on the compositor // side. diff --git a/layout/base/FrameLayerBuilder.cpp b/layout/base/FrameLayerBuilder.cpp index 25bb56090bf..1e523f68838 100644 --- a/layout/base/FrameLayerBuilder.cpp +++ b/layout/base/FrameLayerBuilder.cpp @@ -259,6 +259,7 @@ public: mNeedComponentAlpha(false), mForceTransparentSurface(false), mHideAllLayersBelow(false), + mOpaqueForAnimatedGeometryRootParent(false), mImage(nullptr), mCommonClipCount(-1), mNewChildLayersIndex(-1), @@ -458,6 +459,13 @@ public: * Set if all layers below this ThebesLayer should be hidden. */ bool mHideAllLayersBelow; + /** + * Set if the opaque region for this layer can be applied to the parent + * animated geometry root of this layer's animated geometry root. + * We set this when a ThebesLayer's animated geometry root is a scrollframe + * and the ThebesLayer completely fills the displayport of the scrollframe. + */ + bool mOpaqueForAnimatedGeometryRootParent; /** * Stores the pointer to the nsDisplayImage if we want to @@ -532,6 +540,9 @@ struct NewLayerEntry { nsRefPtr mLayer; const nsIFrame* mAnimatedGeometryRoot; const nsIFrame* mFixedPosFrameForLayerData; + // If non-null, this FrameMetrics is set to the be the first FrameMetrics + // on the layer. + UniquePtr mBaseFrameMetrics; // The following are only used for retained layers (for occlusion // culling of those layers). These regions are all relative to the // container reference frame. @@ -756,14 +767,22 @@ protected: bool ItemCoversScrollableArea(nsDisplayItem* aItem, const nsRegion& aOpaque); /** + * Set FrameMetrics and scroll-induced clipping on aEntry's layer. + */ + void SetupScrollingMetadata(NewLayerEntry* aEntry); + + /** + * Applies occlusion culling. * For each layer in mNewChildLayers, remove from its visible region the * opaque regions of the layers at higher z-index, but only if they have * the same animated geometry root and fixed-pos frame ancestor. * The opaque region for the child layers that share the same animated * geometry root as the container frame is returned in * *aOpaqueRegionForContainer. + * + * Also sets scroll metadata on the layers. */ - void ApplyOcclusionCulling(nsIntRegion* aOpaqueRegionForContainer); + void PostprocessRetainedLayers(nsIntRegion* aOpaqueRegionForContainer); /** * Computes the snapped opaque area of aItem. Sets aList's opaque flag @@ -776,7 +795,8 @@ protected: const nsIFrame* aFixedPosFrame, const DisplayItemClip& aClip, nsDisplayList* aList, - bool* aHideAllLayersBelow); + bool* aHideAllLayersBelow, + bool* aOpaqueForAnimatedGeometryRootParent); /** * Indicate that we are done adding items to the ThebesLayer at the top of @@ -2140,12 +2160,7 @@ ContainerState::PopThebesLayerData() newLayerEntry->mVisibleRegion = data->mVisibleRegion; newLayerEntry->mOpaqueRegion = data->mOpaqueRegion; newLayerEntry->mHideAllLayersBelow = data->mHideAllLayersBelow; - if (nsLayoutUtils::GetScrollableFrameFor(newLayerEntry->mAnimatedGeometryRoot) && - !nsDisplayScrollLayer::IsConstructingScrollLayerForScrolledFrame(newLayerEntry->mAnimatedGeometryRoot)) { - // Async scrolling not currently active so we can propagate our opaque region - // up to the parent animated geometry root. - newLayerEntry->mOpaqueForAnimatedGeometryRootParent = true; - } + newLayerEntry->mOpaqueForAnimatedGeometryRootParent = data->mOpaqueForAnimatedGeometryRootParent; } else { SetOuterVisibleRegionForLayer(layer, data->mVisibleRegion); } @@ -2662,7 +2677,8 @@ ContainerState::ComputeOpaqueRect(nsDisplayItem* aItem, const nsIFrame* aFixedPosFrame, const DisplayItemClip& aClip, nsDisplayList* aList, - bool* aHideAllLayersBelow) + bool* aHideAllLayersBelow, + bool* aOpaqueForAnimatedGeometryRootParent) { bool snapOpaque; nsRegion opaque = aItem->GetOpaqueRegion(mBuilder, &snapOpaque); @@ -2690,6 +2706,23 @@ ContainerState::ComputeOpaqueRect(nsDisplayItem* aItem, if (aFixedPosFrame && ItemCoversScrollableArea(aItem, opaque)) { *aHideAllLayersBelow = true; } + + nsIScrollableFrame* sf = nsLayoutUtils::GetScrollableFrameFor(aAnimatedGeometryRoot); + if (sf) { + nsRect displayport; + bool usingDisplayport = + nsLayoutUtils::GetDisplayPort(aAnimatedGeometryRoot->GetContent(), &displayport); + if (!usingDisplayport) { + // No async scrolling, so all that matters is that the layer contents + // cover the scrollport. + displayport = sf->GetScrollPortRect(); + } + nsIFrame* scrollFrame = do_QueryFrame(sf); + displayport += scrollFrame->GetOffsetToCrossDoc(mContainerReferenceFrame); + if (opaque.Contains(displayport)) { + *aOpaqueForAnimatedGeometryRootParent = true; + } + } } return opaquePixels; } @@ -2970,15 +3003,24 @@ ContainerState::ProcessDisplayItems(nsDisplayList* aList, newLayerEntry->mVisibleRegion = itemVisibleRect; newLayerEntry->mOpaqueRegion = ComputeOpaqueRect(item, animatedGeometryRoot, fixedPosFrame, itemClip, aList, - &newLayerEntry->mHideAllLayersBelow); + &newLayerEntry->mHideAllLayersBelow, + &newLayerEntry->mOpaqueForAnimatedGeometryRootParent); } else { SetOuterVisibleRegionForLayer(ownLayer, itemVisibleRect, layerContentsVisibleRect.width >= 0 ? &layerContentsVisibleRect : nullptr); } - if (itemType == nsDisplayItem::TYPE_SCROLL_LAYER) { + if (itemType == nsDisplayItem::TYPE_SCROLL_LAYER || + itemType == nsDisplayItem::TYPE_SCROLL_INFO_LAYER) { nsDisplayScrollLayer* scrollItem = static_cast(item); newLayerEntry->mOpaqueForAnimatedGeometryRootParent = scrollItem->IsDisplayPortOpaque(); + newLayerEntry->mBaseFrameMetrics = + scrollItem->ComputeFrameMetrics(ownLayer, mParameters); + } else if (itemType == nsDisplayItem::TYPE_SUBDOCUMENT || + itemType == nsDisplayItem::TYPE_ZOOM || + itemType == nsDisplayItem::TYPE_RESOLUTION) { + newLayerEntry->mBaseFrameMetrics = + static_cast(item)->ComputeFrameMetrics(ownLayer, mParameters); } /** @@ -3011,7 +3053,8 @@ ContainerState::ProcessDisplayItems(nsDisplayList* aList, nsIntRegion opaquePixels = ComputeOpaqueRect(item, animatedGeometryRoot, thebesLayerData->mFixedPosFrameForLayerData, itemClip, aList, - &thebesLayerData->mHideAllLayersBelow); + &thebesLayerData->mHideAllLayersBelow, + &thebesLayerData->mOpaqueForAnimatedGeometryRootParent); thebesLayerData->Accumulate(this, item, opaquePixels, itemVisibleRect, itemDrawRect, itemClip); } @@ -3437,7 +3480,63 @@ FindOpaqueRegionEntry(nsTArray& aEntries, } void -ContainerState::ApplyOcclusionCulling(nsIntRegion* aOpaqueRegionForContainer) +ContainerState::SetupScrollingMetadata(NewLayerEntry* aEntry) +{ + nsAutoTArray metricsArray; + if (aEntry->mBaseFrameMetrics) { + metricsArray.AppendElement(*aEntry->mBaseFrameMetrics); + } + uint32_t baseLength = metricsArray.Length(); + + nsIntRect tmpClipRect; + const nsIntRect* layerClip = aEntry->mLayer->GetClipRect(); + nsIFrame* fParent; + for (const nsIFrame* f = aEntry->mAnimatedGeometryRoot; + f != mContainerAnimatedGeometryRoot; + f = nsLayoutUtils::GetAnimatedGeometryRootForFrame( + fParent, mContainerAnimatedGeometryRoot)) { + fParent = nsLayoutUtils::GetCrossDocParentFrame(f); + if (!fParent) { + // This means mContainerAnimatedGeometryRoot was not an ancestor + // of aEntry->mAnimatedGeometryRoot. This is a weird case but it + // can happen, e.g. when a scrolled frame contains a frame with opacity + // which contains a frame that is not scrolled by the scrolled frame. + // For now, we just don't apply any specific async scrolling to this layer. + // It will async-scroll with mContainerAnimatedGeometryRoot, which + // is substandard but not fatal. + metricsArray.SetLength(baseLength); + aEntry->mLayer->SetFrameMetrics(metricsArray); + return; + } + + nsIScrollableFrame* scrollFrame = nsLayoutUtils::GetScrollableFrameFor(f); + if (!scrollFrame) { + continue; + } + + nsRect clipRect(0, 0, -1, -1); + scrollFrame->ComputeFrameMetrics(aEntry->mLayer, mContainerReferenceFrame, + mParameters, &clipRect, &metricsArray); + if (clipRect.width >= 0) { + nsIntRect pixClip = ScaleToNearestPixels(clipRect); + if (layerClip) { + tmpClipRect.IntersectRect(pixClip, *layerClip); + } else { + tmpClipRect = pixClip; + } + layerClip = &tmpClipRect; + // XXX this could cause IPC churn due to cliprects being updated + // twice during layer building --- for non-ThebesLayers that have + // both CSS and scroll clipping. + } + } + aEntry->mLayer->SetClipRect(layerClip); + // Watch out for FrameMetrics copies in profiles + aEntry->mLayer->SetFrameMetrics(metricsArray); +} + +void +ContainerState::PostprocessRetainedLayers(nsIntRegion* aOpaqueRegionForContainer) { nsAutoTArray opaqueRegions; bool hideAll = false; @@ -3458,6 +3557,10 @@ ContainerState::ApplyOcclusionCulling(nsIntRegion* aOpaqueRegionForContainer) e->mVisibleRegion.Sub(e->mVisibleRegion, data->mOpaqueRegion); } + SetOuterVisibleRegionForLayer(e->mLayer, e->mVisibleRegion, + e->mLayerContentsVisibleRect.width >= 0 ? &e->mLayerContentsVisibleRect : nullptr); + SetupScrollingMetadata(e); + if (!e->mOpaqueRegion.IsEmpty()) { const nsIFrame* animatedGeometryRootToCover = e->mAnimatedGeometryRoot; if (e->mOpaqueForAnimatedGeometryRootParent && @@ -3485,9 +3588,6 @@ ContainerState::ApplyOcclusionCulling(nsIntRegion* aOpaqueRegionForContainer) } } - SetOuterVisibleRegionForLayer(e->mLayer, e->mVisibleRegion, - e->mLayerContentsVisibleRect.width >= 0 ? &e->mLayerContentsVisibleRect : nullptr); - if (e->mLayer->GetType() == Layer::TYPE_READBACK) { // ReadbackLayers need to accurately read what's behind them. So, // we don't want to do any occlusion culling of layers behind them. @@ -3518,7 +3618,7 @@ ContainerState::Finish(uint32_t* aTextContentFlags, LayerManagerData* aData, if (mLayerBuilder->IsBuildingRetainedLayers()) { nsIntRegion containerOpaqueRegion; - ApplyOcclusionCulling(&containerOpaqueRegion); + PostprocessRetainedLayers(&containerOpaqueRegion); if (containerOpaqueRegion.Contains(aContainerPixelBounds)) { aChildItems->SetIsOpaque(); } diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index 32b707ce675..0d261ce8336 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -647,15 +647,17 @@ static void UnmarkFrameForDisplay(nsIFrame* aFrame) { } } -static void RecordFrameMetrics(nsIFrame* aForFrame, - nsIFrame* aScrollFrame, - const nsIFrame* aReferenceFrame, - ContainerLayer* aRoot, - ViewID aScrollParentId, - const nsRect& aViewport, - bool aForceNullScrollId, - bool aIsRoot, - const ContainerLayerParameters& aContainerParameters) { +/* static */ FrameMetrics +nsDisplayScrollLayer::ComputeFrameMetrics(nsIFrame* aForFrame, + nsIFrame* aScrollFrame, + const nsIFrame* aReferenceFrame, + Layer* aLayer, + ViewID aScrollParentId, + const nsRect& aViewport, + bool aForceNullScrollId, + bool aIsRoot, + const ContainerLayerParameters& aContainerParameters) +{ nsPresContext* presContext = aForFrame->PresContext(); int32_t auPerDevPixel = presContext->AppUnitsPerDevPixel(); LayoutDeviceToLayerScale resolution(aContainerParameters.mXScale, aContainerParameters.mYScale); @@ -673,7 +675,7 @@ static void RecordFrameMetrics(nsIFrame* aForFrame, nsRect dp; if (nsLayoutUtils::GetDisplayPort(content, &dp)) { metrics.mDisplayPort = CSSRect::FromAppUnits(dp); - nsLayoutUtils::LogTestDataForPaint(aRoot->Manager(), scrollId, "displayport", + nsLayoutUtils::LogTestDataForPaint(aLayer->Manager(), scrollId, "displayport", metrics.mDisplayPort); } if (nsLayoutUtils::GetCriticalDisplayPort(content, &dp)) { @@ -861,7 +863,7 @@ static void RecordFrameMetrics(nsIFrame* aForFrame, } } - aRoot->SetFrameMetrics(metrics); + return metrics; } nsDisplayListBuilder::~nsDisplayListBuilder() { @@ -1292,10 +1294,11 @@ void nsDisplayList::PaintForFrame(nsDisplayListBuilder* aBuilder, nsRect viewport(aBuilder->ToReferenceFrame(aForFrame), aForFrame->GetSize()); - RecordFrameMetrics(aForFrame, rootScrollFrame, - aBuilder->FindReferenceFrameFor(aForFrame), - root, FrameMetrics::NULL_SCROLL_ID, viewport, - !isRoot, isRoot, containerParameters); + root->SetFrameMetrics( + nsDisplayScrollLayer::ComputeFrameMetrics(aForFrame, rootScrollFrame, + aBuilder->FindReferenceFrameFor(aForFrame), + root, FrameMetrics::NULL_SCROLL_ID, viewport, + !isRoot, isRoot, containerParameters)); // NS_WARNING is debug-only, so don't even bother checking the conditions in // a release build. @@ -3668,28 +3671,35 @@ nsDisplaySubDocument::BuildLayer(nsDisplayListBuilder* aBuilder, params.mInLowPrecisionDisplayPort = true; } - nsRefPtr layer = nsDisplayOwnLayer::BuildLayer( - aBuilder, aManager, params); + return nsDisplayOwnLayer::BuildLayer(aBuilder, aManager, params); +} +UniquePtr +nsDisplaySubDocument::ComputeFrameMetrics(Layer* aLayer, + const ContainerLayerParameters& aContainerParameters) +{ if (!(mFlags & GENERATE_SCROLLABLE_LAYER)) { - return layer.forget(); + return UniquePtr(nullptr); } - NS_ASSERTION(layer->AsContainerLayer(), "nsDisplayOwnLayer should have made a ContainerLayer"); - if (ContainerLayer* container = layer->AsContainerLayer()) { - nsIFrame* rootScrollFrame = presContext->PresShell()->GetRootScrollFrame(); - bool isRootContentDocument = presContext->IsRootContentDocument(); - - nsRect viewport = mFrame->GetRect() - - mFrame->GetPosition() + - mFrame->GetOffsetToCrossDoc(ReferenceFrame()); - - RecordFrameMetrics(mFrame, rootScrollFrame, ReferenceFrame(), - container, mScrollParentId, viewport, - false, isRootContentDocument, params); + nsPresContext* presContext = mFrame->PresContext(); + nsIFrame* rootScrollFrame = presContext->PresShell()->GetRootScrollFrame(); + bool isRootContentDocument = presContext->IsRootContentDocument(); + ContainerLayerParameters params = aContainerParameters; + if ((mFlags & GENERATE_SCROLLABLE_LAYER) && + rootScrollFrame->GetContent() && + nsLayoutUtils::GetCriticalDisplayPort(rootScrollFrame->GetContent(), nullptr)) { + params.mInLowPrecisionDisplayPort = true; } - return layer.forget(); + nsRect viewport = mFrame->GetRect() - + mFrame->GetPosition() + + mFrame->GetOffsetToCrossDoc(ReferenceFrame()); + + return MakeUnique( + nsDisplayScrollLayer::ComputeFrameMetrics(mFrame, rootScrollFrame, ReferenceFrame(), + aLayer, mScrollParentId, viewport, + false, isRootContentDocument, params)); } nsRect @@ -3978,25 +3988,14 @@ nsDisplayScrollLayer::GetScrolledContentRectToDraw(nsDisplayListBuilder* aBuilde already_AddRefed nsDisplayScrollLayer::BuildLayer(nsDisplayListBuilder* aBuilder, LayerManager* aManager, - const ContainerLayerParameters& aContainerParameters) { - + const ContainerLayerParameters& aContainerParameters) +{ ContainerLayerParameters params = aContainerParameters; if (mScrolledFrame->GetContent() && nsLayoutUtils::GetCriticalDisplayPort(mScrolledFrame->GetContent(), nullptr)) { - params.mInLowPrecisionDisplayPort = true; + params.mInLowPrecisionDisplayPort = true; } - nsRefPtr layer = aManager->GetLayerBuilder()-> - BuildContainerLayerFor(aBuilder, aManager, mFrame, this, &mList, - params, nullptr); - - nsRect viewport = mScrollFrame->GetRect() - - mScrollFrame->GetPosition() + - mScrollFrame->GetOffsetToCrossDoc(ReferenceFrame()); - - RecordFrameMetrics(mScrolledFrame, mScrollFrame, ReferenceFrame(), layer, - mScrollParentId, viewport, false, false, params); - if (mList.IsOpaque()) { nsRect displayport; bool usingDisplayport = @@ -4007,14 +4006,28 @@ nsDisplayScrollLayer::BuildLayer(nsDisplayListBuilder* aBuilder, mDisplayPortContentsOpaque = false; } - return layer.forget(); + return aManager->GetLayerBuilder()-> + BuildContainerLayerFor(aBuilder, aManager, mFrame, this, &mList, + params, nullptr); } -bool -nsDisplayScrollLayer::IsConstructingScrollLayerForScrolledFrame(const nsIFrame* aScrolledFrame) +UniquePtr +nsDisplayScrollLayer::ComputeFrameMetrics(Layer* aLayer, + const ContainerLayerParameters& aContainerParameters) { - FrameProperties props = aScrolledFrame->Properties(); - return reinterpret_cast(props.Get(nsIFrame::ScrollLayerCount())) != 0; + ContainerLayerParameters params = aContainerParameters; + if (mScrolledFrame->GetContent() && + nsLayoutUtils::GetCriticalDisplayPort(mScrolledFrame->GetContent(), nullptr)) { + params.mInLowPrecisionDisplayPort = true; + } + + nsRect viewport = mScrollFrame->GetRect() - + mScrollFrame->GetPosition() + + mScrollFrame->GetOffsetToCrossDoc(ReferenceFrame()); + + return UniquePtr(new FrameMetrics( + ComputeFrameMetrics(mScrolledFrame, mScrollFrame, ReferenceFrame(), aLayer, + mScrollParentId, viewport, false, false, params))); } bool diff --git a/layout/base/nsDisplayList.h b/layout/base/nsDisplayList.h index c6c36cb50fd..7cd74c4dc9b 100644 --- a/layout/base/nsDisplayList.h +++ b/layout/base/nsDisplayList.h @@ -24,6 +24,8 @@ #include "nsDisplayListInvalidation.h" #include "DisplayListClipState.h" #include "LayerState.h" +#include "FrameMetrics.h" +#include "mozilla/UniquePtr.h" #include @@ -43,8 +45,8 @@ namespace layers { class Layer; class ImageLayer; class ImageContainer; -} //namepsace -} //namepsace +} //namespace +} //namespace // A set of blend modes, that never includes OP_OVER (since it's // considered the default, rather than a specific blend mode). @@ -806,6 +808,7 @@ class nsDisplayItem : public nsDisplayItemLink { public: typedef mozilla::ContainerLayerParameters ContainerLayerParameters; typedef mozilla::DisplayItemClip DisplayItemClip; + typedef mozilla::layers::FrameMetrics FrameMetrics; typedef mozilla::layers::FrameMetrics::ViewID ViewID; typedef mozilla::layers::Layer Layer; typedef mozilla::layers::LayerManager LayerManager; @@ -2885,6 +2888,10 @@ public: virtual nsRegion GetOpaqueRegion(nsDisplayListBuilder* aBuilder, bool* aSnap) MOZ_OVERRIDE; NS_DISPLAY_DECL_NAME("SubDocument", TYPE_SUBDOCUMENT) + + mozilla::UniquePtr ComputeFrameMetrics(Layer* aLayer, + const ContainerLayerParameters& aContainerParameters); + protected: ViewID mScrollParentId; }; @@ -3011,8 +3018,6 @@ public: // after merging, all the nsDisplayScrollLayers should flatten away. intptr_t GetScrollLayerCount(); - static bool IsConstructingScrollLayerForScrolledFrame(const nsIFrame* aScrolledFrame); - virtual nsIFrame* GetScrollFrame() { return mScrollFrame; } virtual nsIFrame* GetScrolledFrame() { return mScrolledFrame; } @@ -3022,6 +3027,19 @@ public: bool IsDisplayPortOpaque() { return mDisplayPortContentsOpaque; } + static FrameMetrics ComputeFrameMetrics(nsIFrame* aForFrame, + nsIFrame* aScrollFrame, + const nsIFrame* aReferenceFrame, + Layer* aLayer, + ViewID aScrollParentId, + const nsRect& aViewport, + bool aForceNullScrollId, + bool aIsRoot, + const ContainerLayerParameters& aContainerParameters); + + mozilla::UniquePtr ComputeFrameMetrics(Layer* aLayer, + const ContainerLayerParameters& aContainerParameters); + protected: nsRect GetScrolledContentRectToDraw(nsDisplayListBuilder* aBuilder, nsRect* aDisplayPort); diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 953d4022cb9..8beee0d19df 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -63,6 +63,22 @@ using namespace mozilla; using namespace mozilla::dom; using namespace mozilla::layout; +static bool +BuildScrollContainerLayers() +{ + static bool sContainerlessScrollingEnabled; + static bool sContainerlessScrollingPrefCached = false; + + if (!sContainerlessScrollingPrefCached) { + sContainerlessScrollingPrefCached = true; + Preferences::AddBoolVarCache(&sContainerlessScrollingEnabled, + "layout.async-containerless-scrolling.enabled", + true); + } + + return !sContainerlessScrollingEnabled; +} + //---------------------------------------------------------------------- //----------nsHTMLScrollFrame------------------------------------------- @@ -2886,6 +2902,8 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder, (!mIsRoot || aBuilder->RootReferenceFrame()->PresContext() != mOuter->PresContext()); } + mScrollParentID = aBuilder->GetCurrentScrollParentId(); + nsDisplayListCollection scrolledContent; { // Note that setting the current scroll parent id here means that positioned children @@ -2954,7 +2972,7 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder, // scroll layer count. The display lists depend on this. ScrollLayerWrapper wrapper(mOuter, mScrolledFrame); - if (mShouldBuildScrollableLayer) { + if (mShouldBuildScrollableLayer && BuildScrollContainerLayers()) { DisplayListClipState::AutoSaveRestore clipState(aBuilder); // For root scrollframes in documents where the CSS viewport has been @@ -2996,6 +3014,31 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder, scrolledContent.MoveTo(aLists); } +void +ScrollFrameHelper::ComputeFrameMetrics(Layer* aLayer, + nsIFrame* aContainerReferenceFrame, + const ContainerLayerParameters& aParameters, + nsRect* aClipRect, + nsTArray* aOutput) const +{ + if (!mShouldBuildScrollableLayer || BuildScrollContainerLayers()) { + return; + } + + MOZ_ASSERT(mScrolledFrame->GetContent()); + + nsRect viewport = mScrollPort + + mOuter->GetOffsetToCrossDoc(aContainerReferenceFrame); + + if (!(mIsRoot && mOuter->PresContext()->PresShell()->GetIsViewportOverridden())) { + *aClipRect = viewport; + } + *aOutput->AppendElement() = + nsDisplayScrollLayer::ComputeFrameMetrics(mScrolledFrame, mOuter, + aContainerReferenceFrame, aLayer, mScrollParentID, + viewport, false, false, aParameters); +} + bool ScrollFrameHelper::IsRectNearlyVisible(const nsRect& aRect) const { diff --git a/layout/generic/nsGfxScrollFrame.h b/layout/generic/nsGfxScrollFrame.h index 8a5ae3be58e..d8cd3834707 100644 --- a/layout/generic/nsGfxScrollFrame.h +++ b/layout/generic/nsGfxScrollFrame.h @@ -31,6 +31,9 @@ class nsIScrollPositionListener; struct ScrollReflowState; namespace mozilla { +namespace layers { +class Layer; +} namespace layout { class ScrollbarActivity; } @@ -43,6 +46,8 @@ public: typedef nsIFrame::Sides Sides; typedef mozilla::CSSIntPoint CSSIntPoint; typedef mozilla::layout::ScrollbarActivity ScrollbarActivity; + typedef mozilla::layers::FrameMetrics FrameMetrics; + typedef mozilla::layers::Layer Layer; class AsyncScroll; class AsyncSmoothMSDScroll; @@ -325,6 +330,10 @@ public: } } bool WantAsyncScroll() const; + void ComputeFrameMetrics(Layer* aLayer, nsIFrame* aContainerReferenceFrame, + const ContainerLayerParameters& aParameters, + nsRect* aClipRect, + nsTArray* aOutput) const; // nsIScrollbarMediator void ScrollByPage(nsScrollbarFrame* aScrollbar, int32_t aDirection); @@ -389,6 +398,8 @@ public: // The scroll position where we last updated image visibility. nsPoint mLastUpdateImagesPos; + FrameMetrics::ViewID mScrollParentID; + bool mNeverHasVerticalScrollbar:1; bool mNeverHasHorizontalScrollbar:1; bool mHasVerticalScrollbar:1; @@ -708,6 +719,13 @@ public: virtual bool WantAsyncScroll() const MOZ_OVERRIDE { return mHelper.WantAsyncScroll(); } + virtual void ComputeFrameMetrics(Layer* aLayer, nsIFrame* aContainerReferenceFrame, + const ContainerLayerParameters& aParameters, + nsRect* aClipRect, + nsTArray* aOutput) const MOZ_OVERRIDE { + mHelper.ComputeFrameMetrics(aLayer, aContainerReferenceFrame, + aParameters, aClipRect, aOutput); + } // nsIStatefulFrame NS_IMETHOD SaveState(nsPresState** aState) MOZ_OVERRIDE { @@ -1047,6 +1065,13 @@ public: virtual bool WantAsyncScroll() const MOZ_OVERRIDE { return mHelper.WantAsyncScroll(); } + virtual void ComputeFrameMetrics(Layer* aLayer, nsIFrame* aContainerReferenceFrame, + const ContainerLayerParameters& aParameters, + nsRect* aClipRect, + nsTArray* aOutput) const MOZ_OVERRIDE { + mHelper.ComputeFrameMetrics(aLayer, aContainerReferenceFrame, + aParameters, aClipRect, aOutput); + } // nsIStatefulFrame NS_IMETHOD SaveState(nsPresState** aState) MOZ_OVERRIDE { diff --git a/layout/generic/nsIScrollableFrame.h b/layout/generic/nsIScrollableFrame.h index 8a6ce21d66e..14a8026533f 100644 --- a/layout/generic/nsIScrollableFrame.h +++ b/layout/generic/nsIScrollableFrame.h @@ -15,6 +15,7 @@ #include "mozilla/gfx/Point.h" #include "nsIScrollbarMediator.h" #include "Units.h" +#include "FrameMetrics.h" #define NS_DEFAULT_VERTICAL_SCROLL_DISTANCE 3 #define NS_DEFAULT_HORIZONTAL_SCROLL_DISTANCE 5 @@ -27,6 +28,13 @@ class nsIContent; class nsRenderingContext; class nsIAtom; +namespace mozilla { +struct ContainerLayerParameters; +namespace layers { +class Layer; +} +} + /** * Interface for frames that are scrollable. This interface exposes * APIs for examining scroll state, observing changes to scroll state, @@ -35,6 +43,8 @@ class nsIAtom; class nsIScrollableFrame : public nsIScrollbarMediator { public: typedef mozilla::CSSIntPoint CSSIntPoint; + typedef mozilla::ContainerLayerParameters ContainerLayerParameters; + typedef mozilla::layers::FrameMetrics FrameMetrics; NS_DECL_QUERYFRAME_TARGET(nsIScrollableFrame) @@ -340,6 +350,15 @@ public: * scroll frame. */ virtual bool WantAsyncScroll() const = 0; + /** + * aLayer's animated geometry root is this frame. If there needs to be a + * FrameMetrics contributed by this frame, append it to aOutput. + */ + virtual void ComputeFrameMetrics(mozilla::layers::Layer* aLayer, + nsIFrame* aContainerReferenceFrame, + const ContainerLayerParameters& aParameters, + nsRect* aOutClipRect, + nsTArray* aOutput) const = 0; }; #endif diff --git a/layout/reftests/async-scrolling/nested-1-ref.html b/layout/reftests/async-scrolling/nested-1-ref.html new file mode 100644 index 00000000000..2ad0568e195 --- /dev/null +++ b/layout/reftests/async-scrolling/nested-1-ref.html @@ -0,0 +1,10 @@ + + + +
+
+
+
+
+
+ diff --git a/layout/reftests/async-scrolling/nested-1.html b/layout/reftests/async-scrolling/nested-1.html new file mode 100644 index 00000000000..eda5c9bd711 --- /dev/null +++ b/layout/reftests/async-scrolling/nested-1.html @@ -0,0 +1,17 @@ + + + + +
+
+
+
+
+
+ diff --git a/layout/reftests/async-scrolling/reftest.list b/layout/reftests/async-scrolling/reftest.list index 4ef8ab84b76..1e8076fe378 100644 --- a/layout/reftests/async-scrolling/reftest.list +++ b/layout/reftests/async-scrolling/reftest.list @@ -1,10 +1,26 @@ -skip-if(!asyncPanZoom) == bg-fixed-1.html bg-fixed-1-ref.html -skip-if(!asyncPanZoom) == bg-fixed-cover-1.html bg-fixed-cover-1-ref.html -skip-if(!asyncPanZoom) == bg-fixed-cover-2.html bg-fixed-cover-2-ref.html -skip-if(!asyncPanZoom) == bg-fixed-cover-3.html bg-fixed-cover-3-ref.html -skip-if(!asyncPanZoom) == element-1.html element-1-ref.html -skip-if(!asyncPanZoom) == position-fixed-1.html position-fixed-1-ref.html -skip-if(!asyncPanZoom) == position-fixed-2.html position-fixed-2-ref.html -skip-if(!asyncPanZoom) == position-fixed-cover-1.html position-fixed-cover-1-ref.html -skip-if(!asyncPanZoom) == position-fixed-cover-2.html position-fixed-cover-2-ref.html -skip-if(!asyncPanZoom) == position-fixed-cover-3.html position-fixed-cover-3-ref.html +pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == bg-fixed-1.html bg-fixed-1-ref.html +pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == bg-fixed-cover-1.html bg-fixed-cover-1-ref.html +pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == bg-fixed-cover-2.html bg-fixed-cover-2-ref.html +pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == bg-fixed-cover-3.html bg-fixed-cover-3-ref.html +pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == element-1.html element-1-ref.html +pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == nested-1.html nested-1-ref.html +pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == position-fixed-1.html position-fixed-1-ref.html +pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == position-fixed-2.html position-fixed-2-ref.html +pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == position-fixed-cover-1.html position-fixed-cover-1-ref.html +pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == position-fixed-cover-2.html position-fixed-cover-2-ref.html +pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == position-fixed-cover-3.html position-fixed-cover-3-ref.html +pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == split-layers-1.html split-layers-1-ref.html +pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == split-layers-multi-scrolling-1.html split-layers-multi-scrolling-1-ref.html +pref(layout.async-containerless-scrolling.enabled,true) pref(apz.subframe.enabled,true) skip-if(!asyncPanZoom) == split-opacity-layers-1.html split-opacity-layers-1-ref.html + +pref(layout.async-containerless-scrolling.enabled,false) skip-if(!asyncPanZoom) == bg-fixed-1.html bg-fixed-1-ref.html +pref(layout.async-containerless-scrolling.enabled,false) skip-if(!asyncPanZoom) == bg-fixed-cover-1.html bg-fixed-cover-1-ref.html +pref(layout.async-containerless-scrolling.enabled,false) skip-if(!asyncPanZoom) == bg-fixed-cover-2.html bg-fixed-cover-2-ref.html +pref(layout.async-containerless-scrolling.enabled,false) skip-if(!asyncPanZoom) == bg-fixed-cover-3.html bg-fixed-cover-3-ref.html +pref(layout.async-containerless-scrolling.enabled,false) skip-if(!asyncPanZoom) == element-1.html element-1-ref.html +pref(layout.async-containerless-scrolling.enabled,false) skip-if(!asyncPanZoom) == position-fixed-1.html position-fixed-1-ref.html +pref(layout.async-containerless-scrolling.enabled,false) skip-if(!asyncPanZoom) == position-fixed-2.html position-fixed-2-ref.html +pref(layout.async-containerless-scrolling.enabled,false) skip-if(!asyncPanZoom) == position-fixed-cover-1.html position-fixed-cover-1-ref.html +pref(layout.async-containerless-scrolling.enabled,false) skip-if(!asyncPanZoom) == position-fixed-cover-2.html position-fixed-cover-2-ref.html +pref(layout.async-containerless-scrolling.enabled,false) skip-if(!asyncPanZoom) == position-fixed-cover-3.html position-fixed-cover-3-ref.html + diff --git a/layout/reftests/async-scrolling/split-layers-1-ref.html b/layout/reftests/async-scrolling/split-layers-1-ref.html new file mode 100644 index 00000000000..2d78cd17381 --- /dev/null +++ b/layout/reftests/async-scrolling/split-layers-1-ref.html @@ -0,0 +1,13 @@ + + + + +
+
+
+
+
+
+ diff --git a/layout/reftests/async-scrolling/split-layers-1.html b/layout/reftests/async-scrolling/split-layers-1.html new file mode 100644 index 00000000000..911982db373 --- /dev/null +++ b/layout/reftests/async-scrolling/split-layers-1.html @@ -0,0 +1,16 @@ + + + + +
+
+
+
+
+
+ diff --git a/layout/reftests/async-scrolling/split-layers-multi-scrolling-1-ref.html b/layout/reftests/async-scrolling/split-layers-multi-scrolling-1-ref.html new file mode 100644 index 00000000000..bbb8a05290a --- /dev/null +++ b/layout/reftests/async-scrolling/split-layers-multi-scrolling-1-ref.html @@ -0,0 +1,14 @@ + + + + +
+
+
+
+
+
+ + diff --git a/layout/reftests/async-scrolling/split-layers-multi-scrolling-1.html b/layout/reftests/async-scrolling/split-layers-multi-scrolling-1.html new file mode 100644 index 00000000000..ecbc2814ebf --- /dev/null +++ b/layout/reftests/async-scrolling/split-layers-multi-scrolling-1.html @@ -0,0 +1,19 @@ + + + + +
+
+
+
+
+
+ diff --git a/layout/reftests/async-scrolling/split-opacity-layers-1-ref.html b/layout/reftests/async-scrolling/split-opacity-layers-1-ref.html new file mode 100644 index 00000000000..347bfe25478 --- /dev/null +++ b/layout/reftests/async-scrolling/split-opacity-layers-1-ref.html @@ -0,0 +1,12 @@ + + + +
+
+
+
+
+
+
+
+ diff --git a/layout/reftests/async-scrolling/split-opacity-layers-1.html b/layout/reftests/async-scrolling/split-opacity-layers-1.html new file mode 100644 index 00000000000..69541204518 --- /dev/null +++ b/layout/reftests/async-scrolling/split-opacity-layers-1.html @@ -0,0 +1,15 @@ + + + +
+
+
+
+
+
+
+
+ diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index d70262747fd..038f064b65a 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -426,6 +426,9 @@ pref("media.audio_data.enabled", false); // Whether to use async panning and zooming pref("layers.async-pan-zoom.enabled", false); +// Whether to enable containerless async scrolling +pref("layout.async-containerless-scrolling.enabled", true); + // APZ preferences. For documentation/details on what these prefs do, check // gfx/layers/apz/src/AsyncPanZoomController.cpp. pref("apz.allow_checkerboarding", true); From 1188d14130e34a0e0e4e3b1c678148f6ea5a51fd Mon Sep 17 00:00:00 2001 From: Gabor Krizsanits Date: Tue, 2 Sep 2014 12:13:45 +0200 Subject: [PATCH 32/66] Bug 877072 - Script execution order for imports. r=mrbkap --- content/base/public/nsIDocument.h | 14 +- content/base/src/ImportManager.cpp | 360 +++++++++++++++++- content/base/src/ImportManager.h | 133 ++++++- content/base/src/nsDocument.cpp | 3 + content/base/src/nsDocument.h | 34 +- content/base/src/nsScriptLoader.cpp | 39 +- content/base/src/nsScriptLoader.h | 12 +- content/html/content/moz.build | 1 + content/html/content/src/HTMLLinkElement.cpp | 11 +- .../content/test/imports/file_importA1.html | 11 + .../content/test/imports/file_importA2.html | 10 + .../content/test/imports/file_importB1.html | 11 + .../content/test/imports/file_importB2.html | 10 + .../content/test/imports/file_importC1.html | 11 + .../content/test/imports/file_importC10.html | 11 + .../content/test/imports/file_importC2.html | 11 + .../content/test/imports/file_importC3.html | 11 + .../content/test/imports/file_importC4.html | 11 + .../content/test/imports/file_importC5.html | 11 + .../content/test/imports/file_importC6.html | 11 + .../content/test/imports/file_importC7.html | 11 + .../content/test/imports/file_importC8.html | 11 + .../content/test/imports/file_importC9.html | 11 + .../content/test/imports/file_importD.html | 8 + .../content/test/imports/file_importE.html | 11 + .../html/content/test/imports/mochitest.ini | 20 + content/html/content/test/mochitest.ini | 2 + .../content/test/test_imports_nested.html | 41 ++ .../content/test/test_imports_nested_2.html | 56 +++ 29 files changed, 854 insertions(+), 43 deletions(-) create mode 100644 content/html/content/test/imports/file_importA1.html create mode 100644 content/html/content/test/imports/file_importA2.html create mode 100644 content/html/content/test/imports/file_importB1.html create mode 100644 content/html/content/test/imports/file_importB2.html create mode 100644 content/html/content/test/imports/file_importC1.html create mode 100644 content/html/content/test/imports/file_importC10.html create mode 100644 content/html/content/test/imports/file_importC2.html create mode 100644 content/html/content/test/imports/file_importC3.html create mode 100644 content/html/content/test/imports/file_importC4.html create mode 100644 content/html/content/test/imports/file_importC5.html create mode 100644 content/html/content/test/imports/file_importC6.html create mode 100644 content/html/content/test/imports/file_importC7.html create mode 100644 content/html/content/test/imports/file_importC8.html create mode 100644 content/html/content/test/imports/file_importC9.html create mode 100644 content/html/content/test/imports/file_importD.html create mode 100644 content/html/content/test/imports/file_importE.html create mode 100644 content/html/content/test/imports/mochitest.ini create mode 100644 content/html/content/test/test_imports_nested.html create mode 100644 content/html/content/test/test_imports_nested_2.html diff --git a/content/base/public/nsIDocument.h b/content/base/public/nsIDocument.h index c302b48d33a..90d33d3404f 100644 --- a/content/base/public/nsIDocument.h +++ b/content/base/public/nsIDocument.h @@ -133,8 +133,8 @@ typedef CallbackObjectHolder NodeFilterHolder; } // namespace mozilla #define NS_IDOCUMENT_IID \ -{ 0x613ea294, 0x0288, 0x48b4, \ - { 0x9e, 0x7b, 0x0f, 0xe9, 0x3f, 0x8c, 0xf8, 0x95 } } +{ 0x42a263db, 0x6ac6, 0x40ff, \ + { 0x89, 0xe2, 0x25, 0x12, 0xe4, 0xbc, 0x2d, 0x2d } } // Enum for requesting a particular type of document when creating a doc enum DocumentFlavor { @@ -2353,11 +2353,15 @@ public: // Each import tree has exactly one master document which is // the root of the tree, and owns the browser context. - virtual already_AddRefed MasterDocument() = 0; + virtual nsIDocument* MasterDocument() = 0; virtual void SetMasterDocument(nsIDocument* master) = 0; virtual bool IsMasterDocument() = 0; - virtual already_AddRefed ImportManager() = 0; - + virtual mozilla::dom::ImportManager* ImportManager() = 0; + // We keep track of the order of sub imports were added to the document. + virtual bool HasSubImportLink(nsINode* aLink) = 0; + virtual uint32_t IndexOfSubImportLink(nsINode* aLink) = 0; + virtual void AddSubImportLink(nsINode* aLink) = 0; + virtual nsINode* GetSubImportLink(uint32_t aIdx) = 0; /* * Given a node, get a weak reference to it and append that reference to * mBlockedTrackingNodes. Can be used later on to look up a node in it. diff --git a/content/base/src/ImportManager.cpp b/content/base/src/ImportManager.cpp index 63a2fcdd094..a16df3b6e0d 100644 --- a/content/base/src/ImportManager.cpp +++ b/content/base/src/ImportManager.cpp @@ -23,6 +23,10 @@ #include "nsScriptLoader.h" #include "nsNetUtil.h" +//----------------------------------------------------------------------------- +// AutoError +//----------------------------------------------------------------------------- + class AutoError { public: explicit AutoError(mozilla::dom::ImportLoader* loader, bool scriptsBlocked = true) @@ -49,6 +53,212 @@ private: namespace mozilla { namespace dom { +//----------------------------------------------------------------------------- +// ImportLoader::Updater +//----------------------------------------------------------------------------- + +void +ImportLoader::Updater::GetReferrerChain(nsINode* aNode, + nsTArray& aResult) +{ + // We fill up the array backward. First the last link: aNode. + MOZ_ASSERT(mLoader->mLinks.Contains(aNode)); + + aResult.AppendElement(aNode); + nsINode* node = aNode; + nsRefPtr manager = mLoader->Manager(); + for (ImportLoader* referrersLoader = manager->Find(node->OwnerDoc()); + referrersLoader; + referrersLoader = manager->Find(node->OwnerDoc())) + { + // Then walking up the main referrer chain and append each link + // to the array. + node = referrersLoader->GetMainReferrer(); + MOZ_ASSERT(node); + aResult.AppendElement(node); + } + + // The reversed order is more useful for consumers. + // XXX: This should probably go to nsTArray or some generic utility + // lib for our containers that we don't have... I would really like to + // get rid of this part... + uint32_t l = aResult.Length(); + for (uint32_t i = 0; i < l / 2; i++) { + Swap(aResult[i], aResult[l - i - 1]); + } +} + +bool +ImportLoader::Updater::ShouldUpdate(nsTArray& aNewPath) +{ + // Let's walk down on the main referrer chains of both the current main and + // the new link, and find the last pair of links that are from the same + // document. This is the junction point between the two referrer chain. Their + // order in the subimport list of that document will determine if we have to + // update the spanning tree or this new edge changes nothing in the script + // execution order. + nsTArray oldPath; + GetReferrerChain(mLoader->mLinks[mLoader->mMainReferrer], oldPath); + uint32_t max = std::min(oldPath.Length(), aNewPath.Length()); + MOZ_ASSERT(max > 0); + uint32_t lastCommonImportAncestor = 0; + + for (uint32_t i = 0; + i < max && oldPath[i]->OwnerDoc() == aNewPath[i]->OwnerDoc(); + i++) + { + lastCommonImportAncestor = i; + } + + MOZ_ASSERT(lastCommonImportAncestor < max); + nsINode* oldLink = oldPath[lastCommonImportAncestor]; + nsINode* newLink = aNewPath[lastCommonImportAncestor]; + + if ((lastCommonImportAncestor == max - 1) && + newLink == oldLink ) { + // If one chain contains the other entirely, then this is a simple cycle, + // nothing to be done here. + MOZ_ASSERT(oldPath.Length() != aNewPath.Length(), + "This would mean that new link == main referrer link"); + return false; + } + + MOZ_ASSERT(aNewPath != oldPath, + "How could this happen?"); + nsIDocument* doc = oldLink->OwnerDoc(); + MOZ_ASSERT(doc->HasSubImportLink(newLink)); + MOZ_ASSERT(doc->HasSubImportLink(oldLink)); + + return doc->IndexOfSubImportLink(newLink) < doc->IndexOfSubImportLink(oldLink); +} + +void +ImportLoader::Updater::UpdateMainReferrer(uint32_t aNewIdx) +{ + MOZ_ASSERT(aNewIdx < mLoader->mLinks.Length()); + nsINode* newMainReferrer = mLoader->mLinks[aNewIdx]; + // This new link means we have to execute our scripts sooner... + if (mLoader->mDocument) { + // Our nearest predecessor has changed. So let's remove our pending + // ScriptLoader from the old one. + nsRefPtr manager = mLoader->Manager(); + nsScriptLoader* loader = mLoader->mDocument->ScriptLoader(); + ImportLoader*& pred = mLoader->mBlockingPredecessor; + if (pred) { + pred->RemoveBlockedScriptLoader(loader); + } + // And add it to the new one if there is any. + pred = manager->GetNearestPredecessor(newMainReferrer); + if (pred) { + pred->AddBlockedScriptLoader(loader); + } + } + if (mLoader->IsBlocking()) { + // Our import parent is changed as well, let's unblock it and block + // the new one. + mLoader->mImportParent->ScriptLoader()->RemoveExecuteBlocker(); + newMainReferrer->OwnerDoc()->ScriptLoader()->AddExecuteBlocker(); + } + // Finally update mMainReferrer to point to the newly added link. + mLoader->mMainReferrer = aNewIdx; + mLoader->mImportParent = newMainReferrer->OwnerDoc(); +} + +nsINode* +ImportLoader::Updater::NextDependant(nsINode* aCurrentLink, + nsTArray& aPath, + NodeTable& aVisitedNodes, bool aSkipChildren) +{ + // Depth first graph traversal. + if (!aSkipChildren) { + // "first child" + ImportLoader* loader = mLoader->Manager()->Find(aCurrentLink); + if (loader && loader->GetDocument()) { + nsINode* firstSubImport = loader->GetDocument()->GetSubImportLink(0); + if (firstSubImport && !aVisitedNodes.Contains(firstSubImport)) { + aPath.AppendElement(aCurrentLink); + aVisitedNodes.PutEntry(firstSubImport); + return firstSubImport; + } + } + } + + aPath.AppendElement(aCurrentLink); + // "(parent's) next sibling" + while(aPath.Length() > 1) { + aCurrentLink = aPath[aPath.Length() - 1]; + aPath.RemoveElementAt(aPath.Length() - 1); + + // Let's find the next "sibling" + ImportLoader* loader = mLoader->Manager()->Find(aCurrentLink->OwnerDoc()); + MOZ_ASSERT(loader && loader->GetDocument(), "How can this happend?"); + nsIDocument* doc = loader->GetDocument(); + MOZ_ASSERT(doc->HasSubImportLink(aCurrentLink)); + uint32_t idx = doc->IndexOfSubImportLink(aCurrentLink); + nsINode* next = doc->GetSubImportLink(idx + 1); + if (next) { + // Note: If we found an already visited link that means the parent links has + // closed the circle it's always the "first child" section that should find + // the first already visited node. Let's just assert that. + MOZ_ASSERT(!aVisitedNodes.Contains(next)); + aVisitedNodes.PutEntry(next); + return next; + } + } + + return nullptr; +} + +void +ImportLoader::Updater::UpdateDependants(nsINode* aNode, + nsTArray& aPath) +{ + NodeTable visitedNodes; + nsINode* current = aNode; + uint32_t initialLength = aPath.Length(); + bool neededUpdate = true; + while ((current = NextDependant(current, aPath, visitedNodes, !neededUpdate))) { + if (!current || aPath.Length() <= initialLength) { + break; + } + ImportLoader* loader = mLoader->Manager()->Find(current); + if (!loader) { + continue; + } + Updater& updater = loader->mUpdater; + neededUpdate = updater.ShouldUpdate(aPath); + if (neededUpdate) { + updater.UpdateMainReferrer(loader->mLinks.IndexOf(current)); + } + } +} + +void +ImportLoader::Updater::UpdateSpanningTree(nsINode* aNode) +{ + if (mLoader->mReady || mLoader->mStopped) { + // Scripts already executed, nothing to be done here. + return; + } + + if (mLoader->mLinks.Length() == 1) { + // If this is the first referrer, let's mark it. + mLoader->mMainReferrer = 0; + return; + } + + nsTArray newReferrerChain; + GetReferrerChain(aNode, newReferrerChain); + if (ShouldUpdate(newReferrerChain)) { + UpdateMainReferrer(mLoader->mLinks.Length() - 1); + UpdateDependants(aNode, newReferrerChain); + } +} + +//----------------------------------------------------------------------------- +// ImportLoader +//----------------------------------------------------------------------------- + NS_INTERFACE_MAP_BEGIN(ImportLoader) NS_INTERFACE_MAP_ENTRY(nsIStreamListener) NS_INTERFACE_MAP_ENTRY(nsIRequestObserver) @@ -66,10 +276,13 @@ NS_IMPL_CYCLE_COLLECTION(ImportLoader, ImportLoader::ImportLoader(nsIURI* aURI, nsIDocument* aImportParent) : mURI(aURI) , mImportParent(aImportParent) + , mBlockingPredecessor(nullptr) , mReady(false) , mStopped(false) , mBlockingScripts(false) -{} + , mUpdater(MOZ_THIS_IN_INITIALIZER_LIST()) +{ +} void ImportLoader::BlockScripts() @@ -84,9 +297,18 @@ ImportLoader::UnblockScripts() { MOZ_ASSERT(mBlockingScripts); mImportParent->ScriptLoader()->RemoveExecuteBlocker(); + // We probably should do a clever assertion here to see + // if our ScriptLoader unblocked all these ScriptLoaders. + mBlockedScriptLoaders.Clear(); mBlockingScripts = false; } +void +ImportLoader::SetBlockingPredecessor(ImportLoader* aLoader) +{ + mBlockingPredecessor = aLoader; +} + void ImportLoader::DispatchEventIfFinished(nsINode* aNode) { @@ -99,6 +321,33 @@ ImportLoader::DispatchEventIfFinished(nsINode* aNode) } } +void +ImportLoader::AddBlockedScriptLoader(nsScriptLoader* aScriptLoader) +{ + MOZ_ASSERT(!mBlockedScriptLoaders.Contains(aScriptLoader), + "Same scripts loader should be added only once"); + + aScriptLoader->AddExecuteBlocker(); + + if (mDocument) { + // If the document is ready we can just add the pending script loader + // to it. Otherwise we will add them once the document is created. + mDocument->ScriptLoader()->AddPendingChildLoader(aScriptLoader); + } + // Let's keep track of the pending script loaders. + mBlockedScriptLoaders.AppendElement(aScriptLoader); +} + +bool +ImportLoader::RemoveBlockedScriptLoader(nsScriptLoader* aScriptLoader) +{ + aScriptLoader->RemoveExecuteBlocker(); + if (mDocument) { + mDocument->ScriptLoader()->RemovePendingChildLoader(aScriptLoader); + } + return mBlockedScriptLoaders.RemoveElement(aScriptLoader); +} + void ImportLoader::AddLinkElement(nsINode* aNode) { @@ -106,14 +355,15 @@ ImportLoader::AddLinkElement(nsINode* aNode) // refers to an import that is already finished loading or // stopped trying, we need to fire the corresponding event // on it. - mLinks.AppendObject(aNode); + mLinks.AppendElement(aNode); + mUpdater.UpdateSpanningTree(aNode); DispatchEventIfFinished(aNode); } void ImportLoader::RemoveLinkElement(nsINode* aNode) { - mLinks.RemoveObject(aNode); + mLinks.RemoveElement(aNode); } // Events has to be fired with a script runner, so mImport can @@ -159,8 +409,8 @@ void ImportLoader::Done() { mReady = true; - uint32_t count = mLinks.Count(); - for (uint32_t i = 0; i < count; i++) { + uint32_t l = mLinks.Length(); + for (uint32_t i = 0; i < l; i++) { DispatchLoadEvent(mLinks[i]); } UnblockScripts(); @@ -172,8 +422,8 @@ ImportLoader::Error(bool aUnblockScripts) { mDocument = nullptr; mStopped = true; - uint32_t count = mLinks.Count(); - for (uint32_t i = 0; i < count; i++) { + uint32_t l = mLinks.Length(); + for (uint32_t i = 0; i < l; i++) { DispatchErrorEvent(mLinks[i]); } if (aUnblockScripts) { @@ -375,6 +625,10 @@ ImportLoader::OnStartRequest(nsIRequest* aRequest, nsISupports* aContext) nsCOMPtr master = mImportParent->MasterDocument(); mDocument->SetMasterDocument(master); + for (uint32_t i = 0; i < mBlockedScriptLoaders.Length(); i++) { + mDocument->ScriptLoader()->AddPendingChildLoader(mBlockedScriptLoaders[i]); + } + // We have to connect the blank document we created with the channel we opened, // and create its own LoadGroup for it. nsCOMPtr listener; @@ -388,7 +642,25 @@ ImportLoader::OnStartRequest(nsIRequest* aRequest, nsISupports* aContext) true); NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_ABORT_ERR); - // Let's start parser. + nsCOMPtr originalURI; + rv = channel->GetOriginalURI(getter_AddRefs(originalURI)); + NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_ABORT_ERR); + + nsCOMPtr URI; + rv = channel->GetURI(getter_AddRefs(URI)); + NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_ABORT_ERR); + MOZ_ASSERT(URI, "URI of a channel should never be null"); + + bool equals; + rv = URI->Equals(originalURI, &equals); + NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_ABORT_ERR); + + if (!equals) { + // In case of a redirection we must add the new URI to the import map. + Manager()->AddLoaderWithNewURI(this, URI); + } + + // Let's start the parser. mParserStreamListener = listener; rv = listener->OnStartRequest(aRequest, aContext); NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_ABORT_ERR); @@ -397,6 +669,10 @@ ImportLoader::OnStartRequest(nsIRequest* aRequest, nsISupports* aContext) return NS_OK; } +//----------------------------------------------------------------------------- +// ImportManager +//----------------------------------------------------------------------------- + NS_IMPL_CYCLE_COLLECTION(ImportManager, mImports) @@ -414,16 +690,78 @@ ImportManager::Get(nsIURI* aURI, nsINode* aNode, nsIDocument* aOrigDocument) // and start it up. nsRefPtr loader; mImports.Get(aURI, getter_AddRefs(loader)); - + bool needToStart = false; if (!loader) { loader = new ImportLoader(aURI, aOrigDocument); mImports.Put(aURI, loader); + needToStart = true; + } + + MOZ_ASSERT(loader); + // Let's keep track of the sub imports links in each document. It will + // be used later for scrip execution order calculation. (see UpdateSpanningTree) + // NOTE: removing and adding back the link to the tree somewhere else will + // NOT have an effect on script execution order. + if (!aOrigDocument->HasSubImportLink(aNode)) { + aOrigDocument->AddSubImportLink(aNode); + } + + loader->AddLinkElement(aNode); + + if (needToStart) { loader->Open(); } - loader->AddLinkElement(aNode); - MOZ_ASSERT(loader); + return loader.forget(); } +ImportLoader* +ImportManager::Find(nsIDocument* aImport) +{ + return mImports.GetWeak(aImport->GetDocumentURIObject()); +} + +ImportLoader* +ImportManager::Find(nsINode* aLink) +{ + HTMLLinkElement* linkElement = static_cast(aLink); + nsCOMPtr uri = linkElement->GetHrefURI(); + return mImports.GetWeak(uri); +} + +void +ImportManager::AddLoaderWithNewURI(ImportLoader* aLoader, nsIURI* aNewURI) +{ + mImports.Put(aNewURI, aLoader); +} + +nsRefPtr ImportManager::GetNearestPredecessor(nsINode* aNode) +{ + // Return the previous link if there is any in the same document. + nsIDocument* doc = aNode->OwnerDoc(); + int32_t idx = doc->IndexOfSubImportLink(aNode); + MOZ_ASSERT(idx != -1, "aNode must be a sub import link of its owner document"); + if (idx == 0) { + if (doc->IsMasterDocument()) { + // If there is no previous one, and it was the master document, then + // there is no predecessor. + return nullptr; + } + // Else we find the main referrer of the import parent of the link's document. + // And do a recursion. + ImportLoader* owner = Find(doc); + MOZ_ASSERT(owner); + nsCOMPtr mainReferrer = owner->GetMainReferrer(); + return GetNearestPredecessor(mainReferrer); + } + MOZ_ASSERT(idx > 0); + HTMLLinkElement* link = + static_cast(doc->GetSubImportLink(idx - 1)); + nsCOMPtr uri = link->GetHrefURI(); + nsRefPtr ret; + mImports.Get(uri, getter_AddRefs(ret)); + return ret; +} + } // namespace dom } // namespace mozilla diff --git a/content/base/src/ImportManager.h b/content/base/src/ImportManager.h index ba619941804..4ce97ebc8e4 100644 --- a/content/base/src/ImportManager.h +++ b/content/base/src/ImportManager.h @@ -39,12 +39,13 @@ #ifndef mozilla_dom_ImportManager_h__ #define mozilla_dom_ImportManager_h__ -#include "nsCOMArray.h" +#include "nsTArray.h" #include "nsCycleCollectionParticipant.h" #include "nsIDOMEventListener.h" #include "nsIStreamListener.h" #include "nsIWeakReferenceUtils.h" #include "nsRefPtrHashtable.h" +#include "nsScriptLoader.h" #include "nsURIHashKey.h" class nsIDocument; @@ -58,11 +59,70 @@ namespace dom { class ImportManager; +typedef nsTHashtable> NodeTable; + class ImportLoader MOZ_FINAL : public nsIStreamListener , public nsIDOMEventListener { + + // A helper inner class to decouple the logic of updating the import graph + // after a new import link has been found by one of the parsers. + class Updater { + + public: + Updater(ImportLoader* aLoader) : mLoader(aLoader) + {} + + // After a new link is added that refers to this import, we + // have to update the spanning tree, since given this new link the + // priority of this import might be higher in the scripts + // execution order than before. It updates mMainReferrer, mImportParent, + // the corresponding pending ScriptRunners, etc. + // It also handles updating additional dependant loaders via the + // UpdateDependants calls. + // (NOTE: See GetMainReferrer about spanning tree.) + void UpdateSpanningTree(nsINode* aNode); + + private: + // Returns an array of links that forms a referring chain from + // the master document to this import. Each link in the array + // is marked as main referrer in the list. + void GetReferrerChain(nsINode* aNode, nsTArray& aResult); + + // Once we find a new referrer path to our import, we have to see if + // it changes the load order hence we have to do an update on the graph. + bool ShouldUpdate(nsTArray& aNewPath); + void UpdateMainReferrer(uint32_t newIdx); + + // It's a depth first graph traversal algorithm, for UpdateDependants. The + // nodes in the graph are the import link elements, and there is a directed + // edge from link1 to link2 if link2 is a subimport in the import document + // of link1. + // If the ImportLoader that aCurrentLink points to didn't need to be updated + // the algorithm skips its "children" (subimports). Note, that this graph can + // also contain cycles, aVisistedLinks is used to track the already visited + // links to avoid an infinite loop. + // aPath - (in/out) the referrer link chain of aCurrentLink when called, and + // of the next link when the function returns + // aVisitedLinks - (in/out) list of links that the traversal already visited + // (to handle cycles in the graph) + // aSkipChildren - when aCurrentLink points to an import that did not need + // to be updated, we can skip its sub-imports ('children') + nsINode* NextDependant(nsINode* aCurrentLink, + nsTArray& aPath, + NodeTable& aVisitedLinks, bool aSkipChildren); + + // When we find a new link that changes the load order of the known imports, + // we also have to check all the subimports of it, to see if they need an + // update too. (see test_imports_nested_2.html) + void UpdateDependants(nsINode* aNode, nsTArray& aPath); + + ImportLoader* mLoader; + }; + friend class ::AutoError; friend class ImportManager; + friend class Updater; public: ImportLoader(nsIURI* aURI, nsIDocument* aOriginDocument); @@ -83,11 +143,46 @@ public: bool IsReady() { return mReady; } bool IsStopped() { return mStopped; } bool IsBlocking() { return mBlockingScripts; } - already_AddRefed GetImport() - { - return mReady ? nsCOMPtr(mDocument).forget() : nullptr; + + ImportManager* Manager() { + MOZ_ASSERT(mDocument || mImportParent, "One of them should be always set"); + return (mDocument ? mDocument : mImportParent)->ImportManager(); } + // Simply getter for the import document. Can return a partially parsed + // document if called too early. + nsIDocument* GetDocument() + { + return mDocument; + } + + // Getter for the import document that is used in the spec. Returns + // nullptr if the import is not yet ready. + nsIDocument* GetImport() + { + return mReady ? mDocument : nullptr; + } + + // There is only one referring link that is marked as primary link per + // imports. This is the one that has to be taken into account when + // scrip execution order is determined. Links marked as primary link form + // a spanning tree in the import graph. (Eliminating the cycles and + // multiple parents.) This spanning tree is recalculated every time + // a new import link is added to the manager. + nsINode* GetMainReferrer() + { + return mLinks.IsEmpty() ? nullptr : mLinks[mMainReferrer]; + } + + // An import is not only blocked by its import children, but also + // by its predecessors. It's enough to find the closest predecessor + // and wait for that to run its scripts. We keep track of all the + // ScriptRunners that are waiting for this import. NOTE: updating + // the main referrer might change this list. + void AddBlockedScriptLoader(nsScriptLoader* aScriptLoader); + bool RemoveBlockedScriptLoader(nsScriptLoader* aScriptLoader); + void SetBlockingPredecessor(ImportLoader* aLoader); + private: ~ImportLoader() {} @@ -122,12 +217,25 @@ private: nsCOMPtr mURI; nsCOMPtr mParserStreamListener; nsCOMPtr mImportParent; + ImportLoader* mBlockingPredecessor; + // List of the LinkElements that are referring to this import // we need to keep track of them so we can fire event on them. - nsCOMArray mLinks; + nsTArray> mLinks; + + // List of pending ScriptLoaders that are waiting for this import + // to finish. + nsTArray> mBlockedScriptLoaders; + + // There is always exactly one referrer link that is flagged as + // the main referrer the primary link. This is the one that is + // used in the script execution order calculation. + // ("Branch" according to the spec.) + uint32_t mMainReferrer; bool mReady; bool mStopped; bool mBlockingScripts; + Updater mUpdater; }; class ImportManager MOZ_FINAL : public nsISupports @@ -142,9 +250,24 @@ public: NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_CLASS(ImportManager) + // Finds the ImportLoader that belongs to aImport in the map. + ImportLoader* Find(nsIDocument* aImport); + + // Find the ImportLoader aLink refers to. + ImportLoader* Find(nsINode* aLink); + + void AddLoaderWithNewURI(ImportLoader* aLoader, nsIURI* aNewURI); + + // When a new import link is added, this getter either creates + // a new ImportLoader for it, or returns an existing one if + // it was already created and in the import map. already_AddRefed Get(nsIURI* aURI, nsINode* aNode, nsIDocument* aOriginDocument); + // It finds the predecessor for an import link node that runs its + // scripts the latest among its predecessors. + nsRefPtr GetNearestPredecessor(nsINode* aNode); + private: ImportMap mImports; }; diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index d8c6248d3ff..5d084cbffb8 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -1972,6 +1972,8 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsDocument) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOnDemandBuiltInUASheets) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPreloadingImages) + NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSubImportLinks) + for (uint32_t i = 0; i < tmp->mFrameRequestCallbacks.Length(); ++i) { NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mFrameRequestCallbacks[i]"); cb.NoteXPCOMChild(tmp->mFrameRequestCallbacks[i].mCallback.GetISupports()); @@ -2036,6 +2038,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDocument) NS_IMPL_CYCLE_COLLECTION_UNLINK(mRegistry) NS_IMPL_CYCLE_COLLECTION_UNLINK(mMasterDocument) NS_IMPL_CYCLE_COLLECTION_UNLINK(mImportManager) + NS_IMPL_CYCLE_COLLECTION_UNLINK(mSubImportLinks) tmp->mParentDocument = nullptr; diff --git a/content/base/src/nsDocument.h b/content/base/src/nsDocument.h index 34f13f21740..d8f57773e62 100644 --- a/content/base/src/nsDocument.h +++ b/content/base/src/nsDocument.h @@ -1291,10 +1291,10 @@ public: mozilla::ErrorResult& rv) MOZ_OVERRIDE; virtual void UseRegistryFromDocument(nsIDocument* aDocument) MOZ_OVERRIDE; - virtual already_AddRefed MasterDocument() + virtual nsIDocument* MasterDocument() { - return mMasterDocument ? (nsCOMPtr(mMasterDocument)).forget() - : (nsCOMPtr(this)).forget(); + return mMasterDocument ? mMasterDocument.get() + : this; } virtual void SetMasterDocument(nsIDocument* master) @@ -1307,11 +1307,11 @@ public: return !mMasterDocument; } - virtual already_AddRefed ImportManager() + virtual mozilla::dom::ImportManager* ImportManager() { if (mImportManager) { MOZ_ASSERT(!mMasterDocument, "Only the master document has ImportManager set"); - return nsRefPtr(mImportManager).forget(); + return mImportManager.get(); } if (mMasterDocument) { @@ -1323,7 +1323,28 @@ public: // master document and this is the first import in it. // Let's create a new manager. mImportManager = new mozilla::dom::ImportManager(); - return nsRefPtr(mImportManager).forget(); + return mImportManager.get(); + } + + virtual bool HasSubImportLink(nsINode* aLink) + { + return mSubImportLinks.Contains(aLink); + } + + virtual uint32_t IndexOfSubImportLink(nsINode* aLink) + { + return mSubImportLinks.IndexOf(aLink); + } + + virtual void AddSubImportLink(nsINode* aLink) + { + mSubImportLinks.AppendElement(aLink); + } + + virtual nsINode* GetSubImportLink(uint32_t aIdx) + { + return aIdx < mSubImportLinks.Length() ? mSubImportLinks[aIdx].get() + : nullptr; } virtual void UnblockDOMContentLoaded() MOZ_OVERRIDE; @@ -1749,6 +1770,7 @@ private: nsCOMPtr mMasterDocument; nsRefPtr mImportManager; + nsTArray > mSubImportLinks; // Set to true when the document is possibly controlled by the ServiceWorker. // Used to prevent multiple requests to ServiceWorkerManager. diff --git a/content/base/src/nsScriptLoader.cpp b/content/base/src/nsScriptLoader.cpp index 2ddb1ed827f..4cf1758ba23 100644 --- a/content/base/src/nsScriptLoader.cpp +++ b/content/base/src/nsScriptLoader.cpp @@ -49,6 +49,7 @@ #include "nsSandboxFlags.h" #include "nsContentTypeParser.h" #include "nsINetworkPredictor.h" +#include "ImportManager.h" #include "mozilla/dom/EncodingUtils.h" #include "mozilla/CORSMode.h" @@ -1227,7 +1228,7 @@ nsScriptLoader::ReadyToExecuteScripts() if (!SelfReadyToExecuteScripts()) { return false; } - + for (nsIDocument* doc = mDocument; doc; doc = doc->GetParentDocument()) { nsScriptLoader* ancestor = doc->ScriptLoader(); if (!ancestor->SelfReadyToExecuteScripts() && @@ -1237,10 +1238,44 @@ nsScriptLoader::ReadyToExecuteScripts() } } + if (!mDocument->IsMasterDocument()) { + nsRefPtr im = mDocument->ImportManager(); + nsRefPtr loader = im->Find(mDocument); + MOZ_ASSERT(loader, "How can we have an import document without a loader?"); + + // The referring link that counts in the execution order calculation + // (in spec: flagged as branch) + nsCOMPtr referrer = loader->GetMainReferrer(); + MOZ_ASSERT(referrer, "There has to be a main referring link for each imports"); + + // Import documents are blocked by their import predecessors. We need to + // wait with script execution until all the predecessors are done. + // Technically it means we have to wait for the last one to finish, + // which is the neares one to us in the order. + nsRefPtr lastPred = im->GetNearestPredecessor(referrer); + if (!lastPred) { + // If there is no predecessor we can run. + return true; + } + + nsCOMPtr doc = lastPred->GetDocument(); + if (!doc || (doc && !doc->ScriptLoader()->SelfReadyToExecuteScripts())) { + // Document has not been created yet or it was created but not ready. + // Either case we are blocked by it. The ImportLoader will take care + // of blocking us, and adding the pending child loader to the blocking + // ScriptLoader when it's possible (at this point the blocking loader + // might not have created the document/ScriptLoader) + lastPred->AddBlockedScriptLoader(this); + // As more imports are parsed, this can change, let's cache what we + // blocked, so it can be later updated if needed (see: ImportLoader::Updater). + loader->SetBlockingPredecessor(lastPred); + return false; + } + } + return true; } - // This function was copied from nsParser.cpp. It was simplified a bit. static bool DetectByteOrderMark(const unsigned char* aBytes, int32_t aLen, nsCString& oCharset) diff --git a/content/base/src/nsScriptLoader.h b/content/base/src/nsScriptLoader.h index 19fad0ce51f..200af7c37ef 100644 --- a/content/base/src/nsScriptLoader.h +++ b/content/base/src/nsScriptLoader.h @@ -249,6 +249,14 @@ public: nsresult ProcessOffThreadRequest(nsScriptLoadRequest *aRequest, void **aOffThreadToken); + bool AddPendingChildLoader(nsScriptLoader* aChild) { + return mPendingChildLoaders.AppendElement(aChild) != nullptr; + } + + bool RemovePendingChildLoader(nsScriptLoader* aLoader) { + return mPendingChildLoaders.RemoveElement(aLoader); + } + private: virtual ~nsScriptLoader(); @@ -302,10 +310,6 @@ private: return mEnabled && !mBlockerCount; } - bool AddPendingChildLoader(nsScriptLoader* aChild) { - return mPendingChildLoaders.AppendElement(aChild) != nullptr; - } - nsresult AttemptAsyncScriptParse(nsScriptLoadRequest* aRequest); nsresult ProcessRequest(nsScriptLoadRequest* aRequest, void **aOffThreadToken = nullptr); diff --git a/content/html/content/moz.build b/content/html/content/moz.build index 140507dd712..7318432f13a 100644 --- a/content/html/content/moz.build +++ b/content/html/content/moz.build @@ -8,6 +8,7 @@ DIRS += ['public', 'src'] MOCHITEST_MANIFESTS += [ 'test/forms/mochitest.ini', + 'test/imports/mochitest.ini', 'test/mochitest.ini', ] diff --git a/content/html/content/src/HTMLLinkElement.cpp b/content/html/content/src/HTMLLinkElement.cpp index 81a9934c870..33c594aaf44 100644 --- a/content/html/content/src/HTMLLinkElement.cpp +++ b/content/html/content/src/HTMLLinkElement.cpp @@ -264,15 +264,6 @@ HTMLLinkElement::UpdateImport() return; } - // Until the script execution order is not sorted out for nested cases - // let's not allow them. - if (!doc->IsMasterDocument()) { - nsContentUtils::LogSimpleConsoleError( - NS_LITERAL_STRING("Nested imports are not supported yet"), - "Imports"); - return; - } - // 2. rel type should be import. nsAutoString rel; GetAttr(kNameSpaceID_None, nsGkAtoms::rel, rel); @@ -527,7 +518,7 @@ HTMLLinkElement::WrapNode(JSContext* aCx) already_AddRefed HTMLLinkElement::GetImport() { - return mImportLoader ? mImportLoader->GetImport() : nullptr; + return mImportLoader ? nsRefPtr(mImportLoader->GetImport()).forget() : nullptr; } } // namespace dom diff --git a/content/html/content/test/imports/file_importA1.html b/content/html/content/test/imports/file_importA1.html new file mode 100644 index 00000000000..ecce6f06123 --- /dev/null +++ b/content/html/content/test/imports/file_importA1.html @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/content/html/content/test/imports/file_importA2.html b/content/html/content/test/imports/file_importA2.html new file mode 100644 index 00000000000..d03e80a4b41 --- /dev/null +++ b/content/html/content/test/imports/file_importA2.html @@ -0,0 +1,10 @@ + + + + + + + + \ No newline at end of file diff --git a/content/html/content/test/imports/file_importB1.html b/content/html/content/test/imports/file_importB1.html new file mode 100644 index 00000000000..82fb55f9f61 --- /dev/null +++ b/content/html/content/test/imports/file_importB1.html @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/content/html/content/test/imports/file_importB2.html b/content/html/content/test/imports/file_importB2.html new file mode 100644 index 00000000000..01b6cc21584 --- /dev/null +++ b/content/html/content/test/imports/file_importB2.html @@ -0,0 +1,10 @@ + + + + + + + + \ No newline at end of file diff --git a/content/html/content/test/imports/file_importC1.html b/content/html/content/test/imports/file_importC1.html new file mode 100644 index 00000000000..9ac117e65c9 --- /dev/null +++ b/content/html/content/test/imports/file_importC1.html @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/content/html/content/test/imports/file_importC10.html b/content/html/content/test/imports/file_importC10.html new file mode 100644 index 00000000000..801d0f08557 --- /dev/null +++ b/content/html/content/test/imports/file_importC10.html @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/content/html/content/test/imports/file_importC2.html b/content/html/content/test/imports/file_importC2.html new file mode 100644 index 00000000000..f0193be4499 --- /dev/null +++ b/content/html/content/test/imports/file_importC2.html @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/content/html/content/test/imports/file_importC3.html b/content/html/content/test/imports/file_importC3.html new file mode 100644 index 00000000000..eb942b707f5 --- /dev/null +++ b/content/html/content/test/imports/file_importC3.html @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/content/html/content/test/imports/file_importC4.html b/content/html/content/test/imports/file_importC4.html new file mode 100644 index 00000000000..5a172772ad9 --- /dev/null +++ b/content/html/content/test/imports/file_importC4.html @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/content/html/content/test/imports/file_importC5.html b/content/html/content/test/imports/file_importC5.html new file mode 100644 index 00000000000..c29dc24ba06 --- /dev/null +++ b/content/html/content/test/imports/file_importC5.html @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/content/html/content/test/imports/file_importC6.html b/content/html/content/test/imports/file_importC6.html new file mode 100644 index 00000000000..a53b62bb45e --- /dev/null +++ b/content/html/content/test/imports/file_importC6.html @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/content/html/content/test/imports/file_importC7.html b/content/html/content/test/imports/file_importC7.html new file mode 100644 index 00000000000..1c7d60114e0 --- /dev/null +++ b/content/html/content/test/imports/file_importC7.html @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/content/html/content/test/imports/file_importC8.html b/content/html/content/test/imports/file_importC8.html new file mode 100644 index 00000000000..04bef617d39 --- /dev/null +++ b/content/html/content/test/imports/file_importC8.html @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/content/html/content/test/imports/file_importC9.html b/content/html/content/test/imports/file_importC9.html new file mode 100644 index 00000000000..1a27497557f --- /dev/null +++ b/content/html/content/test/imports/file_importC9.html @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/content/html/content/test/imports/file_importD.html b/content/html/content/test/imports/file_importD.html new file mode 100644 index 00000000000..a4fbda536dd --- /dev/null +++ b/content/html/content/test/imports/file_importD.html @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/content/html/content/test/imports/file_importE.html b/content/html/content/test/imports/file_importE.html new file mode 100644 index 00000000000..6a8792acf2a --- /dev/null +++ b/content/html/content/test/imports/file_importE.html @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/content/html/content/test/imports/mochitest.ini b/content/html/content/test/imports/mochitest.ini new file mode 100644 index 00000000000..c1a863ea848 --- /dev/null +++ b/content/html/content/test/imports/mochitest.ini @@ -0,0 +1,20 @@ +[DEFAULT] +support-files = + file_importA1.html + file_importA2.html + file_importB1.html + file_importB2.html + file_importC1.html + file_importC2.html + file_importC3.html + file_importC4.html + file_importC5.html + file_importC6.html + file_importC7.html + file_importC8.html + file_importC9.html + file_importC10.html + file_importD.html + file_importE.html + + diff --git a/content/html/content/test/mochitest.ini b/content/html/content/test/mochitest.ini index df5499d15c1..4c8fc83edbd 100644 --- a/content/html/content/test/mochitest.ini +++ b/content/html/content/test/mochitest.ini @@ -462,6 +462,8 @@ skip-if = buildapp == 'b2g' || e10s # b2g(multiple concurrent window.open()s fai [test_imports_basics.html] [test_imports_redirect.html] [test_imports_nonhttp.html] +[test_imports_nested.html] +[test_imports_nested_2.html] [test_li_attributes_reflection.html] [test_link_attributes_reflection.html] [test_link_sizes.html] diff --git a/content/html/content/test/test_imports_nested.html b/content/html/content/test/test_imports_nested.html new file mode 100644 index 00000000000..d6320884c44 --- /dev/null +++ b/content/html/content/test/test_imports_nested.html @@ -0,0 +1,41 @@ + + + + + Test for Bug 877072 + + + + + + Mozilla Bug 877072 + + + + + + + + + + \ No newline at end of file diff --git a/content/html/content/test/test_imports_nested_2.html b/content/html/content/test/test_imports_nested_2.html new file mode 100644 index 00000000000..d5ff7278845 --- /dev/null +++ b/content/html/content/test/test_imports_nested_2.html @@ -0,0 +1,56 @@ + + + + + Test for Bug 877072 + + + + + + Mozilla Bug 877072 + + + + + + + + + + + + \ No newline at end of file From 5bba7ad647bc397b8edda64263db2166333296ed Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Tue, 2 Sep 2014 12:23:06 +0200 Subject: [PATCH 33/66] Bug 1061229: Implement SIMD coercive calls; r=h4writer --HG-- extra : histedit_source : 5cc3742a5277422eaf7fb4bdf13b2cb55f2987fa --- js/src/builtin/SIMD.cpp | 27 ++++++-- .../ecma_6/TypedObject/simd/coercions.js | 66 +++++++++++++++++++ 2 files changed, 88 insertions(+), 5 deletions(-) create mode 100644 js/src/tests/ecma_6/TypedObject/simd/coercions.js diff --git a/js/src/builtin/SIMD.cpp b/js/src/builtin/SIMD.cpp index 069a9b3d019..eb667a06e06 100644 --- a/js/src/builtin/SIMD.cpp +++ b/js/src/builtin/SIMD.cpp @@ -38,9 +38,8 @@ extern const JSFunctionSpec Int32x4Methods[]; static const char *laneNames[] = {"lane 0", "lane 1", "lane 2", "lane3"}; -template -bool -js::IsVectorObject(HandleValue v) +static bool +CheckVectorObject(HandleValue v, X4TypeDescr::Type expectedType) { if (!v.isObject()) return false; @@ -53,7 +52,14 @@ js::IsVectorObject(HandleValue v) if (typeRepr.kind() != type::X4) return false; - return typeRepr.as().type() == V::type; + return typeRepr.as().type() == expectedType; +} + +template +bool +js::IsVectorObject(HandleValue v) +{ + return CheckVectorObject(v, V::type); } template bool js::IsVectorObject(HandleValue v); @@ -300,6 +306,18 @@ X4TypeDescr::call(JSContext *cx, unsigned argc, Value *vp) CallArgs args = CallArgsFromVp(argc, vp); const unsigned LANES = 4; + Rooted descr(cx, &args.callee().as()); + if (args.length() == 1) { + // X4 type used as a coercion + if (!CheckVectorObject(args[0], descr->type())) { + JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_SIMD_NOT_A_VECTOR); + return false; + } + + args.rval().setObject(args[0].toObject()); + return true; + } + if (args.length() < LANES) { JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_MORE_ARGS_NEEDED, args.callee().getClass()->name, "3", "s"); @@ -312,7 +330,6 @@ X4TypeDescr::call(JSContext *cx, unsigned argc, Value *vp) return false; } - Rooted descr(cx, &args.callee().as()); Rooted result(cx, TypedObject::createZeroed(cx, descr, 0)); if (!result) return false; diff --git a/js/src/tests/ecma_6/TypedObject/simd/coercions.js b/js/src/tests/ecma_6/TypedObject/simd/coercions.js new file mode 100644 index 00000000000..06c34cca79d --- /dev/null +++ b/js/src/tests/ecma_6/TypedObject/simd/coercions.js @@ -0,0 +1,66 @@ +// |reftest| skip-if(!this.hasOwnProperty("SIMD")) +var BUGNUMBER = 1061229; +var float32x4 = SIMD.float32x4; +var int32x4 = SIMD.int32x4; +var {StructType, int32} = TypedObject; +var summary = 'constructors used as coercions'; + +/* + * Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/licenses/publicdomain/ + */ + +function assertCaught(f) { + var caught = false; + var args = Array.slice(arguments, 1); + try { + f.apply(null, args); + } catch (e) { + caught = true; + print(e) + } + assertEq(caught, true); +} + +function test() { + var x = int32x4(1, 2, 3, 4); + var y = int32x4(x); + + assertEq(x, y); + + assertEq(y.x, x.x); + assertEq(y.x, 1); + assertEq(y.y, x.y); + assertEq(y.y, 2); + assertEq(y.z, x.z); + assertEq(y.z, 3); + assertEq(y.w, x.w); + assertEq(y.w, 4); + + assertCaught(int32x4, 3); + assertCaught(int32x4, float32x4(1, 2, 3, 4)); + assertCaught(int32x4, 'pony x 4'); + + var x = float32x4(NaN, 13.37, -Infinity, 4); + var y = float32x4(x); + + assertEq(x, y); + + assertEq(y.x, x.x); + assertEq(y.x, Math.fround(NaN)); + assertEq(y.y, x.y); + assertEq(y.y, Math.fround(13.37)); + assertEq(y.z, x.z); + assertEq(y.z, Math.fround(-Infinity)); + assertEq(y.w, x.w); + assertEq(y.w, Math.fround(4)); + + assertCaught(float32x4, 3); + assertCaught(float32x4, int32x4(1, 2, 3, 4)); + assertCaught(float32x4, 'pony x 4'); + + if (typeof reportCompare === "function") + reportCompare(true, true); +} + +test(); From fbb99791d279ffe1c61472d992d273d287c724a5 Mon Sep 17 00:00:00 2001 From: Cervantes Yu Date: Mon, 11 Aug 2014 15:50:20 +0800 Subject: [PATCH 34/66] Bug 1048011 - Fix a race condition that causes PProcLoaderParent leak. r=khuey --HG-- extra : rebase_source : d0230771da1992fab13681c9b5baa585d334d0cc --- ipc/glue/ProcessUtils_linux.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ipc/glue/ProcessUtils_linux.cpp b/ipc/glue/ProcessUtils_linux.cpp index 4a071d0baea..9f7a84153ff 100644 --- a/ipc/glue/ProcessUtils_linux.cpp +++ b/ipc/glue/ProcessUtils_linux.cpp @@ -122,12 +122,22 @@ public: void ProcLoaderParent::ActorDestroy(ActorDestroyReason aWhy) { + if (aWhy == AbnormalShutdown) { + NS_WARNING("ProcLoaderParent is destroyed abnormally."); + } + + if (sProcLoaderClientOnDeinit) { + // Get error for closing while the channel is already error. + return; + } + + // Destroy self asynchronously. + ProcLoaderClientDeinit(); } static void _ProcLoaderParentDestroy(PProcLoaderParent *aLoader) { - aLoader->Close(); delete aLoader; sProcLoaderClientOnDeinit = false; } @@ -136,7 +146,6 @@ bool ProcLoaderParent::RecvLoadComplete(const int32_t &aPid, const int32_t &aCookie) { - ProcLoaderClientDeinit(); return true; } From d11a775d4153b00fecf791fc5a4336b37463c2ad Mon Sep 17 00:00:00 2001 From: Randell Jesup Date: Tue, 2 Sep 2014 04:52:45 -0400 Subject: [PATCH 35/66] Bug 1061475: fix crash in Loop calls on Macs due to Refresh() change r=gcp --- content/media/webrtc/MediaEngine.h | 5 +++ content/media/webrtc/MediaEngineWebRTC.cpp | 12 +++---- content/media/webrtc/MediaEngineWebRTC.h | 6 ---- .../media/webrtc/MediaEngineWebRTCVideo.cpp | 34 +++++++++++-------- 4 files changed, 30 insertions(+), 27 deletions(-) diff --git a/content/media/webrtc/MediaEngine.h b/content/media/webrtc/MediaEngine.h index b05f570228b..43c7b950442 100644 --- a/content/media/webrtc/MediaEngine.h +++ b/content/media/webrtc/MediaEngine.h @@ -83,6 +83,11 @@ protected: class MediaEngineSource : public nsISupports { public: + // code inside webrtc.org assumes these sizes; don't use anything smaller + // without verifying it's ok + static const unsigned int kMaxDeviceNameLength = 128; + static const unsigned int kMaxUniqueIdLength = 256; + virtual ~MediaEngineSource() {} /* Populate the human readable name of this device in the nsAString */ diff --git a/content/media/webrtc/MediaEngineWebRTC.cpp b/content/media/webrtc/MediaEngineWebRTC.cpp index ef55f4eb9d5..a5b280bf2a4 100644 --- a/content/media/webrtc/MediaEngineWebRTC.cpp +++ b/content/media/webrtc/MediaEngineWebRTC.cpp @@ -225,10 +225,8 @@ MediaEngineWebRTC::EnumerateVideoDevices(MediaSourceType aMediaSource, } for (int i = 0; i < num; i++) { - const unsigned int kMaxDeviceNameLength = 128; // XXX FIX! - const unsigned int kMaxUniqueIdLength = 256; - char deviceName[kMaxDeviceNameLength]; - char uniqueId[kMaxUniqueIdLength]; + char deviceName[MediaEngineSource::kMaxDeviceNameLength]; + char uniqueId[MediaEngineSource::kMaxUniqueIdLength]; // paranoia deviceName[0] = '\0'; @@ -246,10 +244,12 @@ MediaEngineWebRTC::EnumerateVideoDevices(MediaSourceType aMediaSource, LOG((" Capture Device Index %d, Name %s", i, deviceName)); webrtc::CaptureCapability cap; - int numCaps = ptrViECapture->NumberOfCapabilities(uniqueId, kMaxUniqueIdLength); + int numCaps = ptrViECapture->NumberOfCapabilities(uniqueId, + MediaEngineSource::kMaxUniqueIdLength); LOG(("Number of Capabilities %d", numCaps)); for (int j = 0; j < numCaps; j++) { - if (ptrViECapture->GetCaptureCapability(uniqueId, kMaxUniqueIdLength, + if (ptrViECapture->GetCaptureCapability(uniqueId, + MediaEngineSource::kMaxUniqueIdLength, j, cap ) != 0 ) { break; } diff --git a/content/media/webrtc/MediaEngineWebRTC.h b/content/media/webrtc/MediaEngineWebRTC.h index 0865710f448..ca7fe54689d 100644 --- a/content/media/webrtc/MediaEngineWebRTC.h +++ b/content/media/webrtc/MediaEngineWebRTC.h @@ -220,9 +220,6 @@ protected: ~MediaEngineWebRTCVideoSource() { Shutdown(); } private: - static const unsigned int KMaxDeviceNameLength = 128; - static const unsigned int KMaxUniqueIdLength = 256; - // Initialize the needed Video engine interfaces. void Init(); void Shutdown(); @@ -350,9 +347,6 @@ protected: int mSamples; private: - static const unsigned int KMaxDeviceNameLength = 128; - static const unsigned int KMaxUniqueIdLength = 256; - void Init(); void Shutdown(); diff --git a/content/media/webrtc/MediaEngineWebRTCVideo.cpp b/content/media/webrtc/MediaEngineWebRTCVideo.cpp index 5bf303a6068..1e381c1bc19 100644 --- a/content/media/webrtc/MediaEngineWebRTCVideo.cpp +++ b/content/media/webrtc/MediaEngineWebRTCVideo.cpp @@ -218,7 +218,7 @@ MediaEngineWebRTCVideoSource::ChooseCapability( return GuessCapability(aConstraints, aPrefs); #else NS_ConvertUTF16toUTF8 uniqueId(mUniqueId); - int num = mViECapture->NumberOfCapabilities(uniqueId.get(), KMaxUniqueIdLength); + int num = mViECapture->NumberOfCapabilities(uniqueId.get(), kMaxUniqueIdLength); if (num <= 0) { // Mac doesn't support capabilities. return GuessCapability(aConstraints, aPrefs); @@ -240,7 +240,7 @@ MediaEngineWebRTCVideoSource::ChooseCapability( for (uint32_t i = 0; i < candidateSet.Length();) { webrtc::CaptureCapability cap; - mViECapture->GetCaptureCapability(uniqueId.get(), KMaxUniqueIdLength, + mViECapture->GetCaptureCapability(uniqueId.get(), kMaxUniqueIdLength, candidateSet[i], cap); if (!SatisfyConstraintSet(aConstraints.mRequired, cap)) { candidateSet.RemoveElementAt(i); @@ -260,7 +260,7 @@ MediaEngineWebRTCVideoSource::ChooseCapability( SourceSet rejects; for (uint32_t j = 0; j < candidateSet.Length();) { webrtc::CaptureCapability cap; - mViECapture->GetCaptureCapability(uniqueId.get(), KMaxUniqueIdLength, + mViECapture->GetCaptureCapability(uniqueId.get(), kMaxUniqueIdLength, candidateSet[j], cap); if (!SatisfyConstraintSet(array[i], cap)) { rejects.AppendElement(candidateSet[j]); @@ -288,7 +288,7 @@ MediaEngineWebRTCVideoSource::ChooseCapability( bool higher = true; for (uint32_t i = 0; i < candidateSet.Length(); i++) { mViECapture->GetCaptureCapability(NS_ConvertUTF16toUTF8(mUniqueId).get(), - KMaxUniqueIdLength, candidateSet[i], cap); + kMaxUniqueIdLength, candidateSet[i], cap); if (higher) { if (i == 0 || (mCapability.width > cap.width && mCapability.height > cap.height)) { @@ -451,7 +451,7 @@ MediaEngineWebRTCVideoSource::Allocate(const VideoTrackConstraintsN &aConstraint ChooseCapability(aConstraints, aPrefs); if (mViECapture->AllocateCaptureDevice(NS_ConvertUTF16toUTF8(mUniqueId).get(), - KMaxUniqueIdLength, mCaptureIndex)) { + kMaxUniqueIdLength, mCaptureIndex)) { return NS_ERROR_FAILURE; } mState = kAllocated; @@ -654,13 +654,11 @@ MediaEngineWebRTCVideoSource::Init() return; } - const uint32_t KMaxDeviceNameLength = 128; - const uint32_t KMaxUniqueIdLength = 256; - char deviceName[KMaxDeviceNameLength]; - char uniqueId[KMaxUniqueIdLength]; + char deviceName[kMaxDeviceNameLength]; + char uniqueId[kMaxUniqueIdLength]; if (mViECapture->GetCaptureDevice(mCaptureIndex, - deviceName, KMaxDeviceNameLength, - uniqueId, KMaxUniqueIdLength)) { + deviceName, kMaxDeviceNameLength, + uniqueId, kMaxUniqueIdLength)) { return; } @@ -707,15 +705,21 @@ void MediaEngineWebRTCVideoSource::Refresh(int aIndex) { // Caller looked up this source by uniqueId; since deviceName == uniqueId nothing else changes #else // Caller looked up this source by uniqueId, so it shouldn't change - const uint32_t KMaxDeviceNameLength = 128; - char deviceName[KMaxDeviceNameLength]; + char deviceName[kMaxDeviceNameLength]; + char uniqueId[kMaxUniqueIdLength]; + if (mViECapture->GetCaptureDevice(aIndex, - deviceName, KMaxDeviceNameLength, - nullptr, 0)) { + deviceName, sizeof(deviceName), + uniqueId, sizeof(uniqueId))) { return; } CopyUTF8toUTF16(deviceName, mDeviceName); +#ifdef DEBUG + nsString temp; + CopyUTF8toUTF16(uniqueId, temp); + MOZ_ASSERT(temp.Equals(mUniqueId)); +#endif #endif } From acf646b3a9c754856bc714296c0896ce34364324 Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Tue, 2 Sep 2014 13:56:44 +0200 Subject: [PATCH 36/66] Backed out changeset 6baeffddba47 (bug 1060279) for regressions --- testing/marionette/client/marionette/runner/mixins/b2g.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/marionette/client/marionette/runner/mixins/b2g.py b/testing/marionette/client/marionette/runner/mixins/b2g.py index 0adbc30f072..129fb882c4f 100644 --- a/testing/marionette/client/marionette/runner/mixins/b2g.py +++ b/testing/marionette/client/marionette/runner/mixins/b2g.py @@ -43,7 +43,7 @@ class B2GTestCaseMixin(object): capabilities = self.marionette.session and \ self.marionette.session_capabilities or {} if not self._device_manager and \ - capabilities.get('platform').lower() == 'android': + capabilities.get('device') != 'desktop': self._device_manager = get_dm(self.marionette, **kwargs) return self._device_manager From f63936f7f602b15ca8d6e77e669deb1436085236 Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Tue, 2 Sep 2014 14:05:00 +0200 Subject: [PATCH 37/66] Bug 1059793 - Mark the compositor's gl context destroyed before the widget is gone. r=jgilbert --- gfx/gl/GLContext.h | 7 +++---- gfx/layers/opengl/CompositorOGL.cpp | 7 +++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gfx/gl/GLContext.h b/gfx/gl/GLContext.h index 5f811942d87..ed73c9b3181 100644 --- a/gfx/gl/GLContext.h +++ b/gfx/gl/GLContext.h @@ -2641,6 +2641,9 @@ protected: public: virtual ~GLContext(); + // Mark this context as destroyed. This will nullptr out all + // the GL function pointers! + void MarkDestroyed(); // ----------------------------------------------------------------------------- // Everything that isn't standard GL APIs @@ -2683,10 +2686,6 @@ public: virtual void ReleaseSurface() {} - // Mark this context as destroyed. This will nullptr out all - // the GL function pointers! - void MarkDestroyed(); - bool IsDestroyed() { // MarkDestroyed will mark all these as null. return mSymbols.fUseProgram == nullptr; diff --git a/gfx/layers/opengl/CompositorOGL.cpp b/gfx/layers/opengl/CompositorOGL.cpp index a6b22af7cdc..020d1bfa14e 100644 --- a/gfx/layers/opengl/CompositorOGL.cpp +++ b/gfx/layers/opengl/CompositorOGL.cpp @@ -173,6 +173,13 @@ CompositorOGL::CleanupResources() mQuadVBO = 0; } + // On the main thread the Widget will be destroyed soon and calling MakeCurrent + // after that could cause a crash (at least with GLX, see bug 1059793), unless + // context is marked as destroyed. + // There may be some textures still alive that will try to call MakeCurrent on + // the context so let's make sure it is marked destroyed now. + mGLContext->MarkDestroyed(); + mGLContext = nullptr; } From 3cad134299335cd48d437ba40c3c3bb68ea03d38 Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Tue, 2 Sep 2014 14:05:49 +0200 Subject: [PATCH 38/66] Bug 1055661 - Add Matrix5x4::operator== which does exact equality comparison. f=Milan, r=Bas --- gfx/2d/Matrix.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gfx/2d/Matrix.h b/gfx/2d/Matrix.h index 9867df9c595..d461a721084 100644 --- a/gfx/2d/Matrix.h +++ b/gfx/2d/Matrix.h @@ -750,6 +750,20 @@ public: , _51(a51), _52(a52), _53(a53), _54(a54) {} + bool operator==(const Matrix5x4 &o) const + { + return _11 == o._11 && _12 == o._12 && _13 == o._13 && _14 == o._14 && + _21 == o._21 && _22 == o._22 && _23 == o._23 && _24 == o._24 && + _31 == o._31 && _32 == o._32 && _33 == o._33 && _34 == o._34 && + _41 == o._41 && _42 == o._42 && _43 == o._43 && _44 == o._44 && + _51 == o._51 && _52 == o._52 && _53 == o._53 && _54 == o._54; + } + + bool operator!=(const Matrix5x4 &aMatrix) const + { + return !(*this == aMatrix); + } + Matrix5x4 operator*(const Matrix5x4 &aMatrix) const { Matrix5x4 resultMatrix; From 5711cc595b6de9e279e16dbdfdc14888c0f61cf9 Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Tue, 2 Sep 2014 14:06:01 +0200 Subject: [PATCH 39/66] Bug 1055661 - Add Matrix5x4::operator*=. f=milan, r=Bas --- gfx/2d/Matrix.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/gfx/2d/Matrix.h b/gfx/2d/Matrix.h index d461a721084..fe13eff930a 100644 --- a/gfx/2d/Matrix.h +++ b/gfx/2d/Matrix.h @@ -166,8 +166,8 @@ public: Matrix& operator*=(const Matrix &aMatrix) { - Matrix resultMatrix = *this * aMatrix; - return *this = resultMatrix; + *this = *this * aMatrix; + return *this; } /* Returns true if the other matrix is fuzzy-equal to this matrix. @@ -572,8 +572,8 @@ public: Matrix4x4& operator*=(const Matrix4x4 &aMatrix) { - Matrix4x4 resultMatrix = *this * aMatrix; - return *this = resultMatrix; + *this = *this * aMatrix; + return *this; } /* Returns true if the matrix is an identity matrix. @@ -792,6 +792,12 @@ public: return resultMatrix; } + Matrix5x4& operator*=(const Matrix5x4 &aMatrix) + { + *this = *this * aMatrix; + return *this; + } + Float _11, _12, _13, _14; Float _21, _22, _23, _24; Float _31, _32, _33, _34; From 703198fcf73b575d3ade0d4af71675bab67a3067 Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Tue, 2 Sep 2014 14:09:21 +0200 Subject: [PATCH 40/66] Bug 1055646 - Fix a typo in the blur shader. r=nical --- gfx/layers/opengl/OGLShaderProgram.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gfx/layers/opengl/OGLShaderProgram.cpp b/gfx/layers/opengl/OGLShaderProgram.cpp index 4cf0733f152..4abe986fb4e 100644 --- a/gfx/layers/opengl/OGLShaderProgram.cpp +++ b/gfx/layers/opengl/OGLShaderProgram.cpp @@ -312,7 +312,7 @@ For [0,1] instead of [0,255], and to 5 places: fs << "vec4 blur(vec4 color, vec2 coord) {" << endl; fs << " vec4 total = color * uBlurGaussianKernel[0];" << endl; fs << " for (int i = 1; i < " << GAUSSIAN_KERNEL_HALF_WIDTH << "; ++i) {" << endl; - fs << " float r = float(i) * " << GAUSSIAN_KERNEL_STEP << " << endl;" << endl; + fs << " float r = float(i) * " << GAUSSIAN_KERNEL_STEP << ";" << endl; fs << " float k = uBlurGaussianKernel[i];" << endl; fs << " total += sampleAtRadius(coord, r) * k;" << endl; fs << " total += sampleAtRadius(coord, -r) * k;" << endl; From d07acdd93c48ccf229e33383917220a974c1eca4 Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Tue, 2 Sep 2014 14:09:26 +0200 Subject: [PATCH 41/66] Bug 1055646 - Allow setting the uniforms of the blur shader on ShaderProgramOGL. r=nical --- gfx/layers/opengl/OGLShaderProgram.cpp | 24 ++++++++++++++++ gfx/layers/opengl/OGLShaderProgram.h | 39 ++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/gfx/layers/opengl/OGLShaderProgram.cpp b/gfx/layers/opengl/OGLShaderProgram.cpp index 4abe986fb4e..faf49f3ebe3 100644 --- a/gfx/layers/opengl/OGLShaderProgram.cpp +++ b/gfx/layers/opengl/OGLShaderProgram.cpp @@ -49,6 +49,10 @@ AddUniforms(ProgramProfileOGL& aProfile) "uTexturePass2", "uColorMatrix", "uColorMatrixVector", + "uBlurRadius", + "uBlurOffset", + "uBlurAlpha", + "uBlurGaussianKernel", nullptr }; @@ -549,5 +553,25 @@ ShaderProgramOGL::Activate() mGL->fUseProgram(mProgram); } +void +ShaderProgramOGL::SetBlurRadius(float aRX, float aRY) +{ + float f[] = {aRX, aRY}; + SetUniform(KnownUniform::BlurRadius, 2, f); + + float gaussianKernel[GAUSSIAN_KERNEL_HALF_WIDTH]; + float sum = 0.0f; + for (int i = 0; i < GAUSSIAN_KERNEL_HALF_WIDTH; i++) { + float x = i * GAUSSIAN_KERNEL_STEP; + float sigma = 1.0f; + gaussianKernel[i] = exp(-x * x / (2 * sigma * sigma)) / sqrt(2 * M_PI * sigma * sigma); + sum += gaussianKernel[i] * (i == 0 ? 1 : 2); + } + for (int i = 0; i < GAUSSIAN_KERNEL_HALF_WIDTH; i++) { + gaussianKernel[i] /= sum; + } + SetArrayUniform(KnownUniform::BlurGaussianKernel, GAUSSIAN_KERNEL_HALF_WIDTH, gaussianKernel); +} + } /* layers */ } /* mozilla */ diff --git a/gfx/layers/opengl/OGLShaderProgram.h b/gfx/layers/opengl/OGLShaderProgram.h index 51ecaaeed36..a7305809fa2 100644 --- a/gfx/layers/opengl/OGLShaderProgram.h +++ b/gfx/layers/opengl/OGLShaderProgram.h @@ -70,6 +70,10 @@ public: TexturePass2, ColorMatrix, ColorMatrixVector, + BlurRadius, + BlurOffset, + BlurAlpha, + BlurGaussianKernel, KnownUniformCount }; @@ -147,6 +151,19 @@ public: return false; } + bool UpdateArrayUniform(int cnt, const float *fp) { + if (mLocation == -1) return false; + if (cnt > 16) { + return false; + } + + if (memcmp(mValue.f16v, fp, sizeof(float) * cnt) != 0) { + memcpy(mValue.f16v, fp, sizeof(float) * cnt); + return true; + } + return false; + } + KnownUniformName mName; const char *mNameString; int32_t mLocation; @@ -389,6 +406,17 @@ public: SetUniform(KnownUniform::TexturePass2, aFlag ? 1 : 0); } + void SetBlurRadius(float aRX, float aRY); + + void SetBlurAlpha(float aAlpha) { + SetUniform(KnownUniform::BlurAlpha, aAlpha); + } + + void SetBlurOffset(float aOffsetX, float aOffsetY) { + float f[] = {aOffsetX, aOffsetY}; + SetUniform(KnownUniform::BlurOffset, 2, f); + } + size_t GetTextureCount() const { return mProfile.mTextureCount; } @@ -459,6 +487,17 @@ protected: } } + void SetArrayUniform(KnownUniform::KnownUniformName aKnownUniform, int aLength, float *aFloatValues) + { + ASSERT_THIS_PROGRAM; + NS_ASSERTION(aKnownUniform >= 0 && aKnownUniform < KnownUniform::KnownUniformCount, "Invalid known uniform"); + + KnownUniform& ku(mProfile.mUniforms[aKnownUniform]); + if (ku.UpdateArrayUniform(aLength, aFloatValues)) { + mGL->fUniform1fv(ku.mLocation, aLength, ku.mValue.f16v); + } + } + void SetUniform(KnownUniform::KnownUniformName aKnownUniform, GLint aIntValue) { ASSERT_THIS_PROGRAM; NS_ASSERTION(aKnownUniform >= 0 && aKnownUniform < KnownUniform::KnownUniformCount, "Invalid known uniform"); From 23e7cc396a89eaab76b8c1ab9d2fcd10ac5f8fe7 Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Tue, 2 Sep 2014 14:54:22 +0200 Subject: [PATCH 42/66] Backed out changeset 9678f9a596d8 (bug 877072) for B2G ICS Emulator Debug m3 and m5 test failures --- content/base/public/nsIDocument.h | 14 +- content/base/src/ImportManager.cpp | 360 +----------------- content/base/src/ImportManager.h | 131 +------ content/base/src/nsDocument.cpp | 3 - content/base/src/nsDocument.h | 34 +- content/base/src/nsScriptLoader.cpp | 39 +- content/base/src/nsScriptLoader.h | 12 +- content/html/content/moz.build | 1 - content/html/content/src/HTMLLinkElement.cpp | 11 +- .../content/test/imports/file_importA1.html | 11 - .../content/test/imports/file_importA2.html | 10 - .../content/test/imports/file_importB1.html | 11 - .../content/test/imports/file_importB2.html | 10 - .../content/test/imports/file_importC1.html | 11 - .../content/test/imports/file_importC10.html | 11 - .../content/test/imports/file_importC2.html | 11 - .../content/test/imports/file_importC3.html | 11 - .../content/test/imports/file_importC4.html | 11 - .../content/test/imports/file_importC5.html | 11 - .../content/test/imports/file_importC6.html | 11 - .../content/test/imports/file_importC7.html | 11 - .../content/test/imports/file_importC8.html | 11 - .../content/test/imports/file_importC9.html | 11 - .../content/test/imports/file_importD.html | 8 - .../content/test/imports/file_importE.html | 11 - .../html/content/test/imports/mochitest.ini | 20 - content/html/content/test/mochitest.ini | 2 - .../content/test/test_imports_nested.html | 41 -- .../content/test/test_imports_nested_2.html | 56 --- 29 files changed, 42 insertions(+), 853 deletions(-) delete mode 100644 content/html/content/test/imports/file_importA1.html delete mode 100644 content/html/content/test/imports/file_importA2.html delete mode 100644 content/html/content/test/imports/file_importB1.html delete mode 100644 content/html/content/test/imports/file_importB2.html delete mode 100644 content/html/content/test/imports/file_importC1.html delete mode 100644 content/html/content/test/imports/file_importC10.html delete mode 100644 content/html/content/test/imports/file_importC2.html delete mode 100644 content/html/content/test/imports/file_importC3.html delete mode 100644 content/html/content/test/imports/file_importC4.html delete mode 100644 content/html/content/test/imports/file_importC5.html delete mode 100644 content/html/content/test/imports/file_importC6.html delete mode 100644 content/html/content/test/imports/file_importC7.html delete mode 100644 content/html/content/test/imports/file_importC8.html delete mode 100644 content/html/content/test/imports/file_importC9.html delete mode 100644 content/html/content/test/imports/file_importD.html delete mode 100644 content/html/content/test/imports/file_importE.html delete mode 100644 content/html/content/test/imports/mochitest.ini delete mode 100644 content/html/content/test/test_imports_nested.html delete mode 100644 content/html/content/test/test_imports_nested_2.html diff --git a/content/base/public/nsIDocument.h b/content/base/public/nsIDocument.h index 90d33d3404f..c302b48d33a 100644 --- a/content/base/public/nsIDocument.h +++ b/content/base/public/nsIDocument.h @@ -133,8 +133,8 @@ typedef CallbackObjectHolder NodeFilterHolder; } // namespace mozilla #define NS_IDOCUMENT_IID \ -{ 0x42a263db, 0x6ac6, 0x40ff, \ - { 0x89, 0xe2, 0x25, 0x12, 0xe4, 0xbc, 0x2d, 0x2d } } +{ 0x613ea294, 0x0288, 0x48b4, \ + { 0x9e, 0x7b, 0x0f, 0xe9, 0x3f, 0x8c, 0xf8, 0x95 } } // Enum for requesting a particular type of document when creating a doc enum DocumentFlavor { @@ -2353,15 +2353,11 @@ public: // Each import tree has exactly one master document which is // the root of the tree, and owns the browser context. - virtual nsIDocument* MasterDocument() = 0; + virtual already_AddRefed MasterDocument() = 0; virtual void SetMasterDocument(nsIDocument* master) = 0; virtual bool IsMasterDocument() = 0; - virtual mozilla::dom::ImportManager* ImportManager() = 0; - // We keep track of the order of sub imports were added to the document. - virtual bool HasSubImportLink(nsINode* aLink) = 0; - virtual uint32_t IndexOfSubImportLink(nsINode* aLink) = 0; - virtual void AddSubImportLink(nsINode* aLink) = 0; - virtual nsINode* GetSubImportLink(uint32_t aIdx) = 0; + virtual already_AddRefed ImportManager() = 0; + /* * Given a node, get a weak reference to it and append that reference to * mBlockedTrackingNodes. Can be used later on to look up a node in it. diff --git a/content/base/src/ImportManager.cpp b/content/base/src/ImportManager.cpp index a16df3b6e0d..63a2fcdd094 100644 --- a/content/base/src/ImportManager.cpp +++ b/content/base/src/ImportManager.cpp @@ -23,10 +23,6 @@ #include "nsScriptLoader.h" #include "nsNetUtil.h" -//----------------------------------------------------------------------------- -// AutoError -//----------------------------------------------------------------------------- - class AutoError { public: explicit AutoError(mozilla::dom::ImportLoader* loader, bool scriptsBlocked = true) @@ -53,212 +49,6 @@ private: namespace mozilla { namespace dom { -//----------------------------------------------------------------------------- -// ImportLoader::Updater -//----------------------------------------------------------------------------- - -void -ImportLoader::Updater::GetReferrerChain(nsINode* aNode, - nsTArray& aResult) -{ - // We fill up the array backward. First the last link: aNode. - MOZ_ASSERT(mLoader->mLinks.Contains(aNode)); - - aResult.AppendElement(aNode); - nsINode* node = aNode; - nsRefPtr manager = mLoader->Manager(); - for (ImportLoader* referrersLoader = manager->Find(node->OwnerDoc()); - referrersLoader; - referrersLoader = manager->Find(node->OwnerDoc())) - { - // Then walking up the main referrer chain and append each link - // to the array. - node = referrersLoader->GetMainReferrer(); - MOZ_ASSERT(node); - aResult.AppendElement(node); - } - - // The reversed order is more useful for consumers. - // XXX: This should probably go to nsTArray or some generic utility - // lib for our containers that we don't have... I would really like to - // get rid of this part... - uint32_t l = aResult.Length(); - for (uint32_t i = 0; i < l / 2; i++) { - Swap(aResult[i], aResult[l - i - 1]); - } -} - -bool -ImportLoader::Updater::ShouldUpdate(nsTArray& aNewPath) -{ - // Let's walk down on the main referrer chains of both the current main and - // the new link, and find the last pair of links that are from the same - // document. This is the junction point between the two referrer chain. Their - // order in the subimport list of that document will determine if we have to - // update the spanning tree or this new edge changes nothing in the script - // execution order. - nsTArray oldPath; - GetReferrerChain(mLoader->mLinks[mLoader->mMainReferrer], oldPath); - uint32_t max = std::min(oldPath.Length(), aNewPath.Length()); - MOZ_ASSERT(max > 0); - uint32_t lastCommonImportAncestor = 0; - - for (uint32_t i = 0; - i < max && oldPath[i]->OwnerDoc() == aNewPath[i]->OwnerDoc(); - i++) - { - lastCommonImportAncestor = i; - } - - MOZ_ASSERT(lastCommonImportAncestor < max); - nsINode* oldLink = oldPath[lastCommonImportAncestor]; - nsINode* newLink = aNewPath[lastCommonImportAncestor]; - - if ((lastCommonImportAncestor == max - 1) && - newLink == oldLink ) { - // If one chain contains the other entirely, then this is a simple cycle, - // nothing to be done here. - MOZ_ASSERT(oldPath.Length() != aNewPath.Length(), - "This would mean that new link == main referrer link"); - return false; - } - - MOZ_ASSERT(aNewPath != oldPath, - "How could this happen?"); - nsIDocument* doc = oldLink->OwnerDoc(); - MOZ_ASSERT(doc->HasSubImportLink(newLink)); - MOZ_ASSERT(doc->HasSubImportLink(oldLink)); - - return doc->IndexOfSubImportLink(newLink) < doc->IndexOfSubImportLink(oldLink); -} - -void -ImportLoader::Updater::UpdateMainReferrer(uint32_t aNewIdx) -{ - MOZ_ASSERT(aNewIdx < mLoader->mLinks.Length()); - nsINode* newMainReferrer = mLoader->mLinks[aNewIdx]; - // This new link means we have to execute our scripts sooner... - if (mLoader->mDocument) { - // Our nearest predecessor has changed. So let's remove our pending - // ScriptLoader from the old one. - nsRefPtr manager = mLoader->Manager(); - nsScriptLoader* loader = mLoader->mDocument->ScriptLoader(); - ImportLoader*& pred = mLoader->mBlockingPredecessor; - if (pred) { - pred->RemoveBlockedScriptLoader(loader); - } - // And add it to the new one if there is any. - pred = manager->GetNearestPredecessor(newMainReferrer); - if (pred) { - pred->AddBlockedScriptLoader(loader); - } - } - if (mLoader->IsBlocking()) { - // Our import parent is changed as well, let's unblock it and block - // the new one. - mLoader->mImportParent->ScriptLoader()->RemoveExecuteBlocker(); - newMainReferrer->OwnerDoc()->ScriptLoader()->AddExecuteBlocker(); - } - // Finally update mMainReferrer to point to the newly added link. - mLoader->mMainReferrer = aNewIdx; - mLoader->mImportParent = newMainReferrer->OwnerDoc(); -} - -nsINode* -ImportLoader::Updater::NextDependant(nsINode* aCurrentLink, - nsTArray& aPath, - NodeTable& aVisitedNodes, bool aSkipChildren) -{ - // Depth first graph traversal. - if (!aSkipChildren) { - // "first child" - ImportLoader* loader = mLoader->Manager()->Find(aCurrentLink); - if (loader && loader->GetDocument()) { - nsINode* firstSubImport = loader->GetDocument()->GetSubImportLink(0); - if (firstSubImport && !aVisitedNodes.Contains(firstSubImport)) { - aPath.AppendElement(aCurrentLink); - aVisitedNodes.PutEntry(firstSubImport); - return firstSubImport; - } - } - } - - aPath.AppendElement(aCurrentLink); - // "(parent's) next sibling" - while(aPath.Length() > 1) { - aCurrentLink = aPath[aPath.Length() - 1]; - aPath.RemoveElementAt(aPath.Length() - 1); - - // Let's find the next "sibling" - ImportLoader* loader = mLoader->Manager()->Find(aCurrentLink->OwnerDoc()); - MOZ_ASSERT(loader && loader->GetDocument(), "How can this happend?"); - nsIDocument* doc = loader->GetDocument(); - MOZ_ASSERT(doc->HasSubImportLink(aCurrentLink)); - uint32_t idx = doc->IndexOfSubImportLink(aCurrentLink); - nsINode* next = doc->GetSubImportLink(idx + 1); - if (next) { - // Note: If we found an already visited link that means the parent links has - // closed the circle it's always the "first child" section that should find - // the first already visited node. Let's just assert that. - MOZ_ASSERT(!aVisitedNodes.Contains(next)); - aVisitedNodes.PutEntry(next); - return next; - } - } - - return nullptr; -} - -void -ImportLoader::Updater::UpdateDependants(nsINode* aNode, - nsTArray& aPath) -{ - NodeTable visitedNodes; - nsINode* current = aNode; - uint32_t initialLength = aPath.Length(); - bool neededUpdate = true; - while ((current = NextDependant(current, aPath, visitedNodes, !neededUpdate))) { - if (!current || aPath.Length() <= initialLength) { - break; - } - ImportLoader* loader = mLoader->Manager()->Find(current); - if (!loader) { - continue; - } - Updater& updater = loader->mUpdater; - neededUpdate = updater.ShouldUpdate(aPath); - if (neededUpdate) { - updater.UpdateMainReferrer(loader->mLinks.IndexOf(current)); - } - } -} - -void -ImportLoader::Updater::UpdateSpanningTree(nsINode* aNode) -{ - if (mLoader->mReady || mLoader->mStopped) { - // Scripts already executed, nothing to be done here. - return; - } - - if (mLoader->mLinks.Length() == 1) { - // If this is the first referrer, let's mark it. - mLoader->mMainReferrer = 0; - return; - } - - nsTArray newReferrerChain; - GetReferrerChain(aNode, newReferrerChain); - if (ShouldUpdate(newReferrerChain)) { - UpdateMainReferrer(mLoader->mLinks.Length() - 1); - UpdateDependants(aNode, newReferrerChain); - } -} - -//----------------------------------------------------------------------------- -// ImportLoader -//----------------------------------------------------------------------------- - NS_INTERFACE_MAP_BEGIN(ImportLoader) NS_INTERFACE_MAP_ENTRY(nsIStreamListener) NS_INTERFACE_MAP_ENTRY(nsIRequestObserver) @@ -276,13 +66,10 @@ NS_IMPL_CYCLE_COLLECTION(ImportLoader, ImportLoader::ImportLoader(nsIURI* aURI, nsIDocument* aImportParent) : mURI(aURI) , mImportParent(aImportParent) - , mBlockingPredecessor(nullptr) , mReady(false) , mStopped(false) , mBlockingScripts(false) - , mUpdater(MOZ_THIS_IN_INITIALIZER_LIST()) -{ -} +{} void ImportLoader::BlockScripts() @@ -297,18 +84,9 @@ ImportLoader::UnblockScripts() { MOZ_ASSERT(mBlockingScripts); mImportParent->ScriptLoader()->RemoveExecuteBlocker(); - // We probably should do a clever assertion here to see - // if our ScriptLoader unblocked all these ScriptLoaders. - mBlockedScriptLoaders.Clear(); mBlockingScripts = false; } -void -ImportLoader::SetBlockingPredecessor(ImportLoader* aLoader) -{ - mBlockingPredecessor = aLoader; -} - void ImportLoader::DispatchEventIfFinished(nsINode* aNode) { @@ -321,33 +99,6 @@ ImportLoader::DispatchEventIfFinished(nsINode* aNode) } } -void -ImportLoader::AddBlockedScriptLoader(nsScriptLoader* aScriptLoader) -{ - MOZ_ASSERT(!mBlockedScriptLoaders.Contains(aScriptLoader), - "Same scripts loader should be added only once"); - - aScriptLoader->AddExecuteBlocker(); - - if (mDocument) { - // If the document is ready we can just add the pending script loader - // to it. Otherwise we will add them once the document is created. - mDocument->ScriptLoader()->AddPendingChildLoader(aScriptLoader); - } - // Let's keep track of the pending script loaders. - mBlockedScriptLoaders.AppendElement(aScriptLoader); -} - -bool -ImportLoader::RemoveBlockedScriptLoader(nsScriptLoader* aScriptLoader) -{ - aScriptLoader->RemoveExecuteBlocker(); - if (mDocument) { - mDocument->ScriptLoader()->RemovePendingChildLoader(aScriptLoader); - } - return mBlockedScriptLoaders.RemoveElement(aScriptLoader); -} - void ImportLoader::AddLinkElement(nsINode* aNode) { @@ -355,15 +106,14 @@ ImportLoader::AddLinkElement(nsINode* aNode) // refers to an import that is already finished loading or // stopped trying, we need to fire the corresponding event // on it. - mLinks.AppendElement(aNode); - mUpdater.UpdateSpanningTree(aNode); + mLinks.AppendObject(aNode); DispatchEventIfFinished(aNode); } void ImportLoader::RemoveLinkElement(nsINode* aNode) { - mLinks.RemoveElement(aNode); + mLinks.RemoveObject(aNode); } // Events has to be fired with a script runner, so mImport can @@ -409,8 +159,8 @@ void ImportLoader::Done() { mReady = true; - uint32_t l = mLinks.Length(); - for (uint32_t i = 0; i < l; i++) { + uint32_t count = mLinks.Count(); + for (uint32_t i = 0; i < count; i++) { DispatchLoadEvent(mLinks[i]); } UnblockScripts(); @@ -422,8 +172,8 @@ ImportLoader::Error(bool aUnblockScripts) { mDocument = nullptr; mStopped = true; - uint32_t l = mLinks.Length(); - for (uint32_t i = 0; i < l; i++) { + uint32_t count = mLinks.Count(); + for (uint32_t i = 0; i < count; i++) { DispatchErrorEvent(mLinks[i]); } if (aUnblockScripts) { @@ -625,10 +375,6 @@ ImportLoader::OnStartRequest(nsIRequest* aRequest, nsISupports* aContext) nsCOMPtr master = mImportParent->MasterDocument(); mDocument->SetMasterDocument(master); - for (uint32_t i = 0; i < mBlockedScriptLoaders.Length(); i++) { - mDocument->ScriptLoader()->AddPendingChildLoader(mBlockedScriptLoaders[i]); - } - // We have to connect the blank document we created with the channel we opened, // and create its own LoadGroup for it. nsCOMPtr listener; @@ -642,25 +388,7 @@ ImportLoader::OnStartRequest(nsIRequest* aRequest, nsISupports* aContext) true); NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_ABORT_ERR); - nsCOMPtr originalURI; - rv = channel->GetOriginalURI(getter_AddRefs(originalURI)); - NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_ABORT_ERR); - - nsCOMPtr URI; - rv = channel->GetURI(getter_AddRefs(URI)); - NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_ABORT_ERR); - MOZ_ASSERT(URI, "URI of a channel should never be null"); - - bool equals; - rv = URI->Equals(originalURI, &equals); - NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_ABORT_ERR); - - if (!equals) { - // In case of a redirection we must add the new URI to the import map. - Manager()->AddLoaderWithNewURI(this, URI); - } - - // Let's start the parser. + // Let's start parser. mParserStreamListener = listener; rv = listener->OnStartRequest(aRequest, aContext); NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_ABORT_ERR); @@ -669,10 +397,6 @@ ImportLoader::OnStartRequest(nsIRequest* aRequest, nsISupports* aContext) return NS_OK; } -//----------------------------------------------------------------------------- -// ImportManager -//----------------------------------------------------------------------------- - NS_IMPL_CYCLE_COLLECTION(ImportManager, mImports) @@ -690,78 +414,16 @@ ImportManager::Get(nsIURI* aURI, nsINode* aNode, nsIDocument* aOrigDocument) // and start it up. nsRefPtr loader; mImports.Get(aURI, getter_AddRefs(loader)); - bool needToStart = false; + if (!loader) { loader = new ImportLoader(aURI, aOrigDocument); mImports.Put(aURI, loader); - needToStart = true; - } - - MOZ_ASSERT(loader); - // Let's keep track of the sub imports links in each document. It will - // be used later for scrip execution order calculation. (see UpdateSpanningTree) - // NOTE: removing and adding back the link to the tree somewhere else will - // NOT have an effect on script execution order. - if (!aOrigDocument->HasSubImportLink(aNode)) { - aOrigDocument->AddSubImportLink(aNode); - } - - loader->AddLinkElement(aNode); - - if (needToStart) { loader->Open(); } - + loader->AddLinkElement(aNode); + MOZ_ASSERT(loader); return loader.forget(); } -ImportLoader* -ImportManager::Find(nsIDocument* aImport) -{ - return mImports.GetWeak(aImport->GetDocumentURIObject()); -} - -ImportLoader* -ImportManager::Find(nsINode* aLink) -{ - HTMLLinkElement* linkElement = static_cast(aLink); - nsCOMPtr uri = linkElement->GetHrefURI(); - return mImports.GetWeak(uri); -} - -void -ImportManager::AddLoaderWithNewURI(ImportLoader* aLoader, nsIURI* aNewURI) -{ - mImports.Put(aNewURI, aLoader); -} - -nsRefPtr ImportManager::GetNearestPredecessor(nsINode* aNode) -{ - // Return the previous link if there is any in the same document. - nsIDocument* doc = aNode->OwnerDoc(); - int32_t idx = doc->IndexOfSubImportLink(aNode); - MOZ_ASSERT(idx != -1, "aNode must be a sub import link of its owner document"); - if (idx == 0) { - if (doc->IsMasterDocument()) { - // If there is no previous one, and it was the master document, then - // there is no predecessor. - return nullptr; - } - // Else we find the main referrer of the import parent of the link's document. - // And do a recursion. - ImportLoader* owner = Find(doc); - MOZ_ASSERT(owner); - nsCOMPtr mainReferrer = owner->GetMainReferrer(); - return GetNearestPredecessor(mainReferrer); - } - MOZ_ASSERT(idx > 0); - HTMLLinkElement* link = - static_cast(doc->GetSubImportLink(idx - 1)); - nsCOMPtr uri = link->GetHrefURI(); - nsRefPtr ret; - mImports.Get(uri, getter_AddRefs(ret)); - return ret; -} - } // namespace dom } // namespace mozilla diff --git a/content/base/src/ImportManager.h b/content/base/src/ImportManager.h index 4ce97ebc8e4..ba619941804 100644 --- a/content/base/src/ImportManager.h +++ b/content/base/src/ImportManager.h @@ -39,13 +39,12 @@ #ifndef mozilla_dom_ImportManager_h__ #define mozilla_dom_ImportManager_h__ -#include "nsTArray.h" +#include "nsCOMArray.h" #include "nsCycleCollectionParticipant.h" #include "nsIDOMEventListener.h" #include "nsIStreamListener.h" #include "nsIWeakReferenceUtils.h" #include "nsRefPtrHashtable.h" -#include "nsScriptLoader.h" #include "nsURIHashKey.h" class nsIDocument; @@ -59,70 +58,11 @@ namespace dom { class ImportManager; -typedef nsTHashtable> NodeTable; - class ImportLoader MOZ_FINAL : public nsIStreamListener , public nsIDOMEventListener { - - // A helper inner class to decouple the logic of updating the import graph - // after a new import link has been found by one of the parsers. - class Updater { - - public: - Updater(ImportLoader* aLoader) : mLoader(aLoader) - {} - - // After a new link is added that refers to this import, we - // have to update the spanning tree, since given this new link the - // priority of this import might be higher in the scripts - // execution order than before. It updates mMainReferrer, mImportParent, - // the corresponding pending ScriptRunners, etc. - // It also handles updating additional dependant loaders via the - // UpdateDependants calls. - // (NOTE: See GetMainReferrer about spanning tree.) - void UpdateSpanningTree(nsINode* aNode); - - private: - // Returns an array of links that forms a referring chain from - // the master document to this import. Each link in the array - // is marked as main referrer in the list. - void GetReferrerChain(nsINode* aNode, nsTArray& aResult); - - // Once we find a new referrer path to our import, we have to see if - // it changes the load order hence we have to do an update on the graph. - bool ShouldUpdate(nsTArray& aNewPath); - void UpdateMainReferrer(uint32_t newIdx); - - // It's a depth first graph traversal algorithm, for UpdateDependants. The - // nodes in the graph are the import link elements, and there is a directed - // edge from link1 to link2 if link2 is a subimport in the import document - // of link1. - // If the ImportLoader that aCurrentLink points to didn't need to be updated - // the algorithm skips its "children" (subimports). Note, that this graph can - // also contain cycles, aVisistedLinks is used to track the already visited - // links to avoid an infinite loop. - // aPath - (in/out) the referrer link chain of aCurrentLink when called, and - // of the next link when the function returns - // aVisitedLinks - (in/out) list of links that the traversal already visited - // (to handle cycles in the graph) - // aSkipChildren - when aCurrentLink points to an import that did not need - // to be updated, we can skip its sub-imports ('children') - nsINode* NextDependant(nsINode* aCurrentLink, - nsTArray& aPath, - NodeTable& aVisitedLinks, bool aSkipChildren); - - // When we find a new link that changes the load order of the known imports, - // we also have to check all the subimports of it, to see if they need an - // update too. (see test_imports_nested_2.html) - void UpdateDependants(nsINode* aNode, nsTArray& aPath); - - ImportLoader* mLoader; - }; - friend class ::AutoError; friend class ImportManager; - friend class Updater; public: ImportLoader(nsIURI* aURI, nsIDocument* aOriginDocument); @@ -143,46 +83,11 @@ public: bool IsReady() { return mReady; } bool IsStopped() { return mStopped; } bool IsBlocking() { return mBlockingScripts; } - - ImportManager* Manager() { - MOZ_ASSERT(mDocument || mImportParent, "One of them should be always set"); - return (mDocument ? mDocument : mImportParent)->ImportManager(); - } - - // Simply getter for the import document. Can return a partially parsed - // document if called too early. - nsIDocument* GetDocument() + already_AddRefed GetImport() { - return mDocument; + return mReady ? nsCOMPtr(mDocument).forget() : nullptr; } - // Getter for the import document that is used in the spec. Returns - // nullptr if the import is not yet ready. - nsIDocument* GetImport() - { - return mReady ? mDocument : nullptr; - } - - // There is only one referring link that is marked as primary link per - // imports. This is the one that has to be taken into account when - // scrip execution order is determined. Links marked as primary link form - // a spanning tree in the import graph. (Eliminating the cycles and - // multiple parents.) This spanning tree is recalculated every time - // a new import link is added to the manager. - nsINode* GetMainReferrer() - { - return mLinks.IsEmpty() ? nullptr : mLinks[mMainReferrer]; - } - - // An import is not only blocked by its import children, but also - // by its predecessors. It's enough to find the closest predecessor - // and wait for that to run its scripts. We keep track of all the - // ScriptRunners that are waiting for this import. NOTE: updating - // the main referrer might change this list. - void AddBlockedScriptLoader(nsScriptLoader* aScriptLoader); - bool RemoveBlockedScriptLoader(nsScriptLoader* aScriptLoader); - void SetBlockingPredecessor(ImportLoader* aLoader); - private: ~ImportLoader() {} @@ -217,25 +122,12 @@ private: nsCOMPtr mURI; nsCOMPtr mParserStreamListener; nsCOMPtr mImportParent; - ImportLoader* mBlockingPredecessor; - // List of the LinkElements that are referring to this import // we need to keep track of them so we can fire event on them. - nsTArray> mLinks; - - // List of pending ScriptLoaders that are waiting for this import - // to finish. - nsTArray> mBlockedScriptLoaders; - - // There is always exactly one referrer link that is flagged as - // the main referrer the primary link. This is the one that is - // used in the script execution order calculation. - // ("Branch" according to the spec.) - uint32_t mMainReferrer; + nsCOMArray mLinks; bool mReady; bool mStopped; bool mBlockingScripts; - Updater mUpdater; }; class ImportManager MOZ_FINAL : public nsISupports @@ -250,24 +142,9 @@ public: NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_CLASS(ImportManager) - // Finds the ImportLoader that belongs to aImport in the map. - ImportLoader* Find(nsIDocument* aImport); - - // Find the ImportLoader aLink refers to. - ImportLoader* Find(nsINode* aLink); - - void AddLoaderWithNewURI(ImportLoader* aLoader, nsIURI* aNewURI); - - // When a new import link is added, this getter either creates - // a new ImportLoader for it, or returns an existing one if - // it was already created and in the import map. already_AddRefed Get(nsIURI* aURI, nsINode* aNode, nsIDocument* aOriginDocument); - // It finds the predecessor for an import link node that runs its - // scripts the latest among its predecessors. - nsRefPtr GetNearestPredecessor(nsINode* aNode); - private: ImportMap mImports; }; diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 5d084cbffb8..d8c6248d3ff 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -1972,8 +1972,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsDocument) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOnDemandBuiltInUASheets) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPreloadingImages) - NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSubImportLinks) - for (uint32_t i = 0; i < tmp->mFrameRequestCallbacks.Length(); ++i) { NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mFrameRequestCallbacks[i]"); cb.NoteXPCOMChild(tmp->mFrameRequestCallbacks[i].mCallback.GetISupports()); @@ -2038,7 +2036,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDocument) NS_IMPL_CYCLE_COLLECTION_UNLINK(mRegistry) NS_IMPL_CYCLE_COLLECTION_UNLINK(mMasterDocument) NS_IMPL_CYCLE_COLLECTION_UNLINK(mImportManager) - NS_IMPL_CYCLE_COLLECTION_UNLINK(mSubImportLinks) tmp->mParentDocument = nullptr; diff --git a/content/base/src/nsDocument.h b/content/base/src/nsDocument.h index d8f57773e62..34f13f21740 100644 --- a/content/base/src/nsDocument.h +++ b/content/base/src/nsDocument.h @@ -1291,10 +1291,10 @@ public: mozilla::ErrorResult& rv) MOZ_OVERRIDE; virtual void UseRegistryFromDocument(nsIDocument* aDocument) MOZ_OVERRIDE; - virtual nsIDocument* MasterDocument() + virtual already_AddRefed MasterDocument() { - return mMasterDocument ? mMasterDocument.get() - : this; + return mMasterDocument ? (nsCOMPtr(mMasterDocument)).forget() + : (nsCOMPtr(this)).forget(); } virtual void SetMasterDocument(nsIDocument* master) @@ -1307,11 +1307,11 @@ public: return !mMasterDocument; } - virtual mozilla::dom::ImportManager* ImportManager() + virtual already_AddRefed ImportManager() { if (mImportManager) { MOZ_ASSERT(!mMasterDocument, "Only the master document has ImportManager set"); - return mImportManager.get(); + return nsRefPtr(mImportManager).forget(); } if (mMasterDocument) { @@ -1323,28 +1323,7 @@ public: // master document and this is the first import in it. // Let's create a new manager. mImportManager = new mozilla::dom::ImportManager(); - return mImportManager.get(); - } - - virtual bool HasSubImportLink(nsINode* aLink) - { - return mSubImportLinks.Contains(aLink); - } - - virtual uint32_t IndexOfSubImportLink(nsINode* aLink) - { - return mSubImportLinks.IndexOf(aLink); - } - - virtual void AddSubImportLink(nsINode* aLink) - { - mSubImportLinks.AppendElement(aLink); - } - - virtual nsINode* GetSubImportLink(uint32_t aIdx) - { - return aIdx < mSubImportLinks.Length() ? mSubImportLinks[aIdx].get() - : nullptr; + return nsRefPtr(mImportManager).forget(); } virtual void UnblockDOMContentLoaded() MOZ_OVERRIDE; @@ -1770,7 +1749,6 @@ private: nsCOMPtr mMasterDocument; nsRefPtr mImportManager; - nsTArray > mSubImportLinks; // Set to true when the document is possibly controlled by the ServiceWorker. // Used to prevent multiple requests to ServiceWorkerManager. diff --git a/content/base/src/nsScriptLoader.cpp b/content/base/src/nsScriptLoader.cpp index 4cf1758ba23..2ddb1ed827f 100644 --- a/content/base/src/nsScriptLoader.cpp +++ b/content/base/src/nsScriptLoader.cpp @@ -49,7 +49,6 @@ #include "nsSandboxFlags.h" #include "nsContentTypeParser.h" #include "nsINetworkPredictor.h" -#include "ImportManager.h" #include "mozilla/dom/EncodingUtils.h" #include "mozilla/CORSMode.h" @@ -1228,7 +1227,7 @@ nsScriptLoader::ReadyToExecuteScripts() if (!SelfReadyToExecuteScripts()) { return false; } - + for (nsIDocument* doc = mDocument; doc; doc = doc->GetParentDocument()) { nsScriptLoader* ancestor = doc->ScriptLoader(); if (!ancestor->SelfReadyToExecuteScripts() && @@ -1238,44 +1237,10 @@ nsScriptLoader::ReadyToExecuteScripts() } } - if (!mDocument->IsMasterDocument()) { - nsRefPtr im = mDocument->ImportManager(); - nsRefPtr loader = im->Find(mDocument); - MOZ_ASSERT(loader, "How can we have an import document without a loader?"); - - // The referring link that counts in the execution order calculation - // (in spec: flagged as branch) - nsCOMPtr referrer = loader->GetMainReferrer(); - MOZ_ASSERT(referrer, "There has to be a main referring link for each imports"); - - // Import documents are blocked by their import predecessors. We need to - // wait with script execution until all the predecessors are done. - // Technically it means we have to wait for the last one to finish, - // which is the neares one to us in the order. - nsRefPtr lastPred = im->GetNearestPredecessor(referrer); - if (!lastPred) { - // If there is no predecessor we can run. - return true; - } - - nsCOMPtr doc = lastPred->GetDocument(); - if (!doc || (doc && !doc->ScriptLoader()->SelfReadyToExecuteScripts())) { - // Document has not been created yet or it was created but not ready. - // Either case we are blocked by it. The ImportLoader will take care - // of blocking us, and adding the pending child loader to the blocking - // ScriptLoader when it's possible (at this point the blocking loader - // might not have created the document/ScriptLoader) - lastPred->AddBlockedScriptLoader(this); - // As more imports are parsed, this can change, let's cache what we - // blocked, so it can be later updated if needed (see: ImportLoader::Updater). - loader->SetBlockingPredecessor(lastPred); - return false; - } - } - return true; } + // This function was copied from nsParser.cpp. It was simplified a bit. static bool DetectByteOrderMark(const unsigned char* aBytes, int32_t aLen, nsCString& oCharset) diff --git a/content/base/src/nsScriptLoader.h b/content/base/src/nsScriptLoader.h index 200af7c37ef..19fad0ce51f 100644 --- a/content/base/src/nsScriptLoader.h +++ b/content/base/src/nsScriptLoader.h @@ -249,14 +249,6 @@ public: nsresult ProcessOffThreadRequest(nsScriptLoadRequest *aRequest, void **aOffThreadToken); - bool AddPendingChildLoader(nsScriptLoader* aChild) { - return mPendingChildLoaders.AppendElement(aChild) != nullptr; - } - - bool RemovePendingChildLoader(nsScriptLoader* aLoader) { - return mPendingChildLoaders.RemoveElement(aLoader); - } - private: virtual ~nsScriptLoader(); @@ -310,6 +302,10 @@ private: return mEnabled && !mBlockerCount; } + bool AddPendingChildLoader(nsScriptLoader* aChild) { + return mPendingChildLoaders.AppendElement(aChild) != nullptr; + } + nsresult AttemptAsyncScriptParse(nsScriptLoadRequest* aRequest); nsresult ProcessRequest(nsScriptLoadRequest* aRequest, void **aOffThreadToken = nullptr); diff --git a/content/html/content/moz.build b/content/html/content/moz.build index 7318432f13a..140507dd712 100644 --- a/content/html/content/moz.build +++ b/content/html/content/moz.build @@ -8,7 +8,6 @@ DIRS += ['public', 'src'] MOCHITEST_MANIFESTS += [ 'test/forms/mochitest.ini', - 'test/imports/mochitest.ini', 'test/mochitest.ini', ] diff --git a/content/html/content/src/HTMLLinkElement.cpp b/content/html/content/src/HTMLLinkElement.cpp index 33c594aaf44..81a9934c870 100644 --- a/content/html/content/src/HTMLLinkElement.cpp +++ b/content/html/content/src/HTMLLinkElement.cpp @@ -264,6 +264,15 @@ HTMLLinkElement::UpdateImport() return; } + // Until the script execution order is not sorted out for nested cases + // let's not allow them. + if (!doc->IsMasterDocument()) { + nsContentUtils::LogSimpleConsoleError( + NS_LITERAL_STRING("Nested imports are not supported yet"), + "Imports"); + return; + } + // 2. rel type should be import. nsAutoString rel; GetAttr(kNameSpaceID_None, nsGkAtoms::rel, rel); @@ -518,7 +527,7 @@ HTMLLinkElement::WrapNode(JSContext* aCx) already_AddRefed HTMLLinkElement::GetImport() { - return mImportLoader ? nsRefPtr(mImportLoader->GetImport()).forget() : nullptr; + return mImportLoader ? mImportLoader->GetImport() : nullptr; } } // namespace dom diff --git a/content/html/content/test/imports/file_importA1.html b/content/html/content/test/imports/file_importA1.html deleted file mode 100644 index ecce6f06123..00000000000 --- a/content/html/content/test/imports/file_importA1.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/content/html/content/test/imports/file_importA2.html b/content/html/content/test/imports/file_importA2.html deleted file mode 100644 index d03e80a4b41..00000000000 --- a/content/html/content/test/imports/file_importA2.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/content/html/content/test/imports/file_importB1.html b/content/html/content/test/imports/file_importB1.html deleted file mode 100644 index 82fb55f9f61..00000000000 --- a/content/html/content/test/imports/file_importB1.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/content/html/content/test/imports/file_importB2.html b/content/html/content/test/imports/file_importB2.html deleted file mode 100644 index 01b6cc21584..00000000000 --- a/content/html/content/test/imports/file_importB2.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/content/html/content/test/imports/file_importC1.html b/content/html/content/test/imports/file_importC1.html deleted file mode 100644 index 9ac117e65c9..00000000000 --- a/content/html/content/test/imports/file_importC1.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/content/html/content/test/imports/file_importC10.html b/content/html/content/test/imports/file_importC10.html deleted file mode 100644 index 801d0f08557..00000000000 --- a/content/html/content/test/imports/file_importC10.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/content/html/content/test/imports/file_importC2.html b/content/html/content/test/imports/file_importC2.html deleted file mode 100644 index f0193be4499..00000000000 --- a/content/html/content/test/imports/file_importC2.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/content/html/content/test/imports/file_importC3.html b/content/html/content/test/imports/file_importC3.html deleted file mode 100644 index eb942b707f5..00000000000 --- a/content/html/content/test/imports/file_importC3.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/content/html/content/test/imports/file_importC4.html b/content/html/content/test/imports/file_importC4.html deleted file mode 100644 index 5a172772ad9..00000000000 --- a/content/html/content/test/imports/file_importC4.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/content/html/content/test/imports/file_importC5.html b/content/html/content/test/imports/file_importC5.html deleted file mode 100644 index c29dc24ba06..00000000000 --- a/content/html/content/test/imports/file_importC5.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/content/html/content/test/imports/file_importC6.html b/content/html/content/test/imports/file_importC6.html deleted file mode 100644 index a53b62bb45e..00000000000 --- a/content/html/content/test/imports/file_importC6.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/content/html/content/test/imports/file_importC7.html b/content/html/content/test/imports/file_importC7.html deleted file mode 100644 index 1c7d60114e0..00000000000 --- a/content/html/content/test/imports/file_importC7.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/content/html/content/test/imports/file_importC8.html b/content/html/content/test/imports/file_importC8.html deleted file mode 100644 index 04bef617d39..00000000000 --- a/content/html/content/test/imports/file_importC8.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/content/html/content/test/imports/file_importC9.html b/content/html/content/test/imports/file_importC9.html deleted file mode 100644 index 1a27497557f..00000000000 --- a/content/html/content/test/imports/file_importC9.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/content/html/content/test/imports/file_importD.html b/content/html/content/test/imports/file_importD.html deleted file mode 100644 index a4fbda536dd..00000000000 --- a/content/html/content/test/imports/file_importD.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/content/html/content/test/imports/file_importE.html b/content/html/content/test/imports/file_importE.html deleted file mode 100644 index 6a8792acf2a..00000000000 --- a/content/html/content/test/imports/file_importE.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/content/html/content/test/imports/mochitest.ini b/content/html/content/test/imports/mochitest.ini deleted file mode 100644 index c1a863ea848..00000000000 --- a/content/html/content/test/imports/mochitest.ini +++ /dev/null @@ -1,20 +0,0 @@ -[DEFAULT] -support-files = - file_importA1.html - file_importA2.html - file_importB1.html - file_importB2.html - file_importC1.html - file_importC2.html - file_importC3.html - file_importC4.html - file_importC5.html - file_importC6.html - file_importC7.html - file_importC8.html - file_importC9.html - file_importC10.html - file_importD.html - file_importE.html - - diff --git a/content/html/content/test/mochitest.ini b/content/html/content/test/mochitest.ini index 4c8fc83edbd..df5499d15c1 100644 --- a/content/html/content/test/mochitest.ini +++ b/content/html/content/test/mochitest.ini @@ -462,8 +462,6 @@ skip-if = buildapp == 'b2g' || e10s # b2g(multiple concurrent window.open()s fai [test_imports_basics.html] [test_imports_redirect.html] [test_imports_nonhttp.html] -[test_imports_nested.html] -[test_imports_nested_2.html] [test_li_attributes_reflection.html] [test_link_attributes_reflection.html] [test_link_sizes.html] diff --git a/content/html/content/test/test_imports_nested.html b/content/html/content/test/test_imports_nested.html deleted file mode 100644 index d6320884c44..00000000000 --- a/content/html/content/test/test_imports_nested.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - Test for Bug 877072 - - - - - - Mozilla Bug 877072 - - - - - - - - - - \ No newline at end of file diff --git a/content/html/content/test/test_imports_nested_2.html b/content/html/content/test/test_imports_nested_2.html deleted file mode 100644 index d5ff7278845..00000000000 --- a/content/html/content/test/test_imports_nested_2.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - Test for Bug 877072 - - - - - - Mozilla Bug 877072 - - - - - - - - - - - - \ No newline at end of file From 52c39a7ffcd8e6ffcb77a4670d7236922698302f Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Tue, 2 Sep 2014 09:44:54 -0400 Subject: [PATCH 43/66] Bug 1061048 - Fix some bad impliciti constructors in profiler; r=BenWa --- tools/profiler/AutoObjectMapper.h | 2 +- tools/profiler/JSStreamWriter.h | 2 +- tools/profiler/ProfilerBacktrace.h | 2 +- tools/profiler/ProfilerMarkers.h | 4 ++-- tools/profiler/TableTicker.cpp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/profiler/AutoObjectMapper.h b/tools/profiler/AutoObjectMapper.h index e1a3c4afbe1..1f813d6f282 100644 --- a/tools/profiler/AutoObjectMapper.h +++ b/tools/profiler/AutoObjectMapper.h @@ -23,7 +23,7 @@ public: // call Map() to attempt the mapping. There is no corresponding // Unmap() since the unmapping is done in the destructor. Failure // messages are sent to |aLog|. - AutoObjectMapperPOSIX(void(*aLog)(const char*)); + explicit AutoObjectMapperPOSIX(void(*aLog)(const char*)); // Unmap the file on destruction of this object. ~AutoObjectMapperPOSIX(); diff --git a/tools/profiler/JSStreamWriter.h b/tools/profiler/JSStreamWriter.h index 02bd79ff6f4..e55e2e15f78 100644 --- a/tools/profiler/JSStreamWriter.h +++ b/tools/profiler/JSStreamWriter.h @@ -13,7 +13,7 @@ class JSStreamWriter { public: - JSStreamWriter(std::ostream& aStream); + explicit JSStreamWriter(std::ostream& aStream); ~JSStreamWriter(); void BeginObject(); diff --git a/tools/profiler/ProfilerBacktrace.h b/tools/profiler/ProfilerBacktrace.h index 9ae7d4dda41..209b81f3a84 100644 --- a/tools/profiler/ProfilerBacktrace.h +++ b/tools/profiler/ProfilerBacktrace.h @@ -12,7 +12,7 @@ class SyncProfile; class ProfilerBacktrace { public: - ProfilerBacktrace(SyncProfile* aProfile); + explicit ProfilerBacktrace(SyncProfile* aProfile); ~ProfilerBacktrace(); void StreamJSObject(JSStreamWriter& b); diff --git a/tools/profiler/ProfilerMarkers.h b/tools/profiler/ProfilerMarkers.h index 7fcc6433032..fc561e52c01 100644 --- a/tools/profiler/ProfilerMarkers.h +++ b/tools/profiler/ProfilerMarkers.h @@ -28,7 +28,7 @@ public: /** * ProfilerMarkerPayload takes ownership of aStack */ - ProfilerMarkerPayload(ProfilerBacktrace* aStack = nullptr); + explicit ProfilerMarkerPayload(ProfilerBacktrace* aStack = nullptr); ProfilerMarkerPayload(const mozilla::TimeStamp& aStartTime, const mozilla::TimeStamp& aEndTime, ProfilerBacktrace* aStack = nullptr); @@ -91,7 +91,7 @@ private: class ProfilerMarkerImagePayload : public ProfilerMarkerPayload { public: - ProfilerMarkerImagePayload(gfxASurface *aImg); + explicit ProfilerMarkerImagePayload(gfxASurface *aImg); protected: virtual void diff --git a/tools/profiler/TableTicker.cpp b/tools/profiler/TableTicker.cpp index c14ddc0827a..43b64a9cf87 100644 --- a/tools/profiler/TableTicker.cpp +++ b/tools/profiler/TableTicker.cpp @@ -184,7 +184,7 @@ JSObject* TableTicker::ToJSObject(JSContext *aCx) } struct SubprocessClosure { - SubprocessClosure(JSStreamWriter *aWriter) + explicit SubprocessClosure(JSStreamWriter *aWriter) : mWriter(aWriter) {} From fc2212dc466effec1995cd19f6ad9d8669111e64 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Tue, 2 Sep 2014 09:45:28 -0400 Subject: [PATCH 44/66] Bug 1061248 - Fix some bad implicit constructors in LUL; r=BenWa --- tools/profiler/LulCommon.cpp | 2 +- tools/profiler/LulMain.cpp | 4 ++-- tools/profiler/LulMain.h | 4 ++-- tools/profiler/LulMainInt.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/profiler/LulCommon.cpp b/tools/profiler/LulCommon.cpp index 86c3e500e58..9664230ee3c 100644 --- a/tools/profiler/LulCommon.cpp +++ b/tools/profiler/LulCommon.cpp @@ -72,7 +72,7 @@ Module::~Module() { // class UniqueString { public: - UniqueString(string str) { str_ = strdup(str.c_str()); } + explicit UniqueString(string str) { str_ = strdup(str.c_str()); } ~UniqueString() { free(reinterpret_cast(const_cast(str_))); } const char* str_; }; diff --git a/tools/profiler/LulMain.cpp b/tools/profiler/LulMain.cpp index 6e6c1d235f1..0384afc8f48 100644 --- a/tools/profiler/LulMain.cpp +++ b/tools/profiler/LulMain.cpp @@ -490,7 +490,7 @@ class SegArray { class PriMap { public: - PriMap(void (*aLog)(const char*)) + explicit PriMap(void (*aLog)(const char*)) : mLog(aLog) {} @@ -838,7 +838,7 @@ class PriMap { class CFICache { public: - CFICache(PriMap* aPriMap) { + explicit CFICache(PriMap* aPriMap) { Invalidate(); mPriMap = aPriMap; } diff --git a/tools/profiler/LulMain.h b/tools/profiler/LulMain.h index ec84d43882d..ac97a908f9f 100644 --- a/tools/profiler/LulMain.h +++ b/tools/profiler/LulMain.h @@ -60,7 +60,7 @@ namespace lul { class TaggedUWord { public: // Construct a valid one. - TaggedUWord(uintptr_t w) + explicit TaggedUWord(uintptr_t w) : mValue(w) , mValid(true) {} @@ -165,7 +165,7 @@ class CFICache; class LUL { public: // Create; supply a logging sink. Initialises the rw-lock. - LUL(void (*aLog)(const char*)); + explicit LUL(void (*aLog)(const char*)); // Destroy. This acquires mRWlock for writing. By doing that, waits // for all unwinder threads to finish any Unwind() calls they may be diff --git a/tools/profiler/LulMainInt.h b/tools/profiler/LulMainInt.h index 16cd391ab9f..5b795d65933 100644 --- a/tools/profiler/LulMainInt.h +++ b/tools/profiler/LulMainInt.h @@ -223,7 +223,7 @@ public: // so let's use mSummaryMinAddr == 1 and mSummaryMaxAddr == 0 to denote // this case. - SecMap(void(*aLog)(const char*)); + explicit SecMap(void(*aLog)(const char*)); ~SecMap(); // Binary search mRuleSets to find one that brackets |ia|, or nullptr From 178da73c35f8612c7d87556d448237aae7270547 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Tue, 2 Sep 2014 09:46:06 -0400 Subject: [PATCH 45/66] Bug 1061253 - Fix more bad implicit constructors in widget; r=roc --- widget/gtk/nsGtkIMModule.h | 2 +- widget/gtk/nsGtkKeyUtils.h | 2 +- widget/gtk/nsSound.cpp | 2 +- widget/gtk/nsWindow.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/widget/gtk/nsGtkIMModule.h b/widget/gtk/nsGtkIMModule.h index 7127c832bd3..42139c5f299 100644 --- a/widget/gtk/nsGtkIMModule.h +++ b/widget/gtk/nsGtkIMModule.h @@ -54,7 +54,7 @@ public: // aOwnerWindow is a pointer of the owner window. When aOwnerWindow is // destroyed, the related IME contexts are released (i.e., IME cannot be // used with the instance after that). - nsGtkIMModule(nsWindow* aOwnerWindow); + explicit nsGtkIMModule(nsWindow* aOwnerWindow); ~nsGtkIMModule(); // "Enabled" means the users can use all IMEs. diff --git a/widget/gtk/nsGtkKeyUtils.h b/widget/gtk/nsGtkKeyUtils.h index e519b5dea76..721f152f20d 100644 --- a/widget/gtk/nsGtkKeyUtils.h +++ b/widget/gtk/nsGtkKeyUtils.h @@ -157,7 +157,7 @@ protected: guint mHardwareKeycode; guint mMask; - ModifierKey(guint aHardwareKeycode) : + explicit ModifierKey(guint aHardwareKeycode) : mHardwareKeycode(aHardwareKeycode), mMask(0) { } diff --git a/widget/gtk/nsSound.cpp b/widget/gtk/nsSound.cpp index 7135603d0cd..62fc1676f85 100644 --- a/widget/gtk/nsSound.cpp +++ b/widget/gtk/nsSound.cpp @@ -69,7 +69,7 @@ static ca_proplist_sets_fn ca_proplist_sets; static ca_context_play_full_fn ca_context_play_full; struct ScopedCanberraFile { - ScopedCanberraFile(nsIFile *file): mFile(file) {}; + explicit ScopedCanberraFile(nsIFile *file): mFile(file) {}; ~ScopedCanberraFile() { if (mFile) { diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp index 31fc64bb527..281ff6602cd 100644 --- a/widget/gtk/nsWindow.cpp +++ b/widget/gtk/nsWindow.cpp @@ -294,7 +294,7 @@ protected: typedef pixman_region32 RawRef; nsSimpleRef() { data = nullptr; } - nsSimpleRef(const RawRef &aRawRef) : pixman_region32(aRawRef) { } + explicit nsSimpleRef(const RawRef &aRawRef) : pixman_region32(aRawRef) { } static void Release(pixman_region32& region) { pixman_region32_fini(®ion); From 42db02677e20edd755035b10e66569e81f369179 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Tue, 2 Sep 2014 09:46:56 -0400 Subject: [PATCH 46/66] Bug 1061252 - Fix more bad implicit constructors in media code; r=roc --- content/media/gstreamer/GStreamerMozVideoBuffer.h | 2 +- content/media/gstreamer/GStreamerReader.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/media/gstreamer/GStreamerMozVideoBuffer.h b/content/media/gstreamer/GStreamerMozVideoBuffer.h index 28aab6f8125..e9295771edb 100644 --- a/content/media/gstreamer/GStreamerMozVideoBuffer.h +++ b/content/media/gstreamer/GStreamerMozVideoBuffer.h @@ -40,7 +40,7 @@ GstMozVideoBufferData* gst_moz_video_buffer_get_data(const GstMozVideoBuffer* bu class GstMozVideoBufferData { public: - GstMozVideoBufferData(layers::PlanarYCbCrImage* aImage) : mImage(aImage) {} + explicit GstMozVideoBufferData(layers::PlanarYCbCrImage* aImage) : mImage(aImage) {} static void* Copy(void* aData) { return new GstMozVideoBufferData(reinterpret_cast(aData)->mImage); diff --git a/content/media/gstreamer/GStreamerReader.h b/content/media/gstreamer/GStreamerReader.h index 430fc3e0737..c2a14dc5a9f 100644 --- a/content/media/gstreamer/GStreamerReader.h +++ b/content/media/gstreamer/GStreamerReader.h @@ -38,7 +38,7 @@ class GStreamerReader : public MediaDecoderReader typedef gfx::IntRect IntRect; public: - GStreamerReader(AbstractMediaDecoder* aDecoder); + explicit GStreamerReader(AbstractMediaDecoder* aDecoder); virtual ~GStreamerReader(); virtual nsresult Init(MediaDecoderReader* aCloneDonor); From 2e7a1f5631342dd7bd0b1bf2d033dc5d3b1deae4 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Tue, 2 Sep 2014 09:47:43 -0400 Subject: [PATCH 47/66] Bug 1061250 - Fix more bad implicit constructors in graphics; r=roc --- gfx/layers/basic/X11BasicCompositor.h | 2 +- gfx/layers/ipc/ShadowLayerUtilsX11.h | 2 +- gfx/thebes/gfxFT2Utils.h | 2 +- gfx/thebes/gfxFontconfigUtils.h | 10 +++++----- gfx/thebes/gfxPangoFonts.cpp | 4 ++-- gfx/thebes/gfxXlibSurface.cpp | 2 +- gfx/thebes/gfxXlibSurface.h | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/gfx/layers/basic/X11BasicCompositor.h b/gfx/layers/basic/X11BasicCompositor.h index 1ee1bc34e4e..b01192c2915 100644 --- a/gfx/layers/basic/X11BasicCompositor.h +++ b/gfx/layers/basic/X11BasicCompositor.h @@ -45,7 +45,7 @@ class X11BasicCompositor : public BasicCompositor { public: - X11BasicCompositor(nsIWidget *aWidget) : BasicCompositor(aWidget) {} + explicit X11BasicCompositor(nsIWidget *aWidget) : BasicCompositor(aWidget) {} virtual TemporaryRef CreateDataTextureSource(TextureFlags aFlags = TextureFlags::NO_FLAGS) MOZ_OVERRIDE; diff --git a/gfx/layers/ipc/ShadowLayerUtilsX11.h b/gfx/layers/ipc/ShadowLayerUtilsX11.h index a3910171031..2970b1489a7 100644 --- a/gfx/layers/ipc/ShadowLayerUtilsX11.h +++ b/gfx/layers/ipc/ShadowLayerUtilsX11.h @@ -31,7 +31,7 @@ struct SurfaceDescriptorX11 { SurfaceDescriptorX11() { } - SurfaceDescriptorX11(gfxXlibSurface* aSurf); + explicit SurfaceDescriptorX11(gfxXlibSurface* aSurf); SurfaceDescriptorX11(Drawable aDrawable, XID aFormatID, const gfx::IntSize& aSize); diff --git a/gfx/thebes/gfxFT2Utils.h b/gfx/thebes/gfxFT2Utils.h index cb5f79af8f5..c41d007c32b 100644 --- a/gfx/thebes/gfxFT2Utils.h +++ b/gfx/thebes/gfxFT2Utils.h @@ -22,7 +22,7 @@ typedef struct FT_FaceRec_* FT_Face; class gfxFT2LockedFace { public: - gfxFT2LockedFace(gfxFT2FontBase *aFont) : + explicit gfxFT2LockedFace(gfxFT2FontBase *aFont) : mGfxFont(aFont), mFace(cairo_ft_scaled_font_lock_face(aFont->CairoScaledFont())) { } diff --git a/gfx/thebes/gfxFontconfigUtils.h b/gfx/thebes/gfxFontconfigUtils.h index 6e5e271d530..588d919bcd4 100644 --- a/gfx/thebes/gfxFontconfigUtils.h +++ b/gfx/thebes/gfxFontconfigUtils.h @@ -173,7 +173,7 @@ public: // nullptr. The caller of PutEntry() must fill in mKey when nullptr. // This provides a mechanism for the caller of PutEntry() to determine // whether the entry has been initialized. - DepFcStrEntry(KeyTypePointer aName) + explicit DepFcStrEntry(KeyTypePointer aName) : mKey(nullptr) { } DepFcStrEntry(const DepFcStrEntry& toCopy) @@ -195,7 +195,7 @@ public: // The caller of PutEntry() must call InitKey() when IsKeyInitialized() // returns false. This provides a mechanism for the caller of // PutEntry() to determine whether the entry has been initialized. - CopiedFcStrEntry(KeyTypePointer aName) { + explicit CopiedFcStrEntry(KeyTypePointer aName) { mKey.SetIsVoid(true); } @@ -216,7 +216,7 @@ public: protected: class FontsByFcStrEntry : public DepFcStrEntry { public: - FontsByFcStrEntry(KeyTypePointer aName) + explicit FontsByFcStrEntry(KeyTypePointer aName) : DepFcStrEntry(aName) { } FontsByFcStrEntry(const FontsByFcStrEntry& toCopy) @@ -245,7 +245,7 @@ protected: // nullptr. The caller of PutEntry() is must fill in mKey when adding // the first font if the key is not derived from the family and style. // If the key is derived from family and style, a font must be added. - FontsByFullnameEntry(KeyTypePointer aName) + explicit FontsByFullnameEntry(KeyTypePointer aName) : DepFcStrEntry(aName) { } FontsByFullnameEntry(const FontsByFullnameEntry& toCopy) @@ -269,7 +269,7 @@ protected: class LangSupportEntry : public CopiedFcStrEntry { public: - LangSupportEntry(KeyTypePointer aName) + explicit LangSupportEntry(KeyTypePointer aName) : CopiedFcStrEntry(aName) { } LangSupportEntry(const LangSupportEntry& toCopy) diff --git a/gfx/thebes/gfxPangoFonts.cpp b/gfx/thebes/gfxPangoFonts.cpp index 4a031cb03d6..9bb70e5a70b 100644 --- a/gfx/thebes/gfxPangoFonts.cpp +++ b/gfx/thebes/gfxPangoFonts.cpp @@ -124,7 +124,7 @@ public: } protected: - gfxFcFontEntry(const nsAString& aName) + explicit gfxFcFontEntry(const nsAString& aName) : gfxFontEntry(aName) { } @@ -326,7 +326,7 @@ gfxSystemFcFontEntry::ReleaseGrFace(gr_face* aFace) class gfxUserFcFontEntry : public gfxFcFontEntry { protected: - gfxUserFcFontEntry(const gfxProxyFontEntry &aProxyEntry) + explicit gfxUserFcFontEntry(const gfxProxyFontEntry &aProxyEntry) : gfxFcFontEntry(aProxyEntry.Name()) { mItalic = aProxyEntry.mItalic; diff --git a/gfx/thebes/gfxXlibSurface.cpp b/gfx/thebes/gfxXlibSurface.cpp index 393c212307d..b954e6a2f62 100644 --- a/gfx/thebes/gfxXlibSurface.cpp +++ b/gfx/thebes/gfxXlibSurface.cpp @@ -331,7 +331,7 @@ private: class DisplayInfo { public: - DisplayInfo(Display* display) : mDisplay(display) { } + explicit DisplayInfo(Display* display) : mDisplay(display) { } Display* mDisplay; nsTArray mColormapEntries; }; diff --git a/gfx/thebes/gfxXlibSurface.h b/gfx/thebes/gfxXlibSurface.h index 1b1c111718d..765777f8433 100644 --- a/gfx/thebes/gfxXlibSurface.h +++ b/gfx/thebes/gfxXlibSurface.h @@ -32,7 +32,7 @@ public: gfxXlibSurface(Screen *screen, Drawable drawable, XRenderPictFormat *format, const gfxIntSize& size); - gfxXlibSurface(cairo_surface_t *csurf); + explicit gfxXlibSurface(cairo_surface_t *csurf); // create a new Pixmap and wrapper surface. // |relatedDrawable| provides a hint to the server for determining whether From 68727749e7cc33be8aa739fcf67cf2e664889b72 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Tue, 2 Sep 2014 09:48:27 -0400 Subject: [PATCH 48/66] Bug 1061274 - Do not pass a non-POD object to a variadic function in nsTextStore::MouseTracker::UnadviseSink; r=masayuki clang-cl treats this as a fatal error, but MSVC seems fine with it. --- widget/windows/nsTextStore.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/widget/windows/nsTextStore.cpp b/widget/windows/nsTextStore.cpp index 3902b1619e3..51b231b252b 100644 --- a/widget/windows/nsTextStore.cpp +++ b/widget/windows/nsTextStore.cpp @@ -4827,7 +4827,7 @@ nsTextStore::MouseTracker::UnadviseSink() PR_LOG(sTextStoreLog, PR_LOG_DEBUG, ("TSF: 0x%p nsTextStore::MouseTracker::UnadviseSink(), " "mCookie=%d, mSink=0x%p, mStart=%d, mLength=%d", - this, mCookie, mSink, mStart, mLength)); + this, mCookie, mSink.get(), mStart, mLength)); mSink = nullptr; mStart = mLength = -1; } From 6a15123539f2ce9a752d1ad0a11b58cc79bbd7c3 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Tue, 2 Sep 2014 09:49:03 -0400 Subject: [PATCH 49/66] Bug 1060986 - Fix one bad implicit constructors in devtools; r=jryans --- toolkit/devtools/security/LocalCertService.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolkit/devtools/security/LocalCertService.cpp b/toolkit/devtools/security/LocalCertService.cpp index 7276ff16d90..05f52e50247 100644 --- a/toolkit/devtools/security/LocalCertService.cpp +++ b/toolkit/devtools/security/LocalCertService.cpp @@ -25,7 +25,7 @@ namespace mozilla { class LocalCertTask : public CryptoTask { protected: - LocalCertTask(const nsACString& aNickname) + explicit LocalCertTask(const nsACString& aNickname) : mNickname(aNickname) { } From 3be29fea36fd4b81aa3ffa17ab77c4c0158dd806 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Tue, 2 Sep 2014 09:49:38 -0400 Subject: [PATCH 50/66] Bug 1061052 - Fix more bad implicit constructors in netwerk; r=mcmanus --- netwerk/cache2/CacheStorageService.cpp | 2 +- netwerk/streamconv/converters/nsMultiMixedConv.cpp | 4 ++-- netwerk/streamconv/converters/nsUnknownDecoder.h | 2 +- netwerk/test/TestProtocols.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/netwerk/cache2/CacheStorageService.cpp b/netwerk/cache2/CacheStorageService.cpp index d67bd8554a0..c140ef72a80 100644 --- a/netwerk/cache2/CacheStorageService.cpp +++ b/netwerk/cache2/CacheStorageService.cpp @@ -1621,7 +1621,7 @@ CacheStorageService::DoomStorageEntry(CacheStorage const* aStorage, class Callback : public nsRunnable { public: - Callback(nsICacheEntryDoomCallback* aCallback) : mCallback(aCallback) { } + explicit Callback(nsICacheEntryDoomCallback* aCallback) : mCallback(aCallback) { } NS_IMETHODIMP Run() { mCallback->OnCacheEntryDoomed(NS_ERROR_NOT_AVAILABLE); diff --git a/netwerk/streamconv/converters/nsMultiMixedConv.cpp b/netwerk/streamconv/converters/nsMultiMixedConv.cpp index a3694e1a156..c68cfac0a37 100644 --- a/netwerk/streamconv/converters/nsMultiMixedConv.cpp +++ b/netwerk/streamconv/converters/nsMultiMixedConv.cpp @@ -460,7 +460,7 @@ class AutoFree public: AutoFree() : mBuffer(nullptr) {} - AutoFree(char *buffer) : mBuffer(buffer) {} + explicit AutoFree(char *buffer) : mBuffer(buffer) {} ~AutoFree() { free(mBuffer); @@ -488,7 +488,7 @@ nsMultiMixedConv::OnDataAvailable(nsIRequest *request, nsISupports *context, return NS_ERROR_FAILURE; nsresult rv = NS_OK; - AutoFree buffer = nullptr; + AutoFree buffer(nullptr); uint32_t bufLen = 0, read = 0; NS_ASSERTION(request, "multimixed converter needs a request"); diff --git a/netwerk/streamconv/converters/nsUnknownDecoder.h b/netwerk/streamconv/converters/nsUnknownDecoder.h index ed2f40bddf8..894a6dc2021 100644 --- a/netwerk/streamconv/converters/nsUnknownDecoder.h +++ b/netwerk/streamconv/converters/nsUnknownDecoder.h @@ -50,7 +50,7 @@ protected: class ConvertedStreamListener: public nsIStreamListener { public: - ConvertedStreamListener(nsUnknownDecoder *aDecoder); + explicit ConvertedStreamListener(nsUnknownDecoder *aDecoder); NS_DECL_ISUPPORTS NS_DECL_NSIREQUESTOBSERVER diff --git a/netwerk/test/TestProtocols.cpp b/netwerk/test/TestProtocols.cpp index 79a3ee1dd1f..c87a2b5f4a9 100644 --- a/netwerk/test/TestProtocols.cpp +++ b/netwerk/test/TestProtocols.cpp @@ -194,7 +194,7 @@ class URLLoadInfo : public nsISupports public: - URLLoadInfo(const char* aUrl); + explicit URLLoadInfo(const char* aUrl); // ISupports interface... NS_DECL_THREADSAFE_ISUPPORTS From 099393be66a44b0df6fe27422cf8f096d2875faa Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Tue, 2 Sep 2014 09:50:07 -0400 Subject: [PATCH 51/66] Bug 1060973 - Fix more bad implicit constructors in XPCOM; r=froydnj --- xpcom/glue/pldhash.h | 2 +- xpcom/threads/SyncRunnable.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xpcom/glue/pldhash.h b/xpcom/glue/pldhash.h index 47d0feedda6..c37aa30ad8e 100644 --- a/xpcom/glue/pldhash.h +++ b/xpcom/glue/pldhash.h @@ -279,7 +279,7 @@ public: */ class Iterator { public: - Iterator(const PLDHashTable* aTable); + explicit Iterator(const PLDHashTable* aTable); Iterator(const Iterator& aIterator); ~Iterator(); bool HasMoreEntries() const; diff --git a/xpcom/threads/SyncRunnable.h b/xpcom/threads/SyncRunnable.h index f84cd218b86..b0681a4fd54 100644 --- a/xpcom/threads/SyncRunnable.h +++ b/xpcom/threads/SyncRunnable.h @@ -31,7 +31,7 @@ namespace mozilla { class SyncRunnable : public nsRunnable { public: - SyncRunnable(nsIRunnable* aRunnable) + explicit SyncRunnable(nsIRunnable* aRunnable) : mRunnable(aRunnable) , mMonitor("SyncRunnable") , mDone(false) From dc91a09eec6360294a3ca4bd1f982554e8199a20 Mon Sep 17 00:00:00 2001 From: Simon Montagu Date: Tue, 2 Sep 2014 17:05:58 +0300 Subject: [PATCH 52/66] Bug 1058021 patch 1: bring encoding/decoding tests in line with w3c tests and the Encoding Standard. r=annevk --- intl/uconv/tests/unit/test_decode_CP1250.js | 10 +++++----- intl/uconv/tests/unit/test_decode_CP1251.js | 10 +++++----- intl/uconv/tests/unit/test_decode_CP1252.js | 10 +++++----- intl/uconv/tests/unit/test_decode_CP1253.js | 10 +++++----- intl/uconv/tests/unit/test_decode_CP1254.js | 10 +++++----- intl/uconv/tests/unit/test_decode_CP1255.js | 10 +++++----- intl/uconv/tests/unit/test_decode_CP1256.js | 6 +++--- intl/uconv/tests/unit/test_decode_CP1257.js | 10 +++++----- intl/uconv/tests/unit/test_decode_CP1258.js | 10 +++++----- intl/uconv/tests/unit/test_decode_CP874.js | 10 +++++----- intl/uconv/tests/unit/test_encode_CP1250.js | 8 ++++---- intl/uconv/tests/unit/test_encode_CP1251.js | 10 +++++----- intl/uconv/tests/unit/test_encode_CP1252.js | 10 +++++----- intl/uconv/tests/unit/test_encode_CP1253.js | 8 ++++---- intl/uconv/tests/unit/test_encode_CP1254.js | 10 +++++----- intl/uconv/tests/unit/test_encode_CP1255.js | 10 +++++----- intl/uconv/tests/unit/test_encode_CP1256.js | 6 +++--- intl/uconv/tests/unit/test_encode_CP1257.js | 8 ++++---- intl/uconv/tests/unit/test_encode_CP1258.js | 8 ++++---- intl/uconv/tests/unit/test_encode_CP874.js | 10 +++++----- 20 files changed, 92 insertions(+), 92 deletions(-) diff --git a/intl/uconv/tests/unit/test_decode_CP1250.js b/intl/uconv/tests/unit/test_decode_CP1250.js index c179b6d57df..6eff6d990d9 100644 --- a/intl/uconv/tests/unit/test_decode_CP1250.js +++ b/intl/uconv/tests/unit/test_decode_CP1250.js @@ -1,10 +1,10 @@ // Tests conversion from windows-1250 to Unicode - + load('CharsetConversionTests.js'); - -const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x82\x84\x85\x86\x87\x89\x8a\x8b\x8c\x8d\x8e\x8f\x91\x92\x93\x94\x95\x96\x97\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; - -const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u201a\u201e\u2026\u2020\u2021\u2030\u0160\u2039\u015a\u0164\u017d\u0179\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u2122\u0161\u203a\u015b\u0165\u017e\u017a\u00a0\u02c7\u02d8\u0141\u00a4\u0104\u00a6\u00a7\u00a8\u00a9\u015e\u00ab\u00ac\u00ad\u00ae\u017b\u00b0\u00b1\u02db\u0142\u00b4\u00b5\u00b6\u00b7\u00b8\u0105\u015f\u00bb\u013d\u02dd\u013e\u017c\u0154\u00c1\u00c2\u0102\u00c4\u0139\u0106\u00c7\u010c\u00c9\u0118\u00cb\u011a\u00cd\u00ce\u010e\u0110\u0143\u0147\u00d3\u00d4\u0150\u00d6\u00d7\u0158\u016e\u00da\u0170\u00dc\u00dd\u0162\u00df\u0155\u00e1\u00e2\u0103\u00e4\u013a\u0107\u00e7\u010d\u00e9\u0119\u00eb\u011b\u00ed\u00ee\u010f\u0111\u0144\u0148\u00f3\u00f4\u0151\u00f6\u00f7\u0159\u016f\u00fa\u0171\u00fc\u00fd\u0163\u02d9"; + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u0081\u201a\u0083\u201e\u2026\u2020\u2021\u0088\u2030\u0160\u2039\u015a\u0164\u017d\u0179\u0090\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u0098\u2122\u0161\u203a\u015b\u0165\u017e\u017a\u00a0\u02c7\u02d8\u0141\u00a4\u0104\u00a6\u00a7\u00a8\u00a9\u015e\u00ab\u00ac\u00ad\u00ae\u017b\u00b0\u00b1\u02db\u0142\u00b4\u00b5\u00b6\u00b7\u00b8\u0105\u015f\u00bb\u013d\u02dd\u013e\u017c\u0154\u00c1\u00c2\u0102\u00c4\u0139\u0106\u00c7\u010c\u00c9\u0118\u00cb\u011a\u00cd\u00ce\u010e\u0110\u0143\u0147\u00d3\u00d4\u0150\u00d6\u00d7\u0158\u016e\u00da\u0170\u00dc\u00dd\u0162\u00df\u0155\u00e1\u00e2\u0103\u00e4\u013a\u0107\u00e7\u010d\u00e9\u0119\u00eb\u011b\u00ed\u00ee\u010f\u0111\u0144\u0148\u00f3\u00f4\u0151\u00f6\u00f7\u0159\u016f\u00fa\u0171\u00fc\u00fd\u0163\u02d9"; const aliases = [ "windows-1250", "x-cp1250", "cp1250" ]; diff --git a/intl/uconv/tests/unit/test_decode_CP1251.js b/intl/uconv/tests/unit/test_decode_CP1251.js index 2c9f5449e2f..186943b8f17 100644 --- a/intl/uconv/tests/unit/test_decode_CP1251.js +++ b/intl/uconv/tests/unit/test_decode_CP1251.js @@ -1,10 +1,10 @@ // Tests conversion from windows-1251 to Unicode - + load('CharsetConversionTests.js'); - -const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; - -const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0402\u0403\u201a\u0453\u201e\u2026\u2020\u2021\u20ac\u2030\u0409\u2039\u040a\u040c\u040b\u040f\u0452\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u2122\u0459\u203a\u045a\u045c\u045b\u045f\u00a0\u040e\u045e\u0408\u00a4\u0490\u00a6\u00a7\u0401\u00a9\u0404\u00ab\u00ac\u00ad\u00ae\u0407\u00b0\u00b1\u0406\u0456\u0491\u00b5\u00b6\u00b7\u0451\u2116\u0454\u00bb\u0458\u0405\u0455\u0457\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041a\u041b\u041c\u041d\u041e\u041f\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042a\u042b\u042c\u042d\u042e\u042f\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043a\u043b\u043c\u043d\u043e\u043f\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044a\u044b\u044c\u044d\u044e\u044f"; + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0402\u0403\u201a\u0453\u201e\u2026\u2020\u2021\u20ac\u2030\u0409\u2039\u040a\u040c\u040b\u040f\u0452\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u0098\u2122\u0459\u203a\u045a\u045c\u045b\u045f\u00a0\u040e\u045e\u0408\u00a4\u0490\u00a6\u00a7\u0401\u00a9\u0404\u00ab\u00ac\u00ad\u00ae\u0407\u00b0\u00b1\u0406\u0456\u0491\u00b5\u00b6\u00b7\u0451\u2116\u0454\u00bb\u0458\u0405\u0455\u0457\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041a\u041b\u041c\u041d\u041e\u041f\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042a\u042b\u042c\u042d\u042e\u042f\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043a\u043b\u043c\u043d\u043e\u043f\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044a\u044b\u044c\u044d\u044e\u044f"; const aliases = [ "windows-1251", "x-cp1251", "cp1251" ]; diff --git a/intl/uconv/tests/unit/test_decode_CP1252.js b/intl/uconv/tests/unit/test_decode_CP1252.js index 4c303360266..bca21e81fba 100644 --- a/intl/uconv/tests/unit/test_decode_CP1252.js +++ b/intl/uconv/tests/unit/test_decode_CP1252.js @@ -1,10 +1,10 @@ // Tests conversion from windows-1252 to Unicode - + load('CharsetConversionTests.js'); - -const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8e\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; - -const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u201a\u0192\u201e\u2026\u2020\u2021\u02c6\u2030\u0160\u2039\u0152\u017d\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u02dc\u2122\u0161\u203a\u0153\u017e\u0178\u00a0\u00a1\u00a2\u00a3\u00a4\u00a5\u00a6\u00a7\u00a8\u00a9\u00aa\u00ab\u00ac\u00ad\u00ae\u00af\u00b0\u00b1\u00b2\u00b3\u00b4\u00b5\u00b6\u00b7\u00b8\u00b9\u00ba\u00bb\u00bc\u00bd\u00be\u00bf\u00c0\u00c1\u00c2\u00c3\u00c4\u00c5\u00c6\u00c7\u00c8\u00c9\u00ca\u00cb\u00cc\u00cd\u00ce\u00cf\u00d0\u00d1\u00d2\u00d3\u00d4\u00d5\u00d6\u00d7\u00d8\u00d9\u00da\u00db\u00dc\u00dd\u00de\u00df\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5\u00e6\u00e7\u00e8\u00e9\u00ea\u00eb\u00ec\u00ed\u00ee\u00ef\u00f0\u00f1\u00f2\u00f3\u00f4\u00f5\u00f6\u00f7\u00f8\u00f9\u00fa\u00fb\u00fc\u00fd\u00fe\u00ff"; + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u0081\u201a\u0192\u201e\u2026\u2020\u2021\u02c6\u2030\u0160\u2039\u0152\u008d\u017d\u008f\u0090\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u02dc\u2122\u0161\u203a\u0153\u009d\u017e\u0178\u00a0\u00a1\u00a2\u00a3\u00a4\u00a5\u00a6\u00a7\u00a8\u00a9\u00aa\u00ab\u00ac\u00ad\u00ae\u00af\u00b0\u00b1\u00b2\u00b3\u00b4\u00b5\u00b6\u00b7\u00b8\u00b9\u00ba\u00bb\u00bc\u00bd\u00be\u00bf\u00c0\u00c1\u00c2\u00c3\u00c4\u00c5\u00c6\u00c7\u00c8\u00c9\u00ca\u00cb\u00cc\u00cd\u00ce\u00cf\u00d0\u00d1\u00d2\u00d3\u00d4\u00d5\u00d6\u00d7\u00d8\u00d9\u00da\u00db\u00dc\u00dd\u00de\u00df\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5\u00e6\u00e7\u00e8\u00e9\u00ea\u00eb\u00ec\u00ed\u00ee\u00ef\u00f0\u00f1\u00f2\u00f3\u00f4\u00f5\u00f6\u00f7\u00f8\u00f9\u00fa\u00fb\u00fc\u00fd\u00fe\u00ff"; const aliases = [ "windows-1252", "x-cp1252", "cp1252" ]; diff --git a/intl/uconv/tests/unit/test_decode_CP1253.js b/intl/uconv/tests/unit/test_decode_CP1253.js index a4268ea4f03..e68d966be97 100644 --- a/intl/uconv/tests/unit/test_decode_CP1253.js +++ b/intl/uconv/tests/unit/test_decode_CP1253.js @@ -1,10 +1,10 @@ // Tests conversion from windows-1253 to Unicode - + load('CharsetConversionTests.js'); - -const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x82\x83\x84\x85\x86\x87\x89\x8b\x91\x92\x93\x94\x95\x96\x97\x99\x9b\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe"; - -const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u201a\u0192\u201e\u2026\u2020\u2021\u2030\u2039\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u2122\u203a\u00a0\u0385\u0386\u00a3\u00a4\u00a5\u00a6\u00a7\u00a8\u00a9\u00ab\u00ac\u00ad\u00ae\u2015\u00b0\u00b1\u00b2\u00b3\u0384\u00b5\u00b6\u00b7\u0388\u0389\u038a\u00bb\u038c\u00bd\u038e\u038f\u0390\u0391\u0392\u0393\u0394\u0395\u0396\u0397\u0398\u0399\u039a\u039b\u039c\u039d\u039e\u039f\u03a0\u03a1\u03a3\u03a4\u03a5\u03a6\u03a7\u03a8\u03a9\u03aa\u03ab\u03ac\u03ad\u03ae\u03af\u03b0\u03b1\u03b2\u03b3\u03b4\u03b5\u03b6\u03b7\u03b8\u03b9\u03ba\u03bb\u03bc\u03bd\u03be\u03bf\u03c0\u03c1\u03c2\u03c3\u03c4\u03c5\u03c6\u03c7\u03c8\u03c9\u03ca\u03cb\u03cc\u03cd\u03ce"; + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u0081\u201a\u0192\u201e\u2026\u2020\u2021\u0088\u2030\u008a\u2039\u008c\u008d\u008e\u008f\u0090\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u0098\u2122\u009a\u203a\u009c\u009d\u009e\u009f\u00a0\u0385\u0386\u00a3\u00a4\u00a5\u00a6\u00a7\u00a8\u00a9\ufffd\u00ab\u00ac\u00ad\u00ae\u2015\u00b0\u00b1\u00b2\u00b3\u0384\u00b5\u00b6\u00b7\u0388\u0389\u038a\u00bb\u038c\u00bd\u038e\u038f\u0390\u0391\u0392\u0393\u0394\u0395\u0396\u0397\u0398\u0399\u039a\u039b\u039c\u039d\u039e\u039f\u03a0\u03a1\ufffd\u03a3\u03a4\u03a5\u03a6\u03a7\u03a8\u03a9\u03aa\u03ab\u03ac\u03ad\u03ae\u03af\u03b0\u03b1\u03b2\u03b3\u03b4\u03b5\u03b6\u03b7\u03b8\u03b9\u03ba\u03bb\u03bc\u03bd\u03be\u03bf\u03c0\u03c1\u03c2\u03c3\u03c4\u03c5\u03c6\u03c7\u03c8\u03c9\u03ca\u03cb\u03cc\u03cd\u03ce\ufffd"; const aliases = [ "windows-1253", "x-cp1253", "cp1253" ]; diff --git a/intl/uconv/tests/unit/test_decode_CP1254.js b/intl/uconv/tests/unit/test_decode_CP1254.js index 232c7ea2617..0654477ff2d 100644 --- a/intl/uconv/tests/unit/test_decode_CP1254.js +++ b/intl/uconv/tests/unit/test_decode_CP1254.js @@ -1,10 +1,10 @@ // Tests conversion from windows-1254 to Unicode - + load('CharsetConversionTests.js'); - -const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; - -const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u201a\u0192\u201e\u2026\u2020\u2021\u02c6\u2030\u0160\u2039\u0152\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u02dc\u2122\u0161\u203a\u0153\u0178\u00a0\u00a1\u00a2\u00a3\u00a4\u00a5\u00a6\u00a7\u00a8\u00a9\u00aa\u00ab\u00ac\u00ad\u00ae\u00af\u00b0\u00b1\u00b2\u00b3\u00b4\u00b5\u00b6\u00b7\u00b8\u00b9\u00ba\u00bb\u00bc\u00bd\u00be\u00bf\u00c0\u00c1\u00c2\u00c3\u00c4\u00c5\u00c6\u00c7\u00c8\u00c9\u00ca\u00cb\u00cc\u00cd\u00ce\u00cf\u011e\u00d1\u00d2\u00d3\u00d4\u00d5\u00d6\u00d7\u00d8\u00d9\u00da\u00db\u00dc\u0130\u015e\u00df\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5\u00e6\u00e7\u00e8\u00e9\u00ea\u00eb\u00ec\u00ed\u00ee\u00ef\u011f\u00f1\u00f2\u00f3\u00f4\u00f5\u00f6\u00f7\u00f8\u00f9\u00fa\u00fb\u00fc\u0131\u015f\u00ff"; + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u0081\u201a\u0192\u201e\u2026\u2020\u2021\u02c6\u2030\u0160\u2039\u0152\u008d\u008e\u008f\u0090\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u02dc\u2122\u0161\u203a\u0153\u009d\u009e\u0178\u00a0\u00a1\u00a2\u00a3\u00a4\u00a5\u00a6\u00a7\u00a8\u00a9\u00aa\u00ab\u00ac\u00ad\u00ae\u00af\u00b0\u00b1\u00b2\u00b3\u00b4\u00b5\u00b6\u00b7\u00b8\u00b9\u00ba\u00bb\u00bc\u00bd\u00be\u00bf\u00c0\u00c1\u00c2\u00c3\u00c4\u00c5\u00c6\u00c7\u00c8\u00c9\u00ca\u00cb\u00cc\u00cd\u00ce\u00cf\u011e\u00d1\u00d2\u00d3\u00d4\u00d5\u00d6\u00d7\u00d8\u00d9\u00da\u00db\u00dc\u0130\u015e\u00df\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5\u00e6\u00e7\u00e8\u00e9\u00ea\u00eb\u00ec\u00ed\u00ee\u00ef\u011f\u00f1\u00f2\u00f3\u00f4\u00f5\u00f6\u00f7\u00f8\u00f9\u00fa\u00fb\u00fc\u0131\u015f\u00ff"; const aliases = [ "windows-1254", "x-cp1254", "cp1254" ]; diff --git a/intl/uconv/tests/unit/test_decode_CP1255.js b/intl/uconv/tests/unit/test_decode_CP1255.js index a3da6ec2c5b..ed81bea635e 100644 --- a/intl/uconv/tests/unit/test_decode_CP1255.js +++ b/intl/uconv/tests/unit/test_decode_CP1255.js @@ -1,10 +1,10 @@ // Tests conversion from windows-1255 to Unicode - + load('CharsetConversionTests.js'); - -const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x82\x83\x84\x85\x86\x87\x88\x89\x8b\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9b\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfd\xfe"; - -const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u201a\u0192\u201e\u2026\u2020\u2021\u02c6\u2030\u2039\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u02dc\u2122\u203a\u00a0\u00a1\u00a2\u00a3\u20aa\u00a5\u00a6\u00a7\u00a8\u00a9\u00d7\u00ab\u00ac\u00ad\u00ae\u00af\u00b0\u00b1\u00b2\u00b3\u00b4\u00b5\u00b6\u00b7\u00b8\u00b9\u00f7\u00bb\u00bc\u00bd\u00be\u00bf\u05b0\u05b1\u05b2\u05b3\u05b4\u05b5\u05b6\u05b7\u05b8\u05b9\u05bb\u05bc\u05bd\u05be\u05bf\u05c0\u05c1\u05c2\u05c3\u05f0\u05f1\u05f2\u05f3\u05f4\u05d0\u05d1\u05d2\u05d3\u05d4\u05d5\u05d6\u05d7\u05d8\u05d9\u05da\u05db\u05dc\u05dd\u05de\u05df\u05e0\u05e1\u05e2\u05e3\u05e4\u05e5\u05e6\u05e7\u05e8\u05e9\u05ea\u200e\u200f"; + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u0081\u201a\u0192\u201e\u2026\u2020\u2021\u02c6\u2030\u008a\u2039\u008c\u008d\u008e\u008f\u0090\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u02dc\u2122\u009a\u203a\u009c\u009d\u009e\u009f\u00a0\u00a1\u00a2\u00a3\u20aa\u00a5\u00a6\u00a7\u00a8\u00a9\u00d7\u00ab\u00ac\u00ad\u00ae\u00af\u00b0\u00b1\u00b2\u00b3\u00b4\u00b5\u00b6\u00b7\u00b8\u00b9\u00f7\u00bb\u00bc\u00bd\u00be\u00bf\u05b0\u05b1\u05b2\u05b3\u05b4\u05b5\u05b6\u05b7\u05b8\u05b9\ufffd\u05bb\u05bc\u05bd\u05be\u05bf\u05c0\u05c1\u05c2\u05c3\u05f0\u05f1\u05f2\u05f3\u05f4\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u05d0\u05d1\u05d2\u05d3\u05d4\u05d5\u05d6\u05d7\u05d8\u05d9\u05da\u05db\u05dc\u05dd\u05de\u05df\u05e0\u05e1\u05e2\u05e3\u05e4\u05e5\u05e6\u05e7\u05e8\u05e9\u05ea\ufffd\ufffd\u200e\u200f\ufffd"; const aliases = [ "windows-1255", "x-cp1255", "cp1255" ]; diff --git a/intl/uconv/tests/unit/test_decode_CP1256.js b/intl/uconv/tests/unit/test_decode_CP1256.js index 85e3e2f59d7..b41e6bc7384 100644 --- a/intl/uconv/tests/unit/test_decode_CP1256.js +++ b/intl/uconv/tests/unit/test_decode_CP1256.js @@ -1,9 +1,9 @@ // Tests conversion from windows-1256 to Unicode - + load('CharsetConversionTests.js'); - + const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; - + const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u067e\u201a\u0192\u201e\u2026\u2020\u2021\u02c6\u2030\u0679\u2039\u0152\u0686\u0698\u0688\u06af\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u06a9\u2122\u0691\u203a\u0153\u200c\u200d\u06ba\u00a0\u060c\u00a2\u00a3\u00a4\u00a5\u00a6\u00a7\u00a8\u00a9\u06be\u00ab\u00ac\u00ad\u00ae\u00af\u00b0\u00b1\u00b2\u00b3\u00b4\u00b5\u00b6\u00b7\u00b8\u00b9\u061b\u00bb\u00bc\u00bd\u00be\u061f\u06c1\u0621\u0622\u0623\u0624\u0625\u0626\u0627\u0628\u0629\u062a\u062b\u062c\u062d\u062e\u062f\u0630\u0631\u0632\u0633\u0634\u0635\u0636\u00d7\u0637\u0638\u0639\u063a\u0640\u0641\u0642\u0643\u00e0\u0644\u00e2\u0645\u0646\u0647\u0648\u00e7\u00e8\u00e9\u00ea\u00eb\u0649\u064a\u00ee\u00ef\u064b\u064c\u064d\u064e\u00f4\u064f\u0650\u00f7\u0651\u00f9\u0652\u00fb\u00fc\u200e\u200f\u06d2"; const aliases = [ "windows-1256", "x-cp1256", "cp1256" ]; diff --git a/intl/uconv/tests/unit/test_decode_CP1257.js b/intl/uconv/tests/unit/test_decode_CP1257.js index 098ea3ec2a8..d8a7ca1d4df 100644 --- a/intl/uconv/tests/unit/test_decode_CP1257.js +++ b/intl/uconv/tests/unit/test_decode_CP1257.js @@ -1,10 +1,10 @@ // Tests conversion from windows-1257 to Unicode - + load('CharsetConversionTests.js'); - -const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x82\x84\x85\x86\x87\x89\x8b\x8d\x8e\x8f\x91\x92\x93\x94\x95\x96\x97\x99\x9b\x9d\x9e\xa0\xa2\xa3\xa4\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; - -const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u201a\u201e\u2026\u2020\u2021\u2030\u2039\u00a8\u02c7\u00b8\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u2122\u203a\u00af\u02db\u00a0\u00a2\u00a3\u00a4\u00a6\u00a7\u00d8\u00a9\u0156\u00ab\u00ac\u00ad\u00ae\u00c6\u00b0\u00b1\u00b2\u00b3\u00b4\u00b5\u00b6\u00b7\u00f8\u00b9\u0157\u00bb\u00bc\u00bd\u00be\u00e6\u0104\u012e\u0100\u0106\u00c4\u00c5\u0118\u0112\u010c\u00c9\u0179\u0116\u0122\u0136\u012a\u013b\u0160\u0143\u0145\u00d3\u014c\u00d5\u00d6\u00d7\u0172\u0141\u015a\u016a\u00dc\u017b\u017d\u00df\u0105\u012f\u0101\u0107\u00e4\u00e5\u0119\u0113\u010d\u00e9\u017a\u0117\u0123\u0137\u012b\u013c\u0161\u0144\u0146\u00f3\u014d\u00f5\u00f6\u00f7\u0173\u0142\u015b\u016b\u00fc\u017c\u017e\u02d9"; + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u0081\u201a\u0083\u201e\u2026\u2020\u2021\u0088\u2030\u008a\u2039\u008c\u00a8\u02c7\u00b8\u0090\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u0098\u2122\u009a\u203a\u009c\u00af\u02db\u009f\u00a0\ufffd\u00a2\u00a3\u00a4\ufffd\u00a6\u00a7\u00d8\u00a9\u0156\u00ab\u00ac\u00ad\u00ae\u00c6\u00b0\u00b1\u00b2\u00b3\u00b4\u00b5\u00b6\u00b7\u00f8\u00b9\u0157\u00bb\u00bc\u00bd\u00be\u00e6\u0104\u012e\u0100\u0106\u00c4\u00c5\u0118\u0112\u010c\u00c9\u0179\u0116\u0122\u0136\u012a\u013b\u0160\u0143\u0145\u00d3\u014c\u00d5\u00d6\u00d7\u0172\u0141\u015a\u016a\u00dc\u017b\u017d\u00df\u0105\u012f\u0101\u0107\u00e4\u00e5\u0119\u0113\u010d\u00e9\u017a\u0117\u0123\u0137\u012b\u013c\u0161\u0144\u0146\u00f3\u014d\u00f5\u00f6\u00f7\u0173\u0142\u015b\u016b\u00fc\u017c\u017e\u02d9"; const aliases = [ "windows-1257", "x-cp1257", "cp1257" ]; diff --git a/intl/uconv/tests/unit/test_decode_CP1258.js b/intl/uconv/tests/unit/test_decode_CP1258.js index 33c214f5a53..99d386c6589 100644 --- a/intl/uconv/tests/unit/test_decode_CP1258.js +++ b/intl/uconv/tests/unit/test_decode_CP1258.js @@ -1,10 +1,10 @@ // Tests conversion from windows-1258 to Unicode - + load('CharsetConversionTests.js'); - -const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x82\x83\x84\x85\x86\x87\x88\x89\x8b\x8c\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9b\x9c\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; - -const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u201a\u0192\u201e\u2026\u2020\u2021\u02c6\u2030\u2039\u0152\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u02dc\u2122\u203a\u0153\u0178\u00a0\u00a1\u00a2\u00a3\u00a4\u00a5\u00a6\u00a7\u00a8\u00a9\u00aa\u00ab\u00ac\u00ad\u00ae\u00af\u00b0\u00b1\u00b2\u00b3\u00b4\u00b5\u00b6\u00b7\u00b8\u00b9\u00ba\u00bb\u00bc\u00bd\u00be\u00bf\u00c0\u00c1\u00c2\u0102\u00c4\u00c5\u00c6\u00c7\u00c8\u00c9\u00ca\u00cb\u0300\u00cd\u00ce\u00cf\u0110\u00d1\u0309\u00d3\u00d4\u01a0\u00d6\u00d7\u00d8\u00d9\u00da\u00db\u00dc\u01af\u0303\u00df\u00e0\u00e1\u00e2\u0103\u00e4\u00e5\u00e6\u00e7\u00e8\u00e9\u00ea\u00eb\u0301\u00ed\u00ee\u00ef\u0111\u00f1\u0323\u00f3\u00f4\u01a1\u00f6\u00f7\u00f8\u00f9\u00fa\u00fb\u00fc\u01b0\u20ab\u00ff"; + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u0081\u201a\u0192\u201e\u2026\u2020\u2021\u02c6\u2030\u008a\u2039\u0152\u008d\u008e\u008f\u0090\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u02dc\u2122\u009a\u203a\u0153\u009d\u009e\u0178\u00a0\u00a1\u00a2\u00a3\u00a4\u00a5\u00a6\u00a7\u00a8\u00a9\u00aa\u00ab\u00ac\u00ad\u00ae\u00af\u00b0\u00b1\u00b2\u00b3\u00b4\u00b5\u00b6\u00b7\u00b8\u00b9\u00ba\u00bb\u00bc\u00bd\u00be\u00bf\u00c0\u00c1\u00c2\u0102\u00c4\u00c5\u00c6\u00c7\u00c8\u00c9\u00ca\u00cb\u0300\u00cd\u00ce\u00cf\u0110\u00d1\u0309\u00d3\u00d4\u01a0\u00d6\u00d7\u00d8\u00d9\u00da\u00db\u00dc\u01af\u0303\u00df\u00e0\u00e1\u00e2\u0103\u00e4\u00e5\u00e6\u00e7\u00e8\u00e9\u00ea\u00eb\u0301\u00ed\u00ee\u00ef\u0111\u00f1\u0323\u00f3\u00f4\u01a1\u00f6\u00f7\u00f8\u00f9\u00fa\u00fb\u00fc\u01b0\u20ab\u00ff"; const aliases = [ "windows-1258", "x-cp1258", "cp1258" ]; diff --git a/intl/uconv/tests/unit/test_decode_CP874.js b/intl/uconv/tests/unit/test_decode_CP874.js index 14a5b25eb39..1bf1f373d5b 100644 --- a/intl/uconv/tests/unit/test_decode_CP874.js +++ b/intl/uconv/tests/unit/test_decode_CP874.js @@ -1,10 +1,10 @@ // Tests conversion from windows-874 to Unicode - + load('CharsetConversionTests.js'); - -const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x85\x91\x92\x93\x94\x95\x96\x97\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb"; - -const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u2026\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u00a0\u0e01\u0e02\u0e03\u0e04\u0e05\u0e06\u0e07\u0e08\u0e09\u0e0a\u0e0b\u0e0c\u0e0d\u0e0e\u0e0f\u0e10\u0e11\u0e12\u0e13\u0e14\u0e15\u0e16\u0e17\u0e18\u0e19\u0e1a\u0e1b\u0e1c\u0e1d\u0e1e\u0e1f\u0e20\u0e21\u0e22\u0e23\u0e24\u0e25\u0e26\u0e27\u0e28\u0e29\u0e2a\u0e2b\u0e2c\u0e2d\u0e2e\u0e2f\u0e30\u0e31\u0e32\u0e33\u0e34\u0e35\u0e36\u0e37\u0e38\u0e39\u0e3a\u0e3f\u0e40\u0e41\u0e42\u0e43\u0e44\u0e45\u0e46\u0e47\u0e48\u0e49\u0e4a\u0e4b\u0e4c\u0e4d\u0e4e\u0e4f\u0e50\u0e51\u0e52\u0e53\u0e54\u0e55\u0e56\u0e57\u0e58\u0e59\u0e5a\u0e5b"; + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u0081\u0082\u0083\u0084\u2026\u0086\u0087\u0088\u0089\u008a\u008b\u008c\u008d\u008e\u008f\u0090\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u0098\u0099\u009a\u009b\u009c\u009d\u009e\u009f\u00a0\u0e01\u0e02\u0e03\u0e04\u0e05\u0e06\u0e07\u0e08\u0e09\u0e0a\u0e0b\u0e0c\u0e0d\u0e0e\u0e0f\u0e10\u0e11\u0e12\u0e13\u0e14\u0e15\u0e16\u0e17\u0e18\u0e19\u0e1a\u0e1b\u0e1c\u0e1d\u0e1e\u0e1f\u0e20\u0e21\u0e22\u0e23\u0e24\u0e25\u0e26\u0e27\u0e28\u0e29\u0e2a\u0e2b\u0e2c\u0e2d\u0e2e\u0e2f\u0e30\u0e31\u0e32\u0e33\u0e34\u0e35\u0e36\u0e37\u0e38\u0e39\u0e3a\ufffd\ufffd\ufffd\ufffd\u0e3f\u0e40\u0e41\u0e42\u0e43\u0e44\u0e45\u0e46\u0e47\u0e48\u0e49\u0e4a\u0e4b\u0e4c\u0e4d\u0e4e\u0e4f\u0e50\u0e51\u0e52\u0e53\u0e54\u0e55\u0e56\u0e57\u0e58\u0e59\u0e5a\u0e5b\ufffd\ufffd\ufffd\ufffd"; const aliases = [ "windows-874", "dos-874" ]; diff --git a/intl/uconv/tests/unit/test_encode_CP1250.js b/intl/uconv/tests/unit/test_encode_CP1250.js index e1fe0a15875..78bd6a947c0 100644 --- a/intl/uconv/tests/unit/test_encode_CP1250.js +++ b/intl/uconv/tests/unit/test_encode_CP1250.js @@ -1,10 +1,10 @@ // Tests conversion from Unicode to windows-1250 load('CharsetConversionTests.js'); - -const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u201a\u201e\u2026\u2020\u2021\u2030\u0160\u2039\u015a\u0164\u017d\u0179\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u2122\u0161\u203a\u015b\u0165\u017e\u017a\u00a0\u02c7\u02d8\u0141\u00a4\u0104\u00a6\u00a7\u00a8\u00a9\u015e\u00ab\u00ac\u00ad\u00ae\u017b\u00b0\u00b1\u02db\u0142\u00b4\u00b5\u00b6\u00b7\u00b8\u0105\u015f\u00bb\u013d\u02dd\u013e\u017c\u0154\u00c1\u00c2\u0102\u00c4\u0139\u0106\u00c7\u010c\u00c9\u0118\u00cb\u011a\u00cd\u00ce\u010e\u0110\u0143\u0147\u00d3\u00d4\u0150\u00d6\u00d7\u0158\u016e\u00da\u0170\u00dc\u00dd\u0162\u00df\u0155\u00e1\u00e2\u0103\u00e4\u013a\u0107\u00e7\u010d\u00e9\u0119\u00eb\u011b\u00ed\u00ee\u010f\u0111\u0144\u0148\u00f3\u00f4\u0151\u00f6\u00f7\u0159\u016f\u00fa\u0171\u00fc\u00fd\u0163\u02d9"; - -const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x82\x84\x85\x86\x87\x89\x8a\x8b\x8c\x8d\x8e\x8f\x91\x92\x93\x94\x95\x96\x97\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u0081\u201a\u0083\u201e\u2026\u2020\u2021\u0088\u2030\u0160\u2039\u015a\u0164\u017d\u0179\u0090\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u0098\u2122\u0161\u203a\u015b\u0165\u017e\u017a\u00a0\u02c7\u02d8\u0141\u00a4\u0104\u00a6\u00a7\u00a8\u00a9\u015e\u00ab\u00ac\u00ad\u00ae\u017b\u00b0\u00b1\u02db\u0142\u00b4\u00b5\u00b6\u00b7\u00b8\u0105\u015f\u00bb\u013d\u02dd\u013e\u017c\u0154\u00c1\u00c2\u0102\u00c4\u0139\u0106\u00c7\u010c\u00c9\u0118\u00cb\u011a\u00cd\u00ce\u010e\u0110\u0143\u0147\u00d3\u00d4\u0150\u00d6\u00d7\u0158\u016e\u00da\u0170\u00dc\u00dd\u0162\u00df\u0155\u00e1\u00e2\u0103\u00e4\u013a\u0107\u00e7\u010d\u00e9\u0119\u00eb\u011b\u00ed\u00ee\u010f\u0111\u0144\u0148\u00f3\u00f4\u0151\u00f6\u00f7\u0159\u016f\u00fa\u0171\u00fc\u00fd\u0163\u02d9"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; const aliases = [ "windows-1250", "x-cp1250", "cp1250" ]; diff --git a/intl/uconv/tests/unit/test_encode_CP1251.js b/intl/uconv/tests/unit/test_encode_CP1251.js index 565b674e036..a8a755e2cd0 100644 --- a/intl/uconv/tests/unit/test_encode_CP1251.js +++ b/intl/uconv/tests/unit/test_encode_CP1251.js @@ -1,10 +1,10 @@ // Tests conversion from Unicode to windows-1251 - + load('CharsetConversionTests.js'); - -const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0402\u0403\u201a\u0453\u201e\u2026\u2020\u2021\u20ac\u2030\u0409\u2039\u040a\u040c\u040b\u040f\u0452\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u2122\u0459\u203a\u045a\u045c\u045b\u045f\u00a0\u040e\u045e\u0408\u00a4\u0490\u00a6\u00a7\u0401\u00a9\u0404\u00ab\u00ac\u00ad\u00ae\u0407\u00b0\u00b1\u0406\u0456\u0491\u00b5\u00b6\u00b7\u0451\u2116\u0454\u00bb\u0458\u0405\u0455\u0457\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041a\u041b\u041c\u041d\u041e\u041f\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042a\u042b\u042c\u042d\u042e\u042f\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043a\u043b\u043c\u043d\u043e\u043f\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044a\u044b\u044c\u044d\u044e\u044f"; - -const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u0402\u0403\u201a\u0453\u201e\u2026\u2020\u2021\u20ac\u2030\u0409\u2039\u040a\u040c\u040b\u040f\u0452\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u0098\u2122\u0459\u203a\u045a\u045c\u045b\u045f\u00a0\u040e\u045e\u0408\u00a4\u0490\u00a6\u00a7\u0401\u00a9\u0404\u00ab\u00ac\u00ad\u00ae\u0407\u00b0\u00b1\u0406\u0456\u0491\u00b5\u00b6\u00b7\u0451\u2116\u0454\u00bb\u0458\u0405\u0455\u0457\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041a\u041b\u041c\u041d\u041e\u041f\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042a\u042b\u042c\u042d\u042e\u042f\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043a\u043b\u043c\u043d\u043e\u043f\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044a\u044b\u044c\u044d\u044e\u044f"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; const aliases = [ "windows-1251", "x-cp1251", "cp1251" ]; diff --git a/intl/uconv/tests/unit/test_encode_CP1252.js b/intl/uconv/tests/unit/test_encode_CP1252.js index 1f4e17c1a44..d3c3441d62a 100644 --- a/intl/uconv/tests/unit/test_encode_CP1252.js +++ b/intl/uconv/tests/unit/test_encode_CP1252.js @@ -1,10 +1,10 @@ // Tests conversion from Unicode to windows-1252 - + load('CharsetConversionTests.js'); - -const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u201a\u0192\u201e\u2026\u2020\u2021\u02c6\u2030\u0160\u2039\u0152\u017d\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u02dc\u2122\u0161\u203a\u0153\u017e\u0178\u00a0\u00a1\u00a2\u00a3\u00a4\u00a5\u00a6\u00a7\u00a8\u00a9\u00aa\u00ab\u00ac\u00ad\u00ae\u00af\u00b0\u00b1\u00b2\u00b3\u00b4\u00b5\u00b6\u00b7\u00b8\u00b9\u00ba\u00bb\u00bc\u00bd\u00be\u00bf\u00c0\u00c1\u00c2\u00c3\u00c4\u00c5\u00c6\u00c7\u00c8\u00c9\u00ca\u00cb\u00cc\u00cd\u00ce\u00cf\u00d0\u00d1\u00d2\u00d3\u00d4\u00d5\u00d6\u00d7\u00d8\u00d9\u00da\u00db\u00dc\u00dd\u00de\u00df\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5\u00e6\u00e7\u00e8\u00e9\u00ea\u00eb\u00ec\u00ed\u00ee\u00ef\u00f0\u00f1\u00f2\u00f3\u00f4\u00f5\u00f6\u00f7\u00f8\u00f9\u00fa\u00fb\u00fc\u00fd\u00fe\u00ff"; - -const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8e\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u0081\u201a\u0192\u201e\u2026\u2020\u2021\u02c6\u2030\u0160\u2039\u0152\u008d\u017d\u008f\u0090\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u02dc\u2122\u0161\u203a\u0153\u009d\u017e\u0178\u00a0\u00a1\u00a2\u00a3\u00a4\u00a5\u00a6\u00a7\u00a8\u00a9\u00aa\u00ab\u00ac\u00ad\u00ae\u00af\u00b0\u00b1\u00b2\u00b3\u00b4\u00b5\u00b6\u00b7\u00b8\u00b9\u00ba\u00bb\u00bc\u00bd\u00be\u00bf\u00c0\u00c1\u00c2\u00c3\u00c4\u00c5\u00c6\u00c7\u00c8\u00c9\u00ca\u00cb\u00cc\u00cd\u00ce\u00cf\u00d0\u00d1\u00d2\u00d3\u00d4\u00d5\u00d6\u00d7\u00d8\u00d9\u00da\u00db\u00dc\u00dd\u00de\u00df\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5\u00e6\u00e7\u00e8\u00e9\u00ea\u00eb\u00ec\u00ed\u00ee\u00ef\u00f0\u00f1\u00f2\u00f3\u00f4\u00f5\u00f6\u00f7\u00f8\u00f9\u00fa\u00fb\u00fc\u00fd\u00fe\u00ff"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; const aliases = [ "windows-1252", "x-cp1252", "cp1252" ]; diff --git a/intl/uconv/tests/unit/test_encode_CP1253.js b/intl/uconv/tests/unit/test_encode_CP1253.js index 2885237308f..ce75d220d30 100644 --- a/intl/uconv/tests/unit/test_encode_CP1253.js +++ b/intl/uconv/tests/unit/test_encode_CP1253.js @@ -1,10 +1,10 @@ // Tests conversion from Unicode to windows-1253 load('CharsetConversionTests.js'); - -const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u201a\u0192\u201e\u2026\u2020\u2021\u2030\u2039\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u2122\u203a\u00a0\u0385\u0386\u00a3\u00a4\u00a5\u00a6\u00a7\u00a8\u00a9\u00ab\u00ac\u00ad\u00ae\u2015\u00b0\u00b1\u00b2\u00b3\u0384\u00b5\u00b6\u00b7\u0388\u0389\u038a\u00bb\u038c\u00bd\u038e\u038f\u0390\u0391\u0392\u0393\u0394\u0395\u0396\u0397\u0398\u0399\u039a\u039b\u039c\u039d\u039e\u039f\u03a0\u03a1\u03a3\u03a4\u03a5\u03a6\u03a7\u03a8\u03a9\u03aa\u03ab\u03ac\u03ad\u03ae\u03af\u03b0\u03b1\u03b2\u03b3\u03b4\u03b5\u03b6\u03b7\u03b8\u03b9\u03ba\u03bb\u03bc\u03bd\u03be\u03bf\u03c0\u03c1\u03c2\u03c3\u03c4\u03c5\u03c6\u03c7\u03c8\u03c9\u03ca\u03cb\u03cc\u03cd\u03ce"; - -const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x82\x83\x84\x85\x86\x87\x89\x8b\x91\x92\x93\x94\x95\x96\x97\x99\x9b\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe"; + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u0081\u201a\u0192\u201e\u2026\u2020\u2021\u0088\u2030\u008a\u2039\u008c\u008d\u008e\u008f\u0090\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u0098\u2122\u009a\u203a\u009c\u009d\u009e\u009f\u00a0\u0385\u0386\u00a3\u00a4\u00a5\u00a6\u00a7\u00a8\u00a9\u00ab\u00ac\u00ad\u00ae\u2015\u00b0\u00b1\u00b2\u00b3\u0384\u00b5\u00b6\u00b7\u0388\u0389\u038a\u00bb\u038c\u00bd\u038e\u038f\u0390\u0391\u0392\u0393\u0394\u0395\u0396\u0397\u0398\u0399\u039a\u039b\u039c\u039d\u039e\u039f\u03a0\u03a1\u03a3\u03a4\u03a5\u03a6\u03a7\u03a8\u03a9\u03aa\u03ab\u03ac\u03ad\u03ae\u03af\u03b0\u03b1\u03b2\u03b3\u03b4\u03b5\u03b6\u03b7\u03b8\u03b9\u03ba\u03bb\u03bc\u03bd\u03be\u03bf\u03c0\u03c1\u03c2\u03c3\u03c4\u03c5\u03c6\u03c7\u03c8\u03c9\u03ca\u03cb\u03cc\u03cd\u03ce"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe"; const aliases = [ "windows-1253", "x-cp1253", "cp1253" ]; diff --git a/intl/uconv/tests/unit/test_encode_CP1254.js b/intl/uconv/tests/unit/test_encode_CP1254.js index 3a91caeadd6..d5fe1ac6a87 100644 --- a/intl/uconv/tests/unit/test_encode_CP1254.js +++ b/intl/uconv/tests/unit/test_encode_CP1254.js @@ -1,10 +1,10 @@ // Tests conversion from Unicode to windows-1254 - + load('CharsetConversionTests.js'); - -const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u201a\u0192\u201e\u2026\u2020\u2021\u02c6\u2030\u0160\u2039\u0152\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u02dc\u2122\u0161\u203a\u0153\u0178\u00a0\u00a1\u00a2\u00a3\u00a4\u00a5\u00a6\u00a7\u00a8\u00a9\u00aa\u00ab\u00ac\u00ad\u00ae\u00af\u00b0\u00b1\u00b2\u00b3\u00b4\u00b5\u00b6\u00b7\u00b8\u00b9\u00ba\u00bb\u00bc\u00bd\u00be\u00bf\u00c0\u00c1\u00c2\u00c3\u00c4\u00c5\u00c6\u00c7\u00c8\u00c9\u00ca\u00cb\u00cc\u00cd\u00ce\u00cf\u011e\u00d1\u00d2\u00d3\u00d4\u00d5\u00d6\u00d7\u00d8\u00d9\u00da\u00db\u00dc\u0130\u015e\u00df\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5\u00e6\u00e7\u00e8\u00e9\u00ea\u00eb\u00ec\u00ed\u00ee\u00ef\u011f\u00f1\u00f2\u00f3\u00f4\u00f5\u00f6\u00f7\u00f8\u00f9\u00fa\u00fb\u00fc\u0131\u015f\u00ff"; - -const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u0081\u201a\u0192\u201e\u2026\u2020\u2021\u02c6\u2030\u0160\u2039\u0152\u008d\u008e\u008f\u0090\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u02dc\u2122\u0161\u203a\u0153\u009d\u009e\u0178\u00a0\u00a1\u00a2\u00a3\u00a4\u00a5\u00a6\u00a7\u00a8\u00a9\u00aa\u00ab\u00ac\u00ad\u00ae\u00af\u00b0\u00b1\u00b2\u00b3\u00b4\u00b5\u00b6\u00b7\u00b8\u00b9\u00ba\u00bb\u00bc\u00bd\u00be\u00bf\u00c0\u00c1\u00c2\u00c3\u00c4\u00c5\u00c6\u00c7\u00c8\u00c9\u00ca\u00cb\u00cc\u00cd\u00ce\u00cf\u011e\u00d1\u00d2\u00d3\u00d4\u00d5\u00d6\u00d7\u00d8\u00d9\u00da\u00db\u00dc\u0130\u015e\u00df\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5\u00e6\u00e7\u00e8\u00e9\u00ea\u00eb\u00ec\u00ed\u00ee\u00ef\u011f\u00f1\u00f2\u00f3\u00f4\u00f5\u00f6\u00f7\u00f8\u00f9\u00fa\u00fb\u00fc\u0131\u015f\u00ff"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; const aliases = [ "windows-1254", "x-cp1254", "cp1254" ]; diff --git a/intl/uconv/tests/unit/test_encode_CP1255.js b/intl/uconv/tests/unit/test_encode_CP1255.js index d1189e22bd0..09654b8b1c1 100644 --- a/intl/uconv/tests/unit/test_encode_CP1255.js +++ b/intl/uconv/tests/unit/test_encode_CP1255.js @@ -1,10 +1,10 @@ // Tests conversion from Unicode to windows-1255 - + load('CharsetConversionTests.js'); - -const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u201a\u0192\u201e\u2026\u2020\u2021\u02c6\u2030\u2039\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u02dc\u2122\u203a\u00a0\u00a1\u00a2\u00a3\u20aa\u00a5\u00a6\u00a7\u00a8\u00a9\u00d7\u00ab\u00ac\u00ad\u00ae\u00af\u00b0\u00b1\u00b2\u00b3\u00b4\u00b5\u00b6\u00b7\u00b8\u00b9\u00f7\u00bb\u00bc\u00bd\u00be\u00bf\u05b0\u05b1\u05b2\u05b3\u05b4\u05b5\u05b6\u05b7\u05b8\u05b9\u05bb\u05bc\u05bd\u05be\u05bf\u05c0\u05c1\u05c2\u05c3\u05f0\u05f1\u05f2\u05f3\u05f4\u05d0\u05d1\u05d2\u05d3\u05d4\u05d5\u05d6\u05d7\u05d8\u05d9\u05da\u05db\u05dc\u05dd\u05de\u05df\u05e0\u05e1\u05e2\u05e3\u05e4\u05e5\u05e6\u05e7\u05e8\u05e9\u05ea\u200e\u200f"; - -const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x82\x83\x84\x85\x86\x87\x88\x89\x8b\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9b\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfd\xfe"; + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u0081\u201a\u0192\u201e\u2026\u2020\u2021\u02c6\u2030\u008a\u2039\u008c\u008d\u008e\u008f\u0090\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u02dc\u2122\u009a\u203a\u009c\u009d\u009e\u009f\u00a0\u00a1\u00a2\u00a3\u20aa\u00a5\u00a6\u00a7\u00a8\u00a9\u00d7\u00ab\u00ac\u00ad\u00ae\u00af\u00b0\u00b1\u00b2\u00b3\u00b4\u00b5\u00b6\u00b7\u00b8\u00b9\u00f7\u00bb\u00bc\u00bd\u00be\u00bf\u05b0\u05b1\u05b2\u05b3\u05b4\u05b5\u05b6\u05b7\u05b8\u05b9\u05bb\u05bc\u05bd\u05be\u05bf\u05c0\u05c1\u05c2\u05c3\u05f0\u05f1\u05f2\u05f3\u05f4\u05d0\u05d1\u05d2\u05d3\u05d4\u05d5\u05d6\u05d7\u05d8\u05d9\u05da\u05db\u05dc\u05dd\u05de\u05df\u05e0\u05e1\u05e2\u05e3\u05e4\u05e5\u05e6\u05e7\u05e8\u05e9\u05ea\u200e\u200f"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfd\xfe"; const aliases = [ "windows-1255", "x-cp1255", "cp1255" ]; diff --git a/intl/uconv/tests/unit/test_encode_CP1256.js b/intl/uconv/tests/unit/test_encode_CP1256.js index b876d27e560..cd8ffb71188 100644 --- a/intl/uconv/tests/unit/test_encode_CP1256.js +++ b/intl/uconv/tests/unit/test_encode_CP1256.js @@ -1,9 +1,9 @@ // Tests conversion from Unicode to windows-1256 - + load('CharsetConversionTests.js'); - + const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u067e\u201a\u0192\u201e\u2026\u2020\u2021\u02c6\u2030\u0679\u2039\u0152\u0686\u0698\u0688\u06af\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u06a9\u2122\u0691\u203a\u0153\u200c\u200d\u06ba\u00a0\u060c\u00a2\u00a3\u00a4\u00a5\u00a6\u00a7\u00a8\u00a9\u06be\u00ab\u00ac\u00ad\u00ae\u00af\u00b0\u00b1\u00b2\u00b3\u00b4\u00b5\u00b6\u00b7\u00b8\u00b9\u061b\u00bb\u00bc\u00bd\u00be\u061f\u06c1\u0621\u0622\u0623\u0624\u0625\u0626\u0627\u0628\u0629\u062a\u062b\u062c\u062d\u062e\u062f\u0630\u0631\u0632\u0633\u0634\u0635\u0636\u00d7\u0637\u0638\u0639\u063a\u0640\u0641\u0642\u0643\u00e0\u0644\u00e2\u0645\u0646\u0647\u0648\u00e7\u00e8\u00e9\u00ea\u00eb\u0649\u064a\u00ee\u00ef\u064b\u064c\u064d\u064e\u00f4\u064f\u0650\u00f7\u0651\u00f9\u0652\u00fb\u00fc\u200e\u200f\u06d2"; - + const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; const aliases = [ "windows-1256", "x-cp1256", "cp1256" ]; diff --git a/intl/uconv/tests/unit/test_encode_CP1257.js b/intl/uconv/tests/unit/test_encode_CP1257.js index 17c52654b1d..602c2cd9499 100644 --- a/intl/uconv/tests/unit/test_encode_CP1257.js +++ b/intl/uconv/tests/unit/test_encode_CP1257.js @@ -1,10 +1,10 @@ // Tests conversion from Unicode to windows-1257 load('CharsetConversionTests.js'); - -const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u201a\u201e\u2026\u2020\u2021\u2030\u2039\u00a8\u02c7\u00b8\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u2122\u203a\u00af\u02db\u00a0\u00a2\u00a3\u00a4\u00a6\u00a7\u00d8\u00a9\u0156\u00ab\u00ac\u00ad\u00ae\u00c6\u00b0\u00b1\u00b2\u00b3\u00b4\u00b5\u00b6\u00b7\u00f8\u00b9\u0157\u00bb\u00bc\u00bd\u00be\u00e6\u0104\u012e\u0100\u0106\u00c4\u00c5\u0118\u0112\u010c\u00c9\u0179\u0116\u0122\u0136\u012a\u013b\u0160\u0143\u0145\u00d3\u014c\u00d5\u00d6\u00d7\u0172\u0141\u015a\u016a\u00dc\u017b\u017d\u00df\u0105\u012f\u0101\u0107\u00e4\u00e5\u0119\u0113\u010d\u00e9\u017a\u0117\u0123\u0137\u012b\u013c\u0161\u0144\u0146\u00f3\u014d\u00f5\u00f6\u00f7\u0173\u0142\u015b\u016b\u00fc\u017c\u017e\u02d9"; - -const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x82\x84\x85\x86\x87\x89\x8b\x8d\x8e\x8f\x91\x92\x93\x94\x95\x96\x97\x99\x9b\x9d\x9e\xa0\xa2\xa3\xa4\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u0081\u201a\u0083\u201e\u2026\u2020\u2021\u0088\u2030\u008a\u2039\u008c\u00a8\u02c7\u00b8\u0090\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u0098\u2122\u009a\u203a\u009c\u00af\u02db\u009f\u00a0\u00a2\u00a3\u00a4\u00a6\u00a7\u00d8\u00a9\u0156\u00ab\u00ac\u00ad\u00ae\u00c6\u00b0\u00b1\u00b2\u00b3\u00b4\u00b5\u00b6\u00b7\u00f8\u00b9\u0157\u00bb\u00bc\u00bd\u00be\u00e6\u0104\u012e\u0100\u0106\u00c4\u00c5\u0118\u0112\u010c\u00c9\u0179\u0116\u0122\u0136\u012a\u013b\u0160\u0143\u0145\u00d3\u014c\u00d5\u00d6\u00d7\u0172\u0141\u015a\u016a\u00dc\u017b\u017d\u00df\u0105\u012f\u0101\u0107\u00e4\u00e5\u0119\u0113\u010d\u00e9\u017a\u0117\u0123\u0137\u012b\u013c\u0161\u0144\u0146\u00f3\u014d\u00f5\u00f6\u00f7\u0173\u0142\u015b\u016b\u00fc\u017c\u017e\u02d9"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa2\xa3\xa4\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; const aliases = [ "windows-1257", "x-cp1257", "cp1257" ]; diff --git a/intl/uconv/tests/unit/test_encode_CP1258.js b/intl/uconv/tests/unit/test_encode_CP1258.js index 60c86143968..8a5945e30c6 100644 --- a/intl/uconv/tests/unit/test_encode_CP1258.js +++ b/intl/uconv/tests/unit/test_encode_CP1258.js @@ -1,10 +1,10 @@ // Tests conversion from Unicode to windows-1258 load('CharsetConversionTests.js'); - -const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u201a\u0192\u201e\u2026\u2020\u2021\u02c6\u2030\u2039\u0152\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u02dc\u2122\u203a\u0153\u0178\u00a0\u00a1\u00a2\u00a3\u00a4\u00a5\u00a6\u00a7\u00a8\u00a9\u00aa\u00ab\u00ac\u00ad\u00ae\u00af\u00b0\u00b1\u00b2\u00b3\u00b4\u00b5\u00b6\u00b7\u00b8\u00b9\u00ba\u00bb\u00bc\u00bd\u00be\u00bf\u00c0\u00c1\u00c2\u0102\u00c4\u00c5\u00c6\u00c7\u00c8\u00c9\u00ca\u00cb\u0300\u00cd\u00ce\u00cf\u0110\u00d1\u0309\u00d3\u00d4\u01a0\u00d6\u00d7\u00d8\u00d9\u00da\u00db\u00dc\u01af\u0303\u00df\u00e0\u00e1\u00e2\u0103\u00e4\u00e5\u00e6\u00e7\u00e8\u00e9\u00ea\u00eb\u0301\u00ed\u00ee\u00ef\u0111\u00f1\u0323\u00f3\u00f4\u01a1\u00f6\u00f7\u00f8\u00f9\u00fa\u00fb\u00fc\u01b0\u20ab\u00ff"; - -const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x82\x83\x84\x85\x86\x87\x88\x89\x8b\x8c\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9b\x9c\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u0081\u201a\u0192\u201e\u2026\u2020\u2021\u02c6\u2030\u008a\u2039\u0152\u008d\u008e\u008f\u0090\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u02dc\u2122\u009a\u203a\u0153\u009d\u009e\u0178\u00a0\u00a1\u00a2\u00a3\u00a4\u00a5\u00a6\u00a7\u00a8\u00a9\u00aa\u00ab\u00ac\u00ad\u00ae\u00af\u00b0\u00b1\u00b2\u00b3\u00b4\u00b5\u00b6\u00b7\u00b8\u00b9\u00ba\u00bb\u00bc\u00bd\u00be\u00bf\u00c0\u00c1\u00c2\u0102\u00c4\u00c5\u00c6\u00c7\u00c8\u00c9\u00ca\u00cb\u0300\u00cd\u00ce\u00cf\u0110\u00d1\u0309\u00d3\u00d4\u01a0\u00d6\u00d7\u00d8\u00d9\u00da\u00db\u00dc\u01af\u0303\u00df\u00e0\u00e1\u00e2\u0103\u00e4\u00e5\u00e6\u00e7\u00e8\u00e9\u00ea\u00eb\u0301\u00ed\u00ee\u00ef\u0111\u00f1\u0323\u00f3\u00f4\u01a1\u00f6\u00f7\u00f8\u00f9\u00fa\u00fb\u00fc\u01b0\u20ab\u00ff"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"; const aliases = [ "windows-1258", "x-cp1258", "cp1258" ]; diff --git a/intl/uconv/tests/unit/test_encode_CP874.js b/intl/uconv/tests/unit/test_encode_CP874.js index 834c7a3ae9e..11350238876 100644 --- a/intl/uconv/tests/unit/test_encode_CP874.js +++ b/intl/uconv/tests/unit/test_encode_CP874.js @@ -1,10 +1,10 @@ // Tests conversion from Unicode to windows-874 - + load('CharsetConversionTests.js'); - -const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u2026\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u00a0\u0e01\u0e02\u0e03\u0e04\u0e05\u0e06\u0e07\u0e08\u0e09\u0e0a\u0e0b\u0e0c\u0e0d\u0e0e\u0e0f\u0e10\u0e11\u0e12\u0e13\u0e14\u0e15\u0e16\u0e17\u0e18\u0e19\u0e1a\u0e1b\u0e1c\u0e1d\u0e1e\u0e1f\u0e20\u0e21\u0e22\u0e23\u0e24\u0e25\u0e26\u0e27\u0e28\u0e29\u0e2a\u0e2b\u0e2c\u0e2d\u0e2e\u0e2f\u0e30\u0e31\u0e32\u0e33\u0e34\u0e35\u0e36\u0e37\u0e38\u0e39\u0e3a\u0e3f\u0e40\u0e41\u0e42\u0e43\u0e44\u0e45\u0e46\u0e47\u0e48\u0e49\u0e4a\u0e4b\u0e4c\u0e4d\u0e4e\u0e4f\u0e50\u0e51\u0e52\u0e53\u0e54\u0e55\u0e56\u0e57\u0e58\u0e59\u0e5a\u0e5b"; - -const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x85\x91\x92\x93\x94\x95\x96\x97\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb"; + +const inString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u20ac\u0081\u0082\u0083\u0084\u2026\u0086\u0087\u0088\u0089\u008a\u008b\u008c\u008d\u008e\u008f\u0090\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u0098\u0099\u009a\u009b\u009c\u009d\u009e\u009f\u00a0\u0e01\u0e02\u0e03\u0e04\u0e05\u0e06\u0e07\u0e08\u0e09\u0e0a\u0e0b\u0e0c\u0e0d\u0e0e\u0e0f\u0e10\u0e11\u0e12\u0e13\u0e14\u0e15\u0e16\u0e17\u0e18\u0e19\u0e1a\u0e1b\u0e1c\u0e1d\u0e1e\u0e1f\u0e20\u0e21\u0e22\u0e23\u0e24\u0e25\u0e26\u0e27\u0e28\u0e29\u0e2a\u0e2b\u0e2c\u0e2d\u0e2e\u0e2f\u0e30\u0e31\u0e32\u0e33\u0e34\u0e35\u0e36\u0e37\u0e38\u0e39\u0e3a\u0e3f\u0e40\u0e41\u0e42\u0e43\u0e44\u0e45\u0e46\u0e47\u0e48\u0e49\u0e4a\u0e4b\u0e4c\u0e4d\u0e4e\u0e4f\u0e50\u0e51\u0e52\u0e53\u0e54\u0e55\u0e56\u0e57\u0e58\u0e59\u0e5a\u0e5b"; + +const expectedString = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb"; const aliases = [ "windows-874", "dos-874" ]; From 0817f5efc9b9b80e7f852c65be14af422475433c Mon Sep 17 00:00:00 2001 From: Simon Montagu Date: Tue, 2 Sep 2014 17:05:58 +0300 Subject: [PATCH 53/66] Bug 1058021 patch 2: add more helpful output for encoding test failures. r=jfkthame --- .../tests/unit/CharsetConversionTests.js | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/intl/uconv/tests/unit/CharsetConversionTests.js b/intl/uconv/tests/unit/CharsetConversionTests.js index 6fb9951664c..7c14d34ba50 100644 --- a/intl/uconv/tests/unit/CharsetConversionTests.js +++ b/intl/uconv/tests/unit/CharsetConversionTests.js @@ -25,6 +25,17 @@ function checkDecode(converter, charset, inText, expectedText) } catch(e) { outText = "\ufffd"; } + + if (outText != expectedText) { + for (var i = 0; i < inText.length; ++i) { + var inn = inText[i]; + var out = outText[i]; + var expected = expectedText[i]; + if (out != expected) { + dump("Decoding error at position " + i + ": for input " + escape(inn) + " expected " + escape(expected) + " but got " + escape(out) + "\n"); + } + } + } do_check_eq(outText, expectedText); } @@ -38,6 +49,17 @@ function checkEncode(converter, charset, inText, expectedText) dump("testing encoding from Unicode to " + charset + "\n"); var outText = converter.ConvertFromUnicode(inText) + converter.Finish(); + + if (outText != expectedText) { + for (var i = 0; i < inText.length; ++i) { + var inn = inText[i]; + var out = outText[i]; + var expected = expectedText[i]; + if (out != expected) { + dump("Encoding error at position " + i + ": for input " + escape(inn) + " expected " + escape(expected) + " but got " + escape(out) + "\n"); + } + } + } do_check_eq(outText, expectedText); } From 4a74fb87f1e8ec3ee59b02e7eff58519a1e8cf8d Mon Sep 17 00:00:00 2001 From: Simon Montagu Date: Tue, 2 Sep 2014 17:05:58 +0300 Subject: [PATCH 54/66] Bug 1058021 patch 3: change the mapfile generator to pass thru undefined codepoints from 0x80-0x9F and update the comments. r=jfkthame --- intl/uconv/tools/umaptable.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/intl/uconv/tools/umaptable.c b/intl/uconv/tools/umaptable.c index 0dc97655659..8bc9a6d4775 100644 --- a/intl/uconv/tools/umaptable.c +++ b/intl/uconv/tools/umaptable.c @@ -172,9 +172,9 @@ void gentable() printf(" The tool which used to generate this file is called umaptable.\n"); printf(" You can find this tool under mozilla/intl/uconv/tools/umaptable.c.\n"); - printf(" If you have any problem of this file. Please contact \n"); - printf(" Netscape Client International Team or \n"); - printf(" ftang@netscape \n"); + printf(" If you have any problems with this file, please file a bug\n"); + printf(" under the \"Internationalization\" component in\n"); + printf(" https://bugzilla.mozilla.org/enter_bug.cgi?product=Core\n"); printf("\n"); printf(" Table in Debug form \n"); @@ -433,11 +433,19 @@ void getinput() { if(buf[0]=='0' && buf[1] == 'x') { + u=-1; sscanf(buf,"%hx %hx",&c,&u); - if(bGenerateFromUnicodeTable) - SetMapValue(u, c); - else - SetMapValue(c, u); + if (u == -1 && 0x80 <= c && c <=0x9f) + { + u = c; + } + if (u != -1) + { + if(bGenerateFromUnicodeTable) + SetMapValue(u, c); + else + SetMapValue(c, u); + } } } } From a6d74d5db4606984299774871fb5b949383a3307 Mon Sep 17 00:00:00 2001 From: Simon Montagu Date: Tue, 2 Sep 2014 17:05:58 +0300 Subject: [PATCH 55/66] Bug 1058021 patch 4: regenerated encoding mapfiles. r=jfkthame --- intl/uconv/ucvlatin/cp1250.uf | 127 +++++++++++---------- intl/uconv/ucvlatin/cp1250.ut | 25 +++-- intl/uconv/ucvlatin/cp1251.uf | 59 +++++----- intl/uconv/ucvlatin/cp1251.ut | 13 ++- intl/uconv/ucvlatin/cp1253.uf | 59 +++++----- intl/uconv/ucvlatin/cp1253.ut | 25 +++-- intl/uconv/ucvlatin/cp1254.uf | 155 +++++++++++++++----------- intl/uconv/ucvlatin/cp1254.ut | 25 +++-- intl/uconv/ucvlatin/cp1255.uf | 187 +++++++++++++++++-------------- intl/uconv/ucvlatin/cp1255.ut | 103 +++++++++-------- intl/uconv/ucvlatin/cp1256.uf | 6 +- intl/uconv/ucvlatin/cp1256.ut | 6 +- intl/uconv/ucvlatin/cp1257.uf | 155 ++++++++++++++------------ intl/uconv/ucvlatin/cp1257.ut | 25 +++-- intl/uconv/ucvlatin/cp1258.uf | 201 ++++++++++++++++++---------------- intl/uconv/ucvlatin/cp1258.ut | 22 ++-- intl/uconv/ucvlatin/cp874.uf | 90 +++++++++------ intl/uconv/ucvlatin/cp874.ut | 75 ++++++++----- 18 files changed, 750 insertions(+), 608 deletions(-) diff --git a/intl/uconv/ucvlatin/cp1250.uf b/intl/uconv/ucvlatin/cp1250.uf index 3e3ab12e0e8..6a1fdb52fea 100644 --- a/intl/uconv/ucvlatin/cp1250.uf +++ b/intl/uconv/ucvlatin/cp1250.uf @@ -5,10 +5,11 @@ /*======================================================== This is a Generated file. Please don't edit it. - The tool which used to generate this file is called fromu. - If you have any problem of this file. Please contact - Netscape Client International Team or - ftang@netscape + The tool which used to generate this file is called umaptable. + You can find this tool under mozilla/intl/uconv/tools/umaptable.c. + If you have any problems with this file, please file a bug + under the "Internationalization" component in + https://bugzilla.mozilla.org/enter_bug.cgi?product=Core Table in Debug form Begin of Item 0000 @@ -20,33 +21,37 @@ End of Item 0000 Begin of Item 0001 Format 1 - srcBegin = 00A0 + srcBegin = 0081 srcEnd = 011B mappingOffset = 0000 Mapping = - 00A0 FFFD FFFD FFFD 00A4 FFFD 00A6 00A7 - 00A8 00A9 FFFD 00AB 00AC 00AD 00AE FFFD - 00B0 00B1 FFFD FFFD 00B4 00B5 00B6 00B7 - 00B8 FFFD FFFD 00BB FFFD FFFD FFFD FFFD - FFFD 00C1 00C2 FFFD 00C4 FFFD FFFD 00C7 - FFFD 00C9 FFFD 00CB FFFD 00CD 00CE FFFD - FFFD FFFD FFFD 00D3 00D4 FFFD 00D6 00D7 - FFFD FFFD 00DA FFFD 00DC 00DD FFFD 00DF - FFFD 00E1 00E2 FFFD 00E4 FFFD FFFD 00E7 - FFFD 00E9 FFFD 00EB FFFD 00ED 00EE FFFD - FFFD FFFD FFFD 00F3 00F4 FFFD 00F6 00F7 - FFFD FFFD 00FA FFFD 00FC 00FD FFFD FFFD - FFFD FFFD 00C3 00E3 00A5 00B9 00C6 00E6 - FFFD FFFD FFFD FFFD 00C8 00E8 00CF 00EF - 00D0 00F0 FFFD FFFD FFFD FFFD FFFD FFFD - 00CA 00EA 00CC 00EC + 0081 FFFD 0083 FFFD FFFD FFFD FFFD 0088 + FFFD FFFD FFFD FFFD FFFD FFFD FFFD 0090 + FFFD FFFD FFFD FFFD FFFD FFFD FFFD 0098 + FFFD FFFD FFFD FFFD FFFD FFFD FFFD 00A0 + FFFD FFFD FFFD 00A4 FFFD 00A6 00A7 00A8 + 00A9 FFFD 00AB 00AC 00AD 00AE FFFD 00B0 + 00B1 FFFD FFFD 00B4 00B5 00B6 00B7 00B8 + FFFD FFFD 00BB FFFD FFFD FFFD FFFD FFFD + 00C1 00C2 FFFD 00C4 FFFD FFFD 00C7 FFFD + 00C9 FFFD 00CB FFFD 00CD 00CE FFFD FFFD + FFFD FFFD 00D3 00D4 FFFD 00D6 00D7 FFFD + FFFD 00DA FFFD 00DC 00DD FFFD 00DF FFFD + 00E1 00E2 FFFD 00E4 FFFD FFFD 00E7 FFFD + 00E9 FFFD 00EB FFFD 00ED 00EE FFFD FFFD + FFFD FFFD 00F3 00F4 FFFD 00F6 00F7 FFFD + FFFD 00FA FFFD 00FC 00FD FFFD FFFD FFFD + FFFD 00C3 00E3 00A5 00B9 00C6 00E6 FFFD + FFFD FFFD FFFD 00C8 00E8 00CF 00EF 00D0 + 00F0 FFFD FFFD FFFD FFFD FFFD FFFD 00CA + 00EA 00CC 00EC End of Item 0001 Begin of Item 0002 Format 1 srcBegin = 0139 srcEnd = 017E - mappingOffset = 007C + mappingOffset = 009B Mapping = 00C5 00E5 FFFD FFFD 00BC 00BE FFFD FFFD 00A3 00B3 00D1 00F1 FFFD FFFD 00D2 00F2 @@ -69,7 +74,7 @@ Begin of Item 0004 Format 1 srcBegin = 02D8 srcEnd = 02DD - mappingOffset = 00C2 + mappingOffset = 00E1 Mapping = 00A2 00FF FFFD 00B2 FFFD 00BD End of Item 0004 @@ -78,7 +83,7 @@ Begin of Item 0005 Format 1 srcBegin = 2013 srcEnd = 203A - mappingOffset = 00C8 + mappingOffset = 00E7 Mapping = 0096 0097 FFFD FFFD FFFD 0091 0092 0082 FFFD 0093 0094 0084 FFFD 0086 0087 0095 @@ -122,44 +127,48 @@ End of Item 0007 /*-------------------------------------------------------*/ /* Offset=0x0007 Start of MapCell Array */ /* 0000 */ 0x0000, 0x007F, 0x0000, -/* 0001 */ 0x00A0, 0x011B, 0x0000, -/* 0002 */ 0x0139, 0x017E, 0x007C, +/* 0001 */ 0x0081, 0x011B, 0x0000, +/* 0002 */ 0x0139, 0x017E, 0x009B, /* 0003 */ 0x02C7, 0x0000, 0x00A1, -/* 0004 */ 0x02D8, 0x02DD, 0x00C2, -/* 0005 */ 0x2013, 0x203A, 0x00C8, +/* 0004 */ 0x02D8, 0x02DD, 0x00E1, +/* 0005 */ 0x2013, 0x203A, 0x00E7, /* 0006 */ 0x20AC, 0x0000, 0x0080, /* 0007 */ 0x2122, 0x0000, 0x0099, /*-------------------------------------------------------*/ /* Offset=0x001F Start of MappingTable */ -/* 0000 */ 0x00A0, 0xFFFD, 0xFFFD, 0xFFFD, 0x00A4, 0xFFFD, 0x00A6, 0x00A7, -/* 0008 */ 0x00A8, 0x00A9, 0xFFFD, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0xFFFD, -/* 0010 */ 0x00B0, 0x00B1, 0xFFFD, 0xFFFD, 0x00B4, 0x00B5, 0x00B6, 0x00B7, -/* 0018 */ 0x00B8, 0xFFFD, 0xFFFD, 0x00BB, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, -/* 0020 */ 0xFFFD, 0x00C1, 0x00C2, 0xFFFD, 0x00C4, 0xFFFD, 0xFFFD, 0x00C7, -/* 0028 */ 0xFFFD, 0x00C9, 0xFFFD, 0x00CB, 0xFFFD, 0x00CD, 0x00CE, 0xFFFD, -/* 0030 */ 0xFFFD, 0xFFFD, 0xFFFD, 0x00D3, 0x00D4, 0xFFFD, 0x00D6, 0x00D7, -/* 0038 */ 0xFFFD, 0xFFFD, 0x00DA, 0xFFFD, 0x00DC, 0x00DD, 0xFFFD, 0x00DF, -/* 0040 */ 0xFFFD, 0x00E1, 0x00E2, 0xFFFD, 0x00E4, 0xFFFD, 0xFFFD, 0x00E7, -/* 0048 */ 0xFFFD, 0x00E9, 0xFFFD, 0x00EB, 0xFFFD, 0x00ED, 0x00EE, 0xFFFD, -/* 0050 */ 0xFFFD, 0xFFFD, 0xFFFD, 0x00F3, 0x00F4, 0xFFFD, 0x00F6, 0x00F7, -/* 0058 */ 0xFFFD, 0xFFFD, 0x00FA, 0xFFFD, 0x00FC, 0x00FD, 0xFFFD, 0xFFFD, -/* 0060 */ 0xFFFD, 0xFFFD, 0x00C3, 0x00E3, 0x00A5, 0x00B9, 0x00C6, 0x00E6, -/* 0068 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x00C8, 0x00E8, 0x00CF, 0x00EF, -/* 0070 */ 0x00D0, 0x00F0, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, -/* 0078 */ 0x00CA, 0x00EA, 0x00CC, 0x00EC, 0x00C5, 0x00E5, 0xFFFD, 0xFFFD, -/* 0080 */ 0x00BC, 0x00BE, 0xFFFD, 0xFFFD, 0x00A3, 0x00B3, 0x00D1, 0x00F1, -/* 0088 */ 0xFFFD, 0xFFFD, 0x00D2, 0x00F2, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, -/* 0090 */ 0xFFFD, 0xFFFD, 0xFFFD, 0x00D5, 0x00F5, 0xFFFD, 0xFFFD, 0x00C0, -/* 0098 */ 0x00E0, 0xFFFD, 0xFFFD, 0x00D8, 0x00F8, 0x008C, 0x009C, 0xFFFD, -/* 00A0 */ 0xFFFD, 0x00AA, 0x00BA, 0x008A, 0x009A, 0x00DE, 0x00FE, 0x008D, -/* 00A8 */ 0x009D, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, -/* 00B0 */ 0xFFFD, 0x00D9, 0x00F9, 0x00DB, 0x00FB, 0xFFFD, 0xFFFD, 0xFFFD, -/* 00B8 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x008F, 0x009F, 0x00AF, 0x00BF, -/* 00C0 */ 0x008E, 0x009E, 0x00A2, 0x00FF, 0xFFFD, 0x00B2, 0xFFFD, 0x00BD, -/* 00C8 */ 0x0096, 0x0097, 0xFFFD, 0xFFFD, 0xFFFD, 0x0091, 0x0092, 0x0082, -/* 00D0 */ 0xFFFD, 0x0093, 0x0094, 0x0084, 0xFFFD, 0x0086, 0x0087, 0x0095, -/* 00D8 */ 0xFFFD, 0xFFFD, 0xFFFD, 0x0085, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, -/* 00E0 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x0089, 0xFFFD, 0xFFFD, -/* 00E8 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x008B, 0x009B, -/* End of table Total Length = 0x010F * 2 */ +/* 0000 */ 0x0081, 0xFFFD, 0x0083, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x0088, +/* 0008 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x0090, +/* 0010 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x0098, +/* 0018 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x00A0, +/* 0020 */ 0xFFFD, 0xFFFD, 0xFFFD, 0x00A4, 0xFFFD, 0x00A6, 0x00A7, 0x00A8, +/* 0028 */ 0x00A9, 0xFFFD, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0xFFFD, 0x00B0, +/* 0030 */ 0x00B1, 0xFFFD, 0xFFFD, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, +/* 0038 */ 0xFFFD, 0xFFFD, 0x00BB, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 0040 */ 0x00C1, 0x00C2, 0xFFFD, 0x00C4, 0xFFFD, 0xFFFD, 0x00C7, 0xFFFD, +/* 0048 */ 0x00C9, 0xFFFD, 0x00CB, 0xFFFD, 0x00CD, 0x00CE, 0xFFFD, 0xFFFD, +/* 0050 */ 0xFFFD, 0xFFFD, 0x00D3, 0x00D4, 0xFFFD, 0x00D6, 0x00D7, 0xFFFD, +/* 0058 */ 0xFFFD, 0x00DA, 0xFFFD, 0x00DC, 0x00DD, 0xFFFD, 0x00DF, 0xFFFD, +/* 0060 */ 0x00E1, 0x00E2, 0xFFFD, 0x00E4, 0xFFFD, 0xFFFD, 0x00E7, 0xFFFD, +/* 0068 */ 0x00E9, 0xFFFD, 0x00EB, 0xFFFD, 0x00ED, 0x00EE, 0xFFFD, 0xFFFD, +/* 0070 */ 0xFFFD, 0xFFFD, 0x00F3, 0x00F4, 0xFFFD, 0x00F6, 0x00F7, 0xFFFD, +/* 0078 */ 0xFFFD, 0x00FA, 0xFFFD, 0x00FC, 0x00FD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 0080 */ 0xFFFD, 0x00C3, 0x00E3, 0x00A5, 0x00B9, 0x00C6, 0x00E6, 0xFFFD, +/* 0088 */ 0xFFFD, 0xFFFD, 0xFFFD, 0x00C8, 0x00E8, 0x00CF, 0x00EF, 0x00D0, +/* 0090 */ 0x00F0, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x00CA, +/* 0098 */ 0x00EA, 0x00CC, 0x00EC, 0x00C5, 0x00E5, 0xFFFD, 0xFFFD, 0x00BC, +/* 00A0 */ 0x00BE, 0xFFFD, 0xFFFD, 0x00A3, 0x00B3, 0x00D1, 0x00F1, 0xFFFD, +/* 00A8 */ 0xFFFD, 0x00D2, 0x00F2, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 00B0 */ 0xFFFD, 0xFFFD, 0x00D5, 0x00F5, 0xFFFD, 0xFFFD, 0x00C0, 0x00E0, +/* 00B8 */ 0xFFFD, 0xFFFD, 0x00D8, 0x00F8, 0x008C, 0x009C, 0xFFFD, 0xFFFD, +/* 00C0 */ 0x00AA, 0x00BA, 0x008A, 0x009A, 0x00DE, 0x00FE, 0x008D, 0x009D, +/* 00C8 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 00D0 */ 0x00D9, 0x00F9, 0x00DB, 0x00FB, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 00D8 */ 0xFFFD, 0xFFFD, 0xFFFD, 0x008F, 0x009F, 0x00AF, 0x00BF, 0x008E, +/* 00E0 */ 0x009E, 0x00A2, 0x00FF, 0xFFFD, 0x00B2, 0xFFFD, 0x00BD, 0x0096, +/* 00E8 */ 0x0097, 0xFFFD, 0xFFFD, 0xFFFD, 0x0091, 0x0092, 0x0082, 0xFFFD, +/* 00F0 */ 0x0093, 0x0094, 0x0084, 0xFFFD, 0x0086, 0x0087, 0x0095, 0xFFFD, +/* 00F8 */ 0xFFFD, 0xFFFD, 0x0085, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 0100 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x0089, 0xFFFD, 0xFFFD, 0xFFFD, +/* 0108 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x008B, 0x009B, +/* End of table Total Length = 0x012E * 2 */ diff --git a/intl/uconv/ucvlatin/cp1250.ut b/intl/uconv/ucvlatin/cp1250.ut index 156b97ef2f1..d775f1729e5 100644 --- a/intl/uconv/ucvlatin/cp1250.ut +++ b/intl/uconv/ucvlatin/cp1250.ut @@ -5,10 +5,11 @@ /*======================================================== This is a Generated file. Please don't edit it. - The tool which used to generate this file is called fromu. - If you have any problem of this file. Please contact - Netscape Client International Team or - ftang@netscape + The tool which used to generate this file is called umaptable. + You can find this tool under mozilla/intl/uconv/tools/umaptable.c. + If you have any problems with this file, please file a bug + under the "Internationalization" component in + https://bugzilla.mozilla.org/enter_bug.cgi?product=Core Table in Debug form Begin of Item 0000 @@ -24,10 +25,10 @@ Begin of Item 0001 srcEnd = 00FF mappingOffset = 0000 Mapping = - 20AC FFFD 201A FFFD 201E 2026 2020 2021 - FFFD 2030 0160 2039 015A 0164 017D 0179 - FFFD 2018 2019 201C 201D 2022 2013 2014 - FFFD 2122 0161 203A 015B 0165 017E 017A + 20AC 0081 201A 0083 201E 2026 2020 2021 + 0088 2030 0160 2039 015A 0164 017D 0179 + 0090 2018 2019 201C 201D 2022 2013 2014 + 0098 2122 0161 203A 015B 0165 017E 017A 00A0 02C7 02D8 0141 00A4 0104 00A6 00A7 00A8 00A9 015E 00AB 00AC 00AD 00AE 017B 00B0 00B1 02DB 0142 00B4 00B5 00B6 00B7 @@ -69,10 +70,10 @@ End of Item 0001 /*-------------------------------------------------------*/ /* Offset=0x000B Start of MappingTable */ -/* 0000 */ 0x20AC, 0xFFFD, 0x201A, 0xFFFD, 0x201E, 0x2026, 0x2020, 0x2021, -/* 0008 */ 0xFFFD, 0x2030, 0x0160, 0x2039, 0x015A, 0x0164, 0x017D, 0x0179, -/* 0010 */ 0xFFFD, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, -/* 0018 */ 0xFFFD, 0x2122, 0x0161, 0x203A, 0x015B, 0x0165, 0x017E, 0x017A, +/* 0000 */ 0x20AC, 0x0081, 0x201A, 0x0083, 0x201E, 0x2026, 0x2020, 0x2021, +/* 0008 */ 0x0088, 0x2030, 0x0160, 0x2039, 0x015A, 0x0164, 0x017D, 0x0179, +/* 0010 */ 0x0090, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, +/* 0018 */ 0x0098, 0x2122, 0x0161, 0x203A, 0x015B, 0x0165, 0x017E, 0x017A, /* 0020 */ 0x00A0, 0x02C7, 0x02D8, 0x0141, 0x00A4, 0x0104, 0x00A6, 0x00A7, /* 0028 */ 0x00A8, 0x00A9, 0x015E, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x017B, /* 0030 */ 0x00B0, 0x00B1, 0x02DB, 0x0142, 0x00B4, 0x00B5, 0x00B6, 0x00B7, diff --git a/intl/uconv/ucvlatin/cp1251.uf b/intl/uconv/ucvlatin/cp1251.uf index 94f80190a6d..dc42f9b1186 100644 --- a/intl/uconv/ucvlatin/cp1251.uf +++ b/intl/uconv/ucvlatin/cp1251.uf @@ -5,10 +5,11 @@ /*======================================================== This is a Generated file. Please don't edit it. - The tool which used to generate this file is called fromu. - If you have any problem of this file. Please contact - Netscape Client International Team or - ftang@netscape + The tool which used to generate this file is called umaptable. + You can find this tool under mozilla/intl/uconv/tools/umaptable.c. + If you have any problems with this file, please file a bug + under the "Internationalization" component in + https://bugzilla.mozilla.org/enter_bug.cgi?product=Core Table in Debug form Begin of Item 0000 @@ -27,10 +28,11 @@ End of Item 0001 Begin of Item 0002 Format 1 - srcBegin = 00A0 + srcBegin = 0098 srcEnd = 00BB mappingOffset = 0000 Mapping = + 0098 FFFD FFFD FFFD FFFD FFFD FFFD FFFD 00A0 FFFD FFFD FFFD 00A4 FFFD 00A6 00A7 FFFD 00A9 FFFD 00AB 00AC 00AD 00AE FFFD 00B0 00B1 FFFD FFFD FFFD 00B5 00B6 00B7 @@ -41,7 +43,7 @@ Begin of Item 0003 Format 1 srcBegin = 0401 srcEnd = 040F - mappingOffset = 001C + mappingOffset = 0024 Mapping = 00A8 0080 0081 00AA 00BD 00B2 00AF 00A3 008A 008C 008E 008D FFFD 00A1 008F @@ -51,7 +53,7 @@ Begin of Item 0004 Format 1 srcBegin = 0451 srcEnd = 045F - mappingOffset = 002B + mappingOffset = 0033 Mapping = 00B8 0090 0083 00BA 00BE 00B3 00BF 00BC 009A 009C 009E 009D FFFD 00A2 009F @@ -61,7 +63,7 @@ Begin of Item 0005 Format 1 srcBegin = 0490 srcEnd = 0491 - mappingOffset = 003A + mappingOffset = 0042 Mapping = 00A5 00B4 End of Item 0005 @@ -70,7 +72,7 @@ Begin of Item 0006 Format 1 srcBegin = 2013 srcEnd = 203A - mappingOffset = 003C + mappingOffset = 0044 Mapping = 0096 0097 FFFD FFFD FFFD 0091 0092 0082 FFFD 0093 0094 0084 FFFD 0086 0087 0095 @@ -121,28 +123,29 @@ End of Item 0009 /* Offset=0x0007 Start of MapCell Array */ /* 0000 */ 0x0000, 0x007F, 0x0000, /* 0001 */ 0x0410, 0x044F, 0x00C0, -/* 0002 */ 0x00A0, 0x00BB, 0x0000, -/* 0003 */ 0x0401, 0x040F, 0x001C, -/* 0004 */ 0x0451, 0x045F, 0x002B, -/* 0005 */ 0x0490, 0x0491, 0x003A, -/* 0006 */ 0x2013, 0x203A, 0x003C, +/* 0002 */ 0x0098, 0x00BB, 0x0000, +/* 0003 */ 0x0401, 0x040F, 0x0024, +/* 0004 */ 0x0451, 0x045F, 0x0033, +/* 0005 */ 0x0490, 0x0491, 0x0042, +/* 0006 */ 0x2013, 0x203A, 0x0044, /* 0007 */ 0x20AC, 0x0000, 0x0088, /* 0008 */ 0x2116, 0x0000, 0x00B9, /* 0009 */ 0x2122, 0x0000, 0x0099, /*-------------------------------------------------------*/ /* Offset=0x0025 Start of MappingTable */ -/* 0000 */ 0x00A0, 0xFFFD, 0xFFFD, 0xFFFD, 0x00A4, 0xFFFD, 0x00A6, 0x00A7, -/* 0008 */ 0xFFFD, 0x00A9, 0xFFFD, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0xFFFD, -/* 0010 */ 0x00B0, 0x00B1, 0xFFFD, 0xFFFD, 0xFFFD, 0x00B5, 0x00B6, 0x00B7, -/* 0018 */ 0xFFFD, 0xFFFD, 0xFFFD, 0x00BB, 0x00A8, 0x0080, 0x0081, 0x00AA, -/* 0020 */ 0x00BD, 0x00B2, 0x00AF, 0x00A3, 0x008A, 0x008C, 0x008E, 0x008D, -/* 0028 */ 0xFFFD, 0x00A1, 0x008F, 0x00B8, 0x0090, 0x0083, 0x00BA, 0x00BE, -/* 0030 */ 0x00B3, 0x00BF, 0x00BC, 0x009A, 0x009C, 0x009E, 0x009D, 0xFFFD, -/* 0038 */ 0x00A2, 0x009F, 0x00A5, 0x00B4, 0x0096, 0x0097, 0xFFFD, 0xFFFD, -/* 0040 */ 0xFFFD, 0x0091, 0x0092, 0x0082, 0xFFFD, 0x0093, 0x0094, 0x0084, -/* 0048 */ 0xFFFD, 0x0086, 0x0087, 0x0095, 0xFFFD, 0xFFFD, 0xFFFD, 0x0085, -/* 0050 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, -/* 0058 */ 0xFFFD, 0x0089, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, -/* 0060 */ 0xFFFD, 0xFFFD, 0x008B, 0x009B, -/* End of table Total Length = 0x0089 * 2 */ +/* 0000 */ 0x0098, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 0008 */ 0x00A0, 0xFFFD, 0xFFFD, 0xFFFD, 0x00A4, 0xFFFD, 0x00A6, 0x00A7, +/* 0010 */ 0xFFFD, 0x00A9, 0xFFFD, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0xFFFD, +/* 0018 */ 0x00B0, 0x00B1, 0xFFFD, 0xFFFD, 0xFFFD, 0x00B5, 0x00B6, 0x00B7, +/* 0020 */ 0xFFFD, 0xFFFD, 0xFFFD, 0x00BB, 0x00A8, 0x0080, 0x0081, 0x00AA, +/* 0028 */ 0x00BD, 0x00B2, 0x00AF, 0x00A3, 0x008A, 0x008C, 0x008E, 0x008D, +/* 0030 */ 0xFFFD, 0x00A1, 0x008F, 0x00B8, 0x0090, 0x0083, 0x00BA, 0x00BE, +/* 0038 */ 0x00B3, 0x00BF, 0x00BC, 0x009A, 0x009C, 0x009E, 0x009D, 0xFFFD, +/* 0040 */ 0x00A2, 0x009F, 0x00A5, 0x00B4, 0x0096, 0x0097, 0xFFFD, 0xFFFD, +/* 0048 */ 0xFFFD, 0x0091, 0x0092, 0x0082, 0xFFFD, 0x0093, 0x0094, 0x0084, +/* 0050 */ 0xFFFD, 0x0086, 0x0087, 0x0095, 0xFFFD, 0xFFFD, 0xFFFD, 0x0085, +/* 0058 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 0060 */ 0xFFFD, 0x0089, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 0068 */ 0xFFFD, 0xFFFD, 0x008B, 0x009B, +/* End of table Total Length = 0x0091 * 2 */ diff --git a/intl/uconv/ucvlatin/cp1251.ut b/intl/uconv/ucvlatin/cp1251.ut index 63da1125c5f..dbfc8c90721 100644 --- a/intl/uconv/ucvlatin/cp1251.ut +++ b/intl/uconv/ucvlatin/cp1251.ut @@ -5,10 +5,11 @@ /*======================================================== This is a Generated file. Please don't edit it. - The tool which used to generate this file is called fromu. - If you have any problem of this file. Please contact - Netscape Client International Team or - ftang@netscape + The tool which used to generate this file is called umaptable. + You can find this tool under mozilla/intl/uconv/tools/umaptable.c. + If you have any problems with this file, please file a bug + under the "Internationalization" component in + https://bugzilla.mozilla.org/enter_bug.cgi?product=Core Table in Debug form Begin of Item 0000 @@ -34,7 +35,7 @@ Begin of Item 0002 0402 0403 201A 0453 201E 2026 2020 2021 20AC 2030 0409 2039 040A 040C 040B 040F 0452 2018 2019 201C 201D 2022 2013 2014 - FFFD 2122 0459 203A 045A 045C 045B 045F + 0098 2122 0459 203A 045A 045C 045B 045F 00A0 040E 045E 0408 00A4 0490 00A6 00A7 0401 00A9 0404 00AB 00AC 00AD 00AE 0407 00B0 00B1 0406 0456 0491 00B5 00B6 00B7 @@ -72,7 +73,7 @@ End of Item 0002 /* 0000 */ 0x0402, 0x0403, 0x201A, 0x0453, 0x201E, 0x2026, 0x2020, 0x2021, /* 0008 */ 0x20AC, 0x2030, 0x0409, 0x2039, 0x040A, 0x040C, 0x040B, 0x040F, /* 0010 */ 0x0452, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, -/* 0018 */ 0xFFFD, 0x2122, 0x0459, 0x203A, 0x045A, 0x045C, 0x045B, 0x045F, +/* 0018 */ 0x0098, 0x2122, 0x0459, 0x203A, 0x045A, 0x045C, 0x045B, 0x045F, /* 0020 */ 0x00A0, 0x040E, 0x045E, 0x0408, 0x00A4, 0x0490, 0x00A6, 0x00A7, /* 0028 */ 0x0401, 0x00A9, 0x0404, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x0407, /* 0030 */ 0x00B0, 0x00B1, 0x0406, 0x0456, 0x0491, 0x00B5, 0x00B6, 0x00B7, diff --git a/intl/uconv/ucvlatin/cp1253.uf b/intl/uconv/ucvlatin/cp1253.uf index 7a558b12fd9..b26e0137ebe 100644 --- a/intl/uconv/ucvlatin/cp1253.uf +++ b/intl/uconv/ucvlatin/cp1253.uf @@ -5,10 +5,11 @@ /*======================================================== This is a Generated file. Please don't edit it. - The tool which used to generate this file is called fromu. - If you have any problem of this file. Please contact - Netscape Client International Team or - ftang@netscape + The tool which used to generate this file is called umaptable. + You can find this tool under mozilla/intl/uconv/tools/umaptable.c. + If you have any problems with this file, please file a bug + under the "Internationalization" component in + https://bugzilla.mozilla.org/enter_bug.cgi?product=Core Table in Debug form Begin of Item 0000 @@ -41,14 +42,18 @@ End of Item 0003 Begin of Item 0004 Format 1 - srcBegin = 00A0 + srcBegin = 0081 srcEnd = 00BD mappingOffset = 0000 Mapping = - 00A0 FFFD FFFD FFFD FFFD FFFD FFFD FFFD - FFFD FFFD FFFD 00AB 00AC 00AD 00AE FFFD - 00B0 00B1 00B2 00B3 FFFD 00B5 00B6 00B7 - FFFD FFFD FFFD 00BB FFFD 00BD + 0081 FFFD FFFD FFFD FFFD FFFD FFFD 0088 + FFFD 008A FFFD 008C 008D 008E 008F 0090 + FFFD FFFD FFFD FFFD FFFD FFFD FFFD 0098 + FFFD 009A FFFD 009C 009D 009E 009F 00A0 + FFFD FFFD FFFD FFFD FFFD FFFD FFFD FFFD + FFFD FFFD 00AB 00AC 00AD 00AE FFFD 00B0 + 00B1 00B2 00B3 FFFD 00B5 00B6 00B7 FFFD + FFFD FFFD 00BB FFFD 00BD End of Item 0004 Begin of Item 0005 @@ -61,7 +66,7 @@ Begin of Item 0006 Format 1 srcBegin = 0384 srcEnd = 038C - mappingOffset = 001E + mappingOffset = 003D Mapping = 00B4 00A1 00A2 FFFD 00B8 00B9 00BA FFFD 00BC @@ -71,7 +76,7 @@ Begin of Item 0007 Format 1 srcBegin = 2013 srcEnd = 203A - mappingOffset = 0027 + mappingOffset = 0046 Mapping = 0096 0097 00AF FFFD FFFD 0091 0092 0082 FFFD 0093 0094 0084 FFFD 0086 0087 0095 @@ -118,23 +123,27 @@ End of Item 0009 /* 0001 */ 0x00A3, 0x00A9, 0x00A3, /* 0002 */ 0x038E, 0x03A1, 0x00BE, /* 0003 */ 0x03A3, 0x03CE, 0x00D3, -/* 0004 */ 0x00A0, 0x00BD, 0x0000, +/* 0004 */ 0x0081, 0x00BD, 0x0000, /* 0005 */ 0x0192, 0x0000, 0x0083, -/* 0006 */ 0x0384, 0x038C, 0x001E, -/* 0007 */ 0x2013, 0x203A, 0x0027, +/* 0006 */ 0x0384, 0x038C, 0x003D, +/* 0007 */ 0x2013, 0x203A, 0x0046, /* 0008 */ 0x20AC, 0x0000, 0x0080, /* 0009 */ 0x2122, 0x0000, 0x0099, /*-------------------------------------------------------*/ /* Offset=0x0025 Start of MappingTable */ -/* 0000 */ 0x00A0, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, -/* 0008 */ 0xFFFD, 0xFFFD, 0xFFFD, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0xFFFD, -/* 0010 */ 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0xFFFD, 0x00B5, 0x00B6, 0x00B7, -/* 0018 */ 0xFFFD, 0xFFFD, 0xFFFD, 0x00BB, 0xFFFD, 0x00BD, 0x00B4, 0x00A1, -/* 0020 */ 0x00A2, 0xFFFD, 0x00B8, 0x00B9, 0x00BA, 0xFFFD, 0x00BC, 0x0096, -/* 0028 */ 0x0097, 0x00AF, 0xFFFD, 0xFFFD, 0x0091, 0x0092, 0x0082, 0xFFFD, -/* 0030 */ 0x0093, 0x0094, 0x0084, 0xFFFD, 0x0086, 0x0087, 0x0095, 0xFFFD, -/* 0038 */ 0xFFFD, 0xFFFD, 0x0085, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, -/* 0040 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x0089, 0xFFFD, 0xFFFD, 0xFFFD, -/* 0048 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x008B, 0x009B, -/* End of table Total Length = 0x0074 * 2 */ +/* 0000 */ 0x0081, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x0088, +/* 0008 */ 0xFFFD, 0x008A, 0xFFFD, 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, +/* 0010 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x0098, +/* 0018 */ 0xFFFD, 0x009A, 0xFFFD, 0x009C, 0x009D, 0x009E, 0x009F, 0x00A0, +/* 0020 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 0028 */ 0xFFFD, 0xFFFD, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0xFFFD, 0x00B0, +/* 0030 */ 0x00B1, 0x00B2, 0x00B3, 0xFFFD, 0x00B5, 0x00B6, 0x00B7, 0xFFFD, +/* 0038 */ 0xFFFD, 0xFFFD, 0x00BB, 0xFFFD, 0x00BD, 0x00B4, 0x00A1, 0x00A2, +/* 0040 */ 0xFFFD, 0x00B8, 0x00B9, 0x00BA, 0xFFFD, 0x00BC, 0x0096, 0x0097, +/* 0048 */ 0x00AF, 0xFFFD, 0xFFFD, 0x0091, 0x0092, 0x0082, 0xFFFD, 0x0093, +/* 0050 */ 0x0094, 0x0084, 0xFFFD, 0x0086, 0x0087, 0x0095, 0xFFFD, 0xFFFD, +/* 0058 */ 0xFFFD, 0x0085, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 0060 */ 0xFFFD, 0xFFFD, 0xFFFD, 0x0089, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 0068 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x008B, 0x009B, +/* End of table Total Length = 0x0093 * 2 */ diff --git a/intl/uconv/ucvlatin/cp1253.ut b/intl/uconv/ucvlatin/cp1253.ut index 30d6e893e80..365fb16d19e 100644 --- a/intl/uconv/ucvlatin/cp1253.ut +++ b/intl/uconv/ucvlatin/cp1253.ut @@ -5,10 +5,11 @@ /*======================================================== This is a Generated file. Please don't edit it. - The tool which used to generate this file is called fromu. - If you have any problem of this file. Please contact - Netscape Client International Team or - ftang@netscape + The tool which used to generate this file is called umaptable. + You can find this tool under mozilla/intl/uconv/tools/umaptable.c. + If you have any problems with this file, please file a bug + under the "Internationalization" component in + https://bugzilla.mozilla.org/enter_bug.cgi?product=Core Table in Debug form Begin of Item 0000 @@ -45,10 +46,10 @@ Begin of Item 0004 srcEnd = 00BD mappingOffset = 0000 Mapping = - 20AC FFFD 201A 0192 201E 2026 2020 2021 - FFFD 2030 FFFD 2039 FFFD FFFD FFFD FFFD - FFFD 2018 2019 201C 201D 2022 2013 2014 - FFFD 2122 FFFD 203A FFFD FFFD FFFD FFFD + 20AC 0081 201A 0192 201E 2026 2020 2021 + 0088 2030 008A 2039 008C 008D 008E 008F + 0090 2018 2019 201C 201D 2022 2013 2014 + 0098 2122 009A 203A 009C 009D 009E 009F 00A0 0385 0386 FFFD FFFD FFFD FFFD FFFD FFFD FFFD FFFD 00AB 00AC 00AD 00AE 2015 00B0 00B1 00B2 00B3 0384 00B5 00B6 00B7 @@ -85,10 +86,10 @@ End of Item 0004 /*-------------------------------------------------------*/ /* Offset=0x0015 Start of MappingTable */ -/* 0000 */ 0x20AC, 0xFFFD, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, -/* 0008 */ 0xFFFD, 0x2030, 0xFFFD, 0x2039, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, -/* 0010 */ 0xFFFD, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, -/* 0018 */ 0xFFFD, 0x2122, 0xFFFD, 0x203A, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 0000 */ 0x20AC, 0x0081, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, +/* 0008 */ 0x0088, 0x2030, 0x008A, 0x2039, 0x008C, 0x008D, 0x008E, 0x008F, +/* 0010 */ 0x0090, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, +/* 0018 */ 0x0098, 0x2122, 0x009A, 0x203A, 0x009C, 0x009D, 0x009E, 0x009F, /* 0020 */ 0x00A0, 0x0385, 0x0386, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, /* 0028 */ 0xFFFD, 0xFFFD, 0xFFFD, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x2015, /* 0030 */ 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x0384, 0x00B5, 0x00B6, 0x00B7, diff --git a/intl/uconv/ucvlatin/cp1254.uf b/intl/uconv/ucvlatin/cp1254.uf index b7f63dadf77..a26221edada 100644 --- a/intl/uconv/ucvlatin/cp1254.uf +++ b/intl/uconv/ucvlatin/cp1254.uf @@ -5,10 +5,11 @@ /*======================================================== This is a Generated file. Please don't edit it. - The tool which used to generate this file is called fromu. - If you have any problem of this file. Please contact - Netscape Client International Team or - ftang@netscape + The tool which used to generate this file is called umaptable. + You can find this tool under mozilla/intl/uconv/tools/umaptable.c. + If you have any problems with this file, please file a bug + under the "Internationalization" component in + https://bugzilla.mozilla.org/enter_bug.cgi?product=Core Table in Debug form Begin of Item 0000 @@ -48,90 +49,114 @@ End of Item 0004 Begin of Item 0005 Format 2 - srcBegin = 00FF - destBegin = 00FF + srcBegin = 0081 + destBegin = 0081 End of Item 0005 Begin of Item 0006 Format 1 - srcBegin = 011E - srcEnd = 011F + srcBegin = 008D + srcEnd = 0090 mappingOffset = 0000 Mapping = - 00D0 00F0 + 008D 008E 008F 0090 End of Item 0006 Begin of Item 0007 Format 1 - srcBegin = 0130 - srcEnd = 0131 - mappingOffset = 0002 + srcBegin = 009D + srcEnd = 009E + mappingOffset = 0004 Mapping = - 00DD 00FD + 009D 009E End of Item 0007 Begin of Item 0008 - Format 1 - srcBegin = 0152 - srcEnd = 0161 - mappingOffset = 0004 - Mapping = - 008C 009C FFFD FFFD FFFD FFFD FFFD FFFD - FFFD FFFD FFFD FFFD 00DE 00FE 008A 009A + Format 2 + srcBegin = 00FF + destBegin = 00FF End of Item 0008 Begin of Item 0009 - Format 2 - srcBegin = 0178 - destBegin = 009F + Format 1 + srcBegin = 011E + srcEnd = 011F + mappingOffset = 0006 + Mapping = + 00D0 00F0 End of Item 0009 Begin of Item 000A - Format 2 - srcBegin = 0192 - destBegin = 0083 + Format 1 + srcBegin = 0130 + srcEnd = 0131 + mappingOffset = 0008 + Mapping = + 00DD 00FD End of Item 000A Begin of Item 000B - Format 2 - srcBegin = 02C6 - destBegin = 0088 + Format 1 + srcBegin = 0152 + srcEnd = 0161 + mappingOffset = 000A + Mapping = + 008C 009C FFFD FFFD FFFD FFFD FFFD FFFD + FFFD FFFD FFFD FFFD 00DE 00FE 008A 009A End of Item 000B Begin of Item 000C Format 2 - srcBegin = 02DC - destBegin = 0098 + srcBegin = 0178 + destBegin = 009F End of Item 000C Begin of Item 000D + Format 2 + srcBegin = 0192 + destBegin = 0083 +End of Item 000D + +Begin of Item 000E + Format 2 + srcBegin = 02C6 + destBegin = 0088 +End of Item 000E + +Begin of Item 000F + Format 2 + srcBegin = 02DC + destBegin = 0098 +End of Item 000F + +Begin of Item 0010 Format 1 srcBegin = 2013 srcEnd = 203A - mappingOffset = 0014 + mappingOffset = 001A Mapping = 0096 0097 FFFD FFFD FFFD 0091 0092 0082 FFFD 0093 0094 0084 FFFD 0086 0087 0095 FFFD FFFD FFFD 0085 FFFD FFFD FFFD FFFD FFFD FFFD FFFD FFFD FFFD 0089 FFFD FFFD FFFD FFFD FFFD FFFD FFFD FFFD 008B 009B -End of Item 000D +End of Item 0010 -Begin of Item 000E +Begin of Item 0011 Format 2 srcBegin = 20AC destBegin = 0080 -End of Item 000E +End of Item 0011 -Begin of Item 000F +Begin of Item 0012 Format 2 srcBegin = 2122 destBegin = 0099 -End of Item 000F +End of Item 0012 ========================================================*/ /* Offset=0x0000 ItemOfList */ - 0x0010, + 0x0013, /*-------------------------------------------------------*/ /* Offset=0x0001 offsetToFormatArray */ 0x0004, @@ -140,15 +165,15 @@ End of Item 000F 0x0009, /*-------------------------------------------------------*/ /* Offset=0x0003 offsetToMappingTable */ - 0x0039, + 0x0042, /*-------------------------------------------------------*/ /* Offset=0x0004 Start of Format Array */ /* Total of Format 0 : 0x0005 */ -/* Total of Format 1 : 0x0004 */ -/* Total of Format 2 : 0x0007 */ +/* Total of Format 1 : 0x0006 */ +/* Total of Format 2 : 0x0008 */ /* Total of Format 3 : 0x0000 */ -0x0000, 0x1120, 0x2221, 0x2212, 0x0000, +0x0000, 0x1120, 0x1112, 0x2222, 0x0221, /*-------------------------------------------------------*/ /* Offset=0x0009 Start of MapCell Array */ /* 0000 */ 0x0000, 0x007F, 0x0000, @@ -156,26 +181,30 @@ End of Item 000F /* 0002 */ 0x00D1, 0x00DC, 0x00D1, /* 0003 */ 0x00DF, 0x00EF, 0x00DF, /* 0004 */ 0x00F1, 0x00FC, 0x00F1, -/* 0005 */ 0x00FF, 0x0000, 0x00FF, -/* 0006 */ 0x011E, 0x011F, 0x0000, -/* 0007 */ 0x0130, 0x0131, 0x0002, -/* 0008 */ 0x0152, 0x0161, 0x0004, -/* 0009 */ 0x0178, 0x0000, 0x009F, -/* 000A */ 0x0192, 0x0000, 0x0083, -/* 000B */ 0x02C6, 0x0000, 0x0088, -/* 000C */ 0x02DC, 0x0000, 0x0098, -/* 000D */ 0x2013, 0x203A, 0x0014, -/* 000E */ 0x20AC, 0x0000, 0x0080, -/* 000F */ 0x2122, 0x0000, 0x0099, +/* 0005 */ 0x0081, 0x0000, 0x0081, +/* 0006 */ 0x008D, 0x0090, 0x0000, +/* 0007 */ 0x009D, 0x009E, 0x0004, +/* 0008 */ 0x00FF, 0x0000, 0x00FF, +/* 0009 */ 0x011E, 0x011F, 0x0006, +/* 000A */ 0x0130, 0x0131, 0x0008, +/* 000B */ 0x0152, 0x0161, 0x000A, +/* 000C */ 0x0178, 0x0000, 0x009F, +/* 000D */ 0x0192, 0x0000, 0x0083, +/* 000E */ 0x02C6, 0x0000, 0x0088, +/* 000F */ 0x02DC, 0x0000, 0x0098, +/* 0010 */ 0x2013, 0x203A, 0x001A, +/* 0011 */ 0x20AC, 0x0000, 0x0080, +/* 0012 */ 0x2122, 0x0000, 0x0099, /*-------------------------------------------------------*/ -/* Offset=0x0039 Start of MappingTable */ +/* Offset=0x0042 Start of MappingTable */ -/* 0000 */ 0x00D0, 0x00F0, 0x00DD, 0x00FD, 0x008C, 0x009C, 0xFFFD, 0xFFFD, -/* 0008 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, -/* 0010 */ 0x00DE, 0x00FE, 0x008A, 0x009A, 0x0096, 0x0097, 0xFFFD, 0xFFFD, -/* 0018 */ 0xFFFD, 0x0091, 0x0092, 0x0082, 0xFFFD, 0x0093, 0x0094, 0x0084, -/* 0020 */ 0xFFFD, 0x0086, 0x0087, 0x0095, 0xFFFD, 0xFFFD, 0xFFFD, 0x0085, -/* 0028 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, -/* 0030 */ 0xFFFD, 0x0089, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, -/* 0038 */ 0xFFFD, 0xFFFD, 0x008B, 0x009B, -/* End of table Total Length = 0x0075 * 2 */ +/* 0000 */ 0x008D, 0x008E, 0x008F, 0x0090, 0x009D, 0x009E, 0x00D0, 0x00F0, +/* 0008 */ 0x00DD, 0x00FD, 0x008C, 0x009C, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 0010 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x00DE, 0x00FE, +/* 0018 */ 0x008A, 0x009A, 0x0096, 0x0097, 0xFFFD, 0xFFFD, 0xFFFD, 0x0091, +/* 0020 */ 0x0092, 0x0082, 0xFFFD, 0x0093, 0x0094, 0x0084, 0xFFFD, 0x0086, +/* 0028 */ 0x0087, 0x0095, 0xFFFD, 0xFFFD, 0xFFFD, 0x0085, 0xFFFD, 0xFFFD, +/* 0030 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x0089, +/* 0038 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 0040 */ 0x008B, 0x009B, +/* End of table Total Length = 0x0084 * 2 */ diff --git a/intl/uconv/ucvlatin/cp1254.ut b/intl/uconv/ucvlatin/cp1254.ut index 407c09cffb7..ba524dd798f 100644 --- a/intl/uconv/ucvlatin/cp1254.ut +++ b/intl/uconv/ucvlatin/cp1254.ut @@ -5,10 +5,11 @@ /*======================================================== This is a Generated file. Please don't edit it. - The tool which used to generate this file is called fromu. - If you have any problem of this file. Please contact - Netscape Client International Team or - ftang@netscape + The tool which used to generate this file is called umaptable. + You can find this tool under mozilla/intl/uconv/tools/umaptable.c. + If you have any problems with this file, please file a bug + under the "Internationalization" component in + https://bugzilla.mozilla.org/enter_bug.cgi?product=Core Table in Debug form Begin of Item 0000 @@ -52,10 +53,10 @@ Begin of Item 0005 srcEnd = 009F mappingOffset = 0000 Mapping = - 20AC FFFD 201A 0192 201E 2026 2020 2021 - 02C6 2030 0160 2039 0152 FFFD FFFD FFFD - FFFD 2018 2019 201C 201D 2022 2013 2014 - 02DC 2122 0161 203A 0153 FFFD FFFD 0178 + 20AC 0081 201A 0192 201E 2026 2020 2021 + 02C6 2030 0160 2039 0152 008D 008E 008F + 0090 2018 2019 201C 201D 2022 2013 2014 + 02DC 2122 0161 203A 0153 009D 009E 0178 End of Item 0005 Begin of Item 0006 @@ -123,9 +124,9 @@ End of Item 0009 /*-------------------------------------------------------*/ /* Offset=0x0025 Start of MappingTable */ -/* 0000 */ 0x20AC, 0xFFFD, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, -/* 0008 */ 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0xFFFD, 0xFFFD, 0xFFFD, -/* 0010 */ 0xFFFD, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, -/* 0018 */ 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0xFFFD, 0xFFFD, 0x0178, +/* 0000 */ 0x20AC, 0x0081, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, +/* 0008 */ 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x008D, 0x008E, 0x008F, +/* 0010 */ 0x0090, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, +/* 0018 */ 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x009D, 0x009E, 0x0178, /* 0020 */ 0x0130, 0x015E, 0x0131, 0x015F, 0x00FF, /* End of table Total Length = 0x004A * 2 */ diff --git a/intl/uconv/ucvlatin/cp1255.uf b/intl/uconv/ucvlatin/cp1255.uf index 1420e1403fa..7feb494ae5e 100644 --- a/intl/uconv/ucvlatin/cp1255.uf +++ b/intl/uconv/ucvlatin/cp1255.uf @@ -5,10 +5,11 @@ /*======================================================== This is a Generated file. Please don't edit it. - The tool which used to generate this file is called fromu. - If you have any problem of this file. Please contact - Netscape Client International Team or - ftang@netscape + The tool which used to generate this file is called umaptable. + You can find this tool under mozilla/intl/uconv/tools/umaptable.c. + If you have any problems with this file, please file a bug + under the "Internationalization" component in + https://bugzilla.mozilla.org/enter_bug.cgi?product=Core Table in Debug form Begin of Item 0000 @@ -20,95 +21,106 @@ End of Item 0000 Begin of Item 0001 Format 0 - srcBegin = 00AB - srcEnd = 00B9 - destBegin = 00AB + srcBegin = 009C + srcEnd = 00A3 + destBegin = 009C End of Item 0001 Begin of Item 0002 Format 0 - srcBegin = 05B0 - srcEnd = 05B9 - destBegin = 00C0 + srcBegin = 00AB + srcEnd = 00B9 + destBegin = 00AB End of Item 0002 Begin of Item 0003 Format 0 - srcBegin = 05BB - srcEnd = 05C3 - destBegin = 00CB + srcBegin = 05B0 + srcEnd = 05B9 + destBegin = 00C0 End of Item 0003 Begin of Item 0004 Format 0 - srcBegin = 05D0 - srcEnd = 05EA - destBegin = 00E0 + srcBegin = 05BB + srcEnd = 05C3 + destBegin = 00CB End of Item 0004 Begin of Item 0005 - Format 1 - srcBegin = 00A0 - srcEnd = 00A9 - mappingOffset = 0000 - Mapping = - 00A0 00A1 00A2 00A3 FFFD 00A5 00A6 00A7 - 00A8 00A9 + Format 0 + srcBegin = 05D0 + srcEnd = 05EA + destBegin = 00E0 End of Item 0005 Begin of Item 0006 Format 1 - srcBegin = 00BB - srcEnd = 00BF - mappingOffset = 000A + srcBegin = 0081 + srcEnd = 00A9 + mappingOffset = 0000 Mapping = - 00BB 00BC 00BD 00BE 00BF + 0081 FFFD FFFD FFFD FFFD FFFD FFFD FFFD + FFFD 008A FFFD 008C 008D 008E 008F 0090 + FFFD FFFD FFFD FFFD FFFD FFFD FFFD FFFD + FFFD 009A FFFD FFFD FFFD FFFD FFFD FFFD + FFFD FFFD FFFD FFFD 00A5 00A6 00A7 00A8 + 00A9 End of Item 0006 Begin of Item 0007 - Format 2 - srcBegin = 00D7 - destBegin = 00AA + Format 1 + srcBegin = 00BB + srcEnd = 00BF + mappingOffset = 0029 + Mapping = + 00BB 00BC 00BD 00BE 00BF End of Item 0007 Begin of Item 0008 Format 2 - srcBegin = 00F7 - destBegin = 00BA + srcBegin = 00D7 + destBegin = 00AA End of Item 0008 Begin of Item 0009 Format 2 - srcBegin = 0192 - destBegin = 0083 + srcBegin = 00F7 + destBegin = 00BA End of Item 0009 Begin of Item 000A Format 2 - srcBegin = 02C6 - destBegin = 0088 + srcBegin = 0192 + destBegin = 0083 End of Item 000A Begin of Item 000B Format 2 - srcBegin = 02DC - destBegin = 0098 + srcBegin = 02C6 + destBegin = 0088 End of Item 000B Begin of Item 000C - Format 1 - srcBegin = 05F0 - srcEnd = 05F4 - mappingOffset = 000F - Mapping = - 00D4 00D5 00D6 00D7 00D8 + Format 2 + srcBegin = 02DC + destBegin = 0098 End of Item 000C Begin of Item 000D + Format 1 + srcBegin = 05F0 + srcEnd = 05F4 + mappingOffset = 002E + Mapping = + 00D4 00D5 00D6 00D7 00D8 +End of Item 000D + +Begin of Item 000E Format 1 srcBegin = 200E srcEnd = 203A - mappingOffset = 0014 + mappingOffset = 0033 Mapping = 00FD 00FE FFFD FFFD FFFD 0096 0097 FFFD FFFD FFFD 0091 0092 0082 FFFD 0093 0094 @@ -116,26 +128,26 @@ Begin of Item 000D 0085 FFFD FFFD FFFD FFFD FFFD FFFD FFFD FFFD FFFD 0089 FFFD FFFD FFFD FFFD FFFD FFFD FFFD FFFD 008B 009B -End of Item 000D - -Begin of Item 000E - Format 1 - srcBegin = 20AA - srcEnd = 20AC - mappingOffset = 0041 - Mapping = - 00A4 FFFD 0080 End of Item 000E Begin of Item 000F + Format 1 + srcBegin = 20AA + srcEnd = 20AC + mappingOffset = 0060 + Mapping = + 00A4 FFFD 0080 +End of Item 000F + +Begin of Item 0010 Format 2 srcBegin = 2122 destBegin = 0099 -End of Item 000F +End of Item 0010 ========================================================*/ /* Offset=0x0000 ItemOfList */ - 0x0010, + 0x0011, /*-------------------------------------------------------*/ /* Offset=0x0001 offsetToFormatArray */ 0x0004, @@ -144,43 +156,48 @@ End of Item 000F 0x0009, /*-------------------------------------------------------*/ /* Offset=0x0003 offsetToMappingTable */ - 0x0039, + 0x003C, /*-------------------------------------------------------*/ /* Offset=0x0004 Start of Format Array */ -/* Total of Format 0 : 0x0005 */ +/* Total of Format 0 : 0x0006 */ /* Total of Format 1 : 0x0005 */ /* Total of Format 2 : 0x0006 */ /* Total of Format 3 : 0x0000 */ -0x0000, 0x2110, 0x2222, 0x2111, 0x0000, +0x0000, 0x1100, 0x2222, 0x1112, 0x0002, /*-------------------------------------------------------*/ /* Offset=0x0009 Start of MapCell Array */ /* 0000 */ 0x0000, 0x007F, 0x0000, -/* 0001 */ 0x00AB, 0x00B9, 0x00AB, -/* 0002 */ 0x05B0, 0x05B9, 0x00C0, -/* 0003 */ 0x05BB, 0x05C3, 0x00CB, -/* 0004 */ 0x05D0, 0x05EA, 0x00E0, -/* 0005 */ 0x00A0, 0x00A9, 0x0000, -/* 0006 */ 0x00BB, 0x00BF, 0x000A, -/* 0007 */ 0x00D7, 0x0000, 0x00AA, -/* 0008 */ 0x00F7, 0x0000, 0x00BA, -/* 0009 */ 0x0192, 0x0000, 0x0083, -/* 000A */ 0x02C6, 0x0000, 0x0088, -/* 000B */ 0x02DC, 0x0000, 0x0098, -/* 000C */ 0x05F0, 0x05F4, 0x000F, -/* 000D */ 0x200E, 0x203A, 0x0014, -/* 000E */ 0x20AA, 0x20AC, 0x0041, -/* 000F */ 0x2122, 0x0000, 0x0099, +/* 0001 */ 0x009C, 0x00A3, 0x009C, +/* 0002 */ 0x00AB, 0x00B9, 0x00AB, +/* 0003 */ 0x05B0, 0x05B9, 0x00C0, +/* 0004 */ 0x05BB, 0x05C3, 0x00CB, +/* 0005 */ 0x05D0, 0x05EA, 0x00E0, +/* 0006 */ 0x0081, 0x00A9, 0x0000, +/* 0007 */ 0x00BB, 0x00BF, 0x0029, +/* 0008 */ 0x00D7, 0x0000, 0x00AA, +/* 0009 */ 0x00F7, 0x0000, 0x00BA, +/* 000A */ 0x0192, 0x0000, 0x0083, +/* 000B */ 0x02C6, 0x0000, 0x0088, +/* 000C */ 0x02DC, 0x0000, 0x0098, +/* 000D */ 0x05F0, 0x05F4, 0x002E, +/* 000E */ 0x200E, 0x203A, 0x0033, +/* 000F */ 0x20AA, 0x20AC, 0x0060, +/* 0010 */ 0x2122, 0x0000, 0x0099, /*-------------------------------------------------------*/ -/* Offset=0x0039 Start of MappingTable */ +/* Offset=0x003C Start of MappingTable */ -/* 0000 */ 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0xFFFD, 0x00A5, 0x00A6, 0x00A7, -/* 0008 */ 0x00A8, 0x00A9, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, 0x00D4, -/* 0010 */ 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00FD, 0x00FE, 0xFFFD, 0xFFFD, -/* 0018 */ 0xFFFD, 0x0096, 0x0097, 0xFFFD, 0xFFFD, 0xFFFD, 0x0091, 0x0092, -/* 0020 */ 0x0082, 0xFFFD, 0x0093, 0x0094, 0x0084, 0xFFFD, 0x0086, 0x0087, -/* 0028 */ 0x0095, 0xFFFD, 0xFFFD, 0xFFFD, 0x0085, 0xFFFD, 0xFFFD, 0xFFFD, -/* 0030 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x0089, 0xFFFD, -/* 0038 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x008B, -/* 0040 */ 0x009B, 0x00A4, 0xFFFD, 0x0080, -/* End of table Total Length = 0x007D * 2 */ +/* 0000 */ 0x0081, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 0008 */ 0xFFFD, 0x008A, 0xFFFD, 0x008C, 0x008D, 0x008E, 0x008F, 0x0090, +/* 0010 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 0018 */ 0xFFFD, 0x009A, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 0020 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x00A5, 0x00A6, 0x00A7, 0x00A8, +/* 0028 */ 0x00A9, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, 0x00D4, 0x00D5, +/* 0030 */ 0x00D6, 0x00D7, 0x00D8, 0x00FD, 0x00FE, 0xFFFD, 0xFFFD, 0xFFFD, +/* 0038 */ 0x0096, 0x0097, 0xFFFD, 0xFFFD, 0xFFFD, 0x0091, 0x0092, 0x0082, +/* 0040 */ 0xFFFD, 0x0093, 0x0094, 0x0084, 0xFFFD, 0x0086, 0x0087, 0x0095, +/* 0048 */ 0xFFFD, 0xFFFD, 0xFFFD, 0x0085, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 0050 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x0089, 0xFFFD, 0xFFFD, +/* 0058 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x008B, 0x009B, +/* 0060 */ 0x00A4, 0xFFFD, 0x0080, +/* End of table Total Length = 0x009F * 2 */ diff --git a/intl/uconv/ucvlatin/cp1255.ut b/intl/uconv/ucvlatin/cp1255.ut index 363935391de..8b56fdb550e 100644 --- a/intl/uconv/ucvlatin/cp1255.ut +++ b/intl/uconv/ucvlatin/cp1255.ut @@ -5,10 +5,11 @@ /*======================================================== This is a Generated file. Please don't edit it. - The tool which used to generate this file is called fromu. - If you have any problem of this file. Please contact - Netscape Client International Team or - ftang@netscape + The tool which used to generate this file is called umaptable. + You can find this tool under mozilla/intl/uconv/tools/umaptable.c. + If you have any problems with this file, please file a bug + under the "Internationalization" component in + https://bugzilla.mozilla.org/enter_bug.cgi?product=Core Table in Debug form Begin of Item 0000 @@ -20,76 +21,83 @@ End of Item 0000 Begin of Item 0001 Format 0 - srcBegin = 00AB - srcEnd = 00B9 - destBegin = 00AB + srcBegin = 009C + srcEnd = 00A3 + destBegin = 009C End of Item 0001 Begin of Item 0002 Format 0 - srcBegin = 00C0 - srcEnd = 00C9 - destBegin = 05B0 + srcBegin = 00AB + srcEnd = 00B9 + destBegin = 00AB End of Item 0002 Begin of Item 0003 Format 0 - srcBegin = 00CB - srcEnd = 00D3 - destBegin = 05BB + srcBegin = 00C0 + srcEnd = 00C9 + destBegin = 05B0 End of Item 0003 Begin of Item 0004 Format 0 - srcBegin = 00E0 - srcEnd = 00FA - destBegin = 05D0 + srcBegin = 00CB + srcEnd = 00D3 + destBegin = 05BB End of Item 0004 Begin of Item 0005 + Format 0 + srcBegin = 00E0 + srcEnd = 00FA + destBegin = 05D0 +End of Item 0005 + +Begin of Item 0006 Format 1 srcBegin = 0080 srcEnd = 00AA mappingOffset = 0000 Mapping = - 20AC FFFD 201A 0192 201E 2026 2020 2021 - 02C6 2030 FFFD 2039 FFFD FFFD FFFD FFFD - FFFD 2018 2019 201C 201D 2022 2013 2014 - 02DC 2122 FFFD 203A FFFD FFFD FFFD FFFD - 00A0 00A1 00A2 00A3 20AA 00A5 00A6 00A7 + 20AC 0081 201A 0192 201E 2026 2020 2021 + 02C6 2030 008A 2039 008C 008D 008E 008F + 0090 2018 2019 201C 201D 2022 2013 2014 + 02DC 2122 009A 203A FFFD FFFD FFFD FFFD + FFFD FFFD FFFD FFFD 20AA 00A5 00A6 00A7 00A8 00A9 00D7 -End of Item 0005 +End of Item 0006 -Begin of Item 0006 +Begin of Item 0007 Format 1 srcBegin = 00BA srcEnd = 00BF mappingOffset = 002B Mapping = 00F7 00BB 00BC 00BD 00BE 00BF -End of Item 0006 +End of Item 0007 -Begin of Item 0007 +Begin of Item 0008 Format 1 srcBegin = 00D4 srcEnd = 00D8 mappingOffset = 0031 Mapping = 05F0 05F1 05F2 05F3 05F4 -End of Item 0007 +End of Item 0008 -Begin of Item 0008 +Begin of Item 0009 Format 1 srcBegin = 00FD srcEnd = 00FE mappingOffset = 0036 Mapping = 200E 200F -End of Item 0008 +End of Item 0009 ========================================================*/ /* Offset=0x0000 ItemOfList */ - 0x0009, + 0x000A, /*-------------------------------------------------------*/ /* Offset=0x0001 offsetToFormatArray */ 0x0004, @@ -98,34 +106,35 @@ End of Item 0008 0x0007, /*-------------------------------------------------------*/ /* Offset=0x0003 offsetToMappingTable */ - 0x0022, + 0x0025, /*-------------------------------------------------------*/ /* Offset=0x0004 Start of Format Array */ -/* Total of Format 0 : 0x0005 */ +/* Total of Format 0 : 0x0006 */ /* Total of Format 1 : 0x0004 */ /* Total of Format 2 : 0x0000 */ /* Total of Format 3 : 0x0000 */ -0x0000, 0x1110, 0x0001, +0x0000, 0x1100, 0x0011, /*-------------------------------------------------------*/ /* Offset=0x0007 Start of MapCell Array */ /* 0000 */ 0x0000, 0x007F, 0x0000, -/* 0001 */ 0x00AB, 0x00B9, 0x00AB, -/* 0002 */ 0x00C0, 0x00C9, 0x05B0, -/* 0003 */ 0x00CB, 0x00D3, 0x05BB, -/* 0004 */ 0x00E0, 0x00FA, 0x05D0, -/* 0005 */ 0x0080, 0x00AA, 0x0000, -/* 0006 */ 0x00BA, 0x00BF, 0x002B, -/* 0007 */ 0x00D4, 0x00D8, 0x0031, -/* 0008 */ 0x00FD, 0x00FE, 0x0036, +/* 0001 */ 0x009C, 0x00A3, 0x009C, +/* 0002 */ 0x00AB, 0x00B9, 0x00AB, +/* 0003 */ 0x00C0, 0x00C9, 0x05B0, +/* 0004 */ 0x00CB, 0x00D3, 0x05BB, +/* 0005 */ 0x00E0, 0x00FA, 0x05D0, +/* 0006 */ 0x0080, 0x00AA, 0x0000, +/* 0007 */ 0x00BA, 0x00BF, 0x002B, +/* 0008 */ 0x00D4, 0x00D8, 0x0031, +/* 0009 */ 0x00FD, 0x00FE, 0x0036, /*-------------------------------------------------------*/ -/* Offset=0x0022 Start of MappingTable */ +/* Offset=0x0025 Start of MappingTable */ -/* 0000 */ 0x20AC, 0xFFFD, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, -/* 0008 */ 0x02C6, 0x2030, 0xFFFD, 0x2039, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, -/* 0010 */ 0xFFFD, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, -/* 0018 */ 0x02DC, 0x2122, 0xFFFD, 0x203A, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, -/* 0020 */ 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x20AA, 0x00A5, 0x00A6, 0x00A7, +/* 0000 */ 0x20AC, 0x0081, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, +/* 0008 */ 0x02C6, 0x2030, 0x008A, 0x2039, 0x008C, 0x008D, 0x008E, 0x008F, +/* 0010 */ 0x0090, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, +/* 0018 */ 0x02DC, 0x2122, 0x009A, 0x203A, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 0020 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x20AA, 0x00A5, 0x00A6, 0x00A7, /* 0028 */ 0x00A8, 0x00A9, 0x00D7, 0x00F7, 0x00BB, 0x00BC, 0x00BD, 0x00BE, /* 0030 */ 0x00BF, 0x05F0, 0x05F1, 0x05F2, 0x05F3, 0x05F4, 0x200E, 0x200F, -/* End of table Total Length = 0x005A * 2 */ +/* End of table Total Length = 0x005D * 2 */ diff --git a/intl/uconv/ucvlatin/cp1256.uf b/intl/uconv/ucvlatin/cp1256.uf index b368730a4c2..8ea801c997c 100644 --- a/intl/uconv/ucvlatin/cp1256.uf +++ b/intl/uconv/ucvlatin/cp1256.uf @@ -7,9 +7,9 @@ The tool which used to generate this file is called umaptable. You can find this tool under mozilla/intl/uconv/tools/umaptable.c. - If you have any problem of this file. Please contact - Netscape Client International Team or - ftang@netscape + If you have any problems with this file, please file a bug + under the "Internationalization" component in + https://bugzilla.mozilla.org/enter_bug.cgi?product=Core Table in Debug form Begin of Item 0000 diff --git a/intl/uconv/ucvlatin/cp1256.ut b/intl/uconv/ucvlatin/cp1256.ut index 1d360d0c3da..512474bb85c 100644 --- a/intl/uconv/ucvlatin/cp1256.ut +++ b/intl/uconv/ucvlatin/cp1256.ut @@ -7,9 +7,9 @@ The tool which used to generate this file is called umaptable. You can find this tool under mozilla/intl/uconv/tools/umaptable.c. - If you have any problem of this file. Please contact - Netscape Client International Team or - ftang@netscape + If you have any problems with this file, please file a bug + under the "Internationalization" component in + https://bugzilla.mozilla.org/enter_bug.cgi?product=Core Table in Debug form Begin of Item 0000 diff --git a/intl/uconv/ucvlatin/cp1257.uf b/intl/uconv/ucvlatin/cp1257.uf index 8f617e90961..09abd391b02 100644 --- a/intl/uconv/ucvlatin/cp1257.uf +++ b/intl/uconv/ucvlatin/cp1257.uf @@ -5,10 +5,11 @@ /*======================================================== This is a Generated file. Please don't edit it. - The tool which used to generate this file is called fromu. - If you have any problem of this file. Please contact - Netscape Client International Team or - ftang@netscape + The tool which used to generate this file is called umaptable. + You can find this tool under mozilla/intl/uconv/tools/umaptable.c. + If you have any problems with this file, please file a bug + under the "Internationalization" component in + https://bugzilla.mozilla.org/enter_bug.cgi?product=Core Table in Debug form Begin of Item 0000 @@ -27,38 +28,42 @@ End of Item 0001 Begin of Item 0002 Format 1 - srcBegin = 00A0 + srcBegin = 0081 srcEnd = 017E mappingOffset = 0000 Mapping = - 00A0 FFFD 00A2 00A3 00A4 FFFD 00A6 00A7 - 008D 00A9 FFFD 00AB 00AC 00AD 00AE 009D - FFFD FFFD FFFD FFFD FFFD FFFD FFFD FFFD - 008F 00B9 FFFD 00BB 00BC 00BD 00BE FFFD - FFFD FFFD FFFD FFFD 00C4 00C5 00AF FFFD - FFFD 00C9 FFFD FFFD FFFD FFFD FFFD FFFD - FFFD FFFD FFFD 00D3 FFFD 00D5 00D6 00D7 - 00A8 FFFD FFFD FFFD 00DC FFFD FFFD 00DF - FFFD FFFD FFFD FFFD 00E4 00E5 00BF FFFD - FFFD 00E9 FFFD FFFD FFFD FFFD FFFD FFFD - FFFD FFFD FFFD 00F3 FFFD 00F5 00F6 00F7 - 00B8 FFFD FFFD FFFD 00FC FFFD FFFD FFFD - 00C2 00E2 FFFD FFFD 00C0 00E0 00C3 00E3 - FFFD FFFD FFFD FFFD 00C8 00E8 FFFD FFFD - FFFD FFFD 00C7 00E7 FFFD FFFD 00CB 00EB - 00C6 00E6 FFFD FFFD FFFD FFFD FFFD FFFD - FFFD FFFD 00CC 00EC FFFD FFFD FFFD FFFD - FFFD FFFD 00CE 00EE FFFD FFFD 00C1 00E1 - FFFD FFFD FFFD FFFD FFFD FFFD 00CD 00ED - FFFD FFFD FFFD 00CF 00EF FFFD FFFD FFFD - FFFD 00D9 00F9 00D1 00F1 00D2 00F2 FFFD - FFFD FFFD FFFD FFFD 00D4 00F4 FFFD FFFD - FFFD FFFD FFFD FFFD FFFD FFFD 00AA 00BA - FFFD FFFD 00DA 00FA FFFD FFFD FFFD FFFD - 00D0 00F0 FFFD FFFD FFFD FFFD FFFD FFFD - FFFD FFFD 00DB 00FB FFFD FFFD FFFD FFFD - FFFD FFFD 00D8 00F8 FFFD FFFD FFFD FFFD - FFFD 00CA 00EA 00DD 00FD 00DE 00FE + 0081 FFFD 0083 FFFD FFFD FFFD FFFD 0088 + FFFD 008A FFFD 008C FFFD FFFD FFFD 0090 + FFFD FFFD FFFD FFFD FFFD FFFD FFFD 0098 + FFFD 009A FFFD 009C FFFD FFFD 009F 00A0 + FFFD 00A2 00A3 00A4 FFFD 00A6 00A7 008D + 00A9 FFFD 00AB 00AC 00AD 00AE 009D FFFD + FFFD FFFD FFFD FFFD FFFD FFFD FFFD 008F + 00B9 FFFD 00BB 00BC 00BD 00BE FFFD FFFD + FFFD FFFD FFFD 00C4 00C5 00AF FFFD FFFD + 00C9 FFFD FFFD FFFD FFFD FFFD FFFD FFFD + FFFD FFFD 00D3 FFFD 00D5 00D6 00D7 00A8 + FFFD FFFD FFFD 00DC FFFD FFFD 00DF FFFD + FFFD FFFD FFFD 00E4 00E5 00BF FFFD FFFD + 00E9 FFFD FFFD FFFD FFFD FFFD FFFD FFFD + FFFD FFFD 00F3 FFFD 00F5 00F6 00F7 00B8 + FFFD FFFD FFFD 00FC FFFD FFFD FFFD 00C2 + 00E2 FFFD FFFD 00C0 00E0 00C3 00E3 FFFD + FFFD FFFD FFFD 00C8 00E8 FFFD FFFD FFFD + FFFD 00C7 00E7 FFFD FFFD 00CB 00EB 00C6 + 00E6 FFFD FFFD FFFD FFFD FFFD FFFD FFFD + FFFD 00CC 00EC FFFD FFFD FFFD FFFD FFFD + FFFD 00CE 00EE FFFD FFFD 00C1 00E1 FFFD + FFFD FFFD FFFD FFFD FFFD 00CD 00ED FFFD + FFFD FFFD 00CF 00EF FFFD FFFD FFFD FFFD + 00D9 00F9 00D1 00F1 00D2 00F2 FFFD FFFD + FFFD FFFD FFFD 00D4 00F4 FFFD FFFD FFFD + FFFD FFFD FFFD FFFD FFFD 00AA 00BA FFFD + FFFD 00DA 00FA FFFD FFFD FFFD FFFD 00D0 + 00F0 FFFD FFFD FFFD FFFD FFFD FFFD FFFD + FFFD 00DB 00FB FFFD FFFD FFFD FFFD FFFD + FFFD 00D8 00F8 FFFD FFFD FFFD FFFD FFFD + 00CA 00EA 00DD 00FD 00DE 00FE End of Item 0002 Begin of Item 0003 @@ -71,7 +76,7 @@ Begin of Item 0004 Format 1 srcBegin = 02D9 srcEnd = 02DB - mappingOffset = 00DF + mappingOffset = 00FE Mapping = 00FF FFFD 009E End of Item 0004 @@ -80,7 +85,7 @@ Begin of Item 0005 Format 1 srcBegin = 2013 srcEnd = 203A - mappingOffset = 00E2 + mappingOffset = 0101 Mapping = 0096 0097 FFFD FFFD FFFD 0091 0092 0082 FFFD 0093 0094 0084 FFFD 0086 0087 0095 @@ -125,47 +130,51 @@ End of Item 0007 /* Offset=0x0007 Start of MapCell Array */ /* 0000 */ 0x0000, 0x007F, 0x0000, /* 0001 */ 0x00B0, 0x00B7, 0x00B0, -/* 0002 */ 0x00A0, 0x017E, 0x0000, +/* 0002 */ 0x0081, 0x017E, 0x0000, /* 0003 */ 0x02C7, 0x0000, 0x008E, -/* 0004 */ 0x02D9, 0x02DB, 0x00DF, -/* 0005 */ 0x2013, 0x203A, 0x00E2, +/* 0004 */ 0x02D9, 0x02DB, 0x00FE, +/* 0005 */ 0x2013, 0x203A, 0x0101, /* 0006 */ 0x20AC, 0x0000, 0x0080, /* 0007 */ 0x2122, 0x0000, 0x0099, /*-------------------------------------------------------*/ /* Offset=0x001F Start of MappingTable */ -/* 0000 */ 0x00A0, 0xFFFD, 0x00A2, 0x00A3, 0x00A4, 0xFFFD, 0x00A6, 0x00A7, -/* 0008 */ 0x008D, 0x00A9, 0xFFFD, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x009D, -/* 0010 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, -/* 0018 */ 0x008F, 0x00B9, 0xFFFD, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0xFFFD, -/* 0020 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x00C4, 0x00C5, 0x00AF, 0xFFFD, -/* 0028 */ 0xFFFD, 0x00C9, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, -/* 0030 */ 0xFFFD, 0xFFFD, 0xFFFD, 0x00D3, 0xFFFD, 0x00D5, 0x00D6, 0x00D7, -/* 0038 */ 0x00A8, 0xFFFD, 0xFFFD, 0xFFFD, 0x00DC, 0xFFFD, 0xFFFD, 0x00DF, -/* 0040 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x00E4, 0x00E5, 0x00BF, 0xFFFD, -/* 0048 */ 0xFFFD, 0x00E9, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, -/* 0050 */ 0xFFFD, 0xFFFD, 0xFFFD, 0x00F3, 0xFFFD, 0x00F5, 0x00F6, 0x00F7, -/* 0058 */ 0x00B8, 0xFFFD, 0xFFFD, 0xFFFD, 0x00FC, 0xFFFD, 0xFFFD, 0xFFFD, -/* 0060 */ 0x00C2, 0x00E2, 0xFFFD, 0xFFFD, 0x00C0, 0x00E0, 0x00C3, 0x00E3, -/* 0068 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x00C8, 0x00E8, 0xFFFD, 0xFFFD, -/* 0070 */ 0xFFFD, 0xFFFD, 0x00C7, 0x00E7, 0xFFFD, 0xFFFD, 0x00CB, 0x00EB, -/* 0078 */ 0x00C6, 0x00E6, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, -/* 0080 */ 0xFFFD, 0xFFFD, 0x00CC, 0x00EC, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, -/* 0088 */ 0xFFFD, 0xFFFD, 0x00CE, 0x00EE, 0xFFFD, 0xFFFD, 0x00C1, 0x00E1, -/* 0090 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x00CD, 0x00ED, -/* 0098 */ 0xFFFD, 0xFFFD, 0xFFFD, 0x00CF, 0x00EF, 0xFFFD, 0xFFFD, 0xFFFD, -/* 00A0 */ 0xFFFD, 0x00D9, 0x00F9, 0x00D1, 0x00F1, 0x00D2, 0x00F2, 0xFFFD, -/* 00A8 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x00D4, 0x00F4, 0xFFFD, 0xFFFD, -/* 00B0 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x00AA, 0x00BA, -/* 00B8 */ 0xFFFD, 0xFFFD, 0x00DA, 0x00FA, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, -/* 00C0 */ 0x00D0, 0x00F0, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, -/* 00C8 */ 0xFFFD, 0xFFFD, 0x00DB, 0x00FB, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, -/* 00D0 */ 0xFFFD, 0xFFFD, 0x00D8, 0x00F8, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, -/* 00D8 */ 0xFFFD, 0x00CA, 0x00EA, 0x00DD, 0x00FD, 0x00DE, 0x00FE, 0x00FF, -/* 00E0 */ 0xFFFD, 0x009E, 0x0096, 0x0097, 0xFFFD, 0xFFFD, 0xFFFD, 0x0091, -/* 00E8 */ 0x0092, 0x0082, 0xFFFD, 0x0093, 0x0094, 0x0084, 0xFFFD, 0x0086, -/* 00F0 */ 0x0087, 0x0095, 0xFFFD, 0xFFFD, 0xFFFD, 0x0085, 0xFFFD, 0xFFFD, -/* 00F8 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x0089, -/* 0100 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, -/* 0108 */ 0x008B, 0x009B, -/* End of table Total Length = 0x0129 * 2 */ +/* 0000 */ 0x0081, 0xFFFD, 0x0083, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x0088, +/* 0008 */ 0xFFFD, 0x008A, 0xFFFD, 0x008C, 0xFFFD, 0xFFFD, 0xFFFD, 0x0090, +/* 0010 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x0098, +/* 0018 */ 0xFFFD, 0x009A, 0xFFFD, 0x009C, 0xFFFD, 0xFFFD, 0x009F, 0x00A0, +/* 0020 */ 0xFFFD, 0x00A2, 0x00A3, 0x00A4, 0xFFFD, 0x00A6, 0x00A7, 0x008D, +/* 0028 */ 0x00A9, 0xFFFD, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x009D, 0xFFFD, +/* 0030 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x008F, +/* 0038 */ 0x00B9, 0xFFFD, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0xFFFD, 0xFFFD, +/* 0040 */ 0xFFFD, 0xFFFD, 0xFFFD, 0x00C4, 0x00C5, 0x00AF, 0xFFFD, 0xFFFD, +/* 0048 */ 0x00C9, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 0050 */ 0xFFFD, 0xFFFD, 0x00D3, 0xFFFD, 0x00D5, 0x00D6, 0x00D7, 0x00A8, +/* 0058 */ 0xFFFD, 0xFFFD, 0xFFFD, 0x00DC, 0xFFFD, 0xFFFD, 0x00DF, 0xFFFD, +/* 0060 */ 0xFFFD, 0xFFFD, 0xFFFD, 0x00E4, 0x00E5, 0x00BF, 0xFFFD, 0xFFFD, +/* 0068 */ 0x00E9, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 0070 */ 0xFFFD, 0xFFFD, 0x00F3, 0xFFFD, 0x00F5, 0x00F6, 0x00F7, 0x00B8, +/* 0078 */ 0xFFFD, 0xFFFD, 0xFFFD, 0x00FC, 0xFFFD, 0xFFFD, 0xFFFD, 0x00C2, +/* 0080 */ 0x00E2, 0xFFFD, 0xFFFD, 0x00C0, 0x00E0, 0x00C3, 0x00E3, 0xFFFD, +/* 0088 */ 0xFFFD, 0xFFFD, 0xFFFD, 0x00C8, 0x00E8, 0xFFFD, 0xFFFD, 0xFFFD, +/* 0090 */ 0xFFFD, 0x00C7, 0x00E7, 0xFFFD, 0xFFFD, 0x00CB, 0x00EB, 0x00C6, +/* 0098 */ 0x00E6, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 00A0 */ 0xFFFD, 0x00CC, 0x00EC, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 00A8 */ 0xFFFD, 0x00CE, 0x00EE, 0xFFFD, 0xFFFD, 0x00C1, 0x00E1, 0xFFFD, +/* 00B0 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x00CD, 0x00ED, 0xFFFD, +/* 00B8 */ 0xFFFD, 0xFFFD, 0x00CF, 0x00EF, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 00C0 */ 0x00D9, 0x00F9, 0x00D1, 0x00F1, 0x00D2, 0x00F2, 0xFFFD, 0xFFFD, +/* 00C8 */ 0xFFFD, 0xFFFD, 0xFFFD, 0x00D4, 0x00F4, 0xFFFD, 0xFFFD, 0xFFFD, +/* 00D0 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x00AA, 0x00BA, 0xFFFD, +/* 00D8 */ 0xFFFD, 0x00DA, 0x00FA, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x00D0, +/* 00E0 */ 0x00F0, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 00E8 */ 0xFFFD, 0x00DB, 0x00FB, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 00F0 */ 0xFFFD, 0x00D8, 0x00F8, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 00F8 */ 0x00CA, 0x00EA, 0x00DD, 0x00FD, 0x00DE, 0x00FE, 0x00FF, 0xFFFD, +/* 0100 */ 0x009E, 0x0096, 0x0097, 0xFFFD, 0xFFFD, 0xFFFD, 0x0091, 0x0092, +/* 0108 */ 0x0082, 0xFFFD, 0x0093, 0x0094, 0x0084, 0xFFFD, 0x0086, 0x0087, +/* 0110 */ 0x0095, 0xFFFD, 0xFFFD, 0xFFFD, 0x0085, 0xFFFD, 0xFFFD, 0xFFFD, +/* 0118 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x0089, 0xFFFD, +/* 0120 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x008B, +/* 0128 */ 0x009B, +/* End of table Total Length = 0x0148 * 2 */ diff --git a/intl/uconv/ucvlatin/cp1257.ut b/intl/uconv/ucvlatin/cp1257.ut index 1d6b62d007e..59bc9d18340 100644 --- a/intl/uconv/ucvlatin/cp1257.ut +++ b/intl/uconv/ucvlatin/cp1257.ut @@ -5,10 +5,11 @@ /*======================================================== This is a Generated file. Please don't edit it. - The tool which used to generate this file is called fromu. - If you have any problem of this file. Please contact - Netscape Client International Team or - ftang@netscape + The tool which used to generate this file is called umaptable. + You can find this tool under mozilla/intl/uconv/tools/umaptable.c. + If you have any problems with this file, please file a bug + under the "Internationalization" component in + https://bugzilla.mozilla.org/enter_bug.cgi?product=Core Table in Debug form Begin of Item 0000 @@ -31,10 +32,10 @@ Begin of Item 0002 srcEnd = 00FF mappingOffset = 0000 Mapping = - 20AC FFFD 201A FFFD 201E 2026 2020 2021 - FFFD 2030 FFFD 2039 FFFD 00A8 02C7 00B8 - FFFD 2018 2019 201C 201D 2022 2013 2014 - FFFD 2122 FFFD 203A FFFD 00AF 02DB FFFD + 20AC 0081 201A 0083 201E 2026 2020 2021 + 0088 2030 008A 2039 008C 00A8 02C7 00B8 + 0090 2018 2019 201C 201D 2022 2013 2014 + 0098 2122 009A 203A 009C 00AF 02DB 009F 00A0 FFFD 00A2 00A3 00A4 FFFD 00A6 00A7 00D8 00A9 0156 00AB 00AC 00AD 00AE 00C6 FFFD FFFD FFFD FFFD FFFD FFFD FFFD FFFD @@ -77,10 +78,10 @@ End of Item 0002 /*-------------------------------------------------------*/ /* Offset=0x000E Start of MappingTable */ -/* 0000 */ 0x20AC, 0xFFFD, 0x201A, 0xFFFD, 0x201E, 0x2026, 0x2020, 0x2021, -/* 0008 */ 0xFFFD, 0x2030, 0xFFFD, 0x2039, 0xFFFD, 0x00A8, 0x02C7, 0x00B8, -/* 0010 */ 0xFFFD, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, -/* 0018 */ 0xFFFD, 0x2122, 0xFFFD, 0x203A, 0xFFFD, 0x00AF, 0x02DB, 0xFFFD, +/* 0000 */ 0x20AC, 0x0081, 0x201A, 0x0083, 0x201E, 0x2026, 0x2020, 0x2021, +/* 0008 */ 0x0088, 0x2030, 0x008A, 0x2039, 0x008C, 0x00A8, 0x02C7, 0x00B8, +/* 0010 */ 0x0090, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, +/* 0018 */ 0x0098, 0x2122, 0x009A, 0x203A, 0x009C, 0x00AF, 0x02DB, 0x009F, /* 0020 */ 0x00A0, 0xFFFD, 0x00A2, 0x00A3, 0x00A4, 0xFFFD, 0x00A6, 0x00A7, /* 0028 */ 0x00D8, 0x00A9, 0x0156, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00C6, /* 0030 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, diff --git a/intl/uconv/ucvlatin/cp1258.uf b/intl/uconv/ucvlatin/cp1258.uf index 70b277266be..902e87755d6 100644 --- a/intl/uconv/ucvlatin/cp1258.uf +++ b/intl/uconv/ucvlatin/cp1258.uf @@ -7,9 +7,9 @@ The tool which used to generate this file is called umaptable. You can find this tool under mozilla/intl/uconv/tools/umaptable.c. - If you have any problem of this file. Please contact - Netscape Client International Team or - ftang@netscape + If you have any problems with this file, please file a bug + under the "Internationalization" component in + https://bugzilla.mozilla.org/enter_bug.cgi?product=Core Table in Debug form Begin of Item 0000 @@ -55,10 +55,22 @@ Begin of Item 0005 End of Item 0005 Begin of Item 0006 + Format 1 + srcBegin = 0081 + srcEnd = 009E + mappingOffset = 0000 + Mapping = + 0081 FFFD FFFD FFFD FFFD FFFD FFFD FFFD + FFFD 008A FFFD FFFD 008D 008E 008F 0090 + FFFD FFFD FFFD FFFD FFFD FFFD FFFD FFFD + FFFD 009A FFFD FFFD 009D 009E +End of Item 0006 + +Begin of Item 0007 Format 1 srcBegin = 00CD srcEnd = 0103 - mappingOffset = 0000 + mappingOffset = 001E Mapping = 00CD 00CE 00CF FFFD 00D1 FFFD 00D3 00D4 FFFD FFFD FFFD FFFD FFFD FFFD FFFD FFFD @@ -67,115 +79,115 @@ Begin of Item 0006 00ED 00EE 00EF FFFD 00F1 FFFD 00F3 00F4 FFFD FFFD FFFD FFFD FFFD FFFD FFFD FFFD FFFD FFFD 00FF FFFD FFFD 00C3 00E3 -End of Item 0006 - -Begin of Item 0007 - Format 1 - srcBegin = 0110 - srcEnd = 0111 - mappingOffset = 0037 - Mapping = - 00D0 00F0 End of Item 0007 Begin of Item 0008 Format 1 - srcBegin = 0152 - srcEnd = 0153 - mappingOffset = 0039 + srcBegin = 0110 + srcEnd = 0111 + mappingOffset = 0055 Mapping = - 008C 009C + 00D0 00F0 End of Item 0008 Begin of Item 0009 - Format 2 - srcBegin = 0178 - destBegin = 009F + Format 1 + srcBegin = 0152 + srcEnd = 0153 + mappingOffset = 0057 + Mapping = + 008C 009C End of Item 0009 Begin of Item 000A Format 2 - srcBegin = 0192 - destBegin = 0083 + srcBegin = 0178 + destBegin = 009F End of Item 000A Begin of Item 000B - Format 1 - srcBegin = 01A0 - srcEnd = 01A1 - mappingOffset = 003B - Mapping = - 00D5 00F5 + Format 2 + srcBegin = 0192 + destBegin = 0083 End of Item 000B Begin of Item 000C Format 1 - srcBegin = 01AF - srcEnd = 01B0 - mappingOffset = 003D + srcBegin = 01A0 + srcEnd = 01A1 + mappingOffset = 0059 Mapping = - 00DD 00FD + 00D5 00F5 End of Item 000C Begin of Item 000D - Format 2 - srcBegin = 02C6 - destBegin = 0088 + Format 1 + srcBegin = 01AF + srcEnd = 01B0 + mappingOffset = 005B + Mapping = + 00DD 00FD End of Item 000D Begin of Item 000E Format 2 - srcBegin = 02DC - destBegin = 0098 + srcBegin = 02C6 + destBegin = 0088 End of Item 000E Begin of Item 000F - Format 1 - srcBegin = 0300 - srcEnd = 0309 - mappingOffset = 003F - Mapping = - 00CC 00EC FFFD 00DE FFFD FFFD FFFD FFFD - FFFD 00D2 + Format 2 + srcBegin = 02DC + destBegin = 0098 End of Item 000F Begin of Item 0010 - Format 2 - srcBegin = 0323 - destBegin = 00F2 + Format 1 + srcBegin = 0300 + srcEnd = 0309 + mappingOffset = 005D + Mapping = + 00CC 00EC FFFD 00DE FFFD FFFD FFFD FFFD + FFFD 00D2 End of Item 0010 Begin of Item 0011 + Format 2 + srcBegin = 0323 + destBegin = 00F2 +End of Item 0011 + +Begin of Item 0012 Format 1 srcBegin = 2013 srcEnd = 203A - mappingOffset = 0049 + mappingOffset = 0067 Mapping = 0096 0097 FFFD FFFD FFFD 0091 0092 0082 FFFD 0093 0094 0084 FFFD 0086 0087 0095 FFFD FFFD FFFD 0085 FFFD FFFD FFFD FFFD FFFD FFFD FFFD FFFD FFFD 0089 FFFD FFFD FFFD FFFD FFFD FFFD FFFD FFFD 008B 009B -End of Item 0011 - -Begin of Item 0012 - Format 1 - srcBegin = 20AB - srcEnd = 20AC - mappingOffset = 0071 - Mapping = - 00FE 0080 End of Item 0012 Begin of Item 0013 + Format 1 + srcBegin = 20AB + srcEnd = 20AC + mappingOffset = 008F + Mapping = + 00FE 0080 +End of Item 0013 + +Begin of Item 0014 Format 2 srcBegin = 2122 destBegin = 0099 -End of Item 0013 +End of Item 0014 ========================================================*/ /* Offset=0x0000 ItemOfList */ - 0x0014, + 0x0015, /*-------------------------------------------------------*/ /* Offset=0x0001 offsetToFormatArray */ 0x0004, @@ -184,15 +196,15 @@ End of Item 0013 0x000A, /*-------------------------------------------------------*/ /* Offset=0x0003 offsetToMappingTable */ - 0x0046, + 0x0049, /*-------------------------------------------------------*/ /* Offset=0x0004 Start of Format Array */ /* Total of Format 0 : 0x0006 */ -/* Total of Format 1 : 0x0008 */ +/* Total of Format 1 : 0x0009 */ /* Total of Format 2 : 0x0006 */ /* Total of Format 3 : 0x0000 */ -0x0000, 0x1100, 0x1221, 0x1221, 0x2112, 0x0000, +0x0000, 0x1100, 0x2211, 0x2211, 0x1121, 0x0002, /*-------------------------------------------------------*/ /* Offset=0x000A Start of MapCell Array */ /* 0000 */ 0x0000, 0x007F, 0x0000, @@ -201,36 +213,41 @@ End of Item 0013 /* 0003 */ 0x00D6, 0x00DC, 0x00D6, /* 0004 */ 0x00E4, 0x00EB, 0x00E4, /* 0005 */ 0x00F6, 0x00FC, 0x00F6, -/* 0006 */ 0x00CD, 0x0103, 0x0000, -/* 0007 */ 0x0110, 0x0111, 0x0037, -/* 0008 */ 0x0152, 0x0153, 0x0039, -/* 0009 */ 0x0178, 0x0000, 0x009F, -/* 000A */ 0x0192, 0x0000, 0x0083, -/* 000B */ 0x01A0, 0x01A1, 0x003B, -/* 000C */ 0x01AF, 0x01B0, 0x003D, -/* 000D */ 0x02C6, 0x0000, 0x0088, -/* 000E */ 0x02DC, 0x0000, 0x0098, -/* 000F */ 0x0300, 0x0309, 0x003F, -/* 0010 */ 0x0323, 0x0000, 0x00F2, -/* 0011 */ 0x2013, 0x203A, 0x0049, -/* 0012 */ 0x20AB, 0x20AC, 0x0071, -/* 0013 */ 0x2122, 0x0000, 0x0099, +/* 0006 */ 0x0081, 0x009E, 0x0000, +/* 0007 */ 0x00CD, 0x0103, 0x001E, +/* 0008 */ 0x0110, 0x0111, 0x0055, +/* 0009 */ 0x0152, 0x0153, 0x0057, +/* 000A */ 0x0178, 0x0000, 0x009F, +/* 000B */ 0x0192, 0x0000, 0x0083, +/* 000C */ 0x01A0, 0x01A1, 0x0059, +/* 000D */ 0x01AF, 0x01B0, 0x005B, +/* 000E */ 0x02C6, 0x0000, 0x0088, +/* 000F */ 0x02DC, 0x0000, 0x0098, +/* 0010 */ 0x0300, 0x0309, 0x005D, +/* 0011 */ 0x0323, 0x0000, 0x00F2, +/* 0012 */ 0x2013, 0x203A, 0x0067, +/* 0013 */ 0x20AB, 0x20AC, 0x008F, +/* 0014 */ 0x2122, 0x0000, 0x0099, /*-------------------------------------------------------*/ -/* Offset=0x0046 Start of MappingTable */ +/* Offset=0x0049 Start of MappingTable */ -/* 0000 */ 0x00CD, 0x00CE, 0x00CF, 0xFFFD, 0x00D1, 0xFFFD, 0x00D3, 0x00D4, -/* 0008 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, -/* 0010 */ 0xFFFD, 0xFFFD, 0x00DF, 0x00E0, 0x00E1, 0x00E2, 0xFFFD, 0xFFFD, -/* 0018 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, -/* 0020 */ 0x00ED, 0x00EE, 0x00EF, 0xFFFD, 0x00F1, 0xFFFD, 0x00F3, 0x00F4, +/* 0000 */ 0x0081, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 0008 */ 0xFFFD, 0x008A, 0xFFFD, 0xFFFD, 0x008D, 0x008E, 0x008F, 0x0090, +/* 0010 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 0018 */ 0xFFFD, 0x009A, 0xFFFD, 0xFFFD, 0x009D, 0x009E, 0x00CD, 0x00CE, +/* 0020 */ 0x00CF, 0xFFFD, 0x00D1, 0xFFFD, 0x00D3, 0x00D4, 0xFFFD, 0xFFFD, /* 0028 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, -/* 0030 */ 0xFFFD, 0xFFFD, 0x00FF, 0xFFFD, 0xFFFD, 0x00C3, 0x00E3, 0x00D0, -/* 0038 */ 0x00F0, 0x008C, 0x009C, 0x00D5, 0x00F5, 0x00DD, 0x00FD, 0x00CC, -/* 0040 */ 0x00EC, 0xFFFD, 0x00DE, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, -/* 0048 */ 0x00D2, 0x0096, 0x0097, 0xFFFD, 0xFFFD, 0xFFFD, 0x0091, 0x0092, -/* 0050 */ 0x0082, 0xFFFD, 0x0093, 0x0094, 0x0084, 0xFFFD, 0x0086, 0x0087, -/* 0058 */ 0x0095, 0xFFFD, 0xFFFD, 0xFFFD, 0x0085, 0xFFFD, 0xFFFD, 0xFFFD, -/* 0060 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x0089, 0xFFFD, -/* 0068 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x008B, -/* 0070 */ 0x009B, 0x00FE, 0x0080, -/* End of table Total Length = 0x00B9 * 2 */ +/* 0030 */ 0x00DF, 0x00E0, 0x00E1, 0x00E2, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 0038 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x00ED, 0x00EE, +/* 0040 */ 0x00EF, 0xFFFD, 0x00F1, 0xFFFD, 0x00F3, 0x00F4, 0xFFFD, 0xFFFD, +/* 0048 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 0050 */ 0x00FF, 0xFFFD, 0xFFFD, 0x00C3, 0x00E3, 0x00D0, 0x00F0, 0x008C, +/* 0058 */ 0x009C, 0x00D5, 0x00F5, 0x00DD, 0x00FD, 0x00CC, 0x00EC, 0xFFFD, +/* 0060 */ 0x00DE, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x00D2, 0x0096, +/* 0068 */ 0x0097, 0xFFFD, 0xFFFD, 0xFFFD, 0x0091, 0x0092, 0x0082, 0xFFFD, +/* 0070 */ 0x0093, 0x0094, 0x0084, 0xFFFD, 0x0086, 0x0087, 0x0095, 0xFFFD, +/* 0078 */ 0xFFFD, 0xFFFD, 0x0085, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, +/* 0080 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x0089, 0xFFFD, 0xFFFD, 0xFFFD, +/* 0088 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x008B, 0x009B, 0x00FE, +/* 0090 */ 0x0080, +/* End of table Total Length = 0x00DA * 2 */ diff --git a/intl/uconv/ucvlatin/cp1258.ut b/intl/uconv/ucvlatin/cp1258.ut index 38a29d2c4e5..df55a5de593 100644 --- a/intl/uconv/ucvlatin/cp1258.ut +++ b/intl/uconv/ucvlatin/cp1258.ut @@ -7,9 +7,9 @@ The tool which used to generate this file is called umaptable. You can find this tool under mozilla/intl/uconv/tools/umaptable.c. - If you have any problem of this file. Please contact - Netscape Client International Team or - ftang@netscape + If you have any problems with this file, please file a bug + under the "Internationalization" component in + https://bugzilla.mozilla.org/enter_bug.cgi?product=Core Table in Debug form Begin of Item 0000 @@ -60,10 +60,10 @@ Begin of Item 0006 srcEnd = 009F mappingOffset = 0000 Mapping = - 20AC FFFD 201A 0192 201E 2026 2020 2021 - 02C6 2030 FFFD 2039 0152 FFFD FFFD FFFD - FFFD 2018 2019 201C 201D 2022 2013 2014 - 02DC 2122 FFFD 203A 0153 FFFD FFFD 0178 + 20AC 0081 201A 0192 201E 2026 2020 2021 + 02C6 2030 008A 2039 0152 008D 008E 008F + 0090 2018 2019 201C 201D 2022 2013 2014 + 02DC 2122 009A 203A 0153 009D 009E 0178 End of Item 0006 Begin of Item 0007 @@ -115,10 +115,10 @@ End of Item 0007 /*-------------------------------------------------------*/ /* Offset=0x001F Start of MappingTable */ -/* 0000 */ 0x20AC, 0xFFFD, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, -/* 0008 */ 0x02C6, 0x2030, 0xFFFD, 0x2039, 0x0152, 0xFFFD, 0xFFFD, 0xFFFD, -/* 0010 */ 0xFFFD, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, -/* 0018 */ 0x02DC, 0x2122, 0xFFFD, 0x203A, 0x0153, 0xFFFD, 0xFFFD, 0x0178, +/* 0000 */ 0x20AC, 0x0081, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, +/* 0008 */ 0x02C6, 0x2030, 0x008A, 0x2039, 0x0152, 0x008D, 0x008E, 0x008F, +/* 0010 */ 0x0090, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, +/* 0018 */ 0x02DC, 0x2122, 0x009A, 0x203A, 0x0153, 0x009D, 0x009E, 0x0178, /* 0020 */ 0x0102, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, /* 0028 */ 0xFFFD, 0x0300, 0x00CD, 0x00CE, 0x00CF, 0x0110, 0x00D1, 0x0309, /* 0030 */ 0x00D3, 0x00D4, 0x01A0, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, diff --git a/intl/uconv/ucvlatin/cp874.uf b/intl/uconv/ucvlatin/cp874.uf index 850623d3c71..a8ad2078eff 100644 --- a/intl/uconv/ucvlatin/cp874.uf +++ b/intl/uconv/ucvlatin/cp874.uf @@ -5,10 +5,11 @@ /*======================================================== This is a Generated file. Please don't edit it. - The tool which used to generate this file is called fromu. - If you have any problem of this file. Please contact - Netscape Client International Team or - ftang@netscape + The tool which used to generate this file is called umaptable. + You can find this tool under mozilla/intl/uconv/tools/umaptable.c. + If you have any problems with this file, please file a bug + under the "Internationalization" component in + https://bugzilla.mozilla.org/enter_bug.cgi?product=Core Table in Debug form Begin of Item 0000 @@ -20,73 +21,92 @@ End of Item 0000 Begin of Item 0001 Format 0 - srcBegin = 0E01 - srcEnd = 0E3A - destBegin = 00A1 + srcBegin = 0086 + srcEnd = 0090 + destBegin = 0086 End of Item 0001 Begin of Item 0002 Format 0 - srcBegin = 0E3F - srcEnd = 0E5B - destBegin = 00DF + srcBegin = 0098 + srcEnd = 00A0 + destBegin = 0098 End of Item 0002 Begin of Item 0003 - Format 2 - srcBegin = 00A0 - destBegin = 00A0 + Format 0 + srcBegin = 0E01 + srcEnd = 0E3A + destBegin = 00A1 End of Item 0003 Begin of Item 0004 + Format 0 + srcBegin = 0E3F + srcEnd = 0E5B + destBegin = 00DF +End of Item 0004 + +Begin of Item 0005 + Format 1 + srcBegin = 0081 + srcEnd = 0084 + mappingOffset = 0000 + Mapping = + 0081 0082 0083 0084 +End of Item 0005 + +Begin of Item 0006 Format 1 srcBegin = 2013 srcEnd = 2026 - mappingOffset = 0000 + mappingOffset = 0004 Mapping = 0096 0097 FFFD FFFD FFFD 0091 0092 FFFD FFFD 0093 0094 FFFD FFFD FFFD FFFD 0095 FFFD FFFD FFFD 0085 -End of Item 0004 +End of Item 0006 -Begin of Item 0005 +Begin of Item 0007 Format 2 srcBegin = 20AC destBegin = 0080 -End of Item 0005 +End of Item 0007 ========================================================*/ /* Offset=0x0000 ItemOfList */ - 0x0006, + 0x0008, /*-------------------------------------------------------*/ /* Offset=0x0001 offsetToFormatArray */ 0x0004, /*-------------------------------------------------------*/ /* Offset=0x0002 offsetToMapCellArray */ - 0x0006, + 0x0007, /*-------------------------------------------------------*/ /* Offset=0x0003 offsetToMappingTable */ - 0x0018, + 0x001F, /*-------------------------------------------------------*/ /* Offset=0x0004 Start of Format Array */ -/* Total of Format 0 : 0x0003 */ -/* Total of Format 1 : 0x0001 */ -/* Total of Format 2 : 0x0002 */ +/* Total of Format 0 : 0x0005 */ +/* Total of Format 1 : 0x0002 */ +/* Total of Format 2 : 0x0001 */ /* Total of Format 3 : 0x0000 */ -0x2000, 0x0021, +0x0000, 0x2110, 0x0000, /*-------------------------------------------------------*/ -/* Offset=0x0006 Start of MapCell Array */ +/* Offset=0x0007 Start of MapCell Array */ /* 0000 */ 0x0000, 0x007F, 0x0000, -/* 0001 */ 0x0E01, 0x0E3A, 0x00A1, -/* 0002 */ 0x0E3F, 0x0E5B, 0x00DF, -/* 0003 */ 0x00A0, 0x0000, 0x00A0, -/* 0004 */ 0x2013, 0x2026, 0x0000, -/* 0005 */ 0x20AC, 0x0000, 0x0080, +/* 0001 */ 0x0086, 0x0090, 0x0086, +/* 0002 */ 0x0098, 0x00A0, 0x0098, +/* 0003 */ 0x0E01, 0x0E3A, 0x00A1, +/* 0004 */ 0x0E3F, 0x0E5B, 0x00DF, +/* 0005 */ 0x0081, 0x0084, 0x0000, +/* 0006 */ 0x2013, 0x2026, 0x0004, +/* 0007 */ 0x20AC, 0x0000, 0x0080, /*-------------------------------------------------------*/ -/* Offset=0x0018 Start of MappingTable */ +/* Offset=0x001F Start of MappingTable */ -/* 0000 */ 0x0096, 0x0097, 0xFFFD, 0xFFFD, 0xFFFD, 0x0091, 0x0092, 0xFFFD, -/* 0008 */ 0xFFFD, 0x0093, 0x0094, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x0095, -/* 0010 */ 0xFFFD, 0xFFFD, 0xFFFD, 0x0085, -/* End of table Total Length = 0x002C * 2 */ +/* 0000 */ 0x0081, 0x0082, 0x0083, 0x0084, 0x0096, 0x0097, 0xFFFD, 0xFFFD, +/* 0008 */ 0xFFFD, 0x0091, 0x0092, 0xFFFD, 0xFFFD, 0x0093, 0x0094, 0xFFFD, +/* 0010 */ 0xFFFD, 0xFFFD, 0xFFFD, 0x0095, 0xFFFD, 0xFFFD, 0xFFFD, 0x0085, +/* End of table Total Length = 0x0037 * 2 */ diff --git a/intl/uconv/ucvlatin/cp874.ut b/intl/uconv/ucvlatin/cp874.ut index c4f813b0ad7..2d44eb8b308 100644 --- a/intl/uconv/ucvlatin/cp874.ut +++ b/intl/uconv/ucvlatin/cp874.ut @@ -5,10 +5,11 @@ /*======================================================== This is a Generated file. Please don't edit it. - The tool which used to generate this file is called fromu. - If you have any problem of this file. Please contact - Netscape Client International Team or - ftang@netscape + The tool which used to generate this file is called umaptable. + You can find this tool under mozilla/intl/uconv/tools/umaptable.c. + If you have any problems with this file, please file a bug + under the "Internationalization" component in + https://bugzilla.mozilla.org/enter_bug.cgi?product=Core Table in Debug form Begin of Item 0000 @@ -20,40 +21,53 @@ End of Item 0000 Begin of Item 0001 Format 0 - srcBegin = 00A1 - srcEnd = 00DA - destBegin = 0E01 + srcBegin = 0086 + srcEnd = 0090 + destBegin = 0086 End of Item 0001 Begin of Item 0002 Format 0 - srcBegin = 00DF - srcEnd = 00FB - destBegin = 0E3F + srcBegin = 0098 + srcEnd = 00A0 + destBegin = 0098 End of Item 0002 Begin of Item 0003 + Format 0 + srcBegin = 00A1 + srcEnd = 00DA + destBegin = 0E01 +End of Item 0003 + +Begin of Item 0004 + Format 0 + srcBegin = 00DF + srcEnd = 00FB + destBegin = 0E3F +End of Item 0004 + +Begin of Item 0005 Format 1 srcBegin = 0080 srcEnd = 0085 mappingOffset = 0000 Mapping = - 20AC FFFD FFFD FFFD FFFD 2026 -End of Item 0003 + 20AC 0081 0082 0083 0084 2026 +End of Item 0005 -Begin of Item 0004 +Begin of Item 0006 Format 1 srcBegin = 0091 - srcEnd = 00A0 + srcEnd = 0097 mappingOffset = 0006 Mapping = - 2018 2019 201C 201D 2022 2013 2014 FFFD - FFFD FFFD FFFD FFFD FFFD FFFD FFFD 00A0 -End of Item 0004 + 2018 2019 201C 201D 2022 2013 2014 +End of Item 0006 ========================================================*/ /* Offset=0x0000 ItemOfList */ - 0x0005, + 0x0007, /*-------------------------------------------------------*/ /* Offset=0x0001 offsetToFormatArray */ 0x0004, @@ -62,26 +76,27 @@ End of Item 0004 0x0006, /*-------------------------------------------------------*/ /* Offset=0x0003 offsetToMappingTable */ - 0x0015, + 0x001B, /*-------------------------------------------------------*/ /* Offset=0x0004 Start of Format Array */ -/* Total of Format 0 : 0x0003 */ +/* Total of Format 0 : 0x0005 */ /* Total of Format 1 : 0x0002 */ /* Total of Format 2 : 0x0000 */ /* Total of Format 3 : 0x0000 */ -0x1000, 0x0001, +0x0000, 0x0110, /*-------------------------------------------------------*/ /* Offset=0x0006 Start of MapCell Array */ /* 0000 */ 0x0000, 0x007F, 0x0000, -/* 0001 */ 0x00A1, 0x00DA, 0x0E01, -/* 0002 */ 0x00DF, 0x00FB, 0x0E3F, -/* 0003 */ 0x0080, 0x0085, 0x0000, -/* 0004 */ 0x0091, 0x00A0, 0x0006, +/* 0001 */ 0x0086, 0x0090, 0x0086, +/* 0002 */ 0x0098, 0x00A0, 0x0098, +/* 0003 */ 0x00A1, 0x00DA, 0x0E01, +/* 0004 */ 0x00DF, 0x00FB, 0x0E3F, +/* 0005 */ 0x0080, 0x0085, 0x0000, +/* 0006 */ 0x0091, 0x0097, 0x0006, /*-------------------------------------------------------*/ -/* Offset=0x0015 Start of MappingTable */ +/* Offset=0x001B Start of MappingTable */ -/* 0000 */ 0x20AC, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x2026, 0x2018, 0x2019, -/* 0008 */ 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0xFFFD, 0xFFFD, 0xFFFD, -/* 0010 */ 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x00A0, -/* End of table Total Length = 0x002B * 2 */ +/* 0000 */ 0x20AC, 0x0081, 0x0082, 0x0083, 0x0084, 0x2026, 0x2018, 0x2019, +/* 0008 */ 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, +/* End of table Total Length = 0x0028 * 2 */ From bc7cc3893c0d8c506954c5cd714c76945b413ea6 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Mon, 1 Sep 2014 18:26:43 -0400 Subject: [PATCH 56/66] Bug 1061023 - Fix more bad implicit constructors in DOM; r=baku --HG-- extra : rebase_source : c80c5f9d7ae28286513cdb52ad76b46c240bdd5d --- content/media/eme/MediaKeyMessageEvent.h | 2 +- .../webaudio/MediaStreamAudioSourceNode.h | 2 +- dom/activities/Activity.h | 2 +- dom/animation/AnimationEffect.h | 2 +- dom/archivereader/ArchiveEvent.h | 2 +- dom/archivereader/ArchiveRequest.cpp | 4 +-- dom/bindings/Codegen.py | 2 +- dom/bindings/Exceptions.cpp | 2 +- dom/bindings/test/TestCImplementedInterface.h | 2 +- dom/camera/AutoRwLock.h | 4 +-- dom/camera/CameraControlImpl.h | 2 +- dom/camera/CameraPreviewMediaStream.h | 2 +- dom/camera/CameraRecorderProfiles.h | 2 +- dom/camera/DOMCameraCapabilities.h | 2 +- dom/camera/DOMCameraControl.cpp | 2 +- dom/camera/DOMCameraControl.h | 2 +- dom/camera/DOMCameraControlListener.cpp | 4 +-- dom/camera/FallbackCameraControl.cpp | 2 +- dom/camera/ICameraControl.h | 2 +- dom/canvas/CanvasImageCache.cpp | 8 ++--- dom/canvas/CanvasRenderingContext2D.cpp | 4 +-- dom/canvas/TextMetrics.h | 2 +- dom/canvas/WebGLBuffer.h | 2 +- dom/canvas/WebGLContext.cpp | 6 ++-- dom/canvas/WebGLContextLossHandler.h | 2 +- dom/canvas/WebGLContextUtils.h | 2 +- dom/canvas/WebGLElementArrayCache.cpp | 4 +-- dom/canvas/WebGLExtensions.h | 8 ++--- dom/canvas/WebGLProgram.h | 2 +- dom/canvas/WebGLQuery.h | 2 +- dom/canvas/WebGLTexture.h | 2 +- dom/canvas/WebGLUniformInfo.h | 2 +- dom/canvas/WebGLValidateStrings.h | 8 ++--- dom/canvas/WebGLVertexArray.h | 2 +- dom/canvas/WebGLVertexArrayFake.h | 4 +-- dom/canvas/WebGLVertexArrayGL.h | 4 +-- dom/crypto/CryptoKeyPair.h | 2 +- dom/crypto/WebCryptoTask.cpp | 6 ++-- dom/datastore/DataStoreDB.cpp | 2 +- dom/devicestorage/nsDeviceStorage.cpp | 2 +- dom/events/ContentEventHandler.h | 2 +- dom/events/EventDispatcher.cpp | 2 +- dom/events/EventStateManager.cpp | 2 +- dom/events/IMEContentObserver.cpp | 4 +-- dom/events/IMEStateManager.cpp | 2 +- dom/events/PaintRequest.h | 4 +-- dom/filehandle/AsyncHelper.h | 2 +- dom/filehandle/FileHandle.cpp | 2 +- dom/filehandle/FileHandle.h | 2 +- dom/filehandle/FileService.h | 2 +- dom/filehandle/FileStreamWrappers.cpp | 4 +-- dom/filesystem/CreateFileTask.cpp | 2 +- dom/indexedDB/AsyncConnectionHelper.cpp | 2 +- dom/indexedDB/AsyncConnectionHelper.h | 2 +- dom/indexedDB/IDBCursor.cpp | 2 +- dom/indexedDB/IDBDatabase.cpp | 2 +- dom/indexedDB/IDBEvents.h | 2 +- dom/indexedDB/IDBFileRequest.h | 2 +- dom/indexedDB/TransactionThreadPool.cpp | 2 +- dom/indexedDB/TransactionThreadPool.h | 4 +-- dom/indexedDB/ipc/IndexedDBChild.cpp | 2 +- dom/mobilemessage/DeletedMessageInfo.h | 2 +- dom/mobilemessage/MmsMessage.h | 2 +- dom/mobilemessage/MobileMessageCallback.h | 2 +- dom/mobilemessage/MobileMessageThread.h | 2 +- dom/mobilemessage/SmsMessage.h | 2 +- dom/network/UDPSocket.cpp | 2 +- dom/notification/DesktopNotification.cpp | 4 +-- dom/notification/Notification.cpp | 2 +- dom/plugins/base/nsJSNPRuntime.cpp | 4 +-- dom/plugins/base/nsNPAPIPlugin.h | 8 ++--- dom/plugins/base/nsNPAPIPluginInstance.cpp | 4 +-- dom/plugins/base/nsPluginHost.cpp | 2 +- dom/plugins/base/nsPluginInstanceOwner.cpp | 2 +- .../base/nsPluginStreamListenerPeer.cpp | 2 +- dom/plugins/base/nsPluginStreamListenerPeer.h | 2 +- dom/plugins/base/nsPluginsDirDarwin.cpp | 4 +-- dom/plugins/ipc/PluginBackgroundDestroyer.h | 2 +- dom/plugins/ipc/PluginInstanceParent.cpp | 2 +- dom/plugins/ipc/PluginInterposeOSX.mm | 6 ++-- dom/plugins/ipc/PluginModuleParent.h | 2 +- dom/plugins/ipc/PluginProcessChild.h | 2 +- dom/plugins/ipc/PluginProcessParent.h | 2 +- .../ipc/PluginScriptableObjectParent.h | 2 +- dom/plugins/ipc/PluginScriptableObjectUtils.h | 2 +- dom/promise/Promise.cpp | 2 +- dom/quota/QuotaManager.cpp | 6 ++-- dom/quota/StorageMatcher.h | 2 +- dom/smil/nsSMILTimedElement.cpp | 12 +++---- dom/telephony/CallsList.h | 2 +- dom/telephony/Telephony.cpp | 2 +- dom/telephony/ipc/TelephonyChild.h | 2 +- dom/workers/DataStore.h | 4 +-- dom/workers/DataStoreCursor.h | 4 +-- dom/workers/Performance.h | 2 +- dom/workers/RuntimeService.cpp | 6 ++-- dom/workers/RuntimeService.h | 2 +- dom/workers/ServiceWorkerEvents.h | 4 +-- dom/workers/ServiceWorkerManager.cpp | 6 ++-- dom/workers/URL.cpp | 4 +-- dom/workers/WorkerPrivate.cpp | 33 ++++++++++--------- dom/workers/WorkerScope.h | 4 +-- dom/workers/XMLHttpRequest.cpp | 4 +-- dom/workers/XMLHttpRequest.h | 2 +- dom/workers/XMLHttpRequestUpload.h | 2 +- 105 files changed, 171 insertions(+), 170 deletions(-) diff --git a/content/media/eme/MediaKeyMessageEvent.h b/content/media/eme/MediaKeyMessageEvent.h index 26ad9c3f841..b6d2970cd7a 100644 --- a/content/media/eme/MediaKeyMessageEvent.h +++ b/content/media/eme/MediaKeyMessageEvent.h @@ -29,7 +29,7 @@ public: NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(MediaKeyMessageEvent, Event) protected: virtual ~MediaKeyMessageEvent(); - MediaKeyMessageEvent(EventTarget* aOwner); + explicit MediaKeyMessageEvent(EventTarget* aOwner); JS::Heap mMessage; nsString mDestinationURL; diff --git a/content/media/webaudio/MediaStreamAudioSourceNode.h b/content/media/webaudio/MediaStreamAudioSourceNode.h index d4edd448438..5a587a9a9b0 100644 --- a/content/media/webaudio/MediaStreamAudioSourceNode.h +++ b/content/media/webaudio/MediaStreamAudioSourceNode.h @@ -18,7 +18,7 @@ namespace dom { class MediaStreamAudioSourceNodeEngine : public AudioNodeEngine { public: - MediaStreamAudioSourceNodeEngine(AudioNode* aNode) + explicit MediaStreamAudioSourceNodeEngine(AudioNode* aNode) : AudioNodeEngine(aNode), mEnabled(false) {} bool IsEnabled() const { return mEnabled; } diff --git a/dom/activities/Activity.h b/dom/activities/Activity.h index 9a36bbce7db..a657024b463 100644 --- a/dom/activities/Activity.h +++ b/dom/activities/Activity.h @@ -39,7 +39,7 @@ public: return activity.forget(); } - Activity(nsPIDOMWindow* aWindow); + explicit Activity(nsPIDOMWindow* aWindow); protected: nsresult Initialize(nsPIDOMWindow* aWindow, diff --git a/dom/animation/AnimationEffect.h b/dom/animation/AnimationEffect.h index 2f25739e984..d4228012da2 100644 --- a/dom/animation/AnimationEffect.h +++ b/dom/animation/AnimationEffect.h @@ -18,7 +18,7 @@ namespace dom { class AnimationEffect MOZ_FINAL : public nsWrapperCache { public: - AnimationEffect(Animation* aAnimation) + explicit AnimationEffect(Animation* aAnimation) : mAnimation(aAnimation) { SetIsDOMBinding(); diff --git a/dom/archivereader/ArchiveEvent.h b/dom/archivereader/ArchiveEvent.h index 392d5fa5885..34e5d00acf2 100644 --- a/dom/archivereader/ArchiveEvent.h +++ b/dom/archivereader/ArchiveEvent.h @@ -54,7 +54,7 @@ class ArchiveReaderEvent : public nsRunnable public: NS_DECL_NSIRUNNABLE - ArchiveReaderEvent(ArchiveReader* aArchiveReader); + explicit ArchiveReaderEvent(ArchiveReader* aArchiveReader); protected: virtual ~ArchiveReaderEvent(); diff --git a/dom/archivereader/ArchiveRequest.cpp b/dom/archivereader/ArchiveRequest.cpp index 3c68c1720b7..617d1e61000 100644 --- a/dom/archivereader/ArchiveRequest.cpp +++ b/dom/archivereader/ArchiveRequest.cpp @@ -23,8 +23,8 @@ class ArchiveRequestEvent : public nsRunnable public: NS_DECL_NSIRUNNABLE - ArchiveRequestEvent(ArchiveRequest* request) - : mRequest(request) + explicit ArchiveRequestEvent(ArchiveRequest* aRequest) + : mRequest(aRequest) { MOZ_COUNT_CTOR(ArchiveRequestEvent); } diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index fcab604208f..7bf5e5388ab 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -14544,7 +14544,7 @@ class CGEventClass(CGBindingImplClass): NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(${nativeType}, ${parentType}) protected: virtual ~${nativeType}(); - ${nativeType}(mozilla::dom::EventTarget* aOwner); + explicit ${nativeType}(mozilla::dom::EventTarget* aOwner); """, nativeType=self.descriptor.nativeType.split('::')[-1], diff --git a/dom/bindings/Exceptions.cpp b/dom/bindings/Exceptions.cpp index 5ae8c3a2e44..7c50eba8bf7 100644 --- a/dom/bindings/Exceptions.cpp +++ b/dom/bindings/Exceptions.cpp @@ -269,7 +269,7 @@ public: StackFrame) // aStack must not be null. - JSStackFrame(JS::Handle aStack); + explicit JSStackFrame(JS::Handle aStack); static already_AddRefed CreateStack(JSContext* aCx, int32_t aMaxDepth = -1); diff --git a/dom/bindings/test/TestCImplementedInterface.h b/dom/bindings/test/TestCImplementedInterface.h index b64d33ebdf3..c5462b71488 100644 --- a/dom/bindings/test/TestCImplementedInterface.h +++ b/dom/bindings/test/TestCImplementedInterface.h @@ -27,7 +27,7 @@ class TestCImplementedInterface2 : public nsISupports, public nsWrapperCache { public: - TestCImplementedInterface2(nsPIDOMWindow* aParent) + explicit TestCImplementedInterface2(nsPIDOMWindow* aParent) {} NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TestCImplementedInterface2) diff --git a/dom/camera/AutoRwLock.h b/dom/camera/AutoRwLock.h index 95b9cf3795c..31c446d9612 100644 --- a/dom/camera/AutoRwLock.h +++ b/dom/camera/AutoRwLock.h @@ -11,7 +11,7 @@ class RwLockAutoEnterRead { public: - RwLockAutoEnterRead(PRRWLock* aRwLock) + explicit RwLockAutoEnterRead(PRRWLock* aRwLock) : mRwLock(aRwLock) { MOZ_ASSERT(mRwLock); @@ -30,7 +30,7 @@ protected: class RwLockAutoEnterWrite { public: - RwLockAutoEnterWrite(PRRWLock* aRwLock) + explicit RwLockAutoEnterWrite(PRRWLock* aRwLock) : mRwLock(aRwLock) { MOZ_ASSERT(mRwLock); diff --git a/dom/camera/CameraControlImpl.h b/dom/camera/CameraControlImpl.h index d357bf3ab09..6b6c1399306 100644 --- a/dom/camera/CameraControlImpl.h +++ b/dom/camera/CameraControlImpl.h @@ -30,7 +30,7 @@ class RecorderProfileManager; class CameraControlImpl : public ICameraControl { public: - CameraControlImpl(uint32_t aCameraId); + explicit CameraControlImpl(uint32_t aCameraId); virtual void AddListener(CameraControlListener* aListener) MOZ_OVERRIDE; virtual void RemoveListener(CameraControlListener* aListener) MOZ_OVERRIDE; diff --git a/dom/camera/CameraPreviewMediaStream.h b/dom/camera/CameraPreviewMediaStream.h index 29776f3d05d..2a5f8ef8f2f 100644 --- a/dom/camera/CameraPreviewMediaStream.h +++ b/dom/camera/CameraPreviewMediaStream.h @@ -23,7 +23,7 @@ class CameraPreviewMediaStream : public MediaStream typedef mozilla::layers::Image Image; public: - CameraPreviewMediaStream(DOMMediaStream* aWrapper); + explicit CameraPreviewMediaStream(DOMMediaStream* aWrapper); virtual void AddAudioOutput(void* aKey) MOZ_OVERRIDE; virtual void SetAudioOutputVolume(void* aKey, float aVolume) MOZ_OVERRIDE; diff --git a/dom/camera/CameraRecorderProfiles.h b/dom/camera/CameraRecorderProfiles.h index 1ce19255aac..92bc9e69796 100644 --- a/dom/camera/CameraRecorderProfiles.h +++ b/dom/camera/CameraRecorderProfiles.h @@ -262,7 +262,7 @@ public: nsresult GetJsObject(JSContext* aCx, JSObject** aObject) const; protected: - RecorderProfileManager(uint32_t aCameraId); + explicit RecorderProfileManager(uint32_t aCameraId); virtual ~RecorderProfileManager(); uint32_t mCameraId; diff --git a/dom/camera/DOMCameraCapabilities.h b/dom/camera/DOMCameraCapabilities.h index 7427b3de3fa..9a5a2b7f801 100644 --- a/dom/camera/DOMCameraCapabilities.h +++ b/dom/camera/DOMCameraCapabilities.h @@ -40,7 +40,7 @@ public: // Great Renaming proposed in bug 983177. static bool HasSupport(JSContext* aCx, JSObject* aGlobal); - CameraCapabilities(nsPIDOMWindow* aWindow); + explicit CameraCapabilities(nsPIDOMWindow* aWindow); // Populate the camera capabilities interface from the specific // camera control object. diff --git a/dom/camera/DOMCameraControl.cpp b/dom/camera/DOMCameraControl.cpp index 2f9f29b98ec..64e1a86d6a7 100644 --- a/dom/camera/DOMCameraControl.cpp +++ b/dom/camera/DOMCameraControl.cpp @@ -81,7 +81,7 @@ public: NS_DECL_ISUPPORTS NS_DECL_NSIDOMEVENTLISTENER - StartRecordingHelper(nsDOMCameraControl* aDOMCameraControl) + explicit StartRecordingHelper(nsDOMCameraControl* aDOMCameraControl) : mDOMCameraControl(aDOMCameraControl) { MOZ_COUNT_CTOR(StartRecordingHelper); diff --git a/dom/camera/DOMCameraControl.h b/dom/camera/DOMCameraControl.h index 00e577972fc..236815ae94c 100644 --- a/dom/camera/DOMCameraControl.h +++ b/dom/camera/DOMCameraControl.h @@ -145,7 +145,7 @@ protected: NS_INLINE_DECL_REFCOUNTING(DOMCameraConfiguration) DOMCameraConfiguration(); - DOMCameraConfiguration(const dom::CameraConfiguration& aConfiguration); + explicit DOMCameraConfiguration(const dom::CameraConfiguration& aConfiguration); // Additional configuration options that aren't exposed to the DOM uint32_t mMaxFocusAreas; diff --git a/dom/camera/DOMCameraControlListener.cpp b/dom/camera/DOMCameraControlListener.cpp index 78a7888b378..ea71d99ec8c 100644 --- a/dom/camera/DOMCameraControlListener.cpp +++ b/dom/camera/DOMCameraControlListener.cpp @@ -31,7 +31,7 @@ DOMCameraControlListener::~DOMCameraControlListener() class DOMCameraControlListener::DOMCallback : public nsRunnable { public: - DOMCallback(nsMainThreadPtrHandle aDOMCameraControl) + explicit DOMCallback(nsMainThreadPtrHandle aDOMCameraControl) : mDOMCameraControl(aDOMCameraControl) { MOZ_COUNT_CTOR(DOMCameraControlListener::DOMCallback); @@ -276,7 +276,7 @@ DOMCameraControlListener::OnShutter() class Callback : public DOMCallback { public: - Callback(nsMainThreadPtrHandle aDOMCameraControl) + explicit Callback(nsMainThreadPtrHandle aDOMCameraControl) : DOMCallback(aDOMCameraControl) { } diff --git a/dom/camera/FallbackCameraControl.cpp b/dom/camera/FallbackCameraControl.cpp index 2655ac95736..9f443a17649 100644 --- a/dom/camera/FallbackCameraControl.cpp +++ b/dom/camera/FallbackCameraControl.cpp @@ -22,7 +22,7 @@ namespace mozilla { class FallbackCameraControl : public CameraControlImpl { public: - FallbackCameraControl(uint32_t aCameraId) : CameraControlImpl(aCameraId) { } + explicit FallbackCameraControl(uint32_t aCameraId) : CameraControlImpl(aCameraId) { } virtual nsresult Set(uint32_t aKey, const nsAString& aValue) MOZ_OVERRIDE { return NS_ERROR_NOT_IMPLEMENTED; } virtual nsresult Get(uint32_t aKey, nsAString& aValue) MOZ_OVERRIDE { return NS_ERROR_NOT_IMPLEMENTED; } diff --git a/dom/camera/ICameraControl.h b/dom/camera/ICameraControl.h index 3d33f831c21..80445dae82e 100644 --- a/dom/camera/ICameraControl.h +++ b/dom/camera/ICameraControl.h @@ -240,7 +240,7 @@ protected: class ICameraControlParameterSetAutoEnter { public: - ICameraControlParameterSetAutoEnter(ICameraControl* aCameraControl) + explicit ICameraControlParameterSetAutoEnter(ICameraControl* aCameraControl) : mCameraControl(aCameraControl) { mCameraControl->BeginBatchParameterSet(); diff --git a/dom/canvas/CanvasImageCache.cpp b/dom/canvas/CanvasImageCache.cpp index 00b3470ad1f..293bdb0eb70 100644 --- a/dom/canvas/CanvasImageCache.cpp +++ b/dom/canvas/CanvasImageCache.cpp @@ -35,7 +35,7 @@ struct ImageCacheEntryData { , mSourceSurface(aOther.mSourceSurface) , mSize(aOther.mSize) {} - ImageCacheEntryData(const ImageCacheKey& aKey) + explicit ImageCacheEntryData(const ImageCacheKey& aKey) : mImage(aKey.mImage) , mILC(nullptr) , mCanvas(aKey.mCanvas) @@ -61,8 +61,8 @@ public: typedef ImageCacheKey KeyType; typedef const ImageCacheKey* KeyTypePointer; - ImageCacheEntry(const KeyType *key) : - mData(new ImageCacheEntryData(*key)) {} + explicit ImageCacheEntry(const KeyType* aKey) : + mData(new ImageCacheEntryData(*aKey)) {} ImageCacheEntry(const ImageCacheEntry &toCopy) : mData(new ImageCacheEntryData(*toCopy.mData)) {} ~ImageCacheEntry() {} @@ -115,7 +115,7 @@ class ImageCacheObserver MOZ_FINAL : public nsIObserver public: NS_DECL_ISUPPORTS - ImageCacheObserver(ImageCache* aImageCache) + explicit ImageCacheObserver(ImageCache* aImageCache) : mImageCache(aImageCache) { RegisterMemoryPressureEvent(); diff --git a/dom/canvas/CanvasRenderingContext2D.cpp b/dom/canvas/CanvasRenderingContext2D.cpp index 2e2e5c34d3c..d29543d1a2c 100644 --- a/dom/canvas/CanvasRenderingContext2D.cpp +++ b/dom/canvas/CanvasRenderingContext2D.cpp @@ -298,7 +298,7 @@ class AdjustedTarget public: typedef CanvasRenderingContext2D::ContextState ContextState; - AdjustedTarget(CanvasRenderingContext2D *ctx, + explicit AdjustedTarget(CanvasRenderingContext2D* ctx, mgfx::Rect *aBounds = nullptr) : mCtx(nullptr) { @@ -438,7 +438,7 @@ NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(CanvasPattern, mContext) class CanvasRenderingContext2DUserData : public LayerUserData { public: - CanvasRenderingContext2DUserData(CanvasRenderingContext2D *aContext) + explicit CanvasRenderingContext2DUserData(CanvasRenderingContext2D *aContext) : mContext(aContext) { aContext->mUserDatas.AppendElement(this); diff --git a/dom/canvas/TextMetrics.h b/dom/canvas/TextMetrics.h index c01f024026e..2a57e132f42 100644 --- a/dom/canvas/TextMetrics.h +++ b/dom/canvas/TextMetrics.h @@ -15,7 +15,7 @@ namespace dom { class TextMetrics MOZ_FINAL : public NonRefcountedDOMObject { public: - TextMetrics(float w) : width(w) + explicit TextMetrics(float aValue) : width(aValue) { MOZ_COUNT_CTOR(TextMetrics); } diff --git a/dom/canvas/WebGLBuffer.h b/dom/canvas/WebGLBuffer.h index 50054fe1bef..ebf391fa93a 100644 --- a/dom/canvas/WebGLBuffer.h +++ b/dom/canvas/WebGLBuffer.h @@ -26,7 +26,7 @@ class WebGLBuffer MOZ_FINAL , public WebGLContextBoundObject { public: - WebGLBuffer(WebGLContext *context); + explicit WebGLBuffer(WebGLContext* aContext); void Delete(); diff --git a/dom/canvas/WebGLContext.cpp b/dom/canvas/WebGLContext.cpp index 543cd4e47f3..99e9b1023d0 100644 --- a/dom/canvas/WebGLContext.cpp +++ b/dom/canvas/WebGLContext.cpp @@ -1129,7 +1129,7 @@ namespace mozilla { class WebGLContextUserData : public LayerUserData { public: - WebGLContextUserData(HTMLCanvasElement *aContent) + explicit WebGLContextUserData(HTMLCanvasElement* aContent) : mContent(aContent) {} @@ -1510,8 +1510,8 @@ class UpdateContextLossStatusTask : public nsRunnable nsRefPtr mContext; public: - UpdateContextLossStatusTask(WebGLContext* context) - : mContext(context) + explicit UpdateContextLossStatusTask(WebGLContext* aContext) + : mContext(aContext) { } diff --git a/dom/canvas/WebGLContextLossHandler.h b/dom/canvas/WebGLContextLossHandler.h index bb41007653a..7cff2337fe7 100644 --- a/dom/canvas/WebGLContextLossHandler.h +++ b/dom/canvas/WebGLContextLossHandler.h @@ -30,7 +30,7 @@ class WebGLContextLossHandler public: MOZ_DECLARE_REFCOUNTED_TYPENAME(WebGLContextLossHandler) - WebGLContextLossHandler(WebGLContext* webgl); + explicit WebGLContextLossHandler(WebGLContext* aWebgl); ~WebGLContextLossHandler(); void RunTimer(); diff --git a/dom/canvas/WebGLContextUtils.h b/dom/canvas/WebGLContextUtils.h index e12081d1d7c..e63446e7fc4 100644 --- a/dom/canvas/WebGLContextUtils.h +++ b/dom/canvas/WebGLContextUtils.h @@ -36,7 +36,7 @@ struct GLComponents : mComponents(0) { } - GLComponents(GLenum format); + explicit GLComponents(GLenum aFormat); // Returns true iff other has all (or more) of // the components present in this GLComponents diff --git a/dom/canvas/WebGLElementArrayCache.cpp b/dom/canvas/WebGLElementArrayCache.cpp index b7783712202..6e0919b3127 100644 --- a/dom/canvas/WebGLElementArrayCache.cpp +++ b/dom/canvas/WebGLElementArrayCache.cpp @@ -144,8 +144,8 @@ public: // Constructor. Takes a reference to the WebGLElementArrayCache that is to be // the parent. Does not initialize the tree. Should be followed by a call // to Update() to attempt initializing the tree. - WebGLElementArrayCacheTree(WebGLElementArrayCache& p) - : mParent(p) + explicit WebGLElementArrayCacheTree(WebGLElementArrayCache& aValue) + : mParent(aValue) { } diff --git a/dom/canvas/WebGLExtensions.h b/dom/canvas/WebGLExtensions.h index af2d81a4d48..a5a3f5f205e 100644 --- a/dom/canvas/WebGLExtensions.h +++ b/dom/canvas/WebGLExtensions.h @@ -23,7 +23,7 @@ class WebGLExtensionBase , public WebGLContextBoundObject { public: - WebGLExtensionBase(WebGLContext*); + explicit WebGLExtensionBase(WebGLContext* aValue); WebGLContext *GetParentObject() const { return Context(); @@ -288,7 +288,7 @@ class WebGLExtensionVertexArray : public WebGLExtensionBase { public: - WebGLExtensionVertexArray(WebGLContext*); + explicit WebGLExtensionVertexArray(WebGLContext* aValue); virtual ~WebGLExtensionVertexArray(); already_AddRefed CreateVertexArrayOES(); @@ -305,7 +305,7 @@ class WebGLExtensionInstancedArrays : public WebGLExtensionBase { public: - WebGLExtensionInstancedArrays(WebGLContext* context); + explicit WebGLExtensionInstancedArrays(WebGLContext* aContext); virtual ~WebGLExtensionInstancedArrays(); void DrawArraysInstancedANGLE(GLenum mode, GLint first, @@ -324,7 +324,7 @@ class WebGLExtensionBlendMinMax : public WebGLExtensionBase { public: - WebGLExtensionBlendMinMax(WebGLContext*); + explicit WebGLExtensionBlendMinMax(WebGLContext* aValue); virtual ~WebGLExtensionBlendMinMax(); static bool IsSupported(const WebGLContext*); diff --git a/dom/canvas/WebGLProgram.h b/dom/canvas/WebGLProgram.h index ddd2cb0f00d..0a11b5938e2 100644 --- a/dom/canvas/WebGLProgram.h +++ b/dom/canvas/WebGLProgram.h @@ -31,7 +31,7 @@ class WebGLProgram MOZ_FINAL , public WebGLContextBoundObject { public: - WebGLProgram(WebGLContext *context); + explicit WebGLProgram(WebGLContext* aContext); void Delete(); diff --git a/dom/canvas/WebGLQuery.h b/dom/canvas/WebGLQuery.h index 419f819dba9..e95635758a8 100644 --- a/dom/canvas/WebGLQuery.h +++ b/dom/canvas/WebGLQuery.h @@ -27,7 +27,7 @@ public: // ------------------------------------------------------------------------- // CONSTRUCTOR - WebGLQuery(WebGLContext *context); + explicit WebGLQuery(WebGLContext* aContext); // ------------------------------------------------------------------------- // MEMBER FUNCTIONS diff --git a/dom/canvas/WebGLTexture.h b/dom/canvas/WebGLTexture.h index a2be3d5b8ab..dcbbc1330ec 100644 --- a/dom/canvas/WebGLTexture.h +++ b/dom/canvas/WebGLTexture.h @@ -35,7 +35,7 @@ class WebGLTexture MOZ_FINAL , public WebGLFramebufferAttachable { public: - WebGLTexture(WebGLContext *context); + explicit WebGLTexture(WebGLContext* aContext); void Delete(); diff --git a/dom/canvas/WebGLUniformInfo.h b/dom/canvas/WebGLUniformInfo.h index aba30886f07..9c341cb30ed 100644 --- a/dom/canvas/WebGLUniformInfo.h +++ b/dom/canvas/WebGLUniformInfo.h @@ -15,7 +15,7 @@ struct WebGLUniformInfo { bool isArray; ShDataType type; - WebGLUniformInfo(uint32_t s = 0, bool a = false, ShDataType t = SH_NONE) + explicit WebGLUniformInfo(uint32_t s = 0, bool a = false, ShDataType t = SH_NONE) : arraySize(s), isArray(a), type(t) {} int ElementSize() const { diff --git a/dom/canvas/WebGLValidateStrings.h b/dom/canvas/WebGLValidateStrings.h index 38e03484713..e4f59278348 100644 --- a/dom/canvas/WebGLValidateStrings.h +++ b/dom/canvas/WebGLValidateStrings.h @@ -58,13 +58,13 @@ namespace mozilla { // implementations not expecting characters outside the GLSL ES set. class StripComments { public: - StripComments(const nsAString& str) + explicit StripComments(const nsAString& aStr) : m_parseState(BeginningOfLine) - , m_end(str.EndReading()) - , m_current(str.BeginReading()) + , m_end(aStr.EndReading()) + , m_current(aStr.BeginReading()) , m_position(0) { - m_result.SetLength(str.Length()); + m_result.SetLength(aStr.Length()); parse(); } diff --git a/dom/canvas/WebGLVertexArray.h b/dom/canvas/WebGLVertexArray.h index d86bfef0f5f..bd35c00a9d7 100644 --- a/dom/canvas/WebGLVertexArray.h +++ b/dom/canvas/WebGLVertexArray.h @@ -74,7 +74,7 @@ public: // ----------------------------------------------------------------------------- // PROTECTED protected: - WebGLVertexArray(WebGLContext* context); + explicit WebGLVertexArray(WebGLContext* aContext); virtual ~WebGLVertexArray() { MOZ_ASSERT(IsDeleted()); diff --git a/dom/canvas/WebGLVertexArrayFake.h b/dom/canvas/WebGLVertexArrayFake.h index 49e4fe6d6ae..898aa28632e 100644 --- a/dom/canvas/WebGLVertexArrayFake.h +++ b/dom/canvas/WebGLVertexArrayFake.h @@ -19,8 +19,8 @@ public: virtual void GenVertexArray() MOZ_OVERRIDE { }; private: - WebGLVertexArrayFake(WebGLContext *context) - : WebGLVertexArray(context) + explicit WebGLVertexArrayFake(WebGLContext* aContext) + : WebGLVertexArray(aContext) { } ~WebGLVertexArrayFake() { diff --git a/dom/canvas/WebGLVertexArrayGL.h b/dom/canvas/WebGLVertexArrayGL.h index de839eaffec..41c82a03650 100644 --- a/dom/canvas/WebGLVertexArrayGL.h +++ b/dom/canvas/WebGLVertexArrayGL.h @@ -19,8 +19,8 @@ public: virtual void GenVertexArray() MOZ_OVERRIDE; private: - WebGLVertexArrayGL(WebGLContext* context) - : WebGLVertexArray(context) + explicit WebGLVertexArrayGL(WebGLContext* aContext) + : WebGLVertexArray(aContext) { } ~WebGLVertexArrayGL() { diff --git a/dom/crypto/CryptoKeyPair.h b/dom/crypto/CryptoKeyPair.h index ce96d0e2ead..788a6873222 100644 --- a/dom/crypto/CryptoKeyPair.h +++ b/dom/crypto/CryptoKeyPair.h @@ -24,7 +24,7 @@ public: NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(CryptoKeyPair) public: - CryptoKeyPair(nsIGlobalObject* aGlobal) + explicit CryptoKeyPair(nsIGlobalObject* aGlobal) : mGlobal(aGlobal) , mPublicKey(new CryptoKey(aGlobal)) , mPrivateKey(new CryptoKey(aGlobal)) diff --git a/dom/crypto/WebCryptoTask.cpp b/dom/crypto/WebCryptoTask.cpp index b7ecd3f04b5..4c1b6d293b1 100644 --- a/dom/crypto/WebCryptoTask.cpp +++ b/dom/crypto/WebCryptoTask.cpp @@ -110,7 +110,7 @@ enum TelemetryAlgorithm { class ClearException { public: - ClearException(JSContext* aCx) + explicit ClearException(JSContext* aCx) : mCx(aCx) {} @@ -379,8 +379,8 @@ WebCryptoTask::CallCallback(nsresult rv) class FailureTask : public WebCryptoTask { public: - FailureTask(nsresult rv) { - mEarlyRv = rv; + explicit FailureTask(nsresult aRv) { + mEarlyRv = aRv; } }; diff --git a/dom/datastore/DataStoreDB.cpp b/dom/datastore/DataStoreDB.cpp index 398ae21f879..56b9135c4ca 100644 --- a/dom/datastore/DataStoreDB.cpp +++ b/dom/datastore/DataStoreDB.cpp @@ -31,7 +31,7 @@ class VersionChangeListener MOZ_FINAL : public nsIDOMEventListener public: NS_DECL_ISUPPORTS - VersionChangeListener(IDBDatabase* aDatabase) + explicit VersionChangeListener(IDBDatabase* aDatabase) : mDatabase(aDatabase) {} diff --git a/dom/devicestorage/nsDeviceStorage.cpp b/dom/devicestorage/nsDeviceStorage.cpp index 1147ebd3f8b..61351ad30f9 100644 --- a/dom/devicestorage/nsDeviceStorage.cpp +++ b/dom/devicestorage/nsDeviceStorage.cpp @@ -1790,7 +1790,7 @@ public: NS_FORWARD_NSICONTENTPERMISSIONREQUEST(mCursor->); - DeviceStorageCursorRequest(nsDOMDeviceStorageCursor* aCursor) + explicit DeviceStorageCursorRequest(nsDOMDeviceStorageCursor* aCursor) : mCursor(aCursor) { } private: diff --git a/dom/events/ContentEventHandler.h b/dom/events/ContentEventHandler.h index f10818c57f4..a86e56eee71 100644 --- a/dom/events/ContentEventHandler.h +++ b/dom/events/ContentEventHandler.h @@ -34,7 +34,7 @@ enum LineBreakType class MOZ_STACK_CLASS ContentEventHandler { public: - ContentEventHandler(nsPresContext* aPresContext); + explicit ContentEventHandler(nsPresContext* aPresContext); // NS_QUERY_SELECTED_TEXT event handler nsresult OnQuerySelectedText(WidgetQueryContentEvent* aEvent); diff --git a/dom/events/EventDispatcher.cpp b/dom/events/EventDispatcher.cpp index c80c5de3e97..16ec46a3d53 100644 --- a/dom/events/EventDispatcher.cpp +++ b/dom/events/EventDispatcher.cpp @@ -71,7 +71,7 @@ private: class EventTargetChainItem { private: - EventTargetChainItem(EventTarget* aTarget); + explicit EventTargetChainItem(EventTarget* aTarget); public: EventTargetChainItem() : mFlags(0) diff --git a/dom/events/EventStateManager.cpp b/dom/events/EventStateManager.cpp index a87184f247a..b914325dd7f 100644 --- a/dom/events/EventStateManager.cpp +++ b/dom/events/EventStateManager.cpp @@ -3544,7 +3544,7 @@ EventStateManager::SetCursor(int32_t aCursor, imgIContainer* aContainer, class MOZ_STACK_CLASS ESMEventCB : public EventDispatchingCallback { public: - ESMEventCB(nsIContent* aTarget) : mTarget(aTarget) {} + explicit ESMEventCB(nsIContent* aTarget) : mTarget(aTarget) {} virtual void HandleEvent(EventChainPostVisitor& aVisitor) { diff --git a/dom/events/IMEContentObserver.cpp b/dom/events/IMEContentObserver.cpp index 74fd89cf8ea..5620004d9fe 100644 --- a/dom/events/IMEContentObserver.cpp +++ b/dom/events/IMEContentObserver.cpp @@ -386,7 +386,7 @@ IMEContentObserver::NotifySelectionChanged(nsIDOMDocument* aDOMDocument, class PositionChangeEvent MOZ_FINAL : public nsRunnable { public: - PositionChangeEvent(IMEContentObserver* aDispatcher) + explicit PositionChangeEvent(IMEContentObserver* aDispatcher) : mDispatcher(aDispatcher) { MOZ_ASSERT(mDispatcher); @@ -1037,7 +1037,7 @@ IMEContentObserver::MaybeNotifyIMEOfPositionChange() class AsyncMergeableNotificationsFlusher : public nsRunnable { public: - AsyncMergeableNotificationsFlusher(IMEContentObserver* aIMEContentObserver) + explicit AsyncMergeableNotificationsFlusher(IMEContentObserver* aIMEContentObserver) : mIMEContentObserver(aIMEContentObserver) { MOZ_ASSERT(mIMEContentObserver); diff --git a/dom/events/IMEStateManager.cpp b/dom/events/IMEStateManager.cpp index ee627bb1cb1..da434a2b6ed 100644 --- a/dom/events/IMEStateManager.cpp +++ b/dom/events/IMEStateManager.cpp @@ -746,7 +746,7 @@ IMEStateManager::GetNewIMEState(nsPresContext* aPresContext, // Helper class, used for IME enabled state change notification class IMEEnabledStateChangedEvent : public nsRunnable { public: - IMEEnabledStateChangedEvent(uint32_t aState) + explicit IMEEnabledStateChangedEvent(uint32_t aState) : mState(aState) { } diff --git a/dom/events/PaintRequest.h b/dom/events/PaintRequest.h index e1415dad780..b22a51ca074 100644 --- a/dom/events/PaintRequest.h +++ b/dom/events/PaintRequest.h @@ -21,7 +21,7 @@ class PaintRequest MOZ_FINAL : public nsIDOMPaintRequest , public nsWrapperCache { public: - PaintRequest(nsIDOMEvent* aParent) + explicit PaintRequest(nsIDOMEvent* aParent) : mParent(aParent) { mRequest.mFlags = 0; @@ -59,7 +59,7 @@ class PaintRequestList MOZ_FINAL : public nsISupports, public nsWrapperCache { public: - PaintRequestList(nsIDOMEvent *aParent) : mParent(aParent) + explicit PaintRequestList(nsIDOMEvent *aParent) : mParent(aParent) { SetIsDOMBinding(); } diff --git a/dom/filehandle/AsyncHelper.h b/dom/filehandle/AsyncHelper.h index 1fc63278e10..8d70f77c62b 100644 --- a/dom/filehandle/AsyncHelper.h +++ b/dom/filehandle/AsyncHelper.h @@ -33,7 +33,7 @@ public: AsyncWork(nsIRequestObserver* aObserver, nsISupports* aCtxt); protected: - AsyncHelper(nsISupports* aStream) + explicit AsyncHelper(nsISupports* aStream) : mStream(aStream), mStatus(NS_OK) { } diff --git a/dom/filehandle/FileHandle.cpp b/dom/filehandle/FileHandle.cpp index 9b1f0ffaff9..752c29c1c83 100644 --- a/dom/filehandle/FileHandle.cpp +++ b/dom/filehandle/FileHandle.cpp @@ -152,7 +152,7 @@ private: class AsyncFlusher : public AsyncHelper { public: - AsyncFlusher(nsISupports* aStream) + explicit AsyncFlusher(nsISupports* aStream) : AsyncHelper(aStream) { } protected: diff --git a/dom/filehandle/FileHandle.h b/dom/filehandle/FileHandle.h index 30228293610..886b488c06e 100644 --- a/dom/filehandle/FileHandle.h +++ b/dom/filehandle/FileHandle.h @@ -256,7 +256,7 @@ public: NS_DECL_NSIRUNNABLE private: - FinishHelper(FileHandleBase* aFileHandle); + explicit FinishHelper(FileHandleBase* aFileHandle); ~FinishHelper() { } diff --git a/dom/filehandle/FileService.h b/dom/filehandle/FileService.h index 026ad6ce427..86c2a5e2bf3 100644 --- a/dom/filehandle/FileService.h +++ b/dom/filehandle/FileService.h @@ -92,7 +92,7 @@ private: private: inline - FileHandleQueue(FileHandleBase* aFileHandle); + explicit FileHandleQueue(FileHandleBase* aFileHandle); ~FileHandleQueue(); diff --git a/dom/filehandle/FileStreamWrappers.cpp b/dom/filehandle/FileStreamWrappers.cpp index 130f6e00f11..124da638ca9 100644 --- a/dom/filehandle/FileStreamWrappers.cpp +++ b/dom/filehandle/FileStreamWrappers.cpp @@ -50,7 +50,7 @@ public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIRUNNABLE - CloseRunnable(FileHelper* aFileHelper) + explicit CloseRunnable(FileHelper* aFileHelper) : mFileHelper(aFileHelper) { } @@ -66,7 +66,7 @@ public: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIRUNNABLE - DestroyRunnable(FileHelper* aFileHelper) + explicit DestroyRunnable(FileHelper* aFileHelper) : mFileHelper(aFileHelper) { } diff --git a/dom/filesystem/CreateFileTask.cpp b/dom/filesystem/CreateFileTask.cpp index 2f3ef2479e8..518f024e4d6 100644 --- a/dom/filesystem/CreateFileTask.cpp +++ b/dom/filesystem/CreateFileTask.cpp @@ -150,7 +150,7 @@ CreateFileTask::Work() class AutoClose { public: - AutoClose(nsIOutputStream* aStream) + explicit AutoClose(nsIOutputStream* aStream) : mStream(aStream) { MOZ_ASSERT(aStream); diff --git a/dom/indexedDB/AsyncConnectionHelper.cpp b/dom/indexedDB/AsyncConnectionHelper.cpp index e546d8a5a34..5ee6b272d1e 100644 --- a/dom/indexedDB/AsyncConnectionHelper.cpp +++ b/dom/indexedDB/AsyncConnectionHelper.cpp @@ -41,7 +41,7 @@ class MOZ_STACK_CLASS TransactionPoolEventTarget : public StackBasedEventTarget public: NS_DECL_NSIEVENTTARGET - TransactionPoolEventTarget(IDBTransaction* aTransaction) + explicit TransactionPoolEventTarget(IDBTransaction* aTransaction) : mTransaction(aTransaction) { } diff --git a/dom/indexedDB/AsyncConnectionHelper.h b/dom/indexedDB/AsyncConnectionHelper.h index 7ec764ce698..e39a654a1ae 100644 --- a/dom/indexedDB/AsyncConnectionHelper.h +++ b/dom/indexedDB/AsyncConnectionHelper.h @@ -47,7 +47,7 @@ public: } protected: - HelperBase(IDBRequest* aRequest) + explicit HelperBase(IDBRequest* aRequest) : mRequest(aRequest) { } diff --git a/dom/indexedDB/IDBCursor.cpp b/dom/indexedDB/IDBCursor.cpp index 79ba37abfe3..ec985566ff1 100644 --- a/dom/indexedDB/IDBCursor.cpp +++ b/dom/indexedDB/IDBCursor.cpp @@ -43,7 +43,7 @@ namespace { class CursorHelper : public AsyncConnectionHelper { public: - CursorHelper(IDBCursor* aCursor) + explicit CursorHelper(IDBCursor* aCursor) : AsyncConnectionHelper(aCursor->Transaction(), aCursor->Request()), mCursor(aCursor), mActor(nullptr) { diff --git a/dom/indexedDB/IDBDatabase.cpp b/dom/indexedDB/IDBDatabase.cpp index 8b393757c5f..7fb922b8d48 100644 --- a/dom/indexedDB/IDBDatabase.cpp +++ b/dom/indexedDB/IDBDatabase.cpp @@ -52,7 +52,7 @@ namespace { class NoRequestDatabaseHelper : public AsyncConnectionHelper { public: - NoRequestDatabaseHelper(IDBTransaction* aTransaction) + explicit NoRequestDatabaseHelper(IDBTransaction* aTransaction) : AsyncConnectionHelper(aTransaction, nullptr) { NS_ASSERTION(IndexedDatabaseManager::IsMainProcess(), "Wrong process!"); diff --git a/dom/indexedDB/IDBEvents.h b/dom/indexedDB/IDBEvents.h index c429923100a..af942d286d7 100644 --- a/dom/indexedDB/IDBEvents.h +++ b/dom/indexedDB/IDBEvents.h @@ -134,7 +134,7 @@ public: } protected: - IDBVersionChangeEvent(mozilla::dom::EventTarget* aOwner) + explicit IDBVersionChangeEvent(mozilla::dom::EventTarget* aOwner) : Event(aOwner, nullptr, nullptr) { SetIsDOMBinding(); diff --git a/dom/indexedDB/IDBFileRequest.h b/dom/indexedDB/IDBFileRequest.h index d7939d9b6e1..70624b34a90 100644 --- a/dom/indexedDB/IDBFileRequest.h +++ b/dom/indexedDB/IDBFileRequest.h @@ -65,7 +65,7 @@ public: IMPL_EVENT_HANDLER(progress) private: - IDBFileRequest(nsPIDOMWindow* aWindow); + explicit IDBFileRequest(nsPIDOMWindow* aWindow); ~IDBFileRequest(); void diff --git a/dom/indexedDB/TransactionThreadPool.cpp b/dom/indexedDB/TransactionThreadPool.cpp index 9d746ede8a1..6a59f5b3d99 100644 --- a/dom/indexedDB/TransactionThreadPool.cpp +++ b/dom/indexedDB/TransactionThreadPool.cpp @@ -456,7 +456,7 @@ TransactionThreadPool::AbortTransactionsForDatabase(IDBDatabase* aDatabase) struct MOZ_STACK_CLASS TransactionSearchInfo { - TransactionSearchInfo(nsIOfflineStorage* aDatabase) + explicit TransactionSearchInfo(nsIOfflineStorage* aDatabase) : db(aDatabase), found(false) { } diff --git a/dom/indexedDB/TransactionThreadPool.h b/dom/indexedDB/TransactionThreadPool.h index 549e1f0f13f..4e90cc186fd 100644 --- a/dom/indexedDB/TransactionThreadPool.h +++ b/dom/indexedDB/TransactionThreadPool.h @@ -62,7 +62,7 @@ protected: NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIRUNNABLE - TransactionQueue(IDBTransaction* aTransaction); + explicit TransactionQueue(IDBTransaction* aTransaction); void Unblock(); @@ -84,7 +84,7 @@ protected: struct TransactionInfo { - TransactionInfo(IDBTransaction* aTransaction) + explicit TransactionInfo(IDBTransaction* aTransaction) { MOZ_COUNT_CTOR(TransactionInfo); diff --git a/dom/indexedDB/ipc/IndexedDBChild.cpp b/dom/indexedDB/ipc/IndexedDBChild.cpp index 266b737ee45..5f2754cd9ce 100644 --- a/dom/indexedDB/ipc/IndexedDBChild.cpp +++ b/dom/indexedDB/ipc/IndexedDBChild.cpp @@ -103,7 +103,7 @@ public: class IPCDeleteDatabaseHelper : public AsyncConnectionHelper { public: - IPCDeleteDatabaseHelper(IDBRequest* aRequest) + explicit IPCDeleteDatabaseHelper(IDBRequest* aRequest) : AsyncConnectionHelper(static_cast(nullptr), aRequest) { } diff --git a/dom/mobilemessage/DeletedMessageInfo.h b/dom/mobilemessage/DeletedMessageInfo.h index 34749db2a24..ed42382c968 100644 --- a/dom/mobilemessage/DeletedMessageInfo.h +++ b/dom/mobilemessage/DeletedMessageInfo.h @@ -21,7 +21,7 @@ public: NS_DECL_ISUPPORTS NS_DECL_NSIDELETEDMESSAGEINFO - DeletedMessageInfo(const DeletedMessageInfoData& aData); + explicit DeletedMessageInfo(const DeletedMessageInfoData& aData); DeletedMessageInfo(int32_t* aMessageIds, uint32_t aMsgCount, diff --git a/dom/mobilemessage/MmsMessage.h b/dom/mobilemessage/MmsMessage.h index ab6c5845ecf..2705c007e55 100644 --- a/dom/mobilemessage/MmsMessage.h +++ b/dom/mobilemessage/MmsMessage.h @@ -58,7 +58,7 @@ public: uint64_t aExpiryDate, bool aReadReportRequested); - MmsMessage(const mobilemessage::MmsMessageData& aData); + explicit MmsMessage(const mobilemessage::MmsMessageData& aData); static nsresult Create(int32_t aId, uint64_t aThreadId, diff --git a/dom/mobilemessage/MobileMessageCallback.h b/dom/mobilemessage/MobileMessageCallback.h index d599a1be65c..c3f46d6d0a8 100644 --- a/dom/mobilemessage/MobileMessageCallback.h +++ b/dom/mobilemessage/MobileMessageCallback.h @@ -22,7 +22,7 @@ public: NS_DECL_ISUPPORTS NS_DECL_NSIMOBILEMESSAGECALLBACK - MobileMessageCallback(DOMRequest* aDOMRequest); + explicit MobileMessageCallback(DOMRequest* aDOMRequest); private: ~MobileMessageCallback(); diff --git a/dom/mobilemessage/MobileMessageThread.h b/dom/mobilemessage/MobileMessageThread.h index 695031c34b8..af57a3b9c61 100644 --- a/dom/mobilemessage/MobileMessageThread.h +++ b/dom/mobilemessage/MobileMessageThread.h @@ -31,7 +31,7 @@ public: uint64_t aUnreadCount, mobilemessage::MessageType aLastMessageType); - MobileMessageThread(const ThreadData& aData); + explicit MobileMessageThread(const ThreadData& aData); static nsresult Create(uint64_t aId, const JS::Value& aParticipants, diff --git a/dom/mobilemessage/SmsMessage.h b/dom/mobilemessage/SmsMessage.h index 35cca14302f..44e842c5066 100644 --- a/dom/mobilemessage/SmsMessage.h +++ b/dom/mobilemessage/SmsMessage.h @@ -35,7 +35,7 @@ public: uint64_t aDeliveryTimestamp, bool aRead); - SmsMessage(const mobilemessage::SmsMessageData& aData); + explicit SmsMessage(const mobilemessage::SmsMessageData& aData); static nsresult Create(int32_t aId, uint64_t aThreadId, diff --git a/dom/network/UDPSocket.cpp b/dom/network/UDPSocket.cpp index a01449630d8..2719fff31fd 100644 --- a/dom/network/UDPSocket.cpp +++ b/dom/network/UDPSocket.cpp @@ -497,7 +497,7 @@ UDPSocket::Init(const nsString& aLocalAddress, class OpenSocketRunnable MOZ_FINAL : public nsRunnable { public: - OpenSocketRunnable(UDPSocket* aSocket) : mSocket(aSocket) + explicit OpenSocketRunnable(UDPSocket* aSocket) : mSocket(aSocket) { } NS_IMETHOD Run() MOZ_OVERRIDE diff --git a/dom/notification/DesktopNotification.cpp b/dom/notification/DesktopNotification.cpp index 9ce200df231..9d9f729b2c3 100644 --- a/dom/notification/DesktopNotification.cpp +++ b/dom/notification/DesktopNotification.cpp @@ -33,8 +33,8 @@ public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_NSICONTENTPERMISSIONREQUEST - DesktopNotificationRequest(DesktopNotification* notification) - : mDesktopNotification(notification) {} + explicit DesktopNotificationRequest(DesktopNotification* aNotification) + : mDesktopNotification(aNotification) {} NS_IMETHOD Run() MOZ_OVERRIDE { diff --git a/dom/notification/Notification.cpp b/dom/notification/Notification.cpp index 7fbabfa3186..0117c756fb8 100644 --- a/dom/notification/Notification.cpp +++ b/dom/notification/Notification.cpp @@ -184,7 +184,7 @@ public: NS_DECL_ISUPPORTS NS_DECL_NSIOBSERVER - NotificationObserver(Notification* aNotification) + explicit NotificationObserver(Notification* aNotification) : mNotification(aNotification) {} protected: diff --git a/dom/plugins/base/nsJSNPRuntime.cpp b/dom/plugins/base/nsJSNPRuntime.cpp index 73bcde3ae97..c2312ed6820 100644 --- a/dom/plugins/base/nsJSNPRuntime.cpp +++ b/dom/plugins/base/nsJSNPRuntime.cpp @@ -101,8 +101,8 @@ NPObjectIsOutOfProcessProxy(NPObject *obj) class AutoJSExceptionReporter { public: - AutoJSExceptionReporter(JSContext *cx) - : mCx(cx) + explicit AutoJSExceptionReporter(JSContext* aCx) + : mCx(aCx) { } diff --git a/dom/plugins/base/nsNPAPIPlugin.h b/dom/plugins/base/nsNPAPIPlugin.h index 29edc92b0db..835b1d2978b 100644 --- a/dom/plugins/base/nsNPAPIPlugin.h +++ b/dom/plugins/base/nsNPAPIPlugin.h @@ -380,13 +380,13 @@ class MOZ_STACK_CLASS NPPAutoPusher : public NPPStack, protected PluginDestructionGuard { public: - NPPAutoPusher(NPP npp) - : PluginDestructionGuard(npp), + explicit NPPAutoPusher(NPP aNpp) + : PluginDestructionGuard(aNpp), mOldNPP(sCurrentNPP) { - NS_ASSERTION(npp, "Uh, null npp passed to NPPAutoPusher!"); + NS_ASSERTION(aNpp, "Uh, null aNpp passed to NPPAutoPusher!"); - sCurrentNPP = npp; + sCurrentNPP = aNpp; } ~NPPAutoPusher() diff --git a/dom/plugins/base/nsNPAPIPluginInstance.cpp b/dom/plugins/base/nsNPAPIPluginInstance.cpp index f3193010845..16bd81d0fd8 100644 --- a/dom/plugins/base/nsNPAPIPluginInstance.cpp +++ b/dom/plugins/base/nsNPAPIPluginInstance.cpp @@ -1153,7 +1153,7 @@ nsNPAPIPluginInstance::IsWindowless(bool* isWindowless) class MOZ_STACK_CLASS AutoPluginLibraryCall { public: - AutoPluginLibraryCall(nsNPAPIPluginInstance* aThis) + explicit AutoPluginLibraryCall(nsNPAPIPluginInstance* aThis) : mThis(aThis), mGuard(aThis), mLibrary(nullptr) { nsNPAPIPlugin* plugin = mThis->GetPlugin(); @@ -1669,7 +1669,7 @@ class CarbonEventModelFailureEvent : public nsRunnable { public: nsCOMPtr mContent; - CarbonEventModelFailureEvent(nsIContent* aContent) + explicit CarbonEventModelFailureEvent(nsIContent* aContent) : mContent(aContent) {} diff --git a/dom/plugins/base/nsPluginHost.cpp b/dom/plugins/base/nsPluginHost.cpp index 2af95851f8e..0a2cda47737 100644 --- a/dom/plugins/base/nsPluginHost.cpp +++ b/dom/plugins/base/nsPluginHost.cpp @@ -3634,7 +3634,7 @@ class nsPluginDestroyRunnable : public nsRunnable, public PRCList { public: - nsPluginDestroyRunnable(nsNPAPIPluginInstance *aInstance) + explicit nsPluginDestroyRunnable(nsNPAPIPluginInstance *aInstance) : mInstance(aInstance) { PR_INIT_CLIST(this); diff --git a/dom/plugins/base/nsPluginInstanceOwner.cpp b/dom/plugins/base/nsPluginInstanceOwner.cpp index a1edf28dd58..c32c55c346e 100644 --- a/dom/plugins/base/nsPluginInstanceOwner.cpp +++ b/dom/plugins/base/nsPluginInstanceOwner.cpp @@ -102,7 +102,7 @@ class nsPluginDOMContextMenuListener : public nsIDOMEventListener virtual ~nsPluginDOMContextMenuListener(); public: - nsPluginDOMContextMenuListener(nsIContent* aContent); + explicit nsPluginDOMContextMenuListener(nsIContent* aContent); NS_DECL_ISUPPORTS NS_DECL_NSIDOMEVENTLISTENER diff --git a/dom/plugins/base/nsPluginStreamListenerPeer.cpp b/dom/plugins/base/nsPluginStreamListenerPeer.cpp index 844725ea28a..26ed12fc851 100644 --- a/dom/plugins/base/nsPluginStreamListenerPeer.cpp +++ b/dom/plugins/base/nsPluginStreamListenerPeer.cpp @@ -38,7 +38,7 @@ class nsPluginByteRangeStreamListener , public nsIInterfaceRequestor { public: - nsPluginByteRangeStreamListener(nsIWeakReference* aWeakPtr); + explicit nsPluginByteRangeStreamListener(nsIWeakReference* aWeakPtr); NS_DECL_ISUPPORTS NS_DECL_NSIREQUESTOBSERVER diff --git a/dom/plugins/base/nsPluginStreamListenerPeer.h b/dom/plugins/base/nsPluginStreamListenerPeer.h index c9e7ecf140b..c940329676d 100644 --- a/dom/plugins/base/nsPluginStreamListenerPeer.h +++ b/dom/plugins/base/nsPluginStreamListenerPeer.h @@ -30,7 +30,7 @@ class nsIChannel; class CachedFileHolder { public: - CachedFileHolder(nsIFile* cacheFile); + explicit CachedFileHolder(nsIFile* cacheFile); ~CachedFileHolder(); void AddRef(); diff --git a/dom/plugins/base/nsPluginsDirDarwin.cpp b/dom/plugins/base/nsPluginsDirDarwin.cpp index f33e233ccd6..67ed1c35f86 100644 --- a/dom/plugins/base/nsPluginsDirDarwin.cpp +++ b/dom/plugins/base/nsPluginsDirDarwin.cpp @@ -117,9 +117,9 @@ static char* CFStringRefToUTF8Buffer(CFStringRef cfString) class AutoCFTypeObject { public: - AutoCFTypeObject(CFTypeRef object) + explicit AutoCFTypeObject(CFTypeRef aObject) { - mObject = object; + mObject = aObject; } ~AutoCFTypeObject() { diff --git a/dom/plugins/ipc/PluginBackgroundDestroyer.h b/dom/plugins/ipc/PluginBackgroundDestroyer.h index 761c32cc5e9..96d3c248be9 100644 --- a/dom/plugins/ipc/PluginBackgroundDestroyer.h +++ b/dom/plugins/ipc/PluginBackgroundDestroyer.h @@ -25,7 +25,7 @@ namespace plugins { */ class PluginBackgroundDestroyerParent : public PPluginBackgroundDestroyerParent { public: - PluginBackgroundDestroyerParent(gfxASurface* aDyingBackground); + explicit PluginBackgroundDestroyerParent(gfxASurface* aDyingBackground); virtual ~PluginBackgroundDestroyerParent(); diff --git a/dom/plugins/ipc/PluginInstanceParent.cpp b/dom/plugins/ipc/PluginInstanceParent.cpp index d4f771dac7a..d426bb3aca7 100644 --- a/dom/plugins/ipc/PluginInstanceParent.cpp +++ b/dom/plugins/ipc/PluginInstanceParent.cpp @@ -349,7 +349,7 @@ PluginInstanceParent::AnswerNPN_SetValue_NPPVpluginUsesDOMForCursor( class NotificationSink : public CompositionNotifySink { public: - NotificationSink(PluginInstanceParent *aInstance) : mInstance(aInstance) + explicit NotificationSink(PluginInstanceParent* aInstance) : mInstance(aInstance) { } virtual void DidComposite() { mInstance->DidComposite(); } diff --git a/dom/plugins/ipc/PluginInterposeOSX.mm b/dom/plugins/ipc/PluginInterposeOSX.mm index f43192bbd6d..c6f9b23aa0f 100644 --- a/dom/plugins/ipc/PluginInterposeOSX.mm +++ b/dom/plugins/ipc/PluginInterposeOSX.mm @@ -743,10 +743,10 @@ void NotifyBrowserOfPopCursor() struct WindowInfo { uint32_t window_id; CGRect bounds; - WindowInfo(NSWindow* window) { - NSInteger window_num = [window windowNumber]; + explicit WindowInfo(NSWindow* aWindow) { + NSInteger window_num = [aWindow windowNumber]; window_id = window_num > 0 ? window_num : 0; - bounds = NSRectToCGRect([window frame]); + bounds = NSRectToCGRect([aWindow frame]); } }; diff --git a/dom/plugins/ipc/PluginModuleParent.h b/dom/plugins/ipc/PluginModuleParent.h index 621040c6a10..7d8a335add0 100644 --- a/dom/plugins/ipc/PluginModuleParent.h +++ b/dom/plugins/ipc/PluginModuleParent.h @@ -87,7 +87,7 @@ protected: public: // aFilePath is UTF8, not native! - PluginModuleParent(const char* aFilePath); + explicit PluginModuleParent(const char* aFilePath); virtual ~PluginModuleParent(); virtual void SetPlugin(nsNPAPIPlugin* plugin) MOZ_OVERRIDE diff --git a/dom/plugins/ipc/PluginProcessChild.h b/dom/plugins/ipc/PluginProcessChild.h index 66641e16dea..c3a3b76aa50 100644 --- a/dom/plugins/ipc/PluginProcessChild.h +++ b/dom/plugins/ipc/PluginProcessChild.h @@ -19,7 +19,7 @@ protected: typedef mozilla::ipc::ProcessChild ProcessChild; public: - PluginProcessChild(ProcessHandle parentHandle) : ProcessChild(parentHandle) + explicit PluginProcessChild(ProcessHandle aParentHandle) : ProcessChild(aParentHandle) { } virtual ~PluginProcessChild() diff --git a/dom/plugins/ipc/PluginProcessParent.h b/dom/plugins/ipc/PluginProcessParent.h index ce0cd092f2a..3383621e301 100644 --- a/dom/plugins/ipc/PluginProcessParent.h +++ b/dom/plugins/ipc/PluginProcessParent.h @@ -25,7 +25,7 @@ namespace plugins { class PluginProcessParent : public mozilla::ipc::GeckoChildProcessHost { public: - PluginProcessParent(const std::string& aPluginFilePath); + explicit PluginProcessParent(const std::string& aPluginFilePath); ~PluginProcessParent(); /** diff --git a/dom/plugins/ipc/PluginScriptableObjectParent.h b/dom/plugins/ipc/PluginScriptableObjectParent.h index 1e685e61f71..419ab9dacec 100644 --- a/dom/plugins/ipc/PluginScriptableObjectParent.h +++ b/dom/plugins/ipc/PluginScriptableObjectParent.h @@ -36,7 +36,7 @@ class PluginScriptableObjectParent : public PPluginScriptableObjectParent friend class PluginInstanceParent; public: - PluginScriptableObjectParent(ScriptableObjectType aType); + explicit PluginScriptableObjectParent(ScriptableObjectType aType); virtual ~PluginScriptableObjectParent(); void diff --git a/dom/plugins/ipc/PluginScriptableObjectUtils.h b/dom/plugins/ipc/PluginScriptableObjectUtils.h index 8ae19a27dad..55917e81da7 100644 --- a/dom/plugins/ipc/PluginScriptableObjectUtils.h +++ b/dom/plugins/ipc/PluginScriptableObjectUtils.h @@ -258,7 +258,7 @@ template > class ProtectedActor { public: - ProtectedActor(ActorType* aActor) : mActor(aActor) + explicit ProtectedActor(ActorType* aActor) : mActor(aActor) { if (!Traits::Nullable()) { NS_ASSERTION(mActor, "This should never be null!"); diff --git a/dom/promise/Promise.cpp b/dom/promise/Promise.cpp index a7cd78520d1..b72a68bed66 100644 --- a/dom/promise/Promise.cpp +++ b/dom/promise/Promise.cpp @@ -41,7 +41,7 @@ NS_IMPL_ISUPPORTS0(PromiseNativeHandler) class PromiseTask MOZ_FINAL : public nsRunnable { public: - PromiseTask(Promise* aPromise) + explicit PromiseTask(Promise* aPromise) : mPromise(aPromise) { MOZ_ASSERT(aPromise); diff --git a/dom/quota/QuotaManager.cpp b/dom/quota/QuotaManager.cpp index 74813d55d1c..26d2e3cb7f6 100644 --- a/dom/quota/QuotaManager.cpp +++ b/dom/quota/QuotaManager.cpp @@ -341,7 +341,7 @@ class ResetOrClearRunnable MOZ_FINAL : public nsRunnable, public: NS_DECL_ISUPPORTS_INHERITED - ResetOrClearRunnable(bool aClear) + explicit ResetOrClearRunnable(bool aClear) : mCallbackState(Pending), mClear(aClear) { } @@ -412,7 +412,7 @@ class FinalizeOriginEvictionRunnable MOZ_FINAL : public nsRunnable }; public: - FinalizeOriginEvictionRunnable(nsTArray& aOrigins) + explicit FinalizeOriginEvictionRunnable(nsTArray& aOrigins) : mCallbackState(Pending) { mOrigins.SwapElements(aOrigins); @@ -504,7 +504,7 @@ bool gTestingEnabled = false; class WaitForTransactionsToFinishRunnable MOZ_FINAL : public nsRunnable { public: - WaitForTransactionsToFinishRunnable(SynchronizedOp* aOp) + explicit WaitForTransactionsToFinishRunnable(SynchronizedOp* aOp) : mOp(aOp), mCountdown(1) { NS_ASSERTION(mOp, "Why don't we have a runnable?"); diff --git a/dom/quota/StorageMatcher.h b/dom/quota/StorageMatcher.h index 69b3fff67ed..663269bd28d 100644 --- a/dom/quota/StorageMatcher.h +++ b/dom/quota/StorageMatcher.h @@ -21,7 +21,7 @@ class StorageMatcher : public ValueType struct Closure { - Closure(SelfType& aSelf) + explicit Closure(SelfType& aSelf) : mSelf(aSelf), mPattern(EmptyCString()), mIndexes(nullptr) { } diff --git a/dom/smil/nsSMILTimedElement.cpp b/dom/smil/nsSMILTimedElement.cpp index 7f51987d3da..7af56886988 100644 --- a/dom/smil/nsSMILTimedElement.cpp +++ b/dom/smil/nsSMILTimedElement.cpp @@ -122,7 +122,7 @@ namespace class MOZ_STACK_CLASS nsSMILTimedElement::AutoIntervalUpdateBatcher { public: - AutoIntervalUpdateBatcher(nsSMILTimedElement& aTimedElement) + explicit AutoIntervalUpdateBatcher(nsSMILTimedElement& aTimedElement) : mTimedElement(aTimedElement), mDidSetFlag(!aTimedElement.mDeferIntervalUpdates) { @@ -160,7 +160,7 @@ private: class MOZ_STACK_CLASS nsSMILTimedElement::AutoIntervalUpdater { public: - AutoIntervalUpdater(nsSMILTimedElement& aTimedElement) + explicit AutoIntervalUpdater(nsSMILTimedElement& aTimedElement) : mTimedElement(aTimedElement) { } ~AutoIntervalUpdater() @@ -471,7 +471,7 @@ namespace class MOZ_STACK_CLASS RemoveByCreator { public: - RemoveByCreator(const nsSMILTimeValueSpec* aCreator) : mCreator(aCreator) + explicit RemoveByCreator(const nsSMILTimeValueSpec* aCreator) : mCreator(aCreator) { } bool operator()(nsSMILInstanceTime* aInstanceTime, uint32_t /*aIndex*/) @@ -1338,7 +1338,7 @@ namespace class MOZ_STACK_CLASS RemoveByFunction { public: - RemoveByFunction(nsSMILTimedElement::RemovalTestFunction aFunction) + explicit RemoveByFunction(nsSMILTimedElement::RemovalTestFunction aFunction) : mFunction(aFunction) { } bool operator()(nsSMILInstanceTime* aInstanceTime, uint32_t /*aIndex*/) { @@ -1416,7 +1416,7 @@ namespace class MOZ_STACK_CLASS RemoveReset { public: - RemoveReset(const nsSMILInstanceTime* aCurrentIntervalBegin) + explicit RemoveReset(const nsSMILInstanceTime* aCurrentIntervalBegin) : mCurrentIntervalBegin(aCurrentIntervalBegin) { } bool operator()(nsSMILInstanceTime* aInstanceTime, uint32_t /*aIndex*/) { @@ -1614,7 +1614,7 @@ namespace class MOZ_STACK_CLASS RemoveFiltered { public: - RemoveFiltered(nsSMILTimeValue aCutoff) : mCutoff(aCutoff) { } + explicit RemoveFiltered(nsSMILTimeValue aCutoff) : mCutoff(aCutoff) { } bool operator()(nsSMILInstanceTime* aInstanceTime, uint32_t /*aIndex*/) { // We can filter instance times that: diff --git a/dom/telephony/CallsList.h b/dom/telephony/CallsList.h index 0b3236b4a21..64e4993ec87 100644 --- a/dom/telephony/CallsList.h +++ b/dom/telephony/CallsList.h @@ -24,7 +24,7 @@ public: NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(CallsList) - CallsList(Telephony* aTelephony, TelephonyCallGroup* aGroup = nullptr); + explicit CallsList(Telephony* aTelephony, TelephonyCallGroup* aGroup = nullptr); nsPIDOMWindow* GetParentObject() const; diff --git a/dom/telephony/Telephony.cpp b/dom/telephony/Telephony.cpp index 286fab477c2..8bacfb52343 100644 --- a/dom/telephony/Telephony.cpp +++ b/dom/telephony/Telephony.cpp @@ -39,7 +39,7 @@ public: NS_DECL_ISUPPORTS NS_FORWARD_SAFE_NSITELEPHONYLISTENER(mTelephony) - Listener(Telephony* aTelephony) + explicit Listener(Telephony* aTelephony) : mTelephony(aTelephony) { MOZ_ASSERT(mTelephony); diff --git a/dom/telephony/ipc/TelephonyChild.h b/dom/telephony/ipc/TelephonyChild.h index daa6a70d348..7c05bae67d8 100644 --- a/dom/telephony/ipc/TelephonyChild.h +++ b/dom/telephony/ipc/TelephonyChild.h @@ -18,7 +18,7 @@ class TelephonyIPCService; class TelephonyChild : public PTelephonyChild { public: - TelephonyChild(TelephonyIPCService* aService); + explicit TelephonyChild(TelephonyIPCService* aService); protected: virtual ~TelephonyChild(); diff --git a/dom/workers/DataStore.h b/dom/workers/DataStore.h index 927d1cd8ab6..182c56336f6 100644 --- a/dom/workers/DataStore.h +++ b/dom/workers/DataStore.h @@ -33,7 +33,7 @@ class WorkerDataStore MOZ_FINAL : public DOMEventTargetHelper public: NS_DECL_ISUPPORTS_INHERITED - WorkerDataStore(WorkerGlobalScope* aScope); + explicit WorkerDataStore(WorkerGlobalScope* aScope); // WebIDL (internal functions) @@ -137,4 +137,4 @@ private: } //namespace dom } //namespace mozilla -#endif \ No newline at end of file +#endif diff --git a/dom/workers/DataStoreCursor.h b/dom/workers/DataStoreCursor.h index e34d8685e9c..14114b5d2a0 100644 --- a/dom/workers/DataStoreCursor.h +++ b/dom/workers/DataStoreCursor.h @@ -28,7 +28,7 @@ public: NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WorkerDataStoreCursor) NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(WorkerDataStoreCursor) - WorkerDataStoreCursor(WorkerDataStore* aWorkerStore); + explicit WorkerDataStoreCursor(WorkerDataStore* aWorkerStore); // WebIDL (internal functions) @@ -65,4 +65,4 @@ private: } //namespace dom } //namespace mozilla -#endif \ No newline at end of file +#endif diff --git a/dom/workers/Performance.h b/dom/workers/Performance.h index d2e8ecf7e89..d83f1488606 100644 --- a/dom/workers/Performance.h +++ b/dom/workers/Performance.h @@ -22,7 +22,7 @@ public: NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(Performance) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(Performance) - Performance(WorkerPrivate* aWorkerPrivate); + explicit Performance(WorkerPrivate* aWorkerPrivate); private: ~Performance(); diff --git a/dom/workers/RuntimeService.cpp b/dom/workers/RuntimeService.cpp index 96f4a583d59..712ae1ac9b3 100644 --- a/dom/workers/RuntimeService.cpp +++ b/dom/workers/RuntimeService.cpp @@ -918,7 +918,7 @@ class WorkerBackgroundChildCallback MOZ_FINAL : bool* mDone; public: - WorkerBackgroundChildCallback(bool* aDone) + explicit WorkerBackgroundChildCallback(bool* aDone) : mDone(aDone) { MOZ_ASSERT(!NS_IsMainThread()); @@ -955,7 +955,7 @@ class WorkerThreadPrimaryRunnable MOZ_FINAL : public nsRunnable nsRefPtr mThread; public: - FinishedRunnable(already_AddRefed aThread) + explicit FinishedRunnable(already_AddRefed aThread) : mThread(aThread) { MOZ_ASSERT(mThread); @@ -1034,7 +1034,7 @@ class RuntimeService::WorkerThread MOZ_FINAL : public nsThread WorkerPrivate* mWorkerPrivate; public: - Observer(WorkerPrivate* aWorkerPrivate) + explicit Observer(WorkerPrivate* aWorkerPrivate) : mWorkerPrivate(aWorkerPrivate) { MOZ_ASSERT(aWorkerPrivate); diff --git a/dom/workers/RuntimeService.h b/dom/workers/RuntimeService.h index 3f6597bd9fa..205a744a24d 100644 --- a/dom/workers/RuntimeService.h +++ b/dom/workers/RuntimeService.h @@ -78,7 +78,7 @@ private: WorkerPrivate* mWorkerPrivate; SharedWorkerInfo* mSharedWorkerInfo; - MatchSharedWorkerInfo(WorkerPrivate* aWorkerPrivate) + explicit MatchSharedWorkerInfo(WorkerPrivate* aWorkerPrivate) : mWorkerPrivate(aWorkerPrivate), mSharedWorkerInfo(nullptr) { } }; diff --git a/dom/workers/ServiceWorkerEvents.h b/dom/workers/ServiceWorkerEvents.h index 5fdfd4d34f3..ff366a33e5e 100644 --- a/dom/workers/ServiceWorkerEvents.h +++ b/dom/workers/ServiceWorkerEvents.h @@ -28,7 +28,7 @@ class InstallPhaseEvent : public Event nsRefPtr mPromise; protected: - InstallPhaseEvent(mozilla::dom::EventTarget* aOwner); + explicit InstallPhaseEvent(mozilla::dom::EventTarget* aOwner); ~InstallPhaseEvent() {} public: @@ -80,7 +80,7 @@ class InstallEvent MOZ_FINAL : public InstallPhaseEvent nsRefPtr mActiveWorker; protected: - InstallEvent(mozilla::dom::EventTarget* aOwner); + explicit InstallEvent(mozilla::dom::EventTarget* aOwner); ~InstallEvent() {} public: diff --git a/dom/workers/ServiceWorkerManager.cpp b/dom/workers/ServiceWorkerManager.cpp index cce9aaf451f..f098f30ae0b 100644 --- a/dom/workers/ServiceWorkerManager.cpp +++ b/dom/workers/ServiceWorkerManager.cpp @@ -203,7 +203,7 @@ class FinishFetchOnMainThreadRunnable : public nsRunnable { nsMainThreadPtrHandle mUpdateInstance; public: - FinishFetchOnMainThreadRunnable + explicit FinishFetchOnMainThreadRunnable (const nsMainThreadPtrHandle& aUpdateInstance) : mUpdateInstance(aUpdateInstance) { } @@ -1213,7 +1213,7 @@ class FinishActivationRunnable : public nsRunnable nsMainThreadPtrHandle mRegistration; public: - FinishActivationRunnable(const nsMainThreadPtrHandle& aRegistration) + explicit FinishActivationRunnable(const nsMainThreadPtrHandle& aRegistration) : mRegistration(aRegistration) { MOZ_ASSERT(!NS_IsMainThread()); @@ -1300,7 +1300,7 @@ class FinishActivateHandler : public PromiseNativeHandler nsMainThreadPtrHandle mRegistration; public: - FinishActivateHandler(const nsMainThreadPtrHandle& aRegistration) + explicit FinishActivateHandler(const nsMainThreadPtrHandle& aRegistration) : mRegistration(aRegistration) { MOZ_ASSERT(!NS_IsMainThread()); diff --git a/dom/workers/URL.cpp b/dom/workers/URL.cpp index 9a44abb0fc8..c35fe57733c 100644 --- a/dom/workers/URL.cpp +++ b/dom/workers/URL.cpp @@ -31,7 +31,7 @@ class URLProxy MOZ_FINAL public: NS_INLINE_DECL_THREADSAFE_REFCOUNTING(URLProxy) - URLProxy(mozilla::dom::URL* aURL) + explicit URLProxy(mozilla::dom::URL* aURL) : mURL(aURL) { AssertIsOnMainThread(); @@ -265,7 +265,7 @@ public: class TeardownURLRunnable : public nsRunnable { public: - TeardownURLRunnable(URLProxy* aURLProxy) + explicit TeardownURLRunnable(URLProxy* aURLProxy) : mURLProxy(aURLProxy) { } diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index 5fca2d0c1d7..7c4063d4d4b 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -35,6 +35,7 @@ #include "js/OldDebugAPI.h" #include "js/MemoryMetrics.h" #include "mozilla/Assertions.h" +#include "mozilla/Attributes.h" #include "mozilla/ContentEvents.h" #include "mozilla/EventDispatcher.h" #include "mozilla/Likely.h" @@ -223,7 +224,7 @@ struct WindowAction nsPIDOMWindow* mWindow; bool mDefaultAction; - WindowAction(nsPIDOMWindow* aWindow) + MOZ_IMPLICIT WindowAction(nsPIDOMWindow* aWindow) : mWindow(aWindow), mDefaultAction(true) { } @@ -773,7 +774,7 @@ class TopLevelWorkerFinishedRunnable MOZ_FINAL : public nsRunnable WorkerPrivate* mFinishedWorker; public: - TopLevelWorkerFinishedRunnable(WorkerPrivate* aFinishedWorker) + explicit TopLevelWorkerFinishedRunnable(WorkerPrivate* aFinishedWorker) : mFinishedWorker(aFinishedWorker) { aFinishedWorker->AssertIsOnWorkerThread(); @@ -847,7 +848,7 @@ private: class CompileScriptRunnable MOZ_FINAL : public WorkerRunnable { public: - CompileScriptRunnable(WorkerPrivate* aWorkerPrivate) + explicit CompileScriptRunnable(WorkerPrivate* aWorkerPrivate) : WorkerRunnable(aWorkerPrivate, WorkerThreadModifyBusyCount) { } @@ -874,7 +875,7 @@ private: class CloseEventRunnable MOZ_FINAL : public WorkerRunnable { public: - CloseEventRunnable(WorkerPrivate* aWorkerPrivate) + explicit CloseEventRunnable(WorkerPrivate* aWorkerPrivate) : WorkerRunnable(aWorkerPrivate, WorkerThreadUnchangedBusyCount) { } @@ -1091,7 +1092,7 @@ private: class CloseRunnable MOZ_FINAL : public WorkerControlRunnable { public: - CloseRunnable(WorkerPrivate* aWorkerPrivate) + explicit CloseRunnable(WorkerPrivate* aWorkerPrivate) : WorkerControlRunnable(aWorkerPrivate, ParentThreadUnchangedBusyCount) { } @@ -1108,7 +1109,7 @@ private: class SuspendRunnable MOZ_FINAL : public WorkerControlRunnable { public: - SuspendRunnable(WorkerPrivate* aWorkerPrivate) + explicit SuspendRunnable(WorkerPrivate* aWorkerPrivate) : WorkerControlRunnable(aWorkerPrivate, WorkerThreadUnchangedBusyCount) { } @@ -1123,7 +1124,7 @@ private: class ResumeRunnable MOZ_FINAL : public WorkerControlRunnable { public: - ResumeRunnable(WorkerPrivate* aWorkerPrivate) + explicit ResumeRunnable(WorkerPrivate* aWorkerPrivate) : WorkerControlRunnable(aWorkerPrivate, WorkerThreadUnchangedBusyCount) { } @@ -1332,7 +1333,7 @@ private: class TimerRunnable MOZ_FINAL : public WorkerRunnable { public: - TimerRunnable(WorkerPrivate* aWorkerPrivate) + explicit TimerRunnable(WorkerPrivate* aWorkerPrivate) : WorkerRunnable(aWorkerPrivate, WorkerThreadUnchangedBusyCount) { } @@ -1425,7 +1426,7 @@ class KillCloseEventRunnable MOZ_FINAL : public WorkerRunnable class KillScriptRunnable MOZ_FINAL : public WorkerControlRunnable { public: - KillScriptRunnable(WorkerPrivate* aWorkerPrivate) + explicit KillScriptRunnable(WorkerPrivate* aWorkerPrivate) : WorkerControlRunnable(aWorkerPrivate, WorkerThreadUnchangedBusyCount) { } @@ -1453,7 +1454,7 @@ class KillCloseEventRunnable MOZ_FINAL : public WorkerRunnable }; public: - KillCloseEventRunnable(WorkerPrivate* aWorkerPrivate) + explicit KillCloseEventRunnable(WorkerPrivate* aWorkerPrivate) : WorkerRunnable(aWorkerPrivate, WorkerThreadUnchangedBusyCount) { } @@ -1690,7 +1691,7 @@ class WorkerJSRuntimeStats : public JS::RuntimeStats const nsACString& mRtPath; public: - WorkerJSRuntimeStats(const nsACString& aRtPath) + explicit WorkerJSRuntimeStats(const nsACString& aRtPath) : JS::RuntimeStats(JsWorkerMallocSizeOf), mRtPath(aRtPath) { } @@ -1872,7 +1873,7 @@ class WorkerPrivateParent::EventTarget MOZ_FINAL nsCOMPtr mNestedEventTarget; public: - EventTarget(WorkerPrivate* aWorkerPrivate) + explicit EventTarget(WorkerPrivate* aWorkerPrivate) : mMutex("WorkerPrivateParent::EventTarget::mMutex"), mWorkerPrivate(aWorkerPrivate), mWeakNestedEventTarget(nullptr) { @@ -1963,7 +1964,7 @@ class WorkerPrivate::MemoryReporter MOZ_FINAL : public nsIMemoryReporter bool mAlreadyMappedToAddon; public: - MemoryReporter(WorkerPrivate* aWorkerPrivate) + explicit MemoryReporter(WorkerPrivate* aWorkerPrivate) : mMutex(aWorkerPrivate->mMutex), mWorkerPrivate(aWorkerPrivate), mAlreadyMappedToAddon(false) { @@ -2414,7 +2415,7 @@ WorkerPrivateParent::Suspend(JSContext* aCx, nsPIDOMWindow* aWindow) nsPIDOMWindow* mWindow; bool mAllSuspended; - Closure(nsPIDOMWindow* aWindow) + explicit Closure(nsPIDOMWindow* aWindow) : mWindow(aWindow), mAllSuspended(true) { AssertIsOnMainThread(); @@ -2498,7 +2499,7 @@ WorkerPrivateParent::Resume(JSContext* aCx, nsPIDOMWindow* aWindow) nsPIDOMWindow* mWindow; bool mAnyRunning; - Closure(nsPIDOMWindow* aWindow) + explicit Closure(nsPIDOMWindow* aWindow) : mWindow(aWindow), mAnyRunning(false) { AssertIsOnMainThread(); @@ -3249,7 +3250,7 @@ WorkerPrivateParent::CloseSharedWorkersForWindow( nsPIDOMWindow* mWindow; nsAutoTArray, 10> mSharedWorkers; - Closure(nsPIDOMWindow* aWindow) + explicit Closure(nsPIDOMWindow* aWindow) : mWindow(aWindow) { AssertIsOnMainThread(); diff --git a/dom/workers/WorkerScope.h b/dom/workers/WorkerScope.h index 3be02ad5752..ea4918d5805 100644 --- a/dom/workers/WorkerScope.h +++ b/dom/workers/WorkerScope.h @@ -36,7 +36,7 @@ class WorkerGlobalScope : public DOMEventTargetHelper, protected: WorkerPrivate* mWorkerPrivate; - WorkerGlobalScope(WorkerPrivate* aWorkerPrivate); + explicit WorkerGlobalScope(WorkerPrivate* aWorkerPrivate); virtual ~WorkerGlobalScope(); public: @@ -126,7 +126,7 @@ class DedicatedWorkerGlobalScope MOZ_FINAL : public WorkerGlobalScope ~DedicatedWorkerGlobalScope() { } public: - DedicatedWorkerGlobalScope(WorkerPrivate* aWorkerPrivate); + explicit DedicatedWorkerGlobalScope(WorkerPrivate* aWorkerPrivate); virtual JSObject* WrapGlobalObject(JSContext* aCx) MOZ_OVERRIDE; diff --git a/dom/workers/XMLHttpRequest.cpp b/dom/workers/XMLHttpRequest.cpp index 111d3046b09..bc94c7f60cf 100644 --- a/dom/workers/XMLHttpRequest.cpp +++ b/dom/workers/XMLHttpRequest.cpp @@ -292,7 +292,7 @@ class AsyncTeardownRunnable MOZ_FINAL : public nsRunnable nsRefPtr mProxy; public: - AsyncTeardownRunnable(Proxy* aProxy) + explicit AsyncTeardownRunnable(Proxy* aProxy) : mProxy(aProxy) { MOZ_ASSERT(aProxy); @@ -868,7 +868,7 @@ class AutoUnpinXHR XMLHttpRequest* mXMLHttpRequestPrivate; public: - AutoUnpinXHR(XMLHttpRequest* aXMLHttpRequestPrivate) + explicit AutoUnpinXHR(XMLHttpRequest* aXMLHttpRequestPrivate) : mXMLHttpRequestPrivate(aXMLHttpRequestPrivate) { MOZ_ASSERT(aXMLHttpRequestPrivate); diff --git a/dom/workers/XMLHttpRequest.h b/dom/workers/XMLHttpRequest.h index 100f5fad126..ae22ce54bbe 100644 --- a/dom/workers/XMLHttpRequest.h +++ b/dom/workers/XMLHttpRequest.h @@ -260,7 +260,7 @@ public: } private: - XMLHttpRequest(WorkerPrivate* aWorkerPrivate); + explicit XMLHttpRequest(WorkerPrivate* aWorkerPrivate); ~XMLHttpRequest(); enum ReleaseType { Default, XHRIsGoingAway, WorkerIsGoingAway }; diff --git a/dom/workers/XMLHttpRequestUpload.h b/dom/workers/XMLHttpRequestUpload.h index 64d922c3a7f..e1ca8b72a3d 100644 --- a/dom/workers/XMLHttpRequestUpload.h +++ b/dom/workers/XMLHttpRequestUpload.h @@ -16,7 +16,7 @@ class XMLHttpRequestUpload MOZ_FINAL : public nsXHREventTarget { nsRefPtr mXHR; - XMLHttpRequestUpload(XMLHttpRequest* aXHR); + explicit XMLHttpRequestUpload(XMLHttpRequest* aXHR); ~XMLHttpRequestUpload(); From 3081f6ca917d873b8f6c7c9ed426ac43b05c60e0 Mon Sep 17 00:00:00 2001 From: Luke Wagner Date: Tue, 2 Sep 2014 09:21:42 -0500 Subject: [PATCH 57/66] Bug 1054538 - Store the IonScript in AsmJSModule::ExitDatum for direct access in ~AsmJSModule (r=hannes) --HG-- extra : rebase_source : e4afb40b979f98a1195163ef3728386a88cd7266 --- js/src/asmjs/AsmJSModule.cpp | 21 +++++++++------------ js/src/asmjs/AsmJSModule.h | 5 ++++- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/js/src/asmjs/AsmJSModule.cpp b/js/src/asmjs/AsmJSModule.cpp index 3b6b38f39f0..81d56f776d7 100644 --- a/js/src/asmjs/AsmJSModule.cpp +++ b/js/src/asmjs/AsmJSModule.cpp @@ -121,18 +121,11 @@ AsmJSModule::~AsmJSModule() if (code_) { for (unsigned i = 0; i < numExits(); i++) { AsmJSModule::ExitDatum &exitDatum = exitIndexToGlobalDatum(i); - if (!exitDatum.fun) - continue; - - if (!exitDatum.fun->hasScript()) - continue; - - JSScript *script = exitDatum.fun->nonLazyScript(); - if (!script->hasIonScript()) + if (!exitDatum.ionScript) continue; jit::DependentAsmJSModuleExit exit(this, i); - script->ionScript()->removeDependentAsmJSModule(exit); + exitDatum.ionScript->removeDependentAsmJSModule(exit); } DeallocateExecutableMemory(code_, pod.totalBytes_); @@ -536,7 +529,9 @@ TryEnablingIon(JSContext *cx, AsmJSModule &module, HandleFunction fun, uint32_t if (!ionScript->addDependentAsmJSModule(cx, DependentAsmJSModuleExit(&module, exitIndex))) return false; - module.exitIndexToGlobalDatum(exitIndex).exit = module.ionExitTrampoline(module.exit(exitIndex)); + AsmJSModule::ExitDatum &exitDatum = module.exitIndexToGlobalDatum(exitIndex); + exitDatum.exit = module.ionExitTrampoline(module.exit(exitIndex)); + exitDatum.ionScript = ionScript; return true; } @@ -737,8 +732,10 @@ AsmJSModule::staticallyLink(ExclusiveContext *cx) // Initialize global data segment for (size_t i = 0; i < exits_.length(); i++) { - exitIndexToGlobalDatum(i).exit = interpExitTrampoline(exits_[i]); - exitIndexToGlobalDatum(i).fun = nullptr; + AsmJSModule::ExitDatum &exitDatum = exitIndexToGlobalDatum(i); + exitDatum.exit = interpExitTrampoline(exits_[i]); + exitDatum.fun = nullptr; + exitDatum.ionScript = nullptr; } JS_ASSERT(isStaticallyLinked()); diff --git a/js/src/asmjs/AsmJSModule.h b/js/src/asmjs/AsmJSModule.h index 31432c46f95..ce765f6bb64 100644 --- a/js/src/asmjs/AsmJSModule.h +++ b/js/src/asmjs/AsmJSModule.h @@ -402,6 +402,7 @@ class AsmJSModule struct ExitDatum { uint8_t *exit; + jit::IonScript *ionScript; HeapPtrFunction fun; }; @@ -1339,7 +1340,9 @@ class AsmJSModule } void detachIonCompilation(size_t exitIndex) const { JS_ASSERT(isFinished()); - exitIndexToGlobalDatum(exitIndex).exit = interpExitTrampoline(exit(exitIndex)); + ExitDatum &exitDatum = exitIndexToGlobalDatum(exitIndex); + exitDatum.exit = interpExitTrampoline(exit(exitIndex)); + exitDatum.ionScript = nullptr; } /*************************************************************************/ From ec19e1ef852e77dc5ee30b1195e8d411bfeb72df Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Tue, 2 Sep 2014 10:23:51 -0400 Subject: [PATCH 58/66] Bug 1061269 - Do not try to build the SkBlitRow assembly implementation with clang-cl; r=snorp clang-cl builds use ml.exe which is the MASM assembler, same as the one we use for MSVC builds. In that respect, clang-cl and gcc builds are quite different. --- gfx/skia/generate_mozbuild.py | 2 +- gfx/skia/moz.build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gfx/skia/generate_mozbuild.py b/gfx/skia/generate_mozbuild.py index 5790e426590..2b8e4351e1c 100755 --- a/gfx/skia/generate_mozbuild.py +++ b/gfx/skia/generate_mozbuild.py @@ -37,7 +37,7 @@ if not CONFIG['INTEL_ARCHITECTURE'] and CONFIG['CPU_ARCH'] == 'arm' and CONFIG[' 'trunk/src/opts/memset32_neon.S', ] -if CONFIG['INTEL_ARCHITECTURE'] and (CONFIG['GNU_CC'] or CONFIG['CLANG_CL']): +if CONFIG['INTEL_ARCHITECTURE'] and CONFIG['GNU_CC']: if CONFIG['CPU_ARCH'] == 'x86_64': SOURCES += [ 'trunk/src/opts/SkBlitRow_opts_SSE4_x64_asm.S', diff --git a/gfx/skia/moz.build b/gfx/skia/moz.build index f6cf5777151..2049b6ef88b 100644 --- a/gfx/skia/moz.build +++ b/gfx/skia/moz.build @@ -869,7 +869,7 @@ if not CONFIG['INTEL_ARCHITECTURE'] and CONFIG['CPU_ARCH'] == 'arm' and CONFIG[' 'trunk/src/opts/memset32_neon.S', ] -if CONFIG['INTEL_ARCHITECTURE'] and (CONFIG['GNU_CC'] or CONFIG['CLANG_CL']): +if CONFIG['INTEL_ARCHITECTURE'] and CONFIG['GNU_CC']: if CONFIG['CPU_ARCH'] == 'x86_64': SOURCES += [ 'trunk/src/opts/SkBlitRow_opts_SSE4_x64_asm.S', From 86961cf0f0adddf9888d31c9cff2ada5af15eaf2 Mon Sep 17 00:00:00 2001 From: Mark Banner Date: Tue, 2 Sep 2014 15:32:51 +0100 Subject: [PATCH 59/66] Bug 1061112 - test_app_rep.js fails when "browser.safebrowsing.downloads.enabled" is false or not set. r=gcp --- toolkit/components/downloads/test/unit/test_app_rep.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/toolkit/components/downloads/test/unit/test_app_rep.js b/toolkit/components/downloads/test/unit/test_app_rep.js index 2592525807d..0ed46b72740 100644 --- a/toolkit/components/downloads/test/unit/test_app_rep.js +++ b/toolkit/components/downloads/test/unit/test_app_rep.js @@ -64,8 +64,10 @@ function run_test() { // Ensure safebrowsing is enabled for this test, even if the app // doesn't have it enabled. Services.prefs.setBoolPref("browser.safebrowsing.malware.enabled", true); + Services.prefs.setBoolPref("browser.safebrowsing.downloads.enabled", true); do_register_cleanup(function() { Services.prefs.clearUserPref("browser.safebrowsing.malware.enabled"); + Services.prefs.clearUserPref("browser.safebrowsing.downloads.enabled"); }); // Set block and allow tables explicitly, since the allowlist is normally From a41821c049836abda03f5e3c3f643a9a1635ea21 Mon Sep 17 00:00:00 2001 From: Jan-Ivar Bruaroey Date: Fri, 29 Aug 2014 20:38:09 -0400 Subject: [PATCH 60/66] Bug 1060708 - Detect user and environment cameras on Android. r=gcp,blassey,snorp --- dom/media/MediaManager.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/dom/media/MediaManager.cpp b/dom/media/MediaManager.cpp index c177daa54b0..6596dbb1809 100644 --- a/dom/media/MediaManager.cpp +++ b/dom/media/MediaManager.cpp @@ -388,13 +388,27 @@ VideoDevice::VideoDevice(MediaEngineVideoSource* aSource) mFacingMode = dom::VideoFacingModeEnum::User; } #endif // MOZ_B2G_CAMERA +#if defined(ANDROID) && !defined(MOZ_WIDGET_GONK) + // Names are generated. Example: "Camera 0, Facing back, Orientation 90" + // + // See media/webrtc/trunk/webrtc/modules/video_capture/android/java/src/org/ + // webrtc/videoengine/VideoCaptureDeviceInfoAndroid.java + if (mName.Find(NS_LITERAL_STRING("Facing back")) != kNotFound) { + mHasFacingMode = true; + mFacingMode = dom::VideoFacingModeEnum::Environment; + } else if (mName.Find(NS_LITERAL_STRING("Facing front")) != kNotFound) { + mHasFacingMode = true; + mFacingMode = dom::VideoFacingModeEnum::User; + } +#endif // ANDROID +#ifdef XP_MACOSX // Kludge to test user-facing cameras on OSX. if (mName.Find(NS_LITERAL_STRING("Face")) != -1) { mHasFacingMode = true; mFacingMode = dom::VideoFacingModeEnum::User; } - +#endif mMediaSource = aSource->GetMediaSource(); } From 23449722566fa9e458002a0fa41dece6e5b4e642 Mon Sep 17 00:00:00 2001 From: James Willcox Date: Tue, 2 Sep 2014 09:57:55 -0500 Subject: [PATCH 61/66] Bug 1056947 - Don't enable GLFeature::draw_buffers (and therefore WEBGL_draw_buffers) on GLES3 r=jgilbert --HG-- extra : rebase_source : b2ba97bf610bc414ab744ab08d788b740d518578 --- gfx/gl/GLContextFeatures.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gfx/gl/GLContextFeatures.cpp b/gfx/gl/GLContextFeatures.cpp index e2d6069e1b7..f3f38e53fdc 100644 --- a/gfx/gl/GLContextFeatures.cpp +++ b/gfx/gl/GLContextFeatures.cpp @@ -87,7 +87,7 @@ static const FeatureInfo sFeatureInfoArr[] = { { "draw_buffers", 200, // OpenGL version - 300, // OpenGL ES version + 0, // Only enable when we have the extension on ES, bug 1056947 GLContext::Extension_None, { GLContext::ARB_draw_buffers, From c005d8b31a7211a2e641c6afc5c3c71edadd0124 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Fri, 29 Aug 2014 15:17:10 -0400 Subject: [PATCH 62/66] Bug 1060540 - declare nsIToolkitProfile and nsIProfileLock builtinclass; r=bsmedberg --- toolkit/profile/nsIToolkitProfile.idl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/toolkit/profile/nsIToolkitProfile.idl b/toolkit/profile/nsIToolkitProfile.idl index 8d0c07c5156..14aafc66297 100644 --- a/toolkit/profile/nsIToolkitProfile.idl +++ b/toolkit/profile/nsIToolkitProfile.idl @@ -12,7 +12,7 @@ interface nsIProfileUnlocker; * Hold on to a profile lock. Once you release the last reference to this * interface, the profile lock is released. */ -[scriptable, uuid(7c58c703-d245-4864-8d75-9648ca4a6139)] +[builtinclass, scriptable, uuid(b1c2f328-de6e-45af-a53a-5ec7ce23166e)] interface nsIProfileLock : nsISupports { /** @@ -43,10 +43,8 @@ interface nsIProfileLock : nsISupports /** * A interface representing a profile. - * @note THIS INTERFACE SHOULD BE IMPLEMENTED BY THE TOOLKIT CODE ONLY! DON'T - * EVEN THINK ABOUT IMPLEMENTING THIS IN JAVASCRIPT! */ -[scriptable, uuid(7422b090-4a86-4407-972e-75468a625388)] +[builtinclass, scriptable, uuid(cc53f90b-d1a5-4524-a4db-dc929e656f6b)] interface nsIToolkitProfile : nsISupports { /** From ea4448cfdf32f70d918f85b06c732cb90b3d042b Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Tue, 2 Sep 2014 12:19:32 -0400 Subject: [PATCH 63/66] Bug 1061251 - Fix more bad implicit constructors in accessible; r=tbsaunde --- accessible/atk/RootAccessibleWrap.h | 2 +- accessible/atk/nsMaiHyperlink.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/accessible/atk/RootAccessibleWrap.h b/accessible/atk/RootAccessibleWrap.h index 0f632fc7c0a..50a5a807ab0 100644 --- a/accessible/atk/RootAccessibleWrap.h +++ b/accessible/atk/RootAccessibleWrap.h @@ -23,7 +23,7 @@ typedef RootAccessible RootAccessibleWrap; class GtkWindowAccessible MOZ_FINAL : public DummyAccessible { public: - GtkWindowAccessible(AtkObject* aAccessible); + explicit GtkWindowAccessible(AtkObject* aAccessible); virtual ~GtkWindowAccessible(); }; diff --git a/accessible/atk/nsMaiHyperlink.h b/accessible/atk/nsMaiHyperlink.h index 156bf60bd30..de179366d55 100644 --- a/accessible/atk/nsMaiHyperlink.h +++ b/accessible/atk/nsMaiHyperlink.h @@ -23,7 +23,7 @@ namespace a11y { class MaiHyperlink { public: - MaiHyperlink(Accessible* aHyperLink); + explicit MaiHyperlink(Accessible* aHyperLink); ~MaiHyperlink(); public: From 847854bef99098805b3cf3b3312e2a1143c0f1ee Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Tue, 2 Sep 2014 12:19:58 -0400 Subject: [PATCH 64/66] Bug 1061009 - Fix more bad implicit constructors in a11y; r=tbsaunde --- accessible/base/ARIAMap.h | 2 +- accessible/base/AccCollector.h | 2 +- accessible/base/AccIterator.h | 6 +++--- accessible/base/EventQueue.h | 2 +- accessible/base/NotificationController.h | 4 ++-- accessible/base/Relation.h | 4 ++-- accessible/base/TextAttrs.h | 6 +++--- accessible/base/nsAccessiblePivot.cpp | 4 ++-- accessible/base/nsAccessiblePivot.h | 2 +- accessible/xpcom/xpcAccessibleTable.h | 2 +- accessible/xpcom/xpcAccessibleTableCell.h | 2 +- accessible/xpcom/xpcAccessibleTextRange.h | 2 +- 12 files changed, 19 insertions(+), 19 deletions(-) diff --git a/accessible/base/ARIAMap.h b/accessible/base/ARIAMap.h index 089689aa671..3b1c315fdf2 100644 --- a/accessible/base/ARIAMap.h +++ b/accessible/base/ARIAMap.h @@ -234,7 +234,7 @@ uint8_t AttrCharacteristicsFor(nsIAtom* aAtom); class AttrIterator { public: - AttrIterator(nsIContent* aContent) : + explicit AttrIterator(nsIContent* aContent) : mContent(aContent), mAttrIdx(0) { mAttrCount = mContent->GetAttrCount(); diff --git a/accessible/base/AccCollector.h b/accessible/base/AccCollector.h index 7cd1c5b74cf..b62219761f7 100644 --- a/accessible/base/AccCollector.h +++ b/accessible/base/AccCollector.h @@ -81,7 +81,7 @@ public: protected: // Make sure it's used by Accessible class only. - EmbeddedObjCollector(Accessible* aRoot) : + explicit EmbeddedObjCollector(Accessible* aRoot) : AccCollector(aRoot, filters::GetEmbeddedObject) { } virtual void AppendObject(Accessible* aAccessible); diff --git a/accessible/base/AccIterator.h b/accessible/base/AccIterator.h index 79d3deebffc..8fb761811c1 100644 --- a/accessible/base/AccIterator.h +++ b/accessible/base/AccIterator.h @@ -52,7 +52,7 @@ private: struct IteratorState { - IteratorState(Accessible* aParent, IteratorState* mParentState = nullptr); + explicit IteratorState(Accessible* aParent, IteratorState* mParentState = nullptr); Accessible* mParent; int32_t mIndex; @@ -254,7 +254,7 @@ private: class SingleAccIterator : public AccIterable { public: - SingleAccIterator(Accessible* aTarget): mAcc(aTarget) { } + explicit SingleAccIterator(Accessible* aTarget): mAcc(aTarget) { } virtual ~SingleAccIterator() { } virtual Accessible* Next(); @@ -274,7 +274,7 @@ private: class ItemIterator : public AccIterable { public: - ItemIterator(Accessible* aItemContainer) : + explicit ItemIterator(Accessible* aItemContainer) : mContainer(aItemContainer), mAnchor(nullptr) { } virtual ~ItemIterator() { } diff --git a/accessible/base/EventQueue.h b/accessible/base/EventQueue.h index a5457d5b0a5..73ad154daf2 100644 --- a/accessible/base/EventQueue.h +++ b/accessible/base/EventQueue.h @@ -19,7 +19,7 @@ class DocAccessible; class EventQueue { protected: - EventQueue(DocAccessible* aDocument) : mDocument(aDocument) { } + explicit EventQueue(DocAccessible* aDocument) : mDocument(aDocument) { } /** * Put an accessible event into the queue to process it later. diff --git a/accessible/base/NotificationController.h b/accessible/base/NotificationController.h index e4fdb23d70c..90b6dcb7b02 100644 --- a/accessible/base/NotificationController.h +++ b/accessible/base/NotificationController.h @@ -275,8 +275,8 @@ private: typedef T* KeyType; typedef const T* KeyTypePointer; - nsCOMPtrHashKey(const T* aKey) : mKey(const_cast(aKey)) {} - nsCOMPtrHashKey(const nsPtrHashKey &aToCopy) : mKey(aToCopy.mKey) {} + explicit nsCOMPtrHashKey(const T* aKey) : mKey(const_cast(aKey)) {} + explicit nsCOMPtrHashKey(const nsPtrHashKey &aToCopy) : mKey(aToCopy.mKey) {} ~nsCOMPtrHashKey() { } KeyType GetKey() const { return mKey; } diff --git a/accessible/base/Relation.h b/accessible/base/Relation.h index e81add9d3f2..1a9ac9cfed5 100644 --- a/accessible/base/Relation.h +++ b/accessible/base/Relation.h @@ -23,10 +23,10 @@ class Relation public: Relation() : mFirstIter(nullptr), mLastIter(nullptr) { } - Relation(AccIterable* aIter) : + explicit Relation(AccIterable* aIter) : mFirstIter(aIter), mLastIter(aIter) { } - Relation(Accessible* aAcc) : + explicit Relation(Accessible* aAcc) : mFirstIter(nullptr), mLastIter(nullptr) { AppendTarget(aAcc); } diff --git a/accessible/base/TextAttrs.h b/accessible/base/TextAttrs.h index 23d74bcfdb9..1c5d54c25fa 100644 --- a/accessible/base/TextAttrs.h +++ b/accessible/base/TextAttrs.h @@ -34,7 +34,7 @@ public: /** * Constructor. Used to expose default text attributes. */ - TextAttrsMgr(HyperTextAccessible* aHyperTextAcc) : + explicit TextAttrsMgr(HyperTextAccessible* aHyperTextAcc) : mOffsetAcc(nullptr), mHyperTextAcc(aHyperTextAcc), mOffsetAccIdx(-1), mIncludeDefAttrs(true) { } @@ -126,7 +126,7 @@ protected: class TTextAttr : public TextAttr { public: - TTextAttr(bool aGetRootValue) : mGetRootValue(aGetRootValue) {} + explicit TTextAttr(bool aGetRootValue) : mGetRootValue(aGetRootValue) {} // TextAttr virtual void Expose(nsIPersistentProperties* aAttributes, @@ -393,7 +393,7 @@ protected: { public: TextDecorValue() { } - TextDecorValue(nsIFrame* aFrame); + explicit TextDecorValue(nsIFrame* aFrame); nscolor Color() const { return mColor; } uint8_t Style() const { return mStyle; } diff --git a/accessible/base/nsAccessiblePivot.cpp b/accessible/base/nsAccessiblePivot.cpp index dcf9fcb3f78..27d42033210 100644 --- a/accessible/base/nsAccessiblePivot.cpp +++ b/accessible/base/nsAccessiblePivot.cpp @@ -19,8 +19,8 @@ using namespace mozilla::a11y; class RuleCache { public: - RuleCache(nsIAccessibleTraversalRule* aRule) : mRule(aRule), - mAcceptRoles(nullptr) { } + explicit RuleCache(nsIAccessibleTraversalRule* aRule) : mRule(aRule), + mAcceptRoles(nullptr) { } ~RuleCache () { if (mAcceptRoles) nsMemory::Free(mAcceptRoles); diff --git a/accessible/base/nsAccessiblePivot.h b/accessible/base/nsAccessiblePivot.h index 5bdabca0eab..c05b8022ea7 100644 --- a/accessible/base/nsAccessiblePivot.h +++ b/accessible/base/nsAccessiblePivot.h @@ -25,7 +25,7 @@ class nsAccessiblePivot MOZ_FINAL : public nsIAccessiblePivot public: typedef mozilla::a11y::Accessible Accessible; - nsAccessiblePivot(Accessible* aRoot); + explicit nsAccessiblePivot(Accessible* aRoot); NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsAccessiblePivot, nsIAccessiblePivot) diff --git a/accessible/xpcom/xpcAccessibleTable.h b/accessible/xpcom/xpcAccessibleTable.h index 0b7dfff5df0..21d0d8e7472 100644 --- a/accessible/xpcom/xpcAccessibleTable.h +++ b/accessible/xpcom/xpcAccessibleTable.h @@ -21,7 +21,7 @@ class TableAccessible; class xpcAccessibleTable { public: - xpcAccessibleTable(mozilla::a11y::TableAccessible* aTable) : mTable(aTable) { } + explicit xpcAccessibleTable(mozilla::a11y::TableAccessible* aTable) : mTable(aTable) { } nsresult GetCaption(nsIAccessible** aCaption); nsresult GetSummary(nsAString& aSummary); diff --git a/accessible/xpcom/xpcAccessibleTableCell.h b/accessible/xpcom/xpcAccessibleTableCell.h index 0936b536247..7ac2fa3cb78 100644 --- a/accessible/xpcom/xpcAccessibleTableCell.h +++ b/accessible/xpcom/xpcAccessibleTableCell.h @@ -25,7 +25,7 @@ class TableCellAccessible; class xpcAccessibleTableCell { public: - xpcAccessibleTableCell(mozilla::a11y::TableCellAccessible* aTableCell) : + explicit xpcAccessibleTableCell(mozilla::a11y::TableCellAccessible* aTableCell) : mTableCell(aTableCell) { } nsresult GetTable(nsIAccessibleTable** aTable); diff --git a/accessible/xpcom/xpcAccessibleTextRange.h b/accessible/xpcom/xpcAccessibleTextRange.h index 8692de50fb4..480f80df52a 100644 --- a/accessible/xpcom/xpcAccessibleTextRange.h +++ b/accessible/xpcom/xpcAccessibleTextRange.h @@ -61,7 +61,7 @@ public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_ACCESSIBLETEXTRANGE_IMPL_IID) private: - xpcAccessibleTextRange(TextRange&& aRange) : + explicit xpcAccessibleTextRange(TextRange&& aRange) : mRange(Forward(aRange)) {} xpcAccessibleTextRange() {} From 4dcaff616a84ee04a81b95fd93d45806c9606fd1 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Tue, 2 Sep 2014 12:20:24 -0400 Subject: [PATCH 65/66] Bug 1061047 - Fix some bad implicit constructors in imagelib; r=jrmuizel --- image/decoders/nsBMPDecoder.h | 2 +- image/decoders/nsGIFDecoder2.h | 2 +- image/decoders/nsICODecoder.h | 2 +- image/decoders/nsIconDecoder.h | 2 +- image/decoders/nsPNGDecoder.h | 2 +- image/src/Decoder.h | 2 +- image/src/DynamicImage.h | 2 +- image/src/FrameBlender.h | 2 +- image/src/FrozenImage.h | 2 +- image/src/Image.h | 2 +- image/src/ImageWrapper.h | 2 +- image/src/OrientedImage.cpp | 2 +- image/src/RasterImage.cpp | 2 +- image/src/RasterImage.h | 12 ++++++------ image/src/ScriptedNotificationObserver.h | 2 +- image/src/VectorImage.h | 4 ++-- image/src/imgFrame.h | 2 +- image/src/imgRequest.cpp | 2 +- image/src/imgRequestProxy.cpp | 2 +- image/src/imgStatusTracker.cpp | 2 +- image/src/imgStatusTracker.h | 2 +- 21 files changed, 27 insertions(+), 27 deletions(-) diff --git a/image/decoders/nsBMPDecoder.h b/image/decoders/nsBMPDecoder.h index f6019149428..812565a2bc8 100644 --- a/image/decoders/nsBMPDecoder.h +++ b/image/decoders/nsBMPDecoder.h @@ -24,7 +24,7 @@ class nsBMPDecoder : public Decoder { public: - nsBMPDecoder(RasterImage &aImage); + explicit nsBMPDecoder(RasterImage &aImage); ~nsBMPDecoder(); // Specifies whether or not the BMP file will contain alpha data diff --git a/image/decoders/nsGIFDecoder2.h b/image/decoders/nsGIFDecoder2.h index 90cc71fc22c..b000de70746 100644 --- a/image/decoders/nsGIFDecoder2.h +++ b/image/decoders/nsGIFDecoder2.h @@ -23,7 +23,7 @@ class nsGIFDecoder2 : public Decoder { public: - nsGIFDecoder2(RasterImage &aImage); + explicit nsGIFDecoder2(RasterImage &aImage); ~nsGIFDecoder2(); virtual void WriteInternal(const char* aBuffer, uint32_t aCount, DecodeStrategy aStrategy); diff --git a/image/decoders/nsICODecoder.h b/image/decoders/nsICODecoder.h index 73576b8036f..b21cb61707e 100644 --- a/image/decoders/nsICODecoder.h +++ b/image/decoders/nsICODecoder.h @@ -22,7 +22,7 @@ class nsICODecoder : public Decoder { public: - nsICODecoder(RasterImage &aImage); + explicit nsICODecoder(RasterImage &aImage); virtual ~nsICODecoder(); // Obtains the width of the icon directory entry diff --git a/image/decoders/nsIconDecoder.h b/image/decoders/nsIconDecoder.h index 4fcffcdd36b..d04f846c602 100644 --- a/image/decoders/nsIconDecoder.h +++ b/image/decoders/nsIconDecoder.h @@ -38,7 +38,7 @@ class nsIconDecoder : public Decoder { public: - nsIconDecoder(RasterImage &aImage); + explicit nsIconDecoder(RasterImage &aImage); virtual ~nsIconDecoder(); virtual void WriteInternal(const char* aBuffer, uint32_t aCount, DecodeStrategy aStrategy); diff --git a/image/decoders/nsPNGDecoder.h b/image/decoders/nsPNGDecoder.h index cfa211b779f..ca7a227447a 100644 --- a/image/decoders/nsPNGDecoder.h +++ b/image/decoders/nsPNGDecoder.h @@ -24,7 +24,7 @@ class RasterImage; class nsPNGDecoder : public Decoder { public: - nsPNGDecoder(RasterImage &aImage); + explicit nsPNGDecoder(RasterImage &aImage); virtual ~nsPNGDecoder(); virtual void InitInternal(); diff --git a/image/src/Decoder.h b/image/src/Decoder.h index 6527ca9b186..dd500f9b945 100644 --- a/image/src/Decoder.h +++ b/image/src/Decoder.h @@ -32,7 +32,7 @@ class Decoder { public: - Decoder(RasterImage& aImage); + explicit Decoder(RasterImage& aImage); virtual ~Decoder(); /** diff --git a/image/src/DynamicImage.h b/image/src/DynamicImage.h index 207f126e683..f2f216ef5c6 100644 --- a/image/src/DynamicImage.h +++ b/image/src/DynamicImage.h @@ -25,7 +25,7 @@ public: NS_DECL_ISUPPORTS NS_DECL_IMGICONTAINER - DynamicImage(gfxDrawable* aDrawable) + explicit DynamicImage(gfxDrawable* aDrawable) : mDrawable(aDrawable) { MOZ_ASSERT(aDrawable, "Must have a gfxDrawable to wrap"); diff --git a/image/src/FrameBlender.h b/image/src/FrameBlender.h index 85fe191019e..a7fc62f8469 100644 --- a/image/src/FrameBlender.h +++ b/image/src/FrameBlender.h @@ -32,7 +32,7 @@ public: * * If aSequenceToUse is not specified, it will be allocated automatically. */ - FrameBlender(FrameSequence* aSequenceToUse = nullptr); + explicit FrameBlender(FrameSequence* aSequenceToUse = nullptr); ~FrameBlender(); bool DoBlend(nsIntRect* aDirtyRect, uint32_t aPrevFrameIndex, diff --git a/image/src/FrozenImage.h b/image/src/FrozenImage.h index 32b0f466408..c197f61c97a 100644 --- a/image/src/FrozenImage.h +++ b/image/src/FrozenImage.h @@ -55,7 +55,7 @@ public: NS_IMETHOD_(float) GetFrameIndex(uint32_t aWhichFrame) MOZ_OVERRIDE; protected: - FrozenImage(Image* aImage) : ImageWrapper(aImage) { } + explicit FrozenImage(Image* aImage) : ImageWrapper(aImage) { } virtual ~FrozenImage() { } private: diff --git a/image/src/Image.h b/image/src/Image.h index 7579ef02ec3..711e1f89298 100644 --- a/image/src/Image.h +++ b/image/src/Image.h @@ -179,7 +179,7 @@ public: virtual ImageURL* GetURI() MOZ_OVERRIDE { return mURI.get(); } protected: - ImageResource(ImageURL* aURI); + explicit ImageResource(ImageURL* aURI); // Shared functionality for implementors of imgIContainer. Every // implementation of attribute animationMode should forward here. diff --git a/image/src/ImageWrapper.h b/image/src/ImageWrapper.h index 071dbff72be..820895ade42 100644 --- a/image/src/ImageWrapper.h +++ b/image/src/ImageWrapper.h @@ -63,7 +63,7 @@ public: virtual ImageURL* GetURI() MOZ_OVERRIDE; protected: - ImageWrapper(Image* aInnerImage) + explicit ImageWrapper(Image* aInnerImage) : mInnerImage(aInnerImage) { NS_ABORT_IF_FALSE(aInnerImage, "Cannot wrap a null image"); diff --git a/image/src/OrientedImage.cpp b/image/src/OrientedImage.cpp index bec3a43fb1c..b620e7faf73 100644 --- a/image/src/OrientedImage.cpp +++ b/image/src/OrientedImage.cpp @@ -164,7 +164,7 @@ OrientedImage::GetImageContainer(LayerManager* aManager, ImageContainer** _retva struct MatrixBuilder { - MatrixBuilder(bool aInvert) : mInvert(aInvert) { } + explicit MatrixBuilder(bool aInvert) : mInvert(aInvert) { } gfxMatrix Build() { return mMatrix; } diff --git a/image/src/RasterImage.cpp b/image/src/RasterImage.cpp index a473ee42a88..1249518faa3 100644 --- a/image/src/RasterImage.cpp +++ b/image/src/RasterImage.cpp @@ -294,7 +294,7 @@ public: class DrawRunner : public nsRunnable { public: - DrawRunner(ScaleRequest* request) + explicit DrawRunner(ScaleRequest* request) : mScaleRequest(request) {} diff --git a/image/src/RasterImage.h b/image/src/RasterImage.h index 7e3f5b55e5b..6f4d1e4ed19 100644 --- a/image/src/RasterImage.h +++ b/image/src/RasterImage.h @@ -350,7 +350,7 @@ private: */ struct DecodeRequest { - DecodeRequest(RasterImage* aImage) + explicit DecodeRequest(RasterImage* aImage) : mImage(aImage) , mBytesToDecode(0) , mRequestStatus(REQUEST_INACTIVE) @@ -546,7 +546,7 @@ private: NS_IMETHOD Run(); private: /* methods */ - FrameNeededWorker(RasterImage* image); + explicit FrameNeededWorker(RasterImage* image); private: /* members */ @@ -780,7 +780,7 @@ private: // data NS_IMETHOD Run(); private: - HandleErrorWorker(RasterImage* aImage); + explicit HandleErrorWorker(RasterImage* aImage); nsRefPtr mImage; }; @@ -793,8 +793,8 @@ private: // data bool StoringSourceData() const; protected: - RasterImage(imgStatusTracker* aStatusTracker = nullptr, - ImageURL* aURI = nullptr); + explicit RasterImage(imgStatusTracker* aStatusTracker = nullptr, + ImageURL* aURI = nullptr); bool ShouldAnimate(); @@ -814,7 +814,7 @@ inline NS_IMETHODIMP RasterImage::GetAnimationMode(uint16_t *aAnimationMode) { class imgDecodeRequestor : public nsRunnable { public: - imgDecodeRequestor(RasterImage &aContainer) { + explicit imgDecodeRequestor(RasterImage &aContainer) { mContainer = &aContainer; } NS_IMETHOD Run() { diff --git a/image/src/ScriptedNotificationObserver.h b/image/src/ScriptedNotificationObserver.h index a08ede2e37d..fccb3010b04 100644 --- a/image/src/ScriptedNotificationObserver.h +++ b/image/src/ScriptedNotificationObserver.h @@ -19,7 +19,7 @@ namespace image { class ScriptedNotificationObserver : public imgINotificationObserver { public: - ScriptedNotificationObserver(imgIScriptedNotificationObserver* aInner); + explicit ScriptedNotificationObserver(imgIScriptedNotificationObserver* aInner); NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_IMGINOTIFICATIONOBSERVER diff --git a/image/src/VectorImage.h b/image/src/VectorImage.h index a7d49bd99de..fee70a703c2 100644 --- a/image/src/VectorImage.h +++ b/image/src/VectorImage.h @@ -78,8 +78,8 @@ public: void OnSVGDocumentError(); protected: - VectorImage(imgStatusTracker* aStatusTracker = nullptr, - ImageURL* aURI = nullptr); + explicit VectorImage(imgStatusTracker* aStatusTracker = nullptr, + ImageURL* aURI = nullptr); virtual ~VectorImage(); virtual nsresult StartAnimation(); diff --git a/image/src/imgFrame.h b/image/src/imgFrame.h index 96eb659d897..9db2e59a7a4 100644 --- a/image/src/imgFrame.h +++ b/image/src/imgFrame.h @@ -172,7 +172,7 @@ private: // data class AutoFrameLocker { public: - AutoFrameLocker(imgFrame* frame) + explicit AutoFrameLocker(imgFrame* frame) : mFrame(frame) , mSucceeded(NS_SUCCEEDED(frame->LockImageData())) {} diff --git a/image/src/imgRequest.cpp b/image/src/imgRequest.cpp index 7536861c736..51030bf967b 100644 --- a/image/src/imgRequest.cpp +++ b/image/src/imgRequest.cpp @@ -303,7 +303,7 @@ void imgRequest::ContinueCancel(nsresult aStatus) class imgRequestMainThreadEvict : public nsRunnable { public: - imgRequestMainThreadEvict(imgRequest *aImgRequest) + explicit imgRequestMainThreadEvict(imgRequest *aImgRequest) : mImgRequest(aImgRequest) { MOZ_ASSERT(!NS_IsMainThread(), "Create me off main thread only!"); diff --git a/image/src/imgRequestProxy.cpp b/image/src/imgRequestProxy.cpp index 967c01d331a..17fbe76563d 100644 --- a/image/src/imgRequestProxy.cpp +++ b/image/src/imgRequestProxy.cpp @@ -1050,7 +1050,7 @@ imgRequestProxy::GetOwner() const class StaticBehaviour : public ProxyBehaviour { public: - StaticBehaviour(mozilla::image::Image* aImage) : mImage(aImage) {} + explicit StaticBehaviour(mozilla::image::Image* aImage) : mImage(aImage) {} virtual already_AddRefed GetImage() const MOZ_OVERRIDE { diff --git a/image/src/imgStatusTracker.cpp b/image/src/imgStatusTracker.cpp index 0a9af6bb6b2..4000266ab59 100644 --- a/image/src/imgStatusTracker.cpp +++ b/image/src/imgStatusTracker.cpp @@ -23,7 +23,7 @@ using mozilla::WeakPtr; class imgStatusTrackerObserver : public imgDecoderObserver { public: - imgStatusTrackerObserver(imgStatusTracker* aTracker) + explicit imgStatusTrackerObserver(imgStatusTracker* aTracker) : mTracker(aTracker) { MOZ_ASSERT(aTracker); diff --git a/image/src/imgStatusTracker.h b/image/src/imgStatusTracker.h index e4e455b0e6e..ef149e6bbf2 100644 --- a/image/src/imgStatusTracker.h +++ b/image/src/imgStatusTracker.h @@ -117,7 +117,7 @@ public: // aImage is the image that this status tracker will pass to the // imgRequestProxys in SyncNotify() and EmulateRequestFinished(), and must be // alive as long as this instance is, because we hold a weak reference to it. - imgStatusTracker(mozilla::image::Image* aImage); + explicit imgStatusTracker(mozilla::image::Image* aImage); // Image-setter, for imgStatusTrackers created by imgRequest::Init, which // are created before their Image is created. This method should only From 907e3c92d47020e563a0a924eede09d32dd88fbe Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Tue, 2 Sep 2014 12:20:50 -0400 Subject: [PATCH 66/66] Bug 1060918 - Do not rely on two implicit conversions in GLContextProviderWGL.cpp for clang-cl compatibility; r=jrmuizel This works around http://llvm.org/PR20821. --- gfx/gl/GLContextProviderWGL.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gfx/gl/GLContextProviderWGL.cpp b/gfx/gl/GLContextProviderWGL.cpp index 8e2cf087ab2..a8c2124d678 100644 --- a/gfx/gl/GLContextProviderWGL.cpp +++ b/gfx/gl/GLContextProviderWGL.cpp @@ -635,7 +635,7 @@ GLContextProviderWGL::CreateHeadless() return nullptr; } - nsRefPtr retGL = glContext; + nsRefPtr retGL = glContext.get(); return retGL.forget(); }