| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "core/xml/DocumentXSLT.h" | 6 #include "core/xml/DocumentXSLT.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/DOMWrapperWorld.h" | 8 #include "bindings/core/v8/DOMWrapperWorld.h" |
| 9 #include "bindings/core/v8/ScriptState.h" | 9 #include "bindings/core/v8/ScriptState.h" |
| 10 #include "bindings/core/v8/V8AbstractEventListener.h" | 10 #include "bindings/core/v8/V8AbstractEventListener.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 95 |
| 96 DocumentXSLT::DocumentXSLT() | 96 DocumentXSLT::DocumentXSLT() |
| 97 : m_transformSourceDocument(nullptr) | 97 : m_transformSourceDocument(nullptr) |
| 98 { | 98 { |
| 99 } | 99 } |
| 100 | 100 |
| 101 void DocumentXSLT::applyXSLTransform(Document& document, ProcessingInstruction*
pi) | 101 void DocumentXSLT::applyXSLTransform(Document& document, ProcessingInstruction*
pi) |
| 102 { | 102 { |
| 103 ASSERT(!pi->isLoading()); | 103 ASSERT(!pi->isLoading()); |
| 104 UseCounter::count(document, UseCounter::XSLProcessingInstruction); | 104 UseCounter::count(document, UseCounter::XSLProcessingInstruction); |
| 105 RefPtrWillBeRawPtr<XSLTProcessor> processor = XSLTProcessor::create(document
); | 105 XSLTProcessor* processor = XSLTProcessor::create(document); |
| 106 processor->setXSLStyleSheet(toXSLStyleSheet(pi->sheet())); | 106 processor->setXSLStyleSheet(toXSLStyleSheet(pi->sheet())); |
| 107 String resultMIMEType; | 107 String resultMIMEType; |
| 108 String newSource; | 108 String newSource; |
| 109 String resultEncoding; | 109 String resultEncoding; |
| 110 document.setParsingState(Document::Parsing); | 110 document.setParsingState(Document::Parsing); |
| 111 if (!processor->transformToString(&document, resultMIMEType, newSource, resu
ltEncoding)) { | 111 if (!processor->transformToString(&document, resultMIMEType, newSource, resu
ltEncoding)) { |
| 112 document.setParsingState(Document::FinishedParsing); | 112 document.setParsingState(Document::FinishedParsing); |
| 113 return; | 113 return; |
| 114 } | 114 } |
| 115 // FIXME: If the transform failed we should probably report an error (like M
ozilla does). | 115 // FIXME: If the transform failed we should probably report an error (like M
ozilla does). |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 return *supplement; | 196 return *supplement; |
| 197 } | 197 } |
| 198 | 198 |
| 199 DEFINE_TRACE(DocumentXSLT) | 199 DEFINE_TRACE(DocumentXSLT) |
| 200 { | 200 { |
| 201 visitor->trace(m_transformSourceDocument); | 201 visitor->trace(m_transformSourceDocument); |
| 202 WillBeHeapSupplement<Document>::trace(visitor); | 202 WillBeHeapSupplement<Document>::trace(visitor); |
| 203 } | 203 } |
| 204 | 204 |
| 205 } // namespace blink | 205 } // namespace blink |
| OLD | NEW |