Title: [184574] branches/safari-601.1.32.2-branch/Source/WebCore
- Revision
- 184574
- Author
- matthew_han...@apple.com
- Date
- 2015-05-19 09:46:52 -0700 (Tue, 19 May 2015)
Log Message
Merge r184513. rdar://problem/21006738
Modified Paths
Diff
Modified: branches/safari-601.1.32.2-branch/Source/WebCore/ChangeLog (184573 => 184574)
--- branches/safari-601.1.32.2-branch/Source/WebCore/ChangeLog 2015-05-19 16:46:48 UTC (rev 184573)
+++ branches/safari-601.1.32.2-branch/Source/WebCore/ChangeLog 2015-05-19 16:46:52 UTC (rev 184574)
@@ -1,5 +1,33 @@
2015-05-18 Matthew Hanson <matthew_han...@apple.com>
+ Merge r184513. rdar://problem/21006738
+
+ 2015-05-18 Brent Fulgham <bfulg...@apple.com>
+
+ REGRESSION(142590): Scroll-snap points are improperly snapping to earlier index values
+ https://bugs.webkit.org/show_bug.cgi?id=145140
+ <rdar://problem/21006738>
+
+ Reviewed by Beth Dakin.
+
+ The new "nearestActiveSnapPoint" logic is firing while scroll snap animations are running. We need
+ to add an "isScrollSnapInProgress" predicate, much like the existing "isRubberBandInProgress" to avoid
+ certain "fix-up" logic that we don't want running while we are in the process of moving to a new position.
+
+ * platform/ScrollAnimator.h:
+ (WebCore::ScrollAnimator::ScrollAnimator::isScrollSnapInProgress): Added.
+ * platform/ScrollableArea.cpp:
+ (WebCore::ScrollableArea::updateScrollSnapState): If we are in the midst of a scroll snap operation,
+ do not attempt to reset position to the current active snap point.
+ * platform/cocoa/ScrollController.h:
+ * platform/cocoa/ScrollController.mm:
+ (WebCore::ScrollController::isScrollSnapInProgress): Added.
+ * platform/mac/ScrollAnimatorMac.h:
+ * platform/mac/ScrollAnimatorMac.mm:
+ (WebCore::ScrollAnimatorMac::isScrollSnapInProgress): Added.
+
+2015-05-18 Matthew Hanson <matthew_han...@apple.com>
+
Merge r184433. rdar://problem/20877518
2015-05-16 Jon Lee <jon...@apple.com>
Modified: branches/safari-601.1.32.2-branch/Source/WebCore/platform/ScrollAnimator.h (184573 => 184574)
--- branches/safari-601.1.32.2-branch/Source/WebCore/platform/ScrollAnimator.h 2015-05-19 16:46:48 UTC (rev 184573)
+++ branches/safari-601.1.32.2-branch/Source/WebCore/platform/ScrollAnimator.h 2015-05-19 16:46:52 UTC (rev 184574)
@@ -118,6 +118,7 @@
virtual void notifyContentAreaScrolled(const FloatSize& delta) { UNUSED_PARAM(delta); }
virtual bool isRubberBandInProgress() const { return false; }
+ virtual bool isScrollSnapInProgress() const { return false; }
void setWheelEventTestTrigger(RefPtr<WheelEventTestTrigger>&& testTrigger) { m_wheelEventTestTrigger = testTrigger; }
#if (ENABLE(CSS_SCROLL_SNAP) || ENABLE(RUBBER_BANDING)) && PLATFORM(MAC)
Modified: branches/safari-601.1.32.2-branch/Source/WebCore/platform/ScrollableArea.cpp (184573 => 184574)
--- branches/safari-601.1.32.2-branch/Source/WebCore/platform/ScrollableArea.cpp 2015-05-19 16:46:48 UTC (rev 184573)
+++ branches/safari-601.1.32.2-branch/Source/WebCore/platform/ScrollableArea.cpp 2015-05-19 16:46:52 UTC (rev 184574)
@@ -458,8 +458,11 @@
void ScrollableArea::updateScrollSnapState()
{
#if PLATFORM(MAC)
- if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
+ if (ScrollAnimator* scrollAnimator = existingScrollAnimator()) {
scrollAnimator->updateScrollAnimatorsAndTimers();
+ if (scrollAnimator->isScrollSnapInProgress())
+ return;
+ }
#endif
IntPoint currentPosition = scrollPosition();
Modified: branches/safari-601.1.32.2-branch/Source/WebCore/platform/cocoa/ScrollController.h (184573 => 184574)
--- branches/safari-601.1.32.2-branch/Source/WebCore/platform/cocoa/ScrollController.h 2015-05-19 16:46:48 UTC (rev 184573)
+++ branches/safari-601.1.32.2-branch/Source/WebCore/platform/cocoa/ScrollController.h 2015-05-19 16:46:52 UTC (rev 184574)
@@ -114,6 +114,7 @@
bool handleWheelEvent(const PlatformWheelEvent&);
bool isRubberBandInProgress() const;
+ bool isScrollSnapInProgress() const;
#if ENABLE(CSS_SCROLL_SNAP) && PLATFORM(MAC)
bool processWheelEventForScrollSnap(const PlatformWheelEvent&);
Modified: branches/safari-601.1.32.2-branch/Source/WebCore/platform/cocoa/ScrollController.mm (184573 => 184574)
--- branches/safari-601.1.32.2-branch/Source/WebCore/platform/cocoa/ScrollController.mm 2015-05-19 16:46:48 UTC (rev 184573)
+++ branches/safari-601.1.32.2-branch/Source/WebCore/platform/cocoa/ScrollController.mm 2015-05-19 16:46:52 UTC (rev 184574)
@@ -404,6 +404,15 @@
return !m_client.stretchAmount().isZero();
}
+bool ScrollController::isScrollSnapInProgress() const
+{
+#if ENABLE(CSS_SCROLL_SNAP) && PLATFORM(MAC)
+ if (m_inScrollGesture || m_momentumScrollInProgress || m_horizontalScrollSnapTimer.isActive() || m_verticalScrollSnapTimer.isActive())
+ return true;
+#endif
+ return false;
+}
+
void ScrollController::startSnapRubberbandTimer()
{
m_client.startSnapRubberbandTimer();
Modified: branches/safari-601.1.32.2-branch/Source/WebCore/platform/mac/ScrollAnimatorMac.h (184573 => 184574)
--- branches/safari-601.1.32.2-branch/Source/WebCore/platform/mac/ScrollAnimatorMac.h 2015-05-19 16:46:48 UTC (rev 184573)
+++ branches/safari-601.1.32.2-branch/Source/WebCore/platform/mac/ScrollAnimatorMac.h 2015-05-19 16:46:52 UTC (rev 184574)
@@ -131,7 +131,8 @@
void immediateScrollTo(const FloatPoint&);
- virtual bool isRubberBandInProgress() const override;
+ bool isRubberBandInProgress() const override;
+ bool isScrollSnapInProgress() const override;
#if ENABLE(RUBBER_BANDING)
/// ScrollControllerClient member functions.
Modified: branches/safari-601.1.32.2-branch/Source/WebCore/platform/mac/ScrollAnimatorMac.mm (184573 => 184574)
--- branches/safari-601.1.32.2-branch/Source/WebCore/platform/mac/ScrollAnimatorMac.mm 2015-05-19 16:46:48 UTC (rev 184573)
+++ branches/safari-601.1.32.2-branch/Source/WebCore/platform/mac/ScrollAnimatorMac.mm 2015-05-19 16:46:52 UTC (rev 184574)
@@ -769,6 +769,15 @@
#endif
}
+bool ScrollAnimatorMac::isScrollSnapInProgress() const
+{
+#if ENABLE(CSS_SCROLL_SNAP)
+ return m_scrollController.isScrollSnapInProgress();
+#else
+ return false;
+#endif
+}
+
void ScrollAnimatorMac::immediateScrollToPointForScrollAnimation(const FloatPoint& newPosition)
{
ASSERT(m_scrollAnimationHelper);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes