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

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: with tests 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
Index: Source/core/html/HTMLPictureElement.cpp
diff --git a/Source/core/html/HTMLPictureElement.cpp b/Source/core/html/HTMLPictureElement.cpp
index f5a3d95c8c7e9eba160320900a4aabff72adf0f7..76878541166c8e663e84fda2325ce2c06ba8657a 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,12 @@ 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(false);
+ }
+
Yoav Weiss 2014/05/23 07:39:17 We can get rid of the braces and the extra newline
cbiesinger 2014/05/23 19:30:37 Deleted the newline but I like the braces because
+}
+
} // namespace

Powered by Google App Engine
This is Rietveld 408576698