| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 if (attribute->name() == valueAttr) { | 63 if (attribute->name() == valueAttr) { |
| 64 if (renderer()) | 64 if (renderer()) |
| 65 renderer()->updateFromElement(); | 65 renderer()->updateFromElement(); |
| 66 } else if (attribute->name() == maxAttr) { | 66 } else if (attribute->name() == maxAttr) { |
| 67 if (renderer()) | 67 if (renderer()) |
| 68 renderer()->updateFromElement(); | 68 renderer()->updateFromElement(); |
| 69 } else | 69 } else |
| 70 HTMLFormControlElement::parseMappedAttribute(attribute); | 70 HTMLFormControlElement::parseMappedAttribute(attribute); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void HTMLProgressElement::attach() |
| 74 { |
| 75 HTMLFormControlElement::attach(); |
| 76 if (renderer()) |
| 77 renderer()->updateFromElement(); |
| 78 } |
| 79 |
| 73 double HTMLProgressElement::value() const | 80 double HTMLProgressElement::value() const |
| 74 { | 81 { |
| 75 const AtomicString& valueString = getAttribute(valueAttr); | 82 const AtomicString& valueString = getAttribute(valueAttr); |
| 76 double value; | 83 double value; |
| 77 bool ok = parseToDoubleForNumberType(valueString, &value); | 84 bool ok = parseToDoubleForNumberType(valueString, &value); |
| 78 if (!ok || value < 0) | 85 if (!ok || value < 0) |
| 79 return valueString.isNull() ? 1 : 0; | 86 return valueString.isNull() ? 1 : 0; |
| 80 return (value > max()) ? max() : value; | 87 return (value > max()) ? max() : value; |
| 81 } | 88 } |
| 82 | 89 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 109 | 116 |
| 110 double HTMLProgressElement::position() const | 117 double HTMLProgressElement::position() const |
| 111 { | 118 { |
| 112 if (!hasAttribute(valueAttr)) | 119 if (!hasAttribute(valueAttr)) |
| 113 return -1; | 120 return -1; |
| 114 return value() / max(); | 121 return value() / max(); |
| 115 } | 122 } |
| 116 | 123 |
| 117 } // namespace | 124 } // namespace |
| 118 #endif | 125 #endif |
| OLD | NEW |