| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All |
| 3 * rights reserved. | 3 * rights reserved. |
| 4 * Copyright (C) 2005 Alexey Proskuryakov. | 4 * Copyright (C) 2005 Alexey Proskuryakov. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 Node* start_container = range.StartPosition().ComputeContainerNode(); | 177 Node* start_container = range.StartPosition().ComputeContainerNode(); |
| 178 if (start_container != &scope && !start_container->IsDescendantOf(&scope)) | 178 if (start_container != &scope && !start_container->IsDescendantOf(&scope)) |
| 179 return PlainTextRange(); | 179 return PlainTextRange(); |
| 180 Node* end_container = range.EndPosition().ComputeContainerNode(); | 180 Node* end_container = range.EndPosition().ComputeContainerNode(); |
| 181 if (end_container != scope && !end_container->IsDescendantOf(&scope)) | 181 if (end_container != scope && !end_container->IsDescendantOf(&scope)) |
| 182 return PlainTextRange(); | 182 return PlainTextRange(); |
| 183 | 183 |
| 184 DocumentLifecycle::DisallowTransitionScope disallow_transition( | 184 DocumentLifecycle::DisallowTransitionScope disallow_transition( |
| 185 scope.GetDocument().Lifecycle()); | 185 scope.GetDocument().Lifecycle()); |
| 186 | 186 |
| 187 size_t start = TextIterator::RangeLength( | 187 size_t start = |
| 188 Position(&const_cast<ContainerNode&>(scope), 0), range.StartPosition()); | 188 TextIterator::RangeLength(Position(scope, 0), range.StartPosition()); |
| 189 size_t end = TextIterator::RangeLength( | 189 size_t end = |
| 190 Position(&const_cast<ContainerNode&>(scope), 0), range.EndPosition()); | 190 TextIterator::RangeLength(Position(scope, 0), range.EndPosition()); |
| 191 | 191 |
| 192 return PlainTextRange(start, end); | 192 return PlainTextRange(start, end); |
| 193 } | 193 } |
| 194 | 194 |
| 195 PlainTextRange PlainTextRange::Create(const ContainerNode& scope, | 195 PlainTextRange PlainTextRange::Create(const ContainerNode& scope, |
| 196 const Range& range) { | 196 const Range& range) { |
| 197 return Create(scope, EphemeralRange(&range)); | 197 return Create(scope, EphemeralRange(&range)); |
| 198 } | 198 } |
| 199 | 199 |
| 200 } // namespace blink | 200 } // namespace blink |
| OLD | NEW |