| Index: third_party/WebKit/Source/core/paint/FileUploadControlPainter.cpp
|
| diff --git a/third_party/WebKit/Source/core/paint/FileUploadControlPainter.cpp b/third_party/WebKit/Source/core/paint/FileUploadControlPainter.cpp
|
| index 8a48617b394da08b4b5996185b99331bc6cdfc5c..0dab0a98e6e9b13c5b7ef5ea3e4f39431f219dbb 100644
|
| --- a/third_party/WebKit/Source/core/paint/FileUploadControlPainter.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/FileUploadControlPainter.cpp
|
| @@ -83,13 +83,15 @@ void FileUploadControlPainter::paintObject(const PaintInfo& paintInfo,
|
| textY = LayoutUnit(m_layoutFileUploadControl.baselinePosition(
|
| AlphabeticBaseline, true, HorizontalLine, PositionOnContainingLine));
|
| TextRunPaintInfo textRunPaintInfo(textRun);
|
| +
|
| + const SimpleFontData* fontData =
|
| + m_layoutFileUploadControl.style()->font().primaryFont();
|
| + if (!fontData)
|
| + return;
|
| // FIXME: Shouldn't these offsets be rounded? crbug.com/350474
|
| textRunPaintInfo.bounds = FloatRect(
|
| - textX.toFloat(),
|
| - textY.toFloat() -
|
| - m_layoutFileUploadControl.style()->getFontMetrics().ascent(),
|
| - textWidth,
|
| - m_layoutFileUploadControl.style()->getFontMetrics().height());
|
| + textX.toFloat(), textY.toFloat() - fontData->getFontMetrics().ascent(),
|
| + textWidth, fontData->getFontMetrics().height());
|
|
|
| // Draw the filename.
|
| LayoutObjectDrawingRecorder recorder(
|
|
|