Commit f5461080 authored by rwlbuis@webkit.org's avatar rwlbuis@webkit.org
Browse files

2011-01-17 Rob Buis <rwlbuis@gmail.com>

        Reviewed by Kent Tamura.

        Color changes to option elements in a select multiple aren't drawn immediately
        https://bugs.webkit.org/show_bug.cgi?id=49790

        Redirect style changes on <option> element to the owner <select> element.

        Tests: fast/forms/select-option-background-color-change.html
               fast/forms/select-option-color-change.html
               fast/forms/select-option-visibility-change.html

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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76002 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 462c3ea4
2011-01-17 Rob Buis <rwlbuis@gmail.com>
Reviewed by Kent Tamura.
Add tests for:
Color changes to option elements in a select multiple aren't drawn immediately
https://bugs.webkit.org/show_bug.cgi?id=49790
* fast/forms/select-option-background-color-change.html: Added.
* fast/forms/select-option-color-change.html: Added.
* fast/forms/select-option-visibility-change.html: Added.
* platform/mac/fast/forms/select-option-background-color-change-expected.checksum: Added.
* platform/mac/fast/forms/select-option-background-color-change-expected.png: Added.
* platform/mac/fast/forms/select-option-background-color-change-expected.txt: Added.
* platform/mac/fast/forms/select-option-color-change-expected.checksum: Added.
* platform/mac/fast/forms/select-option-color-change-expected.png: Added.
* platform/mac/fast/forms/select-option-color-change-expected.txt: Added.
* platform/mac/fast/forms/select-option-visibility-change-expected.checksum: Added.
* platform/mac/fast/forms/select-option-visibility-change-expected.png: Added.
* platform/mac/fast/forms/select-option-visibility-change-expected.txt: Added.
2011-01-17 Steve Lacey <sjl@chromium.org>
 
Reviewed by David Levin.
......
<html>
<head>
<script>
function test()
{
if (window.layoutTestController)
layoutTestController.waitUntilDone();
document.getElementById('option').style.backgroundColor = 'green';
if (window.layoutTestController)
layoutTestController.notifyDone();
}
</script>
</head>
</html>
<body onload="setTimeout(test, 0)">
<p>This tests changing the background color of an option element updates the listbox</p>
<select multiple="multiple">
<option id="option" value="A">A</option>
</select>
</body>
</html>
<html>
<head>
<script>
function test()
{
if (window.layoutTestController)
layoutTestController.waitUntilDone();
document.getElementById('option').style.color = 'green';
if (window.layoutTestController)
layoutTestController.notifyDone();
}
</script>
</head>
</html>
<body onload="setTimeout(test, 0)">
<p>This tests changing the color of an option element updates the listbox</p>
<select multiple="multiple">
<option id="option" value="A">A</option>
</select>
</body>
</html>
<html>
<head>
<script>
function test()
{
if (window.layoutTestController)
layoutTestController.waitUntilDone();
document.getElementById('option').style.visibility = 'hidden';
if (window.layoutTestController)
layoutTestController.notifyDone();
}
</script>
</head>
</html>
<body onload="setTimeout(test, 0)">
<p>This tests changing the visibility of an option element updates the listbox</p>
<select multiple="multiple">
<option id="option" value="A">A</option>
</select>
</body>
</html>
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
RenderBlock {P} at (0,0) size 784x18
RenderText {#text} at (0,0) size 513x18
text run at (0,0) width 513: "This tests changing the background color of an option element updates the listbox"
RenderBlock (anonymous) at (0,34) size 784x61
RenderListBox {SELECT} at (2,2) size 25x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
RenderText {#text} at (0,0) size 0x0
b49a6a3ceaaa2b191e5ae3ddaad26d45
\ No newline at end of file
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
RenderBlock {P} at (0,0) size 784x18
RenderText {#text} at (0,0) size 434x18
text run at (0,0) width 434: "This tests changing the color of an option element updates the listbox"
RenderBlock (anonymous) at (0,34) size 784x61
RenderListBox {SELECT} at (2,2) size 25x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
RenderText {#text} at (0,0) size 0x0
17abce5648df50a5ddc718119e15ab7e
\ No newline at end of file
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
RenderBlock {P} at (0,0) size 784x18
RenderText {#text} at (0,0) size 456x18
text run at (0,0) width 456: "This tests changing the visibility of an option element updates the listbox"
RenderBlock (anonymous) at (0,34) size 784x61
RenderListBox {SELECT} at (2,2) size 25x57 [bgcolor=#FFFFFF] [border: (1px inset #808080)]
RenderText {#text} at (0,0) size 0x0
2011-01-17 Rob Buis <rwlbuis@gmail.com>
Reviewed by Kent Tamura.
Color changes to option elements in a select multiple aren't drawn immediately
https://bugs.webkit.org/show_bug.cgi?id=49790
Redirect style changes on <option> element to the owner <select> element.
Tests: fast/forms/select-option-background-color-change.html
fast/forms/select-option-color-change.html
fast/forms/select-option-visibility-change.html
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::setRenderStyle):
2011-01-17 MORITA Hajime <morrita@google.com>
 
Unreviewed, rolling out r75995.
......
......@@ -221,6 +221,9 @@ String HTMLOptionElement::label() const
void HTMLOptionElement::setRenderStyle(PassRefPtr<RenderStyle> newStyle)
{
m_style = newStyle;
if (HTMLSelectElement* select = ownerSelectElement())
if (RenderObject* renderer = select->renderer())
renderer->repaint();
}
RenderStyle* HTMLOptionElement::nonRendererRenderStyle() const
......
Supports Markdown
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