Index: Source/core/html/parser/HTMLSrcsetParser.h |
diff --git a/Source/core/html/parser/HTMLSrcsetParser.h b/Source/core/html/parser/HTMLSrcsetParser.h |
index 318992142e7dfeea3553b27819a39fd91a7d73ee..ecb4e33b914eee075a0c819f836c5be3a9f039c8 100644 |
--- a/Source/core/html/parser/HTMLSrcsetParser.h |
+++ b/Source/core/html/parser/HTMLSrcsetParser.h |
@@ -53,15 +53,21 @@ struct DescriptorParsingResult { |
class ImageCandidate { |
public: |
+ enum Origin { |
eseidel
2014/04/13 20:57:55
Is this OriginSource? This is controlling where t
|
+ SrcsetOrigin, |
+ SrcOrigin |
+ }; |
+ |
ImageCandidate() |
: m_scaleFactor(1.0) |
{ |
} |
- ImageCandidate(const String& source, unsigned start, unsigned length, const DescriptorParsingResult& result) |
+ ImageCandidate(const String& source, unsigned start, unsigned length, const DescriptorParsingResult& result, Origin origin) |
: m_string(source.createView(start, length)) |
, m_scaleFactor(result.scaleFactor) |
, m_resourceWidth(result.resourceWidth) |
+ , m_origin(origin) |
{ |
} |
@@ -90,6 +96,11 @@ public: |
return m_resourceWidth; |
} |
+ bool srcOrigin() const |
+ { |
+ return (m_origin == SrcOrigin); |
+ } |
+ |
inline bool isEmpty() const |
{ |
return m_string.isEmpty(); |
@@ -99,6 +110,7 @@ private: |
StringView m_string; |
float m_scaleFactor; |
int m_resourceWidth; |
+ Origin m_origin; |
}; |
ImageCandidate bestFitSourceForSrcsetAttribute(float deviceScaleFactor, int effectiveSize, const String& srcsetAttribute); |