OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Intel Corporation. All rights reserved. | 2 * Copyright (C) 2012 Intel Corporation. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above | 8 * 1. Redistributions of source code must retain the above |
9 * copyright notice, this list of conditions and the following | 9 * copyright notice, this list of conditions and the following |
10 * disclaimer. | 10 * disclaimer. |
(...skipping 13 matching lines...) Expand all Loading... |
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR | 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR |
25 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF | 25 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF |
26 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 26 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
27 * SUCH DAMAGE. | 27 * SUCH DAMAGE. |
28 */ | 28 */ |
29 | 29 |
30 #ifndef ViewportStyleResolver_h | 30 #ifndef ViewportStyleResolver_h |
31 #define ViewportStyleResolver_h | 31 #define ViewportStyleResolver_h |
32 | 32 |
33 #include "CSSPropertyNames.h" | 33 #include "CSSPropertyNames.h" |
| 34 #include "core/platform/Length.h" |
34 #include "wtf/RefCounted.h" | 35 #include "wtf/RefCounted.h" |
35 #include "wtf/RefPtr.h" | 36 #include "wtf/RefPtr.h" |
36 | 37 |
37 namespace WebCore { | 38 namespace WebCore { |
38 | 39 |
39 class Document; | 40 class Document; |
40 class MutableStylePropertySet; | 41 class MutableStylePropertySet; |
41 class StyleRuleViewport; | 42 class StyleRuleViewport; |
42 | 43 |
43 class ViewportStyleResolver : public RefCounted<ViewportStyleResolver> { | 44 class ViewportStyleResolver : public RefCounted<ViewportStyleResolver> { |
44 public: | 45 public: |
45 static PassRefPtr<ViewportStyleResolver> create(Document* document) | 46 static PassRefPtr<ViewportStyleResolver> create(Document* document) |
46 { | 47 { |
47 return adoptRef(new ViewportStyleResolver(document)); | 48 return adoptRef(new ViewportStyleResolver(document)); |
48 } | 49 } |
49 | 50 |
50 ~ViewportStyleResolver(); | 51 ~ViewportStyleResolver(); |
51 | 52 |
52 void addViewportRule(StyleRuleViewport*); | 53 void addViewportRule(StyleRuleViewport*); |
53 | 54 |
54 void clearDocument(); | 55 void clearDocument(); |
55 void resolve(); | 56 void resolve(); |
56 | 57 |
57 private: | 58 private: |
58 explicit ViewportStyleResolver(Document*); | 59 explicit ViewportStyleResolver(Document*); |
59 | 60 |
60 float getViewportArgumentValue(CSSPropertyID) const; | 61 float viewportArgumentValue(CSSPropertyID) const; |
| 62 Length viewportLengthValue(CSSPropertyID) const; |
61 | 63 |
62 Document* m_document; | 64 Document* m_document; |
63 RefPtr<MutableStylePropertySet> m_propertySet; | 65 RefPtr<MutableStylePropertySet> m_propertySet; |
64 }; | 66 }; |
65 | 67 |
66 } // namespace WebCore | 68 } // namespace WebCore |
67 | 69 |
68 #endif // ViewportStyleResolver_h | 70 #endif // ViewportStyleResolver_h |
OLD | NEW |