--- a/browser/components/sessionstore/StartupPerformance.jsm+++ b/browser/components/sessionstore/StartupPerformance.jsm@@ -194,19 +194,26 @@ this.StartupPerformance = { this._totalNumberOfWindows += 1; // Observe the restoration of all tabs. We assume that all tabs of this // window will have been restored before `COLLECT_RESULTS_AFTER_MS`. // The last call to `observer` will let us determine how long it took // to reach that point. let win = subject;- let observer = () => {- this._latestRestoredTimeStamp = Date.now();- this._totalNumberOfEagerTabs += 1;+ let observer = (event) => {+ // We don't care about tab restorations that are due to+ // a browser flipping from out-of-main-process to in-main-process+ // or vice-versa. We only care about restorations that are due+ // to the user switching to a lazily restored tab, or for tabs+ // that are restoring eagerly.+ if (!event.detail.isRemotenessUpdate) {+ this._latestRestoredTimeStamp = Date.now();+ this._totalNumberOfEagerTabs += 1;+ } }; win.gBrowser.tabContainer.addEventListener("SSTabRestored", observer); this._totalNumberOfTabs += win.gBrowser.tabContainer.itemCount; // Once we have finished collecting the results, clean up the observers. this._promiseFinished.then(() => { if (!win.gBrowser.tabContainer) { // May be undefined during shutdown and/or some tests.

--- a/browser/components/sessionstore/content/content-sessionStore.js+++ b/browser/components/sessionstore/content/content-sessionStore.js@@ -162,31 +162,31 @@ var MessageListener = { // SessionStore.jsm so that it can run SSTabRestoring. Users of // SSTabRestoring seem to get confused if chrome and content are out of // sync about the state of the restore (particularly regarding // docShell.currentURI). Using a synchronous message is the easiest way // to temporarily synchronize them. sendSyncMessage("SessionStore:restoreHistoryComplete", {epoch}); },- restoreTabContent({loadArguments}) {+ restoreTabContent({loadArguments, isRemotenessUpdate}) { let epoch = gCurrentEpoch; // We need to pass the value of didStartLoad back to SessionStore.jsm. let didStartLoad = gContentRestore.restoreTabContent(loadArguments, () => { // Tell SessionStore.jsm that it may want to restore some more tabs, // since it restores a max of MAX_CONCURRENT_TAB_RESTORES at a time.- sendAsyncMessage("SessionStore:restoreTabContentComplete", {epoch});+ sendAsyncMessage("SessionStore:restoreTabContentComplete", {epoch, isRemotenessUpdate}); }); sendAsyncMessage("SessionStore:restoreTabContentStarted", {epoch}); if (!didStartLoad) { // Pretend that the load succeeded so that event handlers fire correctly.- sendAsyncMessage("SessionStore:restoreTabContentComplete", {epoch});+ sendAsyncMessage("SessionStore:restoreTabContentComplete", {epoch, isRemotenessUpdate}); } }, flush({id}) { // Flush the message queue, send the latest updates. MessageQueue.send({flushID: id}); } };

--- a/dom/events/EventStateManager.cpp+++ b/dom/events/EventStateManager.cpp@@ -1309,17 +1309,17 @@ EventStateManager::HandleCrossProcessEve // This is a touch event with possibly multiple touch points. // Each touch point may have its own target. So iterate through // all of them and collect the unique set of targets for event // forwarding. // // This loop is similar to the one used in // PresShell::DispatchTouchEvent(). const WidgetTouchEvent::TouchArray& touches =- aEvent->AsTouchEvent()->touches;+ aEvent->AsTouchEvent()->mTouches; for (uint32_t i = 0; i < touches.Length(); ++i) { Touch* touch = touches[i]; // NB: the |mChanged| check is an optimization, subprocesses can // compute this for themselves. If the touch hasn't changed, we // may be able to avoid forwarding the event entirely (which is // not free). if (!touch || !touch->mChanged) { continue;

--- a/gfx/layers/apz/src/AsyncPanZoomController.h+++ b/gfx/layers/apz/src/AsyncPanZoomController.h@@ -158,31 +158,16 @@ public: * should continue. If true, the compositor should schedule another composite. */ bool AdvanceAnimations(const TimeStamp& aSampleTime); bool UpdateAnimation(const TimeStamp& aSampleTime, Vector<Task*>* aOutDeferredTasks); /**- * Query the transforms that should be applied to the layer corresponding- * to this APZC due to asynchronous panning and zooming.- * This function returns the async transform via the |aOutTransform|- * out parameter.- */- void SampleContentTransformForFrame(AsyncTransform* aOutTransform,- ParentLayerPoint& aScrollOffset);-- /**- * Return a visual effect that reflects this apzc's- * overscrolled state, if any.- */- AsyncTransformComponentMatrix GetOverscrollTransform() const;-- /** * A shadow layer update has arrived. |aScrollMetdata| is the new ScrollMetadata * for the container layer corresponding to this APZC. * |aIsFirstPaint| is a flag passed from the shadow * layers code indicating that the scroll metadata being sent with this call are * the initial metadata and the initial paint of the frame has just happened. */ void NotifyLayersUpdated(const ScrollMetadata& aScrollMetadata, bool aIsFirstPaint, bool aThisLayerTreeUpdated);@@ -218,30 +203,16 @@ public: void Destroy(); /** * Returns true if Destroy() has already been called on this APZC instance. */ bool IsDestroyed() const; /**- * Returns the incremental transformation corresponding to the async pan/zoom- * in progress. That is, when this transform is multiplied with the layer's- * existing transform, it will make the layer appear with the desired pan/zoom- * amount.- */- AsyncTransform GetCurrentAsyncTransform() const;-- /**- * Returns the same transform as GetCurrentAsyncTransform(), but includes- * any transform due to axis over-scroll.- */- AsyncTransformComponentMatrix GetCurrentAsyncTransformWithOverscroll() const;-- /** * Returns the transform to take something from the coordinate space of the * last thing we know gecko painted, to the coordinate space of the last thing * we asked gecko to paint. In cases where that last request has not yet been * processed, this is needed to transform input events properly into a space * gecko will understand. */ Matrix4x4 GetTransformToLastDispatchedPaint() const;@@ -732,16 +703,63 @@ private: // to allow panning by moving multiple fingers (thus moving the focus point). ParentLayerPoint mLastZoomFocus; RefPtr<AsyncPanZoomAnimation> mAnimation; friend class Axis;+ /* ===================================================================+ * The functions and members in this section are used to expose+ * the current async transform state to callers.+ */+public:+ /**+ * Allows callers to specify which type of async transform they want:+ * NORMAL provides the actual async transforms of the APZC, whereas+ * RESPECT_FORCE_DISABLE will provide empty async transforms if and only if+ * the metrics has the mForceDisableApz flag set. In general the latter should+ * only be used by call sites that are applying the transform to update+ * a layer's position.+ */+ enum AsyncMode {+ NORMAL,+ RESPECT_FORCE_DISABLE,+ };++ /**+ * Query the transforms that should be applied to the layer corresponding+ * to this APZC due to asynchronous panning and zooming.+ * This function returns the async transform via the |aOutTransform|+ * out parameter.+ */+ ParentLayerPoint GetCurrentAsyncScrollOffset(AsyncMode aMode) const;++ /**+ * Return a visual effect that reflects this apzc's+ * overscrolled state, if any.+ */+ AsyncTransformComponentMatrix GetOverscrollTransform(AsyncMode aMode) const;++ /**+ * Returns the incremental transformation corresponding to the async pan/zoom+ * in progress. That is, when this transform is multiplied with the layer's+ * existing transform, it will make the layer appear with the desired pan/zoom+ * amount.+ */+ AsyncTransform GetCurrentAsyncTransform(AsyncMode aMode) const;++ /**+ * Returns the same transform as GetCurrentAsyncTransform(), but includes+ * any transform due to axis over-scroll.+ */+ AsyncTransformComponentMatrix GetCurrentAsyncTransformWithOverscroll(AsyncMode aMode) const;++ /* =================================================================== * The functions and members in this section are used to manage * the state that tracks what this APZC is doing with the input events. */ protected: enum PanZoomState { NOTHING, /* no touch-start events received */@@ -1101,19 +1119,19 @@ public: } uint64_t GetLayersId() const { return mLayersId; } private:- // Extra offset to add in SampleContentTransformForFrame for testing+ // Extra offset to add to the async scroll position for testing CSSPoint mTestAsyncScrollOffset;- // Extra zoom to include in SampleContentTransformForFrame for testing+ // Extra zoom to include in the aync zoom for testing LayerToParentLayerScale mTestAsyncZoom; // Flag to track whether or not the APZ transform is not used. This // flag is recomputed for every composition frame. bool mAsyncTransformAppliedToContent; /* =================================================================== * The functions and members in this section are used for checkerboard