OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006 Apple Computer, 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 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 bool VisibleSelectionTemplate<Strategy>::isContentRichlyEditable() const { | 717 bool VisibleSelectionTemplate<Strategy>::isContentRichlyEditable() const { |
718 return isRichlyEditablePosition(toPositionInDOMTree(start())); | 718 return isRichlyEditablePosition(toPositionInDOMTree(start())); |
719 } | 719 } |
720 | 720 |
721 template <typename Strategy> | 721 template <typename Strategy> |
722 Element* VisibleSelectionTemplate<Strategy>::rootEditableElement() const { | 722 Element* VisibleSelectionTemplate<Strategy>::rootEditableElement() const { |
723 return rootEditableElementOf(start()); | 723 return rootEditableElementOf(start()); |
724 } | 724 } |
725 | 725 |
726 template <typename Strategy> | 726 template <typename Strategy> |
727 void VisibleSelectionTemplate<Strategy>::updateIfNeeded() { | |
728 Document* document = m_base.document(); | |
729 if (!document) | |
730 return; | |
731 DCHECK(!document->needsLayoutTreeUpdate()); | |
732 const bool hasTrailingWhitespace = m_hasTrailingWhitespace; | |
733 validate(m_granularity); | |
734 if (!hasTrailingWhitespace) | |
735 return; | |
736 appendTrailingWhitespace(); | |
737 } | |
738 | |
739 template <typename Strategy> | |
740 static bool equalSelectionsAlgorithm( | 727 static bool equalSelectionsAlgorithm( |
741 const VisibleSelectionTemplate<Strategy>& selection1, | 728 const VisibleSelectionTemplate<Strategy>& selection1, |
742 const VisibleSelectionTemplate<Strategy>& selection2) { | 729 const VisibleSelectionTemplate<Strategy>& selection2) { |
743 if (selection1.affinity() != selection2.affinity() || | 730 if (selection1.affinity() != selection2.affinity() || |
744 selection1.isDirectional() != selection2.isDirectional()) | 731 selection1.isDirectional() != selection2.isDirectional()) |
745 return false; | 732 return false; |
746 | 733 |
747 if (selection1.isNone()) | 734 if (selection1.isNone()) |
748 return selection2.isNone(); | 735 return selection2.isNone(); |
749 | 736 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 | 824 |
838 void showTree(const blink::VisibleSelectionInFlatTree& sel) { | 825 void showTree(const blink::VisibleSelectionInFlatTree& sel) { |
839 sel.showTreeForThis(); | 826 sel.showTreeForThis(); |
840 } | 827 } |
841 | 828 |
842 void showTree(const blink::VisibleSelectionInFlatTree* sel) { | 829 void showTree(const blink::VisibleSelectionInFlatTree* sel) { |
843 if (sel) | 830 if (sel) |
844 sel->showTreeForThis(); | 831 sel->showTreeForThis(); |
845 } | 832 } |
846 #endif | 833 #endif |
OLD | NEW |