| 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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 388         appendNode(createBreakElement(document()).get(), blockToInsert.get()); | 388         appendNode(createBreakElement(document()).get(), blockToInsert.get()); | 
| 389 | 389 | 
| 390     // Move the start node and the siblings of the start node. | 390     // Move the start node and the siblings of the start node. | 
| 391     if (VisiblePosition(insertionPosition) != VisiblePosition(positionBeforeNode
     (blockToInsert.get()))) { | 391     if (VisiblePosition(insertionPosition) != VisiblePosition(positionBeforeNode
     (blockToInsert.get()))) { | 
| 392         Node* n; | 392         Node* n; | 
| 393         if (insertionPosition.containerNode() == startBlock) | 393         if (insertionPosition.containerNode() == startBlock) | 
| 394             n = insertionPosition.computeNodeAfterPosition(); | 394             n = insertionPosition.computeNodeAfterPosition(); | 
| 395         else { | 395         else { | 
| 396             Node* splitTo = insertionPosition.containerNode(); | 396             Node* splitTo = insertionPosition.containerNode(); | 
| 397             if (splitTo->isTextNode() && insertionPosition.offsetInContainerNode
     () >= caretMaxOffset(splitTo)) | 397             if (splitTo->isTextNode() && insertionPosition.offsetInContainerNode
     () >= caretMaxOffset(splitTo)) | 
| 398                 splitTo = NodeTraversal::next(splitTo, startBlock.get()); | 398                 splitTo = NodeTraversal::next(*splitTo, startBlock.get()); | 
| 399             ASSERT(splitTo); | 399             ASSERT(splitTo); | 
| 400             splitTreeToNode(splitTo, startBlock.get()); | 400             splitTreeToNode(splitTo, startBlock.get()); | 
| 401 | 401 | 
| 402             for (n = startBlock->firstChild(); n; n = n->nextSibling()) { | 402             for (n = startBlock->firstChild(); n; n = n->nextSibling()) { | 
| 403                 VisiblePosition beforeNodePosition = positionBeforeNode(n); | 403                 VisiblePosition beforeNodePosition = positionBeforeNode(n); | 
| 404                 if (!beforeNodePosition.isNull() && comparePositions(VisiblePosi
     tion(insertionPosition), beforeNodePosition) <= 0) | 404                 if (!beforeNodePosition.isNull() && comparePositions(VisiblePosi
     tion(insertionPosition), beforeNodePosition) <= 0) | 
| 405                     break; | 405                     break; | 
| 406             } | 406             } | 
| 407         } | 407         } | 
| 408 | 408 | 
| (...skipping 10 matching lines...) Expand all  Loading... | 
| 419             if (positionAfterSplit.deprecatedNode()->isTextNode()) | 419             if (positionAfterSplit.deprecatedNode()->isTextNode()) | 
| 420                 insertTextIntoNode(toText(positionAfterSplit.containerNode()), 0
     , nonBreakingSpaceString()); | 420                 insertTextIntoNode(toText(positionAfterSplit.containerNode()), 0
     , nonBreakingSpaceString()); | 
| 421         } | 421         } | 
| 422     } | 422     } | 
| 423 | 423 | 
| 424     setEndingSelection(VisibleSelection(firstPositionInNode(blockToInsert.get())
     , DOWNSTREAM, endingSelection().isDirectional())); | 424     setEndingSelection(VisibleSelection(firstPositionInNode(blockToInsert.get())
     , DOWNSTREAM, endingSelection().isDirectional())); | 
| 425     applyStyleAfterInsertion(startBlock.get()); | 425     applyStyleAfterInsertion(startBlock.get()); | 
| 426 } | 426 } | 
| 427 | 427 | 
| 428 } // namespace WebCore | 428 } // namespace WebCore | 
| OLD | NEW | 
|---|