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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutScrollbarPart.cpp

Issue 2261663002: Disallow cast/implicit conversion from LayoutUnit to int/unsigned (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 4 years, 4 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: third_party/WebKit/Source/core/layout/LayoutScrollbarPart.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutScrollbarPart.cpp b/third_party/WebKit/Source/core/layout/LayoutScrollbarPart.cpp
index 0c3d5bc85f7e28fafec70f781e9fc2d81d6f5829..1dd61b78b034d7a4bae600daebb20531b27a475a 100644
--- a/third_party/WebKit/Source/core/layout/LayoutScrollbarPart.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutScrollbarPart.cpp
@@ -125,7 +125,7 @@ void LayoutScrollbarPart::layoutVerticalPart()
static int calcScrollbarThicknessUsing(SizeType sizeType, const Length& length, int containingLength)
{
if (!length.isIntrinsicOrAuto() || (sizeType == MinSize && length.isAuto()))
- return minimumValueForLength(length, LayoutUnit(containingLength));
+ return minimumValueForLength(length, LayoutUnit(containingLength)).toInt();
return ScrollbarTheme::theme().scrollbarThickness();
}
@@ -135,7 +135,7 @@ void LayoutScrollbarPart::computeScrollbarWidth()
return;
// 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->owningLayoutObject()->size().width() - m_scrollbar->owningLayoutObject()->style()->borderLeftWidth() - m_scrollbar->owningLayoutObject()->style()->borderRightWidth();
+ int visibleSize = (m_scrollbar->owningLayoutObject()->size().width() - m_scrollbar->owningLayoutObject()->style()->borderLeftWidth() - m_scrollbar->owningLayoutObject()->style()->borderRightWidth()).toInt();
int w = calcScrollbarThicknessUsing(MainOrPreferredSize, style()->width(), visibleSize);
int minWidth = calcScrollbarThicknessUsing(MinSize, style()->minWidth(), visibleSize);
int maxWidth = style()->maxWidth().isMaxSizeNone() ? w : calcScrollbarThicknessUsing(MaxSize, style()->maxWidth(), visibleSize);
@@ -152,7 +152,7 @@ void LayoutScrollbarPart::computeScrollbarHeight()
return;
// 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->owningLayoutObject()->size().height() - m_scrollbar->owningLayoutObject()->style()->borderTopWidth() - m_scrollbar->owningLayoutObject()->style()->borderBottomWidth();
+ int visibleSize = (m_scrollbar->owningLayoutObject()->size().height() - m_scrollbar->owningLayoutObject()->style()->borderTopWidth() - m_scrollbar->owningLayoutObject()->style()->borderBottomWidth()).toInt();
int h = calcScrollbarThicknessUsing(MainOrPreferredSize, style()->height(), visibleSize);
int minHeight = calcScrollbarThicknessUsing(MinSize, style()->minHeight(), visibleSize);
int maxHeight = style()->maxHeight().isMaxSizeNone() ? h : calcScrollbarThicknessUsing(MaxSize, style()->maxHeight(), visibleSize);
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutScrollbar.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutSlider.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698