| 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 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1394 ContainerNode* ownerElementParent = ownerElement->parentNode(); | 1394 ContainerNode* ownerElementParent = ownerElement->parentNode(); |
| 1395 if (!ownerElementParent) | 1395 if (!ownerElementParent) |
| 1396 return; | 1396 return; |
| 1397 | 1397 |
| 1398 // This method's purpose is it to make it easier to select iframes (in order
to delete them). Don't do anything if the iframe isn't deletable. | 1398 // This method's purpose is it to make it easier to select iframes (in order
to delete them). Don't do anything if the iframe isn't deletable. |
| 1399 if (!ownerElementParent->hasEditableStyle()) | 1399 if (!ownerElementParent->hasEditableStyle()) |
| 1400 return; | 1400 return; |
| 1401 | 1401 |
| 1402 // Create compute positions before and after the element. | 1402 // Create compute positions before and after the element. |
| 1403 unsigned ownerElementNodeIndex = ownerElement->nodeIndex(); | 1403 unsigned ownerElementNodeIndex = ownerElement->nodeIndex(); |
| 1404 VisiblePosition beforeOwnerElement(VisiblePosition(Position(ownerElementPare
nt, ownerElementNodeIndex, Position::PositionIsOffsetInAnchor))); | 1404 VisiblePosition beforeOwnerElement(VisiblePosition(Position(ownerElementPare
nt, ownerElementNodeIndex))); |
| 1405 VisiblePosition afterOwnerElement(VisiblePosition(Position(ownerElementParen
t, ownerElementNodeIndex + 1, Position::PositionIsOffsetInAnchor), VP_UPSTREAM_I
F_POSSIBLE)); | 1405 VisiblePosition afterOwnerElement(VisiblePosition(Position(ownerElementParen
t, ownerElementNodeIndex + 1), VP_UPSTREAM_IF_POSSIBLE)); |
| 1406 | 1406 |
| 1407 // Focus on the parent frame, and then select from before this element to af
ter. | 1407 // Focus on the parent frame, and then select from before this element to af
ter. |
| 1408 VisibleSelection newSelection(beforeOwnerElement, afterOwnerElement); | 1408 VisibleSelection newSelection(beforeOwnerElement, afterOwnerElement); |
| 1409 page->focusController().setFocusedFrame(parent); | 1409 page->focusController().setFocusedFrame(parent); |
| 1410 toLocalFrame(parent)->selection().setSelection(newSelection); | 1410 toLocalFrame(parent)->selection().setSelection(newSelection); |
| 1411 } | 1411 } |
| 1412 | 1412 |
| 1413 void FrameSelection::selectAll() | 1413 void FrameSelection::selectAll() |
| 1414 { | 1414 { |
| 1415 Document* document = m_frame->document(); | 1415 Document* document = m_frame->document(); |
| (...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2035 | 2035 |
| 2036 void showTree(const blink::FrameSelection* sel) | 2036 void showTree(const blink::FrameSelection* sel) |
| 2037 { | 2037 { |
| 2038 if (sel) | 2038 if (sel) |
| 2039 sel->showTreeForThis(); | 2039 sel->showTreeForThis(); |
| 2040 else | 2040 else |
| 2041 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); | 2041 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); |
| 2042 } | 2042 } |
| 2043 | 2043 |
| 2044 #endif | 2044 #endif |
| OLD | NEW |