| 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. | 3 * (C) 2008 Torch Mobile Inc. All rights reserved. |
| 4 * (http://www.torchmobile.com/) | 4 * (http://www.torchmobile.com/) |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 styleToUse.logicalWidth().value() >= 0) | 280 styleToUse.logicalWidth().value() >= 0) |
| 281 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = | 281 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = |
| 282 adjustContentBoxLogicalWidthForBoxSizing( | 282 adjustContentBoxLogicalWidthForBoxSizing( |
| 283 styleToUse.logicalWidth().value()); | 283 styleToUse.logicalWidth().value()); |
| 284 else | 284 else |
| 285 computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, | 285 computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, |
| 286 m_maxPreferredLogicalWidth); | 286 m_maxPreferredLogicalWidth); |
| 287 | 287 |
| 288 if (styleToUse.logicalMinWidth().isFixed() && | 288 if (styleToUse.logicalMinWidth().isFixed() && |
| 289 styleToUse.logicalMinWidth().value() > 0) { | 289 styleToUse.logicalMinWidth().value() > 0) { |
| 290 m_maxPreferredLogicalWidth = std::max( | 290 m_maxPreferredLogicalWidth = |
| 291 m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing( | 291 std::max(m_maxPreferredLogicalWidth, |
| 292 styleToUse.logicalMinWidth().value())); | 292 adjustContentBoxLogicalWidthForBoxSizing( |
| 293 m_minPreferredLogicalWidth = std::max( | 293 styleToUse.logicalMinWidth().value())); |
| 294 m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing( | 294 m_minPreferredLogicalWidth = |
| 295 styleToUse.logicalMinWidth().value())); | 295 std::max(m_minPreferredLogicalWidth, |
| 296 adjustContentBoxLogicalWidthForBoxSizing( |
| 297 styleToUse.logicalMinWidth().value())); |
| 296 } | 298 } |
| 297 | 299 |
| 298 if (styleToUse.logicalMaxWidth().isFixed()) { | 300 if (styleToUse.logicalMaxWidth().isFixed()) { |
| 299 m_maxPreferredLogicalWidth = std::min( | 301 m_maxPreferredLogicalWidth = |
| 300 m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing( | 302 std::min(m_maxPreferredLogicalWidth, |
| 301 styleToUse.logicalMaxWidth().value())); | 303 adjustContentBoxLogicalWidthForBoxSizing( |
| 302 m_minPreferredLogicalWidth = std::min( | 304 styleToUse.logicalMaxWidth().value())); |
| 303 m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing( | 305 m_minPreferredLogicalWidth = |
| 304 styleToUse.logicalMaxWidth().value())); | 306 std::min(m_minPreferredLogicalWidth, |
| 307 adjustContentBoxLogicalWidthForBoxSizing( |
| 308 styleToUse.logicalMaxWidth().value())); |
| 305 } | 309 } |
| 306 | 310 |
| 307 LayoutUnit toAdd = borderAndPaddingLogicalWidth(); | 311 LayoutUnit toAdd = borderAndPaddingLogicalWidth(); |
| 308 | 312 |
| 309 m_minPreferredLogicalWidth += toAdd; | 313 m_minPreferredLogicalWidth += toAdd; |
| 310 m_maxPreferredLogicalWidth += toAdd; | 314 m_maxPreferredLogicalWidth += toAdd; |
| 311 | 315 |
| 312 clearPreferredLogicalWidthsDirty(); | 316 clearPreferredLogicalWidthsDirty(); |
| 313 } | 317 } |
| 314 | 318 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 LayoutUnit baseline(fontData->getFontMetrics().ascent(AlphabeticBaseline)); | 357 LayoutUnit baseline(fontData->getFontMetrics().ascent(AlphabeticBaseline)); |
| 354 for (LayoutObject* box = innerEditorLayoutObject; box && box != this; | 358 for (LayoutObject* box = innerEditorLayoutObject; box && box != this; |
| 355 box = box->parent()) { | 359 box = box->parent()) { |
| 356 if (box->isBox()) | 360 if (box->isBox()) |
| 357 baseline += toLayoutBox(box)->logicalTop(); | 361 baseline += toLayoutBox(box)->logicalTop(); |
| 358 } | 362 } |
| 359 return baseline.toInt(); | 363 return baseline.toInt(); |
| 360 } | 364 } |
| 361 | 365 |
| 362 } // namespace blink | 366 } // namespace blink |
| OLD | NEW |