[webkit-reviews] review denied: [Bug 68684] spec change - option.label should be reflected like option.value : [Attachment 108454] Spec change handling

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 27 01:39:57 PDT 2011


Kent Tamura <tkent at chromium.org> has denied Sachin Puranik
<jcqt43 at motorola.com>'s request for review:
Bug 68684: spec change - option.label should be reflected like option.value
https://bugs.webkit.org/show_bug.cgi?id=68684

Attachment 108454: Spec change handling
https://bugs.webkit.org/attachment.cgi?id=108454&action=review

------- Additional Comments from Kent Tamura <tkent at chromium.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=108454&action=review


> Source/WebCore/dom/OptionElement.cpp:136
> +String OptionElement::collectOptionLabel(const OptionElementData& data,
const Element* element)
> +{
> +    String label = data.label();
> +    if (!label.isNull())
> +	   return label;
> +
> +    // Use the text if the Label wasn't set.
> +    return collectOptionInnerText(element).stripWhiteSpace();
> +}

I don't think we need to introduce collectOptionLabel(). Making
collectOptionInnerText() "protected" is enough.
Also, why do you call stripWhiteSpace()?

> LayoutTests/fast/forms/option-value-and-label.html:27
> -shouldBe('o1.label', '""');
> +shouldBe('o1.label', '"text"');
>  
>  var o2 = document.getElementById('o2');
>  shouldBe('o2.value', '"value"');
> -shouldBe('o2.label', '""');
> +shouldBe('o2.label', '"text"');

We need more test cases:
 - updating HTMLOptionElement::label
 - getting label when HTMLOptionElement::textContent has leading/trailing
whitespaces


More information about the webkit-reviews mailing list