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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 void HTMLProgressElement::parseAttribute(const QualifiedName& name, const Atomic
String& value) | 83 void HTMLProgressElement::parseAttribute(const QualifiedName& name, const Atomic
String& value) |
84 { | 84 { |
85 if (name == valueAttr) | 85 if (name == valueAttr) |
86 didElementStateChange(); | 86 didElementStateChange(); |
87 else if (name == maxAttr) | 87 else if (name == maxAttr) |
88 didElementStateChange(); | 88 didElementStateChange(); |
89 else | 89 else |
90 LabelableElement::parseAttribute(name, value); | 90 LabelableElement::parseAttribute(name, value); |
91 } | 91 } |
92 | 92 |
93 void HTMLProgressElement::attach() | 93 void HTMLProgressElement::attach(const AttachContext& context) |
94 { | 94 { |
95 LabelableElement::attach(); | 95 LabelableElement::attach(context); |
96 if (RenderProgress* render = renderProgress()) | 96 if (RenderProgress* render = renderProgress()) |
97 render->updateFromElement(); | 97 render->updateFromElement(); |
98 } | 98 } |
99 | 99 |
100 double HTMLProgressElement::value() const | 100 double HTMLProgressElement::value() const |
101 { | 101 { |
102 double value = parseToDoubleForNumberType(fastGetAttribute(valueAttr)); | 102 double value = parseToDoubleForNumberType(fastGetAttribute(valueAttr)); |
103 return !std::isfinite(value) || value < 0 ? 0 : std::min(value, max()); | 103 return !std::isfinite(value) || value < 0 ? 0 : std::min(value, max()); |
104 } | 104 } |
105 | 105 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 | 165 |
166 inner->appendChild(bar, ASSERT_NO_EXCEPTION); | 166 inner->appendChild(bar, ASSERT_NO_EXCEPTION); |
167 } | 167 } |
168 | 168 |
169 bool HTMLProgressElement::shouldAppearIndeterminate() const | 169 bool HTMLProgressElement::shouldAppearIndeterminate() const |
170 { | 170 { |
171 return !isDeterminate(); | 171 return !isDeterminate(); |
172 } | 172 } |
173 | 173 |
174 } // namespace | 174 } // namespace |
OLD | NEW |