Commit bd205a70 authored by darin's avatar darin

LayoutTests:

        Reviewed by Maciej and Adele
        
        Tests for http://bugzilla.opendarwin.org/show_bug.cgi?id=8398
        Updated and extended select/option form tests 
        
        * fast/forms/HTMLOptionElement_label01.html:
        * fast/forms/HTMLOptionElement_label01-expected.txt:
        * fast/forms/HTMLOptionElement_label01-expected.png:
        * fast/forms/HTMLOptionElement_label02.html:
        * fast/forms/HTMLOptionElement_label02-expected.txt:
        * fast/forms/HTMLOptionElement_label02-expected.png:
        * fast/forms/HTMLOptionElement_label03.html:
        * fast/forms/HTMLOptionElement_label03-expected.txt:
        * fast/forms/HTMLOptionElement_label03-expected.png
        * fast/forms/HTMLOptionElement_label04.html:
        * fast/forms/HTMLOptionElement_label04-expected.txt:
        * fast/forms/HTMLOptionElement_label04-expected.png
        * fast/forms/HTMLOptionElement_label05.html:
        * fast/forms/HTMLOptionElement_label05-expected.txt:
        * fast/forms/HTMLOptionElement_label05-expected.png:
        Updated to reflect success and added some description
        
        * fast/forms/HTMLOptionElement_label06.html:
        * fast/forms/HTMLOptionElement_label06-expected.txt:
        * fast/forms/HTMLOptionElement_label05-expected.png:
        * fast/forms/HTMLOptionElement_label07.html:
        * fast/forms/HTMLOptionElement_label07-expected.txt:
        * fast/forms/HTMLOptionElement_label07-expected.png:
        Added.

