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

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

Issue 2461293002: Merge "Revert of Content in disabled input field should not be selectable. (patchset #4 id:80001 of… (Closed)
Patch Set: 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 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 const HitTestResult& hitTestResult) { 708 const HitTestResult& hitTestResult) {
709 if (!selection().isAvailable()) 709 if (!selection().isAvailable())
710 return false; 710 return false;
711 if (hitTestResult.isLiveLink()) 711 if (hitTestResult.isLiveLink())
712 return false; 712 return false;
713 713
714 Node* innerNode = hitTestResult.innerNode(); 714 Node* innerNode = hitTestResult.innerNode();
715 if (!innerNode) 715 if (!innerNode)
716 return false; 716 return false;
717 innerNode->document().updateStyleAndLayoutTree(); 717 innerNode->document().updateStyleAndLayoutTree();
718 bool innerNodeIsSelectable = 718 bool innerNodeIsSelectable = hasEditableStyle(*innerNode) ||
719 hasEditableStyle(*innerNode) || innerNode->canStartSelection(); 719 innerNode->isTextNode() ||
720 innerNode->canStartSelection();
720 if (!innerNodeIsSelectable) 721 if (!innerNodeIsSelectable)
721 return false; 722 return false;
722 723
723 selectClosestWordFromHitTestResult(hitTestResult, 724 selectClosestWordFromHitTestResult(hitTestResult,
724 AppendTrailingWhitespace::DontAppend, 725 AppendTrailingWhitespace::DontAppend,
725 SelectInputEventType::Touch); 726 SelectInputEventType::Touch);
726 if (!selection().isAvailable()) { 727 if (!selection().isAvailable()) {
727 // "editing/selection/longpress-selection-in-iframe-removed-crash.html" 728 // "editing/selection/longpress-selection-in-iframe-removed-crash.html"
728 // reach here. 729 // reach here.
729 return false; 730 return false;
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 return event.event().altKey() && event.isOverLink(); 830 return event.event().altKey() && event.isOverLink();
830 } 831 }
831 832
832 bool isExtendingSelection(const MouseEventWithHitTestResults& event) { 833 bool isExtendingSelection(const MouseEventWithHitTestResults& event) {
833 bool isMouseDownOnLinkOrImage = 834 bool isMouseDownOnLinkOrImage =
834 event.isOverLink() || event.hitTestResult().image(); 835 event.isOverLink() || event.hitTestResult().image();
835 return event.event().shiftKey() && !isMouseDownOnLinkOrImage; 836 return event.event().shiftKey() && !isMouseDownOnLinkOrImage;
836 } 837 }
837 838
838 } // namespace blink 839 } // 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