| 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 1599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1610 String patchedStyleSheetText; | 1610 String patchedStyleSheetText; |
| 1611 bool success = styleSheetTextWithChangedStyle(style, text, &patchedStyleShee
tText); | 1611 bool success = styleSheetTextWithChangedStyle(style, text, &patchedStyleShee
tText); |
| 1612 if (!success) | 1612 if (!success) |
| 1613 return false; | 1613 return false; |
| 1614 | 1614 |
| 1615 InspectorCSSId id = ruleOrStyleId(style); | 1615 InspectorCSSId id = ruleOrStyleId(style); |
| 1616 if (id.isEmpty()) | 1616 if (id.isEmpty()) |
| 1617 return false; | 1617 return false; |
| 1618 | 1618 |
| 1619 TrackExceptionState es; | 1619 TrackExceptionState es; |
| 1620 style->setCssText(text, es); | 1620 style->setCSSText(text, es); |
| 1621 if (!es.hadException()) | 1621 if (!es.hadException()) |
| 1622 m_parsedStyleSheet->setText(patchedStyleSheetText); | 1622 m_parsedStyleSheet->setText(patchedStyleSheetText); |
| 1623 | 1623 |
| 1624 return !es.hadException(); | 1624 return !es.hadException(); |
| 1625 } | 1625 } |
| 1626 | 1626 |
| 1627 bool InspectorStyleSheet::styleSheetTextWithChangedStyle(CSSStyleDeclaration* st
yle, const String& newStyleText, String* result) | 1627 bool InspectorStyleSheet::styleSheetTextWithChangedStyle(CSSStyleDeclaration* st
yle, const String& newStyleText, String* result) |
| 1628 { | 1628 { |
| 1629 if (!style) | 1629 if (!style) |
| 1630 return false; | 1630 return false; |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1819 | 1819 |
| 1820 RefPtr<MutableStylePropertySet> tempDeclaration = MutableStylePropertySet::c
reate(); | 1820 RefPtr<MutableStylePropertySet> tempDeclaration = MutableStylePropertySet::c
reate(); |
| 1821 RuleSourceDataList ruleSourceDataResult; | 1821 RuleSourceDataList ruleSourceDataResult; |
| 1822 StyleSheetHandler handler(m_styleText, &m_element->document(), m_element->do
cument().elementSheet()->contents(), &ruleSourceDataResult); | 1822 StyleSheetHandler handler(m_styleText, &m_element->document(), m_element->do
cument().elementSheet()->contents(), &ruleSourceDataResult); |
| 1823 createCSSParser(&m_element->document())->parseDeclaration(tempDeclaration.ge
t(), m_styleText, &handler, m_element->document().elementSheet()->contents()); | 1823 createCSSParser(&m_element->document())->parseDeclaration(tempDeclaration.ge
t(), m_styleText, &handler, m_element->document().elementSheet()->contents()); |
| 1824 return ruleSourceDataResult.first().release(); | 1824 return ruleSourceDataResult.first().release(); |
| 1825 } | 1825 } |
| 1826 | 1826 |
| 1827 } // namespace WebCore | 1827 } // namespace WebCore |
| 1828 | 1828 |
| OLD | NEW |