| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |