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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 if (view) { | 152 if (view) { |
153 m_medium = adoptPtr(new MediaQueryEvaluator(&view->frame())); | 153 m_medium = adoptPtr(new MediaQueryEvaluator(&view->frame())); |
154 m_printMediaType = equalIgnoringCase(view->mediaType(), MediaTypeNames::
print); | 154 m_printMediaType = equalIgnoringCase(view->mediaType(), MediaTypeNames::
print); |
155 } else { | 155 } else { |
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() |
| 163 { |
| 164 } |
| 165 |
162 void StyleResolver::initWatchedSelectorRules() | 166 void StyleResolver::initWatchedSelectorRules() |
163 { | 167 { |
164 CSSSelectorWatch* watch = CSSSelectorWatch::fromIfExists(*m_document); | 168 CSSSelectorWatch* watch = CSSSelectorWatch::fromIfExists(*m_document); |
165 if (!watch) | 169 if (!watch) |
166 return; | 170 return; |
167 const WillBeHeapVector<RefPtrWillBeMember<StyleRule>>& watchedSelectors = wa
tch->watchedCallbackSelectors(); | 171 const WillBeHeapVector<RefPtrWillBeMember<StyleRule>>& watchedSelectors = wa
tch->watchedCallbackSelectors(); |
168 if (!watchedSelectors.size()) | 172 if (!watchedSelectors.size()) |
169 return; | 173 return; |
170 m_watchedSelectorsRules = RuleSet::create(); | 174 m_watchedSelectorsRules = RuleSet::create(); |
171 for (unsigned i = 0; i < watchedSelectors.size(); ++i) | 175 for (unsigned i = 0; i < watchedSelectors.size(); ++i) |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 void StyleResolver::pushParentElement(Element& parent) | 343 void StyleResolver::pushParentElement(Element& parent) |
340 { | 344 { |
341 m_selectorFilter.pushParent(parent); | 345 m_selectorFilter.pushParent(parent); |
342 } | 346 } |
343 | 347 |
344 void StyleResolver::popParentElement(Element& parent) | 348 void StyleResolver::popParentElement(Element& parent) |
345 { | 349 { |
346 m_selectorFilter.popParent(parent); | 350 m_selectorFilter.popParent(parent); |
347 } | 351 } |
348 | 352 |
349 StyleResolver::~StyleResolver() | |
350 { | |
351 } | |
352 | |
353 static inline ScopedStyleResolver* scopedResolverFor(const Element* element) | 353 static inline ScopedStyleResolver* scopedResolverFor(const Element* element) |
354 { | 354 { |
355 // Ideally, returning element->treeScope().scopedStyleResolver() should be | 355 // Ideally, returning element->treeScope().scopedStyleResolver() should be |
356 // enough, but ::cue and custom pseudo elements like ::-webkit-meter-bar pie
rce | 356 // enough, but ::cue and custom pseudo elements like ::-webkit-meter-bar pie
rce |
357 // through a shadow dom boundary, yet they are not part of m_treeBoundaryCro
ssingRules. | 357 // through a shadow dom boundary, yet they are not part of m_treeBoundaryCro
ssingRules. |
358 // The assumption here is that these rules only pierce through one boundary
and | 358 // The assumption here is that these rules only pierce through one boundary
and |
359 // that the scope of these elements do not have a style resolver due to the
fact | 359 // that the scope of these elements do not have a style resolver due to the
fact |
360 // that VTT scopes and UA shadow trees don't have <style> elements. This is | 360 // that VTT scopes and UA shadow trees don't have <style> elements. This is |
361 // backed up by the ASSERTs below. | 361 // backed up by the ASSERTs below. |
362 // | 362 // |
(...skipping 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1487 visitor->trace(m_watchedSelectorsRules); | 1487 visitor->trace(m_watchedSelectorsRules); |
1488 visitor->trace(m_treeBoundaryCrossingRules); | 1488 visitor->trace(m_treeBoundaryCrossingRules); |
1489 visitor->trace(m_styleResourceLoader); | 1489 visitor->trace(m_styleResourceLoader); |
1490 visitor->trace(m_styleSharingLists); | 1490 visitor->trace(m_styleSharingLists); |
1491 visitor->trace(m_pendingStyleSheets); | 1491 visitor->trace(m_pendingStyleSheets); |
1492 visitor->trace(m_document); | 1492 visitor->trace(m_document); |
1493 #endif | 1493 #endif |
1494 } | 1494 } |
1495 | 1495 |
1496 } // namespace blink | 1496 } // namespace blink |
OLD | NEW |