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

Side by Side Diff: Source/core/editing/StyledMarkupSerializer.cpp

Issue 1179133002: Refactoring: Remove the first parameter |result| from StyledMarkupAccumulator::appendStartMarkup (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Bug fix: miss to call pushMarkup Created 5 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2008, 2009, 2010, 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2008, 2009, 2010, 2011 Google Inc. All rights reserved.
4 * Copyright (C) 2011 Igalia S.L. 4 * Copyright (C) 2011 Igalia S.L.
5 * Copyright (C) 2011 Motorola Mobility. All rights reserved. 5 * Copyright (C) 2011 Motorola Mobility. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 return false; 303 return false;
304 if (m_shouldAnnotate == AnnotateForInterchange) 304 if (m_shouldAnnotate == AnnotateForInterchange)
305 return true; 305 return true;
306 return convertBlocksToInlines() && isBlock(&element); 306 return convertBlocksToInlines() && isBlock(&element);
307 } 307 }
308 308
309 template<typename Strategy> 309 template<typename Strategy>
310 void StyledMarkupSerializer<Strategy>::wrapWithNode(StyledMarkupAccumulator& acc umulator, ContainerNode& node, PassRefPtrWillBeRawPtr<EditingStyle> style) 310 void StyledMarkupSerializer<Strategy>::wrapWithNode(StyledMarkupAccumulator& acc umulator, ContainerNode& node, PassRefPtrWillBeRawPtr<EditingStyle> style)
311 { 311 {
312 StringBuilder markup; 312 StringBuilder markup;
313 if (!node.isElementNode()) { 313 if (node.isDocumentNode()) {
314 accumulator.appendStartMarkup(markup, node); 314 MarkupFormatter::appendXMLDeclaration(markup, toDocument(node));
315 accumulator.pushMarkup(markup.toString()); 315 accumulator.pushMarkup(markup.toString());
316 return; 316 return;
317 } 317 }
318 if (!node.isElementNode()) {
yosin_UTC9 2015/06/12 07:58:04 nit: We don't need to have curry brace.
hajimehoshi 2015/06/12 08:14:13 Done.
319 return;
320 }
321
yosin_UTC9 2015/06/12 07:58:04 We don't need to have an extra blank line.
hajimehoshi 2015/06/12 08:14:13 Done.
318 Element& element = toElement(node); 322 Element& element = toElement(node);
319 if (accumulator.shouldApplyWrappingStyle(element) || needsInlineStyle(elemen t)) 323 if (accumulator.shouldApplyWrappingStyle(element) || needsInlineStyle(elemen t))
320 accumulator.appendElementWithInlineStyle(markup, element, style); 324 accumulator.appendElementWithInlineStyle(markup, element, style);
321 else 325 else
322 accumulator.appendElement(markup, element); 326 accumulator.appendElement(markup, element);
323 accumulator.pushMarkup(markup.toString()); 327 accumulator.pushMarkup(markup.toString());
324 accumulator.appendEndTag(toElement(node)); 328 accumulator.appendEndTag(toElement(node));
325 } 329 }
326 330
327 template<typename Strategy> 331 template<typename Strategy>
328 RefPtrWillBeRawPtr<EditingStyle> StyledMarkupSerializer<Strategy>::createInlineS tyleIfNeeded(StyledMarkupAccumulator& accumulator, Node& node) 332 RefPtrWillBeRawPtr<EditingStyle> StyledMarkupSerializer<Strategy>::createInlineS tyleIfNeeded(StyledMarkupAccumulator& accumulator, Node& node)
329 { 333 {
330 if (!node.isElementNode()) 334 if (!node.isElementNode())
331 return nullptr; 335 return nullptr;
332 RefPtrWillBeRawPtr<EditingStyle> inlineStyle = accumulator.createInlineStyle (toElement(node)); 336 RefPtrWillBeRawPtr<EditingStyle> inlineStyle = accumulator.createInlineStyle (toElement(node));
333 if (convertBlocksToInlines() && isBlock(&node)) 337 if (convertBlocksToInlines() && isBlock(&node))
334 inlineStyle->forceInline(); 338 inlineStyle->forceInline();
335 return inlineStyle; 339 return inlineStyle;
336 } 340 }
337 341
338 template class StyledMarkupSerializer<EditingStrategy>; 342 template class StyledMarkupSerializer<EditingStrategy>;
339 343
340 } // namespace blink 344 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698