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

Side by Side Diff: Source/core/css/DocumentRuleSets.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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 { 81 {
82 } 82 }
83 83
84 void DocumentRuleSets::initUserStyle(DocumentStyleSheetCollection* styleSheetCol lection, const MediaQueryEvaluator& medium, StyleResolver& resolver) 84 void DocumentRuleSets::initUserStyle(DocumentStyleSheetCollection* styleSheetCol lection, const MediaQueryEvaluator& medium, StyleResolver& resolver)
85 { 85 {
86 OwnPtr<RuleSet> tempUserStyle = RuleSet::create(); 86 OwnPtr<RuleSet> tempUserStyle = RuleSet::create();
87 if (CSSStyleSheet* pageUserSheet = styleSheetCollection->pageUserSheet()) 87 if (CSSStyleSheet* pageUserSheet = styleSheetCollection->pageUserSheet())
88 tempUserStyle->addRulesFromSheet(pageUserSheet->contents(), medium, &res olver); 88 tempUserStyle->addRulesFromSheet(pageUserSheet->contents(), medium, &res olver);
89 collectRulesFromUserStyleSheets(styleSheetCollection->injectedUserStyleSheet s(), *tempUserStyle, medium, resolver); 89 collectRulesFromUserStyleSheets(styleSheetCollection->injectedUserStyleSheet s(), *tempUserStyle, medium, resolver);
90 collectRulesFromUserStyleSheets(styleSheetCollection->documentUserStyleSheet s(), *tempUserStyle, medium, resolver); 90 collectRulesFromUserStyleSheets(styleSheetCollection->documentUserStyleSheet s(), *tempUserStyle, medium, resolver);
91 if (tempUserStyle->ruleCount() > 0 || tempUserStyle->pageRules().size() > 0) 91 if (tempUserStyle->ruleCount() > 0 || tempUserStyle->pageRules().size() > 0 || tempUserStyle->viewportRules().size() > 0)
92 m_userStyle = tempUserStyle.release(); 92 m_userStyle = tempUserStyle.release();
93 } 93 }
94 94
95 void DocumentRuleSets::collectRulesFromUserStyleSheets(const Vector<RefPtr<CSSSt yleSheet> >& userSheets, RuleSet& userStyle, const MediaQueryEvaluator& medium, StyleResolver& resolver) 95 void DocumentRuleSets::collectRulesFromUserStyleSheets(const Vector<RefPtr<CSSSt yleSheet> >& userSheets, RuleSet& userStyle, const MediaQueryEvaluator& medium, StyleResolver& resolver)
96 { 96 {
97 for (unsigned i = 0; i < userSheets.size(); ++i) { 97 for (unsigned i = 0; i < userSheets.size(); ++i) {
98 ASSERT(userSheets[i]->contents()->isUserStyleSheet()); 98 ASSERT(userSheets[i]->contents()->isUserStyleSheet());
99 userStyle.addRulesFromSheet(userSheets[i]->contents(), medium, &resolver ); 99 userStyle.addRulesFromSheet(userSheets[i]->contents(), medium, &resolver );
100 } 100 }
101 } 101 }
(...skipping 21 matching lines...) Expand all
123 } 123 }
124 124
125 void DocumentRuleSets::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) con st 125 void DocumentRuleSets::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) con st
126 { 126 {
127 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); 127 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS);
128 info.addMember(m_userStyle, "userStyle"); 128 info.addMember(m_userStyle, "userStyle");
129 info.addMember(m_shadowDistributedRules, "shadowDistributedRules"); 129 info.addMember(m_shadowDistributedRules, "shadowDistributedRules");
130 } 130 }
131 131
132 } // namespace WebCore 132 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698