Document Additions Reference

Inherits from
Node
Companion guide
Availability
Available in Safari 3.0 and later.
Available in iOS 1.0 and later.

Overview

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

Tasks

Creating Touches

Displaying Content Fullscreen

Properties

onwebkitfullscreenchange

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

attribute EventListener onwebkitfullscreenchange
Availability

webkitCurrentFullScreenElement

The element that is fullscreen.

readonly attribute Element webkitCurrentFullScreenElement
Availability

webkitFullScreenKeyboardInputAllowed

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

readonly attribute boolean webkitFullScreenKeyboardInputAllowed
Discussion

true if keyboard input is allowed; otherwise, false.

Availability

webkitIsFullScreen

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

readonly attribute boolean webkitIsFullScreen
Discussion

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

Availability

Methods

createTouch

Creates a new Touch object.

Touch createTouch( in DOMWindow view, in EventTarget target, in long identifier, in long pageX, in long pageY, in long screenX, in long screenY) raises ( DOMException);
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.

createTouchList

Creates a new TouchList object.

TouchList createTouchList(in Touch firstTouch, …) raises ( DOMException);
Parameters
firstTouch, …

The touch object.

Discussion

This method accepts a varying number of Touch parameters.

Availability
  • Available in iOS 2.0 and later.

webkitCancelFullScreen

Cancels full-screen mode.

void webkitCancelFullScreen ();
Availability
  • Available in Safari 5.1 and later.