| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 node)) | 64 node)) |
| 65 return false; | 65 return false; |
| 66 | 66 |
| 67 VisiblePosition next = nextPositionOf(visiblePosition); | 67 VisiblePosition next = nextPositionOf(visiblePosition); |
| 68 return next.isNull() || | 68 return next.isNull() || |
| 69 !next.deepEquivalent().anchorNode()->isDescendantOf(node); | 69 !next.deepEquivalent().anchorNode()->isDescendantOf(node); |
| 70 } | 70 } |
| 71 | 71 |
| 72 } // namespace | 72 } // namespace |
| 73 | 73 |
| 74 BreakBlockquoteCommand::BreakBlockquoteCommand(Document& document) | 74 BreakBlockquoteCommand::BreakBlockquoteCommand(Document& document, |
| 75 : CompositeEditCommand(document) {} | 75 CommandSource source) |
| 76 : CompositeEditCommand(document, source) {} |
| 76 | 77 |
| 77 void BreakBlockquoteCommand::doApply(EditingState* editingState) { | 78 void BreakBlockquoteCommand::doApply(EditingState* editingState) { |
| 78 if (endingSelection().isNone()) | 79 if (endingSelection().isNone()) |
| 79 return; | 80 return; |
| 80 | 81 |
| 81 // Delete the current selection. | 82 // Delete the current selection. |
| 82 if (endingSelection().isRange()) { | 83 if (endingSelection().isRange()) { |
| 83 deleteSelection(editingState, false, false); | 84 deleteSelection(editingState, false, false); |
| 84 if (editingState->isAborted()) | 85 if (editingState->isAborted()) |
| 85 return; | 86 return; |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 | 269 |
| 269 // Put the selection right before the break. | 270 // Put the selection right before the break. |
| 270 setEndingSelection(SelectionInDOMTree::Builder() | 271 setEndingSelection(SelectionInDOMTree::Builder() |
| 271 .collapse(Position::beforeNode(breakElement)) | 272 .collapse(Position::beforeNode(breakElement)) |
| 272 .setIsDirectional(endingSelection().isDirectional()) | 273 .setIsDirectional(endingSelection().isDirectional()) |
| 273 .build()); | 274 .build()); |
| 274 rebalanceWhitespace(); | 275 rebalanceWhitespace(); |
| 275 } | 276 } |
| 276 | 277 |
| 277 } // namespace blink | 278 } // namespace blink |
| OLD | NEW |