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

Side by Side Diff: Source/core/html/HTMLMeterElement.cpp

Issue 23886003: Have HTMLElements / SVGElements constructors take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Another Android build fix Created 7 years, 3 months 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLMeterElement.h ('k') | Source/core/html/HTMLModElement.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 20 matching lines...) Expand all
31 #include "core/html/parser/HTMLParserIdioms.h" 31 #include "core/html/parser/HTMLParserIdioms.h"
32 #include "core/html/shadow/MeterShadowElement.h" 32 #include "core/html/shadow/MeterShadowElement.h"
33 #include "core/page/Page.h" 33 #include "core/page/Page.h"
34 #include "core/rendering/RenderMeter.h" 34 #include "core/rendering/RenderMeter.h"
35 #include "core/rendering/RenderTheme.h" 35 #include "core/rendering/RenderTheme.h"
36 36
37 namespace WebCore { 37 namespace WebCore {
38 38
39 using namespace HTMLNames; 39 using namespace HTMLNames;
40 40
41 HTMLMeterElement::HTMLMeterElement(const QualifiedName& tagName, Document* docum ent) 41 HTMLMeterElement::HTMLMeterElement(const QualifiedName& tagName, Document& docum ent)
42 : LabelableElement(tagName, document) 42 : LabelableElement(tagName, document)
43 { 43 {
44 ASSERT(hasTagName(meterTag)); 44 ASSERT(hasTagName(meterTag));
45 ScriptWrappable::init(this); 45 ScriptWrappable::init(this);
46 } 46 }
47 47
48 HTMLMeterElement::~HTMLMeterElement() 48 HTMLMeterElement::~HTMLMeterElement()
49 { 49 {
50 } 50 }
51 51
52 PassRefPtr<HTMLMeterElement> HTMLMeterElement::create(const QualifiedName& tagNa me, Document* document) 52 PassRefPtr<HTMLMeterElement> HTMLMeterElement::create(const QualifiedName& tagNa me, Document& document)
53 { 53 {
54 RefPtr<HTMLMeterElement> meter = adoptRef(new HTMLMeterElement(tagName, docu ment)); 54 RefPtr<HTMLMeterElement> meter = adoptRef(new HTMLMeterElement(tagName, docu ment));
55 meter->ensureUserAgentShadowRoot(); 55 meter->ensureUserAgentShadowRoot();
56 return meter; 56 return meter;
57 } 57 }
58 58
59 RenderObject* HTMLMeterElement::createRenderer(RenderStyle* style) 59 RenderObject* HTMLMeterElement::createRenderer(RenderStyle* style)
60 { 60 {
61 if (hasAuthorShadowRoot() || !RenderTheme::theme().supportsMeter(style->appe arance())) 61 if (hasAuthorShadowRoot() || !RenderTheme::theme().supportsMeter(style->appe arance()))
62 return RenderObject::createObject(this, style); 62 return RenderObject::createObject(this, style);
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 219
220 RenderObject* renderObject = userAgentShadowRoot()->firstChild()->renderer() ; 220 RenderObject* renderObject = userAgentShadowRoot()->firstChild()->renderer() ;
221 ASSERT(!renderObject || renderObject->isMeter()); 221 ASSERT(!renderObject || renderObject->isMeter());
222 return static_cast<RenderMeter*>(renderObject); 222 return static_cast<RenderMeter*>(renderObject);
223 } 223 }
224 224
225 void HTMLMeterElement::didAddUserAgentShadowRoot(ShadowRoot* root) 225 void HTMLMeterElement::didAddUserAgentShadowRoot(ShadowRoot* root)
226 { 226 {
227 ASSERT(!m_value); 227 ASSERT(!m_value);
228 228
229 RefPtr<MeterInnerElement> inner = MeterInnerElement::create(&document()); 229 RefPtr<MeterInnerElement> inner = MeterInnerElement::create(document());
230 root->appendChild(inner); 230 root->appendChild(inner);
231 231
232 RefPtr<MeterBarElement> bar = MeterBarElement::create(&document()); 232 RefPtr<MeterBarElement> bar = MeterBarElement::create(document());
233 m_value = MeterValueElement::create(&document()); 233 m_value = MeterValueElement::create(document());
234 m_value->setWidthPercentage(0); 234 m_value->setWidthPercentage(0);
235 m_value->updatePseudo(); 235 m_value->updatePseudo();
236 bar->appendChild(m_value); 236 bar->appendChild(m_value);
237 237
238 inner->appendChild(bar); 238 inner->appendChild(bar);
239 } 239 }
240 240
241 } // namespace 241 } // namespace
OLDNEW
« no previous file with comments | « Source/core/html/HTMLMeterElement.h ('k') | Source/core/html/HTMLModElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698