HTMLOptionElement.text should never return the value of label
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Nov 2015 19:59:57 +0000 (19:59 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Nov 2015 19:59:57 +0000 (19:59 +0000)
commitf03481ce639e5d0ce39601740c6711496b839de9
tree93f521425f03d65e21060f424333581debf7b9cd
parent48acbd5714560b5e6095bd6d2e14790e21cfb4bc
HTMLOptionElement.text should never return the value of label
https://bugs.webkit.org/show_bug.cgi?id=148862
rdar://problem/22589226

Patch by Keith Rollin <krollin@apple.com> on 2015-11-03
Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline tests to reflect new behavior of option.text.

* web-platform-tests/html/semantics/forms/the-option-element/option-text-label-expected.txt:

Source/WebCore:

According to the HTML spec, `option` elements should have the
following behavior:

    - the `text` property should return text contents of element
    - the `label` property should return value of label attribute if
      it exists, else return text property
    - the UI should display label property

12 years ago, in order to be compatibile with browsers of the time, we
diverged from this behavior: the text property behaved like the label
property, and the text property was used for display. This resulted in
our UI incidentally conforming to the spec, but also in the text
property *not* conforming to the spec. See <rdar://problem/3532519>
for discussion on this change.

The behavior of the browsers we were conforming to has changed. In
particular, the text property in Firefox now conforms to the spec
instead of behaving as we did. Therefore, it's less important to
retain our old behavior for the sake of compatibility. This check-in
brings us into conformance with the spec. The result is that the UI
stays the same, but the text property will return different values than
it used to if the option element has a label attribute that used to
hide it.

Updated tests:
- fast/dom/HTMLOptionElement/option-text.html:
- fast/forms/HTMLOptionElement_label01.html:
- fast/forms/HTMLOptionElement_label02.html:
- fast/forms/HTMLOptionElement_label03.html:
- fast/forms/HTMLOptionElement_label04.html:
- fast/forms/HTMLOptionElement_label05.html:
- fast/forms/HTMLOptionElement_label06.html:
- fast/forms/HTMLOptionElement_label07.html:
- fast/forms/option-value-and-label.html:

* accessibility/AccessibilityListBoxOption.cpp:
(WebCore::AccessibilityListBoxOption::stringValue):
* accessibility/AccessibilityMenuListOption.cpp:
(WebCore::AccessibilityMenuListOption::stringValue):
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::text):
(WebCore::HTMLOptionElement::textIndentedToRespectGroupLabel):

LayoutTests:

Rebaseline tests to reflect new behavior of option.text. Convert some
render tests to reference tests.

