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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
288 // in which we don't want to remove line-height with percent or calculated | 288 // in which we don't want to remove line-height with percent or calculated |
289 // length. | 289 // length. |
290 // TODO(tkent): This should be done during layout. | 290 // TODO(tkent): This should be done during layout. |
291 if (logicalHeight.isPercentOrCalc() || (logicalHeight.isFixed() && logicalHe
ight.getFloatValue() > computedLineHeight)) | 291 if (logicalHeight.isPercentOrCalc() || (logicalHeight.isFixed() && logicalHe
ight.getFloatValue() > computedLineHeight)) |
292 textBlockStyle->setLineHeight(ComputedStyle::initialLineHeight()); | 292 textBlockStyle->setLineHeight(ComputedStyle::initialLineHeight()); |
293 | 293 |
294 textBlockStyle->setDisplay(BLOCK); | 294 textBlockStyle->setDisplay(EDisplay::Block); |
295 textBlockStyle->setUnique(); | 295 textBlockStyle->setUnique(); |
296 | 296 |
297 if (inputElement()->shouldRevealPassword()) | 297 if (inputElement()->shouldRevealPassword()) |
298 textBlockStyle->setTextSecurity(TSNONE); | 298 textBlockStyle->setTextSecurity(TSNONE); |
299 | 299 |
300 textBlockStyle->setOverflowX(OverflowScroll); | 300 textBlockStyle->setOverflowX(OverflowScroll); |
301 // overflow-y:visible doesn't work because overflow-x:scroll makes a layer. | 301 // overflow-y:visible doesn't work because overflow-x:scroll makes a layer. |
302 textBlockStyle->setOverflowY(OverflowScroll); | 302 textBlockStyle->setOverflowY(OverflowScroll); |
303 RefPtr<ComputedStyle> noScrollbarStyle = ComputedStyle::create(); | 303 RefPtr<ComputedStyle> noScrollbarStyle = ComputedStyle::create(); |
304 noScrollbarStyle->setStyleType(PseudoIdScrollbar); | 304 noScrollbarStyle->setStyleType(PseudoIdScrollbar); |
305 noScrollbarStyle->setDisplay(NONE); | 305 noScrollbarStyle->setDisplay(EDisplay::None); |
306 textBlockStyle->addCachedPseudoStyle(noScrollbarStyle); | 306 textBlockStyle->addCachedPseudoStyle(noScrollbarStyle); |
307 textBlockStyle->setHasPseudoStyle(PseudoIdScrollbar); | 307 textBlockStyle->setHasPseudoStyle(PseudoIdScrollbar); |
308 | 308 |
309 return textBlockStyle.release(); | 309 return textBlockStyle.release(); |
310 } | 310 } |
311 | 311 |
312 bool LayoutTextControlSingleLine::textShouldBeTruncated() const | 312 bool LayoutTextControlSingleLine::textShouldBeTruncated() const |
313 { | 313 { |
314 return document().focusedElement() != node() && styleRef().getTextOverflow()
== TextOverflowEllipsis; | 314 return document().focusedElement() != node() && styleRef().getTextOverflow()
== TextOverflowEllipsis; |
315 } | 315 } |
(...skipping 61 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 |