Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Side by Side Diff: Source/WebCore/xml/parser/XMLDocumentParser.cpp

Issue 11830062: Merge 138863 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/WebCore/dom/Document.cpp ('k') | Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 } 187 }
188 188
189 void XMLDocumentParser::end() 189 void XMLDocumentParser::end()
190 { 190 {
191 // XMLDocumentParserLibxml2 will do bad things to the document if doEnd() is called. 191 // XMLDocumentParserLibxml2 will do bad things to the document if doEnd() is called.
192 // I don't believe XMLDocumentParserQt needs doEnd called in the fragment ca se. 192 // I don't believe XMLDocumentParserQt needs doEnd called in the fragment ca se.
193 ASSERT(!m_parsingFragment); 193 ASSERT(!m_parsingFragment);
194 194
195 doEnd(); 195 doEnd();
196 196
197 // doEnd() call above can detach the parser and null out its document.
198 // In that case, we just bail out.
199 if (isDetached())
200 return;
201
197 // doEnd() could process a script tag, thus pausing parsing. 202 // doEnd() could process a script tag, thus pausing parsing.
198 if (m_parserPaused) 203 if (m_parserPaused)
199 return; 204 return;
200 205
201 if (m_sawError) 206 if (m_sawError)
202 insertErrorMessageBlock(); 207 insertErrorMessageBlock();
203 else { 208 else {
204 exitText(); 209 exitText();
205 document()->styleResolverChanged(RecalcStyleImmediately); 210 document()->styleResolverChanged(RecalcStyleImmediately);
206 } 211 }
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 306
302 RefPtr<XMLDocumentParser> parser = XMLDocumentParser::create(fragment, conte xtElement, scriptingPermission); 307 RefPtr<XMLDocumentParser> parser = XMLDocumentParser::create(fragment, conte xtElement, scriptingPermission);
303 bool wellFormed = parser->appendFragmentSource(chunk); 308 bool wellFormed = parser->appendFragmentSource(chunk);
304 // Do not call finish(). Current finish() and doEnd() implementations touch the main Document/loader 309 // Do not call finish(). Current finish() and doEnd() implementations touch the main Document/loader
305 // and can cause crashes in the fragment case. 310 // and can cause crashes in the fragment case.
306 parser->detach(); // Allows ~DocumentParser to assert it was detached before destruction. 311 parser->detach(); // Allows ~DocumentParser to assert it was detached before destruction.
307 return wellFormed; // appendFragmentSource()'s wellFormed is more permissive than wellFormed(). 312 return wellFormed; // appendFragmentSource()'s wellFormed is more permissive than wellFormed().
308 } 313 }
309 314
310 } // namespace WebCore 315 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/WebCore/dom/Document.cpp ('k') | Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698