| 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 19 matching lines...) Expand all Loading... |
| 30 #include "core/html/parser/HTMLParserIdioms.h" | 30 #include "core/html/parser/HTMLParserIdioms.h" |
| 31 #include "core/html/shadow/MeterShadowElement.h" | 31 #include "core/html/shadow/MeterShadowElement.h" |
| 32 #include "core/page/Page.h" | 32 #include "core/page/Page.h" |
| 33 #include "core/rendering/RenderMeter.h" | 33 #include "core/rendering/RenderMeter.h" |
| 34 #include "core/rendering/RenderTheme.h" | 34 #include "core/rendering/RenderTheme.h" |
| 35 | 35 |
| 36 namespace WebCore { | 36 namespace WebCore { |
| 37 | 37 |
| 38 using namespace HTMLNames; | 38 using namespace HTMLNames; |
| 39 | 39 |
| 40 HTMLMeterElement::HTMLMeterElement(const QualifiedName& tagName, Document& docum
ent) | 40 HTMLMeterElement::HTMLMeterElement(Document& document) |
| 41 : LabelableElement(tagName, document) | 41 : LabelableElement(meterTag, document) |
| 42 { | 42 { |
| 43 ASSERT(hasTagName(meterTag)); | |
| 44 ScriptWrappable::init(this); | 43 ScriptWrappable::init(this); |
| 45 } | 44 } |
| 46 | 45 |
| 47 HTMLMeterElement::~HTMLMeterElement() | 46 HTMLMeterElement::~HTMLMeterElement() |
| 48 { | 47 { |
| 49 } | 48 } |
| 50 | 49 |
| 51 PassRefPtr<HTMLMeterElement> HTMLMeterElement::create(const QualifiedName& tagNa
me, Document& document) | 50 PassRefPtr<HTMLMeterElement> HTMLMeterElement::create(Document& document) |
| 52 { | 51 { |
| 53 RefPtr<HTMLMeterElement> meter = adoptRef(new HTMLMeterElement(tagName, docu
ment)); | 52 RefPtr<HTMLMeterElement> meter = adoptRef(new HTMLMeterElement(document)); |
| 54 meter->ensureUserAgentShadowRoot(); | 53 meter->ensureUserAgentShadowRoot(); |
| 55 return meter; | 54 return meter; |
| 56 } | 55 } |
| 57 | 56 |
| 58 RenderObject* HTMLMeterElement::createRenderer(RenderStyle* style) | 57 RenderObject* HTMLMeterElement::createRenderer(RenderStyle* style) |
| 59 { | 58 { |
| 60 if (hasAuthorShadowRoot() || !RenderTheme::theme().supportsMeter(style->appe
arance())) | 59 if (hasAuthorShadowRoot() || !RenderTheme::theme().supportsMeter(style->appe
arance())) |
| 61 return RenderObject::createObject(this, style); | 60 return RenderObject::createObject(this, style); |
| 62 | 61 |
| 63 return new RenderMeter(this); | 62 return new RenderMeter(this); |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 RefPtr<MeterBarElement> bar = MeterBarElement::create(document()); | 230 RefPtr<MeterBarElement> bar = MeterBarElement::create(document()); |
| 232 m_value = MeterValueElement::create(document()); | 231 m_value = MeterValueElement::create(document()); |
| 233 m_value->setWidthPercentage(0); | 232 m_value->setWidthPercentage(0); |
| 234 m_value->updatePseudo(); | 233 m_value->updatePseudo(); |
| 235 bar->appendChild(m_value); | 234 bar->appendChild(m_value); |
| 236 | 235 |
| 237 inner->appendChild(bar); | 236 inner->appendChild(bar); |
| 238 } | 237 } |
| 239 | 238 |
| 240 } // namespace | 239 } // namespace |
| OLD | NEW |