Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: Source/core/css/RuleSet.cpp

Issue 19555002: Translate viewport related meta tags into @viewport descriptors as suggested by the CSS Device Adap… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 else if (rule->isRegionRule() && resolver) { 421 else if (rule->isRegionRule() && resolver) {
422 // FIXME (BUG 72472): We don't add @-webkit-region rules of scoped s tyle sheets for the moment. 422 // FIXME (BUG 72472): We don't add @-webkit-region rules of scoped s tyle sheets for the moment.
423 addRegionRule(static_cast<StyleRuleRegion*>(rule), hasDocumentSecuri tyOrigin); 423 addRegionRule(static_cast<StyleRuleRegion*>(rule), hasDocumentSecuri tyOrigin);
424 } else if (rule->isHostRule() && resolver) { 424 } else if (rule->isHostRule() && resolver) {
425 if (!isScopingNodeInShadowTree(scope)) 425 if (!isScopingNodeInShadowTree(scope))
426 continue; 426 continue;
427 bool enabled = resolver->buildScopedStyleTreeInDocumentOrder(); 427 bool enabled = resolver->buildScopedStyleTreeInDocumentOrder();
428 resolver->setBuildScopedStyleTreeInDocumentOrder(false); 428 resolver->setBuildScopedStyleTreeInDocumentOrder(false);
429 resolver->ensureScopedStyleResolver(scope->shadowHost())->addHostRul e(static_cast<StyleRuleHost*>(rule), hasDocumentSecurityOrigin, scope); 429 resolver->ensureScopedStyleResolver(scope->shadowHost())->addHostRul e(static_cast<StyleRuleHost*>(rule), hasDocumentSecurityOrigin, scope);
430 resolver->setBuildScopedStyleTreeInDocumentOrder(enabled); 430 resolver->setBuildScopedStyleTreeInDocumentOrder(enabled);
431 } else if (RuntimeEnabledFeatures::cssViewportEnabled() && rule->isViewp ortRule()) { 431 } else if (rule->isViewportRule()) {
432 // @viewport should not be scoped.
433 if (!isDocumentScope(scope)) 432 if (!isDocumentScope(scope))
434 continue; 433 continue;
435 addViewportRule(static_cast<StyleRuleViewport*>(rule)); 434 addViewportRule(static_cast<StyleRuleViewport*>(rule));
436 } 435 }
437 else if (rule->isSupportsRule() && static_cast<StyleRuleSupports*>(rule) ->conditionIsSupported()) 436 else if (rule->isSupportsRule() && static_cast<StyleRuleSupports*>(rule) ->conditionIsSupported())
438 addChildRules(static_cast<StyleRuleSupports*>(rule)->childRules(), m edium, resolver, scope, hasDocumentSecurityOrigin, addRuleFlags); 437 addChildRules(static_cast<StyleRuleSupports*>(rule)->childRules(), m edium, resolver, scope, hasDocumentSecurityOrigin, addRuleFlags);
439 } 438 }
440 } 439 }
441 440
442 void RuleSet::addRulesFromSheet(StyleSheetContents* sheet, const MediaQueryEvalu ator& medium, StyleResolver* resolver, const ContainerNode* scope) 441 void RuleSet::addRulesFromSheet(StyleSheetContents* sheet, const MediaQueryEvalu ator& medium, StyleResolver* resolver, const ContainerNode* scope)
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 compactPendingRules(pendingRules->shadowPseudoElementRules, m_shadowPseudoEl ementRules); 489 compactPendingRules(pendingRules->shadowPseudoElementRules, m_shadowPseudoEl ementRules);
491 m_linkPseudoClassRules.shrinkToFit(); 490 m_linkPseudoClassRules.shrinkToFit();
492 m_cuePseudoRules.shrinkToFit(); 491 m_cuePseudoRules.shrinkToFit();
493 m_focusPseudoClassRules.shrinkToFit(); 492 m_focusPseudoClassRules.shrinkToFit();
494 m_universalRules.shrinkToFit(); 493 m_universalRules.shrinkToFit();
495 m_pageRules.shrinkToFit(); 494 m_pageRules.shrinkToFit();
496 m_viewportRules.shrinkToFit(); 495 m_viewportRules.shrinkToFit();
497 } 496 }
498 497
499 } // namespace WebCore 498 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698