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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 | 384 |
385 StyleResolver::~StyleResolver() | 385 StyleResolver::~StyleResolver() |
386 { | 386 { |
387 } | 387 } |
388 | 388 |
389 static inline bool applyAuthorStylesOf(const Element* element) | 389 static inline bool applyAuthorStylesOf(const Element* element) |
390 { | 390 { |
391 return element->treeScope().applyAuthorStyles(); | 391 return element->treeScope().applyAuthorStyles(); |
392 } | 392 } |
393 | 393 |
394 void StyleResolver::matchAuthorRulesForShadowHost(Element* element, ElementRuleC
ollector& collector, bool includeEmptyRules, Vector<ScopedStyleResolver*, 8>& re
solvers, Vector<ScopedStyleResolver*, 8>& resolversInShadowTree) | 394 void StyleResolver::matchAuthorRulesForShadowHost(Element* element, ElementRuleC
ollector& collector, bool includeEmptyRules, WillBeHeapVector<RawPtrWillBeMember
<ScopedStyleResolver>, 8>& resolvers, WillBeHeapVector<RawPtrWillBeMember<Scoped
StyleResolver>, 8>& resolversInShadowTree) |
395 { | 395 { |
396 collector.clearMatchedRules(); | 396 collector.clearMatchedRules(); |
397 collector.matchedResult().ranges.lastAuthorRule = collector.matchedResult().
matchedProperties.size() - 1; | 397 collector.matchedResult().ranges.lastAuthorRule = collector.matchedResult().
matchedProperties.size() - 1; |
398 | 398 |
399 CascadeScope cascadeScope = 0; | 399 CascadeScope cascadeScope = 0; |
400 CascadeOrder cascadeOrder = 0; | 400 CascadeOrder cascadeOrder = 0; |
401 bool applyAuthorStyles = applyAuthorStylesOf(element); | 401 bool applyAuthorStyles = applyAuthorStylesOf(element); |
402 | 402 |
403 for (int j = resolversInShadowTree.size() - 1; j >= 0; --j) | 403 for (int j = resolversInShadowTree.size() - 1; j >= 0; --j) |
404 resolversInShadowTree.at(j)->collectMatchingAuthorRules(collector, inclu
deEmptyRules, applyAuthorStyles, cascadeScope, cascadeOrder++); | 404 resolversInShadowTree.at(j)->collectMatchingAuthorRules(collector, inclu
deEmptyRules, applyAuthorStyles, cascadeScope, cascadeOrder++); |
(...skipping 14 matching lines...) Expand all Loading... |
419 collector.matchedResult().ranges.lastAuthorRule = collector.matchedResult().
matchedProperties.size() - 1; | 419 collector.matchedResult().ranges.lastAuthorRule = collector.matchedResult().
matchedProperties.size() - 1; |
420 | 420 |
421 bool applyAuthorStyles = applyAuthorStylesOf(element); | 421 bool applyAuthorStyles = applyAuthorStylesOf(element); |
422 if (m_styleTree.hasOnlyScopedResolverForDocument()) { | 422 if (m_styleTree.hasOnlyScopedResolverForDocument()) { |
423 m_document.scopedStyleResolver()->collectMatchingAuthorRules(collector,
includeEmptyRules, applyAuthorStyles, ignoreCascadeScope); | 423 m_document.scopedStyleResolver()->collectMatchingAuthorRules(collector,
includeEmptyRules, applyAuthorStyles, ignoreCascadeScope); |
424 m_treeBoundaryCrossingRules.collectTreeBoundaryCrossingRules(element, co
llector, includeEmptyRules); | 424 m_treeBoundaryCrossingRules.collectTreeBoundaryCrossingRules(element, co
llector, includeEmptyRules); |
425 collector.sortAndTransferMatchedRules(); | 425 collector.sortAndTransferMatchedRules(); |
426 return; | 426 return; |
427 } | 427 } |
428 | 428 |
429 Vector<ScopedStyleResolver*, 8> resolvers; | 429 WillBeHeapVector<RawPtrWillBeMember<ScopedStyleResolver>, 8> resolvers; |
430 m_styleTree.resolveScopedStyles(element, resolvers); | 430 m_styleTree.resolveScopedStyles(element, resolvers); |
431 | 431 |
432 Vector<ScopedStyleResolver*, 8> resolversInShadowTree; | 432 WillBeHeapVector<RawPtrWillBeMember<ScopedStyleResolver>, 8> resolversInShad
owTree; |
433 m_styleTree.collectScopedResolversForHostedShadowTrees(element, resolversInS
hadowTree); | 433 m_styleTree.collectScopedResolversForHostedShadowTrees(element, resolversInS
hadowTree); |
434 if (!resolversInShadowTree.isEmpty()) { | 434 if (!resolversInShadowTree.isEmpty()) { |
435 matchAuthorRulesForShadowHost(element, collector, includeEmptyRules, res
olvers, resolversInShadowTree); | 435 matchAuthorRulesForShadowHost(element, collector, includeEmptyRules, res
olvers, resolversInShadowTree); |
436 return; | 436 return; |
437 } | 437 } |
438 | 438 |
439 if (resolvers.isEmpty()) | 439 if (resolvers.isEmpty()) |
440 return; | 440 return; |
441 | 441 |
442 CascadeScope cascadeScope = 0; | 442 CascadeScope cascadeScope = 0; |
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1559 visitor->trace(m_keyframesRuleMap); | 1559 visitor->trace(m_keyframesRuleMap); |
1560 visitor->trace(m_matchedPropertiesCache); | 1560 visitor->trace(m_matchedPropertiesCache); |
1561 visitor->trace(m_viewportDependentMediaQueryResults); | 1561 visitor->trace(m_viewportDependentMediaQueryResults); |
1562 visitor->trace(m_viewportStyleResolver); | 1562 visitor->trace(m_viewportStyleResolver); |
1563 visitor->trace(m_features); | 1563 visitor->trace(m_features); |
1564 visitor->trace(m_siblingRuleSet); | 1564 visitor->trace(m_siblingRuleSet); |
1565 visitor->trace(m_uncommonAttributeRuleSet); | 1565 visitor->trace(m_uncommonAttributeRuleSet); |
1566 visitor->trace(m_watchedSelectorsRules); | 1566 visitor->trace(m_watchedSelectorsRules); |
1567 visitor->trace(m_treeBoundaryCrossingRules); | 1567 visitor->trace(m_treeBoundaryCrossingRules); |
1568 visitor->trace(m_pendingStyleSheets); | 1568 visitor->trace(m_pendingStyleSheets); |
| 1569 visitor->trace(m_styleTree); |
1569 #endif | 1570 #endif |
1570 } | 1571 } |
1571 | 1572 |
1572 } // namespace blink | 1573 } // namespace blink |
OLD | NEW |