| 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 1389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1400 | 1400 |
| 1401 if (selectStartTarget && !selectStartTarget->dispatchEvent(Event::createCanc
elableBubble(EventTypeNames::selectstart))) | 1401 if (selectStartTarget && !selectStartTarget->dispatchEvent(Event::createCanc
elableBubble(EventTypeNames::selectstart))) |
| 1402 return; | 1402 return; |
| 1403 | 1403 |
| 1404 VisibleSelection newSelection(VisibleSelection::selectionFromContentsOfNode(
root.get())); | 1404 VisibleSelection newSelection(VisibleSelection::selectionFromContentsOfNode(
root.get())); |
| 1405 setSelection(newSelection); | 1405 setSelection(newSelection); |
| 1406 selectFrameElementInParentIfFullySelected(); | 1406 selectFrameElementInParentIfFullySelected(); |
| 1407 notifyRendererOfSelectionChange(UserTriggered); | 1407 notifyRendererOfSelectionChange(UserTriggered); |
| 1408 } | 1408 } |
| 1409 | 1409 |
| 1410 bool FrameSelection::setSelectedRange(Range* range, EAffinity affinity, bool isD
irectional, SetSelectionOptions options) | 1410 bool FrameSelection::setSelectedRange(Range* range, EAffinity affinity, Directoi
nalOption directional, SetSelectionOptions options) |
| 1411 { | 1411 { |
| 1412 if (!range || !range->startContainer() || !range->endContainer()) | 1412 if (!range || !range->startContainer() || !range->endContainer()) |
| 1413 return false; | 1413 return false; |
| 1414 ASSERT(range->startContainer()->document() == range->endContainer()->documen
t()); | 1414 ASSERT(range->startContainer()->document() == range->endContainer()->documen
t()); |
| 1415 | 1415 |
| 1416 // Non-collapsed ranges are not allowed to start at the end of a line that i
s wrapped, | 1416 // Non-collapsed ranges are not allowed to start at the end of a line that i
s wrapped, |
| 1417 // they start at the beginning of the next line instead | 1417 // they start at the beginning of the next line instead |
| 1418 m_logicalRange = nullptr; | 1418 m_logicalRange = nullptr; |
| 1419 stopObservingVisibleSelectionChangeIfNecessary(); | 1419 stopObservingVisibleSelectionChangeIfNecessary(); |
| 1420 | 1420 |
| 1421 VisibleSelection newSelection(range, affinity, isDirectional); | 1421 VisibleSelection newSelection(range, affinity, directional == Directional); |
| 1422 setSelection(newSelection, options); | 1422 setSelection(newSelection, options); |
| 1423 | 1423 |
| 1424 m_logicalRange = range->cloneRange(); | 1424 m_logicalRange = range->cloneRange(); |
| 1425 startObservingVisibleSelectionChange(); | 1425 startObservingVisibleSelectionChange(); |
| 1426 | 1426 |
| 1427 return true; | 1427 return true; |
| 1428 } | 1428 } |
| 1429 | 1429 |
| 1430 PassRefPtrWillBeRawPtr<Range> FrameSelection::firstRange() const | 1430 PassRefPtrWillBeRawPtr<Range> FrameSelection::firstRange() const |
| 1431 { | 1431 { |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1886 sel.showTreeForThis(); | 1886 sel.showTreeForThis(); |
| 1887 } | 1887 } |
| 1888 | 1888 |
| 1889 void showTree(const WebCore::FrameSelection* sel) | 1889 void showTree(const WebCore::FrameSelection* sel) |
| 1890 { | 1890 { |
| 1891 if (sel) | 1891 if (sel) |
| 1892 sel->showTreeForThis(); | 1892 sel->showTreeForThis(); |
| 1893 } | 1893 } |
| 1894 | 1894 |
| 1895 #endif | 1895 #endif |
| OLD | NEW |