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

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

Issue 200613003: ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuilder should take a const r… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
« no previous file with comments | « Source/core/editing/ReplaceSelectionCommand.h ('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) 2005, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2009, 2010, 2011 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 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 elements.add(tfootTag.localName()); 602 elements.add(tfootTag.localName());
603 elements.add(thTag.localName()); 603 elements.add(thTag.localName());
604 elements.add(theadTag.localName()); 604 elements.add(theadTag.localName());
605 elements.add(trTag.localName()); 605 elements.add(trTag.localName());
606 elements.add(ulTag.localName()); 606 elements.add(ulTag.localName());
607 elements.add(xmpTag.localName()); 607 elements.add(xmpTag.localName());
608 } 608 }
609 return elements.contains(name); 609 return elements.contains(name);
610 } 610 }
611 611
612 void ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuild er(InsertedNodes& insertedNodes) 612 void ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuild er(const InsertedNodes& insertedNodes)
613 { 613 {
614 RefPtr<Node> pastEndNode = insertedNodes.pastLastLeaf(); 614 RefPtr<Node> pastEndNode = insertedNodes.pastLastLeaf();
615 RefPtr<Node> next; 615 RefPtr<Node> next;
616 for (RefPtr<Node> node = insertedNodes.firstNodeInserted(); node && node != pastEndNode; node = next) { 616 for (RefPtr<Node> node = insertedNodes.firstNodeInserted(); node && node != pastEndNode; node = next) {
617 next = NodeTraversal::next(*node); 617 next = NodeTraversal::next(*node);
618 618
619 if (!node->isHTMLElement()) 619 if (!node->isHTMLElement())
620 continue; 620 continue;
621 621
622 if (isProhibitedParagraphChild(toHTMLElement(node)->localName())) { 622 if (isProhibitedParagraphChild(toHTMLElement(node)->localName())) {
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after
1494 removeNodeAndPruneAncestors(nodeAfterInsertionPos.get()); 1494 removeNodeAndPruneAncestors(nodeAfterInsertionPos.get());
1495 1495
1496 VisibleSelection selectionAfterReplace(m_selectReplacement ? start : end, en d); 1496 VisibleSelection selectionAfterReplace(m_selectReplacement ? start : end, en d);
1497 1497
1498 setEndingSelection(selectionAfterReplace); 1498 setEndingSelection(selectionAfterReplace);
1499 1499
1500 return true; 1500 return true;
1501 } 1501 }
1502 1502
1503 } // namespace WebCore 1503 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/editing/ReplaceSelectionCommand.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698