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 18 matching lines...) Expand all Loading... |
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 #ifndef HTMLSrcsetParser_h | 32 #ifndef HTMLSrcsetParser_h |
33 #define HTMLSrcsetParser_h | 33 #define HTMLSrcsetParser_h |
34 | 34 |
35 #include "wtf/text/WTFString.h" | 35 #include "wtf/text/WTFString.h" |
36 | 36 |
37 namespace blink { | 37 namespace blink { |
38 | 38 |
| 39 class Document; |
| 40 |
39 enum { UninitializedDescriptor = -1 }; | 41 enum { UninitializedDescriptor = -1 }; |
40 | 42 |
41 class DescriptorParsingResult { | 43 class DescriptorParsingResult { |
42 public: | 44 public: |
43 DescriptorParsingResult() | 45 DescriptorParsingResult() |
44 : m_density(UninitializedDescriptor) | 46 : m_density(UninitializedDescriptor) |
45 , m_resourceWidth(UninitializedDescriptor) | 47 , m_resourceWidth(UninitializedDescriptor) |
46 , m_resourceHeight(UninitializedDescriptor) | 48 , m_resourceHeight(UninitializedDescriptor) |
47 { | 49 { |
48 } | 50 } |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 return m_string.isEmpty(); | 124 return m_string.isEmpty(); |
123 } | 125 } |
124 | 126 |
125 private: | 127 private: |
126 StringView m_string; | 128 StringView m_string; |
127 float m_density; | 129 float m_density; |
128 int m_resourceWidth; | 130 int m_resourceWidth; |
129 OriginAttribute m_originAttribute; | 131 OriginAttribute m_originAttribute; |
130 }; | 132 }; |
131 | 133 |
132 ImageCandidate bestFitSourceForSrcsetAttribute(float deviceScaleFactor, float so
urceSize, const String& srcsetAttribute); | 134 ImageCandidate bestFitSourceForSrcsetAttribute(float deviceScaleFactor, float so
urceSize, const String& srcsetAttribute, Document* = nullptr); |
133 | 135 |
134 ImageCandidate bestFitSourceForImageAttributes(float deviceScaleFactor, float so
urceSize, const String& srcAttribute, const String& srcsetAttribute); | 136 ImageCandidate bestFitSourceForImageAttributes(float deviceScaleFactor, float so
urceSize, const String& srcAttribute, const String& srcsetAttribute, Document* =
nullptr); |
135 | 137 |
136 String bestFitSourceForImageAttributes(float deviceScaleFactor, float sourceSize
, const String& srcAttribute, ImageCandidate& srcsetImageCandidate); | 138 String bestFitSourceForImageAttributes(float deviceScaleFactor, float sourceSize
, const String& srcAttribute, ImageCandidate& srcsetImageCandidate); |
137 | 139 |
138 } | 140 } |
139 | 141 |
140 #endif | 142 #endif |
OLD | NEW |