| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |