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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 // require proper deletion in that case. | 102 // require proper deletion in that case. |
103 const bool should_keep_selected_list = | 103 const bool should_keep_selected_list = |
104 end.AnchorNode() == selected_list_item || | 104 end.AnchorNode() == selected_list_item || |
105 end.AnchorNode()->IsDescendantOf(selected_list_item->lastChild()); | 105 end.AnchorNode()->IsDescendantOf(selected_list_item->lastChild()); |
106 | 106 |
107 const VisiblePosition& start_of_paragraph_to_move = | 107 const VisiblePosition& start_of_paragraph_to_move = |
108 CreateVisiblePosition(start); | 108 CreateVisiblePosition(start); |
109 const VisiblePosition& end_of_paragraph_to_move = | 109 const VisiblePosition& end_of_paragraph_to_move = |
110 should_keep_selected_list | 110 should_keep_selected_list |
111 ? CreateVisiblePosition(end) | 111 ? CreateVisiblePosition(end) |
112 : VisiblePosition::AfterNode(selected_list_item->lastChild()); | 112 : VisiblePosition::AfterNode(*selected_list_item->lastChild()); |
113 | 113 |
114 // The insertion of |newList| may change the computed style of other | 114 // The insertion of |newList| may change the computed style of other |
115 // elements, resulting in failure in visible canonicalization. | 115 // elements, resulting in failure in visible canonicalization. |
116 if (start_of_paragraph_to_move.IsNull() || | 116 if (start_of_paragraph_to_move.IsNull() || |
117 end_of_paragraph_to_move.IsNull()) { | 117 end_of_paragraph_to_move.IsNull()) { |
118 editing_state->Abort(); | 118 editing_state->Abort(); |
119 return false; | 119 return false; |
120 } | 120 } |
121 | 121 |
122 MoveParagraphWithClones(start_of_paragraph_to_move, end_of_paragraph_to_move, | 122 MoveParagraphWithClones(start_of_paragraph_to_move, end_of_paragraph_to_move, |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 else | 420 else |
421 IndentIntoBlockquote(start, end, blockquote_for_next_indent, editing_state); | 421 IndentIntoBlockquote(start, end, blockquote_for_next_indent, editing_state); |
422 } | 422 } |
423 | 423 |
424 InputEvent::InputType IndentOutdentCommand::GetInputType() const { | 424 InputEvent::InputType IndentOutdentCommand::GetInputType() const { |
425 return type_of_action_ == kIndent ? InputEvent::InputType::kFormatIndent | 425 return type_of_action_ == kIndent ? InputEvent::InputType::kFormatIndent |
426 : InputEvent::InputType::kFormatOutdent; | 426 : InputEvent::InputType::kFormatOutdent; |
427 } | 427 } |
428 | 428 |
429 } // namespace blink | 429 } // namespace blink |
OLD | NEW |