Closed
Bug 1208978
Opened 9 years ago
Closed 9 years ago
Firefox select tag bug with Hindi language
Categories
(Core :: Layout: Form Controls, defect)
Tracking
()
RESOLVED
FIXED
mozilla44
Tracking | Status | |
---|---|---|
firefox44 | --- | fixed |
People
(Reporter: alexandrberlin, Assigned: jfkthame)
References
Details
Attachments
(2 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36 Steps to reproduce: Use this code: <select onchange="onChangeLang(this)" class="b-lang__select" style="height: 20px;"> <option label="English" value="en">English</option> <option label="Deutsch" value="de">Deutsch</option> <option label="Français" value="fr">Français</option> <option label="Español" value="es">Español</option> <option label="Italiano" value="it">Italiano</option> <option selected="" label="Русский" value="ru">Русский</option> <option label="Chinese" value="zh">Chinese</option> <option label="Български" value="bg">Български</option> <option label="Ελληνικά" value="el">Ελληνικά</option> <option label="Suomi" value="fi">Suomi</option> <option label="हिंदी" value="hi">हिंदी</option> <option label="日本語" value="ja">日本語</option> <option label="Polski" value="pl">Polski</option> <option label="Português" value="pt">Português</option> <option label="Română" value="ro">Română</option> <option label="Српски" value="sr">Српски</option> <option label="Svenska" value="sv">Svenska</option> <option label="Türkçe" value="tr">Türkçe</option> <option label="Bahasa Indonesia" value="id">Bahasa Indonesia</option><option label="한국어" value="ko">한국어</option><option label="ไทย" value="th">ไทย</option> </select> Actual results: Wrong height of dropdown list, when Hindi language in list. Expected results: Correct height of dropdown list.
Reporter | ||
Updated•9 years ago
|
OS: Unspecified → Mac OS X
Hardware: Unspecified → x86
Updated•9 years ago
|
Component: Untriaged → Layout: Text
Assignee | ||
Comment 1•9 years ago
|
||
Experimenting a bit, I find that this is not specific to Hindi; I can reproduce a similar issue with a list that contains one instance of <option>العربي</option>, followed by 20 copies of <option>English</option>. Moreover, if you have fewer options in the <select> (less than 20), the problem won't occur (even with Hindi present); and if you add several more copies of the Hindi option, so that a vertical scrollbar appears on the list, it won't occur then either. The issue seems to arise when we get a combination of two factors: (a) there are slightly over 20 items in the list (the example above has 21); and (b) one or more of them trigger fallback to a font (such as Devanagari) that has greater default line-height.
Status: UNCONFIRMED → NEW
Component: Layout: Text → Layout: Form Controls
Ever confirmed: true
Assignee | ||
Comment 2•9 years ago
|
||
My guess is that what happens is something like this: when there are more than 20 items in the list, we intend to restrict its height to the height of 20 items and provide a scrollbar to get to the rest. But when some of those items are using different (fallback) fonts, we get the size computation wrong: it looks like we calculate the height needed for 20 items based on the largest line-height of any of the fonts being used, and then we fix the vertical height of the popup to that size; but we still render each item with its font's default height. In this case, that means that most of the items (all except the Hindi one, probably) are occupying less height than we allowed for, and so we have some vertical space left over.
Assignee | ||
Comment 3•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=361748bf4f3a
Assignee | ||
Comment 4•9 years ago
|
||
Attachment #8668340 -
Flags: review?(roc)
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Attachment #8668340 -
Flags: review?(roc) → review+
Assignee | ||
Comment 5•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/e42955baebbd10675a488cc377d3d9a4ef785a24 Bug 1208978 - Limit the size of a potentially-scrollable dropdown list to the actual size of its contents, as our estimate based on row count may be too large if the row heights vary. r=roc
Comment 6•9 years ago
|
||
You have build bustage!
Comment 7•9 years ago
|
||
/builds/slave/m-in-l64-asan-0000000000000000/build/src/layout/forms/nsListControlFrame.cpp:590:22: error: no matching function for call to 'min'
Comment 8•9 years ago
|
||
Backed out in https://hg.mozilla.org/integration/mozilla-inbound/rev/4c2c0eef4d12
Flags: needinfo?(jfkthame)
Assignee | ||
Comment 9•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/67f016207ddeab47ac1341873e6d3c1be389f0f5 Bug 1208978 - Limit the size of a potentially-scrollable dropdown list to the actual size of its contents, as our estimate based on row count may be too large if the row heights vary. r=roc
Assignee | ||
Comment 10•9 years ago
|
||
Argh, silly signed-vs-unsignedness.... sorry! Fixed and relanded.
Flags: needinfo?(jfkthame)
https://hg.mozilla.org/mozilla-central/rev/67f016207dde
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox44:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in
before you can comment on or make changes to this bug.
Description
•