| 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. | 8 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. |
| 9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
| 10 * | 10 * |
| 11 * This library is free software; you can redistribute it and/or | 11 * This library is free software; you can redistribute it and/or |
| 12 * modify it under the terms of the GNU Library General Public | 12 * modify it under the terms of the GNU Library General Public |
| 13 * License as published by the Free Software Foundation; either | 13 * License as published by the Free Software Foundation; either |
| 14 * version 2 of the License, or (at your option) any later version. | 14 * version 2 of the License, or (at your option) any later version. |
| 15 * | 15 * |
| 16 * This library is distributed in the hope that it will be useful, | 16 * This library is distributed in the hope that it will be useful, |
| 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 19 * Library General Public License for more details. | 19 * Library General Public License for more details. |
| 20 * | 20 * |
| 21 * You should have received a copy of the GNU Library General Public License | 21 * You should have received a copy of the GNU Library General Public License |
| 22 * along with this library; see the file COPYING.LIB. If not, write to | 22 * along with this library; see the file COPYING.LIB. If not, write to |
| 23 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 23 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 24 * Boston, MA 02110-1301, USA. | 24 * Boston, MA 02110-1301, USA. |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #include "core/xml/parser/XMLDocumentParser.h" | 27 #include "core/xml/parser/XMLDocumentParser.h" |
| 28 | 28 |
| 29 #include <libxml/catalog.h> |
| 30 #include <libxml/parser.h> |
| 31 #include <libxml/parserInternals.h> |
| 32 #include <libxslt/xslt.h> |
| 33 #include <memory> |
| 29 #include "bindings/core/v8/ExceptionState.h" | 34 #include "bindings/core/v8/ExceptionState.h" |
| 30 #include "bindings/core/v8/ScriptController.h" | 35 #include "bindings/core/v8/ScriptController.h" |
| 31 #include "bindings/core/v8/ScriptSourceCode.h" | 36 #include "bindings/core/v8/ScriptSourceCode.h" |
| 32 #include "core/HTMLNames.h" | 37 #include "core/HTMLNames.h" |
| 33 #include "core/XMLNSNames.h" | 38 #include "core/XMLNSNames.h" |
| 34 #include "core/dom/CDATASection.h" | 39 #include "core/dom/CDATASection.h" |
| 35 #include "core/dom/Comment.h" | 40 #include "core/dom/Comment.h" |
| 36 #include "core/dom/Document.h" | 41 #include "core/dom/Document.h" |
| 37 #include "core/dom/DocumentFragment.h" | 42 #include "core/dom/DocumentFragment.h" |
| 38 #include "core/dom/DocumentParserTiming.h" | 43 #include "core/dom/DocumentParserTiming.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 54 #include "core/xml/DocumentXMLTreeViewer.h" | 59 #include "core/xml/DocumentXMLTreeViewer.h" |
| 55 #include "core/xml/DocumentXSLT.h" | 60 #include "core/xml/DocumentXSLT.h" |
| 56 #include "core/xml/parser/SharedBufferReader.h" | 61 #include "core/xml/parser/SharedBufferReader.h" |
| 57 #include "core/xml/parser/XMLDocumentParserScope.h" | 62 #include "core/xml/parser/XMLDocumentParserScope.h" |
| 58 #include "core/xml/parser/XMLParserInput.h" | 63 #include "core/xml/parser/XMLParserInput.h" |
| 59 #include "platform/RuntimeEnabledFeatures.h" | 64 #include "platform/RuntimeEnabledFeatures.h" |
| 60 #include "platform/SharedBuffer.h" | 65 #include "platform/SharedBuffer.h" |
| 61 #include "platform/instrumentation/tracing/TraceEvent.h" | 66 #include "platform/instrumentation/tracing/TraceEvent.h" |
| 62 #include "platform/loader/fetch/FetchInitiatorTypeNames.h" | 67 #include "platform/loader/fetch/FetchInitiatorTypeNames.h" |
| 63 #include "platform/loader/fetch/RawResource.h" | 68 #include "platform/loader/fetch/RawResource.h" |
| 69 #include "platform/loader/fetch/ResourceError.h" |
| 64 #include "platform/loader/fetch/ResourceFetcher.h" | 70 #include "platform/loader/fetch/ResourceFetcher.h" |
| 65 #include "platform/network/ResourceError.h" | 71 #include "platform/loader/fetch/ResourceRequest.h" |
| 66 #include "platform/network/ResourceRequest.h" | 72 #include "platform/loader/fetch/ResourceResponse.h" |
| 67 #include "platform/network/ResourceResponse.h" | |
| 68 #include "platform/weborigin/SecurityOrigin.h" | 73 #include "platform/weborigin/SecurityOrigin.h" |
| 69 #include "wtf/AutoReset.h" | 74 #include "wtf/AutoReset.h" |
| 70 #include "wtf/PtrUtil.h" | 75 #include "wtf/PtrUtil.h" |
| 71 #include "wtf/StringExtras.h" | 76 #include "wtf/StringExtras.h" |
| 72 #include "wtf/Threading.h" | 77 #include "wtf/Threading.h" |
| 73 #include "wtf/Vector.h" | 78 #include "wtf/Vector.h" |
| 74 #include "wtf/text/UTF8.h" | 79 #include "wtf/text/UTF8.h" |
| 75 #include <libxml/catalog.h> | |
| 76 #include <libxml/parser.h> | |
| 77 #include <libxml/parserInternals.h> | |
| 78 #include <libxslt/xslt.h> | |
| 79 #include <memory> | |
| 80 | 80 |
| 81 namespace blink { | 81 namespace blink { |
| 82 | 82 |
| 83 using namespace HTMLNames; | 83 using namespace HTMLNames; |
| 84 | 84 |
| 85 // FIXME: HTMLConstructionSite has a limit of 512, should these match? | 85 // FIXME: HTMLConstructionSite has a limit of 512, should these match? |
| 86 static const unsigned maxXMLTreeDepth = 5000; | 86 static const unsigned maxXMLTreeDepth = 5000; |
| 87 | 87 |
| 88 static inline String toString(const xmlChar* string, size_t length) { | 88 static inline String toString(const xmlChar* string, size_t length) { |
| 89 return String::fromUTF8(reinterpret_cast<const char*>(string), length); | 89 return String::fromUTF8(reinterpret_cast<const char*>(string), length); |
| (...skipping 1621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1711 RefPtr<XMLParserContext> parser = | 1711 RefPtr<XMLParserContext> parser = |
| 1712 XMLParserContext::createStringParser(&sax, &state); | 1712 XMLParserContext::createStringParser(&sax, &state); |
| 1713 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; | 1713 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; |
| 1714 parseChunk(parser->context(), parseString); | 1714 parseChunk(parser->context(), parseString); |
| 1715 finishParsing(parser->context()); | 1715 finishParsing(parser->context()); |
| 1716 attrsOK = state.gotAttributes; | 1716 attrsOK = state.gotAttributes; |
| 1717 return state.attributes; | 1717 return state.attributes; |
| 1718 } | 1718 } |
| 1719 | 1719 |
| 1720 } // namespace blink | 1720 } // namespace blink |
| OLD | NEW |