Index: Source/WebCore/html/HTMLMediaElement.cpp |
=================================================================== |
--- Source/WebCore/html/HTMLMediaElement.cpp (revision 87760) |
+++ Source/WebCore/html/HTMLMediaElement.cpp (working copy) |
@@ -2655,17 +2655,16 @@ |
MediaControls* HTMLMediaElement::mediaControls() |
{ |
- if (!shadowRoot()) |
- return 0; |
- |
- Node* node = shadowRoot()->firstChild(); |
- ASSERT(node->isHTMLElement()); |
- return static_cast<MediaControls*>(node); |
+ return toMediaControls(shadowRoot()->firstChild()); |
} |
bool HTMLMediaElement::hasMediaControls() |
{ |
- return shadowRoot(); |
+ if (!shadowRoot()) |
+ return false; |
+ |
+ Node* node = shadowRoot()->firstChild(); |
+ return node && node->isMediaControls(); |
} |
void HTMLMediaElement::ensureMediaControls() |