| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple 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 1470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1481 return false; | 1481 return false; |
| 1482 | 1482 |
| 1483 // Non-collapsed ranges are not allowed to start at the end of a line that i
s wrapped, | 1483 // Non-collapsed ranges are not allowed to start at the end of a line that i
s wrapped, |
| 1484 // they start at the beginning of the next line instead | 1484 // they start at the beginning of the next line instead |
| 1485 m_logicalRange = nullptr; | 1485 m_logicalRange = nullptr; |
| 1486 stopObservingVisibleSelectionChangeIfNecessary(); | 1486 stopObservingVisibleSelectionChangeIfNecessary(); |
| 1487 | 1487 |
| 1488 // Since |FrameSeleciton::setSelection()| dispatches events and DOM tree | 1488 // Since |FrameSeleciton::setSelection()| dispatches events and DOM tree |
| 1489 // can be modified by event handlers, we should create |Range| object before | 1489 // can be modified by event handlers, we should create |Range| object before |
| 1490 // calling it. | 1490 // calling it. |
| 1491 m_logicalRange = Range::create(range.document(), range.startPosition(), rang
e.endPosition()); | 1491 m_logicalRange = createRange(range); |
| 1492 | 1492 |
| 1493 VisibleSelection newSelection(range.startPosition(), range.endPosition(), af
finity, directional == Directional); | 1493 VisibleSelection newSelection(range.startPosition(), range.endPosition(), af
finity, directional == Directional); |
| 1494 setSelection(newSelection, options); | 1494 setSelection(newSelection, options); |
| 1495 startObservingVisibleSelectionChange(); | 1495 startObservingVisibleSelectionChange(); |
| 1496 return true; | 1496 return true; |
| 1497 } | 1497 } |
| 1498 | 1498 |
| 1499 PassRefPtrWillBeRawPtr<Range> FrameSelection::firstRange() const | 1499 PassRefPtrWillBeRawPtr<Range> FrameSelection::firstRange() const |
| 1500 { | 1500 { |
| 1501 if (m_logicalRange) | 1501 if (m_logicalRange) |
| (...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2058 | 2058 |
| 2059 void showTree(const blink::FrameSelection* sel) | 2059 void showTree(const blink::FrameSelection* sel) |
| 2060 { | 2060 { |
| 2061 if (sel) | 2061 if (sel) |
| 2062 sel->showTreeForThis(); | 2062 sel->showTreeForThis(); |
| 2063 else | 2063 else |
| 2064 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); | 2064 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); |
| 2065 } | 2065 } |
| 2066 | 2066 |
| 2067 #endif | 2067 #endif |
| OLD | NEW |