Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(350)

Side by Side Diff: Source/core/inspector/InspectorStyleSheet.cpp

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/inspector/InspectorOverlay.cpp ('k') | Source/core/loader/DocumentLoader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorOverlay.cpp ('k') | Source/core/loader/DocumentLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698