| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 return next.isNull() || !next.deepEquivalent().anchorNode()->isDescendantOf(
node); | 65 return next.isNull() || !next.deepEquivalent().anchorNode()->isDescendantOf(
node); |
| 66 } | 66 } |
| 67 | 67 |
| 68 } // namespace | 68 } // namespace |
| 69 | 69 |
| 70 BreakBlockquoteCommand::BreakBlockquoteCommand(Document& document) | 70 BreakBlockquoteCommand::BreakBlockquoteCommand(Document& document) |
| 71 : CompositeEditCommand(document) | 71 : CompositeEditCommand(document) |
| 72 { | 72 { |
| 73 } | 73 } |
| 74 | 74 |
| 75 void BreakBlockquoteCommand::doApply() | 75 void BreakBlockquoteCommand::doApply(EditingState*) |
| 76 { | 76 { |
| 77 if (endingSelection().isNone()) | 77 if (endingSelection().isNone()) |
| 78 return; | 78 return; |
| 79 | 79 |
| 80 // Delete the current selection. | 80 // Delete the current selection. |
| 81 if (endingSelection().isRange()) | 81 if (endingSelection().isRange()) |
| 82 deleteSelection(false, false); | 82 deleteSelection(false, false); |
| 83 | 83 |
| 84 // This is a scenario that should never happen, but we want to | 84 // This is a scenario that should never happen, but we want to |
| 85 // make sure we don't dereference a null pointer below. | 85 // make sure we don't dereference a null pointer below. |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 217 |
| 218 // Make sure the cloned block quote renders. | 218 // Make sure the cloned block quote renders. |
| 219 addBlockPlaceholderIfNeeded(clonedBlockquote.get()); | 219 addBlockPlaceholderIfNeeded(clonedBlockquote.get()); |
| 220 | 220 |
| 221 // Put the selection right before the break. | 221 // Put the selection right before the break. |
| 222 setEndingSelection(VisibleSelection(positionBeforeNode(breakElement.get()),
TextAffinity::Downstream, endingSelection().isDirectional())); | 222 setEndingSelection(VisibleSelection(positionBeforeNode(breakElement.get()),
TextAffinity::Downstream, endingSelection().isDirectional())); |
| 223 rebalanceWhitespace(); | 223 rebalanceWhitespace(); |
| 224 } | 224 } |
| 225 | 225 |
| 226 } // namespace blink | 226 } // namespace blink |
| OLD | NEW |