OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SizesAttributeParser_h | 5 #ifndef SizesAttributeParser_h |
6 #define SizesAttributeParser_h | 6 #define SizesAttributeParser_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/css/MediaValues.h" | 9 #include "core/css/MediaValues.h" |
10 #include "core/css/parser/MediaQueryBlockWatcher.h" | 10 #include "core/css/parser/MediaQueryBlockWatcher.h" |
11 #include "core/css/parser/MediaQueryParser.h" | 11 #include "core/css/parser/MediaQueryParser.h" |
12 #include "platform/heap/Handle.h" | 12 #include "platform/heap/Handle.h" |
13 #include "wtf/text/WTFString.h" | 13 #include "wtf/text/WTFString.h" |
14 | 14 |
15 namespace blink { | 15 namespace blink { |
16 | 16 |
17 class CORE_EXPORT SizesAttributeParser { | 17 class CORE_EXPORT SizesAttributeParser { |
18 STACK_ALLOCATED(); | 18 STACK_ALLOCATED(); |
19 public: | 19 public: |
20 SizesAttributeParser(PassRefPtr<MediaValues>, const String&); | 20 SizesAttributeParser(PassRefPtrWillBeRawPtr<MediaValues>, const String&); |
21 | 21 |
22 float length(); | 22 float length(); |
23 | 23 |
24 private: | 24 private: |
25 bool parse(CSSParserTokenRange); | 25 bool parse(CSSParserTokenRange); |
26 float effectiveSize(); | 26 float effectiveSize(); |
27 bool calculateLengthInPixels(CSSParserTokenRange, float& result); | 27 bool calculateLengthInPixels(CSSParserTokenRange, float& result); |
28 bool mediaConditionMatches(PassRefPtrWillBeRawPtr<MediaQuerySet> mediaCondit
ion); | 28 bool mediaConditionMatches(PassRefPtrWillBeRawPtr<MediaQuerySet> mediaCondit
ion); |
29 unsigned effectiveSizeDefaultValue(); | 29 unsigned effectiveSizeDefaultValue(); |
30 | 30 |
31 RefPtrWillBeMember<MediaQuerySet> m_mediaCondition; | 31 RefPtrWillBeMember<MediaQuerySet> m_mediaCondition; |
32 RefPtr<MediaValues> m_mediaValues; | 32 RefPtrWillBeMember<MediaValues> m_mediaValues; |
33 float m_length; | 33 float m_length; |
34 bool m_lengthWasSet; | 34 bool m_lengthWasSet; |
35 bool m_isValid; | 35 bool m_isValid; |
36 }; | 36 }; |
37 | 37 |
38 } // namespace | 38 } // namespace |
39 | 39 |
40 #endif | 40 #endif |
41 | 41 |
OLD | NEW |