| Differences between
and this patch
- a/Source/WebCore/ChangeLog +27 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2015-11-17  Keith Rollin  <krollin@apple.com>
2
3
        [Win] fast/forms/HTMLOptionElement_label03.html failing on win7
4
        https://bugs.webkit.org/show_bug.cgi?id=150909
5
        rdar://problem/23539673
6
7
        Reviewed by Darin Adler.
8
9
        When returning text to be displayed, an <option> element will return
10
        the value of a label attribute if it exists, or the text content as a
11
        fallback. The failing test concerned the display of a <select>
12
        element when it contained a sole <option> element that had a label
13
        attribute set to a single space. When displayed, various
14
        platform-specific bits of code will strip off the leading and trailing
15
        whitespace. However, when WebKit would use this text to measure how
16
        wide the <select> popup menu button should be, it would not strip off
17
        spaces, leading to the calculated width being wider than necessary.
18
        The approach taken to fix this is to strip whitespace in the label
19
        attribute before it is returned from the <option> element.
20
21
        No new tests. fast/forms/HTMLOptionElement_label03.html had been
22
        marked as being expected to fail in TestExpectations; that test now
23
        succeeds.
24
25
        * html/HTMLOptionElement.cpp:
26
        (WebCore::HTMLOptionElement::label):
27
1
2015-11-13  Jiewen Tan  <jiewen_tan@apple.com>
28
2015-11-13  Jiewen Tan  <jiewen_tan@apple.com>
2
29
3
        Element::focus() should acquire the ownership of Frame.
30
        Element::focus() should acquire the ownership of Frame.
- a/Source/WebCore/html/HTMLOptionElement.cpp -2 / +2 lines
Lines 265-273 HTMLSelectElement* HTMLOptionElement::ownerSelectElement() const a/Source/WebCore/html/HTMLOptionElement.cpp_sec1
265
265
266
String HTMLOptionElement::label() const
266
String HTMLOptionElement::label() const
267
{
267
{
268
    const AtomicString& label = fastGetAttribute(labelAttr);
268
    String label = fastGetAttribute(labelAttr);
269
    if (!label.isNull())
269
    if (!label.isNull())
270
        return label; 
270
        return label.stripWhiteSpace(isHTMLSpace);
271
    return collectOptionInnerText().stripWhiteSpace(isHTMLSpace).simplifyWhiteSpace(isHTMLSpace);
271
    return collectOptionInnerText().stripWhiteSpace(isHTMLSpace).simplifyWhiteSpace(isHTMLSpace);
272
}
272
}
273
273
- a/LayoutTests/ChangeLog +17 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2015-11-17  Keith Rollin  <krollin@apple.com>
2
3
        [Win] fast/forms/HTMLOptionElement_label03.html failing on win7
4
        https://bugs.webkit.org/show_bug.cgi?id=150909
5
        rdar://problem/23539673
6
7
        Reviewed by Darin Adler.
8
9
        Mark fast/forms/HTMLOptionElement_label03.html as being expected to
10
        pass. Also update some text in HTMLOptionElement_label02.html and
11
        HTMLOptionElement_label03.html so that it no longer refers to our
12
        trying to match IE (which we are no longer doing).
13
14
        * fast/forms/HTMLOptionElement_label02.html:
15
        * fast/forms/HTMLOptionElement_label03.html:
16
        * platform/win/TestExpectations:
17
1
2015-11-13  Jiewen Tan  <jiewen_tan@apple.com>
18
2015-11-13  Jiewen Tan  <jiewen_tan@apple.com>
2
19
3
        Element::focus() should acquire the ownership of Frame.
20
        Element::focus() should acquire the ownership of Frame.
- a/LayoutTests/fast/forms/HTMLOptionElement_label02.html -1 / +1 lines
Lines 2-7 a/LayoutTests/fast/forms/HTMLOptionElement_label02.html_sec1
2
<!-- Even though it's empty, the label exists, so it is used. -->
2
<!-- Even though it's empty, the label exists, so it is used. -->
3
<body>
3
<body>
4
    <select>
4
    <select>
5
        <option label="">empty label should display empty string to match IE</option>
5
        <option label="">empty label should display empty string</option>
6
    </select>
6
    </select>
7
</body>
7
</body>
- a/LayoutTests/fast/forms/HTMLOptionElement_label03.html -1 / +1 lines
Lines 2-7 a/LayoutTests/fast/forms/HTMLOptionElement_label03.html_sec1
2
<!-- Even though the label is nothing but whitespace, it exists, so it it used. -->
2
<!-- Even though the label is nothing but whitespace, it exists, so it it used. -->
3
<body>
3
<body>
4
    <select>
4
    <select>
5
        <option label=" ">white space label should display empty string to match IE</option>
5
        <option label=" ">white space label should display empty string</option>
6
    </select>
6
    </select>
7
</body>
7
</body>
- a/LayoutTests/platform/win/TestExpectations -2 lines
Lines 2133-2140 fast/forms/state-restore-to-non-autocomplete-form.html [ Skip ] a/LayoutTests/platform/win/TestExpectations_sec1
2133
fast/forms/state-restore-to-non-edited-controls.html [ Skip ]
2133
fast/forms/state-restore-to-non-edited-controls.html [ Skip ]
2134
fast/forms/state-save-of-detached-control.html [ Skip ]
2134
fast/forms/state-save-of-detached-control.html [ Skip ]
2135
fast/forms/textarea/textarea-state-restore.html [ Skip ]
2135
fast/forms/textarea/textarea-state-restore.html [ Skip ]
2136
2137
webkit.org/b/150909 fast/forms/HTMLOptionElement_label03.html [ ImageOnlyFailure ]
2138
################################################################################
2136
################################################################################
2139
#################          End Forms Issues              #######################
2137
#################          End Forms Issues              #######################
2140
################################################################################
2138
################################################################################

Return to Bug 150909