Changeset 25562 in webkit


Ignore:
Timestamp:
Sep 14, 2007 8:38:58 AM (17 years ago)
Author:
darin
Message:

WebCore:

Reviewed by Mitz and Kevin Decker.

Test: fast/forms/textarea-rows-cols.html

  • html/HTMLTextAreaElement.cpp: (WebCore::HTMLTextAreaElement::HTMLTextAreaElement): Use constants for the default number of rows and columns. (WebCore::HTMLTextAreaElement::parseMappedAttribute): If rows/cols attribute has a value that's missing, non-numeric, or zero, then use the default value. Also check for the case where the effective value of the attribute isn't changing.

LayoutTests:

Reviewed by Mitz and Kevin Decker.

  • fast/forms/textarea-rows-cols.html: Added.
  • platform/mac/fast/forms/textarea-rows-cols-expected.checksum: Added.
  • platform/mac/fast/forms/textarea-rows-cols-expected.png: Added.
  • platform/mac/fast/forms/textarea-rows-cols-expected.txt: Added.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r25547 r25562  
     12007-09-14  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by Mitz and Kevin Decker.
     4
     5        - test for http://bugs.webkit.org/show_bug.cgi?id=15197
     6          <rdar://problem/5478271> REGRESSION: Some Yahoo text entry fields
     7          render as lines rather than text entry boxes
     8
     9        * fast/forms/textarea-rows-cols.html: Added.
     10        * platform/mac/fast/forms/textarea-rows-cols-expected.checksum: Added.
     11        * platform/mac/fast/forms/textarea-rows-cols-expected.png: Added.
     12        * platform/mac/fast/forms/textarea-rows-cols-expected.txt: Added.
     13
    1142007-09-13  Darin Adler  <darin@apple.com>
    215
  • trunk/WebCore/ChangeLog

    r25561 r25562  
     12007-09-14  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by Mitz and Kevin Decker.
     4
     5        - fix http://bugs.webkit.org/show_bug.cgi?id=15197
     6          <rdar://problem/5478271> REGRESSION: Some Yahoo text entry fields
     7          render as lines rather than text entry boxes
     8
     9        Test: fast/forms/textarea-rows-cols.html
     10
     11        * html/HTMLTextAreaElement.cpp:
     12        (WebCore::HTMLTextAreaElement::HTMLTextAreaElement): Use constants for the default number
     13        of rows and columns.
     14        (WebCore::HTMLTextAreaElement::parseMappedAttribute): If rows/cols attribute has a value
     15        that's missing, non-numeric, or zero, then use the default value. Also check for the
     16        case where the effective value of the attribute isn't changing.
     17
    1182007-09-14  Sven Herzberg  <sven@imendio.com>
    219
  • trunk/WebCore/html/HTMLTextAreaElement.cpp

    r25345 r25562  
    4545using namespace HTMLNames;
    4646
    47 HTMLTextAreaElement::HTMLTextAreaElement(Document *doc, HTMLFormElement *f)
     47static const int defaultRows = 2;
     48static const int defaultCols = 20;
     49
     50HTMLTextAreaElement::HTMLTextAreaElement(Document* doc, HTMLFormElement* f)
    4851    : HTMLFormControlElementWithState(textareaTag, doc, f)
    49     , m_rows(2)
    50     , m_cols(20)
     52    , m_rows(defaultRows)
     53    , m_cols(defaultCols)
    5154    , m_wrap(ta_Virtual)
    5255    , cachedSelStart(-1)
     
    125128{
    126129    if (attr->name() == rowsAttr) {
    127         m_rows = !attr->isNull() ? attr->value().toInt() : 3;
    128         if (renderer())
    129             renderer()->setNeedsLayoutAndPrefWidthsRecalc();
     130        int rows = attr->value().toInt();
     131        if (rows <= 0)
     132            rows = defaultRows;
     133        if (m_rows != rows) {
     134            m_rows = rows;
     135            if (renderer())
     136                renderer()->setNeedsLayoutAndPrefWidthsRecalc();
     137        }
    130138    } else if (attr->name() == colsAttr) {
    131         m_cols = !attr->isNull() ? attr->value().toInt() : 60;
    132         if (renderer())
    133             renderer()->setNeedsLayoutAndPrefWidthsRecalc();
     139        int cols = attr->value().toInt();
     140        if (cols <= 0)
     141            cols = defaultCols;
     142        if (m_cols != cols) {
     143            m_cols = cols;
     144            if (renderer())
     145                renderer()->setNeedsLayoutAndPrefWidthsRecalc();
     146        }
    134147    } else if (attr->name() == wrapAttr) {
    135148        // virtual / physical is Netscape extension of HTML 3.0, now deprecated
Note: See TracChangeset for help on using the changeset viewer.