| 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 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 923 if (selectStartTarget) { | 923 if (selectStartTarget) { |
| 924 const Document& expectedDocument = document(); | 924 const Document& expectedDocument = document(); |
| 925 if (selectStartTarget->dispatchEvent(Event::createCancelableBubble( | 925 if (selectStartTarget->dispatchEvent(Event::createCancelableBubble( |
| 926 EventTypeNames::selectstart)) != DispatchEventResult::NotCanceled) | 926 EventTypeNames::selectstart)) != DispatchEventResult::NotCanceled) |
| 927 return; | 927 return; |
| 928 // |root| may be detached due to selectstart event. | 928 // |root| may be detached due to selectstart event. |
| 929 if (!root->isConnected() || expectedDocument != root->document()) | 929 if (!root->isConnected() || expectedDocument != root->document()) |
| 930 return; | 930 return; |
| 931 } | 931 } |
| 932 | 932 |
| 933 setSelection(SelectionInDOMTree::Builder().selectAllChildren(*root).build()); | 933 setSelection(SelectionInDOMTree::Builder() |
| 934 .selectAllChildren(*root) |
| 935 .setIsHandleVisible(isHandleVisible()) |
| 936 .build()); |
| 934 selectFrameElementInParentIfFullySelected(); | 937 selectFrameElementInParentIfFullySelected(); |
| 935 notifyLayoutObjectOfSelectionChange(UserTriggered); | 938 notifyLayoutObjectOfSelectionChange(UserTriggered); |
| 936 } | 939 } |
| 937 | 940 |
| 938 bool FrameSelection::setSelectedRange(const EphemeralRange& range, | 941 bool FrameSelection::setSelectedRange(const EphemeralRange& range, |
| 939 TextAffinity affinity, | 942 TextAffinity affinity, |
| 940 SelectionDirectionalMode directional, | 943 SelectionDirectionalMode directional, |
| 941 SetSelectionOptions options) { | 944 SetSelectionOptions options) { |
| 942 if (range.isNull()) | 945 if (range.isNull()) |
| 943 return false; | 946 return false; |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1440 } | 1443 } |
| 1441 | 1444 |
| 1442 void showTree(const blink::FrameSelection* sel) { | 1445 void showTree(const blink::FrameSelection* sel) { |
| 1443 if (sel) | 1446 if (sel) |
| 1444 sel->showTreeForThis(); | 1447 sel->showTreeForThis(); |
| 1445 else | 1448 else |
| 1446 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; | 1449 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; |
| 1447 } | 1450 } |
| 1448 | 1451 |
| 1449 #endif | 1452 #endif |
| OLD | NEW |