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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 } | 86 } |
87 | 87 |
88 if (canMergeLists(previousList.get(), newList.get())) | 88 if (canMergeLists(previousList.get(), newList.get())) |
89 mergeIdenticalElements(previousList.get(), newList.get()); | 89 mergeIdenticalElements(previousList.get(), newList.get()); |
90 if (canMergeLists(newList.get(), nextList.get())) | 90 if (canMergeLists(newList.get(), nextList.get())) |
91 mergeIdenticalElements(newList.get(), nextList.get()); | 91 mergeIdenticalElements(newList.get(), nextList.get()); |
92 | 92 |
93 return true; | 93 return true; |
94 } | 94 } |
95 | 95 |
96 void IndentOutdentCommand::indentIntoBlockquote(const Position& start, const Pos
ition& end, RefPtrWillBeRawPtr<Element>& targetBlockquote) | 96 void IndentOutdentCommand::indentIntoBlockquote(const Position& start, const Pos
ition& end, RefPtrWillBeRawPtr<HTMLElement>& targetBlockquote) |
97 { | 97 { |
98 Node* enclosingCell = enclosingNodeOfType(start, &isTableCell); | 98 Node* enclosingCell = enclosingNodeOfType(start, &isTableCell); |
99 Node* nodeToSplitTo; | 99 Node* nodeToSplitTo; |
100 if (enclosingCell) | 100 if (enclosingCell) |
101 nodeToSplitTo = enclosingCell; | 101 nodeToSplitTo = enclosingCell; |
102 else if (enclosingList(start.containerNode())) | 102 else if (enclosingList(start.containerNode())) |
103 nodeToSplitTo = enclosingBlock(start.containerNode()); | 103 nodeToSplitTo = enclosingBlock(start.containerNode()); |
104 else | 104 else |
105 nodeToSplitTo = editableRootForPosition(start); | 105 nodeToSplitTo = editableRootForPosition(start); |
106 | 106 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 } | 236 } |
237 | 237 |
238 void IndentOutdentCommand::formatSelection(const VisiblePosition& startOfSelecti
on, const VisiblePosition& endOfSelection) | 238 void IndentOutdentCommand::formatSelection(const VisiblePosition& startOfSelecti
on, const VisiblePosition& endOfSelection) |
239 { | 239 { |
240 if (m_typeOfAction == Indent) | 240 if (m_typeOfAction == Indent) |
241 ApplyBlockElementCommand::formatSelection(startOfSelection, endOfSelecti
on); | 241 ApplyBlockElementCommand::formatSelection(startOfSelection, endOfSelecti
on); |
242 else | 242 else |
243 outdentRegion(startOfSelection, endOfSelection); | 243 outdentRegion(startOfSelection, endOfSelection); |
244 } | 244 } |
245 | 245 |
246 void IndentOutdentCommand::formatRange(const Position& start, const Position& en
d, const Position&, RefPtrWillBeRawPtr<Element>& blockquoteForNextIndent) | 246 void IndentOutdentCommand::formatRange(const Position& start, const Position& en
d, const Position&, RefPtrWillBeRawPtr<HTMLElement>& blockquoteForNextIndent) |
247 { | 247 { |
248 if (tryIndentingAsListItem(start, end)) | 248 if (tryIndentingAsListItem(start, end)) |
249 blockquoteForNextIndent = nullptr; | 249 blockquoteForNextIndent = nullptr; |
250 else | 250 else |
251 indentIntoBlockquote(start, end, blockquoteForNextIndent); | 251 indentIntoBlockquote(start, end, blockquoteForNextIndent); |
252 } | 252 } |
253 | 253 |
254 } | 254 } |
OLD | NEW |