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

Side by Side Diff: Source/core/xml/XSLTProcessor.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/xml/XSLStyleSheetLibxslt.cpp ('k') | Source/core/xml/XSLTProcessorLibxslt.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 * This file is part of the XSL implementation. 2 * This file is part of the XSL implementation.
3 * 3 *
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple, Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple, Inc. All rights reserved.
5 * Copyright (C) 2005, 2006 Alexey Proskuryakov <ap@webkit.org> 5 * Copyright (C) 2005, 2006 Alexey Proskuryakov <ap@webkit.org>
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 XSLTProcessor::~XSLTProcessor() 54 XSLTProcessor::~XSLTProcessor()
55 { 55 {
56 // Stylesheet shouldn't outlive its root node. 56 // Stylesheet shouldn't outlive its root node.
57 ASSERT(!m_stylesheetRootNode || !m_stylesheet || m_stylesheet->hasOneRef()); 57 ASSERT(!m_stylesheetRootNode || !m_stylesheet || m_stylesheet->hasOneRef());
58 } 58 }
59 59
60 PassRefPtr<Document> XSLTProcessor::createDocumentFromSource(const String& sourc eString, 60 PassRefPtr<Document> XSLTProcessor::createDocumentFromSource(const String& sourc eString,
61 const String& sourceEncoding, const String& sourceMIMEType, Node* sourceNode , Frame* frame) 61 const String& sourceEncoding, const String& sourceMIMEType, Node* sourceNode , Frame* frame)
62 { 62 {
63 RefPtr<Document> ownerDocument = sourceNode->document(); 63 RefPtr<Document> ownerDocument = &sourceNode->document();
64 bool sourceIsDocument = (sourceNode == ownerDocument.get()); 64 bool sourceIsDocument = (sourceNode == ownerDocument.get());
65 String documentSource = sourceString; 65 String documentSource = sourceString;
66 66
67 RefPtr<Document> result; 67 RefPtr<Document> result;
68 if (sourceMIMEType == "text/plain") { 68 if (sourceMIMEType == "text/plain") {
69 result = Document::create(DocumentInit(sourceIsDocument ? ownerDocument- >url() : KURL(), frame)); 69 result = Document::create(DocumentInit(sourceIsDocument ? ownerDocument- >url() : KURL(), frame));
70 transformTextStringToXHTMLDocumentString(documentSource); 70 transformTextStringToXHTMLDocumentString(documentSource);
71 } else 71 } else
72 result = DOMImplementation::createDocument(sourceMIMEType, frame, source IsDocument ? ownerDocument->url() : KURL(), false); 72 result = DOMImplementation::createDocument(sourceMIMEType, frame, source IsDocument ? ownerDocument->url() : KURL(), false);
73 73
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 } 145 }
146 146
147 void XSLTProcessor::reset() 147 void XSLTProcessor::reset()
148 { 148 {
149 m_stylesheet.clear(); 149 m_stylesheet.clear();
150 m_stylesheetRootNode.clear(); 150 m_stylesheetRootNode.clear();
151 m_parameters.clear(); 151 m_parameters.clear();
152 } 152 }
153 153
154 } // namespace WebCore 154 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/xml/XSLStyleSheetLibxslt.cpp ('k') | Source/core/xml/XSLTProcessorLibxslt.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698