| 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 21 matching lines...) Expand all Loading... |
| 32 #include "bindings/core/v8/V8Document.h" | 32 #include "bindings/core/v8/V8Document.h" |
| 33 #include "core/HTMLNames.h" | 33 #include "core/HTMLNames.h" |
| 34 #include "core/XMLNSNames.h" | 34 #include "core/XMLNSNames.h" |
| 35 #include "core/dom/CDATASection.h" | 35 #include "core/dom/CDATASection.h" |
| 36 #include "core/dom/Comment.h" | 36 #include "core/dom/Comment.h" |
| 37 #include "core/dom/Document.h" | 37 #include "core/dom/Document.h" |
| 38 #include "core/dom/DocumentFragment.h" | 38 #include "core/dom/DocumentFragment.h" |
| 39 #include "core/dom/DocumentType.h" | 39 #include "core/dom/DocumentType.h" |
| 40 #include "core/dom/ProcessingInstruction.h" | 40 #include "core/dom/ProcessingInstruction.h" |
| 41 #include "core/dom/ScriptLoader.h" | 41 #include "core/dom/ScriptLoader.h" |
| 42 #include "core/dom/StyleEngine.h" |
| 42 #include "core/dom/TransformSource.h" | 43 #include "core/dom/TransformSource.h" |
| 43 #include "core/fetch/FetchInitiatorTypeNames.h" | 44 #include "core/fetch/FetchInitiatorTypeNames.h" |
| 44 #include "core/fetch/RawResource.h" | 45 #include "core/fetch/RawResource.h" |
| 45 #include "core/fetch/ResourceFetcher.h" | 46 #include "core/fetch/ResourceFetcher.h" |
| 46 #include "core/fetch/ScriptResource.h" | 47 #include "core/fetch/ScriptResource.h" |
| 47 #include "core/frame/ConsoleTypes.h" | 48 #include "core/frame/ConsoleTypes.h" |
| 48 #include "core/frame/LocalFrame.h" | 49 #include "core/frame/LocalFrame.h" |
| 49 #include "core/frame/UseCounter.h" | 50 #include "core/frame/UseCounter.h" |
| 50 #include "core/html/HTMLHtmlElement.h" | 51 #include "core/html/HTMLHtmlElement.h" |
| 51 #include "core/html/HTMLTemplateElement.h" | 52 #include "core/html/HTMLTemplateElement.h" |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 // doEnd() could process a script tag, thus pausing parsing. | 442 // doEnd() could process a script tag, thus pausing parsing. |
| 442 if (m_parserPaused) | 443 if (m_parserPaused) |
| 443 return; | 444 return; |
| 444 | 445 |
| 445 if (m_sawError) { | 446 if (m_sawError) { |
| 446 insertErrorMessageBlock(); | 447 insertErrorMessageBlock(); |
| 447 } else { | 448 } else { |
| 448 updateLeafTextNode(); | 449 updateLeafTextNode(); |
| 449 // Do not bail out if in a stopped state, but notify document that | 450 // Do not bail out if in a stopped state, but notify document that |
| 450 // parsing has finished. | 451 // parsing has finished. |
| 451 document()->styleResolverChanged(); | 452 document()->styleEngine().resolverChanged(FullStyleUpdate); |
| 452 } | 453 } |
| 453 | 454 |
| 454 if (isParsing()) | 455 if (isParsing()) |
| 455 prepareToStopParsing(); | 456 prepareToStopParsing(); |
| 456 document()->setReadyState(Document::Interactive); | 457 document()->setReadyState(Document::Interactive); |
| 457 clearCurrentNodeStack(); | 458 clearCurrentNodeStack(); |
| 458 document()->finishedParsing(); | 459 document()->finishedParsing(); |
| 459 } | 460 } |
| 460 | 461 |
| 461 void XMLDocumentParser::finish() | 462 void XMLDocumentParser::finish() |
| (...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1534 bool xmlViewerMode = !m_sawError && !m_sawCSS && !m_sawXSLTransform && hasNo
StyleInformation(document()); | 1535 bool xmlViewerMode = !m_sawError && !m_sawCSS && !m_sawXSLTransform && hasNo
StyleInformation(document()); |
| 1535 if (xmlViewerMode) { | 1536 if (xmlViewerMode) { |
| 1536 const char noStyleMessage[] = "This XML file does not appear to have any
style information associated with it. The document tree is shown below."; | 1537 const char noStyleMessage[] = "This XML file does not appear to have any
style information associated with it. The document tree is shown below."; |
| 1537 document()->setIsViewSource(true); | 1538 document()->setIsViewSource(true); |
| 1538 V8Document::PrivateScript::transformDocumentToTreeViewMethod(document()-
>frame(), document(), noStyleMessage); | 1539 V8Document::PrivateScript::transformDocumentToTreeViewMethod(document()-
>frame(), document(), noStyleMessage); |
| 1539 } else if (m_sawXSLTransform) { | 1540 } else if (m_sawXSLTransform) { |
| 1540 xmlDocPtr doc = xmlDocPtrForString(document(), m_originalSourceForTransf
orm.toString(), document()->url().string()); | 1541 xmlDocPtr doc = xmlDocPtrForString(document(), m_originalSourceForTransf
orm.toString(), document()->url().string()); |
| 1541 document()->setTransformSource(adoptPtr(new TransformSource(doc))); | 1542 document()->setTransformSource(adoptPtr(new TransformSource(doc))); |
| 1542 // Make the document think it's done, so it will apply XSL stylesheets. | 1543 // Make the document think it's done, so it will apply XSL stylesheets. |
| 1543 document()->setParsingState(Document::FinishedParsing); | 1544 document()->setParsingState(Document::FinishedParsing); |
| 1544 document()->styleResolverChanged(); | 1545 document()->styleEngine().resolverChanged(FullStyleUpdate); |
| 1545 | 1546 |
| 1546 // styleResolverChanged() call can detach the parser and null out its | 1547 // resolverChanged() call can detach the parser and null out its |
| 1547 // document. In that case, we just bail out. | 1548 // document. In that case, we just bail out. |
| 1548 if (isDetached()) | 1549 if (isDetached()) |
| 1549 return; | 1550 return; |
| 1550 | 1551 |
| 1551 document()->setParsingState(Document::Parsing); | 1552 document()->setParsingState(Document::Parsing); |
| 1552 DocumentParser::stopParsing(); | 1553 DocumentParser::stopParsing(); |
| 1553 } | 1554 } |
| 1554 } | 1555 } |
| 1555 | 1556 |
| 1556 xmlDocPtr xmlDocPtrForString(Document* document, const String& source, const Str
ing& url) | 1557 xmlDocPtr xmlDocPtrForString(Document* document, const String& source, const Str
ing& url) |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1698 sax.initialized = XML_SAX2_MAGIC; | 1699 sax.initialized = XML_SAX2_MAGIC; |
| 1699 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); | 1700 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); |
| 1700 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; | 1701 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; |
| 1701 parseChunk(parser->context(), parseString); | 1702 parseChunk(parser->context(), parseString); |
| 1702 finishParsing(parser->context()); | 1703 finishParsing(parser->context()); |
| 1703 attrsOK = state.gotAttributes; | 1704 attrsOK = state.gotAttributes; |
| 1704 return state.attributes; | 1705 return state.attributes; |
| 1705 } | 1706 } |
| 1706 | 1707 |
| 1707 } // namespace blink | 1708 } // namespace blink |
| OLD | NEW |