From 9cdb4ee0d8d9d18cc5822dcbcdc1410ebd344999 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Wed, 5 Sep 2012 22:29:15 +1200 Subject: [PATCH] Bug 785588. Perform asynchronous scroll operations before firing requestAnimationFrame callbacks. r=tnikkel --HG-- extra : rebase_source : 3c1439773981db4ea1b957db4351f50899229130 --- layout/base/tests/Makefile.in | 1 + .../tests/test_scroll_event_ordering.html | 56 +++++++++++++++++++ layout/generic/nsGfxScrollFrame.cpp | 4 +- 3 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 layout/base/tests/test_scroll_event_ordering.html diff --git a/layout/base/tests/Makefile.in b/layout/base/tests/Makefile.in index ed39b27f33b..eb6d3a21161 100644 --- a/layout/base/tests/Makefile.in +++ b/layout/base/tests/Makefile.in @@ -133,6 +133,7 @@ MOCHITEST_FILES = \ test_bug696020.html \ test_event_target_radius.html \ test_mozPaintCount.html \ + test_scroll_event_ordering.html \ test_scroll_selection_into_view.html \ test_bug583889.html \ bug583889_inner1.html \ diff --git a/layout/base/tests/test_scroll_event_ordering.html b/layout/base/tests/test_scroll_event_ordering.html new file mode 100644 index 00000000000..db9074af086 --- /dev/null +++ b/layout/base/tests/test_scroll_event_ordering.html @@ -0,0 +1,56 @@ + + + + + Test for Bug 785588 --- ordering of scroll-related events + + + + + +Mozilla Bug 785588 +
+
+
Hello
+
+
+
+
+
+ + diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 1fef06819ce..b7b1aa8cbb2 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -1377,7 +1377,7 @@ public: bool SetRefreshObserver(nsGfxScrollFrameInner *aCallee) { NS_ASSERTION(aCallee && !mCallee, "AsyncScroll::SetRefreshObserver - Invalid usage."); - if (!RefreshDriver(aCallee)->AddRefreshObserver(this, Flush_Display)) { + if (!RefreshDriver(aCallee)->AddRefreshObserver(this, Flush_Style)) { return false; } @@ -1405,7 +1405,7 @@ private: */ void RemoveObserver() { if (mCallee) { - RefreshDriver(mCallee)->RemoveRefreshObserver(this, Flush_Display); + RefreshDriver(mCallee)->RemoveRefreshObserver(this, Flush_Style); } } };