mouse-lock.html
author Vincent Scheib <scheib@google.com>
Mon, 24 Oct 2011 17:33:16 -0700
changeset 133 d6110048bf5c
parent 132 4ec3f28f3e93
child 134 536cc04c0377
permissions -rw-r--r--
Mouse Lock: Work in progress on initial spec conversion: Document interface
132
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
     1
<!DOCTYPE html>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
     2
<html lang="en">
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
     3
  <head>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
     4
    <title>Mouse Lock</title>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
     5
    <meta http-equiv='Content-Type' content='text/html;charset=utf-8'/>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
     6
    <meta name="viewport" content="width=device-width">
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
     7
    <!--
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
     8
      === NOTA BENE ===
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
     9
      For the three scripts below, if your spec resides on dev.w3 you can check them
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    10
      out in the same tree and use relative links so that they'll work offline,
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    11
     -->
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    12
    <script src='http://dev.w3.org/2009/dap/ReSpec.js/js/respec.js' class='remove'></script>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    13
    <script class='remove'>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    14
      var respecConfig = {
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    15
        // specification status (e.g. WD, LCWD, NOTE, etc.). If in doubt use ED.
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    16
        specStatus:           "ED",
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    17
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    18
        // the specification's short name, as in http://www.w3.org/TR/short-name/
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    19
        shortName:            "mouse-lock",
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    20
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    21
        // if your specification has a subtitle that goes below the main
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    22
        // formal title, define it here
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    23
        // subtitle   :  "an excellent document",
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    24
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    25
        // if you wish the publication date to be other than today, set this
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    26
        //publishDate:  "2011-01-01",
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    27
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    28
        // if the specification's copyright date is a range of years, specify
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    29
        // the start date here:
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    30
        // copyrightStart: "2005"
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    31
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    32
        // if there is a previously published draft, uncomment this and set its YYYY-MM-DD date
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    33
        // and its maturity status
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    34
        // previousPublishDate:  "1977-03-15",
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    35
        // previousMaturity:  "WD",
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    36
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    37
        // if there a publicly available Editor's Draft, this is the link
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    38
        edDraftURI:           "http://dvcs.w3.org/hg/webevents/raw-file/default/mouse-lock.html",
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    39
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    40
        // if this is a LCWD, uncomment and set the end of its review period
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    41
        // lcEnd: "2009-08-05",
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    42
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    43
        // if you want to have extra CSS, append them to this list
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    44
        // it is recommended that the respec.css stylesheet be kept
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    45
        extraCSS:             ["http://www.w3.org/StyleSheets/TR/W3C-TR.css", "http://dev.w3.org/2009/dap/ReSpec.js/css/respec.css"],
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    46
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    47
        // editors, add as many as you like
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    48
        // only "name" is required
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    49
        editors:  [
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    50
            { name: "Vincent Scheib", url: "http://www.scheib.net",
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    51
        company: "Google", companyURL: "http://www.google.com/" },
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    52
        ],
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    53
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    54
        // authors, add as many as you like.
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    55
        // This is optional, uncomment if you have authors as well as editors.
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    56
        // only "name" is required. Same format as editors.
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    57
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    58
        //authors:  [
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    59
        //    { name: "Your Name", url: "http://example.org/",
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    60
        //      company: "Your Company", companyURL: "http://example.com/" },
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    61
        //],
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    62
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    63
        // name of the WG
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    64
        wg:           "Web Events Working Group",
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    65
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    66
        // URI of the public WG page
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    67
        wgURI:        "http://www.w3.org/2010/webevents/",
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    68
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    69
        // name (with the @w3c.org) of the public mailing to which comments are due
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    70
        wgPublicList: "public-webevents",
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    71
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    72
        // URI of the patent status for this WG, for Rec-track documents
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    73
        // !!!! IMPORTANT !!!!
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    74
        // This is important for Rec-track documents, do not copy a patent URI from a random
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    75
        // document unless you know what you're doing. If in doubt ask your friendly neighbourhood
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    76
        // Team Contact.
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    77
        wgPatentURI:  "http://www.w3.org/2004/01/pp-impl/45559/status",
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    78
      };
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    79
    </script>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    80
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    81
    <style type="text/css">
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    82
      .event {
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    83
        font-family: monospace;
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    84
        color: #459900;
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    85
      }
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    86
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    87
      pre.idl {
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    88
        white-space: pre-wrap;
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    89
      }
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    90
    </style>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    91
  </head>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    92
  <body>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    93
    <section id='abstract'>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    94
      This specification defines an API that provides scripted access to raw
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    95
      mouse movement data while locking the target of mouse events to a single
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    96
      element and removing the cursor from view.  This is an essential input
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    97
      mode for certain classes of applications, especially first person
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    98
      perspective 3D applications and 3D modelling software.
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
    99
    </section>
133
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   100
    
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   101
    <section id="sotd"> <!-- Status of This Document -->
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   102
      Conversion in progress from the <a href="http://goo.gl/9G8pd">Version 
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   103
      0.8, 2011-10-20 Draft Spec</a> Google Document.
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   104
    </section>
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   105
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   106
    </section> 
132
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   107
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   108
    <section id='introduction' class='informative'>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   109
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   110
      <h2>Introduction</h2>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   111
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   112
      <p>The Mouse Lock API provides for input methods of applications based on 
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   113
      the movement of the mouse, not just the absolute position of a cursor.  A 
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   114
      popular example is that of first person movement controls in three 
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   115
      dimensional graphics applications such as games.  Movement of the mouse is 
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   116
      interpreted for rotation of the view-port, there is no limit to how far 
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   117
      movement can go, and no mouse cursor is displayed.</p>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   118
      
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   119
      <p>Mouse Lock is related to Mouse Capture [MDCCAP].  Capture provides 
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   120
      continued event delivery to a target element while a mouse is being 
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   121
      dragged, but ceases when the mouse button is released.  Mouse Lock differs 
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   122
      by being persistent, not limited by screen boundaries, sending events 
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   123
      regardless of mouse button state, hiding the cursor, and not releasing 
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   124
      until an API call or specific release gesture by the user.</p> 
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   125
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   126
    </section>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   127
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   128
    <section id='conformance'>
