| 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 // On a treasure map, <b>X</b> marks the spot. | 175 // On a treasure map, <b>X</b> marks the spot. |
| 176 // ^ selected | 176 // ^ selected |
| 177 // | 177 // |
| 178 DCHECK(isRange()); | 178 DCHECK(isRange()); |
| 179 return normalizeRange(EphemeralRangeTemplate<Strategy>(m_start, m_end)); | 179 return normalizeRange(EphemeralRangeTemplate<Strategy>(m_start, m_end)); |
| 180 } | 180 } |
| 181 | 181 |
| 182 template <typename Strategy> | 182 template <typename Strategy> |
| 183 static EphemeralRangeTemplate<Strategy> makeSearchRange( | 183 static EphemeralRangeTemplate<Strategy> makeSearchRange( |
| 184 const PositionTemplate<Strategy>& pos) { | 184 const PositionTemplate<Strategy>& pos) { |
| 185 Node* node = pos.anchorNode(); | 185 Node* node = pos.computeContainerNode(); |
| 186 if (!node) | 186 if (!node) |
| 187 return EphemeralRangeTemplate<Strategy>(); | 187 return EphemeralRangeTemplate<Strategy>(); |
| 188 Document& document = node->document(); | 188 Document& document = node->document(); |
| 189 if (!document.documentElement()) | 189 if (!document.documentElement()) |
| 190 return EphemeralRangeTemplate<Strategy>(); | 190 return EphemeralRangeTemplate<Strategy>(); |
| 191 Element* boundary = enclosingBlockFlowElement(*node); | 191 Element* boundary = enclosingBlockFlowElement(*node); |
| 192 if (!boundary) | 192 if (!boundary) |
| 193 return EphemeralRangeTemplate<Strategy>(); | 193 return EphemeralRangeTemplate<Strategy>(); |
| 194 | 194 |
| 195 return EphemeralRangeTemplate<Strategy>( | 195 return EphemeralRangeTemplate<Strategy>( |
| (...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 800 | 800 |
| 801 void showTree(const blink::VisibleSelectionInFlatTree& sel) { | 801 void showTree(const blink::VisibleSelectionInFlatTree& sel) { |
| 802 sel.showTreeForThis(); | 802 sel.showTreeForThis(); |
| 803 } | 803 } |
| 804 | 804 |
| 805 void showTree(const blink::VisibleSelectionInFlatTree* sel) { | 805 void showTree(const blink::VisibleSelectionInFlatTree* sel) { |
| 806 if (sel) | 806 if (sel) |
| 807 sel->showTreeForThis(); | 807 sel->showTreeForThis(); |
| 808 } | 808 } |
| 809 #endif | 809 #endif |
| OLD | NEW |