| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1120 if (rule->type() != CSSRule::MEDIA_RULE) { | 1120 if (rule->type() != CSSRule::MEDIA_RULE) { |
| 1121 exceptionState.throwDOMException(NotFoundError, "Cannot insert rule in n
on-media rule."); | 1121 exceptionState.throwDOMException(NotFoundError, "Cannot insert rule in n
on-media rule."); |
| 1122 return 0; | 1122 return 0; |
| 1123 } | 1123 } |
| 1124 return insertCSSOMRuleInMediaRule(toCSSMediaRule(rule.get()), sourceRange, r
uleText, exceptionState); | 1124 return insertCSSOMRuleInMediaRule(toCSSMediaRule(rule.get()), sourceRange, r
uleText, exceptionState); |
| 1125 } | 1125 } |
| 1126 | 1126 |
| 1127 bool InspectorStyleSheet::verifyRuleText(const String& ruleText) | 1127 bool InspectorStyleSheet::verifyRuleText(const String& ruleText) |
| 1128 { | 1128 { |
| 1129 DEFINE_STATIC_LOCAL(String, bogusPropertyName, ("-webkit-boguz-propertee")); | 1129 DEFINE_STATIC_LOCAL(String, bogusPropertyName, ("-webkit-boguz-propertee")); |
| 1130 RefPtrWillBeRawPtr<MutableStylePropertySet> tempMutableStyle = MutableStyleP
ropertySet::create(); | |
| 1131 RuleSourceDataList sourceData; | 1130 RuleSourceDataList sourceData; |
| 1132 RefPtrWillBeRawPtr<StyleSheetContents> styleSheetContents = StyleSheetConten
ts::create(strictCSSParserContext()); | 1131 RefPtrWillBeRawPtr<StyleSheetContents> styleSheetContents = StyleSheetConten
ts::create(strictCSSParserContext()); |
| 1133 String text = ruleText + " div { " + bogusPropertyName + ": none; }"; | 1132 String text = ruleText + " div { " + bogusPropertyName + ": none; }"; |
| 1134 StyleSheetHandler handler(text, ownerDocument(), styleSheetContents.get(), &
sourceData); | 1133 StyleSheetHandler handler(text, ownerDocument(), styleSheetContents.get(), &
sourceData); |
| 1135 BisonCSSParser(parserContextForDocument(ownerDocument())).parseSheet(styleSh
eetContents.get(), text, TextPosition::minimumPosition(), &handler); | 1134 BisonCSSParser(parserContextForDocument(ownerDocument())).parseSheet(styleSh
eetContents.get(), text, TextPosition::minimumPosition(), &handler); |
| 1136 unsigned ruleCount = sourceData.size(); | 1135 unsigned ruleCount = sourceData.size(); |
| 1137 | 1136 |
| 1138 // Exactly two rules should be parsed. | 1137 // Exactly two rules should be parsed. |
| 1139 if (ruleCount != 2) | 1138 if (ruleCount != 2) |
| 1140 return false; | 1139 return false; |
| (...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1817 void InspectorStyleSheetForInlineStyle::trace(Visitor* visitor) | 1816 void InspectorStyleSheetForInlineStyle::trace(Visitor* visitor) |
| 1818 { | 1817 { |
| 1819 visitor->trace(m_element); | 1818 visitor->trace(m_element); |
| 1820 visitor->trace(m_ruleSourceData); | 1819 visitor->trace(m_ruleSourceData); |
| 1821 visitor->trace(m_inspectorStyle); | 1820 visitor->trace(m_inspectorStyle); |
| 1822 InspectorStyleSheetBase::trace(visitor); | 1821 InspectorStyleSheetBase::trace(visitor); |
| 1823 } | 1822 } |
| 1824 | 1823 |
| 1825 } // namespace blink | 1824 } // namespace blink |
| 1826 | 1825 |
| OLD | NEW |