Label of an <option> element should not be displayed in quirks mode
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Mar 2017 22:24:19 +0000 (22:24 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Mar 2017 22:24:19 +0000 (22:24 +0000)
commitf3bad4200f2b115d26e42be6c527082af9f40996
tree3337e1777eb70716cf6565b42fdda95a85616e72
parent87259bcecb480f33812be0c1ccf172f7df89a983
Label of an <option> element should not be displayed in quirks mode
https://bugs.webkit.org/show_bug.cgi?id=169296
<rdar://problem/30900751>

Reviewed by Simon Fraser.

Source/WebCore:

Label of an <option> element should not be displayed in quirks mode, to
match Chrome and Firefox. However, we should still display the label in
strict mode, as per the HTML specification:
- https://html.spec.whatwg.org/multipage/rendering.html#the-select-element-2

Chrome renders the label in strict mode, same as us. Firefox does not:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1345242

Tests: fast/dom/HTMLOptionElement/option-label-quirksmode.html
       fast/dom/HTMLOptionElement/option-label-quirksmode2.html
       fast/dom/HTMLOptionElement/option-label-strictmode.html

* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::displayLabel):
(WebCore::HTMLOptionElement::textIndentedToRespectGroupLabel):
* html/HTMLOptionElement.h:

LayoutTests:

Add layout test coverage.

* fast/dom/HTMLOptionElement/option-label-quirksmode-expected.html: Added.
* fast/dom/HTMLOptionElement/option-label-quirksmode.html: Added.
* fast/dom/HTMLOptionElement/option-label-quirksmode2-expected.html: Added.
* fast/dom/HTMLOptionElement/option-label-quirksmode2.html: Added.
* fast/dom/HTMLOptionElement/option-label-strictmode-expected.html: Added.
* fast/dom/HTMLOptionElement/option-label-strictmode.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213542 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/dom/HTMLOptionElement/option-label-quirksmode-expected.html [new file with mode: 0644]
LayoutTests/fast/dom/HTMLOptionElement/option-label-quirksmode.html [new file with mode: 0644]
LayoutTests/fast/dom/HTMLOptionElement/option-label-quirksmode2-expected.html [new file with mode: 0644]
LayoutTests/fast/dom/HTMLOptionElement/option-label-quirksmode2.html [new file with mode: 0644]
LayoutTests/fast/dom/HTMLOptionElement/option-label-strictmode-expected.html [new file with mode: 0644]
LayoutTests/fast/dom/HTMLOptionElement/option-label-strictmode.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLOptionElement.cpp
Source/WebCore/html/HTMLOptionElement.h