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

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

Issue 59463007: Have Element::ensureUserAgentShadowRoot() return a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add extra assertion Created 7 years, 1 month 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/HTMLProgressElement.h ('k') | Source/core/html/HTMLSummaryElement.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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 { 138 {
139 m_value->setWidthPercentage(position() * 100); 139 m_value->setWidthPercentage(position() * 100);
140 if (RenderProgress* render = renderProgress()) { 140 if (RenderProgress* render = renderProgress()) {
141 bool wasDeterminate = render->isDeterminate(); 141 bool wasDeterminate = render->isDeterminate();
142 render->updateFromElement(); 142 render->updateFromElement();
143 if (wasDeterminate != isDeterminate()) 143 if (wasDeterminate != isDeterminate())
144 didAffectSelector(AffectedSelectorIndeterminate); 144 didAffectSelector(AffectedSelectorIndeterminate);
145 } 145 }
146 } 146 }
147 147
148 void HTMLProgressElement::didAddUserAgentShadowRoot(ShadowRoot* root) 148 void HTMLProgressElement::didAddUserAgentShadowRoot(ShadowRoot& root)
149 { 149 {
150 ASSERT(!m_value); 150 ASSERT(!m_value);
151 151
152 RefPtr<ProgressInnerElement> inner = ProgressInnerElement::create(document() ); 152 RefPtr<ProgressInnerElement> inner = ProgressInnerElement::create(document() );
153 inner->setPart(AtomicString("-webkit-progress-inner-element", AtomicString:: ConstructFromLiteral)); 153 inner->setPart(AtomicString("-webkit-progress-inner-element", AtomicString:: ConstructFromLiteral));
154 root->appendChild(inner); 154 root.appendChild(inner);
155 155
156 RefPtr<ProgressBarElement> bar = ProgressBarElement::create(document()); 156 RefPtr<ProgressBarElement> bar = ProgressBarElement::create(document());
157 bar->setPart(AtomicString("-webkit-progress-bar", AtomicString::ConstructFro mLiteral)); 157 bar->setPart(AtomicString("-webkit-progress-bar", AtomicString::ConstructFro mLiteral));
158 RefPtr<ProgressValueElement> value = ProgressValueElement::create(document() ); 158 RefPtr<ProgressValueElement> value = ProgressValueElement::create(document() );
159 m_value = value.get(); 159 m_value = value.get();
160 m_value->setPart(AtomicString("-webkit-progress-value", AtomicString::Constr uctFromLiteral)); 160 m_value->setPart(AtomicString("-webkit-progress-value", AtomicString::Constr uctFromLiteral));
161 m_value->setWidthPercentage(HTMLProgressElement::IndeterminatePosition * 100 ); 161 m_value->setWidthPercentage(HTMLProgressElement::IndeterminatePosition * 100 );
162 bar->appendChild(m_value); 162 bar->appendChild(m_value);
163 163
164 inner->appendChild(bar); 164 inner->appendChild(bar);
165 } 165 }
166 166
167 bool HTMLProgressElement::shouldAppearIndeterminate() const 167 bool HTMLProgressElement::shouldAppearIndeterminate() const
168 { 168 {
169 return !isDeterminate(); 169 return !isDeterminate();
170 } 170 }
171 171
172 } // namespace 172 } // namespace
OLDNEW
« no previous file with comments | « Source/core/html/HTMLProgressElement.h ('k') | Source/core/html/HTMLSummaryElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698