OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 virtual void finishParsingChildren() OVERRIDE FINAL; | 278 virtual void finishParsingChildren() OVERRIDE FINAL; |
279 virtual bool isURLAttribute(const Attribute&) const OVERRIDE; | 279 virtual bool isURLAttribute(const Attribute&) const OVERRIDE; |
280 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; | 280 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; |
281 | 281 |
282 virtual void didMoveToNewDocument(Document& oldDocument) OVERRIDE; | 282 virtual void didMoveToNewDocument(Document& oldDocument) OVERRIDE; |
283 | 283 |
284 enum DisplayMode { Unknown, Poster, PosterWaitingForVideo, Video }; | 284 enum DisplayMode { Unknown, Poster, PosterWaitingForVideo, Video }; |
285 DisplayMode displayMode() const { return m_displayMode; } | 285 DisplayMode displayMode() const { return m_displayMode; } |
286 virtual void setDisplayMode(DisplayMode mode) { m_displayMode = mode; } | 286 virtual void setDisplayMode(DisplayMode mode) { m_displayMode = mode; } |
287 | 287 |
288 virtual bool isMediaElement() const OVERRIDE FINAL { return true; } | |
289 | |
290 void setControllerInternal(PassRefPtr<MediaController>); | 288 void setControllerInternal(PassRefPtr<MediaController>); |
291 | 289 |
292 bool ignoreTrackDisplayUpdateRequests() const { return m_ignoreTrackDisplayU
pdate > 0; } | 290 bool ignoreTrackDisplayUpdateRequests() const { return m_ignoreTrackDisplayU
pdate > 0; } |
293 void beginIgnoringTrackDisplayUpdateRequests(); | 291 void beginIgnoringTrackDisplayUpdateRequests(); |
294 void endIgnoringTrackDisplayUpdateRequests(); | 292 void endIgnoringTrackDisplayUpdateRequests(); |
295 | 293 |
296 private: | 294 private: |
297 void createMediaPlayer(); | 295 void createMediaPlayer(); |
298 | 296 |
299 virtual bool alwaysCreateUserAgentShadowRoot() const OVERRIDE FINAL { return
true; } | 297 virtual bool alwaysCreateUserAgentShadowRoot() const OVERRIDE FINAL { return
true; } |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 struct ValueToString<TextTrackCue*> { | 536 struct ValueToString<TextTrackCue*> { |
539 static String string(TextTrackCue* const& cue) | 537 static String string(TextTrackCue* const& cue) |
540 { | 538 { |
541 return cue->toString(); | 539 return cue->toString(); |
542 } | 540 } |
543 }; | 541 }; |
544 #endif | 542 #endif |
545 | 543 |
546 inline bool isHTMLMediaElement(const Node& node) | 544 inline bool isHTMLMediaElement(const Node& node) |
547 { | 545 { |
548 return node.isElementNode() && toElement(node).isMediaElement(); | 546 return isHTMLAudioElement(node) || isHTMLVideoElement(node); |
| 547 } |
| 548 |
| 549 inline bool isHTMLMediaElement(const Node* node) |
| 550 { |
| 551 return node && isHTMLMediaElement(*node); |
549 } | 552 } |
550 | 553 |
551 DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); | 554 DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); |
552 | 555 |
553 } //namespace | 556 } //namespace |
554 | 557 |
555 #endif | 558 #endif |
OLD | NEW |