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

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

Issue 2145323002: Content in disabled input field should not be selectable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated code for WebViewTest.LongPressImageTextArea test failure Created 4 years, 5 months 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 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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 } 571 }
572 572
573 bool SelectionController::handleGestureLongPress(const PlatformGestureEvent& ges tureEvent, const HitTestResult& hitTestResult) 573 bool SelectionController::handleGestureLongPress(const PlatformGestureEvent& ges tureEvent, const HitTestResult& hitTestResult)
574 { 574 {
575 if (!selection().isAvailable()) 575 if (!selection().isAvailable())
576 return false; 576 return false;
577 if (hitTestResult.isLiveLink()) 577 if (hitTestResult.isLiveLink())
578 return false; 578 return false;
579 579
580 Node* innerNode = hitTestResult.innerNode(); 580 Node* innerNode = hitTestResult.innerNode();
581 bool innerNodeIsSelectable = innerNode && (innerNode->isContentEditable() || innerNode->isTextNode() || innerNode->canStartSelection()); 581 bool innerNodeIsSelectable = innerNode && (innerNode->isContentEditable() || innerNode->canStartSelection());
582 if (!innerNodeIsSelectable) 582 if (!innerNodeIsSelectable)
583 return false; 583 return false;
584 584
585 selectClosestWordFromHitTestResult(hitTestResult, AppendTrailingWhitespace:: DontAppend, SelectInputEventType::Touch); 585 selectClosestWordFromHitTestResult(hitTestResult, AppendTrailingWhitespace:: DontAppend, SelectInputEventType::Touch);
586 if (!selection().isAvailable()) { 586 if (!selection().isAvailable()) {
587 // "editing/selection/longpress-selection-in-iframe-removed-crash.html" 587 // "editing/selection/longpress-selection-in-iframe-removed-crash.html"
588 // reach here. 588 // reach here.
589 return false; 589 return false;
590 } 590 }
591 return selection().isRange(); 591 return selection().isRange();
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 { 664 {
665 return m_frame->selection(); 665 return m_frame->selection();
666 } 666 }
667 667
668 bool isLinkSelection(const MouseEventWithHitTestResults& event) 668 bool isLinkSelection(const MouseEventWithHitTestResults& event)
669 { 669 {
670 return event.event().altKey() && event.isOverLink(); 670 return event.event().altKey() && event.isOverLink();
671 } 671 }
672 672
673 } // namespace blink 673 } // 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