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 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1015 if (isStopped()) { | 1015 if (isStopped()) { |
1016 stopParsing(); | 1016 stopParsing(); |
1017 return; | 1017 return; |
1018 } | 1018 } |
1019 | 1019 |
1020 if (isHTMLTemplateElement(*newElement)) | 1020 if (isHTMLTemplateElement(*newElement)) |
1021 pushCurrentNode(toHTMLTemplateElement(*newElement).content()); | 1021 pushCurrentNode(toHTMLTemplateElement(*newElement).content()); |
1022 else | 1022 else |
1023 pushCurrentNode(newElement); | 1023 pushCurrentNode(newElement); |
1024 | 1024 |
1025 if (isHTMLHtmlElement(*newElement)) | 1025 // Note: |insertedByParser| will perform dispatching if this is an |
| 1026 // HTMLHtmlElement. |
| 1027 if (isHTMLHtmlElement(*newElement) && isFirstElement) { |
1026 toHTMLHtmlElement(*newElement).insertedByParser(); | 1028 toHTMLHtmlElement(*newElement).insertedByParser(); |
1027 | 1029 } else if (!m_parsingFragment && isFirstElement && document()->frame()) { |
1028 if (!m_parsingFragment && isFirstElement && document()->frame()) { | |
1029 document()->frame()->loader().dispatchDocumentElementAvailable(); | 1030 document()->frame()->loader().dispatchDocumentElementAvailable(); |
1030 document()->frame()->loader().runScriptsAtDocumentElementAvailable(); | 1031 document()->frame()->loader().runScriptsAtDocumentElementAvailable(); |
1031 // runScriptsAtDocumentElementAvailable might have invalidated the docum
ent. | 1032 // runScriptsAtDocumentElementAvailable might have invalidated the docum
ent. |
1032 } | 1033 } |
1033 } | 1034 } |
1034 | 1035 |
1035 void XMLDocumentParser::endElementNs() | 1036 void XMLDocumentParser::endElementNs() |
1036 { | 1037 { |
1037 if (isStopped()) | 1038 if (isStopped()) |
1038 return; | 1039 return; |
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1638 sax.initialized = XML_SAX2_MAGIC; | 1639 sax.initialized = XML_SAX2_MAGIC; |
1639 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); | 1640 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); |
1640 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; | 1641 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; |
1641 parseChunk(parser->context(), parseString); | 1642 parseChunk(parser->context(), parseString); |
1642 finishParsing(parser->context()); | 1643 finishParsing(parser->context()); |
1643 attrsOK = state.gotAttributes; | 1644 attrsOK = state.gotAttributes; |
1644 return state.attributes; | 1645 return state.attributes; |
1645 } | 1646 } |
1646 | 1647 |
1647 } // namespace blink | 1648 } // namespace blink |
OLD | NEW |