| OLD | NEW |
| 1 /** | 1 /** |
| 2 * Copyright (C) 2006, 2007, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2010 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 * Copyright (C) 2010 Google Inc. All rights reserved. | 4 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 5 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | 5 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 PassRefPtr<ComputedStyle> LayoutTextControlSingleLine::createInnerEditorStyle(co
nst ComputedStyle& startStyle) const | 267 PassRefPtr<ComputedStyle> LayoutTextControlSingleLine::createInnerEditorStyle(co
nst ComputedStyle& startStyle) const |
| 268 { | 268 { |
| 269 RefPtr<ComputedStyle> textBlockStyle = ComputedStyle::create(); | 269 RefPtr<ComputedStyle> textBlockStyle = ComputedStyle::create(); |
| 270 textBlockStyle->inheritFrom(startStyle); | 270 textBlockStyle->inheritFrom(startStyle); |
| 271 adjustInnerEditorStyle(*textBlockStyle); | 271 adjustInnerEditorStyle(*textBlockStyle); |
| 272 | 272 |
| 273 textBlockStyle->setWhiteSpace(PRE); | 273 textBlockStyle->setWhiteSpace(PRE); |
| 274 textBlockStyle->setOverflowWrap(NormalOverflowWrap); | 274 textBlockStyle->setOverflowWrap(NormalOverflowWrap); |
| 275 textBlockStyle->setTextOverflow(textShouldBeTruncated() ? TextOverflowEllips
is : TextOverflowClip); | 275 textBlockStyle->setTextOverflow(textShouldBeTruncated() ? TextOverflowEllips
is : TextOverflowClip); |
| 276 | 276 |
| 277 int computedLineHeight = lineHeight(true, HorizontalLine, PositionOfInterior
LineBoxes); | 277 int computedLineHeight = lineHeight(true, HorizontalLine, PositionOfInterior
LineBoxes).toInt(); |
| 278 // Do not allow line-height to be smaller than our default. | 278 // Do not allow line-height to be smaller than our default. |
| 279 if (textBlockStyle->fontSize() >= computedLineHeight) | 279 if (textBlockStyle->fontSize() >= computedLineHeight) |
| 280 textBlockStyle->setLineHeight(ComputedStyle::initialLineHeight()); | 280 textBlockStyle->setLineHeight(ComputedStyle::initialLineHeight()); |
| 281 | 281 |
| 282 // We'd like to remove line-height if it's unnecessary because | 282 // We'd like to remove line-height if it's unnecessary because |
| 283 // overflow:scroll clips editing text by line-height. | 283 // overflow:scroll clips editing text by line-height. |
| 284 Length logicalHeight = startStyle.logicalHeight(); | 284 Length logicalHeight = startStyle.logicalHeight(); |
| 285 // Here, we remove line-height if the INPUT fixed height is taller than the | 285 // Here, we remove line-height if the INPUT fixed height is taller than the |
| 286 // line-height. It's not the precise condition because logicalHeight | 286 // line-height. It's not the precise condition because logicalHeight |
| 287 // includes border and padding if box-sizing:border-box, and there are cases | 287 // includes border and padding if box-sizing:border-box, and there are cases |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 // inner-editor element overflows the INPUT box intentionally, however it | 377 // inner-editor element overflows the INPUT box intentionally, however it |
| 378 // shouldn't affect outside of the INPUT box. So we ignore child overflow. | 378 // shouldn't affect outside of the INPUT box. So we ignore child overflow. |
| 379 } | 379 } |
| 380 | 380 |
| 381 HTMLInputElement* LayoutTextControlSingleLine::inputElement() const | 381 HTMLInputElement* LayoutTextControlSingleLine::inputElement() const |
| 382 { | 382 { |
| 383 return toHTMLInputElement(node()); | 383 return toHTMLInputElement(node()); |
| 384 } | 384 } |
| 385 | 385 |
| 386 } // namespace blink | 386 } // namespace blink |
| OLD | NEW |