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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 HTMLTextFormControlElement* RenderTextControl::textFormControlElement() const | 44 HTMLTextFormControlElement* RenderTextControl::textFormControlElement() const |
45 { | 45 { |
46 return toHTMLTextFormControlElement(node()); | 46 return toHTMLTextFormControlElement(node()); |
47 } | 47 } |
48 | 48 |
49 HTMLElement* RenderTextControl::innerEditorElement() const | 49 HTMLElement* RenderTextControl::innerEditorElement() const |
50 { | 50 { |
51 return textFormControlElement()->innerEditorElement(); | 51 return textFormControlElement()->innerEditorElement(); |
52 } | 52 } |
53 | 53 |
54 void RenderTextControl::addChild(RenderObject* newChild, RenderObject* beforeChi
ld) | 54 void RenderTextControl::addChild(LayoutObject* newChild, LayoutObject* beforeChi
ld) |
55 { | 55 { |
56 // FIXME: This is a terrible hack to get the caret over the placeholder text
since it'll | 56 // FIXME: This is a terrible hack to get the caret over the placeholder text
since it'll |
57 // make us paint the placeholder first. (See https://trac.webkit.org/changes
et/118733) | 57 // make us paint the placeholder first. (See https://trac.webkit.org/changes
et/118733) |
58 Node* node = newChild->node(); | 58 Node* node = newChild->node(); |
59 if (node && node->isElementNode() && toElement(node)->shadowPseudoId() == "-
webkit-input-placeholder") | 59 if (node && node->isElementNode() && toElement(node)->shadowPseudoId() == "-
webkit-input-placeholder") |
60 RenderBlockFlow::addChild(newChild, firstChild()); | 60 RenderBlockFlow::addChild(newChild, firstChild()); |
61 else | 61 else |
62 RenderBlockFlow::addChild(newChild, beforeChild); | 62 RenderBlockFlow::addChild(newChild, beforeChild); |
63 } | 63 } |
64 | 64 |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 | 282 |
283 clearPreferredLogicalWidthsDirty(); | 283 clearPreferredLogicalWidthsDirty(); |
284 } | 284 } |
285 | 285 |
286 void RenderTextControl::addFocusRingRects(Vector<LayoutRect>& rects, const Layou
tPoint& additionalOffset) const | 286 void RenderTextControl::addFocusRingRects(Vector<LayoutRect>& rects, const Layou
tPoint& additionalOffset) const |
287 { | 287 { |
288 if (!size().isEmpty()) | 288 if (!size().isEmpty()) |
289 rects.append(LayoutRect(additionalOffset, size())); | 289 rects.append(LayoutRect(additionalOffset, size())); |
290 } | 290 } |
291 | 291 |
292 RenderObject* RenderTextControl::layoutSpecialExcludedChild(bool relayoutChildre
n, SubtreeLayoutScope& layoutScope) | 292 LayoutObject* RenderTextControl::layoutSpecialExcludedChild(bool relayoutChildre
n, SubtreeLayoutScope& layoutScope) |
293 { | 293 { |
294 HTMLElement* placeholder = toHTMLTextFormControlElement(node())->placeholder
Element(); | 294 HTMLElement* placeholder = toHTMLTextFormControlElement(node())->placeholder
Element(); |
295 RenderObject* placeholderRenderer = placeholder ? placeholder->renderer() :
0; | 295 LayoutObject* placeholderRenderer = placeholder ? placeholder->renderer() :
0; |
296 if (!placeholderRenderer) | 296 if (!placeholderRenderer) |
297 return 0; | 297 return 0; |
298 if (relayoutChildren) | 298 if (relayoutChildren) |
299 layoutScope.setChildNeedsLayout(placeholderRenderer); | 299 layoutScope.setChildNeedsLayout(placeholderRenderer); |
300 return placeholderRenderer; | 300 return placeholderRenderer; |
301 } | 301 } |
302 | 302 |
303 } // namespace blink | 303 } // namespace blink |
OLD | NEW |