| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2008 Apple 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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 else | 255 else |
| 256 setEndingSelection(endOfCurrentParagraph); | 256 setEndingSelection(endOfCurrentParagraph); |
| 257 | 257 |
| 258 outdentParagraph(editingState); | 258 outdentParagraph(editingState); |
| 259 if (editingState->isAborted()) | 259 if (editingState->isAborted()) |
| 260 return; | 260 return; |
| 261 | 261 |
| 262 // outdentParagraph could move more than one paragraph if the paragraph | 262 // outdentParagraph could move more than one paragraph if the paragraph |
| 263 // is in a list item. As a result, endAfterSelection and endOfNextParagr
aph | 263 // is in a list item. As a result, endAfterSelection and endOfNextParagr
aph |
| 264 // could refer to positions no longer in the document. | 264 // could refer to positions no longer in the document. |
| 265 if (endAfterSelection.isNotNull() && !endAfterSelection.deepEquivalent()
.inDocument()) | 265 if (endAfterSelection.isNotNull() && !endAfterSelection.deepEquivalent()
.inShadowIncludingDocument()) |
| 266 break; | 266 break; |
| 267 | 267 |
| 268 if (endOfNextParagraph.isNotNull() && !endOfNextParagraph.deepEquivalent
().inDocument()) { | 268 if (endOfNextParagraph.isNotNull() && !endOfNextParagraph.deepEquivalent
().inShadowIncludingDocument()) { |
| 269 endOfCurrentParagraph = createVisiblePosition(endingSelection().end(
)); | 269 endOfCurrentParagraph = createVisiblePosition(endingSelection().end(
)); |
| 270 endOfNextParagraph = endOfParagraph(nextPositionOf(endOfCurrentParag
raph)); | 270 endOfNextParagraph = endOfParagraph(nextPositionOf(endOfCurrentParag
raph)); |
| 271 } | 271 } |
| 272 endOfCurrentParagraph = endOfNextParagraph; | 272 endOfCurrentParagraph = endOfNextParagraph; |
| 273 } | 273 } |
| 274 } | 274 } |
| 275 | 275 |
| 276 void IndentOutdentCommand::formatSelection(const VisiblePosition& startOfSelecti
on, const VisiblePosition& endOfSelection, EditingState* editingState) | 276 void IndentOutdentCommand::formatSelection(const VisiblePosition& startOfSelecti
on, const VisiblePosition& endOfSelection, EditingState* editingState) |
| 277 { | 277 { |
| 278 if (m_typeOfAction == Indent) | 278 if (m_typeOfAction == Indent) |
| 279 ApplyBlockElementCommand::formatSelection(startOfSelection, endOfSelecti
on, editingState); | 279 ApplyBlockElementCommand::formatSelection(startOfSelection, endOfSelecti
on, editingState); |
| 280 else | 280 else |
| 281 outdentRegion(startOfSelection, endOfSelection, editingState); | 281 outdentRegion(startOfSelection, endOfSelection, editingState); |
| 282 } | 282 } |
| 283 | 283 |
| 284 void IndentOutdentCommand::formatRange(const Position& start, const Position& en
d, const Position&, RawPtr<HTMLElement>& blockquoteForNextIndent, EditingState*
editingState) | 284 void IndentOutdentCommand::formatRange(const Position& start, const Position& en
d, const Position&, RawPtr<HTMLElement>& blockquoteForNextIndent, EditingState*
editingState) |
| 285 { | 285 { |
| 286 bool indentingAsListItemResult = tryIndentingAsListItem(start, end, editingS
tate); | 286 bool indentingAsListItemResult = tryIndentingAsListItem(start, end, editingS
tate); |
| 287 if (editingState->isAborted()) | 287 if (editingState->isAborted()) |
| 288 return; | 288 return; |
| 289 if (indentingAsListItemResult) | 289 if (indentingAsListItemResult) |
| 290 blockquoteForNextIndent = nullptr; | 290 blockquoteForNextIndent = nullptr; |
| 291 else | 291 else |
| 292 indentIntoBlockquote(start, end, blockquoteForNextIndent, editingState); | 292 indentIntoBlockquote(start, end, blockquoteForNextIndent, editingState); |
| 293 } | 293 } |
| 294 | 294 |
| 295 } // namespace blink | 295 } // namespace blink |
| OLD | NEW |