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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutTheme.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, 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 unified diff | Download patch
OLDNEW
1 /** 1 /**
2 * This file is part of the theme implementation for form controls in WebCore. 2 * This file is part of the theme implementation for form controls in WebCore.
3 * 3 *
4 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Computer, Inc. 4 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Computer, Inc.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 369
370 int LayoutTheme::baselinePosition(const LayoutObject* o) const 370 int LayoutTheme::baselinePosition(const LayoutObject* o) const
371 { 371 {
372 if (!o->isBox()) 372 if (!o->isBox())
373 return 0; 373 return 0;
374 374
375 const LayoutBox* box = toLayoutBox(o); 375 const LayoutBox* box = toLayoutBox(o);
376 376
377 if (m_platformTheme) 377 if (m_platformTheme)
378 return box->size().height() + box->marginTop() + m_platformTheme->baseli nePositionAdjustment(o->style()->appearance()) * o->style()->effectiveZoom(); 378 return box->size().height() + box->marginTop() + m_platformTheme->baseli nePositionAdjustment(o->style()->appearance()) * o->style()->effectiveZoom();
379 return box->size().height() + box->marginTop(); 379 return (box->size().height() + box->marginTop()).toInt();
380 } 380 }
381 381
382 bool LayoutTheme::isControlContainer(ControlPart appearance) const 382 bool LayoutTheme::isControlContainer(ControlPart appearance) const
383 { 383 {
384 // There are more leaves than this, but we'll patch this function as we add support for 384 // There are more leaves than this, but we'll patch this function as we add support for
385 // more controls. 385 // more controls.
386 return appearance != CheckboxPart && appearance != RadioPart; 386 return appearance != CheckboxPart && appearance != RadioPart;
387 } 387 }
388 388
389 bool LayoutTheme::isControlStyled(const ComputedStyle& style) const 389 bool LayoutTheme::isControlStyled(const ComputedStyle& style) const
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
914 914
915 // padding - not honored by WinIE, needs to be removed. 915 // padding - not honored by WinIE, needs to be removed.
916 style.resetPadding(); 916 style.resetPadding();
917 917
918 // border - honored by WinIE, but looks terrible (just paints in the control box and turns off the Windows XP theme) 918 // border - honored by WinIE, but looks terrible (just paints in the control box and turns off the Windows XP theme)
919 // for now, we will not honor it. 919 // for now, we will not honor it.
920 style.resetBorder(); 920 style.resetBorder();
921 } 921 }
922 922
923 } // namespace blink 923 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698