Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Unified Diff: Source/core/css/parser/SizesAttributeParser.h

Issue 369423002: Have srcset respond to viewport changes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Self review nits Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/css/parser/SizesAttributeParser.h
diff --git a/Source/core/css/parser/SizesAttributeParser.h b/Source/core/css/parser/SizesAttributeParser.h
index 3c7bc4ee260c25283576e9169a1f6818161fe982..0365b707f648f8773bd7405110dd95115981cf7f 100644
--- a/Source/core/css/parser/SizesAttributeParser.h
+++ b/Source/core/css/parser/SizesAttributeParser.h
@@ -15,13 +15,14 @@ namespace WebCore {
class SizesAttributeParser {
STACK_ALLOCATED();
public:
- static unsigned findEffectiveSize(const String& attribute, PassRefPtr<MediaValues>);
+ static unsigned findEffectiveSize(const String& attribute, PassRefPtr<MediaValues>, bool& viewportDependant);
private:
SizesAttributeParser(PassRefPtr<MediaValues> mediaValues)
: m_mediaValues(mediaValues)
, m_length(0)
, m_lengthWasSet(false)
+ , m_viewportDependant(false)
{
}
@@ -31,11 +32,13 @@ private:
bool calculateLengthInPixels(MediaQueryTokenIterator startToken, MediaQueryTokenIterator endToken, unsigned& result);
bool mediaConditionMatches(PassRefPtrWillBeRawPtr<MediaQuerySet> mediaCondition);
unsigned effectiveSizeDefaultValue();
+ bool viewportDependant() const { return m_viewportDependant; }
RefPtrWillBeMember<MediaQuerySet> m_mediaCondition;
RefPtr<MediaValues> m_mediaValues;
unsigned m_length;
bool m_lengthWasSet;
+ bool m_viewportDependant;
};
} // namespace

Powered by Google App Engine
This is Rietveld 408576698