Chromium Code Reviews| Index: Source/core/html/HTMLOptionElement.cpp |
| diff --git a/Source/core/html/HTMLOptionElement.cpp b/Source/core/html/HTMLOptionElement.cpp |
| index c0b02f12ef71b46fdeb0ba02b6d1e17bed4813ba..05d36a35f80c77e1d74f69dc1adbf598b5ee5e53 100644 |
| --- a/Source/core/html/HTMLOptionElement.cpp |
| +++ b/Source/core/html/HTMLOptionElement.cpp |
| @@ -303,7 +303,12 @@ RenderStyle* HTMLOptionElement::nonRendererStyle() const |
| PassRefPtr<RenderStyle> HTMLOptionElement::customStyleForRenderer() |
| { |
| + RefPtr<RenderStyle> oldStyle = m_style; |
| updateNonRenderStyle(); |
| + if ((m_style->display() == NONE || (!oldStyle || oldStyle->display() == NONE)) && (!oldStyle || (m_style->display() != oldStyle->display()))) { |
|
esprehn
2014/03/21 20:43:39
This can be much simpler, just do:
bool wasDispla
spartha
2014/03/21 21:29:03
Done.
|
| + if (HTMLSelectElement* select = ownerSelectElement()) |
| + select->updateListOnRenderer(); |
| + } |
| return m_style; |
| } |
| @@ -375,4 +380,10 @@ HTMLFormElement* HTMLOptionElement::form() const |
| return 0; |
| } |
| +bool HTMLOptionElement::isDisplayNone() const |
| +{ |
| + RenderStyle* style = nonRendererStyle(); |
| + return style && style->display() == NONE; |
| +} |
| + |
| } // namespace WebCore |