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 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 | 464 |
465 ScriptLoader* scriptLoader = toScriptLoaderIfPossible(e.get()); | 465 ScriptLoader* scriptLoader = toScriptLoaderIfPossible(e.get()); |
466 ASSERT(scriptLoader); | 466 ASSERT(scriptLoader); |
467 | 467 |
468 // JavaScript can detach this parser, make sure it's kept alive even if deta
ched. | 468 // JavaScript can detach this parser, make sure it's kept alive even if deta
ched. |
469 RefPtr<XMLDocumentParser> protect(this); | 469 RefPtr<XMLDocumentParser> protect(this); |
470 | 470 |
471 if (errorOccurred) | 471 if (errorOccurred) |
472 scriptLoader->dispatchErrorEvent(); | 472 scriptLoader->dispatchErrorEvent(); |
473 else if (!wasCanceled) { | 473 else if (!wasCanceled) { |
474 if (scriptLoader->executePotentiallyCrossOriginScript(sourceCode)) | 474 scriptLoader->executeScript(sourceCode); |
475 scriptLoader->dispatchLoadEvent(); | 475 scriptLoader->dispatchLoadEvent(); |
476 } | 476 } |
477 | 477 |
478 m_scriptElement = 0; | 478 m_scriptElement = 0; |
479 | 479 |
480 if (!isDetached() && !m_requestingScript) | 480 if (!isDetached() && !m_requestingScript) |
481 resumeParsing(); | 481 resumeParsing(); |
482 } | 482 } |
483 | 483 |
484 bool XMLDocumentParser::isWaitingForScripts() const | 484 bool XMLDocumentParser::isWaitingForScripts() const |
485 { | 485 { |
(...skipping 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1632 sax.initialized = XML_SAX2_MAGIC; | 1632 sax.initialized = XML_SAX2_MAGIC; |
1633 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); | 1633 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); |
1634 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; | 1634 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; |
1635 parseChunk(parser->context(), parseString); | 1635 parseChunk(parser->context(), parseString); |
1636 finishParsing(parser->context()); | 1636 finishParsing(parser->context()); |
1637 attrsOK = state.gotAttributes; | 1637 attrsOK = state.gotAttributes; |
1638 return state.attributes; | 1638 return state.attributes; |
1639 } | 1639 } |
1640 | 1640 |
1641 } // namespace WebCore | 1641 } // namespace WebCore |
OLD | NEW |