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

Side by Side Diff: Source/WebCore/dom/XMLDocumentParser.cpp

Issue 7057048: Merge 87737 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/742/
Patch Set: Created 9 years, 6 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 | « LayoutTests/fast/dom/xml-parser-error-message-crash-expected.txt ('k') | no next file » | 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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 if (m_parsingFragment) 287 if (m_parsingFragment)
288 return; 288 return;
289 #endif 289 #endif
290 // One or more errors occurred during parsing of the code. Display an error block to the user above 290 // One or more errors occurred during parsing of the code. Display an error block to the user above
291 // the normal content (the DOM tree is created manually and includes line/co l info regarding 291 // the normal content (the DOM tree is created manually and includes line/co l info regarding
292 // where the errors are located) 292 // where the errors are located)
293 293
294 // Create elements for display 294 // Create elements for display
295 ExceptionCode ec = 0; 295 ExceptionCode ec = 0;
296 Document* document = this->document(); 296 Document* document = this->document();
297 Element* documentElement = document->documentElement(); 297 RefPtr<Element> documentElement = document->documentElement();
298 if (!documentElement) { 298 if (!documentElement) {
299 RefPtr<Element> rootElement = document->createElement(htmlTag, false); 299 RefPtr<Element> rootElement = document->createElement(htmlTag, false);
300 document->appendChild(rootElement, ec); 300 document->appendChild(rootElement, ec);
301 RefPtr<Element> body = document->createElement(bodyTag, false); 301 RefPtr<Element> body = document->createElement(bodyTag, false);
302 rootElement->appendChild(body, ec); 302 rootElement->appendChild(body, ec);
303 documentElement = body.get(); 303 documentElement = body.get();
304 } 304 }
305 #if ENABLE(SVG) 305 #if ENABLE(SVG)
306 else if (documentElement->namespaceURI() == SVGNames::svgNamespaceURI) { 306 else if (documentElement->namespaceURI() == SVGNames::svgNamespaceURI) {
307 RefPtr<Element> rootElement = document->createElement(htmlTag, false); 307 RefPtr<Element> rootElement = document->createElement(htmlTag, false);
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 397
398 RefPtr<XMLDocumentParser> parser = XMLDocumentParser::create(fragment, conte xtElement, scriptingPermission); 398 RefPtr<XMLDocumentParser> parser = XMLDocumentParser::create(fragment, conte xtElement, scriptingPermission);
399 bool wellFormed = parser->appendFragmentSource(chunk); 399 bool wellFormed = parser->appendFragmentSource(chunk);
400 // Do not call finish(). Current finish() and doEnd() implementations touch the main Document/loader 400 // Do not call finish(). Current finish() and doEnd() implementations touch the main Document/loader
401 // and can cause crashes in the fragment case. 401 // and can cause crashes in the fragment case.
402 parser->detach(); // Allows ~DocumentParser to assert it was detached before destruction. 402 parser->detach(); // Allows ~DocumentParser to assert it was detached before destruction.
403 return wellFormed; // appendFragmentSource()'s wellFormed is more permissive than wellFormed(). 403 return wellFormed; // appendFragmentSource()'s wellFormed is more permissive than wellFormed().
404 } 404 }
405 405
406 } // namespace WebCore 406 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/xml-parser-error-message-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698