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 int findEffectiveSize(const String& attribute, PassRefPtr<MediaValues >); | |
17 | |
18 private: | |
19 SizesAttributeParser(PassRefPtr<MediaValues> mediaValues) | |
eseidel
2014/04/08 06:02:14
Feels a bit odd for this to be private, but OK. I
| |
20 : m_mediaValues(mediaValues) | |
21 , m_length(0) | |
22 { | |
23 } | |
24 | |
25 bool parseImpl(Vector<MediaQueryToken>& tokens); | |
26 bool parseMediaConditionAndLength(TokenIterator startToken, TokenIterator en dToken); | |
eseidel
2014/04/08 06:02:14
Should these be const&?
| |
27 int effectiveSize(); | |
28 int calculateLengthInPixels(TokenIterator startToken, TokenIterator endToken ); | |
29 bool mediaConditionMatches(PassRefPtr<MediaQuerySet> mediaCondition); | |
30 | |
31 RefPtr<MediaQuerySet> m_mediaCondition; | |
32 RefPtr<MediaValues> m_mediaValues; | |
33 int m_length; | |
eseidel
2014/04/08 06:02:14
Do you want these to be ints or unsigned?
| |
34 int m_defaultLength; | |
35 }; | |
36 | |
37 } // namespace | |
38 | |
39 #endif | |
40 | |
OLD | NEW |