| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 HTMLTextFormControlElement* RenderTextControl::textFormControlElement() const | 45 HTMLTextFormControlElement* RenderTextControl::textFormControlElement() const |
| 46 { | 46 { |
| 47 return toHTMLTextFormControlElement(node()); | 47 return toHTMLTextFormControlElement(node()); |
| 48 } | 48 } |
| 49 | 49 |
| 50 HTMLElement* RenderTextControl::innerTextElement() const | 50 HTMLElement* RenderTextControl::innerTextElement() const |
| 51 { | 51 { |
| 52 return textFormControlElement()->innerTextElement(); | 52 return textFormControlElement()->innerTextElement(); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void RenderTextControl::addChild(RenderObject* newChild, RenderObject* beforeChi
ld) |
| 56 { |
| 57 // FIXME: This is a terrible hack to get the caret over the placeholder text
since it'll |
| 58 // make us paint the placeholder first. (See https://trac.webkit.org/changes
et/118733) |
| 59 Node* node = newChild->node(); |
| 60 if (node && node->isElementNode() && toElement(node)->part() == "-webkit-inp
ut-placeholder") |
| 61 RenderBlock::addChild(newChild, firstChild()); |
| 62 else |
| 63 RenderBlock::addChild(newChild, beforeChild); |
| 64 } |
| 65 |
| 55 void RenderTextControl::styleDidChange(StyleDifference diff, const RenderStyle*
oldStyle) | 66 void RenderTextControl::styleDidChange(StyleDifference diff, const RenderStyle*
oldStyle) |
| 56 { | 67 { |
| 57 RenderBlock::styleDidChange(diff, oldStyle); | 68 RenderBlock::styleDidChange(diff, oldStyle); |
| 58 Element* innerText = innerTextElement(); | 69 Element* innerText = innerTextElement(); |
| 59 if (!innerText) | 70 if (!innerText) |
| 60 return; | 71 return; |
| 61 RenderBlock* innerTextRenderer = toRenderBlock(innerText->renderer()); | 72 RenderBlock* innerTextRenderer = toRenderBlock(innerText->renderer()); |
| 62 if (innerTextRenderer) { | 73 if (innerTextRenderer) { |
| 63 // We may have set the width and the height in the old style in layout()
. | 74 // We may have set the width and the height in the old style in layout()
. |
| 64 // Reset them now to avoid getting a spurious layout hint. | 75 // Reset them now to avoid getting a spurious layout hint. |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 layoutScope.setChildNeedsLayout(placeholderRenderer); | 294 layoutScope.setChildNeedsLayout(placeholderRenderer); |
| 284 return placeholderRenderer; | 295 return placeholderRenderer; |
| 285 } | 296 } |
| 286 | 297 |
| 287 bool RenderTextControl::canBeReplacedWithInlineRunIn() const | 298 bool RenderTextControl::canBeReplacedWithInlineRunIn() const |
| 288 { | 299 { |
| 289 return false; | 300 return false; |
| 290 } | 301 } |
| 291 | 302 |
| 292 } // namespace WebCore | 303 } // namespace WebCore |
| OLD | NEW |