From 8b999f2be31cc244afa50f122ff34663c8243b1e Mon Sep 17 00:00:00 2001 From: Pale Moon Date: Sun, 1 Jul 2018 16:57:15 +0200 Subject: 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 bae91213e..06e84956f 100644 --- a/dom/html/HTMLInputElement.cpp +++ b/dom/html/HTMLInputElement.cpp @@ -3191,7 +3191,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