OLD | NEW |
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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 if (!isNodeRendered(node) && !isTableStructureNode(node)) | 286 if (!isNodeRendered(node) && !isTableStructureNode(node)) |
287 unrendered.append(node); | 287 unrendered.append(node); |
288 | 288 |
289 size_t n = unrendered.size(); | 289 size_t n = unrendered.size(); |
290 for (size_t i = 0; i < n; ++i) | 290 for (size_t i = 0; i < n; ++i) |
291 removeNode(unrendered[i]); | 291 removeNode(unrendered[i]); |
292 } | 292 } |
293 | 293 |
294 void ReplacementFragment::removeInterchangeNodes(Node* container) | 294 void ReplacementFragment::removeInterchangeNodes(Node* container) |
295 { | 295 { |
| 296 m_hasInterchangeNewlineAtStart = false; |
| 297 m_hasInterchangeNewlineAtEnd = false; |
| 298 |
296 // Interchange newlines at the "start" of the incoming fragment must be | 299 // Interchange newlines at the "start" of the incoming fragment must be |
297 // either the first node in the fragment or the first leaf in the fragment. | 300 // either the first node in the fragment or the first leaf in the fragment. |
298 Node* node = container->firstChild(); | 301 Node* node = container->firstChild(); |
299 while (node) { | 302 while (node) { |
300 if (isInterchangeNewlineNode(node)) { | 303 if (isInterchangeNewlineNode(node)) { |
301 m_hasInterchangeNewlineAtStart = true; | 304 m_hasInterchangeNewlineAtStart = true; |
302 removeNode(node); | 305 removeNode(node); |
303 break; | 306 break; |
304 } | 307 } |
305 node = node->firstChild(); | 308 node = node->firstChild(); |
(...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1345 removeNodeAndPruneAncestors(nodeAfterInsertionPos); | 1348 removeNodeAndPruneAncestors(nodeAfterInsertionPos); |
1346 | 1349 |
1347 VisibleSelection selectionAfterReplace(m_selectReplacement ? start : end, en
d); | 1350 VisibleSelection selectionAfterReplace(m_selectReplacement ? start : end, en
d); |
1348 | 1351 |
1349 setEndingSelection(selectionAfterReplace); | 1352 setEndingSelection(selectionAfterReplace); |
1350 | 1353 |
1351 return true; | 1354 return true; |
1352 } | 1355 } |
1353 | 1356 |
1354 } // namespace WebCore | 1357 } // namespace WebCore |
OLD | NEW |