OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 break; | 410 break; |
411 } | 411 } |
412 } | 412 } |
413 | 413 |
414 moveRemainingSiblingsToNewParent(n, blockToInsert.get(), blockToInsert); | 414 moveRemainingSiblingsToNewParent(n, blockToInsert.get(), blockToInsert); |
415 } | 415 } |
416 | 416 |
417 // Handle whitespace that occurs after the split | 417 // Handle whitespace that occurs after the split |
418 if (positionAfterSplit.isNotNull()) { | 418 if (positionAfterSplit.isNotNull()) { |
419 document().updateLayoutIgnorePendingStylesheets(); | 419 document().updateLayoutIgnorePendingStylesheets(); |
420 if (!positionAfterSplit.isRenderedCharacter()) { | 420 // TODO(yosin) |isRenderedCharacter()| should be removed, and we should |
| 421 // use |VisiblePosition::characterAfter()|. |
| 422 if (!isRenderedCharacter(positionAfterSplit)) { |
421 // Clear out all whitespace and insert one non-breaking space | 423 // Clear out all whitespace and insert one non-breaking space |
422 ASSERT(!positionAfterSplit.computeContainerNode()->layoutObject() ||
positionAfterSplit.computeContainerNode()->layoutObject()->style()->collapseWhi
teSpace()); | 424 ASSERT(!positionAfterSplit.computeContainerNode()->layoutObject() ||
positionAfterSplit.computeContainerNode()->layoutObject()->style()->collapseWhi
teSpace()); |
423 deleteInsignificantTextDownstream(positionAfterSplit); | 425 deleteInsignificantTextDownstream(positionAfterSplit); |
424 if (positionAfterSplit.anchorNode()->isTextNode()) | 426 if (positionAfterSplit.anchorNode()->isTextNode()) |
425 insertTextIntoNode(toText(positionAfterSplit.computeContainerNod
e()), 0, nonBreakingSpaceString()); | 427 insertTextIntoNode(toText(positionAfterSplit.computeContainerNod
e()), 0, nonBreakingSpaceString()); |
426 } | 428 } |
427 } | 429 } |
428 | 430 |
429 setEndingSelection(VisibleSelection(firstPositionInNode(blockToInsert.get())
, DOWNSTREAM, endingSelection().isDirectional())); | 431 setEndingSelection(VisibleSelection(firstPositionInNode(blockToInsert.get())
, DOWNSTREAM, endingSelection().isDirectional())); |
430 applyStyleAfterInsertion(startBlock.get()); | 432 applyStyleAfterInsertion(startBlock.get()); |
431 } | 433 } |
432 | 434 |
433 DEFINE_TRACE(InsertParagraphSeparatorCommand) | 435 DEFINE_TRACE(InsertParagraphSeparatorCommand) |
434 { | 436 { |
435 visitor->trace(m_style); | 437 visitor->trace(m_style); |
436 CompositeEditCommand::trace(visitor); | 438 CompositeEditCommand::trace(visitor); |
437 } | 439 } |
438 | 440 |
439 | 441 |
440 } // namespace blink | 442 } // namespace blink |
OLD | NEW |