Changeset 115783 in webkit
- Timestamp:
- May 1, 2012 8:01:29 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r115782 r115783 1 2012-05-01 Kent Tamura <tkent@chromium.org> 2 3 Calendar Picker: Too wide in Japanese locale 4 https://bugs.webkit.org/show_bug.cgi?id=85331 5 6 Reviewed by Kentaro Hara. 7 8 No new tests. This is a locale-specific behavior. 9 10 * Resources/calendarPicker.js: 11 (formatJapaneseImperialEra): 12 Do not show an imperial era later than 平成99年 to avoid very long 13 year string like "275760年(平成273772年)." 14 (YearMonthController.prototype.attachTo): 15 - Respect the maximum year specfied by <input max=...> 16 If <input max="9999-12-31"> is specified, we don't need to 17 secure space for the year 275,760. 18 - Check the width for 平成99年 as well as the maximum year because 19 "2087年(平成99年)" is usually wider than "275760年". 20 1 21 2012-05-01 Noel Gordon <noel.gordon@gmail.com> 2 22 -
trunk/Source/WebCore/Resources/calendarPicker.js
r115276 r115783 123 123 } 124 124 125 /* 126 * @const 127 * @type {number} 128 */ 129 var ImperialEraLimit = 2087; 130 125 131 /** 126 132 * @param {!number} year … … 129 135 */ 130 136 function formatJapaneseImperialEra(year, month) { 137 // We don't show an imperial era if it is greater than 99 becase of space 138 // limitation. 139 if (year > ImperialEraLimit) 140 return ""; 131 141 if (year > 1989) 132 142 return "(平成" + (year - 1988) + "年)"; … … 427 437 main.appendChild(this._wall); 428 438 429 // The maximum year which <input type=date> supports is 275,760. 430 // See WebCore/platform/DateComponents.h 431 var MaximumYear = 275760; 439 var maximumYear = global.maximumDate.getUTCFullYear(); 432 440 var maxWidth = 0; 433 441 for (var m = 0; m < 12; ++m) { 434 this._month.textContent = formatYearMonth( MaximumYear, m);442 this._month.textContent = formatYearMonth(maximumYear, m); 435 443 maxWidth = Math.max(maxWidth, this._month.offsetWidth); 444 } 445 if (getLanguage() == "ja" && ImperialEraLimit < maximumYear) { 446 for (var m = 0; m < 12; ++m) { 447 this._month.textContent = formatYearMonth(ImperialEraLimit, m); 448 maxWidth = Math.max(maxWidth, this._month.offsetWidth); 449 } 436 450 } 437 451 this._month.style.minWidth = maxWidth + 'px';
Note: See TracChangeset
for help on using the changeset viewer.