diff options
Diffstat (limited to 'Source/WebCore/html/HTMLSourceElement.cpp')
-rw-r--r-- | Source/WebCore/html/HTMLSourceElement.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Source/WebCore/html/HTMLSourceElement.cpp b/Source/WebCore/html/HTMLSourceElement.cpp index c2f93621f..2b331c8bb 100644 --- a/Source/WebCore/html/HTMLSourceElement.cpp +++ b/Source/WebCore/html/HTMLSourceElement.cpp @@ -63,14 +63,16 @@ Node::InsertionNotificationRequest HTMLSourceElement::insertedInto(Node* inserti return InsertionDone; } -void HTMLSourceElement::willRemove() +void HTMLSourceElement::removedFrom(Node* removalRoot) { Element* parent = parentElement(); + if (!parent && removalRoot->isElementNode()) + parent = toElement(removalRoot); if (parent && parent->isMediaElement()) - static_cast<HTMLMediaElement*>(parentNode())->sourceWillBeRemoved(this); - HTMLElement::willRemove(); + toMediaElement(parent)->sourceWasRemoved(this); + HTMLElement::removedFrom(removalRoot); } - + void HTMLSourceElement::setSrc(const String& url) { setAttribute(srcAttr, url); @@ -117,9 +119,9 @@ void HTMLSourceElement::errorEventTimerFired(Timer<HTMLSourceElement>*) dispatchEvent(Event::create(eventNames().errorEvent, false, true)); } -bool HTMLSourceElement::isURLAttribute(Attribute* attribute) const +bool HTMLSourceElement::isURLAttribute(const Attribute& attribute) const { - return attribute->name() == srcAttr || HTMLElement::isURLAttribute(attribute); + return attribute.name() == srcAttr || HTMLElement::isURLAttribute(attribute); } #if ENABLE(MICRODATA) |