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

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

Issue 180723006: Have ElementData::attributeItem() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 9 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/dom/PresentationAttributeStyle.cpp ('k') | Source/core/editing/markup.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) 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. 3 * Copyright (C) 2009, 2010 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 result.appendLiteral("?>"); 374 result.appendLiteral("?>");
375 } 375 }
376 376
377 void MarkupAccumulator::appendElement(StringBuilder& result, Element& element, N amespaces* namespaces) 377 void MarkupAccumulator::appendElement(StringBuilder& result, Element& element, N amespaces* namespaces)
378 { 378 {
379 appendOpenTag(result, element, namespaces); 379 appendOpenTag(result, element, namespaces);
380 380
381 if (element.hasAttributes()) { 381 if (element.hasAttributes()) {
382 unsigned length = element.attributeCount(); 382 unsigned length = element.attributeCount();
383 for (unsigned int i = 0; i < length; i++) 383 for (unsigned int i = 0; i < length; i++)
384 appendAttribute(result, element, *element.attributeItem(i), namespac es); 384 appendAttribute(result, element, element.attributeItem(i), namespace s);
385 } 385 }
386 386
387 // Give an opportunity to subclasses to add their own attributes. 387 // Give an opportunity to subclasses to add their own attributes.
388 appendCustomAttributes(result, element, namespaces); 388 appendCustomAttributes(result, element, namespaces);
389 389
390 appendCloseTag(result, element); 390 appendCloseTag(result, element);
391 } 391 }
392 392
393 static String nodeNamePreservingCase(const Element& element) 393 static String nodeNamePreservingCase(const Element& element)
394 { 394 {
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 { 529 {
530 if (!node.isElementNode() || shouldSelfClose(node) || (!node.hasChildren() & & elementCannotHaveEndTag(node))) 530 if (!node.isElementNode() || shouldSelfClose(node) || (!node.hasChildren() & & elementCannotHaveEndTag(node)))
531 return; 531 return;
532 532
533 result.appendLiteral("</"); 533 result.appendLiteral("</");
534 result.append(nodeNamePreservingCase(toElement(node))); 534 result.append(nodeNamePreservingCase(toElement(node)));
535 result.append('>'); 535 result.append('>');
536 } 536 }
537 537
538 } 538 }
OLDNEW
« no previous file with comments | « Source/core/dom/PresentationAttributeStyle.cpp ('k') | Source/core/editing/markup.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698