HTML input file control "No File Selected" needs more room in some languages
authorjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 Feb 2012 21:55:38 +0000 (21:55 +0000)
committerjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 Feb 2012 21:55:38 +0000 (21:55 +0000)
commit84fc124c3763e476534e24d1f7ab502ecaaf0145
treedbf4833fea32aad70352c141b4143a1538d62edc
parent389efb4fabd7f0dbb081dfae514fc32953338ab2
HTML input file control "No File Selected" needs more room in some languages
https://bugs.webkit.org/show_bug.cgi?id=32366
<rdar://problem/4481028>

Reviewed by David Hyatt.

The patch exposes a function to return the "no file(s) selected" label text.

* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::fileListDefaultLabel): Added to expose the text for the label in
file upload controls when nothing has been selected.
(WebCore::RenderTheme::fileListNameForWidth): Refactor to use fileListDefaultLabel().
* rendering/RenderTheme.h: Change fileListNameForWidth() to be a const function.

* rendering/RenderThemeMac.h: Update fileListNameForWidth() to be a const function for
platform implementations.
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::fileListNameForWidth): Refactor to use fileListDefaultLabel().

Update fileListNameForWidth() to be a const function for platform implementations.
* platform/gtk/RenderThemeGtk.h:
* platform/gtk/RenderThemeGtk.cpp:
* platform/qt/RenderThemeQt.h:
* platform/qt/RenderThemeQt.cpp:

* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::computePreferredLogicalWidths): Change the calculation
of the max preferred logical width. Calculate the length of the "no file(s) selected" text,
and include the button and after-button margin. Take the max of that and the original
default width, which was a string of 34 (defaultWidthNumChars) "0"'s, in the case that the
label text is too short.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@108261 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/gtk/RenderThemeGtk.cpp
Source/WebCore/platform/gtk/RenderThemeGtk.h
Source/WebCore/platform/qt/RenderThemeQt.cpp
Source/WebCore/platform/qt/RenderThemeQt.h
Source/WebCore/rendering/RenderFileUploadControl.cpp
Source/WebCore/rendering/RenderFileUploadControl.h
Source/WebCore/rendering/RenderTheme.cpp
Source/WebCore/rendering/RenderTheme.h
Source/WebCore/rendering/RenderThemeMac.h
Source/WebCore/rendering/RenderThemeMac.mm