diff --git a/b2g/chrome/content/settings.js b/b2g/chrome/content/settings.js index 746b29fde63e..038f73b3d92a 100644 --- a/b2g/chrome/content/settings.js +++ b/b2g/chrome/content/settings.js @@ -537,6 +537,48 @@ SettingsListener.observe("theme.selected", setPAC(); })(); +#ifdef MOZ_B2G_RIL +XPCOMUtils.defineLazyModuleGetter(this, "AppsUtils", + "resource://gre/modules/AppsUtils.jsm"); + +// ======================= Dogfooders FOTA ========================== +SettingsListener.observe('debug.performance_data.dogfooding', false, + isDogfooder => { + if (!isDogfooder) { + dump('AUS:Settings: Not a dogfooder!\n'); + return; + } + + if (!('mozTelephony' in navigator)) { + dump('AUS:Settings: There is no mozTelephony!\n'); + return; + } + + if (!('mozMobileConnections' in navigator)) { + dump('AUS:Settings: There is no mozMobileConnections!\n'); + return; + } + + let conn = navigator.mozMobileConnections[0]; + conn.addEventListener('radiostatechange', function onradiostatechange() { + if (conn.radioState !== 'enabled') { + return; + } + + conn.removeEventListener('radiostatechange', onradiostatechange); + navigator.mozTelephony.dial('*#06#').then(call => { + return call.result.then(res => { + if (res.success && res.statusMessage + && (res.serviceCode === 'scImei')) { + Services.prefs.setCharPref("app.update.imei_hash", + AppsUtils.computeHash(res.statusMessage, "SHA512")); + } + }); + }); + }); + }); +#endif + // =================== Various simple mapping ====================== var settingsToObserve = { 'accessibility.screenreader_quicknav_modes': { diff --git a/b2g/config/aries/sources.xml b/b2g/config/aries/sources.xml index 1ffdf1650434..686fb3c8446d 100644 --- a/b2g/config/aries/sources.xml +++ b/b2g/config/aries/sources.xml @@ -15,11 +15,11 @@ - + - + diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml index 9379420fe47a..7885aefffcb9 100644 --- a/b2g/config/dolphin/sources.xml +++ b/b2g/config/dolphin/sources.xml @@ -15,11 +15,11 @@ - + - + diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 827501b0c4fc..4c9e3ec86dd9 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,12 +19,12 @@ - + - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index 892fc6fd80dd..4f750f723152 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,9 +17,9 @@ - + - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index fa095dff005b..b4d110c0b4bb 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,11 +15,11 @@ - + - + diff --git a/b2g/config/emulator-l/sources.xml b/b2g/config/emulator-l/sources.xml index 92fe63b5bc98..6c3790092575 100644 --- a/b2g/config/emulator-l/sources.xml +++ b/b2g/config/emulator-l/sources.xml @@ -15,11 +15,11 @@ - + - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 827501b0c4fc..4c9e3ec86dd9 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,12 +19,12 @@ - + - + diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml index 84eb0cf9907e..0096068244ad 100644 --- a/b2g/config/flame-kk/sources.xml +++ b/b2g/config/flame-kk/sources.xml @@ -15,11 +15,11 @@ - + - + diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 0a7b39fde9da..3358a73f9405 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,9 +1,9 @@ { "git": { - "git_revision": "aede8622d780ec71f766a3ecccbff74c04aaba4e", + "git_revision": "2082894c8e974b0c371e4dec298e0ad0f3ac56b1", "remote": "https://git.mozilla.org/releases/gaia.git", "branch": "" }, - "revision": "dbd3a4ea9042cae987147f2d05f41d2a7ebaccbc", + "revision": "0e712c8d330e10908f99194a9638e62a07c5c483", "repo_path": "integration/gaia-central" } diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml index 185a7dd18c71..eefc6b17bd65 100644 --- a/b2g/config/nexus-4/sources.xml +++ b/b2g/config/nexus-4/sources.xml @@ -17,9 +17,9 @@ - + - + diff --git a/b2g/config/nexus-5-l/sources.xml b/b2g/config/nexus-5-l/sources.xml index 57c4df19634c..9b5668ab3b13 100644 --- a/b2g/config/nexus-5-l/sources.xml +++ b/b2g/config/nexus-5-l/sources.xml @@ -15,11 +15,11 @@ - + - + diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index 4cf542d9bc7b..d8c045917bd9 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -163,7 +163,7 @@ diff --git a/browser/base/content/test/general/browser_selectpopup.js b/browser/base/content/test/general/browser_selectpopup.js index 6e043d9139d6..af5daf453ae4 100644 --- a/browser/base/content/test/general/browser_selectpopup.js +++ b/browser/base/content/test/general/browser_selectpopup.js @@ -23,7 +23,7 @@ const PAGECONTENT = " " + " " + " " + - " " + + " Text" + ""; function openSelectPopup(selectPopup, withMouse) @@ -108,6 +108,12 @@ function doSelectTests(contentType, dtd) is((yield getChangeEvents()), 0, "Before closed - number of change events"); + EventUtils.synthesizeKey("a", { accelKey: true }); + let selection = yield ContentTask.spawn(gBrowser.selectedBrowser, {}, function() { + return String(content.getSelection()); + }); + is(selection, isWindows ? "Text" : "", "Select all while popup is open"); + yield hideSelectPopup(selectPopup); is(menulist.selectedIndex, 3, "Item 3 still selected"); diff --git a/config/check_vanilla_allocations.py b/config/check_vanilla_allocations.py index ad3ce4f444e6..2a3be879ec89 100644 --- a/config/check_vanilla_allocations.py +++ b/config/check_vanilla_allocations.py @@ -75,8 +75,8 @@ def main(): # Run |nm|. Options: # -u: show only undefined symbols # -C: demangle symbol names - # -l: show a filename and line number for each undefined symbol - cmd = ['nm', '-u', '-C', '-l', args.file] + # -A: show an object filename for each undefined symbol + cmd = ['nm', '-u', '-C', '-A', args.file] lines = subprocess.check_output(cmd, universal_newlines=True, stderr=subprocess.PIPE).split('\n') @@ -112,26 +112,30 @@ def main(): # This regexp matches the relevant lines in the output of |nm|, which look # like the following. # - # U malloc /path/to/objdir/dist/include/js/Utility.h:142 + # js/src/libjs_static.a:jsutil.o: U malloc # - alloc_fns_re = r'U (' + r'|'.join(alloc_fns) + r').*\/([\w\.]+):(\d+)$' + alloc_fns_re = r'([^:/ ]+):\s+U (' + r'|'.join(alloc_fns) + r')' # This tracks which allocation/free functions have been seen in jsutil.cpp. jsutil_cpp = set([]) + # Would it be helpful to emit detailed line number information after a failure? + emit_line_info = False + for line in lines: m = re.search(alloc_fns_re, line) if m is None: continue - fn = m.group(1) - filename = m.group(2) - linenum = m.group(3) - if filename == 'jsutil.cpp': + filename = m.group(1) + fn = m.group(2) + if filename == 'jsutil.o': jsutil_cpp.add(fn) else: # An allocation is present in a non-special file. Fail! - fail("'" + fn + "' present at " + filename + ':' + linenum) + fail("'" + fn + "' present in " + filename) + # Try to give more precise information about the offending code. + emit_line_info = True # Check that all functions we expect are used in jsutil.cpp. (This will @@ -147,6 +151,34 @@ def main(): fail('unexpected allocation fns used in jsutil.cpp: ' + ', '.join(jsutil_cpp)) + # If we found any improper references to allocation functions, try to use + # DWARF debug info to get more accurate line number information about the + # bad calls. This is a lot slower than 'nm -A', and it is not always + # precise when building with --enable-optimized. + if emit_line_info: + print('check_vanilla_allocations.py: Source lines with allocation calls:') + print('check_vanilla_allocations.py: Accurate in unoptimized builds; jsutil.cpp expected.') + + # Run |nm|. Options: + # -u: show only undefined symbols + # -C: demangle symbol names + # -l: show line number information for each undefined symbol + cmd = ['nm', '-u', '-C', '-l', args.file] + lines = subprocess.check_output(cmd, universal_newlines=True, + stderr=subprocess.PIPE).split('\n') + + # This regexp matches the relevant lines in the output of |nm -l|, + # which look like the following. + # + # U malloc jsutil.cpp:117 + # + alloc_lines_re = r'U ((' + r'|'.join(alloc_fns) + r').*)\s+(\S+:\d+)$' + + for line in lines: + m = re.search(alloc_lines_re, line) + if m: + print('check_vanilla_allocations.py:', m.group(1), 'called at', m.group(3)) + if has_failed: sys.exit(1) diff --git a/configure.in b/configure.in index 398c7c7651b9..e03e46794778 100644 --- a/configure.in +++ b/configure.in @@ -7251,9 +7251,6 @@ if test -z "$MOZ_MEMORY"; then esac else AC_DEFINE(MOZ_MEMORY) - if test -n "$NIGHTLY_BUILD"; then - MOZ_JEMALLOC4=1 - fi if test -n "$MOZ_JEMALLOC4"; then AC_DEFINE(MOZ_JEMALLOC4) fi diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index bf5c1bb5398a..a5f7b0981ebd 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -10871,10 +10871,7 @@ nsDocShell::DoChannelLoad(nsIChannel* aChannel, // If the user pressed shift-reload, then do not allow ServiceWorker // interception to occur. See step 12.1 of the SW HandleFetch algorithm. - if (mLoadType == LOAD_RELOAD_BYPASS_CACHE || - mLoadType == LOAD_RELOAD_BYPASS_PROXY || - mLoadType == LOAD_RELOAD_BYPASS_PROXY_AND_CACHE || - mLoadType == LOAD_RELOAD_ALLOW_MIXED_CONTENT) { + if (IsForceReloadType(mLoadType)) { nsCOMPtr internal = do_QueryInterface(aChannel); if (internal) { internal->ForceNoIntercept(); @@ -11163,11 +11160,7 @@ nsDocShell::OnNewURI(nsIURI* aURI, nsIChannel* aChannel, nsISupports* aOwner, * for the page. Save the new cacheKey in Session History. * see bug 90098 */ - if (aChannel && - (aLoadType == LOAD_RELOAD_BYPASS_CACHE || - aLoadType == LOAD_RELOAD_BYPASS_PROXY || - aLoadType == LOAD_RELOAD_BYPASS_PROXY_AND_CACHE || - aLoadType == LOAD_RELOAD_ALLOW_MIXED_CONTENT)) { + if (aChannel && IsForceReloadType(aLoadType)) { NS_ASSERTION(!updateSHistory, "We shouldn't be updating session history for forced" " reloads!"); diff --git a/docshell/base/nsDocShellLoadTypes.h b/docshell/base/nsDocShellLoadTypes.h index 273dd87b0d61..67304476dfa1 100644 --- a/docshell/base/nsDocShellLoadTypes.h +++ b/docshell/base/nsDocShellLoadTypes.h @@ -101,5 +101,17 @@ IsValidLoadType(uint32_t aLoadType) return false; } +static inline bool +IsForceReloadType(uint32_t aLoadType) { + switch (aLoadType) { + case LOAD_RELOAD_BYPASS_CACHE: + case LOAD_RELOAD_BYPASS_PROXY: + case LOAD_RELOAD_BYPASS_PROXY_AND_CACHE: + case LOAD_RELOAD_ALLOW_MIXED_CONTENT: + return true; + } + return false; +} + #endif // MOZILLA_INTERNAL_API #endif diff --git a/dom/animation/Animation.cpp b/dom/animation/Animation.cpp index 6be92df4a7b6..bba21fb316c4 100644 --- a/dom/animation/Animation.cpp +++ b/dom/animation/Animation.cpp @@ -560,7 +560,7 @@ Animation::CanThrottle() const return true; } - return mIsRunningOnCompositor; + return IsRunningOnCompositor(); } void @@ -763,11 +763,6 @@ Animation::DoPause(ErrorResult& aRv) reuseReadyPromise = true; } - // Mark this as no longer running on the compositor so that next time - // we update animations we won't throttle them and will have a chance - // to remove the animation from any layer it might be on. - mIsRunningOnCompositor = false; - if (!reuseReadyPromise) { // Clear ready promise. We'll create a new one lazily. mReady = nullptr; @@ -1202,5 +1197,11 @@ Animation::DispatchPlaybackEvent(const nsAString& aName) asyncDispatcher->PostDOMEvent(); } +bool +Animation::IsRunningOnCompositor() const +{ + return mEffect && mEffect->IsRunningOnCompositor(); +} + } // namespace dom } // namespace mozilla diff --git a/dom/animation/Animation.h b/dom/animation/Animation.h index 05f2cbd52781..989bd6aa1b33 100644 --- a/dom/animation/Animation.h +++ b/dom/animation/Animation.h @@ -58,7 +58,6 @@ public: , mPlaybackRate(1.0) , mPendingState(PendingState::NotPending) , mAnimationIndex(sNextAnimationIndex++) - , mIsRunningOnCompositor(false) , mFinishedAtLastComposeStyle(false) , mIsRelevant(false) , mFinishedIsResolved(false) @@ -109,7 +108,7 @@ public: virtual void Play(ErrorResult& aRv, LimitBehavior aLimitBehavior); virtual void Pause(ErrorResult& aRv); virtual void Reverse(ErrorResult& aRv); - bool IsRunningOnCompositor() const { return mIsRunningOnCompositor; } + bool IsRunningOnCompositor() const; IMPL_EVENT_HANDLER(finish); IMPL_EVENT_HANDLER(cancel); @@ -269,8 +268,6 @@ public: */ virtual bool HasLowerCompositeOrderThan(const Animation& aOther) const; - void SetIsRunningOnCompositor() { mIsRunningOnCompositor = true; } - void ClearIsRunningOnCompositor() { mIsRunningOnCompositor = false; } /** * Returns true if this animation does not currently need to update * style on the main thread (e.g. because it is empty, or is @@ -409,7 +406,6 @@ protected: // possible for two different objects to have the same index. uint64_t mAnimationIndex; - bool mIsRunningOnCompositor; bool mFinishedAtLastComposeStyle; // Indicates that the animation should be exposed in an element's // getAnimations() list. diff --git a/dom/animation/KeyframeEffect.cpp b/dom/animation/KeyframeEffect.cpp index 07107ecef078..2a02d3a48139 100644 --- a/dom/animation/KeyframeEffect.cpp +++ b/dom/animation/KeyframeEffect.cpp @@ -9,6 +9,7 @@ #include "mozilla/FloatingPoint.h" #include "AnimationCommon.h" #include "nsCSSPropertySet.h" +#include "nsCSSProps.h" // For nsCSSProps::PropHasFlags namespace mozilla { @@ -74,6 +75,20 @@ NS_INTERFACE_MAP_END_INHERITING(AnimationEffectReadOnly) NS_IMPL_ADDREF_INHERITED(KeyframeEffectReadOnly, AnimationEffectReadOnly) NS_IMPL_RELEASE_INHERITED(KeyframeEffectReadOnly, AnimationEffectReadOnly) +KeyframeEffectReadOnly::KeyframeEffectReadOnly( + nsIDocument* aDocument, + Element* aTarget, + nsCSSPseudoElements::Type aPseudoType, + const AnimationTiming& aTiming) + : AnimationEffectReadOnly(aDocument) + , mTarget(aTarget) + , mTiming(aTiming) + , mPseudoType(aPseudoType) +{ + MOZ_ASSERT(aTarget, "null animation target is not yet supported"); + ResetIsRunningOnCompositor(); +} + JSObject* KeyframeEffectReadOnly::WrapObject(JSContext* aCx, JS::Handle aGivenProto) @@ -396,5 +411,50 @@ KeyframeEffectReadOnly::ComposeStyle(nsRefPtr& aStyleRule, } } +bool +KeyframeEffectReadOnly::IsRunningOnCompositor() const +{ + // We consider animation is running on compositor if there is at least + // one property running on compositor. + // Animation.IsRunningOnCompotitor will return more fine grained + // information in bug 1196114. + for (bool isPropertyRunningOnCompositor : mIsPropertyRunningOnCompositor) { + if (isPropertyRunningOnCompositor) { + return true; + } + } + return false; +} + +void +KeyframeEffectReadOnly::SetIsRunningOnCompositor(nsCSSProperty aProperty, + bool aIsRunning) +{ + static_assert( + MOZ_ARRAY_LENGTH(LayerAnimationInfo::sRecords) == + MOZ_ARRAY_LENGTH(mIsPropertyRunningOnCompositor), + "The length of mIsPropertyRunningOnCompositor should equal to" + "the length of LayserAnimationInfo::sRecords"); + MOZ_ASSERT(nsCSSProps::PropHasFlags(aProperty, + CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR), + "Property being animated on compositor is a recognized " + "compositor-animatable property"); + const auto& info = LayerAnimationInfo::sRecords; + for (size_t i = 0; i < ArrayLength(mIsPropertyRunningOnCompositor); i++) { + if (info[i].mProperty == aProperty) { + mIsPropertyRunningOnCompositor[i] = aIsRunning; + return; + } + } +} + +void +KeyframeEffectReadOnly::ResetIsRunningOnCompositor() +{ + for (bool& isPropertyRunningOnCompositor : mIsPropertyRunningOnCompositor) { + isPropertyRunningOnCompositor = false; + } +} + } // namespace dom } // namespace mozilla diff --git a/dom/animation/KeyframeEffect.h b/dom/animation/KeyframeEffect.h index e7d95204fed5..c3dc6286565a 100644 --- a/dom/animation/KeyframeEffect.h +++ b/dom/animation/KeyframeEffect.h @@ -13,6 +13,7 @@ #include "nsIDocument.h" #include "nsWrapperCache.h" #include "mozilla/Attributes.h" +#include "mozilla/LayerAnimationInfo.h" // LayerAnimations::kRecords #include "mozilla/StickyTimeDuration.h" #include "mozilla/StyleAnimationValue.h" #include "mozilla/TimeStamp.h" @@ -199,14 +200,7 @@ public: KeyframeEffectReadOnly(nsIDocument* aDocument, Element* aTarget, nsCSSPseudoElements::Type aPseudoType, - const AnimationTiming &aTiming) - : AnimationEffectReadOnly(aDocument) - , mTarget(aTarget) - , mTiming(aTiming) - , mPseudoType(aPseudoType) - { - MOZ_ASSERT(aTarget, "null animation target is not yet supported"); - } + const AnimationTiming& aTiming); NS_DECL_ISUPPORTS_INHERITED NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(KeyframeEffectReadOnly, @@ -308,9 +302,12 @@ public: // Any updated properties are added to |aSetProperties|. void ComposeStyle(nsRefPtr& aStyleRule, nsCSSPropertySet& aSetProperties); + bool IsRunningOnCompositor() const; + void SetIsRunningOnCompositor(nsCSSProperty aProperty, bool aIsRunning); protected: virtual ~KeyframeEffectReadOnly() { } + void ResetIsRunningOnCompositor(); nsCOMPtr mTarget; Nullable mParentTime; @@ -319,6 +316,17 @@ protected: nsCSSPseudoElements::Type mPseudoType; InfallibleTArray mProperties; + + // Parallel array corresponding to CommonAnimationManager::sLayerAnimationInfo + // such that mIsPropertyRunningOnCompositor[x] is true only if this effect has + // an animation of CommonAnimationManager::sLayerAnimationInfo[x].mProperty + // that is currently running on the compositor. + // + // Note that when the owning Animation requests a non-throttled restyle, in + // between calling RequestRestyle on its AnimationCollection and when the + // restyle is performed, this member may temporarily become false even if + // the animation remains on the layer after the restyle. + bool mIsPropertyRunningOnCompositor[LayerAnimationInfo::kRecords]; }; } // namespace dom diff --git a/dom/animation/test/chrome.ini b/dom/animation/test/chrome.ini index aa8b4b026302..f42aeac442ee 100644 --- a/dom/animation/test/chrome.ini +++ b/dom/animation/test/chrome.ini @@ -1,3 +1,8 @@ +[DEFAULT] +support-files = + testcommon.js + ../../imptests/testharness.js + ../../imptests/testharnessreport.js [chrome/test_animation_observers.html] [chrome/test_running_on_compositor.html] -skip-if = buildapp == 'b2g' \ No newline at end of file +skip-if = buildapp == 'b2g' diff --git a/dom/animation/test/chrome/test_running_on_compositor.html b/dom/animation/test/chrome/test_running_on_compositor.html index 84cb4d4b0ca8..384a50692115 100644 --- a/dom/animation/test/chrome/test_running_on_compositor.html +++ b/dom/animation/test/chrome/test_running_on_compositor.html @@ -3,18 +3,23 @@ Bug 1045994 - Add a chrome-only property to inspect if an animation is running on the compositor or not - - - - + + +