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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 { | 57 { |
58 rules->compactRulesIfNeeded(); | 58 rules->compactRulesIfNeeded(); |
59 | 59 |
60 const WillBeHeapVector<RawPtrWillBeMember<StyleRuleViewport> >& viewportRule
s = rules->viewportRules(); | 60 const WillBeHeapVector<RawPtrWillBeMember<StyleRuleViewport> >& viewportRule
s = rules->viewportRules(); |
61 for (size_t i = 0; i < viewportRules.size(); ++i) | 61 for (size_t i = 0; i < viewportRules.size(); ++i) |
62 addViewportRule(viewportRules[i], origin); | 62 addViewportRule(viewportRules[i], origin); |
63 } | 63 } |
64 | 64 |
65 void ViewportStyleResolver::addViewportRule(StyleRuleViewport* viewportRule, Ori
gin origin) | 65 void ViewportStyleResolver::addViewportRule(StyleRuleViewport* viewportRule, Ori
gin origin) |
66 { | 66 { |
67 StylePropertySet* propertySet = viewportRule->mutableProperties(); | 67 StylePropertySet& propertySet = viewportRule->mutableProperties(); |
68 | 68 |
69 unsigned propertyCount = propertySet->propertyCount(); | 69 unsigned propertyCount = propertySet.propertyCount(); |
70 if (!propertyCount) | 70 if (!propertyCount) |
71 return; | 71 return; |
72 | 72 |
73 if (origin == AuthorOrigin) | 73 if (origin == AuthorOrigin) |
74 m_hasAuthorStyle = true; | 74 m_hasAuthorStyle = true; |
75 | 75 |
76 if (!m_propertySet) { | 76 if (!m_propertySet) { |
77 m_propertySet = propertySet->mutableCopy(); | 77 m_propertySet = propertySet.mutableCopy(); |
78 return; | 78 return; |
79 } | 79 } |
80 | 80 |
81 // We cannot use mergeAndOverrideOnConflict() here because it doesn't | 81 // We cannot use mergeAndOverrideOnConflict() here because it doesn't |
82 // respect the !important declaration (but addParsedProperty() does). | 82 // respect the !important declaration (but addParsedProperty() does). |
83 for (unsigned i = 0; i < propertyCount; ++i) | 83 for (unsigned i = 0; i < propertyCount; ++i) |
84 m_propertySet->addParsedProperty(propertySet->propertyAt(i).toCSSPropert
y()); | 84 m_propertySet->addParsedProperty(propertySet.propertyAt(i).toCSSProperty
()); |
85 } | 85 } |
86 | 86 |
87 void ViewportStyleResolver::clearDocument() | 87 void ViewportStyleResolver::clearDocument() |
88 { | 88 { |
89 m_document = 0; | 89 m_document = 0; |
90 } | 90 } |
91 | 91 |
92 void ViewportStyleResolver::resolve() | 92 void ViewportStyleResolver::resolve() |
93 { | 93 { |
94 if (!m_document) | 94 if (!m_document) |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 | 200 |
201 Length result = primitiveValue->convertToLength<AnyConversion>(CSSToLengthCo
nversionData(documentStyle, documentStyle, width, height, 1.0f)); | 201 Length result = primitiveValue->convertToLength<AnyConversion>(CSSToLengthCo
nversionData(documentStyle, documentStyle, width, height, 1.0f)); |
202 if (documentStyle->hasViewportUnits()) | 202 if (documentStyle->hasViewportUnits()) |
203 m_document->setHasViewportUnits(); | 203 m_document->setHasViewportUnits(); |
204 documentStyle->setHasViewportUnits(documentStyleHasViewportUnits); | 204 documentStyle->setHasViewportUnits(documentStyleHasViewportUnits); |
205 | 205 |
206 return result; | 206 return result; |
207 } | 207 } |
208 | 208 |
209 } // namespace WebCore | 209 } // namespace WebCore |
OLD | NEW |