Chromium Code Reviews| 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 SizesCalcParser_h | 5 #ifndef SizesCalcParser_h |
| 6 #define SizesCalcParser_h | 6 #define SizesCalcParser_h |
| 7 | 7 |
| 8 #include "core/css/MediaValues.h" | 8 #include "core/css/MediaValues.h" |
| 9 #include "core/css/parser/MediaQueryToken.h" | 9 #include "core/css/parser/MediaQueryToken.h" |
| 10 #include "wtf/text/WTFString.h" | 10 #include "wtf/text/WTFString.h" |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 27 : value(numericValue) | 27 : value(numericValue) |
| 28 , isLength(length) | 28 , isLength(length) |
| 29 , operation(0) | 29 , operation(0) |
| 30 { | 30 { |
| 31 } | 31 } |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 class SizesCalcParser { | 34 class SizesCalcParser { |
| 35 | 35 |
| 36 public: | 36 public: |
| 37 static bool parse(MediaQueryTokenIterator start, MediaQueryTokenIterator end , PassRefPtr<MediaValues>, unsigned& result); | 37 static bool parse(MediaQueryTokenIterator start, MediaQueryTokenIterator end , PassRefPtr<MediaValues>, unsigned& result, bool& viewportDependant); |
|
esprehn
2014/07/14 08:39:49
Same thing, this is way too many out params now, y
| |
| 38 bool viewportDependant() const { return m_viewportDependant; } | |
| 38 | 39 |
| 39 private: | 40 private: |
| 40 SizesCalcParser(PassRefPtr<MediaValues> mediaValues) | 41 SizesCalcParser(PassRefPtr<MediaValues> mediaValues) |
| 41 : m_mediaValues(mediaValues) | 42 : m_mediaValues(mediaValues) |
| 43 , m_viewportDependant(false) | |
| 42 { | 44 { |
| 43 } | 45 } |
| 44 | 46 |
| 45 bool calcToReversePolishNotation(MediaQueryTokenIterator start, MediaQueryTo kenIterator end); | 47 bool calcToReversePolishNotation(MediaQueryTokenIterator start, MediaQueryTo kenIterator end); |
| 46 bool calculate(unsigned& result); | 48 bool calculate(unsigned& result); |
| 47 void appendNumber(const MediaQueryToken&); | 49 void appendNumber(const MediaQueryToken&); |
| 48 bool appendLength(const MediaQueryToken&); | 50 bool appendLength(const MediaQueryToken&); |
| 49 bool handleOperator(Vector<MediaQueryToken>& stack, const MediaQueryToken&); | 51 bool handleOperator(Vector<MediaQueryToken>& stack, const MediaQueryToken&); |
| 50 void appendOperator(const MediaQueryToken&); | 52 void appendOperator(const MediaQueryToken&); |
| 51 | 53 |
| 52 Vector<SizesCalcValue> m_valueList; | 54 Vector<SizesCalcValue> m_valueList; |
| 53 RefPtr<MediaValues> m_mediaValues; | 55 RefPtr<MediaValues> m_mediaValues; |
| 56 bool m_viewportDependant; | |
| 54 }; | 57 }; |
| 55 | 58 |
| 56 } // namespace WebCore | 59 } // namespace WebCore |
| 57 | 60 |
| 58 #endif // SizesCalcParser_h | 61 #endif // SizesCalcParser_h |
| 59 | 62 |
| OLD | NEW |