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

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

Issue 197283025: Use new is*Element() helper functions more in rendering code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderFieldset.cpp ('k') | Source/core/rendering/RenderImage.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 PositionWithAffinity RenderFileUploadControl::positionForPoint(const LayoutPoint &) 199 PositionWithAffinity RenderFileUploadControl::positionForPoint(const LayoutPoint &)
200 { 200 {
201 return PositionWithAffinity(); 201 return PositionWithAffinity();
202 } 202 }
203 203
204 HTMLInputElement* RenderFileUploadControl::uploadButton() const 204 HTMLInputElement* RenderFileUploadControl::uploadButton() const
205 { 205 {
206 // FIXME: This should be on HTMLInputElement as an API like innerButtonEleme nt(). 206 // FIXME: This should be on HTMLInputElement as an API like innerButtonEleme nt().
207 HTMLInputElement* input = toHTMLInputElement(node()); 207 HTMLInputElement* input = toHTMLInputElement(node());
208 Node* buttonNode = input->userAgentShadowRoot()->firstChild(); 208 Node* buttonNode = input->userAgentShadowRoot()->firstChild();
209 return buttonNode && buttonNode->isHTMLElement() && buttonNode->hasTagName(i nputTag) ? toHTMLInputElement(buttonNode) : 0; 209 return isHTMLInputElement(buttonNode) ? toHTMLInputElement(buttonNode) : 0;
210 } 210 }
211 211
212 String RenderFileUploadControl::buttonValue() 212 String RenderFileUploadControl::buttonValue()
213 { 213 {
214 if (HTMLInputElement* button = uploadButton()) 214 if (HTMLInputElement* button = uploadButton())
215 return button->value(); 215 return button->value();
216 216
217 return String(); 217 return String();
218 } 218 }
219 219
220 String RenderFileUploadControl::fileTextValue() const 220 String RenderFileUploadControl::fileTextValue() const
221 { 221 {
222 HTMLInputElement* input = toHTMLInputElement(node()); 222 HTMLInputElement* input = toHTMLInputElement(node());
223 ASSERT(input->files()); 223 ASSERT(input->files());
224 return RenderTheme::theme().fileListNameForWidth(input->locale(), input->fil es(), style()->font(), maxFilenameWidth()); 224 return RenderTheme::theme().fileListNameForWidth(input->locale(), input->fil es(), style()->font(), maxFilenameWidth());
225 } 225 }
226 226
227 } // namespace WebCore 227 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderFieldset.cpp ('k') | Source/core/rendering/RenderImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698