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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 104 |
105 void IndentOutdentCommand::indentIntoBlockquote(const Position& start, const Pos
ition& end, RefPtrWillBeRawPtr<HTMLElement>& targetBlockquote) | 105 void IndentOutdentCommand::indentIntoBlockquote(const Position& start, const Pos
ition& end, RefPtrWillBeRawPtr<HTMLElement>& targetBlockquote) |
106 { | 106 { |
107 Element* enclosingCell = toElement(enclosingNodeOfType(start, &isTableCell))
; | 107 Element* enclosingCell = toElement(enclosingNodeOfType(start, &isTableCell))
; |
108 Element* elementToSplitTo; | 108 Element* elementToSplitTo; |
109 if (enclosingCell) | 109 if (enclosingCell) |
110 elementToSplitTo = enclosingCell; | 110 elementToSplitTo = enclosingCell; |
111 else if (enclosingList(start.computeContainerNode())) | 111 else if (enclosingList(start.computeContainerNode())) |
112 elementToSplitTo = enclosingBlock(start.computeContainerNode()); | 112 elementToSplitTo = enclosingBlock(start.computeContainerNode()); |
113 else | 113 else |
114 elementToSplitTo = editableRootElementForPosition(start); | 114 elementToSplitTo = rootEditableElementOf(start); |
115 | 115 |
116 if (!elementToSplitTo) | 116 if (!elementToSplitTo) |
117 return; | 117 return; |
118 | 118 |
119 RefPtrWillBeRawPtr<Node> outerBlock = (start.computeContainerNode() == eleme
ntToSplitTo) ? start.computeContainerNode() : splitTreeToNode(start.computeConta
inerNode(), elementToSplitTo).get(); | 119 RefPtrWillBeRawPtr<Node> outerBlock = (start.computeContainerNode() == eleme
ntToSplitTo) ? start.computeContainerNode() : splitTreeToNode(start.computeConta
inerNode(), elementToSplitTo).get(); |
120 | 120 |
121 VisiblePosition startOfContents = createVisiblePosition(start); | 121 VisiblePosition startOfContents = createVisiblePosition(start); |
122 if (!targetBlockquote) { | 122 if (!targetBlockquote) { |
123 // Create a new blockquote and insert it as a child of the root editable
element. We accomplish | 123 // Create a new blockquote and insert it as a child of the root editable
element. We accomplish |
124 // this by splitting all parents of the current paragraph up to that poi
nt. | 124 // this by splitting all parents of the current paragraph up to that poi
nt. |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 | 254 |
255 void IndentOutdentCommand::formatRange(const Position& start, const Position& en
d, const Position&, RefPtrWillBeRawPtr<HTMLElement>& blockquoteForNextIndent) | 255 void IndentOutdentCommand::formatRange(const Position& start, const Position& en
d, const Position&, RefPtrWillBeRawPtr<HTMLElement>& blockquoteForNextIndent) |
256 { | 256 { |
257 if (tryIndentingAsListItem(start, end)) | 257 if (tryIndentingAsListItem(start, end)) |
258 blockquoteForNextIndent = nullptr; | 258 blockquoteForNextIndent = nullptr; |
259 else | 259 else |
260 indentIntoBlockquote(start, end, blockquoteForNextIndent); | 260 indentIntoBlockquote(start, end, blockquoteForNextIndent); |
261 } | 261 } |
262 | 262 |
263 } | 263 } |
OLD | NEW |