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

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

Issue 23513013: Have Text constructor take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/track/WebVTTParser.cpp ('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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 if (type != XMLErrors::warning) 365 if (type != XMLErrors::warning)
366 m_sawError = true; 366 m_sawError = true;
367 if (type == XMLErrors::fatal) 367 if (type == XMLErrors::fatal)
368 stopParsing(); 368 stopParsing();
369 } 369 }
370 370
371 void XMLDocumentParser::enterText() 371 void XMLDocumentParser::enterText()
372 { 372 {
373 ASSERT(m_bufferedText.size() == 0); 373 ASSERT(m_bufferedText.size() == 0);
374 ASSERT(!m_leafTextNode); 374 ASSERT(!m_leafTextNode);
375 m_leafTextNode = Text::create(&m_currentNode->document(), ""); 375 m_leafTextNode = Text::create(m_currentNode->document(), "");
376 m_currentNode->parserAppendChild(m_leafTextNode.get()); 376 m_currentNode->parserAppendChild(m_leafTextNode.get());
377 } 377 }
378 378
379 void XMLDocumentParser::exitText() 379 void XMLDocumentParser::exitText()
380 { 380 {
381 if (isStopped()) 381 if (isStopped())
382 return; 382 return;
383 383
384 if (!m_leafTextNode) 384 if (!m_leafTextNode)
385 return; 385 return;
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 if (isStopped()) 1155 if (isStopped())
1156 return; 1156 return;
1157 1157
1158 if (m_parserPaused) { 1158 if (m_parserPaused) {
1159 m_pendingCallbacks.append(adoptPtr(new PendingCDATABlockCallback(text))) ; 1159 m_pendingCallbacks.append(adoptPtr(new PendingCDATABlockCallback(text))) ;
1160 return; 1160 return;
1161 } 1161 }
1162 1162
1163 exitText(); 1163 exitText();
1164 1164
1165 RefPtr<CDATASection> newNode = CDATASection::create(&m_currentNode->document (), text); 1165 RefPtr<CDATASection> newNode = CDATASection::create(m_currentNode->document( ), text);
1166 m_currentNode->parserAppendChild(newNode.get()); 1166 m_currentNode->parserAppendChild(newNode.get());
1167 } 1167 }
1168 1168
1169 void XMLDocumentParser::comment(const String& text) 1169 void XMLDocumentParser::comment(const String& text)
1170 { 1170 {
1171 if (isStopped()) 1171 if (isStopped())
1172 return; 1172 return;
1173 1173
1174 if (m_parserPaused) { 1174 if (m_parserPaused) {
1175 m_pendingCallbacks.append(adoptPtr(new PendingCommentCallback(text))); 1175 m_pendingCallbacks.append(adoptPtr(new PendingCommentCallback(text)));
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
1614 sax.initialized = XML_SAX2_MAGIC; 1614 sax.initialized = XML_SAX2_MAGIC;
1615 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax, &state); 1615 RefPtr<XMLParserContext> parser = XMLParserContext::createStringParser(&sax, &state);
1616 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />"; 1616 String parseString = "<?xml version=\"1.0\"?><attrs " + string + " />";
1617 parseChunk(parser->context(), parseString); 1617 parseChunk(parser->context(), parseString);
1618 finishParsing(parser->context()); 1618 finishParsing(parser->context());
1619 attrsOK = state.gotAttributes; 1619 attrsOK = state.gotAttributes;
1620 return state.attributes; 1620 return state.attributes;
1621 } 1621 }
1622 1622
1623 } // namespace WebCore 1623 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/track/WebVTTParser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698