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