From 3dc461fc723928bd4308eecd433a3abb4458f69b Mon Sep 17 00:00:00 2001 From: Olli Pettay Date: Wed, 30 May 2018 17:04:18 +0300 Subject: [PATCH] Bug 1459693 - Ensure the right anonymous element is focused when calling input.focus(). --- dom/html/HTMLInputElement.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dom/html/HTMLInputElement.cpp b/dom/html/HTMLInputElement.cpp index d09bc31030..e9086933b7 100644 --- a/dom/html/HTMLInputElement.cpp +++ b/dom/html/HTMLInputElement.cpp @@ -3546,7 +3546,8 @@ HTMLInputElement::Focus(ErrorResult& aError) nsNumberControlFrame* numberControlFrame = do_QueryFrame(GetPrimaryFrame()); if (numberControlFrame) { - HTMLInputElement* textControl = numberControlFrame->GetAnonTextControl(); + RefPtr textControl = + numberControlFrame->GetAnonTextControl(); if (textControl) { textControl->Focus(aError); return;