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

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

Issue 24253004: Cleanup: Start using toFoo methods as part of newly adopted coding guideline. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
« no previous file with comments | « Source/core/html/HTMLInputElement.cpp ('k') | Source/core/html/HTMLProgressElement.cpp » ('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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 { 207 {
208 m_value->setWidthPercentage(valueRatio()*100); 208 m_value->setWidthPercentage(valueRatio()*100);
209 m_value->updatePseudo(); 209 m_value->updatePseudo();
210 if (RenderMeter* render = renderMeter()) 210 if (RenderMeter* render = renderMeter())
211 render->updateFromElement(); 211 render->updateFromElement();
212 } 212 }
213 213
214 RenderMeter* HTMLMeterElement::renderMeter() const 214 RenderMeter* HTMLMeterElement::renderMeter() const
215 { 215 {
216 if (renderer() && renderer()->isMeter()) 216 if (renderer() && renderer()->isMeter())
217 return static_cast<RenderMeter*>(renderer()); 217 return toRenderMeter(renderer());
218 218
219 RenderObject* renderObject = userAgentShadowRoot()->firstChild()->renderer() ; 219 RenderObject* renderObject = userAgentShadowRoot()->firstChild()->renderer() ;
220 ASSERT(!renderObject || renderObject->isMeter()); 220 ASSERT(!renderObject || renderObject->isMeter());
221 return static_cast<RenderMeter*>(renderObject); 221 return toRenderMeter(renderObject);
222 } 222 }
223 223
224 void HTMLMeterElement::didAddUserAgentShadowRoot(ShadowRoot* root) 224 void HTMLMeterElement::didAddUserAgentShadowRoot(ShadowRoot* root)
225 { 225 {
226 ASSERT(!m_value); 226 ASSERT(!m_value);
227 227
228 RefPtr<MeterInnerElement> inner = MeterInnerElement::create(document()); 228 RefPtr<MeterInnerElement> inner = MeterInnerElement::create(document());
229 root->appendChild(inner); 229 root->appendChild(inner);
230 230
231 RefPtr<MeterBarElement> bar = MeterBarElement::create(document()); 231 RefPtr<MeterBarElement> bar = MeterBarElement::create(document());
232 m_value = MeterValueElement::create(document()); 232 m_value = MeterValueElement::create(document());
233 m_value->setWidthPercentage(0); 233 m_value->setWidthPercentage(0);
234 m_value->updatePseudo(); 234 m_value->updatePseudo();
235 bar->appendChild(m_value); 235 bar->appendChild(m_value);
236 236
237 inner->appendChild(bar); 237 inner->appendChild(bar);
238 } 238 }
239 239
240 } // namespace 240 } // namespace
OLDNEW
« no previous file with comments | « Source/core/html/HTMLInputElement.cpp ('k') | Source/core/html/HTMLProgressElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698