| 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 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 842 if (root) { | 842 if (root) { |
| 843 selectStartTarget = root->shadowHost(); | 843 selectStartTarget = root->shadowHost(); |
| 844 } else { | 844 } else { |
| 845 root = document->documentElement(); | 845 root = document->documentElement(); |
| 846 selectStartTarget = document->body(); | 846 selectStartTarget = document->body(); |
| 847 } | 847 } |
| 848 } | 848 } |
| 849 if (!root || editingIgnoresContent(root.get())) | 849 if (!root || editingIgnoresContent(root.get())) |
| 850 return; | 850 return; |
| 851 | 851 |
| 852 if (selectStartTarget && !selectStartTarget->dispatchEvent(Event::createCanc
elableBubble(EventTypeNames::selectstart))) | 852 if (selectStartTarget && selectStartTarget->dispatchEvent(Event::createCance
lableBubble(EventTypeNames::selectstart)) != DispatchEventResult::NotCanceled) |
| 853 return; | 853 return; |
| 854 | 854 |
| 855 VisibleSelection newSelection(VisibleSelection::selectionFromContentsOfNode(
root.get())); | 855 VisibleSelection newSelection(VisibleSelection::selectionFromContentsOfNode(
root.get())); |
| 856 setSelection(newSelection); | 856 setSelection(newSelection); |
| 857 selectFrameElementInParentIfFullySelected(); | 857 selectFrameElementInParentIfFullySelected(); |
| 858 notifyLayoutObjectOfSelectionChange(UserTriggered); | 858 notifyLayoutObjectOfSelectionChange(UserTriggered); |
| 859 } | 859 } |
| 860 | 860 |
| 861 bool FrameSelection::setSelectedRange(Range* range, TextAffinity affinity, Selec
tionDirectionalMode directional, SetSelectionOptions options) | 861 bool FrameSelection::setSelectedRange(Range* range, TextAffinity affinity, Selec
tionDirectionalMode directional, SetSelectionOptions options) |
| 862 { | 862 { |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1401 | 1401 |
| 1402 void showTree(const blink::FrameSelection* sel) | 1402 void showTree(const blink::FrameSelection* sel) |
| 1403 { | 1403 { |
| 1404 if (sel) | 1404 if (sel) |
| 1405 sel->showTreeForThis(); | 1405 sel->showTreeForThis(); |
| 1406 else | 1406 else |
| 1407 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); | 1407 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); |
| 1408 } | 1408 } |
| 1409 | 1409 |
| 1410 #endif | 1410 #endif |
| OLD | NEW |