From c631245c9c387850b9a0c0184135d9fa27aaef15 Mon Sep 17 00:00:00 2001 From: Olli Pettay Date: Wed, 30 May 2018 17:04:18 +0300 Subject: 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(-) (limited to 'dom/html') diff --git a/dom/html/HTMLInputElement.cpp b/dom/html/HTMLInputElement.cpp index d09bc3103..e9086933b 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; -- cgit v1.2.3