Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Side by Side Diff: Source/core/rendering/RenderTextControl.cpp

Issue 163513002: Have RenderBlockFlow sub-classes' methods call their super-class method properly. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderTableCell.cpp ('k') | Source/core/rendering/RenderTextControlSingleLine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698