Changeset 142198 in webkit


Ignore:
Timestamp:
Feb 7, 2013 4:06:24 PM (11 years ago)
Author:
tkent@chromium.org
Message:

REGRESSION (r140778): Calendar Picker doesn't open when the element has the required attribute
https://bugs.webkit.org/show_bug.cgi?id=109136

Patch by Keishi Hattori <keishi@webkit.org> on 2013-02-07
Reviewed by Kent Tamura.

Source/WebCore:

Calendar picker was using the "Clear" button to calculate the window width.
Since it doesn't exist when the input element has a required attribute,
it was throwing an error. This patch fixes the width calculating logic.

Tests: platform/chromium/fast/forms/calendar-picker/calendar-picker-appearance-required-ar.html

platform/chromium/fast/forms/calendar-picker/calendar-picker-appearance-required.html

  • Resources/pagepopups/calendarPicker.css:

(.today-clear-area):

  • Resources/pagepopups/calendarPicker.js:

(CalendarPicker.prototype.fixWindowSize): Fixing the logic to calculate
the width. We don't want to use clear button because it doesn't exist
when a value is required.

LayoutTests:

  • platform/chromium-mac/platform/chromium/fast/forms/calendar-picker/calendar-picker-appearance-required-ar-expected.png: Added.
  • platform/chromium-mac/platform/chromium/fast/forms/calendar-picker/calendar-picker-appearance-required-expected.png: Added.
  • platform/chromium/fast/forms/calendar-picker/calendar-picker-appearance-required-ar-expected.txt: Added.
  • platform/chromium/fast/forms/calendar-picker/calendar-picker-appearance-required-ar.html: Added.
  • platform/chromium/fast/forms/calendar-picker/calendar-picker-appearance-required-expected.txt: Added.
  • platform/chromium/fast/forms/calendar-picker/calendar-picker-appearance-required.html: Added.
  • platform/chromium/TestExpectations:
Location:
trunk
Files:
6 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r142195 r142198  
     12013-02-07  Keishi Hattori  <keishi@webkit.org>
     2
     3        REGRESSION (r140778): Calendar Picker doesn't open when the element has the required attribute
     4        https://bugs.webkit.org/show_bug.cgi?id=109136
     5
     6        Reviewed by Kent Tamura.
     7
     8        * platform/chromium-mac/platform/chromium/fast/forms/calendar-picker/calendar-picker-appearance-required-ar-expected.png: Added.
     9        * platform/chromium-mac/platform/chromium/fast/forms/calendar-picker/calendar-picker-appearance-required-expected.png: Added.
     10        * platform/chromium/fast/forms/calendar-picker/calendar-picker-appearance-required-ar-expected.txt: Added.
     11        * platform/chromium/fast/forms/calendar-picker/calendar-picker-appearance-required-ar.html: Added.
     12        * platform/chromium/fast/forms/calendar-picker/calendar-picker-appearance-required-expected.txt: Added.
     13        * platform/chromium/fast/forms/calendar-picker/calendar-picker-appearance-required.html: Added.
     14        * platform/chromium/TestExpectations:
     15
    1162013-02-07  Terry Anderson  <tdanderson@chromium.org>
    217
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r142130 r142198  
    42334233webkit.org/b/107508 platform/chromium/fast/forms/calendar-picker/calendar-picker-appearance-step.html [ ImageOnlyFailure Pass ]
    42344234webkit.org/b/107508 platform/chromium/fast/forms/calendar-picker/calendar-picker-appearance.html [ ImageOnlyFailure Pass ]
     4235webkit.org/b/109136 platform/chromium/fast/forms/calendar-picker/calendar-picker-appearance-required.html [ ImageOnlyFailure Pass Missing ]
     4236webkit.org/b/109136 platform/chromium/fast/forms/calendar-picker/calendar-picker-appearance-required-ar.html [ ImageOnlyFailure Pass Missing ]
    42354237
    42364238# Rebaseline after currentPath
  • trunk/Source/WebCore/ChangeLog

    r142195 r142198  
     12013-02-07  Keishi Hattori  <keishi@webkit.org>
     2
     3        REGRESSION (r140778): Calendar Picker doesn't open when the element has the required attribute
     4        https://bugs.webkit.org/show_bug.cgi?id=109136
     5
     6        Reviewed by Kent Tamura.
     7
     8        Calendar picker was using the "Clear" button to calculate the window width.
     9        Since it doesn't exist when the input element has a required attribute,
     10        it was throwing an error. This patch fixes the width calculating logic.
     11
     12        Tests: platform/chromium/fast/forms/calendar-picker/calendar-picker-appearance-required-ar.html
     13               platform/chromium/fast/forms/calendar-picker/calendar-picker-appearance-required.html
     14
     15        * Resources/pagepopups/calendarPicker.css:
     16        (.today-clear-area):
     17        * Resources/pagepopups/calendarPicker.js:
     18        (CalendarPicker.prototype.fixWindowSize): Fixing the logic to calculate
     19        the width. We don't want to use clear button because it doesn't exist
     20        when a value is required.
     21
    1222013-02-07  Terry Anderson  <tdanderson@chromium.org>
    223
  • trunk/Source/WebCore/Resources/pagepopups/calendarPicker.css

    r142130 r142198  
    275275    margin-right: 8px;
    276276}
     277
     278.today-clear-area {
     279    display: inline-block;
     280    /* display: block is added in the JS code. */
     281}
  • trunk/Source/WebCore/Resources/pagepopups/calendarPicker.js

    r142130 r142198  
    761761    var yearMonthRightElement = this._element.getElementsByClassName(ClassNames.YearMonthButtonRight)[0];
    762762    var daysAreaElement = this._element.getElementsByClassName(ClassNames.DaysArea)[0];
    763     var clearButton = this._element.getElementsByClassName(ClassNames.ClearButton)[0];
     763    var todayClearArea = this._element.getElementsByClassName(ClassNames.TodayClearArea)[0];
    764764    var headers = daysAreaElement.getElementsByClassName(ClassNames.DayLabel);
    765765    var maxCellWidth = 0;
     
    780780        yearMonthEnd = startOffset - yearMonthRightElement.offsetLeft;
    781781        daysAreaEnd = startOffset - (daysAreaElement.offsetLeft + daysAreaElement.offsetWidth) + weekColumnWidth + maxCellWidth * 7 + DaysAreaContainerBorder;
    782         todayClearAreaEnd = startOffset - clearButton.offsetLeft;
     782        todayClearAreaEnd = startOffset - todayClearArea.offsetLeft;
    783783    } else {
    784784        yearMonthEnd = yearMonthRightElement.offsetLeft + yearMonthRightElement.offsetWidth;
    785785        daysAreaEnd = daysAreaElement.offsetLeft + weekColumnWidth + maxCellWidth * 7 + DaysAreaContainerBorder;
    786         todayClearAreaEnd = clearButton.offsetLeft + clearButton.offsetWidth;
     786        todayClearAreaEnd = todayClearArea.offsetLeft + todayClearArea.offsetWidth;
    787787    }
    788788    var maxEnd = Math.max(yearMonthEnd, daysAreaEnd, todayClearAreaEnd);
     
    795795    daysAreaElement.style.width = "100%";
    796796    daysAreaElement.style.tableLayout = "fixed";
     797    todayClearArea.style.display = "block";
    797798    this._element.getElementsByClassName(ClassNames.YearMonthUpper)[0].style.display = "-webkit-box";
    798799    this._element.getElementsByClassName(ClassNames.MonthSelectorBox)[0].style.display = "block";
Note: See TracChangeset for help on using the changeset viewer.