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

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

Issue 19697011: Change rendering code to use RenderObject::resolveColor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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/RenderFrameSet.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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 if (RenderButton* buttonRenderer = toRenderButton(button->renderer())) 142 if (RenderButton* buttonRenderer = toRenderButton(button->renderer()))
143 textY = paintOffset.y() + borderTop() + paddingTop() + buttonRendere r->baselinePosition(AlphabeticBaseline, true, HorizontalLine, PositionOnContaini ngLine); 143 textY = paintOffset.y() + borderTop() + paddingTop() + buttonRendere r->baselinePosition(AlphabeticBaseline, true, HorizontalLine, PositionOnContaini ngLine);
144 else 144 else
145 textY = baselinePosition(AlphabeticBaseline, true, HorizontalLine, P ositionOnContainingLine); 145 textY = baselinePosition(AlphabeticBaseline, true, HorizontalLine, P ositionOnContainingLine);
146 TextRunPaintInfo textRunPaintInfo(textRun); 146 TextRunPaintInfo textRunPaintInfo(textRun);
147 textRunPaintInfo.bounds = FloatRect(textX, 147 textRunPaintInfo.bounds = FloatRect(textX,
148 textY - style()->fontMetrics().ascen t(), 148 textY - style()->fontMetrics().ascen t(),
149 textWidth, 149 textWidth,
150 style()->fontMetrics().height()); 150 style()->fontMetrics().height());
151 151
152 paintInfo.context->setFillColor(style()->visitedDependentColor(CSSProper tyColor)); 152 paintInfo.context->setFillColor(resolveColor(CSSPropertyColor));
153 153
154 // Draw the filename 154 // Draw the filename
155 paintInfo.context->drawBidiText(font, textRunPaintInfo, IntPoint(roundTo Int(textX), roundToInt(textY))); 155 paintInfo.context->drawBidiText(font, textRunPaintInfo, IntPoint(roundTo Int(textX), roundToInt(textY)));
156 156
157 if (input->icon()) { 157 if (input->icon()) {
158 // Determine where the icon should be placed 158 // Determine where the icon should be placed
159 LayoutUnit iconY = paintOffset.y() + borderTop() + paddingTop() + (c ontentHeight() - iconHeight) / 2; 159 LayoutUnit iconY = paintOffset.y() + borderTop() + paddingTop() + (c ontentHeight() - iconHeight) / 2;
160 LayoutUnit iconX; 160 LayoutUnit iconX;
161 if (style()->isLeftToRightDirection()) 161 if (style()->isLeftToRightDirection())
162 iconX = contentLeft + buttonWidth + afterButtonSpacing; 162 iconX = contentLeft + buttonWidth + afterButtonSpacing;
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 } 247 }
248 248
249 String RenderFileUploadControl::fileTextValue() const 249 String RenderFileUploadControl::fileTextValue() const
250 { 250 {
251 HTMLInputElement* input = toHTMLInputElement(node()); 251 HTMLInputElement* input = toHTMLInputElement(node());
252 ASSERT(input->files()); 252 ASSERT(input->files());
253 return theme()->fileListNameForWidth(input->files(), style()->font(), maxFil enameWidth(), input->multiple()); 253 return theme()->fileListNameForWidth(input->files(), style()->font(), maxFil enameWidth(), input->multiple());
254 } 254 }
255 255
256 } // namespace WebCore 256 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderFieldset.cpp ('k') | Source/core/rendering/RenderFrameSet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698