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 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 } | 762 } |
763 if (editing_state->IsAborted()) | 763 if (editing_state->IsAborted()) |
764 return; | 764 return; |
765 } | 765 } |
766 | 766 |
767 // If we have a caret selection at the beginning of a cell, we have | 767 // If we have a caret selection at the beginning of a cell, we have |
768 // nothing to do. | 768 // nothing to do. |
769 if (enclosing_table_cell && | 769 if (enclosing_table_cell && |
770 visible_start.DeepEquivalent() == | 770 visible_start.DeepEquivalent() == |
771 VisiblePosition::FirstPositionInNode( | 771 VisiblePosition::FirstPositionInNode( |
772 const_cast<Node*>(enclosing_table_cell)) | 772 *const_cast<Node*>(enclosing_table_cell)) |
773 .DeepEquivalent()) | 773 .DeepEquivalent()) |
774 return; | 774 return; |
775 | 775 |
776 // If the caret is at the start of a paragraph after a table, move content | 776 // If the caret is at the start of a paragraph after a table, move content |
777 // into the last table cell. | 777 // into the last table cell. |
778 if (IsStartOfParagraph(visible_start) && | 778 if (IsStartOfParagraph(visible_start) && |
779 TableElementJustBefore( | 779 TableElementJustBefore( |
780 PreviousPositionOf(visible_start, kCannotCrossEditingBoundary))) { | 780 PreviousPositionOf(visible_start, kCannotCrossEditingBoundary))) { |
781 // Unless the caret is just before a table. We don't want to move a | 781 // Unless the caret is just before a table. We don't want to move a |
782 // table into the last table cell. | 782 // table into the last table cell. |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1015 } | 1015 } |
1016 NOTREACHED(); | 1016 NOTREACHED(); |
1017 preserves_typing_style_ = false; | 1017 preserves_typing_style_ = false; |
1018 } | 1018 } |
1019 | 1019 |
1020 bool TypingCommand::IsTypingCommand() const { | 1020 bool TypingCommand::IsTypingCommand() const { |
1021 return true; | 1021 return true; |
1022 } | 1022 } |
1023 | 1023 |
1024 } // namespace blink | 1024 } // namespace blink |
OLD | NEW |