| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2000 Peter Kelly (pmk@post.com) | 2 * Copyright (C) 2000 Peter Kelly (pmk@post.com) |
| 3 * Copyright (C) 2005, 2006, 2008, 2014 Apple Inc. All rights reserved. | 3 * Copyright (C) 2005, 2006, 2008, 2014 Apple Inc. All rights reserved. |
| 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 5 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) | 5 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) |
| 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 7 * Copyright (C) 2008 Holger Hans Peter Freyther | 7 * Copyright (C) 2008 Holger Hans Peter Freyther |
| 8 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 8 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 9 * | 9 * |
| 10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 * Boston, MA 02110-1301, USA. | 23 * Boston, MA 02110-1301, USA. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #include "config.h" | 26 #include "config.h" |
| 27 #include "core/xml/parser/XMLDocumentParser.h" | 27 #include "core/xml/parser/XMLDocumentParser.h" |
| 28 | 28 |
| 29 #include "bindings/core/v8/ExceptionState.h" | 29 #include "bindings/core/v8/ExceptionState.h" |
| 30 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | 30 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
| 31 #include "bindings/core/v8/ScriptController.h" | 31 #include "bindings/core/v8/ScriptController.h" |
| 32 #include "bindings/core/v8/ScriptSourceCode.h" | 32 #include "bindings/core/v8/ScriptSourceCode.h" |
| 33 #include "bindings/core/v8/V8XMLTreeViewer.h" |
| 33 #include "core/FetchInitiatorTypeNames.h" | 34 #include "core/FetchInitiatorTypeNames.h" |
| 34 #include "core/HTMLNames.h" | 35 #include "core/HTMLNames.h" |
| 35 #include "core/XMLNSNames.h" | 36 #include "core/XMLNSNames.h" |
| 36 #include "core/dom/CDATASection.h" | 37 #include "core/dom/CDATASection.h" |
| 37 #include "core/dom/Comment.h" | 38 #include "core/dom/Comment.h" |
| 38 #include "core/dom/Document.h" | 39 #include "core/dom/Document.h" |
| 39 #include "core/dom/DocumentFragment.h" | 40 #include "core/dom/DocumentFragment.h" |
| 40 #include "core/dom/DocumentType.h" | 41 #include "core/dom/DocumentType.h" |
| 41 #include "core/dom/ProcessingInstruction.h" | 42 #include "core/dom/ProcessingInstruction.h" |
| 42 #include "core/dom/ScriptLoader.h" | 43 #include "core/dom/ScriptLoader.h" |
| (...skipping 1420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1463 XMLDocumentParserScope scope(document()->fetcher()); | 1464 XMLDocumentParserScope scope(document()->fetcher()); |
| 1464 finishParsing(context()); | 1465 finishParsing(context()); |
| 1465 } | 1466 } |
| 1466 | 1467 |
| 1467 m_context = nullptr; | 1468 m_context = nullptr; |
| 1468 } | 1469 } |
| 1469 } | 1470 } |
| 1470 | 1471 |
| 1471 bool xmlViewerMode = !m_sawError && !m_sawCSS && !m_sawXSLTransform && hasNo
StyleInformation(document()); | 1472 bool xmlViewerMode = !m_sawError && !m_sawCSS && !m_sawXSLTransform && hasNo
StyleInformation(document()); |
| 1472 if (xmlViewerMode) { | 1473 if (xmlViewerMode) { |
| 1473 XMLTreeViewer xmlTreeViewer(document()); | 1474 XMLTreeViewer xmlTreeViewer; |
| 1474 xmlTreeViewer.transformDocumentToTreeView(); | 1475 document()->setIsViewSource(true); |
| 1476 V8XMLTreeViewer::PrivateScript::transformDocumentToTreeViewMethod(docume
nt()->frame(), &xmlTreeViewer); |
| 1475 } else if (m_sawXSLTransform) { | 1477 } else if (m_sawXSLTransform) { |
| 1476 xmlDocPtr doc = xmlDocPtrForString(document()->fetcher(), m_originalSour
ceForTransform.toString(), document()->url().string()); | 1478 xmlDocPtr doc = xmlDocPtrForString(document()->fetcher(), m_originalSour
ceForTransform.toString(), document()->url().string()); |
| 1477 document()->setTransformSource(adoptPtr(new TransformSource(doc))); | 1479 document()->setTransformSource(adoptPtr(new TransformSource(doc))); |
| 1478 // Make the document think it's done, so it will apply XSL stylesheets. | 1480 // Make the document think it's done, so it will apply XSL stylesheets. |
| 1479 document()->setParsing(false); | 1481 document()->setParsing(false); |
| 1480 document()->styleResolverChanged(); | 1482 document()->styleResolverChanged(); |
| 1481 | 1483 |
| 1482 // styleResolverChanged() call can detach the parser and null out its | 1484 // styleResolverChanged() call can detach the parser and null out its |
| 1483 // document. In that case, we just bail out. | 1485 // document. In that case, we just bail out. |
| 1484 if (isDetached()) | 1486 if (isDetached()) |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1634 sax.initialized = XML_SAX2_MAGIC; | 1636 sax.initialized = XML_SAX2_MAGIC; |
| 1635 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); | 1637 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); |
| 1636 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; | 1638 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; |
| 1637 parseChunk(parser->context(), parseString); | 1639 parseChunk(parser->context(), parseString); |
| 1638 finishParsing(parser->context()); | 1640 finishParsing(parser->context()); |
| 1639 attrsOK = state.gotAttributes; | 1641 attrsOK = state.gotAttributes; |
| 1640 return state.attributes; | 1642 return state.attributes; |
| 1641 } | 1643 } |
| 1642 | 1644 |
| 1643 } // namespace blink | 1645 } // namespace blink |
| OLD | NEW |