зеркало из https://github.com/mozilla/gecko-dev.git
Bug 990907 - Add a flag on nsIScrollableFrame to indicate if it is actively being scrolled by APZ. r=tn
This commit is contained in:
Родитель
618c917976
Коммит
53bf04f021
|
@ -249,6 +249,9 @@ APZEventState::ProcessAPZStateChange(const nsCOMPtr<nsIDocument>& aDocument,
|
||||||
case APZStateChange::TransformBegin:
|
case APZStateChange::TransformBegin:
|
||||||
{
|
{
|
||||||
nsIScrollableFrame* sf = nsLayoutUtils::FindScrollableFrameFor(aViewId);
|
nsIScrollableFrame* sf = nsLayoutUtils::FindScrollableFrameFor(aViewId);
|
||||||
|
if (sf) {
|
||||||
|
sf->SetTransformingByAPZ(true);
|
||||||
|
}
|
||||||
nsIScrollbarMediator* scrollbarMediator = do_QueryFrame(sf);
|
nsIScrollbarMediator* scrollbarMediator = do_QueryFrame(sf);
|
||||||
if (scrollbarMediator) {
|
if (scrollbarMediator) {
|
||||||
scrollbarMediator->ScrollbarActivityStarted();
|
scrollbarMediator->ScrollbarActivityStarted();
|
||||||
|
@ -266,6 +269,9 @@ APZEventState::ProcessAPZStateChange(const nsCOMPtr<nsIDocument>& aDocument,
|
||||||
case APZStateChange::TransformEnd:
|
case APZStateChange::TransformEnd:
|
||||||
{
|
{
|
||||||
nsIScrollableFrame* sf = nsLayoutUtils::FindScrollableFrameFor(aViewId);
|
nsIScrollableFrame* sf = nsLayoutUtils::FindScrollableFrameFor(aViewId);
|
||||||
|
if (sf) {
|
||||||
|
sf->SetTransformingByAPZ(false);
|
||||||
|
}
|
||||||
nsIScrollbarMediator* scrollbarMediator = do_QueryFrame(sf);
|
nsIScrollbarMediator* scrollbarMediator = do_QueryFrame(sf);
|
||||||
if (scrollbarMediator) {
|
if (scrollbarMediator) {
|
||||||
scrollbarMediator->ScrollbarActivityStopped();
|
scrollbarMediator->ScrollbarActivityStopped();
|
||||||
|
|
|
@ -1896,6 +1896,7 @@ ScrollFrameHelper::ScrollFrameHelper(nsContainerFrame* aOuter,
|
||||||
, mHasBeenScrolled(false)
|
, mHasBeenScrolled(false)
|
||||||
, mIsResolutionSet(false)
|
, mIsResolutionSet(false)
|
||||||
, mScaleToResolution(false)
|
, mScaleToResolution(false)
|
||||||
|
, mTransformingByAPZ(false)
|
||||||
{
|
{
|
||||||
if (LookAndFeel::GetInt(LookAndFeel::eIntID_UseOverlayScrollbars) != 0) {
|
if (LookAndFeel::GetInt(LookAndFeel::eIntID_UseOverlayScrollbars) != 0) {
|
||||||
mScrollbarActivity = new ScrollbarActivity(do_QueryFrame(aOuter));
|
mScrollbarActivity = new ScrollbarActivity(do_QueryFrame(aOuter));
|
||||||
|
|
|
@ -324,6 +324,13 @@ public:
|
||||||
void MarkNotRecentlyScrolled();
|
void MarkNotRecentlyScrolled();
|
||||||
nsExpirationState* GetExpirationState() { return &mActivityExpirationState; }
|
nsExpirationState* GetExpirationState() { return &mActivityExpirationState; }
|
||||||
|
|
||||||
|
void SetTransformingByAPZ(bool aTransforming) {
|
||||||
|
mTransformingByAPZ = aTransforming;
|
||||||
|
}
|
||||||
|
bool IsTransformingByAPZ() const {
|
||||||
|
return mTransformingByAPZ;
|
||||||
|
}
|
||||||
|
|
||||||
void ScheduleSyntheticMouseMove();
|
void ScheduleSyntheticMouseMove();
|
||||||
static void ScrollActivityCallback(nsITimer *aTimer, void* anInstance);
|
static void ScrollActivityCallback(nsITimer *aTimer, void* anInstance);
|
||||||
|
|
||||||
|
@ -466,6 +473,10 @@ public:
|
||||||
// Only meaningful for root scroll frames.
|
// Only meaningful for root scroll frames.
|
||||||
bool mScaleToResolution:1;
|
bool mScaleToResolution:1;
|
||||||
|
|
||||||
|
// True if the APZ is in the process of async-transforming this scrollframe,
|
||||||
|
// (as best as we can tell on the main thread, anyway).
|
||||||
|
bool mTransformingByAPZ:1;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
* @note This method might destroy the frame, pres shell and other objects.
|
* @note This method might destroy the frame, pres shell and other objects.
|
||||||
|
@ -812,6 +823,13 @@ public:
|
||||||
virtual void ScrollbarActivityStarted() const MOZ_OVERRIDE;
|
virtual void ScrollbarActivityStarted() const MOZ_OVERRIDE;
|
||||||
virtual void ScrollbarActivityStopped() const MOZ_OVERRIDE;
|
virtual void ScrollbarActivityStopped() const MOZ_OVERRIDE;
|
||||||
|
|
||||||
|
virtual void SetTransformingByAPZ(bool aTransforming) MOZ_OVERRIDE {
|
||||||
|
mHelper.SetTransformingByAPZ(aTransforming);
|
||||||
|
}
|
||||||
|
bool IsTransformingByAPZ() const MOZ_OVERRIDE {
|
||||||
|
return mHelper.IsTransformingByAPZ();
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_FRAME_DUMP
|
#ifdef DEBUG_FRAME_DUMP
|
||||||
virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
|
virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
|
||||||
#endif
|
#endif
|
||||||
|
@ -1181,6 +1199,13 @@ public:
|
||||||
virtual void ScrollbarActivityStarted() const MOZ_OVERRIDE;
|
virtual void ScrollbarActivityStarted() const MOZ_OVERRIDE;
|
||||||
virtual void ScrollbarActivityStopped() const MOZ_OVERRIDE;
|
virtual void ScrollbarActivityStopped() const MOZ_OVERRIDE;
|
||||||
|
|
||||||
|
virtual void SetTransformingByAPZ(bool aTransforming) MOZ_OVERRIDE {
|
||||||
|
mHelper.SetTransformingByAPZ(aTransforming);
|
||||||
|
}
|
||||||
|
bool IsTransformingByAPZ() const MOZ_OVERRIDE {
|
||||||
|
return mHelper.IsTransformingByAPZ();
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_FRAME_DUMP
|
#ifdef DEBUG_FRAME_DUMP
|
||||||
virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
|
virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -397,6 +397,9 @@ public:
|
||||||
* Mark the scrollbar frames for reflow.
|
* Mark the scrollbar frames for reflow.
|
||||||
*/
|
*/
|
||||||
virtual void MarkScrollbarsDirtyForReflow() const = 0;
|
virtual void MarkScrollbarsDirtyForReflow() const = 0;
|
||||||
|
|
||||||
|
virtual void SetTransformingByAPZ(bool aTransforming) = 0;
|
||||||
|
virtual bool IsTransformingByAPZ() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Загрузка…
Ссылка в новой задаче