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 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
825 selectElement->selectAll(); | 825 selectElement->selectAll(); |
826 return; | 826 return; |
827 } | 827 } |
828 } | 828 } |
829 | 829 |
830 Node* root = nullptr; | 830 Node* root = nullptr; |
831 Node* selectStartTarget = nullptr; | 831 Node* selectStartTarget = nullptr; |
832 if (isContentEditable()) { | 832 if (isContentEditable()) { |
833 root = highestEditableRoot(selection().start()); | 833 root = highestEditableRoot(selection().start()); |
834 if (Node* shadowRoot = nonBoundaryShadowTreeRootNode(selection().start()
)) | 834 if (Node* shadowRoot = nonBoundaryShadowTreeRootNode(selection().start()
)) |
835 selectStartTarget = shadowRoot->shadowHost(); | 835 selectStartTarget = shadowRoot->ownerShadowHost(); |
836 else | 836 else |
837 selectStartTarget = root; | 837 selectStartTarget = root; |
838 } else { | 838 } else { |
839 root = nonBoundaryShadowTreeRootNode(selection().start()); | 839 root = nonBoundaryShadowTreeRootNode(selection().start()); |
840 if (root) { | 840 if (root) { |
841 selectStartTarget = root->shadowHost(); | 841 selectStartTarget = root->ownerShadowHost(); |
842 } else { | 842 } else { |
843 root = document().documentElement(); | 843 root = document().documentElement(); |
844 selectStartTarget = document().body(); | 844 selectStartTarget = document().body(); |
845 } | 845 } |
846 } | 846 } |
847 if (!root || editingIgnoresContent(root)) | 847 if (!root || editingIgnoresContent(root)) |
848 return; | 848 return; |
849 | 849 |
850 if (selectStartTarget) { | 850 if (selectStartTarget) { |
851 const Document& expectedDocument = document(); | 851 const Document& expectedDocument = document(); |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1379 | 1379 |
1380 void showTree(const blink::FrameSelection* sel) | 1380 void showTree(const blink::FrameSelection* sel) |
1381 { | 1381 { |
1382 if (sel) | 1382 if (sel) |
1383 sel->showTreeForThis(); | 1383 sel->showTreeForThis(); |
1384 else | 1384 else |
1385 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; | 1385 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; |
1386 } | 1386 } |
1387 | 1387 |
1388 #endif | 1388 #endif |
OLD | NEW |