OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) |
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) | 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) |
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
All rights reserved. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
All rights reserved. |
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 m_medium = adoptPtr(new MediaQueryEvaluator("all")); | 156 m_medium = adoptPtr(new MediaQueryEvaluator("all")); |
157 } | 157 } |
158 | 158 |
159 initWatchedSelectorRules(); | 159 initWatchedSelectorRules(); |
160 } | 160 } |
161 | 161 |
162 StyleResolver::~StyleResolver() | 162 StyleResolver::~StyleResolver() |
163 { | 163 { |
164 } | 164 } |
165 | 165 |
| 166 #if ENABLE(OILPAN) |
| 167 void StyleResolver::dispose() |
| 168 { |
| 169 m_features.clear(); |
| 170 if (m_siblingRuleSet) { |
| 171 m_siblingRuleSet->dispose(); |
| 172 m_siblingRuleSet.clear(); |
| 173 } |
| 174 if (m_uncommonAttributeRuleSet) { |
| 175 m_uncommonAttributeRuleSet->dispose(); |
| 176 m_uncommonAttributeRuleSet.clear(); |
| 177 } |
| 178 m_styleSharingLists.clear(); |
| 179 if (m_watchedSelectorsRules) { |
| 180 m_watchedSelectorsRules->dispose(); |
| 181 m_watchedSelectorsRules.clear(); |
| 182 } |
| 183 m_pendingStyleSheets.clear(); |
| 184 } |
| 185 #endif |
| 186 |
166 void StyleResolver::initWatchedSelectorRules() | 187 void StyleResolver::initWatchedSelectorRules() |
167 { | 188 { |
168 CSSSelectorWatch* watch = CSSSelectorWatch::fromIfExists(*m_document); | 189 CSSSelectorWatch* watch = CSSSelectorWatch::fromIfExists(*m_document); |
169 if (!watch) | 190 if (!watch) |
170 return; | 191 return; |
171 const WillBeHeapVector<RefPtrWillBeMember<StyleRule>>& watchedSelectors = wa
tch->watchedCallbackSelectors(); | 192 const WillBeHeapVector<RefPtrWillBeMember<StyleRule>>& watchedSelectors = wa
tch->watchedCallbackSelectors(); |
172 if (!watchedSelectors.size()) | 193 if (!watchedSelectors.size()) |
173 return; | 194 return; |
174 m_watchedSelectorsRules = RuleSet::create(); | 195 m_watchedSelectorsRules = RuleSet::create(); |
175 for (unsigned i = 0; i < watchedSelectors.size(); ++i) | 196 for (unsigned i = 0; i < watchedSelectors.size(); ++i) |
(...skipping 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1454 | 1475 |
1455 for (CSSPropertyID property : properties) { | 1476 for (CSSPropertyID property : properties) { |
1456 if (property == CSSPropertyLineHeight) | 1477 if (property == CSSPropertyLineHeight) |
1457 updateFont(state); | 1478 updateFont(state); |
1458 StyleBuilder::applyProperty(property, state, propertySet.getPropertyCSSV
alue(property).get()); | 1479 StyleBuilder::applyProperty(property, state, propertySet.getPropertyCSSV
alue(property).get()); |
1459 } | 1480 } |
1460 } | 1481 } |
1461 | 1482 |
1462 void StyleResolver::addMediaQueryResults(const MediaQueryResultList& list) | 1483 void StyleResolver::addMediaQueryResults(const MediaQueryResultList& list) |
1463 { | 1484 { |
1464 for (size_t i = 0; i < list.size(); ++i) | 1485 if (list.size()) |
1465 m_viewportDependentMediaQueryResults.append(list[i]); | 1486 m_viewportDependentMediaQueryResults.appendVector(list); |
1466 } | 1487 } |
1467 | 1488 |
1468 bool StyleResolver::mediaQueryAffectedByViewportChange() const | 1489 bool StyleResolver::mediaQueryAffectedByViewportChange() const |
1469 { | 1490 { |
1470 for (unsigned i = 0; i < m_viewportDependentMediaQueryResults.size(); ++i) { | 1491 for (unsigned i = 0; i < m_viewportDependentMediaQueryResults.size(); ++i) { |
1471 if (m_medium->eval(m_viewportDependentMediaQueryResults[i]->expression()
) != m_viewportDependentMediaQueryResults[i]->result()) | 1492 if (m_medium->eval(m_viewportDependentMediaQueryResults[i]->expression()
) != m_viewportDependentMediaQueryResults[i]->result()) |
1472 return true; | 1493 return true; |
1473 } | 1494 } |
1474 return false; | 1495 return false; |
1475 } | 1496 } |
(...skipping 11 matching lines...) Expand all Loading... |
1487 visitor->trace(m_watchedSelectorsRules); | 1508 visitor->trace(m_watchedSelectorsRules); |
1488 visitor->trace(m_treeBoundaryCrossingRules); | 1509 visitor->trace(m_treeBoundaryCrossingRules); |
1489 visitor->trace(m_styleResourceLoader); | 1510 visitor->trace(m_styleResourceLoader); |
1490 visitor->trace(m_styleSharingLists); | 1511 visitor->trace(m_styleSharingLists); |
1491 visitor->trace(m_pendingStyleSheets); | 1512 visitor->trace(m_pendingStyleSheets); |
1492 visitor->trace(m_document); | 1513 visitor->trace(m_document); |
1493 #endif | 1514 #endif |
1494 } | 1515 } |
1495 | 1516 |
1496 } // namespace blink | 1517 } // namespace blink |
OLD | NEW |