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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutTextControl.cpp

Issue 1651703002: More explicit LayoutUnit conversions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@evenMoarConstructors
Patch Set: Traits vs Properties vs Pandas Created 4 years, 10 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 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
3 * (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 3 * (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 if (LayoutBox* innerEditorLayoutBox = innerEditorElement()->layoutBox()) 235 if (LayoutBox* innerEditorLayoutBox = innerEditorElement()->layoutBox())
236 maxLogicalWidth += innerEditorLayoutBox->paddingStart() + innerEditorLay outBox->paddingEnd(); 236 maxLogicalWidth += innerEditorLayoutBox->paddingStart() + innerEditorLay outBox->paddingEnd();
237 if (!style()->logicalWidth().hasPercent()) 237 if (!style()->logicalWidth().hasPercent())
238 minLogicalWidth = maxLogicalWidth; 238 minLogicalWidth = maxLogicalWidth;
239 } 239 }
240 240
241 void LayoutTextControl::computePreferredLogicalWidths() 241 void LayoutTextControl::computePreferredLogicalWidths()
242 { 242 {
243 ASSERT(preferredLogicalWidthsDirty()); 243 ASSERT(preferredLogicalWidthsDirty());
244 244
245 m_minPreferredLogicalWidth = 0; 245 m_minPreferredLogicalWidth = LayoutUnit();
246 m_maxPreferredLogicalWidth = 0; 246 m_maxPreferredLogicalWidth = LayoutUnit();
247 const ComputedStyle& styleToUse = styleRef(); 247 const ComputedStyle& styleToUse = styleRef();
248 248
249 if (styleToUse.logicalWidth().isFixed() && styleToUse.logicalWidth().value() >= 0) 249 if (styleToUse.logicalWidth().isFixed() && styleToUse.logicalWidth().value() >= 0)
250 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentB oxLogicalWidthForBoxSizing(styleToUse.logicalWidth().value()); 250 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentB oxLogicalWidthForBoxSizing(styleToUse.logicalWidth().value());
251 else 251 else
252 computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferred LogicalWidth); 252 computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferred LogicalWidth);
253 253
254 if (styleToUse.logicalMinWidth().isFixed() && styleToUse.logicalMinWidth().v alue() > 0) { 254 if (styleToUse.logicalMinWidth().isFixed() && styleToUse.logicalMinWidth().v alue() > 0) {
255 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjust ContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth().value())); 255 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjust ContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth().value()));
256 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjust ContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth().value())); 256 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjust ContentBoxLogicalWidthForBoxSizing(styleToUse.logicalMinWidth().value()));
(...skipping 22 matching lines...) Expand all
279 HTMLElement* placeholder = toHTMLTextFormControlElement(node())->placeholder Element(); 279 HTMLElement* placeholder = toHTMLTextFormControlElement(node())->placeholder Element();
280 LayoutObject* placeholderLayoutObject = placeholder ? placeholder->layoutObj ect() : nullptr; 280 LayoutObject* placeholderLayoutObject = placeholder ? placeholder->layoutObj ect() : nullptr;
281 if (!placeholderLayoutObject) 281 if (!placeholderLayoutObject)
282 return nullptr; 282 return nullptr;
283 if (relayoutChildren) 283 if (relayoutChildren)
284 layoutScope.setChildNeedsLayout(placeholderLayoutObject); 284 layoutScope.setChildNeedsLayout(placeholderLayoutObject);
285 return placeholderLayoutObject; 285 return placeholderLayoutObject;
286 } 286 }
287 287
288 } // namespace blink 288 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698