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 1324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |