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

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

Issue 1774943003: blink: Rename platform/ methods to prefix with get when they collide. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clash-platform: rebase-yayyyyyyyy Created 4 years, 9 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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 const UChar ch = '0'; 220 const UChar ch = '0';
221 const String str = String(&ch, 1); 221 const String str = String(&ch, 1);
222 TextRun textRun = constructTextRun(font, str, styleRef(), TextRun::AllowTrai lingExpansion); 222 TextRun textRun = constructTextRun(font, str, styleRef(), TextRun::AllowTrai lingExpansion);
223 return font.width(textRun); 223 return font.width(textRun);
224 } 224 }
225 225
226 float LayoutTextControl::scaleEmToUnits(int x) const 226 float LayoutTextControl::scaleEmToUnits(int x) const
227 { 227 {
228 // This matches the unitsPerEm value for MS Shell Dlg and Courier New from t he "head" font table. 228 // This matches the unitsPerEm value for MS Shell Dlg and Courier New from t he "head" font table.
229 float unitsPerEm = 2048.0f; 229 float unitsPerEm = 2048.0f;
230 return roundf(style()->font().fontDescription().computedSize() * x / unitsPe rEm); 230 return roundf(style()->font().getFontDescription().computedSize() * x / unit sPerEm);
231 } 231 }
232 232
233 void LayoutTextControl::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidt h, LayoutUnit& maxLogicalWidth) const 233 void LayoutTextControl::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidt h, LayoutUnit& maxLogicalWidth) const
234 { 234 {
235 // Use average character width. Matches IE. 235 // Use average character width. Matches IE.
236 AtomicString family = style()->font().fontDescription().family().family(); 236 AtomicString family = style()->font().getFontDescription().family().family() ;
237 maxLogicalWidth = preferredContentLogicalWidth(const_cast<LayoutTextControl* >(this)->getAvgCharWidth(family)); 237 maxLogicalWidth = preferredContentLogicalWidth(const_cast<LayoutTextControl* >(this)->getAvgCharWidth(family));
238 if (LayoutBox* innerEditorLayoutBox = innerEditorElement()->layoutBox()) 238 if (LayoutBox* innerEditorLayoutBox = innerEditorElement()->layoutBox())
239 maxLogicalWidth += innerEditorLayoutBox->paddingStart() + innerEditorLay outBox->paddingEnd(); 239 maxLogicalWidth += innerEditorLayoutBox->paddingStart() + innerEditorLay outBox->paddingEnd();
240 if (!style()->logicalWidth().hasPercent()) 240 if (!style()->logicalWidth().hasPercent())
241 minLogicalWidth = maxLogicalWidth; 241 minLogicalWidth = maxLogicalWidth;
242 } 242 }
243 243
244 void LayoutTextControl::computePreferredLogicalWidths() 244 void LayoutTextControl::computePreferredLogicalWidths()
245 { 245 {
246 ASSERT(preferredLogicalWidthsDirty()); 246 ASSERT(preferredLogicalWidthsDirty());
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 HTMLElement* placeholder = toHTMLTextFormControlElement(node())->placeholder Element(); 282 HTMLElement* placeholder = toHTMLTextFormControlElement(node())->placeholder Element();
283 LayoutObject* placeholderLayoutObject = placeholder ? placeholder->layoutObj ect() : nullptr; 283 LayoutObject* placeholderLayoutObject = placeholder ? placeholder->layoutObj ect() : nullptr;
284 if (!placeholderLayoutObject) 284 if (!placeholderLayoutObject)
285 return nullptr; 285 return nullptr;
286 if (relayoutChildren) 286 if (relayoutChildren)
287 layoutScope.setChildNeedsLayout(placeholderLayoutObject); 287 layoutScope.setChildNeedsLayout(placeholderLayoutObject);
288 return placeholderLayoutObject; 288 return placeholderLayoutObject;
289 } 289 }
290 290
291 } // namespace blink 291 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698