| 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 1740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1751 return !es.hadException(); | 1751 return !es.hadException(); |
| 1752 } | 1752 } |
| 1753 | 1753 |
| 1754 PassOwnPtr<Vector<unsigned> > InspectorStyleSheetForInlineStyle::lineEndings() c
onst | 1754 PassOwnPtr<Vector<unsigned> > InspectorStyleSheetForInlineStyle::lineEndings() c
onst |
| 1755 { | 1755 { |
| 1756 return WTF::lineEndings(elementStyleText()); | 1756 return WTF::lineEndings(elementStyleText()); |
| 1757 } | 1757 } |
| 1758 | 1758 |
| 1759 Document* InspectorStyleSheetForInlineStyle::ownerDocument() const | 1759 Document* InspectorStyleSheetForInlineStyle::ownerDocument() const |
| 1760 { | 1760 { |
| 1761 return m_element->document(); | 1761 return &m_element->document(); |
| 1762 } | 1762 } |
| 1763 | 1763 |
| 1764 bool InspectorStyleSheetForInlineStyle::ensureParsedDataReady() | 1764 bool InspectorStyleSheetForInlineStyle::ensureParsedDataReady() |
| 1765 { | 1765 { |
| 1766 // The "style" property value can get changed indirectly, e.g. via element.s
tyle.borderWidth = "2px". | 1766 // The "style" property value can get changed indirectly, e.g. via element.s
tyle.borderWidth = "2px". |
| 1767 const String& currentStyleText = elementStyleText(); | 1767 const String& currentStyleText = elementStyleText(); |
| 1768 if (m_styleText != currentStyleText) { | 1768 if (m_styleText != currentStyleText) { |
| 1769 m_ruleSourceData.clear(); | 1769 m_ruleSourceData.clear(); |
| 1770 m_styleText = currentStyleText; | 1770 m_styleText = currentStyleText; |
| 1771 m_isStyleTextValid = true; | 1771 m_isStyleTextValid = true; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1808 | 1808 |
| 1809 if (m_styleText.isEmpty()) { | 1809 if (m_styleText.isEmpty()) { |
| 1810 RefPtr<CSSRuleSourceData> result = CSSRuleSourceData::create(CSSRuleSour
ceData::STYLE_RULE); | 1810 RefPtr<CSSRuleSourceData> result = CSSRuleSourceData::create(CSSRuleSour
ceData::STYLE_RULE); |
| 1811 result->ruleBodyRange.start = 0; | 1811 result->ruleBodyRange.start = 0; |
| 1812 result->ruleBodyRange.end = 0; | 1812 result->ruleBodyRange.end = 0; |
| 1813 return result.release(); | 1813 return result.release(); |
| 1814 } | 1814 } |
| 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->doc
ument()->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.get
(), 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 |