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

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

Issue 1115353002: Update renderer to layoutObject in core/html. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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/HTMLPlugInElement.cpp ('k') | Source/core/html/HTMLSelectElement.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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 didElementStateChange(); 81 didElementStateChange();
82 else if (name == maxAttr) 82 else if (name == maxAttr)
83 didElementStateChange(); 83 didElementStateChange();
84 else 84 else
85 LabelableElement::parseAttribute(name, value); 85 LabelableElement::parseAttribute(name, value);
86 } 86 }
87 87
88 void HTMLProgressElement::attach(const AttachContext& context) 88 void HTMLProgressElement::attach(const AttachContext& context)
89 { 89 {
90 LabelableElement::attach(context); 90 LabelableElement::attach(context);
91 if (LayoutProgress* render = layoutProgress()) 91 if (LayoutProgress* layoutObject = layoutProgress())
92 render->updateFromElement(); 92 layoutObject->updateFromElement();
93 } 93 }
94 94
95 double HTMLProgressElement::value() const 95 double HTMLProgressElement::value() const
96 { 96 {
97 double value = getFloatingPointAttribute(valueAttr); 97 double value = getFloatingPointAttribute(valueAttr);
98 // Otherwise, if the parsed value was greater than or equal to the maximum 98 // Otherwise, if the parsed value was greater than or equal to the maximum
99 // value, then the current value of the progress bar is the maximum value 99 // value, then the current value of the progress bar is the maximum value
100 // of the progress bar. Otherwise, if parsing the value attribute's value 100 // of the progress bar. Otherwise, if parsing the value attribute's value
101 // resulted in an error, or a number less than or equal to zero, then the 101 // resulted in an error, or a number less than or equal to zero, then the
102 // current value of the progress bar is zero. 102 // current value of the progress bar is zero.
(...skipping 28 matching lines...) Expand all
131 } 131 }
132 132
133 bool HTMLProgressElement::isDeterminate() const 133 bool HTMLProgressElement::isDeterminate() const
134 { 134 {
135 return fastHasAttribute(valueAttr); 135 return fastHasAttribute(valueAttr);
136 } 136 }
137 137
138 void HTMLProgressElement::didElementStateChange() 138 void HTMLProgressElement::didElementStateChange()
139 { 139 {
140 m_value->setWidthPercentage(position() * 100); 140 m_value->setWidthPercentage(position() * 100);
141 if (LayoutProgress* render = layoutProgress()) { 141 if (LayoutProgress* layoutObject = layoutProgress()) {
142 bool wasDeterminate = render->isDeterminate(); 142 bool wasDeterminate = layoutObject->isDeterminate();
143 render->updateFromElement(); 143 layoutObject->updateFromElement();
144 if (wasDeterminate != isDeterminate()) 144 if (wasDeterminate != isDeterminate())
145 pseudoStateChanged(CSSSelector::PseudoIndeterminate); 145 pseudoStateChanged(CSSSelector::PseudoIndeterminate);
146 } 146 }
147 } 147 }
148 148
149 void HTMLProgressElement::didAddUserAgentShadowRoot(ShadowRoot& root) 149 void HTMLProgressElement::didAddUserAgentShadowRoot(ShadowRoot& root)
150 { 150 {
151 ASSERT(!m_value); 151 ASSERT(!m_value);
152 152
153 RefPtrWillBeRawPtr<ProgressInnerElement> inner = ProgressInnerElement::creat e(document()); 153 RefPtrWillBeRawPtr<ProgressInnerElement> inner = ProgressInnerElement::creat e(document());
(...skipping 22 matching lines...) Expand all
176 lazyReattachIfAttached(); 176 lazyReattachIfAttached();
177 } 177 }
178 178
179 DEFINE_TRACE(HTMLProgressElement) 179 DEFINE_TRACE(HTMLProgressElement)
180 { 180 {
181 visitor->trace(m_value); 181 visitor->trace(m_value);
182 LabelableElement::trace(visitor); 182 LabelableElement::trace(visitor);
183 } 183 }
184 184
185 } // namespace 185 } // namespace
OLDNEW
« no previous file with comments | « Source/core/html/HTMLPlugInElement.cpp ('k') | Source/core/html/HTMLSelectElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698