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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 m_affinity = other.m_affinity; | 129 m_affinity = other.m_affinity; |
130 m_changeObserver = 0; | 130 m_changeObserver = 0; |
131 m_selectionType = other.m_selectionType; | 131 m_selectionType = other.m_selectionType; |
132 m_baseIsFirst = other.m_baseIsFirst; | 132 m_baseIsFirst = other.m_baseIsFirst; |
133 m_isDirectional = other.m_isDirectional; | 133 m_isDirectional = other.m_isDirectional; |
134 return *this; | 134 return *this; |
135 } | 135 } |
136 | 136 |
137 VisibleSelection::~VisibleSelection() | 137 VisibleSelection::~VisibleSelection() |
138 { | 138 { |
| 139 #if !ENABLE(OILPAN) |
139 didChange(); | 140 didChange(); |
| 141 #endif |
140 } | 142 } |
141 | 143 |
142 VisibleSelection VisibleSelection::selectionFromContentsOfNode(Node* node) | 144 VisibleSelection VisibleSelection::selectionFromContentsOfNode(Node* node) |
143 { | 145 { |
144 ASSERT(!editingIgnoresContent(node)); | 146 ASSERT(!editingIgnoresContent(node)); |
145 return VisibleSelection(firstPositionInNode(node), lastPositionInNode(node),
DOWNSTREAM); | 147 return VisibleSelection(firstPositionInNode(node), lastPositionInNode(node),
DOWNSTREAM); |
146 } | 148 } |
147 | 149 |
148 void VisibleSelection::setBase(const Position& position) | 150 void VisibleSelection::setBase(const Position& position) |
149 { | 151 { |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
753 ASSERT(m_changeObserver); | 755 ASSERT(m_changeObserver); |
754 m_changeObserver = 0; | 756 m_changeObserver = 0; |
755 } | 757 } |
756 | 758 |
757 void VisibleSelection::didChange() | 759 void VisibleSelection::didChange() |
758 { | 760 { |
759 if (m_changeObserver) | 761 if (m_changeObserver) |
760 m_changeObserver->didChangeVisibleSelection(); | 762 m_changeObserver->didChangeVisibleSelection(); |
761 } | 763 } |
762 | 764 |
| 765 void VisibleSelection::trace(Visitor* visitor) |
| 766 { |
| 767 visitor->trace(m_base); |
| 768 visitor->trace(m_extent); |
| 769 visitor->trace(m_start); |
| 770 visitor->trace(m_end); |
| 771 } |
| 772 |
763 #ifndef NDEBUG | 773 #ifndef NDEBUG |
764 | 774 |
765 void VisibleSelection::debugPosition() const | 775 void VisibleSelection::debugPosition() const |
766 { | 776 { |
767 fprintf(stderr, "VisibleSelection ===============\n"); | 777 fprintf(stderr, "VisibleSelection ===============\n"); |
768 | 778 |
769 if (!m_start.anchorNode()) | 779 if (!m_start.anchorNode()) |
770 fputs("pos: null", stderr); | 780 fputs("pos: null", stderr); |
771 else if (m_start == m_end) { | 781 else if (m_start == m_end) { |
772 fprintf(stderr, "pos: %s ", m_start.anchorNode()->nodeName().utf8().da
ta()); | 782 fprintf(stderr, "pos: %s ", m_start.anchorNode()->nodeName().utf8().da
ta()); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
824 sel.showTreeForThis(); | 834 sel.showTreeForThis(); |
825 } | 835 } |
826 | 836 |
827 void showTree(const WebCore::VisibleSelection* sel) | 837 void showTree(const WebCore::VisibleSelection* sel) |
828 { | 838 { |
829 if (sel) | 839 if (sel) |
830 sel->showTreeForThis(); | 840 sel->showTreeForThis(); |
831 } | 841 } |
832 | 842 |
833 #endif | 843 #endif |
OLD | NEW |