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

Unified Diff: Source/core/rendering/RenderScrollbarPart.cpp

Issue 82083002: Move viewport unit resolution to style recalc time (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: rename browser zoom to page zoom Created 6 years, 12 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/RenderReplaced.cpp ('k') | Source/core/rendering/RenderTable.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderScrollbarPart.cpp
diff --git a/Source/core/rendering/RenderScrollbarPart.cpp b/Source/core/rendering/RenderScrollbarPart.cpp
index 13a35ebb8326d035ebb446f04408da66e19059ee..8df91634ba507729f9aac25c3c407deca4f34bb5 100644
--- a/Source/core/rendering/RenderScrollbarPart.cpp
+++ b/Source/core/rendering/RenderScrollbarPart.cpp
@@ -88,10 +88,10 @@ void RenderScrollbarPart::layoutVerticalPart()
}
}
-static int calcScrollbarThicknessUsing(SizeType sizeType, const Length& length, int containingLength, RenderView* renderView)
+static int calcScrollbarThicknessUsing(SizeType sizeType, const Length& length, int containingLength)
{
if (!length.isIntrinsicOrAuto() || (sizeType == MinSize && length.isAuto()))
- return minimumValueForLength(length, containingLength, renderView);
+ return minimumValueForLength(length, containingLength);
return ScrollbarTheme::theme()->scrollbarThickness();
}
@@ -99,36 +99,34 @@ void RenderScrollbarPart::computeScrollbarWidth()
{
if (!m_scrollbar->owningRenderer())
return;
- RenderView* renderView = view();
// FIXME: We are querying layout information but nothing guarantees that it's up-to-date, especially since we are called at style change.
// FIXME: Querying the style's border information doesn't work on table cells with collapsing borders.
int visibleSize = m_scrollbar->owningRenderer()->width() - m_scrollbar->owningRenderer()->style()->borderLeftWidth() - m_scrollbar->owningRenderer()->style()->borderRightWidth();
- int w = calcScrollbarThicknessUsing(MainOrPreferredSize, style()->width(), visibleSize, renderView);
- int minWidth = calcScrollbarThicknessUsing(MinSize, style()->minWidth(), visibleSize, renderView);
- int maxWidth = style()->maxWidth().isUndefined() ? w : calcScrollbarThicknessUsing(MaxSize, style()->maxWidth(), visibleSize, renderView);
+ int w = calcScrollbarThicknessUsing(MainOrPreferredSize, style()->width(), visibleSize);
+ int minWidth = calcScrollbarThicknessUsing(MinSize, style()->minWidth(), visibleSize);
+ int maxWidth = style()->maxWidth().isUndefined() ? w : calcScrollbarThicknessUsing(MaxSize, style()->maxWidth(), visibleSize);
setWidth(max(minWidth, min(maxWidth, w)));
// Buttons and track pieces can all have margins along the axis of the scrollbar.
- m_marginBox.setLeft(minimumValueForLength(style()->marginLeft(), visibleSize, renderView));
- m_marginBox.setRight(minimumValueForLength(style()->marginRight(), visibleSize, renderView));
+ m_marginBox.setLeft(minimumValueForLength(style()->marginLeft(), visibleSize));
+ m_marginBox.setRight(minimumValueForLength(style()->marginRight(), visibleSize));
}
void RenderScrollbarPart::computeScrollbarHeight()
{
if (!m_scrollbar->owningRenderer())
return;
- RenderView* renderView = view();
// FIXME: We are querying layout information but nothing guarantees that it's up-to-date, especially since we are called at style change.
// FIXME: Querying the style's border information doesn't work on table cells with collapsing borders.
int visibleSize = m_scrollbar->owningRenderer()->height() - m_scrollbar->owningRenderer()->style()->borderTopWidth() - m_scrollbar->owningRenderer()->style()->borderBottomWidth();
- int h = calcScrollbarThicknessUsing(MainOrPreferredSize, style()->height(), visibleSize, renderView);
- int minHeight = calcScrollbarThicknessUsing(MinSize, style()->minHeight(), visibleSize, renderView);
- int maxHeight = style()->maxHeight().isUndefined() ? h : calcScrollbarThicknessUsing(MaxSize, style()->maxHeight(), visibleSize, renderView);
+ int h = calcScrollbarThicknessUsing(MainOrPreferredSize, style()->height(), visibleSize);
+ int minHeight = calcScrollbarThicknessUsing(MinSize, style()->minHeight(), visibleSize);
+ int maxHeight = style()->maxHeight().isUndefined() ? h : calcScrollbarThicknessUsing(MaxSize, style()->maxHeight(), visibleSize);
setHeight(max(minHeight, min(maxHeight, h)));
// Buttons and track pieces can all have margins along the axis of the scrollbar.
- m_marginBox.setTop(minimumValueForLength(style()->marginTop(), visibleSize, renderView));
- m_marginBox.setBottom(minimumValueForLength(style()->marginBottom(), visibleSize, renderView));
+ m_marginBox.setTop(minimumValueForLength(style()->marginTop(), visibleSize));
+ m_marginBox.setBottom(minimumValueForLength(style()->marginBottom(), visibleSize));
}
void RenderScrollbarPart::computePreferredLogicalWidths()
« no previous file with comments | « Source/core/rendering/RenderReplaced.cpp ('k') | Source/core/rendering/RenderTable.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698