Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2060)

Side by Side Diff: WebCore/html/HTMLProgressElement.cpp

Issue 5772004: Merge 73488 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/597/
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « WebCore/html/HTMLProgressElement.h ('k') | WebCore/rendering/RenderIndicator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « WebCore/html/HTMLProgressElement.h ('k') | WebCore/rendering/RenderIndicator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698