15c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)/*
2591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch * Copyright (C) 2011 Google Inc. All rights reserved.
4591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch * Copyright (C) 2013 Samsung Electronics. All rights reserved.
55c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *
65c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * Redistribution and use in source and binary forms, with or without
75c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * modification, are permitted provided that the following conditions
85c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * are met:
95c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * 1. Redistributions of source code must retain the above copyright
105c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *    notice, this list of conditions and the following disclaimer.
115c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * 2. Redistributions in binary form must reproduce the above copyright
125c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *    notice, this list of conditions and the following disclaimer in the
135c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *    documentation and/or other materials provided with the distribution.
145c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *
155c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
165c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
175c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
185c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
195c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
205c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
215c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
225c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
235c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
245c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2581a5157921f1d2a7ff6aae115bfe3c139b38a5c8Torne (Richard Coles) * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
265c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) */
275c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
28a9984bf9ddc3cf73fdae3f29134a2bab379e7029Ben Murdoch// http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#windowtimers
29a9984bf9ddc3cf73fdae3f29134a2bab379e7029Ben Murdoch
305c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)[
31a9984bf9ddc3cf73fdae3f29134a2bab379e7029Ben Murdoch    ImplementedAs=DOMWindowTimers,
32a9984bf9ddc3cf73fdae3f29134a2bab379e7029Ben Murdoch    LegacyTreatAsPartialInterface,
33a9984bf9ddc3cf73fdae3f29134a2bab379e7029Ben Murdoch    NoInterfaceObject, // Always used on target of 'implements'
34591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch] interface WindowTimers {
35a9984bf9ddc3cf73fdae3f29134a2bab379e7029Ben Murdoch    // FIXME: currently using [Custom] and |any| because overload algorithm
36a9984bf9ddc3cf73fdae3f29134a2bab379e7029Ben Murdoch    // can't handle Function/DOMString overload properly
37a9984bf9ddc3cf73fdae3f29134a2bab379e7029Ben Murdoch    // http://crbug.com/293561
38a9984bf9ddc3cf73fdae3f29134a2bab379e7029Ben Murdoch    // FIXME: would be clearer as a union type, like:
39a9984bf9ddc3cf73fdae3f29134a2bab379e7029Ben Murdoch    // typedef (Function or DOMString) Handler
40a9984bf9ddc3cf73fdae3f29134a2bab379e7029Ben Murdoch    // Needs spec update and better union support: http://crbug.com/240176
41591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch    [Custom] long setTimeout(any handler, [Default=Undefined] optional long timeout);
42591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch    void clearTimeout([Default=Undefined] optional long handle);
43591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch    [Custom] long setInterval(any handler, [Default=Undefined] optional long timeout);
44591b958dee2cf159d33a0b931e6231072eaf38d5Ben Murdoch    void clearInterval([Default=Undefined] optional long handle);
455c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)};
46