Chromium Code Reviews| 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; | 658 return; |
| 659 | 659 |
| 660 if (selectionStartNode->isInShadowTree()) { | |
|
tkent
2014/07/08 23:33:01
nit:
if (selectionStartNode->isInShadowTree() && s
deepak.sa
2014/07/10 13:52:03
Done.
| |
| 661 if (selectionStartNode->shadowHost() == newFocusedNode) | |
| 662 return; | |
| 663 } | |
| 664 | |
| 660 if (Node* mousePressNode = newFocusedFrame->eventHandler().mousePressNode()) { | 665 if (Node* mousePressNode = newFocusedFrame->eventHandler().mousePressNode()) { |
| 661 if (mousePressNode->renderer() && !mousePressNode->canStartSelection()) { | 666 if (mousePressNode->renderer() && !mousePressNode->canStartSelection()) { |
| 662 // Don't clear the selection for contentEditable elements, but do | 667 // Don't clear the selection for contentEditable elements, but do |
| 663 // clear it for input and textarea. See bug 38696. | 668 // clear it for input and textarea. See bug 38696. |
| 664 if (!enclosingTextFormControl(selection.start())) | 669 if (!enclosingTextFormControl(selection.start())) |
| 665 return; | 670 return; |
| 666 } | 671 } |
| 667 } | 672 } |
| 668 | 673 |
| 669 selection.clear(); | 674 selection.clear(); |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 917 startingRect = nodeRectInAbsoluteCoordinates(container, true /* ignore b order */); | 922 startingRect = nodeRectInAbsoluteCoordinates(container, true /* ignore b order */); |
| 918 container = scrollableEnclosingBoxOrParentFrameForNodeInDirection(type, container); | 923 container = scrollableEnclosingBoxOrParentFrameForNodeInDirection(type, container); |
| 919 if (container && container->isDocumentNode()) | 924 if (container && container->isDocumentNode()) |
| 920 toDocument(container)->updateLayoutIgnorePendingStylesheets(); | 925 toDocument(container)->updateLayoutIgnorePendingStylesheets(); |
| 921 } while (!consumed && container); | 926 } while (!consumed && container); |
| 922 | 927 |
| 923 return consumed; | 928 return consumed; |
| 924 } | 929 } |
| 925 | 930 |
| 926 } // namespace WebCore | 931 } // namespace WebCore |
| OLD | NEW |