Bug 1909577 - Make some nsFocusManager::GetFocusedElement() users use its static version instead r=emilio,credential-management-reviewers,issammani
Now, we have `nsFocusManager::GetFocusedElementStatic()` which returns focused element if the `nsFocusManager` instance is available. Therefore, if `nsFocusManager::GetFocusedElement()` users do not use other methods of `nsFocusManager`, they can use `nsFocusManager::GetFocusedElementStatic()` and make themselves simpler. Note that some callers return early if `nsFocusManager` is not available, but they do not return error and `nsFocusManager` instance is available in most time of the life time of the process. Therefore, we can simply stop using the early return. Differential Revision: https://phabricator.services.mozilla.com/D217527
This commit is contained in:
@@ -3969,14 +3969,14 @@ nsresult HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor) {
|
||||
wheelEvent->mDeltaY != 0 &&
|
||||
wheelEvent->mDeltaMode != WheelEvent_Binding::DOM_DELTA_PIXEL) {
|
||||
if (mType == FormControlType::InputNumber) {
|
||||
if (nsContentUtils::IsFocusedContent(this)) {
|
||||
if (nsFocusManager::GetFocusedElementStatic() == this) {
|
||||
StepNumberControlForUserEvent(wheelEvent->mDeltaY > 0 ? -1
|
||||
: 1);
|
||||
FireChangeEventIfNeeded();
|
||||
aVisitor.mEvent->PreventDefault();
|
||||
}
|
||||
} else if (mType == FormControlType::InputRange &&
|
||||
nsContentUtils::IsFocusedContent(this) &&
|
||||
nsFocusManager::GetFocusedElementStatic() == this &&
|
||||
GetMinimum() < GetMaximum()) {
|
||||
Decimal value = GetValueAsDecimal();
|
||||
Decimal step = GetStep();
|
||||
|
||||
Reference in New Issue
Block a user