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
+2015-11-03 Keith Rollin <krollin@apple.com>
+
+ HTMLOptionElement.text should never return the value of label
+ https://bugs.webkit.org/show_bug.cgi?id=148862
+ rdar://problem/22589226
+
+ Reviewed by Darin Adler.
+
+ 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.
+
2015-11-02 Wenson Hsieh <wenson_hsieh@apple.com>
Tapping *below* some <input>s can focus them in Mobile Safari
Test http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLOptionElement04
-Status failure
-Message textLink: assertEquals failed, actual l1, expected EMP10002.
+Status Success
-Test for the text attribute of HTMLOptionElement. To match other browsers, the attribute value is the text as displayed in the list box or popup, rather than strictly “the text contained within the option element” as specified.
+Test for the text attribute of HTMLOptionElement. Specification.
PASS: got "foo" as expected.
PASS: got "foo" as expected.
PASS: got "¥" as expected.
PASS: got "foo bar" as expected.
-PASS: got "label" as expected.
+PASS: got "text" as expected.
<body>
<p>
Test for the <code>text</code> attribute of <code>HTMLOptionElement</code>.
- To match other browsers, the attribute value is the text as displayed
- in the list box or popup, rather than strictly “the text contained within the option element”
- as <a href="http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html#ID-48154426">specified</a>.
+ <a href="http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html#ID-48154426">Specification</a>.
</p>
<select multiple>
<option id="o1">foo </option>
<option id="o2"> foo</option>
<option id="o3">\</option>
<option id="o4">foo bar</option>
- <option id="o5" label=" label ">ignored</option>
+ <option id="o5" label=" label ">text</option>
</select>
<pre id="console"></pre>
<script>
test("o2", "foo");
test("o3", "\u00a5");
test("o4", "foo bar");
- test("o5", "label");
+ test("o5", "text");
</script>
</body>
</html>
--- /dev/null
+<!DOCTYPE html>
+<body>
+ <select>
+ <option>1</option>
+ </select>
+</body>
-In the selection list below, the text 'The label for this element is "1"' should appear, and not the character '1'<br>
-<select>
-<option label="1">the label for this element is "1"</option>
-</select>
+<!DOCTYPE html>
+<!-- In the selection list below, the character '1' should appear, and not the text 'The label for this element is "1"' -->
+<body>
+ <select>
+ <option label="1">the label for this element is "1"</option>
+ </select>
+<body>
--- /dev/null
+<!DOCTYPE html>
+<body>
+ <select>
+ <option></option>
+ </select>
+</body>
-With the label empty, the enclosing text is used.<br>
-<select>
-<option label="">empty label should display empty string to match IE</option>
-</select>
+<!DOCTYPE html>
+<!-- Even though it's empty, the label exists, so it is used. -->
+<body>
+ <select>
+ <option label="">empty label should display empty string to match IE</option>
+ </select>
+</body>
--- /dev/null
+<!DOCTYPE html>
+<body>
+ <select>
+ <option> </option>
+ </select>
+</body>
-When the label contains only white space, the containing text is used.<br>
-<select>
-<option label=" ">white space label should display empty string to match IE</option>
-</select>
+<!DOCTYPE html>
+<!-- Even though the label is nothing but whitespace, it exists, so it it used. -->
+<body>
+ <select>
+ <option label=" ">white space label should display empty string to match IE</option>
+ </select>
+</body>
--- /dev/null
+<!DOCTYPE html>
+<body>
+ <select>
+ <option></option>
+ </select>
+</body>
-The label attribute appears, but is missing the equals value piece, so the containing text is used.<br>
-<select>
-<option label>the label attribute is mentioned but no value is specified; this text should appear</option>
-</select>
+<!DOCTYPE html>
+<!-- Even though the label is missing the 'equals value' piece, it exists, so it is used. -->
+<body>
+ <select>
+ <option label>this text should not appear</option>
+ </select>
+</body>
--- /dev/null
+<!DOCTYPE html>
+<body>
+ <select size="5">
+ <option>This label should appear</option>
+ </select>
+</body>
-In the list box below, the text "This text should appear" should be shown as the first entry into the list box.<br>
-<select size="5"><option label="This label should not appear">This text should appear</option></select>
+<!DOCTYPE html>
+<!-- In the list box below, the text "This label should appear" should be shown as the first entry into the list box. -->
+<body>
+ <select size="5">
+ <option label="This label should appear">This text should not appear</option>
+ </select>
+</body>
--- /dev/null
+<!DOCTYPE html>
+<body>
+ <select>
+ <option>text</option>
+ </select>
+</body>
-The select item below has a label specified, and no enclosed text. There should be no text shown in the select box.<br>
-<select><option label="text"></option></select>
+<!DOCTYPE html>
+<!-- The select item below has a label specified, and no enclosed text. The label 'text' should be shown in the select box. -->
+<body>
+ <select>
+ <option label="text"></option>
+ </select>
+</body>
--- /dev/null
+<!DOCTYPE html>
+<body>
+ <select>
+ <option>text</option>
+ </select>
+</body>
-The select item below has a label specified, and enclosed text that is whitespace. There should be no text shown in the select box.<br>
-<select><option label="text"> </option></select>
+<!DOCTYPE html>
+<!-- The select item below has a label specified, and enclosed text that is whitespace. The label 'text' should be shown in the select box. -->
+<body>
+ <select>
+ <option label="text"> </option>
+ </select>
+</body>
PASS o1.value is "text"
PASS o1.label is "text"
+PASS o1.text is "text"
PASS o2.value is "value"
PASS o2.label is "text"
+PASS o2.text is "text"
PASS o3.value is "text"
PASS o3.label is "label"
+PASS o3.text is "text"
PASS o4.value is "value"
PASS o4.label is "label"
+PASS o4.text is "text"
PASS successfullyParsed is true
TEST COMPLETE
var o1 = document.getElementById('o1');
shouldBe('o1.value', '"text"');
shouldBe('o1.label', '"text"');
+shouldBe('o1.text', '"text"');
var o2 = document.getElementById('o2');
shouldBe('o2.value', '"value"');
shouldBe('o2.label', '"text"');
+shouldBe('o2.text', '"text"');
var o3 = document.getElementById('o3');
shouldBe('o3.value', '"text"');
shouldBe('o3.label', '"label"');
+shouldBe('o3.text', '"text"');
var o4 = document.getElementById('o4');
shouldBe('o4.value', '"value"');
shouldBe('o4.label', '"label"');
+shouldBe('o4.text', '"text"');
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
+2015-11-03 Keith Rollin <krollin@apple.com>
+
+ HTMLOptionElement.text should never return the value of label
+ https://bugs.webkit.org/show_bug.cgi?id=148862
+ rdar://problem/22589226
+
+ Reviewed by Darin Adler.
+
+ Rebaseline tests to reflect new behavior of option.text.
+
+ * web-platform-tests/html/semantics/forms/the-option-element/option-text-label-expected.txt:
+
2015-10-28 Brady Eidson <beidson@apple.com>
Modern IDB: Support IDBDatabase.transaction() (and transaction scheduling in general).
-FAIL Option with non-empty label. assert_equals: expected "text" but got "label"
+PASS Option with non-empty label.
PASS Option with empty label.
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 673x17
- text run at (0,0) width 673: "In the selection list below, the text 'The label for this element is \"1\"' should appear, and not the character '1'"
- RenderBR {BR} at (673,14) size 0x0
- RenderMenuList {SELECT} at (2,20) size 270x38 [bgcolor=#FFFFFF]
- RenderBlock (anonymous) at (15,10) size 214x18
- RenderText at (0,0) size 214x17
- text run at (0,0) width 214: "the label for this element is \"1\""
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 300x17
- text run at (0,0) width 300: "With the label empty, the enclosing text is used."
- RenderBR {BR} at (300,14) size 0x0
- RenderMenuList {SELECT} at (2,20) size 418x38 [bgcolor=#FFFFFF]
- RenderBlock (anonymous) at (15,10) size 362x18
- RenderText at (0,0) size 362x17
- text run at (0,0) width 362: "empty label should display empty string to match IE"
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 436x17
- text run at (0,0) width 436: "When the label contains only white space, the containing text is used."
- RenderBR {BR} at (436,14) size 0x0
- RenderMenuList {SELECT} at (2,20) size 460x38 [bgcolor=#FFFFFF]
- RenderBlock (anonymous) at (15,10) size 404x18
- RenderText at (0,0) size 404x17
- text run at (0,0) width 404: "white space label should display empty string to match IE"
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 595x17
- text run at (0,0) width 595: "The label attribute appears, but is missing the equals value piece, so the containing text is used."
- RenderBR {BR} at (595,14) size 0x0
- RenderMenuList {SELECT} at (2,20) size 616x38 [bgcolor=#FFFFFF]
- RenderBlock (anonymous) at (15,10) size 560x18
- RenderText at (0,0) size 560x17
- text run at (0,0) width 560: "the label attribute is mentioned but no value is specified; this text should appear"
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 668x17
- text run at (0,0) width 668: "In the list box below, the text \"This text should appear\" should be shown as the first entry into the list box."
- RenderBR {BR} at (668,14) size 0x0
- RenderListBox {SELECT} at (2,20) size 187x91 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 718x17
- text run at (0,0) width 718: "The select item below has a label specified, and no enclosed text. There should be no text shown in the select box."
- RenderBR {BR} at (718,14) size 0x0
- RenderMenuList {SELECT} at (2,20) size 56x38 [bgcolor=#FFFFFF]
- RenderBlock (anonymous) at (15,10) size 0x18
- RenderText at (0,0) size 0x17
- text run at (0,0) width 0: " "
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 781x35
- text run at (0,0) width 781: "The select item below has a label specified, and enclosed text that is whitespace. There should be no text shown in the select"
- text run at (0,18) width 28: "box."
- RenderBR {BR} at (28,32) size 0x0
- RenderMenuList {SELECT} at (2,38) size 56x38 [bgcolor=#FFFFFF]
- RenderBlock (anonymous) at (15,10) size 0x18
- RenderText at (0,0) size 0x17
- text run at (0,0) width 0: " "
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 673x17
- text run at (0,0) width 673: "In the selection list below, the text 'The label for this element is \"1\"' should appear, and not the character '1'"
- RenderBR {BR} at (673,14) size 0x0
- RenderMenuList {SELECT} at (2,19) size 241x27 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
- RenderBlock (anonymous) at (1,1) size 239x25
- RenderText at (4,4) size 214x17
- text run at (4,4) width 214: "the label for this element is \"1\""
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 300x17
- text run at (0,0) width 300: "With the label empty, the enclosing text is used."
- RenderBR {BR} at (300,14) size 0x0
- RenderMenuList {SELECT} at (2,19) size 389x27 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
- RenderBlock (anonymous) at (1,1) size 387x25
- RenderText at (4,4) size 362x17
- text run at (4,4) width 362: "empty label should display empty string to match IE"
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 436x17
- text run at (0,0) width 436: "When the label contains only white space, the containing text is used."
- RenderBR {BR} at (436,14) size 0x0
- RenderMenuList {SELECT} at (2,19) size 431x27 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
- RenderBlock (anonymous) at (1,1) size 429x25
- RenderText at (4,4) size 404x17
- text run at (4,4) width 404: "white space label should display empty string to match IE"
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 595x17
- text run at (0,0) width 595: "The label attribute appears, but is missing the equals value piece, so the containing text is used."
- RenderBR {BR} at (595,14) size 0x0
- RenderMenuList {SELECT} at (2,19) size 587x27 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
- RenderBlock (anonymous) at (1,1) size 585x25
- RenderText at (4,4) size 560x17
- text run at (4,4) width 560: "the label attribute is mentioned but no value is specified; this text should appear"
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 668x17
- text run at (0,0) width 668: "In the list box below, the text \"This text should appear\" should be shown as the first entry into the list box."
- RenderBR {BR} at (668,14) size 0x0
- RenderListBox {SELECT} at (2,19) size 187x91 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 718x17
- text run at (0,0) width 718: "The select item below has a label specified, and no enclosed text. There should be no text shown in the select box."
- RenderBR {BR} at (718,14) size 0x0
- RenderMenuList {SELECT} at (2,19) size 27x27 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
- RenderBlock (anonymous) at (1,1) size 25x25
- RenderText at (4,4) size 0x17
- text run at (4,4) width 0: " "
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 781x34
- text run at (0,0) width 781: "The select item below has a label specified, and enclosed text that is whitespace. There should be no text shown in the select"
- text run at (0,17) width 28: "box."
- RenderBR {BR} at (28,31) size 0x0
- RenderMenuList {SELECT} at (2,36) size 27x27 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
- RenderBlock (anonymous) at (1,1) size 25x25
- RenderText at (4,4) size 0x17
- text run at (4,4) width 0: " "
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 685x19
- text run at (0,0) width 685: "In the selection list below, the text 'The label for this element is \"1\"' should appear, and not the character '1'"
- RenderBR {BR} at (684,15) size 1x0
- RenderMenuList {SELECT} at (2,22) size 180x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
- RenderBlock (anonymous) at (6,3) size 168x14
- RenderText at (0,0) size 148x14
- text run at (0,0) width 148: "the label for this element is \"1\""
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 306x19
- text run at (0,0) width 306: "With the label empty, the enclosing text is used."
- RenderBR {BR} at (305,15) size 1x0
- RenderMenuList {SELECT} at (2,22) size 283x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
- RenderBlock (anonymous) at (6,3) size 271x14
- RenderText at (0,0) size 251x14
- text run at (0,0) width 251: "empty label should display empty string to match IE"
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 445x19
- text run at (0,0) width 445: "When the label contains only white space, the containing text is used."
- RenderBR {BR} at (444,15) size 1x0
- RenderMenuList {SELECT} at (2,22) size 311x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
- RenderBlock (anonymous) at (6,3) size 299x14
- RenderText at (0,0) size 279x14
- text run at (0,0) width 279: "white space label should display empty string to match IE"
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 610x19
- text run at (0,0) width 610: "The label attribute appears, but is missing the equals value piece, so the containing text is used."
- RenderBR {BR} at (609,15) size 1x0
- RenderMenuList {SELECT} at (2,22) size 420x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
- RenderBlock (anonymous) at (6,3) size 408x14
- RenderText at (0,0) size 388x14
- text run at (0,0) width 388: "the label attribute is mentioned but no value is specified; this text should appear"
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 680x19
- text run at (0,0) width 680: "In the list box below, the text \"This text should appear\" should be shown as the first entry into the list box."
- RenderBR {BR} at (679,15) size 1x0
- RenderMenuList {SELECT} at (2,22) size 147x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
- RenderBlock (anonymous) at (6,3) size 135x14
- RenderText at (0,0) size 0x14
- text run at (0,0) width 0: " "
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 731x19
- text run at (0,0) width 731: "The select item below has a label specified, and no enclosed text. There should be no text shown in the select box."
- RenderBR {BR} at (730,15) size 1x0
- RenderMenuList {SELECT} at (2,22) size 32x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
- RenderBlock (anonymous) at (6,3) size 20x14
- RenderText at (0,0) size 0x14
- text run at (0,0) width 0: " "
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 756x39
- text run at (0,0) width 756: "The select item below has a label specified, and enclosed text that is whitespace. There should be no text shown in the"
- text run at (0,20) width 69: "select box."
- RenderBR {BR} at (68,35) size 1x0
- RenderMenuList {SELECT} at (2,42) size 32x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
- RenderBlock (anonymous) at (6,3) size 20x14
- RenderText at (0,0) size 0x14
- text run at (0,0) width 0: " "
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 685x19
- text run at (0,0) width 685: "In the selection list below, the text 'The label for this element is \"1\"' should appear, and not the character '1'"
- RenderBR {BR} at (684,15) size 1x0
- RenderMenuList {SELECT} at (2,22) size 180x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
- RenderBlock (anonymous) at (6,3) size 168x14
- RenderText at (0,0) size 148x14
- text run at (0,0) width 148: "the label for this element is \"1\""
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 306x19
- text run at (0,0) width 306: "With the label empty, the enclosing text is used."
- RenderBR {BR} at (305,15) size 1x0
- RenderMenuList {SELECT} at (2,22) size 283x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
- RenderBlock (anonymous) at (6,3) size 271x14
- RenderText at (0,0) size 251x14
- text run at (0,0) width 251: "empty label should display empty string to match IE"
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 445x19
- text run at (0,0) width 445: "When the label contains only white space, the containing text is used."
- RenderBR {BR} at (444,15) size 1x0
- RenderMenuList {SELECT} at (2,22) size 311x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
- RenderBlock (anonymous) at (6,3) size 299x14
- RenderText at (0,0) size 279x14
- text run at (0,0) width 279: "white space label should display empty string to match IE"
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 610x19
- text run at (0,0) width 610: "The label attribute appears, but is missing the equals value piece, so the containing text is used."
- RenderBR {BR} at (609,15) size 1x0
- RenderMenuList {SELECT} at (2,22) size 420x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
- RenderBlock (anonymous) at (6,3) size 408x14
- RenderText at (0,0) size 388x14
- text run at (0,0) width 388: "the label attribute is mentioned but no value is specified; this text should appear"
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 680x19
- text run at (0,0) width 680: "In the list box below, the text \"This text should appear\" should be shown as the first entry into the list box."
- RenderBR {BR} at (679,15) size 1x0
- RenderMenuList {SELECT} at (2,22) size 147x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
- RenderBlock (anonymous) at (6,3) size 135x14
- RenderText at (0,0) size 0x14
- text run at (0,0) width 0: " "
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 731x19
- text run at (0,0) width 731: "The select item below has a label specified, and no enclosed text. There should be no text shown in the select box."
- RenderBR {BR} at (730,15) size 1x0
- RenderMenuList {SELECT} at (2,22) size 32x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
- RenderBlock (anonymous) at (6,3) size 20x14
- RenderText at (0,0) size 0x14
- text run at (0,0) width 0: " "
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 756x39
- text run at (0,0) width 756: "The select item below has a label specified, and enclosed text that is whitespace. There should be no text shown in the"
- text run at (0,20) width 69: "select box."
- RenderBR {BR} at (68,35) size 1x0
- RenderMenuList {SELECT} at (2,42) size 32x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
- RenderBlock (anonymous) at (6,3) size 20x14
- RenderText at (0,0) size 0x14
- text run at (0,0) width 0: " "
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 685x18
- text run at (0,0) width 685: "In the selection list below, the text 'The label for this element is \"1\"' should appear, and not the character '1'"
- RenderBR {BR} at (684,14) size 1x0
- RenderMenuList {SELECT} at (2,20) size 196x18 [bgcolor=#FFFFFF]
- RenderBlock (anonymous) at (0,0) size 196x18
- RenderText at (8,2) size 165x13
- text run at (8,2) width 165: "the label for this element is \"1\""
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 306x18
- text run at (0,0) width 306: "With the label empty, the enclosing text is used."
- RenderBR {BR} at (305,14) size 1x0
- RenderMenuList {SELECT} at (2,20) size 307x18 [bgcolor=#FFFFFF]
- RenderBlock (anonymous) at (0,0) size 307x18
- RenderText at (8,2) size 276x13
- text run at (8,2) width 276: "empty label should display empty string to match IE"
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 610x18
- text run at (0,0) width 610: "The label attribute appears, but is missing the equals value piece, so the containing text is used."
- RenderBR {BR} at (609,14) size 1x0
- RenderMenuList {SELECT} at (2,20) size 461x18 [bgcolor=#FFFFFF]
- RenderBlock (anonymous) at (0,0) size 461x18
- RenderText at (8,2) size 430x13
- text run at (8,2) width 430: "the label attribute is mentioned but no value is specified; this text should appear"
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 680x18
- text run at (0,0) width 680: "In the list box below, the text \"This text should appear\" should be shown as the first entry into the list box."
- RenderBR {BR} at (679,14) size 1x0
- RenderListBox {SELECT} at (2,20) size 142x71 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 685x18
- text run at (0,0) width 685: "In the selection list below, the text 'The label for this element is \"1\"' should appear, and not the character '1'"
- RenderBR {BR} at (684,14) size 1x0
- RenderMenuList {SELECT} at (2,20) size 194x18 [bgcolor=#FFFFFF]
- RenderBlock (anonymous) at (0,0) size 194x18
- RenderText at (8,2) size 163x13
- text run at (8,2) width 163: "the label for this element is \"1\""
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 306x18
- text run at (0,0) width 306: "With the label empty, the enclosing text is used."
- RenderBR {BR} at (305,14) size 1x0
- RenderMenuList {SELECT} at (2,20) size 306x18 [bgcolor=#FFFFFF]
- RenderBlock (anonymous) at (0,0) size 306x18
- RenderText at (8,2) size 275x13
- text run at (8,2) width 275: "empty label should display empty string to match IE"
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 445x18
- text run at (0,0) width 445: "When the label contains only white space, the containing text is used."
- RenderBR {BR} at (444,14) size 1x0
- RenderMenuList {SELECT} at (2,20) size 336x18 [bgcolor=#FFFFFF]
- RenderBlock (anonymous) at (0,0) size 336x18
- RenderText at (8,2) size 305x13
- text run at (8,2) width 305: "white space label should display empty string to match IE"
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 610x18
- text run at (0,0) width 610: "The label attribute appears, but is missing the equals value piece, so the containing text is used."
- RenderBR {BR} at (609,14) size 1x0
- RenderMenuList {SELECT} at (2,20) size 455x18 [bgcolor=#FFFFFF]
- RenderBlock (anonymous) at (0,0) size 455x18
- RenderText at (8,2) size 424x13
- text run at (8,2) width 424: "the label attribute is mentioned but no value is specified; this text should appear"
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 680x18
- text run at (0,0) width 680: "In the list box below, the text \"This text should appear\" should be shown as the first entry into the list box."
- RenderBR {BR} at (679,14) size 1x0
- RenderListBox {SELECT} at (2,20) size 142x71 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 730x18
- text run at (0,0) width 730: "The select item below has a label specified, and no enclosed text. There should be no text shown in the select box."
- RenderBR {BR} at (729,14) size 1x0
- RenderMenuList {SELECT} at (2,20) size 36x18 [bgcolor=#FFFFFF]
- RenderBlock (anonymous) at (0,0) size 36x18
- RenderText at (8,2) size 0x13
- text run at (8,2) width 0: " "
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 755x36
- text run at (0,0) width 755: "The select item below has a label specified, and enclosed text that is whitespace. There should be no text shown in the"
- text run at (0,18) width 69: "select box."
- RenderBR {BR} at (68,32) size 1x0
- RenderMenuList {SELECT} at (2,38) size 36x18 [bgcolor=#FFFFFF]
- RenderBlock (anonymous) at (0,0) size 36x18
- RenderText at (8,2) size 0x13
- text run at (8,2) width 0: " "
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 673x18
- text run at (0,0) width 673: "In the selection list below, the text 'The label for this element is \"1\"' should appear, and not the character '1'"
- RenderBR {BR} at (673,14) size 0x0
- RenderMenuList {SELECT} at (2,20) size 197x19 [bgcolor=#FFFFFF]
- RenderBlock (anonymous) at (4,2) size 172x15
- RenderText at (0,0) size 172x15
- text run at (0,0) width 172: "the label for this element is \"1\""
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 300x18
- text run at (0,0) width 300: "With the label empty, the enclosing text is used."
- RenderBR {BR} at (300,14) size 0x0
- RenderMenuList {SELECT} at (2,20) size 319x19 [bgcolor=#FFFFFF]
- RenderBlock (anonymous) at (4,2) size 294x15
- RenderText at (0,0) size 294x15
- text run at (0,0) width 294: "empty label should display empty string to match IE"
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 436x18
- text run at (0,0) width 436: "When the label contains only white space, the containing text is used."
- RenderBR {BR} at (436,14) size 0x0
- RenderMenuList {SELECT} at (2,20) size 351x19 [bgcolor=#FFFFFF]
- RenderBlock (anonymous) at (4,2) size 326x15
- RenderText at (0,0) size 326x15
- text run at (0,0) width 326: "white space label should display empty string to match IE"
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 595x18
- text run at (0,0) width 595: "The label attribute appears, but is missing the equals value piece, so the containing text is used."
- RenderBR {BR} at (595,14) size 0x0
- RenderMenuList {SELECT} at (2,20) size 475x19 [bgcolor=#FFFFFF]
- RenderBlock (anonymous) at (4,2) size 450x15
- RenderText at (0,0) size 450x15
- text run at (0,0) width 450: "the label attribute is mentioned but no value is specified; this text should appear"
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 668x18
- text run at (0,0) width 668: "In the list box below, the text \"This text should appear\" should be shown as the first entry into the list box."
- RenderBR {BR} at (668,14) size 0x0
- RenderListBox {SELECT} at (2,20) size 154x81 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 718x18
- text run at (0,0) width 718: "The select item below has a label specified, and no enclosed text. There should be no text shown in the select box."
- RenderBR {BR} at (718,14) size 0x0
- RenderMenuList {SELECT} at (2,20) size 25x19 [bgcolor=#FFFFFF]
- RenderBlock (anonymous) at (4,2) size 0x15
- RenderText at (0,0) size 0x15
- text run at (0,0) width 0: " "
- RenderText {#text} at (0,0) size 0x0
+++ /dev/null
-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
- RenderBlock {HTML} at (0,0) size 800x600
- RenderBody {BODY} at (8,8) size 784x584
- RenderText {#text} at (0,0) size 781x36
- text run at (0,0) width 781: "The select item below has a label specified, and enclosed text that is whitespace. There should be no text shown in the select"
- text run at (0,18) width 28: "box."
- RenderBR {BR} at (28,32) size 0x0
- RenderMenuList {SELECT} at (2,38) size 25x19 [bgcolor=#FFFFFF]
- RenderBlock (anonymous) at (4,2) size 0x15
- RenderText at (0,0) size 0x15
- text run at (0,0) width 0: " "
- RenderText {#text} at (0,0) size 0x0
+2015-11-03 Keith Rollin <krollin@apple.com>
+
+ HTMLOptionElement.text should never return the value of label
+ https://bugs.webkit.org/show_bug.cgi?id=148862
+ rdar://problem/22589226
+
+ Reviewed by Darin Adler.
+
+ 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):
+
2015-11-03 Andreas Kling <akling@apple.com>
ResourceUsageOverlay should draw itself using WebCore::GraphicsContext.
return ariaLabel;
if (is<HTMLOptionElement>(*m_optionElement))
- return downcast<HTMLOptionElement>(*m_optionElement).text();
+ return downcast<HTMLOptionElement>(*m_optionElement).label();
if (is<HTMLOptGroupElement>(*m_optionElement))
return downcast<HTMLOptGroupElement>(*m_optionElement).groupLabelText();
String AccessibilityMenuListOption::stringValue() const
{
- return downcast<HTMLOptionElement>(*m_element).text();
+ return downcast<HTMLOptionElement>(*m_element).label();
}
} // namespace WebCore
String HTMLOptionElement::text() const
{
- String text;
-
- // WinIE does not use the label attribute, so as a quirk, we ignore it.
- if (!document().inQuirksMode())
- text = fastGetAttribute(labelAttr);
-
- // FIXME: The following treats an element with the label attribute set to
- // the empty string the same as an element with no label attribute at all.
- // Is that correct? If it is, then should the label function work the same way?
- if (text.isEmpty())
- text = collectOptionInnerText();
+ String text = collectOptionInnerText();
// FIXME: Is displayStringModifiedByEncoding helpful here?
// If it's correct here, then isn't it needed in the value and label functions too?
{
ContainerNode* parent = parentNode();
if (is<HTMLOptGroupElement>(parent))
- return " " + text();
- return text();
+ return " " + label();
+ return label();
}
bool HTMLOptionElement::isDisabledFormControl() const