Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: third_party/WebKit/Source/core/editing/FrameSelection.cpp

Issue 2860593002: Prune ComputeVisibleSelectionInDOMTreeDeprecated from FrameSelection::SelectAll (Closed)
Patch Set: Fix unit test Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 HTMLSelectElement* select_element = 625 HTMLSelectElement* select_element =
626 toHTMLSelectElement(GetDocument().FocusedElement()); 626 toHTMLSelectElement(GetDocument().FocusedElement());
627 if (select_element->CanSelectAll()) { 627 if (select_element->CanSelectAll()) {
628 select_element->SelectAll(); 628 select_element->SelectAll();
629 return; 629 return;
630 } 630 }
631 } 631 }
632 632
633 Node* root = nullptr; 633 Node* root = nullptr;
634 Node* select_start_target = nullptr; 634 Node* select_start_target = nullptr;
635 if (ComputeVisibleSelectionInDOMTreeDeprecated().IsContentEditable()) { 635 if (ComputeVisibleSelectionInDOMTree().IsContentEditable()) {
636 root = HighestEditableRoot( 636 root = HighestEditableRoot(ComputeVisibleSelectionInDOMTree().Start());
637 ComputeVisibleSelectionInDOMTreeDeprecated().Start());
638 if (Node* shadow_root = NonBoundaryShadowTreeRootNode( 637 if (Node* shadow_root = NonBoundaryShadowTreeRootNode(
639 ComputeVisibleSelectionInDOMTreeDeprecated().Start())) 638 ComputeVisibleSelectionInDOMTree().Start()))
640 select_start_target = shadow_root->OwnerShadowHost(); 639 select_start_target = shadow_root->OwnerShadowHost();
641 else 640 else
642 select_start_target = root; 641 select_start_target = root;
643 } else { 642 } else {
644 root = NonBoundaryShadowTreeRootNode( 643 root = NonBoundaryShadowTreeRootNode(
645 ComputeVisibleSelectionInDOMTreeDeprecated().Start()); 644 ComputeVisibleSelectionInDOMTree().Start());
646 if (root) { 645 if (root) {
647 select_start_target = root->OwnerShadowHost(); 646 select_start_target = root->OwnerShadowHost();
648 } else { 647 } else {
649 root = GetDocument().documentElement(); 648 root = GetDocument().documentElement();
650 select_start_target = GetDocument().body(); 649 select_start_target = GetDocument().body();
651 } 650 }
652 } 651 }
653 if (!root || EditingIgnoresContent(*root)) 652 if (!root || EditingIgnoresContent(*root))
654 return; 653 return;
655 654
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
1185 } 1184 }
1186 1185
1187 void showTree(const blink::FrameSelection* sel) { 1186 void showTree(const blink::FrameSelection* sel) {
1188 if (sel) 1187 if (sel)
1189 sel->ShowTreeForThis(); 1188 sel->ShowTreeForThis();
1190 else 1189 else
1191 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; 1190 LOG(INFO) << "Cannot showTree for <null> FrameSelection.";
1192 } 1191 }
1193 1192
1194 #endif 1193 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698