Index: Source/WebCore/html/HTMLSourceElement.cpp |
=================================================================== |
--- Source/WebCore/html/HTMLSourceElement.cpp (revision 92737) |
+++ Source/WebCore/html/HTMLSourceElement.cpp (working copy) |
@@ -57,13 +57,15 @@ |
void HTMLSourceElement::insertedIntoTree(bool deep) |
{ |
HTMLElement::insertedIntoTree(deep); |
- if (parentNode() && (parentNode()->hasTagName(audioTag) || parentNode()->hasTagName(videoTag))) |
+ Element* parent = parentElement(); |
+ if (parent && parent->isMediaElement()) |
static_cast<HTMLMediaElement*>(parentNode())->sourceWasAdded(this); |
} |
void HTMLSourceElement::willRemove() |
{ |
- if (parentNode() && (parentNode()->hasTagName(audioTag) || parentNode()->hasTagName(videoTag))) |
+ Element* parent = parentElement(); |
+ if (parent && parent->isMediaElement()) |
static_cast<HTMLMediaElement*>(parentNode())->sourceWillBeRemoved(this); |
HTMLElement::willRemove(); |
} |