Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserv ed. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserv ed. |
| 5 * Copyright (C) 2010 Google Inc. All rights reserved. | 5 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 34 #include "core/dom/NodeTraversal.h" | 34 #include "core/dom/NodeTraversal.h" |
| 35 #include "core/fetch/ImageResource.h" | 35 #include "core/fetch/ImageResource.h" |
| 36 #include "core/frame/UseCounter.h" | 36 #include "core/frame/UseCounter.h" |
| 37 #include "core/html/HTMLAnchorElement.h" | 37 #include "core/html/HTMLAnchorElement.h" |
| 38 #include "core/html/HTMLCanvasElement.h" | 38 #include "core/html/HTMLCanvasElement.h" |
| 39 #include "core/html/HTMLFormElement.h" | 39 #include "core/html/HTMLFormElement.h" |
| 40 #include "core/html/HTMLSourceElement.h" | 40 #include "core/html/HTMLSourceElement.h" |
| 41 #include "core/html/canvas/CanvasRenderingContext.h" | 41 #include "core/html/canvas/CanvasRenderingContext.h" |
| 42 #include "core/html/parser/HTMLParserIdioms.h" | 42 #include "core/html/parser/HTMLParserIdioms.h" |
| 43 #include "core/html/parser/HTMLSrcsetParser.h" | 43 #include "core/html/parser/HTMLSrcsetParser.h" |
| 44 #include "core/inspector/ConsoleMessage.h" | |
| 44 #include "core/rendering/RenderImage.h" | 45 #include "core/rendering/RenderImage.h" |
| 45 #include "platform/MIMETypeRegistry.h" | 46 #include "platform/MIMETypeRegistry.h" |
| 46 #include "platform/RuntimeEnabledFeatures.h" | 47 #include "platform/RuntimeEnabledFeatures.h" |
| 47 | 48 |
| 48 namespace blink { | 49 namespace blink { |
| 49 | 50 |
| 50 using namespace HTMLNames; | 51 using namespace HTMLNames; |
| 51 | 52 |
| 52 class HTMLImageElement::ViewportChangeListener FINAL : public MediaQueryListList ener { | 53 class HTMLImageElement::ViewportChangeListener FINAL : public MediaQueryListList ener { |
| 53 public: | 54 public: |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 275 if (!parent || !isHTMLPictureElement(*parent)) | 276 if (!parent || !isHTMLPictureElement(*parent)) |
| 276 return ImageCandidate(); | 277 return ImageCandidate(); |
| 277 for (Node* child = parent->firstChild(); child; child = child->nextSibling() ) { | 278 for (Node* child = parent->firstChild(); child; child = child->nextSibling() ) { |
| 278 if (child == this) | 279 if (child == this) |
| 279 return ImageCandidate(); | 280 return ImageCandidate(); |
| 280 | 281 |
| 281 if (!isHTMLSourceElement(*child)) | 282 if (!isHTMLSourceElement(*child)) |
| 282 continue; | 283 continue; |
| 283 | 284 |
| 284 HTMLSourceElement* source = toHTMLSourceElement(child); | 285 HTMLSourceElement* source = toHTMLSourceElement(child); |
| 286 if (!source->fastGetAttribute(srcAttr).isNull()) { | |
| 287 document().addConsoleMessage(ConsoleMessage::create(RenderingMessage Source, WarningMessageLevel, "<source src> with a <picture> parent is invalid an d 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
| |
| 288 UseCounter::countDeprecation(document(), UseCounter::PictureSourceSr c); | |
| 289 } | |
| 285 String srcset = source->fastGetAttribute(srcsetAttr); | 290 String srcset = source->fastGetAttribute(srcsetAttr); |
| 286 if (srcset.isEmpty()) | 291 if (srcset.isEmpty()) |
| 287 continue; | 292 continue; |
| 288 String type = source->fastGetAttribute(typeAttr); | 293 String type = source->fastGetAttribute(typeAttr); |
| 289 if (!type.isEmpty() && !supportedImageType(type)) | 294 if (!type.isEmpty() && !supportedImageType(type)) |
| 290 continue; | 295 continue; |
| 291 | 296 |
| 292 if (!source->mediaQueryMatches()) | 297 if (!source->mediaQueryMatches()) |
| 293 continue; | 298 continue; |
| 294 | 299 |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 636 } | 641 } |
| 637 imageLoader().updateFromElement(behavior); | 642 imageLoader().updateFromElement(behavior); |
| 638 } | 643 } |
| 639 | 644 |
| 640 const KURL& HTMLImageElement::sourceURL() const | 645 const KURL& HTMLImageElement::sourceURL() const |
| 641 { | 646 { |
| 642 return cachedImage()->response().url(); | 647 return cachedImage()->response().url(); |
| 643 } | 648 } |
| 644 | 649 |
| 645 } | 650 } |
| OLD | NEW |