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

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

Issue 33353003: Have Frame::tree() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/TreeScope.cpp ('k') | Source/core/editing/SpellChecker.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 1324 matching lines...) Expand 10 before | Expand all | Expand 10 after
1335 } 1335 }
1336 1336
1337 // Workaround for the fact that it's hard to delete a frame. 1337 // Workaround for the fact that it's hard to delete a frame.
1338 // Call this after doing user-triggered selections to make it easy to delete the frame you entirely selected. 1338 // Call this after doing user-triggered selections to make it easy to delete the frame you entirely selected.
1339 // Can't do this implicitly as part of every setSelection call because in some c ontexts it might not be good 1339 // Can't do this implicitly as part of every setSelection call because in some c ontexts it might not be good
1340 // for the focus to move to another frame. So instead we call it from places whe re we are selecting with the 1340 // for the focus to move to another frame. So instead we call it from places whe re we are selecting with the
1341 // mouse or the keyboard after setting the selection. 1341 // mouse or the keyboard after setting the selection.
1342 void FrameSelection::selectFrameElementInParentIfFullySelected() 1342 void FrameSelection::selectFrameElementInParentIfFullySelected()
1343 { 1343 {
1344 // Find the parent frame; if there is none, then we have nothing to do. 1344 // Find the parent frame; if there is none, then we have nothing to do.
1345 Frame* parent = m_frame->tree()->parent(); 1345 Frame* parent = m_frame->tree().parent();
1346 if (!parent) 1346 if (!parent)
1347 return; 1347 return;
1348 Page* page = m_frame->page(); 1348 Page* page = m_frame->page();
1349 if (!page) 1349 if (!page)
1350 return; 1350 return;
1351 1351
1352 // Check if the selection contains the entire frame contents; if not, then t here is nothing to do. 1352 // Check if the selection contains the entire frame contents; if not, then t here is nothing to do.
1353 if (!isRange()) 1353 if (!isRange())
1354 return; 1354 return;
1355 if (!isStartOfDocument(selection().visibleStart())) 1355 if (!isStartOfDocument(selection().visibleStart()))
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
1866 sel.showTreeForThis(); 1866 sel.showTreeForThis();
1867 } 1867 }
1868 1868
1869 void showTree(const WebCore::FrameSelection* sel) 1869 void showTree(const WebCore::FrameSelection* sel)
1870 { 1870 {
1871 if (sel) 1871 if (sel)
1872 sel->showTreeForThis(); 1872 sel->showTreeForThis();
1873 } 1873 }
1874 1874
1875 #endif 1875 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/TreeScope.cpp ('k') | Source/core/editing/SpellChecker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698