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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 | 111 |
112 VisiblePosition startOfContents(start); | 112 VisiblePosition startOfContents(start); |
113 if (!targetBlockquote) { | 113 if (!targetBlockquote) { |
114 // Create a new blockquote and insert it as a child of the root editable
element. We accomplish | 114 // Create a new blockquote and insert it as a child of the root editable
element. We accomplish |
115 // this by splitting all parents of the current paragraph up to that poi
nt. | 115 // this by splitting all parents of the current paragraph up to that poi
nt. |
116 targetBlockquote = createBlockElement(); | 116 targetBlockquote = createBlockElement(); |
117 if (outerBlock == start.containerNode()) | 117 if (outerBlock == start.containerNode()) |
118 insertNodeAt(targetBlockquote, start); | 118 insertNodeAt(targetBlockquote, start); |
119 else | 119 else |
120 insertNodeBefore(targetBlockquote, outerBlock); | 120 insertNodeBefore(targetBlockquote, outerBlock); |
121 startOfContents = VisiblePosition(positionInParentAfterNode(targetBlockq
uote.get())); | 121 startOfContents = VisiblePosition(positionInParentAfterNode(*targetBlock
quote)); |
122 } | 122 } |
123 | 123 |
124 moveParagraphWithClones(startOfContents, VisiblePosition(end), targetBlockqu
ote.get(), outerBlock.get()); | 124 moveParagraphWithClones(startOfContents, VisiblePosition(end), targetBlockqu
ote.get(), outerBlock.get()); |
125 } | 125 } |
126 | 126 |
127 void IndentOutdentCommand::outdentParagraph() | 127 void IndentOutdentCommand::outdentParagraph() |
128 { | 128 { |
129 VisiblePosition visibleStartOfParagraph = startOfParagraph(endingSelection()
.visibleStart()); | 129 VisiblePosition visibleStartOfParagraph = startOfParagraph(endingSelection()
.visibleStart()); |
130 VisiblePosition visibleEndOfParagraph = endOfParagraph(visibleStartOfParagra
ph); | 130 VisiblePosition visibleEndOfParagraph = endOfParagraph(visibleStartOfParagra
ph); |
131 | 131 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 | 237 |
238 void IndentOutdentCommand::formatRange(const Position& start, const Position& en
d, const Position&, RefPtr<Element>& blockquoteForNextIndent) | 238 void IndentOutdentCommand::formatRange(const Position& start, const Position& en
d, const Position&, RefPtr<Element>& blockquoteForNextIndent) |
239 { | 239 { |
240 if (tryIndentingAsListItem(start, end)) | 240 if (tryIndentingAsListItem(start, end)) |
241 blockquoteForNextIndent = nullptr; | 241 blockquoteForNextIndent = nullptr; |
242 else | 242 else |
243 indentIntoBlockquote(start, end, blockquoteForNextIndent); | 243 indentIntoBlockquote(start, end, blockquoteForNextIndent); |
244 } | 244 } |
245 | 245 |
246 } | 246 } |
OLD | NEW |