зеркало из https://github.com/mozilla/pjs.git
Bug 707734 - Disable 'click and drag' text selection in nsFrame.cpp for touch enable devices r=roc
This commit is contained in:
Родитель
b696c91629
Коммит
9b4bbfd024
|
@ -52,6 +52,9 @@ pref("browser.viewport.scaleRatio", -1);
|
|||
/* allow scrollbars to float above chrome ui */
|
||||
pref("ui.scrollbarsCanOverlapContent", 1);
|
||||
|
||||
/* disable text selection */
|
||||
pref("browser.ignoreNativeFrameTextSelection", true);
|
||||
|
||||
/* cache prefs */
|
||||
pref("browser.cache.disk.enable", false);
|
||||
pref("browser.cache.disk.capacity", 0); // kilobytes
|
||||
|
|
|
@ -2444,14 +2444,14 @@ nsFrame::HandlePress(nsPresContext* aPresContext,
|
|||
|
||||
#ifdef XP_MACOSX
|
||||
if (me->isControl)
|
||||
return NS_OK;//short ciruit. hard coded for mac due to time restraints.
|
||||
return NS_OK;//short circuit. hard coded for mac due to time restraints.
|
||||
bool control = me->isMeta;
|
||||
#else
|
||||
bool control = me->isControl;
|
||||
#endif
|
||||
|
||||
nsRefPtr<nsFrameSelection> fc = const_cast<nsFrameSelection*>(frameselection);
|
||||
if (me->clickCount >1 )
|
||||
if (me->clickCount > 1)
|
||||
{
|
||||
// These methods aren't const but can't actually delete anything,
|
||||
// so no need for nsWeakFrame.
|
||||
|
@ -2466,6 +2466,14 @@ nsFrame::HandlePress(nsPresContext* aPresContext,
|
|||
if (!offsets.content)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
// On touchables devices, touch the screen is usually a pan action,
|
||||
// so let reposition the caret if needed but do not select text
|
||||
if (Preferences::GetBool("browser.ignoreNativeFrameTextSelection", false)) {
|
||||
return fc->HandleClick(offsets.content, offsets.StartOffset(),
|
||||
offsets.EndOffset(), false, false,
|
||||
offsets.associateWithNext);
|
||||
}
|
||||
|
||||
// Let Ctrl/Cmd+mouse down do table selection instead of drag initiation
|
||||
nsCOMPtr<nsIContent>parentContent;
|
||||
PRInt32 contentOffset;
|
||||
|
|
Загрузка…
Ссылка в новой задаче