Changeset 122212 in webkit


Ignore:
Timestamp:
Jul 10, 2012 4:19:37 AM (12 years ago)
Author:
tkent@chromium.org
Message:

RTL calendar picker for <input type=date> is too narrow and clipped
https://bugs.webkit.org/show_bug.cgi?id=90864

Reviewed by Kentaro Hara.

.:

  • ManualTests/forms/calendar-picker.html:
  • Add isRTL:true for the arabic setting
  • Reset the iframe size when the setting is changed.

Source/WebCore:

Tests: ManualTests/forms/calendar-picker.html

  • Resources/calendarPicker.js:

(fixWindowSize):
Checks the left edge of elemenets in RTL.
(layout): Add dir=ltr for the manual test, which re-uses the document.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r122205 r122212  
     12012-07-10  Kent Tamura  <tkent@chromium.org>
     2
     3        RTL calendar picker for <input type=date> is too narrow and clipped
     4        https://bugs.webkit.org/show_bug.cgi?id=90864
     5
     6        Reviewed by Kentaro Hara.
     7
     8        * ManualTests/forms/calendar-picker.html:
     9        - Add isRTL:true for the arabic setting
     10        - Reset the iframe size when the setting is changed.
     11
    1122012-07-10  Sheriff Bot  <webkit.review.bot@gmail.com>
    213
  • trunk/ManualTests/forms/calendar-picker.html

    r118482 r122212  
    5959var arabicArguments = {
    6060    locale: 'ar',
     61    isRTL: true,
    6162    monthLabels : ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو',
    6263                   'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'],
     
    9697
    9798function selected(select) {
     99    var frame = document.getElementsByTagName('iframe')[0];
     100    frame.style.width = '100px';
     101    frame.style.height = '100px';
    98102    switch (select.selectedIndex) {
    99103    case 0:
  • trunk/Source/WebCore/ChangeLog

    r122205 r122212  
     12012-07-10  Kent Tamura  <tkent@chromium.org>
     2
     3        RTL calendar picker for <input type=date> is too narrow and clipped
     4        https://bugs.webkit.org/show_bug.cgi?id=90864
     5
     6        Reviewed by Kentaro Hara.
     7
     8        Tests: ManualTests/forms/calendar-picker.html
     9
     10        * Resources/calendarPicker.js:
     11        (fixWindowSize):
     12        Checks the left edge of elemenets in RTL.
     13        (layout): Add dir=ltr for the manual test, which re-uses the document.
     14
    1152012-07-10  Sheriff Bot  <webkit.review.bot@gmail.com>
    216
  • trunk/Source/WebCore/Resources/calendarPicker.js

    r118482 r122212  
    311311    }
    312312    var DaysAreaContainerBorder = 1;
    313     var maxRight = Math.max(yearMonthRightElement.offsetLeft + yearMonthRightElement.offsetWidth,
    314                             daysAreaElement.offsetLeft + maxCellWidth * 7 + DaysAreaContainerBorder);
     313    var main = $("main");
     314    var yearMonthEnd;
     315    var daysAreaEnd;
     316    if (global.params.isRTL) {
     317        var startOffset = main.offsetLeft + main.offsetWidth;
     318        yearMonthEnd = startOffset - yearMonthRightElement.offsetLeft;
     319        daysAreaEnd = startOffset - (daysAreaElement.offsetLeft + daysAreaElement.offsetWidth) + maxCellWidth * 7 + DaysAreaContainerBorder;
     320    } else {
     321        yearMonthEnd = yearMonthRightElement.offsetLeft + yearMonthRightElement.offsetWidth;
     322        daysAreaEnd = daysAreaElement.offsetLeft + maxCellWidth * 7 + DaysAreaContainerBorder;
     323    }
     324
     325    var maxEnd = Math.max(yearMonthEnd, daysAreaEnd);
    315326    var MainPadding = 6;
    316327    var MainBorder = 1;
    317     var desiredBodyWidth = maxRight + MainPadding + MainBorder;
    318 
    319     var main = $("main");
     328    var desiredBodyWidth = maxEnd + MainPadding + MainBorder;
     329
    320330    var mainHeight = main.offsetHeight;
    321331    main.style.width = "auto";
     
    356366    if (global.params.isRTL)
    357367        document.body.dir = "rtl";
     368    else
     369        document.body.dir = "ltr";
    358370    var main = $("main");
    359371    var params = global.params;
Note: See TracChangeset for help on using the changeset viewer.