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 13:57:24
It might be worthwhile to measure how often this o
| |
285 String srcset = source->fastGetAttribute(srcsetAttr); | 288 String srcset = source->fastGetAttribute(srcsetAttr); |
286 if (srcset.isEmpty()) | 289 if (srcset.isEmpty()) |
287 continue; | 290 continue; |
288 String type = source->fastGetAttribute(typeAttr); | 291 String type = source->fastGetAttribute(typeAttr); |
289 if (!type.isEmpty() && !supportedImageType(type)) | 292 if (!type.isEmpty() && !supportedImageType(type)) |
290 continue; | 293 continue; |
291 | 294 |
292 if (!source->mediaQueryMatches()) | 295 if (!source->mediaQueryMatches()) |
293 continue; | 296 continue; |
294 | 297 |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
636 } | 639 } |
637 imageLoader().updateFromElement(behavior); | 640 imageLoader().updateFromElement(behavior); |
638 } | 641 } |
639 | 642 |
640 const KURL& HTMLImageElement::sourceURL() const | 643 const KURL& HTMLImageElement::sourceURL() const |
641 { | 644 { |
642 return cachedImage()->response().url(); | 645 return cachedImage()->response().url(); |
643 } | 646 } |
644 | 647 |
645 } | 648 } |
OLD | NEW |