diff options
-rw-r--r-- | application/basilisk/base/content/browser-fullScreenAndPointerLock.js | 12 | ||||
-rw-r--r-- | application/palemoon/base/content/browser-fullScreen.js | 12 | ||||
-rw-r--r-- | dom/base/nsImageLoadingContent.cpp | 36 | ||||
-rw-r--r-- | dom/base/nsImageLoadingContent.h | 10 | ||||
-rw-r--r-- | js/src/jit/BaselineBailouts.cpp | 56 | ||||
-rw-r--r-- | js/src/jit/JitFrameIterator.h | 2 | ||||
-rw-r--r-- | layout/svg/SVGFEImageFrame.cpp | 6 | ||||
-rw-r--r-- | layout/svg/nsSVGImageFrame.cpp | 6 | ||||
-rw-r--r-- | testing/mozharness/requirements.txt | 4 |
9 files changed, 84 insertions, 60 deletions
diff --git a/application/basilisk/base/content/browser-fullScreenAndPointerLock.js b/application/basilisk/base/content/browser-fullScreenAndPointerLock.js index 497e51121..dbc9478c1 100644 --- a/application/basilisk/base/content/browser-fullScreenAndPointerLock.js +++ b/application/basilisk/base/content/browser-fullScreenAndPointerLock.js @@ -320,6 +320,18 @@ var FullScreen = { document.addEventListener("keypress", this._keyToggleCallback, false); document.addEventListener("popupshown", this._setPopupOpen, false); document.addEventListener("popuphidden", this._setPopupOpen, false); + // If it is not safe to collapse, add the mouse position tracker or + // else it won't be possible to hide the navigation toolbox again + if (!this._safeToCollapse()) { + let rect = gBrowser.mPanelContainer.getBoundingClientRect(); + this._mouseTargetRect = { + top: rect.top + 50, + bottom: rect.bottom, + left: rect.left, + right: rect.right + }; + MousePosTracker.addListener(this); + } // In DOM fullscreen mode, we hide toolbars with CSS if (!document.fullscreenElement) this.hideNavToolbox(true); diff --git a/application/palemoon/base/content/browser-fullScreen.js b/application/palemoon/base/content/browser-fullScreen.js index 6afd247be..b1235a8d3 100644 --- a/application/palemoon/base/content/browser-fullScreen.js +++ b/application/palemoon/base/content/browser-fullScreen.js @@ -53,6 +53,18 @@ var FullScreen = { document.addEventListener("popupshown", this._setPopupOpen, false); document.addEventListener("popuphidden", this._setPopupOpen, false); this._shouldAnimate = true; + // If it is not safe to collapse, add the mouse position tracker or + // else it won't be possible to hide the navigation toolbox again + if (!this._safeToCollapse(document.mozFullScreen)) { + let rect = gBrowser.mPanelContainer.getBoundingClientRect(); + this._mouseTargetRect = { + top: rect.top + 50, + bottom: rect.bottom, + left: rect.left, + right: rect.right + }; + MousePosTracker.addListener(this); + } // We don't animate the toolbar collapse if in DOM full-screen mode, // as the size of the content area would still be changing after the // mozfullscreenchange event fired, which could confuse content script. diff --git a/dom/base/nsImageLoadingContent.cpp b/dom/base/nsImageLoadingContent.cpp index d25dd6319..0c6c37b44 100644 --- a/dom/base/nsImageLoadingContent.cpp +++ b/dom/base/nsImageLoadingContent.cpp @@ -94,8 +94,7 @@ nsImageLoadingContent::nsImageLoadingContent() mNewRequestsWillNeedAnimationReset(false), mStateChangerDepth(0), mCurrentRequestRegistered(false), - mPendingRequestRegistered(false), - mFrameCreateCalled(false) + mPendingRequestRegistered(false) { if (!nsContentUtils::GetImgLoaderForChannel(nullptr, nullptr)) { mLoadingEnabled = false; @@ -489,10 +488,8 @@ nsImageLoadingContent::FrameCreated(nsIFrame* aFrame) { NS_ASSERTION(aFrame, "aFrame is null"); - mFrameCreateCalled = true; - - TrackImage(mCurrentRequest); - TrackImage(mPendingRequest); + TrackImage(mCurrentRequest, aFrame); + TrackImage(mPendingRequest, aFrame); // We need to make sure that our image request is registered, if it should // be registered. @@ -513,8 +510,6 @@ nsImageLoadingContent::FrameDestroyed(nsIFrame* aFrame) { NS_ASSERTION(aFrame, "aFrame is null"); - mFrameCreateCalled = false; - // We need to make sure that our image request is deregistered. nsPresContext* presContext = GetFramePresContext(); if (mCurrentRequest) { @@ -1486,7 +1481,8 @@ nsImageLoadingContent::OnVisibilityChange(Visibility aNewVisibility, } void -nsImageLoadingContent::TrackImage(imgIRequest* aImage) +nsImageLoadingContent::TrackImage(imgIRequest* aImage, + nsIFrame* aFrame /*= nullptr */) { if (!aImage) return; @@ -1499,13 +1495,21 @@ nsImageLoadingContent::TrackImage(imgIRequest* aImage) return; } - // We only want to track this request if we're visible. Ordinarily we check - // the visible count, but that requires a frame; in cases where - // GetOurPrimaryFrame() cannot obtain a frame (e.g. <feImage>), we assume - // we're visible if FrameCreated() was called. - nsIFrame* frame = GetOurPrimaryFrame(); - if ((frame && frame->GetVisibility() == Visibility::APPROXIMATELY_NONVISIBLE) || - (!frame && !mFrameCreateCalled)) { + if (!aFrame) { + aFrame = GetOurPrimaryFrame(); + } + + /* This line is deceptively simple. It hides a lot of subtlety. Before we + * create an nsImageFrame we call nsImageFrame::ShouldCreateImageFrameFor + * to determine if we should create an nsImageFrame or create a frame based + * on the display of the element (ie inline, block, etc). Inline, block, etc + * frames don't register for visibility tracking so they will return UNTRACKED + * from GetVisibility(). So this line is choosing to mark such images as + * visible. Once the image loads we will get an nsImageFrame and the proper + * visibility. This is a pitfall of tracking the visibility on the frames + * instead of the content node. + */ + if (!aFrame || aFrame->GetVisibility() == Visibility::APPROXIMATELY_NONVISIBLE) { return; } diff --git a/dom/base/nsImageLoadingContent.h b/dom/base/nsImageLoadingContent.h index 85db2bd2c..5f7daff72 100644 --- a/dom/base/nsImageLoadingContent.h +++ b/dom/base/nsImageLoadingContent.h @@ -364,6 +364,11 @@ protected: * * No-op if aImage is null. * + * @param aFrame If called from FrameCreated the frame passed to FrameCreated. + * This is our frame, but at the time of the FrameCreated call + * our primary frame pointer hasn't been set yet, so this is + * only way to get our frame. + * * @param aNonvisibleAction A requested action if the frame has become * nonvisible. If Nothing(), no action is * requested. If DISCARD_IMAGES is specified, the @@ -371,7 +376,7 @@ protected: * associated with to discard their surfaces if * possible. */ - void TrackImage(imgIRequest* aImage); + void TrackImage(imgIRequest* aImage, nsIFrame* aFrame = nullptr); void UntrackImage(imgIRequest* aImage, const Maybe<OnNonvisible>& aNonvisibleAction = Nothing()); @@ -454,9 +459,6 @@ private: // registered with the refresh driver. bool mCurrentRequestRegistered; bool mPendingRequestRegistered; - - // True when FrameCreate has been called but FrameDestroy has not. - bool mFrameCreateCalled; }; #endif // nsImageLoadingContent_h__ diff --git a/js/src/jit/BaselineBailouts.cpp b/js/src/jit/BaselineBailouts.cpp index 3ab722b3d..ad2757ae1 100644 --- a/js/src/jit/BaselineBailouts.cpp +++ b/js/src/jit/BaselineBailouts.cpp @@ -419,41 +419,6 @@ struct BaselineStackBuilder } }; -// Ensure that all value locations are readable from the SnapshotIterator. -// Remove RInstructionResults from the JitActivation if the frame got recovered -// ahead of the bailout. -class SnapshotIteratorForBailout : public SnapshotIterator -{ - JitActivation* activation_; - JitFrameIterator& iter_; - - public: - SnapshotIteratorForBailout(JitActivation* activation, JitFrameIterator& iter) - : SnapshotIterator(iter, activation->bailoutData()->machineState()), - activation_(activation), - iter_(iter) - { - MOZ_ASSERT(iter.isBailoutJS()); - } - - ~SnapshotIteratorForBailout() { - // The bailout is complete, we no longer need the recover instruction - // results. - activation_->removeIonFrameRecovery(fp_); - } - - // Take previously computed result out of the activation, or compute the - // results of all recover instructions contained in the snapshot. - MOZ_MUST_USE bool init(JSContext* cx) { - - // Under a bailout, there is no need to invalidate the frame after - // evaluating the recover instruction, as the invalidation is only - // needed to cause of the frame which has been introspected. - MaybeReadFallback recoverBailout(cx, activation_, &iter_, MaybeReadFallback::Fallback_DoNothing); - return initInstructionResults(recoverBailout); - } -}; - #ifdef DEBUG static inline bool IsInlinableFallback(ICFallbackStub* icEntry) @@ -1476,6 +1441,7 @@ jit::BailoutIonToBaseline(JSContext* cx, JitActivation* activation, JitFrameIter { MOZ_ASSERT(bailoutInfo != nullptr); MOZ_ASSERT(*bailoutInfo == nullptr); + MOZ_ASSERT(iter.isBailoutJS()); TraceLoggerThread* logger = TraceLoggerForMainThread(cx->runtime()); TraceLogStopEvent(logger, TraceLogger_IonMonkey); @@ -1488,6 +1454,12 @@ jit::BailoutIonToBaseline(JSContext* cx, JitActivation* activation, JitFrameIter activation->removeRematerializedFramesFromDebugger(cx, iter.fp()); }); + // Always remove the RInstructionResults from the JitActivation, even in + // case of failures as the stack frame is going away after the bailout. + auto removeIonFrameRecovery = mozilla::MakeScopeExit([&] { + activation->removeIonFrameRecovery(iter.jsFrame()); + }); + // The caller of the top frame must be one of the following: // IonJS - Ion calling into Ion. // BaselineStub - Baseline calling into Ion. @@ -1561,9 +1533,19 @@ jit::BailoutIonToBaseline(JSContext* cx, JitActivation* activation, JitFrameIter } JitSpew(JitSpew_BaselineBailouts, " Incoming frame ptr = %p", builder.startFrame()); - SnapshotIteratorForBailout snapIter(activation, iter); - if (!snapIter.init(cx)) + // Under a bailout, there is no need to invalidate the frame after + // evaluating the recover instruction, as the invalidation is only needed in + // cases where the frame is introspected ahead of the bailout. + MaybeReadFallback recoverBailout(cx, activation, &iter, MaybeReadFallback::Fallback_DoNothing); + + // Ensure that all value locations are readable from the SnapshotIterator. + // Get the RInstructionResults from the JitActivation if the frame got + // recovered ahead of the bailout. + SnapshotIterator snapIter(iter, activation->bailoutData()->machineState()); + if (!snapIter.initInstructionResults(recoverBailout)) { + ReportOutOfMemory(cx); return BAILOUT_RETURN_FATAL_ERROR; + } #ifdef TRACK_SNAPSHOTS snapIter.spewBailingFrom(); diff --git a/js/src/jit/JitFrameIterator.h b/js/src/jit/JitFrameIterator.h index 3620badbd..76d04d092 100644 --- a/js/src/jit/JitFrameIterator.h +++ b/js/src/jit/JitFrameIterator.h @@ -509,13 +509,13 @@ class SnapshotIterator return recover_.moreInstructions(); } - protected: // Register a vector used for storing the results of the evaluation of // recover instructions. This vector should be registered before the // beginning of the iteration. This function is in charge of allocating // enough space for all instructions results, and return false iff it fails. MOZ_MUST_USE bool initInstructionResults(MaybeReadFallback& fallback); + protected: // This function is used internally for computing the result of the recover // instructions. MOZ_MUST_USE bool computeInstructionResults(JSContext* cx, RInstructionResults* results) const; diff --git a/layout/svg/SVGFEImageFrame.cpp b/layout/svg/SVGFEImageFrame.cpp index 185096a93..b1f98c421 100644 --- a/layout/svg/SVGFEImageFrame.cpp +++ b/layout/svg/SVGFEImageFrame.cpp @@ -107,6 +107,12 @@ SVGFEImageFrame::Init(nsIContent* aContent, nsFrame::Init(aContent, aParent, aPrevInFlow); // We assume that feImage's are always visible. + // This call must happen before the FrameCreated. This is because the + // primary frame pointer on our content node isn't set until after this + // function ends, so there is no way for the resulting OnVisibilityChange + // notification to get a frame. FrameCreated has a workaround for this in + // that it passes our frame around so it can be accessed. OnVisibilityChange + // doesn't have that workaround. IncApproximateVisibleCount(); nsCOMPtr<nsIImageLoadingContent> imageLoader = diff --git a/layout/svg/nsSVGImageFrame.cpp b/layout/svg/nsSVGImageFrame.cpp index c0a7f9419..2d6f75d26 100644 --- a/layout/svg/nsSVGImageFrame.cpp +++ b/layout/svg/nsSVGImageFrame.cpp @@ -159,6 +159,12 @@ nsSVGImageFrame::Init(nsIContent* aContent, if (GetStateBits() & NS_FRAME_IS_NONDISPLAY) { // Non-display frames are likely to be patterns, masks or the like. // Treat them as always visible. + // This call must happen before the FrameCreated. This is because the + // primary frame pointer on our content node isn't set until after this + // function ends, so there is no way for the resulting OnVisibilityChange + // notification to get a frame. FrameCreated has a workaround for this in + // that it passes our frame around so it can be accessed. OnVisibilityChange + // doesn't have that workaround. IncApproximateVisibleCount(); } diff --git a/testing/mozharness/requirements.txt b/testing/mozharness/requirements.txt index 632355c54..571ce421e 100644 --- a/testing/mozharness/requirements.txt +++ b/testing/mozharness/requirements.txt @@ -12,8 +12,8 @@ mercurial==3.7.3 mock==1.0.1 nose==1.2.1 ordereddict==1.1 -paramiko==1.10.0 -pycrypto==2.6 +paramiko ~> 1.17.6 +pycrypto > 2.6.1 pyflakes==0.6.1 pylint==0.27.0 simplejson==2.1.1 |