| 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 1677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1688 bool InspectorStyleSheet::inlineStyleSheetText(String* result) const | 1688 bool InspectorStyleSheet::inlineStyleSheetText(String* result) const |
| 1689 { | 1689 { |
| 1690 if (!m_pageStyleSheet) | 1690 if (!m_pageStyleSheet) |
| 1691 return false; | 1691 return false; |
| 1692 | 1692 |
| 1693 Node* ownerNode = m_pageStyleSheet->ownerNode(); | 1693 Node* ownerNode = m_pageStyleSheet->ownerNode(); |
| 1694 if (!ownerNode || ownerNode->nodeType() != Node::ELEMENT_NODE) | 1694 if (!ownerNode || ownerNode->nodeType() != Node::ELEMENT_NODE) |
| 1695 return false; | 1695 return false; |
| 1696 Element* ownerElement = toElement(ownerNode); | 1696 Element* ownerElement = toElement(ownerNode); |
| 1697 | 1697 |
| 1698 if (!ownerElement->hasTagName(HTMLNames::styleTag) && !ownerElement->hasTagN
ame(SVGNames::styleTag)) | 1698 // FIXME: Handle @viewport rules. |
| 1699 if (!ownerElement->hasTagName(HTMLNames::styleTag) && !ownerElement->hasTagN
ame(SVGNames::styleTag) && !ownerElement->hasTagName(HTMLNames::metaTag)) |
| 1699 return false; | 1700 return false; |
| 1700 *result = ownerElement->textContent(); | 1701 *result = ownerElement->textContent(); |
| 1701 return true; | 1702 return true; |
| 1702 } | 1703 } |
| 1703 | 1704 |
| 1704 PassRefPtr<InspectorStyleSheetForInlineStyle> InspectorStyleSheetForInlineStyle:
:create(InspectorPageAgent* pageAgent, const String& id, PassRefPtr<Element> ele
ment, TypeBuilder::CSS::StyleSheetOrigin::Enum origin, Listener* listener) | 1705 PassRefPtr<InspectorStyleSheetForInlineStyle> InspectorStyleSheetForInlineStyle:
:create(InspectorPageAgent* pageAgent, const String& id, PassRefPtr<Element> ele
ment, TypeBuilder::CSS::StyleSheetOrigin::Enum origin, Listener* listener) |
| 1705 { | 1706 { |
| 1706 return adoptRef(new InspectorStyleSheetForInlineStyle(pageAgent, id, element
, origin, listener)); | 1707 return adoptRef(new InspectorStyleSheetForInlineStyle(pageAgent, id, element
, origin, listener)); |
| 1707 } | 1708 } |
| 1708 | 1709 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1815 | 1816 |
| 1816 RefPtr<MutableStylePropertySet> tempDeclaration = MutableStylePropertySet::c
reate(); | 1817 RefPtr<MutableStylePropertySet> tempDeclaration = MutableStylePropertySet::c
reate(); |
| 1817 RuleSourceDataList ruleSourceDataResult; | 1818 RuleSourceDataList ruleSourceDataResult; |
| 1818 StyleSheetHandler handler(m_styleText, m_element->document(), m_element->doc
ument()->elementSheet()->contents(), &ruleSourceDataResult); | 1819 StyleSheetHandler handler(m_styleText, m_element->document(), m_element->doc
ument()->elementSheet()->contents(), &ruleSourceDataResult); |
| 1819 createCSSParser(m_element->document())->parseDeclaration(tempDeclaration.get
(), m_styleText, &handler, m_element->document()->elementSheet()->contents()); | 1820 createCSSParser(m_element->document())->parseDeclaration(tempDeclaration.get
(), m_styleText, &handler, m_element->document()->elementSheet()->contents()); |
| 1820 return ruleSourceDataResult.first().release(); | 1821 return ruleSourceDataResult.first().release(); |
| 1821 } | 1822 } |
| 1822 | 1823 |
| 1823 } // namespace WebCore | 1824 } // namespace WebCore |
| 1824 | 1825 |
| OLD | NEW |