| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2005 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 } | 55 } |
| 56 | 56 |
| 57 bool isLastVisiblePositionInNode(const VisiblePosition& visiblePosition, const C
ontainerNode* node) | 57 bool isLastVisiblePositionInNode(const VisiblePosition& visiblePosition, const C
ontainerNode* node) |
| 58 { | 58 { |
| 59 if (visiblePosition.isNull()) | 59 if (visiblePosition.isNull()) |
| 60 return false; | 60 return false; |
| 61 | 61 |
| 62 if (!visiblePosition.deepEquivalent().computeContainerNode()->isDescendantOf
(node)) | 62 if (!visiblePosition.deepEquivalent().computeContainerNode()->isDescendantOf
(node)) |
| 63 return false; | 63 return false; |
| 64 | 64 |
| 65 VisiblePosition next = visiblePosition.next(); | 65 VisiblePosition next = nextPositionOf(visiblePosition); |
| 66 return next.isNull() || !next.deepEquivalent().anchorNode()->isDescendantOf(
node); | 66 return next.isNull() || !next.deepEquivalent().anchorNode()->isDescendantOf(
node); |
| 67 } | 67 } |
| 68 | 68 |
| 69 } // namespace | 69 } // namespace |
| 70 | 70 |
| 71 BreakBlockquoteCommand::BreakBlockquoteCommand(Document& document) | 71 BreakBlockquoteCommand::BreakBlockquoteCommand(Document& document) |
| 72 : CompositeEditCommand(document) | 72 : CompositeEditCommand(document) |
| 73 { | 73 { |
| 74 } | 74 } |
| 75 | 75 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 | 218 |
| 219 // Make sure the cloned block quote renders. | 219 // Make sure the cloned block quote renders. |
| 220 addBlockPlaceholderIfNeeded(clonedBlockquote.get()); | 220 addBlockPlaceholderIfNeeded(clonedBlockquote.get()); |
| 221 | 221 |
| 222 // Put the selection right before the break. | 222 // Put the selection right before the break. |
| 223 setEndingSelection(VisibleSelection(positionBeforeNode(breakElement.get()),
TextAffinity::Downstream, endingSelection().isDirectional())); | 223 setEndingSelection(VisibleSelection(positionBeforeNode(breakElement.get()),
TextAffinity::Downstream, endingSelection().isDirectional())); |
| 224 rebalanceWhitespace(); | 224 rebalanceWhitespace(); |
| 225 } | 225 } |
| 226 | 226 |
| 227 } // namespace blink | 227 } // namespace blink |
| OLD | NEW |