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 13 matching lines...) Expand all Loading... |
24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 */ | 30 */ |
31 | 31 |
32 #include "core/html/parser/HTMLSrcsetParser.h" | 32 #include "core/html/parser/HTMLSrcsetParser.h" |
33 | 33 |
| 34 #include <algorithm> |
34 #include "core/dom/Document.h" | 35 #include "core/dom/Document.h" |
35 #include "core/frame/FrameConsole.h" | 36 #include "core/frame/FrameConsole.h" |
36 #include "core/frame/LocalFrame.h" | 37 #include "core/frame/LocalFrame.h" |
37 #include "core/frame/UseCounter.h" | 38 #include "core/frame/UseCounter.h" |
38 #include "core/html/parser/HTMLParserIdioms.h" | 39 #include "core/html/parser/HTMLParserIdioms.h" |
39 #include "core/inspector/ConsoleMessage.h" | 40 #include "core/inspector/ConsoleMessage.h" |
40 #include "platform/json/JSONValues.h" | 41 #include "platform/json/JSONValues.h" |
41 #include "platform/loader/fetch/MemoryCache.h" | 42 #include "platform/loader/fetch/MemoryCache.h" |
42 #include "platform/loader/fetch/ResourceFetcher.h" | 43 #include "platform/loader/fetch/ResourceFetcher.h" |
43 #include "wtf/text/ParsingUtilities.h" | 44 #include "wtf/text/ParsingUtilities.h" |
44 #include "wtf/text/StringToNumber.h" | 45 #include "wtf/text/StringToNumber.h" |
45 #include <algorithm> | |
46 | 46 |
47 namespace blink { | 47 namespace blink { |
48 | 48 |
49 static bool compareByDensity(const ImageCandidate& first, | 49 static bool compareByDensity(const ImageCandidate& first, |
50 const ImageCandidate& second) { | 50 const ImageCandidate& second) { |
51 return first.density() < second.density(); | 51 return first.density() < second.density(); |
52 } | 52 } |
53 | 53 |
54 enum DescriptorTokenizerState { | 54 enum DescriptorTokenizerState { |
55 TokenStart, | 55 TokenStart, |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 if (!srcAttribute.isEmpty()) | 500 if (!srcAttribute.isEmpty()) |
501 imageCandidates.push_back( | 501 imageCandidates.push_back( |
502 ImageCandidate(srcAttribute, 0, srcAttribute.length(), | 502 ImageCandidate(srcAttribute, 0, srcAttribute.length(), |
503 DescriptorParsingResult(), ImageCandidate::SrcOrigin)); | 503 DescriptorParsingResult(), ImageCandidate::SrcOrigin)); |
504 | 504 |
505 return pickBestImageCandidate(deviceScaleFactor, sourceSize, imageCandidates) | 505 return pickBestImageCandidate(deviceScaleFactor, sourceSize, imageCandidates) |
506 .toString(); | 506 .toString(); |
507 } | 507 } |
508 | 508 |
509 } // namespace blink | 509 } // namespace blink |
OLD | NEW |