Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(458)

Side by Side Diff: third_party/WebKit/Source/core/editing/SelectionController.cpp

Issue 2455853002: Revert of Content in disabled input field should not be selectable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
6 * Copyright (C) 2015 Google Inc. All rights reserved. 6 * Copyright (C) 2015 Google Inc. All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 const HitTestResult& hitTestResult) { 839 const HitTestResult& hitTestResult) {
840 if (!selection().isAvailable()) 840 if (!selection().isAvailable())
841 return false; 841 return false;
842 if (hitTestResult.isLiveLink()) 842 if (hitTestResult.isLiveLink())
843 return false; 843 return false;
844 844
845 Node* innerNode = hitTestResult.innerNode(); 845 Node* innerNode = hitTestResult.innerNode();
846 if (!innerNode) 846 if (!innerNode)
847 return false; 847 return false;
848 innerNode->document().updateStyleAndLayoutTree(); 848 innerNode->document().updateStyleAndLayoutTree();
849 bool innerNodeIsSelectable = 849 bool innerNodeIsSelectable = hasEditableStyle(*innerNode) ||
850 hasEditableStyle(*innerNode) || innerNode->canStartSelection(); 850 innerNode->isTextNode() ||
851 innerNode->canStartSelection();
851 if (!innerNodeIsSelectable) 852 if (!innerNodeIsSelectable)
852 return false; 853 return false;
853 854
854 selectClosestWordFromHitTestResult(hitTestResult, 855 selectClosestWordFromHitTestResult(hitTestResult,
855 AppendTrailingWhitespace::DontAppend, 856 AppendTrailingWhitespace::DontAppend,
856 SelectInputEventType::Touch); 857 SelectInputEventType::Touch);
857 if (!selection().isAvailable()) { 858 if (!selection().isAvailable()) {
858 // "editing/selection/longpress-selection-in-iframe-removed-crash.html" 859 // "editing/selection/longpress-selection-in-iframe-removed-crash.html"
859 // reach here. 860 // reach here.
860 return false; 861 return false;
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 return event.event().altKey() && event.isOverLink(); 966 return event.event().altKey() && event.isOverLink();
966 } 967 }
967 968
968 bool isExtendingSelection(const MouseEventWithHitTestResults& event) { 969 bool isExtendingSelection(const MouseEventWithHitTestResults& event) {
969 bool isMouseDownOnLinkOrImage = 970 bool isMouseDownOnLinkOrImage =
970 event.isOverLink() || event.hitTestResult().image(); 971 event.isOverLink() || event.hitTestResult().image();
971 return event.event().shiftKey() && !isMouseDownOnLinkOrImage; 972 return event.event().shiftKey() && !isMouseDownOnLinkOrImage;
972 } 973 }
973 974
974 } // namespace blink 975 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698