diff --git a/CLOBBER b/CLOBBER index 4108b26533d8..22d13e193ea8 100644 --- a/CLOBBER +++ b/CLOBBER @@ -22,4 +22,4 @@ # changes to stick? As of bug 928195, this shouldn't be necessary! Please # don't change CLOBBER for WebIDL changes any more. -Bug 916012 moves definition from one WEBIDL_FILE to another (Bug 979886) +Bug 995411 moves some files around in gfx/layers and widget/xpwidget diff --git a/content/media/gstreamer/GStreamerFormatHelper.cpp b/content/media/gstreamer/GStreamerFormatHelper.cpp index a5e5db8fedf7..6557ad4c8bf6 100644 --- a/content/media/gstreamer/GStreamerFormatHelper.cpp +++ b/content/media/gstreamer/GStreamerFormatHelper.cpp @@ -30,10 +30,8 @@ GStreamerFormatHelper* GStreamerFormatHelper::Instance() { } void GStreamerFormatHelper::Shutdown() { - if (gInstance) { - delete gInstance; - gInstance = nullptr; - } + delete gInstance; + gInstance = nullptr; } static char const *const sContainers[6][2] = { diff --git a/content/media/omx/AudioOutput.cpp b/content/media/omx/AudioOutput.cpp index 7a96ddbab478..69f4ac909efb 100644 --- a/content/media/omx/AudioOutput.cpp +++ b/content/media/omx/AudioOutput.cpp @@ -180,10 +180,8 @@ void AudioOutput::Close() AUDIO_OFFLOAD_LOG(PR_LOG_DEBUG, ("%s", __PRETTY_FUNCTION__)); mTrack.clear(); - if (mCallbackData) { - delete mCallbackData; - mCallbackData = NULL; - } + delete mCallbackData; + mCallbackData = nullptr; } // static diff --git a/content/media/plugins/MediaPluginHost.cpp b/content/media/plugins/MediaPluginHost.cpp index b8c4844ec48d..c8ea4e682635 100644 --- a/content/media/plugins/MediaPluginHost.cpp +++ b/content/media/plugins/MediaPluginHost.cpp @@ -323,10 +323,8 @@ MediaPluginHost *GetMediaPluginHost() void MediaPluginHost::Shutdown() { - if (sMediaPluginHost) { - delete sMediaPluginHost; - sMediaPluginHost = nullptr; - } + delete sMediaPluginHost; + sMediaPluginHost = nullptr; } } // namespace mozilla diff --git a/content/media/webrtc/MediaEngineWebRTCAudio.cpp b/content/media/webrtc/MediaEngineWebRTCAudio.cpp index dfbf2121336c..a01a20209d23 100644 --- a/content/media/webrtc/MediaEngineWebRTCAudio.cpp +++ b/content/media/webrtc/MediaEngineWebRTCAudio.cpp @@ -468,10 +468,7 @@ MediaEngineWebRTCAudioSource::Shutdown() mVoENetwork->DeRegisterExternalTransport(mChannel); } - if (mNullTransport) { - delete mNullTransport; - } - + delete mNullTransport; return; } @@ -491,9 +488,7 @@ MediaEngineWebRTCAudioSource::Shutdown() mVoENetwork->DeRegisterExternalTransport(mChannel); } - if (mNullTransport) { - delete mNullTransport; - } + delete mNullTransport; mVoEProcessing = nullptr; mVoENetwork = nullptr; diff --git a/editor/reftests/xul/reftest.list b/editor/reftests/xul/reftest.list index 14f639bad925..a4de29c2503c 100644 --- a/editor/reftests/xul/reftest.list +++ b/editor/reftests/xul/reftest.list @@ -1,29 +1,29 @@ -fails-if(Android||B2G) == empty-1.xul empty-ref.xul # bug 783658 -!= empty-2.xul empty-ref.xul +fails-if(Android||B2G) skip-if(B2G&&browserIsRemote) == empty-1.xul empty-ref.xul # bug 783658 +skip-if(B2G&&browserIsRemote) != empty-2.xul empty-ref.xul # There is no way to simulate an autocomplete textbox in windows XP/Vista/7 default theme using CSS. # Therefore, the equlity tests below should be marked as failing. -fails-if(Android||B2G) fails-if(windowsDefaultTheme&&/^Windows\x20NT\x20(5\.[12]|6\.[012])/.test(http.oscpu)) == autocomplete-1.xul autocomplete-ref.xul # bug 783658 -fails-if(Android||B2G) fails-if(windowsDefaultTheme&&/^Windows\x20NT\x20(5\.[12]|6\.[012])/.test(http.oscpu)) == emptyautocomplete-1.xul emptyautocomplete-ref.xul # bug 783658 -!= emptymultiline-1.xul emptymultiline-ref.xul -fails-if(Android||B2G) == emptymultiline-2.xul emptymultiline-ref.xul # bug 783658 -fails-if(Android||B2G) == emptytextbox-1.xul emptytextbox-ref.xul # bug 783658 -fails-if(Android||B2G) == emptytextbox-2.xul emptytextbox-ref.xul # bug 783658 -!= emptytextbox-3.xul emptytextbox-ref.xul -!= emptytextbox-4.xul emptytextbox-ref.xul -fails-if(Android||B2G) == emptytextbox-5.xul emptytextbox-ref.xul # bug 783658 +fails-if(Android||B2G) fails-if(windowsDefaultTheme&&/^Windows\x20NT\x20(5\.[12]|6\.[012])/.test(http.oscpu)) skip-if(B2G&&browserIsRemote) == autocomplete-1.xul autocomplete-ref.xul # bug 783658 +fails-if(Android||B2G) fails-if(windowsDefaultTheme&&/^Windows\x20NT\x20(5\.[12]|6\.[012])/.test(http.oscpu)) skip-if(B2G&&browserIsRemote) == emptyautocomplete-1.xul emptyautocomplete-ref.xul # bug 783658 +skip-if(B2G&&browserIsRemote) != emptymultiline-1.xul emptymultiline-ref.xul +fails-if(Android||B2G) skip-if(B2G&&browserIsRemote) == emptymultiline-2.xul emptymultiline-ref.xul # bug 783658 +fails-if(Android||B2G) skip-if(B2G&&browserIsRemote) == emptytextbox-1.xul emptytextbox-ref.xul # bug 783658 +fails-if(Android||B2G) skip-if(B2G&&browserIsRemote) == emptytextbox-2.xul emptytextbox-ref.xul # bug 783658 +skip-if(B2G&&browserIsRemote) != emptytextbox-3.xul emptytextbox-ref.xul +skip-if(B2G&&browserIsRemote) != emptytextbox-4.xul emptytextbox-ref.xul +fails-if(Android||B2G) skip-if(B2G&&browserIsRemote) == emptytextbox-5.xul emptytextbox-ref.xul # bug 783658 # There is no way to simulate a number textbox in windows XP/Vista/7 default theme using CSS. # Therefore, the equlity tests below should be marked as failing. -!= number-1.xul number-ref.xul -!= number-2.xul number-ref.xul -fails-if(Android||B2G) fails-if(windowsDefaultTheme&&/^Windows\x20NT\x20(5\.[12]|6\.[012])/.test(http.oscpu)) == number-3.xul number-ref.xul # bug 783658 -!= number-4.xul number-ref.xul -fails-if(Android||B2G) fails-if(windowsDefaultTheme&&/^Windows\x20NT\x20(5\.[12]|6\.[012])/.test(http.oscpu)) == number-5.xul number-ref.xul # bug 783658 -fails-if(Android||B2G) fails-if(windowsDefaultTheme&&/^Windows\x20NT\x20(5\.[12]|6\.[012])/.test(http.oscpu)) == numberwithvalue-1.xul numberwithvalue-ref.xul # bug 783658 -fails-if(Android||B2G) == passwd-1.xul passwd-ref.xul # bug 783658 -fails-if(Android||B2G) == passwd-2.xul passwd-ref.xul # bug 783658 -!= passwd-3.xul passwd-ref.xul -fails-if(Android||B2G) == plain-1.xul plain-ref.xul # bug 783658 -fails-if(Android||B2G) == textbox-1.xul textbox-ref.xul -!= textbox-disabled.xul textbox-ref.xul +skip-if(B2G&&browserIsRemote) != number-1.xul number-ref.xul +skip-if(B2G&&browserIsRemote) != number-2.xul number-ref.xul +fails-if(Android||B2G) fails-if(windowsDefaultTheme&&/^Windows\x20NT\x20(5\.[12]|6\.[012])/.test(http.oscpu)) skip-if(B2G&&browserIsRemote) == number-3.xul number-ref.xul # bug 783658 +skip-if(B2G&&browserIsRemote) != number-4.xul number-ref.xul +fails-if(Android||B2G) fails-if(windowsDefaultTheme&&/^Windows\x20NT\x20(5\.[12]|6\.[012])/.test(http.oscpu)) skip-if(B2G&&browserIsRemote) == number-5.xul number-ref.xul # bug 783658 +fails-if(Android||B2G) fails-if(windowsDefaultTheme&&/^Windows\x20NT\x20(5\.[12]|6\.[012])/.test(http.oscpu)) skip-if(B2G&&browserIsRemote) == numberwithvalue-1.xul numberwithvalue-ref.xul # bug 783658 +fails-if(Android||B2G) skip-if(B2G&&browserIsRemote) == passwd-1.xul passwd-ref.xul # bug 783658 +fails-if(Android||B2G) skip-if(B2G&&browserIsRemote) == passwd-2.xul passwd-ref.xul # bug 783658 +skip-if(B2G&&browserIsRemote) != passwd-3.xul passwd-ref.xul +fails-if(Android||B2G) skip-if(B2G&&browserIsRemote) == plain-1.xul plain-ref.xul # bug 783658 +fails-if(Android||B2G) skip-if(B2G&&browserIsRemote) == textbox-1.xul textbox-ref.xul +skip-if(B2G&&browserIsRemote) != textbox-disabled.xul textbox-ref.xul # Read-only textboxes look like normal textboxes in windows Vista/7 default theme -fails-if(windowsDefaultTheme&&/^Windows\x20NT\x206\.[012]/.test(http.oscpu)) != textbox-readonly.xul textbox-ref.xul +fails-if(windowsDefaultTheme&&/^Windows\x20NT\x206\.[012]/.test(http.oscpu)) skip-if(B2G&&browserIsRemote) != textbox-readonly.xul textbox-ref.xul diff --git a/gfx/thebes/gfxMacPlatformFontList.mm b/gfx/thebes/gfxMacPlatformFontList.mm index c7a1199e67bb..f5bb856eba4c 100644 --- a/gfx/thebes/gfxMacPlatformFontList.mm +++ b/gfx/thebes/gfxMacPlatformFontList.mm @@ -830,13 +830,13 @@ gfxMacPlatformFontList::RegisteredFontsChangedNotificationCallback(CFNotificatio return; } + gfxMacPlatformFontList* fl = static_cast(observer); + // xxx - should be carefully pruning the list of fonts, not rebuilding it from scratch - static_cast(observer)->UpdateFontList(); + fl->UpdateFontList(); // modify a preference that will trigger reflow everywhere - static const char kPrefName[] = "font.internaluseonly.changed"; - bool fontInternalChange = Preferences::GetBool(kPrefName, false); - Preferences::SetBool(kPrefName, !fontInternalChange); + fl->ForceGlobalReflow(); } gfxFontEntry* diff --git a/gfx/thebes/gfxPlatformFontList.cpp b/gfx/thebes/gfxPlatformFontList.cpp index dee2446080d2..46a39cd7e003 100644 --- a/gfx/thebes/gfxPlatformFontList.cpp +++ b/gfx/thebes/gfxPlatformFontList.cpp @@ -9,6 +9,7 @@ #include "prlog.h" #include "gfxPlatformFontList.h" +#include "gfxUserFontSet.h" #include "nsUnicharUtils.h" #include "nsUnicodeRange.h" @@ -303,6 +304,21 @@ gfxPlatformFontList::ResolveFontName(const nsAString& aFontName, nsAString& aRes return false; } +static PLDHashOperator +RebuildLocalFonts(nsPtrHashKey* aKey, + void* aClosure) +{ + aKey->GetKey()->RebuildLocalRules(); + return PL_DHASH_NEXT; +} + +void +gfxPlatformFontList::UpdateFontList() +{ + InitFontList(); + mUserFontSetList.EnumerateEntries(RebuildLocalFonts, nullptr); +} + struct FontListData { FontListData(nsIAtom *aLangGroup, const nsACString& aGenericFamily, @@ -797,6 +813,11 @@ gfxPlatformFontList::LoadFontInfo() } #endif + if (done) { + mOtherFamilyNamesInitialized = true; + mFaceNamesInitialized = true; + } + return done; } @@ -820,8 +841,6 @@ gfxPlatformFontList::CleanupLoader() } #endif - mOtherFamilyNamesInitialized = true; - mFaceNamesInitialized = true; gfxFontInfoLoader::CleanupLoader(); } @@ -839,6 +858,15 @@ gfxPlatformFontList::GetPrefsAndStartLoader() StartLoader(delay, interval); } +void +gfxPlatformFontList::ForceGlobalReflow() +{ + // modify a preference that will trigger reflow everywhere + static const char kPrefName[] = "font.internaluseonly.changed"; + bool fontInternalChange = Preferences::GetBool(kPrefName, false); + Preferences::SetBool(kPrefName, !fontInternalChange); +} + // Support for memory reporting static size_t diff --git a/gfx/thebes/gfxPlatformFontList.h b/gfx/thebes/gfxPlatformFontList.h index 3cb1afcaa1e8..fa39bca4be90 100644 --- a/gfx/thebes/gfxPlatformFontList.h +++ b/gfx/thebes/gfxPlatformFontList.h @@ -82,6 +82,8 @@ struct FontListSizes { uint32_t mCharMapsSize; // memory used for cmap coverage info }; +class gfxUserFontSet; + class gfxPlatformFontList : public gfxFontInfoLoader { public: @@ -115,7 +117,7 @@ public: virtual bool ResolveFontName(const nsAString& aFontName, nsAString& aResolvedFontName); - void UpdateFontList() { InitFontList(); } + void UpdateFontList(); void ClearPrefFonts() { mPrefFonts.Clear(); } @@ -178,6 +180,15 @@ public: // remove the cmap from the shared cmap set void RemoveCmap(const gfxCharacterMap *aCharMap); + // keep track of userfont sets to notify when global fontlist changes occur + void AddUserFontSet(gfxUserFontSet *aUserFontSet) { + mUserFontSetList.PutEntry(aUserFontSet); + } + + void RemoveUserFontSet(gfxUserFontSet *aUserFontSet) { + mUserFontSetList.RemoveEntry(aUserFontSet); + } + protected: class MemoryReporter MOZ_FINAL : public nsIMemoryReporter { @@ -254,6 +265,9 @@ protected: // read the loader initialization prefs, and start it void GetPrefsAndStartLoader(); + // for font list changes that affect all documents + void ForceGlobalReflow(); + // used by memory reporter to accumulate sizes of family names in the hash static size_t SizeOfFamilyNameEntryExcludingThis(const nsAString& aKey, @@ -305,6 +319,8 @@ protected: uint32_t mStartIndex; uint32_t mIncrement; uint32_t mNumFamilies; + + nsTHashtable > mUserFontSetList; }; #endif /* GFXPLATFORMFONTLIST_H_ */ diff --git a/gfx/thebes/gfxUserFontSet.cpp b/gfx/thebes/gfxUserFontSet.cpp index 996e013aef64..7ad4c0c92a2b 100644 --- a/gfx/thebes/gfxUserFontSet.cpp +++ b/gfx/thebes/gfxUserFontSet.cpp @@ -18,6 +18,7 @@ #include "gfxFontConstants.h" #include "mozilla/Services.h" #include "mozilla/gfx/2D.h" +#include "gfxPlatformFontList.h" #include "opentype-sanitiser.h" #include "ots-memory-stream.h" @@ -102,13 +103,21 @@ gfxProxyFontEntry::CreateFontInstance(const gfxFontStyle *aFontStyle, bool aNeed } gfxUserFontSet::gfxUserFontSet() - : mFontFamilies(5) + : mFontFamilies(5), mLocalRulesUsed(false) { IncrementGeneration(); + gfxPlatformFontList *fp = gfxPlatformFontList::PlatformFontList(); + if (fp) { + fp->AddUserFontSet(this); + } } gfxUserFontSet::~gfxUserFontSet() { + gfxPlatformFontList *fp = gfxPlatformFontList::PlatformFontList(); + if (fp) { + fp->RemoveUserFontSet(this); + } } gfxFontEntry* @@ -539,6 +548,7 @@ gfxUserFontSet::LoadNext(gfxMixedFontFamily *aFamily, gfxFontEntry *fe = gfxPlatform::GetPlatform()->LookupLocalFont(aProxyEntry, currSrc.mLocalName); + mLocalRulesUsed = true; if (fe) { LOG(("userfonts (%p) [src %d] loaded local: (%s) for (%s) gen: %8.8x\n", this, aProxyEntry->mSrcIndex, @@ -664,6 +674,13 @@ gfxUserFontSet::IncrementGeneration() mGeneration = sFontSetGeneration; } +void +gfxUserFontSet::RebuildLocalRules() +{ + if (mLocalRulesUsed) { + DoRebuildUserFontSet(); + } +} gfxFontEntry* gfxUserFontSet::LoadFont(gfxMixedFontFamily *aFamily, diff --git a/gfx/thebes/gfxUserFontSet.h b/gfx/thebes/gfxUserFontSet.h index 86d17c61735a..74038df58d7f 100644 --- a/gfx/thebes/gfxUserFontSet.h +++ b/gfx/thebes/gfxUserFontSet.h @@ -242,6 +242,9 @@ public: // increment the generation on font load void IncrementGeneration(); + // rebuild if local rules have been used + void RebuildLocalRules(); + class UserFontCache { public: // Record a loaded user-font in the cache. This requires that the @@ -418,11 +421,17 @@ protected: static bool OTSMessage(void *aUserData, const char *format, ...); + // helper method for performing the actual userfont set rebuild + virtual void DoRebuildUserFontSet() = 0; + // font families defined by @font-face rules nsRefPtrHashtable mFontFamilies; uint64_t mGeneration; + // true when local names have been looked up, false otherwise + bool mLocalRulesUsed; + static PRLogModuleInfo* GetUserFontsLog(); private: diff --git a/image/test/reftest/bmp/bmp-corrupted/reftest.list b/image/test/reftest/bmp/bmp-corrupted/reftest.list index fc39882dac51..a398338852c8 100644 --- a/image/test/reftest/bmp/bmp-corrupted/reftest.list +++ b/image/test/reftest/bmp/bmp-corrupted/reftest.list @@ -8,5 +8,5 @@ # Tests for RLE4 with an invalid BPP == wrapper.html?invalid-compression-RLE4.bmp about:blank # Tests for RLE8 with an invalid BPP -== wrapper.html?invalid-compression-RLE8.bmp about:blank +random-if(B2G) == wrapper.html?invalid-compression-RLE8.bmp about:blank # Bug 921207 diff --git a/js/src/jit-test/tests/asm.js/testSource.js b/js/src/jit-test/tests/asm.js/testSource.js index d5a575d40ce3..2e2ff5dc42b3 100644 --- a/js/src/jit-test/tests/asm.js/testSource.js +++ b/js/src/jit-test/tests/asm.js/testSource.js @@ -237,6 +237,33 @@ if (isAsmJSCompilationAvailable() && isCachingEnabled()) { })(); +/* Implicit "use strict" context */ +(function() { + +var funcHeader = 'function (glob, ffi, heap) {', + funcBody = '\n"use asm";\n\ + function g() {}\n\ + return g;\n\n' + funcFooter = '}', + funcSource = funcHeader + funcBody + funcFooter + useStrict = '\n"use strict";\n'; + +var f4 = eval("\"use strict\";\n(" + funcSource + ")"); + +var expectedToString = funcHeader + useStrict + funcBody + funcFooter +var expectedToSource = '(' + expectedToString + ')' + +assertEq(f4.toString(), expectedToString); +assertEq(f4.toSource(), expectedToSource); + +if (isAsmJSCompilationAvailable() && isCachingEnabled()) { + var f5 = eval("\"use strict\";\n(" + funcSource + ")"); + assertEq(isAsmJSModuleLoadedFromCache(f5), true); + assertEq(f5.toString(), expectedToString); + assertEq(f5.toSource(), expectedToSource); +} +})(); + /* Functions */ (function() { diff --git a/js/src/jit/AsmJS.cpp b/js/src/jit/AsmJS.cpp index a196590a891f..d419d42d5a75 100644 --- a/js/src/jit/AsmJS.cpp +++ b/js/src/jit/AsmJS.cpp @@ -1143,7 +1143,13 @@ class MOZ_STACK_CLASS ModuleCompiler uint32_t funcStart = parser_.pc->maybeFunction->pn_body->pn_pos.begin; uint32_t offsetToEndOfUseAsm = parser_.tokenStream.currentToken().pos.end; - module_ = cx_->new_(parser_.ss, funcStart, offsetToEndOfUseAsm); + + // "use strict" should be added to the source if we are in an implicit + // strict context, see also comment above addUseStrict in + // js::FunctionToString. + bool strict = parser_.pc->sc->strict && !parser_.pc->sc->hasExplicitUseStrict(); + + module_ = cx_->new_(parser_.ss, funcStart, offsetToEndOfUseAsm, strict); if (!module_) return false; @@ -1514,7 +1520,6 @@ class MOZ_STACK_CLASS ModuleCompiler { module_->initFuncEnd(parser_.tokenStream.currentToken().pos.end, parser_.tokenStream.peekTokenPos().end); - masm_.finish(); if (masm_.oom()) return false; diff --git a/js/src/jit/AsmJSLink.cpp b/js/src/jit/AsmJSLink.cpp index 7142eb81ef10..bd71166a0e1a 100644 --- a/js/src/jit/AsmJSLink.cpp +++ b/js/src/jit/AsmJSLink.cpp @@ -800,8 +800,31 @@ js::AsmJSModuleToString(JSContext *cx, HandleFunction fun, bool addParenToLambda if (!src) return nullptr; - if (!out.append(src->chars(), src->length())) - return nullptr; + if (module.strict()) { + // We need to add "use strict" in the body right after the opening + // brace. + size_t bodyStart = 0, bodyEnd; + + // No need to test for functions created with the Function ctor as + // these doesn't implicitly inherit the "use strict" context. Strict mode is + // enabled for functions created with the Function ctor only if they begin with + // the "use strict" directive, but these functions won't validate as asm.js + // modules. + + ConstTwoByteChars chars(src->chars(), src->length()); + if (!FindBody(cx, fun, chars, src->length(), &bodyStart, &bodyEnd)) + return nullptr; + + if (!out.append(chars, bodyStart) || + !out.append("\n\"use strict\";\n") || + !out.append(chars + bodyStart, src->length() - bodyStart)) + { + return nullptr; + } + } else { + if (!out.append(src->chars(), src->length())) + return nullptr; + } if (funCtor && !out.append("\n}")) return nullptr; diff --git a/js/src/jit/AsmJSModule.cpp b/js/src/jit/AsmJSModule.cpp index f128d834fd9a..2e9de679561d 100644 --- a/js/src/jit/AsmJSModule.cpp +++ b/js/src/jit/AsmJSModule.cpp @@ -328,7 +328,8 @@ AsmJSModule::staticallyLink(ExclusiveContext *cx) } } -AsmJSModule::AsmJSModule(ScriptSource *scriptSource, uint32_t funcStart, uint32_t offsetToEndOfUseAsm) +AsmJSModule::AsmJSModule(ScriptSource *scriptSource, uint32_t funcStart, + uint32_t offsetToEndOfUseAsm, bool strict) : globalArgumentName_(nullptr), importArgumentName_(nullptr), bufferArgumentName_(nullptr), @@ -344,6 +345,7 @@ AsmJSModule::AsmJSModule(ScriptSource *scriptSource, uint32_t funcStart, uint32_ mozilla::PodZero(&pod); scriptSource_->incref(); pod.minHeapLength_ = AsmJSAllocationGranularity; + pod.strict_ = strict; } AsmJSModule::~AsmJSModule() @@ -876,7 +878,7 @@ AsmJSModule::clone(JSContext *cx, ScopedJSDeletePtr *moduleOut) con { AutoUnprotectCodeForClone cloneGuard(cx, *this); - *moduleOut = cx->new_(scriptSource_, funcStart_, offsetToEndOfUseAsm_); + *moduleOut = cx->new_(scriptSource_, funcStart_, offsetToEndOfUseAsm_, pod.strict_); if (!*moduleOut) return false; @@ -1313,8 +1315,9 @@ js::LookupAsmJSModuleInCache(ExclusiveContext *cx, uint32_t funcStart = parser.pc->maybeFunction->pn_body->pn_pos.begin; uint32_t offsetToEndOfUseAsm = parser.tokenStream.currentToken().pos.end; + bool strict = parser.pc->sc->strict && !parser.pc->sc->hasExplicitUseStrict(); ScopedJSDeletePtr module( - cx->new_(parser.ss, funcStart, offsetToEndOfUseAsm)); + cx->new_(parser.ss, funcStart, offsetToEndOfUseAsm, strict)); if (!module) return false; cursor = module->deserialize(cx, cursor); diff --git a/js/src/jit/AsmJSModule.h b/js/src/jit/AsmJSModule.h index d8d5199a0496..d9738588a474 100644 --- a/js/src/jit/AsmJSModule.h +++ b/js/src/jit/AsmJSModule.h @@ -431,6 +431,7 @@ class AsmJSModule struct Pod { uint32_t funcLength_; uint32_t funcLengthWithRightBrace_; + bool strict_; uint32_t numGlobalVars_; uint32_t numFFIs_; size_t funcPtrTableAndExitBytes_; @@ -464,7 +465,8 @@ class AsmJSModule mutable bool codeIsProtected_; public: - explicit AsmJSModule(ScriptSource *scriptSource, uint32_t functStart, uint32_t offsetToEndOfUseAsm); + explicit AsmJSModule(ScriptSource *scriptSource, uint32_t functStart, + uint32_t offsetToEndOfUseAsm, bool strict); ~AsmJSModule(); void trace(JSTracer *trc) { @@ -524,6 +526,9 @@ class AsmJSModule uint32_t funcEndAfterCurly() const { return funcStart_ + pod.funcLengthWithRightBrace_; } + bool strict() const { + return pod.strict_; + } bool addGlobalVarInit(const Value &v, AsmJSCoercion coercion, uint32_t *globalIndex) { JS_ASSERT(pod.funcPtrTableAndExitBytes_ == 0); diff --git a/js/src/jsfun.cpp b/js/src/jsfun.cpp index 347862d0259e..7f4639cd5f11 100644 --- a/js/src/jsfun.cpp +++ b/js/src/jsfun.cpp @@ -626,14 +626,18 @@ const Class JSFunction::class_ = { const Class* const js::FunctionClassPtr = &JSFunction::class_; /* Find the body of a function (not including braces). */ -static bool -FindBody(JSContext *cx, HandleFunction fun, ConstTwoByteChars chars, size_t length, +bool +js::FindBody(JSContext *cx, HandleFunction fun, ConstTwoByteChars chars, size_t length, size_t *bodyStart, size_t *bodyEnd) { // We don't need principals, since those are only used for error reporting. CompileOptions options(cx); - options.setFileAndLine("internal-findBody", 0) - .setVersion(fun->nonLazyScript()->getVersion()); + options.setFileAndLine("internal-findBody", 0); + + // For asm.js modules, there's no script. + if (fun->hasScript()) + options.setVersion(fun->nonLazyScript()->getVersion()); + AutoKeepAtoms keepAtoms(cx->perThreadData); TokenStream ts(cx, options, chars.get(), length, nullptr); int nest = 0; diff --git a/js/src/jsfun.h b/js/src/jsfun.h index 226ddc2666e1..d11f1ac52f73 100644 --- a/js/src/jsfun.h +++ b/js/src/jsfun.h @@ -554,6 +554,11 @@ CloneFunctionObject(JSContext *cx, HandleFunction fun, HandleObject parent, gc::AllocKind kind = JSFunction::FinalizeKind, NewObjectKind newKindArg = GenericObject); + +extern bool +FindBody(JSContext *cx, HandleFunction fun, ConstTwoByteChars chars, size_t length, + size_t *bodyStart, size_t *bodyEnd); + } // namespace js inline js::FunctionExtended * diff --git a/layout/base/nsDisplayListInvalidation.cpp b/layout/base/nsDisplayListInvalidation.cpp index 8ff8ad324849..514f652eed54 100644 --- a/layout/base/nsDisplayListInvalidation.cpp +++ b/layout/base/nsDisplayListInvalidation.cpp @@ -5,6 +5,7 @@ #include "nsDisplayListInvalidation.h" #include "nsDisplayList.h" +#include "nsIFrame.h" nsDisplayItemGeometry::nsDisplayItemGeometry(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder) { diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 8f0915c615f0..536921a7776a 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -6690,8 +6690,8 @@ nsFrame::BreakWordBetweenPunctuation(const PeekWordState* aState, } if (!Preferences::GetBool("layout.word_select.stop_at_punctuation")) { // When this pref is false, we never stop at a punctuation boundary unless - // it's after whitespace - return false; + // it's followed by whitespace (in the relevant direction). + return aWhitespaceAfter; } if (!aIsKeyboardSelect) { // mouse caret movement (e.g. word selection) always stops at every punctuation boundary diff --git a/layout/generic/test/test_movement_by_words.html b/layout/generic/test/test_movement_by_words.html index b71820d8fa03..8f5402b5d501 100644 --- a/layout/generic/test/test_movement_by_words.html +++ b/layout/generic/test/test_movement_by_words.html @@ -14,7 +14,7 @@

Catch-all