Changeset 13688 in webkit


Ignore:
Timestamp:
Apr 4, 2006 3:23:01 PM (18 years ago)
Author:
adele
Message:

LayoutTests:

  • Test for:

http://bugzilla.opendarwin.org/show_bug.cgi?id=8092
REGRESSION (NativeTextField): table contents misaligned in Netflix queue

http://bugzilla.opendarwin.org/show_bug.cgi?id=8141
REGRESSION: Native text field fails to wrap inside table

http://bugzilla.opendarwin.org/show_bug.cgi?id=8072
REGRESSION: text fields at connect.apple.com spill out of the containing box

  • fast/forms/input-table-expected.checksum: Added.
  • fast/forms/input-table-expected.png: Added.
  • fast/forms/input-table-expected.txt: Added.
  • fast/forms/input-table.html: Added.

WebCore:

Reviewed by Hyatt.

http://bugzilla.opendarwin.org/show_bug.cgi?id=8141
REGRESSION: Native text field fails to wrap inside table

http://bugzilla.opendarwin.org/show_bug.cgi?id=8072
REGRESSION: text fields at connect.apple.com spill out of the containing box

Test: fast/forms/input-table.html

Rewrote calcMinMaxWidth for text fields so it considers width,
min-width, and max-width settings as well as the size attribute.

  • rendering/RenderTextField.cpp: (WebCore::RenderTextField::calcMinMaxWidth):
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r13685 r13688  
     12006-04-04  Adele Peterson  <adele@apple.com>
     2
     3         - Test for:
     4        http://bugzilla.opendarwin.org/show_bug.cgi?id=8092
     5        REGRESSION (NativeTextField): table contents misaligned in Netflix queue
     6
     7        http://bugzilla.opendarwin.org/show_bug.cgi?id=8141
     8        REGRESSION: Native text field fails to wrap inside table
     9
     10        http://bugzilla.opendarwin.org/show_bug.cgi?id=8072
     11        REGRESSION: text fields at connect.apple.com spill out of the containing box
     12
     13        * fast/forms/input-table-expected.checksum: Added.
     14        * fast/forms/input-table-expected.png: Added.
     15        * fast/forms/input-table-expected.txt: Added.
     16        * fast/forms/input-table.html: Added.
     17
    1182006-04-04  Justin Garcia  <justin.garcia@apple.com>
    219
  • trunk/WebCore/ChangeLog

    r13687 r13688  
     12006-04-04  Adele Peterson  <adele@apple.com>
     2
     3        Reviewed by Hyatt.
     4
     5        - Fix for:
     6        http://bugzilla.opendarwin.org/show_bug.cgi?id=8092
     7        REGRESSION (NativeTextField): table contents misaligned in Netflix queue
     8
     9        http://bugzilla.opendarwin.org/show_bug.cgi?id=8141
     10        REGRESSION: Native text field fails to wrap inside table
     11
     12        http://bugzilla.opendarwin.org/show_bug.cgi?id=8072
     13        REGRESSION: text fields at connect.apple.com spill out of the containing box
     14
     15        Test: fast/forms/input-table.html
     16
     17        Rewrote calcMinMaxWidth for text fields so it considers width,
     18        min-width, and max-width settings as well as the size attribute.
     19
     20        * rendering/RenderTextField.cpp: (WebCore::RenderTextField::calcMinMaxWidth):
     21
    1222006-04-04  Beth Dakin  <bdakin@apple.com>
    223
  • trunk/WebCore/rendering/RenderTextField.cpp

    r13666 r13688  
    216216void RenderTextField::calcMinMaxWidth()
    217217{
    218     // Figure out how big a text field needs to be for a given number of characters
    219     // (using "0" as the nominal character).
    220     int size = static_cast<HTMLInputElement*>(element())->size();
    221     if (size <= 0)
    222         size = 20;
    223    
    224     QChar ch[1];
    225     ch[0] = '0';
    226     m_minWidth = m_maxWidth = (int)ceilf(style()->font().floatWidth(ch, 1, 0, 1, 0, 0) * size) + paddingLeft() + paddingRight() +
    227                 borderLeft() + borderRight() + m_div->renderer()->paddingLeft() + m_div->renderer()->paddingRight();
    228     setMinMaxKnown();
     218    m_minWidth = 0;
     219    m_maxWidth = 0;
     220
     221    if (style()->width().isFixed() && style()->width().value() > 0)
     222        m_minWidth = m_maxWidth = calcContentBoxWidth(style()->width().value());
     223    else {
     224        // Figure out how big a text field needs to be for a given number of characters
     225        // (using "0" as the nominal character).
     226        int size = static_cast<HTMLInputElement*>(element())->size();
     227        if (size <= 0)
     228            size = 20;
     229
     230        QChar ch[1];
     231        ch[0] = '0';
     232        int sizeWidth = (int)ceilf(style()->font().floatWidth(ch, 1, 0, 1, 0, 0) * size);
     233        m_maxWidth = sizeWidth;
     234    }
     235   
     236    if (style()->minWidth().isFixed() && style()->minWidth().value() > 0) {
     237        m_maxWidth = max(m_maxWidth, calcContentBoxWidth(style()->minWidth().value()));
     238        m_minWidth = max(m_minWidth, calcContentBoxWidth(style()->minWidth().value()));
     239    } else
     240        m_minWidth = m_maxWidth;
     241   
     242    if (style()->maxWidth().isFixed() && style()->maxWidth().value() != undefinedLength) {
     243        m_maxWidth = min(m_maxWidth, calcContentBoxWidth(style()->maxWidth().value()));
     244        m_minWidth = min(m_minWidth, calcContentBoxWidth(style()->maxWidth().value()));
     245    }
     246
     247    int toAdd = paddingLeft() + paddingRight() + borderLeft() + borderRight() + m_div->renderer()->paddingLeft() + m_div->renderer()->paddingRight();
     248    m_minWidth += toAdd;
     249    m_maxWidth += toAdd;
     250
     251    setMinMaxKnown();   
    229252}
    230253
Note: See TracChangeset for help on using the changeset viewer.