mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset d5d68c0258f3 (bug 1201330)
This commit is contained in:
parent
82f7ef8f08
commit
e0f8429ec7
@ -97,13 +97,6 @@ public:
|
||||
// Previous scale due to the CSS transform property.
|
||||
Maybe<gfxSize> mPreviousTransformScale;
|
||||
|
||||
// The scroll frame during for which we most recently received a call to
|
||||
// NotifyAnimatedFromScrollHandler.
|
||||
nsWeakFrame mAnimatingScrollHandlerFrame;
|
||||
// The set of activities that were triggered during
|
||||
// mAnimatingScrollHandlerFrame's scroll event handler.
|
||||
EnumSet<ActivityIndex> mScrollHandlerInducedActivity;
|
||||
|
||||
// Number of restyle operations detected
|
||||
uint8_t mRestyleCounts[ACTIVITY_COUNT];
|
||||
bool mContentActive;
|
||||
@ -116,21 +109,15 @@ public:
|
||||
LayerActivityTracker()
|
||||
: nsExpirationTracker<LayerActivity,4>(GENERATION_MS,
|
||||
"LayerActivityTracker")
|
||||
, mDestroying(false)
|
||||
{}
|
||||
~LayerActivityTracker() {
|
||||
mDestroying = true;
|
||||
AgeAllGenerations();
|
||||
}
|
||||
|
||||
virtual void NotifyExpired(LayerActivity* aObject);
|
||||
|
||||
private:
|
||||
bool mDestroying;
|
||||
};
|
||||
|
||||
static LayerActivityTracker* gLayerActivityTracker = nullptr;
|
||||
static nsIFrame* gCurrentScrollHandlerFrame = nullptr;
|
||||
|
||||
LayerActivity::~LayerActivity()
|
||||
{
|
||||
@ -146,13 +133,6 @@ NS_DECLARE_FRAME_PROPERTY(LayerActivityProperty, DeleteValue<LayerActivity>)
|
||||
void
|
||||
LayerActivityTracker::NotifyExpired(LayerActivity* aObject)
|
||||
{
|
||||
if (!mDestroying && aObject->mAnimatingScrollHandlerFrame.IsAlive()) {
|
||||
// Reset the restyle counts, but let the layer activity survive.
|
||||
PodArrayZero(aObject->mRestyleCounts);
|
||||
MarkUsed(aObject);
|
||||
return;
|
||||
}
|
||||
|
||||
RemoveObject(aObject);
|
||||
|
||||
nsIFrame* f = aObject->mFrame;
|
||||
@ -314,23 +294,6 @@ ActiveLayerTracker::NotifyAnimated(nsIFrame* aFrame, nsCSSProperty aProperty)
|
||||
mutationCount = 0xFF;
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
ActiveLayerTracker::NotifyAnimatedFromScrollHandler(nsIFrame* aFrame, nsCSSProperty aProperty,
|
||||
nsIFrame* aScrollFrame)
|
||||
{
|
||||
LayerActivity* layerActivity = GetLayerActivityForUpdate(aFrame);
|
||||
LayerActivity::ActivityIndex activityIndex = LayerActivity::GetActivityIndexForProperty(aProperty);
|
||||
|
||||
if (layerActivity->mAnimatingScrollHandlerFrame.GetFrame() != aScrollFrame) {
|
||||
// Discard any activity of a different scroll frame. We only track the
|
||||
// most recent scroll handler induced activity.
|
||||
layerActivity->mScrollHandlerInducedActivity.clear();
|
||||
layerActivity->mAnimatingScrollHandlerFrame = aScrollFrame;
|
||||
}
|
||||
|
||||
layerActivity->mScrollHandlerInducedActivity += activityIndex;
|
||||
}
|
||||
|
||||
static bool
|
||||
IsPresContextInScriptAnimationCallback(nsPresContext* aPresContext)
|
||||
{
|
||||
@ -347,12 +310,10 @@ IsPresContextInScriptAnimationCallback(nsPresContext* aPresContext)
|
||||
ActiveLayerTracker::NotifyInlineStyleRuleModified(nsIFrame* aFrame,
|
||||
nsCSSProperty aProperty)
|
||||
{
|
||||
if (IsPresContextInScriptAnimationCallback(aFrame->PresContext())) {
|
||||
NotifyAnimated(aFrame, aProperty);
|
||||
}
|
||||
if (gCurrentScrollHandlerFrame) {
|
||||
NotifyAnimatedFromScrollHandler(aFrame, aProperty, gCurrentScrollHandlerFrame);
|
||||
if (!IsPresContextInScriptAnimationCallback(aFrame->PresContext())) {
|
||||
return;
|
||||
}
|
||||
NotifyAnimated(aFrame, aProperty);
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
@ -361,29 +322,6 @@ ActiveLayerTracker::IsStyleMaybeAnimated(nsIFrame* aFrame, nsCSSProperty aProper
|
||||
return IsStyleAnimated(nullptr, aFrame, aProperty);
|
||||
}
|
||||
|
||||
static bool
|
||||
CheckScrollInducedActivity(LayerActivity* aLayerActivity,
|
||||
LayerActivity::ActivityIndex aActivityIndex,
|
||||
nsDisplayListBuilder* aBuilder)
|
||||
{
|
||||
if (!aLayerActivity->mScrollHandlerInducedActivity.contains(aActivityIndex) ||
|
||||
!aLayerActivity->mAnimatingScrollHandlerFrame.IsAlive()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
nsIScrollableFrame* scrollFrame =
|
||||
do_QueryFrame(aLayerActivity->mAnimatingScrollHandlerFrame.GetFrame());
|
||||
if (scrollFrame && (!aBuilder || scrollFrame->IsScrollingActive(aBuilder))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// The scroll frame has been destroyed or has become inactive. Clear it from
|
||||
// the layer activity so that it can expire.
|
||||
aLayerActivity->mAnimatingScrollHandlerFrame = nullptr;
|
||||
aLayerActivity->mScrollHandlerInducedActivity.clear();
|
||||
return false;
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
ActiveLayerTracker::IsStyleAnimated(nsDisplayListBuilder* aBuilder,
|
||||
nsIFrame* aFrame, nsCSSProperty aProperty)
|
||||
@ -402,11 +340,7 @@ ActiveLayerTracker::IsStyleAnimated(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
LayerActivity* layerActivity = GetLayerActivity(aFrame);
|
||||
if (layerActivity) {
|
||||
LayerActivity::ActivityIndex activityIndex = LayerActivity::GetActivityIndexForProperty(aProperty);
|
||||
if (layerActivity->mRestyleCounts[activityIndex] >= 2) {
|
||||
return true;
|
||||
}
|
||||
if (CheckScrollInducedActivity(layerActivity, activityIndex, aBuilder)) {
|
||||
if (layerActivity->RestyleCountForProperty(aProperty) >= 2) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -524,12 +458,6 @@ ActiveLayerTracker::IsContentActive(nsIFrame* aFrame)
|
||||
return layerActivity && layerActivity->mContentActive;
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
ActiveLayerTracker::SetCurrentScrollHandlerFrame(nsIFrame* aFrame)
|
||||
{
|
||||
gCurrentScrollHandlerFrame = aFrame;
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
ActiveLayerTracker::Shutdown()
|
||||
{
|
||||
|
@ -49,12 +49,6 @@ public:
|
||||
* Any such marking will time out after a short period.
|
||||
*/
|
||||
static void NotifyAnimated(nsIFrame* aFrame, nsCSSProperty aProperty);
|
||||
/**
|
||||
* Notify aFrame as being known to have an animation of aProperty through an
|
||||
* inline style modification during aScrollFrame's scroll event handler.
|
||||
*/
|
||||
static void NotifyAnimatedFromScrollHandler(nsIFrame* aFrame, nsCSSProperty aProperty,
|
||||
nsIFrame* aScrollFrame);
|
||||
/**
|
||||
* Notify that a property in the inline style rule of aFrame's element
|
||||
* has been modified.
|
||||
@ -113,13 +107,6 @@ public:
|
||||
* Return true if this frame's content is still marked as active.
|
||||
*/
|
||||
static bool IsContentActive(nsIFrame* aFrame);
|
||||
|
||||
/**
|
||||
* Called before and after a scroll event handler is executed, with the
|
||||
* scrollframe or nullptr, respectively. This acts as a hint to treat
|
||||
* inline style changes during the handler differently.
|
||||
*/
|
||||
static void SetCurrentScrollHandlerFrame(nsIFrame* aFrame);
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
@ -4199,7 +4199,6 @@ ScrollFrameHelper::FireScrollEvent()
|
||||
{
|
||||
mScrollEvent.Forget();
|
||||
|
||||
ActiveLayerTracker::SetCurrentScrollHandlerFrame(mOuter);
|
||||
WidgetGUIEvent event(true, eScroll, nullptr);
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
nsIContent* content = mOuter->GetContent();
|
||||
@ -4217,7 +4216,6 @@ ScrollFrameHelper::FireScrollEvent()
|
||||
event.mFlags.mBubbles = false;
|
||||
EventDispatcher::Dispatch(content, prescontext, &event, nullptr, &status);
|
||||
}
|
||||
ActiveLayerTracker::SetCurrentScrollHandlerFrame(nullptr);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -127,14 +127,6 @@ public:
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear
|
||||
*/
|
||||
void clear()
|
||||
{
|
||||
mBitField = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Intersection
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user