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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 87 |
88 void HTMLOptGroupElement::recalcSelectOptions() | 88 void HTMLOptGroupElement::recalcSelectOptions() |
89 { | 89 { |
90 ContainerNode* select = parentNode(); | 90 ContainerNode* select = parentNode(); |
91 while (select && !select->hasTagName(selectTag)) | 91 while (select && !select->hasTagName(selectTag)) |
92 select = select->parentNode(); | 92 select = select->parentNode(); |
93 if (select) | 93 if (select) |
94 toHTMLSelectElement(select)->setRecalcListItems(); | 94 toHTMLSelectElement(select)->setRecalcListItems(); |
95 } | 95 } |
96 | 96 |
97 void HTMLOptGroupElement::attach() | 97 void HTMLOptGroupElement::attach(const AttachContext& context) |
98 { | 98 { |
99 HTMLElement::attach(); | 99 HTMLElement::attach(context); |
100 // If after attaching nothing called styleForRenderer() on this node we | 100 // If after attaching nothing called styleForRenderer() on this node we |
101 // manually cache the value. This happens if our parent doesn't have a | 101 // manually cache the value. This happens if our parent doesn't have a |
102 // renderer like <optgroup> or if it doesn't allow children like <select>. | 102 // renderer like <optgroup> or if it doesn't allow children like <select>. |
103 if (!m_style && parentNode()->renderStyle()) | 103 if (!m_style && parentNode()->renderStyle()) |
104 updateNonRenderStyle(); | 104 updateNonRenderStyle(); |
105 } | 105 } |
106 | 106 |
107 void HTMLOptGroupElement::detach() | 107 void HTMLOptGroupElement::detach(const AttachContext& context) |
108 { | 108 { |
109 m_style.clear(); | 109 m_style.clear(); |
110 HTMLElement::detach(); | 110 HTMLElement::detach(context); |
111 } | 111 } |
112 | 112 |
113 void HTMLOptGroupElement::updateNonRenderStyle() | 113 void HTMLOptGroupElement::updateNonRenderStyle() |
114 { | 114 { |
115 m_style = originalStyleForRenderer(); | 115 m_style = originalStyleForRenderer(); |
116 } | 116 } |
117 | 117 |
118 RenderStyle* HTMLOptGroupElement::nonRendererStyle() const | 118 RenderStyle* HTMLOptGroupElement::nonRendererStyle() const |
119 { | 119 { |
120 return m_style.get(); | 120 return m_style.get(); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 | 154 |
155 void HTMLOptGroupElement::accessKeyAction(bool) | 155 void HTMLOptGroupElement::accessKeyAction(bool) |
156 { | 156 { |
157 HTMLSelectElement* select = ownerSelectElement(); | 157 HTMLSelectElement* select = ownerSelectElement(); |
158 // send to the parent to bring focus to the list box | 158 // send to the parent to bring focus to the list box |
159 if (select && !select->focused()) | 159 if (select && !select->focused()) |
160 select->accessKeyAction(false); | 160 select->accessKeyAction(false); |
161 } | 161 } |
162 | 162 |
163 } // namespace | 163 } // namespace |
OLD | NEW |