Class WindowOrWorkerGlobalScopeMixin


  • public final class WindowOrWorkerGlobalScopeMixin
    extends java.lang.Object
    The implementation of WindowOrWorkerGlobalScope to be used by the implementers of the mixin.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static int MIN_TIMER_DELAY
      The minimum delay that can be used with setInterval() or setTimeout().
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String atob​(java.lang.String encodedData)
      Decodes a string of data which has been encoded using base-64 encoding.
      static java.lang.String btoa​(java.lang.String stringToEncode)
      Creates a base-64 encoded ASCII string from a string of binary data.
      static java.lang.Object setInterval​(org.htmlunit.corejs.javascript.Context context, org.htmlunit.corejs.javascript.Scriptable thisObj, java.lang.Object[] args, org.htmlunit.corejs.javascript.Function function)
      Sets a chunk of JavaScript to be invoked each time a specified number of milliseconds has elapsed.
      static java.lang.Object setTimeout​(org.htmlunit.corejs.javascript.Context context, org.htmlunit.corejs.javascript.Scriptable thisObj, java.lang.Object[] args, org.htmlunit.corejs.javascript.Function function)
      Sets a chunk of JavaScript to be invoked at some specified time later.
      private static int setTimeoutIntervalImpl​(Window window, java.lang.Object code, int timeout, boolean isTimeout, java.lang.Object[] params)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WindowOrWorkerGlobalScopeMixin

        private WindowOrWorkerGlobalScopeMixin()
    • Method Detail

      • atob

        public static java.lang.String atob​(java.lang.String encodedData)
        Decodes a string of data which has been encoded using base-64 encoding.
        Parameters:
        encodedData - the encoded string
        Returns:
        the decoded value
      • btoa

        public static java.lang.String btoa​(java.lang.String stringToEncode)
        Creates a base-64 encoded ASCII string from a string of binary data.
        Parameters:
        stringToEncode - string to encode
        Returns:
        the encoded string
      • setTimeout

        public static java.lang.Object setTimeout​(org.htmlunit.corejs.javascript.Context context,
                                                  org.htmlunit.corejs.javascript.Scriptable thisObj,
                                                  java.lang.Object[] args,
                                                  org.htmlunit.corejs.javascript.Function function)
        Sets a chunk of JavaScript to be invoked at some specified time later. The invocation occurs only if the window is opened after the delay and does not contain an other page than the one that originated the setTimeout.
        Parameters:
        context - the JavaScript context
        thisObj - the scriptable
        args - the arguments passed into the method
        function - the function
        Returns:
        the id of the created timer
        See Also:
        MDN web docs
      • setInterval

        public static java.lang.Object setInterval​(org.htmlunit.corejs.javascript.Context context,
                                                   org.htmlunit.corejs.javascript.Scriptable thisObj,
                                                   java.lang.Object[] args,
                                                   org.htmlunit.corejs.javascript.Function function)
        Sets a chunk of JavaScript to be invoked each time a specified number of milliseconds has elapsed.
        Parameters:
        context - the JavaScript context
        thisObj - the scriptable
        args - the arguments passed into the method
        function - the function
        Returns:
        the id of the created interval
        See Also:
        MDN web docs
      • setTimeoutIntervalImpl

        private static int setTimeoutIntervalImpl​(Window window,
                                                  java.lang.Object code,
                                                  int timeout,
                                                  boolean isTimeout,
                                                  java.lang.Object[] params)