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