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

Unified Diff: Source/core/html/MediaDocument.cpp

Issue 18205009: Introduce isHTMLVideoElement and toHTMLVideoElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 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/html/HTMLVideoElement.h ('k') | Source/core/html/shadow/MediaControlElements.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/MediaDocument.cpp
diff --git a/Source/core/html/MediaDocument.cpp b/Source/core/html/MediaDocument.cpp
index aeacbcfec72f6fb0448537c6d18f9004811ddb07..c3a5511e02b0e11faae1565722cebe9dc7efcbf6 100644
--- a/Source/core/html/MediaDocument.cpp
+++ b/Source/core/html/MediaDocument.cpp
@@ -90,7 +90,7 @@ void MediaDocumentParser::createDocumentStructure()
RefPtr<Element> mediaElement = document()->createElement(videoTag, false);
- m_mediaElement = static_cast<HTMLVideoElement*>(mediaElement.get());
+ m_mediaElement = toHTMLVideoElement(mediaElement.get());
m_mediaElement->setAttribute(controlsAttr, "");
m_mediaElement->setAttribute(autoplayAttr, "");
@@ -133,13 +133,13 @@ static inline HTMLVideoElement* descendentVideoElement(Node* node)
{
ASSERT(node);
- if (node->hasTagName(videoTag))
- return static_cast<HTMLVideoElement*>(node);
+ if (isHTMLVideoElement(node))
+ return toHTMLVideoElement(node);
RefPtr<NodeList> nodeList = node->getElementsByTagNameNS(videoTag.namespaceURI(), videoTag.localName());
-
+
if (nodeList.get()->length() > 0)
- return static_cast<HTMLVideoElement*>(nodeList.get()->item(0));
+ return toHTMLVideoElement(nodeList.get()->item(0));
return 0;
}
« no previous file with comments | « Source/core/html/HTMLVideoElement.h ('k') | Source/core/html/shadow/MediaControlElements.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698