| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 return 0; | 136 return 0; |
| 137 | 137 |
| 138 return m_sourceData->at(index); | 138 return m_sourceData->at(index); |
| 139 } | 139 } |
| 140 | 140 |
| 141 namespace WebCore { | 141 namespace WebCore { |
| 142 | 142 |
| 143 static PassOwnPtr<CSSParser> createCSSParser(Document* document) | 143 static PassOwnPtr<CSSParser> createCSSParser(Document* document) |
| 144 { | 144 { |
| 145 UseCounter* counter = 0; | 145 UseCounter* counter = 0; |
| 146 return adoptPtr(new CSSParser(document ? CSSParserContext(document) : strict
CSSParserContext(), counter)); | 146 return adoptPtr(new CSSParser(document ? CSSParserContext(*document) : stric
tCSSParserContext(), counter)); |
| 147 } | 147 } |
| 148 | 148 |
| 149 namespace { | 149 namespace { |
| 150 | 150 |
| 151 class StyleSheetHandler : public CSSParser::SourceDataHandler { | 151 class StyleSheetHandler : public CSSParser::SourceDataHandler { |
| 152 public: | 152 public: |
| 153 StyleSheetHandler(const String& parsedText, Document* document, StyleSheetCo
ntents* styleSheetContents, RuleSourceDataList* result) | 153 StyleSheetHandler(const String& parsedText, Document* document, StyleSheetCo
ntents* styleSheetContents, RuleSourceDataList* result) |
| 154 : m_parsedText(parsedText) | 154 : m_parsedText(parsedText) |
| 155 , m_document(document) | 155 , m_document(document) |
| 156 , m_styleSheetContents(styleSheetContents) | 156 , m_styleSheetContents(styleSheetContents) |
| (...skipping 1658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1815 | 1815 |
| 1816 RefPtr<MutableStylePropertySet> tempDeclaration = MutableStylePropertySet::c
reate(); | 1816 RefPtr<MutableStylePropertySet> tempDeclaration = MutableStylePropertySet::c
reate(); |
| 1817 RuleSourceDataList ruleSourceDataResult; | 1817 RuleSourceDataList ruleSourceDataResult; |
| 1818 StyleSheetHandler handler(m_styleText, &m_element->document(), m_element->do
cument().elementSheet()->contents(), &ruleSourceDataResult); | 1818 StyleSheetHandler handler(m_styleText, &m_element->document(), m_element->do
cument().elementSheet()->contents(), &ruleSourceDataResult); |
| 1819 createCSSParser(&m_element->document())->parseDeclaration(tempDeclaration.ge
t(), m_styleText, &handler, m_element->document().elementSheet()->contents()); | 1819 createCSSParser(&m_element->document())->parseDeclaration(tempDeclaration.ge
t(), m_styleText, &handler, m_element->document().elementSheet()->contents()); |
| 1820 return ruleSourceDataResult.first().release(); | 1820 return ruleSourceDataResult.first().release(); |
| 1821 } | 1821 } |
| 1822 | 1822 |
| 1823 } // namespace WebCore | 1823 } // namespace WebCore |
| 1824 | 1824 |
| OLD | NEW |