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

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

Issue 23863002: Refactoring: toHTMLElement(const Node*) added but never used. Using it. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
« no previous file with comments | « no previous file | Source/core/editing/ReplaceSelectionCommand.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 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 531
532 bool MarkupAccumulator::elementCannotHaveEndTag(const Node* node) 532 bool MarkupAccumulator::elementCannotHaveEndTag(const Node* node)
533 { 533 {
534 if (!node->isHTMLElement()) 534 if (!node->isHTMLElement())
535 return false; 535 return false;
536 536
537 // FIXME: ieForbidsInsertHTML may not be the right function to call here 537 // FIXME: ieForbidsInsertHTML may not be the right function to call here
538 // ieForbidsInsertHTML is used to disallow setting innerHTML/outerHTML 538 // ieForbidsInsertHTML is used to disallow setting innerHTML/outerHTML
539 // or createContextualFragment. It does not necessarily align with 539 // or createContextualFragment. It does not necessarily align with
540 // which elements should be serialized w/o end tags. 540 // which elements should be serialized w/o end tags.
541 return static_cast<const HTMLElement*>(node)->ieForbidsInsertHTML(); 541 return toHTMLElement(node)->ieForbidsInsertHTML();
542 } 542 }
543 543
544 void MarkupAccumulator::appendEndMarkup(StringBuilder& result, const Node* node) 544 void MarkupAccumulator::appendEndMarkup(StringBuilder& result, const Node* node)
545 { 545 {
546 if (!node->isElementNode() || shouldSelfClose(node) || (!node->hasChildNodes () && elementCannotHaveEndTag(node))) 546 if (!node->isElementNode() || shouldSelfClose(node) || (!node->hasChildNodes () && elementCannotHaveEndTag(node)))
547 return; 547 return;
548 548
549 result.append('<'); 549 result.append('<');
550 result.append('/'); 550 result.append('/');
551 result.append(toElement(node)->nodeNamePreservingCase()); 551 result.append(toElement(node)->nodeNamePreservingCase());
552 result.append('>'); 552 result.append('>');
553 } 553 }
554 554
555 } 555 }
OLDNEW
« no previous file with comments | « no previous file | Source/core/editing/ReplaceSelectionCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698