Bug 1905743 - Unify text control button storage. r=dholbert
Split out from the other patch for readability. This doesn't change behavior but unifies where we store the buttons of number/search/password inputs. Differential Revision: https://phabricator.services.mozilla.com/D215548
This commit is contained in:
@@ -4004,7 +4004,7 @@ nsresult HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor) {
|
||||
if (mType == FormControlType::InputSearch) {
|
||||
if (nsSearchControlFrame* searchControlFrame =
|
||||
do_QueryFrame(GetPrimaryFrame())) {
|
||||
Element* clearButton = searchControlFrame->GetAnonClearButton();
|
||||
Element* clearButton = searchControlFrame->GetButton();
|
||||
if (clearButton &&
|
||||
aVisitor.mEvent->mOriginalTarget == clearButton) {
|
||||
SetUserInput(EmptyString(),
|
||||
@@ -4018,7 +4018,7 @@ nsresult HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor) {
|
||||
} else if (mType == FormControlType::InputPassword) {
|
||||
if (nsTextControlFrame* textControlFrame =
|
||||
do_QueryFrame(GetPrimaryFrame())) {
|
||||
auto* reveal = textControlFrame->GetRevealButton();
|
||||
auto* reveal = textControlFrame->GetButton();
|
||||
if (reveal && aVisitor.mEvent->mOriginalTarget == reveal) {
|
||||
SetRevealPassword(!RevealPassword());
|
||||
// TODO(emilio): This should focus the input, but calling
|
||||
|
||||
Reference in New Issue
Block a user