Safari Developer Library

Developer

Document Additions Reference

Options
Deployment Target:

On This Page

Document

These additions to the Document class are used to create touch event objects on iOS and control full-screen mode on the desktop.

Inheritance


  • Node
  • Document
  • HTMLDocument
  • SVGDocument

Conforms To


Not Applicable

Import Statement


Not Applicable Not Applicable

Availability


Available in Safari 3.0 and later.
Available in iOS 1.0 and later.
  • Creates a new Touch object.

    Declaration

    JavaScript

    Touch createTouch (in DOMWindow view, in EventTarget target, in long identifier, in long pageX, in long pageY, in long screenX, in long screenY);

    Parameters

    view

    The view (DOM window) in which the event occurred.

    target

    The target of this gesture.

    identifier

    The unique identifier for this touch object.

    pageX

    The x-coordinate of the touch’s location, in page coordinates.

    pageY

    The y-coordinate of the touch’s location, in page coordinates.

    screenX

    The x-coordinate of the event’s location, in screen coordinates.

    screenY

    The y-coordinate of the event’s location, in screen coordinates.

    Availability

    Available in iOS 2.0 and later.

  • Creates a new TouchList object.

    Declaration

    JavaScript

    TouchList createTouchList ();

    Parameters

    firstTouch, …

    The touch object.

    Discussion

    This method accepts a varying number of Touch parameters.

    Availability

    Available in iOS 2.0 and later.

  • Cancels full-screen mode.

    Declaration

    JavaScript

    void webkitCancelFullScreen ();

    Availability

    Available in Safari 5.1 and later.

  • The element that is fullscreen.

    Declaration

    JavaScript

    readonly attribute Element webkitCurrentFullScreenElement

    Availability

    Available in Safari 5.1 and later.

  • A Boolean that indicates whether keyboard input is allowed in fullscreen mode.

    Declaration

    JavaScript

    readonly attribute boolean webkitFullScreenKeyboardInputAllowed

    Discussion

    true if keyboard input is allowed; otherwise, false.

    Availability

    Available in Safari 5.1 and later.

  • A Boolean that indicates whether the document is in full-screen mode.

    Declaration

    JavaScript

    readonly attribute boolean webkitIsFullScreen

    Discussion

    true if the document is in full-screen mode; otherwise, false.

    Availability

    Available in Safari 5.1 and later.

  • An event listener that is called when entering or exiting full-screen mode.

    Declaration

    JavaScript

    attribute EventListener onwebkitfullscreenchange

    Availability

    Available in Safari 5.1 and later.