mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Bug 1204872 - Add documentation and rename mCaretMode. r=roc
Rename mCaretMode to mLastUpdateCaretsMode to make it clear that this variable track the caret mode since last update. This also avoid the confusion that GetCaretMode() returns mCaretMode. --HG-- extra : commitid : BoFaTHocik extra : rebase_source : 944882f796904671d516f4e15edb39a5ae88bada
This commit is contained in:
parent
a54527efd5
commit
1e2a01e453
@ -99,9 +99,9 @@ AccessibleCaretManager::HideCarets()
|
||||
void
|
||||
AccessibleCaretManager::UpdateCarets(UpdateCaretsHint aHint)
|
||||
{
|
||||
mCaretMode = GetCaretMode();
|
||||
mLastUpdateCaretMode = GetCaretMode();
|
||||
|
||||
switch (mCaretMode) {
|
||||
switch (mLastUpdateCaretMode) {
|
||||
case CaretMode::None:
|
||||
HideCarets();
|
||||
break;
|
||||
@ -402,7 +402,7 @@ AccessibleCaretManager::OnScrollStart()
|
||||
void
|
||||
AccessibleCaretManager::OnScrollEnd()
|
||||
{
|
||||
if (mCaretMode != GetCaretMode()) {
|
||||
if (mLastUpdateCaretMode != GetCaretMode()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -418,7 +418,7 @@ AccessibleCaretManager::OnScrollEnd()
|
||||
void
|
||||
AccessibleCaretManager::OnScrollPositionChanged()
|
||||
{
|
||||
if (mCaretMode != GetCaretMode()) {
|
||||
if (mLastUpdateCaretMode != GetCaretMode()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -429,7 +429,7 @@ AccessibleCaretManager::OnScrollPositionChanged()
|
||||
void
|
||||
AccessibleCaretManager::OnReflow()
|
||||
{
|
||||
if (mCaretMode != GetCaretMode()) {
|
||||
if (mLastUpdateCaretMode != GetCaretMode()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -115,7 +115,10 @@ protected:
|
||||
// appearance to Normal.
|
||||
RespectOldAppearance
|
||||
};
|
||||
// Update carets based on current selection status.
|
||||
void UpdateCarets(UpdateCaretsHint aHint = UpdateCaretsHint::Default);
|
||||
|
||||
// Force hiding all carets regardless of the current selection status.
|
||||
void HideCarets();
|
||||
|
||||
void UpdateCaretsForCursorMode(UpdateCaretsHint aHint);
|
||||
@ -182,8 +185,12 @@ protected:
|
||||
// The caret being pressed or dragged.
|
||||
AccessibleCaret* mActiveCaret = nullptr;
|
||||
|
||||
// The timer for hiding the caret in cursor mode after timeout behind the
|
||||
// preference "layout.accessiblecaret.timeout_ms".
|
||||
nsCOMPtr<nsITimer> mCaretTimeoutTimer;
|
||||
CaretMode mCaretMode = CaretMode::None;
|
||||
|
||||
// The caret mode since last update carets.
|
||||
CaretMode mLastUpdateCaretMode = CaretMode::None;
|
||||
|
||||
static const int32_t kAutoScrollTimerDelay = 30;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user