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 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r
ights 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 15 matching lines...) Expand all Loading... |
26 * Boston, MA 02110-1301, USA. | 26 * Boston, MA 02110-1301, USA. |
27 */ | 27 */ |
28 | 28 |
29 #include "config.h" | 29 #include "config.h" |
30 #include "core/css/RuleSet.h" | 30 #include "core/css/RuleSet.h" |
31 | 31 |
32 #include <wtf/MemoryInstrumentationHashMap.h> | 32 #include <wtf/MemoryInstrumentationHashMap.h> |
33 #include <wtf/MemoryInstrumentationHashSet.h> | 33 #include <wtf/MemoryInstrumentationHashSet.h> |
34 #include <wtf/MemoryInstrumentationVector.h> | 34 #include <wtf/MemoryInstrumentationVector.h> |
35 #include "HTMLNames.h" | 35 #include "HTMLNames.h" |
| 36 #include "RuntimeEnabledFeatures.h" |
36 #include "core/css/CSSFontSelector.h" | 37 #include "core/css/CSSFontSelector.h" |
37 #include "core/css/CSSKeyframesRule.h" | 38 #include "core/css/CSSKeyframesRule.h" |
38 #include "core/css/CSSSelector.h" | 39 #include "core/css/CSSSelector.h" |
39 #include "core/css/CSSSelectorList.h" | 40 #include "core/css/CSSSelectorList.h" |
40 #include "core/css/MediaQueryEvaluator.h" | 41 #include "core/css/MediaQueryEvaluator.h" |
41 #include "core/css/SelectorChecker.h" | 42 #include "core/css/SelectorChecker.h" |
42 #include "core/css/SelectorCheckerFastPath.h" | 43 #include "core/css/SelectorCheckerFastPath.h" |
43 #include "core/css/SelectorFilter.h" | 44 #include "core/css/SelectorFilter.h" |
44 #include "core/css/StyleRule.h" | 45 #include "core/css/StyleRule.h" |
45 #include "core/css/StyleRuleImport.h" | 46 #include "core/css/StyleRuleImport.h" |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 if (!isDocumentScope(scope)) | 335 if (!isDocumentScope(scope)) |
335 continue; | 336 continue; |
336 resolver->addKeyframeStyle(static_cast<StyleRuleKeyframes*>(rule)); | 337 resolver->addKeyframeStyle(static_cast<StyleRuleKeyframes*>(rule)); |
337 } | 338 } |
338 else if (rule->isRegionRule() && resolver) { | 339 else if (rule->isRegionRule() && resolver) { |
339 // FIXME (BUG 72472): We don't add @-webkit-region rules of scoped s
tyle sheets for the moment. | 340 // FIXME (BUG 72472): We don't add @-webkit-region rules of scoped s
tyle sheets for the moment. |
340 addRegionRule(static_cast<StyleRuleRegion*>(rule), hasDocumentSecuri
tyOrigin); | 341 addRegionRule(static_cast<StyleRuleRegion*>(rule), hasDocumentSecuri
tyOrigin); |
341 } | 342 } |
342 else if (rule->isHostRule()) | 343 else if (rule->isHostRule()) |
343 resolver->ensureScopedStyleResolver(scope->shadowHost())->addHostRul
e(static_cast<StyleRuleHost*>(rule), hasDocumentSecurityOrigin, scope); | 344 resolver->ensureScopedStyleResolver(scope->shadowHost())->addHostRul
e(static_cast<StyleRuleHost*>(rule), hasDocumentSecurityOrigin, scope); |
344 #if ENABLE(CSS_DEVICE_ADAPTATION) | 345 else if (RuntimeEnabledFeatures::cssViewportEnabled() && rule->isViewpor
tRule() && resolver) { |
345 else if (rule->isViewportRule() && resolver) { | |
346 // @viewport should not be scoped. | 346 // @viewport should not be scoped. |
347 if (!isDocumentScope(scope)) | 347 if (!isDocumentScope(scope)) |
348 continue; | 348 continue; |
349 resolver->viewportStyleResolver()->addViewportRule(static_cast<Style
RuleViewport*>(rule)); | 349 resolver->viewportStyleResolver()->addViewportRule(static_cast<Style
RuleViewport*>(rule)); |
350 } | 350 } |
351 #endif | |
352 else if (rule->isSupportsRule() && static_cast<StyleRuleSupports*>(rule)
->conditionIsSupported()) | 351 else if (rule->isSupportsRule() && static_cast<StyleRuleSupports*>(rule)
->conditionIsSupported()) |
353 addChildRules(static_cast<StyleRuleSupports*>(rule)->childRules(), m
edium, resolver, scope, hasDocumentSecurityOrigin, addRuleFlags); | 352 addChildRules(static_cast<StyleRuleSupports*>(rule)->childRules(), m
edium, resolver, scope, hasDocumentSecurityOrigin, addRuleFlags); |
354 } | 353 } |
355 } | 354 } |
356 | 355 |
357 void RuleSet::addRulesFromSheet(StyleSheetContents* sheet, const MediaQueryEvalu
ator& medium, StyleResolver* resolver, const ContainerNode* scope) | 356 void RuleSet::addRulesFromSheet(StyleSheetContents* sheet, const MediaQueryEvalu
ator& medium, StyleResolver* resolver, const ContainerNode* scope) |
358 { | 357 { |
359 ASSERT(sheet); | 358 ASSERT(sheet); |
360 | 359 |
361 const Vector<RefPtr<StyleRuleImport> >& importRules = sheet->importRules(); | 360 const Vector<RefPtr<StyleRuleImport> >& importRules = sheet->importRules(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 shrinkMapVectorsToFit(m_tagRules); | 393 shrinkMapVectorsToFit(m_tagRules); |
395 shrinkMapVectorsToFit(m_shadowPseudoElementRules); | 394 shrinkMapVectorsToFit(m_shadowPseudoElementRules); |
396 m_linkPseudoClassRules.shrinkToFit(); | 395 m_linkPseudoClassRules.shrinkToFit(); |
397 m_cuePseudoRules.shrinkToFit(); | 396 m_cuePseudoRules.shrinkToFit(); |
398 m_focusPseudoClassRules.shrinkToFit(); | 397 m_focusPseudoClassRules.shrinkToFit(); |
399 m_universalRules.shrinkToFit(); | 398 m_universalRules.shrinkToFit(); |
400 m_pageRules.shrinkToFit(); | 399 m_pageRules.shrinkToFit(); |
401 } | 400 } |
402 | 401 |
403 } // namespace WebCore | 402 } // namespace WebCore |
OLD | NEW |