Changeset 97741 in webkit


Ignore:
Timestamp:
Oct 18, 2011 5:39:11 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

Option.value should trim extra internal html spaces
https://bugs.webkit.org/show_bug.cgi?id=69455

Patch by Sachin Puranik <jcqt43@motorola.com> on 2011-10-18
Reviewed by Kent Tamura.

Currently option.value does not trim the internal white space as suggested by spec. This patch implements the same.

Source/WebCore:

Test: fast/forms/option-value-trim-html-spaces.html

  • dom/OptionElement.cpp: Removed a function as this implementation is moved to the HTMLOptionElement.cpp file.
  • html/HTMLOptionElement.cpp:

(WebCore::HTMLOptionElement::value): Implementation of .value function which will now trim the html white spaces.

LayoutTests:

  • fast/forms/option-value-trim-html-spaces-expected.txt: Test case to test the text triming on the value attribute.
  • fast/forms/option-value-trim-html-spaces.html: Test case to test the text triming on the value attribute.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r97738 r97741  
     12011-10-18  Sachin Puranik  <jcqt43@motorola.com>
     2
     3        Option.value should trim extra internal html spaces
     4        https://bugs.webkit.org/show_bug.cgi?id=69455
     5
     6        Reviewed by Kent Tamura.
     7
     8        Currently option.value does not trim the internal white space as suggested by spec. This patch implements the same.
     9
     10        * fast/forms/option-value-trim-html-spaces-expected.txt: Test case to test the text triming on the value attribute.
     11        * fast/forms/option-value-trim-html-spaces.html: Test case to test the text triming on the value attribute.
     12
    1132011-10-18  Mihnea Ovidenie  <mihnea@adobe.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r97738 r97741  
     12011-10-18  Sachin Puranik  <jcqt43@motorola.com>
     2
     3        Option.value should trim extra internal html spaces
     4        https://bugs.webkit.org/show_bug.cgi?id=69455
     5
     6        Reviewed by Kent Tamura.
     7
     8        Currently option.value does not trim the internal white space as suggested by spec. This patch implements the same.
     9
     10        Test: fast/forms/option-value-trim-html-spaces.html
     11
     12        * dom/OptionElement.cpp: Removed a function as this implementation is moved to the HTMLOptionElement.cpp file.
     13        * html/HTMLOptionElement.cpp:
     14        (WebCore::HTMLOptionElement::value): Implementation of .value function which will now trim the html white spaces.
     15
    1162011-10-18  Mihnea Ovidenie  <mihnea@adobe.com>
    217
  • trunk/Source/WebCore/dom/OptionElement.cpp

    r97720 r97741  
    118118}
    119119
    120 String OptionElement::collectOptionValue(const OptionElementData& data, const Element* element)
    121 {
    122     String value = data.value();
    123     if (!value.isNull())
    124         return value;
    125 
    126     // Use the text if the value wasn't set.
    127     return collectOptionInnerText(element).stripWhiteSpace();
    128 }
    129 
    130120// OptionElementData
    131121OptionElementData::OptionElementData()
  • trunk/Source/WebCore/html/HTMLOptionElement.cpp

    r97533 r97741  
    156156String HTMLOptionElement::value() const
    157157{
    158     return OptionElement::collectOptionValue(m_data, this);
     158    if (!m_data.value().isNull())
     159        return m_data.value();
     160
     161    return collectOptionInnerText(this).stripWhiteSpace(isHTMLSpace).simplifyWhiteSpace(isHTMLSpace);
     162
    159163}
    160164
Note: See TracChangeset for help on using the changeset viewer.