WebCore:

        Reviewed by Maciej and Adele

        Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8398
        REGRESSION: LABEL in OPTION element is clobbering display #TEXT
        Patch provided by Darin.
        
        * rendering/RenderSelect.cpp
        (RenderSelect::updateFromElement): 
        Changed to use the containing text by default, and not the label text



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@14679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7869e236
2006-06-01 David Carson <dacarson@gmail.com>
Reviewed by Maciej and Adele
Tests for http://bugzilla.opendarwin.org/show_bug.cgi?id=8398
Updated and extended select/option form tests
* fast/forms/HTMLOptionElement_label01.html:
* fast/forms/HTMLOptionElement_label01-expected.txt:
* fast/forms/HTMLOptionElement_label01-expected.png:
* fast/forms/HTMLOptionElement_label02.html:
* fast/forms/HTMLOptionElement_label02-expected.txt:
* fast/forms/HTMLOptionElement_label02-expected.png:
* fast/forms/HTMLOptionElement_label03.html:
* fast/forms/HTMLOptionElement_label03-expected.txt:
* fast/forms/HTMLOptionElement_label03-expected.png
* fast/forms/HTMLOptionElement_label04.html:
* fast/forms/HTMLOptionElement_label04-expected.txt:
* fast/forms/HTMLOptionElement_label04-expected.png
* fast/forms/HTMLOptionElement_label05.html:
* fast/forms/HTMLOptionElement_label05-expected.txt:
* fast/forms/HTMLOptionElement_label05-expected.png:
Updated to reflect success and added some description
* fast/forms/HTMLOptionElement_label06.html:
* fast/forms/HTMLOptionElement_label06-expected.txt:
* fast/forms/HTMLOptionElement_label05-expected.png:
* fast/forms/HTMLOptionElement_label07.html:
* fast/forms/HTMLOptionElement_label07-expected.txt:
* fast/forms/HTMLOptionElement_label07-expected.png:
Added.
2006-06-01 David Carson <dacarson@gmail.com>
Reviewed by Hyatt
75dbc993b3353c9418ecb9ec0f72dc29
\ No newline at end of file
b2111e5de6977b83d86103ae1dcd7408
\ No newline at end of file
......@@ -3,5 +3,8 @@ layer 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
RenderSelect {SELECT} at (2,2) size 38x18
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
RenderSelect {SELECT} at (2,20) size 197x18
RenderText {#text} at (0,0) size 0x0
<select><option label="1">the label for this element is "1"</option></select>
\ No newline at end of file
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>
f82a02cc8580d0b103828524c66bfbf4
\ No newline at end of file
889f1936ba4389da5e898b9c4ae87ba2
\ No newline at end of file
......@@ -3,5 +3,8 @@ layer 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
RenderSelect {SELECT} at (2,2) size 36x18
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
RenderSelect {SELECT} at (2,20) size 309x18
RenderText {#text} at (0,0) size 0x0
<select><option label="">empty label should display empty string to match IE</option></select>
\ No newline at end of file
With the label empty, the enclosing text is used.<br>
<select>
<option label="">empty label should display empty string to match IE</option>
</select>
f82a02cc8580d0b103828524c66bfbf4
\ No newline at end of file
50f731b6421252a89ab0784a3185c53d
\ No newline at end of file
......@@ -3,5 +3,8 @@ layer 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
RenderSelect {SELECT} at (2,2) size 36x18
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
RenderSelect {SELECT} at (2,20) size 338x18
RenderText {#text} at (0,0) size 0x0
<select><option label=" ">white space label should display empty string to match IE</option></select>
\ No newline at end of file
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>
f82a02cc8580d0b103828524c66bfbf4
\ No newline at end of file
b3b94f99be537fe0458811765c33b5c4
\ No newline at end of file
......@@ -3,5 +3,8 @@ layer 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
RenderSelect {SELECT} at (2,2) size 36x18
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
RenderSelect {SELECT} at (2,20) size 464x18
RenderText {#text} at (0,0) size 0x0
<select><option label>the label attribute is mentioned but no value is specified; this text should appear</option></select>
\ No newline at end of file
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>
1aed407505967364c112395ee76359fb
\ No newline at end of file
4e5bf2bb603a97f4173e63946bf94d11
\ No newline at end of file
......@@ -3,5 +3,8 @@ layer 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
RenderSelect {SELECT} at (2,2) size 149x72
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
RenderSelect {SELECT} at (2,20) size 144x72
RenderText {#text} at (0,0) size 0x0
<select size="5"><option label="This label should appear">This text should not appear</option></select>
\ No newline at end of file
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>
43b7e2d07d9c41409466664d13812d7c
\ No newline at end of file
layer at (0,0) size 800x600
RenderCanvas 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
RenderSelect {SELECT} at (2,20) size 53x18
RenderText {#text} at (0,0) size 0x0
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>
606805bddcfef40e61bfb8426f74ecd7
\ No newline at end of file
layer at (0,0) size 800x600
RenderCanvas 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
RenderSelect {SELECT} at (2,38) size 36x18
RenderText {#text} at (0,0) size 0x0
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>
2006-06-01 David Carson <dacarson@gmail.com>
Reviewed by Maciej and Adele
Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8398
REGRESSION: LABEL in OPTION element is clobbering display #TEXT
Patch provided by Darin.
* rendering/RenderSelect.cpp
(RenderSelect::updateFromElement):
Changed to use the containing text by default, and not the label text
2006-06-01 David Carson <dacarson@gmail.com>
Reviewed by Hyatt.
......
......@@ -133,11 +133,9 @@ void RenderSelect::updateFromElement()
static_cast<QComboBox*>(m_widget)->appendGroupLabel(label);
} else if (listItems[listIndex]->hasTagName(optionTag)) {
HTMLOptionElement* optionElement = static_cast<HTMLOptionElement*>(listItems[listIndex]);
DeprecatedString itemText;
if (optionElement->hasAttribute(labelAttr))
DeprecatedString itemText = optionElement->text().deprecatedString();
if (itemText.isEmpty())
itemText = optionElement->getAttribute(labelAttr).deprecatedString();
else
itemText = optionElement->text().deprecatedString();
itemText.replace('\\', backslashAsCurrencySymbol());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment