       Utils.nextTick ->
         window.focus()
         document.body.focus()
-        if 0 < scrollX or 0 < scrollY
+        if scrollX > 0 or scrollY > 0
           Marks.setPreviousPosition()
           window.scrollTo scrollX, scrollY
+        return
 
 flashFrame = do ->
   highlightedFrameElement = null

# correct enabled state (but only if this frame has the focus).
checkEnabledAfterURLChange = forTrusted ->
  Scroller.reset() # The URL changing feels like navigation to the user, so reset the scroller (see #3119).
  checkIfEnabledForUrl() if windowIsFocused()

# If we are in the help dialog iframe, then HelpDialog is already defined with the necessary functions.
root.HelpDialog ?=
  helpUI: null
  isShowing: -> @helpUI?.showing
  abort: -> @helpUI.hide false if @isShowing()

  toggle: (request) ->
    DomUtils.documentComplete =>

    window.focus()
    # On Firefox, window.focus doesn't always draw focus back from a child frame (bug 554039).
    # We blur the active element if it is an iframe, which gives the window back focus as intended.
    if document.activeElement.tagName.toLowerCase() == "iframe"
      document.activeElement.blur()
    if request.highlight
      flashFrame()
    return
  return

# Used by focusInput command.
root.lastFocusedInput = do ->
