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

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

Issue 22893055: Split computeScrollDimensions() out of RenderLayer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated after Ian's comment. Created 7 years, 3 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
« no previous file with comments | « Source/core/rendering/RenderLayer.cpp ('k') | Source/core/rendering/RenderLayerScrollableArea.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderLayerScrollableArea.h
diff --git a/Source/core/rendering/RenderLayerScrollableArea.h b/Source/core/rendering/RenderLayerScrollableArea.h
index 215ef8334217f6410e75b78cb9084e7d8629e401..f00040711f8487b1523ecf7a8c40ee7c279881b7 100644
--- a/Source/core/rendering/RenderLayerScrollableArea.h
+++ b/Source/core/rendering/RenderLayerScrollableArea.h
@@ -53,6 +53,11 @@ enum ResizerHitTestType {
ResizerForTouch
};
+enum ScrollOffsetClamping {
+ ScrollOffsetUnclamped,
+ ScrollOffsetClamped
+};
+
class RenderLayer;
class RenderLayerModelObject;
@@ -105,13 +110,39 @@ public:
IntSize 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 updateAfterLayout();
+ void updateAfterStyleChange(const RenderStyle*);
+
private:
+ bool hasHorizontalOverflow() const;
+ bool hasVerticalOverflow() const;
+ bool hasScrollableHorizontalOverflow() const;
+ bool hasScrollableVerticalOverflow() const;
+
+ int scrollWidth() const;
+ int scrollHeight() const;
+
+ void computeScrollDimensions();
+
+ IntSize clampScrollOffset(const IntSize&) const;
+ IntSize adjustedScrollOffset() const { return IntSize(scrollXOffset(), scrollYOffset()); }
+
void setScrollOffset(const IntSize& scrollOffset) { m_scrollOffset = scrollOffset; }
RenderLayerModelObject* renderer() const;
RenderLayer* m_layer;
+ unsigned m_scrollDimensionsDirty : 1;
+
+ // The width/height of our scrolled area.
+ LayoutRect m_overflowRect;
+
// This is the (scroll) offset from scrollOrigin().
IntSize m_scrollOffset;
};
« no previous file with comments | « Source/core/rendering/RenderLayer.cpp ('k') | Source/core/rendering/RenderLayerScrollableArea.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698