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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 HTMLElement* blockquote = createBlockElement(); | 132 HTMLElement* blockquote = createBlockElement(); |
133 insertNodeAt(blockquote, start, editingState); | 133 insertNodeAt(blockquote, start, editingState); |
134 if (editingState->isAborted()) | 134 if (editingState->isAborted()) |
135 return; | 135 return; |
136 HTMLBRElement* placeholder = HTMLBRElement::create(document()); | 136 HTMLBRElement* placeholder = HTMLBRElement::create(document()); |
137 appendNode(placeholder, blockquote, editingState); | 137 appendNode(placeholder, blockquote, editingState); |
138 if (editingState->isAborted()) | 138 if (editingState->isAborted()) |
139 return; | 139 return; |
140 document().updateStyleAndLayoutIgnorePendingStylesheets(); | 140 document().updateStyleAndLayoutIgnorePendingStylesheets(); |
141 setEndingSelection(createVisibleSelection( | 141 setEndingSelection(createVisibleSelection( |
142 Position::beforeNode(placeholder), TextAffinity::Downstream, | 142 SelectionInDOMTree::Builder() |
143 endingSelection().isDirectional())); | 143 .collapse(Position::beforeNode(placeholder)) |
| 144 .setIsDirectional(endingSelection().isDirectional()) |
| 145 .build())); |
144 return; | 146 return; |
145 } | 147 } |
146 | 148 |
147 HTMLElement* blockquoteForNextIndent = nullptr; | 149 HTMLElement* blockquoteForNextIndent = nullptr; |
148 VisiblePosition endOfCurrentParagraph = endOfParagraph(startOfSelection); | 150 VisiblePosition endOfCurrentParagraph = endOfParagraph(startOfSelection); |
149 VisiblePosition endOfLastParagraph = endOfParagraph(endOfSelection); | 151 VisiblePosition endOfLastParagraph = endOfParagraph(endOfSelection); |
150 Position endAfterSelection = | 152 Position endAfterSelection = |
151 endOfParagraph(nextPositionOf(endOfLastParagraph)).deepEquivalent(); | 153 endOfParagraph(nextPositionOf(endOfLastParagraph)).deepEquivalent(); |
152 m_endOfLastParagraph = endOfLastParagraph.deepEquivalent(); | 154 m_endOfLastParagraph = endOfLastParagraph.deepEquivalent(); |
153 | 155 |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 element->setAttribute(styleAttr, m_inlineStyle); | 383 element->setAttribute(styleAttr, m_inlineStyle); |
382 return element; | 384 return element; |
383 } | 385 } |
384 | 386 |
385 DEFINE_TRACE(ApplyBlockElementCommand) { | 387 DEFINE_TRACE(ApplyBlockElementCommand) { |
386 visitor->trace(m_endOfLastParagraph); | 388 visitor->trace(m_endOfLastParagraph); |
387 CompositeEditCommand::trace(visitor); | 389 CompositeEditCommand::trace(visitor); |
388 } | 390 } |
389 | 391 |
390 } // namespace blink | 392 } // namespace blink |
OLD | NEW |