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

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

Issue 290203002: <picture>: Update the <img> element when a <source> changes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: review comments addressed Created 6 years, 7 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/HTMLPictureElement.h ('k') | Source/core/html/HTMLSourceElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLPictureElement.cpp
diff --git a/Source/core/html/HTMLPictureElement.cpp b/Source/core/html/HTMLPictureElement.cpp
index f5a3d95c8c7e9eba160320900a4aabff72adf0f7..ee30bfd1e89549a64b15bfebad3a0a4e3ef17260 100644
--- a/Source/core/html/HTMLPictureElement.cpp
+++ b/Source/core/html/HTMLPictureElement.cpp
@@ -6,6 +6,8 @@
#include "core/html/HTMLPictureElement.h"
#include "HTMLNames.h"
+#include "core/dom/ElementTraversal.h"
+#include "core/html/HTMLImageElement.h"
namespace WebCore {
@@ -17,4 +19,11 @@ HTMLPictureElement::HTMLPictureElement(Document& document)
ScriptWrappable::init(this);
}
+void HTMLPictureElement::sourceOrMediaChanged()
+{
+ for (HTMLImageElement* imageElement = Traversal<HTMLImageElement>::firstChild(*this); imageElement; imageElement = Traversal<HTMLImageElement>::nextSibling(*imageElement)) {
+ imageElement->selectSourceURL(HTMLImageElement::UpdateNormal);
+ }
+}
+
} // namespace
« no previous file with comments | « Source/core/html/HTMLPictureElement.h ('k') | Source/core/html/HTMLSourceElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698