Back out changeset 698cda645acb (bug 1209970) for Gu failures in tag_visibility_monitor_test.js

This commit is contained in:
Phil Ringnalda 2015-12-17 19:44:55 -08:00
parent 6a985982a7
commit 3d202aeb87
5 changed files with 17 additions and 32 deletions

View File

@ -16,8 +16,6 @@ const SCROLL2_X = Math.round(300 * (1 + Math.random()));
const SCROLL2_Y = Math.round(400 * (1 + Math.random()));
const SCROLL2_STR = SCROLL2_X + "," + SCROLL2_Y;
requestLongerTimeout(2);
/**
* This test ensures that we properly serialize and restore scroll positions
* for an average page without any frames.

View File

@ -4225,28 +4225,18 @@ void ScrollFrameHelper::CurPosAttributeChanged(nsIContent* aContent)
/* ============= Scroll events ========== */
ScrollFrameHelper::ScrollEvent::ScrollEvent(ScrollFrameHelper* aHelper)
: mHelper(aHelper)
NS_IMETHODIMP
ScrollFrameHelper::ScrollEvent::Run()
{
mHelper->mOuter->PresContext()->RefreshDriver()->AddRefreshObserver(this, Flush_Style);
}
ScrollFrameHelper::ScrollEvent::~ScrollEvent()
{
mHelper->mOuter->PresContext()->RefreshDriver()->RemoveRefreshObserver(this, Flush_Style);
}
void
ScrollFrameHelper::ScrollEvent::WillRefresh(mozilla::TimeStamp aTime)
{
mHelper->FireScrollEvent();
if (mHelper)
mHelper->FireScrollEvent();
return NS_OK;
}
void
ScrollFrameHelper::FireScrollEvent()
{
MOZ_ASSERT(mScrollEvent);
mScrollEvent = nullptr;
mScrollEvent.Forget();
ActiveLayerTracker::SetCurrentScrollHandlerFrame(mOuter);
WidgetGUIEvent event(true, eScroll, nullptr);
@ -4273,11 +4263,14 @@ ScrollFrameHelper::FireScrollEvent()
void
ScrollFrameHelper::PostScrollEvent()
{
if (mScrollEvent)
if (mScrollEvent.IsPending())
return;
// The ScrollEvent constructor registers itself with the refresh driver.
nsRootPresContext* rpc = mOuter->PresContext()->GetRootPresContext();
if (!rpc)
return;
mScrollEvent = new ScrollEvent(this);
rpc->AddWillPaintObserver(mScrollEvent.get());
}
NS_IMETHODIMP

View File

@ -19,7 +19,6 @@
#include "nsIReflowCallback.h"
#include "nsBoxLayoutState.h"
#include "nsQueryFrame.h"
#include "nsRefreshDriver.h"
#include "nsExpirationTracker.h"
#include "TextOverflow.h"
#include "ScrollVelocityQueue.h"
@ -102,13 +101,11 @@ public:
bool IsSmoothScrollingEnabled();
class ScrollEvent : public nsARefreshObserver {
class ScrollEvent : public nsRunnable {
public:
NS_INLINE_DECL_REFCOUNTING(ScrollEvent, override)
explicit ScrollEvent(ScrollFrameHelper *helper);
void WillRefresh(mozilla::TimeStamp aTime) override;
protected:
virtual ~ScrollEvent();
NS_DECL_NSIRUNNABLE
explicit ScrollEvent(ScrollFrameHelper *helper) : mHelper(helper) {}
void Revoke() { mHelper = nullptr; }
private:
ScrollFrameHelper *mHelper;
};
@ -420,7 +417,7 @@ public:
nsCOMPtr<nsIContent> mScrollCornerContent;
nsCOMPtr<nsIContent> mResizerContent;
RefPtr<ScrollEvent> mScrollEvent;
nsRevocableEventPtr<ScrollEvent> mScrollEvent;
nsRevocableEventPtr<AsyncScrollPortEvent> mAsyncScrollPortEvent;
nsRevocableEventPtr<ScrolledAreaEvent> mScrolledAreaEvent;
nsIFrame* mHScrollbarBox;

View File

@ -526,10 +526,8 @@ function sendWheelAndPaint(aTarget, aOffsetX, aOffsetY, aEvent, aCallback, aWind
setTimeout(function() {
utils.advanceTimeAndRefresh(1000);
if (!aCallback) {
utils.advanceTimeAndRefresh(0);
if (!aCallback)
return;
}
var waitForPaints = function () {
SpecialPowers.Services.obs.removeObserver(waitForPaints, "apz-repaints-flushed", false);

View File

@ -1034,7 +1034,6 @@ function initElements()
resetScrollPosition(gSubView1);
resetScrollPosition(gSubView2);
resetScrollPosition(gSubView3);
_getDOMWindowUtils(window).advanceTimeAndRefresh(0);
runNextTestStep();
}