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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 bool VisibleSelection::intersectsNode(Node* node) const | 233 bool VisibleSelection::intersectsNode(Node* node) const |
234 { | 234 { |
235 if (isNone()) | 235 if (isNone()) |
236 return false; | 236 return false; |
237 Position start = m_start.parentAnchoredEquivalent(); | 237 Position start = m_start.parentAnchoredEquivalent(); |
238 Position end = m_end.parentAnchoredEquivalent(); | 238 Position end = m_end.parentAnchoredEquivalent(); |
239 TrackExceptionState exceptionState; | 239 TrackExceptionState exceptionState; |
240 return Range::intersectsNode(node, start, end, exceptionState) && !exception
State.hadException(); | 240 return Range::intersectsNode(node, start, end, exceptionState) && !exception
State.hadException(); |
241 } | 241 } |
242 | 242 |
243 PassRefPtrWillBeRawPtr<Range> VisibleSelection::toNormalizedRange() const | |
244 { | |
245 return createRange(toNormalizedEphemeralRange()); | |
246 } | |
247 | |
248 template <typename Strategy> | 243 template <typename Strategy> |
249 static EphemeralRangeTemplate<Strategy> normalizeRangeAlgorithm(const EphemeralR
angeTemplate<Strategy>& range) | 244 static EphemeralRangeTemplate<Strategy> normalizeRangeAlgorithm(const EphemeralR
angeTemplate<Strategy>& range) |
250 { | 245 { |
251 ASSERT(range.isNotNull()); | 246 ASSERT(range.isNotNull()); |
252 range.document().updateLayoutIgnorePendingStylesheets(); | 247 range.document().updateLayoutIgnorePendingStylesheets(); |
253 | 248 |
254 // TODO(yosin) We should not call |parentAnchoredEquivalent()|, it is | 249 // TODO(yosin) We should not call |parentAnchoredEquivalent()|, it is |
255 // redundant. | 250 // redundant. |
256 const PositionAlgorithm<Strategy> normalizedStart = mostForwardCaretPosition
(range.startPosition()).parentAnchoredEquivalent(); | 251 const PositionAlgorithm<Strategy> normalizedStart = mostForwardCaretPosition
(range.startPosition()).parentAnchoredEquivalent(); |
257 const PositionAlgorithm<Strategy> normalizedEnd = mostBackwardCaretPosition(
range.endPosition()).parentAnchoredEquivalent(); | 252 const PositionAlgorithm<Strategy> normalizedEnd = mostBackwardCaretPosition(
range.endPosition()).parentAnchoredEquivalent(); |
(...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1249 sel.showTreeForThis(); | 1244 sel.showTreeForThis(); |
1250 } | 1245 } |
1251 | 1246 |
1252 void showTree(const blink::VisibleSelection* sel) | 1247 void showTree(const blink::VisibleSelection* sel) |
1253 { | 1248 { |
1254 if (sel) | 1249 if (sel) |
1255 sel->showTreeForThis(); | 1250 sel->showTreeForThis(); |
1256 } | 1251 } |
1257 | 1252 |
1258 #endif | 1253 #endif |
OLD | NEW |