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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 continue; | 236 continue; |
237 | 237 |
238 HTMLSourceElement* source = toHTMLSourceElement(child); | 238 HTMLSourceElement* source = toHTMLSourceElement(child); |
239 String srcset = source->fastGetAttribute(srcsetAttr); | 239 String srcset = source->fastGetAttribute(srcsetAttr); |
240 if (srcset.isEmpty()) | 240 if (srcset.isEmpty()) |
241 continue; | 241 continue; |
242 String type = source->fastGetAttribute(typeAttr); | 242 String type = source->fastGetAttribute(typeAttr); |
243 if (!type.isEmpty() && !supportedImageType(type)) | 243 if (!type.isEmpty() && !supportedImageType(type)) |
244 continue; | 244 continue; |
245 | 245 |
246 String media = source->fastGetAttribute(mediaAttr); | 246 if (!source->mediaQueryMatches()) |
247 if (!media.isEmpty()) { | 247 continue; |
248 RefPtrWillBeRawPtr<MediaQuerySet> mediaQueries = MediaQuerySet::crea
te(media); | |
249 if (!document().mediaQueryMatcher().evaluate(mediaQueries.get())) | |
250 continue; | |
251 } | |
252 | 248 |
253 unsigned effectiveSize = SizesAttributeParser::findEffectiveSize(source-
>fastGetAttribute(sizesAttr), MediaValuesDynamic::create(document())); | 249 unsigned effectiveSize = SizesAttributeParser::findEffectiveSize(source-
>fastGetAttribute(sizesAttr), MediaValuesDynamic::create(document())); |
254 ImageCandidate candidate = bestFitSourceForSrcsetAttribute(document().de
vicePixelRatio(), effectiveSize, source->fastGetAttribute(srcsetAttr)); | 250 ImageCandidate candidate = bestFitSourceForSrcsetAttribute(document().de
vicePixelRatio(), effectiveSize, source->fastGetAttribute(srcsetAttr)); |
255 if (candidate.isEmpty()) | 251 if (candidate.isEmpty()) |
256 continue; | 252 continue; |
257 return candidate; | 253 return candidate; |
258 } | 254 } |
259 return ImageCandidate(); | 255 return ImageCandidate(); |
260 } | 256 } |
261 | 257 |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 else | 583 else |
588 imageLoader().updateFromElement(); | 584 imageLoader().updateFromElement(); |
589 } | 585 } |
590 | 586 |
591 const KURL& HTMLImageElement::sourceURL() const | 587 const KURL& HTMLImageElement::sourceURL() const |
592 { | 588 { |
593 return cachedImage()->response().url(); | 589 return cachedImage()->response().url(); |
594 } | 590 } |
595 | 591 |
596 } | 592 } |
OLD | NEW |