summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/ScrollView.h
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform/ScrollView.h')
-rw-r--r--WebCore/platform/ScrollView.h34
1 files changed, 24 insertions, 10 deletions
diff --git a/WebCore/platform/ScrollView.h b/WebCore/platform/ScrollView.h
index 3627283..6f7ec8b 100644
--- a/WebCore/platform/ScrollView.h
+++ b/WebCore/platform/ScrollView.h
@@ -168,7 +168,7 @@ public:
IntSize scrollOffset() const { return visibleContentRect().location() - IntPoint(); } // Gets the scrolled position as an IntSize. Convenient for adding to other sizes.
IntPoint maximumScrollPosition() const; // The maximum position we can be scrolled to.
IntPoint minimumScrollPosition() const; // The minimum position we can be scrolled to.
- // Adjust the pass in scroll position within the minimum and maximum positions.
+ // Adjust the passed in scroll position to keep it between the minimum and maximum positions.
IntPoint adjustScrollPositionWithinRange(const IntPoint&) const;
int scrollX() const { return scrollPosition().x(); }
int scrollY() const { return scrollPosition().y(); }
@@ -179,7 +179,10 @@ public:
// This function scrolls by lines, pages or pixels.
bool scroll(ScrollDirection, ScrollGranularity);
-
+
+ // A logical scroll that just ends up calling the corresponding physical scroll() based off the document's writing mode.
+ bool logicalScroll(ScrollLogicalDirection, ScrollGranularity);
+
// Scroll the actual contents of the view (either blitting or invalidating as needed).
void scrollContents(const IntSize& scrollDelta);
@@ -289,9 +292,12 @@ protected:
// Scroll the content by invalidating everything.
virtual void scrollContentsSlowPath(const IntRect& updateRect);
- void setScrollOriginX(int);
- int scrollOriginX() { return m_scrollOriginX; }
- void updateScrollbars();
+ void setScrollOrigin(const IntPoint&, bool updatePosition);
+ IntPoint scrollOrigin() { return m_scrollOrigin; }
+
+ // Subclassed by FrameView to check the writing-mode of the document.
+ virtual bool isVerticalDocument() const { return true; }
+ virtual bool isFlippedDocument() const { return false; }
private:
RefPtr<Scrollbar> m_horizontalScrollbar;
@@ -328,10 +334,18 @@ private:
bool m_paintsEntireContents;
bool m_delegatesScrolling;
- // m_scrollOriginX is 0 for LTR page. And it is negative of left layout
- // overflow for RTL page. It is mainly used to set the horizontal scrollbar
- // position for RTL page.
- int m_scrollOriginX;
+ // There are 8 possible combinations of writing mode and direction. Scroll origin will be non-zero in the x or y axis
+ // if there is any reversed direction or writing-mode. The combinations are:
+ // writing-mode / direction scrollOrigin.x() set scrollOrigin.y() set
+ // horizontal-tb / ltr NO NO
+ // horizontal-tb / rtl YES NO
+ // horizontal-bt / ltr NO YES
+ // horizontal-bt / rtl YES YES
+ // vertical-lr / ltr NO NO
+ // vertical-lr / rtl NO YES
+ // vertical-rl / ltr YES NO
+ // vertical-rl / rtl YES YES
+ IntPoint m_scrollOrigin;
void init();
void destroy();
@@ -361,7 +375,7 @@ private:
void platformRepaintContentRectangle(const IntRect&, bool now);
bool platformIsOffscreen() const;
- void platformSetScrollOriginX(int);
+ void platformSetScrollOrigin(const IntPoint&, bool updatePosition);
#if PLATFORM(ANDROID)
int platformActualWidth() const;