diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index d89aefdb..cca5ae69 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -3019,6 +3019,14 @@ Volt: tm_scope: source.d ace_mode: d +WebIDL: + type: programming + extensions: + - .webidl + tm_scope: none + ace_mode: none + + XC: type: programming extensions: diff --git a/samples/WebIDL/AnimationEvent.webidl b/samples/WebIDL/AnimationEvent.webidl new file mode 100644 index 00000000..e48ed571 --- /dev/null +++ b/samples/WebIDL/AnimationEvent.webidl @@ -0,0 +1,25 @@ +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. + * + * The origin of this IDL file is + * http://www.w3.org/TR/css3-animations/#animation-events- + * http://dev.w3.org/csswg/css3-animations/#animation-events- + * + * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C + * liability, trademark and document use rules apply. + */ + +[Constructor(DOMString type, optional AnimationEventInit eventInitDict)] +interface AnimationEvent : Event { + readonly attribute DOMString animationName; + readonly attribute float elapsedTime; + readonly attribute DOMString pseudoElement; +}; + +dictionary AnimationEventInit : EventInit { + DOMString animationName = ""; + float elapsedTime = 0; + DOMString pseudoElement = ""; +}; diff --git a/samples/WebIDL/Fetch.webidl b/samples/WebIDL/Fetch.webidl new file mode 100644 index 00000000..fb022126 --- /dev/null +++ b/samples/WebIDL/Fetch.webidl @@ -0,0 +1,35 @@ +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. + * + * The origin of this IDL file is + * http://fetch.spec.whatwg.org/ + */ + +typedef object JSON; +// FIXME(nsm): Bug 739173: FormData is not available in workers. +// typedef (ArrayBuffer or ArrayBufferView or Blob or FormData or USVString or URLSearchParams) BodyInit; +typedef (ArrayBuffer or ArrayBufferView or Blob or USVString or URLSearchParams) BodyInit; + +[NoInterfaceObject, Exposed=(Window,Worker)] +interface Body { + readonly attribute boolean bodyUsed; + [Throws] + Promise arrayBuffer(); + [Throws] + Promise blob(); + // FIXME(nsm): Bug 739173 FormData is not supported in workers. + // Promise formData(); + [Throws] + Promise json(); + [Throws] + Promise text(); +}; + +[NoInterfaceObject, Exposed=(Window,Worker)] +interface GlobalFetch { + [Throws, Func="mozilla::dom::Headers::PrefEnabled"] + Promise fetch(RequestInfo input, optional RequestInit init); +}; +