OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2010 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 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 } | 520 } |
521 if (editing_state->IsAborted()) | 521 if (editing_state->IsAborted()) |
522 return; | 522 return; |
523 | 523 |
524 GetDocument().UpdateStyleAndLayoutIgnorePendingStylesheets(); | 524 GetDocument().UpdateStyleAndLayoutIgnorePendingStylesheets(); |
525 | 525 |
526 // Make |start| and |end| valid again. | 526 // Make |start| and |end| valid again. |
527 start = CreateVisiblePosition(start_position); | 527 start = CreateVisiblePosition(start_position); |
528 end = CreateVisiblePosition(end_position); | 528 end = CreateVisiblePosition(end_position); |
529 | 529 |
530 VisiblePosition insertion_point = VisiblePosition::BeforeNode(placeholder); | 530 VisiblePosition insertion_point = VisiblePosition::BeforeNode(*placeholder); |
531 MoveParagraphs(start, end, insertion_point, editing_state, kPreserveSelection, | 531 MoveParagraphs(start, end, insertion_point, editing_state, kPreserveSelection, |
532 kPreserveStyle, list_child_node); | 532 kPreserveStyle, list_child_node); |
533 } | 533 } |
534 | 534 |
535 static HTMLElement* AdjacentEnclosingList(const VisiblePosition& pos, | 535 static HTMLElement* AdjacentEnclosingList(const VisiblePosition& pos, |
536 const VisiblePosition& adjacent_pos, | 536 const VisiblePosition& adjacent_pos, |
537 const HTMLQualifiedName& list_tag) { | 537 const HTMLQualifiedName& list_tag) { |
538 HTMLElement* list_element = | 538 HTMLElement* list_element = |
539 OutermostEnclosingList(adjacent_pos.DeepEquivalent().AnchorNode()); | 539 OutermostEnclosingList(adjacent_pos.DeepEquivalent().AnchorNode()); |
540 | 540 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 return; | 673 return; |
674 // Inserting list element and list item list may change start of pargraph | 674 // Inserting list element and list item list may change start of pargraph |
675 // to move. We calculate start of paragraph again. | 675 // to move. We calculate start of paragraph again. |
676 GetDocument().UpdateStyleAndLayoutIgnorePendingStylesheets(); | 676 GetDocument().UpdateStyleAndLayoutIgnorePendingStylesheets(); |
677 const VisiblePosition& valid_pos = | 677 const VisiblePosition& valid_pos = |
678 CreateVisiblePosition(pos.ToPositionWithAffinity()); | 678 CreateVisiblePosition(pos.ToPositionWithAffinity()); |
679 const VisiblePosition& start = | 679 const VisiblePosition& start = |
680 StartOfParagraph(valid_pos, kCanSkipOverEditingBoundary); | 680 StartOfParagraph(valid_pos, kCanSkipOverEditingBoundary); |
681 const VisiblePosition& end = | 681 const VisiblePosition& end = |
682 EndOfParagraph(valid_pos, kCanSkipOverEditingBoundary); | 682 EndOfParagraph(valid_pos, kCanSkipOverEditingBoundary); |
683 MoveParagraph(start, end, VisiblePosition::BeforeNode(placeholder), | 683 MoveParagraph(start, end, VisiblePosition::BeforeNode(*placeholder), |
684 editing_state, kPreserveSelection); | 684 editing_state, kPreserveSelection); |
685 } | 685 } |
686 | 686 |
687 DEFINE_TRACE(InsertListCommand) { | 687 DEFINE_TRACE(InsertListCommand) { |
688 CompositeEditCommand::Trace(visitor); | 688 CompositeEditCommand::Trace(visitor); |
689 } | 689 } |
690 | 690 |
691 } // namespace blink | 691 } // namespace blink |
OLD | NEW |