| 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 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 835 selectStartTarget = root.get(); | 835 selectStartTarget = root.get(); |
| 836 } else { | 836 } else { |
| 837 root = selection().nonBoundaryShadowTreeRootNode(); | 837 root = selection().nonBoundaryShadowTreeRootNode(); |
| 838 if (root) { | 838 if (root) { |
| 839 selectStartTarget = root->shadowHost(); | 839 selectStartTarget = root->shadowHost(); |
| 840 } else { | 840 } else { |
| 841 root = document->documentElement(); | 841 root = document->documentElement(); |
| 842 selectStartTarget = document->body(); | 842 selectStartTarget = document->body(); |
| 843 } | 843 } |
| 844 } | 844 } |
| 845 if (!root) | 845 if (!root || editingIgnoresContent(root)) |
| 846 return; | 846 return; |
| 847 | 847 |
| 848 if (selectStartTarget && !selectStartTarget->dispatchEvent(Event::createCanc
elableBubble(EventTypeNames::selectstart))) | 848 if (selectStartTarget && !selectStartTarget->dispatchEvent(Event::createCanc
elableBubble(EventTypeNames::selectstart))) |
| 849 return; | 849 return; |
| 850 | 850 |
| 851 VisibleSelection newSelection(VisibleSelection::selectionFromContentsOfNode(
root.get())); | 851 VisibleSelection newSelection(VisibleSelection::selectionFromContentsOfNode(
root.get())); |
| 852 setSelection(newSelection); | 852 setSelection(newSelection); |
| 853 selectFrameElementInParentIfFullySelected(); | 853 selectFrameElementInParentIfFullySelected(); |
| 854 notifyLayoutObjectOfSelectionChange(UserTriggered); | 854 notifyLayoutObjectOfSelectionChange(UserTriggered); |
| 855 } | 855 } |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1411 | 1411 |
| 1412 void showTree(const blink::FrameSelection* sel) | 1412 void showTree(const blink::FrameSelection* sel) |
| 1413 { | 1413 { |
| 1414 if (sel) | 1414 if (sel) |
| 1415 sel->showTreeForThis(); | 1415 sel->showTreeForThis(); |
| 1416 else | 1416 else |
| 1417 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); | 1417 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); |
| 1418 } | 1418 } |
| 1419 | 1419 |
| 1420 #endif | 1420 #endif |
| OLD | NEW |