OLD | NEW |
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 Loading... |
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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 info.addMember(m_originalURL, "originalURL"); | 520 info.addMember(m_originalURL, "originalURL"); |
523 info.addMember(m_encodingFromCharsetRule, "encodingFromCharsetRule"); | 521 info.addMember(m_encodingFromCharsetRule, "encodingFromCharsetRule"); |
524 info.addMember(m_importRules, "importRules"); | 522 info.addMember(m_importRules, "importRules"); |
525 info.addMember(m_childRules, "childRules"); | 523 info.addMember(m_childRules, "childRules"); |
526 info.addMember(m_namespaces, "namespaces"); | 524 info.addMember(m_namespaces, "namespaces"); |
527 info.addMember(m_parserContext, "parserContext"); | 525 info.addMember(m_parserContext, "parserContext"); |
528 info.addMember(m_clients, "clients"); | 526 info.addMember(m_clients, "clients"); |
529 } | 527 } |
530 | 528 |
531 } | 529 } |
OLD | NEW |