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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 return; | 412 return; |
413 | 413 |
414 // doEnd() could process a script tag, thus pausing parsing. | 414 // doEnd() could process a script tag, thus pausing parsing. |
415 if (m_parserPaused) | 415 if (m_parserPaused) |
416 return; | 416 return; |
417 | 417 |
418 if (m_sawError) | 418 if (m_sawError) |
419 insertErrorMessageBlock(); | 419 insertErrorMessageBlock(); |
420 else { | 420 else { |
421 exitText(); | 421 exitText(); |
422 document()->styleResolverChanged(RecalcStyleImmediately); | 422 document()->styleResolverChanged(RecalcStyleDeferred); |
423 } | 423 } |
424 | 424 |
425 if (isParsing()) | 425 if (isParsing()) |
426 prepareToStopParsing(); | 426 prepareToStopParsing(); |
427 document()->setReadyState(Document::Interactive); | 427 document()->setReadyState(Document::Interactive); |
428 clearCurrentNodeStack(); | 428 clearCurrentNodeStack(); |
429 document()->finishedParsing(); | 429 document()->finishedParsing(); |
430 } | 430 } |
431 | 431 |
432 void XMLDocumentParser::finish() | 432 void XMLDocumentParser::finish() |
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1436 | 1436 |
1437 bool xmlViewerMode = !m_sawError && !m_sawCSS && !m_sawXSLTransform && hasNo
StyleInformation(document()); | 1437 bool xmlViewerMode = !m_sawError && !m_sawCSS && !m_sawXSLTransform && hasNo
StyleInformation(document()); |
1438 if (xmlViewerMode) { | 1438 if (xmlViewerMode) { |
1439 XMLTreeViewer xmlTreeViewer(document()); | 1439 XMLTreeViewer xmlTreeViewer(document()); |
1440 xmlTreeViewer.transformDocumentToTreeView(); | 1440 xmlTreeViewer.transformDocumentToTreeView(); |
1441 } else if (m_sawXSLTransform) { | 1441 } else if (m_sawXSLTransform) { |
1442 xmlDocPtr doc = xmlDocPtrForString(document()->fetcher(), m_originalSour
ceForTransform.toString(), document()->url().string()); | 1442 xmlDocPtr doc = xmlDocPtrForString(document()->fetcher(), m_originalSour
ceForTransform.toString(), document()->url().string()); |
1443 document()->setTransformSource(adoptPtr(new TransformSource(doc))); | 1443 document()->setTransformSource(adoptPtr(new TransformSource(doc))); |
1444 | 1444 |
1445 document()->setParsing(false); // Make the document think it's done, so
it will apply XSL stylesheets. | 1445 document()->setParsing(false); // Make the document think it's done, so
it will apply XSL stylesheets. |
1446 document()->styleResolverChanged(RecalcStyleImmediately); | 1446 document()->styleResolverChanged(RecalcStyleDeferred); |
1447 | 1447 |
1448 // styleResolverChanged() call can detach the parser and null out its do
cument. | 1448 // styleResolverChanged() call can detach the parser and null out its do
cument. |
1449 // In that case, we just bail out. | 1449 // In that case, we just bail out. |
1450 if (isDetached()) | 1450 if (isDetached()) |
1451 return; | 1451 return; |
1452 | 1452 |
1453 document()->setParsing(true); | 1453 document()->setParsing(true); |
1454 DocumentParser::stopParsing(); | 1454 DocumentParser::stopParsing(); |
1455 } | 1455 } |
1456 } | 1456 } |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1596 sax.initialized = XML_SAX2_MAGIC; | 1596 sax.initialized = XML_SAX2_MAGIC; |
1597 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); | 1597 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); |
1598 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; | 1598 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; |
1599 parseChunk(parser->context(), parseString); | 1599 parseChunk(parser->context(), parseString); |
1600 finishParsing(parser->context()); | 1600 finishParsing(parser->context()); |
1601 attrsOK = state.gotAttributes; | 1601 attrsOK = state.gotAttributes; |
1602 return state.attributes; | 1602 return state.attributes; |
1603 } | 1603 } |
1604 | 1604 |
1605 } // namespace WebCore | 1605 } // namespace WebCore |
OLD | NEW |