Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(811)

Unified Diff: Source/core/rendering/RenderLayerScrollableArea.h

Issue 610423004: Preserve fractional scroll offset for JS scrolling API (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/rendering/RenderLayerScrollableArea.h
diff --git a/Source/core/rendering/RenderLayerScrollableArea.h b/Source/core/rendering/RenderLayerScrollableArea.h
index 449d18c9359313f291a6a1e5ef0653c407c5aafc..fa203d4856a6f0978c65d2a7fa29c3afec0ac9cb 100644
--- a/Source/core/rendering/RenderLayerScrollableArea.h
+++ b/Source/core/rendering/RenderLayerScrollableArea.h
@@ -91,7 +91,9 @@ public:
virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar*, const IntPoint&) const OVERRIDE;
virtual int scrollSize(ScrollbarOrientation) const OVERRIDE;
virtual void setScrollOffset(const IntPoint&) OVERRIDE;
+ virtual void setScrollOffset(const DoublePoint&) OVERRIDE;
virtual IntPoint scrollPosition() const OVERRIDE;
+ virtual DoublePoint scrollPositionDouble() const OVERRIDE;
virtual IntPoint minimumScrollPosition() const OVERRIDE;
virtual IntPoint maximumScrollPosition() const OVERRIDE;
virtual IntRect visibleContentRect(IncludeScrollbarsInRect) const OVERRIDE;
@@ -107,17 +109,17 @@ public:
virtual bool shouldPlaceVerticalScrollbarOnLeft() const OVERRIDE;
virtual int pageStep(ScrollbarOrientation) const OVERRIDE;
- int scrollXOffset() const { return m_scrollOffset.width() + scrollOrigin().x(); }
- int scrollYOffset() const { return m_scrollOffset.height() + scrollOrigin().y(); }
+ double scrollXOffset() const { return m_scrollOffset.width() + scrollOrigin().x(); }
+ double scrollYOffset() const { return m_scrollOffset.height() + scrollOrigin().y(); }
- IntSize scrollOffset() const { return m_scrollOffset; }
+ DoubleSize scrollOffset() const { return m_scrollOffset; }
// FIXME: We shouldn't allow access to m_overflowRect outside this class.
LayoutRect overflowRect() const { return m_overflowRect; }
- void scrollToOffset(const IntSize& scrollOffset, ScrollOffsetClamping = ScrollOffsetUnclamped);
- void scrollToXOffset(int x, ScrollOffsetClamping clamp = ScrollOffsetUnclamped) { scrollToOffset(IntSize(x, scrollYOffset()), clamp); }
- void scrollToYOffset(int y, ScrollOffsetClamping clamp = ScrollOffsetUnclamped) { scrollToOffset(IntSize(scrollXOffset(), y), clamp); }
+ void scrollToOffset(const DoubleSize& scrollOffset, ScrollOffsetClamping = ScrollOffsetUnclamped);
+ void scrollToXOffset(double x, ScrollOffsetClamping clamp = ScrollOffsetUnclamped) { scrollToOffset(DoubleSize(x, scrollYOffset()), clamp); }
+ void scrollToYOffset(double y, ScrollOffsetClamping clamp = ScrollOffsetUnclamped) { scrollToOffset(DoubleSize(scrollXOffset(), y), clamp); }
void updateAfterLayout();
void updateAfterStyleChange(const RenderStyle*);
@@ -149,7 +151,7 @@ public:
int verticalScrollbarWidth(OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize) const;
int horizontalScrollbarHeight(OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize) const;
- IntSize adjustedScrollOffset() const { return IntSize(scrollXOffset(), scrollYOffset()); }
+ DoubleSize adjustedScrollOffset() const { return DoubleSize(scrollXOffset(), scrollYOffset()); }
void paintResizer(GraphicsContext*, const IntPoint& paintOffset, const IntRect& damageRect);
void paintOverflowControls(GraphicsContext*, const IntPoint& paintOffset, const IntRect& damageRect, bool paintingOverlayControls);
@@ -190,7 +192,7 @@ private:
void computeScrollDimensions();
- IntSize clampScrollOffset(const IntSize&) const;
+ DoubleSize clampScrollOffset(const DoubleSize&) const;
IntRect rectForHorizontalScrollbar(const IntRect& borderBoxRect) const;
IntRect rectForVerticalScrollbar(const IntRect& borderBoxRect) const;
@@ -240,7 +242,7 @@ private:
LayoutRect m_overflowRect;
// This is the (scroll) offset from scrollOrigin().
- IntSize m_scrollOffset;
+ DoubleSize m_scrollOffset;
IntPoint m_cachedOverlayScrollbarOffset;

Powered by Google App Engine
This is Rietveld 408576698