OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2013 Apple Inc. All rights reserved. |
3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 23 matching lines...) Expand all Loading... |
34 | 34 |
35 #include "core/dom/Document.h" | 35 #include "core/dom/Document.h" |
36 #include "core/fetch/MemoryCache.h" | 36 #include "core/fetch/MemoryCache.h" |
37 #include "core/fetch/ResourceFetcher.h" | 37 #include "core/fetch/ResourceFetcher.h" |
38 #include "core/frame/FrameConsole.h" | 38 #include "core/frame/FrameConsole.h" |
39 #include "core/frame/LocalFrame.h" | 39 #include "core/frame/LocalFrame.h" |
40 #include "core/frame/UseCounter.h" | 40 #include "core/frame/UseCounter.h" |
41 #include "core/html/parser/HTMLParserIdioms.h" | 41 #include "core/html/parser/HTMLParserIdioms.h" |
42 #include "core/inspector/ConsoleMessage.h" | 42 #include "core/inspector/ConsoleMessage.h" |
43 #include "platform/ParsingUtilities.h" | 43 #include "platform/ParsingUtilities.h" |
| 44 #include <algorithm> |
44 | 45 |
45 namespace blink { | 46 namespace blink { |
46 | 47 |
47 static bool compareByDensity(const ImageCandidate& first, const ImageCandidate&
second) | 48 static bool compareByDensity(const ImageCandidate& first, const ImageCandidate&
second) |
48 { | 49 { |
49 return first.density() < second.density(); | 50 return first.density() < second.density(); |
50 } | 51 } |
51 | 52 |
52 enum DescriptorTokenizerState { | 53 enum DescriptorTokenizerState { |
53 TokenStart, | 54 TokenStart, |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 Vector<ImageCandidate> imageCandidates; | 436 Vector<ImageCandidate> imageCandidates; |
436 imageCandidates.append(srcsetImageCandidate); | 437 imageCandidates.append(srcsetImageCandidate); |
437 | 438 |
438 if (!srcAttribute.isEmpty()) | 439 if (!srcAttribute.isEmpty()) |
439 imageCandidates.append(ImageCandidate(srcAttribute, 0, srcAttribute.leng
th(), DescriptorParsingResult(), ImageCandidate::SrcOrigin)); | 440 imageCandidates.append(ImageCandidate(srcAttribute, 0, srcAttribute.leng
th(), DescriptorParsingResult(), ImageCandidate::SrcOrigin)); |
440 | 441 |
441 return pickBestImageCandidate(deviceScaleFactor, sourceSize, imageCandidates
).toString(); | 442 return pickBestImageCandidate(deviceScaleFactor, sourceSize, imageCandidates
).toString(); |
442 } | 443 } |
443 | 444 |
444 } | 445 } |
OLD | NEW |