| 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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 // Collect all ids and rules using sibling selectors (:first-child and simil
ar) | 273 // Collect all ids and rules using sibling selectors (:first-child and simil
ar) |
| 274 // in the current set of stylesheets. Style sharing code uses this informati
on to reject | 274 // in the current set of stylesheets. Style sharing code uses this informati
on to reject |
| 275 // sharing candidates. | 275 // sharing candidates. |
| 276 CSSDefaultStyleSheets& defaultStyleSheets = CSSDefaultStyleSheets::instance(
); | 276 CSSDefaultStyleSheets& defaultStyleSheets = CSSDefaultStyleSheets::instance(
); |
| 277 if (defaultStyleSheets.defaultStyle()) | 277 if (defaultStyleSheets.defaultStyle()) |
| 278 m_features.add(defaultStyleSheets.defaultStyle()->features()); | 278 m_features.add(defaultStyleSheets.defaultStyle()->features()); |
| 279 | 279 |
| 280 if (document().isViewSource()) | 280 if (document().isViewSource()) |
| 281 m_features.add(defaultStyleSheets.defaultViewSourceStyle()->features()); | 281 m_features.add(defaultStyleSheets.defaultViewSourceStyle()->features()); |
| 282 | 282 |
| 283 if (document().isTransitionDocument()) | |
| 284 m_features.add(defaultStyleSheets.defaultTransitionStyle()->features()); | |
| 285 | |
| 286 if (m_watchedSelectorsRules) | 283 if (m_watchedSelectorsRules) |
| 287 m_features.add(m_watchedSelectorsRules->features()); | 284 m_features.add(m_watchedSelectorsRules->features()); |
| 288 | 285 |
| 289 document().styleEngine().collectScopedStyleFeaturesTo(m_features); | 286 document().styleEngine().collectScopedStyleFeaturesTo(m_features); |
| 290 | 287 |
| 291 m_siblingRuleSet = makeRuleSet(m_features.siblingRules); | 288 m_siblingRuleSet = makeRuleSet(m_features.siblingRules); |
| 292 m_uncommonAttributeRuleSet = makeRuleSet(m_features.uncommonAttributeRules); | 289 m_uncommonAttributeRuleSet = makeRuleSet(m_features.uncommonAttributeRules); |
| 293 m_needCollectFeatures = false; | 290 m_needCollectFeatures = false; |
| 294 } | 291 } |
| 295 | 292 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 matchRuleSet(collector, userAgentStyleSheet); | 411 matchRuleSet(collector, userAgentStyleSheet); |
| 415 | 412 |
| 416 // In quirks mode, we match rules from the quirks user agent sheet. | 413 // In quirks mode, we match rules from the quirks user agent sheet. |
| 417 if (document().inQuirksMode()) | 414 if (document().inQuirksMode()) |
| 418 matchRuleSet(collector, defaultStyleSheets.defaultQuirksStyle()); | 415 matchRuleSet(collector, defaultStyleSheets.defaultQuirksStyle()); |
| 419 | 416 |
| 420 // If document uses view source styles (in view source mode or in xml viewer
mode), then we match rules from the view source style sheet. | 417 // If document uses view source styles (in view source mode or in xml viewer
mode), then we match rules from the view source style sheet. |
| 421 if (document().isViewSource()) | 418 if (document().isViewSource()) |
| 422 matchRuleSet(collector, defaultStyleSheets.defaultViewSourceStyle()); | 419 matchRuleSet(collector, defaultStyleSheets.defaultViewSourceStyle()); |
| 423 | 420 |
| 424 if (document().isTransitionDocument()) | |
| 425 matchRuleSet(collector, defaultStyleSheets.defaultTransitionStyle()); | |
| 426 | |
| 427 collector.setMatchingUARules(false); | 421 collector.setMatchingUARules(false); |
| 428 } | 422 } |
| 429 | 423 |
| 430 void StyleResolver::matchRuleSet(ElementRuleCollector& collector, RuleSet* rules
) | 424 void StyleResolver::matchRuleSet(ElementRuleCollector& collector, RuleSet* rules
) |
| 431 { | 425 { |
| 432 collector.clearMatchedRules(); | 426 collector.clearMatchedRules(); |
| 433 collector.matchedResult().ranges.lastUARule = collector.matchedResult().matc
hedProperties.size() - 1; | 427 collector.matchedResult().ranges.lastUARule = collector.matchedResult().matc
hedProperties.size() - 1; |
| 434 | 428 |
| 435 RuleRange ruleRange = collector.matchedResult().ranges.UARuleRange(); | 429 RuleRange ruleRange = collector.matchedResult().ranges.UARuleRange(); |
| 436 collector.collectMatchingRules(MatchRequest(rules), ruleRange); | 430 collector.collectMatchingRules(MatchRequest(rules), ruleRange); |
| (...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1505 visitor->trace(m_watchedSelectorsRules); | 1499 visitor->trace(m_watchedSelectorsRules); |
| 1506 visitor->trace(m_treeBoundaryCrossingRules); | 1500 visitor->trace(m_treeBoundaryCrossingRules); |
| 1507 visitor->trace(m_styleResourceLoader); | 1501 visitor->trace(m_styleResourceLoader); |
| 1508 visitor->trace(m_styleSharingLists); | 1502 visitor->trace(m_styleSharingLists); |
| 1509 visitor->trace(m_pendingStyleSheets); | 1503 visitor->trace(m_pendingStyleSheets); |
| 1510 visitor->trace(m_document); | 1504 visitor->trace(m_document); |
| 1511 #endif | 1505 #endif |
| 1512 } | 1506 } |
| 1513 | 1507 |
| 1514 } // namespace blink | 1508 } // namespace blink |
| OLD | NEW |