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

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

Issue 351213002: Change RenderObject::style(bool) to accept an enum instead (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Renamed enum to OwnOrFirstLineStyle, rebased and got rid of duplicate state on the stack in RootInl… Created 6 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
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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 LayoutUnit textX; 118 LayoutUnit textX;
119 if (style()->isLeftToRightDirection()) 119 if (style()->isLeftToRightDirection())
120 textX = contentLeft + buttonAndSpacingWidth; 120 textX = contentLeft + buttonAndSpacingWidth;
121 else 121 else
122 textX = contentLeft + contentWidth() - buttonAndSpacingWidth - textW idth; 122 textX = contentLeft + contentWidth() - buttonAndSpacingWidth - textW idth;
123 123
124 LayoutUnit textY = 0; 124 LayoutUnit textY = 0;
125 // We want to match the button's baseline 125 // We want to match the button's baseline
126 // FIXME: Make this work with transforms. 126 // FIXME: Make this work with transforms.
127 if (RenderButton* buttonRenderer = toRenderButton(button->renderer())) 127 if (RenderButton* buttonRenderer = toRenderButton(button->renderer()))
128 textY = paintOffset.y() + borderTop() + paddingTop() + buttonRendere r->baselinePosition(AlphabeticBaseline, true, HorizontalLine, PositionOnContaini ngLine); 128 textY = paintOffset.y() + borderTop() + paddingTop() + buttonRendere r->baselinePosition(AlphabeticBaseline, FirstLineStyle, HorizontalLine, Position OnContainingLine);
129 else 129 else
130 textY = baselinePosition(AlphabeticBaseline, true, HorizontalLine, P ositionOnContainingLine); 130 textY = baselinePosition(AlphabeticBaseline, FirstLineStyle, Horizon talLine, PositionOnContainingLine);
131 TextRunPaintInfo textRunPaintInfo(textRun); 131 TextRunPaintInfo textRunPaintInfo(textRun);
132 // FIXME: Shouldn't these offsets be rounded? crbug.com/350474 132 // FIXME: Shouldn't these offsets be rounded? crbug.com/350474
133 textRunPaintInfo.bounds = FloatRect(textX.toFloat(), textY.toFloat() - s tyle()->fontMetrics().ascent(), 133 textRunPaintInfo.bounds = FloatRect(textX.toFloat(), textY.toFloat() - s tyle()->fontMetrics().ascent(),
134 textWidth, style()->fontMetrics().height()); 134 textWidth, style()->fontMetrics().height());
135 135
136 paintInfo.context->setFillColor(resolveColor(CSSPropertyColor)); 136 paintInfo.context->setFillColor(resolveColor(CSSPropertyColor));
137 137
138 // Draw the filename 138 // Draw the filename
139 paintInfo.context->drawBidiText(font, textRunPaintInfo, IntPoint(roundTo Int(textX), roundToInt(textY))); 139 paintInfo.context->drawBidiText(font, textRunPaintInfo, IntPoint(roundTo Int(textX), roundToInt(textY)));
140 } 140 }
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 } 217 }
218 218
219 String RenderFileUploadControl::fileTextValue() const 219 String RenderFileUploadControl::fileTextValue() const
220 { 220 {
221 HTMLInputElement* input = toHTMLInputElement(node()); 221 HTMLInputElement* input = toHTMLInputElement(node());
222 ASSERT(input->files()); 222 ASSERT(input->files());
223 return RenderTheme::theme().fileListNameForWidth(input->locale(), input->fil es(), style()->font(), maxFilenameWidth()); 223 return RenderTheme::theme().fileListNameForWidth(input->locale(), input->fil es(), style()->font(), maxFilenameWidth());
224 } 224 }
225 225
226 } // namespace WebCore 226 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderDeprecatedFlexibleBox.cpp ('k') | Source/core/rendering/RenderFlexibleBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698