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 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1029 ScriptLoader* scriptLoader = toScriptLoaderIfPossible(element); | 1029 ScriptLoader* scriptLoader = toScriptLoaderIfPossible(element); |
1030 if (!scriptLoader) { | 1030 if (!scriptLoader) { |
1031 popCurrentNode(); | 1031 popCurrentNode(); |
1032 return; | 1032 return; |
1033 } | 1033 } |
1034 | 1034 |
1035 // Don't load external scripts for standalone documents (for now). | 1035 // Don't load external scripts for standalone documents (for now). |
1036 ASSERT(!m_pendingScript); | 1036 ASSERT(!m_pendingScript); |
1037 m_requestingScript = true; | 1037 m_requestingScript = true; |
1038 | 1038 |
1039 if (scriptLoader->prepareScript(m_scriptStartPosition, ScriptLoader::AllowLe
gacyTypeInTypeAttribute)) { | 1039 ScriptPrep prep = scriptLoader->prepareScript(m_scriptStartPosition, ScriptL
oader::AllowLegacyTypeInTypeAttribute); |
| 1040 if (prep.succeeded()) { |
1040 // FIXME: Script execution should be shared between | 1041 // FIXME: Script execution should be shared between |
1041 // the libxml2 and Qt XMLDocumentParser implementations. | 1042 // the libxml2 and Qt XMLDocumentParser implementations. |
1042 | 1043 |
1043 if (scriptLoader->readyToBeParserExecuted()) { | 1044 if (scriptLoader->readyToBeParserExecuted()) { |
1044 scriptLoader->executeScript(ScriptSourceCode(scriptLoader->scriptCon
tent(), document()->url(), m_scriptStartPosition)); | 1045 scriptLoader->executeScript(ScriptSourceCode(scriptLoader->scriptCon
tent(), document()->url(), m_scriptStartPosition)); |
1045 } else if (scriptLoader->willBeParserExecuted()) { | 1046 } else if (scriptLoader->willBeParserExecuted()) { |
1046 m_pendingScript = scriptLoader->resource(); | 1047 m_pendingScript = prep.resource(); |
1047 m_scriptElement = element; | 1048 m_scriptElement = element; |
1048 m_pendingScript->addClient(this); | 1049 m_pendingScript->addClient(this); |
1049 | 1050 |
1050 // m_pendingScript will be 0 if script was already loaded and addCli
ent() executed it. | 1051 // m_pendingScript will be 0 if script was already loaded and addCli
ent() executed it. |
1051 if (m_pendingScript) | 1052 if (m_pendingScript) |
1052 pauseParsing(); | 1053 pauseParsing(); |
1053 } else { | 1054 } else { |
1054 m_scriptElement = nullptr; | 1055 m_scriptElement = nullptr; |
1055 } | 1056 } |
1056 | 1057 |
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1596 sax.initialized = XML_SAX2_MAGIC; | 1597 sax.initialized = XML_SAX2_MAGIC; |
1597 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); | 1598 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); |
1598 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; | 1599 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; |
1599 parseChunk(parser->context(), parseString); | 1600 parseChunk(parser->context(), parseString); |
1600 finishParsing(parser->context()); | 1601 finishParsing(parser->context()); |
1601 attrsOK = state.gotAttributes; | 1602 attrsOK = state.gotAttributes; |
1602 return state.attributes; | 1603 return state.attributes; |
1603 } | 1604 } |
1604 | 1605 |
1605 } // namespace WebCore | 1606 } // namespace WebCore |
OLD | NEW |