133
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   129
      <p class="issue" id="issue-whatever">
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   130
        Please check this section is OK . 
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   131
      </p>
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   132
132
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   133
      <p>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   134
        This specification defines conformance criteria that apply to a single
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   135
        product: the <dfn id="dfn-user-agent">user agent</dfn> that implements
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   136
        the interfaces that it contains.
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   137
      </p>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   138
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   139
      <p>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   140
        Implementations that use ECMAScript to implement the APIs defined in
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   141
        this specification MUST implement them in a manner consistent with the
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   142
        ECMAScript Bindings defined in the Web IDL specification [[!WEBIDL]] as
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   143
        this specification uses that specification and terminology.
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   144
      </p>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   145
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   146
      <p>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   147
        A conforming implementation is required to implement all fields
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   148
        defined in this specification.
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   149
      </p>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   150
    </section>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   151
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   152
    <section>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   153
      <h2><a>Document</a> Interface extension</h2>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   154
      <p>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   155
        The <a>Document</a> interface [[!DOM-LEVEL-3-CORE]] contains methods
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   156
        providing the ability to enter, exit, and poll the state of mouse lock.
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   157
      </p>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   158
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   159
      <dl title='partial interface Document' class='idl'>
133
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   160
        <dt>void <dfn>lockMouse</dfn>()</dt>
132
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   161
        <dd>
133
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   162
          <p>The <code>lockMouse</code> method requests that the mouse be locked 
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   163
          to a given DOM element <code>target</code>. It must immediately
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   164
          return. Two optional callback parameters provide asynchronous 
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   165
          notification of success (<code>successCallback</code>) or failure
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   166
          (<code>failureCallback</code>) to acquire the locked state. The user 
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   167
          agent must determine if mouse lock state will be entered and call the 
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   168
          appropriate callback if it was provided.  Because a user agent may 
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   169
          prompt a user for permission to enter mouse lock the response must be 
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   170
          asynchronous.</p>
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   171
132
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   172
          <dl class='parameters'>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   173
            <dt>in Element target</dt> <dd></dd>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   174
            <dt>in optional VoidCallback successCallback</dt> <dd></dd>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   175
            <dt>in optional VoidCallback failureCallback</dt> <dd></dd>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   176
          </dl>
133
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   177
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   178
          <p>Mouse lock must succeed only if the window is in focus and the 
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   179
          user-agent is the active application of the operating system. The 
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   180
          target element of <a>lockMouse</a>() need not be in focus.</p>
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   181
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   182
          <p>Mouse lock must succeed only if the target element is in the DOM 
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   183
          tree. If the target element is removed from the DOM tree after mouse 
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   184
          lock is entered then mouse lock will be lost.</p>
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   185
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   186
          <p>If the mouse is already locked to the same element, a repeated 
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   187
          call to lockMouse() will succeed and the <code>successCallback</code> called. If 
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   188
          another element is locked a user agent must transfer the mouse lock to 
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   189
          the new target and call the <a>mouselocklost</a> callback for the previous 
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   190
          target.</p>
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   191
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   192
          <p>Once in the locked state the user agent must fire all relevant user 
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   193
          generated <code>MouseEvent</code> events (for example: <code>mousemove</code>, <code>mousedown</code>, 
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   194
          <code>mouseup</code>, <code>click</code>, <code>wheel</code>)[DOMMOUSE] to the target of mouse lock, and 
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   195
          not fire mouse events to other elements. Events that require the 
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   196
          concept of a mouse cursor must not be dispatched (for example: 
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   197
          <code>mouseover</code>, <code>mouseout</code>). In the locked state the system mouse cursor 
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   198
          must be hidden. Movement and button presses of the mouse must not 
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   199
          cause the window to lose focus.</p>
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   200
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   201
          <p>Synthetic mouse events created by application script act the same 
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   202
          regardless of lock state.<p>
d6110048bf5c Mouse Lock: Work in progress on initial spec conversion: Document interface
Vincent Scheib <scheib@google.com>
parents: 132
diff changeset
   203
132
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   204
        </dd>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   205
      </dl>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   206
    </section>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   207
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   208
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   209
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   210
    <section class='appendix informative'>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   211
      <h2>Acknowledgements</h2>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   212
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   213
      <p>Many have made contributions to the discussions of this
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   214
        specification:</p>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   215
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   216
      <ul>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   217
        <li>Adam Barth</li>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   218
        <li>Alexey Proskuryakov</li>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   219
        <li>Aryeh Gregor</li>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   220
        <li>Brandon Andrews</li>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   221
        <li>Glenn Maynard</li>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   222
        <li>Gregg Tavares</li>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   223
        <li>John Villar</li>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   224
        <li>Jonas Sicking</li>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   225
        <li>Klaas Heidstra</li>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   226
        <li>Olli Pettay</li>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   227
        <li>Robert O'Callahan</li>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   228
        <li>Tab Atkins Jr.</li>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   229
      </ul>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   230
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   231
      <p>Please let me know if I have inadvertently omitted your name.</p>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   232
    </section>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   233
  </body>
4ec3f28f3e93 Mouse Lock: Work in progress on initial spec conversion
Vincent Scheib <scheib@google.com>
parents:
diff changeset
   234
</html>