| 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 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1407 { | 1407 { |
| 1408 if (!range || !range->startContainer() || !range->endContainer()) | 1408 if (!range || !range->startContainer() || !range->endContainer()) |
| 1409 return false; | 1409 return false; |
| 1410 ASSERT(range->startContainer()->document() == range->endContainer()->documen
t()); | 1410 ASSERT(range->startContainer()->document() == range->endContainer()->documen
t()); |
| 1411 | 1411 |
| 1412 // Non-collapsed ranges are not allowed to start at the end of a line that i
s wrapped, | 1412 // Non-collapsed ranges are not allowed to start at the end of a line that i
s wrapped, |
| 1413 // they start at the beginning of the next line instead | 1413 // they start at the beginning of the next line instead |
| 1414 m_logicalRange = nullptr; | 1414 m_logicalRange = nullptr; |
| 1415 stopObservingVisibleSelectionChangeIfNecessary(); | 1415 stopObservingVisibleSelectionChangeIfNecessary(); |
| 1416 | 1416 |
| 1417 VisibleSelection newSelection(range, affinity); | 1417 VisibleSelection newSelection(range, affinity, range->collapsed() ? m_select
ion.isDirectional() : true); |
| 1418 setSelection(newSelection, options); | 1418 setSelection(newSelection, options); |
| 1419 | 1419 |
| 1420 m_logicalRange = range->cloneRange(); | 1420 m_logicalRange = range->cloneRange(); |
| 1421 startObservingVisibleSelectionChange(); | 1421 startObservingVisibleSelectionChange(); |
| 1422 | 1422 |
| 1423 return true; | 1423 return true; |
| 1424 } | 1424 } |
| 1425 | 1425 |
| 1426 PassRefPtrWillBeRawPtr<Range> FrameSelection::firstRange() const | 1426 PassRefPtrWillBeRawPtr<Range> FrameSelection::firstRange() const |
| 1427 { | 1427 { |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1882 sel.showTreeForThis(); | 1882 sel.showTreeForThis(); |
| 1883 } | 1883 } |
| 1884 | 1884 |
| 1885 void showTree(const WebCore::FrameSelection* sel) | 1885 void showTree(const WebCore::FrameSelection* sel) |
| 1886 { | 1886 { |
| 1887 if (sel) | 1887 if (sel) |
| 1888 sel->showTreeForThis(); | 1888 sel->showTreeForThis(); |
| 1889 } | 1889 } |
| 1890 | 1890 |
| 1891 #endif | 1891 #endif |
| OLD | NEW |