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

Side by Side Diff: third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp

Issue 2121613003: Include style tags when pasting HTML content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Try to appease Windows linker. Created 4 years, 5 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
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 767 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 return createVisiblePosition(m_startOfInsertedContent); 778 return createVisiblePosition(m_startOfInsertedContent);
779 } 779 }
780 780
781 static void removeHeadContents(ReplacementFragment& fragment) 781 static void removeHeadContents(ReplacementFragment& fragment)
782 { 782 {
783 Node* next = nullptr; 783 Node* next = nullptr;
784 for (Node* node = fragment.firstChild(); node; node = next) { 784 for (Node* node = fragment.firstChild(); node; node = next) {
785 if (isHTMLBaseElement(*node) 785 if (isHTMLBaseElement(*node)
786 || isHTMLLinkElement(*node) 786 || isHTMLLinkElement(*node)
787 || isHTMLMetaElement(*node) 787 || isHTMLMetaElement(*node)
788 || isHTMLStyleElement(*node)
789 || isHTMLTitleElement(*node)) { 788 || isHTMLTitleElement(*node)) {
790 next = NodeTraversal::nextSkippingChildren(*node); 789 next = NodeTraversal::nextSkippingChildren(*node);
791 fragment.removeNode(node); 790 fragment.removeNode(node);
792 } else { 791 } else {
793 next = NodeTraversal::next(*node); 792 next = NodeTraversal::next(*node);
794 } 793 }
795 } 794 }
796 } 795 }
797 796
798 static bool followBlockElementStyle(const Node* node) 797 static bool followBlockElementStyle(const Node* node)
(...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after
1757 visitor->trace(m_startOfInsertedContent); 1756 visitor->trace(m_startOfInsertedContent);
1758 visitor->trace(m_endOfInsertedContent); 1757 visitor->trace(m_endOfInsertedContent);
1759 visitor->trace(m_insertionStyle); 1758 visitor->trace(m_insertionStyle);
1760 visitor->trace(m_documentFragment); 1759 visitor->trace(m_documentFragment);
1761 visitor->trace(m_startOfInsertedRange); 1760 visitor->trace(m_startOfInsertedRange);
1762 visitor->trace(m_endOfInsertedRange); 1761 visitor->trace(m_endOfInsertedRange);
1763 CompositeEditCommand::trace(visitor); 1762 CompositeEditCommand::trace(visitor);
1764 } 1763 }
1765 1764
1766 } // namespace blink 1765 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698