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

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

Issue 2875763002: Prune ComputeVisibleSelectionInDOMTreeDeprecated from FrameSelection::CurrentForm (Closed)
Patch Set: 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 | no next file » | 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 924 matching lines...) Expand 10 before | Expand all | Expand 10 after
935 return 0; 935 return 0;
936 } 936 }
937 937
938 // We look for either the form containing the current focus, or for one 938 // We look for either the form containing the current focus, or for one
939 // immediately after it 939 // immediately after it
940 HTMLFormElement* FrameSelection::CurrentForm() const { 940 HTMLFormElement* FrameSelection::CurrentForm() const {
941 // Start looking either at the active (first responder) node, or where the 941 // Start looking either at the active (first responder) node, or where the
942 // selection is. 942 // selection is.
943 Node* start = GetDocument().FocusedElement(); 943 Node* start = GetDocument().FocusedElement();
944 if (!start) 944 if (!start)
945 start = ComputeVisibleSelectionInDOMTreeDeprecated().Start().AnchorNode(); 945 start = ComputeVisibleSelectionInDOMTree().Start().AnchorNode();
946 if (!start) 946 if (!start)
947 return 0; 947 return 0;
948 948
949 // Try walking up the node tree to find a form element. 949 // Try walking up the node tree to find a form element.
950 for (HTMLElement* element = 950 for (HTMLElement* element =
951 Traversal<HTMLElement>::FirstAncestorOrSelf(*start); 951 Traversal<HTMLElement>::FirstAncestorOrSelf(*start);
952 element; element = Traversal<HTMLElement>::FirstAncestor(*element)) { 952 element; element = Traversal<HTMLElement>::FirstAncestor(*element)) {
953 if (HTMLFormElement* form = AssociatedFormElement(*element)) 953 if (HTMLFormElement* form = AssociatedFormElement(*element))
954 return form; 954 return form;
955 } 955 }
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
1184 } 1184 }
1185 1185
1186 void showTree(const blink::FrameSelection* sel) { 1186 void showTree(const blink::FrameSelection* sel) {
1187 if (sel) 1187 if (sel)
1188 sel->ShowTreeForThis(); 1188 sel->ShowTreeForThis();
1189 else 1189 else
1190 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; 1190 LOG(INFO) << "Cannot showTree for <null> FrameSelection.";
1191 } 1191 }
1192 1192
1193 #endif 1193 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698