| 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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 } | 224 } |
| 225 } | 225 } |
| 226 VisiblePosition startOfParagraphToMove = startOfParagraph(visibleStartOfPara
graph); | 226 VisiblePosition startOfParagraphToMove = startOfParagraph(visibleStartOfPara
graph); |
| 227 VisiblePosition endOfParagraphToMove = endOfParagraph(visibleEndOfParagraph)
; | 227 VisiblePosition endOfParagraphToMove = endOfParagraph(visibleEndOfParagraph)
; |
| 228 if (startOfParagraphToMove.isNull() || endOfParagraphToMove.isNull()) | 228 if (startOfParagraphToMove.isNull() || endOfParagraphToMove.isNull()) |
| 229 return; | 229 return; |
| 230 HTMLBRElement* placeholder = HTMLBRElement::create(document()); | 230 HTMLBRElement* placeholder = HTMLBRElement::create(document()); |
| 231 insertNodeBefore(placeholder, splitBlockquoteNode, editingState); | 231 insertNodeBefore(placeholder, splitBlockquoteNode, editingState); |
| 232 if (editingState->isAborted()) | 232 if (editingState->isAborted()) |
| 233 return; | 233 return; |
| 234 moveParagraph(startOfParagraphToMove, endOfParagraphToMove, createVisiblePos
ition(positionBeforeNode(placeholder)), editingState, true); | 234 moveParagraph(startOfParagraphToMove, endOfParagraphToMove, createVisiblePos
ition(Position::beforeNode(placeholder)), editingState, true); |
| 235 } | 235 } |
| 236 | 236 |
| 237 // FIXME: We should merge this function with ApplyBlockElementCommand::formatSel
ection | 237 // FIXME: We should merge this function with ApplyBlockElementCommand::formatSel
ection |
| 238 void IndentOutdentCommand::outdentRegion(const VisiblePosition& startOfSelection
, const VisiblePosition& endOfSelection, EditingState* editingState) | 238 void IndentOutdentCommand::outdentRegion(const VisiblePosition& startOfSelection
, const VisiblePosition& endOfSelection, EditingState* editingState) |
| 239 { | 239 { |
| 240 VisiblePosition endOfCurrentParagraph = endOfParagraph(startOfSelection); | 240 VisiblePosition endOfCurrentParagraph = endOfParagraph(startOfSelection); |
| 241 VisiblePosition endOfLastParagraph = endOfParagraph(endOfSelection); | 241 VisiblePosition endOfLastParagraph = endOfParagraph(endOfSelection); |
| 242 | 242 |
| 243 if (endOfCurrentParagraph.deepEquivalent() == endOfLastParagraph.deepEquival
ent()) { | 243 if (endOfCurrentParagraph.deepEquivalent() == endOfLastParagraph.deepEquival
ent()) { |
| 244 outdentParagraph(editingState); | 244 outdentParagraph(editingState); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |