Chromium Code Reviews| Index: Source/core/html/HTMLSourceElement.cpp |
| diff --git a/Source/core/html/HTMLSourceElement.cpp b/Source/core/html/HTMLSourceElement.cpp |
| index 6c613b47a50fc021c7edb8c8a910331f38f80fc6..9eb9895deedb3c4587e1703d54fb0e15739e28c9 100644 |
| --- a/Source/core/html/HTMLSourceElement.cpp |
| +++ b/Source/core/html/HTMLSourceElement.cpp |
| @@ -29,6 +29,7 @@ |
| #include "HTMLNames.h" |
| #include "core/events/EventSender.h" |
| #include "core/html/HTMLMediaElement.h" |
| +#include "core/html/HTMLPictureElement.h" |
| #include "platform/Logging.h" |
| using namespace std; |
| @@ -66,6 +67,8 @@ Node::InsertionNotificationRequest HTMLSourceElement::insertedInto(ContainerNode |
| Element* parent = parentElement(); |
| if (isHTMLMediaElement(parent)) |
| toHTMLMediaElement(parent)->sourceWasAdded(this); |
| + if (isHTMLPictureElement(parent)) |
| + toHTMLPictureElement(parent)->sourceOrMediaChanged(); |
| return InsertionDone; |
| } |
| @@ -76,7 +79,10 @@ void HTMLSourceElement::removedFrom(ContainerNode* removalRoot) |
| parent = toElement(removalRoot); |
| if (isHTMLMediaElement(parent)) |
| toHTMLMediaElement(parent)->sourceWasRemoved(this); |
| + if (isHTMLPictureElement(parent)) |
| + toHTMLPictureElement(parent)->sourceOrMediaChanged(); |
| HTMLElement::removedFrom(removalRoot); |
| + |
|
Yoav Weiss
2014/05/23 07:39:17
Why the extra newline?
cbiesinger
2014/05/23 19:30:37
Done.
|
| } |
| void HTMLSourceElement::setSrc(const String& url) |
| @@ -118,4 +124,15 @@ bool HTMLSourceElement::isURLAttribute(const Attribute& attribute) const |
| return attribute.name() == srcAttr || HTMLElement::isURLAttribute(attribute); |
| } |
| +void HTMLSourceElement::parseAttribute(const QualifiedName& name, const AtomicString& value) |
| +{ |
| + HTMLElement::parseAttribute(name, value); |
| + if (name == srcsetAttr || name == sizesAttr || name == mediaAttr || name == typeAttr) { |
| + Element* parent = parentElement(); |
| + if (isHTMLPictureElement(parent)) { |
| + toHTMLPictureElement(parent)->sourceOrMediaChanged(); |
| + } |
|
Yoav Weiss
2014/05/23 07:39:17
No need for these braces
cbiesinger
2014/05/23 19:30:37
Done.
|
| + } |
| +} |
| + |
| } |