OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserv
ed. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserv
ed. |
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 } | 89 } |
90 | 90 |
91 void HTMLOptGroupElement::detach(const AttachContext& context) | 91 void HTMLOptGroupElement::detach(const AttachContext& context) |
92 { | 92 { |
93 m_style.clear(); | 93 m_style.clear(); |
94 HTMLElement::detach(context); | 94 HTMLElement::detach(context); |
95 } | 95 } |
96 | 96 |
97 void HTMLOptGroupElement::updateNonRenderStyle() | 97 void HTMLOptGroupElement::updateNonRenderStyle() |
98 { | 98 { |
| 99 bool oldDisplayNoneStatus = isDisplayNone(); |
99 m_style = originalStyleForRenderer(); | 100 m_style = originalStyleForRenderer(); |
| 101 if (oldDisplayNoneStatus != isDisplayNone()) { |
| 102 if (HTMLSelectElement* select = ownerSelectElement()) |
| 103 select->updateListOnRenderer(); |
| 104 } |
100 } | 105 } |
101 | 106 |
102 RenderStyle* HTMLOptGroupElement::nonRendererStyle() const | 107 RenderStyle* HTMLOptGroupElement::nonRendererStyle() const |
103 { | 108 { |
104 return m_style.get(); | 109 return m_style.get(); |
105 } | 110 } |
106 | 111 |
107 PassRefPtr<RenderStyle> HTMLOptGroupElement::customStyleForRenderer() | 112 PassRefPtr<RenderStyle> HTMLOptGroupElement::customStyleForRenderer() |
108 { | 113 { |
109 updateNonRenderStyle(); | 114 updateNonRenderStyle(); |
(...skipping 18 matching lines...) Expand all Loading... |
128 } | 133 } |
129 | 134 |
130 void HTMLOptGroupElement::accessKeyAction(bool) | 135 void HTMLOptGroupElement::accessKeyAction(bool) |
131 { | 136 { |
132 HTMLSelectElement* select = ownerSelectElement(); | 137 HTMLSelectElement* select = ownerSelectElement(); |
133 // send to the parent to bring focus to the list box | 138 // send to the parent to bring focus to the list box |
134 if (select && !select->focused()) | 139 if (select && !select->focused()) |
135 select->accessKeyAction(false); | 140 select->accessKeyAction(false); |
136 } | 141 } |
137 | 142 |
| 143 bool HTMLOptGroupElement::isDisplayNone() const |
| 144 { |
| 145 RenderStyle* style = nonRendererStyle(); |
| 146 return style && style->display() == NONE; |
| 147 } |
| 148 |
138 } // namespace | 149 } // namespace |
OLD | NEW |