OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights |
3 * reserved. | 3 * 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 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 } | 554 } |
555 | 555 |
556 VisiblePosition EndOfBlock(const VisiblePosition& visible_position, | 556 VisiblePosition EndOfBlock(const VisiblePosition& visible_position, |
557 EditingBoundaryCrossingRule rule) { | 557 EditingBoundaryCrossingRule rule) { |
558 DCHECK(visible_position.IsValid()) << visible_position; | 558 DCHECK(visible_position.IsValid()) << visible_position; |
559 Position position = visible_position.DeepEquivalent(); | 559 Position position = visible_position.DeepEquivalent(); |
560 Element* end_block = | 560 Element* end_block = |
561 position.ComputeContainerNode() | 561 position.ComputeContainerNode() |
562 ? EnclosingBlock(position.ComputeContainerNode(), rule) | 562 ? EnclosingBlock(position.ComputeContainerNode(), rule) |
563 : 0; | 563 : 0; |
564 return end_block ? VisiblePosition::LastPositionInNode(end_block) | 564 return end_block ? VisiblePosition::LastPositionInNode(*end_block) |
565 : VisiblePosition(); | 565 : VisiblePosition(); |
566 } | 566 } |
567 | 567 |
568 bool IsStartOfBlock(const VisiblePosition& pos) { | 568 bool IsStartOfBlock(const VisiblePosition& pos) { |
569 DCHECK(pos.IsValid()) << pos; | 569 DCHECK(pos.IsValid()) << pos; |
570 return pos.IsNotNull() && | 570 return pos.IsNotNull() && |
571 pos.DeepEquivalent() == | 571 pos.DeepEquivalent() == |
572 StartOfBlock(pos, kCanCrossEditingBoundary).DeepEquivalent(); | 572 StartOfBlock(pos, kCanCrossEditingBoundary).DeepEquivalent(); |
573 } | 573 } |
574 | 574 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 return VisiblePosition::FirstPositionInNode(*highest_root); | 646 return VisiblePosition::FirstPositionInNode(*highest_root); |
647 } | 647 } |
648 | 648 |
649 VisiblePosition EndOfEditableContent(const VisiblePosition& visible_position) { | 649 VisiblePosition EndOfEditableContent(const VisiblePosition& visible_position) { |
650 DCHECK(visible_position.IsValid()) << visible_position; | 650 DCHECK(visible_position.IsValid()) << visible_position; |
651 ContainerNode* highest_root = | 651 ContainerNode* highest_root = |
652 HighestEditableRoot(visible_position.DeepEquivalent()); | 652 HighestEditableRoot(visible_position.DeepEquivalent()); |
653 if (!highest_root) | 653 if (!highest_root) |
654 return VisiblePosition(); | 654 return VisiblePosition(); |
655 | 655 |
656 return VisiblePosition::LastPositionInNode(highest_root); | 656 return VisiblePosition::LastPositionInNode(*highest_root); |
657 } | 657 } |
658 | 658 |
659 bool IsEndOfEditableOrNonEditableContent(const VisiblePosition& position) { | 659 bool IsEndOfEditableOrNonEditableContent(const VisiblePosition& position) { |
660 DCHECK(position.IsValid()) << position; | 660 DCHECK(position.IsValid()) << position; |
661 return position.IsNotNull() && NextPositionOf(position).IsNull(); | 661 return position.IsNotNull() && NextPositionOf(position).IsNull(); |
662 } | 662 } |
663 | 663 |
664 // TODO(yosin) We should rename |isEndOfEditableOrNonEditableContent()| what | 664 // TODO(yosin) We should rename |isEndOfEditableOrNonEditableContent()| what |
665 // this function does, e.g. |isLastVisiblePositionOrEndOfInnerEditor()|. | 665 // this function does, e.g. |isLastVisiblePositionOrEndOfInnerEditor()|. |
666 bool IsEndOfEditableOrNonEditableContent( | 666 bool IsEndOfEditableOrNonEditableContent( |
(...skipping 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2075 | 2075 |
2076 IntRect ComputeTextRect(const EphemeralRangeInFlatTree& range) { | 2076 IntRect ComputeTextRect(const EphemeralRangeInFlatTree& range) { |
2077 return EnclosingIntRect(ComputeTextRectTemplate(range)); | 2077 return EnclosingIntRect(ComputeTextRectTemplate(range)); |
2078 } | 2078 } |
2079 | 2079 |
2080 FloatRect ComputeTextFloatRect(const EphemeralRange& range) { | 2080 FloatRect ComputeTextFloatRect(const EphemeralRange& range) { |
2081 return ComputeTextRectTemplate(range); | 2081 return ComputeTextRectTemplate(range); |
2082 } | 2082 } |
2083 | 2083 |
2084 } // namespace blink | 2084 } // namespace blink |
OLD | NEW |