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