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 20 matching lines...) Expand all Loading... |
31 #include "core/html/shadow/ProgressShadowElement.h" | 31 #include "core/html/shadow/ProgressShadowElement.h" |
32 #include "core/rendering/RenderProgress.h" | 32 #include "core/rendering/RenderProgress.h" |
33 | 33 |
34 namespace WebCore { | 34 namespace WebCore { |
35 | 35 |
36 using namespace HTMLNames; | 36 using namespace HTMLNames; |
37 | 37 |
38 const double HTMLProgressElement::IndeterminatePosition = -1; | 38 const double HTMLProgressElement::IndeterminatePosition = -1; |
39 const double HTMLProgressElement::InvalidPosition = -2; | 39 const double HTMLProgressElement::InvalidPosition = -2; |
40 | 40 |
41 HTMLProgressElement::HTMLProgressElement(const QualifiedName& tagName, Document&
document) | 41 HTMLProgressElement::HTMLProgressElement(Document& document) |
42 : LabelableElement(tagName, document) | 42 : LabelableElement(progressTag, document) |
43 , m_value(0) | 43 , m_value(0) |
44 { | 44 { |
45 ASSERT(hasTagName(progressTag)); | |
46 ScriptWrappable::init(this); | 45 ScriptWrappable::init(this); |
47 } | 46 } |
48 | 47 |
49 HTMLProgressElement::~HTMLProgressElement() | 48 HTMLProgressElement::~HTMLProgressElement() |
50 { | 49 { |
51 } | 50 } |
52 | 51 |
53 PassRefPtr<HTMLProgressElement> HTMLProgressElement::create(const QualifiedName&
tagName, Document& document) | 52 PassRefPtr<HTMLProgressElement> HTMLProgressElement::create(Document& document) |
54 { | 53 { |
55 RefPtr<HTMLProgressElement> progress = adoptRef(new HTMLProgressElement(tagN
ame, document)); | 54 RefPtr<HTMLProgressElement> progress = adoptRef(new HTMLProgressElement(docu
ment)); |
56 progress->ensureUserAgentShadowRoot(); | 55 progress->ensureUserAgentShadowRoot(); |
57 return progress.release(); | 56 return progress.release(); |
58 } | 57 } |
59 | 58 |
60 RenderObject* HTMLProgressElement::createRenderer(RenderStyle* style) | 59 RenderObject* HTMLProgressElement::createRenderer(RenderStyle* style) |
61 { | 60 { |
62 if (!style->hasAppearance() || hasAuthorShadowRoot()) | 61 if (!style->hasAppearance() || hasAuthorShadowRoot()) |
63 return RenderObject::createObject(this, style); | 62 return RenderObject::createObject(this, style); |
64 | 63 |
65 return new RenderProgress(this); | 64 return new RenderProgress(this); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 | 162 |
164 inner->appendChild(bar); | 163 inner->appendChild(bar); |
165 } | 164 } |
166 | 165 |
167 bool HTMLProgressElement::shouldAppearIndeterminate() const | 166 bool HTMLProgressElement::shouldAppearIndeterminate() const |
168 { | 167 { |
169 return !isDeterminate(); | 168 return !isDeterminate(); |
170 } | 169 } |
171 | 170 |
172 } // namespace | 171 } // namespace |
OLD | NEW |