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

Unified Diff: Source/core/rendering/RenderTheme.cpp

Issue 197283025: Use new is*Element() helper functions more in rendering code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/RenderTextControlSingleLine.cpp ('k') | Source/core/rendering/RenderTreeAsText.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderTheme.cpp
diff --git a/Source/core/rendering/RenderTheme.cpp b/Source/core/rendering/RenderTheme.cpp
index d7aa06f9ecdf21f317589ff4cc357d998de3340f..972bcf6c11a8177510972e7bc259e6dcc554732b 100644
--- a/Source/core/rendering/RenderTheme.cpp
+++ b/Source/core/rendering/RenderTheme.cpp
@@ -711,14 +711,14 @@ bool RenderTheme::isActive(const RenderObject* o) const
bool RenderTheme::isChecked(const RenderObject* o) const
{
- if (!o->node() || !o->node()->hasTagName(inputTag))
+ if (!isHTMLInputElement(o->node()))
return false;
return toHTMLInputElement(o->node())->shouldAppearChecked();
}
bool RenderTheme::isIndeterminate(const RenderObject* o) const
{
- if (!o->node() || !o->node()->hasTagName(inputTag))
+ if (!isHTMLInputElement(o->node()))
return false;
return toHTMLInputElement(o->node())->shouldAppearIndeterminate();
}
@@ -864,7 +864,7 @@ bool RenderTheme::paintMeter(RenderObject*, const PaintInfo&, const IntRect&)
void RenderTheme::paintSliderTicks(RenderObject* o, const PaintInfo& paintInfo, const IntRect& rect)
{
Node* node = o->node();
- if (!node || !node->hasTagName(inputTag))
+ if (!isHTMLInputElement(node))
return;
HTMLInputElement* input = toHTMLInputElement(node);
@@ -923,9 +923,9 @@ void RenderTheme::paintSliderTicks(RenderObject* o, const PaintInfo& paintInfo,
GraphicsContextStateSaver stateSaver(*paintInfo.context);
paintInfo.context->setFillColor(o->resolveColor(CSSPropertyColor));
for (unsigned i = 0; Element* element = options->item(i); i++) {
- ASSERT(element->hasTagName(optionTag));
- HTMLOptionElement* optionElement = toHTMLOptionElement(element);
- String value = optionElement->value();
+ ASSERT(isHTMLOptionElement(*element));
+ HTMLOptionElement& optionElement = toHTMLOptionElement(*element);
+ String value = optionElement.value();
if (!input->isValidValue(value))
continue;
double parsedValue = parseToDoubleForNumberType(input->sanitizeValue(value));
« no previous file with comments | « Source/core/rendering/RenderTextControlSingleLine.cpp ('k') | Source/core/rendering/RenderTreeAsText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698