| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef SizesAttributeParser_h | |
| 6 #define SizesAttributeParser_h | |
| 7 | |
| 8 #include "core/css/MediaValues.h" | |
| 9 #include "core/css/parser/MediaQueryParser.h" | |
| 10 #include "wtf/text/WTFString.h" | |
| 11 | |
| 12 namespace WebCore { | |
| 13 | |
| 14 class SizesAttributeParser { | |
| 15 public: | |
| 16 static unsigned findEffectiveSize(const String& attribute, PassRefPtr<MediaV
alues>); | |
| 17 | |
| 18 private: | |
| 19 SizesAttributeParser(PassRefPtr<MediaValues> mediaValues) | |
| 20 : m_mediaValues(mediaValues) | |
| 21 , m_length(0) | |
| 22 { | |
| 23 } | |
| 24 | |
| 25 bool parse(Vector<MediaQueryToken>& tokens); | |
| 26 bool parseMediaConditionAndLength(TokenIterator startToken, TokenIterator en
dToken); | |
| 27 unsigned effectiveSize(); | |
| 28 bool calculateLengthInPixels(TokenIterator startToken, TokenIterator endToke
n, unsigned& result); | |
| 29 bool mediaConditionMatches(PassRefPtr<MediaQuerySet> mediaCondition); | |
| 30 unsigned effectiveSizeDefaultValue(); | |
| 31 | |
| 32 RefPtr<MediaQuerySet> m_mediaCondition; | |
| 33 RefPtr<MediaValues> m_mediaValues; | |
| 34 unsigned m_length; | |
| 35 }; | |
| 36 | |
| 37 } // namespace | |
| 38 | |
| 39 #endif | |
| 40 | |
| OLD | NEW |