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

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

Issue 14408004: Fix incorrect evaluation of resolution media queries (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 7 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
OLDNEW
1 /* 1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2006, 2007, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2006, 2007, 2012 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 ASSERT(!rule->isCharsetRule()); 130 ASSERT(!rule->isCharsetRule());
131 if (rule->isImportRule()) { 131 if (rule->isImportRule()) {
132 // Parser enforces that @import rules come before anything else except @ charset. 132 // Parser enforces that @import rules come before anything else except @ charset.
133 ASSERT(m_childRules.isEmpty()); 133 ASSERT(m_childRules.isEmpty());
134 m_importRules.append(static_cast<StyleRuleImport*>(rule.get())); 134 m_importRules.append(static_cast<StyleRuleImport*>(rule.get()));
135 m_importRules.last()->setParentStyleSheet(this); 135 m_importRules.last()->setParentStyleSheet(this);
136 m_importRules.last()->requestStyleSheet(); 136 m_importRules.last()->requestStyleSheet();
137 return; 137 return;
138 } 138 }
139 139
140 #if ENABLE(RESOLUTION_MEDIA_QUERY)
141 // Add warning message to inspector if dpi/dpcm values are used for screen m edia. 140 // Add warning message to inspector if dpi/dpcm values are used for screen m edia.
142 if (rule->isMediaRule()) 141 if (rule->isMediaRule())
143 reportMediaQueryWarningIfNeeded(singleOwnerDocument(), static_cast<Style RuleMedia*>(rule.get())->mediaQueries()); 142 reportMediaQueryWarningIfNeeded(singleOwnerDocument(), static_cast<Style RuleMedia*>(rule.get())->mediaQueries());
144 #endif
145 143
146 m_childRules.append(rule); 144 m_childRules.append(rule);
147 } 145 }
148 146
149 StyleRuleBase* StyleSheetContents::ruleAt(unsigned index) const 147 StyleRuleBase* StyleSheetContents::ruleAt(unsigned index) const
150 { 148 {
151 ASSERT_WITH_SECURITY_IMPLICATION(index < ruleCount()); 149 ASSERT_WITH_SECURITY_IMPLICATION(index < ruleCount());
152 150
153 unsigned childVectorIndex = index; 151 unsigned childVectorIndex = index;
154 if (hasCharsetRule()) { 152 if (hasCharsetRule()) {
155 if (index == 0) 153 if (index == 0)
156 return 0; 154 return 0;
157 --childVectorIndex; 155 --childVectorIndex;
158 } 156 }
159 if (childVectorIndex < m_importRules.size()) 157 if (childVectorIndex < m_importRules.size())
160 return m_importRules[childVectorIndex].get(); 158 return m_importRules[childVectorIndex].get();
161 159
162 childVectorIndex -= m_importRules.size(); 160 childVectorIndex -= m_importRules.size();
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 info.addMember(m_originalURL, "originalURL"); 512 info.addMember(m_originalURL, "originalURL");
515 info.addMember(m_encodingFromCharsetRule, "encodingFromCharsetRule"); 513 info.addMember(m_encodingFromCharsetRule, "encodingFromCharsetRule");
516 info.addMember(m_importRules, "importRules"); 514 info.addMember(m_importRules, "importRules");
517 info.addMember(m_childRules, "childRules"); 515 info.addMember(m_childRules, "childRules");
518 info.addMember(m_namespaces, "namespaces"); 516 info.addMember(m_namespaces, "namespaces");
519 info.addMember(m_parserContext, "parserContext"); 517 info.addMember(m_parserContext, "parserContext");
520 info.addMember(m_clients, "clients"); 518 info.addMember(m_clients, "clients");
521 } 519 }
522 520
523 } 521 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698