WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
32366
HTML input file control "No File Selected" needs more room in some languages
https://bugs.webkit.org/show_bug.cgi?id=32366
Summary
HTML input file control "No File Selected" needs more room in some languages
Nils Jeisecke
Reported
2009-12-10 01:15:06 PST
Created
attachment 44600
[details]
Screenshot with german locale It simply too small, please see screenshot.
Attachments
Screenshot with german locale
(2.97 KB, image/png)
2009-12-10 01:15 PST
,
Nils Jeisecke
no flags
Details
Screenshot of Qt Demobrowser
(57.64 KB, image/png)
2010-03-17 03:36 PDT
,
Nils Jeisecke
no flags
Details
Patch
(10.73 KB, patch)
2012-02-18 00:22 PST
,
Jon Lee
hyatt
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Nils Jeisecke
Comment 1
2009-12-21 05:11:31 PST
Apple's Safari shows a shorter string: "Keine Datei ausgewählt". Maybe changing the german localisation in qt_de.ts is the easiest fix.
Tor Arne Vestbø
Comment 2
2010-03-05 09:39:35 PST
Please follow the QtWebKit bug reporting guidelines when reporting bugs. See
http://trac.webkit.org/wiki/QtWebKitBugs
Specifically: - The 'QtWebKit' component should be used for bugs/features in the public QtWebKit API layer, not to signify that the bug is specific to the Qt port of WebKit
http://trac.webkit.org/wiki/QtWebKitBugs#Component
Robert Hogan
Comment 3
2010-03-16 11:18:02 PDT
Hi Nils - which browser are you seeing this in exactly? You haven't provided enough information to reproduce this bug so I have to close as INVALID for now. (I suspect it's not even a webkit bug as the screenshot looks like a dialog from a specific browser.)
Nils Jeisecke
Comment 4
2010-03-17 02:16:57 PDT
Hi Robert, this problem is specific to QtWebKit. Best regards Nils
Robert Hogan
Comment 5
2010-03-17 03:07:46 PDT
(In reply to
comment #4
)
> Hi Robert, > > this problem is specific to QtWebKit. > > Best regards > > Nils
Can you provide a full screenshot of the problem. Is the affected text in a webpage or in a dialog box?
Nils Jeisecke
Comment 6
2010-03-17 03:36:13 PDT
Created
attachment 50891
[details]
Screenshot of Qt Demobrowser This screenshot shows a typical use of an upload form (input type="file") as rendered by Qt Webkit.
Robert Hogan
Comment 7
2010-03-17 04:17:38 PDT
Perfect, get you now. In FileChooserQt.cpp: String FileChooser::basenameForWidth(const Font& f, int width) const { if (width <= 0) return String(); String string; if (m_filenames.isEmpty()) string = fileButtonNoFileSelectedLabel(); else if (m_filenames.size() == 1) { String fname = m_filenames[0]; QFontMetrics fm(f.font()); string = fm.elidedText(fname, Qt::ElideLeft, width); } else { int n = m_filenames.size(); string = QCoreApplication::translate("QWebPage", "%n file(s)", "number of chosen file", QCoreApplication::CodecForTr, n); } return string; } is not checking that the width of the localized string is equal to or less than the width of the file input element. I haven't reproduced this directly but it definitely looks like a bug.
Robert Hogan
Comment 8
2010-03-17 04:18:36 PDT
Trying to change this to NEW!
Jon Lee
Comment 9
2012-02-17 11:25:18 PST
This is an issue for not just German, and in some cases it's impossible to come up with a shorter translation. <
rdar://problem/4481028
>
Jon Lee
Comment 10
2012-02-17 23:49:08 PST
Changing title to reflect language-agnostic nature of bug :)
Jon Lee
Comment 11
2012-02-18 00:22:02 PST
Created
attachment 127697
[details]
Patch
mitz
Comment 12
2012-02-20 09:31:34 PST
Comment on
attachment 127697
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=127697&action=review
The code change looks fine, but how do we know that this doesn’t break the layout of existing websites? Also, is there precedent for the user’s preferred UI language affecting the layout of webpages? (To answer my own question: yes, the default line-breaking behavior depends on the user’s preferred UI language; but it is not something authors can rely on anyway).
> Source/WebCore/rendering/RenderFileUploadControl.cpp:189 > + m_maxPreferredLogicalWidth = (int)ceilf(max(minDefaultLabelWidth, defaultLabelWidth));
Please change this to a static_cast<int> if it’s even necessary.
Dave Hyatt
Comment 13
2012-02-20 13:26:22 PST
Comment on
attachment 127697
[details]
Patch r=me
Jon Lee
Comment 14
2012-02-20 13:55:56 PST
http://trac.webkit.org/changeset/108261
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug