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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 // FIXME: This code is madness (https://crbug.com/461117) | 107 // FIXME: This code is madness (https://crbug.com/461117) |
108 // FIXME: We should remove the height-related hacks in layout() and | 108 // FIXME: We should remove the height-related hacks in layout() and |
109 // styleDidChange(). We need them because | 109 // styleDidChange(). We need them because |
110 // - Center the inner elements vertically if the input height is taller than | 110 // - Center the inner elements vertically if the input height is taller than |
111 // the intrinsic height of the inner elements. | 111 // the intrinsic height of the inner elements. |
112 // - Shrink the inner elment heights if the input height is samller than the | 112 // - Shrink the inner elment heights if the input height is samller than the |
113 // intrinsic heights of the inner elements. | 113 // intrinsic heights of the inner elements. |
114 | 114 |
115 // We don't honor paddings and borders for textfields without decorations | 115 // We don't honor paddings and borders for textfields without decorations |
116 // and type=search if the text height is taller than the contentHeight() | 116 // and type=search if the text height is taller than the contentHeight() |
117 // because of compability. | 117 // because of compatibility. |
118 | 118 |
119 LayoutBox* innerEditorLayoutObject = innerEditorElement()->layoutBox(); | 119 LayoutBox* innerEditorLayoutObject = innerEditorElement()->layoutBox(); |
120 bool innerEditorLayoutObjectHadLayout = innerEditorLayoutObject && innerEdit
orLayoutObject->needsLayout(); | 120 bool innerEditorLayoutObjectHadLayout = innerEditorLayoutObject && innerEdit
orLayoutObject->needsLayout(); |
121 LayoutBox* viewPortLayoutObject = editingViewPortElement() ? editingViewPort
Element()->layoutBox() : 0; | 121 LayoutBox* viewPortLayoutObject = editingViewPortElement() ? editingViewPort
Element()->layoutBox() : 0; |
122 | 122 |
123 // To ensure consistency between layouts, we need to reset any conditionally
overriden height. | 123 // To ensure consistency between layouts, we need to reset any conditionally
overriden height. |
124 if (innerEditorLayoutObject && !innerEditorLayoutObject->styleRef().logicalH
eight().isAuto()) { | 124 if (innerEditorLayoutObject && !innerEditorLayoutObject->styleRef().logicalH
eight().isAuto()) { |
125 innerEditorLayoutObject->mutableStyleRef().setLogicalHeight(Length(Auto)
); | 125 innerEditorLayoutObject->mutableStyleRef().setLogicalHeight(Length(Auto)
); |
126 layoutScope.setNeedsLayout(innerEditorLayoutObject, LayoutInvalidationRe
ason::TextControlChanged); | 126 layoutScope.setNeedsLayout(innerEditorLayoutObject, LayoutInvalidationRe
ason::TextControlChanged); |
127 HTMLElement* placeholderElement = inputElement()->placeholderElement(); | 127 HTMLElement* placeholderElement = inputElement()->placeholderElement(); |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 if (innerEditorElement()) | 445 if (innerEditorElement()) |
446 innerEditorElement()->setScrollTop(newTop); | 446 innerEditorElement()->setScrollTop(newTop); |
447 } | 447 } |
448 | 448 |
449 HTMLInputElement* LayoutTextControlSingleLine::inputElement() const | 449 HTMLInputElement* LayoutTextControlSingleLine::inputElement() const |
450 { | 450 { |
451 return toHTMLInputElement(node()); | 451 return toHTMLInputElement(node()); |
452 } | 452 } |
453 | 453 |
454 } | 454 } |
OLD | NEW |