OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 } | 133 } |
134 | 134 |
135 bool HTMLProgressElement::isDeterminate() const | 135 bool HTMLProgressElement::isDeterminate() const |
136 { | 136 { |
137 return fastHasAttribute(valueAttr); | 137 return fastHasAttribute(valueAttr); |
138 } | 138 } |
139 | 139 |
140 void HTMLProgressElement::didElementStateChange() | 140 void HTMLProgressElement::didElementStateChange() |
141 { | 141 { |
142 m_value->setWidthPercentage(position() * 100); | 142 m_value->setWidthPercentage(position() * 100); |
143 if (renderer()) { | 143 if (renderer() && renderer()->isProgress()) { |
144 RenderProgress* render = toRenderProgress(renderer()); | 144 RenderProgress* render = toRenderProgress(renderer()); |
145 bool wasDeterminate = render->isDeterminate(); | 145 bool wasDeterminate = render->isDeterminate(); |
146 renderer()->updateFromElement(); | 146 renderer()->updateFromElement(); |
147 if (wasDeterminate != isDeterminate()) | 147 if (wasDeterminate != isDeterminate()) |
148 setNeedsStyleRecalc(); | 148 setNeedsStyleRecalc(); |
149 } | 149 } |
150 } | 150 } |
151 | 151 |
152 void HTMLProgressElement::createShadowSubtree() | 152 void HTMLProgressElement::createShadowSubtree() |
153 { | 153 { |
154 ASSERT(!hasShadowRoot()); | 154 ASSERT(!hasShadowRoot()); |
155 | 155 |
156 RefPtr<ProgressBarElement> bar = ProgressBarElement::create(document()); | 156 RefPtr<ProgressBarElement> bar = ProgressBarElement::create(document()); |
157 m_value = ProgressValueElement::create(document()); | 157 m_value = ProgressValueElement::create(document()); |
158 bar->appendChild(m_value, ASSERT_NO_EXCEPTION); | 158 bar->appendChild(m_value, ASSERT_NO_EXCEPTION); |
159 | 159 |
160 RefPtr<ShadowRoot> root = ShadowRoot::create(this, ShadowRoot::CreatingUserA
gentShadowRoot, ASSERT_NO_EXCEPTION); | 160 RefPtr<ShadowRoot> root = ShadowRoot::create(this, ShadowRoot::CreatingUserA
gentShadowRoot, ASSERT_NO_EXCEPTION); |
161 root->appendChild(bar, ASSERT_NO_EXCEPTION); | 161 root->appendChild(bar, ASSERT_NO_EXCEPTION); |
162 } | 162 } |
163 | 163 |
164 } // namespace | 164 } // namespace |
165 #endif | 165 #endif |
OLD | NEW |