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 * Copyright (C) 2010 Google Inc. All rights reserved. | 3 * Copyright (C) 2010 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 endOfCurrentParagraph = end; | 131 endOfCurrentParagraph = end; |
132 | 132 |
133 Node* enclosingCell = enclosingNodeOfType(start, &isTableCell); | 133 Node* enclosingCell = enclosingNodeOfType(start, &isTableCell); |
134 VisiblePosition endOfNextParagraph = endOfNextParagrahSplittingTextNodes
IfNeeded(endOfCurrentParagraph, start, end); | 134 VisiblePosition endOfNextParagraph = endOfNextParagrahSplittingTextNodes
IfNeeded(endOfCurrentParagraph, start, end); |
135 | 135 |
136 formatRange(start, end, m_endOfLastParagraph, blockquoteForNextIndent); | 136 formatRange(start, end, m_endOfLastParagraph, blockquoteForNextIndent); |
137 | 137 |
138 // Don't put the next paragraph in the blockquote we just created for th
is paragraph unless | 138 // Don't put the next paragraph in the blockquote we just created for th
is paragraph unless |
139 // the next paragraph is in the same cell. | 139 // the next paragraph is in the same cell. |
140 if (enclosingCell && enclosingCell != enclosingNodeOfType(endOfNextParag
raph.deepEquivalent(), &isTableCell)) | 140 if (enclosingCell && enclosingCell != enclosingNodeOfType(endOfNextParag
raph.deepEquivalent(), &isTableCell)) |
141 blockquoteForNextIndent = 0; | 141 blockquoteForNextIndent = nullptr; |
142 | 142 |
143 // indentIntoBlockquote could move more than one paragraph if the paragr
aph | 143 // indentIntoBlockquote could move more than one paragraph if the paragr
aph |
144 // is in a list item or a table. As a result, endAfterSelection could re
fer to a position | 144 // is in a list item or a table. As a result, endAfterSelection could re
fer to a position |
145 // no longer in the document. | 145 // no longer in the document. |
146 if (endAfterSelection.isNotNull() && !endAfterSelection.deepEquivalent()
.inDocument()) | 146 if (endAfterSelection.isNotNull() && !endAfterSelection.deepEquivalent()
.inDocument()) |
147 break; | 147 break; |
148 // Sanity check: Make sure our moveParagraph calls didn't remove endOfNe
xtParagraph.deepEquivalent().deprecatedNode() | 148 // Sanity check: Make sure our moveParagraph calls didn't remove endOfNe
xtParagraph.deepEquivalent().deprecatedNode() |
149 // If somehow, e.g. mutation event handler, we did, return to prevent cr
ashes. | 149 // If somehow, e.g. mutation event handler, we did, return to prevent cr
ashes. |
150 if (endOfNextParagraph.isNotNull() && !endOfNextParagraph.deepEquivalent
().inDocument()) | 150 if (endOfNextParagraph.isNotNull() && !endOfNextParagraph.deepEquivalent
().inDocument()) |
151 return; | 151 return; |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 | 278 |
279 PassRefPtr<Element> ApplyBlockElementCommand::createBlockElement() const | 279 PassRefPtr<Element> ApplyBlockElementCommand::createBlockElement() const |
280 { | 280 { |
281 RefPtr<Element> element = createHTMLElement(document(), m_tagName); | 281 RefPtr<Element> element = createHTMLElement(document(), m_tagName); |
282 if (m_inlineStyle.length()) | 282 if (m_inlineStyle.length()) |
283 element->setAttribute(styleAttr, m_inlineStyle); | 283 element->setAttribute(styleAttr, m_inlineStyle); |
284 return element.release(); | 284 return element.release(); |
285 } | 285 } |
286 | 286 |
287 } | 287 } |
OLD | NEW |