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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 if (!m_leafTextNode) | 168 if (!m_leafTextNode) |
169 return; | 169 return; |
170 | 170 |
171 #if !USE(QXMLSTREAM) | 171 #if !USE(QXMLSTREAM) |
172 ExceptionCode ec = 0; | 172 ExceptionCode ec = 0; |
173 m_leafTextNode->appendData(toString(m_bufferedText.data(), m_bufferedText.si
ze()), ec); | 173 m_leafTextNode->appendData(toString(m_bufferedText.data(), m_bufferedText.si
ze()), ec); |
174 Vector<xmlChar> empty; | 174 Vector<xmlChar> empty; |
175 m_bufferedText.swap(empty); | 175 m_bufferedText.swap(empty); |
176 #endif | 176 #endif |
177 | 177 |
178 if (m_view && !m_leafTextNode->attached()) | 178 if (m_view && m_leafTextNode->parentNode() && m_leafTextNode->parentNode()->
attached() |
| 179 && !m_leafTextNode->attached()) |
179 m_leafTextNode->attach(); | 180 m_leafTextNode->attach(); |
180 | 181 |
181 m_leafTextNode = 0; | 182 m_leafTextNode = 0; |
182 } | 183 } |
183 | 184 |
184 void XMLDocumentParser::detach() | 185 void XMLDocumentParser::detach() |
185 { | 186 { |
186 clearCurrentNodeStack(); | 187 clearCurrentNodeStack(); |
187 ScriptableDocumentParser::detach(); | 188 ScriptableDocumentParser::detach(); |
188 } | 189 } |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 | 303 |
303 RefPtr<XMLDocumentParser> parser = XMLDocumentParser::create(fragment, conte
xtElement, scriptingPermission); | 304 RefPtr<XMLDocumentParser> parser = XMLDocumentParser::create(fragment, conte
xtElement, scriptingPermission); |
304 bool wellFormed = parser->appendFragmentSource(chunk); | 305 bool wellFormed = parser->appendFragmentSource(chunk); |
305 // Do not call finish(). Current finish() and doEnd() implementations touch
the main Document/loader | 306 // Do not call finish(). Current finish() and doEnd() implementations touch
the main Document/loader |
306 // and can cause crashes in the fragment case. | 307 // and can cause crashes in the fragment case. |
307 parser->detach(); // Allows ~DocumentParser to assert it was detached before
destruction. | 308 parser->detach(); // Allows ~DocumentParser to assert it was detached before
destruction. |
308 return wellFormed; // appendFragmentSource()'s wellFormed is more permissive
than wellFormed(). | 309 return wellFormed; // appendFragmentSource()'s wellFormed is more permissive
than wellFormed(). |
309 } | 310 } |
310 | 311 |
311 } // namespace WebCore | 312 } // namespace WebCore |
OLD | NEW |