| 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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 if (isHTMLUListElement(*enclosingElement)) { | 174 if (isHTMLUListElement(*enclosingElement)) { |
| 175 applyCommandToComposite(InsertListCommand::create(document(), InsertList
Command::UnorderedList), editingState); | 175 applyCommandToComposite(InsertListCommand::create(document(), InsertList
Command::UnorderedList), editingState); |
| 176 return; | 176 return; |
| 177 } | 177 } |
| 178 | 178 |
| 179 // The selection is inside a blockquote i.e. enclosingNode is a blockquote | 179 // The selection is inside a blockquote i.e. enclosingNode is a blockquote |
| 180 VisiblePosition positionInEnclosingBlock = VisiblePosition::firstPositionInN
ode(enclosingElement); | 180 VisiblePosition positionInEnclosingBlock = VisiblePosition::firstPositionInN
ode(enclosingElement); |
| 181 // If the blockquote is inline, the start of the enclosing block coincides w
ith | 181 // If the blockquote is inline, the start of the enclosing block coincides w
ith |
| 182 // positionInEnclosingBlock. | 182 // positionInEnclosingBlock. |
| 183 VisiblePosition startOfEnclosingBlock = (enclosingElement->layoutObject() &&
enclosingElement->layoutObject()->isInline()) ? positionInEnclosingBlock : star
tOfBlock(positionInEnclosingBlock); | 183 VisiblePosition startOfEnclosingBlock = (enclosingElement->layoutObject() &&
enclosingElement->layoutObject()->isInline()) ? positionInEnclosingBlock : star
tOfBlock(positionInEnclosingBlock); |
| 184 VisiblePosition lastPositionInEnclosingBlock = createVisiblePosition(lastPos
itionInNode(enclosingElement)); | 184 VisiblePosition lastPositionInEnclosingBlock = createVisiblePosition(Positio
n::lastPositionInNode(enclosingElement)); |
| 185 VisiblePosition endOfEnclosingBlock = endOfBlock(lastPositionInEnclosingBloc
k); | 185 VisiblePosition endOfEnclosingBlock = endOfBlock(lastPositionInEnclosingBloc
k); |
| 186 if (visibleStartOfParagraph.deepEquivalent() == startOfEnclosingBlock.deepEq
uivalent() | 186 if (visibleStartOfParagraph.deepEquivalent() == startOfEnclosingBlock.deepEq
uivalent() |
| 187 && visibleEndOfParagraph.deepEquivalent() == endOfEnclosingBlock.deepEqu
ivalent()) { | 187 && visibleEndOfParagraph.deepEquivalent() == endOfEnclosingBlock.deepEqu
ivalent()) { |
| 188 // The blockquote doesn't contain anything outside the paragraph, so it
can be totally removed. | 188 // The blockquote doesn't contain anything outside the paragraph, so it
can be totally removed. |
| 189 Node* splitPoint = enclosingElement->nextSibling(); | 189 Node* splitPoint = enclosingElement->nextSibling(); |
| 190 removeNodePreservingChildren(enclosingElement, editingState); | 190 removeNodePreservingChildren(enclosingElement, editingState); |
| 191 if (editingState->isAborted()) | 191 if (editingState->isAborted()) |
| 192 return; | 192 return; |
| 193 // outdentRegion() assumes it is operating on the first paragraph of an
enclosing blockquote, but if there are multiply nested blockquotes and we've | 193 // outdentRegion() assumes it is operating on the first paragraph of an
enclosing blockquote, but if there are multiply nested blockquotes and we've |
| 194 // just removed one, then this assumption isn't true. By splitting the n
ext containing blockquote after this node, we keep this assumption true | 194 // just removed one, then this assumption isn't true. By splitting the n
ext containing blockquote after this node, we keep this assumption true |
| (...skipping 91 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 |