Title: [193368] trunk
Revision
193368
Author
commit-qu...@webkit.org
Date
2015-12-03 12:46:13 -0800 (Thu, 03 Dec 2015)

Log Message

[Win] fast/forms/HTMLOptionElement_label03.html failing on win7
https://bugs.webkit.org/show_bug.cgi?id=150909
rdar://problem/23539673

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

Source/WebCore:

When returning text to be displayed, an <option> element will return
the value of a label attribute if it exists, or the text content as a
fallback. The failing test concerned the display of a <select>
element when it contained a sole <option> element that had a label
attribute set to a single space. When displayed, various
platform-specific bits of code will strip off the leading and trailing
whitespace. However, when WebKit would use this text to measure how
wide the <select> popup menu button should be, it would not strip off
spaces, leading to the calculated width being wider than necessary.
The approach taken to fix this is to strip whitespace in the label
attribute before it is returned from the <option> element.

No new tests. fast/forms/HTMLOptionElement_label03.html had been
marked as being expected to fail in TestExpectations; that test now
succeeds.

* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::label):

LayoutTests:

Mark fast/forms/HTMLOptionElement_label03.html as being expected to
pass. Also update some text in HTMLOptionElement_label02.html and
HTMLOptionElement_label03.html so that it no longer refers to our
trying to match IE (which we are no longer doing).

* fast/forms/HTMLOptionElement_label02.html:
* fast/forms/HTMLOptionElement_label03.html:
* platform/win/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (193367 => 193368)


--- trunk/LayoutTests/ChangeLog	2015-12-03 20:44:12 UTC (rev 193367)
+++ trunk/LayoutTests/ChangeLog	2015-12-03 20:46:13 UTC (rev 193368)
@@ -1,3 +1,20 @@
+2015-12-03  Keith Rollin  <krol...@apple.com>
+
+        [Win] fast/forms/HTMLOptionElement_label03.html failing on win7
+        https://bugs.webkit.org/show_bug.cgi?id=150909
+        rdar://problem/23539673
+
+        Reviewed by Darin Adler.
+
+        Mark fast/forms/HTMLOptionElement_label03.html as being expected to
+        pass. Also update some text in HTMLOptionElement_label02.html and
+        HTMLOptionElement_label03.html so that it no longer refers to our
+        trying to match IE (which we are no longer doing).
+
+        * fast/forms/HTMLOptionElement_label02.html:
+        * fast/forms/HTMLOptionElement_label03.html:
+        * platform/win/TestExpectations:
+
 2015-12-03  Brady Eidson  <beid...@apple.com>
 
         Modern IDB: storage/indexeddb/cursor-advance.html fails.

Modified: trunk/LayoutTests/fast/forms/HTMLOptionElement_label02.html (193367 => 193368)


--- trunk/LayoutTests/fast/forms/HTMLOptionElement_label02.html	2015-12-03 20:44:12 UTC (rev 193367)
+++ trunk/LayoutTests/fast/forms/HTMLOptionElement_label02.html	2015-12-03 20:46:13 UTC (rev 193368)
@@ -2,6 +2,6 @@
 <!-- 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>
+        <option label="">empty label should display empty string</option>
     </select>
 </body>

Modified: trunk/LayoutTests/fast/forms/HTMLOptionElement_label03.html (193367 => 193368)


--- trunk/LayoutTests/fast/forms/HTMLOptionElement_label03.html	2015-12-03 20:44:12 UTC (rev 193367)
+++ trunk/LayoutTests/fast/forms/HTMLOptionElement_label03.html	2015-12-03 20:46:13 UTC (rev 193368)
@@ -2,6 +2,6 @@
 <!-- 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>
+        <option label=" ">white space label should display empty string</option>
     </select>
 </body>

Modified: trunk/LayoutTests/platform/win/TestExpectations (193367 => 193368)


--- trunk/LayoutTests/platform/win/TestExpectations	2015-12-03 20:44:12 UTC (rev 193367)
+++ trunk/LayoutTests/platform/win/TestExpectations	2015-12-03 20:46:13 UTC (rev 193368)
@@ -2145,8 +2145,6 @@
 fast/forms/state-restore-to-non-edited-controls.html [ Skip ]
 fast/forms/state-save-of-detached-control.html [ Skip ]
 fast/forms/textarea/textarea-state-restore.html [ Skip ]
-
-webkit.org/b/150909 fast/forms/HTMLOptionElement_label03.html [ ImageOnlyFailure ]
 ################################################################################
 #################          End Forms Issues              #######################
 ################################################################################

Modified: trunk/Source/WebCore/ChangeLog (193367 => 193368)


--- trunk/Source/WebCore/ChangeLog	2015-12-03 20:44:12 UTC (rev 193367)
+++ trunk/Source/WebCore/ChangeLog	2015-12-03 20:46:13 UTC (rev 193368)
@@ -1,3 +1,30 @@
+2015-12-03  Keith Rollin  <krol...@apple.com>
+
+        [Win] fast/forms/HTMLOptionElement_label03.html failing on win7
+        https://bugs.webkit.org/show_bug.cgi?id=150909
+        rdar://problem/23539673
+
+        Reviewed by Darin Adler.
+
+        When returning text to be displayed, an <option> element will return
+        the value of a label attribute if it exists, or the text content as a
+        fallback. The failing test concerned the display of a <select>
+        element when it contained a sole <option> element that had a label
+        attribute set to a single space. When displayed, various
+        platform-specific bits of code will strip off the leading and trailing
+        whitespace. However, when WebKit would use this text to measure how
+        wide the <select> popup menu button should be, it would not strip off
+        spaces, leading to the calculated width being wider than necessary.
+        The approach taken to fix this is to strip whitespace in the label
+        attribute before it is returned from the <option> element.
+
+        No new tests. fast/forms/HTMLOptionElement_label03.html had been
+        marked as being expected to fail in TestExpectations; that test now
+        succeeds.
+
+        * html/HTMLOptionElement.cpp:
+        (WebCore::HTMLOptionElement::label):
+
 2015-12-03  Sam Weinig  <s...@webkit.org>
 
         Try to fix the Windows build.

Modified: trunk/Source/WebCore/html/HTMLOptionElement.cpp (193367 => 193368)


--- trunk/Source/WebCore/html/HTMLOptionElement.cpp	2015-12-03 20:44:12 UTC (rev 193367)
+++ trunk/Source/WebCore/html/HTMLOptionElement.cpp	2015-12-03 20:46:13 UTC (rev 193368)
@@ -265,9 +265,9 @@
 
 String HTMLOptionElement::label() const
 {
-    const AtomicString& label = fastGetAttribute(labelAttr);
+    String label = fastGetAttribute(labelAttr);
     if (!label.isNull())
-        return label; 
+        return label.stripWhiteSpace(isHTMLSpace);
     return collectOptionInnerText().stripWhiteSpace(isHTMLSpace).simplifyWhiteSpace(isHTMLSpace);
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to