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

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

Issue 9477008: REGRESSION(r99076): WebKit pastes the trailing newline into a single-line text field (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 8 years, 10 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 | « LayoutTests/resources/dump-as-markup.js ('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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 if (!isNodeRendered(node) && !isTableStructureNode(node)) 284 if (!isNodeRendered(node) && !isTableStructureNode(node))
285 unrendered.append(node); 285 unrendered.append(node);
286 286
287 size_t n = unrendered.size(); 287 size_t n = unrendered.size();
288 for (size_t i = 0; i < n; ++i) 288 for (size_t i = 0; i < n; ++i)
289 removeNode(unrendered[i]); 289 removeNode(unrendered[i]);
290 } 290 }
291 291
292 void ReplacementFragment::removeInterchangeNodes(Node* container) 292 void ReplacementFragment::removeInterchangeNodes(Node* container)
293 { 293 {
294 m_hasInterchangeNewlineAtStart = false;
295 m_hasInterchangeNewlineAtEnd = false;
296
294 // Interchange newlines at the "start" of the incoming fragment must be 297 // Interchange newlines at the "start" of the incoming fragment must be
295 // either the first node in the fragment or the first leaf in the fragment. 298 // either the first node in the fragment or the first leaf in the fragment.
296 Node* node = container->firstChild(); 299 Node* node = container->firstChild();
297 while (node) { 300 while (node) {
298 if (isInterchangeNewlineNode(node)) { 301 if (isInterchangeNewlineNode(node)) {
299 m_hasInterchangeNewlineAtStart = true; 302 m_hasInterchangeNewlineAtStart = true;
300 removeNode(node); 303 removeNode(node);
301 break; 304 break;
302 } 305 }
303 node = node->firstChild(); 306 node = node->firstChild();
(...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after
1288 removeNodeAndPruneAncestors(nodeAfterInsertionPos); 1291 removeNodeAndPruneAncestors(nodeAfterInsertionPos);
1289 1292
1290 VisibleSelection selectionAfterReplace(m_selectReplacement ? start : end, en d); 1293 VisibleSelection selectionAfterReplace(m_selectReplacement ? start : end, en d);
1291 1294
1292 setEndingSelection(selectionAfterReplace); 1295 setEndingSelection(selectionAfterReplace);
1293 1296
1294 return true; 1297 return true;
1295 } 1298 }
1296 1299
1297 } // namespace WebCore 1300 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/resources/dump-as-markup.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698