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 1420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1431 XMLDocumentParserScope scope(document()->cachedResourceLoader())
; | 1431 XMLDocumentParserScope scope(document()->cachedResourceLoader())
; |
1432 finishParsing(context()); | 1432 finishParsing(context()); |
1433 } | 1433 } |
1434 | 1434 |
1435 m_context = 0; | 1435 m_context = 0; |
1436 } | 1436 } |
1437 } | 1437 } |
1438 | 1438 |
1439 XMLTreeViewer xmlTreeViewer(document()); | 1439 XMLTreeViewer xmlTreeViewer(document()); |
1440 bool xmlViewerMode = !m_sawError && !m_sawCSS && !m_sawXSLTransform && xmlTr
eeViewer.hasNoStyleInformation(); | 1440 bool xmlViewerMode = !m_sawError && !m_sawCSS && !m_sawXSLTransform && xmlTr
eeViewer.hasNoStyleInformation(); |
1441 if (xmlViewerMode) | 1441 if (xmlViewerMode) { |
1442 xmlTreeViewer.transformDocumentToTreeView(); | 1442 xmlTreeViewer.transformDocumentToTreeView(); |
1443 | 1443 } else if (m_sawXSLTransform) { |
1444 if (m_sawXSLTransform) { | |
1445 xmlDocPtr doc = xmlDocPtrForString(document()->cachedResourceLoader(), m
_originalSourceForTransform.toString(), document()->url().string()); | 1444 xmlDocPtr doc = xmlDocPtrForString(document()->cachedResourceLoader(), m
_originalSourceForTransform.toString(), document()->url().string()); |
1446 document()->setTransformSource(adoptPtr(new TransformSource(doc))); | 1445 document()->setTransformSource(adoptPtr(new TransformSource(doc))); |
1447 | 1446 |
1448 document()->setParsing(false); // Make the document think it's done, so
it will apply XSL stylesheets. | 1447 document()->setParsing(false); // Make the document think it's done, so
it will apply XSL stylesheets. |
1449 document()->styleResolverChanged(RecalcStyleImmediately); | 1448 document()->styleResolverChanged(RecalcStyleImmediately); |
1450 | 1449 |
1451 // styleResolverChanged() call can detach the parser and null out its do
cument. | 1450 // styleResolverChanged() call can detach the parser and null out its do
cument. |
1452 // In that case, we just bail out. | 1451 // In that case, we just bail out. |
1453 if (isDetached()) | 1452 if (isDetached()) |
1454 return; | 1453 return; |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1599 sax.initialized = XML_SAX2_MAGIC; | 1598 sax.initialized = XML_SAX2_MAGIC; |
1600 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); | 1599 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax,
&state); |
1601 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; | 1600 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; |
1602 parseChunk(parser->context(), parseString); | 1601 parseChunk(parser->context(), parseString); |
1603 finishParsing(parser->context()); | 1602 finishParsing(parser->context()); |
1604 attrsOK = state.gotAttributes; | 1603 attrsOK = state.gotAttributes; |
1605 return state.attributes; | 1604 return state.attributes; |
1606 } | 1605 } |
1607 | 1606 |
1608 } // namespace WebCore | 1607 } // namespace WebCore |
OLD | NEW |