OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012-2013 Intel Corporation. All rights reserved. | 2 * Copyright (C) 2012-2013 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 24 matching lines...) Expand all Loading... |
35 #include "core/css/CSSToLengthConversionData.h" | 35 #include "core/css/CSSToLengthConversionData.h" |
36 #include "core/css/StylePropertySet.h" | 36 #include "core/css/StylePropertySet.h" |
37 #include "core/css/StyleRule.h" | 37 #include "core/css/StyleRule.h" |
38 #include "core/dom/Document.h" | 38 #include "core/dom/Document.h" |
39 #include "core/dom/NodeRenderStyle.h" | 39 #include "core/dom/NodeRenderStyle.h" |
40 #include "core/dom/ViewportDescription.h" | 40 #include "core/dom/ViewportDescription.h" |
41 #include "core/frame/FrameView.h" | 41 #include "core/frame/FrameView.h" |
42 | 42 |
43 namespace WebCore { | 43 namespace WebCore { |
44 | 44 |
| 45 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(ViewportStyleResolver); |
| 46 |
45 ViewportStyleResolver::ViewportStyleResolver(Document* document) | 47 ViewportStyleResolver::ViewportStyleResolver(Document* document) |
46 : m_document(document), | 48 : m_document(document), |
47 m_hasAuthorStyle(false) | 49 m_hasAuthorStyle(false) |
48 { | 50 { |
49 ASSERT(m_document); | 51 ASSERT(m_document); |
50 } | 52 } |
51 | 53 |
52 ViewportStyleResolver::~ViewportStyleResolver() | |
53 { | |
54 } | |
55 | |
56 void ViewportStyleResolver::collectViewportRules(RuleSet* rules, Origin origin) | 54 void ViewportStyleResolver::collectViewportRules(RuleSet* rules, Origin origin) |
57 { | 55 { |
58 rules->compactRulesIfNeeded(); | 56 rules->compactRulesIfNeeded(); |
59 | 57 |
60 const WillBeHeapVector<RawPtrWillBeMember<StyleRuleViewport> >& viewportRule
s = rules->viewportRules(); | 58 const WillBeHeapVector<RawPtrWillBeMember<StyleRuleViewport> >& viewportRule
s = rules->viewportRules(); |
61 for (size_t i = 0; i < viewportRules.size(); ++i) | 59 for (size_t i = 0; i < viewportRules.size(); ++i) |
62 addViewportRule(viewportRules[i], origin); | 60 addViewportRule(viewportRules[i], origin); |
63 } | 61 } |
64 | 62 |
65 void ViewportStyleResolver::addViewportRule(StyleRuleViewport* viewportRule, Ori
gin origin) | 63 void ViewportStyleResolver::addViewportRule(StyleRuleViewport* viewportRule, Ori
gin origin) |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 float height = view ? view->height() : 0; | 197 float height = view ? view->height() : 0; |
200 | 198 |
201 Length result = primitiveValue->convertToLength<AnyConversion>(CSSToLengthCo
nversionData(documentStyle, documentStyle, width, height, 1.0f)); | 199 Length result = primitiveValue->convertToLength<AnyConversion>(CSSToLengthCo
nversionData(documentStyle, documentStyle, width, height, 1.0f)); |
202 if (documentStyle->hasViewportUnits()) | 200 if (documentStyle->hasViewportUnits()) |
203 m_document->setHasViewportUnits(); | 201 m_document->setHasViewportUnits(); |
204 documentStyle->setHasViewportUnits(documentStyleHasViewportUnits); | 202 documentStyle->setHasViewportUnits(documentStyleHasViewportUnits); |
205 | 203 |
206 return result; | 204 return result; |
207 } | 205 } |
208 | 206 |
| 207 void ViewportStyleResolver::trace(Visitor* visitor) |
| 208 { |
| 209 visitor->trace(m_propertySet); |
| 210 } |
| 211 |
209 } // namespace WebCore | 212 } // namespace WebCore |
OLD | NEW |