diff --git a/dom/html/HTMLInputElement.cpp b/dom/html/HTMLInputElement.cpp
index 06e84956f6..bd839f4935 100644
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -3191,7 +3191,7 @@ HTMLInputElement::Focus(ErrorResult& aError)
nsNumberControlFrame* numberControlFrame =
do_QueryFrame(GetPrimaryFrame());
if (numberControlFrame) {
- RefPtr textControl =
+ nsRefPtr textControl =
numberControlFrame->GetAnonTextControl();
if (textControl) {
textControl->Focus(aError);