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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 m_originalSourceForTransform.append(source); | 342 m_originalSourceForTransform.append(source); |
343 | 343 |
344 if (isStopped() || m_sawXSLTransform) | 344 if (isStopped() || m_sawXSLTransform) |
345 return; | 345 return; |
346 | 346 |
347 if (m_parserPaused) { | 347 if (m_parserPaused) { |
348 m_pendingSrc.append(source); | 348 m_pendingSrc.append(source); |
349 return; | 349 return; |
350 } | 350 } |
351 | 351 |
| 352 // JavaScript can detach the parser. Make sure this is not released |
| 353 // before the end of this method. |
| 354 RefPtr<XMLDocumentParser> protect(this); |
| 355 |
352 doWrite(source.toString()); | 356 doWrite(source.toString()); |
353 | 357 |
354 if (isStopped()) | 358 if (isStopped()) |
355 return; | 359 return; |
356 | 360 |
357 if (document()->frame() && document()->frame()->script()->canExecuteScripts(
NotAboutToExecuteScript)) | 361 if (document()->frame() && document()->frame()->script()->canExecuteScripts(
NotAboutToExecuteScript)) |
358 ImageLoader::dispatchPendingBeforeLoadEvents(); | 362 ImageLoader::dispatchPendingBeforeLoadEvents(); |
359 } | 363 } |
360 | 364 |
361 void XMLDocumentParser::handleError(XMLErrors::ErrorType type, const char* forma
ttedMessage, TextPosition position) | 365 void XMLDocumentParser::handleError(XMLErrors::ErrorType type, const char* forma
ttedMessage, TextPosition position) |
(...skipping 1254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1616 sax.initialized = XML_SAX2_MAGIC; | 1620 sax.initialized = XML_SAX2_MAGIC; |
1617 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); | 1621 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); |
1618 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; | 1622 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; |
1619 parseChunk(parser->context(), parseString); | 1623 parseChunk(parser->context(), parseString); |
1620 finishParsing(parser->context()); | 1624 finishParsing(parser->context()); |
1621 attrsOK = state.gotAttributes; | 1625 attrsOK = state.gotAttributes; |
1622 return state.attributes; | 1626 return state.attributes; |
1623 } | 1627 } |
1624 | 1628 |
1625 } // namespace WebCore | 1629 } // namespace WebCore |
OLD | NEW |