Changeset 130716 in webkit


Ignore:
Timestamp:
Oct 8, 2012 7:18:20 PM (12 years ago)
Author:
tkent@chromium.org
Message:

Take account of overflowing values for width calculation of a year sub-field
https://bugs.webkit.org/show_bug.cgi?id=98506

Reviewed by Eric Seidel.

Source/WebCore:

When we decide the width of a year field of an input[type=date]
with the multiple fields UI, we need to take account of the
current value width because we allow to set overflowing values to
the input[type=date].

This change affects only platforms with INPUT_TYPE_DATE &&
INPUT_MULTIPLE_FIELDS_UI.

Test: fast/forms/date-multiple-fields/date-multiple-fields-change-layout-by-value.html

  • html/shadow/DateTimeNumericFieldElement.cpp:

(WebCore::DateTimeNumericFieldElement::customStyleForRenderer):
Take account of the current value width.

LayoutTests:

  • fast/forms/date-multiple-fields/date-multiple-fields-change-layout-by-value-expected.txt: Added.
  • fast/forms/date-multiple-fields/date-multiple-fields-change-layout-by-value.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r130714 r130716  
     12012-10-08  Kent Tamura  <tkent@chromium.org>
     2
     3        Take account of overflowing values for width calculation of a year sub-field
     4        https://bugs.webkit.org/show_bug.cgi?id=98506
     5
     6        Reviewed by Eric Seidel.
     7
     8        * fast/forms/date-multiple-fields/date-multiple-fields-change-layout-by-value-expected.txt: Added.
     9        * fast/forms/date-multiple-fields/date-multiple-fields-change-layout-by-value.html: Added.
     10
    1112012-10-08  Tony Chang  <tony@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r130714 r130716  
     12012-10-08  Kent Tamura  <tkent@chromium.org>
     2
     3        Take account of overflowing values for width calculation of a year sub-field
     4        https://bugs.webkit.org/show_bug.cgi?id=98506
     5
     6        Reviewed by Eric Seidel.
     7
     8        When we decide the width of a year field of an input[type=date]
     9        with the multiple fields UI, we need to take account of the
     10        current value width because we allow to set overflowing values to
     11        the input[type=date].
     12
     13        This change affects only platforms with INPUT_TYPE_DATE &&
     14        INPUT_MULTIPLE_FIELDS_UI.
     15
     16        Test: fast/forms/date-multiple-fields/date-multiple-fields-change-layout-by-value.html
     17
     18        * html/shadow/DateTimeNumericFieldElement.cpp:
     19        (WebCore::DateTimeNumericFieldElement::customStyleForRenderer):
     20        Take account of the current value width.
     21
    1222012-10-08  Tony Chang  <tony@chromium.org>
    223
  • trunk/Source/WebCore/html/shadow/DateTimeNumericFieldElement.cpp

    r130477 r130716  
    8282    float maxiumWidth = style->font().width(m_placeholder);
    8383    maxiumWidth = std::max(maxiumWidth, style->font().width(formatValue(maximum())));
     84    maxiumWidth = std::max(maxiumWidth, style->font().width(value()));
    8485    style->setWidth(Length(maxiumWidth, Fixed));
    8586    return style.release();
Note: See TracChangeset for help on using the changeset viewer.