| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Nuanti Ltd. | 3 * Copyright (C) 2008 Nuanti Ltd. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 | 647 |
| 648 FrameSelection& selection = oldFocusedFrame->selection(); | 648 FrameSelection& selection = oldFocusedFrame->selection(); |
| 649 if (selection.isNone()) | 649 if (selection.isNone()) |
| 650 return; | 650 return; |
| 651 | 651 |
| 652 bool caretBrowsing = oldFocusedFrame->settings()->caretBrowsingEnabled(); | 652 bool caretBrowsing = oldFocusedFrame->settings()->caretBrowsingEnabled(); |
| 653 if (caretBrowsing) | 653 if (caretBrowsing) |
| 654 return; | 654 return; |
| 655 | 655 |
| 656 Node* selectionStartNode = selection.selection().start().deprecatedNode(); | 656 Node* selectionStartNode = selection.selection().start().deprecatedNode(); |
| 657 if (selectionStartNode == newFocusedNode || selectionStartNode->isDescendant
Of(newFocusedNode) || selectionStartNode->deprecatedShadowAncestorNode() == newF
ocusedNode) | 657 if (selectionStartNode == newFocusedNode || selectionStartNode->isDescendant
Of(newFocusedNode)) |
| 658 return; |
| 659 |
| 660 if (selectionStartNode->isInShadowTree() && selectionStartNode->shadowHost()
== newFocusedNode) |
| 658 return; | 661 return; |
| 659 | 662 |
| 660 if (Node* mousePressNode = newFocusedFrame->eventHandler().mousePressNode())
{ | 663 if (Node* mousePressNode = newFocusedFrame->eventHandler().mousePressNode())
{ |
| 661 if (mousePressNode->renderer() && !mousePressNode->canStartSelection())
{ | 664 if (mousePressNode->renderer() && !mousePressNode->canStartSelection())
{ |
| 662 // Don't clear the selection for contentEditable elements, but do | 665 // Don't clear the selection for contentEditable elements, but do |
| 663 // clear it for input and textarea. See bug 38696. | 666 // clear it for input and textarea. See bug 38696. |
| 664 if (!enclosingTextFormControl(selection.start())) | 667 if (!enclosingTextFormControl(selection.start())) |
| 665 return; | 668 return; |
| 666 } | 669 } |
| 667 } | 670 } |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 917 startingRect = nodeRectInAbsoluteCoordinates(container, true /* ignore b
order */); | 920 startingRect = nodeRectInAbsoluteCoordinates(container, true /* ignore b
order */); |
| 918 container = scrollableEnclosingBoxOrParentFrameForNodeInDirection(type,
container); | 921 container = scrollableEnclosingBoxOrParentFrameForNodeInDirection(type,
container); |
| 919 if (container && container->isDocumentNode()) | 922 if (container && container->isDocumentNode()) |
| 920 toDocument(container)->updateLayoutIgnorePendingStylesheets(); | 923 toDocument(container)->updateLayoutIgnorePendingStylesheets(); |
| 921 } while (!consumed && container); | 924 } while (!consumed && container); |
| 922 | 925 |
| 923 return consumed; | 926 return consumed; |
| 924 } | 927 } |
| 925 | 928 |
| 926 } // namespace WebCore | 929 } // namespace WebCore |
| OLD | NEW |