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

Side by Side Diff: Source/core/page/EventHandler.cpp

Issue 309553007: Adding support for Text Selection on Disabled and Readonly input elements in Android (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed Linux and Windows Layout test breaks. Created 6 years, 2 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 | « LayoutTests/editing/selection/readonly-disabled-text-selection-expected.txt ('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 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 2305 matching lines...) Expand 10 before | Expand all | Expand 10 after
2316 } 2316 }
2317 #if OS(ANDROID) 2317 #if OS(ANDROID)
2318 bool shouldLongPressSelectWord = true; 2318 bool shouldLongPressSelectWord = true;
2319 #else 2319 #else
2320 bool shouldLongPressSelectWord = m_frame->settings() && m_frame->settings()- >touchEditingEnabled(); 2320 bool shouldLongPressSelectWord = m_frame->settings() && m_frame->settings()- >touchEditingEnabled();
2321 #endif 2321 #endif
2322 if (shouldLongPressSelectWord) { 2322 if (shouldLongPressSelectWord) {
2323 IntPoint hitTestPoint = m_frame->view()->windowToContents(gestureEvent.p osition()); 2323 IntPoint hitTestPoint = m_frame->view()->windowToContents(gestureEvent.p osition());
2324 HitTestResult result = hitTestResultAtPoint(hitTestPoint); 2324 HitTestResult result = hitTestResultAtPoint(hitTestPoint);
2325 Node* innerNode = result.innerNode(); 2325 Node* innerNode = result.innerNode();
2326 if (!result.isLiveLink() && innerNode && (innerNode->isContentEditable() || innerNode->isTextNode())) { 2326 if (!result.isLiveLink() && innerNode && (innerNode->isContentEditable() || innerNode->isTextNode()
2327 #if OS(ANDROID)
2328 || innerNode->canStartSelection()
2329 #endif
2330 )) {
2327 selectClosestWordFromHitTestResult(result, DontAppendTrailingWhitesp ace); 2331 selectClosestWordFromHitTestResult(result, DontAppendTrailingWhitesp ace);
2328 if (m_frame->selection().isRange()) { 2332 if (m_frame->selection().isRange()) {
2329 focusDocumentView(); 2333 focusDocumentView();
2330 return true; 2334 return true;
2331 } 2335 }
2332 } 2336 }
2333 } 2337 }
2334 return sendContextMenuEventForGesture(targetedEvent); 2338 return sendContextMenuEventForGesture(targetedEvent);
2335 } 2339 }
2336 2340
(...skipping 1542 matching lines...) Expand 10 before | Expand all | Expand 10 after
3879 unsigned EventHandler::accessKeyModifiers() 3883 unsigned EventHandler::accessKeyModifiers()
3880 { 3884 {
3881 #if OS(MACOSX) 3885 #if OS(MACOSX)
3882 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 3886 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
3883 #else 3887 #else
3884 return PlatformEvent::AltKey; 3888 return PlatformEvent::AltKey;
3885 #endif 3889 #endif
3886 } 3890 }
3887 3891
3888 } // namespace blink 3892 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/editing/selection/readonly-disabled-text-selection-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698