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

Unified Diff: Source/WebCore/accessibility/AccessibilityMediaControls.cpp

Issue 8758009: Merge 100408 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/912/
Patch Set: '' Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/WebCore/html/shadow/MediaControlElements.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/accessibility/AccessibilityMediaControls.cpp
===================================================================
--- Source/WebCore/accessibility/AccessibilityMediaControls.cpp (revision 101562)
+++ Source/WebCore/accessibility/AccessibilityMediaControls.cpp (working copy)
@@ -53,17 +53,9 @@
PassRefPtr<AccessibilityObject> AccessibilityMediaControl::create(RenderObject* renderer)
{
- ASSERT(renderer->node() && renderer->node()->isMediaControlElement());
+ ASSERT(renderer->node());
- Node* node = renderer->node();
- MediaControlElementType controlType;
-
- if (node->hasTagName(inputTag))
- controlType = static_cast<MediaControlInputElement*>(node)->displayType();
- else
- controlType = static_cast<MediaControlElement*>(node)->displayType();
-
- switch (controlType) {
+ switch (mediaControlElementType(renderer->node())) {
case MediaSlider:
return AccessibilityMediaTimeline::create(renderer);
@@ -84,12 +76,7 @@
if (!renderer() || !renderer()->node())
return MediaTimelineContainer; // Timeline container is not accessible.
- Node* node = renderer()->node();
-
- if (node->hasTagName(inputTag))
- return static_cast<MediaControlInputElement*>(node)->displayType();
-
- return static_cast<MediaControlElement*>(node)->displayType();
+ return mediaControlElementType(renderer()->node());
}
String AccessibilityMediaControl::controlTypeName() const
@@ -264,9 +251,11 @@
String AccessibilityMediaTimeline::valueDescription() const
{
- ASSERT(m_renderer->node()->hasTagName(inputTag));
+ Node* node = m_renderer->node();
+ if (!node->hasTagName(inputTag))
+ return String();
- float time = static_cast<HTMLInputElement*>(m_renderer->node())->value().toFloat();
+ float time = static_cast<HTMLInputElement*>(node)->value().toFloat();
return localizedMediaTimeDescription(time);
}
« no previous file with comments | « no previous file | Source/WebCore/html/shadow/MediaControlElements.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698