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

Unified Diff: Source/core/html/HTMLMediaElement.h

Issue 196723014: Replace Element::isMediaElement() with isHTMLMediaElement (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: less null checks 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/events/EventPath.cpp ('k') | Source/core/html/HTMLSourceElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLMediaElement.h
diff --git a/Source/core/html/HTMLMediaElement.h b/Source/core/html/HTMLMediaElement.h
index ff834bbc591634b5ed972592a091bd75d8333fb5..695bf5f26a0a1c41eb9a037c00dad760046256e4 100644
--- a/Source/core/html/HTMLMediaElement.h
+++ b/Source/core/html/HTMLMediaElement.h
@@ -285,8 +285,6 @@ protected:
DisplayMode displayMode() const { return m_displayMode; }
virtual void setDisplayMode(DisplayMode mode) { m_displayMode = mode; }
- virtual bool isMediaElement() const OVERRIDE FINAL { return true; }
-
void setControllerInternal(PassRefPtr<MediaController>);
bool ignoreTrackDisplayUpdateRequests() const { return m_ignoreTrackDisplayUpdate > 0; }
@@ -545,7 +543,12 @@ struct ValueToString<TextTrackCue*> {
inline bool isHTMLMediaElement(const Node& node)
{
- return node.isElementNode() && toElement(node).isMediaElement();
+ return isHTMLAudioElement(node) || isHTMLVideoElement(node);
+}
+
+inline bool isHTMLMediaElement(const Node* node)
+{
+ return node && isHTMLMediaElement(*node);
}
DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement);
« no previous file with comments | « Source/core/events/EventPath.cpp ('k') | Source/core/html/HTMLSourceElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698