| 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 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 // --------- | 542 // --------- |
| 543 | 543 |
| 544 VisiblePosition StartOfBlock(const VisiblePosition& visible_position, | 544 VisiblePosition StartOfBlock(const VisiblePosition& visible_position, |
| 545 EditingBoundaryCrossingRule rule) { | 545 EditingBoundaryCrossingRule rule) { |
| 546 DCHECK(visible_position.IsValid()) << visible_position; | 546 DCHECK(visible_position.IsValid()) << visible_position; |
| 547 Position position = visible_position.DeepEquivalent(); | 547 Position position = visible_position.DeepEquivalent(); |
| 548 Element* start_block = | 548 Element* start_block = |
| 549 position.ComputeContainerNode() | 549 position.ComputeContainerNode() |
| 550 ? EnclosingBlock(position.ComputeContainerNode(), rule) | 550 ? EnclosingBlock(position.ComputeContainerNode(), rule) |
| 551 : 0; | 551 : 0; |
| 552 return start_block ? VisiblePosition::FirstPositionInNode(start_block) | 552 return start_block ? VisiblePosition::FirstPositionInNode(*start_block) |
| 553 : VisiblePosition(); | 553 : VisiblePosition(); |
| 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) |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 636 // --------- | 636 // --------- |
| 637 | 637 |
| 638 VisiblePosition StartOfEditableContent( | 638 VisiblePosition StartOfEditableContent( |
| 639 const VisiblePosition& visible_position) { | 639 const VisiblePosition& visible_position) { |
| 640 DCHECK(visible_position.IsValid()) << visible_position; | 640 DCHECK(visible_position.IsValid()) << visible_position; |
| 641 ContainerNode* highest_root = | 641 ContainerNode* highest_root = |
| 642 HighestEditableRoot(visible_position.DeepEquivalent()); | 642 HighestEditableRoot(visible_position.DeepEquivalent()); |
| 643 if (!highest_root) | 643 if (!highest_root) |
| 644 return VisiblePosition(); | 644 return VisiblePosition(); |
| 645 | 645 |
| 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); |
| (...skipping 1418 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 |