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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutFileUploadControl.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 * Copyright (C) 2006, 2007, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 if (styleToUse.minWidth().isFixed() && styleToUse.minWidth().value() > 0) { 118 if (styleToUse.minWidth().isFixed() && styleToUse.minWidth().value() > 0) {
119 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjust ContentBoxLogicalWidthForBoxSizing(LayoutUnit(styleToUse.minWidth().value()))); 119 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjust ContentBoxLogicalWidthForBoxSizing(LayoutUnit(styleToUse.minWidth().value())));
120 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjust ContentBoxLogicalWidthForBoxSizing(LayoutUnit(styleToUse.minWidth().value()))); 120 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjust ContentBoxLogicalWidthForBoxSizing(LayoutUnit(styleToUse.minWidth().value())));
121 } 121 }
122 122
123 if (styleToUse.maxWidth().isFixed()) { 123 if (styleToUse.maxWidth().isFixed()) {
124 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjust ContentBoxLogicalWidthForBoxSizing(LayoutUnit(styleToUse.maxWidth().value()))); 124 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjust ContentBoxLogicalWidthForBoxSizing(LayoutUnit(styleToUse.maxWidth().value())));
125 m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjust ContentBoxLogicalWidthForBoxSizing(LayoutUnit(styleToUse.maxWidth().value()))); 125 m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjust ContentBoxLogicalWidthForBoxSizing(LayoutUnit(styleToUse.maxWidth().value())));
126 } 126 }
127 127
128 int toAdd = borderAndPaddingWidth(); 128 int toAdd = borderAndPaddingWidth().toInt();
129 m_minPreferredLogicalWidth += toAdd; 129 m_minPreferredLogicalWidth += toAdd;
130 m_maxPreferredLogicalWidth += toAdd; 130 m_maxPreferredLogicalWidth += toAdd;
131 131
132 clearPreferredLogicalWidthsDirty(); 132 clearPreferredLogicalWidthsDirty();
133 } 133 }
134 134
135 PositionWithAffinity LayoutFileUploadControl::positionForPoint(const LayoutPoint &) 135 PositionWithAffinity LayoutFileUploadControl::positionForPoint(const LayoutPoint &)
136 { 136 {
137 return PositionWithAffinity(); 137 return PositionWithAffinity();
138 } 138 }
(...skipping 15 matching lines...) Expand all
154 } 154 }
155 155
156 String LayoutFileUploadControl::fileTextValue() const 156 String LayoutFileUploadControl::fileTextValue() const
157 { 157 {
158 HTMLInputElement* input = toHTMLInputElement(node()); 158 HTMLInputElement* input = toHTMLInputElement(node());
159 ASSERT(input->files()); 159 ASSERT(input->files());
160 return LayoutTheme::theme().fileListNameForWidth(input->locale(), input->fil es(), style()->font(), maxFilenameWidth()); 160 return LayoutTheme::theme().fileListNameForWidth(input->locale(), input->fil es(), style()->font(), maxFilenameWidth());
161 } 161 }
162 162
163 } // namespace blink 163 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutFieldset.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698