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

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, 4 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 { 74 {
75 } 75 }
76 76
77 void DocumentRuleSets::initUserStyle(DocumentStyleSheetCollection* styleSheetCol lection, const MediaQueryEvaluator& medium, StyleResolver& resolver) 77 void DocumentRuleSets::initUserStyle(DocumentStyleSheetCollection* styleSheetCol lection, const MediaQueryEvaluator& medium, StyleResolver& resolver)
78 { 78 {
79 OwnPtr<RuleSet> tempUserStyle = RuleSet::create(); 79 OwnPtr<RuleSet> tempUserStyle = RuleSet::create();
80 if (CSSStyleSheet* pageUserSheet = styleSheetCollection->pageUserSheet()) 80 if (CSSStyleSheet* pageUserSheet = styleSheetCollection->pageUserSheet())
81 tempUserStyle->addRulesFromSheet(pageUserSheet->contents(), medium, &res olver); 81 tempUserStyle->addRulesFromSheet(pageUserSheet->contents(), medium, &res olver);
82 collectRulesFromUserStyleSheets(styleSheetCollection->injectedUserStyleSheet s(), *tempUserStyle, medium, resolver); 82 collectRulesFromUserStyleSheets(styleSheetCollection->injectedUserStyleSheet s(), *tempUserStyle, medium, resolver);
83 collectRulesFromUserStyleSheets(styleSheetCollection->documentUserStyleSheet s(), *tempUserStyle, medium, resolver); 83 collectRulesFromUserStyleSheets(styleSheetCollection->documentUserStyleSheet s(), *tempUserStyle, medium, resolver);
84 if (tempUserStyle->ruleCount() > 0 || tempUserStyle->pageRules().size() > 0) 84 if (tempUserStyle->ruleCount() > 0 || tempUserStyle->pageRules().size() > 0 || tempUserStyle->viewportRules().size() > 0)
85 m_userStyle = tempUserStyle.release(); 85 m_userStyle = tempUserStyle.release();
86 } 86 }
87 87
88 void DocumentRuleSets::collectRulesFromUserStyleSheets(const Vector<RefPtr<CSSSt yleSheet> >& userSheets, RuleSet& userStyle, const MediaQueryEvaluator& medium, StyleResolver& resolver) 88 void DocumentRuleSets::collectRulesFromUserStyleSheets(const Vector<RefPtr<CSSSt yleSheet> >& userSheets, RuleSet& userStyle, const MediaQueryEvaluator& medium, StyleResolver& resolver)
89 { 89 {
90 for (unsigned i = 0; i < userSheets.size(); ++i) { 90 for (unsigned i = 0; i < userSheets.size(); ++i) {
91 ASSERT(userSheets[i]->contents()->isUserStyleSheet()); 91 ASSERT(userSheets[i]->contents()->isUserStyleSheet());
92 userStyle.addRulesFromSheet(userSheets[i]->contents(), medium, &resolver ); 92 userStyle.addRulesFromSheet(userSheets[i]->contents(), medium, &resolver );
93 } 93 }
94 } 94 }
(...skipping 14 matching lines...) Expand all
109 if (isViewSource) 109 if (isViewSource)
110 features.add(CSSDefaultStyleSheets::viewSourceStyle()->features()); 110 features.add(CSSDefaultStyleSheets::viewSourceStyle()->features());
111 111
112 if (m_userStyle) 112 if (m_userStyle)
113 features.add(m_userStyle->features()); 113 features.add(m_userStyle->features());
114 114
115 m_shadowDistributedRules.collectFeaturesTo(features); 115 m_shadowDistributedRules.collectFeaturesTo(features);
116 } 116 }
117 117
118 } // namespace WebCore 118 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698