| 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 Apple Inc. All rights reserved. | 3 * Copyright (C) 2005, 2006, 2008 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 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 return adoptRef(new XMLParserContext(parser)); | 732 return adoptRef(new XMLParserContext(parser)); |
| 733 } | 733 } |
| 734 | 734 |
| 735 // -------------------------------- | 735 // -------------------------------- |
| 736 | 736 |
| 737 bool XMLDocumentParser::supportsXMLVersion(const String& version) | 737 bool XMLDocumentParser::supportsXMLVersion(const String& version) |
| 738 { | 738 { |
| 739 return version == "1.0"; | 739 return version == "1.0"; |
| 740 } | 740 } |
| 741 | 741 |
| 742 XMLDocumentParser::XMLDocumentParser(Document* document, FrameView* frameView) | 742 XMLDocumentParser::XMLDocumentParser(Document& document, FrameView* frameView) |
| 743 : ScriptableDocumentParser(document) | 743 : ScriptableDocumentParser(document) |
| 744 , m_view(frameView) | 744 , m_view(frameView) |
| 745 , m_context(nullptr) | 745 , m_context(nullptr) |
| 746 , m_currentNode(document) | 746 , m_currentNode(&document) |
| 747 , m_isCurrentlyParsing8BitChunk(false) | 747 , m_isCurrentlyParsing8BitChunk(false) |
| 748 , m_sawError(false) | 748 , m_sawError(false) |
| 749 , m_sawCSS(false) | 749 , m_sawCSS(false) |
| 750 , m_sawXSLTransform(false) | 750 , m_sawXSLTransform(false) |
| 751 , m_sawFirstElement(false) | 751 , m_sawFirstElement(false) |
| 752 , m_isXHTMLDocument(false) | 752 , m_isXHTMLDocument(false) |
| 753 , m_parserPaused(false) | 753 , m_parserPaused(false) |
| 754 , m_requestingScript(false) | 754 , m_requestingScript(false) |
| 755 , m_finishCalled(false) | 755 , m_finishCalled(false) |
| 756 , m_xmlErrors(document) | 756 , m_xmlErrors(&document) |
| 757 , m_pendingScript(0) | 757 , m_pendingScript(0) |
| 758 , m_scriptStartPosition(TextPosition::belowRangePosition()) | 758 , m_scriptStartPosition(TextPosition::belowRangePosition()) |
| 759 , m_parsingFragment(false) | 759 , m_parsingFragment(false) |
| 760 { | 760 { |
| 761 // This is XML being used as a document resource. | 761 // This is XML being used as a document resource. |
| 762 if (frameView && document->isXMLDocument()) | 762 if (frameView && document.isXMLDocument()) |
| 763 UseCounter::count(*document, UseCounter::XMLDocument); | 763 UseCounter::count(document, UseCounter::XMLDocument); |
| 764 } | 764 } |
| 765 | 765 |
| 766 XMLDocumentParser::XMLDocumentParser(DocumentFragment* fragment, Element* parent
Element, ParserContentPolicy parserContentPolicy) | 766 XMLDocumentParser::XMLDocumentParser(DocumentFragment* fragment, Element* parent
Element, ParserContentPolicy parserContentPolicy) |
| 767 : ScriptableDocumentParser(&fragment->document(), parserContentPolicy) | 767 : ScriptableDocumentParser(fragment->document(), parserContentPolicy) |
| 768 , m_view(0) | 768 , m_view(0) |
| 769 , m_context(nullptr) | 769 , m_context(nullptr) |
| 770 , m_currentNode(fragment) | 770 , m_currentNode(fragment) |
| 771 , m_isCurrentlyParsing8BitChunk(false) | 771 , m_isCurrentlyParsing8BitChunk(false) |
| 772 , m_sawError(false) | 772 , m_sawError(false) |
| 773 , m_sawCSS(false) | 773 , m_sawCSS(false) |
| 774 , m_sawXSLTransform(false) | 774 , m_sawXSLTransform(false) |
| 775 , m_sawFirstElement(false) | 775 , m_sawFirstElement(false) |
| 776 , m_isXHTMLDocument(false) | 776 , m_isXHTMLDocument(false) |
| 777 , m_parserPaused(false) | 777 , m_parserPaused(false) |
| (...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1599 sax.initialized = XML_SAX2_MAGIC; | 1599 sax.initialized = XML_SAX2_MAGIC; |
| 1600 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); | 1600 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); |
| 1601 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; | 1601 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; |
| 1602 parseChunk(parser->context(), parseString); | 1602 parseChunk(parser->context(), parseString); |
| 1603 finishParsing(parser->context()); | 1603 finishParsing(parser->context()); |
| 1604 attrsOK = state.gotAttributes; | 1604 attrsOK = state.gotAttributes; |
| 1605 return state.attributes; | 1605 return state.attributes; |
| 1606 } | 1606 } |
| 1607 | 1607 |
| 1608 } // namespace WebCore | 1608 } // namespace WebCore |
| OLD | NEW |