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

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

Issue 466353002: Added a console warning when <picture><source src></picture> is used. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added use counter Created 6 years, 4 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/frame/UseCounter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLImageElement.cpp
diff --git a/Source/core/html/HTMLImageElement.cpp b/Source/core/html/HTMLImageElement.cpp
index e738685e6f1267e4894d29acbb622019399bce0d..395e76bac8616bec0be38c7d3b4613b5cacef96c 100644
--- a/Source/core/html/HTMLImageElement.cpp
+++ b/Source/core/html/HTMLImageElement.cpp
@@ -41,6 +41,7 @@
#include "core/html/canvas/CanvasRenderingContext.h"
#include "core/html/parser/HTMLParserIdioms.h"
#include "core/html/parser/HTMLSrcsetParser.h"
+#include "core/inspector/ConsoleMessage.h"
#include "core/rendering/RenderImage.h"
#include "platform/MIMETypeRegistry.h"
#include "platform/RuntimeEnabledFeatures.h"
@@ -282,6 +283,10 @@ ImageCandidate HTMLImageElement::findBestFitImageFromPictureParent()
continue;
HTMLSourceElement* source = toHTMLSourceElement(child);
+ if (!source->fastGetAttribute(srcAttr).isNull()) {
+ document().addConsoleMessage(ConsoleMessage::create(RenderingMessageSource, WarningMessageLevel, "<source src> with a <picture> parent is invalid and therefore ignored. Use <source srcset> instead."));
Mike West 2014/08/13 14:29:30 You can drop this message here, and add it to the
+ UseCounter::countDeprecation(document(), UseCounter::PictureSourceSrc);
+ }
String srcset = source->fastGetAttribute(srcsetAttr);
if (srcset.isEmpty())
continue;
« no previous file with comments | « Source/core/frame/UseCounter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698