OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) | 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) |
5 * Copyright (C) 2015 Google Inc. All rights reserved. | 5 * Copyright (C) 2015 Google Inc. All rights reserved. |
6 * | 6 * |
7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
9 * are met: | 9 * are met: |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 return DispatchEventResult::NotCanceled; | 80 return DispatchEventResult::NotCanceled; |
81 | 81 |
82 return node->dispatchEvent(Event::createCancelableBubble(EventTypeNames::sel
ectstart)); | 82 return node->dispatchEvent(Event::createCancelableBubble(EventTypeNames::sel
ectstart)); |
83 } | 83 } |
84 | 84 |
85 VisibleSelectionInFlatTree expandSelectionToRespectUserSelectAll(Node* targetNod
e, const VisibleSelectionInFlatTree& selection) | 85 VisibleSelectionInFlatTree expandSelectionToRespectUserSelectAll(Node* targetNod
e, const VisibleSelectionInFlatTree& selection) |
86 { | 86 { |
87 Node* rootUserSelectAll = EditingInFlatTreeStrategy::rootUserSelectAllForNod
e(targetNode); | 87 Node* rootUserSelectAll = EditingInFlatTreeStrategy::rootUserSelectAllForNod
e(targetNode); |
88 if (!rootUserSelectAll) | 88 if (!rootUserSelectAll) |
89 return selection; | 89 return selection; |
| 90 if (rootUserSelectAll->isHTMLElement() && toHTMLElement(rootUserSelectAll)->
isTextFormControl()) |
| 91 return selection; |
| 92 if (rootUserSelectAll->layoutObject()->style()->userModify() != READ_ONLY) |
| 93 return selection; |
90 | 94 |
91 VisibleSelectionInFlatTree newSelection(selection); | 95 VisibleSelectionInFlatTree newSelection(selection); |
92 newSelection.setBase(mostBackwardCaretPosition(PositionInFlatTree::beforeNod
e(rootUserSelectAll), CanCrossEditingBoundary)); | 96 newSelection.setBase(mostBackwardCaretPosition(PositionInFlatTree::beforeNod
e(rootUserSelectAll), CanCrossEditingBoundary)); |
93 newSelection.setExtent(mostForwardCaretPosition(PositionInFlatTree::afterNod
e(rootUserSelectAll), CanCrossEditingBoundary)); | 97 newSelection.setExtent(mostForwardCaretPosition(PositionInFlatTree::afterNod
e(rootUserSelectAll), CanCrossEditingBoundary)); |
94 | 98 |
95 return newSelection; | 99 return newSelection; |
96 } | 100 } |
97 | 101 |
98 static int textDistance(const PositionInFlatTree& start, const PositionInFlatTre
e& end) | 102 static int textDistance(const PositionInFlatTree& start, const PositionInFlatTre
e& end) |
99 { | 103 { |
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 return event.event().altKey() && event.isOverLink(); | 674 return event.event().altKey() && event.isOverLink(); |
671 } | 675 } |
672 | 676 |
673 bool isExtendingSelection(const MouseEventWithHitTestResults& event) | 677 bool isExtendingSelection(const MouseEventWithHitTestResults& event) |
674 { | 678 { |
675 bool isMouseDownOnLinkOrImage = event.isOverLink() || event.hitTestResult().
image(); | 679 bool isMouseDownOnLinkOrImage = event.isOverLink() || event.hitTestResult().
image(); |
676 return event.event().shiftKey() && !isMouseDownOnLinkOrImage; | 680 return event.event().shiftKey() && !isMouseDownOnLinkOrImage; |
677 } | 681 } |
678 | 682 |
679 } // namespace blink | 683 } // namespace blink |
OLD | NEW |