| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2007, 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 1611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1622 createVisiblePositionDeprecated(afterParagraphPosition.position()); | 1622 createVisiblePositionDeprecated(afterParagraphPosition.position()); |
| 1623 if (beforeParagraph.isNotNull() && | 1623 if (beforeParagraph.isNotNull() && |
| 1624 (!isEndOfParagraphDeprecated(beforeParagraph) || | 1624 (!isEndOfParagraphDeprecated(beforeParagraph) || |
| 1625 beforeParagraph.deepEquivalent() == afterParagraph.deepEquivalent())) { | 1625 beforeParagraph.deepEquivalent() == afterParagraph.deepEquivalent())) { |
| 1626 // FIXME: Trim text between beforeParagraph and afterParagraph if they | 1626 // FIXME: Trim text between beforeParagraph and afterParagraph if they |
| 1627 // aren't equal. | 1627 // aren't equal. |
| 1628 insertNodeAt(HTMLBRElement::create(document()), | 1628 insertNodeAt(HTMLBRElement::create(document()), |
| 1629 beforeParagraph.deepEquivalent(), editingState); | 1629 beforeParagraph.deepEquivalent(), editingState); |
| 1630 if (editingState->isAborted()) | 1630 if (editingState->isAborted()) |
| 1631 return; | 1631 return; |
| 1632 // Need an updateLayout here in case inserting the br has split a text node. | |
| 1633 document().updateStyleAndLayoutIgnorePendingStylesheets(); | |
| 1634 } | 1632 } |
| 1635 | 1633 |
| 1634 // TextIterator::rangeLength requires clean layout. |
| 1635 document().updateStyleAndLayoutIgnorePendingStylesheets(); |
| 1636 |
| 1636 destinationIndex = TextIterator::rangeLength( | 1637 destinationIndex = TextIterator::rangeLength( |
| 1637 Position::firstPositionInNode(document().documentElement()), | 1638 Position::firstPositionInNode(document().documentElement()), |
| 1638 destination.toParentAnchoredPosition(), true); | 1639 destination.toParentAnchoredPosition(), true); |
| 1639 | 1640 |
| 1640 VisibleSelection destinationSelection = | 1641 VisibleSelection destinationSelection = |
| 1641 createVisibleSelectionDeprecated(destination, originalIsDirectional); | 1642 createVisibleSelectionDeprecated(destination, originalIsDirectional); |
| 1642 if (endingSelection().isNone()) { | 1643 if (endingSelection().isNone()) { |
| 1643 // We abort executing command since |destination| becomes invisible. | 1644 // We abort executing command since |destination| becomes invisible. |
| 1644 editingState->abort(); | 1645 editingState->abort(); |
| 1645 return; | 1646 return; |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1994 return node; | 1995 return node; |
| 1995 } | 1996 } |
| 1996 | 1997 |
| 1997 DEFINE_TRACE(CompositeEditCommand) { | 1998 DEFINE_TRACE(CompositeEditCommand) { |
| 1998 visitor->trace(m_commands); | 1999 visitor->trace(m_commands); |
| 1999 visitor->trace(m_composition); | 2000 visitor->trace(m_composition); |
| 2000 EditCommand::trace(visitor); | 2001 EditCommand::trace(visitor); |
| 2001 } | 2002 } |
| 2002 | 2003 |
| 2003 } // namespace blink | 2004 } // namespace blink |
| OLD | NEW |