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

Unified Diff: Source/core/platform/ScrollView.cpp

Issue 23441020: Make it possibe to lock the fixedLayoutSize (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add one more test 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
Index: Source/core/platform/ScrollView.cpp
diff --git a/Source/core/platform/ScrollView.cpp b/Source/core/platform/ScrollView.cpp
index 79dd29b7de9d91771665bda1a87fdbfa2f709ac0..405b588c521080a59346124d98c7cfcf6b2d6aaa 100644
--- a/Source/core/platform/ScrollView.cpp
+++ b/Source/core/platform/ScrollView.cpp
@@ -50,6 +50,7 @@ ScrollView::ScrollView()
, m_updateScrollbarsPass(0)
, m_drawPanScrollIcon(false)
, m_useFixedLayout(false)
+ , m_fixedLayoutSizeLock(false)
, m_paintsEntireContents(false)
, m_clipsRepaints(true)
{
@@ -205,13 +206,14 @@ IntSize ScrollView::unscaledVisibleContentSize(VisibleContentRectIncludesScrollb
IntRect ScrollView::visibleContentRect(VisibleContentRectIncludesScrollbars scollbarInclusion) const
{
FloatSize visibleContentSize = unscaledVisibleContentSize(scollbarInclusion);
- visibleContentSize.scale(1 / visibleContentScaleFactor());
+ if (!m_fixedLayoutSizeLock)
+ visibleContentSize.scale(1 / visibleContentScaleFactor());
return IntRect(IntPoint(m_scrollOffset), expandedIntSize(visibleContentSize));
}
IntSize ScrollView::layoutSize(VisibleContentRectIncludesScrollbars scrollbarInclusion) const
{
- return m_fixedLayoutSize.isEmpty() || !m_useFixedLayout ? unscaledVisibleContentSize(scrollbarInclusion) : m_fixedLayoutSize;
+ return m_fixedLayoutSize.isZero() || !m_useFixedLayout ? unscaledVisibleContentSize(scrollbarInclusion) : m_fixedLayoutSize;
}
IntSize ScrollView::fixedLayoutSize() const
@@ -221,6 +223,8 @@ IntSize ScrollView::fixedLayoutSize() const
void ScrollView::setFixedLayoutSize(const IntSize& newSize)
{
+ if (m_fixedLayoutSizeLock)
+ return;
if (fixedLayoutSize() == newSize)
return;
m_fixedLayoutSize = newSize;
@@ -243,6 +247,16 @@ void ScrollView::setUseFixedLayout(bool enable)
contentsResized();
}
+void ScrollView::setFixedLayoutSizeLock(bool enable)
+{
+ m_fixedLayoutSizeLock = enable;
+}
+
+bool ScrollView::fixedLayoutSizeLock() const
+{
+ return m_fixedLayoutSizeLock;
+}
+
IntSize ScrollView::contentsSize() const
{
return m_contentsSize;

Powered by Google App Engine
This is Rietveld 408576698