Skip to content

Commit

Permalink
Bug 1092888 - Part 1: Remove preference for selection carets with non…
Browse files Browse the repository at this point in the history
…-editable fields support. r=roc
  • Loading branch information
mephisto41 committed Nov 10, 2014
1 parent 940edd6 commit 45fc104
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
23 changes: 0 additions & 23 deletions layout/base/SelectionCarets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,6 @@ static const char* kSelectionCaretsLogModuleName = "SelectionCarets";
static const int32_t kMoveStartTolerancePx = 5;
// Time for trigger scroll end event, in miliseconds.
static const int32_t kScrollEndTimerDelay = 300;
// Read from preference "selectioncaret.noneditable". Indicate whether support
// non-editable fields selection or not. We have stable state for editable
// fields selection now. And we don't want to break this stable state when
// enabling non-editable support. So I add a pref to control to support or
// not. Once non-editable fields support is stable. We should remove this
// pref.
static bool kSupportNonEditableFields = false;

NS_IMPL_ISUPPORTS(SelectionCarets,
nsIReflowObserver,
Expand Down Expand Up @@ -103,8 +96,6 @@ SelectionCarets::SelectionCarets(nsIPresShell* aPresShell)
if (!addedPref) {
Preferences::AddIntVarCache(&sSelectionCaretsInflateSize,
"selectioncaret.inflatesize.threshold");
Preferences::AddBoolVarCache(&kSupportNonEditableFields,
"selectioncaret.noneditable");
addedPref = true;
}
}
Expand Down Expand Up @@ -472,14 +463,6 @@ SelectionCarets::UpdateSelectionCarets()
return;
}

// If frame isn't editable and we don't support non-editable fields, bail
// out.
if (!kSupportNonEditableFields &&
(!startFrame->GetContent()->IsEditable() ||
!endFrame->GetContent()->IsEditable())) {
return;
}

// Check if startFrame is after endFrame.
if (nsLayoutUtils::CompareTreePosition(startFrame, endFrame) > 0) {
SetVisibility(false);
Expand Down Expand Up @@ -558,12 +541,6 @@ SelectionCarets::SelectWord()
return NS_OK;
}

// If frame isn't editable and we don't support non-editable fields, bail
// out.
if (!kSupportNonEditableFields && !ptFrame->GetContent()->IsEditable()) {
return NS_OK;
}

nsPoint ptInFrame = mDownPoint;
nsLayoutUtils::TransformPoint(rootFrame, ptFrame, ptInFrame);

Expand Down
1 change: 0 additions & 1 deletion modules/libpref/init/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -4363,7 +4363,6 @@ pref("touchcaret.expiration.time", 3000);

// Turn off selection caret by default
pref("selectioncaret.enabled", false);
pref("selectioncaret.noneditable", false);

// This will inflate size of selection caret frame when we checking if
// user click on selection caret or not. In app units.
Expand Down

0 comments on commit 45fc104

Please sign in to comment.