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

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

Issue 2286543002: Add Length::isPercent and use it in tables. (Closed)
Patch Set: rebase 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 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 235
236 void LayoutTextControl::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidt h, LayoutUnit& maxLogicalWidth) const 236 void LayoutTextControl::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidt h, LayoutUnit& maxLogicalWidth) const
237 { 237 {
238 // Use average character width. Matches IE. 238 // Use average character width. Matches IE.
239 AtomicString family = style()->font().getFontDescription().family().family() ; 239 AtomicString family = style()->font().getFontDescription().family().family() ;
240 maxLogicalWidth = preferredContentLogicalWidth(const_cast<LayoutTextControl* >(this)->getAvgCharWidth(family)); 240 maxLogicalWidth = preferredContentLogicalWidth(const_cast<LayoutTextControl* >(this)->getAvgCharWidth(family));
241 if (innerEditorElement()) { 241 if (innerEditorElement()) {
242 if (LayoutBox* innerEditorLayoutBox = innerEditorElement()->layoutBox()) 242 if (LayoutBox* innerEditorLayoutBox = innerEditorElement()->layoutBox())
243 maxLogicalWidth += innerEditorLayoutBox->paddingStart() + innerEdito rLayoutBox->paddingEnd(); 243 maxLogicalWidth += innerEditorLayoutBox->paddingStart() + innerEdito rLayoutBox->paddingEnd();
244 } 244 }
245 if (!style()->logicalWidth().hasPercent()) 245 if (!style()->logicalWidth().isPercentOrCalc())
246 minLogicalWidth = maxLogicalWidth; 246 minLogicalWidth = maxLogicalWidth;
247 } 247 }
248 248
249 void LayoutTextControl::computePreferredLogicalWidths() 249 void LayoutTextControl::computePreferredLogicalWidths()
250 { 250 {
251 ASSERT(preferredLogicalWidthsDirty()); 251 ASSERT(preferredLogicalWidthsDirty());
252 252
253 m_minPreferredLogicalWidth = LayoutUnit(); 253 m_minPreferredLogicalWidth = LayoutUnit();
254 m_maxPreferredLogicalWidth = LayoutUnit(); 254 m_maxPreferredLogicalWidth = LayoutUnit();
255 const ComputedStyle& styleToUse = styleRef(); 255 const ComputedStyle& styleToUse = styleRef();
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 HTMLElement* placeholder = toHTMLTextFormControlElement(node())->placeholder Element(); 287 HTMLElement* placeholder = toHTMLTextFormControlElement(node())->placeholder Element();
288 LayoutObject* placeholderLayoutObject = placeholder ? placeholder->layoutObj ect() : nullptr; 288 LayoutObject* placeholderLayoutObject = placeholder ? placeholder->layoutObj ect() : nullptr;
289 if (!placeholderLayoutObject) 289 if (!placeholderLayoutObject)
290 return nullptr; 290 return nullptr;
291 if (relayoutChildren) 291 if (relayoutChildren)
292 layoutScope.setChildNeedsLayout(placeholderLayoutObject); 292 layoutScope.setChildNeedsLayout(placeholderLayoutObject);
293 return placeholderLayoutObject; 293 return placeholderLayoutObject;
294 } 294 }
295 295
296 } // namespace blink 296 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698