| 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 | 243 PassRefPtrWillBeRawPtr<Range> VisibleSelection::toNormalizedRange() const |
| 244 { | 244 { |
| 245 const EphemeralRange range = toNormalizedEphemeralRange(); | 245 return createRange(toNormalizedEphemeralRange()); |
| 246 if (range.isNull()) | |
| 247 return nullptr; | |
| 248 return Range::create(range.document(), range.startPosition(), range.endPosit
ion()); | |
| 249 } | 246 } |
| 250 | 247 |
| 251 template <typename Strategy> | 248 template <typename Strategy> |
| 252 static EphemeralRangeTemplate<Strategy> normalizeRangeAlgorithm(const EphemeralR
angeTemplate<Strategy>& range) | 249 static EphemeralRangeTemplate<Strategy> normalizeRangeAlgorithm(const EphemeralR
angeTemplate<Strategy>& range) |
| 253 { | 250 { |
| 254 ASSERT(range.isNotNull()); | 251 ASSERT(range.isNotNull()); |
| 255 range.document().updateLayoutIgnorePendingStylesheets(); | 252 range.document().updateLayoutIgnorePendingStylesheets(); |
| 256 | 253 |
| 257 // TODO(yosin) We should not call |parentAnchoredEquivalent()|, it is | 254 // TODO(yosin) We should not call |parentAnchoredEquivalent()|, it is |
| 258 // redundant. | 255 // redundant. |
| (...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1252 sel.showTreeForThis(); | 1249 sel.showTreeForThis(); |
| 1253 } | 1250 } |
| 1254 | 1251 |
| 1255 void showTree(const blink::VisibleSelection* sel) | 1252 void showTree(const blink::VisibleSelection* sel) |
| 1256 { | 1253 { |
| 1257 if (sel) | 1254 if (sel) |
| 1258 sel->showTreeForThis(); | 1255 sel->showTreeForThis(); |
| 1259 } | 1256 } |
| 1260 | 1257 |
| 1261 #endif | 1258 #endif |
| OLD | NEW |