Skip to content
Permalink
Browse files
Some cleanup in ScrollAnimator
https://bugs.webkit.org/show_bug.cgi?id=152649

Try to fix GTK scroll position errors in RTL.

ScrollAnimatorNone::scrollToOffsetWithoutAnimation() was failing to map from
offset to position.

Also add logging in ScrollableArea::scrollToOffsetWithoutAnimation().

* platform/ScrollAnimatorNone.cpp:
(WebCore::ScrollAnimatorNone::scrollToOffsetWithoutAnimation):
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::scrollToOffsetWithoutAnimation):

Canonical link: https://commits.webkit.org/170751@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194513 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
smfr committed Jan 3, 2016
1 parent f10ae71 commit 7c17ba364d3266341bea0f659cf383e61376e800
Showing with 27 additions and 6 deletions.
  1. +17 −0 Source/WebCore/ChangeLog
  2. +7 −6 Source/WebCore/platform/ScrollAnimatorNone.cpp
  3. +3 −0 Source/WebCore/platform/ScrollableArea.cpp
@@ -1,3 +1,20 @@
2016-01-03 Simon Fraser <simon.fraser@apple.com>

Some cleanup in ScrollAnimator
https://bugs.webkit.org/show_bug.cgi?id=152649

Try to fix GTK scroll position errors in RTL.

ScrollAnimatorNone::scrollToOffsetWithoutAnimation() was failing to map from
offset to position.

Also add logging in ScrollableArea::scrollToOffsetWithoutAnimation().

* platform/ScrollAnimatorNone.cpp:
(WebCore::ScrollAnimatorNone::scrollToOffsetWithoutAnimation):
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::scrollToOffsetWithoutAnimation):

2016-01-02 Simon Fraser <simon.fraser@apple.com>

Temporarily turn on Scrolling logging on GTK, to investigate
@@ -448,16 +448,17 @@ bool ScrollAnimatorNone::scroll(ScrollbarOrientation orientation, ScrollGranular
void ScrollAnimatorNone::scrollToOffsetWithoutAnimation(const FloatPoint& offset)
{
stopAnimationTimerIfNeeded();

FloatSize delta = FloatSize(offset.x() - *m_horizontalData.m_currentPosition, offset.y() - *m_verticalData.m_currentPosition);

FloatPoint position = ScrollableArea::scrollPositionFromOffset(offset, toFloatSize(m_scrollableArea.scrollOrigin()));
FloatSize delta = position - FloatPoint(*m_horizontalData.m_currentPosition, *m_verticalData.m_currentPosition);

m_horizontalData.reset();
*m_horizontalData.m_currentPosition = offset.x();
m_horizontalData.m_desiredPosition = offset.x();
*m_horizontalData.m_currentPosition = position.x();
m_horizontalData.m_desiredPosition = position.x();

m_verticalData.reset();
*m_verticalData.m_currentPosition = offset.y();
m_verticalData.m_desiredPosition = offset.y();
*m_verticalData.m_currentPosition = position.y();
m_verticalData.m_desiredPosition = position.y();

notifyPositionChanged(delta);
}
@@ -36,9 +36,11 @@
#include "GraphicsLayer.h"
#include "FloatPoint.h"
#include "LayoutRect.h"
#include "Logging.h"
#include "PlatformWheelEvent.h"
#include "ScrollAnimator.h"
#include "ScrollbarTheme.h"
#include "TextStream.h"

namespace WebCore {

@@ -134,6 +136,7 @@ bool ScrollableArea::scroll(ScrollDirection direction, ScrollGranularity granula

void ScrollableArea::scrollToOffsetWithoutAnimation(const FloatPoint& offset)
{
LOG_WITH_STREAM(Scrolling, stream << "ScrollableArea " << this << " scrollToOffsetWithoutAnimation " << offset);
scrollAnimator().scrollToOffsetWithoutAnimation(offset);
}

0 comments on commit 7c17ba3

Please sign in to comment.