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

Unified Diff: Source/core/html/HTMLSourceElement.cpp

Issue 14449003: Picture element initial implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@picture_after_rebase
Patch Set: Created 7 years, 8 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/html/HTMLSourceElement.h ('k') | Source/core/html/HTMLTagNames.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLSourceElement.cpp
diff --git a/Source/core/html/HTMLSourceElement.cpp b/Source/core/html/HTMLSourceElement.cpp
index e54994aaf17a4c9e31760e44766d7fd50e5a658d..adf2516edebbc483dfa28c17bae939cbedab6097 100644
--- a/Source/core/html/HTMLSourceElement.cpp
+++ b/Source/core/html/HTMLSourceElement.cpp
@@ -31,6 +31,9 @@
#include "EventNames.h"
#include "HTMLDocument.h"
#include "HTMLMediaElement.h"
+#if ENABLE(PICTURE)
+#include "HTMLPictureElement.h"
+#endif
#include "HTMLNames.h"
#include "Logging.h"
@@ -60,6 +63,10 @@ Node::InsertionNotificationRequest HTMLSourceElement::insertedInto(ContainerNode
Element* parent = parentElement();
if (parent && parent->isMediaElement())
static_cast<HTMLMediaElement*>(parentNode())->sourceWasAdded(this);
+#if ENABLE(PICTURE)
+ if (parent && parent->isPictureElement())
+ static_cast<HTMLPictureElement*>(parentNode())->sourceWasAdded();
+#endif
return InsertionDone;
}
@@ -78,6 +85,11 @@ void HTMLSourceElement::setSrc(const String& url)
setAttribute(srcAttr, url);
}
+String HTMLSourceElement::src() const
+{
+ return getAttribute(srcAttr);
+}
+
String HTMLSourceElement::media() const
{
return getAttribute(mediaAttr);
« no previous file with comments | « Source/core/html/HTMLSourceElement.h ('k') | Source/core/html/HTMLTagNames.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698