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

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

Issue 2122003003: Make ReplaceSelectionCommand to handle empty SPAN replacement (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-07-07T10:52:58 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommandTest.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) 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 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after
1306 } 1306 }
1307 1307
1308 makeInsertedContentRoundTrippableWithHTMLTreeBuilder(insertedNodes, editingS tate); 1308 makeInsertedContentRoundTrippableWithHTMLTreeBuilder(insertedNodes, editingS tate);
1309 if (editingState->isAborted()) 1309 if (editingState->isAborted())
1310 return; 1310 return;
1311 1311
1312 removeRedundantStylesAndKeepStyleSpanInline(insertedNodes, editingState); 1312 removeRedundantStylesAndKeepStyleSpanInline(insertedNodes, editingState);
1313 if (editingState->isAborted()) 1313 if (editingState->isAborted())
1314 return; 1314 return;
1315 1315
1316 if (m_sanitizeFragment) { 1316 if (m_sanitizeFragment && insertedNodes.firstNodeInserted()) {
1317 applyCommandToComposite(SimplifyMarkupCommand::create(document(), insert edNodes.firstNodeInserted(), insertedNodes.pastLastLeaf()), editingState); 1317 applyCommandToComposite(SimplifyMarkupCommand::create(document(), insert edNodes.firstNodeInserted(), insertedNodes.pastLastLeaf()), editingState);
1318 if (editingState->isAborted()) 1318 if (editingState->isAborted())
1319 return; 1319 return;
1320 } 1320 }
1321 1321
1322 // Setup m_startOfInsertedContent and m_endOfInsertedContent. This should be the last two lines of code that access insertedNodes. 1322 // Setup m_startOfInsertedContent and m_endOfInsertedContent. This should be the last two lines of code that access insertedNodes.
1323 m_startOfInsertedContent = firstPositionInOrBeforeNode(insertedNodes.firstNo deInserted()); 1323 m_startOfInsertedContent = firstPositionInOrBeforeNode(insertedNodes.firstNo deInserted());
1324 m_endOfInsertedContent = lastPositionInOrAfterNode(insertedNodes.lastLeafIns erted()); 1324 m_endOfInsertedContent = lastPositionInOrAfterNode(insertedNodes.lastLeafIns erted());
1325 1325
1326 // Determine whether or not we should merge the end of inserted content with what's after it before we do 1326 // Determine whether or not we should merge the end of inserted content with what's after it before we do
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
1756 visitor->trace(m_startOfInsertedContent); 1756 visitor->trace(m_startOfInsertedContent);
1757 visitor->trace(m_endOfInsertedContent); 1757 visitor->trace(m_endOfInsertedContent);
1758 visitor->trace(m_insertionStyle); 1758 visitor->trace(m_insertionStyle);
1759 visitor->trace(m_documentFragment); 1759 visitor->trace(m_documentFragment);
1760 visitor->trace(m_startOfInsertedRange); 1760 visitor->trace(m_startOfInsertedRange);
1761 visitor->trace(m_endOfInsertedRange); 1761 visitor->trace(m_endOfInsertedRange);
1762 CompositeEditCommand::trace(visitor); 1762 CompositeEditCommand::trace(visitor);
1763 } 1763 }
1764 1764
1765 } // namespace blink 1765 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommandTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698