| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 { | 51 { |
| 52 return textFormControlElement()->innerTextElement(); | 52 return textFormControlElement()->innerTextElement(); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void RenderTextControl::addChild(RenderObject* newChild, RenderObject* beforeChi
ld) | 55 void RenderTextControl::addChild(RenderObject* newChild, RenderObject* beforeChi
ld) |
| 56 { | 56 { |
| 57 // FIXME: This is a terrible hack to get the caret over the placeholder text
since it'll | 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) | 58 // make us paint the placeholder first. (See https://trac.webkit.org/changes
et/118733) |
| 59 Node* node = newChild->node(); | 59 Node* node = newChild->node(); |
| 60 if (node && node->isElementNode() && toElement(node)->shadowPseudoId() == "-
webkit-input-placeholder") | 60 if (node && node->isElementNode() && toElement(node)->shadowPseudoId() == "-
webkit-input-placeholder") |
| 61 RenderBlock::addChild(newChild, firstChild()); | 61 RenderBlockFlow::addChild(newChild, firstChild()); |
| 62 else | 62 else |
| 63 RenderBlock::addChild(newChild, beforeChild); | 63 RenderBlockFlow::addChild(newChild, beforeChild); |
| 64 } | 64 } |
| 65 | 65 |
| 66 void RenderTextControl::styleDidChange(StyleDifference diff, const RenderStyle*
oldStyle) | 66 void RenderTextControl::styleDidChange(StyleDifference diff, const RenderStyle*
oldStyle) |
| 67 { | 67 { |
| 68 RenderBlock::styleDidChange(diff, oldStyle); | 68 RenderBlockFlow::styleDidChange(diff, oldStyle); |
| 69 Element* innerText = innerTextElement(); | 69 Element* innerText = innerTextElement(); |
| 70 if (!innerText) | 70 if (!innerText) |
| 71 return; | 71 return; |
| 72 RenderBlock* innerTextRenderer = toRenderBlock(innerText->renderer()); | 72 RenderBlock* innerTextRenderer = toRenderBlock(innerText->renderer()); |
| 73 if (innerTextRenderer) { | 73 if (innerTextRenderer) { |
| 74 // 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()
. |
| 75 // Reset them now to avoid getting a spurious layout hint. | 75 // Reset them now to avoid getting a spurious layout hint. |
| 76 innerTextRenderer->style()->setHeight(Length()); | 76 innerTextRenderer->style()->setHeight(Length()); |
| 77 innerTextRenderer->style()->setWidth(Length()); | 77 innerTextRenderer->style()->setWidth(Length()); |
| 78 innerTextRenderer->setStyle(createInnerTextStyle(style())); | 78 innerTextRenderer->setStyle(createInnerTextStyle(style())); |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 HTMLElement* placeholder = toHTMLTextFormControlElement(node())->placeholder
Element(); | 289 HTMLElement* placeholder = toHTMLTextFormControlElement(node())->placeholder
Element(); |
| 290 RenderObject* placeholderRenderer = placeholder ? placeholder->renderer() :
0; | 290 RenderObject* placeholderRenderer = placeholder ? placeholder->renderer() :
0; |
| 291 if (!placeholderRenderer) | 291 if (!placeholderRenderer) |
| 292 return 0; | 292 return 0; |
| 293 if (relayoutChildren) | 293 if (relayoutChildren) |
| 294 layoutScope.setChildNeedsLayout(placeholderRenderer); | 294 layoutScope.setChildNeedsLayout(placeholderRenderer); |
| 295 return placeholderRenderer; | 295 return placeholderRenderer; |
| 296 } | 296 } |
| 297 | 297 |
| 298 } // namespace WebCore | 298 } // namespace WebCore |
| OLD | NEW |