* dom/xhtml/level2/html/HTMLOptionElement04-expected.txt:
* fast/dom/HTMLOptionElement/option-text-expected.txt:
* fast/dom/HTMLOptionElement/option-text.html:
* fast/forms/HTMLOptionElement_label01-expected.html: Added.
* fast/forms/HTMLOptionElement_label01.html:
* fast/forms/HTMLOptionElement_label02-expected.html: Added.
* fast/forms/HTMLOptionElement_label02.html:
* fast/forms/HTMLOptionElement_label03-expected.html: Added.
* fast/forms/HTMLOptionElement_label03.html:
* fast/forms/HTMLOptionElement_label04-expected.html: Added.
* fast/forms/HTMLOptionElement_label04.html:
* fast/forms/HTMLOptionElement_label05-expected.html: Added.
* fast/forms/HTMLOptionElement_label05.html:
* fast/forms/HTMLOptionElement_label06-expected.html: Added.
* fast/forms/HTMLOptionElement_label06.html:
* fast/forms/HTMLOptionElement_label07-expected.html: Added.
* fast/forms/HTMLOptionElement_label07.html:
* fast/forms/option-value-and-label-expected.txt:
* fast/forms/option-value-and-label.html:
* platform/efl/fast/forms/HTMLOptionElement_label01-expected.png: Removed.
* platform/efl/fast/forms/HTMLOptionElement_label01-expected.txt: Removed.
* platform/efl/fast/forms/HTMLOptionElement_label02-expected.png: Removed.
* platform/efl/fast/forms/HTMLOptionElement_label02-expected.txt: Removed.
* platform/efl/fast/forms/HTMLOptionElement_label03-expected.png: Removed.
* platform/efl/fast/forms/HTMLOptionElement_label03-expected.txt: Removed.
* platform/efl/fast/forms/HTMLOptionElement_label04-expected.png: Removed.
* platform/efl/fast/forms/HTMLOptionElement_label04-expected.txt: Removed.
* platform/efl/fast/forms/HTMLOptionElement_label05-expected.png: Removed.
* platform/efl/fast/forms/HTMLOptionElement_label05-expected.txt: Removed.
* platform/efl/fast/forms/HTMLOptionElement_label06-expected.png: Removed.
* platform/efl/fast/forms/HTMLOptionElement_label06-expected.txt: Removed.
* platform/efl/fast/forms/HTMLOptionElement_label07-expected.png: Removed.
* platform/efl/fast/forms/HTMLOptionElement_label07-expected.txt: Removed.
* platform/gtk/fast/forms/HTMLOptionElement_label01-expected.png: Removed.
* platform/gtk/fast/forms/HTMLOptionElement_label01-expected.txt: Removed.
* platform/gtk/fast/forms/HTMLOptionElement_label02-expected.png: Removed.
* platform/gtk/fast/forms/HTMLOptionElement_label02-expected.txt: Removed.
* platform/gtk/fast/forms/HTMLOptionElement_label03-expected.png: Removed.
* platform/gtk/fast/forms/HTMLOptionElement_label03-expected.txt: Removed.
* platform/gtk/fast/forms/HTMLOptionElement_label04-expected.png: Removed.
* platform/gtk/fast/forms/HTMLOptionElement_label04-expected.txt: Removed.
* platform/gtk/fast/forms/HTMLOptionElement_label05-expected.png: Removed.
* platform/gtk/fast/forms/HTMLOptionElement_label05-expected.txt: Removed.
* platform/gtk/fast/forms/HTMLOptionElement_label06-expected.png: Removed.
* platform/gtk/fast/forms/HTMLOptionElement_label06-expected.txt: Removed.
* platform/gtk/fast/forms/HTMLOptionElement_label07-expected.png: Removed.
* platform/gtk/fast/forms/HTMLOptionElement_label07-expected.txt: Removed.
* platform/ios-simulator-wk2/fast/forms/HTMLOptionElement_label01-expected.txt: Removed.
* platform/ios-simulator-wk2/fast/forms/HTMLOptionElement_label02-expected.txt: Removed.
* platform/ios-simulator-wk2/fast/forms/HTMLOptionElement_label03-expected.txt: Removed.
* platform/ios-simulator-wk2/fast/forms/HTMLOptionElement_label04-expected.txt: Removed.
* platform/ios-simulator-wk2/fast/forms/HTMLOptionElement_label05-expected.txt: Removed.
* platform/ios-simulator-wk2/fast/forms/HTMLOptionElement_label06-expected.txt: Removed.
* platform/ios-simulator-wk2/fast/forms/HTMLOptionElement_label07-expected.txt: Removed.
* platform/ios-simulator/fast/forms/HTMLOptionElement_label01-expected.txt: Removed.
* platform/ios-simulator/fast/forms/HTMLOptionElement_label02-expected.txt: Removed.
* platform/ios-simulator/fast/forms/HTMLOptionElement_label03-expected.txt: Removed.
* platform/ios-simulator/fast/forms/HTMLOptionElement_label04-expected.txt: Removed.
* platform/ios-simulator/fast/forms/HTMLOptionElement_label05-expected.txt: Removed.
* platform/ios-simulator/fast/forms/HTMLOptionElement_label06-expected.txt: Removed.
* platform/ios-simulator/fast/forms/HTMLOptionElement_label07-expected.txt: Removed.
* platform/mac-mavericks/fast/forms/HTMLOptionElement_label01-expected.png: Removed.
* platform/mac-mavericks/fast/forms/HTMLOptionElement_label01-expected.txt: Removed.
* platform/mac-mavericks/fast/forms/HTMLOptionElement_label02-expected.png: Removed.
* platform/mac-mavericks/fast/forms/HTMLOptionElement_label02-expected.txt: Removed.
* platform/mac-mavericks/fast/forms/HTMLOptionElement_label03-expected.png: Removed.
* platform/mac-mavericks/fast/forms/HTMLOptionElement_label04-expected.png: Removed.
* platform/mac-mavericks/fast/forms/HTMLOptionElement_label04-expected.txt: Removed.
* platform/mac-mavericks/fast/forms/HTMLOptionElement_label05-expected.png: Removed.
* platform/mac-mavericks/fast/forms/HTMLOptionElement_label05-expected.txt: Removed.
* platform/mac/fast/forms/HTMLOptionElement_label01-expected.png: Removed.
* platform/mac/fast/forms/HTMLOptionElement_label01-expected.txt: Removed.
* platform/mac/fast/forms/HTMLOptionElement_label02-expected.png: Removed.
* platform/mac/fast/forms/HTMLOptionElement_label02-expected.txt: Removed.
* platform/mac/fast/forms/HTMLOptionElement_label03-expected.png: Removed.
* platform/mac/fast/forms/HTMLOptionElement_label03-expected.txt: Removed.
* platform/mac/fast/forms/HTMLOptionElement_label04-expected.png: Removed.
* platform/mac/fast/forms/HTMLOptionElement_label04-expected.txt: Removed.
* platform/mac/fast/forms/HTMLOptionElement_label05-expected.png: Removed.
* platform/mac/fast/forms/HTMLOptionElement_label05-expected.txt: Removed.
* platform/mac/fast/forms/HTMLOptionElement_label06-expected.png: Removed.
* platform/mac/fast/forms/HTMLOptionElement_label06-expected.txt: Removed.
* platform/mac/fast/forms/HTMLOptionElement_label07-expected.png: Removed.
* platform/mac/fast/forms/HTMLOptionElement_label07-expected.txt: Removed.
* platform/win/fast/forms/HTMLOptionElement_label01-expected.png: Removed.
* platform/win/fast/forms/HTMLOptionElement_label01-expected.txt: Removed.
* platform/win/fast/forms/HTMLOptionElement_label02-expected.png: Removed.
* platform/win/fast/forms/HTMLOptionElement_label02-expected.txt: Removed.
* platform/win/fast/forms/HTMLOptionElement_label03-expected.png: Removed.
* platform/win/fast/forms/HTMLOptionElement_label03-expected.txt: Removed.
* platform/win/fast/forms/HTMLOptionElement_label04-expected.png: Removed.
* platform/win/fast/forms/HTMLOptionElement_label04-expected.txt: Removed.
* platform/win/fast/forms/HTMLOptionElement_label05-expected.txt: Removed.
* platform/win/fast/forms/HTMLOptionElement_label06-expected.txt: Removed.
* platform/win/fast/forms/HTMLOptionElement_label07-expected.txt: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191964 268f45cc-cd09-0410-ab3c-d52691b4dbfc
102 files changed:
LayoutTests/ChangeLog
LayoutTests/dom/xhtml/level2/html/HTMLOptionElement04-expected.txt
LayoutTests/fast/dom/HTMLOptionElement/option-text-expected.txt
LayoutTests/fast/dom/HTMLOptionElement/option-text.html
LayoutTests/fast/forms/HTMLOptionElement_label01-expected.html [new file with mode: 0644]
LayoutTests/fast/forms/HTMLOptionElement_label01.html
LayoutTests/fast/forms/HTMLOptionElement_label02-expected.html [new file with mode: 0644]
LayoutTests/fast/forms/HTMLOptionElement_label02.html
LayoutTests/fast/forms/HTMLOptionElement_label03-expected.html [new file with mode: 0644]
LayoutTests/fast/forms/HTMLOptionElement_label03.html
LayoutTests/fast/forms/HTMLOptionElement_label04-expected.html [new file with mode: 0644]
LayoutTests/fast/forms/HTMLOptionElement_label04.html
LayoutTests/fast/forms/HTMLOptionElement_label05-expected.html [new file with mode: 0644]
LayoutTests/fast/forms/HTMLOptionElement_label05.html
LayoutTests/fast/forms/HTMLOptionElement_label06-expected.html [new file with mode: 0644]
LayoutTests/fast/forms/HTMLOptionElement_label06.html
LayoutTests/fast/forms/HTMLOptionElement_label07-expected.html [new file with mode: 0644]
LayoutTests/fast/forms/HTMLOptionElement_label07.html
LayoutTests/fast/forms/option-value-and-label-expected.txt
LayoutTests/fast/forms/option-value-and-label.html
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-option-element/option-text-label-expected.txt
LayoutTests/platform/efl/fast/forms/HTMLOptionElement_label01-expected.png [deleted file]
LayoutTests/platform/efl/fast/forms/HTMLOptionElement_label01-expected.txt [deleted file]
LayoutTests/platform/efl/fast/forms/HTMLOptionElement_label02-expected.png [deleted file]
LayoutTests/platform/efl/fast/forms/HTMLOptionElement_label02-expected.txt [deleted file]
LayoutTests/platform/efl/fast/forms/HTMLOptionElement_label03-expected.png [deleted file]
LayoutTests/platform/efl/fast/forms/HTMLOptionElement_label03-expected.txt [deleted file]
LayoutTests/platform/efl/fast/forms/HTMLOptionElement_label04-expected.png [deleted file]
LayoutTests/platform/efl/fast/forms/HTMLOptionElement_label04-expected.txt [deleted file]
LayoutTests/platform/efl/fast/forms/HTMLOptionElement_label05-expected.png [deleted file]
LayoutTests/platform/efl/fast/forms/HTMLOptionElement_label05-expected.txt [deleted file]
LayoutTests/platform/efl/fast/forms/HTMLOptionElement_label06-expected.png [deleted file]
LayoutTests/platform/efl/fast/forms/HTMLOptionElement_label06-expected.txt [deleted file]
LayoutTests/platform/efl/fast/forms/HTMLOptionElement_label07-expected.png [deleted file]
LayoutTests/platform/efl/fast/forms/HTMLOptionElement_label07-expected.txt [deleted file]
LayoutTests/platform/gtk/fast/forms/HTMLOptionElement_label01-expected.png [deleted file]
LayoutTests/platform/gtk/fast/forms/HTMLOptionElement_label01-expected.txt [deleted file]
LayoutTests/platform/gtk/fast/forms/HTMLOptionElement_label02-expected.png [deleted file]
LayoutTests/platform/gtk/fast/forms/HTMLOptionElement_label02-expected.txt [deleted file]
LayoutTests/platform/gtk/fast/forms/HTMLOptionElement_label03-expected.png [deleted file]
LayoutTests/platform/gtk/fast/forms/HTMLOptionElement_label03-expected.txt [deleted file]
LayoutTests/platform/gtk/fast/forms/HTMLOptionElement_label04-expected.png [deleted file]
LayoutTests/platform/gtk/fast/forms/HTMLOptionElement_label04-expected.txt [deleted file]
LayoutTests/platform/gtk/fast/forms/HTMLOptionElement_label05-expected.png [deleted file]
LayoutTests/platform/gtk/fast/forms/HTMLOptionElement_label05-expected.txt [deleted file]
LayoutTests/platform/gtk/fast/forms/HTMLOptionElement_label06-expected.png [deleted file]
LayoutTests/platform/gtk/fast/forms/HTMLOptionElement_label06-expected.txt [deleted file]
LayoutTests/platform/gtk/fast/forms/HTMLOptionElement_label07-expected.png [deleted file]
LayoutTests/platform/gtk/fast/forms/HTMLOptionElement_label07-expected.txt [deleted file]
LayoutTests/platform/ios-simulator-wk2/fast/forms/HTMLOptionElement_label01-expected.txt [deleted file]
LayoutTests/platform/ios-simulator-wk2/fast/forms/HTMLOptionElement_label02-expected.txt [deleted file]
LayoutTests/platform/ios-simulator-wk2/fast/forms/HTMLOptionElement_label03-expected.txt [deleted file]
LayoutTests/platform/ios-simulator-wk2/fast/forms/HTMLOptionElement_label04-expected.txt [deleted file]
LayoutTests/platform/ios-simulator-wk2/fast/forms/HTMLOptionElement_label05-expected.txt [deleted file]
LayoutTests/platform/ios-simulator-wk2/fast/forms/HTMLOptionElement_label06-expected.txt [deleted file]
LayoutTests/platform/ios-simulator-wk2/fast/forms/HTMLOptionElement_label07-expected.txt [deleted file]
LayoutTests/platform/ios-simulator/fast/forms/HTMLOptionElement_label01-expected.txt [deleted file]
LayoutTests/platform/ios-simulator/fast/forms/HTMLOptionElement_label02-expected.txt [deleted file]
LayoutTests/platform/ios-simulator/fast/forms/HTMLOptionElement_label03-expected.txt [deleted file]
LayoutTests/platform/ios-simulator/fast/forms/HTMLOptionElement_label04-expected.txt [deleted file]
LayoutTests/platform/ios-simulator/fast/forms/HTMLOptionElement_label05-expected.txt [deleted file]
LayoutTests/platform/ios-simulator/fast/forms/HTMLOptionElement_label06-expected.txt [deleted file]
LayoutTests/platform/ios-simulator/fast/forms/HTMLOptionElement_label07-expected.txt [deleted file]
LayoutTests/platform/mac-mavericks/fast/forms/HTMLOptionElement_label01-expected.png [deleted file]
LayoutTests/platform/mac-mavericks/fast/forms/HTMLOptionElement_label01-expected.txt [deleted file]
LayoutTests/platform/mac-mavericks/fast/forms/HTMLOptionElement_label02-expected.png [deleted file]
LayoutTests/platform/mac-mavericks/fast/forms/HTMLOptionElement_label02-expected.txt [deleted file]
LayoutTests/platform/mac-mavericks/fast/forms/HTMLOptionElement_label03-expected.png [deleted file]
LayoutTests/platform/mac-mavericks/fast/forms/HTMLOptionElement_label04-expected.png [deleted file]
LayoutTests/platform/mac-mavericks/fast/forms/HTMLOptionElement_label04-expected.txt [deleted file]
LayoutTests/platform/mac-mavericks/fast/forms/HTMLOptionElement_label05-expected.png [deleted file]
LayoutTests/platform/mac-mavericks/fast/forms/HTMLOptionElement_label05-expected.txt [deleted file]
LayoutTests/platform/mac/fast/forms/HTMLOptionElement_label01-expected.png [deleted file]
LayoutTests/platform/mac/fast/forms/HTMLOptionElement_label01-expected.txt [deleted file]
LayoutTests/platform/mac/fast/forms/HTMLOptionElement_label02-expected.png [deleted file]
LayoutTests/platform/mac/fast/forms/HTMLOptionElement_label02-expected.txt [deleted file]
LayoutTests/platform/mac/fast/forms/HTMLOptionElement_label03-expected.png [deleted file]
LayoutTests/platform/mac/fast/forms/HTMLOptionElement_label03-expected.txt [deleted file]
LayoutTests/platform/mac/fast/forms/HTMLOptionElement_label04-expected.png [deleted file]
LayoutTests/platform/mac/fast/forms/HTMLOptionElement_label04-expected.txt [deleted file]
LayoutTests/platform/mac/fast/forms/HTMLOptionElement_label05-expected.png [deleted file]
LayoutTests/platform/mac/fast/forms/HTMLOptionElement_label05-expected.txt [deleted file]
LayoutTests/platform/mac/fast/forms/HTMLOptionElement_label06-expected.png [deleted file]
LayoutTests/platform/mac/fast/forms/HTMLOptionElement_label06-expected.txt [deleted file]
LayoutTests/platform/mac/fast/forms/HTMLOptionElement_label07-expected.png [deleted file]
LayoutTests/platform/mac/fast/forms/HTMLOptionElement_label07-expected.txt [deleted file]
LayoutTests/platform/win/fast/forms/HTMLOptionElement_label01-expected.png [deleted file]
LayoutTests/platform/win/fast/forms/HTMLOptionElement_label01-expected.txt [deleted file]
LayoutTests/platform/win/fast/forms/HTMLOptionElement_label02-expected.png [deleted file]
LayoutTests/platform/win/fast/forms/HTMLOptionElement_label02-expected.txt [deleted file]
LayoutTests/platform/win/fast/forms/HTMLOptionElement_label03-expected.png [deleted file]
LayoutTests/platform/win/fast/forms/HTMLOptionElement_label03-expected.txt [deleted file]
LayoutTests/platform/win/fast/forms/HTMLOptionElement_label04-expected.png [deleted file]
LayoutTests/platform/win/fast/forms/HTMLOptionElement_label04-expected.txt [deleted file]
LayoutTests/platform/win/fast/forms/HTMLOptionElement_label05-expected.txt [deleted file]
LayoutTests/platform/win/fast/forms/HTMLOptionElement_label06-expected.txt [deleted file]
LayoutTests/platform/win/fast/forms/HTMLOptionElement_label07-expected.txt [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityListBoxOption.cpp
Source/WebCore/accessibility/AccessibilityMenuListOption.cpp
Source/WebCore/html/HTMLOptionElement.cpp