summaryrefslogtreecommitdiff
path: root/dom/webidl
diff options
context:
space:
mode:
authorPale Moon <git-repo@palemoon.org>2016-09-01 13:39:08 +0200
committerPale Moon <git-repo@palemoon.org>2016-09-01 13:39:08 +0200
commit3d8ce1a11a7347cc94a937719c4bc8df46fb8d14 (patch)
tree8c26ca375a6312751c00a27e1653fb6f189f0463 /dom/webidl
parente449bdb1ec3a82f204bffdd9c3c54069d086eee3 (diff)
downloadpalemoon-gre-3d8ce1a11a7347cc94a937719c4bc8df46fb8d14.tar.gz
Base import of Tycho code (warning: huge commit)
Diffstat (limited to 'dom/webidl')
-rw-r--r--dom/webidl/APZTestData.webidl37
-rw-r--r--dom/webidl/AbortablePromise.webidl19
-rw-r--r--dom/webidl/AbstractWorker.webidl10
-rw-r--r--dom/webidl/ActivityRequestHandler.webidl17
-rw-r--r--dom/webidl/AlarmsManager.webidl19
-rw-r--r--dom/webidl/AnalyserNode.webidl9
-rw-r--r--dom/webidl/Animatable.webidl17
-rw-r--r--dom/webidl/Animation.webidl21
-rw-r--r--dom/webidl/AnimationEffect.webidl16
-rw-r--r--dom/webidl/AnimationPlayer.webidl50
-rw-r--r--dom/webidl/AnimationTimeline.webidl20
-rw-r--r--dom/webidl/AnonymousContent.webidl56
-rw-r--r--dom/webidl/AppInfo.webidl12
-rw-r--r--dom/webidl/AppNotificationServiceOptions.webidl19
-rw-r--r--dom/webidl/Apps.webidl130
-rw-r--r--dom/webidl/ArchiveReader.webidl2
-rw-r--r--dom/webidl/ArchiveRequest.webidl1
-rw-r--r--dom/webidl/Attr.webidl5
-rw-r--r--dom/webidl/AudioBuffer.webidl5
-rw-r--r--dom/webidl/AudioBufferSourceNode.webidl25
-rw-r--r--dom/webidl/AudioChannel.webidl49
-rw-r--r--dom/webidl/AudioChannelManager.webidl7
-rw-r--r--dom/webidl/AudioContext.webidl87
-rw-r--r--dom/webidl/AudioDestinationNode.webidl1
-rw-r--r--dom/webidl/AudioListener.webidl1
-rw-r--r--dom/webidl/AudioNode.webidl13
-rw-r--r--dom/webidl/AudioParam.webidl13
-rw-r--r--dom/webidl/AudioProcessingEvent.webidl10
-rw-r--r--dom/webidl/AudioTrack.webidl17
-rw-r--r--dom/webidl/AudioTrackList.webidl19
-rw-r--r--dom/webidl/AutocompleteErrorEvent.webidl23
-rw-r--r--dom/webidl/AutocompleteInfo.webidl17
-rw-r--r--dom/webidl/BatteryManager.webidl4
-rw-r--r--dom/webidl/BeforeAfterKeyboardEvent.webidl24
-rw-r--r--dom/webidl/BiquadFilterNode.webidl29
-rw-r--r--dom/webidl/Blob.webidl19
-rw-r--r--dom/webidl/BlobEvent.webidl3
-rw-r--r--dom/webidl/BluetoothAdapter.webidl161
-rw-r--r--dom/webidl/BluetoothAdapter2.webidl180
-rw-r--r--dom/webidl/BluetoothAdapterEvent.webidl19
-rw-r--r--dom/webidl/BluetoothAttributeEvent.webidl21
-rw-r--r--dom/webidl/BluetoothClassOfDevice.webidl42
-rw-r--r--dom/webidl/BluetoothDevice.webidl23
-rw-r--r--dom/webidl/BluetoothDevice2.webidl60
-rw-r--r--dom/webidl/BluetoothDeviceEvent.webidl6
-rw-r--r--dom/webidl/BluetoothDiscoveryHandle.webidl9
-rw-r--r--dom/webidl/BluetoothDiscoveryStateChangedEvent.webidl19
-rw-r--r--dom/webidl/BluetoothGatt.webidl38
-rw-r--r--dom/webidl/BluetoothManager.webidl17
-rw-r--r--dom/webidl/BluetoothManager2.webidl27
-rw-r--r--dom/webidl/BluetoothPairingEvent.webidl20
-rw-r--r--dom/webidl/BluetoothPairingHandle.webidl20
-rw-r--r--dom/webidl/BluetoothPairingListener.webidl13
-rw-r--r--dom/webidl/BluetoothStatusChangedEvent.webidl20
-rw-r--r--dom/webidl/BoxObject.webidl33
-rw-r--r--dom/webidl/BroadcastChannel.webidl22
-rw-r--r--dom/webidl/BrowserElement.webidl148
-rw-r--r--dom/webidl/BrowserElementDictionaries.webidl29
-rw-r--r--dom/webidl/BrowserFeedWriter.webidl20
-rw-r--r--dom/webidl/CFStateChangeEvent.webidl39
-rw-r--r--dom/webidl/CSPReport.webidl23
-rw-r--r--dom/webidl/CSS.webidl11
-rw-r--r--dom/webidl/CSS2PropertiesProps.h17
-rw-r--r--dom/webidl/CSSFontFaceLoadEvent.webidl21
-rw-r--r--dom/webidl/CSSRuleList.webidl10
-rw-r--r--dom/webidl/CSSStyleDeclaration.webidl8
-rw-r--r--dom/webidl/CSSStyleSheet.webidl1
-rw-r--r--dom/webidl/CallEvent.webidl3
-rw-r--r--dom/webidl/CallGroupErrorEvent.webidl20
-rw-r--r--dom/webidl/CallsList.webidl11
-rw-r--r--dom/webidl/CameraCapabilities.webidl92
-rw-r--r--dom/webidl/CameraClosedEvent.webidl (renamed from dom/webidl/ClientRect.webidl)16
-rw-r--r--dom/webidl/CameraConfigurationEvent.webidl22
-rw-r--r--dom/webidl/CameraControl.webidl470
-rw-r--r--dom/webidl/CameraFacesDetectedEvent.webidl18
-rw-r--r--dom/webidl/CameraManager.webidl104
-rw-r--r--dom/webidl/CameraStateChangeEvent.webidl16
-rw-r--r--dom/webidl/CameraUtil.webidl12
-rw-r--r--dom/webidl/CanvasRenderingContext2D.webidl89
-rw-r--r--dom/webidl/CaretPosition.webidl2
-rw-r--r--dom/webidl/ChannelMergerNode.webidl1
-rw-r--r--dom/webidl/ChannelSplitterNode.webidl1
-rw-r--r--dom/webidl/CharacterData.webidl5
-rw-r--r--dom/webidl/ChildNode.webidl12
-rw-r--r--dom/webidl/ChromeNotifications.webidl14
-rw-r--r--dom/webidl/Client.webidl17
-rw-r--r--dom/webidl/Clients.webidl30
-rw-r--r--dom/webidl/ClipboardEvent.webidl2
-rw-r--r--dom/webidl/CloseEvent.webidl15
-rw-r--r--dom/webidl/CompositionEvent.webidl4
-rw-r--r--dom/webidl/Console.webidl97
-rw-r--r--dom/webidl/Constraints.webidl53
-rw-r--r--dom/webidl/Contacts.webidl130
-rw-r--r--dom/webidl/ContainerBoxObject.webidl (renamed from dom/webidl/MobileMessageManager.webidl)12
-rw-r--r--dom/webidl/ConvolverNode.webidl4
-rw-r--r--dom/webidl/Crypto.webidl22
-rw-r--r--dom/webidl/CustomEvent.webidl5
-rw-r--r--dom/webidl/DOMCursor.webidl4
-rw-r--r--dom/webidl/DOMError.webidl3
-rw-r--r--dom/webidl/DOMException.webidl111
-rw-r--r--dom/webidl/DOMImplementation.webidl2
-rw-r--r--dom/webidl/DOMMatrix.webidl148
-rw-r--r--dom/webidl/DOMMobileMessageError.webidl12
-rw-r--r--dom/webidl/DOMParser.webidl8
-rw-r--r--dom/webidl/DOMPoint.webidl37
-rw-r--r--dom/webidl/DOMQuad.webidl23
-rw-r--r--dom/webidl/DOMRect.webidl32
-rw-r--r--dom/webidl/DOMRectList.webidl (renamed from dom/webidl/ClientRectList.webidl)5
-rw-r--r--dom/webidl/DOMRequest.webidl17
-rw-r--r--dom/webidl/DOMStringList.webidl1
-rw-r--r--dom/webidl/DOMTokenList.webidl4
-rw-r--r--dom/webidl/DOMTransactionEvent.webidl9
-rw-r--r--dom/webidl/DataChannel.webidl4
-rw-r--r--dom/webidl/DataContainerEvent.webidl1
-rw-r--r--dom/webidl/DataErrorEvent.webidl3
-rw-r--r--dom/webidl/DataStore.webidl112
-rw-r--r--dom/webidl/DataStoreChangeEvent.webidl24
-rw-r--r--dom/webidl/DataStoreImpl.webidl61
-rw-r--r--dom/webidl/DataTransfer.webidl137
-rw-r--r--dom/webidl/DedicatedWorkerGlobalScope.webidl22
-rw-r--r--dom/webidl/DelayNode.webidl4
-rw-r--r--dom/webidl/DesktopNotification.webidl4
-rw-r--r--dom/webidl/DeviceLightEvent.webidl4
-rw-r--r--dom/webidl/DeviceMotionEvent.webidl58
-rw-r--r--dom/webidl/DeviceOrientationEvent.webidl20
-rw-r--r--dom/webidl/DeviceProximityEvent.webidl2
-rw-r--r--dom/webidl/DeviceStorage.webidl43
-rw-r--r--dom/webidl/DeviceStorageChangeEvent.webidl3
-rw-r--r--dom/webidl/Directory.webidl98
-rw-r--r--dom/webidl/Document.webidl157
-rw-r--r--dom/webidl/DocumentFragment.webidl2
-rw-r--r--dom/webidl/DownloadEvent.webidl18
-rw-r--r--dom/webidl/Downloads.webidl102
-rw-r--r--dom/webidl/DragEvent.webidl5
-rw-r--r--dom/webidl/DummyBinding.webidl15
-rw-r--r--dom/webidl/DynamicsCompressorNode.webidl4
-rw-r--r--dom/webidl/Element.webidl123
-rw-r--r--dom/webidl/ElementReplaceEvent.webidl23
-rw-r--r--dom/webidl/EngineeringMode.webidl13
-rw-r--r--dom/webidl/ErrorEvent.webidl24
-rw-r--r--dom/webidl/Event.webidl49
-rw-r--r--dom/webidl/EventHandler.webidl158
-rw-r--r--dom/webidl/EventSource.webidl12
-rw-r--r--dom/webidl/EventTarget.webidl1
-rw-r--r--dom/webidl/ExtendableEvent.webidl19
-rw-r--r--dom/webidl/External.webidl18
-rw-r--r--dom/webidl/FMRadio.webidl176
-rw-r--r--dom/webidl/Fetch.webidl35
-rw-r--r--dom/webidl/FetchEvent.webidl27
-rw-r--r--dom/webidl/File.webidl45
-rw-r--r--dom/webidl/FileList.webidl2
-rw-r--r--dom/webidl/FileReader.webidl6
-rw-r--r--dom/webidl/FileReaderSync.webidl5
-rw-r--r--dom/webidl/FontFace.webidl48
-rw-r--r--dom/webidl/FontFaceSet.webidl63
-rw-r--r--dom/webidl/FontFaceSource.webidl18
-rw-r--r--dom/webidl/GainNode.webidl4
-rw-r--r--dom/webidl/Gamepad.webidl28
-rw-r--r--dom/webidl/GamepadAxisMoveEvent.webidl3
-rw-r--r--dom/webidl/GamepadButtonEvent.webidl3
-rw-r--r--dom/webidl/GamepadEvent.webidl3
-rw-r--r--dom/webidl/Geolocation.webidl4
-rw-r--r--dom/webidl/GeometryUtils.webidl38
-rw-r--r--dom/webidl/GetUserMediaRequest.webidl16
-rw-r--r--dom/webidl/HTMLAllCollection.webidl13
-rw-r--r--dom/webidl/HTMLAnchorElement.webidl4
-rw-r--r--dom/webidl/HTMLAppletElement.webidl2
-rw-r--r--dom/webidl/HTMLAreaElement.webidl7
-rw-r--r--dom/webidl/HTMLAudioElement.webidl17
-rw-r--r--dom/webidl/HTMLCanvasElement.webidl21
-rw-r--r--dom/webidl/HTMLCollection.webidl3
-rw-r--r--dom/webidl/HTMLContentElement.webidl19
-rw-r--r--dom/webidl/HTMLDocument.webidl41
-rw-r--r--dom/webidl/HTMLElement.webidl27
-rw-r--r--dom/webidl/HTMLEmbedElement.webidl2
-rw-r--r--dom/webidl/HTMLFormControlsCollection.webidl17
-rw-r--r--dom/webidl/HTMLFormElement.webidl3
-rw-r--r--dom/webidl/HTMLIFrameElement.webidl5
-rw-r--r--dom/webidl/HTMLImageElement.webidl16
-rw-r--r--dom/webidl/HTMLInputElement.webidl38
-rw-r--r--dom/webidl/HTMLLegendElement.webidl1
-rw-r--r--dom/webidl/HTMLLinkElement.webidl15
-rw-r--r--dom/webidl/HTMLMediaElement.webidl79
-rw-r--r--dom/webidl/HTMLMenuElement.webidl6
-rw-r--r--dom/webidl/HTMLObjectElement.webidl30
-rw-r--r--dom/webidl/HTMLOptionElement.webidl1
-rw-r--r--dom/webidl/HTMLOptionsCollection.webidl2
-rw-r--r--dom/webidl/HTMLPictureElement.webidl9
-rw-r--r--dom/webidl/HTMLPropertiesCollection.webidl2
-rw-r--r--dom/webidl/HTMLScriptElement.webidl2
-rw-r--r--dom/webidl/HTMLSelectElement.webidl4
-rw-r--r--dom/webidl/HTMLShadowElement.webidl18
-rw-r--r--dom/webidl/HTMLSourceElement.webidl7
-rw-r--r--dom/webidl/HTMLTableColElement.webidl6
-rw-r--r--dom/webidl/HTMLTextAreaElement.webidl7
-rw-r--r--dom/webidl/HTMLTrackElement.webidl4
-rw-r--r--dom/webidl/HTMLVideoElement.webidl6
-rw-r--r--dom/webidl/HashChangeEvent.webidl13
-rw-r--r--dom/webidl/Headers.webidl35
-rw-r--r--dom/webidl/History.webidl29
-rw-r--r--dom/webidl/IDBCursor.webidl45
-rw-r--r--dom/webidl/IDBDatabase.webidl51
-rw-r--r--dom/webidl/IDBEnvironment.webidl14
-rw-r--r--dom/webidl/IDBFactory.webidl35
-rw-r--r--dom/webidl/IDBFileHandle.webidl50
-rw-r--r--dom/webidl/IDBFileRequest.webidl (renamed from dom/webidl/FileRequest.webidl)9
-rw-r--r--dom/webidl/IDBIndex.webidl56
-rw-r--r--dom/webidl/IDBKeyRange.webidl30
-rw-r--r--dom/webidl/IDBMutableFile.webidl (renamed from dom/webidl/FileHandle.webidl)10
-rw-r--r--dom/webidl/IDBObjectStore.webidl79
-rw-r--r--dom/webidl/IDBOpenDBRequest.webidl15
-rw-r--r--dom/webidl/IDBRequest.webidl31
-rw-r--r--dom/webidl/IDBTransaction.webidl39
-rw-r--r--dom/webidl/IDBVersionChangeEvent.webidl16
-rw-r--r--dom/webidl/IccCardLockError.webidl12
-rw-r--r--dom/webidl/IccCardLockErrorEvent.webidl18
-rw-r--r--dom/webidl/IccChangeEvent.webidl19
-rw-r--r--dom/webidl/Identity.webidl70
-rw-r--r--dom/webidl/ImageCapture.webidl28
-rw-r--r--dom/webidl/ImageCaptureErrorEvent.webidl32
-rw-r--r--dom/webidl/ImageData.webidl5
-rw-r--r--dom/webidl/ImageDocument.webidl4
-rw-r--r--dom/webidl/InputEvent.webidl (renamed from dom/webidl/SmartCardEvent.webidl)10
-rw-r--r--dom/webidl/InputMethod.webidl265
-rw-r--r--dom/webidl/InspectorUtils.webidl13
-rw-r--r--dom/webidl/InstallEvent.webidl21
-rw-r--r--dom/webidl/InstallTrigger.webidl90
-rw-r--r--dom/webidl/InterAppConnection.webidl15
-rw-r--r--dom/webidl/InterAppConnectionRequest.webidl13
-rw-r--r--dom/webidl/InterAppMessagePort.webidl24
-rw-r--r--dom/webidl/KeyAlgorithm.webidl37
-rw-r--r--dom/webidl/KeyEvent.webidl8
-rw-r--r--dom/webidl/KeyboardEvent.webidl27
-rw-r--r--dom/webidl/LegacyQueryInterface.webidl91
-rw-r--r--dom/webidl/ListBoxObject.webidl21
-rw-r--r--dom/webidl/Location.webidl11
-rw-r--r--dom/webidl/MMICall.webidl13
-rw-r--r--dom/webidl/MediaDevices.webidl23
-rw-r--r--dom/webidl/MediaElementAudioSourceNode.webidl19
-rw-r--r--dom/webidl/MediaList.webidl19
-rw-r--r--dom/webidl/MediaQueryList.webidl20
-rw-r--r--dom/webidl/MediaRecorder.webidl54
-rw-r--r--dom/webidl/MediaSource.webidl40
-rw-r--r--dom/webidl/MediaStream.webidl26
-rw-r--r--dom/webidl/MediaStreamAudioDestinationNode.webidl3
-rw-r--r--dom/webidl/MediaStreamAudioSourceNode.webidl19
-rw-r--r--dom/webidl/MediaStreamError.webidl21
-rw-r--r--dom/webidl/MediaStreamEvent.webidl1
-rw-r--r--dom/webidl/MediaStreamList.webidl2
-rw-r--r--dom/webidl/MediaStreamTrack.webidl6
-rw-r--r--dom/webidl/MediaStreamTrackEvent.webidl22
-rw-r--r--dom/webidl/MediaTrackConstraintSet.webidl38
-rw-r--r--dom/webidl/MenuBoxObject.webidl19
-rw-r--r--dom/webidl/MessageChannel.webidl14
-rw-r--r--dom/webidl/MessageEvent.webidl28
-rw-r--r--dom/webidl/MessagePort.webidl21
-rw-r--r--dom/webidl/MessagePortList.webidl11
-rw-r--r--dom/webidl/MimeType.webidl12
-rw-r--r--dom/webidl/MimeTypeArray.webidl12
-rw-r--r--dom/webidl/MouseEvent.webidl27
-rw-r--r--dom/webidl/MouseScrollEvent.webidl4
-rw-r--r--dom/webidl/MozActivity.webidl9
-rw-r--r--dom/webidl/MozApplicationEvent.webidl7
-rw-r--r--dom/webidl/MozCellBroadcast.webidl20
-rw-r--r--dom/webidl/MozCellBroadcastEvent.webidl6
-rw-r--r--dom/webidl/MozCellBroadcastMessage.webidl100
-rw-r--r--dom/webidl/MozClirModeEvent.webidl22
-rw-r--r--dom/webidl/MozContactChangeEvent.webidl2
-rw-r--r--dom/webidl/MozEmergencyCbModeEvent.webidl26
-rw-r--r--dom/webidl/MozIcc.webidl358
-rw-r--r--dom/webidl/MozIccInfo.webidl71
-rw-r--r--dom/webidl/MozIccManager.webidl275
-rw-r--r--dom/webidl/MozInterAppMessageEvent.webidl15
-rw-r--r--dom/webidl/MozIsoDepTech.webidl13
-rw-r--r--dom/webidl/MozMessageDeletedEvent.webidl23
-rw-r--r--dom/webidl/MozMmsEvent.webidl5
-rw-r--r--dom/webidl/MozMmsMessage.webidl15
-rw-r--r--dom/webidl/MozMobileCellInfo.webidl67
-rw-r--r--dom/webidl/MozMobileConnection.webidl669
-rw-r--r--dom/webidl/MozMobileConnectionArray.webidl11
-rw-r--r--dom/webidl/MozMobileConnectionInfo.webidl66
-rw-r--r--dom/webidl/MozMobileMessageManager.webidl170
-rw-r--r--dom/webidl/MozMobileNetworkInfo.webidl34
-rw-r--r--dom/webidl/MozNDEFRecord.webidl58
-rw-r--r--dom/webidl/MozNFC.webidl140
-rw-r--r--dom/webidl/MozNFCPeer.webidl38
-rw-r--r--dom/webidl/MozNFCPeerEvent.webidl21
-rw-r--r--dom/webidl/MozNFCTag.webidl121
-rw-r--r--dom/webidl/MozNFCTagEvent.webidl29
-rw-r--r--dom/webidl/MozNetworkStats.webidl74
-rw-r--r--dom/webidl/MozNetworkStatsAlarm.webidl14
-rw-r--r--dom/webidl/MozNetworkStatsData.webidl13
-rw-r--r--dom/webidl/MozNetworkStatsInterface.webidl26
-rw-r--r--dom/webidl/MozOtaStatusEvent.webidl33
-rw-r--r--dom/webidl/MozPaymentProvider.webidl33
-rw-r--r--dom/webidl/MozPowerManager.webidl96
-rw-r--r--dom/webidl/MozSelfSupport.webidl42
-rw-r--r--dom/webidl/MozSettingsEvent.webidl3
-rw-r--r--dom/webidl/MozSettingsTransactionEvent.webidl17
-rw-r--r--dom/webidl/MozSmsEvent.webidl5
-rw-r--r--dom/webidl/MozSpeakerManager.webidl18
-rw-r--r--dom/webidl/MozStkCommandEvent.webidl707
-rw-r--r--dom/webidl/MozTetheringManager.webidl57
-rw-r--r--dom/webidl/MozTimeManager.webidl2
-rw-r--r--dom/webidl/MozVoicemail.webidl37
-rw-r--r--dom/webidl/MozVoicemailEvent.webidl6
-rw-r--r--dom/webidl/MozVoicemailStatus.webidl47
-rw-r--r--dom/webidl/MozWakeLock.webidl18
-rw-r--r--dom/webidl/MozWifiCapabilities.webidl46
-rw-r--r--dom/webidl/MozWifiConnectionInfoEvent.webidl22
-rw-r--r--dom/webidl/MozWifiManager.webidl345
-rw-r--r--dom/webidl/MozWifiP2pManager.webidl147
-rw-r--r--dom/webidl/MozWifiP2pStatusChangeEvent.webidl20
-rw-r--r--dom/webidl/MozWifiStationInfoEvent.webidl19
-rw-r--r--dom/webidl/MozWifiStatusChangeEvent.webidl12
-rw-r--r--dom/webidl/MutationObserver.webidl26
-rw-r--r--dom/webidl/NamedNodeMap.webidl (renamed from dom/webidl/MozNamedAttrMap.webidl)6
-rw-r--r--dom/webidl/NativeOSFileInternals.webidl21
-rw-r--r--dom/webidl/Navigator.webidl420
-rw-r--r--dom/webidl/NetDashboard.webidl82
-rw-r--r--dom/webidl/NetworkInformation.webidl25
-rw-r--r--dom/webidl/NetworkOptions.webidl99
-rw-r--r--dom/webidl/NfcOptions.webidl60
-rw-r--r--dom/webidl/Node.webidl19
-rw-r--r--dom/webidl/Notification.webidl48
-rw-r--r--dom/webidl/NotifyAudioAvailableEvent.webidl22
-rw-r--r--dom/webidl/NotifyPaintEvent.webidl4
-rw-r--r--dom/webidl/OfflineAudioCompletionEvent.webidl1
-rw-r--r--dom/webidl/OfflineAudioContext.webidl9
-rw-r--r--dom/webidl/OfflineResourceList.webidl8
-rw-r--r--dom/webidl/OscillatorNode.webidl41
-rw-r--r--dom/webidl/PageTransitionEvent.webidl9
-rw-r--r--dom/webidl/PaintRequest.webidl2
-rw-r--r--dom/webidl/PannerNode.webidl35
-rw-r--r--dom/webidl/ParentNode.webidl24
-rw-r--r--dom/webidl/PeerConnectionImpl.webidl88
-rw-r--r--dom/webidl/PeerConnectionImplEnums.webidl42
-rw-r--r--dom/webidl/PeerConnectionObserver.webidl47
-rw-r--r--dom/webidl/PeerConnectionObserverEnums.webidl16
-rw-r--r--dom/webidl/Performance.webidl44
-rw-r--r--dom/webidl/PerformanceEntry.webidl21
-rw-r--r--dom/webidl/PerformanceMark.webidl12
-rw-r--r--dom/webidl/PerformanceMeasure.webidl12
-rw-r--r--dom/webidl/PerformanceNavigation.webidl2
-rw-r--r--dom/webidl/PerformanceResourceTiming.webidl35
-rw-r--r--dom/webidl/PerformanceTiming.webidl2
-rw-r--r--dom/webidl/PeriodicWave.webidl1
-rw-r--r--dom/webidl/PermissionSettings.webidl20
-rw-r--r--dom/webidl/PhoneNumberService.webidl15
-rw-r--r--dom/webidl/Plugin.webidl16
-rw-r--r--dom/webidl/PluginArray.webidl14
-rw-r--r--dom/webidl/PluginCrashedEvent.webidl26
-rw-r--r--dom/webidl/PointerEvent.webidl37
-rw-r--r--dom/webidl/PopStateEvent.webidl10
-rw-r--r--dom/webidl/PopupBlockedEvent.webidl12
-rw-r--r--dom/webidl/PopupBoxObject.webidl175
-rw-r--r--dom/webidl/PresentationDeviceInfoManager.webidl26
-rw-r--r--dom/webidl/ProfileTimelineMarker.webidl27
-rw-r--r--dom/webidl/ProgressEvent.webidl2
-rw-r--r--dom/webidl/Promise.webidl53
-rw-r--r--dom/webidl/PromiseDebugging.webidl71
-rw-r--r--dom/webidl/PushManager.webidl16
-rw-r--r--dom/webidl/RTCConfiguration.webidl4
-rw-r--r--dom/webidl/RTCDataChannelEvent.webidl1
-rw-r--r--dom/webidl/RTCIceCandidate.webidl4
-rw-r--r--dom/webidl/RTCIdentityAssertion.webidl16
-rw-r--r--dom/webidl/RTCIdentityProvider.webidl54
-rw-r--r--dom/webidl/RTCPeerConnection.webidl118
-rw-r--r--dom/webidl/RTCPeerConnectionIceEvent.webidl1
-rw-r--r--dom/webidl/RTCPeerConnectionStatic.webidl39
-rw-r--r--dom/webidl/RTCRtpReceiver.webidl14
-rw-r--r--dom/webidl/RTCRtpSender.webidl16
-rw-r--r--dom/webidl/RTCSessionDescription.webidl4
-rw-r--r--dom/webidl/RTCStatsReport.webidl181
-rw-r--r--dom/webidl/RadioNodeList.webidl16
-rw-r--r--dom/webidl/Range.webidl6
-rw-r--r--dom/webidl/RecordErrorEvent.webidl16
-rw-r--r--dom/webidl/Request.webidl60
-rw-r--r--dom/webidl/RequestSyncManager.webidl56
-rw-r--r--dom/webidl/RequestSyncScheduler.webidl38
-rw-r--r--dom/webidl/ResourceStats.webidl68
-rw-r--r--dom/webidl/ResourceStatsManager.webidl228
-rw-r--r--dom/webidl/Response.webidl40
-rw-r--r--dom/webidl/SVGAnimatedEnumeration.webidl17
-rw-r--r--dom/webidl/SVGAnimatedInteger.webidl16
-rw-r--r--dom/webidl/SVGAnimatedLength.webidl2
-rw-r--r--dom/webidl/SVGAnimatedNumber.webidl16
-rw-r--r--dom/webidl/SVGClipPathElement.webidl4
-rw-r--r--dom/webidl/SVGComponentTransferFunctionElement.webidl7
-rw-r--r--dom/webidl/SVGDocument.webidl2
-rw-r--r--dom/webidl/SVGElement.webidl18
-rw-r--r--dom/webidl/SVGFEBlendElement.webidl17
-rw-r--r--dom/webidl/SVGFEColorMatrixElement.webidl5
-rw-r--r--dom/webidl/SVGFEComponentTransferElement.webidl3
-rw-r--r--dom/webidl/SVGFECompositeElement.webidl10
-rw-r--r--dom/webidl/SVGFEConvolveMatrixElement.webidl15
-rw-r--r--dom/webidl/SVGFEDiffuseLightingElement.webidl7
-rw-r--r--dom/webidl/SVGFEDisplacementMapElement.webidl8
-rw-r--r--dom/webidl/SVGFEDistantLightElement.webidl4
-rw-r--r--dom/webidl/SVGFEDropShadowElement.webidl28
-rw-r--r--dom/webidl/SVGFEFloodElement.webidl2
-rw-r--r--dom/webidl/SVGFEGaussianBlurElement.webidl7
-rw-r--r--dom/webidl/SVGFEImageElement.webidl1
-rw-r--r--dom/webidl/SVGFEMergeNodeElement.webidl1
-rw-r--r--dom/webidl/SVGFEMorphologyElement.webidl7
-rw-r--r--dom/webidl/SVGFEOffsetElement.webidl5
-rw-r--r--dom/webidl/SVGFEPointLightElement.webidl5
-rw-r--r--dom/webidl/SVGFESpecularLightingElement.webidl8
-rw-r--r--dom/webidl/SVGFESpotLightElement.webidl10
-rw-r--r--dom/webidl/SVGFETileElement.webidl1
-rw-r--r--dom/webidl/SVGFETurbulenceElement.webidl10
-rw-r--r--dom/webidl/SVGFilterElement.webidl12
-rw-r--r--dom/webidl/SVGFilterPrimitiveStandardAttributes.webidl5
-rw-r--r--dom/webidl/SVGGradientElement.webidl3
-rw-r--r--dom/webidl/SVGGraphicsElement.webidl11
-rw-r--r--dom/webidl/SVGLength.webidl40
-rw-r--r--dom/webidl/SVGLengthList.webidl2
-rw-r--r--dom/webidl/SVGLinearGradientElement.webidl4
-rw-r--r--dom/webidl/SVGMarkerElement.webidl9
-rw-r--r--dom/webidl/SVGMaskElement.webidl8
-rw-r--r--dom/webidl/SVGMatrix.webidl22
-rw-r--r--dom/webidl/SVGNumber.webidl18
-rw-r--r--dom/webidl/SVGNumberList.webidl2
-rw-r--r--dom/webidl/SVGPathElement.webidl42
-rw-r--r--dom/webidl/SVGPathSeg.webidl2
-rw-r--r--dom/webidl/SVGPatternElement.webidl2
-rw-r--r--dom/webidl/SVGPoint.webidl2
-rw-r--r--dom/webidl/SVGRadialGradientElement.webidl5
-rw-r--r--dom/webidl/SVGSVGElement.webidl33
-rw-r--r--dom/webidl/SVGScriptElement.webidl2
-rw-r--r--dom/webidl/SVGStopElement.webidl3
-rw-r--r--dom/webidl/SVGTextContentElement.webidl12
-rw-r--r--dom/webidl/SVGTextPathElement.webidl5
-rw-r--r--dom/webidl/SVGTextPositioningElement.webidl5
-rw-r--r--dom/webidl/SVGURIReference.webidl1
-rw-r--r--dom/webidl/Screen.webidl6
-rw-r--r--dom/webidl/ScriptProcessorNode.webidl5
-rw-r--r--dom/webidl/ScrollAreaEvent.webidl4
-rw-r--r--dom/webidl/ScrollBoxObject.webidl70
-rw-r--r--dom/webidl/ScrollViewChangeEvent.webidl21
-rw-r--r--dom/webidl/SecureElement.webidl160
-rw-r--r--dom/webidl/SecureElementManager.webidl23
-rw-r--r--dom/webidl/Selection.webidl85
-rw-r--r--dom/webidl/SelectionStateChangedEvent.webidl34
-rw-r--r--dom/webidl/ServiceWorker.webidl35
-rw-r--r--dom/webidl/ServiceWorkerContainer.webidl51
-rw-r--r--dom/webidl/ServiceWorkerGlobalScope.webidl45
-rw-r--r--dom/webidl/ServiceWorkerRegistration.webidl25
-rw-r--r--dom/webidl/SettingChangeNotification.webidl12
-rw-r--r--dom/webidl/SettingsManager.webidl41
-rw-r--r--dom/webidl/ShadowRoot.webidl27
-rw-r--r--dom/webidl/SharedWorker.webidl13
-rw-r--r--dom/webidl/SharedWorkerGlobalScope.webidl20
-rw-r--r--dom/webidl/SimpleGestureEvent.webidl4
-rw-r--r--dom/webidl/SocketCommon.webidl16
-rw-r--r--dom/webidl/SourceBuffer.webidl44
-rw-r--r--dom/webidl/SourceBufferList.webidl17
-rw-r--r--dom/webidl/SpeechGrammar.webidl3
-rw-r--r--dom/webidl/SpeechGrammarList.webidl2
-rw-r--r--dom/webidl/SpeechRecognition.webidl18
-rw-r--r--dom/webidl/SpeechRecognitionAlternative.webidl2
-rw-r--r--dom/webidl/SpeechRecognitionError.webidl27
-rw-r--r--dom/webidl/SpeechRecognitionEvent.webidl3
-rw-r--r--dom/webidl/SpeechRecognitionResult.webidl2
-rw-r--r--dom/webidl/SpeechRecognitionResultList.webidl2
-rw-r--r--dom/webidl/SpeechSynthesis.webidl4
-rw-r--r--dom/webidl/SpeechSynthesisEvent.webidl3
-rw-r--r--dom/webidl/SpeechSynthesisUtterance.webidl9
-rw-r--r--dom/webidl/SpeechSynthesisVoice.webidl2
-rw-r--r--dom/webidl/StereoPannerNode.webidl19
-rw-r--r--dom/webidl/Storage.webidl32
-rw-r--r--dom/webidl/StorageEvent.webidl5
-rw-r--r--dom/webidl/StorageType.webidl7
-rw-r--r--dom/webidl/StyleRuleChangeEvent.webidl2
-rw-r--r--dom/webidl/StyleSheet.webidl1
-rw-r--r--dom/webidl/StyleSheetApplicableStateChangeEvent.webidl2
-rw-r--r--dom/webidl/StyleSheetChangeEvent.webidl2
-rw-r--r--dom/webidl/StyleSheetList.webidl8
-rw-r--r--dom/webidl/SubtleCrypto.webidl220
-rw-r--r--dom/webidl/TVChannel.webidl46
-rw-r--r--dom/webidl/TVCurrentChannelChangedEvent.webidl20
-rw-r--r--dom/webidl/TVCurrentSourceChangedEvent.webidl20
-rw-r--r--dom/webidl/TVEITBroadcastedEvent.webidl20
-rw-r--r--dom/webidl/TVManager.webidl14
-rw-r--r--dom/webidl/TVProgram.webidl29
-rw-r--r--dom/webidl/TVScanningStateChangedEvent.webidl29
-rw-r--r--dom/webidl/TVSource.webidl61
-rw-r--r--dom/webidl/TVTuner.webidl28
-rw-r--r--dom/webidl/Telephony.webidl72
-rw-r--r--dom/webidl/TelephonyCall.webidl55
-rw-r--r--dom/webidl/TelephonyCallGroup.webidl38
-rw-r--r--dom/webidl/TelephonyCallId.webidl35
-rw-r--r--dom/webidl/TestInterfaceJS.webidl69
-rw-r--r--dom/webidl/TestInterfaceJSDictionaries.webidl27
-rw-r--r--dom/webidl/Text.webidl2
-rw-r--r--dom/webidl/TextDecoder.webidl9
-rw-r--r--dom/webidl/TextEncoder.webidl12
-rw-r--r--dom/webidl/TextTrack.webidl16
-rw-r--r--dom/webidl/TextTrackCueList.webidl4
-rw-r--r--dom/webidl/TextTrackList.webidl10
-rw-r--r--dom/webidl/TimeEvent.webidl4
-rw-r--r--dom/webidl/Touch.webidl26
-rw-r--r--dom/webidl/TouchEvent.webidl7
-rw-r--r--dom/webidl/TouchList.webidl10
-rw-r--r--dom/webidl/TrackEvent.webidl19
-rw-r--r--dom/webidl/TreeBoxObject.webidl207
-rw-r--r--dom/webidl/TreeColumn.webidl35
-rw-r--r--dom/webidl/TreeColumns.webidl23
-rw-r--r--dom/webidl/UDPMessageEvent.webidl24
-rw-r--r--dom/webidl/UDPSocket.webidl40
-rw-r--r--dom/webidl/UIEvent.webidl8
-rw-r--r--dom/webidl/URL.webidl10
-rw-r--r--dom/webidl/URLSearchParams.webidl28
-rw-r--r--dom/webidl/URLUtils.webidl50
-rw-r--r--dom/webidl/URLUtilsReadOnly.webidl30
-rw-r--r--dom/webidl/USSDReceivedEvent.webidl11
-rw-r--r--dom/webidl/USSDSession.webidl17
-rw-r--r--dom/webidl/UndoManager.webidl2
-rw-r--r--dom/webidl/UserProximityEvent.webidl2
-rw-r--r--dom/webidl/VRDevice.webidl132
-rw-r--r--dom/webidl/VTTCue.webidl (renamed from dom/webidl/TextTrackCue.webidl)41
-rw-r--r--dom/webidl/VTTRegion.webidl27
-rw-r--r--dom/webidl/ValidityState.webidl2
-rw-r--r--dom/webidl/VideoPlaybackQuality.webidl21
-rw-r--r--dom/webidl/VideoTrack.webidl17
-rw-r--r--dom/webidl/VideoTrackList.webidl21
-rw-r--r--dom/webidl/WaveShaperNode.webidl11
-rw-r--r--dom/webidl/WebComponents.webidl11
-rw-r--r--dom/webidl/WebGL2RenderingContext.webidl476
-rw-r--r--dom/webidl/WebGLRenderingContext.webidl259
-rw-r--r--dom/webidl/WebIDL.mk484
-rw-r--r--dom/webidl/WebSocket.webidl7
-rw-r--r--dom/webidl/WebrtcGlobalInformation.webidl37
-rw-r--r--dom/webidl/WifiOptions.webidl38
-rw-r--r--dom/webidl/Window.webidl463
-rw-r--r--dom/webidl/WindowRoot.webidl9
-rw-r--r--dom/webidl/Worker.webidl33
-rw-r--r--dom/webidl/WorkerGlobalScope.webidl57
-rw-r--r--dom/webidl/WorkerLocation.webidl17
-rw-r--r--dom/webidl/WorkerNavigator.webidl13
-rw-r--r--dom/webidl/XMLHttpRequest.webidl17
-rw-r--r--dom/webidl/XMLHttpRequestEventTarget.webidl16
-rw-r--r--dom/webidl/XMLHttpRequestUpload.webidl1
-rw-r--r--dom/webidl/XPathEvaluator.webidl14
-rw-r--r--dom/webidl/XPathExpression.webidl22
-rw-r--r--dom/webidl/XPathNSResolver.webidl10
-rw-r--r--dom/webidl/XPathResult.webidl38
-rw-r--r--dom/webidl/XSLTProcessor.webidl109
-rw-r--r--dom/webidl/XULCommandEvent.webidl7
-rw-r--r--dom/webidl/XULDocument.webidl4
-rw-r--r--dom/webidl/XULElement.webidl9
-rw-r--r--dom/webidl/moz.build814
552 files changed, 18824 insertions, 2018 deletions
diff --git a/dom/webidl/APZTestData.webidl b/dom/webidl/APZTestData.webidl
new file mode 100644
index 000000000..2eea0c6c2
--- /dev/null
+++ b/dom/webidl/APZTestData.webidl
@@ -0,0 +1,37 @@
+/* -*- 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/.
+ */
+
+/*
+ * This file declares data structures used to communicate data logged by
+ * various components for the purpose of APZ testing (see bug 961289 and
+ * gfx/layers/apz/test/APZTestData.h) to JS test code.
+ */
+
+// A single key-value pair in the data.
+dictionary ScrollFrameDataEntry {
+ DOMString key;
+ DOMString value;
+};
+
+// All the key-value pairs associated with a given scrollable frame.
+// The scrollable frame is identified by a scroll id.
+dictionary ScrollFrameData {
+ unsigned long long scrollId;
+ sequence<ScrollFrameDataEntry> entries;
+};
+
+// All the scrollable frames associated with a given paint or repaint request.
+// The paint or repaint request is identified by a sequence number.
+dictionary APZBucket {
+ unsigned long sequenceNumber;
+ sequence<ScrollFrameData> scrollFrames;
+};
+
+// All the paints and repaint requests. This is the top-level data structure.
+dictionary APZTestData {
+ sequence<APZBucket> paints;
+ sequence<APZBucket> repaintRequests;
+}; \ No newline at end of file
diff --git a/dom/webidl/AbortablePromise.webidl b/dom/webidl/AbortablePromise.webidl
new file mode 100644
index 000000000..bc06891a9
--- /dev/null
+++ b/dom/webidl/AbortablePromise.webidl
@@ -0,0 +1,19 @@
+/* -*- 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/.
+ */
+
+callback AbortCallback = void ();
+
+[Constructor(PromiseInit init, AbortCallback abortCallback),
+ Pref="dom.abortablepromise.enabled"]
+interface MozAbortablePromise : _Promise {
+ /*
+ * Aborts the promise.
+ * If the promise has not been resolved or rejected, it should be rejected
+ * with an Exception of type abort and then AbortCallback is called
+ * asynchronously. Otherwise, nothing should be done.
+ */
+ void abort();
+};
diff --git a/dom/webidl/AbstractWorker.webidl b/dom/webidl/AbstractWorker.webidl
new file mode 100644
index 000000000..7ea6e367b
--- /dev/null
+++ b/dom/webidl/AbstractWorker.webidl
@@ -0,0 +1,10 @@
+/* -*- 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/.
+ */
+
+[NoInterfaceObject, Exposed=(Window,Worker,System)]
+interface AbstractWorker {
+ attribute EventHandler onerror;
+};
diff --git a/dom/webidl/ActivityRequestHandler.webidl b/dom/webidl/ActivityRequestHandler.webidl
new file mode 100644
index 000000000..3d0f930cd
--- /dev/null
+++ b/dom/webidl/ActivityRequestHandler.webidl
@@ -0,0 +1,17 @@
+/* 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/. */
+
+[Pref="dom.sysmsg.enabled",
+ JSImplementation="@mozilla.org/dom/activities/request-handler;1",
+ ChromeConstructor(DOMString id, optional ActivityOptions options),
+ ChromeOnly]
+interface ActivityRequestHandler
+{
+ [UnsafeInPrerendering]
+ void postResult(any result);
+ [UnsafeInPrerendering]
+ void postError(DOMString error);
+ [Pure, Cached, Frozen]
+ readonly attribute ActivityOptions source;
+};
diff --git a/dom/webidl/AlarmsManager.webidl b/dom/webidl/AlarmsManager.webidl
new file mode 100644
index 000000000..40877a40a
--- /dev/null
+++ b/dom/webidl/AlarmsManager.webidl
@@ -0,0 +1,19 @@
+/* -*- 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/.
+ *
+ * https://wiki.mozilla.org/WebAPI/AlarmAPI
+ */
+
+[NavigatorProperty="mozAlarms",
+ JSImplementation="@mozilla.org/alarmsManager;1",
+ CheckPermissions="alarms",
+ Pref="dom.mozAlarms.enabled"]
+interface AlarmsManager {
+ DOMRequest getAll();
+ [UnsafeInPrerendering]
+ DOMRequest add(any date, DOMString respectTimezone, optional any data);
+ [UnsafeInPrerendering]
+ void remove(unsigned long id);
+};
diff --git a/dom/webidl/AnalyserNode.webidl b/dom/webidl/AnalyserNode.webidl
index 46524a6d7..aaed3f09c 100644
--- a/dom/webidl/AnalyserNode.webidl
+++ b/dom/webidl/AnalyserNode.webidl
@@ -10,14 +10,14 @@
* liability, trademark and document use rules apply.
*/
-[PrefControlled]
interface AnalyserNode : AudioNode {
- // Real-time frequency-domain data
+ // Real-time frequency-domain data
void getFloatFrequencyData(Float32Array array);
void getByteFrequencyData(Uint8Array array);
- // Real-time waveform data
+ // Real-time waveform data
+ void getFloatTimeDomainData(Float32Array array);
void getByteTimeDomainData(Uint8Array array);
[SetterThrows, Pure]
@@ -35,3 +35,6 @@ interface AnalyserNode : AudioNode {
};
+// Mozilla extension
+AnalyserNode implements AudioNodePassThrough;
+
diff --git a/dom/webidl/Animatable.webidl b/dom/webidl/Animatable.webidl
new file mode 100644
index 000000000..93101adf1
--- /dev/null
+++ b/dom/webidl/Animatable.webidl
@@ -0,0 +1,17 @@
+/* -*- 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://dev.w3.org/fxtf/web-animations/#the-animatable-interface
+ *
+ * Copyright © 2014 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+[NoInterfaceObject]
+interface Animatable {
+ [Func="nsDocument::IsWebAnimationsEnabled"]
+ sequence<AnimationPlayer> getAnimationPlayers();
+};
diff --git a/dom/webidl/Animation.webidl b/dom/webidl/Animation.webidl
new file mode 100644
index 000000000..db852cf8e
--- /dev/null
+++ b/dom/webidl/Animation.webidl
@@ -0,0 +1,21 @@
+/* -*- 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://dev.w3.org/fxtf/web-animations/#the-animation-interface
+ *
+ * Copyright © 2014 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+[Func="nsDocument::IsWebAnimationsEnabled"]
+interface Animation {
+ // FIXME: |effect| should have type (AnimationEffect or EffectCallback)?
+ // but we haven't implemented EffectCallback yet.
+ [Cached,Pure]
+ readonly attribute AnimationEffect? effect;
+ // FIXME: This should be writeable (bug 1067769)
+ readonly attribute Element? target;
+};
diff --git a/dom/webidl/AnimationEffect.webidl b/dom/webidl/AnimationEffect.webidl
new file mode 100644
index 000000000..3c0c5eec1
--- /dev/null
+++ b/dom/webidl/AnimationEffect.webidl
@@ -0,0 +1,16 @@
+/* -*- 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://dev.w3.org/fxtf/web-animations/#the-animationeffect-interface
+ *
+ * Copyright © 2014 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+[Func="nsDocument::IsWebAnimationsEnabled"]
+interface AnimationEffect {
+ readonly attribute DOMString name;
+};
diff --git a/dom/webidl/AnimationPlayer.webidl b/dom/webidl/AnimationPlayer.webidl
new file mode 100644
index 000000000..9f6defae6
--- /dev/null
+++ b/dom/webidl/AnimationPlayer.webidl
@@ -0,0 +1,50 @@
+/* -*- 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://dev.w3.org/fxtf/web-animations/#idl-def-AnimationPlayer
+ *
+ * Copyright © 2014 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+enum AnimationPlayState { "idle", "pending", "running", "paused", "finished" };
+
+[Func="nsDocument::IsWebAnimationsEnabled"]
+interface AnimationPlayer {
+ // Bug 1049975
+ // attribute AnimationNode? source;
+ [Pure]
+ readonly attribute Animation? source;
+ readonly attribute AnimationTimeline timeline;
+ [BinaryName="startTimeAsDouble"]
+ readonly attribute double? startTime;
+ [BinaryName="currentTimeAsDouble"]
+ readonly attribute double? currentTime;
+
+ /* Not yet implemented
+ attribute double playbackRate; */
+ [BinaryName="playStateFromJS"]
+ readonly attribute AnimationPlayState playState;
+ [Throws]
+ readonly attribute Promise<AnimationPlayer> ready;
+ /*
+ readonly attribute Promise<AnimationPlayer> finished;
+ void cancel ();
+ void finish ();
+ */
+ [BinaryName="playFromJS"]
+ void play ();
+ [BinaryName="pauseFromJS"]
+ void pause ();
+ /*
+ void reverse ();
+ */
+};
+
+// Non-standard extensions
+partial interface AnimationPlayer {
+ [ChromeOnly] readonly attribute boolean isRunningOnCompositor;
+};
diff --git a/dom/webidl/AnimationTimeline.webidl b/dom/webidl/AnimationTimeline.webidl
new file mode 100644
index 000000000..83d1f57e3
--- /dev/null
+++ b/dom/webidl/AnimationTimeline.webidl
@@ -0,0 +1,20 @@
+/* -*- 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://dev.w3.org/fxtf/web-animations/#the-animationtimeline-interface
+ *
+ * Copyright © 2014 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+[Func="nsDocument::IsWebAnimationsEnabled"]
+interface AnimationTimeline {
+ [BinaryName="currentTimeAsDouble"]
+ readonly attribute double? currentTime;
+ // Not yet implemented:
+ // AnimationPlayer play (optional TimedItem? source = null);
+ // sequence<AnimationPlayer> getAnimationPlayers ();
+};
diff --git a/dom/webidl/AnonymousContent.webidl b/dom/webidl/AnonymousContent.webidl
new file mode 100644
index 000000000..71055e341
--- /dev/null
+++ b/dom/webidl/AnonymousContent.webidl
@@ -0,0 +1,56 @@
+/* -*- 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/.
+ */
+
+/*
+ * This file declares the AnonymousContent interface which is used to
+ * manipulate content that has been inserted into the document's canvasFrame
+ * anonymous container.
+ * See Document.insertAnonymousContent.
+ *
+ * This API never returns a reference to the actual inserted DOM node on
+ * purpose. This is to make sure the content cannot be randomly changed and the
+ * DOM cannot be traversed from the node, so that Goanna can remain in control of
+ * the inserted content.
+ */
+
+[ChromeOnly]
+interface AnonymousContent {
+ /**
+ * Get the text content of an element inside this custom anonymous content.
+ */
+ [Throws]
+ DOMString getTextContentForElement(DOMString elementId);
+
+ /**
+ * Set the text content of an element inside this custom anonymous content.
+ */
+ [Throws]
+ void setTextContentForElement(DOMString elementId, DOMString text);
+
+ /**
+ * Get the value of an attribute of an element inside this custom anonymous
+ * content.
+ */
+ [Throws]
+ DOMString? getAttributeForElement(DOMString elementId,
+ DOMString attributeName);
+
+ /**
+ * Set the value of an attribute of an element inside this custom anonymous
+ * content.
+ */
+ [Throws]
+ void setAttributeForElement(DOMString elementId,
+ DOMString attributeName,
+ DOMString value);
+
+ /**
+ * Remove an attribute from an element inside this custom anonymous content.
+ */
+ [Throws]
+ void removeAttributeForElement(DOMString elementId,
+ DOMString attributeName);
+};
diff --git a/dom/webidl/AppInfo.webidl b/dom/webidl/AppInfo.webidl
new file mode 100644
index 000000000..a4f44d46c
--- /dev/null
+++ b/dom/webidl/AppInfo.webidl
@@ -0,0 +1,12 @@
+/* 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/. */
+
+/**
+ * This dictionnary holds the parameters supporting the app:// protocol.
+ */
+dictionary AppInfo
+{
+ DOMString path = "";
+ boolean isCoreApp = false;
+};
diff --git a/dom/webidl/AppNotificationServiceOptions.webidl b/dom/webidl/AppNotificationServiceOptions.webidl
new file mode 100644
index 000000000..f5addc92a
--- /dev/null
+++ b/dom/webidl/AppNotificationServiceOptions.webidl
@@ -0,0 +1,19 @@
+/* -*- 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/.
+ */
+
+interface MozObserver;
+
+dictionary AppNotificationServiceOptions {
+ boolean textClickable = false;
+ DOMString manifestURL = "";
+ DOMString id = "";
+ DOMString dbId = "";
+ DOMString dir = "";
+ DOMString lang = "";
+ DOMString tag = "";
+ DOMString data = "";
+ NotificationBehavior mozbehavior = null;
+};
diff --git a/dom/webidl/Apps.webidl b/dom/webidl/Apps.webidl
new file mode 100644
index 000000000..846db2c6a
--- /dev/null
+++ b/dom/webidl/Apps.webidl
@@ -0,0 +1,130 @@
+/* -*- 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/.
+ */
+
+dictionary InstallParameters {
+ sequence<DOMString> receipts = [];
+ sequence<DOMString> categories = [];
+};
+
+dictionary LanguageDesc {
+ DOMString target;
+ long revision;
+ DOMString name;
+};
+
+enum LocaleResourceType {
+ "binary",
+ "json",
+ "text"
+};
+
+[NoInterfaceObject, NavigatorProperty="mozApps",
+ JSImplementation="@mozilla.org/webapps;1"]
+interface DOMApplicationsRegistry {
+ [CheckPermissions="webapps-manage"]
+ readonly attribute DOMApplicationsManager mgmt;
+ DOMRequest install(DOMString url, optional InstallParameters params);
+ DOMRequest installPackage(DOMString url, optional InstallParameters params);
+ DOMRequest getSelf();
+ DOMRequest getInstalled();
+ DOMRequest checkInstalled(DOMString manifestUrl);
+
+ // Language pack API.
+ // These promises will be rejected if the page is not in an app context,
+ // i.e. they are implicitely acting on getSelf().
+ Promise<MozMap<sequence<LanguageDesc>>> getAdditionalLanguages();
+ // Resolves to a different object depending on the dataType value.
+ Promise<any>
+ getLocalizationResource(DOMString language,
+ DOMString version,
+ DOMString path,
+ LocaleResourceType dataType);
+};
+
+[JSImplementation="@mozilla.org/webapps/application;1", ChromeOnly]
+interface DOMApplication : EventTarget {
+ // manifest and updateManifest will be turned into dictionaries once
+ // in bug 1053033 once bug 963382 is fixed.
+ readonly attribute any manifest;
+ readonly attribute any updateManifest;
+ readonly attribute DOMString manifestURL;
+ readonly attribute DOMString origin;
+ readonly attribute DOMString installOrigin;
+ readonly attribute DOMTimeStamp installTime;
+ readonly attribute boolean removable;
+ readonly attribute boolean enabled;
+
+ [Cached, Pure]
+ readonly attribute sequence<DOMString> receipts;
+
+ readonly attribute double progress;
+
+ readonly attribute DOMString installState;
+
+ readonly attribute DOMTimeStamp lastUpdateCheck;
+ readonly attribute DOMTimeStamp updateTime;
+
+ readonly attribute boolean downloadAvailable;
+ readonly attribute boolean downloading;
+ readonly attribute boolean readyToApplyDownload;
+ readonly attribute long downloadSize;
+
+ readonly attribute DOMError? downloadError;
+
+ attribute EventHandler onprogress;
+ attribute EventHandler ondownloadsuccess;
+ attribute EventHandler ondownloaderror;
+ attribute EventHandler ondownloadavailable;
+ attribute EventHandler ondownloadapplied;
+
+ void download();
+ void cancelDownload();
+
+ DOMRequest launch(optional DOMString? url);
+
+ DOMRequest clearBrowserData();
+ DOMRequest checkForUpdate();
+
+ /**
+ * Inter-App Communication APIs.
+ *
+ * https://wiki.mozilla.org/WebAPI/Inter_App_Communication_Alt_proposal
+ *
+ */
+ Promise<MozInterAppConnection> connect(DOMString keyword, optional any rules);
+
+ Promise<sequence<MozInterAppMessagePort>> getConnections();
+
+ // Receipts handling functions.
+ DOMRequest addReceipt(optional DOMString receipt);
+ DOMRequest removeReceipt(optional DOMString receipt);
+ DOMRequest replaceReceipt(optional DOMString oldReceipt,
+ optional DOMString newReceipt);
+
+ // Export this app as a shareable Blob.
+ Promise<Blob> export();
+};
+
+[JSImplementation="@mozilla.org/webapps/manager;1",
+ ChromeOnly,
+ CheckPermissions="webapps-manage"]
+interface DOMApplicationsManager : EventTarget {
+ DOMRequest getAll();
+ DOMRequest getNotInstalled();
+ void applyDownload(DOMApplication app);
+ DOMRequest uninstall(DOMApplication app);
+
+ Promise<DOMApplication> import(Blob blob);
+ Promise<any> extractManifest(Blob blob);
+
+ void setEnabled(DOMApplication app, boolean state);
+ Promise<Blob> getIcon(DOMApplication app, DOMString iconID,
+ optional DOMString entryPoint);
+
+ attribute EventHandler oninstall;
+ attribute EventHandler onuninstall;
+ attribute EventHandler onenabledstatechange;
+};
diff --git a/dom/webidl/ArchiveReader.webidl b/dom/webidl/ArchiveReader.webidl
index eccdabedf..028712c12 100644
--- a/dom/webidl/ArchiveReader.webidl
+++ b/dom/webidl/ArchiveReader.webidl
@@ -3,7 +3,7 @@
* 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/. */
-[PrefControlled,
+[Pref="dom.archivereader.enabled",
Constructor(Blob blob, optional ArchiveReaderOptions options)]
interface ArchiveReader {
ArchiveRequest getFilenames();
diff --git a/dom/webidl/ArchiveRequest.webidl b/dom/webidl/ArchiveRequest.webidl
index 6cc383804..24b79cf33 100644
--- a/dom/webidl/ArchiveRequest.webidl
+++ b/dom/webidl/ArchiveRequest.webidl
@@ -4,6 +4,7 @@
* 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/. */
+[Pref="dom.archivereader.enabled"]
interface ArchiveRequest : DOMRequest {
readonly attribute ArchiveReader reader;
};
diff --git a/dom/webidl/Attr.webidl b/dom/webidl/Attr.webidl
index 27d4d40cd..d1fbaa822 100644
--- a/dom/webidl/Attr.webidl
+++ b/dom/webidl/Attr.webidl
@@ -18,14 +18,13 @@ interface Attr : Node {
readonly attribute DOMString name;
readonly attribute DOMString? namespaceURI;
readonly attribute DOMString? prefix;
+
+ readonly attribute boolean specified;
};
// Mozilla extensions
partial interface Attr {
- readonly attribute boolean specified;
-
-
[GetterThrows]
readonly attribute Element? ownerElement;
};
diff --git a/dom/webidl/AudioBuffer.webidl b/dom/webidl/AudioBuffer.webidl
index 6e38b8822..cb91e6292 100644
--- a/dom/webidl/AudioBuffer.webidl
+++ b/dom/webidl/AudioBuffer.webidl
@@ -10,7 +10,6 @@
* liability, trademark and document use rules apply.
*/
-[PrefControlled]
interface AudioBuffer {
readonly attribute float sampleRate;
@@ -24,5 +23,9 @@ interface AudioBuffer {
[Throws]
Float32Array getChannelData(unsigned long channel);
+ [Throws]
+ void copyFromChannel(Float32Array destination, long channelNumber, optional unsigned long startInChannel = 0);
+ [Throws]
+ void copyToChannel(Float32Array source, long channelNumber, optional unsigned long startInChannel = 0);
};
diff --git a/dom/webidl/AudioBufferSourceNode.webidl b/dom/webidl/AudioBufferSourceNode.webidl
index 06f3d33f8..dd029481f 100644
--- a/dom/webidl/AudioBufferSourceNode.webidl
+++ b/dom/webidl/AudioBufferSourceNode.webidl
@@ -10,7 +10,6 @@
* liability, trademark and document use rules apply.
*/
-[PrefControlled]
interface AudioBufferSourceNode : AudioNode {
attribute AudioBuffer? buffer;
@@ -21,30 +20,14 @@ interface AudioBufferSourceNode : AudioNode {
attribute double loopStart;
attribute double loopEnd;
- [Throws]
+ [Throws, UnsafeInPrerendering]
void start(optional double when = 0, optional double grainOffset = 0,
optional double grainDuration);
- [Throws]
+ [Throws, UnsafeInPrerendering]
void stop(optional double when = 0);
- [SetterThrows]
attribute EventHandler onended;
};
-/*
- * The origin of this IDL file is
- * https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AlternateNames
- */
-[PrefControlled]
-partial interface AudioBufferSourceNode {
- // Same as start()
- [Throws,Pref="media.webaudio.legacy.AudioBufferSourceNode"]
- void noteOn(double when);
- [Throws,Pref="media.webaudio.legacy.AudioBufferSourceNode"]
- void noteGrainOn(double when, double grainOffset, double grainDuration);
-
- [Throws,Pref="media.webaudio.legacy.AudioBufferSourceNode"]
- // Same as stop()
- void noteOff(double when);
-};
-
+// Mozilla extensions
+AudioBufferSourceNode implements AudioNodePassThrough;
diff --git a/dom/webidl/AudioChannel.webidl b/dom/webidl/AudioChannel.webidl
new file mode 100644
index 000000000..215ec0b65
--- /dev/null
+++ b/dom/webidl/AudioChannel.webidl
@@ -0,0 +1,49 @@
+/* -*- 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/.
+ */
+
+// AudioChannels are used by:
+// * HTMLMediaElement
+// * AudioContext (WebAudio)
+// When used, it has to throw an exception if the app tries to change the audio
+// channel type without the permission (manifest file for B2G apps).
+// The supported values are:
+// * normal (default value)
+// Automatically paused if "notification" or higher priority channel
+// is played
+// Use case: normal applications
+// * content
+// Automatically paused if "notification" or higher priority channel
+// is played. Also paused if another app starts using "content"
+// channel. Using this channel never affects applications using
+// the "normal" channel.
+// Use case: video/audio players
+// * notification
+// Automatically paused if "alarm" or higher priority channel is played.
+// Use case: New email, incoming SMS
+// * alarm
+// Automatically paused if "telephony" or higher priority channel is
+// played.
+// User case: Alarm clock, calendar alarms
+// * telephony
+// Automatically paused if "ringer" or higher priority
+// channel is played.
+// Use case: dialer, voip
+// * ringer
+// Automatically paused if "publicnotification" or higher priority
+// channel is played.
+// Use case: dialer, voip
+// * publicnotification
+// Always plays in speaker, even when headphones are plugged in.
+// Use case: Camera shutter sound.
+enum AudioChannel {
+ "normal",
+ "content",
+ "notification",
+ "alarm",
+ "telephony",
+ "ringer",
+ "publicnotification",
+};
diff --git a/dom/webidl/AudioChannelManager.webidl b/dom/webidl/AudioChannelManager.webidl
index 7559d30fb..3d90f22ac 100644
--- a/dom/webidl/AudioChannelManager.webidl
+++ b/dom/webidl/AudioChannelManager.webidl
@@ -22,6 +22,11 @@ interface AudioChannelManager : EventTarget {
* speakers (or vice versa). This allows you to, for example, pause your
* window's audio when the headphones are unplugged.
*/
- [SetterThrows]
attribute EventHandler onheadphoneschange;
+
+ /**
+ * Indicates which audio channel is used to adjust volume when pressing HW
+ * volume keys.
+ */
+ attribute DOMString volumeControlChannel;
};
diff --git a/dom/webidl/AudioContext.webidl b/dom/webidl/AudioContext.webidl
index 9d33cbc88..94e1ac158 100644
--- a/dom/webidl/AudioContext.webidl
+++ b/dom/webidl/AudioContext.webidl
@@ -13,7 +13,8 @@
callback DecodeSuccessCallback = void (AudioBuffer decodedData);
callback DecodeErrorCallback = void ();
-[Constructor, PrefControlled]
+[Constructor,
+ Constructor(AudioChannel audioChannelType)]
interface AudioContext : EventTarget {
readonly attribute AudioDestinationNode destination;
@@ -21,75 +22,77 @@ interface AudioContext : EventTarget {
readonly attribute double currentTime;
readonly attribute AudioListener listener;
- [Creator, Throws]
+ [NewObject, Throws]
AudioBuffer createBuffer(unsigned long numberOfChannels, unsigned long length, float sampleRate);
- void decodeAudioData(ArrayBuffer audioData,
- DecodeSuccessCallback successCallback,
- optional DecodeErrorCallback errorCallback);
+ [Throws]
+ Promise<AudioBuffer> decodeAudioData(ArrayBuffer audioData,
+ optional DecodeSuccessCallback successCallback,
+ optional DecodeErrorCallback errorCallback);
- // AudioNode creation
- [Creator]
+ // AudioNode creation
+ [NewObject]
AudioBufferSourceNode createBufferSource();
- [Creator, Throws]
+ [NewObject, Throws]
MediaStreamAudioDestinationNode createMediaStreamDestination();
- [Creator, Throws]
+ [NewObject, Throws]
ScriptProcessorNode createScriptProcessor(optional unsigned long bufferSize = 0,
optional unsigned long numberOfInputChannels = 2,
optional unsigned long numberOfOutputChannels = 2);
- [Creator]
+ [NewObject]
+ StereoPannerNode createStereoPanner();
+ [NewObject]
AnalyserNode createAnalyser();
- [Creator]
+ [NewObject, Throws, UnsafeInPrerendering]
+ MediaElementAudioSourceNode createMediaElementSource(HTMLMediaElement mediaElement);
+ [NewObject, Throws, UnsafeInPrerendering]
+ MediaStreamAudioSourceNode createMediaStreamSource(MediaStream mediaStream);
+ [NewObject]
GainNode createGain();
- [Creator, Throws]
+ [NewObject, Throws]
DelayNode createDelay(optional double maxDelayTime = 1);
- [Creator]
+ [NewObject]
BiquadFilterNode createBiquadFilter();
- [Creator]
+ [NewObject]
WaveShaperNode createWaveShaper();
- [Creator]
+ [NewObject]
PannerNode createPanner();
- [Creator]
+ [NewObject]
ConvolverNode createConvolver();
- [Creator, Throws]
+ [NewObject, Throws]
ChannelSplitterNode createChannelSplitter(optional unsigned long numberOfOutputs = 6);
- [Creator, Throws]
+ [NewObject, Throws]
ChannelMergerNode createChannelMerger(optional unsigned long numberOfInputs = 6);
- [Creator]
+ [NewObject]
DynamicsCompressorNode createDynamicsCompressor();
- [Creator, Throws]
+ [NewObject]
+ OscillatorNode createOscillator();
+ [NewObject, Throws]
PeriodicWave createPeriodicWave(Float32Array real, Float32Array imag);
};
-/*
- * The origin of this IDL file is
- * https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AlternateNames
- */
-[PrefControlled]
+// Mozilla extensions
partial interface AudioContext {
- [Creator, Throws]
- AudioBuffer? createBuffer(ArrayBuffer buffer, boolean mixToMono);
-
- // Same as createGain()
- [Creator,Pref="media.webaudio.legacy.AudioContext"]
- GainNode createGainNode();
-
- // Same as createDelay()
- [Creator, Throws, Pref="media.webaudio.legacy.AudioContext"]
- DelayNode createDelayNode(optional double maxDelayTime = 1);
-
- // Same as createScriptProcessor()
- [Creator, Throws, Pref="media.webaudio.legacy.AudioContext"]
- ScriptProcessorNode createJavaScriptNode(optional unsigned long bufferSize = 0,
- optional unsigned long numberOfInputChannels = 2,
- optional unsigned long numberOfOutputChannels = 2);
-};
+ // Read AudioChannel.webidl for more information about this attribute.
+ [Pref="media.useAudioChannelService"]
+ readonly attribute AudioChannel mozAudioChannelType;
+ // These 2 events are dispatched when the AudioContext object is muted by
+ // the AudioChannelService. It's call 'interrupt' because when this event is
+ // dispatched on a HTMLMediaElement, the audio stream is paused.
+ [Pref="media.useAudioChannelService"]
+ attribute EventHandler onmozinterruptbegin;
+ [Pref="media.useAudioChannelService"]
+ attribute EventHandler onmozinterruptend;
+
+ // This method is for test only.
+ [ChromeOnly] AudioChannel testAudioChannelInAudioNodeStream();
+};
diff --git a/dom/webidl/AudioDestinationNode.webidl b/dom/webidl/AudioDestinationNode.webidl
index 135b1c65f..c6f13b7a2 100644
--- a/dom/webidl/AudioDestinationNode.webidl
+++ b/dom/webidl/AudioDestinationNode.webidl
@@ -10,7 +10,6 @@
* liability, trademark and document use rules apply.
*/
-[PrefControlled]
interface AudioDestinationNode : AudioNode {
readonly attribute unsigned long maxChannelCount;
diff --git a/dom/webidl/AudioListener.webidl b/dom/webidl/AudioListener.webidl
index 45fe4b23d..91e8cdb35 100644
--- a/dom/webidl/AudioListener.webidl
+++ b/dom/webidl/AudioListener.webidl
@@ -10,7 +10,6 @@
* liability, trademark and document use rules apply.
*/
-[PrefControlled]
interface AudioListener {
// same as OpenAL (default 1)
diff --git a/dom/webidl/AudioNode.webidl b/dom/webidl/AudioNode.webidl
index 8f5805386..3bb8f4f41 100644
--- a/dom/webidl/AudioNode.webidl
+++ b/dom/webidl/AudioNode.webidl
@@ -21,7 +21,6 @@ enum ChannelInterpretation {
"discrete"
};
-[PrefControlled]
interface AudioNode : EventTarget {
[Throws]
@@ -38,8 +37,20 @@ interface AudioNode : EventTarget {
// Channel up-mixing and down-mixing rules for all inputs.
[SetterThrows]
attribute unsigned long channelCount;
+ [SetterThrows]
attribute ChannelCountMode channelCountMode;
attribute ChannelInterpretation channelInterpretation;
};
+// Mozilla extension
+partial interface AudioNode {
+ [ChromeOnly]
+ readonly attribute unsigned long id;
+};
+[NoInterfaceObject]
+interface AudioNodePassThrough {
+ [ChromeOnly]
+ attribute boolean passThrough;
+};
+
diff --git a/dom/webidl/AudioParam.webidl b/dom/webidl/AudioParam.webidl
index a4789193f..375ab6279 100644
--- a/dom/webidl/AudioParam.webidl
+++ b/dom/webidl/AudioParam.webidl
@@ -10,7 +10,6 @@
* liability, trademark and document use rules apply.
*/
-[PrefControlled]
interface AudioParam {
attribute float value;
@@ -38,15 +37,3 @@ interface AudioParam {
void cancelScheduledValues(double startTime);
};
-
-/*
- * The origin of this IDL file is
- * https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AlternateNames
- */
-[PrefControlled]
-partial interface AudioParam {
- // Same as setTargetAtTime()
- [Throws,Pref="media.webaudio.legacy.AudioParam"]
- void setTargetValueAtTime(float target, double startTime, double timeConstant);
-};
-
diff --git a/dom/webidl/AudioProcessingEvent.webidl b/dom/webidl/AudioProcessingEvent.webidl
index 0bb37c3cf..17ee321fb 100644
--- a/dom/webidl/AudioProcessingEvent.webidl
+++ b/dom/webidl/AudioProcessingEvent.webidl
@@ -10,12 +10,14 @@
* liability, trademark and document use rules apply.
*/
-[PrefControlled]
interface AudioProcessingEvent : Event {
- readonly attribute double playbackTime;
- readonly attribute AudioBuffer inputBuffer;
- readonly attribute AudioBuffer outputBuffer;
+ readonly attribute double playbackTime;
+
+ [Throws]
+ readonly attribute AudioBuffer inputBuffer;
+ [Throws]
+ readonly attribute AudioBuffer outputBuffer;
};
diff --git a/dom/webidl/AudioTrack.webidl b/dom/webidl/AudioTrack.webidl
new file mode 100644
index 000000000..e70456a37
--- /dev/null
+++ b/dom/webidl/AudioTrack.webidl
@@ -0,0 +1,17 @@
+/* -*- 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.whatwg.org/specs/web-apps/current-work/#audiotrack
+ */
+
+[Pref="media.track.enabled"]
+interface AudioTrack {
+ readonly attribute DOMString id;
+ readonly attribute DOMString kind;
+ readonly attribute DOMString label;
+ readonly attribute DOMString language;
+ attribute boolean enabled;
+};
diff --git a/dom/webidl/AudioTrackList.webidl b/dom/webidl/AudioTrackList.webidl
new file mode 100644
index 000000000..2c229a67a
--- /dev/null
+++ b/dom/webidl/AudioTrackList.webidl
@@ -0,0 +1,19 @@
+/* -*- 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.whatwg.org/specs/web-apps/current-work/#audiotracklist
+ */
+
+[Pref="media.track.enabled"]
+interface AudioTrackList : EventTarget {
+ readonly attribute unsigned long length;
+ getter AudioTrack (unsigned long index);
+ AudioTrack? getTrackById(DOMString id);
+
+ attribute EventHandler onchange;
+ attribute EventHandler onaddtrack;
+ attribute EventHandler onremovetrack;
+};
diff --git a/dom/webidl/AutocompleteErrorEvent.webidl b/dom/webidl/AutocompleteErrorEvent.webidl
new file mode 100644
index 000000000..23b8ae739
--- /dev/null
+++ b/dom/webidl/AutocompleteErrorEvent.webidl
@@ -0,0 +1,23 @@
+/* -*- 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/. */
+
+enum AutoCompleteErrorReason {
+ "",
+ "cancel",
+ "disabled",
+ "invalid"
+};
+
+[Pref="dom.forms.requestAutocomplete",
+ Constructor(DOMString type, optional AutocompleteErrorEventInit eventInitDict)]
+interface AutocompleteErrorEvent : Event
+{
+ readonly attribute AutoCompleteErrorReason reason;
+};
+
+dictionary AutocompleteErrorEventInit : EventInit
+{
+ AutoCompleteErrorReason reason = "";
+};
diff --git a/dom/webidl/AutocompleteInfo.webidl b/dom/webidl/AutocompleteInfo.webidl
new file mode 100644
index 000000000..ad32ff6d3
--- /dev/null
+++ b/dom/webidl/AutocompleteInfo.webidl
@@ -0,0 +1,17 @@
+/* -*- 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/.
+ */
+
+/**
+ * This dictionary is used for the input, textarea and select element's
+ * getAutocompleteInfo method.
+ */
+
+dictionary AutocompleteInfo {
+ DOMString section = "";
+ DOMString addressType = "";
+ DOMString contactType = "";
+ DOMString fieldName = "";
+};
diff --git a/dom/webidl/BatteryManager.webidl b/dom/webidl/BatteryManager.webidl
index f4940c667..a964f3b0b 100644
--- a/dom/webidl/BatteryManager.webidl
+++ b/dom/webidl/BatteryManager.webidl
@@ -16,12 +16,8 @@ interface BatteryManager : EventTarget {
readonly attribute unrestricted double dischargingTime;
readonly attribute double level;
- [SetterThrows]
attribute EventHandler onchargingchange;
- [SetterThrows]
attribute EventHandler onchargingtimechange;
- [SetterThrows]
attribute EventHandler ondischargingtimechange;
- [SetterThrows]
attribute EventHandler onlevelchange;
};
diff --git a/dom/webidl/BeforeAfterKeyboardEvent.webidl b/dom/webidl/BeforeAfterKeyboardEvent.webidl
new file mode 100644
index 000000000..63226e2c4
--- /dev/null
+++ b/dom/webidl/BeforeAfterKeyboardEvent.webidl
@@ -0,0 +1,24 @@
+/* -*- 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/.
+ */
+
+[Constructor(DOMString typeArg,
+ optional BeforeAfterKeyboardEventInit eventInitDict),
+ CheckPermissions="embed-apps before-after-keyboard-event",
+ Pref="dom.beforeAfterKeyboardEvent.enabled"]
+interface BeforeAfterKeyboardEvent : KeyboardEvent
+{
+ // The valid value of embeddedCancelled is:
+ // - "mozbrowserbeforekeydown": null
+ // - "mozbrowserbeforekeyup": null
+ // - "mozbrowserafterkeydown": true/false
+ // - "mozbrowserafterkeyup": true/false
+ readonly attribute boolean? embeddedCancelled;
+};
+
+dictionary BeforeAfterKeyboardEventInit : KeyboardEventInit
+{
+ boolean? embeddedCancelled = null;
+};
diff --git a/dom/webidl/BiquadFilterNode.webidl b/dom/webidl/BiquadFilterNode.webidl
index 5a290b176..daa35ffb0 100644
--- a/dom/webidl/BiquadFilterNode.webidl
+++ b/dom/webidl/BiquadFilterNode.webidl
@@ -11,9 +11,6 @@
*/
enum BiquadFilterType {
- // Hack: Use numbers to support alternate enum values
- "0", "1", "2", "3", "4", "5", "6", "7",
-
"lowpass",
"highpass",
"bandpass",
@@ -24,7 +21,6 @@ enum BiquadFilterType {
"allpass"
};
-[PrefControlled]
interface BiquadFilterNode : AudioNode {
attribute BiquadFilterType type;
@@ -39,27 +35,6 @@ interface BiquadFilterNode : AudioNode {
};
-/*
- * The origin of this IDL file is
- * https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AlternateNames
- */
-[PrefControlled]
-partial interface BiquadFilterNode {
- [Pref="media.webaudio.legacy.BiquadFilterNode"]
- const unsigned short LOWPASS = 0;
- [Pref="media.webaudio.legacy.BiquadFilterNode"]
- const unsigned short HIGHPASS = 1;
- [Pref="media.webaudio.legacy.BiquadFilterNode"]
- const unsigned short BANDPASS = 2;
- [Pref="media.webaudio.legacy.BiquadFilterNode"]
- const unsigned short LOWSHELF = 3;
- [Pref="media.webaudio.legacy.BiquadFilterNode"]
- const unsigned short HIGHSHELF = 4;
- [Pref="media.webaudio.legacy.BiquadFilterNode"]
- const unsigned short PEAKING = 5;
- [Pref="media.webaudio.legacy.BiquadFilterNode"]
- const unsigned short NOTCH = 6;
- [Pref="media.webaudio.legacy.BiquadFilterNode"]
- const unsigned short ALLPASS = 7;
-};
+// Mozilla extension
+BiquadFilterNode implements AudioNodePassThrough;
diff --git a/dom/webidl/Blob.webidl b/dom/webidl/Blob.webidl
index d64c24096..b9314c7f1 100644
--- a/dom/webidl/Blob.webidl
+++ b/dom/webidl/Blob.webidl
@@ -10,22 +10,27 @@
* liability, trademark and document use rules apply.
*/
-/*
-[Constructor, Constructor((ArrayBuffer or ArrayBufferView or Blob or DOMString)[] blobParts, optional BlobPropertyBag options)]
+[Constructor,
+ Constructor(sequence<(ArrayBuffer or ArrayBufferView or Blob or DOMString)> blobParts, optional BlobPropertyBag options),
+ Exposed=(Window,Worker)]
interface Blob {
+ [GetterThrows]
readonly attribute unsigned long long size;
+
readonly attribute DOMString type;
+ // readonly attribute boolean isClosed; TODO bug 1048321
+
//slice Blob into byte-ranged chunks
- Blob slice(optional long long start,
- optional long long end,
- optional DOMString contentType);
- void close();
+ [Throws]
+ Blob slice([Clamp] optional long long start,
+ [Clamp] optional long long end,
+ optional DOMString contentType = "");
+ // void close(); TODO bug 1048325
};
-*/
enum EndingTypes{"transparent", "native"};
diff --git a/dom/webidl/BlobEvent.webidl b/dom/webidl/BlobEvent.webidl
index 770a07145..8d0418701 100644
--- a/dom/webidl/BlobEvent.webidl
+++ b/dom/webidl/BlobEvent.webidl
@@ -3,9 +3,8 @@
* 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/.
*/
-interface Blob;
-[Constructor(DOMString type, optional BlobEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Constructor(DOMString type, optional BlobEventInit eventInitDict)]
interface BlobEvent : Event
{
readonly attribute Blob? data;
diff --git a/dom/webidl/BluetoothAdapter.webidl b/dom/webidl/BluetoothAdapter.webidl
new file mode 100644
index 000000000..12a25663b
--- /dev/null
+++ b/dom/webidl/BluetoothAdapter.webidl
@@ -0,0 +1,161 @@
+/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
+/* vim: set ts=2 et sw=2 tw=80: */
+/* 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/. */
+
+// MediaMetadata and MediaPlayStatus are used to keep data from Applications.
+// Please see specification of AVRCP 1.3 for more details.
+dictionary MediaMetaData
+{
+ // track title
+ DOMString title = "";
+ // artist name
+ DOMString artist = "";
+ // album name
+ DOMString album = "";
+ // track number
+ long long mediaNumber = -1;
+ // number of tracks in the album
+ long long totalMediaCount = -1;
+ // playing time (ms)
+ long long duration = -1;
+};
+
+dictionary MediaPlayStatus
+{
+ // current track length (ms)
+ long long duration = -1;
+ // playing time (ms)
+ long long position = -1;
+ // one of 'STOPPED'/'PLAYING'/'PAUSED'/'FWD_SEEK'/'REV_SEEK'/'ERROR'
+ DOMString playStatus = "";
+};
+
+[CheckPermissions="bluetooth"]
+interface BluetoothAdapter : EventTarget {
+ readonly attribute DOMString address;
+ readonly attribute unsigned long class;
+ readonly attribute boolean discovering;
+ readonly attribute DOMString name;
+ readonly attribute boolean discoverable;
+ readonly attribute unsigned long discoverableTimeout; // in seconds
+
+ // array of type BluetoothDevice[]
+ [GetterThrows]
+ readonly attribute any devices;
+
+ // array of type DOMString[]
+ [GetterThrows]
+ readonly attribute any uuids;
+
+ attribute EventHandler ondevicefound;
+
+ // Fired when discovery process has been done or has started
+ attribute EventHandler ondiscoverystatechanged;
+
+ // Fired when pairing process is completed
+ attribute EventHandler onpairedstatuschanged;
+
+ // Fired when a2dp connection status changed
+ attribute EventHandler ona2dpstatuschanged;
+
+ // Fired when handsfree connection status changed
+ attribute EventHandler onhfpstatuschanged;
+
+ // Fired when sco connection status changed
+ attribute EventHandler onscostatuschanged;
+
+ // Fired when remote devices query current media play status
+ attribute EventHandler onrequestmediaplaystatus;
+
+ [NewObject, Throws]
+ DOMRequest setName(DOMString name);
+ [NewObject, Throws]
+ DOMRequest setDiscoverable(boolean discoverable);
+ [NewObject, Throws]
+ DOMRequest setDiscoverableTimeout(unsigned long timeout);
+ [NewObject, Throws]
+ DOMRequest startDiscovery();
+ [NewObject, Throws]
+ DOMRequest stopDiscovery();
+ [NewObject, Throws]
+ DOMRequest pair(DOMString deviceAddress);
+ [NewObject, Throws]
+ DOMRequest unpair(DOMString deviceAddress);
+ [NewObject, Throws]
+ DOMRequest getPairedDevices();
+ [NewObject, Throws]
+ DOMRequest getConnectedDevices(unsigned short serviceUuid);
+ [NewObject, Throws]
+ DOMRequest setPinCode(DOMString deviceAddress, DOMString pinCode);
+ [NewObject, Throws]
+ DOMRequest setPasskey(DOMString deviceAddress, unsigned long passkey);
+ [NewObject, Throws]
+ DOMRequest setPairingConfirmation(DOMString deviceAddress, boolean confirmation);
+
+ /**
+ * Connect/Disconnect to a specific service of a target remote device.
+ * To check the value of service UUIDs, please check "Bluetooth Assigned
+ * Numbers" / "Service Discovery Protocol" for more information.
+ *
+ * Note that service UUID is optional. If it isn't passed when calling
+ * Connect, multiple profiles are tried sequentially based on the class of
+ * device (CoD). If it isn't passed when calling Disconnect, all connected
+ * profiles are going to be closed.
+ *
+ * Reply success if the connection of any profile is successfully
+ * established/released; reply error if we failed to connect/disconnect all
+ * of the planned profiles.
+ *
+ * @param device Remote device
+ * @param profile 2-octets service UUID. This is optional.
+ */
+ [NewObject, Throws]
+ DOMRequest connect(BluetoothDevice device, optional unsigned short serviceUuid);
+
+ [NewObject, Throws]
+ DOMRequest disconnect(BluetoothDevice device, optional unsigned short serviceUuid);
+
+ [NewObject, Throws]
+ DOMRequest isConnected(unsigned short serviceUuid);
+
+ // One device can only send one file at a time
+ [NewObject, Throws]
+ DOMRequest sendFile(DOMString deviceAddress, Blob blob);
+ [NewObject, Throws]
+ DOMRequest stopSendingFile(DOMString deviceAddress);
+ [NewObject, Throws]
+ DOMRequest confirmReceivingFile(DOMString deviceAddress, boolean confirmation);
+
+ // Connect/Disconnect SCO (audio) connection
+ [NewObject, Throws]
+ DOMRequest connectSco();
+ [NewObject, Throws]
+ DOMRequest disconnectSco();
+ [NewObject, Throws]
+ DOMRequest isScoConnected();
+
+ /**
+ * Additional HFP methods to handle CDMA network.
+ *
+ * In GSM network we observe call operations from RIL call state changes;
+ * however in CDMA network RIL call states do not change under some call
+ * operations, so we need these additional methods to be informed of these
+ * operations from dialer.
+ *
+ * For more information please refer to bug 912005 and 925638.
+ */
+ [NewObject, Throws]
+ DOMRequest answerWaitingCall();
+ [NewObject, Throws]
+ DOMRequest ignoreWaitingCall();
+ [NewObject, Throws]
+ DOMRequest toggleCalls();
+
+ // AVRCP 1.3 methods
+ [NewObject,Throws]
+ DOMRequest sendMediaMetaData(optional MediaMetaData mediaMetaData);
+ [NewObject,Throws]
+ DOMRequest sendMediaPlayStatus(optional MediaPlayStatus mediaPlayStatus);
+};
diff --git a/dom/webidl/BluetoothAdapter2.webidl b/dom/webidl/BluetoothAdapter2.webidl
new file mode 100644
index 000000000..f5e9e3491
--- /dev/null
+++ b/dom/webidl/BluetoothAdapter2.webidl
@@ -0,0 +1,180 @@
+/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
+/* vim: set ts=2 et sw=2 tw=80: */
+/* 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/. */
+
+// MediaMetadata and MediaPlayStatus are used to keep data from Applications.
+// Please see specification of AVRCP 1.3 for more details.
+dictionary MediaMetaData
+{
+ // track title
+ DOMString title = "";
+ // artist name
+ DOMString artist = "";
+ // album name
+ DOMString album = "";
+ // track number
+ long long mediaNumber = -1;
+ // number of tracks in the album
+ long long totalMediaCount = -1;
+ // playing time (ms)
+ long long duration = -1;
+};
+
+dictionary MediaPlayStatus
+{
+ // current track length (ms)
+ long long duration = -1;
+ // playing time (ms)
+ long long position = -1;
+ // one of 'STOPPED'/'PLAYING'/'PAUSED'/'FWD_SEEK'/'REV_SEEK'/'ERROR'
+ DOMString playStatus = "";
+};
+
+[CheckPermissions="bluetooth"]
+interface BluetoothAdapter : EventTarget {
+ readonly attribute BluetoothAdapterState state;
+ [AvailableIn=CertifiedApps]
+ readonly attribute DOMString address;
+ readonly attribute DOMString name;
+ readonly attribute boolean discoverable;
+ readonly attribute boolean discovering;
+
+ [AvailableIn=CertifiedApps]
+ readonly attribute BluetoothPairingListener pairingReqs;
+
+ // Fired when attribute(s) of BluetoothAdapter changed
+ attribute EventHandler onattributechanged;
+
+ // Fired when a remote device gets paired with the adapter
+ attribute EventHandler ondevicepaired;
+
+ // Fired when a remote device gets unpaired from the adapter
+ attribute EventHandler ondeviceunpaired;
+
+ // Fired when a2dp connection status changed
+ attribute EventHandler ona2dpstatuschanged;
+
+ // Fired when handsfree connection status changed
+ attribute EventHandler onhfpstatuschanged;
+
+ // Fired when sco connection status changed
+ attribute EventHandler onscostatuschanged;
+
+ // Fired when remote devices query current media play status
+ attribute EventHandler onrequestmediaplaystatus;
+
+ /**
+ * Enable/Disable a local bluetooth adapter by asynchronus methods and return
+ * its result through a Promise.
+ *
+ * Several onattributechanged events would be triggered during processing the
+ * request, and the last one indicates adapter.state becomes enabled/disabled.
+ */
+ [NewObject, AvailableIn=CertifiedApps]
+ Promise<void> enable();
+ [NewObject, AvailableIn=CertifiedApps]
+ Promise<void> disable();
+
+ [NewObject, AvailableIn=CertifiedApps]
+ Promise<void> setName(DOMString aName);
+ [NewObject]
+ Promise<void> setDiscoverable(boolean aDiscoverable);
+
+ [NewObject]
+ Promise<BluetoothDiscoveryHandle> startDiscovery();
+ [NewObject]
+ Promise<void> stopDiscovery();
+
+ [NewObject]
+ Promise<void> pair(DOMString deviceAddress);
+ [NewObject]
+ Promise<void> unpair(DOMString deviceAddress);
+
+ sequence<BluetoothDevice> getPairedDevices();
+
+ [NewObject, Throws, AvailableIn=CertifiedApps]
+ DOMRequest getConnectedDevices(unsigned short serviceUuid);
+
+ /**
+ * Connect/Disconnect to a specific service of a target remote device.
+ * To check the value of service UUIDs, please check "Bluetooth Assigned
+ * Numbers" / "Service Discovery Protocol" for more information.
+ *
+ * Note that service UUID is optional. If it isn't passed when calling
+ * Connect, multiple profiles are tried sequentially based on the class of
+ * device (CoD). If it isn't passed when calling Disconnect, all connected
+ * profiles are going to be closed.
+ *
+ * Reply success if the connection of any profile is successfully
+ * established/released; reply error if we failed to connect/disconnect all
+ * of the planned profiles.
+ *
+ * @param device Remote device
+ * @param profile 2-octets service UUID. This is optional.
+ */
+ [NewObject, Throws, AvailableIn=CertifiedApps]
+ DOMRequest connect(BluetoothDevice device, optional unsigned short serviceUuid);
+
+ [NewObject, Throws, AvailableIn=CertifiedApps]
+ DOMRequest disconnect(BluetoothDevice device, optional unsigned short serviceUuid);
+
+ // One device can only send one file at a time
+ [NewObject, Throws, AvailableIn=CertifiedApps]
+ DOMRequest sendFile(DOMString deviceAddress, Blob blob);
+ [NewObject, Throws, AvailableIn=CertifiedApps]
+ DOMRequest stopSendingFile(DOMString deviceAddress);
+ [NewObject, Throws, AvailableIn=CertifiedApps]
+ DOMRequest confirmReceivingFile(DOMString deviceAddress, boolean confirmation);
+
+ // Connect/Disconnect SCO (audio) connection
+ [NewObject, Throws, AvailableIn=CertifiedApps]
+ DOMRequest connectSco();
+ [NewObject, Throws, AvailableIn=CertifiedApps]
+ DOMRequest disconnectSco();
+ [NewObject, Throws, AvailableIn=CertifiedApps]
+ DOMRequest isScoConnected();
+
+ /**
+ * Additional HFP methods to handle CDMA network.
+ *
+ * In GSM network we observe call operations from RIL call state changes;
+ * however in CDMA network RIL call states do not change under some call
+ * operations, so we need these additional methods to be informed of these
+ * operations from dialer.
+ *
+ * For more information please refer to bug 912005 and 925638.
+ */
+ [NewObject, Throws, AvailableIn=CertifiedApps]
+ DOMRequest answerWaitingCall();
+ [NewObject, Throws, AvailableIn=CertifiedApps]
+ DOMRequest ignoreWaitingCall();
+ [NewObject, Throws, AvailableIn=CertifiedApps]
+ DOMRequest toggleCalls();
+
+ // AVRCP 1.3 methods
+ [NewObject, Throws, AvailableIn=CertifiedApps]
+ DOMRequest sendMediaMetaData(optional MediaMetaData mediaMetaData);
+ [NewObject, Throws, AvailableIn=CertifiedApps]
+ DOMRequest sendMediaPlayStatus(optional MediaPlayStatus mediaPlayStatus);
+};
+
+enum BluetoothAdapterState
+{
+ "disabled",
+ "disabling",
+ "enabled",
+ "enabling"
+};
+
+enum BluetoothAdapterAttribute
+{
+ "unknown",
+ "state",
+ "address",
+ "name",
+ "discoverable",
+ "discovering"
+};
+
diff --git a/dom/webidl/BluetoothAdapterEvent.webidl b/dom/webidl/BluetoothAdapterEvent.webidl
new file mode 100644
index 000000000..bc074be16
--- /dev/null
+++ b/dom/webidl/BluetoothAdapterEvent.webidl
@@ -0,0 +1,19 @@
+/* -*- 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/.
+ */
+
+[CheckPermissions="bluetooth",
+ Constructor(DOMString type, optional BluetoothAdapterEventInit eventInitDict)]
+interface BluetoothAdapterEvent : Event
+{
+ readonly attribute BluetoothAdapter? adapter;
+ readonly attribute DOMString? address;
+};
+
+dictionary BluetoothAdapterEventInit : EventInit
+{
+ BluetoothAdapter? adapter = null;
+ DOMString? address = "";
+};
diff --git a/dom/webidl/BluetoothAttributeEvent.webidl b/dom/webidl/BluetoothAttributeEvent.webidl
new file mode 100644
index 000000000..ca30bf89e
--- /dev/null
+++ b/dom/webidl/BluetoothAttributeEvent.webidl
@@ -0,0 +1,21 @@
+/* -*- 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/.
+ */
+
+[CheckPermissions="bluetooth",
+ Constructor(DOMString type,
+ optional BluetoothAttributeEventInit eventInitDict)]
+interface BluetoothAttributeEvent : Event
+{
+ readonly attribute any attrs;
+ // We don't support sequence in event codegen yet (Bug 1023762)
+ // Bug 1015796:
+ // readonly attribute sequence<DOMString> attrs;
+};
+
+dictionary BluetoothAttributeEventInit : EventInit
+{
+ any attrs = null;
+};
diff --git a/dom/webidl/BluetoothClassOfDevice.webidl b/dom/webidl/BluetoothClassOfDevice.webidl
new file mode 100644
index 000000000..c7d3c876d
--- /dev/null
+++ b/dom/webidl/BluetoothClassOfDevice.webidl
@@ -0,0 +1,42 @@
+/* -*- 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/. */
+
+[CheckPermissions="bluetooth"]
+interface BluetoothClassOfDevice
+{
+ /**
+ * The following constants are defined in Assigned Numbers of bluetooth
+ * General Access Profile (GAP) spec. For more information see
+ * https://www.bluetooth.org/en-us/specification/assigned-numbers/baseband
+ */
+
+ // Major service class
+ const unsigned short LIMITED_DISCOVERABILITY = 0x0001;
+ const unsigned short POSITIONING = 0x0008;
+ const unsigned short NETWORKING = 0x0010;
+ const unsigned short RENDERING = 0x0020;
+ const unsigned short CAPTURING = 0x0040;
+ const unsigned short OBJECT_TRANSFER = 0x0080;
+ const unsigned short AUDIO = 0x0100;
+ const unsigned short TELEPHONY = 0x0200;
+ const unsigned short INFORMATION = 0x0400;
+
+ // Major device class
+ const octet MISC = 0x00;
+ const octet COMPUTER = 0x01;
+ const octet PHONE = 0x02;
+ const octet NETWORK = 0x03;
+ const octet AUDIO_VIDEO = 0x04;
+ const octet PERIPHERAL = 0x05;
+ const octet IMAGING = 0x06;
+ const octet WEARABLE = 0x07;
+ const octet TOY = 0x08;
+ const octet HEALTH = 0x09;
+ const octet UNCATEGORIZED = 0x1F;
+
+ readonly attribute unsigned short majorServiceClass;
+ readonly attribute octet majorDeviceClass;
+ readonly attribute octet minorDeviceClass;
+};
diff --git a/dom/webidl/BluetoothDevice.webidl b/dom/webidl/BluetoothDevice.webidl
new file mode 100644
index 000000000..6d1fe59c8
--- /dev/null
+++ b/dom/webidl/BluetoothDevice.webidl
@@ -0,0 +1,23 @@
+/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
+/* vim: set ts=2 et sw=2 tw=80: */
+/* 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/. */
+
+[CheckPermissions="bluetooth"]
+interface BluetoothDevice : EventTarget {
+ readonly attribute DOMString address;
+ readonly attribute DOMString name;
+ readonly attribute DOMString icon;
+ readonly attribute boolean connected;
+ readonly attribute boolean paired;
+ readonly attribute unsigned long class;
+
+ // array of type DOMString[]
+ [Throws]
+ readonly attribute any uuids;
+
+ // array of type DOMString[]
+ [Throws]
+ readonly attribute any services;
+};
diff --git a/dom/webidl/BluetoothDevice2.webidl b/dom/webidl/BluetoothDevice2.webidl
new file mode 100644
index 000000000..7cdd96eb0
--- /dev/null
+++ b/dom/webidl/BluetoothDevice2.webidl
@@ -0,0 +1,60 @@
+/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
+/* vim: set ts=2 et sw=2 tw=80: */
+/* 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/. */
+
+[CheckPermissions="bluetooth"]
+interface BluetoothDevice : EventTarget
+{
+ readonly attribute DOMString address;
+ readonly attribute BluetoothClassOfDevice cod;
+ readonly attribute DOMString name;
+ readonly attribute boolean paired;
+ readonly attribute BluetoothDeviceType type;
+
+ /**
+ * Retrieve the BluetoothGatt interface to interact with remote BLE devices.
+ * This attribute is null if the device type is not dual or le.
+ */
+ readonly attribute BluetoothGatt? gatt;
+
+ [Cached, Pure]
+ readonly attribute sequence<DOMString> uuids;
+
+ // Fired when attribute(s) of BluetoothDevice changed
+ attribute EventHandler onattributechanged;
+
+ /**
+ * Fetch the up-to-date UUID list of each bluetooth service that the device
+ * provides and refresh the cache value of attribute uuids if it is updated.
+ *
+ * If the operation succeeds, the promise will be resolved with up-to-date
+ * UUID list which is identical to attribute uuids.
+ */
+ [NewObject]
+ Promise<sequence<DOMString>> fetchUuids();
+};
+
+enum BluetoothDeviceType
+{
+ "unknown",
+ "classic",
+ "le",
+ "dual"
+};
+
+/*
+ * Possible device attributes that attributechanged event reports.
+ * Note "address" and "type" are excluded since they never change once
+ * BluetoothDevice is created.
+ */
+enum BluetoothDeviceAttribute
+{
+ "unknown",
+ "cod",
+ "name",
+ "paired",
+ "uuids"
+};
+
diff --git a/dom/webidl/BluetoothDeviceEvent.webidl b/dom/webidl/BluetoothDeviceEvent.webidl
index 744e0861e..6f5c73bdc 100644
--- a/dom/webidl/BluetoothDeviceEvent.webidl
+++ b/dom/webidl/BluetoothDeviceEvent.webidl
@@ -3,15 +3,17 @@
* 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/.
*/
-interface BluetoothDevice;
-[Constructor(DOMString type, optional BluetoothDeviceEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[CheckPermissions="bluetooth",
+ Constructor(DOMString type, optional BluetoothDeviceEventInit eventInitDict)]
interface BluetoothDeviceEvent : Event
{
readonly attribute BluetoothDevice? device;
+ readonly attribute DOMString? address;
};
dictionary BluetoothDeviceEventInit : EventInit
{
BluetoothDevice? device = null;
+ DOMString? address = "";
};
diff --git a/dom/webidl/BluetoothDiscoveryHandle.webidl b/dom/webidl/BluetoothDiscoveryHandle.webidl
new file mode 100644
index 000000000..05ffdb7a6
--- /dev/null
+++ b/dom/webidl/BluetoothDiscoveryHandle.webidl
@@ -0,0 +1,9 @@
+/* -*- 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/. */
+
+[CheckPermissions="bluetooth"]
+interface BluetoothDiscoveryHandle : EventTarget {
+ attribute EventHandler ondevicefound;
+};
diff --git a/dom/webidl/BluetoothDiscoveryStateChangedEvent.webidl b/dom/webidl/BluetoothDiscoveryStateChangedEvent.webidl
new file mode 100644
index 000000000..212fabce4
--- /dev/null
+++ b/dom/webidl/BluetoothDiscoveryStateChangedEvent.webidl
@@ -0,0 +1,19 @@
+/* -*- 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/.
+ */
+
+[Constructor(DOMString type,
+ optional BluetoothDiscoveryStateChangedEventInit eventInitDict),
+ CheckPermissions="bluetooth"]
+interface BluetoothDiscoveryStateChangedEvent : Event
+{
+ readonly attribute boolean discovering;
+};
+
+dictionary BluetoothDiscoveryStateChangedEventInit : EventInit
+{
+ boolean discovering = false;
+};
+
diff --git a/dom/webidl/BluetoothGatt.webidl b/dom/webidl/BluetoothGatt.webidl
new file mode 100644
index 000000000..cd271c7ce
--- /dev/null
+++ b/dom/webidl/BluetoothGatt.webidl
@@ -0,0 +1,38 @@
+/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
+/* vim: set ts=2 et sw=2 tw=80: */
+/* 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/. */
+
+[CheckPermissions="bluetooth"]
+interface BluetoothGatt : EventTarget
+{
+ readonly attribute BluetoothConnectionState connectionState;
+
+ // Fired when attribute connectionState changed
+ attribute EventHandler onconnectionstatechanged;
+
+ /**
+ * Connect/Disconnect to the remote BLE device if the connectionState is
+ * disconnected/connected. Otherwise, the Promise will be rejected directly.
+ *
+ * If current connectionState is disconnected/connected,
+ * 1) connectionState change to connecting/disconnecting along with a
+ * connectionstatechanged event.
+ * 2) connectionState change to connected/disconnected if the operation
+ * succeeds. Otherwise, change to disconnected/connected.
+ * 3) Promise is resolved or rejected according to the operation result.
+ */
+ [NewObject]
+ Promise<void> connect();
+ [NewObject]
+ Promise<void> disconnect();
+};
+
+enum BluetoothConnectionState
+{
+ "disconnected",
+ "disconnecting",
+ "connected",
+ "connecting"
+};
diff --git a/dom/webidl/BluetoothManager.webidl b/dom/webidl/BluetoothManager.webidl
new file mode 100644
index 000000000..8083888a0
--- /dev/null
+++ b/dom/webidl/BluetoothManager.webidl
@@ -0,0 +1,17 @@
+/* -*- 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/. */
+
+[CheckPermissions="bluetooth"]
+interface BluetoothManager : EventTarget {
+ [Throws]
+ readonly attribute boolean enabled;
+
+ attribute EventHandler onenabled;
+ attribute EventHandler ondisabled;
+ attribute EventHandler onadapteradded;
+
+ [NewObject, Throws]
+ DOMRequest? getDefaultAdapter();
+};
diff --git a/dom/webidl/BluetoothManager2.webidl b/dom/webidl/BluetoothManager2.webidl
new file mode 100644
index 000000000..fbc9435e7
--- /dev/null
+++ b/dom/webidl/BluetoothManager2.webidl
@@ -0,0 +1,27 @@
+/* -*- 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/. */
+
+[CheckPermissions="bluetooth"]
+interface BluetoothManager: EventTarget
+{
+ readonly attribute BluetoothAdapter? defaultAdapter;
+
+ // Fired when attribute(s) of BluetoothManager changed
+ attribute EventHandler onattributechanged;
+
+ // Fired when a new adapter is plugged in
+ attribute EventHandler onadapteradded;
+
+ // Fired when an existing adapter is unplugged
+ attribute EventHandler onadapterremoved;
+
+ sequence<BluetoothAdapter> getAdapters();
+};
+
+enum BluetoothManagerAttribute
+{
+ "unknown",
+ "defaultAdapter"
+};
diff --git a/dom/webidl/BluetoothPairingEvent.webidl b/dom/webidl/BluetoothPairingEvent.webidl
new file mode 100644
index 000000000..1c9982b50
--- /dev/null
+++ b/dom/webidl/BluetoothPairingEvent.webidl
@@ -0,0 +1,20 @@
+/* -*- 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/.
+ */
+
+[CheckPermissions="bluetooth",
+ Constructor(DOMString type,
+ optional BluetoothPairingEventInit eventInitDict)]
+interface BluetoothPairingEvent : Event
+{
+ readonly attribute BluetoothDevice device;
+ readonly attribute BluetoothPairingHandle handle;
+};
+
+dictionary BluetoothPairingEventInit : EventInit
+{
+ required BluetoothDevice device;
+ required BluetoothPairingHandle handle;
+};
diff --git a/dom/webidl/BluetoothPairingHandle.webidl b/dom/webidl/BluetoothPairingHandle.webidl
new file mode 100644
index 000000000..ad75fdcdd
--- /dev/null
+++ b/dom/webidl/BluetoothPairingHandle.webidl
@@ -0,0 +1,20 @@
+/* -*- 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/. */
+
+[CheckPermissions="bluetooth"]
+interface BluetoothPairingHandle
+{
+ /**
+ * A 6-digit string ranging from decimal 000000 to 999999.
+ * This attribute is an empty string for enterpincodereq and
+ * pairingconsentreq.
+ */
+ readonly attribute DOMString passkey;
+
+ [NewObject]
+ Promise<void> setPinCode(DOMString aPinCode);
+ [NewObject]
+ Promise<void> setPairingConfirmation(boolean aConfirm);
+};
diff --git a/dom/webidl/BluetoothPairingListener.webidl b/dom/webidl/BluetoothPairingListener.webidl
new file mode 100644
index 000000000..88b379e7b
--- /dev/null
+++ b/dom/webidl/BluetoothPairingListener.webidl
@@ -0,0 +1,13 @@
+/* -*- 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/. */
+
+[AvailableIn=CertifiedApps, CheckPermissions="bluetooth"]
+interface BluetoothPairingListener: EventTarget
+{
+ attribute EventHandler ondisplaypasskeyreq;
+ attribute EventHandler onenterpincodereq;
+ attribute EventHandler onpairingconfirmationreq;
+ attribute EventHandler onpairingconsentreq;
+};
diff --git a/dom/webidl/BluetoothStatusChangedEvent.webidl b/dom/webidl/BluetoothStatusChangedEvent.webidl
new file mode 100644
index 000000000..d67a3a232
--- /dev/null
+++ b/dom/webidl/BluetoothStatusChangedEvent.webidl
@@ -0,0 +1,20 @@
+/* -*- 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/.
+ */
+
+[Constructor(DOMString type,
+ optional BluetoothStatusChangedEventInit eventInitDict),
+ CheckPermissions="bluetooth"]
+interface BluetoothStatusChangedEvent : Event
+{
+ readonly attribute DOMString address;
+ readonly attribute boolean status;
+};
+
+dictionary BluetoothStatusChangedEventInit : EventInit
+{
+ DOMString address = "";
+ boolean status = false;
+};
diff --git a/dom/webidl/BoxObject.webidl b/dom/webidl/BoxObject.webidl
new file mode 100644
index 000000000..8bebd6c9e
--- /dev/null
+++ b/dom/webidl/BoxObject.webidl
@@ -0,0 +1,33 @@
+/* -*- 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/.
+ */
+
+[Func="IsChromeOrXBL"]
+interface BoxObject {
+ readonly attribute Element? element;
+
+ readonly attribute long x;
+ readonly attribute long y;
+ [Throws]
+ readonly attribute long screenX;
+ [Throws]
+ readonly attribute long screenY;
+ readonly attribute long width;
+ readonly attribute long height;
+
+ nsISupports? getPropertyAsSupports(DOMString propertyName);
+ void setPropertyAsSupports(DOMString propertyName, nsISupports value);
+ [Throws]
+ DOMString? getProperty(DOMString propertyName);
+ void setProperty(DOMString propertyName, DOMString propertyValue);
+ void removeProperty(DOMString propertyName);
+
+ // for stepping through content in the expanded dom with box-ordinal-group order
+ readonly attribute Element? parentBox;
+ readonly attribute Element? firstChild;
+ readonly attribute Element? lastChild;
+ readonly attribute Element? nextSibling;
+ readonly attribute Element? previousSibling;
+};
diff --git a/dom/webidl/BroadcastChannel.webidl b/dom/webidl/BroadcastChannel.webidl
new file mode 100644
index 000000000..37c531d4a
--- /dev/null
+++ b/dom/webidl/BroadcastChannel.webidl
@@ -0,0 +1,22 @@
+/* -*- 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/.
+ *
+ * For more information on this interface, please see
+ * http://www.whatwg.org/specs/web-apps/current-work/multipage/web-messaging.html#broadcasting-to-other-browsing-contexts
+ */
+
+[Constructor(DOMString channel),
+ Exposed=(Window,Worker),
+ Func="BroadcastChannel::IsEnabled"]
+interface BroadcastChannel : EventTarget {
+ readonly attribute DOMString name;
+
+ [Throws]
+ void postMessage(any message);
+
+ void close();
+
+ attribute EventHandler onmessage;
+};
diff --git a/dom/webidl/BrowserElement.webidl b/dom/webidl/BrowserElement.webidl
new file mode 100644
index 000000000..2d94ffbc6
--- /dev/null
+++ b/dom/webidl/BrowserElement.webidl
@@ -0,0 +1,148 @@
+/* -*- 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/.
+ */
+
+callback BrowserElementNextPaintEventCallback = void ();
+
+dictionary BrowserElementDownloadOptions {
+ DOMString? filename;
+};
+
+[NoInterfaceObject]
+interface BrowserElement {
+};
+
+BrowserElement implements BrowserElementCommon;
+BrowserElement implements BrowserElementPrivileged;
+
+[NoInterfaceObject]
+interface BrowserElementCommon {
+ [Throws,
+ Pref="dom.mozBrowserFramesEnabled",
+ CheckPermissions="browser embed-widgets"]
+ void setVisible(boolean visible);
+
+ [Throws,
+ Pref="dom.mozBrowserFramesEnabled",
+ CheckPermissions="browser embed-widgets"]
+ DOMRequest getVisible();
+
+ [Throws,
+ Pref="dom.mozBrowserFramesEnabled",
+ CheckPermissions="browser embed-widgets"]
+ void setActive(boolean active);
+
+ [Throws,
+ Pref="dom.mozBrowserFramesEnabled",
+ CheckPermissions="browser embed-widgets"]
+ boolean getActive();
+
+ [Throws,
+ Pref="dom.mozBrowserFramesEnabled",
+ CheckPermissions="browser embed-widgets"]
+ void addNextPaintListener(BrowserElementNextPaintEventCallback listener);
+
+ [Throws,
+ Pref="dom.mozBrowserFramesEnabled",
+ CheckPermissions="browser embed-widgets"]
+ void removeNextPaintListener(BrowserElementNextPaintEventCallback listener);
+};
+
+[NoInterfaceObject]
+interface BrowserElementPrivileged {
+ [Throws,
+ Pref="dom.mozBrowserFramesEnabled",
+ CheckPermissions="browser"]
+ void sendMouseEvent(DOMString type,
+ unsigned long x,
+ unsigned long y,
+ unsigned long button,
+ unsigned long clickCount,
+ unsigned long modifiers);
+
+ [Throws,
+ Pref="dom.mozBrowserFramesEnabled",
+ Func="TouchEvent::PrefEnabled",
+ CheckPermissions="browser"]
+ void sendTouchEvent(DOMString type,
+ sequence<unsigned long> identifiers,
+ sequence<long> x,
+ sequence<long> y,
+ sequence<unsigned long> rx,
+ sequence<unsigned long> ry,
+ sequence<float> rotationAngles,
+ sequence<float> forces,
+ unsigned long count,
+ unsigned long modifiers);
+
+ [Throws,
+ Pref="dom.mozBrowserFramesEnabled",
+ CheckPermissions="browser"]
+ void goBack();
+
+ [Throws,
+ Pref="dom.mozBrowserFramesEnabled",
+ CheckPermissions="browser"]
+ void goForward();
+
+ [Throws,
+ Pref="dom.mozBrowserFramesEnabled",
+ CheckPermissions="browser"]
+ void reload(optional boolean hardReload = false);
+
+ [Throws,
+ Pref="dom.mozBrowserFramesEnabled",
+ CheckPermissions="browser"]
+ void stop();
+
+ [Throws,
+ Pref="dom.mozBrowserFramesEnabled",
+ CheckPermissions="browser"]
+ DOMRequest download(DOMString url,
+ optional BrowserElementDownloadOptions options);
+
+ [Throws,
+ Pref="dom.mozBrowserFramesEnabled",
+ CheckPermissions="browser"]
+ DOMRequest purgeHistory();
+
+ [Throws,
+ Pref="dom.mozBrowserFramesEnabled",
+ CheckPermissions="browser"]
+ DOMRequest getScreenshot([EnforceRange] unsigned long width,
+ [EnforceRange] unsigned long height,
+ optional DOMString mimeType="");
+
+ [Throws,
+ Pref="dom.mozBrowserFramesEnabled",
+ CheckPermissions="browser"]
+ void zoom(float zoom);
+
+ [Throws,
+ Pref="dom.mozBrowserFramesEnabled",
+ CheckPermissions="browser"]
+ DOMRequest getCanGoBack();
+
+ [Throws,
+ Pref="dom.mozBrowserFramesEnabled",
+ CheckPermissions="browser"]
+ DOMRequest getCanGoForward();
+
+ [Throws,
+ Pref="dom.mozBrowserFramesEnabled",
+ CheckPermissions="browser"]
+ DOMRequest getContentDimensions();
+
+ [Throws,
+ Pref="dom.mozBrowserFramesEnabled",
+ CheckPermissions="browser"]
+ DOMRequest setInputMethodActive(boolean isActive);
+
+ // Additional |nfc-manager| permission is required for setNFCFocus API
+ [Throws,
+ Pref="dom.mozBrowserFramesEnabled",
+ CheckPermissions="browser"]
+ void setNFCFocus(boolean isFocus);
+};
diff --git a/dom/webidl/BrowserElementDictionaries.webidl b/dom/webidl/BrowserElementDictionaries.webidl
new file mode 100644
index 000000000..a259c7df8
--- /dev/null
+++ b/dom/webidl/BrowserElementDictionaries.webidl
@@ -0,0 +1,29 @@
+/* -*- 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/.
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+dictionary AsyncScrollEventDetail {
+ float top = 0;
+ float left = 0;
+ float width = 0;
+ float height = 0;
+ float scrollWidth = 0;
+ float scrollHeight = 0;
+};
+
+dictionary OpenWindowEventDetail {
+ DOMString url = "";
+ DOMString name = "";
+ DOMString features = "";
+ Node? frameElement = null;
+};
+
+dictionary DOMWindowResizeEventDetail {
+ long width = 0;
+ long height = 0;
+};
diff --git a/dom/webidl/BrowserFeedWriter.webidl b/dom/webidl/BrowserFeedWriter.webidl
new file mode 100644
index 000000000..d756a8837
--- /dev/null
+++ b/dom/webidl/BrowserFeedWriter.webidl
@@ -0,0 +1,20 @@
+/* -*- 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/.
+ */
+
+[JSImplementation="@mozilla.org/browser/feeds/result-writer;1",
+ Func="mozilla::FeedWriterEnabled::IsEnabled",
+ Constructor]
+interface BrowserFeedWriter {
+ /**
+ * Writes the feed content, assumes that the feed writer is initialized.
+ */
+ void writeContent();
+
+ /**
+ * Uninitialize the feed writer.
+ */
+ void close();
+};
diff --git a/dom/webidl/CFStateChangeEvent.webidl b/dom/webidl/CFStateChangeEvent.webidl
index 998ff80b6..364a386f8 100644
--- a/dom/webidl/CFStateChangeEvent.webidl
+++ b/dom/webidl/CFStateChangeEvent.webidl
@@ -4,20 +4,53 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-[Constructor(DOMString type, optional CFStateChangeEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Pref="dom.mobileconnection.enabled",
+ Constructor(DOMString type, optional CFStateChangeEventInit eventInitDict)]
interface CFStateChangeEvent : Event
{
- readonly attribute boolean success;
+ /**
+ * Indicates what to do with the rule.
+ *
+ * One of the CALL_FORWARD_ACTION_* constants. It will be either disable (0),
+ * enable (1), query status (2), registration (3), or erasure (4).
+ *
+ * @see 3GPP MozMobileConnection.CALL_FORWARD_ACTION_* values.
+ * @see 3GPP TS 27.007 7.11 "mode".
+ */
readonly attribute unsigned short action;
+
+ /**
+ * Indicates the reason the call is being forwarded.
+ *
+ * One of the CALL_FORWARD_REASON_* constants. It will be either
+ * unconditional (0), mobile busy (1), no reply (2), not reachable (3),
+ * all call forwarding (4), or all conditional call forwarding (5).
+ *
+ * @see 3GPP MozMobileConnection.CALL_FORWARD_REASON_* values.
+ * @see 3GPP TS 27.007 7.11 "reason".
+ */
readonly attribute unsigned short reason;
+
+ /**
+ * Phone number of forwarding address.
+ */
readonly attribute DOMString? number;
+
+ /**
+ * When "no reply" is enabled or queried, this gives the time in
+ * seconds to wait before call is forwarded.
+ */
readonly attribute unsigned short timeSeconds;
+
+ /**
+ * Service for which the call forward is set up. It should be one of the
+ * MozMobileConnection.ICC_SERVICE_CLASS_* values.
+ */
readonly attribute unsigned short serviceClass;
};
dictionary CFStateChangeEventInit : EventInit
{
- boolean success = false;
unsigned short action = 0;
unsigned short reason = 0;
DOMString number = "";
diff --git a/dom/webidl/CSPReport.webidl b/dom/webidl/CSPReport.webidl
new file mode 100644
index 000000000..390898c83
--- /dev/null
+++ b/dom/webidl/CSPReport.webidl
@@ -0,0 +1,23 @@
+/* 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/. */
+
+/**
+ * This dictionary holds the parameters used to send
+ * CSP reports in JSON format.
+ */
+
+dictionary CSPReportProperties {
+ DOMString document-uri = "";
+ DOMString referrer = "";
+ DOMString blocked-uri = "";
+ DOMString violated-directive = "";
+ DOMString original-policy= "";
+ DOMString source-file;
+ DOMString script-sample;
+ long line-number;
+};
+
+dictionary CSPReport {
+ CSPReportProperties csp-report;
+};
diff --git a/dom/webidl/CSS.webidl b/dom/webidl/CSS.webidl
index 4432c3a38..9965554a8 100644
--- a/dom/webidl/CSS.webidl
+++ b/dom/webidl/CSS.webidl
@@ -10,11 +10,16 @@
* liability, trademark and document use rules apply.
*/
-[PrefControlled]
interface CSS {
- [Throws, Pref="layout.css.supports-rule.enabled"]
+ [Throws]
static boolean supports(DOMString property, DOMString value);
- [Throws, Pref="layout.css.supports-rule.enabled"]
+ [Throws]
static boolean supports(DOMString conditionText);
};
+
+// http://dev.w3.org/csswg/cssom/#the-css.escape%28%29-method
+partial interface CSS {
+ [Throws]
+ static DOMString escape(DOMString ident);
+};
diff --git a/dom/webidl/CSS2PropertiesProps.h b/dom/webidl/CSS2PropertiesProps.h
index b799db072..978dfd45c 100644
--- a/dom/webidl/CSS2PropertiesProps.h
+++ b/dom/webidl/CSS2PropertiesProps.h
@@ -5,30 +5,37 @@
[
-#define DO_PROP(method, pref) \
- [ #method, pref ],
+#define PROP_STRINGIFY_INTERNAL(X) #X
+#define PROP_STRINGIFY(X) PROP_STRINGIFY_INTERNAL(X)
+
+#define DO_PROP(name, method, id, flags, pref) \
+ [ #name, #method, #id, PROP_STRINGIFY(flags), pref ],
#define CSS_PROP(name, id, method, flags, pref, parsevariant, kwtable, \
stylestruct, stylestructofset, animtype) \
- DO_PROP(method, pref)
+ DO_PROP(name, method, id, flags, pref)
#define CSS_PROP_SHORTHAND(name, id, method, flags, pref) \
- DO_PROP(method, pref)
+ DO_PROP(name, method, id, flags, pref)
#define CSS_PROP_PUBLIC_OR_PRIVATE(publicname_, privatename_) publicname_
#define CSS_PROP_LIST_EXCLUDE_INTERNAL
+#define CSS_PROP_LIST_INCLUDE_LOGICAL
#include "nsCSSPropList.h"
+#undef CSS_PROP_LIST_INCLUDE_LOGICAL
#undef CSS_PROP_LIST_EXCLUDE_INTERNAL
#undef CSS_PROP_PUBLIC_OR_PRIVATE
#undef CSS_PROP_SHORTHAND
#undef CSS_PROP
#define CSS_PROP_ALIAS(name, id, method, pref) \
- DO_PROP(method, pref)
+ DO_PROP(name, method, id, 0, pref)
#include "nsCSSPropAliasList.h"
#undef CSS_PROP_ALIAS
#undef DO_PROP
+#undef PROP_STRINGIFY
+#undef PROP_STRINGIFY_INTERNAL
]
diff --git a/dom/webidl/CSSFontFaceLoadEvent.webidl b/dom/webidl/CSSFontFaceLoadEvent.webidl
new file mode 100644
index 000000000..0227639b1
--- /dev/null
+++ b/dom/webidl/CSSFontFaceLoadEvent.webidl
@@ -0,0 +1,21 @@
+/* -*- 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://dev.w3.org/csswg/css-font-loading/#FontFaceSet-interface
+ *
+ * Copyright © 2014 W3C® (MIT, ERCIM, Keio, Beihang), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+dictionary CSSFontFaceLoadEventInit : EventInit {
+ sequence<FontFace> fontfaces = [];
+};
+
+[Constructor(DOMString type, optional CSSFontFaceLoadEventInit eventInitDict),
+ Pref="layout.css.font-loading-api.enabled"]
+interface CSSFontFaceLoadEvent : Event {
+ [Cached, Constant] readonly attribute sequence<FontFace> fontfaces;
+};
diff --git a/dom/webidl/CSSRuleList.webidl b/dom/webidl/CSSRuleList.webidl
new file mode 100644
index 000000000..c4faec148
--- /dev/null
+++ b/dom/webidl/CSSRuleList.webidl
@@ -0,0 +1,10 @@
+/* -*- 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/.
+ */
+
+interface CSSRuleList {
+ readonly attribute unsigned long length;
+ getter CSSRule? item(unsigned long index);
+};
diff --git a/dom/webidl/CSSStyleDeclaration.webidl b/dom/webidl/CSSStyleDeclaration.webidl
index 58477233d..d9b2511de 100644
--- a/dom/webidl/CSSStyleDeclaration.webidl
+++ b/dom/webidl/CSSStyleDeclaration.webidl
@@ -23,9 +23,15 @@ interface CSSStyleDeclaration {
CSSValue? getPropertyCSSValue(DOMString property);
DOMString getPropertyPriority(DOMString property);
[Throws]
- void setProperty(DOMString property, DOMString value, [TreatNullAs=EmptyString] optional DOMString priority = "");
+ void setProperty(DOMString property, [TreatNullAs=EmptyString] DOMString value, [TreatNullAs=EmptyString] optional DOMString priority = "");
[Throws]
DOMString removeProperty(DOMString property);
readonly attribute CSSRule? parentRule;
};
+
+// Mozilla extensions
+partial interface CSSStyleDeclaration {
+ [ChromeOnly,Throws]
+ DOMString getAuthoredPropertyValue(DOMString property);
+};
diff --git a/dom/webidl/CSSStyleSheet.webidl b/dom/webidl/CSSStyleSheet.webidl
index 9f844c70b..1a368aec2 100644
--- a/dom/webidl/CSSStyleSheet.webidl
+++ b/dom/webidl/CSSStyleSheet.webidl
@@ -7,7 +7,6 @@
* http://dev.w3.org/csswg/cssom/
*/
-interface CSSRuleList;
interface CSSRule;
interface CSSStyleSheet : StyleSheet {
diff --git a/dom/webidl/CallEvent.webidl b/dom/webidl/CallEvent.webidl
index 83db7db03..5add9254d 100644
--- a/dom/webidl/CallEvent.webidl
+++ b/dom/webidl/CallEvent.webidl
@@ -3,9 +3,8 @@
* 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/.
*/
-interface TelephonyCall;
-[Constructor(DOMString type, optional CallEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Constructor(DOMString type, optional CallEventInit eventInitDict), Pref="dom.telephony.enabled"]
interface CallEvent : Event
{
readonly attribute TelephonyCall? call;
diff --git a/dom/webidl/CallGroupErrorEvent.webidl b/dom/webidl/CallGroupErrorEvent.webidl
new file mode 100644
index 000000000..ee4624518
--- /dev/null
+++ b/dom/webidl/CallGroupErrorEvent.webidl
@@ -0,0 +1,20 @@
+/* -*- 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/.
+ */
+
+[Pref="dom.telephony.enabled",
+ Constructor(DOMString type,
+ optional CallGroupErrorEventInit eventInitDict)]
+interface CallGroupErrorEvent : Event
+{
+ readonly attribute DOMString? name;
+ readonly attribute DOMString? message;
+};
+
+dictionary CallGroupErrorEventInit : EventInit
+{
+ DOMString name = "";
+ DOMString message = "";
+};
diff --git a/dom/webidl/CallsList.webidl b/dom/webidl/CallsList.webidl
new file mode 100644
index 000000000..251a0b91d
--- /dev/null
+++ b/dom/webidl/CallsList.webidl
@@ -0,0 +1,11 @@
+/* -*- 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/.
+ */
+
+[ArrayClass, NoInterfaceObject]
+interface CallsList {
+ getter TelephonyCall item(unsigned long index);
+ readonly attribute unsigned long length;
+};
diff --git a/dom/webidl/CameraCapabilities.webidl b/dom/webidl/CameraCapabilities.webidl
new file mode 100644
index 000000000..bf2d4ae68
--- /dev/null
+++ b/dom/webidl/CameraCapabilities.webidl
@@ -0,0 +1,92 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=2 et sw=2 tw=80: */
+/* 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 capabilities of the video recorder. These are guaranteed not to change
+ over the lifetime of that partcicular instance.
+*/
+[Func="CameraCapabilities::HasSupport"]
+interface CameraRecorderAudioProfile
+{
+ [Constant, Cached] readonly attribute DOMString codec;
+ [Constant, Cached] readonly attribute unsigned long bitsPerSecond;
+ [Constant, Cached] readonly attribute unsigned long samplesPerSecond;
+ [Constant, Cached] readonly attribute unsigned long channels;
+
+ jsonifier;
+};
+
+[Func="CameraCapabilities::HasSupport"]
+interface CameraRecorderVideoProfile
+{
+ [Constant, Cached] readonly attribute DOMString codec;
+ [Constant, Cached] readonly attribute unsigned long bitsPerSecond;
+ [Constant, Cached] readonly attribute unsigned long framesPerSecond;
+ [Constant, Cached] readonly attribute CameraSize size;
+
+ [Constant, Cached] readonly attribute unsigned long width;
+ [Constant, Cached] readonly attribute unsigned long height;
+
+ jsonifier;
+};
+
+[Func="CameraCapabilities::HasSupport"]
+interface CameraRecorderProfile
+{
+ [Constant, Cached] readonly attribute DOMString name;
+ [Constant, Cached] readonly attribute DOMString containerFormat;
+ [Constant, Cached] readonly attribute DOMString mimeType;
+
+ [Constant, Cached] readonly attribute CameraRecorderAudioProfile audio;
+ [Constant, Cached] readonly attribute CameraRecorderVideoProfile video;
+
+ jsonifier;
+};
+
+[Func="CameraCapabilities::HasSupport"]
+interface CameraRecorderProfiles
+{
+ getter CameraRecorderProfile(DOMString profile);
+
+ jsonifier;
+};
+
+/* The capabilities of a CameraControl instance. These are guaranteed
+ not to change over the lifetime of that particular instance.
+*/
+[Func="CameraCapabilities::HasSupport"]
+interface CameraCapabilities
+{
+ [Constant, Cached] readonly attribute sequence<CameraSize> previewSizes;
+ [Constant, Cached] readonly attribute sequence<CameraSize> pictureSizes;
+ [Constant, Cached] readonly attribute sequence<CameraSize> thumbnailSizes;
+ [Constant, Cached] readonly attribute sequence<CameraSize> videoSizes;
+
+ [Constant, Cached] readonly attribute sequence<DOMString> fileFormats;
+
+ [Constant, Cached] readonly attribute sequence<DOMString> whiteBalanceModes;
+ [Constant, Cached] readonly attribute sequence<DOMString> sceneModes;
+ [Constant, Cached] readonly attribute sequence<DOMString> effects;
+ [Constant, Cached] readonly attribute sequence<DOMString> flashModes;
+ [Constant, Cached] readonly attribute sequence<DOMString> focusModes;
+
+ [Constant, Cached] readonly attribute sequence<double> zoomRatios;
+
+ [Constant, Cached] readonly attribute unsigned long maxFocusAreas;
+ [Constant, Cached] readonly attribute unsigned long maxMeteringAreas;
+ [Constant, Cached] readonly attribute unsigned long maxDetectedFaces;
+
+ [Constant, Cached] readonly attribute double minExposureCompensation;
+ [Constant, Cached] readonly attribute double maxExposureCompensation;
+ [Constant, Cached] readonly attribute double exposureCompensationStep;
+
+ [Constant, Cached] readonly attribute CameraRecorderProfiles recorderProfiles;
+
+ [Constant, Cached] readonly attribute sequence<DOMString> isoModes;
+ [Constant, Cached] readonly attribute sequence<DOMString> meteringModes;
+
+ jsonifier;
+};
diff --git a/dom/webidl/ClientRect.webidl b/dom/webidl/CameraClosedEvent.webidl
index d4f7b7ad8..0452bfb35 100644
--- a/dom/webidl/ClientRect.webidl
+++ b/dom/webidl/CameraClosedEvent.webidl
@@ -3,12 +3,14 @@
* 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/. */
-interface ClientRect
+[Func="Navigator::HasCameraSupport",
+ Constructor(DOMString type, optional CameraClosedEventInit eventInitDict)]
+interface CameraClosedEvent : Event
{
- readonly attribute float left;
- readonly attribute float top;
- readonly attribute float right;
- readonly attribute float bottom;
- readonly attribute float width;
- readonly attribute float height;
+ readonly attribute DOMString reason;
+};
+
+dictionary CameraClosedEventInit : EventInit
+{
+ DOMString reason = "HardwareReleased";
};
diff --git a/dom/webidl/CameraConfigurationEvent.webidl b/dom/webidl/CameraConfigurationEvent.webidl
new file mode 100644
index 000000000..90ffe3a90
--- /dev/null
+++ b/dom/webidl/CameraConfigurationEvent.webidl
@@ -0,0 +1,22 @@
+/* -*- 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/. */
+
+[Func="Navigator::HasCameraSupport",
+ Constructor(DOMString type, optional CameraConfigurationEventInit eventInitDict)]
+interface CameraConfigurationEvent : Event
+{
+ readonly attribute CameraMode mode;
+ readonly attribute DOMString recorderProfile;
+ readonly attribute DOMRectReadOnly? previewSize;
+ readonly attribute DOMRectReadOnly? pictureSize;
+};
+
+dictionary CameraConfigurationEventInit : EventInit
+{
+ CameraMode mode = "picture";
+ DOMString recorderProfile = "cif";
+ DOMRectReadOnly? previewSize = null;
+ DOMRectReadOnly? pictureSize = null;
+};
diff --git a/dom/webidl/CameraControl.webidl b/dom/webidl/CameraControl.webidl
new file mode 100644
index 000000000..fa5243e31
--- /dev/null
+++ b/dom/webidl/CameraControl.webidl
@@ -0,0 +1,470 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=2 et sw=2 tw=80: */
+/* 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/.
+ */
+
+/* Camera regions are used to set focus and metering areas;
+ the coordinates are referenced to the sensor:
+ (-1000, -1000) is the top-left corner
+ (1000, 1000) is the bottom-right corner
+ The weight of the region can range from 0 to 1000. */
+dictionary CameraRegion
+{
+ long top = -1000;
+ long left = -1000;
+ long bottom = 1000;
+ long right = 1000;
+ unsigned long weight = 1000;
+};
+
+/* The position information to record in the image header.
+ 'NaN' indicates the information is not available. */
+dictionary CameraPosition
+{
+ unrestricted double latitude = NaN;
+ unrestricted double longitude = NaN;
+ unrestricted double altitude = NaN;
+ unrestricted double timestamp = NaN;
+};
+
+/*
+ Options for takePicture().
+*/
+dictionary CameraPictureOptions
+{
+ /* an object with a combination of 'height' and 'width' properties
+ chosen from CameraCapabilities.pictureSizes */
+ CameraSize pictureSize = null;
+
+ /* one of the file formats chosen from
+ CameraCapabilities.fileFormats */
+ DOMString fileFormat = "";
+
+ /* the rotation of the image in degrees, from 0 to 270 in
+ steps of 90; this doesn't affect the image, only the
+ rotation recorded in the image header.*/
+ long rotation = 0;
+
+ /* an object containing any or all of 'latitude', 'longitude',
+ 'altitude', and 'timestamp', used to record when and where
+ the image was taken. e.g.
+ {
+ latitude: 43.647118,
+ longitude: -79.3943,
+ altitude: 500
+ // timestamp not specified, in this case, and
+ // won't be included in the image header
+ }
+
+ can be null in the case where position information isn't
+ available/desired.
+
+ 'altitude' is in metres; 'timestamp' is UTC, in seconds from
+ January 1, 1970.
+ */
+ CameraPosition position = null;
+
+ /* the number of seconds from January 1, 1970 UTC. This can be
+ different from the positional timestamp (above). */
+ // XXXbz this should really accept a date too, no?
+ long long dateTime = 0;
+};
+
+/* These properties affect the actual video recording, e.g.
+ {
+ rotation: 0,
+ maxFileSizeBytes: 1024 * 1024,
+ maxVideoLengthMs: 0
+ }
+
+ 'rotation' is the degrees clockwise to rotate the recorded video; if
+ this options is not supported, it will be ignored; if this option is
+ missing, the default is 0.
+
+ 'maxFileSizeBytes' is the maximum size in bytes to which the recorded
+ video file will be allowed to grow.
+
+ 'maxVideoLengthMs' is the maximum length in milliseconds to which the
+ recorded video will be allowed to grow.
+
+ if either 'maxFileSizeBytes' or 'maxVideoLengthMs' is missing or zero,
+ that limit will be disabled; if either value is out of range, it will
+ be clamped from 0 to the upper limit for an 'unsigned long long'.
+*/
+dictionary CameraStartRecordingOptions
+{
+ long rotation = 0;
+ [Clamp]
+ unsigned long long maxFileSizeBytes = 0;
+ [Clamp]
+ unsigned long long maxVideoLengthMs = 0;
+
+ /* If startRecording() is called with flashMode set to "auto" and the
+ camera has determined that the scene is poorly lit, the flash mode
+ will be automatically changed to "torch" until stopRecording() is
+ called. During this time, flashMode will reflect the new setting. If
+ flashMode is changed while recording is in progress, the new setting
+ will be left as-is on stopRecording(). If the camera does not
+ support this setting, it will be ignored. */
+ boolean autoEnableLowLightTorch = false;
+};
+
+/*
+ attributes here affect the preview, any pictures taken, and/or
+ any video recorded by the camera.
+*/
+[Func="nsDOMCameraControl::HasSupport"]
+interface CameraControl : MediaStream
+{
+ [Constant, Cached]
+ readonly attribute CameraCapabilities capabilities;
+
+ /* one of the values chosen from capabilities.effects;
+ default is "none" */
+ [Throws]
+ attribute DOMString effect;
+
+ /* one of the values chosen from capabilities.whiteBalanceModes;
+ default is "auto" */
+ [Throws]
+ attribute DOMString whiteBalanceMode;
+
+ /* one of the values chosen from capabilities.sceneModes;
+ default is "auto" */
+ [Throws]
+ attribute DOMString sceneMode;
+
+ /* one of the values chosen from capabilities.flashModes;
+ default is "auto" */
+ [Throws]
+ attribute DOMString flashMode;
+
+ /* one of the values chosen from capabilities.focusModes;
+ default is "auto", if supported, or "fixed" */
+ [Throws]
+ attribute DOMString focusMode;
+
+ /* one of the values chosen from capabilities.zoomRatios; other
+ values will be rounded to the nearest supported value;
+ default is 1.0 */
+ [Throws]
+ attribute double zoom;
+
+ /* an array of one or more objects that define where the
+ camera will perform light metering, each defining the properties:
+ {
+ top: -1000,
+ left: -1000,
+ bottom: 1000,
+ right: 1000,
+ weight: 1000
+ }
+
+ 'top', 'left', 'bottom', and 'right' all range from -1000 at
+ the top-/leftmost of the sensor to 1000 at the bottom-/rightmost
+ of the sensor.
+
+ objects missing one or more of these properties will be ignored;
+ if the array contains more than capabilities.maxMeteringAreas,
+ extra areas will be ignored.
+
+ if this setter is called with no arguments, the camera will
+ determine metering areas on its own. */
+ [Throws]
+ sequence<CameraRegion> getMeteringAreas();
+ [Throws]
+ void setMeteringAreas(optional sequence<CameraRegion> meteringAreas);
+
+ /* an array of one or more objects that define where the camera will
+ perform auto-focusing, with the same definition as meteringAreas.
+
+ if the array contains more than capabilities.maxFocusAreas, extra
+ areas will be ignored.
+
+ if this setter is called with no arguments, the camera will
+ determine focus areas on its own. */
+ [Throws]
+ sequence<CameraRegion> getFocusAreas();
+ [Throws]
+ void setFocusAreas(optional sequence<CameraRegion> focusAreas);
+
+ /* focal length in millimetres */
+ [Throws]
+ readonly attribute double focalLength;
+
+ /* the distances in metres to where the image subject appears to be
+ in focus. 'focusDistanceOptimum' is where the subject will appear
+ sharpest; the difference between 'focusDistanceFar' and
+ 'focusDistanceNear' is the image's depth of field.
+
+ 'focusDistanceFar' may be infinity. */
+ [Throws]
+ readonly attribute double focusDistanceNear;
+ [Throws]
+ readonly attribute double focusDistanceOptimum;
+ [Throws]
+ readonly attribute unrestricted double focusDistanceFar;
+
+ /* over- or under-expose the image; acceptable values must range from
+ minExposureCompensation to maxExposureCompensation in steps of
+ stepExposureCompensation. Invalid values will be rounded to the nearest
+ valid value; out-of-bounds values will be limited to the range
+ supported by the camera. */
+ [Throws]
+ attribute double exposureCompensation;
+
+ /* one of the values chosen from capabilities.isoModes; default
+ value is "auto" if supported. */
+ [Throws]
+ attribute DOMString isoMode;
+
+ /* the event dispatched on the camera's shutter event, to trigger
+ a shutter sound and/or a visual shutter indicator.
+
+ contains no event-specific data. */
+ attribute EventHandler onshutter;
+
+ /* the event dispatched when the camera hardware is closed; this may
+ be due to a system failure, another process taking over the camera,
+ or a call to release().
+
+ The event has a 'reason' attribute that will be one of the following
+ string values:
+ - SystemFailure : the camera subsystem failed and was closed;
+ - HardwareReleased : a call to release() was successful;
+ - NotAvailable : the camera hardware is in use by another process.
+ */
+ attribute EventHandler onclose;
+
+ /* the event dispatched when the recorder changes state, either because
+ the recording process encountered an error, or because one of the
+ recording limits (see CameraStartRecordingOptions) was reached.
+
+ event type is CameraStateChangeEvent where:
+ 'newState' is the new recorder state */
+ attribute EventHandler onrecorderstatechange;
+
+ /* the event dispatched when the viewfinder stops or starts,
+ useful for synchronizing other UI elements.
+
+ event type is CameraStateChangeEvent where:
+ 'newState' is the new preview state */
+ attribute EventHandler onpreviewstatechange;
+
+ /* the size of the picture to be returned by a call to takePicture();
+ an object with 'height' and 'width' properties that corresponds to
+ one of the options returned by capabilities.pictureSizes.
+
+ note that unlike when one uses setConfiguration instead to update the
+ picture size, this will not recalculate the ideal preview size. */
+ [Throws]
+ CameraSize getPictureSize();
+ [Throws]
+ void setPictureSize(optional CameraSize size);
+
+ /* if the image blob to be returned by takePicture() supports lossy
+ compression, this setting controls the quality-size trade-off;
+ valid values range from 0.0 for smallest size/worst quality to 1.0
+ for largest size/best quality. Note that depending on the range of
+ values supported by the underlying platform, this attribute may not
+ 'get' the exact value that was previously 'set'. If this setting is
+ not supported, it is ignored. */
+ [Throws]
+ attribute double pictureQuality;
+
+ /* the size of the thumbnail to be included in the picture returned
+ by a call to takePicture(), assuming the chosen fileFormat supports
+ one; an object with 'height' and 'width' properties that corresponds
+ to one of the options returned by capabilities.pictureSizes.
+
+ this setting should be considered a hint: the implementation will
+ respect it when possible, and override it if necessary. */
+ [Throws]
+ CameraSize getThumbnailSize();
+ [Throws]
+ void setThumbnailSize(optional CameraSize size);
+
+ /* the angle, in degrees, that the image sensor is mounted relative
+ to the display; e.g. if 'sensorAngle' is 270 degrees (or -90 degrees),
+ then the preview stream needs to be rotated +90 degrees to have the
+ same orientation as the real world. */
+ [Constant, Cached]
+ readonly attribute long sensorAngle;
+
+ /* the mode the camera will use to determine the correct exposure of
+ the scene; supported modes are exposed by capabilities.meteringModes. */
+ [Throws]
+ attribute DOMString meteringMode;
+
+ /* tell the camera to attempt to focus the image */
+ [Throws]
+ Promise<boolean> autoFocus();
+
+ /* the event dispatched whenever the focus state changes due to calling
+ autoFocus or due to continuous autofocus.
+
+ if continuous autofocus is supported and focusMode is set to enable it,
+ then this event is dispatched whenever the camera decides to start and
+ stop moving the focus position; it can be used to update a UI element to
+ indicate that the camera is still trying to focus, or has finished. Some
+ platforms do not support this event, in which case the callback is never
+ invoked.
+
+ event type is CameraStateChangeEvent where:
+ 'newState' is one of the following states:
+ 'focused' if the focus is now set
+ 'focusing' if the focus is moving
+ 'unfocused' if last attempt to focus failed */
+ attribute EventHandler onfocus;
+
+ /* capture an image and return it as a blob to the 'onSuccess' callback;
+ if the camera supports it, this may be invoked while the camera is
+ already recording video.
+
+ invoking this function will stop the preview stream, which must be
+ manually restarted by calling resumePreview(). */
+ [Throws]
+ Promise<Blob> takePicture(optional CameraPictureOptions options);
+
+ /* the event dispatched when a picture is successfully taken; it is of the
+ type BlobEvent, where the data attribute contains the picture. */
+ attribute EventHandler onpicture;
+
+ /* start recording video; 'options' is a CameraStartRecordingOptions object.
+ If the success/error callbacks are not used, one may determine success by
+ waiting for the recorderstatechange event. */
+ [Throws]
+ Promise<void> startRecording(CameraStartRecordingOptions options,
+ DeviceStorage storageArea,
+ DOMString filename);
+
+ /* stop precording video. */
+ [Throws]
+ void stopRecording();
+
+ /* call in or after the takePicture() onSuccess callback to
+ resume the camera preview stream. */
+ [Throws]
+ void resumePreview();
+
+ /* release the camera so that other applications can use it; you should
+ probably call this whenever the camera is not longer in the foreground
+ (depending on your usage model).
+
+ once this is called, the camera control object is to be considered
+ defunct; a new instance will need to be created to access the camera. */
+ [Throws]
+ Promise<void> release();
+
+ /* changes the camera configuration on the fly. */
+ [Throws]
+ Promise<CameraConfiguration> setConfiguration(optional CameraConfiguration configuration);
+
+ /* the event dispatched when the camera is successfully configured.
+
+ event type is CameraConfigurationEvent which has the same members as
+ CameraConfiguration. */
+ attribute EventHandler onconfigurationchange;
+
+ /* if focusMode is set to either 'continuous-picture' or 'continuous-video',
+ then calling autoFocus() will trigger its onSuccess callback immediately
+ if the camera was either successfully focused, or if no focus could be
+ acquired; if the focus acquisition is still in progress, the onSuccess
+ callback will be invoked later, its argument indicating success or
+ failure.
+
+ once autoFocus() is called with a continuous autofocus mode set, the
+ continuous autofocus process is stopped and focus is locked in the
+ current state until this method is called.
+ */
+ [Throws]
+ void resumeContinuousFocus();
+};
+
+/* The information of the each face detected by a camera device, e.g.
+ {
+ id: 1,
+ score: 80,
+ bound: { left: -203,
+ top: -400,
+ right: 300,
+ bottom: 250 },
+ leftEye: { x: -100,
+ y: -200 },
+ rightEye: { x: 100,
+ y: 100 },
+ mouth: { x: 150,
+ y: 150 } }
+
+ 'id' is an unique value per face while the face is visible to the tracker.
+ If the face leaves the viewfinder and then returns, it will be assigned
+ a new value.
+
+ 'score' is the confidence level for the detection of the face.
+ This range is 1 to 100, where 100 is the highest confidence.
+
+ 'bounds' is the bounds of the face. It is guaranteed left < right and
+ top < bottom. The coordinates can be smaller than -1000 or bigger than 1000.
+ But at least one vertex will be within (-1000, -1000) and (1000, 1000).
+
+ 'leftEye' is the coordinates of the centre of the left eye. The coordinates
+ are in the same space as the ones for 'bounds'. This is an optional field
+ and may not be supported on all devices. If it is not supported or detected,
+ the value will be set to null. The x and y coordinates are bounded by the
+ range (-1000, 1000) where:
+ { x: -1000, y: -1000 } is the top-left corner
+ { x: 1000, y: 1000 } is the bottom-right corner
+
+ 'rightEye' is the coordinates of the detected right eye; null if not
+ supported or detected. Same boundary conditions as 'leftEye'.
+
+ 'mouth' is the coordinates of the detected mouth; null if not supported or
+ detected. Same boundary conditions as 'leftEye'.
+*/
+[Pref="camera.control.face_detection.enabled", Func="DOMCameraDetectedFace::HasSupport"]
+interface CameraDetectedFace
+{
+ readonly attribute unsigned long id;
+
+ readonly attribute unsigned long score;
+
+ readonly attribute DOMRect bounds;
+
+ readonly attribute boolean hasLeftEye;
+ readonly attribute DOMPoint? leftEye;
+
+ readonly attribute boolean hasRightEye;
+ readonly attribute DOMPoint? rightEye;
+
+ readonly attribute boolean hasMouth;
+ readonly attribute DOMPoint? mouth;
+};
+
+callback CameraFaceDetectionCallback = void (sequence<CameraDetectedFace> faces);
+
+partial interface CameraControl
+{
+ /* Starts the face detection. This should be called after the preview is
+ started. The camera will periodically call 'onFacesDetected' with a
+ sequence of zero or one or more detected faces in the preview frame.
+
+ How often the callback is invoked is implementation dependent.
+
+ This method throws an exception if face detection fails to start.
+ */
+ [Throws, Pref="camera.control.face_detection.enabled"]
+ void startFaceDetection();
+
+ /* Stops the face detection.
+
+ This method throws an exception if face detection can't be stopped.
+ */
+ [Throws, Pref="camera.control.face_detection.enabled"]
+ void stopFaceDetection();
+
+ /* CameraFacesDetectedEvent */
+ [Pref="camera.control.face_detection.enabled"]
+ attribute EventHandler onfacesdetected;
+};
diff --git a/dom/webidl/CameraFacesDetectedEvent.webidl b/dom/webidl/CameraFacesDetectedEvent.webidl
new file mode 100644
index 000000000..0d16cd810
--- /dev/null
+++ b/dom/webidl/CameraFacesDetectedEvent.webidl
@@ -0,0 +1,18 @@
+/* -*- 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/. */
+
+[Pref="camera.control.face_detection.enabled",
+ Func="Navigator::HasCameraSupport",
+ Constructor(DOMString type, optional CameraFacesDetectedEventInit eventInitDict)]
+interface CameraFacesDetectedEvent : Event
+{
+ [Pure, Cached]
+ readonly attribute sequence<CameraDetectedFace>? faces;
+};
+
+dictionary CameraFacesDetectedEventInit : EventInit
+{
+ sequence<CameraDetectedFace>? faces = null;
+};
diff --git a/dom/webidl/CameraManager.webidl b/dom/webidl/CameraManager.webidl
index bcf15c1cc..aa27a7c9d 100644
--- a/dom/webidl/CameraManager.webidl
+++ b/dom/webidl/CameraManager.webidl
@@ -5,70 +5,58 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-dictionary CameraPictureOptions {
-
- /* an object with a combination of 'height' and 'width' properties
- chosen from nsICameraCapabilities.pictureSizes */
- // XXXbz this should be a CameraSize dictionary, but we don't have that yet.
- any pictureSize = null;
-
- /* one of the file formats chosen from
- nsICameraCapabilities.fileFormats */
- DOMString fileFormat = "";
-
- /* the rotation of the image in degrees, from 0 to 270 in
- steps of 90; this doesn't affect the image, only the
- rotation recorded in the image header.*/
- long rotation = 0;
-
- /* an object containing any or all of 'latitude', 'longitude',
- 'altitude', and 'timestamp', used to record when and where
- the image was taken. e.g.
- {
- latitude: 43.647118,
- longitude: -79.3943,
- altitude: 500
- // timestamp not specified, in this case, and
- // won't be included in the image header
- }
-
- can be null in the case where position information isn't
- available/desired.
-
- 'altitude' is in metres; 'timestamp' is UTC, in seconds from
- January 1, 1970.
- */
- any position = null;
-
- /* the number of seconds from January 1, 1970 UTC. This can be
- different from the positional timestamp (above). */
- // XXXbz this should really accept a date too, no?
- long long dateTime = 0;
+enum CameraMode { "unspecified", "picture", "video" };
+
+/* Used for the dimensions of a captured picture,
+ a preview stream, a video capture stream, etc. */
+dictionary CameraSize
+{
+ unsigned long width = 0;
+ unsigned long height = 0;
};
-// If we start using CameraPictureOptions here, remove it from DummyBinding.
-
-interface GetCameraCallback;
-interface CameraErrorCallback;
-
-/* Select a camera to use. */
-dictionary CameraSelector {
- DOMString camera = "back";
+/* Pre-emptive camera configuration options. If 'mode' is set to "unspecified",
+ the camera will not be configured immediately. If the 'mode' is set to
+ "video" or "picture", then the camera automatically configures itself and
+ will be ready for use upon return.
+
+ The remaining parameters are optional and are considered hints by the
+ camera. The application should use the values returned in the
+ GetCameraCallback configuration because while the camera makes a best effort
+ to adhere to the requested values, it may need to change them to ensure
+ optimal behavior.
+
+ If not specified, 'pictureSize' and 'recorderProfile' default to the best or
+ highest resolutions supported by the camera hardware.
+
+ To determine 'previewSize', one should generally provide the size of the
+ element which will contain the preview rather than guess which supported
+ preview size is the best. If not specified, 'previewSize' defaults to the
+ inner window size. */
+dictionary CameraConfiguration
+{
+ CameraMode mode = "picture";
+ CameraSize previewSize = null;
+ CameraSize pictureSize = null;
+
+ /* one of the profiles reported by
+ CameraControl.capabilities.recorderProfiles
+ */
+ DOMString recorderProfile = "default";
};
-interface CameraManager {
- /* get a camera instance; options will be used to specify which
- camera to get from the list returned by getListOfCameras(), e.g.:
- {
- camera: "front"
- }
- */
+[Func="nsDOMCameraManager::HasSupport"]
+interface CameraManager
+{
+ /* get a camera instance; 'camera' is one of the camera
+ identifiers returned by getListOfCameras() below.
+ */
[Throws]
- void getCamera(CameraSelector options, GetCameraCallback callback,
- optional CameraErrorCallback errorCallback);
+ Promise<CameraGetPromiseData> getCamera(DOMString camera,
+ optional CameraConfiguration initialConfiguration);
- /* return an array of camera identifiers, e.g.
- [ "front", "back" ]
+ /* return an array of camera identifiers, e.g.
+ [ "front", "back" ]
*/
[Throws]
sequence<DOMString> getListOfCameras();
diff --git a/dom/webidl/CameraStateChangeEvent.webidl b/dom/webidl/CameraStateChangeEvent.webidl
new file mode 100644
index 000000000..af77453cb
--- /dev/null
+++ b/dom/webidl/CameraStateChangeEvent.webidl
@@ -0,0 +1,16 @@
+/* -*- 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/. */
+
+[Func="Navigator::HasCameraSupport",
+ Constructor(DOMString type, optional CameraStateChangeEventInit eventInitDict)]
+interface CameraStateChangeEvent : Event
+{
+ readonly attribute DOMString newState;
+};
+
+dictionary CameraStateChangeEventInit : EventInit
+{
+ DOMString newState = "";
+};
diff --git a/dom/webidl/CameraUtil.webidl b/dom/webidl/CameraUtil.webidl
new file mode 100644
index 000000000..155a71f2d
--- /dev/null
+++ b/dom/webidl/CameraUtil.webidl
@@ -0,0 +1,12 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=2 et sw=2 tw=80: */
+/* 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/.
+ */
+
+dictionary CameraGetPromiseData
+{
+ CameraControl? camera = null;
+ CameraConfiguration configuration;
+};
diff --git a/dom/webidl/CanvasRenderingContext2D.webidl b/dom/webidl/CanvasRenderingContext2D.webidl
index d377cdf60..6902f1c36 100644
--- a/dom/webidl/CanvasRenderingContext2D.webidl
+++ b/dom/webidl/CanvasRenderingContext2D.webidl
@@ -11,11 +11,20 @@
* and create derivative works of this document.
*/
-interface HitRegionOptions;
-interface Window;
-
enum CanvasWindingRule { "nonzero", "evenodd" };
+dictionary ContextAttributes2D {
+ // whether or not we're planning to do a lot of readback operations
+ boolean willReadFrequently = false;
+ // signal if the canvas contains an alpha channel
+ boolean alpha = true;
+};
+
+dictionary HitRegionOptions {
+ DOMString id = "";
+ Element? control = null;
+};
+
interface CanvasRenderingContext2D {
// back-reference to the canvas. Might be null if we're not
@@ -38,7 +47,8 @@ interface CanvasRenderingContext2D {
void transform(double a, double b, double c, double d, double e, double f);
[Throws, LenientFloat]
void setTransform(double a, double b, double c, double d, double e, double f);
-// NOT IMPLEMENTED void resetTransform();
+ [Throws]
+ void resetTransform();
// compositing
attribute unrestricted double globalAlpha; // (default 1.0)
@@ -46,15 +56,13 @@ interface CanvasRenderingContext2D {
attribute DOMString globalCompositeOperation; // (default source-over)
// colors and styles (see also the CanvasDrawingStyles interface)
- [GetterThrows]
- attribute any strokeStyle; // (default black)
- [GetterThrows]
- attribute any fillStyle; // (default black)
- [Creator]
+ attribute (DOMString or CanvasGradient or CanvasPattern) strokeStyle; // (default black)
+ attribute (DOMString or CanvasGradient or CanvasPattern) fillStyle; // (default black)
+ [NewObject]
CanvasGradient createLinearGradient(double x0, double y0, double x1, double y1);
- [Creator, Throws]
+ [NewObject, Throws]
CanvasGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1);
- [Creator, Throws]
+ [NewObject, Throws]
CanvasPattern createPattern((HTMLImageElement or HTMLCanvasElement or HTMLVideoElement) image, [TreatNullAs=EmptyString] DOMString repetition);
// shadows
@@ -66,6 +74,9 @@ interface CanvasRenderingContext2D {
attribute double shadowBlur; // (default 0)
attribute DOMString shadowColor; // (default transparent black)
+ [Pref="canvas.filters.enabled", SetterThrows]
+ attribute DOMString filter; // (default empty string = no filter)
+
// rects
[LenientFloat]
void clearRect(double x, double y, double w, double h);
@@ -76,29 +87,30 @@ interface CanvasRenderingContext2D {
// path API (see also CanvasPathMethods)
void beginPath();
- void fill([TreatUndefinedAs=Missing] optional CanvasWindingRule winding = "nonzero");
-// NOT IMPLEMENTED void fill(Path path);
+ void fill(optional CanvasWindingRule winding = "nonzero");
+ void fill(Path2D path, optional CanvasWindingRule winding = "nonzero");
void stroke();
-// NOT IMPLEMENTED void stroke(Path path);
-// NOT IMPLEMENTED void drawSystemFocusRing(Element element);
-// NOT IMPLEMENTED void drawSystemFocusRing(Path path, Element element);
-// NOT IMPLEMENTED boolean drawCustomFocusRing(Element element);
-// NOT IMPLEMENTED boolean drawCustomFocusRing(Path path, Element element);
+ void stroke(Path2D path);
+ [Pref="canvas.focusring.enabled"] void drawFocusIfNeeded(Element element);
+// NOT IMPLEMENTED void drawSystemFocusRing(Path path, HTMLElement element);
+ [Pref="canvas.customfocusring.enabled"] boolean drawCustomFocusRing(Element element);
+// NOT IMPLEMENTED boolean drawCustomFocusRing(Path path, HTMLElement element);
// NOT IMPLEMENTED void scrollPathIntoView();
// NOT IMPLEMENTED void scrollPathIntoView(Path path);
- void clip([TreatUndefinedAs=Missing] optional CanvasWindingRule winding = "nonzero");
-// NOT IMPLEMENTED void clip(Path path);
+ void clip(optional CanvasWindingRule winding = "nonzero");
+ void clip(Path2D path, optional CanvasWindingRule winding = "nonzero");
// NOT IMPLEMENTED void resetClip();
- boolean isPointInPath(unrestricted double x, unrestricted double y, [TreatUndefinedAs=Missing] optional CanvasWindingRule winding = "nonzero");
-// NOT IMPLEMENTED boolean isPointInPath(Path path, unrestricted double x, unrestricted double y);
+ boolean isPointInPath(unrestricted double x, unrestricted double y, optional CanvasWindingRule winding = "nonzero");
+ boolean isPointInPath(Path2D path, unrestricted double x, unrestricted double y, optional CanvasWindingRule winding = "nonzero");
boolean isPointInStroke(double x, double y);
+ boolean isPointInStroke(Path2D path, unrestricted double x, unrestricted double y);
// text (see also the CanvasDrawingStyles interface)
[Throws, LenientFloat]
void fillText(DOMString text, double x, double y, optional double maxWidth);
[Throws, LenientFloat]
void strokeText(DOMString text, double x, double y, optional double maxWidth);
- [Creator, Throws]
+ [NewObject, Throws]
TextMetrics measureText(DOMString text);
// drawing images
@@ -111,14 +123,16 @@ interface CanvasRenderingContext2D {
void drawImage((HTMLImageElement or HTMLCanvasElement or HTMLVideoElement) image, double sx, double sy, double sw, double sh, double dx, double dy, double dw, double dh);
// hit regions
-// NOT IMPLEMENTED void addHitRegion(HitRegionOptions options);
+ [Pref="canvas.hitregions.enabled", Throws] void addHitRegion(optional HitRegionOptions options);
+ [Pref="canvas.hitregions.enabled"] void removeHitRegion(DOMString id);
+ [Pref="canvas.hitregions.enabled"] void clearHitRegions();
// pixel manipulation
- [Creator, Throws]
+ [NewObject, Throws]
ImageData createImageData(double sw, double sh);
- [Creator, Throws]
+ [NewObject, Throws]
ImageData createImageData(ImageData imagedata);
- [Creator, Throws]
+ [NewObject, Throws]
ImageData getImageData(double sx, double sy, double sw, double sh);
[Throws]
void putImageData(ImageData imagedata, double dx, double dy);
@@ -209,6 +223,12 @@ interface CanvasRenderingContext2D {
void asyncDrawXULElement(XULElement elem, double x, double y, double w,
double h, DOMString bgColor,
optional unsigned long flags = 0);
+ /**
+ * This causes a context that is currently using a hardware-accelerated
+ * backend to fallback to a software one. All state should be preserved.
+ */
+ [ChromeOnly]
+ void demote();
};
CanvasRenderingContext2D implements CanvasDrawingStyles;
CanvasRenderingContext2D implements CanvasPathMethods;
@@ -271,7 +291,11 @@ interface CanvasGradient {
interface CanvasPattern {
// opaque object
- // void setTransform(SVGMatrix transform);
+ // [Throws, LenientFloat] - could not do this overload because of bug 1020975
+ // void setTransform(double a, double b, double c, double d, double e, double f);
+
+ // No throw necessary here - SVGMatrix is always good.
+ void setTransform(SVGMatrix matrix);
};
interface TextMetrics {
@@ -299,3 +323,12 @@ interface TextMetrics {
};
+[Pref="canvas.path.enabled",
+ Constructor,
+ Constructor(Path2D other),
+ Constructor(DOMString pathString)]
+interface Path2D
+{
+ void addPath(Path2D path, optional SVGMatrix transformation);
+};
+Path2D implements CanvasPathMethods;
diff --git a/dom/webidl/CaretPosition.webidl b/dom/webidl/CaretPosition.webidl
index 3b743dfc1..074781a2c 100644
--- a/dom/webidl/CaretPosition.webidl
+++ b/dom/webidl/CaretPosition.webidl
@@ -16,5 +16,5 @@ interface CaretPosition {
* Goanna specific methods and properties for CaretPosition.
*/
partial interface CaretPosition {
- ClientRect? getClientRect();
+ DOMRect? getClientRect();
};
diff --git a/dom/webidl/ChannelMergerNode.webidl b/dom/webidl/ChannelMergerNode.webidl
index 5880053ea..018c004a0 100644
--- a/dom/webidl/ChannelMergerNode.webidl
+++ b/dom/webidl/ChannelMergerNode.webidl
@@ -10,7 +10,6 @@
* liability, trademark and document use rules apply.
*/
-[PrefControlled]
interface ChannelMergerNode : AudioNode {
};
diff --git a/dom/webidl/ChannelSplitterNode.webidl b/dom/webidl/ChannelSplitterNode.webidl
index 0978ccd15..41dcc75de 100644
--- a/dom/webidl/ChannelSplitterNode.webidl
+++ b/dom/webidl/ChannelSplitterNode.webidl
@@ -10,7 +10,6 @@
* liability, trademark and document use rules apply.
*/
-[PrefControlled]
interface ChannelSplitterNode : AudioNode {
};
diff --git a/dom/webidl/CharacterData.webidl b/dom/webidl/CharacterData.webidl
index d1b222bc1..8d6a214e5 100644
--- a/dom/webidl/CharacterData.webidl
+++ b/dom/webidl/CharacterData.webidl
@@ -11,7 +11,9 @@
*/
interface CharacterData : Node {
- [TreatNullAs=EmptyString,SetterThrows] attribute DOMString data;
+ [TreatNullAs=EmptyString, Pure, SetterThrows]
+ attribute DOMString data;
+ [Pure]
readonly attribute unsigned long length;
[Throws]
DOMString substringData(unsigned long offset, unsigned long count);
@@ -26,3 +28,4 @@ interface CharacterData : Node {
};
CharacterData implements ChildNode;
+CharacterData implements NonDocumentTypeChildNode;
diff --git a/dom/webidl/ChildNode.webidl b/dom/webidl/ChildNode.webidl
index 7032dd416..0895011fe 100644
--- a/dom/webidl/ChildNode.webidl
+++ b/dom/webidl/ChildNode.webidl
@@ -9,13 +9,17 @@
[NoInterfaceObject]
interface ChildNode {
-// On Element:
-// readonly attribute Element? previousElementSibling;
-// readonly attribute Element? nextElementSibling;
-
// Not implemented yet:
// void before((Node or DOMString)... nodes);
// void after((Node or DOMString)... nodes);
// void replace((Node or DOMString)... nodes);
void remove();
};
+
+[NoInterfaceObject]
+interface NonDocumentTypeChildNode {
+ [Pure]
+ readonly attribute Element? previousElementSibling;
+ [Pure]
+ readonly attribute Element? nextElementSibling;
+};
diff --git a/dom/webidl/ChromeNotifications.webidl b/dom/webidl/ChromeNotifications.webidl
new file mode 100644
index 000000000..ad7a9de01
--- /dev/null
+++ b/dom/webidl/ChromeNotifications.webidl
@@ -0,0 +1,14 @@
+/* -*- 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/.
+ */
+
+[JSImplementation="@mozilla.org/mozChromeNotifications;1",
+ NavigatorProperty="mozChromeNotifications",
+ AvailableIn="CertifiedApps"]
+interface ChromeNotifications {
+ void mozResendAllNotifications(ResendCallback resendCallback);
+};
+
+callback ResendCallback = void (long count);
diff --git a/dom/webidl/Client.webidl b/dom/webidl/Client.webidl
new file mode 100644
index 000000000..570a9de52
--- /dev/null
+++ b/dom/webidl/Client.webidl
@@ -0,0 +1,17 @@
+/* -*- 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://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html
+ *
+ */
+
+[Exposed=ServiceWorker]
+interface Client {
+ readonly attribute unsigned long id;
+
+ [Throws]
+ void postMessage(any message, optional sequence<Transferable> transfer);
+};
diff --git a/dom/webidl/Clients.webidl b/dom/webidl/Clients.webidl
new file mode 100644
index 000000000..d3a75cf4e
--- /dev/null
+++ b/dom/webidl/Clients.webidl
@@ -0,0 +1,30 @@
+/* -*- 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://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html
+ *
+ */
+
+[Exposed=ServiceWorker]
+interface Clients {
+ // A list of client objects, identifiable by ID, that correspond to windows
+ // (or workers) that are "controlled" by this SW
+ [Throws]
+ Promise<sequence<Client>?> matchAll(optional ClientQueryOptions options);
+};
+
+dictionary ClientQueryOptions {
+ boolean includeUncontrolled = false;
+ ClientType type = "window";
+};
+
+enum ClientType {
+ "window",
+ "worker",
+ "sharedworker",
+ "all"
+};
+
diff --git a/dom/webidl/ClipboardEvent.webidl b/dom/webidl/ClipboardEvent.webidl
index 2ddc3266f..8fe8a4935 100644
--- a/dom/webidl/ClipboardEvent.webidl
+++ b/dom/webidl/ClipboardEvent.webidl
@@ -10,8 +10,6 @@
* liability, trademark and document use rules apply.
*/
-interface DataTransfer;
-
[Constructor(DOMString type, optional ClipboardEventInit eventInitDict)]
interface ClipboardEvent : Event
{
diff --git a/dom/webidl/CloseEvent.webidl b/dom/webidl/CloseEvent.webidl
index f835b4d6c..9a64564bf 100644
--- a/dom/webidl/CloseEvent.webidl
+++ b/dom/webidl/CloseEvent.webidl
@@ -10,21 +10,20 @@
* http://www.whatwg.org/specs/web-apps/current-work/multipage/network.html#closeevent
*/
-[Constructor(DOMString type, optional CloseEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Constructor(DOMString type, optional CloseEventInit eventInitDict),LegacyEventInit]
interface CloseEvent : Event
{
readonly attribute boolean wasClean;
readonly attribute unsigned short code;
readonly attribute DOMString? reason;
- // initCloseEvent is a Goanna specific deprecated method.
[Throws]
- void initCloseEvent(DOMString type,
- boolean canBubble,
- boolean cancelable,
- boolean wasClean,
- unsigned short code,
- DOMString? reason);
+ void initCloseEvent(DOMString aType,
+ boolean aCanBubble,
+ boolean aCancelable,
+ boolean aWasClean,
+ unsigned short aReasonCode,
+ DOMString? aReason);
};
dictionary CloseEventInit : EventInit
diff --git a/dom/webidl/CompositionEvent.webidl b/dom/webidl/CompositionEvent.webidl
index c1a85fcbb..9a059f8c7 100644
--- a/dom/webidl/CompositionEvent.webidl
+++ b/dom/webidl/CompositionEvent.webidl
@@ -9,8 +9,6 @@
* liability, trademark and document use rules apply.
*/
-interface WindowProxy;
-
interface CompositionEvent : UIEvent
{
readonly attribute DOMString? data;
@@ -23,7 +21,7 @@ partial interface CompositionEvent
void initCompositionEvent(DOMString typeArg,
boolean canBubbleArg,
boolean cancelableArg,
- WindowProxy? viewArg,
+ Window? viewArg,
DOMString? dataArg,
DOMString localeArg);
};
diff --git a/dom/webidl/Console.webidl b/dom/webidl/Console.webidl
new file mode 100644
index 000000000..e38013076
--- /dev/null
+++ b/dom/webidl/Console.webidl
@@ -0,0 +1,97 @@
+/* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=2 et sw=2 tw=80: */
+/* 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/. */
+
+[ChromeOnly,
+ Exposed=(Window,Worker)]
+interface Console {
+ void log(any... data);
+ void info(any... data);
+ void warn(any... data);
+ void error(any... data);
+ void _exception(any... data);
+ void debug(any... data);
+ void table(any... data);
+ void trace();
+ void dir(any... data);
+ void group(any... data);
+ void groupCollapsed(any... data);
+ void groupEnd(any... data);
+ void time(optional any time);
+ void timeEnd(optional any time);
+
+ void profile(any... data);
+ void profileEnd(any... data);
+
+ void assert(boolean condition, any... data);
+ void count(any... data);
+
+ void ___noSuchMethod__();
+};
+
+// This is used to propagate console events to the observers.
+dictionary ConsoleEvent {
+ (unsigned long long or DOMString) ID;
+ (unsigned long long or DOMString) innerID;
+ DOMString level = "";
+ DOMString filename = "";
+ unsigned long lineNumber = 0;
+ unsigned long columnNumber = 0;
+ DOMString functionName = "";
+ double timeStamp = 0;
+ sequence<any> arguments;
+
+ // This array will only hold strings or null elements.
+ sequence<any> styles;
+
+ boolean private = false;
+ // stacktrace is handled via a getter in some cases so we can construct it
+ // lazily. Note that we're not making this whole thing an interface because
+ // consumers expect to see own properties on it, which would mean making the
+ // props unforgeable, which means lots of JSFunction allocations. Maybe we
+ // should fix those consumers, of course....
+ // sequence<ConsoleStackEntry> stacktrace;
+ DOMString groupName = "";
+ any timer = null;
+ any counter = null;
+};
+
+// Event for profile operations
+dictionary ConsoleProfileEvent {
+ DOMString action = "";
+ sequence<any> arguments;
+};
+
+// This dictionary is used to manage stack trace data.
+dictionary ConsoleStackEntry {
+ DOMString filename = "";
+ unsigned long lineNumber = 0;
+ unsigned long columnNumber = 0;
+ DOMString functionName = "";
+ unsigned long language = 0;
+};
+
+dictionary ConsoleTimerStart {
+ DOMString name = "";
+ double started = 0;
+};
+
+dictionary ConsoleTimerEnd {
+ DOMString name = "";
+ double duration = 0;
+};
+
+dictionary ConsoleTimerError {
+ DOMString error = "maxTimersExceeded";
+};
+
+dictionary ConsoleCounter {
+ DOMString label = "";
+ unsigned long count = 0;
+};
+
+dictionary ConsoleCounterError {
+ DOMString error = "maxCountersExceeded";
+};
diff --git a/dom/webidl/Constraints.webidl b/dom/webidl/Constraints.webidl
new file mode 100644
index 000000000..fc6275b59
--- /dev/null
+++ b/dom/webidl/Constraints.webidl
@@ -0,0 +1,53 @@
+/* -*- 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/.
+ */
+
+// These dictionaries need to be in a separate file from their use in unions
+// in MediaTrackConstraintSet.webidl due to a webidl compiler limitation.
+
+// These enums are in the spec even though they're not used directly in the API
+// due to https://www.w3.org/Bugs/Public/show_bug.cgi?id=19936
+// Their binding code is quite useful though, and is used in the implementation.
+
+enum VideoFacingModeEnum {
+ "user",
+ "environment",
+ "left",
+ "right"
+};
+
+enum MediaSourceEnum {
+ "camera",
+ "screen",
+ "application",
+ "window",
+ "browser",
+ "microphone",
+ "other"
+};
+
+dictionary ConstrainLongRange {
+ long min;
+ long max;
+ long exact;
+ long ideal;
+};
+
+dictionary ConstrainDoubleRange {
+ double min;
+ double max;
+ double exact;
+ double ideal;
+};
+
+dictionary ConstrainBooleanParameters {
+ boolean exact;
+ boolean ideal;
+};
+
+dictionary ConstrainDOMStringParameters {
+ (DOMString or sequence<DOMString>) exact;
+ (DOMString or sequence<DOMString>) ideal;
+};
diff --git a/dom/webidl/Contacts.webidl b/dom/webidl/Contacts.webidl
new file mode 100644
index 000000000..91dc264ed
--- /dev/null
+++ b/dom/webidl/Contacts.webidl
@@ -0,0 +1,130 @@
+/* -*- 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/.
+ */
+
+dictionary ContactAddress {
+ sequence<DOMString>? type;
+ DOMString? streetAddress;
+ DOMString? locality;
+ DOMString? region;
+ DOMString? postalCode;
+ DOMString? countryName;
+ boolean? pref;
+};
+
+dictionary ContactField {
+ sequence<DOMString>? type;
+ DOMString? value;
+ boolean? pref;
+};
+
+dictionary ContactTelField : ContactField {
+ DOMString? carrier;
+};
+
+dictionary ContactProperties {
+ Date? bday;
+ Date? anniversary;
+
+ DOMString? sex;
+ DOMString? genderIdentity;
+
+ sequence<Blob>? photo;
+
+ sequence<ContactAddress>? adr;
+
+ sequence<ContactField>? email;
+ sequence<ContactField>? url;
+ sequence<ContactField>? impp;
+
+ sequence<ContactTelField>? tel;
+
+ sequence<DOMString>? name;
+ sequence<DOMString>? honorificPrefix;
+ sequence<DOMString>? givenName;
+ sequence<DOMString>? phoneticGivenName;
+ sequence<DOMString>? additionalName;
+ sequence<DOMString>? familyName;
+ sequence<DOMString>? phoneticFamilyName;
+ sequence<DOMString>? honorificSuffix;
+ sequence<DOMString>? nickname;
+ sequence<DOMString>? category;
+ sequence<DOMString>? org;
+ sequence<DOMString>? jobTitle;
+ sequence<DOMString>? note;
+ sequence<DOMString>? key;
+};
+
+[Constructor(optional ContactProperties properties),
+ JSImplementation="@mozilla.org/contact;1"]
+interface mozContact {
+ attribute DOMString id;
+ readonly attribute Date? published;
+ readonly attribute Date? updated;
+
+ attribute Date? bday;
+ attribute Date? anniversary;
+
+ attribute DOMString? sex;
+ attribute DOMString? genderIdentity;
+
+ [Cached, Pure] attribute sequence<Blob>? photo;
+
+ [Cached, Pure] attribute sequence<ContactAddress>? adr;
+
+ [Cached, Pure] attribute sequence<ContactField>? email;
+ [Cached, Pure] attribute sequence<ContactField>? url;
+ [Cached, Pure] attribute sequence<ContactField>? impp;
+
+ [Cached, Pure] attribute sequence<ContactTelField>? tel;
+
+ [Cached, Pure] attribute sequence<DOMString>? name;
+ [Cached, Pure] attribute sequence<DOMString>? honorificPrefix;
+ [Cached, Pure] attribute sequence<DOMString>? givenName;
+ [Cached, Pure] attribute sequence<DOMString>? phoneticGivenName;
+ [Cached, Pure] attribute sequence<DOMString>? additionalName;
+ [Cached, Pure] attribute sequence<DOMString>? familyName;
+ [Cached, Pure] attribute sequence<DOMString>? phoneticFamilyName;
+ [Cached, Pure] attribute sequence<DOMString>? honorificSuffix;
+ [Cached, Pure] attribute sequence<DOMString>? nickname;
+ [Cached, Pure] attribute sequence<DOMString>? category;
+ [Cached, Pure] attribute sequence<DOMString>? org;
+ [Cached, Pure] attribute sequence<DOMString>? jobTitle;
+ [Cached, Pure] attribute sequence<DOMString>? note;
+ [Cached, Pure] attribute sequence<DOMString>? key;
+
+ void init(optional ContactProperties properties);
+
+ [ChromeOnly]
+ void setMetadata(DOMString id, Date? published, Date? updated);
+
+ jsonifier;
+};
+
+dictionary ContactFindSortOptions {
+ DOMString sortBy; // "givenName" or "familyName"
+ DOMString sortOrder = "ascending"; // e.g. "descending"
+};
+
+dictionary ContactFindOptions : ContactFindSortOptions {
+ DOMString filterValue; // e.g. "Tom"
+ DOMString filterOp; // e.g. "startsWith"
+ any filterBy; // e.g. ["givenName", "nickname"]
+ unsigned long filterLimit = 0;
+};
+
+[NoInterfaceObject, NavigatorProperty="mozContacts",
+ JSImplementation="@mozilla.org/contactManager;1"]
+interface ContactManager : EventTarget {
+ DOMRequest find(optional ContactFindOptions options);
+ DOMCursor getAll(optional ContactFindSortOptions options);
+ DOMRequest clear();
+ DOMRequest save(mozContact contact);
+ DOMRequest remove((mozContact or DOMString) contactOrId);
+ DOMRequest getRevision();
+ DOMRequest getCount();
+
+ attribute EventHandler oncontactchange;
+};
diff --git a/dom/webidl/MobileMessageManager.webidl b/dom/webidl/ContainerBoxObject.webidl
index 2cebb4d0c..f2dd9ffa5 100644
--- a/dom/webidl/MobileMessageManager.webidl
+++ b/dom/webidl/ContainerBoxObject.webidl
@@ -1,14 +1,12 @@
+
/* -*- 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/.
*/
-dictionary MmsParameters {
- sequence<DOMString> receivers;
- DOMString? subject = null;
- DOMString? smil = null;
- sequence<MmsAttachment> attachments;
+[NoInterfaceObject]
+interface ContainerBoxObject : BoxObject {
+ [ChromeOnly]
+ readonly attribute nsIDocShell? docShell;
};
-
-// If we start using MmsParameters here, remove it from DummyBinding.
diff --git a/dom/webidl/ConvolverNode.webidl b/dom/webidl/ConvolverNode.webidl
index 482b0486d..fcdebe1ee 100644
--- a/dom/webidl/ConvolverNode.webidl
+++ b/dom/webidl/ConvolverNode.webidl
@@ -10,7 +10,6 @@
* liability, trademark and document use rules apply.
*/
-[PrefControlled]
interface ConvolverNode : AudioNode {
[SetterThrows]
@@ -19,3 +18,6 @@ interface ConvolverNode : AudioNode {
};
+// Mozilla extension
+ConvolverNode implements AudioNodePassThrough;
+
diff --git a/dom/webidl/Crypto.webidl b/dom/webidl/Crypto.webidl
new file mode 100644
index 000000000..9a89efc5f
--- /dev/null
+++ b/dom/webidl/Crypto.webidl
@@ -0,0 +1,22 @@
+/* -*- 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
+ * https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html#crypto-interface
+ */
+
+[NoInterfaceObject]
+interface GlobalCrypto {
+ [Throws] readonly attribute Crypto crypto;
+};
+
+//[Exposed=(Window,Worker)]
+interface Crypto {
+ [Pref="dom.webcrypto.enabled"]
+ readonly attribute SubtleCrypto subtle;
+
+ [Throws]
+ ArrayBufferView getRandomValues(ArrayBufferView array);
+};
diff --git a/dom/webidl/CustomEvent.webidl b/dom/webidl/CustomEvent.webidl
index fbfec504c..fd1c5535a 100644
--- a/dom/webidl/CustomEvent.webidl
+++ b/dom/webidl/CustomEvent.webidl
@@ -6,14 +6,13 @@
* The origin of this IDL file is
* http://www.w3.org/TR/2012/WD-dom-20120105/
*
- * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
* liability, trademark and document use rules apply.
*/
-[Constructor(DOMString type, optional CustomEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Constructor(DOMString type, optional CustomEventInit eventInitDict)]
interface CustomEvent : Event
{
- [Throws]
readonly attribute any detail;
// initCustomEvent is a Goanna specific deprecated method.
diff --git a/dom/webidl/DOMCursor.webidl b/dom/webidl/DOMCursor.webidl
index b18a75539..3ad36a76f 100644
--- a/dom/webidl/DOMCursor.webidl
+++ b/dom/webidl/DOMCursor.webidl
@@ -3,8 +3,10 @@
* 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/. */
-interface DOMCursor : DOMRequest {
+interface DOMCursor : EventTarget {
readonly attribute boolean done;
[Throws]
void continue();
};
+
+DOMCursor implements DOMRequestShared;
diff --git a/dom/webidl/DOMError.webidl b/dom/webidl/DOMError.webidl
index ccdc1c622..bd4a7b39d 100644
--- a/dom/webidl/DOMError.webidl
+++ b/dom/webidl/DOMError.webidl
@@ -10,7 +10,8 @@
* liability, trademark and document use rules apply.
*/
-[Constructor(DOMString name, optional DOMString message = "")]
+[Constructor(DOMString name, optional DOMString message = ""),
+ Exposed=(Window,Worker,System)]
interface DOMError {
[Constant]
readonly attribute DOMString name;
diff --git a/dom/webidl/DOMException.webidl b/dom/webidl/DOMException.webidl
new file mode 100644
index 000000000..95a6250d8
--- /dev/null
+++ b/dom/webidl/DOMException.webidl
@@ -0,0 +1,111 @@
+/* -*- 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://dom.spec.whatwg.org/#exception-domexception
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+
+// This is the WebIDL version of nsIException. This is mostly legacy stuff.
+
+interface StackFrame;
+
+[NoInterfaceObject,
+ Exposed=(Window,Worker)]
+interface ExceptionMembers
+{
+ // A custom message set by the thrower. LenientThis so it can be
+ // gotten on the prototype, which Error.prototype.toString will do
+ // if someone tries to stringify DOMException.prototype.
+ [LenientThis]
+ readonly attribute DOMString message;
+ // The nsresult associated with this exception.
+ readonly attribute unsigned long result;
+ // The name of the error code (ie, a string repr of |result|).
+ // LenientThis so it can be gotten on the prototype, which
+ // Error.prototype.toString will do if someone tries to stringify
+ // DOMException.prototype.
+ [LenientThis]
+ readonly attribute DOMString name;
+
+ // Filename location. This is the location that caused the
+ // error, which may or may not be a source file location.
+ // For example, standard language errors would generally have
+ // the same location as their top stack entry. File
+ // parsers may put the location of the file they were parsing,
+ // etc.
+
+ // null indicates "no data"
+ readonly attribute DOMString filename;
+ // Valid line numbers begin at '1'. '0' indicates unknown.
+ readonly attribute unsigned long lineNumber;
+ // Valid column numbers begin at 0.
+ // We don't have an unambiguous indicator for unknown.
+ readonly attribute unsigned long columnNumber;
+
+ // A stack trace, if available. nsIStackFrame does not have classinfo so
+ // this was only ever usefully available to chrome JS.
+ [ChromeOnly]
+ readonly attribute StackFrame? location;
+ // An inner exception that triggered this, if available.
+ readonly attribute nsISupports? inner;
+
+ // Arbitary data for the implementation.
+ readonly attribute nsISupports? data;
+
+ // Formatted exception stack
+ [Throws, Replaceable]
+ readonly attribute DOMString stack;
+};
+
+[NoInterfaceObject]
+interface Exception {
+ // A generic formatter - make it suitable to print, etc.
+ stringifier;
+};
+
+Exception implements ExceptionMembers;
+
+// XXXkhuey this is an 'exception', not an interface, but we don't have any
+// parser or codegen mechanisms for dealing with exceptions.
+[ExceptionClass,
+ Exposed=(Window, Worker),
+ Constructor(optional DOMString message = "", optional DOMString name)]
+interface DOMException {
+ const unsigned short INDEX_SIZE_ERR = 1;
+ const unsigned short DOMSTRING_SIZE_ERR = 2; // historical
+ const unsigned short HIERARCHY_REQUEST_ERR = 3;
+ const unsigned short WRONG_DOCUMENT_ERR = 4;
+ const unsigned short INVALID_CHARACTER_ERR = 5;
+ const unsigned short NO_DATA_ALLOWED_ERR = 6; // historical
+ const unsigned short NO_MODIFICATION_ALLOWED_ERR = 7;
+ const unsigned short NOT_FOUND_ERR = 8;
+ const unsigned short NOT_SUPPORTED_ERR = 9;
+ const unsigned short INUSE_ATTRIBUTE_ERR = 10; // historical
+ const unsigned short INVALID_STATE_ERR = 11;
+ const unsigned short SYNTAX_ERR = 12;
+ const unsigned short INVALID_MODIFICATION_ERR = 13;
+ const unsigned short NAMESPACE_ERR = 14;
+ const unsigned short INVALID_ACCESS_ERR = 15;
+ const unsigned short VALIDATION_ERR = 16; // historical
+ const unsigned short TYPE_MISMATCH_ERR = 17; // historical; use JavaScript's TypeError instead
+ const unsigned short SECURITY_ERR = 18;
+ const unsigned short NETWORK_ERR = 19;
+ const unsigned short ABORT_ERR = 20;
+ const unsigned short URL_MISMATCH_ERR = 21;
+ const unsigned short QUOTA_EXCEEDED_ERR = 22;
+ const unsigned short TIMEOUT_ERR = 23;
+ const unsigned short INVALID_NODE_TYPE_ERR = 24;
+ const unsigned short DATA_CLONE_ERR = 25;
+
+ readonly attribute unsigned short code;
+};
+
+// XXXkhuey copy all of Goanna's non-standard stuff onto DOMException, but leave
+// the prototype chain sane.
+DOMException implements ExceptionMembers;
diff --git a/dom/webidl/DOMImplementation.webidl b/dom/webidl/DOMImplementation.webidl
index f7fa91c42..cc16db852 100644
--- a/dom/webidl/DOMImplementation.webidl
+++ b/dom/webidl/DOMImplementation.webidl
@@ -21,7 +21,7 @@ interface DOMImplementation {
[Throws]
Document createDocument(DOMString? namespace,
[TreatNullAs=EmptyString] DOMString qualifiedName,
- DocumentType? doctype);
+ optional DocumentType? doctype = null);
[Throws]
Document createHTMLDocument(optional DOMString title);
};
diff --git a/dom/webidl/DOMMatrix.webidl b/dom/webidl/DOMMatrix.webidl
new file mode 100644
index 000000000..6b236ae66
--- /dev/null
+++ b/dom/webidl/DOMMatrix.webidl
@@ -0,0 +1,148 @@
+/* -*- 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://dev.w3.org/fxtf/geometry/
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+[Pref="layout.css.DOMMatrix.enabled"]
+interface DOMMatrixReadOnly {
+ // These attributes are simple aliases for certain elements of the 4x4 matrix
+ readonly attribute unrestricted double a;
+ readonly attribute unrestricted double b;
+ readonly attribute unrestricted double c;
+ readonly attribute unrestricted double d;
+ readonly attribute unrestricted double e;
+ readonly attribute unrestricted double f;
+
+ readonly attribute unrestricted double m11;
+ readonly attribute unrestricted double m12;
+ readonly attribute unrestricted double m13;
+ readonly attribute unrestricted double m14;
+ readonly attribute unrestricted double m21;
+ readonly attribute unrestricted double m22;
+ readonly attribute unrestricted double m23;
+ readonly attribute unrestricted double m24;
+ readonly attribute unrestricted double m31;
+ readonly attribute unrestricted double m32;
+ readonly attribute unrestricted double m33;
+ readonly attribute unrestricted double m34;
+ readonly attribute unrestricted double m41;
+ readonly attribute unrestricted double m42;
+ readonly attribute unrestricted double m43;
+ readonly attribute unrestricted double m44;
+
+ // Immutable transform methods
+ DOMMatrix translate(unrestricted double tx,
+ unrestricted double ty,
+ optional unrestricted double tz = 0);
+ DOMMatrix scale(unrestricted double scale,
+ optional unrestricted double originX = 0,
+ optional unrestricted double originY = 0);
+ DOMMatrix scale3d(unrestricted double scale,
+ optional unrestricted double originX = 0,
+ optional unrestricted double originY = 0,
+ optional unrestricted double originZ = 0);
+ DOMMatrix scaleNonUniform(unrestricted double scaleX,
+ optional unrestricted double scaleY = 1,
+ optional unrestricted double scaleZ = 1,
+ optional unrestricted double originX = 0,
+ optional unrestricted double originY = 0,
+ optional unrestricted double originZ = 0);
+ DOMMatrix rotate(unrestricted double angle,
+ optional unrestricted double originX = 0,
+ optional unrestricted double originY = 0);
+ DOMMatrix rotateFromVector(unrestricted double x,
+ unrestricted double y);
+ DOMMatrix rotateAxisAngle(unrestricted double x,
+ unrestricted double y,
+ unrestricted double z,
+ unrestricted double angle);
+ DOMMatrix skewX(unrestricted double sx);
+ DOMMatrix skewY(unrestricted double sy);
+ DOMMatrix multiply(DOMMatrix other);
+ DOMMatrix flipX();
+ DOMMatrix flipY();
+ DOMMatrix inverse();
+
+ // Helper methods
+ readonly attribute boolean is2D;
+ readonly attribute boolean identity;
+ DOMPoint transformPoint(optional DOMPointInit point);
+ [Throws] Float32Array toFloat32Array();
+ [Throws] Float64Array toFloat64Array();
+ stringifier;
+};
+
+[Pref="layout.css.DOMMatrix.enabled",
+ Constructor,
+ Constructor(DOMString transformList),
+ Constructor(DOMMatrixReadOnly other),
+ Constructor(Float32Array array32),
+ Constructor(Float64Array array64),
+ Constructor(sequence<unrestricted double> numberSequence)]
+interface DOMMatrix : DOMMatrixReadOnly {
+ // These attributes are simple aliases for certain elements of the 4x4 matrix
+ inherit attribute unrestricted double a;
+ inherit attribute unrestricted double b;
+ inherit attribute unrestricted double c;
+ inherit attribute unrestricted double d;
+ inherit attribute unrestricted double e;
+ inherit attribute unrestricted double f;
+
+ inherit attribute unrestricted double m11;
+ inherit attribute unrestricted double m12;
+ inherit attribute unrestricted double m13;
+ inherit attribute unrestricted double m14;
+ inherit attribute unrestricted double m21;
+ inherit attribute unrestricted double m22;
+ inherit attribute unrestricted double m23;
+ inherit attribute unrestricted double m24;
+ inherit attribute unrestricted double m31;
+ inherit attribute unrestricted double m32;
+ inherit attribute unrestricted double m33;
+ inherit attribute unrestricted double m34;
+ inherit attribute unrestricted double m41;
+ inherit attribute unrestricted double m42;
+ inherit attribute unrestricted double m43;
+ inherit attribute unrestricted double m44;
+
+ // Mutable transform methods
+ DOMMatrix multiplySelf(DOMMatrix other);
+ DOMMatrix preMultiplySelf(DOMMatrix other);
+ DOMMatrix translateSelf(unrestricted double tx,
+ unrestricted double ty,
+ optional unrestricted double tz = 0);
+ DOMMatrix scaleSelf(unrestricted double scale,
+ optional unrestricted double originX = 0,
+ optional unrestricted double originY = 0);
+ DOMMatrix scale3dSelf(unrestricted double scale,
+ optional unrestricted double originX = 0,
+ optional unrestricted double originY = 0,
+ optional unrestricted double originZ = 0);
+ DOMMatrix scaleNonUniformSelf(unrestricted double scaleX,
+ optional unrestricted double scaleY = 1,
+ optional unrestricted double scaleZ = 1,
+ optional unrestricted double originX = 0,
+ optional unrestricted double originY = 0,
+ optional unrestricted double originZ = 0);
+ DOMMatrix rotateSelf(unrestricted double angle,
+ optional unrestricted double originX = 0,
+ optional unrestricted double originY = 0);
+ DOMMatrix rotateFromVectorSelf(unrestricted double x,
+ unrestricted double y);
+ DOMMatrix rotateAxisAngleSelf(unrestricted double x,
+ unrestricted double y,
+ unrestricted double z,
+ unrestricted double angle);
+ DOMMatrix skewXSelf(unrestricted double sx);
+ DOMMatrix skewYSelf(unrestricted double sy);
+ DOMMatrix invertSelf();
+ [Throws] DOMMatrix setMatrixValue(DOMString transformList);
+};
+
diff --git a/dom/webidl/DOMMobileMessageError.webidl b/dom/webidl/DOMMobileMessageError.webidl
new file mode 100644
index 000000000..30d1994b5
--- /dev/null
+++ b/dom/webidl/DOMMobileMessageError.webidl
@@ -0,0 +1,12 @@
+/* -*- 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/.
+ */
+
+[Pref="dom.sms.enabled",
+ CheckPermissions="sms",
+ AvailableIn="CertifiedApps"]
+interface DOMMobileMessageError : DOMError {
+ readonly attribute (MozSmsMessage or MozMmsMessage) data;
+};
diff --git a/dom/webidl/DOMParser.webidl b/dom/webidl/DOMParser.webidl
index bdbbfdb82..154666697 100644
--- a/dom/webidl/DOMParser.webidl
+++ b/dom/webidl/DOMParser.webidl
@@ -23,19 +23,19 @@ enum SupportedType {
Constructor(Principal? prin, optional URI? documentURI = null,
optional URI? baseURI = null)]
interface DOMParser {
- [Creator, Throws]
+ [NewObject, Throws]
Document parseFromString(DOMString str, SupportedType type);
// Mozilla-specific stuff
// Throws if the passed-in length is greater than the actual sequence length
- [Creator, Throws, ChromeOnly]
+ [NewObject, Throws, ChromeOnly]
Document parseFromBuffer(sequence<octet> buf, unsigned long bufLen,
SupportedType type);
// Throws if the passed-in length is greater than the actual typed array length
- [Creator, Throws, ChromeOnly]
+ [NewObject, Throws, ChromeOnly]
Document parseFromBuffer(Uint8Array buf, unsigned long bufLen,
SupportedType type);
- [Creator, Throws, ChromeOnly]
+ [NewObject, Throws, ChromeOnly]
Document parseFromStream(InputStream stream, DOMString? charset,
long contentLength, SupportedType type);
[Throws, ChromeOnly]
diff --git a/dom/webidl/DOMPoint.webidl b/dom/webidl/DOMPoint.webidl
new file mode 100644
index 000000000..d092d900f
--- /dev/null
+++ b/dom/webidl/DOMPoint.webidl
@@ -0,0 +1,37 @@
+/* -*- 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://dev.w3.org/fxtf/geometry/
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+[Pref="layout.css.DOMPoint.enabled"]
+interface DOMPointReadOnly {
+ readonly attribute unrestricted double x;
+ readonly attribute unrestricted double y;
+ readonly attribute unrestricted double z;
+ readonly attribute unrestricted double w;
+};
+
+[Pref="layout.css.DOMPoint.enabled",
+ Constructor(optional DOMPointInit point),
+ Constructor(unrestricted double x, unrestricted double y,
+ optional unrestricted double z = 0, optional unrestricted double w = 1)]
+interface DOMPoint : DOMPointReadOnly {
+ inherit attribute unrestricted double x;
+ inherit attribute unrestricted double y;
+ inherit attribute unrestricted double z;
+ inherit attribute unrestricted double w;
+};
+
+dictionary DOMPointInit {
+ unrestricted double x = 0;
+ unrestricted double y = 0;
+ unrestricted double z = 0;
+ unrestricted double w = 1;
+}; \ No newline at end of file
diff --git a/dom/webidl/DOMQuad.webidl b/dom/webidl/DOMQuad.webidl
new file mode 100644
index 000000000..b933987d5
--- /dev/null
+++ b/dom/webidl/DOMQuad.webidl
@@ -0,0 +1,23 @@
+/* -*- 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://dev.w3.org/fxtf/geometry/
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+[Pref="layout.css.DOMQuad.enabled",
+ Constructor(optional DOMPointInit p1, optional DOMPointInit p2,
+ optional DOMPointInit p3, optional DOMPointInit p4),
+ Constructor(DOMRectReadOnly rect)]
+interface DOMQuad {
+ [SameObject] readonly attribute DOMPoint p1;
+ [SameObject] readonly attribute DOMPoint p2;
+ [SameObject] readonly attribute DOMPoint p3;
+ [SameObject] readonly attribute DOMPoint p4;
+ [SameObject] readonly attribute DOMRectReadOnly bounds;
+}; \ No newline at end of file
diff --git a/dom/webidl/DOMRect.webidl b/dom/webidl/DOMRect.webidl
new file mode 100644
index 000000000..1e817106c
--- /dev/null
+++ b/dom/webidl/DOMRect.webidl
@@ -0,0 +1,32 @@
+/* -*- 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://dev.w3.org/fxtf/geometry/
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+[Constructor,
+ Constructor(unrestricted double x, unrestricted double y,
+ unrestricted double width, unrestricted double height)]
+interface DOMRect : DOMRectReadOnly {
+ inherit attribute unrestricted double x;
+ inherit attribute unrestricted double y;
+ inherit attribute unrestricted double width;
+ inherit attribute unrestricted double height;
+};
+
+interface DOMRectReadOnly {
+ readonly attribute unrestricted double x;
+ readonly attribute unrestricted double y;
+ readonly attribute unrestricted double width;
+ readonly attribute unrestricted double height;
+ readonly attribute unrestricted double top;
+ readonly attribute unrestricted double right;
+ readonly attribute unrestricted double bottom;
+ readonly attribute unrestricted double left;
+}; \ No newline at end of file
diff --git a/dom/webidl/ClientRectList.webidl b/dom/webidl/DOMRectList.webidl
index 964425bd0..172235e17 100644
--- a/dom/webidl/ClientRectList.webidl
+++ b/dom/webidl/DOMRectList.webidl
@@ -4,7 +4,8 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-interface ClientRectList {
+[ArrayClass]
+interface DOMRectList {
readonly attribute unsigned long length;
- getter ClientRect? item(unsigned long index);
+ getter DOMRect? item(unsigned long index);
};
diff --git a/dom/webidl/DOMRequest.webidl b/dom/webidl/DOMRequest.webidl
index 77cbf7ff3..53686ab11 100644
--- a/dom/webidl/DOMRequest.webidl
+++ b/dom/webidl/DOMRequest.webidl
@@ -3,18 +3,25 @@
* 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/. */
-interface Window;
-
enum DOMRequestReadyState { "pending", "done" };
-interface DOMRequest : EventTarget {
+[NoInterfaceObject]
+interface DOMRequestShared {
readonly attribute DOMRequestReadyState readyState;
readonly attribute any result;
readonly attribute DOMError? error;
- [SetterThrows]
attribute EventHandler onsuccess;
- [SetterThrows]
attribute EventHandler onerror;
};
+
+interface DOMRequest : EventTarget {
+ // The [TreatNonCallableAsNull] annotation is required since then() should do
+ // nothing instead of throwing errors when non-callable arguments are passed.
+ [NewObject]
+ Promise<any> then([TreatNonCallableAsNull] optional AnyCallback? fulfillCallback = null,
+ [TreatNonCallableAsNull] optional AnyCallback? rejectCallback = null);
+};
+
+DOMRequest implements DOMRequestShared;
diff --git a/dom/webidl/DOMStringList.webidl b/dom/webidl/DOMStringList.webidl
index 27e6d4143..023956b5b 100644
--- a/dom/webidl/DOMStringList.webidl
+++ b/dom/webidl/DOMStringList.webidl
@@ -10,6 +10,7 @@
* liability, trademark and document use rules apply.
*/
+[Exposed=(Window,Worker)]
interface DOMStringList {
readonly attribute unsigned long length;
getter DOMString? item(unsigned long index);
diff --git a/dom/webidl/DOMTokenList.webidl b/dom/webidl/DOMTokenList.webidl
index ac8be65a3..a6f1b925b 100644
--- a/dom/webidl/DOMTokenList.webidl
+++ b/dom/webidl/DOMTokenList.webidl
@@ -16,9 +16,9 @@ interface DOMTokenList {
[Throws]
boolean contains(DOMString token);
[Throws]
- void add(DOMString token);
+ void add(DOMString... tokens);
[Throws]
- void remove(DOMString token);
+ void remove(DOMString... tokens);
[Throws]
boolean toggle(DOMString token, optional boolean force);
stringifier DOMString ();
diff --git a/dom/webidl/DOMTransactionEvent.webidl b/dom/webidl/DOMTransactionEvent.webidl
index 959ca2483..0fae2e059 100644
--- a/dom/webidl/DOMTransactionEvent.webidl
+++ b/dom/webidl/DOMTransactionEvent.webidl
@@ -4,17 +4,10 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-[Constructor(DOMString type, optional DOMTransactionEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Constructor(DOMString type, optional DOMTransactionEventInit eventInitDict)]
interface DOMTransactionEvent : Event
{
- [Throws]
readonly attribute any transactions;
-
- [Throws]
- void initDOMTransactionEvent(DOMString type,
- boolean canBubble,
- boolean cancelable,
- any transactions);
};
dictionary DOMTransactionEventInit : EventInit
diff --git a/dom/webidl/DataChannel.webidl b/dom/webidl/DataChannel.webidl
index 5aae7bfc3..5599403ba 100644
--- a/dom/webidl/DataChannel.webidl
+++ b/dom/webidl/DataChannel.webidl
@@ -21,14 +21,10 @@ interface DataChannel : EventTarget
readonly attribute boolean reliable;
readonly attribute RTCDataChannelState readyState;
readonly attribute unsigned long bufferedAmount;
- [SetterThrows]
attribute EventHandler onopen;
- [SetterThrows]
attribute EventHandler onerror;
- [SetterThrows]
attribute EventHandler onclose;
void close();
- [SetterThrows]
attribute EventHandler onmessage;
attribute RTCDataChannelType binaryType;
[Throws]
diff --git a/dom/webidl/DataContainerEvent.webidl b/dom/webidl/DataContainerEvent.webidl
index 8293063cf..968421040 100644
--- a/dom/webidl/DataContainerEvent.webidl
+++ b/dom/webidl/DataContainerEvent.webidl
@@ -6,6 +6,7 @@
interface nsIVariant;
+[ChromeOnly]
interface DataContainerEvent : Event {
/**
* Return the data associated with the given key.
diff --git a/dom/webidl/DataErrorEvent.webidl b/dom/webidl/DataErrorEvent.webidl
index 2e66a2578..e57e08317 100644
--- a/dom/webidl/DataErrorEvent.webidl
+++ b/dom/webidl/DataErrorEvent.webidl
@@ -4,7 +4,8 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-[Constructor(DOMString type, optional DataErrorEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Pref="dom.mobileconnection.enabled",
+ Constructor(DOMString type, optional DataErrorEventInit eventInitDict)]
interface DataErrorEvent : Event
{
readonly attribute DOMString? message;
diff --git a/dom/webidl/DataStore.webidl b/dom/webidl/DataStore.webidl
new file mode 100644
index 000000000..79f0b7cd5
--- /dev/null
+++ b/dom/webidl/DataStore.webidl
@@ -0,0 +1,112 @@
+/* -*- 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/.
+ */
+
+typedef (DOMString or unsigned long) DataStoreKey;
+
+// TODO Bug 957086 - The constructor and the setDataStoreImpl(...) will be
+// removed once the DataStore API is fully rewritten in C++,
+// which currently plays a role of C++ proxy directing to the
+// JS codes implemented by the DataStoreImpl WebIDL.
+
+[Func="Navigator::HasDataStoreSupport",
+ ChromeConstructor,
+ Exposed=(Window,Worker)]
+interface DataStore : EventTarget {
+ // Returns the label of the DataSource.
+ [GetterThrows]
+ readonly attribute DOMString name;
+
+ // Returns the origin of the DataSource (e.g., 'facebook.com').
+ // This value is the manifest URL of the owner app.
+ [GetterThrows]
+ readonly attribute DOMString owner;
+
+ // is readOnly a F(current_app, datastore) function? yes
+ [GetterThrows]
+ readonly attribute boolean readOnly;
+
+ [Throws]
+ Promise<any> get(DataStoreKey... id);
+
+ [Throws]
+ Promise<void> put(any obj, DataStoreKey id, optional DOMString revisionId = "");
+
+ [Throws]
+ Promise<DataStoreKey> add(any obj, optional DataStoreKey id,
+ optional DOMString revisionId = "");
+
+ [Throws]
+ Promise<boolean> remove(DataStoreKey id, optional DOMString revisionId = "");
+
+ [Throws]
+ Promise<void> clear(optional DOMString revisionId = "");
+
+ [GetterThrows]
+ readonly attribute DOMString revisionId;
+
+ attribute EventHandler onchange;
+
+ [Throws]
+ Promise<unsigned long> getLength();
+
+ [NewObject, Throws]
+ DataStoreCursor sync(optional DOMString revisionId = "");
+};
+
+partial interface DataStore {
+ [ChromeOnly, Throws, Exposed=Window]
+ void setDataStoreImpl(DataStoreImpl store);
+};
+
+// TODO Bug 957086 - The constructor and the setDataStoreCursorImpl(...) will be
+// removed once the DataStore API is fully rewritten in C++,
+// which currently plays a role of C++ proxy directing to the
+// JS codes implemented by the DataStoreCursorImpl WebIDL.
+
+[Func="Navigator::HasDataStoreSupport",
+ ChromeConstructor,
+ Exposed=(Window,Worker)]
+interface DataStoreCursor {
+ // the DataStore
+ [GetterThrows]
+ readonly attribute DataStore store;
+
+ [Throws]
+ Promise<DataStoreTask> next();
+
+ [Throws]
+ void close();
+};
+
+partial interface DataStoreCursor {
+ [ChromeOnly, Exposed=Window]
+ void setDataStoreCursorImpl(DataStoreCursorImpl cursor);
+};
+
+enum DataStoreOperation {
+ "add",
+ "update",
+ "remove",
+ "clear",
+ "done"
+};
+
+dictionary DataStoreTask {
+ DOMString revisionId;
+
+ DataStoreOperation operation;
+
+ // When |operation| is "clear" or "done", this must return null.
+ DataStoreKey? id;
+ any data;
+};
+
+// For internal use.
+dictionary DataStoreRevisionData {
+ DOMString revisionId = "";
+ unsigned long objectId = 0;
+ DOMString operation = "";
+};
diff --git a/dom/webidl/DataStoreChangeEvent.webidl b/dom/webidl/DataStoreChangeEvent.webidl
new file mode 100644
index 000000000..6b6176e8a
--- /dev/null
+++ b/dom/webidl/DataStoreChangeEvent.webidl
@@ -0,0 +1,24 @@
+/* -*- 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/.
+ */
+
+dictionary DataStoreChangeEventInit : EventInit {
+ DOMString revisionId = "";
+
+ // When |operation| is "clear" or "done", this must return null.
+ DataStoreKey? id = null;
+
+ DOMString operation = "";
+ DOMString owner = "";
+};
+
+[Func="Navigator::HasDataStoreSupport",
+ Constructor(DOMString type, optional DataStoreChangeEventInit eventInitDict)]
+interface DataStoreChangeEvent : Event {
+ readonly attribute DOMString revisionId;
+ readonly attribute DataStoreKey? id;
+ readonly attribute DOMString operation;
+ readonly attribute DOMString owner;
+};
diff --git a/dom/webidl/DataStoreImpl.webidl b/dom/webidl/DataStoreImpl.webidl
new file mode 100644
index 000000000..564f4ff99
--- /dev/null
+++ b/dom/webidl/DataStoreImpl.webidl
@@ -0,0 +1,61 @@
+/* -*- 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/.
+ */
+
+// TODO Bug 957086 - The DataStoreImpl WebIDL will be removed once the
+// DataStore API is fully rewritten in C++ (i.e. should be
+// directly implemented by the DataStore WebIDL).
+
+[HeaderFile="mozilla/dom/DataStore.h",
+ Func="mozilla::dom::DataStore::EnabledForScope",
+ JSImplementation="@mozilla.org/dom/datastore-impl;1"]
+interface DataStoreImpl {
+ void setEventTarget(EventTarget eventTarget);
+
+ // Returns the label of the DataSource.
+ readonly attribute DOMString name;
+
+ // Returns the origin of the DataSource (e.g., 'facebook.com').
+ // This value is the manifest URL of the owner app.
+ readonly attribute DOMString owner;
+
+ // is readOnly a F(current_app, datastore) function? yes
+ readonly attribute boolean readOnly;
+
+ Promise<any> get(DataStoreKey... id);
+
+ Promise<void> put(any obj, DataStoreKey id, optional DOMString revisionId = "");
+
+ Promise<DataStoreKey> add(any obj, optional DataStoreKey id,
+ optional DOMString revisionId = "");
+
+ Promise<boolean> remove(DataStoreKey id, optional DOMString revisionId = "");
+
+ Promise<void> clear(optional DOMString revisionId = "");
+
+ readonly attribute DOMString revisionId;
+
+ Promise<unsigned long> getLength();
+
+ [NewObject]
+ DataStoreCursor sync(optional DOMString revisionId = "");
+};
+
+
+// TODO Bug 957086 - The DataStoreCursorImpl WebIDL will be removed once the
+// DataStore API is fully rewritten in C++ (i.e. should be
+// directly implemented by the DataStoreCursor WebIDL).
+
+[HeaderFile="mozilla/dom/DataStore.h",
+ Func="mozilla::dom::DataStore::EnabledForScope",
+ JSImplementation="@mozilla.org/dom/datastore-cursor-impl;1"]
+interface DataStoreCursorImpl {
+ // the DataStore
+ readonly attribute DataStore store;
+
+ Promise<DataStoreTask> next();
+
+ void close();
+};
diff --git a/dom/webidl/DataTransfer.webidl b/dom/webidl/DataTransfer.webidl
new file mode 100644
index 000000000..54bb1f607
--- /dev/null
+++ b/dom/webidl/DataTransfer.webidl
@@ -0,0 +1,137 @@
+/* -*- 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.whatwg.org/specs/web-apps/current-work/#the-datatransfer-interface
+ */
+
+[ChromeConstructor(DOMString eventType, boolean isExternal)]
+interface DataTransfer {
+ attribute DOMString dropEffect;
+ attribute DOMString effectAllowed;
+
+ //readonly attribute DataTransferItemList items;
+
+ [Throws]
+ void setDragImage(Element image, long x, long y);
+
+ readonly attribute DOMStringList types;
+ [Throws]
+ DOMString getData(DOMString format);
+ [Throws]
+ void setData(DOMString format, DOMString data);
+ [Throws]
+ void clearData(optional DOMString format);
+ [Throws]
+ readonly attribute FileList? files;
+};
+
+// Mozilla specific stuff
+partial interface DataTransfer {
+ /*
+ * Set the drag source. Usually you would not change this, but it will
+ * affect which node the drag and dragend events are fired at. The
+ * default target is the node that was dragged.
+ *
+ * @param element drag source to use
+ * @throws NO_MODIFICATION_ALLOWED_ERR if the item cannot be modified
+ */
+ [Throws]
+ void addElement(Element element);
+
+ /**
+ * The number of items being dragged.
+ */
+ readonly attribute unsigned long mozItemCount;
+
+ /**
+ * Sets the drag cursor state. Primarily used to control the cursor during
+ * tab drags, but could be expanded to other uses. XXX Currently implemented
+ * on Win32 only.
+ *
+ * Possible values:
+ * auto - use default system behavior.
+ * default - set the cursor to an arrow during the drag operation.
+ *
+ * Values other than 'default' are indentical to setting mozCursor to
+ * 'auto'.
+ */
+ attribute DOMString mozCursor;
+
+ /**
+ * Holds a list of the format types of the data that is stored for an item
+ * at the specified index. If the index is not in the range from 0 to
+ * itemCount - 1, an empty string list is returned.
+ */
+ [Throws]
+ DOMStringList mozTypesAt(unsigned long index);
+
+ /**
+ * Remove the data associated with the given format for an item at the
+ * specified index. The index is in the range from zero to itemCount - 1.
+ *
+ * If the last format for the item is removed, the entire item is removed,
+ * reducing the itemCount by one.
+ *
+ * If format is empty, then the data associated with all formats is removed.
+ * If the format is not found, then this method has no effect.
+ *
+ * @param format the format to remove
+ * @throws NS_ERROR_DOM_INDEX_SIZE_ERR if index is greater or equal than itemCount
+ * @throws NO_MODIFICATION_ALLOWED_ERR if the item cannot be modified
+ */
+ [Throws]
+ void mozClearDataAt(DOMString format, unsigned long index);
+
+ /*
+ * A data transfer may store multiple items, each at a given zero-based
+ * index. setDataAt may only be called with an index argument less than
+ * itemCount in which case an existing item is modified, or equal to
+ * itemCount in which case a new item is added, and the itemCount is
+ * incremented by one.
+ *
+ * Data should be added in order of preference, with the most specific
+ * format added first and the least specific format added last. If data of
+ * the given format already exists, it is replaced in the same position as
+ * the old data.
+ *
+ * The data should be either a string, a primitive boolean or number type
+ * (which will be converted into a string) or an nsISupports.
+ *
+ * @param format the format to add
+ * @param data the data to add
+ * @throws NS_ERROR_NULL_POINTER if the data is null
+ * @throws NS_ERROR_DOM_INDEX_SIZE_ERR if index is greater than itemCount
+ * @throws NO_MODIFICATION_ALLOWED_ERR if the item cannot be modified
+ */
+ [Throws]
+ void mozSetDataAt(DOMString format, any data, unsigned long index);
+
+ /**
+ * Retrieve the data associated with the given format for an item at the
+ * specified index, or null if it does not exist. The index should be in the
+ * range from zero to itemCount - 1.
+ *
+ * @param format the format of the data to look up
+ * @returns the data of the given format, or null if it doesn't exist.
+ * @throws NS_ERROR_DOM_INDEX_SIZE_ERR if index is greater or equal than itemCount
+ */
+ [Throws]
+ any mozGetDataAt(DOMString format, unsigned long index);
+
+ /**
+ * Will be true when the user has cancelled the drag (typically by pressing
+ * Escape) and when the drag has been cancelled unexpectedly. This will be
+ * false otherwise, including when the drop has been rejected by its target.
+ * This property is only relevant for the dragend event.
+ */
+ readonly attribute boolean mozUserCancelled;
+
+ /**
+ * The node that the mouse was pressed over to begin the drag. For external
+ * drags, or if the caller cannot access this node, this will be null.
+ */
+ readonly attribute Node? mozSourceNode;
+};
diff --git a/dom/webidl/DedicatedWorkerGlobalScope.webidl b/dom/webidl/DedicatedWorkerGlobalScope.webidl
new file mode 100644
index 000000000..26dca58da
--- /dev/null
+++ b/dom/webidl/DedicatedWorkerGlobalScope.webidl
@@ -0,0 +1,22 @@
+/* -*- 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.whatwg.org/specs/web-apps/current-work/multipage/workers.html#the-workerglobalscope-common-interface
+ *
+ * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and Opera
+ * Software ASA.
+ * You are granted a license to use, reproduce and create derivative works of
+ * this document.
+ */
+
+[Global=(Worker,DedicatedWorker),
+ Exposed=DedicatedWorker]
+interface DedicatedWorkerGlobalScope : WorkerGlobalScope {
+ [Throws]
+ void postMessage(any message, optional sequence<any> transfer);
+
+ attribute EventHandler onmessage;
+};
diff --git a/dom/webidl/DelayNode.webidl b/dom/webidl/DelayNode.webidl
index 37a348ce9..631ffad4e 100644
--- a/dom/webidl/DelayNode.webidl
+++ b/dom/webidl/DelayNode.webidl
@@ -10,10 +10,12 @@
* liability, trademark and document use rules apply.
*/
-[PrefControlled]
interface DelayNode : AudioNode {
readonly attribute AudioParam delayTime;
};
+// Mozilla extension
+DelayNode implements AudioNodePassThrough;
+
diff --git a/dom/webidl/DesktopNotification.webidl b/dom/webidl/DesktopNotification.webidl
index 9763adc5f..18bfce9dc 100644
--- a/dom/webidl/DesktopNotification.webidl
+++ b/dom/webidl/DesktopNotification.webidl
@@ -9,7 +9,7 @@ interface MozObserver;
[HeaderFile="mozilla/dom/DesktopNotification.h"]
interface DesktopNotificationCenter
{
- [Creator]
+ [NewObject]
DesktopNotification createNotification(DOMString title,
DOMString description,
optional DOMString iconURL = "");
@@ -20,9 +20,7 @@ interface DesktopNotification : EventTarget
[Throws]
void show();
- [SetterThrows]
attribute EventHandler onclick;
- [SetterThrows]
attribute EventHandler onclose;
};
diff --git a/dom/webidl/DeviceLightEvent.webidl b/dom/webidl/DeviceLightEvent.webidl
index c238b77e2..453c67613 100644
--- a/dom/webidl/DeviceLightEvent.webidl
+++ b/dom/webidl/DeviceLightEvent.webidl
@@ -4,10 +4,10 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-[Constructor(DOMString type, optional DeviceLightEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Constructor(DOMString type, optional DeviceLightEventInit eventInitDict)]
interface DeviceLightEvent : Event
{
- readonly attribute double value;
+ readonly attribute unrestricted double value;
};
dictionary DeviceLightEventInit : EventInit
diff --git a/dom/webidl/DeviceMotionEvent.webidl b/dom/webidl/DeviceMotionEvent.webidl
index a8bd4caf8..a1d7bc04b 100644
--- a/dom/webidl/DeviceMotionEvent.webidl
+++ b/dom/webidl/DeviceMotionEvent.webidl
@@ -4,23 +4,55 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-interface DeviceAcceleration;
-interface DeviceRotationRate;
+[NoInterfaceObject]
+interface DeviceAcceleration {
+ readonly attribute double? x;
+ readonly attribute double? y;
+ readonly attribute double? z;
+};
-interface DeviceMotionEvent : Event
-{
- [Throws]
- void initDeviceMotionEvent(DOMString type,
- boolean canBubble,
- boolean cancelable,
- DeviceAcceleration? acceleration,
- DeviceAcceleration? accelerationIncludingGravity,
- DeviceRotationRate? rotationRate,
- double interval);
+[NoInterfaceObject]
+interface DeviceRotationRate {
+ readonly attribute double? alpha;
+ readonly attribute double? beta;
+ readonly attribute double? gamma;
+};
+[Constructor(DOMString type, optional DeviceMotionEventInit eventInitDict)]
+interface DeviceMotionEvent : Event {
readonly attribute DeviceAcceleration? acceleration;
readonly attribute DeviceAcceleration? accelerationIncludingGravity;
readonly attribute DeviceRotationRate? rotationRate;
- readonly attribute double interval;
+ readonly attribute double? interval;
+};
+
+dictionary DeviceAccelerationInit {
+ double? x = null;
+ double? y = null;
+ double? z = null;
};
+dictionary DeviceRotationRateInit {
+ double? alpha = null;
+ double? beta = null;
+ double? gamma = null;
+};
+
+dictionary DeviceMotionEventInit : EventInit {
+ DeviceAccelerationInit acceleration;
+ DeviceAccelerationInit accelerationIncludingGravity;
+ DeviceRotationRateInit rotationRate;
+ double? interval = null;
+};
+
+// Mozilla extensions.
+partial interface DeviceMotionEvent {
+ [Throws]
+ void initDeviceMotionEvent(DOMString type,
+ boolean canBubble,
+ boolean cancelable,
+ DeviceAccelerationInit acceleration,
+ DeviceAccelerationInit accelerationIncludingGravity,
+ DeviceRotationRateInit rotationRate,
+ double? interval);
+};
diff --git a/dom/webidl/DeviceOrientationEvent.webidl b/dom/webidl/DeviceOrientationEvent.webidl
index 1ac6eb648..7cd4cd566 100644
--- a/dom/webidl/DeviceOrientationEvent.webidl
+++ b/dom/webidl/DeviceOrientationEvent.webidl
@@ -4,12 +4,12 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-[Constructor(DOMString type, optional DeviceOrientationEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Constructor(DOMString type, optional DeviceOrientationEventInit eventInitDict), LegacyEventInit]
interface DeviceOrientationEvent : Event
{
- readonly attribute double alpha;
- readonly attribute double beta;
- readonly attribute double gamma;
+ readonly attribute double? alpha;
+ readonly attribute double? beta;
+ readonly attribute double? gamma;
readonly attribute boolean absolute;
// initDeviceOrientationEvent is a Goanna specific deprecated method.
@@ -17,16 +17,16 @@ interface DeviceOrientationEvent : Event
void initDeviceOrientationEvent(DOMString type,
boolean canBubble,
boolean cancelable,
- double alpha,
- double beta,
- double gamma,
+ double? alpha,
+ double? beta,
+ double? gamma,
boolean absolute);
};
dictionary DeviceOrientationEventInit : EventInit
{
- double alpha = 0;
- double beta = 0;
- double gamma = 0;
+ double? alpha = null;
+ double? beta = null;
+ double? gamma = null;
boolean absolute = false;
};
diff --git a/dom/webidl/DeviceProximityEvent.webidl b/dom/webidl/DeviceProximityEvent.webidl
index 44ff14b55..0d3dc1275 100644
--- a/dom/webidl/DeviceProximityEvent.webidl
+++ b/dom/webidl/DeviceProximityEvent.webidl
@@ -4,7 +4,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-[Constructor(DOMString type, optional DeviceProximityEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Constructor(DOMString type, optional DeviceProximityEventInit eventInitDict)]
interface DeviceProximityEvent : Event
{
readonly attribute double value;
diff --git a/dom/webidl/DeviceStorage.webidl b/dom/webidl/DeviceStorage.webidl
index faa253748..2b31fcc3f 100644
--- a/dom/webidl/DeviceStorage.webidl
+++ b/dom/webidl/DeviceStorage.webidl
@@ -7,8 +7,8 @@ dictionary DeviceStorageEnumerationParameters {
Date since;
};
+[Pref="device.storage.enabled"]
interface DeviceStorage : EventTarget {
- [SetterThrows]
attribute EventHandler onchange;
[Throws]
@@ -16,6 +16,20 @@ interface DeviceStorage : EventTarget {
[Throws]
DOMRequest? addNamed(Blob? aBlob, DOMString aName);
+ /**
+ * Append data to a given file.
+ * If the file doesn't exist, a "NotFoundError" event will be dispatched.
+ * In the same time, it is a request.onerror case.
+ * If the file exists, it will be opened with the following permission:
+ * "PR_WRONLY|PR_CREATE_FILE|PR_APPEND".
+ * The function will return null when blob file is null and other unexpected situations.
+ * @parameter aBlob: A Blob object representing the data to append
+ * @parameter aName: A string representing the full name (path + file name) of the file
+ * to append data to.
+ */
+ [Throws]
+ DOMRequest? appendNamed(Blob? aBlob, DOMString aName);
+
[Throws]
DOMRequest get(DOMString aName);
[Throws]
@@ -40,12 +54,39 @@ interface DeviceStorage : EventTarget {
DOMRequest usedSpace();
[Throws]
DOMRequest available();
+ [Throws]
+ DOMRequest storageStatus();
+ [Throws]
+ DOMRequest format();
+ [Throws]
+ DOMRequest mount();
+ [Throws]
+ DOMRequest unmount();
// Note that the storageName is just a name (like sdcard), and doesn't
// include any path information.
readonly attribute DOMString storageName;
+ // Indicates if the storage area denoted by storageName is capable of
+ // being mounted and unmounted.
+ readonly attribute boolean canBeMounted;
+
+ // Indicates if the storage area denoted by storageName is capable of
+ // being shared and unshared.
+ readonly attribute boolean canBeShared;
+
+ // Indicates if the storage area denoted by storageName is capable of
+ // being formatted.
+ readonly attribute boolean canBeFormatted;
+
// Determines if this storage area is the one which will be used by default
// for storing new files.
readonly attribute boolean default;
+
+ // Indicates if the storage area denoted by storageName is removable
+ readonly attribute boolean isRemovable;
+
+ [NewObject]
+ // XXXbz what type does this really return?
+ Promise<any> getRoot();
};
diff --git a/dom/webidl/DeviceStorageChangeEvent.webidl b/dom/webidl/DeviceStorageChangeEvent.webidl
index 494501250..6d79c791e 100644
--- a/dom/webidl/DeviceStorageChangeEvent.webidl
+++ b/dom/webidl/DeviceStorageChangeEvent.webidl
@@ -4,7 +4,8 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-[Constructor(DOMString type, optional DeviceStorageChangeEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Constructor(DOMString type, optional DeviceStorageChangeEventInit eventInitDict),
+ Pref="device.storage.enabled"]
interface DeviceStorageChangeEvent : Event
{
readonly attribute DOMString? path;
diff --git a/dom/webidl/Directory.webidl b/dom/webidl/Directory.webidl
new file mode 100644
index 000000000..f60b2ad6b
--- /dev/null
+++ b/dom/webidl/Directory.webidl
@@ -0,0 +1,98 @@
+/* -*- 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/.
+ */
+
+/*
+ * All functions on Directory that accept DOMString arguments for file or
+ * directory names only allow relative path to current directory itself. The
+ * path should be a descendent path like "path/to/file.txt" and not contain a
+ * segment of ".." or ".". So the paths aren't allowed to walk up the directory
+ * tree. For example, paths like "../foo", "..", "/foo/bar" or "foo/../bar" are
+ * not allowed.
+ */
+[NoInterfaceObject]
+interface Directory {
+ /*
+ * The leaf name of the directory.
+ */
+ readonly attribute DOMString name;
+
+ /*
+ * Creates a new file or replaces an existing file with given data. The file
+ * should be a descendent of current directory.
+ *
+ * @param path The relative path of the new file to current directory.
+ * @param options It has two optional properties, 'ifExists' and 'data'.
+ * If 'ifExists' is 'fail' and the path already exists, createFile must fail;
+ * If 'ifExists' is 'replace', the path already exists, and is a file, create
+ * a new file to replace the existing one;
+ * If 'ifExists' is 'replace', the path already exists, but is a directory,
+ * createFile must fail.
+ * Otherwise, if no other error occurs, createFile will create a new file.
+ * The 'data' property contains the new file's content.
+ * @return If succeeds, the promise is resolved with the new created
+ * File object. Otherwise, rejected with a DOM error.
+ */
+ [NewObject]
+ Promise<File> createFile(DOMString path, optional CreateFileOptions options);
+
+ /*
+ * Creates a descendent directory. This method will create any intermediate
+ * directories specified by the path segments.
+ *
+ * @param path The relative path of the new directory to current directory.
+ * If path exists, createDirectory must fail.
+ * @return If succeeds, the promise is resolved with the new created
+ * Directory object. Otherwise, rejected with a DOM error.
+ */
+ [NewObject]
+ Promise<Directory> createDirectory(DOMString path);
+
+ /*
+ * Gets a descendent file or directory with the given path.
+ *
+ * @param path The descendent entry's relative path to current directory.
+ * @return If the path exists and no error occurs, the promise is resolved
+ * with a File or Directory object, depending on the entry's type. Otherwise,
+ * rejected with a DOM error.
+ */
+ [NewObject]
+ Promise<(File or Directory)> get(DOMString path);
+
+ /*
+ * Deletes a file or an empty directory. The target must be a descendent of
+ * current directory.
+ * @param path If a DOM string is passed, it is the relative path of the
+ * target. Otherwise, the File or Directory object of the target should be
+ * passed.
+ * @return If the target is a non-empty directory, or if deleting the target
+ * fails, the promise is rejected with a DOM error. If the target did not
+ * exist, the promise is resolved with boolean false. If the target did exist
+ * and was successfully deleted, the promise is resolved with boolean true.
+ */
+ [NewObject]
+ Promise<boolean> remove((DOMString or File or Directory) path);
+
+ /*
+ * Deletes a file or a directory recursively. The target should be a
+ * descendent of current directory.
+ * @param path If a DOM string is passed, it is the relative path of the
+ * target. Otherwise, the File or Directory object of the target should be
+ * passed.
+ * @return If the target exists, but deleting the target fails, the promise is
+ * rejected with a DOM error. If the target did not exist, the promise is
+ * resolved with boolean false. If the target did exist and was successfully
+ * deleted, the promise is resolved with boolean true.
+ */
+ [NewObject]
+ Promise<boolean> removeDeep((DOMString or File or Directory) path);
+};
+
+enum CreateIfExistsMode { "replace", "fail" };
+
+dictionary CreateFileOptions {
+ CreateIfExistsMode ifExists = "fail";
+ (DOMString or Blob or ArrayBuffer or ArrayBufferView) data;
+};
diff --git a/dom/webidl/Document.webidl b/dom/webidl/Document.webidl
index a79444397..dff58c6b1 100644
--- a/dom/webidl/Document.webidl
+++ b/dom/webidl/Document.webidl
@@ -3,22 +3,13 @@
* 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://dom.spec.whatwg.org/#interface-document
- * http://www.whatwg.org/specs/web-apps/current-work/#the-document-object
- * http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html#api
- * http://dvcs.w3.org/hg/pointerlock/raw-file/default/index.html#extensions-to-the-document-interface
- * http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/PageVisibility/Overview.html#sec-document-interface
- * http://dev.w3.org/csswg/cssom/#extensions-to-the-document-interface
- * http://dev.w3.org/csswg/cssom-view/#extensions-to-the-document-interface
- *
* http://mxr.mozilla.org/mozilla-central/source/dom/interfaces/core/nsIDOMDocument.idl
*/
-interface StyleSheetList;
-interface TouchList;
interface WindowProxy;
interface nsISupports;
+interface URI;
+interface nsIDocShell;
enum VisibilityState { "hidden", "visible" };
@@ -27,47 +18,58 @@ enum VisibilityState { "hidden", "visible" };
interface Document : Node {
[Throws]
readonly attribute DOMImplementation implementation;
+ [Pure]
readonly attribute DOMString URL;
+ [Pure]
readonly attribute DOMString documentURI;
+ [Pure]
readonly attribute DOMString compatMode;
+ [Pure]
readonly attribute DOMString characterSet;
+ [Pure]
readonly attribute DOMString contentType;
+ [Pure]
readonly attribute DocumentType? doctype;
+ [Pure]
readonly attribute Element? documentElement;
+ [Pure]
HTMLCollection getElementsByTagName(DOMString localName);
+ [Pure, Throws]
HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
+ [Pure]
HTMLCollection getElementsByClassName(DOMString classNames);
+ [Pure]
Element? getElementById(DOMString elementId);
- [Creator, Throws]
+ [NewObject, Throws]
Element createElement(DOMString localName);
- [Creator, Throws]
+ [NewObject, Throws]
Element createElementNS(DOMString? namespace, DOMString qualifiedName);
- [Creator]
+ [NewObject]
DocumentFragment createDocumentFragment();
- [Creator]
+ [NewObject]
Text createTextNode(DOMString data);
- [Creator]
+ [NewObject]
Comment createComment(DOMString data);
- [Creator, Throws]
+ [NewObject, Throws]
ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
[Throws]
- Node importNode(Node node, optional boolean deep = true);
+ Node importNode(Node node, optional boolean deep = false);
[Throws]
Node adoptNode(Node node);
- [Creator, Throws]
+ [NewObject, Throws]
Event createEvent(DOMString interface);
- [Creator, Throws]
+ [NewObject, Throws]
Range createRange();
// NodeFilter.SHOW_ALL = 0xFFFFFFFF
- [Creator, Throws]
+ [NewObject, Throws]
NodeIterator createNodeIterator(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
- [Creator, Throws]
+ [NewObject, Throws]
TreeWalker createTreeWalker(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
// NEW
@@ -77,12 +79,13 @@ interface Document : Node {
// These are not in the spec, but leave them for now for backwards compat.
// So sort of like Goanna extensions
- [Creator, Throws]
+ [NewObject, Throws]
CDATASection createCDATASection(DOMString data);
- [Creator, Throws]
+ [NewObject, Throws]
Attr createAttribute(DOMString name);
- [Creator, Throws]
+ [NewObject, Throws]
Attr createAttributeNS(DOMString? namespace, DOMString name);
+ [Pure]
readonly attribute DOMString? inputEncoding;
};
@@ -97,8 +100,9 @@ partial interface Document {
// DOM tree accessors
//(Not proxy yet)getter object (DOMString name);
- [SetterThrows]
+ [SetterThrows, Pure]
attribute DOMString title;
+ [Pure]
attribute DOMString dir;
//(HTML only) attribute HTMLElement? body;
//(HTML only)readonly attribute HTMLHeadElement? head;
@@ -120,6 +124,7 @@ partial interface Document {
//(HTML only)void writeln(DOMString... text);
// user interaction
+ [Pure]
readonly attribute WindowProxy? defaultView;
readonly attribute Element? activeElement;
[Throws]
@@ -136,27 +141,26 @@ partial interface Document {
//(Not implemented)readonly attribute HTMLCollection commands;
// special event handler IDL attributes that only apply to Document objects
- [LenientThis, SetterThrows] attribute EventHandler onreadystatechange;
+ [LenientThis] attribute EventHandler onreadystatechange;
// Goanna extensions?
- [LenientThis, SetterThrows] attribute EventHandler onmouseenter;
- [LenientThis, SetterThrows] attribute EventHandler onmouseleave;
- [SetterThrows] attribute EventHandler onwheel;
- [SetterThrows] attribute EventHandler oncopy;
- [SetterThrows] attribute EventHandler oncut;
- [SetterThrows] attribute EventHandler onpaste;
- [SetterThrows] attribute EventHandler onbeforescriptexecute;
- [SetterThrows] attribute EventHandler onafterscriptexecute;
+ attribute EventHandler onwheel;
+ attribute EventHandler oncopy;
+ attribute EventHandler oncut;
+ attribute EventHandler onpaste;
+ attribute EventHandler onbeforescriptexecute;
+ attribute EventHandler onafterscriptexecute;
/**
* True if this document is synthetic : stand alone image, video, audio file,
* etc.
*/
- [ChromeOnly] readonly attribute boolean mozSyntheticDocument;
+ [Func="IsChromeOrXBL"] readonly attribute boolean mozSyntheticDocument;
/**
* Returns the script element whose script is currently being processed.
*
* @see <https://developer.mozilla.org/en/DOM/document.currentScript>
*/
+ [Pure]
readonly attribute Element? currentScript;
/**
* Release the current mouse capture if it is on an element within this
@@ -200,6 +204,13 @@ partial interface Document {
[ChromeOnly]
readonly attribute URI? documentURIObject;
+ /**
+ * Current referrer policy - one of the REFERRER_POLICY_* constants
+ * from nsIHttpChannel.
+ */
+ [ChromeOnly]
+ readonly attribute unsigned long referrerPolicy;
+
};
// http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html#api
@@ -225,8 +236,16 @@ partial interface Document {
//http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/custom/index.html#dfn-document-register
partial interface Document {
- [Throws, Pref="dom.webcomponents.enabled"]
- object register(DOMString name, optional ElementRegistrationOptions options);
+ [Throws, Func="nsDocument::IsWebComponentsEnabled"]
+ object registerElement(DOMString name, optional ElementRegistrationOptions options);
+};
+
+//http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/custom/index.html#dfn-document-register
+partial interface Document {
+ [NewObject, Throws]
+ Element createElement(DOMString localName, DOMString typeExtension);
+ [NewObject, Throws]
+ Element createElementNS(DOMString? namespace, DOMString qualifiedName, DOMString typeExtension);
};
// http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/PageVisibility/Overview.html#sec-document-interface
@@ -264,15 +283,21 @@ partial interface Document {
// http://dev.w3.org/2006/webapi/selectors-api2/#interface-definitions
partial interface Document {
- [Throws]
+ [Throws, Pure]
Element? querySelector(DOMString selectors);
- [Throws]
+ [Throws, Pure]
NodeList querySelectorAll(DOMString selectors);
//(Not implemented)Element? find(DOMString selectors, optional (Element or sequence<Node>)? refNodes);
//(Not implemented)NodeList findAll(DOMString selectors, optional (Element or sequence<Node>)? refNodes);
};
+// http://dev.w3.org/fxtf/web-animations/#extensions-to-the-document-interface
+partial interface Document {
+ [Func="nsDocument::IsWebAnimationsEnabled"]
+ readonly attribute AnimationTimeline timeline;
+};
+
// Mozilla extensions of various sorts
partial interface Document {
// nsIDOMDocumentXBL. Wish we could make these [ChromeOnly], but
@@ -290,7 +315,7 @@ partial interface Document {
// nsIDOMDocumentTouch
// XXXbz I can't find the sane spec for this stuff, so just cribbing
// from our xpidl for now.
- [Creator, Func="nsGenericHTMLElement::TouchEventsEnabled"]
+ [NewObject, Func="nsGenericHTMLElement::TouchEventsEnabled"]
Touch createTouch(optional Window? view = null,
optional EventTarget? target = null,
optional long identifier = 0,
@@ -308,18 +333,27 @@ partial interface Document {
// distinguishing arguments yet. Once this hack is removed. we can also
// remove the corresponding overload on nsIDocument, since Touch... and
// sequence<Touch> look the same in the C++.
- [Creator, Func="nsGenericHTMLElement::TouchEventsEnabled"]
+ [NewObject, Func="nsGenericHTMLElement::TouchEventsEnabled"]
TouchList createTouchList(Touch touch, Touch... touches);
// XXXbz and another hack for the fact that we can't usefully have optional
// distinguishing arguments but need a working zero-arg form of
// createTouchList().
- [Creator, Func="nsGenericHTMLElement::TouchEventsEnabled"]
+ [NewObject, Func="nsGenericHTMLElement::TouchEventsEnabled"]
TouchList createTouchList();
- [Creator, Func="nsGenericHTMLElement::TouchEventsEnabled"]
+ [NewObject, Func="nsGenericHTMLElement::TouchEventsEnabled"]
TouchList createTouchList(sequence<Touch> touches);
[ChromeOnly]
attribute boolean styleSheetChangeEventsEnabled;
+
+ [ChromeOnly, Throws]
+ void obsoleteSheet(URI sheetURI);
+ [ChromeOnly, Throws]
+ void obsoleteSheet(DOMString sheetURI);
+
+ [ChromeOnly] readonly attribute nsIDocShell? docShell;
+
+ [ChromeOnly] readonly attribute DOMString contentLanguage;
};
// Extension to give chrome JS the ability to determine when a document was
@@ -328,7 +362,40 @@ partial interface Document {
[ChromeOnly] readonly attribute boolean isSrcdocDocument;
};
+/**
+ * Chrome document anonymous content management.
+ * This is a Chrome-only API that allows inserting fixed positioned anonymous
+ * content on top of the current page displayed in the document.
+ * The supplied content is cloned and inserted into the document's CanvasFrame.
+ * Note that this only works for HTML documents.
+ */
+partial interface Document {
+ /**
+ * Deep-clones the provided element and inserts it into the CanvasFrame.
+ * Returns an AnonymousContent instance that can be used to manipulate the
+ * inserted element.
+ */
+ [ChromeOnly, NewObject, Throws]
+ AnonymousContent insertAnonymousContent(Element aElement);
+
+ /**
+ * Removes the element inserted into the CanvasFrame given an AnonymousContent
+ * instance.
+ */
+ [ChromeOnly, Throws]
+ void removeAnonymousContent(AnonymousContent aContent);
+};
+
+// Extension to give chrome and XBL JS the ability to determine whether
+// the document is sandboxed without permission to run scripts.
+partial interface Document {
+ [Func="IsChromeOrXBL"] readonly attribute boolean hasScriptsBlockedBySandbox;
+};
+
Document implements XPathEvaluator;
Document implements GlobalEventHandlers;
-Document implements NodeEventHandlers;
Document implements TouchEventHandlers;
+Document implements ParentNode;
+Document implements OnErrorEventHandlerForNodes;
+Document implements GeometryUtils;
+Document implements FontFaceSource;
diff --git a/dom/webidl/DocumentFragment.webidl b/dom/webidl/DocumentFragment.webidl
index 87fb00b40..0f814666f 100644
--- a/dom/webidl/DocumentFragment.webidl
+++ b/dom/webidl/DocumentFragment.webidl
@@ -23,3 +23,5 @@ partial interface DocumentFragment {
[Throws]
NodeList querySelectorAll(DOMString selectors);
};
+
+DocumentFragment implements ParentNode;
diff --git a/dom/webidl/DownloadEvent.webidl b/dom/webidl/DownloadEvent.webidl
new file mode 100644
index 000000000..b64bd2984
--- /dev/null
+++ b/dom/webidl/DownloadEvent.webidl
@@ -0,0 +1,18 @@
+/* -*- 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/.
+ */
+
+[Constructor(DOMString type, optional DownloadEventInit eventInitDict),
+ Pref="dom.mozDownloads.enabled",
+ CheckPermissions="downloads"]
+interface DownloadEvent : Event
+{
+ readonly attribute DOMDownload? download;
+};
+
+dictionary DownloadEventInit : EventInit
+{
+ DOMDownload? download = null;
+};
diff --git a/dom/webidl/Downloads.webidl b/dom/webidl/Downloads.webidl
new file mode 100644
index 000000000..2d981c983
--- /dev/null
+++ b/dom/webidl/Downloads.webidl
@@ -0,0 +1,102 @@
+/* -*- 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/.
+ */
+
+// Represents the state of a download.
+// "downloading": The resource is actively transfering.
+// "stopped" : No network tranfer is happening.
+// "succeeded" : The resource has been downloaded successfully.
+// "finalized" : We won't try to download this resource, but the DOM
+// object is still alive.
+enum DownloadState {
+ "downloading",
+ "stopped",
+ "succeeded",
+ "finalized"
+};
+
+//
+// XXXTODO: When we have a generic way to do feature detection in marketplace
+// we will *STOP* using the pref and use CheckPermissions like
+// DOMDownload and DownloadEvent.
+//
+[NoInterfaceObject,
+ NavigatorProperty="mozDownloadManager",
+ JSImplementation="@mozilla.org/downloads/manager;1",
+ Pref="dom.mozDownloads.enabled"]
+interface DOMDownloadManager : EventTarget {
+ // This promise returns an array of downloads with all the current
+ // download objects.
+ Promise<sequence<DOMDownload>> getDownloads();
+
+ // Removes one download from the downloads set. Returns a promise resolved
+ // with the finalized download.
+ [UnsafeInPrerendering]
+ Promise<DOMDownload> remove(DOMDownload download);
+
+ // Removes all the completed downloads from the set. Returns an
+ // array of the completed downloads that were removed.
+ [UnsafeInPrerendering]
+ Promise<sequence<DOMDownload>> clearAllDone();
+
+ // Fires when a new download starts.
+ attribute EventHandler ondownloadstart;
+};
+
+[JSImplementation="@mozilla.org/downloads/download;1",
+ Pref="dom.mozDownloads.enabled",
+ CheckPermissions="downloads"]
+interface DOMDownload : EventTarget {
+ // The full size of the resource.
+ readonly attribute long long totalBytes;
+
+ // The number of bytes that we have currently downloaded.
+ readonly attribute long long currentBytes;
+
+ // The url of the resource.
+ readonly attribute DOMString url;
+
+ // The full path in local storage where the file will end up once the download
+ // is complete.
+ readonly attribute DOMString path;
+
+ // The DeviceStorage volume name on which the file is being downloaded.
+ readonly attribute DOMString storageName;
+
+ // The DeviceStorage path on the volume with 'storageName' of the file being
+ // downloaded.
+ readonly attribute DOMString storagePath;
+
+ // The state of the download.
+ readonly attribute DownloadState state;
+
+ // The mime type for this resource.
+ readonly attribute DOMString contentType;
+
+ // The timestamp this download started.
+ readonly attribute Date startTime;
+
+ // An opaque identifier for this download. All instances of the same
+ // download (eg. in different windows) will have the same id.
+ readonly attribute DOMString id;
+
+ // A DOM error object, that will be not null when a download is stopped
+ // because something failed.
+ readonly attribute DOMError? error;
+
+ // Pauses the download.
+ [UnsafeInPrerendering]
+ Promise<DOMDownload> pause();
+
+ // Resumes the download. This resolves only once the download has
+ // succeeded.
+ [UnsafeInPrerendering]
+ Promise<DOMDownload> resume();
+
+ // This event is triggered anytime a property of the object changes:
+ // - when the transfer progresses, updating currentBytes.
+ // - when the state and/or error attributes change.
+ attribute EventHandler onstatechange;
+};
diff --git a/dom/webidl/DragEvent.webidl b/dom/webidl/DragEvent.webidl
index 63846a453..03c2e6f61 100644
--- a/dom/webidl/DragEvent.webidl
+++ b/dom/webidl/DragEvent.webidl
@@ -4,9 +4,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-interface WindowProxy;
-interface DataTransfer;
-
interface DragEvent : MouseEvent
{
readonly attribute DataTransfer? dataTransfer;
@@ -15,7 +12,7 @@ interface DragEvent : MouseEvent
void initDragEvent(DOMString type,
boolean canBubble,
boolean cancelable,
- WindowProxy? aView,
+ Window? aView,
long aDetail,
long aScreenX,
long aScreenY,
diff --git a/dom/webidl/DummyBinding.webidl b/dom/webidl/DummyBinding.webidl
index 7bdfbbe7d..931c9db99 100644
--- a/dom/webidl/DummyBinding.webidl
+++ b/dom/webidl/DummyBinding.webidl
@@ -8,21 +8,8 @@
// aren't actually referenced anywhere in IDL yet but are used in C++.
interface DummyInterface {
- readonly attribute OnErrorEventHandlerNonNull onErrorEventHandler;
- FilePropertyBag fileBag();
- InspectorRGBTriple rgbTriple();
- Function getFunction();
- void funcSocketsDict(optional SocketsDict arg);
- void funcHttpConnDict(optional HttpConnDict arg);
- void funcWebSocketDict(optional WebSocketDict arg);
- void funcDNSCacheDict(optional DNSCacheDict arg);
- void frameRequestCallback(FrameRequestCallback arg);
- void idbObjectStoreParams(optional IDBObjectStoreParameters arg);
- void CameraPictureOptions(optional CameraPictureOptions arg);
- void MmsParameters(optional MmsParameters arg);
- void MmsAttachment(optional MmsAttachment arg);
+ void lifecycleCallbacks(optional LifecycleCallbacks arg);
};
interface DummyInterfaceWorkers {
- BlobPropertyBag blobBag();
};
diff --git a/dom/webidl/DynamicsCompressorNode.webidl b/dom/webidl/DynamicsCompressorNode.webidl
index 5cac73f6a..5e7021cdc 100644
--- a/dom/webidl/DynamicsCompressorNode.webidl
+++ b/dom/webidl/DynamicsCompressorNode.webidl
@@ -10,7 +10,6 @@
* liability, trademark and document use rules apply.
*/
-[PrefControlled]
interface DynamicsCompressorNode : AudioNode {
readonly attribute AudioParam threshold; // in Decibels
@@ -22,3 +21,6 @@ interface DynamicsCompressorNode : AudioNode {
};
+// Mozilla extension
+DynamicsCompressorNode implements AudioNodePassThrough;
+
diff --git a/dom/webidl/Element.webidl b/dom/webidl/Element.webidl
index e85fe127b..45037c57f 100644
--- a/dom/webidl/Element.webidl
+++ b/dom/webidl/Element.webidl
@@ -28,16 +28,16 @@ interface Element : Node {
[Pure]
attribute DOMString id;
-/*
- FIXME Bug 810677 Move className from HTMLElement to Element
+ [Pure]
attribute DOMString className;
-*/
[Constant]
- readonly attribute DOMTokenList? classList;
+ readonly attribute DOMTokenList classList;
- [Constant]
- readonly attribute MozNamedAttrMap attributes;
+ [SameObject]
+ readonly attribute NamedNodeMap attributes;
+ [Pure]
DOMString? getAttribute(DOMString name);
+ [Pure]
DOMString? getAttributeNS(DOMString? namespace, DOMString localName);
[Throws]
void setAttribute(DOMString name, DOMString value);
@@ -47,29 +47,25 @@ interface Element : Node {
void removeAttribute(DOMString name);
[Throws]
void removeAttributeNS(DOMString? namespace, DOMString localName);
+ [Pure]
boolean hasAttribute(DOMString name);
+ [Pure]
boolean hasAttributeNS(DOMString? namespace, DOMString localName);
-
- [Throws]
+ [Pure]
+ boolean hasAttributes();
+
+ [Throws, Pure]
+ Element? closest(DOMString selector);
+
+ [Throws, Pure]
boolean matches(DOMString selector);
-
- HTMLCollection getElementsByTagName(DOMString localName);
- [Throws]
- HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
- HTMLCollection getElementsByClassName(DOMString classNames);
- [Constant]
- readonly attribute HTMLCollection children;
- [Pure]
- readonly attribute Element? firstElementChild;
- [Pure]
- readonly attribute Element? lastElementChild;
- [Pure]
- readonly attribute Element? previousElementSibling;
[Pure]
- readonly attribute Element? nextElementSibling;
+ HTMLCollection getElementsByTagName(DOMString localName);
+ [Throws, Pure]
+ HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
[Pure]
- readonly attribute unsigned long childElementCount;
+ HTMLCollection getElementsByClassName(DOMString classNames);
/**
* The ratio of font-size-inflated text font size to computed font
@@ -86,12 +82,7 @@ interface Element : Node {
readonly attribute float fontSizeInflation;
// Mozilla specific stuff
-
- [SetterThrows,LenientThis]
- attribute EventHandler onmouseenter;
- [SetterThrows,LenientThis]
- attribute EventHandler onmouseleave;
- [SetterThrows]
+ [Pure]
attribute EventHandler onwheel;
// Selectors API
@@ -101,9 +92,16 @@ interface Element : Node {
*
* See <http://dev.w3.org/2006/webapi/selectors-api2/#matchesselector>
*/
- [Throws]
+ [Throws, Pure]
boolean mozMatchesSelector(DOMString selector);
+ // Pointer events methods.
+ [Throws, Pref="dom.w3c_pointer_events.enabled", UnsafeInPrerendering]
+ void setPointerCapture(long pointerId);
+
+ [Throws, Pref="dom.w3c_pointer_events.enabled"]
+ void releasePointerCapture(long pointerId);
+
// Proprietary extensions
/**
* Set this during a mousedown event to grab and retarget all mouse events
@@ -126,9 +124,13 @@ interface Element : Node {
* Requests that this element be made the full-screen element, as per the DOM
* full-screen api.
*
- * @see <https://wiki.mozilla.org/index.php?title=Gecko:FullScreenAPI>
+ * The options parameter is non-standard. In Goanna, it can be:
+ * a RequestFullscreenOptions object
+ *
+ * @see <https://wiki.mozilla.org/index.php?title=Goanna:FullScreenAPI>
*/
- void mozRequestFullScreen();
+ [Throws, UnsafeInPrerendering]
+ void mozRequestFullScreen(optional any options);
/**
* Requests that this element be made the pointer-locked element, as per the DOM
@@ -136,6 +138,7 @@ interface Element : Node {
*
* @see <http://dvcs.w3.org/hg/pointerlock/raw-file/default/index.html>
*/
+ [UnsafeInPrerendering]
void mozRequestPointerLock();
// Obsolete methods.
@@ -147,20 +150,41 @@ interface Element : Node {
Attr? getAttributeNodeNS(DOMString? namespaceURI, DOMString localName);
[Throws]
Attr? setAttributeNodeNS(Attr newAttr);
+
+ [ChromeOnly]
+ /**
+ * Scrolls the element by (dx, dy) CSS pixels without doing any
+ * layout flushing.
+ */
+ boolean scrollByNoFlush(long dx, long dy);
+};
+
+// http://dev.w3.org/csswg/cssom-view/
+enum ScrollLogicalPosition { "start", "end" };
+dictionary ScrollIntoViewOptions : ScrollOptions {
+ ScrollLogicalPosition block = "start";
};
// http://dev.w3.org/csswg/cssom-view/#extensions-to-the-element-interface
partial interface Element {
- ClientRectList getClientRects();
- ClientRect getBoundingClientRect();
+ DOMRectList getClientRects();
+ DOMRect getBoundingClientRect();
// scrolling
- void scrollIntoView(optional boolean top = true);
+ void scrollIntoView(boolean top);
+ void scrollIntoView(optional ScrollIntoViewOptions options);
// None of the CSSOM attributes are [Pure], because they flush
attribute long scrollTop; // scroll on setting
attribute long scrollLeft; // scroll on setting
readonly attribute long scrollWidth;
readonly attribute long scrollHeight;
+
+ void scroll(unrestricted double x, unrestricted double y);
+ void scroll(optional ScrollToOptions options);
+ void scrollTo(unrestricted double x, unrestricted double y);
+ void scrollTo(optional ScrollToOptions options);
+ void scrollBy(unrestricted double x, unrestricted double y);
+ void scrollBy(optional ScrollToOptions options);
readonly attribute long clientTop;
readonly attribute long clientLeft;
@@ -185,9 +209,9 @@ partial interface Element {
// http://domparsing.spec.whatwg.org/#extensions-to-the-element-interface
partial interface Element {
- [Throws,TreatNullAs=EmptyString]
+ [Pure,SetterThrows,TreatNullAs=EmptyString]
attribute DOMString innerHTML;
- [Throws,TreatNullAs=EmptyString]
+ [Pure,SetterThrows,TreatNullAs=EmptyString]
attribute DOMString outerHTML;
[Throws]
void insertAdjacentHTML(DOMString position, DOMString text);
@@ -195,10 +219,31 @@ partial interface Element {
// http://www.w3.org/TR/selectors-api/#interface-definitions
partial interface Element {
- [Throws]
+ [Throws, Pure]
Element? querySelector(DOMString selectors);
- [Throws]
+ [Throws, Pure]
NodeList querySelectorAll(DOMString selectors);
};
+// http://w3c.github.io/webcomponents/spec/shadow/#extensions-to-element-interface
+partial interface Element {
+ [Throws,Func="nsDocument::IsWebComponentsEnabled"]
+ ShadowRoot createShadowRoot();
+ [Func="nsDocument::IsWebComponentsEnabled"]
+ NodeList getDestinationInsertionPoints();
+ [Func="nsDocument::IsWebComponentsEnabled"]
+ readonly attribute ShadowRoot? shadowRoot;
+};
+
Element implements ChildNode;
+Element implements NonDocumentTypeChildNode;
+Element implements ParentNode;
+Element implements Animatable;
+Element implements GeometryUtils;
+
+// non-standard: allows passing options to Element.requestFullScreen
+dictionary RequestFullscreenOptions {
+ // Which HMDVRDevice to go full screen on; also enables VR rendering.
+ // If null, normal fullscreen is entered.
+ HMDVRDevice? vrDisplay = null;
+};
diff --git a/dom/webidl/ElementReplaceEvent.webidl b/dom/webidl/ElementReplaceEvent.webidl
deleted file mode 100644
index ce3acd3f7..000000000
--- a/dom/webidl/ElementReplaceEvent.webidl
+++ /dev/null
@@ -1,23 +0,0 @@
-/* -*- 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/.
- */
-
-[Constructor(DOMString type, optional ElementReplaceEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
-interface ElementReplaceEvent : Event
-{
- readonly attribute Element? upgrade;
-
- // initElementReplaceEvent is a Goanna specific deprecated method.
- [Throws]
- void initElementReplaceEvent(DOMString type,
- boolean canBubble,
- boolean cancelable,
- Element? upgrade);
-};
-
-dictionary ElementReplaceEventInit : EventInit
-{
- Element? upgrade = null;
-};
diff --git a/dom/webidl/EngineeringMode.webidl b/dom/webidl/EngineeringMode.webidl
new file mode 100644
index 000000000..03f8931e1
--- /dev/null
+++ b/dom/webidl/EngineeringMode.webidl
@@ -0,0 +1,13 @@
+/* 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/. */
+
+[JSImplementation="@mozilla.org/dom/engineering-mode-api;1",
+ NavigatorProperty="engineeringMode",
+ AvailableIn=CertifiedApps,
+ CheckPermissions="engineering-mode"]
+interface EngineeringMode : EventTarget {
+ Promise<DOMString> getValue(DOMString name);
+ Promise<void> setValue(DOMString name, DOMString value);
+ attribute EventHandler onmessage;
+};
diff --git a/dom/webidl/ErrorEvent.webidl b/dom/webidl/ErrorEvent.webidl
new file mode 100644
index 000000000..5d12b879f
--- /dev/null
+++ b/dom/webidl/ErrorEvent.webidl
@@ -0,0 +1,24 @@
+/* -*- 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/. */
+
+[Constructor(DOMString type, optional ErrorEventInit eventInitDict),
+ Exposed=(Window,System)]
+interface ErrorEvent : Event
+{
+ readonly attribute DOMString message;
+ readonly attribute DOMString filename;
+ readonly attribute unsigned long lineno;
+ readonly attribute unsigned long colno;
+ readonly attribute any error;
+};
+
+dictionary ErrorEventInit : EventInit
+{
+ DOMString message = "";
+ DOMString filename = "";
+ unsigned long lineno = 0;
+ unsigned long colno = 0;
+ any error = null;
+};
diff --git a/dom/webidl/Event.webidl b/dom/webidl/Event.webidl
index b96bc3fa6..188045654 100644
--- a/dom/webidl/Event.webidl
+++ b/dom/webidl/Event.webidl
@@ -10,28 +10,38 @@
* liability, trademark and document use rules apply.
*/
-[Constructor(DOMString type, optional EventInit eventInitDict)]
+[Constructor(DOMString type, optional EventInit eventInitDict),
+ Exposed=(Window,Worker,System)]
interface Event {
+ [Pure]
readonly attribute DOMString type;
+ [Pure]
readonly attribute EventTarget? target;
+ [Pure]
readonly attribute EventTarget? currentTarget;
const unsigned short NONE = 0;
const unsigned short CAPTURING_PHASE = 1;
const unsigned short AT_TARGET = 2;
const unsigned short BUBBLING_PHASE = 3;
+ [Pure]
readonly attribute unsigned short eventPhase;
void stopPropagation();
void stopImmediatePropagation();
+ [Pure]
readonly attribute boolean bubbles;
+ [Pure]
readonly attribute boolean cancelable;
void preventDefault();
+ [Pure]
readonly attribute boolean defaultPrevented;
+ [Unforgeable, Pure]
readonly attribute boolean isTrusted;
- readonly attribute DOMTimeStamp timeStamp;
+ [Pure]
+ readonly attribute DOMHighResTimeStamp timeStamp;
[Throws]
void initEvent(DOMString type, boolean bubbles, boolean cancelable);
@@ -39,38 +49,6 @@ interface Event {
// Mozilla specific legacy stuff.
partial interface Event {
- const long MOUSEDOWN = 0x00000001;
- const long MOUSEUP = 0x00000002;
- const long MOUSEOVER = 0x00000004;
- const long MOUSEOUT = 0x00000008;
- const long MOUSEMOVE = 0x00000010;
- const long MOUSEDRAG = 0x00000020;
- const long CLICK = 0x00000040;
- const long DBLCLICK = 0x00000080;
- const long KEYDOWN = 0x00000100;
- const long KEYUP = 0x00000200;
- const long KEYPRESS = 0x00000400;
- const long DRAGDROP = 0x00000800;
- const long FOCUS = 0x00001000;
- const long BLUR = 0x00002000;
- const long SELECT = 0x00004000;
- const long CHANGE = 0x00008000;
- const long RESET = 0x00010000;
- const long SUBMIT = 0x00020000;
- const long SCROLL = 0x00040000;
- const long LOAD = 0x00080000;
- const long UNLOAD = 0x00100000;
- const long XFER_DONE = 0x00200000;
- const long ABORT = 0x00400000;
- const long ERROR = 0x00800000;
- const long LOCATE = 0x01000000;
- const long MOVE = 0x02000000;
- const long RESIZE = 0x04000000;
- const long FORWARD = 0x08000000;
- const long HELP = 0x10000000;
- const long BACK = 0x20000000;
- const long TEXT = 0x40000000;
-
const long ALT_MASK = 0x00000001;
const long CONTROL_MASK = 0x00000002;
const long SHIFT_MASK = 0x00000004;
@@ -78,7 +56,9 @@ partial interface Event {
readonly attribute EventTarget? originalTarget;
readonly attribute EventTarget? explicitOriginalTarget;
+ [ChromeOnly] readonly attribute EventTarget? composedTarget;
[ChromeOnly] readonly attribute boolean multipleActionsPrevented;
+ [ChromeOnly] readonly attribute boolean isSynthesized;
boolean getPreventDefault();
};
@@ -87,4 +67,3 @@ dictionary EventInit {
boolean bubbles = false;
boolean cancelable = false;
};
-
diff --git a/dom/webidl/EventHandler.webidl b/dom/webidl/EventHandler.webidl
index 79d7775c7..f3741468f 100644
--- a/dom/webidl/EventHandler.webidl
+++ b/dom/webidl/EventHandler.webidl
@@ -10,184 +10,142 @@
* Opera Software ASA. You are granted a license to use, reproduce
* and create derivative works of this document.
*/
-[TreatNonCallableAsNull]
+[TreatNonObjectAsNull]
callback EventHandlerNonNull = any (Event event);
typedef EventHandlerNonNull? EventHandler;
-[TreatNonCallableAsNull]
-callback BeforeUnloadEventHandlerNonNull = DOMString? (Event event);
-typedef BeforeUnloadEventHandlerNonNull? BeforeUnloadEventHandler;
+[TreatNonObjectAsNull]
+// https://www.w3.org/Bugs/Public/show_bug.cgi?id=23489
+//callback OnBeforeUnloadEventHandlerNonNull = DOMString (Event event);
+callback OnBeforeUnloadEventHandlerNonNull = DOMString? (Event event);
+typedef OnBeforeUnloadEventHandlerNonNull? OnBeforeUnloadEventHandler;
-[TreatNonCallableAsNull]
-callback OnErrorEventHandlerNonNull = boolean ((Event or DOMString) event, optional DOMString source, optional unsigned long lineno, optional unsigned long column);
+[TreatNonObjectAsNull]
+callback OnErrorEventHandlerNonNull = boolean ((Event or DOMString) event, optional DOMString source, optional unsigned long lineno, optional unsigned long column, optional any error);
typedef OnErrorEventHandlerNonNull? OnErrorEventHandler;
[NoInterfaceObject]
interface GlobalEventHandlers {
- [SetterThrows]
attribute EventHandler onabort;
- //(Not implemented)[SetterThrows]
+ attribute EventHandler onblur;
+// We think the spec is wrong here. See OnErrorEventHandlerForNodes/Window
+// below.
+// attribute OnErrorEventHandler onerror;
+ attribute EventHandler onfocus;
//(Not implemented)attribute EventHandler oncancel;
- [SetterThrows]
attribute EventHandler oncanplay;
- [SetterThrows]
attribute EventHandler oncanplaythrough;
- [SetterThrows]
attribute EventHandler onchange;
- [SetterThrows]
attribute EventHandler onclick;
- //(Not implemented)[SetterThrows]
//(Not implemented)attribute EventHandler onclose;
- [SetterThrows]
attribute EventHandler oncontextmenu;
- //(Not implemented)[SetterThrows]
//(Not implemented)attribute EventHandler oncuechange;
- [SetterThrows]
attribute EventHandler ondblclick;
- [SetterThrows]
attribute EventHandler ondrag;
- [SetterThrows]
attribute EventHandler ondragend;
- [SetterThrows]
attribute EventHandler ondragenter;
- [SetterThrows]
+ //(Not implemented)attribute EventHandler ondragexit;
attribute EventHandler ondragleave;
- [SetterThrows]
attribute EventHandler ondragover;
- [SetterThrows]
attribute EventHandler ondragstart;
- [SetterThrows]
attribute EventHandler ondrop;
- [SetterThrows]
attribute EventHandler ondurationchange;
- [SetterThrows]
attribute EventHandler onemptied;
- [SetterThrows]
attribute EventHandler onended;
- [SetterThrows]
attribute EventHandler oninput;
- [SetterThrows]
attribute EventHandler oninvalid;
- [SetterThrows]
attribute EventHandler onkeydown;
- [SetterThrows]
attribute EventHandler onkeypress;
- [SetterThrows]
attribute EventHandler onkeyup;
- [SetterThrows]
+ attribute EventHandler onload;
attribute EventHandler onloadeddata;
- [SetterThrows]
attribute EventHandler onloadedmetadata;
- [SetterThrows]
attribute EventHandler onloadstart;
- [SetterThrows]
attribute EventHandler onmousedown;
- [SetterThrows]
+ [LenientThis] attribute EventHandler onmouseenter;
+ [LenientThis] attribute EventHandler onmouseleave;
attribute EventHandler onmousemove;
- [SetterThrows]
attribute EventHandler onmouseout;
- [SetterThrows]
attribute EventHandler onmouseover;
- [SetterThrows]
attribute EventHandler onmouseup;
- //(Not implemented)[SetterThrows]
//(Not implemented)attribute EventHandler onmousewheel;
- [SetterThrows]
attribute EventHandler onpause;
- [SetterThrows]
attribute EventHandler onplay;
- [SetterThrows]
attribute EventHandler onplaying;
- [SetterThrows]
attribute EventHandler onprogress;
- [SetterThrows]
attribute EventHandler onratechange;
- [SetterThrows]
attribute EventHandler onreset;
- [SetterThrows]
+ attribute EventHandler onresize;
+ attribute EventHandler onscroll;
attribute EventHandler onseeked;
- [SetterThrows]
attribute EventHandler onseeking;
- [SetterThrows]
attribute EventHandler onselect;
- [SetterThrows]
attribute EventHandler onshow;
- //(Not implemented)[SetterThrows]
//(Not implemented)attribute EventHandler onsort;
- [SetterThrows]
attribute EventHandler onstalled;
- [SetterThrows]
attribute EventHandler onsubmit;
- [SetterThrows]
attribute EventHandler onsuspend;
- [SetterThrows]
attribute EventHandler ontimeupdate;
- [SetterThrows]
attribute EventHandler onvolumechange;
- [SetterThrows]
attribute EventHandler onwaiting;
+ // Pointer events handlers
+ [Pref="dom.w3c_pointer_events.enabled"]
+ attribute EventHandler onpointercancel;
+ [Pref="dom.w3c_pointer_events.enabled"]
+ attribute EventHandler onpointerdown;
+ [Pref="dom.w3c_pointer_events.enabled"]
+ attribute EventHandler onpointerup;
+ [Pref="dom.w3c_pointer_events.enabled"]
+ attribute EventHandler onpointermove;
+ [Pref="dom.w3c_pointer_events.enabled"]
+ attribute EventHandler onpointerout;
+ [Pref="dom.w3c_pointer_events.enabled"]
+ attribute EventHandler onpointerover;
+ [Pref="dom.w3c_pointer_events.enabled"]
+ attribute EventHandler onpointerenter;
+ [Pref="dom.w3c_pointer_events.enabled"]
+ attribute EventHandler onpointerleave;
+ [Pref="dom.w3c_pointer_events.enabled"]
+ attribute EventHandler ongotpointercapture;
+ [Pref="dom.w3c_pointer_events.enabled"]
+ attribute EventHandler onlostpointercapture;
+
// Mozilla-specific handlers
- [SetterThrows]
attribute EventHandler onmozfullscreenchange;
- [SetterThrows]
attribute EventHandler onmozfullscreenerror;
- [SetterThrows]
attribute EventHandler onmozpointerlockchange;
- [SetterThrows]
attribute EventHandler onmozpointerlockerror;
};
[NoInterfaceObject]
-interface NodeEventHandlers {
- [SetterThrows]
- attribute EventHandler onblur;
- // We think the spec is wrong here.
- // attribute OnErrorEventHandler onerror;
- [SetterThrows]
- attribute EventHandler onerror;
- [SetterThrows]
- attribute EventHandler onfocus;
- [SetterThrows]
- attribute EventHandler onload;
- [SetterThrows]
- attribute EventHandler onscroll;
-};
-
-[NoInterfaceObject]
interface WindowEventHandlers {
- [SetterThrows]
attribute EventHandler onafterprint;
- [SetterThrows]
attribute EventHandler onbeforeprint;
- [SetterThrows]
- attribute BeforeUnloadEventHandler onbeforeunload;
- // For now, onerror comes from NodeEventHandlers
- // When we convert Window to WebIDL this may need to change.
- // [SetterThrows]
- // attribute OnErrorEventHandler onerror;
- //(Not implemented)[SetterThrows]
- //(Not implemented)attribute EventHandler onfullscreenchange;
- //(Not implemented)[SetterThrows]
- //(Not implemented)attribute EventHandler onfullscreenerror;
- [SetterThrows]
+ attribute OnBeforeUnloadEventHandler onbeforeunload;
attribute EventHandler onhashchange;
- [SetterThrows]
+ attribute EventHandler onlanguagechange;
attribute EventHandler onmessage;
- [SetterThrows]
attribute EventHandler onoffline;
- [SetterThrows]
attribute EventHandler ononline;
- [SetterThrows]
attribute EventHandler onpagehide;
- [SetterThrows]
attribute EventHandler onpageshow;
- [SetterThrows]
attribute EventHandler onpopstate;
- [SetterThrows]
- attribute EventHandler onresize;
- //(Not implemented)[SetterThrows]
//(Not implemented)attribute EventHandler onstorage;
- [SetterThrows]
attribute EventHandler onunload;
};
+
+// The spec has |attribute OnErrorEventHandler onerror;| on
+// GlobalEventHandlers, and calls the handler differently depending on
+// whether an ErrorEvent was fired. We don't do that, and until we do we'll
+// need to distinguish between onerror on Window or on nodes.
+
+[NoInterfaceObject]
+interface OnErrorEventHandlerForNodes {
+ attribute EventHandler onerror;
+};
+
+[NoInterfaceObject]
+interface OnErrorEventHandlerForWindow {
+ attribute OnErrorEventHandler onerror;
+};
diff --git a/dom/webidl/EventSource.webidl b/dom/webidl/EventSource.webidl
index d9dff911a..8d00315ab 100644
--- a/dom/webidl/EventSource.webidl
+++ b/dom/webidl/EventSource.webidl
@@ -11,7 +11,8 @@
* and create derivative works of this document.
*/
-[Constructor(DOMString url, optional EventSourceInit eventSourceInitDict), PrefControlled]
+[Constructor(DOMString url, optional EventSourceInit eventSourceInitDict),
+ Func="mozilla::dom::EventSource::PrefEnabled"]
interface EventSource : EventTarget {
[Constant]
readonly attribute DOMString url;
@@ -25,12 +26,9 @@ interface EventSource : EventTarget {
readonly attribute unsigned short readyState;
// networking
- [SetterThrows]
- attribute EventHandler onopen;
- [SetterThrows]
- attribute EventHandler onmessage;
- [SetterThrows]
- attribute EventHandler onerror;
+ attribute EventHandler onopen;
+ attribute EventHandler onmessage;
+ attribute EventHandler onerror;
void close();
};
diff --git a/dom/webidl/EventTarget.webidl b/dom/webidl/EventTarget.webidl
index ae6cad31c..0ad59289c 100644
--- a/dom/webidl/EventTarget.webidl
+++ b/dom/webidl/EventTarget.webidl
@@ -10,6 +10,7 @@
* liability, trademark and document use rules apply.
*/
+[Exposed=(Window,Worker,System)]
interface EventTarget {
/* Passing null for wantsUntrusted means "default behavior", which
differs in content and chrome. In content that default boolean
diff --git a/dom/webidl/ExtendableEvent.webidl b/dom/webidl/ExtendableEvent.webidl
new file mode 100644
index 000000000..47a192ba6
--- /dev/null
+++ b/dom/webidl/ExtendableEvent.webidl
@@ -0,0 +1,19 @@
+/* -*- 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/.
+ *
+ * For more information on this interface, please see
+ * http://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html
+ */
+
+[Constructor(DOMString type, optional ExtendableEventInit eventInitDict),
+ Exposed=ServiceWorker]
+interface ExtendableEvent : Event {
+ // https://github.com/slightlyoff/ServiceWorker/issues/261
+ void waitUntil(Promise<any> p);
+};
+
+dictionary ExtendableEventInit : EventInit {
+ // Defined for the forward compatibility across the derived events
+};
diff --git a/dom/webidl/External.webidl b/dom/webidl/External.webidl
new file mode 100644
index 000000000..ef8017949
--- /dev/null
+++ b/dom/webidl/External.webidl
@@ -0,0 +1,18 @@
+/* -*- 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/.
+ */
+
+[JSImplementation="@mozilla.org/sidebar;1"]
+interface External
+{
+ [UnsafeInPrerendering] void AddSearchProvider(DOMString aDescriptionURL);
+ unsigned long IsSearchProviderInstalled(DOMString aSearchURL);
+};
+
+// Mozilla extension
+partial interface External {
+ [UnsafeInPrerendering] void addSearchEngine(DOMString engineURL, DOMString iconURL,
+ DOMString suggestedTitle, DOMString suggestedCategory);
+};
diff --git a/dom/webidl/FMRadio.webidl b/dom/webidl/FMRadio.webidl
new file mode 100644
index 000000000..57db07691
--- /dev/null
+++ b/dom/webidl/FMRadio.webidl
@@ -0,0 +1,176 @@
+/* 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/. */
+
+interface FMRadio : EventTarget {
+ /* Indicates if the FM radio is enabled. */
+ readonly attribute boolean enabled;
+
+ /* Indicates if RDS reception is enabled */
+ readonly attribute boolean rdsEnabled;
+
+ /* Indicates if the antenna is plugged and available. */
+ readonly attribute boolean antennaAvailable;
+
+ /**
+ * Current frequency in MHz. The value will be null if the FM radio is
+ * disabled.
+ */
+ readonly attribute double? frequency;
+
+ /* The upper bound of frequency in MHz. */
+ readonly attribute double frequencyUpperBound;
+
+ /* The lower bound of frequency in MHz. */
+ readonly attribute double frequencyLowerBound;
+
+ /**
+ * The difference in frequency between two "adjacent" channels, in MHz. That
+ * is, any two radio channels' frequencies differ by at least channelWidth
+ * MHz. Usually, the value is one of:
+ * - 0.05 MHz
+ * - 0.1 MHz
+ * - 0.2 MHz
+ */
+ readonly attribute double channelWidth;
+
+ /**
+ * This is a mask consisting of bits corresponding to
+ * (1 << groupcode) that can be specified to receive
+ * raw RDS groups of specific group types. Note that
+ * groupcode corresponds to the upper 5 bits in block B.
+ */
+ attribute unsigned long rdsGroupMask;
+
+ /**
+ * The Program Identification (PI) code.
+ * Available if RDS is enabled on both the station and on this device.
+ * The value is null otherwise.
+ */
+ readonly attribute unsigned short? pi;
+
+ /**
+ * The Program Type (PTY) code.
+ * Available if RDS is enabled on both the station and on this device.
+ * The value is null otherwise.
+ */
+ readonly attribute octet? pty;
+
+ /**
+ * The Program Service (PS) name.
+ * Available if RDS is enabled on the station and on this device
+ */
+ readonly attribute DOMString? ps;
+
+ /**
+ * The radiotext, as provided by group 2A/2B.
+ * Available if RDS is enabled on the station and on this device
+ */
+ readonly attribute DOMString? rt;
+
+ /**
+ * The last RDS group received.
+ * Available if RDS is enabled on the station and on this device
+ */
+ readonly attribute Uint16Array? rdsgroup;
+
+ /* Fired when the FM radio is enabled. */
+ attribute EventHandler onenabled;
+
+ /* Fired when the FM radio is disabled. */
+ attribute EventHandler ondisabled;
+
+ /* Fired when the RDS is enabled. */
+ attribute EventHandler onrdsenabled;
+
+ /* Fired when the RDS is disabled. */
+ attribute EventHandler onrdsdisabled;
+
+ /**
+ * Fired when the antenna becomes available or unavailable, i.e., fired when
+ * the antennaAvailable attribute changes.
+ */
+ attribute EventHandler onantennaavailablechange;
+
+ /* Fired when the FM radio's frequency is changed. */
+ attribute EventHandler onfrequencychange;
+
+ /* Fired when the PI code changes */
+ attribute EventHandler onpichange;
+
+ /* Fired when the PTY changes */
+ attribute EventHandler onptychange;
+
+ /* Fired when the PS name changes */
+ attribute EventHandler onpschange;
+
+ /* Fired when the radiotext changes */
+ attribute EventHandler onrtchange;
+
+ /* Fired when we get a new RDS group */
+ attribute EventHandler onnewrdsgroup;
+
+ /**
+ * Power the FM radio off. The disabled event will be fired if this request
+ * completes successfully.
+ */
+ DOMRequest disable();
+
+ /**
+ * Power the FM radio on, and tune the radio to the given frequency in MHz.
+ * This will fail if the given frequency is out of range. The enabled event
+ * and frequencychange event will be fired if this request completes
+ * successfully.
+ */
+ DOMRequest enable(double frequency);
+
+ /**
+ * Tune the FM radio to the given frequency. This will fail if the given
+ * frequency is out of range.
+ *
+ * Note that the FM radio may not tuned to the exact frequency given. To get
+ * the frequency the radio is actually tuned to, wait for the request to fire
+ * sucess (or wait for the frequencychange event to fire), and then read the
+ * frequency attribute.
+ */
+ DOMRequest setFrequency(double frequency);
+
+ /**
+ * Tell the FM radio to seek up to the next channel. If the frequency is
+ * successfully changed, the frequencychange event will be triggered.
+ *
+ * Only one seek is allowed at once: If the radio is seeking when the seekUp
+ * is called, error will be fired.
+ */
+ DOMRequest seekUp();
+
+ /**
+ * Tell the FM radio to seek down to the next channel. If the frequency is
+ * successfully changed, the frequencychange event will be triggered.
+ *
+ * Only one seek is allowed at once: If the radio is seeking when the
+ * seekDown is called, error will be fired.
+ */
+ DOMRequest seekDown();
+
+ /**
+ * Cancel the seek action. If the radio is not currently seeking up or down,
+ * error will be fired.
+ */
+ DOMRequest cancelSeek();
+
+ /**
+ * Enable RDS reception.
+ *
+ * If the radio is off, RDS will be enabled when the radio is turned on.
+ */
+ DOMRequest enableRDS();
+
+ /**
+ * Disable RDS reception.
+ *
+ * If the radio is off, RDS will not be enabled when the radio is turned on.
+ */
+ DOMRequest disableRDS();
+};
+
diff --git a/dom/webidl/Fetch.webidl b/dom/webidl/Fetch.webidl
new file mode 100644
index 000000000..fb0221269
--- /dev/null
+++ b/dom/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> arrayBuffer();
+ [Throws]
+ Promise<Blob> blob();
+ // FIXME(nsm): Bug 739173 FormData is not supported in workers.
+ // Promise<FormData> formData();
+ [Throws]
+ Promise<JSON> json();
+ [Throws]
+ Promise<USVString> text();
+};
+
+[NoInterfaceObject, Exposed=(Window,Worker)]
+interface GlobalFetch {
+ [Throws, Func="mozilla::dom::Headers::PrefEnabled"]
+ Promise<Response> fetch(RequestInfo input, optional RequestInit init);
+};
+
diff --git a/dom/webidl/FetchEvent.webidl b/dom/webidl/FetchEvent.webidl
new file mode 100644
index 000000000..b02bcd8da
--- /dev/null
+++ b/dom/webidl/FetchEvent.webidl
@@ -0,0 +1,27 @@
+/* -*- 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/.
+ *
+ * For more information on this interface, please see
+ * http://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html
+ */
+
+[Constructor(DOMString type, optional FetchEventInit eventInitDict),
+ Func="mozilla::dom::workers::ServiceWorkerVisible",
+ Exposed=(ServiceWorker)]
+interface FetchEvent : Event {
+ readonly attribute Request request;
+ readonly attribute Client client; // The window issuing the request.
+ readonly attribute boolean isReload;
+
+ [Throws] void respondWith(Promise<Response> r);
+ Promise<Response> forwardTo(USVString url);
+ Promise<Response> default();
+};
+
+dictionary FetchEventInit : EventInit {
+ Request request;
+ Client client;
+ boolean isReload;
+};
diff --git a/dom/webidl/File.webidl b/dom/webidl/File.webidl
index f4d085e29..fe2e83d09 100644
--- a/dom/webidl/File.webidl
+++ b/dom/webidl/File.webidl
@@ -4,6 +4,47 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-dictionary FilePropertyBag : BlobPropertyBag {
- DOMString name = "";
+interface nsIFile;
+
+[Constructor(sequence<(ArrayBuffer or ArrayBufferView or Blob or DOMString)> fileBits,
+ USVString fileName, optional FilePropertyBag options),
+
+ // These constructors are just for chrome callers:
+ Constructor(Blob fileBits, optional ChromeFilePropertyBag options),
+ Constructor(nsIFile fileBits, optional ChromeFilePropertyBag options),
+ Constructor(USVString fileBits, optional ChromeFilePropertyBag options),
+
+ Exposed=(Window,Worker)]
+interface File : Blob {
+
+ readonly attribute DOMString name;
+
+ [GetterThrows]
+ readonly attribute long long lastModified;
+
+};
+
+
+dictionary FilePropertyBag {
+
+ DOMString type = "";
+ long long lastModified;
+
+};
+
+dictionary ChromeFilePropertyBag : FilePropertyBag {
+
+ DOMString name = "";
+ boolean temporary = false;
+};
+
+// Mozilla extensions
+partial interface File {
+
+ [GetterThrows]
+ readonly attribute Date lastModifiedDate;
+
+ [GetterThrows, ChromeOnly]
+ readonly attribute DOMString mozFullPath;
+
};
diff --git a/dom/webidl/FileList.webidl b/dom/webidl/FileList.webidl
index 7f5bcfa9c..84a56be1b 100644
--- a/dom/webidl/FileList.webidl
+++ b/dom/webidl/FileList.webidl
@@ -10,8 +10,6 @@
* liability, trademark and document use rules apply.
*/
-interface File;
-
interface FileList {
getter File? item(unsigned long index);
readonly attribute unsigned long length;
diff --git a/dom/webidl/FileReader.webidl b/dom/webidl/FileReader.webidl
index 3dffb9372..0032efeba 100644
--- a/dom/webidl/FileReader.webidl
+++ b/dom/webidl/FileReader.webidl
@@ -39,17 +39,11 @@ interface FileReader : EventTarget {
readonly attribute DOMError? error;
// event handler attributes
- [SetterThrows]
attribute EventHandler onloadstart;
- [SetterThrows]
attribute EventHandler onprogress;
- [SetterThrows]
attribute EventHandler onload;
- [SetterThrows]
attribute EventHandler onabort;
- [SetterThrows]
attribute EventHandler onerror;
- [SetterThrows]
attribute EventHandler onloadend;
};
diff --git a/dom/webidl/FileReaderSync.webidl b/dom/webidl/FileReaderSync.webidl
index 340506b17..8b586f4a7 100644
--- a/dom/webidl/FileReaderSync.webidl
+++ b/dom/webidl/FileReaderSync.webidl
@@ -10,9 +10,8 @@
* liability, trademark and document use rules apply.
*/
-interface Blob;
-
-[Constructor]
+[Constructor,
+ Exposed=Worker]
interface FileReaderSync {
// Synchronously return strings
diff --git a/dom/webidl/FontFace.webidl b/dom/webidl/FontFace.webidl
new file mode 100644
index 000000000..d4221a397
--- /dev/null
+++ b/dom/webidl/FontFace.webidl
@@ -0,0 +1,48 @@
+/* -*- 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://dev.w3.org/csswg/css-font-loading/#fontface-interface
+ *
+ * Copyright © 2014 W3C® (MIT, ERCIM, Keio, Beihang), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+typedef (ArrayBuffer or ArrayBufferView) BinaryData;
+
+dictionary FontFaceDescriptors {
+ DOMString style = "normal";
+ DOMString weight = "normal";
+ DOMString stretch = "normal";
+ DOMString unicodeRange = "U+0-10FFFF";
+ DOMString variant = "normal";
+ DOMString featureSettings = "normal";
+};
+
+enum FontFaceLoadStatus { "unloaded", "loading", "loaded", "error" };
+
+// Bug 1072107 is for exposing this in workers.
+// [Exposed=(Window,Worker)]
+[Constructor(DOMString family,
+ (DOMString or BinaryData) source,
+ optional FontFaceDescriptors descriptors),
+ Pref="layout.css.font-loading-api.enabled"]
+interface FontFace {
+ [SetterThrows] attribute DOMString family;
+ [SetterThrows] attribute DOMString style;
+ [SetterThrows] attribute DOMString weight;
+ [SetterThrows] attribute DOMString stretch;
+ [SetterThrows] attribute DOMString unicodeRange;
+ [SetterThrows] attribute DOMString variant;
+ [SetterThrows] attribute DOMString featureSettings;
+
+ readonly attribute FontFaceLoadStatus status;
+
+ [Throws]
+ Promise<FontFace> load();
+
+ [Throws]
+ readonly attribute Promise<FontFace> loaded;
+};
diff --git a/dom/webidl/FontFaceSet.webidl b/dom/webidl/FontFaceSet.webidl
new file mode 100644
index 000000000..68cf4b073
--- /dev/null
+++ b/dom/webidl/FontFaceSet.webidl
@@ -0,0 +1,63 @@
+/* -*- 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://dev.w3.org/csswg/css-font-loading/#FontFaceSet-interface
+ *
+ * Copyright © 2014 W3C® (MIT, ERCIM, Keio, Beihang), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+enum FontFaceSetLoadStatus { "loading", "loaded" };
+
+// Bug 1072762 is for the FontFaceSet constructor.
+// [Constructor(sequence<FontFace> initialFaces)]
+[Pref="layout.css.font-loading-api.enabled"]
+interface FontFaceSet : EventTarget {
+
+ // Emulate the Set interface, until we can extend Set correctly.
+ // Implementing these commented out operations and the iterator is
+ // bug 1072101.
+ // readonly attribute unsigned long size;
+ [Throws] void add(FontFace font);
+ boolean has(FontFace font);
+ [Throws] boolean delete(FontFace font);
+ void clear();
+ // Iterator entries();
+ // Iterator keys();
+ // Iterator values();
+ // void forEach(ForEachCallback cb, optional any thisArg);
+ // FontFace iterator;
+
+ // -- events for when loading state changes
+ attribute EventHandler onloading;
+ attribute EventHandler onloadingdone;
+ attribute EventHandler onloadingerror;
+
+ // check and start loads if appropriate
+ // and fulfill promise when all loads complete
+ // Not implemented yet: bug 1072102.
+ [Throws] Promise<sequence<FontFace>> load(DOMString font, optional DOMString text = " ");
+
+ // return whether all fonts in the fontlist are loaded
+ // (does not initiate load if not available)
+ // Not implemented yet: bug 1072102.
+ // [Throws] boolean check(DOMString font, optional DOMString text = " ");
+
+ // async notification that font loading and layout operations are done
+ [Throws] readonly attribute Promise<void> ready;
+
+ // loading state, "loading" while one or more fonts loading, "loaded" otherwise
+ readonly attribute FontFaceSetLoadStatus status;
+};
+
+// This provides access to the FontFace objects in the FontFaceSet until we
+// get iterators working (bug 1072101). Don't enable the pref for the CSS Font
+// Loading API until the iterator is available, as we don't want to expose more
+// indexed properties on the Web.
+partial interface FontFaceSet {
+ getter FontFace (unsigned long index);
+ readonly attribute unsigned long length;
+};
diff --git a/dom/webidl/FontFaceSource.webidl b/dom/webidl/FontFaceSource.webidl
new file mode 100644
index 000000000..e16f943f5
--- /dev/null
+++ b/dom/webidl/FontFaceSource.webidl
@@ -0,0 +1,18 @@
+/* -*- 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://dev.w3.org/csswg/css-font-loading/#font-face-source
+ *
+ * Copyright © 2014 W3C® (MIT, ERCIM, Keio, Beihang), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+[NoInterfaceObject]
+interface FontFaceSource {
+
+ [Throws, Pref="layout.css.font-loading-api.enabled"]
+ readonly attribute FontFaceSet fonts;
+};
diff --git a/dom/webidl/GainNode.webidl b/dom/webidl/GainNode.webidl
index 8c561a592..56ba0bda0 100644
--- a/dom/webidl/GainNode.webidl
+++ b/dom/webidl/GainNode.webidl
@@ -10,10 +10,12 @@
* liability, trademark and document use rules apply.
*/
-[PrefControlled]
interface GainNode : AudioNode {
readonly attribute AudioParam gain;
};
+// Mozilla extension
+GainNode implements AudioNodePassThrough;
+
diff --git a/dom/webidl/Gamepad.webidl b/dom/webidl/Gamepad.webidl
index 4089dd86a..9779c71b8 100644
--- a/dom/webidl/Gamepad.webidl
+++ b/dom/webidl/Gamepad.webidl
@@ -3,7 +3,16 @@
* 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/. */
-interface nsIVariant;
+[Pref="dom.gamepad.enabled"]
+interface GamepadButton {
+ readonly attribute boolean pressed;
+ readonly attribute double value;
+};
+
+enum GamepadMappingType {
+ "",
+ "standard"
+};
[Pref="dom.gamepad.enabled"]
interface Gamepad {
@@ -22,7 +31,7 @@ interface Gamepad {
* The mapping in use for this device. The empty string
* indicates that no mapping is in use.
*/
- readonly attribute DOMString mapping;
+ readonly attribute GamepadMappingType mapping;
/**
* true if this gamepad is currently connected to the system.
@@ -31,15 +40,20 @@ interface Gamepad {
/**
* The current state of all buttons on the device, an
- * array of doubles.
+ * array of GamepadButton.
*/
- [Throws]
- readonly attribute nsIVariant buttons;
+ [Pure, Cached, Frozen]
+ readonly attribute sequence<GamepadButton> buttons;
/**
* The current position of all axes on the device, an
* array of doubles.
*/
- [Throws]
- readonly attribute nsIVariant axes;
+ [Pure, Cached, Frozen]
+ readonly attribute sequence<double> axes;
+
+ /**
+ * Timestamp from when the data of this device was last updated.
+ */
+ readonly attribute DOMHighResTimeStamp timestamp;
};
diff --git a/dom/webidl/GamepadAxisMoveEvent.webidl b/dom/webidl/GamepadAxisMoveEvent.webidl
index 4bc9d3bae..7699674b4 100644
--- a/dom/webidl/GamepadAxisMoveEvent.webidl
+++ b/dom/webidl/GamepadAxisMoveEvent.webidl
@@ -5,8 +5,7 @@
*/
[Pref="dom.gamepad.non_standard_events.enabled",
- Constructor(DOMString type, optional GamepadAxisMoveEventInit eventInitDict),
- HeaderFile="GeneratedEventClasses.h"]
+ Constructor(DOMString type, optional GamepadAxisMoveEventInit eventInitDict)]
interface GamepadAxisMoveEvent : GamepadEvent
{
readonly attribute unsigned long axis;
diff --git a/dom/webidl/GamepadButtonEvent.webidl b/dom/webidl/GamepadButtonEvent.webidl
index 24e5e0a7c..b8a9e086b 100644
--- a/dom/webidl/GamepadButtonEvent.webidl
+++ b/dom/webidl/GamepadButtonEvent.webidl
@@ -5,8 +5,7 @@
*/
[Pref="dom.gamepad.non_standard_events.enabled",
- Constructor(DOMString type, optional GamepadButtonEventInit eventInitDict),
- HeaderFile="GeneratedEventClasses.h"]
+ Constructor(DOMString type, optional GamepadButtonEventInit eventInitDict)]
interface GamepadButtonEvent : GamepadEvent
{
readonly attribute unsigned long button;
diff --git a/dom/webidl/GamepadEvent.webidl b/dom/webidl/GamepadEvent.webidl
index 15b2209f6..f4c3092ac 100644
--- a/dom/webidl/GamepadEvent.webidl
+++ b/dom/webidl/GamepadEvent.webidl
@@ -5,8 +5,7 @@
*/
[Pref="dom.gamepad.enabled",
- Constructor(DOMString type, optional GamepadEventInit eventInitDict),
- HeaderFile="GeneratedEventClasses.h"]
+ Constructor(DOMString type, optional GamepadEventInit eventInitDict)]
interface GamepadEvent : Event
{
readonly attribute Gamepad? gamepad;
diff --git a/dom/webidl/Geolocation.webidl b/dom/webidl/Geolocation.webidl
index adf13a80c..aa284f07c 100644
--- a/dom/webidl/Geolocation.webidl
+++ b/dom/webidl/Geolocation.webidl
@@ -13,10 +13,10 @@
dictionary PositionOptions {
boolean enableHighAccuracy = false;
long timeout = 0x7fffffff;
- long maximumAge = 30000; /* non-conformant, should be 0 */
+ long maximumAge = 0;
};
-[NoInterfaceObject, Pref="geo.enabled"]
+[NoInterfaceObject]
interface Geolocation {
[Throws]
void getCurrentPosition(PositionCallback successCallback,
diff --git a/dom/webidl/GeometryUtils.webidl b/dom/webidl/GeometryUtils.webidl
new file mode 100644
index 000000000..7a468baa1
--- /dev/null
+++ b/dom/webidl/GeometryUtils.webidl
@@ -0,0 +1,38 @@
+/* -*- 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://dev.w3.org/csswg/cssom-view/
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+enum CSSBoxType { "margin", "border", "padding", "content" };
+dictionary BoxQuadOptions {
+ CSSBoxType box = "border";
+ GeometryNode relativeTo;
+};
+
+dictionary ConvertCoordinateOptions {
+ CSSBoxType fromBox = "border";
+ CSSBoxType toBox = "border";
+};
+
+[NoInterfaceObject]
+interface GeometryUtils {
+ [Throws, Func="nsINode::HasBoxQuadsSupport"]
+ sequence<DOMQuad> getBoxQuads(optional BoxQuadOptions options);
+ [Throws, Pref="layout.css.convertFromNode.enabled"]
+ DOMQuad convertQuadFromNode(DOMQuad quad, GeometryNode from, optional ConvertCoordinateOptions options);
+ [Throws, Pref="layout.css.convertFromNode.enabled"]
+ DOMQuad convertRectFromNode(DOMRectReadOnly rect, GeometryNode from, optional ConvertCoordinateOptions options);
+ [Throws, Pref="layout.css.convertFromNode.enabled"]
+ DOMPoint convertPointFromNode(DOMPointInit point, GeometryNode from, optional ConvertCoordinateOptions options);
+};
+
+// PseudoElement implements GeometryUtils;
+
+typedef (Text or Element /* or PseudoElement */ or Document) GeometryNode;
diff --git a/dom/webidl/GetUserMediaRequest.webidl b/dom/webidl/GetUserMediaRequest.webidl
new file mode 100644
index 000000000..9fd378e6e
--- /dev/null
+++ b/dom/webidl/GetUserMediaRequest.webidl
@@ -0,0 +1,16 @@
+/* -*- 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/.
+ *
+ * This is an internal IDL file
+ */
+
+[NoInterfaceObject]
+interface GetUserMediaRequest {
+ readonly attribute unsigned long long windowID;
+ readonly attribute unsigned long long innerWindowID;
+ readonly attribute DOMString callID;
+ MediaStreamConstraints getConstraints();
+ readonly attribute boolean isSecure;
+};
diff --git a/dom/webidl/HTMLAllCollection.webidl b/dom/webidl/HTMLAllCollection.webidl
new file mode 100644
index 000000000..433ad2aa5
--- /dev/null
+++ b/dom/webidl/HTMLAllCollection.webidl
@@ -0,0 +1,13 @@
+/* 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/. */
+
+/* Emulates undefined through Codegen.py. */
+interface HTMLAllCollection {
+ readonly attribute unsigned long length;
+ getter Node? (unsigned long index);
+ Node? item(unsigned long index);
+ (Node or HTMLCollection)? item(DOMString name);
+ legacycaller (Node or HTMLCollection)? (DOMString name);
+ getter (Node or HTMLCollection)? namedItem(DOMString name);
+};
diff --git a/dom/webidl/HTMLAnchorElement.webidl b/dom/webidl/HTMLAnchorElement.webidl
index 9d253bc8c..1fe81048f 100644
--- a/dom/webidl/HTMLAnchorElement.webidl
+++ b/dom/webidl/HTMLAnchorElement.webidl
@@ -21,8 +21,7 @@ interface HTMLAnchorElement : HTMLElement {
attribute DOMString ping;
[SetterThrows]
attribute DOMString rel;
- // relList not supported yet
- //readonly attribute DOMTokenList relList;
+ readonly attribute DOMTokenList relList;
[SetterThrows]
attribute DOMString hreflang;
[SetterThrows]
@@ -32,6 +31,7 @@ interface HTMLAnchorElement : HTMLElement {
attribute DOMString text;
};
HTMLAnchorElement implements URLUtils;
+HTMLAnchorElement implements URLUtilsSearchParams;
// http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
partial interface HTMLAnchorElement {
diff --git a/dom/webidl/HTMLAppletElement.webidl b/dom/webidl/HTMLAppletElement.webidl
index d28059895..d75c42d15 100644
--- a/dom/webidl/HTMLAppletElement.webidl
+++ b/dom/webidl/HTMLAppletElement.webidl
@@ -12,7 +12,7 @@
*/
// http://www.whatwg.org/specs/web-apps/current-work/#the-applet-element
-[NeedNewResolve]
+[NeedResolve, UnsafeInPrerendering]
interface HTMLAppletElement : HTMLElement {
[Pure, SetterThrows]
attribute DOMString align;
diff --git a/dom/webidl/HTMLAreaElement.webidl b/dom/webidl/HTMLAreaElement.webidl
index b5437f54c..69ff48b12 100644
--- a/dom/webidl/HTMLAreaElement.webidl
+++ b/dom/webidl/HTMLAreaElement.webidl
@@ -26,11 +26,11 @@ interface HTMLAreaElement : HTMLElement {
attribute DOMString download;
[SetterThrows]
attribute DOMString ping;
+ [SetterThrows]
+ attribute DOMString rel;
+ readonly attribute DOMTokenList relList;
// not implemented.
- // [SetterThrows]
- // attribute DOMString rel;
- //readonly attribute DOMTokenList relList;
//
// [SetterThrows]
// attribute DOMString hreflang;
@@ -38,6 +38,7 @@ interface HTMLAreaElement : HTMLElement {
// attribute DOMString type;
};
HTMLAreaElement implements URLUtils;
+HTMLAreaElement implements URLUtilsSearchParams;
// http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
partial interface HTMLAreaElement {
diff --git a/dom/webidl/HTMLAudioElement.webidl b/dom/webidl/HTMLAudioElement.webidl
index 6a6907ffe..8537453c0 100644
--- a/dom/webidl/HTMLAudioElement.webidl
+++ b/dom/webidl/HTMLAudioElement.webidl
@@ -14,20 +14,3 @@
[NamedConstructor=Audio(optional DOMString src)]
interface HTMLAudioElement : HTMLMediaElement {};
-partial interface HTMLAudioElement
-{
- // Setup the audio stream for writing
- [Pref="media.audio_data.enabled", Throws]
- void mozSetup(unsigned long channels, unsigned long rate);
-
- // Write audio to the audio stream
- [Pref="media.audio_data.enabled", Throws]
- unsigned long mozWriteAudio(Float32Array data);
- [Pref="media.audio_data.enabled", Throws]
- unsigned long mozWriteAudio(sequence<unrestricted float> data);
-
- // Get the current offset (measured in samples since the start) of the audio
- // stream created using mozWriteAudio().
- [Pref="media.audio_data.enabled", Throws]
- unsigned long long mozCurrentSampleOffset();
-};
diff --git a/dom/webidl/HTMLCanvasElement.webidl b/dom/webidl/HTMLCanvasElement.webidl
index 8f298dc8b..48c1bd5c1 100644
--- a/dom/webidl/HTMLCanvasElement.webidl
+++ b/dom/webidl/HTMLCanvasElement.webidl
@@ -10,11 +10,8 @@
* and create derivative works of this document.
*/
-interface Blob;
-interface FileCallback;
interface nsIInputStreamCallback;
interface nsISupports;
-interface PrintCallback;
interface Variant;
interface HTMLCanvasElement : HTMLElement {
@@ -30,7 +27,9 @@ interface HTMLCanvasElement : HTMLElement {
DOMString toDataURL(optional DOMString type = "",
optional any encoderOptions);
[Throws]
- void toBlob(FileCallback _callback, optional DOMString type = "");
+ void toBlob(FileCallback _callback,
+ optional DOMString type = "",
+ optional any encoderOptions);
};
// Mozilla specific bits
@@ -45,3 +44,17 @@ partial interface HTMLCanvasElement {
void mozFetchAsStream(nsIInputStreamCallback callback, optional DOMString? type = null);
attribute PrintCallback? mozPrintCallback;
};
+
+[ChromeOnly]
+interface MozCanvasPrintState
+{
+ // A canvas rendering context.
+ readonly attribute nsISupports context;
+
+ // To be called when rendering to the context is done.
+ void done();
+};
+
+callback PrintCallback = void(MozCanvasPrintState ctx);
+
+callback FileCallback = void(Blob file);
diff --git a/dom/webidl/HTMLCollection.webidl b/dom/webidl/HTMLCollection.webidl
index 1e56c3c01..178986a86 100644
--- a/dom/webidl/HTMLCollection.webidl
+++ b/dom/webidl/HTMLCollection.webidl
@@ -13,6 +13,5 @@
interface HTMLCollection {
readonly attribute unsigned long length;
getter Element? item(unsigned long index);
- [Throws]
- getter object? namedItem(DOMString name); // only returns Element
+ getter Element? namedItem(DOMString name);
};
diff --git a/dom/webidl/HTMLContentElement.webidl b/dom/webidl/HTMLContentElement.webidl
new file mode 100644
index 000000000..100dc0b14
--- /dev/null
+++ b/dom/webidl/HTMLContentElement.webidl
@@ -0,0 +1,19 @@
+/* -*- 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
+ * https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html
+ *
+ * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
+ * Opera Software ASA. You are granted a license to use, reproduce
+ * and create derivative works of this document.
+ */
+
+interface HTMLContentElement : HTMLElement
+{
+ attribute DOMString select;
+ NodeList getDistributedNodes();
+};
+
diff --git a/dom/webidl/HTMLDocument.webidl b/dom/webidl/HTMLDocument.webidl
index 9f8144a14..72516e885 100644
--- a/dom/webidl/HTMLDocument.webidl
+++ b/dom/webidl/HTMLDocument.webidl
@@ -4,25 +4,30 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-interface Selection;
-
[OverrideBuiltins]
interface HTMLDocument : Document {
- [Throws]
+ [SetterThrows]
attribute DOMString? domain;
[Throws]
attribute DOMString cookie;
// DOM tree accessors
[Throws]
getter object (DOMString name);
- [SetterThrows]
+ [Pure, SetterThrows]
attribute HTMLElement? body;
+ [Pure]
readonly attribute HTMLHeadElement? head;
+ [Pure]
readonly attribute HTMLCollection images;
+ [Pure]
readonly attribute HTMLCollection embeds;
+ [Pure]
readonly attribute HTMLCollection plugins;
+ [Pure]
readonly attribute HTMLCollection links;
+ [Pure]
readonly attribute HTMLCollection forms;
+ [Pure]
readonly attribute HTMLCollection scripts;
NodeList getElementsByName(DOMString elementName);
NodeList getItems(optional DOMString typeNames = ""); // microdata
@@ -60,22 +65,38 @@ interface HTMLDocument : Document {
[TreatNullAs=EmptyString] attribute DOMString alinkColor;
[TreatNullAs=EmptyString] attribute DOMString bgColor;
+ [Pure]
readonly attribute HTMLCollection anchors;
+ [Pure]
readonly attribute HTMLCollection applets;
void clear();
- [Throws]
- readonly attribute object all;
+ readonly attribute HTMLAllCollection all;
// https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#selections
[Throws]
- Selection getSelection();
+ Selection? getSelection();
// @deprecated These are old Netscape 4 methods. Do not use,
// the implementation is no-op.
// XXXbz do we actually need these anymore?
- void captureEvents(long eventFlags);
- void releaseEvents(long eventFlags);
- void routeEvent(Event evt);
+ void captureEvents();
+ void releaseEvents();
+};
+
+partial interface HTMLDocument {
+ /*
+ * Number of nodes that have been blocked by
+ * the Safebrowsing API to prevent tracking.
+ */
+ [ChromeOnly, Pure]
+ readonly attribute long blockedTrackingNodeCount;
+
+ /*
+ * List of nodes that have been blocked by
+ * the Safebrowsing API to prevent tracking.
+ */
+ [ChromeOnly, Pure]
+ readonly attribute NodeList blockedTrackingNodes;
};
diff --git a/dom/webidl/HTMLElement.webidl b/dom/webidl/HTMLElement.webidl
index 781c75a79..8399c1e7c 100644
--- a/dom/webidl/HTMLElement.webidl
+++ b/dom/webidl/HTMLElement.webidl
@@ -76,14 +76,8 @@ interface HTMLElement : Element {
readonly attribute CSSStyleDeclaration style;
// Mozilla specific stuff
- // FIXME Bug 810677 Move className from HTMLElement to Element
- attribute DOMString className;
-
- [SetterThrows]
attribute EventHandler oncopy;
- [SetterThrows]
attribute EventHandler oncut;
- [SetterThrows]
attribute EventHandler onpaste;
};
@@ -97,24 +91,27 @@ partial interface HTMLElement {
readonly attribute long offsetHeight;
};
+// Extension for scroll-grabbing, used in the B2G dynamic toolbar.
+// This is likely to be revised.
+partial interface HTMLElement {
+ [Func="nsGenericHTMLElement::IsScrollGrabAllowed"]
+ attribute boolean scrollgrab;
+};
+
[NoInterfaceObject]
interface TouchEventHandlers {
- [SetterThrows,Func="nsGenericHTMLElement::TouchEventsEnabled"]
+ [Func="nsGenericHTMLElement::TouchEventsEnabled"]
attribute EventHandler ontouchstart;
- [SetterThrows,Func="nsGenericHTMLElement::TouchEventsEnabled"]
+ [Func="nsGenericHTMLElement::TouchEventsEnabled"]
attribute EventHandler ontouchend;
- [SetterThrows,Func="nsGenericHTMLElement::TouchEventsEnabled"]
+ [Func="nsGenericHTMLElement::TouchEventsEnabled"]
attribute EventHandler ontouchmove;
- [SetterThrows,Func="nsGenericHTMLElement::TouchEventsEnabled"]
- attribute EventHandler ontouchenter;
- [SetterThrows,Func="nsGenericHTMLElement::TouchEventsEnabled"]
- attribute EventHandler ontouchleave;
- [SetterThrows,Func="nsGenericHTMLElement::TouchEventsEnabled"]
+ [Func="nsGenericHTMLElement::TouchEventsEnabled"]
attribute EventHandler ontouchcancel;
};
HTMLElement implements GlobalEventHandlers;
-HTMLElement implements NodeEventHandlers;
HTMLElement implements TouchEventHandlers;
+HTMLElement implements OnErrorEventHandlerForNodes;
interface HTMLUnknownElement : HTMLElement {};
diff --git a/dom/webidl/HTMLEmbedElement.webidl b/dom/webidl/HTMLEmbedElement.webidl
index 460f99e4b..062848d8d 100644
--- a/dom/webidl/HTMLEmbedElement.webidl
+++ b/dom/webidl/HTMLEmbedElement.webidl
@@ -13,7 +13,7 @@
*/
// http://www.whatwg.org/specs/web-apps/current-work/#the-embed-element
-[NeedNewResolve]
+[NeedResolve]
interface HTMLEmbedElement : HTMLElement {
[Pure, SetterThrows]
attribute DOMString src;
diff --git a/dom/webidl/HTMLFormControlsCollection.webidl b/dom/webidl/HTMLFormControlsCollection.webidl
new file mode 100644
index 000000000..eb2d83d42
--- /dev/null
+++ b/dom/webidl/HTMLFormControlsCollection.webidl
@@ -0,0 +1,17 @@
+/* -*- 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.whatwg.org/specs/web-apps/current-work/#htmlformcontrolscollection
+ *
+ * © Copyright 2004-2013 Apple Computer, Inc., Mozilla Foundation, and
+ * Opera Software ASA. You are granted a license to use, reproduce
+ * and create derivative works of this document.
+ */
+
+interface HTMLFormControlsCollection : HTMLCollection {
+ // inherits length and item()
+ /* legacycaller */ getter (RadioNodeList or Element)? namedItem(DOMString name); // shadows inherited namedItem()
+};
diff --git a/dom/webidl/HTMLFormElement.webidl b/dom/webidl/HTMLFormElement.webidl
index b82354cca..1581d19fd 100644
--- a/dom/webidl/HTMLFormElement.webidl
+++ b/dom/webidl/HTMLFormElement.webidl
@@ -45,4 +45,7 @@ interface HTMLFormElement : HTMLElement {
void submit();
void reset();
boolean checkValidity();
+
+ [Pref="dom.forms.requestAutocomplete"]
+ void requestAutocomplete();
};
diff --git a/dom/webidl/HTMLIFrameElement.webidl b/dom/webidl/HTMLIFrameElement.webidl
index 1f68b0e4c..ec8e7676f 100644
--- a/dom/webidl/HTMLIFrameElement.webidl
+++ b/dom/webidl/HTMLIFrameElement.webidl
@@ -18,9 +18,7 @@ interface HTMLIFrameElement : HTMLElement {
attribute DOMString srcdoc;
[SetterThrows, Pure]
attribute DOMString name;
- // [PutForwards=value] readonly attribute DOMSettableTokenList sandbox;
- // We're implementing sandbox as a string for now, see bug 845057.
- attribute DOMString sandbox;
+ [PutForwards=value] readonly attribute DOMSettableTokenList sandbox;
// attribute boolean seamless;
[SetterThrows, Pure]
attribute boolean allowFullscreen;
@@ -65,3 +63,4 @@ partial interface HTMLIFrameElement {
};
HTMLIFrameElement implements MozFrameLoaderOwner;
+HTMLIFrameElement implements BrowserElement;
diff --git a/dom/webidl/HTMLImageElement.webidl b/dom/webidl/HTMLImageElement.webidl
index bd95f227e..fce3c7cdf 100644
--- a/dom/webidl/HTMLImageElement.webidl
+++ b/dom/webidl/HTMLImageElement.webidl
@@ -23,9 +23,10 @@ interface HTMLImageElement : HTMLElement {
attribute DOMString alt;
[SetterThrows]
attribute DOMString src;
-// attribute DOMString srcset;
+ [SetterThrows, Pref="dom.image.srcset.enabled"]
+ attribute DOMString srcset;
[SetterThrows]
- attribute DOMString crossOrigin;
+ attribute DOMString? crossOrigin;
[SetterThrows]
attribute DOMString useMap;
[SetterThrows]
@@ -55,6 +56,15 @@ partial interface HTMLImageElement {
[TreatNullAs=EmptyString,SetterThrows] attribute DOMString border;
};
+// [Update me: not in whatwg spec yet]
+// http://picture.responsiveimages.org/#the-img-element
+partial interface HTMLImageElement {
+ [SetterThrows, Pref="dom.image.picture.enabled"]
+ attribute DOMString sizes;
+ [Pref="dom.image.srcset.enabled"]
+ readonly attribute DOMString currentSrc;
+};
+
// Mozilla extensions.
partial interface HTMLImageElement {
attribute DOMString lowsrc;
@@ -93,7 +103,7 @@ interface MozImageLoadingContent {
[ChromeOnly,Throws]
nsIStreamListener? loadImageWithChannel(MozChannel aChannel);
[ChromeOnly,Throws]
- void forceReload();
+ void forceReload(optional boolean aNotify);
[ChromeOnly]
void forceImageState(boolean aForce, unsigned long long aState);
};
diff --git a/dom/webidl/HTMLInputElement.webidl b/dom/webidl/HTMLInputElement.webidl
index 3bc903636..dbddb23e7 100644
--- a/dom/webidl/HTMLInputElement.webidl
+++ b/dom/webidl/HTMLInputElement.webidl
@@ -12,6 +12,13 @@
* and create derivative works of this document.
*/
+enum SelectionMode {
+ "select",
+ "start",
+ "end",
+ "preserve",
+};
+
interface nsIControllers;
interface HTMLInputElement : HTMLElement {
@@ -33,6 +40,8 @@ interface HTMLInputElement : HTMLElement {
readonly attribute HTMLFormElement? form;
[Pure]
readonly attribute FileList? files;
+ [Throws, Pref="dom.input.dirpicker"]
+ void openDirectoryPicker();
[Pure, SetterThrows]
attribute DOMString formAction;
[Pure, SetterThrows]
@@ -112,8 +121,11 @@ interface HTMLInputElement : HTMLElement {
attribute long selectionEnd;
[Throws]
attribute DOMString selectionDirection;
- // Bug 850364 void setRangeText(DOMString replacement);
- // Bug 850364 setRangeText(DOMString replacement, unsigned long start, unsigned long end, optional SelectionMode selectionMode);
+ [Throws]
+ void setRangeText(DOMString replacement);
+ [Throws]
+ void setRangeText(DOMString replacement, unsigned long start,
+ unsigned long end, optional SelectionMode selectionMode = "preserve");
// also has obsolete members
};
@@ -131,7 +143,7 @@ partial interface HTMLInputElement {
[Throws]
void setSelectionRange(long start, long end, optional DOMString direction);
- [GetterThrows]
+ [GetterThrows, ChromeOnly]
readonly attribute nsIControllers controllers;
[GetterThrows]
readonly attribute long textLength;
@@ -142,7 +154,27 @@ partial interface HTMLInputElement {
[ChromeOnly]
void mozSetFileNameArray(sequence<DOMString> fileNames);
+ [ChromeOnly]
+ void mozSetFileArray(sequence<File> files);
+
+ // Number controls (<input type=number>) have an anonymous text control
+ // (<input type=text>) in the anonymous shadow tree that they contain. On
+ // such an anonymous text control this property provides access to the
+ // number control that owns the text control. This is useful, for example,
+ // in code that looks at the currently focused element to make decisions
+ // about which IME to bring up. Such code needs to be able to check for any
+ // owning number control since it probably wants to bring up a number pad
+ // instead of the standard keyboard, even when the anonymous text control has
+ // focus.
+ [ChromeOnly]
+ readonly attribute HTMLInputElement? ownerNumberControl;
+
boolean mozIsTextField(boolean aExcludePassword);
+
+ [ChromeOnly]
+ // This function will return null if @autocomplete is not defined for the
+ // current @type
+ AutocompleteInfo? getAutocompleteInfo();
};
partial interface HTMLInputElement {
diff --git a/dom/webidl/HTMLLegendElement.webidl b/dom/webidl/HTMLLegendElement.webidl
index b13da7e54..0ce4ae88b 100644
--- a/dom/webidl/HTMLLegendElement.webidl
+++ b/dom/webidl/HTMLLegendElement.webidl
@@ -19,5 +19,6 @@ interface HTMLLegendElement : HTMLElement {
// http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
partial interface HTMLLegendElement {
+ [SetterThrows]
attribute DOMString align;
};
diff --git a/dom/webidl/HTMLLinkElement.webidl b/dom/webidl/HTMLLinkElement.webidl
index b0ca0ddad..32cfb518c 100644
--- a/dom/webidl/HTMLLinkElement.webidl
+++ b/dom/webidl/HTMLLinkElement.webidl
@@ -18,19 +18,17 @@ interface HTMLLinkElement : HTMLElement {
[SetterThrows, Pure]
attribute DOMString href;
[SetterThrows, Pure]
- attribute DOMString crossOrigin;
+ attribute DOMString? crossOrigin;
[SetterThrows, Pure]
attribute DOMString rel;
-// Not supported yet:
-// readonly attribute DOMTokenList relList;
+ readonly attribute DOMTokenList relList;
[SetterThrows, Pure]
attribute DOMString media;
[SetterThrows, Pure]
attribute DOMString hreflang;
[SetterThrows, Pure]
attribute DOMString type;
-// Not supported yet:
-// [PutForwards=value] readonly attribute DOMSettableTokenList sizes;
+ [PutForwards=value] readonly attribute DOMSettableTokenList sizes;
};
HTMLLinkElement implements LinkStyle;
@@ -43,3 +41,10 @@ partial interface HTMLLinkElement {
[SetterThrows, Pure]
attribute DOMString target;
};
+
+// http://w3c.github.io/webcomponents/spec/imports/#interface-import
+partial interface HTMLLinkElement {
+ [Func="nsDocument::IsWebComponentsEnabled"]
+ readonly attribute Document? import;
+};
+
diff --git a/dom/webidl/HTMLMediaElement.webidl b/dom/webidl/HTMLMediaElement.webidl
index 5704bf897..42902459e 100644
--- a/dom/webidl/HTMLMediaElement.webidl
+++ b/dom/webidl/HTMLMediaElement.webidl
@@ -22,7 +22,7 @@ interface HTMLMediaElement : HTMLElement {
readonly attribute DOMString currentSrc;
[SetterThrows]
- attribute DOMString crossOrigin;
+ attribute DOMString? crossOrigin;
const unsigned short NETWORK_EMPTY = 0;
const unsigned short NETWORK_IDLE = 1;
const unsigned short NETWORK_LOADING = 2;
@@ -30,7 +30,7 @@ interface HTMLMediaElement : HTMLElement {
readonly attribute unsigned short networkState;
[SetterThrows]
attribute DOMString preload;
- [Creator]
+ [NewObject]
readonly attribute TimeRanges buffered;
void load();
DOMString canPlayType(DOMString type);
@@ -47,17 +47,20 @@ interface HTMLMediaElement : HTMLElement {
// playback state
[SetterThrows]
attribute double currentTime;
- // TODO: Bug 847375 - void fastSeek(double time);
+ [Throws]
+ void fastSeek(double time);
readonly attribute unrestricted double duration;
+ [ChromeOnly]
+ readonly attribute boolean isEncrypted;
// TODO: Bug 847376 - readonly attribute any startDate;
readonly attribute boolean paused;
[SetterThrows]
attribute double defaultPlaybackRate;
[SetterThrows]
attribute double playbackRate;
- [Creator]
+ [NewObject]
readonly attribute TimeRanges played;
- [Creator]
+ [NewObject]
readonly attribute TimeRanges seekable;
readonly attribute boolean ended;
[SetterThrows]
@@ -85,10 +88,12 @@ interface HTMLMediaElement : HTMLElement {
// TODO: Bug 847379
// tracks
- //readonly attribute AudioTrackList audioTracks;
- //readonly attribute VideoTrackList videoTracks;
+ [Pref="media.track.enabled"]
+ readonly attribute AudioTrackList audioTracks;
+ [Pref="media.track.enabled"]
+ readonly attribute VideoTrackList videoTracks;
[Pref="media.webvtt.enabled"]
- readonly attribute TextTrackList textTracks;
+ readonly attribute TextTrackList? textTracks;
[Pref="media.webvtt.enabled"]
TextTrack addTextTrack(TextTrackKind kind,
optional DOMString label = "",
@@ -97,30 +102,24 @@ interface HTMLMediaElement : HTMLElement {
// Mozilla extensions:
partial interface HTMLMediaElement {
+ [ChromeOnly]
+ readonly attribute MediaSource? mozMediaSourceObject;
attribute MediaStream? mozSrcObject;
attribute boolean mozPreservesPitch;
readonly attribute boolean mozAutoplayEnabled;
+ // NB: for internal use with the video controls:
+ [Func="IsChromeOrXBL"] attribute boolean mozMediaStatisticsShowing;
+ [Func="IsChromeOrXBL"] attribute boolean mozAllowCasting;
+ [Func="IsChromeOrXBL"] attribute boolean mozIsCasting;
+
// Mozilla extension: stream capture
- [Throws]
+ [Throws, UnsafeInPrerendering]
MediaStream mozCaptureStream();
- [Throws]
+ [Throws, UnsafeInPrerendering]
MediaStream mozCaptureStreamUntilEnded();
readonly attribute boolean mozAudioCaptured;
- // Mozilla extension: extra stream metadata information, used as part
- // of MozAudioAvailable events and the mozWriteAudio() method. The
- // mozFrameBufferLength method allows for the size of the framebuffer
- // used within MozAudioAvailable events to be changed. The new size must
- // be between 512 and 16384. The default size, for a media element with
- // audio is (mozChannels * 1024).
- [GetterThrows]
- readonly attribute unsigned long mozChannels;
- [GetterThrows]
- readonly attribute unsigned long mozSampleRate;
- [Throws]
- attribute unsigned long mozFrameBufferLength;
-
// Mozilla extension: return embedded metadata from the stream as a
// JSObject with key:value pairs for each tag. This can be used by
// player interfaces to display the song title, artist, etc.
@@ -133,39 +132,9 @@ partial interface HTMLMediaElement {
readonly attribute double mozFragmentEnd;
// Mozilla extension: an audio channel type for media elements.
- // An exception is thrown if the app tries to change the audio channel type
- // without the permission (manifest file for B2G apps).
- // The supported values are:
- // * normal (default value)
- // Automatically paused if "notification" or higher priority channel
- // is played
- // Use case: normal applications
- // * content
- // Automatically paused if "notification" or higher priority channel
- // is played. Also paused if another app starts using "content"
- // channel. Using this channel never affects applications using
- // the "normal" channel.
- // Use case: video/audio players
- // * notification
- // Automatically paused if "alarm" or higher priority channel is played.
- // Use case: New email, incoming SMS
- // * alarm
- // Automatically paused if "telephony" or higher priority channel is
- // played.
- // User case: Alarm clock, calendar alarms
- // * telephony
- // Automatically paused if "ringer" or higher priority
- // channel is played.
- // Use case: dialer, voip
- // * ringer
- // Automatically paused if "publicnotification" or higher priority
- // channel is played.
- // Use case: dialer, voip
- // * publicnotification
- // Always plays in speaker, even when headphones are plugged in.
- // Use case: Camera shutter sound.
+ // Read AudioChannel.webidl for more information about this attribute.
[SetterThrows]
- attribute DOMString mozAudioChannelType;
+ attribute AudioChannel mozAudioChannelType;
// In addition the media element has this new events:
// * onmozinterruptbegin - called when the media element is interrupted
diff --git a/dom/webidl/HTMLMenuElement.webidl b/dom/webidl/HTMLMenuElement.webidl
index 5ee2e66e3..ff81a7c80 100644
--- a/dom/webidl/HTMLMenuElement.webidl
+++ b/dom/webidl/HTMLMenuElement.webidl
@@ -40,11 +40,11 @@ partial interface HTMLMenuElement {
/**
* Creates a native menu builder. The builder type is dependent on menu type.
- * Currently, it returns nsXULContextMenuBuilder for context menus.
- * Toolbar menus are not yet supported (the method returns null).
+ * Currently, it returns the @mozilla.org/content/html-menu-builder;1
+ * component. Toolbar menus are not yet supported (the method returns null).
*/
[ChromeOnly]
- MenuBuilder createBuilder();
+ MenuBuilder? createBuilder();
/*
* Builds a menu by iterating over menu children.
diff --git a/dom/webidl/HTMLObjectElement.webidl b/dom/webidl/HTMLObjectElement.webidl
index 6ab56eeba..e3836e6d7 100644
--- a/dom/webidl/HTMLObjectElement.webidl
+++ b/dom/webidl/HTMLObjectElement.webidl
@@ -13,13 +13,14 @@
*/
// http://www.whatwg.org/specs/web-apps/current-work/#the-object-element
-[NeedNewResolve]
+[NeedResolve, UnsafeInPrerendering]
interface HTMLObjectElement : HTMLElement {
[Pure, SetterThrows]
attribute DOMString data;
[Pure, SetterThrows]
attribute DOMString type;
-// attribute boolean typeMustMatch;
+ [Pure, SetterThrows]
+ attribute boolean typeMustMatch;
[Pure, SetterThrows]
attribute DOMString name;
[Pure, SetterThrows]
@@ -154,6 +155,13 @@ interface MozObjectLoadingContent {
[ChromeOnly]
unsigned long getContentTypeForMIMEType(DOMString aMimeType);
+
+ [ChromeOnly]
+ sequence<MozPluginParameter> getPluginAttributes();
+
+ [ChromeOnly]
+ sequence<MozPluginParameter> getPluginParameters();
+
/**
* This method will play a plugin that has been stopped by the
* click-to-play plugins or play-preview features.
@@ -162,6 +170,15 @@ interface MozObjectLoadingContent {
void playPlugin();
/**
+ * Forces a re-evaluation and reload of the tag, optionally invalidating its
+ * click-to-play state. This can be used when the MIME type that provides a
+ * type has changed, for instance, to force the tag to re-evalulate the
+ * handler to use.
+ */
+ [ChromeOnly, Throws]
+ void reload(boolean aClearActivation);
+
+ /**
* This attribute will return true if the current content type has been
* activated, either explicitly or by passing checks that would have it be
* click-to-play or play-preview.
@@ -196,6 +213,15 @@ interface MozObjectLoadingContent {
void cancelPlayPreview();
};
+/**
+ * Name:Value pair type used for passing parameters to NPAPI or javascript
+ * plugins.
+ */
+dictionary MozPluginParameter {
+ DOMString name = "";
+ DOMString value = "";
+};
+
HTMLObjectElement implements MozImageLoadingContent;
HTMLObjectElement implements MozFrameLoaderOwner;
HTMLObjectElement implements MozObjectLoadingContent;
diff --git a/dom/webidl/HTMLOptionElement.webidl b/dom/webidl/HTMLOptionElement.webidl
index a4a65aa6f..c80bedeef 100644
--- a/dom/webidl/HTMLOptionElement.webidl
+++ b/dom/webidl/HTMLOptionElement.webidl
@@ -27,6 +27,5 @@ interface HTMLOptionElement : HTMLElement {
[SetterThrows]
attribute DOMString text;
- [GetterThrows]
readonly attribute long index;
};
diff --git a/dom/webidl/HTMLOptionsCollection.webidl b/dom/webidl/HTMLOptionsCollection.webidl
index d54fd19a4..4d4385d82 100644
--- a/dom/webidl/HTMLOptionsCollection.webidl
+++ b/dom/webidl/HTMLOptionsCollection.webidl
@@ -13,8 +13,6 @@
interface HTMLOptionsCollection : HTMLCollection {
attribute unsigned long length;
[Throws]
- getter object? namedItem(DOMString name);
- [Throws]
setter creator void (unsigned long index, HTMLOptionElement? option);
[Throws]
void add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null);
diff --git a/dom/webidl/HTMLPictureElement.webidl b/dom/webidl/HTMLPictureElement.webidl
new file mode 100644
index 000000000..e2964dd1b
--- /dev/null
+++ b/dom/webidl/HTMLPictureElement.webidl
@@ -0,0 +1,9 @@
+/* -*- 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/.
+ */
+
+[Pref="dom.image.picture.enabled"]
+interface HTMLPictureElement : HTMLElement {
+};
diff --git a/dom/webidl/HTMLPropertiesCollection.webidl b/dom/webidl/HTMLPropertiesCollection.webidl
index e281e7571..8fd8d148a 100644
--- a/dom/webidl/HTMLPropertiesCollection.webidl
+++ b/dom/webidl/HTMLPropertiesCollection.webidl
@@ -10,8 +10,6 @@
* liability, trademark and document use rules apply.
*/
-interface DOMStringList;
-
interface HTMLPropertiesCollection : HTMLCollection {
// inherits length and item()
getter PropertyNodeList? namedItem(DOMString name); // overrides inherited namedItem()
diff --git a/dom/webidl/HTMLScriptElement.webidl b/dom/webidl/HTMLScriptElement.webidl
index 979e38ca3..cbe3161c6 100644
--- a/dom/webidl/HTMLScriptElement.webidl
+++ b/dom/webidl/HTMLScriptElement.webidl
@@ -20,7 +20,7 @@ interface HTMLScriptElement : HTMLElement {
[SetterThrows]
attribute boolean defer;
[SetterThrows]
- attribute DOMString crossOrigin;
+ attribute DOMString? crossOrigin;
[SetterThrows]
attribute DOMString text;
};
diff --git a/dom/webidl/HTMLSelectElement.webidl b/dom/webidl/HTMLSelectElement.webidl
index 89f410a05..d1794cda1 100644
--- a/dom/webidl/HTMLSelectElement.webidl
+++ b/dom/webidl/HTMLSelectElement.webidl
@@ -10,6 +10,8 @@
interface HTMLSelectElement : HTMLElement {
[SetterThrows, Pure]
attribute boolean autofocus;
+ [Pref="dom.forms.autocomplete.experimental", SetterThrows, Pure]
+ attribute DOMString autocomplete;
[SetterThrows, Pure]
attribute boolean disabled;
[Pure]
@@ -38,7 +40,7 @@ interface HTMLSelectElement : HTMLElement {
[Throws]
setter creator void (unsigned long index, HTMLOptionElement? option);
-// NYI: readonly attribute HTMLCollection selectedOptions;
+ readonly attribute HTMLCollection selectedOptions;
[SetterThrows, Pure]
attribute long selectedIndex;
[Pure]
diff --git a/dom/webidl/HTMLShadowElement.webidl b/dom/webidl/HTMLShadowElement.webidl
new file mode 100644
index 000000000..6bce7245e
--- /dev/null
+++ b/dom/webidl/HTMLShadowElement.webidl
@@ -0,0 +1,18 @@
+/* -*- 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
+ * https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html
+ *
+ * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
+ * Opera Software ASA. You are granted a license to use, reproduce
+ * and create derivative works of this document.
+ */
+
+interface HTMLShadowElement : HTMLElement
+{
+ readonly attribute ShadowRoot? olderShadowRoot;
+};
+
diff --git a/dom/webidl/HTMLSourceElement.webidl b/dom/webidl/HTMLSourceElement.webidl
index 8119a1e33..2cb5ea873 100644
--- a/dom/webidl/HTMLSourceElement.webidl
+++ b/dom/webidl/HTMLSourceElement.webidl
@@ -16,6 +16,13 @@ interface HTMLSourceElement : HTMLElement {
attribute DOMString src;
[SetterThrows]
attribute DOMString type;
+};
+
+partial interface HTMLSourceElement {
+ [SetterThrows, Pref="dom.image.picture.enabled"]
+ attribute DOMString srcset;
+ [SetterThrows, Pref="dom.image.picture.enabled"]
+ attribute DOMString sizes;
[SetterThrows]
attribute DOMString media;
};
diff --git a/dom/webidl/HTMLTableColElement.webidl b/dom/webidl/HTMLTableColElement.webidl
index 0e6c858e7..c927541a3 100644
--- a/dom/webidl/HTMLTableColElement.webidl
+++ b/dom/webidl/HTMLTableColElement.webidl
@@ -12,13 +12,19 @@
*/
interface HTMLTableColElement : HTMLElement {
+ [SetterThrows]
attribute unsigned long span;
};
partial interface HTMLTableColElement {
+ [SetterThrows]
attribute DOMString align;
+ [SetterThrows]
attribute DOMString ch;
+ [SetterThrows]
attribute DOMString chOff;
+ [SetterThrows]
attribute DOMString vAlign;
+ [SetterThrows]
attribute DOMString width;
};
diff --git a/dom/webidl/HTMLTextAreaElement.webidl b/dom/webidl/HTMLTextAreaElement.webidl
index 2a8758901..1b0d6f5a9 100644
--- a/dom/webidl/HTMLTextAreaElement.webidl
+++ b/dom/webidl/HTMLTextAreaElement.webidl
@@ -63,8 +63,11 @@ interface HTMLTextAreaElement : HTMLElement {
attribute unsigned long selectionEnd;
[Throws]
attribute DOMString selectionDirection;
- // void setRangeText(DOMString replacement);
- // void setRangeText(DOMString replacement, unsigned long start, unsigned long end, optional SelectionMode selectionMode);
+ [Throws]
+ void setRangeText(DOMString replacement);
+ [Throws]
+ void setRangeText(DOMString replacement, unsigned long start,
+ unsigned long end, optional SelectionMode selectionMode = "preserve");
[Throws]
void setSelectionRange(unsigned long start, unsigned long end, optional DOMString direction);
};
diff --git a/dom/webidl/HTMLTrackElement.webidl b/dom/webidl/HTMLTrackElement.webidl
index d72f70c04..c432d0c20 100644
--- a/dom/webidl/HTMLTrackElement.webidl
+++ b/dom/webidl/HTMLTrackElement.webidl
@@ -10,7 +10,7 @@
[Pref="media.webvtt.enabled"]
interface HTMLTrackElement : HTMLElement {
[SetterThrows, Pure]
- attribute TextTrackKind kind;
+ attribute DOMString kind;
[SetterThrows, Pure]
attribute DOMString src;
[SetterThrows, Pure]
@@ -26,5 +26,5 @@ interface HTMLTrackElement : HTMLElement {
const unsigned short ERROR = 3;
readonly attribute unsigned short readyState;
- readonly attribute TextTrack track;
+ readonly attribute TextTrack? track;
};
diff --git a/dom/webidl/HTMLVideoElement.webidl b/dom/webidl/HTMLVideoElement.webidl
index a6c34fb49..cfa2c783f 100644
--- a/dom/webidl/HTMLVideoElement.webidl
+++ b/dom/webidl/HTMLVideoElement.webidl
@@ -45,3 +45,9 @@ partial interface HTMLVideoElement {
// True if the video has an audio track available.
readonly attribute boolean mozHasAudio;
};
+
+// https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#idl-def-HTMLVideoElement
+partial interface HTMLVideoElement {
+ [Func="mozilla::dom::MediaSource::Enabled", NewObject]
+ VideoPlaybackQuality getVideoPlaybackQuality();
+};
diff --git a/dom/webidl/HashChangeEvent.webidl b/dom/webidl/HashChangeEvent.webidl
index f11437aa4..86bfe8a69 100644
--- a/dom/webidl/HashChangeEvent.webidl
+++ b/dom/webidl/HashChangeEvent.webidl
@@ -4,19 +4,18 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-[Constructor(DOMString type, optional HashChangeEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Constructor(DOMString type, optional HashChangeEventInit eventInitDict), LegacyEventInit]
interface HashChangeEvent : Event
{
readonly attribute DOMString? oldURL;
readonly attribute DOMString? newURL;
- // initHashChangeEvent is a Goanna specific deprecated method.
[Throws]
- void initHashChangeEvent(DOMString type,
- boolean canBubble,
- boolean cancelable,
- DOMString? oldURL,
- DOMString? newURL);
+ void initHashChangeEvent(DOMString typeArg,
+ boolean canBubbleArg,
+ boolean cancelableArg,
+ DOMString? oldURLArg,
+ DOMString? newURLArg);
};
dictionary HashChangeEventInit : EventInit
diff --git a/dom/webidl/Headers.webidl b/dom/webidl/Headers.webidl
new file mode 100644
index 000000000..a240e3729
--- /dev/null
+++ b/dom/webidl/Headers.webidl
@@ -0,0 +1,35 @@
+/* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
+/* 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/#headers-class
+ */
+
+typedef (Headers or sequence<sequence<ByteString>> or MozMap<ByteString>) HeadersInit;
+
+enum HeadersGuardEnum {
+ "none",
+ "request",
+ "request-no-cors",
+ "response",
+ "immutable"
+};
+
+[Constructor(optional HeadersInit init),
+ Exposed=(Window,Worker),
+ Func="mozilla::dom::Headers::PrefEnabled"]
+interface Headers {
+ [Throws] void append(ByteString name, ByteString value);
+ [Throws] void delete(ByteString name);
+ [Throws] ByteString? get(ByteString name);
+ [Throws] sequence<ByteString> getAll(ByteString name);
+ [Throws] boolean has(ByteString name);
+ [Throws] void set(ByteString name, ByteString value);
+
+ // Used to test different guard states from mochitest.
+ // Note: Must be set prior to populating headers or will throw.
+ [ChromeOnly, SetterThrows] attribute HeadersGuardEnum guard;
+};
diff --git a/dom/webidl/History.webidl b/dom/webidl/History.webidl
new file mode 100644
index 000000000..8c9be6f9f
--- /dev/null
+++ b/dom/webidl/History.webidl
@@ -0,0 +1,29 @@
+/* -*- 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.whatwg.org/specs/web-apps/current-work/#the-history-interface
+ *
+ * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
+ * Opera Software ASA. You are granted a license to use, reproduce
+ * and create derivative works of this document.
+ */
+
+interface History {
+ [Throws]
+ readonly attribute unsigned long length;
+ [Throws]
+ readonly attribute any state;
+ [Throws, UnsafeInPrerendering]
+ void go(optional long delta = 0);
+ [Throws, UnsafeInPrerendering]
+ void back();
+ [Throws, UnsafeInPrerendering]
+ void forward();
+ [Throws]
+ void pushState(any data, DOMString title, optional DOMString? url = null);
+ [Throws]
+ void replaceState(any data, DOMString title, optional DOMString? url = null);
+};
diff --git a/dom/webidl/IDBCursor.webidl b/dom/webidl/IDBCursor.webidl
new file mode 100644
index 000000000..b195ea3a8
--- /dev/null
+++ b/dom/webidl/IDBCursor.webidl
@@ -0,0 +1,45 @@
+/* -*- 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
+ * https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBCursorDirection
+ */
+
+enum IDBCursorDirection {
+ "next",
+ "nextunique",
+ "prev",
+ "prevunique"
+};
+
+[Exposed=(Window,Worker)]
+interface IDBCursor {
+ readonly attribute (IDBObjectStore or IDBIndex) source;
+
+ readonly attribute IDBCursorDirection direction;
+
+ [Throws]
+ readonly attribute any key;
+
+ [Throws]
+ readonly attribute any primaryKey;
+
+ [Throws]
+ IDBRequest update (any value);
+
+ [Throws]
+ void advance ([EnforceRange] unsigned long count);
+
+ [Throws]
+ void continue (optional any key);
+
+ [Throws]
+ IDBRequest delete ();
+};
+
+interface IDBCursorWithValue : IDBCursor {
+ [Throws]
+ readonly attribute any value;
+};
diff --git a/dom/webidl/IDBDatabase.webidl b/dom/webidl/IDBDatabase.webidl
index 00b7a1a47..056eed7f4 100644
--- a/dom/webidl/IDBDatabase.webidl
+++ b/dom/webidl/IDBDatabase.webidl
@@ -2,13 +2,52 @@
/* 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
+ * https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBObjectStoreParameters
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
*/
-dictionary IDBObjectStoreParameters {
- // XXXbz this should be "(DOMString or sequence<DOMString>)?", but
- // we don't support unions in dictionaries yet. See bug 767926.
- any keyPath = null;
- boolean autoIncrement = false;
+[Exposed=(Window,Worker)]
+interface IDBDatabase : EventTarget {
+ readonly attribute DOMString name;
+ readonly attribute unsigned long long version;
+
+ readonly attribute DOMStringList objectStoreNames;
+
+ [Throws]
+ IDBObjectStore createObjectStore (DOMString name, optional IDBObjectStoreParameters optionalParameters);
+
+ [Throws]
+ void deleteObjectStore (DOMString name);
+
+ // This should be:
+ // IDBTransaction transaction ((DOMString or sequence<DOMString>) storeNames, optional IDBTransactionMode mode = "readonly");
+ // but unions are not currently supported.
+
+ [Throws]
+ IDBTransaction transaction (DOMString storeName, optional IDBTransactionMode mode = "readonly");
+
+ [Throws]
+ IDBTransaction transaction (sequence<DOMString> storeNames, optional IDBTransactionMode mode = "readonly");
+
+ void close ();
+
+ attribute EventHandler onabort;
+ attribute EventHandler onerror;
+ attribute EventHandler onversionchange;
};
-// If we start using IDBObjectStoreParameters here, remove it from DummyBinding.
+partial interface IDBDatabase {
+ [Func="mozilla::dom::indexedDB::IndexedDatabaseManager::ExperimentalFeaturesEnabled"]
+ readonly attribute StorageType storage;
+
+ [Exposed=Window, Throws]
+ IDBRequest createMutableFile (DOMString name, optional DOMString type);
+
+ // this is deprecated due to renaming in the spec
+ [Exposed=Window, Throws]
+ IDBRequest mozCreateFileHandle (DOMString name, optional DOMString type); // now createMutableFile
+};
diff --git a/dom/webidl/IDBEnvironment.webidl b/dom/webidl/IDBEnvironment.webidl
new file mode 100644
index 000000000..6ae8be97c
--- /dev/null
+++ b/dom/webidl/IDBEnvironment.webidl
@@ -0,0 +1,14 @@
+/* -*- 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:
+ * https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html
+ */
+
+[Exposed=(Window,Worker), NoInterfaceObject]
+interface IDBEnvironment {
+ //[Throws] readonly attribute IDBFactory indexedDB;
+ [Throws] readonly attribute IDBFactory? indexedDB;
+};
diff --git a/dom/webidl/IDBFactory.webidl b/dom/webidl/IDBFactory.webidl
index 8736e4878..a875ba191 100644
--- a/dom/webidl/IDBFactory.webidl
+++ b/dom/webidl/IDBFactory.webidl
@@ -2,25 +2,43 @@
/* 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
+ * https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBFactory
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
*/
-interface IDBOpenDBRequest;
interface Principal;
+dictionary IDBOpenDBOptions
+{
+ [EnforceRange] unsigned long long version;
+ StorageType storage;
+};
+
/**
* Interface that defines the indexedDB property on a window. See
* http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBFactory
* for more information.
*/
+[Exposed=(Window,Worker)]
interface IDBFactory {
[Throws]
IDBOpenDBRequest
open(DOMString name,
- [EnforceRange] optional unsigned long long version);
+ [EnforceRange] unsigned long long version);
+
+ [Throws]
+ IDBOpenDBRequest
+ open(DOMString name,
+ optional IDBOpenDBOptions options);
[Throws]
IDBOpenDBRequest
- deleteDatabase(DOMString name);
+ deleteDatabase(DOMString name,
+ optional IDBOpenDBOptions options);
[Throws]
short
@@ -31,10 +49,17 @@ interface IDBFactory {
IDBOpenDBRequest
openForPrincipal(Principal principal,
DOMString name,
- [EnforceRange] optional unsigned long long version);
+ [EnforceRange] unsigned long long version);
+
+ [Throws, ChromeOnly]
+ IDBOpenDBRequest
+ openForPrincipal(Principal principal,
+ DOMString name,
+ optional IDBOpenDBOptions options);
[Throws, ChromeOnly]
IDBOpenDBRequest
deleteForPrincipal(Principal principal,
- DOMString name);
+ DOMString name,
+ optional IDBOpenDBOptions options);
};
diff --git a/dom/webidl/IDBFileHandle.webidl b/dom/webidl/IDBFileHandle.webidl
new file mode 100644
index 000000000..ad88084fb
--- /dev/null
+++ b/dom/webidl/IDBFileHandle.webidl
@@ -0,0 +1,50 @@
+/* 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 obtaone at http://mozilla.org/MPL/2.0/. */
+
+dictionary IDBFileMetadataParameters
+{
+ boolean size = true;
+ boolean lastModified = true;
+};
+
+interface IDBFileHandle : EventTarget
+{
+ readonly attribute IDBMutableFile? mutableFile;
+ // this is deprecated due to renaming in the spec
+ readonly attribute IDBMutableFile? fileHandle; // now mutableFile
+ readonly attribute FileMode mode;
+ readonly attribute boolean active;
+ attribute unsigned long long? location;
+
+ [Throws]
+ IDBFileRequest? getMetadata(optional IDBFileMetadataParameters parameters);
+ [Throws]
+ IDBFileRequest? readAsArrayBuffer(unsigned long long size);
+ [Throws]
+ IDBFileRequest? readAsText(unsigned long long size,
+ optional DOMString? encoding = null);
+
+ [Throws]
+ IDBFileRequest? write(ArrayBuffer value);
+ [Throws]
+ IDBFileRequest? write(Blob value);
+ [Throws]
+ IDBFileRequest? write(DOMString value);
+ [Throws]
+ IDBFileRequest? append(ArrayBuffer value);
+ [Throws]
+ IDBFileRequest? append(Blob value);
+ [Throws]
+ IDBFileRequest? append(DOMString value);
+ [Throws]
+ IDBFileRequest? truncate(optional unsigned long long size);
+ [Throws]
+ IDBFileRequest? flush();
+ [Throws]
+ void abort();
+
+ attribute EventHandler oncomplete;
+ attribute EventHandler onabort;
+ attribute EventHandler onerror;
+};
diff --git a/dom/webidl/FileRequest.webidl b/dom/webidl/IDBFileRequest.webidl
index 15d5e37b1..b32af45c5 100644
--- a/dom/webidl/FileRequest.webidl
+++ b/dom/webidl/IDBFileRequest.webidl
@@ -4,11 +4,10 @@
* 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/. */
-interface LockedFile;
+interface IDBFileRequest : DOMRequest {
+ readonly attribute IDBFileHandle? fileHandle;
+ // this is deprecated due to renaming in the spec
+ readonly attribute IDBFileHandle? lockedFile; // now fileHandle
-interface FileRequest : DOMRequest {
- readonly attribute LockedFile? lockedFile;
-
- [SetterThrows]
attribute EventHandler onprogress;
};
diff --git a/dom/webidl/IDBIndex.webidl b/dom/webidl/IDBIndex.webidl
new file mode 100644
index 000000000..8f44b35de
--- /dev/null
+++ b/dom/webidl/IDBIndex.webidl
@@ -0,0 +1,56 @@
+/* -*- 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
+ * https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBIndexParameters
+ */
+
+dictionary IDBIndexParameters {
+ boolean unique = false;
+ boolean multiEntry = false;
+};
+
+[Exposed=(Window,Worker)]
+interface IDBIndex {
+ readonly attribute DOMString name;
+ readonly attribute IDBObjectStore objectStore;
+
+ [Throws]
+ readonly attribute any keyPath;
+
+ readonly attribute boolean multiEntry;
+ readonly attribute boolean unique;
+
+ [Throws]
+ IDBRequest openCursor (optional any range, optional IDBCursorDirection direction = "next");
+
+ [Throws]
+ IDBRequest openKeyCursor (optional any range, optional IDBCursorDirection direction = "next");
+
+ [Throws]
+ IDBRequest get (any key);
+
+ [Throws]
+ IDBRequest getKey (any key);
+
+ [Throws]
+ IDBRequest count (optional any key);
+};
+
+partial interface IDBIndex {
+ [Throws]
+ IDBRequest mozGetAll (optional any key, optional unsigned long limit);
+
+ [Throws]
+ IDBRequest mozGetAllKeys (optional any key, optional unsigned long limit);
+
+ [Throws,
+ Func="mozilla::dom::indexedDB::IndexedDatabaseManager::ExperimentalFeaturesEnabled"]
+ IDBRequest getAll (optional any key, optional unsigned long limit);
+
+ [Throws,
+ Func="mozilla::dom::indexedDB::IndexedDatabaseManager::ExperimentalFeaturesEnabled"]
+ IDBRequest getAllKeys (optional any key, optional unsigned long limit);
+};
diff --git a/dom/webidl/IDBKeyRange.webidl b/dom/webidl/IDBKeyRange.webidl
new file mode 100644
index 000000000..d3295f8a3
--- /dev/null
+++ b/dom/webidl/IDBKeyRange.webidl
@@ -0,0 +1,30 @@
+/* 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
+ * https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+[Exposed=(Window,Worker)]
+interface IDBKeyRange {
+ [Throws]
+ readonly attribute any lower;
+ [Throws]
+ readonly attribute any upper;
+ [Constant]
+ readonly attribute boolean lowerOpen;
+ [Constant]
+ readonly attribute boolean upperOpen;
+ [NewObject, Throws]
+ static IDBKeyRange only (any value);
+ [NewObject, Throws]
+ static IDBKeyRange lowerBound (any lower, optional boolean open = false);
+ [NewObject, Throws]
+ static IDBKeyRange upperBound (any upper, optional boolean open = false);
+ [NewObject, Throws]
+ static IDBKeyRange bound (any lower, any upper, optional boolean lowerOpen = false, optional boolean upperOpen = false);
+};
diff --git a/dom/webidl/FileHandle.webidl b/dom/webidl/IDBMutableFile.webidl
index 8beaa51d2..f5b275c21 100644
--- a/dom/webidl/FileHandle.webidl
+++ b/dom/webidl/IDBMutableFile.webidl
@@ -3,20 +3,18 @@
* 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/. */
-interface LockedFile;
-
-interface FileHandle : EventTarget {
+interface IDBMutableFile : EventTarget {
readonly attribute DOMString name;
readonly attribute DOMString type;
+ readonly attribute IDBDatabase database;
+
[Throws]
- LockedFile open(optional FileMode mode = "readonly");
+ IDBFileHandle open(optional FileMode mode = "readonly");
[Throws]
DOMRequest getFile();
- [SetterThrows]
attribute EventHandler onabort;
- [SetterThrows]
attribute EventHandler onerror;
};
diff --git a/dom/webidl/IDBObjectStore.webidl b/dom/webidl/IDBObjectStore.webidl
new file mode 100644
index 000000000..a912aa68b
--- /dev/null
+++ b/dom/webidl/IDBObjectStore.webidl
@@ -0,0 +1,79 @@
+/* -*- 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
+ * https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBObjectStore
+ */
+
+dictionary IDBObjectStoreParameters {
+ (DOMString or sequence<DOMString>)? keyPath = null;
+ boolean autoIncrement = false;
+};
+
+[Exposed=(Window,Worker)]
+interface IDBObjectStore {
+ readonly attribute DOMString name;
+
+ [Throws]
+ readonly attribute any keyPath;
+
+ readonly attribute DOMStringList indexNames;
+ readonly attribute IDBTransaction transaction;
+ readonly attribute boolean autoIncrement;
+
+ [Throws]
+ IDBRequest put (any value, optional any key);
+
+ [Throws]
+ IDBRequest add (any value, optional any key);
+
+ [Throws]
+ IDBRequest delete (any key);
+
+ [Throws]
+ IDBRequest get (any key);
+
+ [Throws]
+ IDBRequest clear ();
+
+ [Throws]
+ IDBRequest openCursor (optional any range, optional IDBCursorDirection direction = "next");
+
+ // Bug 899972
+ // IDBIndex createIndex (DOMString name, (DOMString or sequence<DOMString>) keyPath, optional IDBIndexParameters optionalParameters);
+
+ [Throws]
+ IDBIndex createIndex (DOMString name, DOMString keyPath, optional IDBIndexParameters optionalParameters);
+
+ [Throws]
+ IDBIndex createIndex (DOMString name, sequence<DOMString> keyPath, optional IDBIndexParameters optionalParameters);
+
+ [Throws]
+ IDBIndex index (DOMString name);
+
+ [Throws]
+ void deleteIndex (DOMString indexName);
+
+ [Throws]
+ IDBRequest count (optional any key);
+};
+
+partial interface IDBObjectStore {
+ // Success fires IDBTransactionEvent, result == array of values for given keys
+ [Throws]
+ IDBRequest mozGetAll (optional any key, optional unsigned long limit);
+
+ [Throws,
+ Func="mozilla::dom::indexedDB::IndexedDatabaseManager::ExperimentalFeaturesEnabled"]
+ IDBRequest getAll (optional any key, optional unsigned long limit);
+
+ [Throws,
+ Func="mozilla::dom::indexedDB::IndexedDatabaseManager::ExperimentalFeaturesEnabled"]
+ IDBRequest getAllKeys (optional any key, optional unsigned long limit);
+
+ [Throws,
+ Func="mozilla::dom::indexedDB::IndexedDatabaseManager::ExperimentalFeaturesEnabled"]
+ IDBRequest openKeyCursor (optional any range, optional IDBCursorDirection direction = "next");
+};
diff --git a/dom/webidl/IDBOpenDBRequest.webidl b/dom/webidl/IDBOpenDBRequest.webidl
new file mode 100644
index 000000000..8668009a6
--- /dev/null
+++ b/dom/webidl/IDBOpenDBRequest.webidl
@@ -0,0 +1,15 @@
+/* -*- 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
+ * https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBOpenDBRequest
+ */
+
+[Exposed=(Window,Worker)]
+interface IDBOpenDBRequest : IDBRequest {
+ attribute EventHandler onblocked;
+
+ attribute EventHandler onupgradeneeded;
+};
diff --git a/dom/webidl/IDBRequest.webidl b/dom/webidl/IDBRequest.webidl
new file mode 100644
index 000000000..a1c7fbfdf
--- /dev/null
+++ b/dom/webidl/IDBRequest.webidl
@@ -0,0 +1,31 @@
+/* -*- 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
+ * https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBRequest
+ * https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBRequestReadyState
+ */
+
+enum IDBRequestReadyState {
+ "pending",
+ "done"
+};
+
+[Exposed=(Window,Worker)]
+interface IDBRequest : EventTarget {
+ [Throws]
+ readonly attribute any result;
+
+ [Throws]
+ readonly attribute DOMError? error;
+
+ readonly attribute (IDBObjectStore or IDBIndex or IDBCursor)? source;
+ readonly attribute IDBTransaction? transaction;
+ readonly attribute IDBRequestReadyState readyState;
+
+ attribute EventHandler onsuccess;
+
+ attribute EventHandler onerror;
+};
diff --git a/dom/webidl/IDBTransaction.webidl b/dom/webidl/IDBTransaction.webidl
new file mode 100644
index 000000000..82ea4a948
--- /dev/null
+++ b/dom/webidl/IDBTransaction.webidl
@@ -0,0 +1,39 @@
+/* -*- 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
+ * https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBTransaction
+ * https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBTransactionMode
+ */
+
+enum IDBTransactionMode {
+ "readonly",
+ "readwrite",
+ "versionchange"
+};
+
+[Exposed=(Window,Worker)]
+interface IDBTransaction : EventTarget {
+ [Throws]
+ readonly attribute IDBTransactionMode mode;
+ readonly attribute IDBDatabase db;
+
+ readonly attribute DOMError? error;
+
+ [Throws]
+ IDBObjectStore objectStore (DOMString name);
+
+ [Throws]
+ void abort();
+
+ attribute EventHandler onabort;
+ attribute EventHandler oncomplete;
+ attribute EventHandler onerror;
+};
+
+// This seems to be custom
+partial interface IDBTransaction {
+ readonly attribute DOMStringList objectStoreNames;
+};
diff --git a/dom/webidl/IDBVersionChangeEvent.webidl b/dom/webidl/IDBVersionChangeEvent.webidl
index ea0e88be3..461b515f9 100644
--- a/dom/webidl/IDBVersionChangeEvent.webidl
+++ b/dom/webidl/IDBVersionChangeEvent.webidl
@@ -3,14 +3,22 @@
* 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/.
*
- * IDBVersionChangeEvent is defined in:
- * https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html
+ * The origin of this IDL file is
+ * https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBVersionChangeEvent
*
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
* liability, trademark and document use rules apply.
*/
+dictionary IDBVersionChangeEventInit : EventInit {
+ unsigned long long oldVersion = 0;
+ unsigned long long? newVersion = null;
+};
+
+[Constructor(DOMString type, optional IDBVersionChangeEventInit eventInitDict),
+ Exposed=(Window,Worker)]
interface IDBVersionChangeEvent : Event {
- readonly attribute unsigned long long oldVersion;
- readonly attribute unsigned long long? newVersion;
+ readonly attribute unsigned long long oldVersion;
+ readonly attribute unsigned long long? newVersion;
};
+
diff --git a/dom/webidl/IccCardLockError.webidl b/dom/webidl/IccCardLockError.webidl
new file mode 100644
index 000000000..332b08bc1
--- /dev/null
+++ b/dom/webidl/IccCardLockError.webidl
@@ -0,0 +1,12 @@
+/* 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/.
+ */
+
+[Constructor(DOMString errorName, short retryCount),
+ Pref="dom.icc.enabled",
+ CheckPermissions="mobileconnection",
+ AvailableIn="CertifiedApps"]
+interface IccCardLockError : DOMError {
+ readonly attribute short retryCount;
+};
diff --git a/dom/webidl/IccCardLockErrorEvent.webidl b/dom/webidl/IccCardLockErrorEvent.webidl
deleted file mode 100644
index 4b64f6954..000000000
--- a/dom/webidl/IccCardLockErrorEvent.webidl
+++ /dev/null
@@ -1,18 +0,0 @@
-/* -*- 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/.
- */
-
-[Constructor(DOMString type, optional IccCardLockErrorEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
-interface IccCardLockErrorEvent : Event
-{
- readonly attribute DOMString? lockType;
- readonly attribute long retryCount;
-};
-
-dictionary IccCardLockErrorEventInit : EventInit
-{
- DOMString lockType = "";
- long retryCount = 0;
-};
diff --git a/dom/webidl/IccChangeEvent.webidl b/dom/webidl/IccChangeEvent.webidl
new file mode 100644
index 000000000..1effa299b
--- /dev/null
+++ b/dom/webidl/IccChangeEvent.webidl
@@ -0,0 +1,19 @@
+/* -*- 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/.
+ */
+
+[Pref="dom.icc.enabled",
+ CheckPermissions="mobileconnection",
+ AvailableIn="CertifiedApps",
+ Constructor(DOMString type, optional IccChangeEventInit eventInitDict)]
+interface IccChangeEvent : Event
+{
+ readonly attribute DOMString iccId;
+};
+
+dictionary IccChangeEventInit : EventInit
+{
+ DOMString iccId = "";
+};
diff --git a/dom/webidl/Identity.webidl b/dom/webidl/Identity.webidl
new file mode 100644
index 000000000..893fe06fe
--- /dev/null
+++ b/dom/webidl/Identity.webidl
@@ -0,0 +1,70 @@
+/* -*- 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/.
+ */
+
+callback IdentityOnReadyCallback = void();
+callback IdentityOnLoginCallback = void(DOMString identityAssertion);
+callback IdentityOnLogoutCallback = void();
+callback IdentityOnCancelCallback = void(DOMString? error);
+callback IdentityOnErrorCallback = void(DOMString error);
+
+dictionary IdentityWatchOptions {
+ // Required callback
+ IdentityOnLoginCallback onlogin;
+
+ // Optional parameters
+ DOMString wantIssuer;
+ DOMString loggedInUser;
+
+ // Optional callbacks
+ IdentityOnReadyCallback onready;
+ IdentityOnLogoutCallback onlogout;
+ IdentityOnErrorCallback onerror;
+
+ // Certified apps can specify this
+ DOMString audience;
+};
+
+dictionary IdentityRequestOptions {
+ // Optional parameters
+ long refreshAuthentication;
+ DOMString termsOfService;
+ DOMString privacyPolicy;
+ DOMString backgroundColor;
+ DOMString siteLogo;
+ DOMString siteName;
+ DOMString returnTo;
+
+ IdentityOnCancelCallback oncancel;
+
+ // Certified apps can specify this
+ DOMString origin;
+};
+
+dictionary IdentityGetOptions {
+ DOMString privacyPolicy;
+ DOMString termsOfService;
+ DOMString privacyURL;
+ DOMString tosURL;
+ DOMString siteName;
+ DOMString siteLogo;
+};
+
+[JSImplementation="@mozilla.org/identity/manager;1",
+ NoInterfaceObject,
+ NavigatorProperty="mozId",
+ Pref="dom.identity.enabled"]
+interface IdentityManager {
+ void watch(optional IdentityWatchOptions options);
+ void request(optional IdentityRequestOptions options);
+ void logout();
+
+ [Pref="dom.identity.exposeLegacyGetAPI"]
+ void get(IdentityOnLoginCallback callback, optional IdentityGetOptions options);
+
+ [Pref="dom.identity.exposeLegacyGetVerifiedEmailAPI"]
+ void getVerifiedEmail(IdentityOnLoginCallback callback);
+};
+
diff --git a/dom/webidl/ImageCapture.webidl b/dom/webidl/ImageCapture.webidl
new file mode 100644
index 000000000..22f330335
--- /dev/null
+++ b/dom/webidl/ImageCapture.webidl
@@ -0,0 +1,28 @@
+/* -*- 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
+ * https://dvcs.w3.org/hg/dap/raw-file/default/media-stream-capture/ImageCapture.html
+ *
+ * Copyright © 2012-2014 W3C® (MIT, ERCIM, Keio, Beihang), All Rights Reserved.
+ * W3C liability, trademark and document use rules apply.
+ */
+
+[Pref="dom.imagecapture.enabled", Constructor(VideoStreamTrack track)]
+interface ImageCapture : EventTarget {
+ // readonly attribute PhotoSettingsOptions photoSettingsOptions;
+ readonly attribute VideoStreamTrack videoStreamTrack;
+ attribute EventHandler onphoto;
+ attribute EventHandler onerror;
+ // attribute EventHandler onphotosettingschange;
+ // attribute EventHandler onframegrab;
+
+ // [Throws]
+ // void setOptions (PhotoSettings? photoSettings);
+ [Throws]
+ void takePhoto();
+ // [Throws]
+ // void getFrame();
+};
diff --git a/dom/webidl/ImageCaptureErrorEvent.webidl b/dom/webidl/ImageCaptureErrorEvent.webidl
new file mode 100644
index 000000000..b7300aa30
--- /dev/null
+++ b/dom/webidl/ImageCaptureErrorEvent.webidl
@@ -0,0 +1,32 @@
+/* -*- 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
+ * https://dvcs.w3.org/hg/dap/raw-file/default/media-stream-capture/ImageCapture.html
+ *
+ * Copyright © 2012-2014 W3C® (MIT, ERCIM, Keio, Beihang), All Rights Reserved.
+ * W3C liability, trademark and document use rules apply.
+ */
+
+[Pref="dom.imagecapture.enabled",
+Constructor(DOMString type, optional ImageCaptureErrorEventInit imageCaptureErrorInitDict)]
+interface ImageCaptureErrorEvent : Event {
+ readonly attribute ImageCaptureError? imageCaptureError;
+};
+
+dictionary ImageCaptureErrorEventInit : EventInit {
+ ImageCaptureError? imageCaptureError = null;
+};
+
+[NoInterfaceObject]
+interface ImageCaptureError {
+ const unsigned short FRAME_GRAB_ERROR = 1;
+ const unsigned short SETTINGS_ERROR = 2;
+ const unsigned short PHOTO_ERROR = 3;
+ const unsigned short ERROR_UNKNOWN = 4;
+ readonly attribute unsigned short code;
+ readonly attribute DOMString message;
+};
+
diff --git a/dom/webidl/ImageData.webidl b/dom/webidl/ImageData.webidl
index 5f5f34079..f6000bd05 100644
--- a/dom/webidl/ImageData.webidl
+++ b/dom/webidl/ImageData.webidl
@@ -10,11 +10,14 @@
* You are granted a license to use, reproduce and create derivative works of this document.
*/
+[Constructor(unsigned long sw, unsigned long sh),
+ Constructor(Uint8ClampedArray data, unsigned long sw, optional unsigned long sh),
+ Exposed=(Window,Worker)]
interface ImageData {
[Constant]
readonly attribute unsigned long width;
[Constant]
readonly attribute unsigned long height;
- [Constant]
+ [Constant, StoreInSlot]
readonly attribute Uint8ClampedArray data;
};
diff --git a/dom/webidl/ImageDocument.webidl b/dom/webidl/ImageDocument.webidl
index a9996c90f..2606636f1 100644
--- a/dom/webidl/ImageDocument.webidl
+++ b/dom/webidl/ImageDocument.webidl
@@ -4,12 +4,12 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*
* The origin of this IDL file is:
- * content/html/document/public/nsIImageDocument.idl
+ * dom/html/public/nsIImageDocument.idl
*/
interface imgIRequest;
-[OverrideBuiltins, ChromeOnly]
+[ChromeOnly, OverrideBuiltins]
interface ImageDocument : HTMLDocument {
/* Whether the pref for image resizing has been set. */
readonly attribute boolean imageResizingEnabled;
diff --git a/dom/webidl/SmartCardEvent.webidl b/dom/webidl/InputEvent.webidl
index f2515b02d..805b0510c 100644
--- a/dom/webidl/SmartCardEvent.webidl
+++ b/dom/webidl/InputEvent.webidl
@@ -4,13 +4,13 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-[Constructor(DOMString type, optional SmartCardEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
-interface SmartCardEvent : Event
+[Constructor(DOMString type, optional InputEventInit eventInitDict)]
+interface InputEvent : UIEvent
{
- readonly attribute DOMString? tokenName;
+ readonly attribute boolean isComposing;
};
-dictionary SmartCardEventInit : EventInit
+dictionary InputEventInit : UIEventInit
{
- DOMString tokenName = "";
+ boolean isComposing = false;
};
diff --git a/dom/webidl/InputMethod.webidl b/dom/webidl/InputMethod.webidl
new file mode 100644
index 000000000..75e6aa4e9
--- /dev/null
+++ b/dom/webidl/InputMethod.webidl
@@ -0,0 +1,265 @@
+/* -*- 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/.
+ */
+
+[JSImplementation="@mozilla.org/b2g-inputmethod;1",
+ NavigatorProperty="mozInputMethod",
+ Func="Navigator::HasInputMethodSupport"]
+interface MozInputMethod : EventTarget {
+ // Input Method Manager contain a few global methods expose to apps
+ readonly attribute MozInputMethodManager mgmt;
+
+ // Fired when the input context changes, include changes from and to null.
+ // The new InputContext instance will be available in the event
+ // object under |inputcontext| property. When it changes to null it
+ // means the app (the user of this API) no longer has the control of
+ // the original focused input field.
+ // Note that if the app saves the original context, it might get
+ // void; implementation decides when to void the input context.
+ attribute EventHandler oninputcontextchange;
+
+ // An "input context" is mapped to a text field that the app is
+ // allow to mutate. this attribute should be null when there is no
+ // text field currently focused.
+ readonly attribute MozInputContext? inputcontext;
+
+ [ChromeOnly]
+ // Activate or decactive current input method window.
+ void setActive(boolean isActive);
+
+ // Add a dynamically declared input.
+ //
+ // The id must not be the same with any statically declared input in the app
+ // manifest. If an input of the same id is already declared, the info of that
+ // input will be updated.
+ Promise<void> addInput(DOMString inputId, object inputManifest);
+
+ // Remove a dynamically declared input.
+ //
+ // The id must not be the same with any statically declared input in the app
+ // manifest. Silently resolves if the input is not previously declared;
+ // rejects if attempt to remove a statically declared input.
+ Promise<void> removeInput(DOMString id);
+
+ // The following are internal methods for Firefox OS system app only.
+
+ // Set the value on the currently focused element. This has to be used
+ // for special situations where the value had to be chosen amongst a
+ // list (type=month) or a widget (type=date, time, etc.).
+ // If the value passed in parameter isn't valid (in the term of HTML5
+ // Forms Validation), the value will simply be ignored by the element.
+ [Throws]
+ void setValue(DOMString value);
+
+ // Select the <select> option specified by index.
+ // If this method is called on a <select> that support multiple
+ // selection, then the option specified by index will be added to
+ // the selection.
+ // If this method is called for a select that does not support multiple
+ // selection the previous element will be unselected.
+ [Throws]
+ void setSelectedOption(long index);
+
+ // Select the <select> options specified by indexes. All other options
+ // will be deselected.
+ // If this method is called for a <select> that does not support multiple
+ // selection, then the last index specified in indexes will be selected.
+ [Throws]
+ void setSelectedOptions(sequence<long> indexes);
+
+ [Throws]
+ void removeFocus();
+};
+
+// Manages the list of IMEs, enables/disables IME and switches to an
+// IME.
+[JSImplementation="@mozilla.org/b2g-imm;1",
+ Pref="dom.mozInputMethod.enabled"]
+interface MozInputMethodManager {
+ // Ask the OS to show a list of available IMEs for users to switch from.
+ // OS should ignore this request if the app is currently not the active one.
+ void showAll();
+
+ // Ask the OS to switch away from the current active Keyboard app.
+ // OS should ignore this request if the app is currently not the active one.
+ void next();
+
+ // To know if the OS supports IME switching or not.
+ // Use case: let the keyboard app knows if it is necessary to show the "IME switching"
+ // (globe) button. We have a use case that when there is only one IME enabled, we
+ // should not show the globe icon.
+ boolean supportsSwitching();
+
+ // Ask the OS to hide the current active Keyboard app. (was: |removeFocus()|)
+ // OS should ignore this request if the app is currently not the active one.
+ // The OS will void the current input context (if it exists).
+ // This method belong to |mgmt| because we would like to allow Keyboard to access to
+ // this method w/o a input context.
+ void hide();
+};
+
+// The input context, which consists of attributes and information of current input field.
+// It also hosts the methods available to the keyboard app to mutate the input field represented.
+// An "input context" gets void when the app is no longer allowed to interact with the text field,
+// e.g., the text field does no longer exist, the app is being switched to background, and etc.
+[JSImplementation="@mozilla.org/b2g-inputcontext;1",
+ Pref="dom.mozInputMethod.enabled"]
+interface MozInputContext: EventTarget {
+ // The tag name of input field, which is enum of "input", "textarea", or "contenteditable"
+ readonly attribute DOMString? type;
+ // The type of the input field, which is enum of text, number, password, url, search, email, and so on.
+ // See http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#states-of-the-type-attribute
+ readonly attribute DOMString? inputType;
+ /*
+ * The inputmode string, representing the input mode.
+ * See http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#input-modalities:-the-inputmode-attribute
+ */
+ readonly attribute DOMString? inputMode;
+ /*
+ * The primary language for the input field.
+ * It is the value of HTMLElement.lang.
+ * See http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#htmlelement
+ */
+ readonly attribute DOMString? lang;
+ /*
+ * Get the whole text content of the input field.
+ * @return DOMString
+ */
+ Promise<DOMString> getText(optional long offset, optional long length);
+ // The start and stop position of the selection.
+ readonly attribute long selectionStart;
+ readonly attribute long selectionEnd;
+
+ // The text before and after the begining of the selected text.
+ readonly attribute DOMString? textBeforeCursor;
+ readonly attribute DOMString? textAfterCursor;
+
+ /*
+ * Set the selection range of the the editable text.
+ * Note: This method cannot be used to move the cursor during composition. Calling this
+ * method will cancel composition.
+ * @param start The beginning of the selected text.
+ * @param length The length of the selected text.
+ *
+ * Note that the start position should be less or equal to the end position.
+ * To move the cursor, set the start and end position to the same value.
+ *
+ * @return boolean
+ */
+ Promise<boolean> setSelectionRange(long start, long length);
+
+ /* User moves the cursor, or changes the selection with other means. If the text around
+ * cursor has changed, but the cursor has not been moved, the IME won't get notification.
+ *
+ * A dict is provided in the detail property of the event containing the new values, and
+ * an "ownAction" property to denote the event is the result of our own mutation to
+ * the input field.
+ */
+ attribute EventHandler onselectionchange;
+
+ /*
+ * Commit text to current input field and replace text around
+ * cursor position. It will clear the current composition.
+ *
+ * @param text The string to be replaced with.
+ * @param offset The offset from the cursor position where replacing starts. Defaults to 0.
+ * @param length The length of text to replace. Defaults to 0.
+ * @return boolean
+ */
+ Promise<boolean> replaceSurroundingText(DOMString text, optional long offset, optional long length);
+
+ /*
+ *
+ * Delete text around the cursor.
+ * @param offset The offset from the cursor position where deletion starts.
+ * @param length The length of text to delete.
+ * TODO: maybe updateSurroundingText(DOMString beforeText, DOMString afterText); ?
+ * @return boolean
+ */
+ Promise<boolean> deleteSurroundingText(long offset, long length);
+
+ /*
+ * Notifies when the text around the cursor is changed, due to either text
+ * editing or cursor movement. If the cursor has been moved, but the text around has not
+ * changed, the IME won't get notification.
+ *
+ * A dict is provided in the detail property of the event containing the new values, and
+ * an "ownAction" property to denote the event is the result of our own mutation to
+ * the input field.
+ */
+ attribute EventHandler onsurroundingtextchange;
+
+ /*
+ * send a character with its key events.
+ * @param modifiers see http://mxr.mozilla.org/mozilla-central/source/dom/interfaces/base/nsIDOMWindowUtils.idl#206
+ * @param repeat indicates whether a key would be sent repeatedly.
+ * @return true if succeeds. Otherwise false if the input context becomes void.
+ * Alternative: sendKey(KeyboardEvent event), but we will likely
+ * waste memory for creating the KeyboardEvent object.
+ * Note that, if you want to send a key n times repeatedly, make sure set
+ * parameter repeat to true and invoke sendKey n-1 times, and then set
+ * repeat to false in the last invoke.
+ */
+ Promise<boolean> sendKey(long keyCode, long charCode, long modifiers, optional boolean repeat);
+
+ /*
+ * Set current composing text. This method will start composition or update
+ * composition if it has started. The composition will be started right
+ * before the cursor position and any selected text will be replaced by the
+ * composing text. When the composition is started, calling this method can
+ * update the text and move cursor winthin the range of the composing text.
+ * @param text The new composition text to show.
+ * @param cursor The new cursor position relative to the start of the
+ * composition text. The cursor should be positioned within the composition
+ * text. This means the value should be >= 0 and <= the length of
+ * composition text. Defaults to the lenght of composition text, i.e., the
+ * cursor will be positioned after the composition text.
+ * @param clauses The array of composition clause information. If not set,
+ * only one clause is supported.
+ *
+ * The composing text, which is shown with underlined style to distinguish
+ * from the existing text, is used to compose non-ASCII characters from
+ * keystrokes, e.g. Pinyin or Hiragana. The composing text is the
+ * intermediate text to help input complex character and is not committed to
+ * current input field. Therefore if any text operation other than
+ * composition is performed, the composition will automatically end. Same
+ * apply when the inputContext is lost during an unfinished composition
+ * session.
+ *
+ * To finish composition and commit text to current input field, an IME
+ * should call |endComposition|.
+ */
+ // XXXbz what is this promise resolved with?
+ Promise<any> setComposition(DOMString text, optional long cursor,
+ optional sequence<CompositionClauseParameters> clauses);
+
+ /*
+ * End composition, clear the composing text and commit given text to
+ * current input field. The text will be committed before the cursor
+ * position.
+ * @param text The text to commited before cursor position. If empty string
+ * is given, no text will be committed.
+ *
+ * Note that composition always ends automatically with nothing to commit if
+ * the composition does not explicitly end by calling |endComposition|, but
+ * is interrupted by |sendKey|, |setSelectionRange|,
+ * |replaceSurroundingText|, |deleteSurroundingText|, user moving the
+ * cursor, changing the focus, etc.
+ */
+ // XXXbz what is this promise resolved with?
+ Promise<any> endComposition(optional DOMString text);
+};
+
+enum CompositionClauseSelectionType {
+ "raw-input",
+ "selected-raw-text",
+ "converted-text",
+ "selected-converted-text"
+};
+
+dictionary CompositionClauseParameters {
+ DOMString selectionType = "raw-input";
+ long length;
+};
diff --git a/dom/webidl/InspectorUtils.webidl b/dom/webidl/InspectorUtils.webidl
index 2f73a839d..289fafaf5 100644
--- a/dom/webidl/InspectorUtils.webidl
+++ b/dom/webidl/InspectorUtils.webidl
@@ -14,3 +14,16 @@ dictionary InspectorRGBTriple {
octet g = 0;
octet b = 0;
};
+
+dictionary InspectorRGBATuple {
+ /*
+ * NOTE: This tuple is in the normal 0-255-sized RGB space but can be
+ * fractional and may extend outside the 0-255 range.
+ *
+ * a is in the range 0 - 1.
+ */
+ double r = 0;
+ double g = 0;
+ double b = 0;
+ double a = 1;
+};
diff --git a/dom/webidl/InstallEvent.webidl b/dom/webidl/InstallEvent.webidl
new file mode 100644
index 000000000..aeb436077
--- /dev/null
+++ b/dom/webidl/InstallEvent.webidl
@@ -0,0 +1,21 @@
+/* -*- 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/.
+ *
+ * For more information on this interface, please see
+ * http://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html
+ */
+
+[Constructor(DOMString type, optional InstallEventInit eventInitDict),
+ Exposed=ServiceWorker]
+interface InstallEvent : ExtendableEvent {
+ readonly attribute ServiceWorker? activeWorker;
+ void replace();
+};
+
+// Should be in the spec soon to satisfy conventions about events.
+// https://github.com/slightlyoff/ServiceWorker/issues/216.
+dictionary InstallEventInit : ExtendableEventInit {
+ ServiceWorker? activeWorker = null;
+};
diff --git a/dom/webidl/InstallTrigger.webidl b/dom/webidl/InstallTrigger.webidl
new file mode 100644
index 000000000..789fb2bc4
--- /dev/null
+++ b/dom/webidl/InstallTrigger.webidl
@@ -0,0 +1,90 @@
+/* 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/.
+ */
+
+
+/**
+ * A callback function that webpages can implement to be notified when triggered
+ * installs complete.
+ */
+callback InstallTriggerCallback = void(DOMString url, short status);
+
+dictionary InstallTriggerData {
+ DOMString URL;
+ DOMString? IconURL;
+ DOMString? Hash;
+};
+
+/**
+ * The interface for the InstallTrigger object available to all websites.
+ */
+[ChromeOnly,
+ JSImplementation="@mozilla.org/addons/installtrigger;1"]
+interface InstallTriggerImpl {
+ /**
+ * Retained for backwards compatibility.
+ */
+ const unsigned short SKIN = 1;
+ const unsigned short LOCALE = 2;
+ const unsigned short CONTENT = 4;
+ const unsigned short PACKAGE = 7;
+
+ /**
+ * Tests if installation is enabled.
+ */
+ boolean enabled();
+
+ /**
+ * Tests if installation is enabled.
+ *
+ * @deprecated Use "enabled" in the future.
+ */
+ boolean updateEnabled();
+
+ /**
+ * Starts a new installation of a set of add-ons.
+ *
+ * @param aArgs
+ * The add-ons to install. This should be a JS object, each property
+ * is the name of an add-on to be installed. The value of the
+ * property should either be a string URL, or an object with the
+ * following properties:
+ * * URL for the add-on's URL
+ * * IconURL for an icon for the add-on
+ * * Hash for a hash of the add-on
+ * @param aCallback
+ * A callback to call as each installation succeeds or fails
+ * @return true if the installations were successfully started
+ */
+ boolean install(MozMap<(DOMString or InstallTriggerData)> installs,
+ optional InstallTriggerCallback callback);
+
+ /**
+ * Starts installing a new add-on.
+ *
+ * @deprecated use "install" in the future.
+ *
+ * @param aType
+ * Unused, retained for backwards compatibility
+ * @param aUrl
+ * The URL of the add-on
+ * @param aSkin
+ * Unused, retained for backwards compatibility
+ * @return true if the installation was successfully started
+ */
+ boolean installChrome(unsigned short type, DOMString url, DOMString skin);
+
+ /**
+ * Starts installing a new add-on.
+ *
+ * @deprecated use "install" in the future.
+ *
+ * @param aUrl
+ * The URL of the add-on
+ * @param aFlags
+ * Unused, retained for backwards compatibility
+ * @return true if the installation was successfully started
+ */
+ boolean startSoftwareUpdate(DOMString url, optional unsigned short flags);
+};
diff --git a/dom/webidl/InterAppConnection.webidl b/dom/webidl/InterAppConnection.webidl
new file mode 100644
index 000000000..710f9978d
--- /dev/null
+++ b/dom/webidl/InterAppConnection.webidl
@@ -0,0 +1,15 @@
+/* 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/. */
+
+[HeaderFile="mozilla/dom/InterAppComm.h",
+ Func="mozilla::dom::InterAppComm::EnabledForScope",
+ Constructor(DOMString keyword, DOMString publisher, DOMString subsriber),
+ JSImplementation="@mozilla.org/dom/inter-app-connection;1"]
+interface MozInterAppConnection {
+ readonly attribute DOMString keyword;
+ readonly attribute DOMString publisher;
+ readonly attribute DOMString subscriber;
+
+ void cancel();
+};
diff --git a/dom/webidl/InterAppConnectionRequest.webidl b/dom/webidl/InterAppConnectionRequest.webidl
new file mode 100644
index 000000000..d90d1c00f
--- /dev/null
+++ b/dom/webidl/InterAppConnectionRequest.webidl
@@ -0,0 +1,13 @@
+/* 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/. */
+
+[HeaderFile="mozilla/dom/InterAppComm.h",
+ Func="mozilla::dom::InterAppComm::EnabledForScope",
+ Constructor(DOMString keyword, MozInterAppMessagePort port),
+ JSImplementation="@mozilla.org/dom/inter-app-connection-request;1"]
+interface MozInterAppConnectionRequest {
+ readonly attribute DOMString keyword;
+
+ readonly attribute MozInterAppMessagePort port;
+};
diff --git a/dom/webidl/InterAppMessagePort.webidl b/dom/webidl/InterAppMessagePort.webidl
new file mode 100644
index 000000000..9f23f9b89
--- /dev/null
+++ b/dom/webidl/InterAppMessagePort.webidl
@@ -0,0 +1,24 @@
+/* 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/. */
+
+// TODO Bug 907060 Per off-line discussion, after the MessagePort is done
+// at Bug 643325, we will start to refactorize the common logic of both
+// Inter-App Communication and Shared Worker. For now, we hope to design an
+// MozInterAppMessagePort to meet the timeline, which still follows exactly
+// the same interface and semantic as the MessagePort is. In the future,
+// we can then align it back to MessagePort with backward compatibility.
+
+[HeaderFile="mozilla/dom/InterAppComm.h",
+ Func="mozilla::dom::InterAppComm::EnabledForScope",
+ Constructor(DOMString messagePortID),
+ JSImplementation="@mozilla.org/dom/inter-app-message-port;1"]
+interface MozInterAppMessagePort : EventTarget {
+ void postMessage(any message);
+
+ void start();
+
+ void close();
+
+ attribute EventHandler onmessage;
+};
diff --git a/dom/webidl/KeyAlgorithm.webidl b/dom/webidl/KeyAlgorithm.webidl
new file mode 100644
index 000000000..260b1e624
--- /dev/null
+++ b/dom/webidl/KeyAlgorithm.webidl
@@ -0,0 +1,37 @@
+/* -*- 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/WebCryptoAPI/
+ */
+
+dictionary KeyAlgorithm {
+ required DOMString name;
+};
+
+dictionary AesKeyAlgorithm : KeyAlgorithm {
+ required unsigned short length;
+};
+
+dictionary EcKeyAlgorithm : KeyAlgorithm {
+ required DOMString namedCurve;
+};
+
+dictionary HmacKeyAlgorithm : KeyAlgorithm {
+ required KeyAlgorithm hash;
+ required unsigned long length;
+};
+
+dictionary RsaHashedKeyAlgorithm : KeyAlgorithm {
+ required unsigned short modulusLength;
+ required Uint8Array publicExponent;
+ required KeyAlgorithm hash;
+};
+
+dictionary DhKeyAlgorithm : KeyAlgorithm {
+ required Uint8Array prime;
+ required Uint8Array generator;
+};
+
diff --git a/dom/webidl/KeyEvent.webidl b/dom/webidl/KeyEvent.webidl
index f29ff946c..37ff7fc2e 100644
--- a/dom/webidl/KeyEvent.webidl
+++ b/dom/webidl/KeyEvent.webidl
@@ -4,8 +4,6 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-interface WindowProxy;
-
// http://www.w3.org/TR/1999/WD-DOM-Level-2-19990923/events.html#Events-KeyEvent
interface KeyEvent
{
@@ -15,7 +13,9 @@ interface KeyEvent
const unsigned long DOM_VK_TAB = 0x09;
const unsigned long DOM_VK_CLEAR = 0x0C;
const unsigned long DOM_VK_RETURN = 0x0D;
- const unsigned long DOM_VK_ENTER = 0x0E;
+ // DOM_VK_ENTER has been never used for representing native key events.
+ // Therefore, it's removed for preventing developers being confused.
+ // const unsigned long DOM_VK_ENTER = 0x0E;
const unsigned long DOM_VK_SHIFT = 0x10;
const unsigned long DOM_VK_CONTROL = 0x11;
const unsigned long DOM_VK_ALT = 0x12;
@@ -228,7 +228,7 @@ interface KeyEvent
void initKeyEvent(DOMString type,
boolean canBubble,
boolean cancelable,
- WindowProxy? view,
+ Window? view,
boolean ctrlKey,
boolean altKey,
boolean shiftKey,
diff --git a/dom/webidl/KeyboardEvent.webidl b/dom/webidl/KeyboardEvent.webidl
index b6a295969..274a6d6c2 100644
--- a/dom/webidl/KeyboardEvent.webidl
+++ b/dom/webidl/KeyboardEvent.webidl
@@ -4,8 +4,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-interface WindowProxy;
-
+[Constructor(DOMString typeArg, optional KeyboardEventInit keyboardEventInitDict)]
interface KeyboardEvent : UIEvent
{
readonly attribute unsigned long charCode;
@@ -22,12 +21,32 @@ interface KeyboardEvent : UIEvent
const unsigned long DOM_KEY_LOCATION_LEFT = 0x01;
const unsigned long DOM_KEY_LOCATION_RIGHT = 0x02;
const unsigned long DOM_KEY_LOCATION_NUMPAD = 0x03;
- const unsigned long DOM_KEY_LOCATION_MOBILE = 0x04;
- const unsigned long DOM_KEY_LOCATION_JOYSTICK = 0x05;
readonly attribute unsigned long location;
+ readonly attribute boolean repeat;
+ readonly attribute boolean isComposing;
readonly attribute DOMString key;
+ [Pref="dom.keyboardevent.code.enabled"]
+ readonly attribute DOMString code;
+};
+
+dictionary KeyboardEventInit : UIEventInit
+{
+ DOMString key = "";
+ DOMString code = "";
+ unsigned long location = 0;
+ boolean ctrlKey = false;
+ boolean shiftKey = false;
+ boolean altKey = false;
+ boolean metaKey = false;
+ boolean repeat = false;
+ boolean isComposing = false;
+
+ // legacy attributes
+ unsigned long charCode = 0;
+ unsigned long keyCode = 0;
+ unsigned long which = 0;
};
// Mozilla extensions
diff --git a/dom/webidl/LegacyQueryInterface.webidl b/dom/webidl/LegacyQueryInterface.webidl
new file mode 100644
index 000000000..4222e609e
--- /dev/null
+++ b/dom/webidl/LegacyQueryInterface.webidl
@@ -0,0 +1,91 @@
+/* -*- 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/.
+ */
+
+interface nsISupports;
+interface IID;
+
+[NoInterfaceObject,
+ // Need Exposed here, because this is a mixin onto things like Event
+ // that are exposed in workers.
+ Exposed=(Window,Worker,System)]
+interface LegacyQueryInterface {
+ // Legacy QueryInterface, only exposed to chrome or XBL code on the
+ // main thread.
+ [Exposed=Window]
+ nsISupports queryInterface(IID iid);
+};
+
+Attr implements LegacyQueryInterface;
+BarProp implements LegacyQueryInterface;
+BoxObject implements LegacyQueryInterface;
+CaretPosition implements LegacyQueryInterface;
+Comment implements LegacyQueryInterface;
+Crypto implements LegacyQueryInterface;
+CSSPrimitiveValue implements LegacyQueryInterface;
+CSSStyleDeclaration implements LegacyQueryInterface;
+CSSValueList implements LegacyQueryInterface;
+DOMImplementation implements LegacyQueryInterface;
+DOMParser implements LegacyQueryInterface;
+DOMStringMap implements LegacyQueryInterface;
+DOMTokenList implements LegacyQueryInterface;
+Document implements LegacyQueryInterface;
+DocumentFragment implements LegacyQueryInterface;
+DocumentType implements LegacyQueryInterface;
+Element implements LegacyQueryInterface;
+Event implements LegacyQueryInterface;
+EventSource implements LegacyQueryInterface;
+FileList implements LegacyQueryInterface;
+FormData implements LegacyQueryInterface;
+HTMLCollection implements LegacyQueryInterface;
+History implements LegacyQueryInterface;
+MimeTypeArray implements LegacyQueryInterface;
+NamedNodeMap implements LegacyQueryInterface;
+MutationObserver implements LegacyQueryInterface;
+MutationRecord implements LegacyQueryInterface;
+Navigator implements LegacyQueryInterface;
+NodeIterator implements LegacyQueryInterface;
+NodeList implements LegacyQueryInterface;
+Notification implements LegacyQueryInterface;
+OfflineResourceList implements LegacyQueryInterface;
+PaintRequest implements LegacyQueryInterface;
+PaintRequestList implements LegacyQueryInterface;
+Performance implements LegacyQueryInterface;
+Plugin implements LegacyQueryInterface;
+PluginArray implements LegacyQueryInterface;
+ProcessingInstruction implements LegacyQueryInterface;
+Range implements LegacyQueryInterface;
+Rect implements LegacyQueryInterface;
+Selection implements LegacyQueryInterface;
+SVGAnimatedEnumeration implements LegacyQueryInterface;
+SVGAnimatedInteger implements LegacyQueryInterface;
+SVGAnimatedNumber implements LegacyQueryInterface;
+SVGAnimatedNumberList implements LegacyQueryInterface;
+SVGAnimatedPreserveAspectRatio implements LegacyQueryInterface;
+SVGAnimatedString implements LegacyQueryInterface;
+SVGLengthList implements LegacyQueryInterface;
+SVGNumberList implements LegacyQueryInterface;
+SVGPathSegList implements LegacyQueryInterface;
+SVGPoint implements LegacyQueryInterface;
+SVGPointList implements LegacyQueryInterface;
+SVGPreserveAspectRatio implements LegacyQueryInterface;
+SVGRect implements LegacyQueryInterface;
+SVGStringList implements LegacyQueryInterface;
+SVGTransformList implements LegacyQueryInterface;
+Screen implements LegacyQueryInterface;
+StyleSheet implements LegacyQueryInterface;
+Text implements LegacyQueryInterface;
+Touch implements LegacyQueryInterface;
+TouchList implements LegacyQueryInterface;
+TreeColumns implements LegacyQueryInterface;
+TreeWalker implements LegacyQueryInterface;
+UndoManager implements LegacyQueryInterface;
+ValidityState implements LegacyQueryInterface;
+WebSocket implements LegacyQueryInterface;
+Window implements LegacyQueryInterface;
+XMLHttpRequest implements LegacyQueryInterface;
+XMLHttpRequestUpload implements LegacyQueryInterface;
+XMLSerializer implements LegacyQueryInterface;
+XPathEvaluator implements LegacyQueryInterface;
diff --git a/dom/webidl/ListBoxObject.webidl b/dom/webidl/ListBoxObject.webidl
new file mode 100644
index 000000000..5e11e923f
--- /dev/null
+++ b/dom/webidl/ListBoxObject.webidl
@@ -0,0 +1,21 @@
+
+/* -*- 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/.
+ */
+
+[NoInterfaceObject]
+interface ListBoxObject : BoxObject {
+
+ long getRowCount();
+ long getNumberOfVisibleRows();
+ long getIndexOfFirstVisibleRow();
+
+ void ensureIndexIsVisible(long rowIndex);
+ void scrollToIndex(long rowIndex);
+ void scrollByLines(long numLines);
+
+ Element? getItemAtIndex(long index);
+ long getIndexOfItem(Element item);
+};
diff --git a/dom/webidl/Location.webidl b/dom/webidl/Location.webidl
index 33d4c2e0d..c38842e67 100644
--- a/dom/webidl/Location.webidl
+++ b/dom/webidl/Location.webidl
@@ -11,11 +11,16 @@
* and create derivative works of this document.
*/
-// No support for [Unforgeable] on interfaces yet
-//[Unforgeable]
+[Unforgeable]
interface Location {
+ [Throws, UnsafeInPrerendering]
void assign(DOMString url);
+ [Throws, CrossOriginCallable, UnsafeInPrerendering]
void replace(DOMString url);
- void reload();
+ // XXXbz there is no forceget argument in the spec! See bug 1037721.
+ [Throws, UnsafeInPrerendering]
+ void reload(optional boolean forceget = false);
};
+// No support for .searchParams on Location yet. See bug 1082734.
+
Location implements URLUtils;
diff --git a/dom/webidl/MMICall.webidl b/dom/webidl/MMICall.webidl
new file mode 100644
index 000000000..670c8ffc8
--- /dev/null
+++ b/dom/webidl/MMICall.webidl
@@ -0,0 +1,13 @@
+/* -*- 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/.
+ */
+
+[Pref="dom.telephony.enabled",
+ CheckPermissions="telephony",
+ AvailableIn="CertifiedApps"]
+interface MMICall {
+ [Throws]
+ readonly attribute Promise<MozMMIResult> result;
+};
diff --git a/dom/webidl/MediaDevices.webidl b/dom/webidl/MediaDevices.webidl
new file mode 100644
index 000000000..b658fd867
--- /dev/null
+++ b/dom/webidl/MediaDevices.webidl
@@ -0,0 +1,23 @@
+/* -*- 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://dev.w3.org/2011/webrtc/editor/getusermedia.html
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+[Func="Navigator::HasUserMediaSupport"]
+interface MediaDevices : EventTarget {
+// attribute EventHandler ondevicechange;
+//
+// void enumerateDevices (MediaDeviceInfoCallback resultCallback);
+//
+// static Dictionary getSupportedConstraints (DOMString kind);
+
+ [Throws, Func="Navigator::HasUserMediaSupport"]
+ Promise<MediaStream> getUserMedia(optional MediaStreamConstraints constraints);
+};
diff --git a/dom/webidl/MediaElementAudioSourceNode.webidl b/dom/webidl/MediaElementAudioSourceNode.webidl
new file mode 100644
index 000000000..0b1355f5d
--- /dev/null
+++ b/dom/webidl/MediaElementAudioSourceNode.webidl
@@ -0,0 +1,19 @@
+/* -*- 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
+ * https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+interface MediaElementAudioSourceNode : AudioNode {
+
+};
+
+// Mozilla extensions
+MediaElementAudioSourceNode implements AudioNodePassThrough;
+
diff --git a/dom/webidl/MediaList.webidl b/dom/webidl/MediaList.webidl
new file mode 100644
index 000000000..44e733190
--- /dev/null
+++ b/dom/webidl/MediaList.webidl
@@ -0,0 +1,19 @@
+/* -*- 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/. */
+
+// http://dev.w3.org/csswg/cssom/#the-medialist-interface
+
+[ArrayClass]
+interface MediaList {
+ [TreatNullAs=EmptyString]
+ attribute DOMString mediaText;
+
+ readonly attribute unsigned long length;
+ getter DOMString? item(unsigned long index);
+ [Throws]
+ void deleteMedium(DOMString oldMedium);
+ [Throws]
+ void appendMedium(DOMString newMedium);
+};
diff --git a/dom/webidl/MediaQueryList.webidl b/dom/webidl/MediaQueryList.webidl
new file mode 100644
index 000000000..519ddb0e5
--- /dev/null
+++ b/dom/webidl/MediaQueryList.webidl
@@ -0,0 +1,20 @@
+/* -*- 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://dev.w3.org/csswg/cssom-view/#the-mediaquerylist-interface
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+interface MediaQueryList {
+ readonly attribute DOMString media;
+ readonly attribute boolean matches;
+ void addListener(MediaQueryListListener listener);
+ void removeListener(MediaQueryListListener listener);
+};
+
+callback MediaQueryListListener = void (MediaQueryList list);
diff --git a/dom/webidl/MediaRecorder.webidl b/dom/webidl/MediaRecorder.webidl
new file mode 100644
index 000000000..d3caca1cc
--- /dev/null
+++ b/dom/webidl/MediaRecorder.webidl
@@ -0,0 +1,54 @@
+/* -*- 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
+ * https://dvcs.w3.org/hg/dap/raw-file/default/media-stream-capture/MediaRecorder.html
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+enum RecordingState { "inactive", "recording", "paused" };
+
+[Constructor(MediaStream stream, optional MediaRecorderOptions options),
+ Constructor(AudioNode node, optional unsigned long output = 0,
+ optional MediaRecorderOptions options)]
+interface MediaRecorder : EventTarget {
+
+ readonly attribute MediaStream stream;
+
+ readonly attribute RecordingState state;
+
+ readonly attribute DOMString mimeType;
+
+ attribute EventHandler ondataavailable;
+
+ attribute EventHandler onerror;
+
+ attribute EventHandler onstart;
+
+ attribute EventHandler onstop;
+
+ attribute EventHandler onwarning;
+
+ [Throws]
+ void start(optional long timeSlice);
+
+ [Throws]
+ void stop();
+
+ [Throws]
+ void pause();
+
+ [Throws]
+ void resume();
+
+ [Throws]
+ void requestData();
+};
+
+dictionary MediaRecorderOptions {
+ DOMString mimeType = ""; // Default encoding mimeType.
+};
diff --git a/dom/webidl/MediaSource.webidl b/dom/webidl/MediaSource.webidl
new file mode 100644
index 000000000..562f8ebb8
--- /dev/null
+++ b/dom/webidl/MediaSource.webidl
@@ -0,0 +1,40 @@
+/* -*- 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://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+enum MediaSourceReadyState {
+ "closed",
+ "open",
+ "ended"
+};
+
+enum MediaSourceEndOfStreamError {
+ "network",
+ "decode"
+};
+
+[Constructor, Func="mozilla::dom::MediaSource::Enabled"]
+interface MediaSource : EventTarget {
+ readonly attribute SourceBufferList sourceBuffers;
+ readonly attribute SourceBufferList activeSourceBuffers;
+ readonly attribute MediaSourceReadyState readyState;
+ [SetterThrows]
+ attribute unrestricted double duration;
+ [NewObject, Throws]
+ SourceBuffer addSourceBuffer(DOMString type);
+ [Throws]
+ void removeSourceBuffer(SourceBuffer sourceBuffer);
+ [Throws]
+ void endOfStream(optional MediaSourceEndOfStreamError error);
+ static boolean isTypeSupported(DOMString type);
+ [ChromeOnly]
+ readonly attribute DOMString mozDebugReaderData;
+};
diff --git a/dom/webidl/MediaStream.webidl b/dom/webidl/MediaStream.webidl
index 7c1cc6df8..b19b08f68 100644
--- a/dom/webidl/MediaStream.webidl
+++ b/dom/webidl/MediaStream.webidl
@@ -10,10 +10,28 @@
* liability, trademark and document use rules apply.
*/
-interface MediaStream {
- // readonly attribute DOMString id;
- sequence<AudioStreamTrack> getAudioTracks ();
- sequence<VideoStreamTrack> getVideoTracks ();
+// These dictionaries need to be in a separate file from their
+// MediaTrackConstraints* counterparts due to a webidl compiler limitation.
+
+dictionary MediaStreamConstraints {
+ (boolean or MediaTrackConstraints) audio = false;
+ (boolean or MediaTrackConstraints) video = false;
+ boolean picture = false; // Mozilla legacy
+ boolean fake = false; // For testing purpose. Generates frames of solid
+ // colors if video is enabled, and sound of 1Khz sine
+ // wave if audio is enabled.
+ boolean fakeTracks = false; // For testing purpose, works only if fake is
+ // enabled. Enable fakeTracks returns a stream
+ // with two extra empty video tracks and three
+ // extra empty audio tracks.
+ DOMString? peerIdentity = null;
+};
+
+interface MediaStream : EventTarget {
+ readonly attribute DOMString id;
+ sequence<AudioStreamTrack> getAudioTracks();
+ sequence<VideoStreamTrack> getVideoTracks();
+ sequence<MediaStreamTrack> getTracks();
// MediaStreamTrack getTrackById (DOMString trackId);
// void addTrack (MediaStreamTrack track);
// void removeTrack (MediaStreamTrack track);
diff --git a/dom/webidl/MediaStreamAudioDestinationNode.webidl b/dom/webidl/MediaStreamAudioDestinationNode.webidl
index 8bcee5795..b4bf503a6 100644
--- a/dom/webidl/MediaStreamAudioDestinationNode.webidl
+++ b/dom/webidl/MediaStreamAudioDestinationNode.webidl
@@ -10,9 +10,8 @@
* liability, trademark and document use rules apply.
*/
-[PrefControlled]
interface MediaStreamAudioDestinationNode : AudioNode {
readonly attribute MediaStream stream;
-}; \ No newline at end of file
+};
diff --git a/dom/webidl/MediaStreamAudioSourceNode.webidl b/dom/webidl/MediaStreamAudioSourceNode.webidl
new file mode 100644
index 000000000..495548a8e
--- /dev/null
+++ b/dom/webidl/MediaStreamAudioSourceNode.webidl
@@ -0,0 +1,19 @@
+/* -*- 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
+ * https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+interface MediaStreamAudioSourceNode : AudioNode {
+
+};
+
+// Mozilla extensions
+MediaStreamAudioSourceNode implements AudioNodePassThrough;
+
diff --git a/dom/webidl/MediaStreamError.webidl b/dom/webidl/MediaStreamError.webidl
new file mode 100644
index 000000000..c6df0587d
--- /dev/null
+++ b/dom/webidl/MediaStreamError.webidl
@@ -0,0 +1,21 @@
+/* -*- 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://w3c.github.io/mediacapture-main/getusermedia.html#idl-def-MediaStreamError
+ */
+
+// The future of MediaStreamError is uncertain.
+// https://www.w3.org/Bugs/Public/show_bug.cgi?id=26776
+
+// TODO: This is an 'exception', not an interface, by virtue of needing to be
+// passed as a promise rejection-reason. Revisit if DOMException grows a customArg
+
+[ExceptionClass, NoInterfaceObject]
+interface MediaStreamError {
+ readonly attribute DOMString name;
+ readonly attribute DOMString? message;
+ readonly attribute DOMString? constraintName;
+};
diff --git a/dom/webidl/MediaStreamEvent.webidl b/dom/webidl/MediaStreamEvent.webidl
index b2800e3de..56bac3a86 100644
--- a/dom/webidl/MediaStreamEvent.webidl
+++ b/dom/webidl/MediaStreamEvent.webidl
@@ -12,7 +12,6 @@ dictionary MediaStreamEventInit : EventInit {
};
[Pref="media.peerconnection.enabled",
- JSImplementation="@mozilla.org/dom/mediastreamevent;1",
Constructor(DOMString type, optional MediaStreamEventInit eventInitDict)]
interface MediaStreamEvent : Event {
readonly attribute MediaStream? stream;
diff --git a/dom/webidl/MediaStreamList.webidl b/dom/webidl/MediaStreamList.webidl
index f105c9abd..b72e9d212 100644
--- a/dom/webidl/MediaStreamList.webidl
+++ b/dom/webidl/MediaStreamList.webidl
@@ -4,7 +4,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-[NoInterfaceObject]
+[ChromeOnly]
interface MediaStreamList {
getter MediaStream? (unsigned long index);
readonly attribute unsigned long length;
diff --git a/dom/webidl/MediaStreamTrack.webidl b/dom/webidl/MediaStreamTrack.webidl
index 891e486cc..12d8b32eb 100644
--- a/dom/webidl/MediaStreamTrack.webidl
+++ b/dom/webidl/MediaStreamTrack.webidl
@@ -10,6 +10,10 @@
* liability, trademark and document use rules apply.
*/
+dictionary MediaTrackConstraints : MediaTrackConstraintSet {
+ sequence<MediaTrackConstraintSet> advanced;
+};
+
interface MediaStreamTrack {
readonly attribute DOMString kind;
readonly attribute DOMString id;
@@ -29,5 +33,5 @@ interface MediaStreamTrack {
// void prependConstraint (DOMString constraintName, any constraintValue);
// void appendConstraint (DOMString constraintName, any constraintValue);
// attribute EventHandler onoverconstrained;
-// void stop ();
+ void stop ();
};
diff --git a/dom/webidl/MediaStreamTrackEvent.webidl b/dom/webidl/MediaStreamTrackEvent.webidl
new file mode 100644
index 000000000..a2ad8efce
--- /dev/null
+++ b/dom/webidl/MediaStreamTrackEvent.webidl
@@ -0,0 +1,22 @@
+/* -*- 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://dev.w3.org/2011/webrtc/editor/webrtc.html#mediastreamevent
+ */
+
+dictionary MediaStreamTrackEventInit : EventInit {
+ MediaStreamTrack? track = null;
+ RTCRtpReceiver? receiver = null;
+ MediaStream? stream = null;
+};
+
+[Pref="media.peerconnection.enabled",
+ Constructor(DOMString type, optional MediaStreamTrackEventInit eventInitDict)]
+interface MediaStreamTrackEvent : Event {
+ readonly attribute RTCRtpReceiver? receiver;
+ readonly attribute MediaStreamTrack? track;
+ readonly attribute MediaStream? stream;
+};
diff --git a/dom/webidl/MediaTrackConstraintSet.webidl b/dom/webidl/MediaTrackConstraintSet.webidl
new file mode 100644
index 000000000..f7f5b4d93
--- /dev/null
+++ b/dom/webidl/MediaTrackConstraintSet.webidl
@@ -0,0 +1,38 @@
+/* -*- 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://dev.w3.org/2011/webrtc/editor/getusermedia.html
+ */
+
+enum SupportedVideoConstraints {
+ "other",
+ "facingMode",
+ "width",
+ "height",
+ "frameRate",
+ "mediaSource",
+ "browserWindow",
+ "scrollWithPage"
+};
+
+enum SupportedAudioConstraints {
+ "other"
+};
+
+dictionary MediaTrackConstraintSet {
+ ConstrainLong width;
+ ConstrainLong height;
+ ConstrainDouble frameRate;
+ ConstrainDOMString facingMode;
+ DOMString mediaSource = "camera";
+ long long browserWindow;
+ boolean scrollWithPage;
+};
+
+typedef (long or ConstrainLongRange) ConstrainLong;
+typedef (double or ConstrainDoubleRange) ConstrainDouble;
+typedef (boolean or ConstrainBooleanParameters) ConstrainBoolean;
+typedef (DOMString or sequence<DOMString> or ConstrainDOMStringParameters) ConstrainDOMString;
diff --git a/dom/webidl/MenuBoxObject.webidl b/dom/webidl/MenuBoxObject.webidl
new file mode 100644
index 000000000..449cadc59
--- /dev/null
+++ b/dom/webidl/MenuBoxObject.webidl
@@ -0,0 +1,19 @@
+
+/* -*- 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/.
+ */
+
+[Func="IsChromeOrXBL"]
+interface MenuBoxObject : BoxObject {
+
+ void openMenu(boolean openFlag);
+
+ attribute Element? activeChild;
+
+ boolean handleKeyPress(KeyboardEvent keyEvent);
+
+ readonly attribute boolean openedWithKey;
+
+};
diff --git a/dom/webidl/MessageChannel.webidl b/dom/webidl/MessageChannel.webidl
new file mode 100644
index 000000000..34de4b46e
--- /dev/null
+++ b/dom/webidl/MessageChannel.webidl
@@ -0,0 +1,14 @@
+/* -*- 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/.
+ *
+ * For more information on this interface, please see
+ * http://www.whatwg.org/specs/web-apps/current-work/#channel-messaging
+ */
+
+[Constructor, Func="MessageChannel::Enabled"]
+interface MessageChannel {
+ readonly attribute MessagePort port1;
+ readonly attribute MessagePort port2;
+};
diff --git a/dom/webidl/MessageEvent.webidl b/dom/webidl/MessageEvent.webidl
index 4a1e7dbc3..a663540f2 100644
--- a/dom/webidl/MessageEvent.webidl
+++ b/dom/webidl/MessageEvent.webidl
@@ -7,10 +7,9 @@
* http://www.whatwg.org/specs/web-apps/current-work/#messageevent
*/
-interface WindowProxy;
-
-interface MessageEvent : Event
-{
+[Constructor(DOMString type, optional MessageEventInit eventInitDict),
+ Exposed=(Window,Worker,System)]
+interface MessageEvent : Event {
/**
* Custom data associated with this event.
*/
@@ -32,21 +31,22 @@ interface MessageEvent : Event
readonly attribute DOMString lastEventId;
/**
- * The window which originated this event.
+ * The window or the port which originated this event.
*/
- readonly attribute WindowProxy? source;
+ readonly attribute (WindowProxy or MessagePort)? source;
/**
* Initializes this event with the given data, in a manner analogous to
* the similarly-named method on the nsIDOMEvent interface, also setting the
* data, origin, source, and lastEventId attributes of this appropriately.
*/
- [Throws]
- void initMessageEvent(DOMString aType,
- boolean aCanBubble,
- boolean aCancelable,
- any aData,
- DOMString aOrigin,
- DOMString aLastEventId,
- WindowProxy? aSource);
+ readonly attribute MessagePortList? ports;
+};
+
+dictionary MessageEventInit : EventInit {
+ any data;
+ DOMString origin;
+ DOMString lastEventId;
+ (Window or MessagePort)? source = null;
+ sequence<MessagePort>? ports;
};
diff --git a/dom/webidl/MessagePort.webidl b/dom/webidl/MessagePort.webidl
new file mode 100644
index 000000000..59c61a714
--- /dev/null
+++ b/dom/webidl/MessagePort.webidl
@@ -0,0 +1,21 @@
+/* -*- 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/.
+ *
+ * For more information on this interface, please see
+ * http://www.whatwg.org/specs/web-apps/current-work/#channel-messaging
+ */
+
+[Exposed=(Window,Worker,System)]
+interface MessagePort : EventTarget {
+ [Throws]
+ void postMessage(any message, optional sequence<Transferable> transferable);
+
+ void start();
+ void close();
+
+ // event handlers
+ attribute EventHandler onmessage;
+};
+// MessagePort implements Transferable;
diff --git a/dom/webidl/MessagePortList.webidl b/dom/webidl/MessagePortList.webidl
new file mode 100644
index 000000000..bcf729f2a
--- /dev/null
+++ b/dom/webidl/MessagePortList.webidl
@@ -0,0 +1,11 @@
+/* -*- 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/.
+ */
+
+[NoInterfaceObject, ArrayClass, Exposed=(Window,Worker,System)]
+interface MessagePortList {
+ readonly attribute unsigned long length;
+ getter MessagePort? item(unsigned long index);
+};
diff --git a/dom/webidl/MimeType.webidl b/dom/webidl/MimeType.webidl
new file mode 100644
index 000000000..a33d31640
--- /dev/null
+++ b/dom/webidl/MimeType.webidl
@@ -0,0 +1,12 @@
+/* -*- 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/.
+ */
+
+interface MimeType {
+ readonly attribute DOMString description;
+ readonly attribute Plugin? enabledPlugin;
+ readonly attribute DOMString suffixes;
+ readonly attribute DOMString type;
+};
diff --git a/dom/webidl/MimeTypeArray.webidl b/dom/webidl/MimeTypeArray.webidl
new file mode 100644
index 000000000..0187f8413
--- /dev/null
+++ b/dom/webidl/MimeTypeArray.webidl
@@ -0,0 +1,12 @@
+/* -*- 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/.
+ */
+
+interface MimeTypeArray {
+ readonly attribute unsigned long length;
+
+ getter MimeType? item(unsigned long index);
+ getter MimeType? namedItem(DOMString name);
+};
diff --git a/dom/webidl/MouseEvent.webidl b/dom/webidl/MouseEvent.webidl
index 69bd00408..ee29f1166 100644
--- a/dom/webidl/MouseEvent.webidl
+++ b/dom/webidl/MouseEvent.webidl
@@ -15,19 +15,22 @@ interface MouseEvent : UIEvent {
readonly attribute long screenY;
readonly attribute long clientX;
readonly attribute long clientY;
+ readonly attribute long offsetX;
+ readonly attribute long offsetY;
readonly attribute boolean ctrlKey;
readonly attribute boolean shiftKey;
readonly attribute boolean altKey;
readonly attribute boolean metaKey;
- readonly attribute unsigned short button;
+ readonly attribute short button;
readonly attribute unsigned short buttons;
readonly attribute EventTarget? relatedTarget;
+ readonly attribute DOMString? region;
// Deprecated in DOM Level 3:
[Throws]
void initMouseEvent(DOMString typeArg,
boolean canBubbleArg,
boolean cancelableArg,
- WindowProxy? viewArg,
+ Window? viewArg,
long detailArg,
long screenXArg,
long screenYArg,
@@ -37,7 +40,7 @@ interface MouseEvent : UIEvent {
boolean altKeyArg,
boolean shiftKeyArg,
boolean metaKeyArg,
- unsigned short buttonArg,
+ short buttonArg,
EventTarget? relatedTargetArg);
// Introduced in DOM Level 3:
boolean getModifierState(DOMString keyArg);
@@ -51,15 +54,7 @@ partial interface MouseEvent
};
// Suggested initMouseEvent replacement initializer:
-dictionary MouseEventInit {
- // Attributes from Event:
- boolean bubbles = false;
- boolean cancelable = false;
-
- // Attributes from UIEvent:
- WindowProxy? view = null;
- long detail = 0;
-
+dictionary MouseEventInit : UIEventInit {
// Attributes for MouseEvent:
long screenX = 0;
long screenY = 0;
@@ -69,7 +64,7 @@ dictionary MouseEventInit {
boolean shiftKey = false;
boolean altKey = false;
boolean metaKey = false;
- unsigned short button = 0;
+ short button = 0;
// Note: "buttons" was not previously initializable through initMouseEvent!
unsigned short buttons = 0;
EventTarget? relatedTarget = null;
@@ -99,7 +94,7 @@ partial interface MouseEvent
void initNSMouseEvent(DOMString typeArg,
boolean canBubbleArg,
boolean cancelableArg,
- WindowProxy? viewArg,
+ Window? viewArg,
long detailArg,
long screenXArg,
long screenYArg,
@@ -109,10 +104,12 @@ partial interface MouseEvent
boolean altKeyArg,
boolean shiftKeyArg,
boolean metaKeyArg,
- unsigned short buttonArg,
+ short buttonArg,
EventTarget? relatedTargetArg,
float pressure,
unsigned short inputSourceArg);
+ [ChromeOnly]
+ readonly attribute boolean hitCluster; // True when touch occurs in a cluster of links
};
diff --git a/dom/webidl/MouseScrollEvent.webidl b/dom/webidl/MouseScrollEvent.webidl
index 3846dcaa3..eb02d0572 100644
--- a/dom/webidl/MouseScrollEvent.webidl
+++ b/dom/webidl/MouseScrollEvent.webidl
@@ -4,8 +4,6 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-interface WindowProxy;
-
interface MouseScrollEvent : MouseEvent
{
const long HORIZONTAL_AXIS = 1;
@@ -17,7 +15,7 @@ interface MouseScrollEvent : MouseEvent
void initMouseScrollEvent(DOMString type,
boolean canBubble,
boolean cancelable,
- WindowProxy? view,
+ Window? view,
long detail,
long screenX,
long screenY,
diff --git a/dom/webidl/MozActivity.webidl b/dom/webidl/MozActivity.webidl
index 994d55bef..5f2f9de8d 100644
--- a/dom/webidl/MozActivity.webidl
+++ b/dom/webidl/MozActivity.webidl
@@ -4,8 +4,13 @@
* 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/. */
-interface ActivityOptions;
+dictionary ActivityOptions {
+ DOMString name = "";
+ any data = null;
+ boolean getFilterResults = false;
+};
-[PrefControlled, Constructor(ActivityOptions options)]
+[Pref="dom.sysmsg.enabled",
+ Constructor(optional ActivityOptions options)]
interface MozActivity : DOMRequest {
};
diff --git a/dom/webidl/MozApplicationEvent.webidl b/dom/webidl/MozApplicationEvent.webidl
index b37d606e0..e46fdca06 100644
--- a/dom/webidl/MozApplicationEvent.webidl
+++ b/dom/webidl/MozApplicationEvent.webidl
@@ -3,15 +3,14 @@
* 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/.
*/
-interface mozIDOMApplication;
-[Constructor(DOMString type, optional MozApplicationEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Constructor(DOMString type, optional MozApplicationEventInit eventInitDict), ChromeOnly]
interface MozApplicationEvent : Event
{
- readonly attribute mozIDOMApplication? application;
+ readonly attribute DOMApplication? application;
};
dictionary MozApplicationEventInit : EventInit
{
- mozIDOMApplication? application = null;
+ DOMApplication? application = null;
};
diff --git a/dom/webidl/MozCellBroadcast.webidl b/dom/webidl/MozCellBroadcast.webidl
new file mode 100644
index 000000000..3a0c0c063
--- /dev/null
+++ b/dom/webidl/MozCellBroadcast.webidl
@@ -0,0 +1,20 @@
+/* -*- 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/. */
+
+/**
+ * Cell Broadcast short message service (CBS) permits a number of
+ * unacknowledged general CBS messages to be broadcast to all receivers within
+ * a particular region.
+ */
+[Pref="dom.cellbroadcast.enabled",
+ CheckPermissions="cellbroadcast",
+ AvailableIn="CertifiedApps"]
+interface MozCellBroadcast : EventTarget
+{
+ /**
+ * Cell Broadcast messages received.
+ */
+ attribute EventHandler onreceived;
+};
diff --git a/dom/webidl/MozCellBroadcastEvent.webidl b/dom/webidl/MozCellBroadcastEvent.webidl
index b82ebf097..50fd49069 100644
--- a/dom/webidl/MozCellBroadcastEvent.webidl
+++ b/dom/webidl/MozCellBroadcastEvent.webidl
@@ -3,9 +3,11 @@
* 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/.
*/
-interface MozCellBroadcastMessage;
-[Constructor(DOMString type, optional MozCellBroadcastEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Constructor(DOMString type, optional MozCellBroadcastEventInit eventInitDict),
+ Pref="dom.cellbroadcast.enabled",
+ CheckPermissions="cellbroadcast",
+ AvailableIn="CertifiedApps"]
interface MozCellBroadcastEvent : Event
{
readonly attribute MozCellBroadcastMessage? message;
diff --git a/dom/webidl/MozCellBroadcastMessage.webidl b/dom/webidl/MozCellBroadcastMessage.webidl
new file mode 100644
index 000000000..58ce5c061
--- /dev/null
+++ b/dom/webidl/MozCellBroadcastMessage.webidl
@@ -0,0 +1,100 @@
+/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
+/* vim: set ts=2 et sw=2 tw=40: */
+/* 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/. */
+
+enum CellBroadcastGsmGeographicalScope {"cell-immediate", "plmn",
+ "location-area", "cell"};
+enum CellBroadcastMessageClass {"class-0", "class-1", "class-2",
+ "class-3", "user-1", "user-2", "normal"};
+enum CellBroadcastEtwsWarningType {"earthquake", "tsunami",
+ "earthquake-tsunami", "test", "other"};
+
+[Pref="dom.cellbroadcast.enabled",
+ CheckPermissions="cellbroadcast",
+ AvailableIn="CertifiedApps"]
+interface MozCellBroadcastMessage
+{
+ /**
+ * The Service Id in the device where the message is received from.
+ */
+ readonly attribute unsigned long serviceId;
+
+ /**
+ * Indication of the geographical area over which the Message Code is unique,
+ * and the display mode.
+ *
+ * Possible values are: "cell-immediate", "plmn", "location-area" and "cell".
+ */
+ readonly attribute CellBroadcastGsmGeographicalScope? gsmGeographicalScope;
+
+ /**
+ * The Message Code differentiates between messages from the same source and
+ * type (e.g., with the same Message Identifier).
+ */
+ readonly attribute unsigned short messageCode;
+
+ /**
+ * Source and type of the message. For example, "Automotive Association"
+ * (= source), "Traffic Reports" (= type) could correspond to one value. The
+ * Message Identifier is coded in binary.
+ */
+ readonly attribute unsigned short messageId;
+
+ /**
+ * ISO-639-1 language code for this message. Null if unspecified.
+ */
+ readonly attribute DOMString? language;
+
+ /**
+ * Text message carried by the message.
+ */
+ readonly attribute DOMString? body;
+
+ /**
+ * Possible values are "normal", "class-0", "class-1", "class-2", "class-3",
+ * "user-1", and "user-2".
+ */
+ readonly attribute CellBroadcastMessageClass? messageClass;
+
+ /**
+ * System time stamp at receival.
+ */
+ readonly attribute DOMTimeStamp timestamp;
+
+ /**
+ * Additional ETWS-specific info.
+ */
+ readonly attribute MozCellBroadcastEtwsInfo? etws;
+
+ /**
+ * Service Category.
+ */
+ readonly attribute unsigned short? cdmaServiceCategory;
+};
+
+[Pref="dom.cellbroadcast.enabled",
+ CheckPermissions="cellbroadcast",
+ AvailableIn="CertifiedApps"]
+interface MozCellBroadcastEtwsInfo
+{
+ /**
+ * Warning type. Possible values are "earthquake", "tsunami",
+ * "earthquake-tsunami", "test" and "other".
+ */
+ readonly attribute CellBroadcastEtwsWarningType? warningType;
+
+ /**
+ * Emergency user alert indication. It is used to command mobile terminals to
+ * activate emergency user alert upon the reception of ETWS primary
+ * notification.
+ */
+ readonly attribute boolean emergencyUserAlert;
+
+ /**
+ * Message popup indication. It is used to command mobile terminals to
+ * activate message popup upon the reception of ETWS primary notification.
+ */
+ readonly attribute boolean popup;
+};
diff --git a/dom/webidl/MozClirModeEvent.webidl b/dom/webidl/MozClirModeEvent.webidl
new file mode 100644
index 000000000..1eed02bdf
--- /dev/null
+++ b/dom/webidl/MozClirModeEvent.webidl
@@ -0,0 +1,22 @@
+/* -*- 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/.
+ */
+
+[Pref="dom.mobileconnection.enabled",
+ Constructor(DOMString type, optional MozClirModeEventInit eventInitDict)]
+interface MozClirModeEvent : Event
+{
+ /**
+ * Indicates the mode of the calling line id restriction (CLIR).
+ *
+ * @see MozMobileConnection.CLIR_* values.
+ */
+ readonly attribute unsigned long mode;
+};
+
+dictionary MozClirModeEventInit : EventInit
+{
+ unsigned long mode = 0;
+};
diff --git a/dom/webidl/MozContactChangeEvent.webidl b/dom/webidl/MozContactChangeEvent.webidl
index d31087276..95b695b2a 100644
--- a/dom/webidl/MozContactChangeEvent.webidl
+++ b/dom/webidl/MozContactChangeEvent.webidl
@@ -4,7 +4,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-[Constructor(DOMString type, optional MozContactChangeEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Constructor(DOMString type, optional MozContactChangeEventInit eventInitDict)]
interface MozContactChangeEvent : Event
{
readonly attribute DOMString? contactID;
diff --git a/dom/webidl/MozEmergencyCbModeEvent.webidl b/dom/webidl/MozEmergencyCbModeEvent.webidl
new file mode 100644
index 000000000..e388dc680
--- /dev/null
+++ b/dom/webidl/MozEmergencyCbModeEvent.webidl
@@ -0,0 +1,26 @@
+/* -*- 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/.
+ */
+
+[Pref="dom.mobileconnection.enabled",
+ Constructor(DOMString type, optional MozEmergencyCbModeEventInit eventInitDict)]
+interface MozEmergencyCbModeEvent : Event
+{
+ /**
+ * Whether the mode is activated.
+ */
+ readonly attribute boolean active;
+
+ /**
+ * Automatically exit the mode after the timeoutMs ms.
+ */
+ readonly attribute unsigned long timeoutMs;
+};
+
+dictionary MozEmergencyCbModeEventInit : EventInit
+{
+ boolean active = false;
+ unsigned long timeoutMs = 0;
+};
diff --git a/dom/webidl/MozIcc.webidl b/dom/webidl/MozIcc.webidl
new file mode 100644
index 000000000..afe1f4c8c
--- /dev/null
+++ b/dom/webidl/MozIcc.webidl
@@ -0,0 +1,358 @@
+/* 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/. */
+
+enum IccCardState
+{
+ "unknown", // ICC card state is either not yet reported from modem or in an
+ // unknown state.
+ "ready",
+ "pinRequired",
+ "pukRequired",
+ "permanentBlocked",
+
+ /**
+ * Personalization States
+ */
+ "personalizationInProgress",
+ "personalizationReady",
+
+ // SIM Personalization States.
+ "networkLocked",
+ "networkSubsetLocked",
+ "corporateLocked",
+ "serviceProviderLocked",
+ "simPersonalizationLocked",
+ "networkPukRequired",
+ "networkSubsetPukRequired",
+ "corporatePukRequired",
+ "serviceProviderPukRequired",
+ "simPersonalizationPukRequired",
+
+ // RUIM Personalization States.
+ "network1Locked",
+ "network2Locked",
+ "hrpdNetworkLocked",
+ "ruimCorporateLocked",
+ "ruimServiceProviderLocked",
+ "ruimPersonalizationLocked",
+ "network1PukRequired",
+ "network2PukRequired",
+ "hrpdNetworkPukRequired",
+ "ruimCorporatePukRequired",
+ "ruimServiceProviderPukRequired",
+ "ruimPersonalizationPukRequired",
+
+ /**
+ * Additional States.
+ */
+ "illegal" // See Bug 916000. An owed pay card will be rejected by the network
+ // and fall in this state.
+};
+
+enum IccLockType
+{
+ "pin",
+ "pin2",
+ "puk",
+ "puk2",
+ "nck", // Network depersonalization -- network control key (NCK).
+ "nsck", // Network subset depersonalization -- network subset control key (NSCK).
+ "nck1", // Network type 1 depersonalization -- network type 1 control key (NCK1).
+ "nck2", // Network type 2 depersonalization -- network type 2 control key (NCK2).
+ "hnck", // HRPD network depersonalization -- HRPD network control key (HNCK).
+ "cck", // Corporate depersonalization -- corporate control key (CCK).
+ "spck", // Service provider depersonalization -- service provider control key (SPCK).
+ "pck", // SIM depersonalization -- personalization control key (PCK).
+ "rcck", // RUIM corporate depersonalization -- RUIM corporate control key (RCCK).
+ "rspck", // RUIM service provider depersonalization -- RUIM service provider control key (RSPCK).
+ "nckPuk", // Network PUK depersonalization -- network control key (NCK).
+ "nsckPuk", // Network subset PUK depersonalization -- network subset control key (NSCK).
+ "nck1Puk", // Network type 1 PUK depersonalization -- network type 1 control key (NCK1).
+ "nck2Puk", // Network type 2 PUK depersonalization -- Network type 2 control key (NCK2).
+ "hnckPuk", // HRPD network PUK depersonalization -- HRPD network control key (HNCK).
+ "cckPuk", // Corporate PUK depersonalization -- corporate control key (CCK).
+ "spckPuk", // Service provider PUK depersonalization -- service provider control key (SPCK).
+ "pckPuk", // SIM PUK depersonalization -- personalization control key (PCK).
+ "rcckPuk", // RUIM corporate PUK depersonalization -- RUIM corporate control key (RCCK).
+ "rspckPuk", // RUIM service provider PUK depersonalization -- service provider control key (SPCK).
+ "fdn"
+};
+
+enum IccContactType
+{
+ "adn", // Abbreviated Dialling Number.
+ "fdn", // Fixed Dialling Number.
+ "sdn" // Service Dialling Number.
+};
+
+enum IccMvnoType
+{
+ "imsi",
+ "spn",
+ "gid"
+};
+
+enum IccService
+{
+ "fdn"
+};
+
+dictionary IccUnlockCardLockOptions
+{
+ required IccLockType lockType;
+
+ DOMString? pin = null; // Necessary for lock types: "pin", "pin2", "nck",
+ // "nsck", "nck1", "nck2", "hnck", "cck", "spck",
+ // "pck", "rcck", "rspck".
+
+ DOMString? puk = null; // Necessary for lock types: "puk", "puk2", "nckPuk",
+ // "nsckPuk", "nck1Puk", "nck2Puk", "hnckPuk", "cckPuk",
+ // "spckPuk", "pckPuk", "rcckPuk", "rspckPuk".
+
+ DOMString? newPin = null; // Necessary for lock types: "puk", "puk2".
+};
+
+dictionary IccSetCardLockOptions
+{
+ required IccLockType lockType;
+
+ DOMString? pin = null; // Necessary for lock types: "pin", "pin2"
+
+ DOMString? pin2 = null; // Used for enabling/disabling operation.
+ // Necessary for lock types: "fdn".
+
+ DOMString? newPin = null; // Used for changing password operation.
+ // Necessary for lock types: "pin", "pin2"
+
+ boolean enabled; // Used for enabling/disabling operation.
+ // Necessary for lock types: "pin", "fdn"
+};
+
+[Pref="dom.icc.enabled",
+ CheckPermissions="mobileconnection",
+ AvailableIn="CertifiedApps"]
+interface MozIcc : EventTarget
+{
+ // Integrated Circuit Card Information.
+
+ /**
+ * Information stored in the device's ICC.
+ *
+ * Once the ICC becomes undetectable, iccinfochange event will be notified.
+ * Also, the attribute is set to null and this MozIcc object becomes invalid.
+ * Calling asynchronous functions raises exception then.
+ */
+ readonly attribute (MozIccInfo or MozGsmIccInfo or MozCdmaIccInfo)? iccInfo;
+
+ /**
+ * The 'iccinfochange' event is notified whenever the icc info object
+ * changes.
+ */
+ attribute EventHandler oniccinfochange;
+
+ // Integrated Circuit Card State.
+
+ /**
+ * Indicates the state of the device's ICC.
+ *
+ * Once the ICC becomes undetectable, cardstatechange event will be notified.
+ * Also, the attribute is set to null and this MozIcc object becomes invalid.
+ * Calling asynchronous functions raises exception then.
+ */
+ readonly attribute IccCardState? cardState;
+
+ /**
+ * The 'cardstatechange' event is notified when the 'cardState' attribute
+ * changes value.
+ */
+ attribute EventHandler oncardstatechange;
+
+ // Integrated Circuit Card STK.
+
+ /**
+ * Send the response back to ICC after an attempt to execute STK proactive
+ * Command.
+ *
+ * @param command
+ * Command received from ICC. See MozStkCommand.
+ * @param response
+ * The response that will be sent to ICC.
+ * @see MozStkResponse for the detail of response.
+ */
+ [Throws]
+ void sendStkResponse(any command, any response);
+
+ /**
+ * Send the "Menu Selection" envelope command to ICC for menu selection.
+ *
+ * @param itemIdentifier
+ * The identifier of the item selected by user.
+ * @param helpRequested
+ * true if user requests to provide help information, false otherwise.
+ */
+ [Throws]
+ void sendStkMenuSelection(unsigned short itemIdentifier,
+ boolean helpRequested);
+
+ /**
+ * Send the "Timer Expiration" envelope command to ICC for TIMER MANAGEMENT.
+ *
+ * @param timer
+ * The identifier and value for a timer.
+ * timerId: Identifier of the timer that has expired.
+ * timerValue: Different between the time when this command is issued
+ * and when the timer was initially started.
+ * @see MozStkTimer
+ */
+ [Throws]
+ void sendStkTimerExpiration(any timer);
+
+ /**
+ * Send "Event Download" envelope command to ICC.
+ * ICC will not respond with any data for this command.
+ *
+ * @param event
+ * one of events below:
+ * - MozStkLocationEvent
+ * - MozStkCallEvent
+ * - MozStkLanguageSelectionEvent
+ * - MozStkGeneralEvent
+ * - MozStkBrowserTerminationEvent
+ */
+ [Throws]
+ void sendStkEventDownload(any event);
+
+ /**
+ * The 'stkcommand' event is notified whenever STK proactive command is
+ * issued from ICC.
+ */
+ attribute EventHandler onstkcommand;
+
+ /**
+ * 'stksessionend' event is notified whenever STK session is terminated by
+ * ICC.
+ */
+ attribute EventHandler onstksessionend;
+
+ // Integrated Circuit Card Lock interfaces.
+
+ /**
+ * Find out about the status of an ICC lock (e.g. the PIN lock).
+ *
+ * @param lockType
+ * Identifies the lock type.
+ *
+ * @return a DOMRequest.
+ * The request's result will be an object containing
+ * information about the specified lock's status.
+ * e.g. {enabled: true}.
+ */
+ [Throws]
+ DOMRequest getCardLock(IccLockType lockType);
+
+ /**
+ * Unlock a card lock.
+ *
+ * @param info
+ * An object containing the information necessary to unlock
+ * the given lock.
+ *
+ * @return a DOMRequest.
+ * The request's error will be an object containing the number of
+ * remaining retries
+ * @see IccCardLockError.
+ */
+ [Throws]
+ DOMRequest unlockCardLock(optional IccUnlockCardLockOptions info);
+
+ /**
+ * Modify the state of a card lock.
+ *
+ * @param info
+ * An object containing information about the lock and
+ * how to modify its state.
+ *
+ * @return a DOMRequest.
+ * The request's error will be an object containing the number of
+ * remaining retries.
+ * @see IccCardLockError.
+ */
+ [Throws]
+ DOMRequest setCardLock(optional IccSetCardLockOptions info);
+
+ /**
+ * Retrieve the number of remaining tries for unlocking the card.
+ *
+ * @param lockType
+ * Identifies the lock type.
+ *
+ * @return a DOMRequest.
+ * The request's result will be an object containing the number of
+ * remaining retries.
+ * e.g. {retryCount: 3}.
+ */
+ [Throws]
+ DOMRequest getCardLockRetryCount(IccLockType lockType);
+
+ // Integrated Circuit Card Phonebook Interfaces.
+
+ /**
+ * Read ICC contacts.
+ *
+ * @param contactType
+ * Identifies the contact type.
+ *
+ * @return a DOMRequest.
+ */
+ [Throws]
+ DOMRequest readContacts(IccContactType contactType);
+
+ /**
+ * Update ICC Phonebook contact.
+ *
+ * @param contactType
+ * Identifies the contact type.
+ * @param contact
+ * The contact will be updated in ICC.
+ * @param pin2 [optional]
+ * PIN2 is only required for "fdn".
+ *
+ * @return a DOMRequest.
+ */
+ [Throws]
+ DOMRequest updateContact(IccContactType contactType,
+ any contact,
+ optional DOMString? pin2 = null);
+
+ // Integrated Circuit Card Helpers.
+
+ /**
+ * Verify whether the passed data (matchData) matches with some ICC's field
+ * according to the mvno type (mvnoType).
+ *
+ * @param mvnoType
+ * Mvno type to use to compare the match data.
+ * @param matchData
+ * Data to be compared with ICC's field.
+ *
+ * @return a DOMRequest.
+ * The request's result will be a boolean indicating the matching
+ * result.
+ */
+ [Throws]
+ DOMRequest matchMvno(IccMvnoType mvnoType, DOMString matchData);
+
+ /**
+ * Retrieve the the availability of an icc service.
+ *
+ * @param service
+ * Identifies the service type.
+ *
+ * @return a Promise
+ * If succeeds, the promise is resolved with boolean indicating the
+ * availability of the service. Otherwise, rejected with a DOMError.
+ */
+ [NewObject]
+ Promise<boolean> getServiceState(IccService service);
+};
diff --git a/dom/webidl/MozIccInfo.webidl b/dom/webidl/MozIccInfo.webidl
new file mode 100644
index 000000000..548734c6c
--- /dev/null
+++ b/dom/webidl/MozIccInfo.webidl
@@ -0,0 +1,71 @@
+/* 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/. */
+
+enum IccType {"sim", "usim", "csim", "ruim"};
+
+[Pref="dom.icc.enabled",
+ CheckPermissions="mobileconnection",
+ AvailableIn="CertifiedApps"]
+interface MozIccInfo {
+ /**
+ * Integrated Circuit Card Type.
+ */
+ readonly attribute IccType? iccType;
+
+ /**
+ * Integrated Circuit Card Identifier.
+ */
+ readonly attribute DOMString? iccid;
+
+ /**
+ * Mobile Country Code (MCC) of the subscriber's home network.
+ */
+ readonly attribute DOMString? mcc;
+
+ /**
+ * Mobile Network Code (MNC) of the subscriber's home network.
+ */
+ readonly attribute DOMString? mnc;
+
+ /**
+ * Service Provider Name (SPN) of the subscriber's home network.
+ */
+ readonly attribute DOMString? spn;
+
+ /**
+ * Network name must be a part of displayed carrier name.
+ */
+ readonly attribute boolean isDisplayNetworkNameRequired;
+
+ /**
+ * Service provider name must be a part of displayed carrier name.
+ */
+ readonly attribute boolean isDisplaySpnRequired;
+};
+
+[Pref="dom.icc.enabled",
+ CheckPermissions="mobileconnection",
+ AvailableIn="CertifiedApps"]
+interface MozGsmIccInfo : MozIccInfo {
+ /**
+ * Mobile Station ISDN Number (MSISDN) of the subscriber, aka
+ * his phone number.
+ */
+ readonly attribute DOMString? msisdn;
+};
+
+[Pref="dom.icc.enabled",
+ CheckPermissions="mobileconnection",
+ AvailableIn="CertifiedApps"]
+interface MozCdmaIccInfo : MozIccInfo {
+ /**
+ * Mobile Directory Number (MDN) of the subscriber, aka his phone number.
+ */
+ readonly attribute DOMString? mdn;
+
+ /**
+ * Preferred Roaming List (PRL) version of the subscriber.
+ */
+ readonly attribute long prlVersion;
+};
diff --git a/dom/webidl/MozIccManager.webidl b/dom/webidl/MozIccManager.webidl
new file mode 100644
index 000000000..831c6b9e7
--- /dev/null
+++ b/dom/webidl/MozIccManager.webidl
@@ -0,0 +1,275 @@
+/* -*- 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/. */
+
+[Pref="dom.icc.enabled",
+ CheckPermissions="mobileconnection",
+ AvailableIn="CertifiedApps"]
+interface MozIccManager : EventTarget
+{
+ /**
+ * STK menu presentation types.
+ */
+ const unsigned short STK_MENU_TYPE_NOT_SPECIFIED = 0x00;
+ const unsigned short STK_MENU_TYPE_DATA_VALUES = 0x01;
+ const unsigned short STK_MENU_TYPE_NAVIGATION_OPTIONS = 0x03;
+
+ /**
+ * Browser launch mode.
+ */
+ const unsigned short STK_BROWSER_MODE_LAUNCH_IF_NOT_ALREADY_LAUNCHED = 0x00;
+ const unsigned short STK_BROWSER_MODE_USING_EXISTING_BROWSER = 0x02;
+ const unsigned short STK_BROWSER_MODE_USING_NEW_BROWSER = 0x03;
+
+ /**
+ * STK proactive commands.
+ *
+ * @see TS 11.14, clause 13.4
+ */
+ const unsigned short STK_CMD_REFRESH = 0x01;
+ const unsigned short STK_CMD_POLL_INTERVAL = 0x03;
+ const unsigned short STK_CMD_POLL_OFF = 0x04;
+ const unsigned short STK_CMD_SET_UP_EVENT_LIST = 0x05;
+ const unsigned short STK_CMD_SET_UP_CALL = 0x10;
+ const unsigned short STK_CMD_SEND_SS = 0x11;
+ const unsigned short STK_CMD_SEND_USSD = 0x12;
+ const unsigned short STK_CMD_SEND_SMS = 0x13;
+ const unsigned short STK_CMD_SEND_DTMF = 0x14;
+ const unsigned short STK_CMD_LAUNCH_BROWSER = 0x15;
+ const unsigned short STK_CMD_PLAY_TONE = 0x20;
+ const unsigned short STK_CMD_DISPLAY_TEXT = 0x21;
+ const unsigned short STK_CMD_GET_INKEY = 0x22;
+ const unsigned short STK_CMD_GET_INPUT = 0x23;
+ const unsigned short STK_CMD_SELECT_ITEM = 0x24;
+ const unsigned short STK_CMD_SET_UP_MENU = 0x25;
+ const unsigned short STK_CMD_PROVIDE_LOCAL_INFO = 0x26;
+ const unsigned short STK_CMD_TIMER_MANAGEMENT = 0x27;
+ const unsigned short STK_CMD_SET_UP_IDLE_MODE_TEXT = 0x28;
+ const unsigned short STK_CMD_OPEN_CHANNEL = 0x40;
+ const unsigned short STK_CMD_CLOSE_CHANNEL = 0x41;
+ const unsigned short STK_CMD_RECEIVE_DATA = 0x42;
+ const unsigned short STK_CMD_SEND_DATA = 0x43;
+
+ /**
+ * STK result code.
+ *
+ * @see TS 11.14, clause 12.12
+ *
+ * Results '0X' and '1X' indicate that the command has been performed.
+ */
+ /** Command performed successfully */
+ const unsigned short STK_RESULT_OK = 0x00;
+
+ /** Command performed with partial comprehension */
+ const unsigned short STK_RESULT_PRFRMD_WITH_PARTIAL_COMPREHENSION = 0x01;
+
+ /** Command performed, with missing information */
+ const unsigned short STK_RESULT_PRFRMD_WITH_MISSING_INFO = 0x02;
+
+ /** REFRESH performed with additional EFs read */
+ const unsigned short STK_RESULT_PRFRMD_WITH_ADDITIONAL_EFS_READ = 0x03;
+
+ /** Command performed successfully, but icon could not be displayed */
+ const unsigned short STK_RESULT_PRFRMD_ICON_NOT_DISPLAYED = 0x04;
+
+ /** Command performed successfully, limited service */
+ const unsigned short STK_RESULT_PRFRMD_LIMITED_SERVICE = 0x06;
+
+ /** Proactive UICC session terminated by the user */
+ const unsigned short STK_RESULT_UICC_SESSION_TERM_BY_USER = 0x10;
+
+ /** Backward move in the proactive UICC session requested by the user */
+ const unsigned short STK_RESULT_BACKWARD_MOVE_BY_USER = 0x11;
+
+ /** No response from user */
+ const unsigned short STK_RESULT_NO_RESPONSE_FROM_USER = 0x12;
+
+ /** Help information required by the user */
+ const unsigned short STK_RESULT_HELP_INFO_REQUIRED = 0x13;
+
+ /** USSD or SS transaction terminated by the user */
+ const unsigned short STK_RESULT_USSD_SS_SESSION_TERM_BY_USER = 0x14;
+
+ /**
+ * Results '2X' indicate to the UICC that it may be worth re-trying the
+ * command at a later opportunity.
+ */
+ /** Terminal currently unable to process command */
+ const unsigned short STK_RESULT_TERMINAL_CRNTLY_UNABLE_TO_PROCESS = 0x20;
+
+ /** Network currently unable to process command */
+ const unsigned short STK_RESULT_NETWORK_CRNTLY_UNABLE_TO_PROCESS = 0x21;
+
+ /** User did not accept the proactive command */
+ const unsigned short STK_RESULT_USER_NOT_ACCEPT = 0x22;
+
+ /** User cleared down call before connection or network release */
+ const unsigned short STK_RESULT_USER_CLEAR_DOWN_CALL = 0x23;
+
+ /** Action in contradiction with the current timer state */
+ const unsigned short STK_RESULT_ACTION_CONTRADICTION_TIMER_STATE = 0x24;
+
+ /** Launch browser generic error code */
+ const unsigned short STK_RESULT_LAUNCH_BROWSER_ERROR = 0x26;
+
+ /**
+ * Results '3X' indicate that it is not worth the UICC re-trying with an
+ * identical command, as it will only get the same response. However, the
+ * decision to retry lies with the application.
+ */
+ /** Command beyond terminal's capabilities */
+ const unsigned short STK_RESULT_BEYOND_TERMINAL_CAPABILITY = 0x30;
+
+ /** Command type not understood by terminal */
+ const unsigned short STK_RESULT_CMD_TYPE_NOT_UNDERSTOOD = 0x31;
+
+ /** Command data not understood by terminal */
+ const unsigned short STK_RESULT_CMD_DATA_NOT_UNDERSTOOD = 0x32;
+
+ /** Command number not known by terminal */
+ const unsigned short STK_RESULT_CMD_NUM_NOT_KNOWN = 0x33;
+
+ /** SS return error */
+ const unsigned short STK_RESULT_SS_RETURN_ERROR = 0x34;
+
+ /** SMS RP-ERROR */
+ const unsigned short STK_RESULT_SMS_RP_ERROR = 0x35;
+
+ /** Error, required values are missing */
+ const unsigned short STK_RESULT_REQUIRED_VALUES_MISSING = 0x36;
+
+ /** USSD return error */
+ const unsigned short STK_RESULT_USSD_RETURN_ERROR = 0x37;
+
+ /** MultipleCard commands error */
+ const unsigned short STK_RESULT_MULTI_CARDS_CMD_ERROR = 0x38;
+
+ /**
+ * Interaction with call control by USIM or MO short message control by
+ * USIM, permanent problem.
+ */
+ const unsigned short STK_RESULT_USIM_CALL_CONTROL_PERMANENT = 0x39;
+
+ /** Bearer independent protocol error */
+ const unsigned short STK_RESULT_BIP_ERROR = 0x3a;
+
+ /**
+ * Additional information on result:
+ *
+ * TS 11.14, 12.12.1-11 and TS 31.111,8.12.1-13 defines additional infomation
+ * for different categories such as SEND SS, ME problem, network problem, etc.
+ *
+ * Note: We define these information here by category when needed.
+ */
+
+ /**
+ * 12.12.2 Additional information for ME problem:
+ */
+ const unsigned short STK_ADDITIONAL_INFO_ME_PROBLEM_SCREEN_IS_BUSY = 0x01;
+
+ /**
+ * STK event list.
+ */
+ const unsigned short STK_EVENT_TYPE_MT_CALL = 0x00;
+ const unsigned short STK_EVENT_TYPE_CALL_CONNECTED = 0x01;
+ const unsigned short STK_EVENT_TYPE_CALL_DISCONNECTED = 0x02;
+ const unsigned short STK_EVENT_TYPE_LOCATION_STATUS = 0x03;
+ const unsigned short STK_EVENT_TYPE_USER_ACTIVITY = 0x04;
+ const unsigned short STK_EVENT_TYPE_IDLE_SCREEN_AVAILABLE = 0x05;
+ const unsigned short STK_EVENT_TYPE_CARD_READER_STATUS = 0x06;
+ const unsigned short STK_EVENT_TYPE_LANGUAGE_SELECTION = 0x07;
+ const unsigned short STK_EVENT_TYPE_BROWSER_TERMINATION = 0x08;
+ const unsigned short STK_EVENT_TYPE_DATA_AVAILABLE = 0x09;
+ const unsigned short STK_EVENT_TYPE_CHANNEL_STATUS = 0x0a;
+ const unsigned short STK_EVENT_TYPE_SINGLE_ACCESS_TECHNOLOGY_CHANGED = 0x0b;
+ const unsigned short STK_EVENT_TYPE_DISPLAY_PARAMETER_CHANGED = 0x0c;
+ const unsigned short STK_EVENT_TYPE_LOCAL_CONNECTION = 0x0d;
+ const unsigned short STK_EVENT_TYPE_NETWORK_SEARCH_MODE_CHANGED = 0x0e;
+ const unsigned short STK_EVENT_TYPE_BROWSING_STATUS = 0x0f;
+ const unsigned short STK_EVENT_TYPE_FRAMES_INFORMATION_CHANGED = 0x10;
+
+ /**
+ * The service state of STK location status.
+ */
+ const unsigned short STK_SERVICE_STATE_NORMAL = 0x00;
+ const unsigned short STK_SERVICE_STATE_LIMITED = 0x01;
+ const unsigned short STK_SERVICE_STATE_UNAVAILABLE = 0x02;
+
+ /**
+ * Tone type.
+ */
+ const unsigned short STK_TONE_TYPE_DIAL_TONE = 0x01;
+ const unsigned short STK_TONE_TYPE_CALLED_SUBSCRIBER_BUSY = 0x02;
+ const unsigned short STK_TONE_TYPE_CONGESTION = 0x03;
+ const unsigned short STK_TONE_TYPE_RADIO_PATH_ACK = 0x04;
+ const unsigned short STK_TONE_TYPE_RADIO_PATH_NOT_AVAILABLE = 0x05;
+ const unsigned short STK_TONE_TYPE_ERROR = 0x06;
+ const unsigned short STK_TONE_TYPE_CALL_WAITING_TONE = 0x07;
+ const unsigned short STK_TONE_TYPE_RINGING_TONE = 0x08;
+ const unsigned short STK_TONE_TYPE_GENERAL_BEEP = 0x10;
+ const unsigned short STK_TONE_TYPE_POSITIVE_ACK_TONE = 0x11;
+ const unsigned short STK_TONE_TYPE_NEGATIVE_ACK_TONE = 0x12;
+
+ /**
+ * Time unit.
+ */
+ const unsigned short STK_TIME_UNIT_MINUTE = 0x00;
+ const unsigned short STK_TIME_UNIT_SECOND = 0x01;
+ const unsigned short STK_TIME_UNIT_TENTH_SECOND = 0x02;
+
+ /**
+ * Local Information list.
+ *
+ * @see TS 102.223, clause 8.6
+ */
+ const unsigned short STK_LOCAL_INFO_LOCATION_INFO = 0x00;
+ const unsigned short STK_LOCAL_INFO_IMEI = 0x01;
+ const unsigned short STK_LOCAL_INFO_DATE_TIME_ZONE = 0x03;
+ const unsigned short STK_LOCAL_INFO_LANGUAGE = 0x04;
+
+ /**
+ * Timer management.
+ */
+ const unsigned short STK_TIMER_START = 0x00;
+ const unsigned short STK_TIMER_DEACTIVATE = 0x01;
+ const unsigned short STK_TIMER_GET_CURRENT_VALUE = 0x02;
+
+ /**
+ * Browser termination cause.
+ */
+ const unsigned short STK_BROWSER_TERMINATION_CAUSE_USER = 0x00;
+ const unsigned short STK_BROWSER_TERMINATION_CAUSE_ERROR = 0x01;
+
+ /**
+ * Next Action Indicator.
+ */
+ const unsigned short STK_NEXT_ACTION_NULL = 0x00;
+ const unsigned short STK_NEXT_ACTION_END_PROACTIVE_SESSION = 0x81;
+
+ /**
+ * Array of iccIds that are currently detected.
+ */
+ [Cached, Pure]
+ readonly attribute sequence<DOMString> iccIds;
+
+ /**
+ * Get ICC object by iccId.
+ *
+ * @param iccId
+ * The identifier of the ICC.
+ *
+ * @return see MozIcc.webidl for the detail.
+ */
+ MozIcc? getIccById(DOMString iccId);
+
+ /**
+ * 'oniccdetected' event is notified whenever a new ICC is detected.
+ */
+ attribute EventHandler oniccdetected;
+
+ /**
+ * 'oniccundetected' event is notified whenever an ICC becomes undetected.
+ */
+ attribute EventHandler oniccundetected;
+};
diff --git a/dom/webidl/MozInterAppMessageEvent.webidl b/dom/webidl/MozInterAppMessageEvent.webidl
new file mode 100644
index 000000000..55f593b02
--- /dev/null
+++ b/dom/webidl/MozInterAppMessageEvent.webidl
@@ -0,0 +1,15 @@
+/* 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/. */
+
+dictionary MozInterAppMessageEventInit : EventInit {
+ any data = null;
+};
+
+[HeaderFile="mozilla/dom/InterAppComm.h",
+ Func="mozilla::dom::InterAppComm::EnabledForScope",
+ Constructor(DOMString type,
+ optional MozInterAppMessageEventInit eventInitDict)]
+interface MozInterAppMessageEvent : Event {
+ readonly attribute any data;
+};
diff --git a/dom/webidl/MozIsoDepTech.webidl b/dom/webidl/MozIsoDepTech.webidl
new file mode 100644
index 000000000..35b1b06bc
--- /dev/null
+++ b/dom/webidl/MozIsoDepTech.webidl
@@ -0,0 +1,13 @@
+/* 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/. */
+
+[Func="Navigator::HasNFCSupport", AvailableIn="PrivilegedApps",
+ ChromeConstructor(MozNFCTag tag)]
+interface MozIsoDepTech {
+ /**
+ * Send raw command to tag and receive the response.
+ */
+ [Throws]
+ Promise<Uint8Array> transceive(Uint8Array command);
+};
diff --git a/dom/webidl/MozMessageDeletedEvent.webidl b/dom/webidl/MozMessageDeletedEvent.webidl
new file mode 100644
index 000000000..9f2f16c14
--- /dev/null
+++ b/dom/webidl/MozMessageDeletedEvent.webidl
@@ -0,0 +1,23 @@
+/* -*- 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/.
+ */
+
+[Pref="dom.sms.enabled",
+ CheckPermissions="sms",
+ AvailableIn="CertifiedApps",
+ Constructor(DOMString type, optional MozMessageDeletedEventInit eventInitDict)]
+interface MozMessageDeletedEvent : Event
+{
+ // Array of deleted message ids.
+ [Cached, Constant] readonly attribute sequence<long>? deletedMessageIds;
+ // Array of deleted thread ids.
+ [Cached, Constant] readonly attribute sequence<unsigned long long>? deletedThreadIds;
+};
+
+dictionary MozMessageDeletedEventInit : EventInit
+{
+ sequence<long>? deletedMessageIds = null;
+ sequence<unsigned long long>? deletedThreadIds = null;
+};
diff --git a/dom/webidl/MozMmsEvent.webidl b/dom/webidl/MozMmsEvent.webidl
index 4883a63a7..bb4af99a2 100644
--- a/dom/webidl/MozMmsEvent.webidl
+++ b/dom/webidl/MozMmsEvent.webidl
@@ -5,7 +5,10 @@
*/
interface MozMmsMessage;
-[Constructor(DOMString type, optional MozMmsEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Pref="dom.sms.enabled",
+ CheckPermissions="sms",
+ AvailableIn="CertifiedApps",
+ Constructor(DOMString type, optional MozMmsEventInit eventInitDict)]
interface MozMmsEvent : Event
{
readonly attribute MozMmsMessage? message;
diff --git a/dom/webidl/MozMmsMessage.webidl b/dom/webidl/MozMmsMessage.webidl
index 778c85ce4..f7f690c60 100644
--- a/dom/webidl/MozMmsMessage.webidl
+++ b/dom/webidl/MozMmsMessage.webidl
@@ -4,11 +4,12 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-// If this is changed, change the XPIDL dictionary as well.
-dictionary MmsAttachment {
- DOMString? id = null;
- DOMString? location = null;
- Blob? content = null;
+dictionary MmsDeliveryInfo {
+ DOMString? receiver = null;
+ DOMString? deliveryStatus = null;
+ DOMTimeStamp deliveryTimestamp = 0; // 0 if not available (e.g.,
+ // |delivery| = "received" or not yet delivered).
+ DOMString? readStatus = null;
+ DOMTimeStamp readTimestamp = 0; // 0 if not available (e.g.,
+ // |delivery| = "received" or not yet read).
};
-
-// If we start using MmsParameters here, remove it from DummyBinding.
diff --git a/dom/webidl/MozMobileCellInfo.webidl b/dom/webidl/MozMobileCellInfo.webidl
new file mode 100644
index 000000000..b8f6918e9
--- /dev/null
+++ b/dom/webidl/MozMobileCellInfo.webidl
@@ -0,0 +1,67 @@
+/* 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/. */
+
+[Pref="dom.mobileconnection.enabled"]
+interface MozMobileCellInfo
+{
+ /**
+ * Mobile Location Area Code (LAC) for GSM/WCDMA networks.
+ *
+ * Possible ranges from 0x0000 to 0xffff.
+ * -1 if the LAC is unknown.
+ */
+ readonly attribute long gsmLocationAreaCode;
+
+ /**
+ * Mobile Cell ID for GSM/WCDMA networks.
+ *
+ * Possible ranges from 0x00000000 to 0xffffffff.
+ * -1 if the cell id is unknown.
+ */
+ readonly attribute long long gsmCellId;
+
+ /**
+ * Base Station ID for CDMA networks.
+ *
+ * Possible ranges from 0 to 65535.
+ * -1 if the base station id is unknown.
+ */
+ readonly attribute long cdmaBaseStationId;
+
+ /**
+ * Base Station Latitude for CDMA networks.
+ *
+ * Possible ranges from -1296000 to 1296000.
+ * -2147483648 if the latitude is unknown.
+ *
+ * @see 3GPP2 C.S0005-A v6.0.
+ */
+ readonly attribute long cdmaBaseStationLatitude;
+
+ /**
+ * Base Station Longitude for CDMA networks.
+ *
+ * Possible ranges from -2592000 to 2592000.
+ * -2147483648 if the longitude is unknown.
+ *
+ * @see 3GPP2 C.S0005-A v6.0.
+ */
+ readonly attribute long cdmaBaseStationLongitude;
+
+ /**
+ * System ID for CDMA networks.
+ *
+ * Possible ranges from 0 to 32767.
+ * -1 if the system id is unknown.
+ */
+ readonly attribute long cdmaSystemId;
+
+ /**
+ * Network ID for CDMA networks.
+ *
+ * Possible ranges from 0 to 65535.
+ * -1 if the network id is unknown.
+ */
+ readonly attribute long cdmaNetworkId;
+};
diff --git a/dom/webidl/MozMobileConnection.webidl b/dom/webidl/MozMobileConnection.webidl
new file mode 100644
index 000000000..c9ea38eb7
--- /dev/null
+++ b/dom/webidl/MozMobileConnection.webidl
@@ -0,0 +1,669 @@
+/* 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/. */
+
+enum MobileNetworkSelectionMode {"automatic", "manual"};
+enum MobileRadioState {"enabling", "enabled", "disabling", "disabled"};
+enum MobileNetworkType {"gsm", "wcdma", "cdma", "evdo", "lte"};
+enum MobilePreferredNetworkType {"wcdma/gsm", "gsm", "wcdma", "wcdma/gsm-auto",
+ "cdma/evdo", "cdma", "evdo",
+ "wcdma/gsm/cdma/evdo", "lte/cdma/evdo",
+ "lte/wcdma/gsm", "lte/wcdma/gsm/cdma/evdo",
+ "lte"};
+enum MobileRoamingMode {"home", "affiliated", "any"};
+
+[Pref="dom.mobileconnection.enabled"]
+interface MozMobileConnection : EventTarget
+{
+ const long ICC_SERVICE_CLASS_VOICE = 0x01; // (1 << 0)
+ const long ICC_SERVICE_CLASS_DATA = 0x02; // (1 << 1)
+ const long ICC_SERVICE_CLASS_FAX = 0x04; // (1 << 2)
+ const long ICC_SERVICE_CLASS_SMS = 0x08; // (1 << 3)
+ const long ICC_SERVICE_CLASS_DATA_SYNC = 0x10; // (1 << 4)
+ const long ICC_SERVICE_CLASS_DATA_ASYNC = 0x20; // (1 << 5)
+ const long ICC_SERVICE_CLASS_PACKET = 0x40; // (1 << 6)
+ const long ICC_SERVICE_CLASS_PAD = 0x80; // (1 << 7)
+ const long ICC_SERVICE_CLASS_MAX = 0x80; // (1 << 7)
+
+ /**
+ * Call forwarding action.
+ *
+ * @see 3GPP TS 27.007 7.11 "mode".
+ */
+ const long CALL_FORWARD_ACTION_DISABLE = 0;
+ const long CALL_FORWARD_ACTION_ENABLE = 1;
+ const long CALL_FORWARD_ACTION_QUERY_STATUS = 2;
+ const long CALL_FORWARD_ACTION_REGISTRATION = 3;
+ const long CALL_FORWARD_ACTION_ERASURE = 4;
+
+ /**
+ * Call forwarding reason.
+ *
+ * @see 3GPP TS 27.007 7.11 "reason".
+ */
+ const long CALL_FORWARD_REASON_UNCONDITIONAL = 0;
+ const long CALL_FORWARD_REASON_MOBILE_BUSY = 1;
+ const long CALL_FORWARD_REASON_NO_REPLY = 2;
+ const long CALL_FORWARD_REASON_NOT_REACHABLE = 3;
+ const long CALL_FORWARD_REASON_ALL_CALL_FORWARDING = 4;
+ const long CALL_FORWARD_REASON_ALL_CONDITIONAL_CALL_FORWARDING = 5;
+
+ /**
+ * Call barring program.
+ */
+ const long CALL_BARRING_PROGRAM_ALL_OUTGOING = 0;
+ const long CALL_BARRING_PROGRAM_OUTGOING_INTERNATIONAL = 1;
+ const long CALL_BARRING_PROGRAM_OUTGOING_INTERNATIONAL_EXCEPT_HOME = 2;
+ const long CALL_BARRING_PROGRAM_ALL_INCOMING = 3;
+ const long CALL_BARRING_PROGRAM_INCOMING_ROAMING = 4;
+
+ /**
+ * Calling line identification restriction constants.
+ *
+ * @see 3GPP TS 27.007 7.7 Defined values.
+ */
+ const long CLIR_DEFAULT = 0;
+ const long CLIR_INVOCATION = 1;
+ const long CLIR_SUPPRESSION = 2;
+
+ /**
+ * These two fields can be accessed by privileged applications with the
+ * 'mobilenetwork' permission.
+ */
+ [CheckPermissions="mobilenetwork"]
+ readonly attribute DOMString lastKnownNetwork;
+ [CheckPermissions="mobilenetwork"]
+ readonly attribute DOMString lastKnownHomeNetwork;
+
+ /**
+ * Information about the voice connection.
+ */
+ [CheckPermissions="mobileconnection"]
+ readonly attribute MozMobileConnectionInfo voice;
+
+ /**
+ * Information about the data connection.
+ */
+ [CheckPermissions="mobileconnection"]
+ readonly attribute MozMobileConnectionInfo data;
+
+ /**
+ * Integrated Circuit Card Identifier of the SIM this mobile connection
+ * corresponds to.
+ */
+ [CheckPermissions="mobileconnection"]
+ readonly attribute DOMString? iccId;
+
+ /**
+ * The selection mode of the voice and data networks.
+ */
+ [CheckPermissions="mobileconnection"]
+ readonly attribute MobileNetworkSelectionMode? networkSelectionMode;
+
+ /**
+ * The current radio state.
+ */
+ [CheckPermissions="mobileconnection"]
+ readonly attribute MobileRadioState? radioState;
+
+ /**
+ * Array of network types that are supported by this radio.
+ */
+ [Cached, Pure, CheckPermissions="mobileconnection"]
+ readonly attribute sequence<MobileNetworkType> supportedNetworkTypes;
+
+ /**
+ * Search for available networks.
+ *
+ * @return a DOMRequest.
+ *
+ * If successful, the request's onsuccess will be called. And the request's
+ * result will be an array of MozMobileNetworkInfo.
+ *
+ * Otherwise, the request's onerror will be called, and the request's error
+ * will be either 'RadioNotAvailable', 'RequestNotSupported', or
+ * 'GenericFailure'.
+ */
+ [Throws, CheckPermissions="mobileconnection"]
+ DOMRequest getNetworks();
+
+ /**
+ * Manually selects the passed in network, overriding the radio's current
+ * selection.
+ *
+ * @return a DOMRequest.
+ *
+ * If successful, the request's onsuccess will be called.
+ * Note: If the network was actually changed by this request,
+ * the 'voicechange' and 'datachange' events will also be fired.
+ *
+ * Otherwise, the request's onerror will be called, and the request's error
+ * will be either 'RadioNotAvailable', 'RequestNotSupported',
+ * 'IllegalSIMorME', or 'GenericFailure'.
+ */
+ [Throws, CheckPermissions="mobileconnection"]
+ DOMRequest selectNetwork(MozMobileNetworkInfo network);
+
+ /**
+ * Tell the radio to automatically select a network.
+ *
+ * @return a DOMRequest.
+ *
+ * If successful, the request's onsuccess will be called.
+ * Note: If the network was actually changed by this request, the
+ * 'voicechange' and 'datachange' events will also be fired.
+ *
+ * Otherwise, the request's onerror will be called, and the request's error
+ * will be either 'RadioNotAvailable', 'RequestNotSupported',
+ * 'IllegalSIMorME', or 'GenericFailure'.
+ */
+ [Throws, CheckPermissions="mobileconnection"]
+ DOMRequest selectNetworkAutomatically();
+
+ /**
+ * Set preferred network type.
+ *
+ * @param type
+ * PreferredNetworkType indicates the desired preferred network type.
+ *
+ * @return a DOMRequest.
+ *
+ * If successful, the request's onsuccess will be called.
+ *
+ * Otherwise, the request's onerror will be called, and the request's error
+ * will be either 'RadioNotAvailable', 'RequestNotSupported',
+ * 'InvalidParameter', 'ModeNotSupported', 'IllegalSIMorME', or
+ * 'GenericFailure'.
+ */
+ [Throws, CheckPermissions="mobileconnection"]
+ DOMRequest setPreferredNetworkType(MobilePreferredNetworkType type);
+
+ /**
+ * Query current preferred network type.
+ *
+ * @return a DOMRequest.
+ *
+ * If successful, the request's onsuccess will be called. And the request's
+ * result will be a string indicating the current preferred network type.
+ * The value will be either 'wcdma/gsm', 'gsm', 'wcdma', 'wcdma/gsm-auto',
+ * 'cdma/evdo', 'cdma', 'evdo', 'wcdma/gsm/cdma/evdo', 'lte/cdma/evdo',
+ * 'lte/wcdma/gsm', 'lte/wcdma/gsm/cdma/evdo' or 'lte'.
+ *
+ * Otherwise, the request's onerror will be called, and the request's error
+ * will be either 'RadioNotAvailable', 'RequestNotSupported',
+ * 'IllegalSIMorME', or 'GenericFailure'.
+ */
+ [Throws, CheckPermissions="mobileconnection"]
+ DOMRequest getPreferredNetworkType();
+
+ /**
+ * Set roaming preference.
+ *
+ * @param mode
+ * RoamingPreferenceMode indicates the desired roaming preference.
+ *
+ * @return a DOMRequest.
+ *
+ * If successful, the request's onsuccess will be called.
+ *
+ * Otherwise, the request's onerror will be called, and the request's error
+ * will be either 'RadioNotAvailable', 'RequestNotSupported',
+ * 'InvalidParameter', 'IllegalSIMorME', or 'GenericFailure'.
+ */
+ [Throws, CheckPermissions="mobileconnection"]
+ DOMRequest setRoamingPreference(MobileRoamingMode mode);
+
+ /**
+ * Query current roaming preference.
+ *
+ * @return a DOMRequest.
+ *
+ * If successful, the request's onsuccess will be called. And the request's
+ * result will be a string indicating the current roaming preference.
+ * The value will be either 'home', 'affiliated', or 'any'.
+ *
+ * Otherwise, the request's onerror will be called, and the request's error
+ * will be either 'RadioNotAvailable', 'RequestNotSupported',
+ * 'IllegalSIMorME', or 'GenericFailure'.
+ */
+ [Throws, CheckPermissions="mobileconnection"]
+ DOMRequest getRoamingPreference();
+
+ /**
+ * Set voice privacy preference.
+ *
+ * @param enabled
+ * Boolean indicates the preferred voice privacy mode used in voice
+ * scrambling in CDMA networks. 'True' means the enhanced voice security
+ * is required.
+ *
+ * @return a DOMRequest.
+ *
+ * If successful, the request's onsuccess will be called.
+ *
+ * Otherwise, the request's onerror will be called, and the request's error
+ * will be either 'RadioNotAvailable', 'RequestNotSupported',
+ * 'InvalidParameter', 'IllegalSIMorME', or 'GenericFailure'.
+ */
+ [Throws, CheckPermissions="mobileconnection"]
+ DOMRequest setVoicePrivacyMode(boolean enabled);
+
+ /**
+ * Query current voice privacy mode.
+ *
+ * @return a DOMRequest.
+ *
+ * If successful, the request's onsuccess will be called. And the request's
+ * result will be a boolean indicating the current voice privacy mode.
+ *
+ * Otherwise, the request's onerror will be called, and the request's error
+ * will be either 'RadioNotAvailable', 'RequestNotSupported',
+ * 'IllegalSIMorME', or 'GenericFailure'.
+ */
+ [Throws, CheckPermissions="mobileconnection"]
+ DOMRequest getVoicePrivacyMode();
+
+ /**
+ * Configures call forward options.
+ *
+ * @param options
+ * An object containing the call forward rule to set.
+ * @see MozCallForwardingOptions for the detail of options.
+ *
+ * @return a DOMRequest
+ *
+ * If successful, the request's onsuccess will be called.
+ *
+ * Otherwise, the request's onerror will be called, and the request's error
+ * will be either 'RadioNotAvailable', 'RequestNotSupported',
+ * 'InvalidParameter', 'IllegalSIMorME', or 'GenericFailure'.
+ */
+ [Throws, CheckPermissions="mobileconnection"]
+ DOMRequest setCallForwardingOption(optional MozCallForwardingOptions options);
+
+ /**
+ * Queries current call forward options.
+ *
+ * @param reason
+ * Indicates the reason the call is being forwarded. It shall be one of
+ * the MozMobileConnection.CALL_FORWARD_REASON_* values.
+ *
+ * @return a DOMRequest
+ *
+ * If successful, the request's onsuccess will be called. And the request's
+ * result will be an array of MozCallForwardingOptions.
+ * @see MozCallForwardingOptions for the detail of result.
+ *
+ * Otherwise, the request's onerror will be called, and the request's error
+ * will be either 'RadioNotAvailable', 'RequestNotSupported',
+ * 'InvalidParameter', 'IllegalSIMorME', or 'GenericFailure'.
+ */
+ [Throws, CheckPermissions="mobileconnection"]
+ DOMRequest getCallForwardingOption(unsigned short reason);
+
+ /**
+ * Configures call barring options.
+ *
+ * @param options
+ * An object containing the call barring rule to set.
+ * @see MozCallBarringOptions for the detail of options.
+ *
+ * @return a DOMRequest
+ *
+ * If successful, the request's onsuccess will be called.
+ *
+ * Otherwise, the request's onerror will be called, and the request's error
+ * will be either 'RadioNotAvailable', 'RequestNotSupported',
+ * 'InvalidParameter', 'IllegalSIMorME', or 'GenericFailure'.
+ */
+ [Throws, CheckPermissions="mobileconnection"]
+ DOMRequest setCallBarringOption(optional MozCallBarringOptions options);
+
+ /**
+ * Queries current call barring status.
+ *
+ * @param options
+ * An object containing the call barring rule to query. No need to
+ * specify 'enabled' property.
+ * @see MozCallBarringOptions for the detail of options.
+ *
+ * @return a DOMRequest
+ *
+ * If successful, the request's onsuccess will be called. And the request's
+ * result will be an object of MozCallBarringOptions with correct 'enabled'
+ * property indicating the status of this rule.
+ * @see MozCallBarringOptions for the detail of result.
+ *
+ * Otherwise, the request's onerror will be called, and the request's error
+ * will be either 'RadioNotAvailable', 'RequestNotSupported',
+ * 'InvalidParameter', 'IllegalSIMorME', or 'GenericFailure'.
+ */
+ [Throws, CheckPermissions="mobileconnection"]
+ DOMRequest getCallBarringOption(optional MozCallBarringOptions options);
+
+ /**
+ * Change call barring facility password.
+ *
+ * @param options
+ * An object containing information about pin and newPin, and,
+ * this object must have both "pin" and "newPin" attributes
+ * to change the call barring facility password.
+ * @see MozCallBarringOptions for the detail of options.
+ *
+ * Example:
+ *
+ * changeCallBarringPassword({pin: "...",
+ * newPin: "..."});
+ *
+ * @return a DOMRequest.
+ *
+ * If successful, the request's onsuccess will be called.
+ *
+ * Otherwise, the request's onerror will be called, and the request's error
+ * will be either 'RadioNotAvailable', 'RequestNotSupported',
+ * 'InvalidParameter', 'IllegalSIMorME', or 'GenericFailure'.
+ */
+ [Throws, CheckPermissions="mobileconnection"]
+ DOMRequest changeCallBarringPassword(optional MozCallBarringOptions options);
+
+ /**
+ * Configures call waiting options.
+ *
+ * @param enabled
+ * Boolean indicates the desired call waiting status.
+ *
+ * @return a DOMRequest.
+ *
+ * If successful, the request's onsuccess will be called.
+ *
+ * Otherwise, the request's onerror will be called, and the request's error
+ * will be either 'RadioNotAvailable', 'RequestNotSupported',
+ * 'IllegalSIMorME', or 'GenericFailure'.
+ */
+ [Throws, CheckPermissions="mobileconnection"]
+ DOMRequest setCallWaitingOption(boolean enabled);
+
+ /**
+ * Queries current call waiting options.
+ *
+ * @return a DOMRequest
+ *
+ * If successful, the request's onsuccess will be called. And the request's
+ * result will be a boolean indicating the call waiting status.
+ *
+ * Otherwise, the request's onerror will be called, and the request's error
+ * will be either 'RadioNotAvailable', 'RequestNotSupported',
+ * 'IllegalSIMorME', or 'GenericFailure'.
+ */
+ [Throws, CheckPermissions="mobileconnection"]
+ DOMRequest getCallWaitingOption();
+
+ /**
+ * Enables or disables the presentation of the calling line identity (CLI) to
+ * the called party when originating a call.
+ *
+ * @param mode
+ * It shall be one of the MozMobileConnection.CLIR_* values.
+ *
+ * @return a DOMRequest
+ *
+ * If successful, the request's onsuccess will be called.
+ *
+ * Otherwise, the request's onerror will be called, and the request's error
+ * will be either 'RadioNotAvailable', 'RequestNotSupported',
+ * 'InvalidParameter', 'IllegalSIMorME', or 'GenericFailure'.
+ */
+ [Throws, CheckPermissions="mobileconnection"]
+ DOMRequest setCallingLineIdRestriction(unsigned short mode);
+
+ /**
+ * Queries current CLIR status.
+ *
+ * @return a DOMRequest
+ *
+ * If successful, the request's onsuccess will be called. And the request's
+ * result will be an object containing containing CLIR 'n' and 'm' parameter.
+ * @see MozClirStatus for the detail of result.
+ *
+ * Otherwise, the request's onerror will be called, and the request's error
+ * will be either 'RadioNotAvailable', 'RequestNotSupported',
+ * 'IllegalSIMorME', or 'GenericFailure'.
+ */
+ [Throws, CheckPermissions="mobileconnection"]
+ DOMRequest getCallingLineIdRestriction();
+
+ /**
+ * Exit emergency callback mode.
+ *
+ * @return a DOMRequest
+ *
+ * If successful, the request's onsuccess will be called.
+ *
+ * Otherwise, the request's onerror will be called, and the request's error
+ * will be either 'RadioNotAvailable', 'RequestNotSupported',
+ * 'IllegalSIMorME', or 'GenericFailure'.
+ */
+ [Throws, CheckPermissions="mobileconnection"]
+ DOMRequest exitEmergencyCbMode();
+
+ /**
+ * Set radio enabled/disabled.
+ *
+ * @param enabled
+ * True to enable the radio.
+ *
+ * @return a DOMRequest
+ *
+ * If successful, the request's onsuccess will be called.
+ *
+ * Otherwise, the request's onerror will be called, and the request's error
+ * will be either 'InvalidStateError', 'RadioNotAvailable',
+ * 'IllegalSIMorME', or 'GenericFailure'.
+ *
+ * Note: Request is not available when radioState is null, 'enabling', or
+ * 'disabling'. Calling the function in above conditions will receive
+ * 'InvalidStateError' error.
+ */
+ [Throws, CheckPermissions="mobileconnection"]
+ DOMRequest setRadioEnabled(boolean enabled);
+
+ /**
+ * The 'voicechange' event is notified whenever the voice connection object
+ * changes.
+ */
+ attribute EventHandler onvoicechange;
+
+ /**
+ * The 'datachange' event is notified whenever the data connection object
+ * changes values.
+ */
+ attribute EventHandler ondatachange;
+
+ /**
+ * The 'dataerror' event is notified whenever the data connection object
+ * receives an error from the RIL.
+ */
+ attribute EventHandler ondataerror;
+
+ /**
+ * The 'oncfstatechange' event is notified whenever the call forwarding
+ * state changes.
+ */
+ attribute EventHandler oncfstatechange;
+
+ /**
+ * The 'emergencycbmodechange' event is notified whenever the emergency
+ * callback mode changes.
+ */
+ attribute EventHandler onemergencycbmodechange;
+
+ /**
+ * The 'onotastatuschange' event is notified whenever the ota provision status
+ * changes.
+ */
+ attribute EventHandler onotastatuschange;
+
+ /**
+ * The 'oniccchange' event is notified whenever the iccid value
+ * changes.
+ */
+ attribute EventHandler oniccchange;
+
+ /**
+ * The 'onradiostatechange' event is notified whenever the radio state
+ * changes.
+ */
+ attribute EventHandler onradiostatechange;
+
+ /**
+ * The 'onclirmodechange' event is notified whenever the mode of the calling
+ * line id restriction (CLIR) changes.
+ */
+ attribute EventHandler onclirmodechange;
+};
+
+dictionary MozCallForwardingOptions
+{
+ /**
+ * Call forwarding rule status.
+ *
+ * It will be either not active (false), or active (true).
+ *
+ * Note: Unused for setting call forwarding options. It reports
+ * the status of the rule when getting how the rule is
+ * configured.
+ *
+ * @see 3GPP TS 27.007 7.11 "status".
+ */
+ boolean? active;
+
+ /**
+ * Indicates what to do with the rule. It shall be one of the
+ * MozMobileConnection.CALL_FORWARD_ACTION_* values.
+ */
+ unsigned short? action;
+
+ /**
+ * Indicates the reason the call is being forwarded. It shall be one of the
+ * MozMobileConnection.CALL_FORWARD_REASON_* values.
+ */
+ unsigned short? reason;
+
+ /**
+ * Phone number of forwarding address.
+ */
+ DOMString? number;
+
+ /**
+ * When "no reply" is enabled or queried, this gives the time in
+ * seconds to wait before call is forwarded.
+ */
+ unsigned short? timeSeconds;
+
+ /**
+ * Service for which the call forward is set up. It should be one of the
+ * MozMobileConnection.ICC_SERVICE_CLASS_* values.
+ */
+ unsigned short? serviceClass;
+};
+
+dictionary MozCallBarringOptions
+{
+ /**
+ * Indicates the program the call is being barred. It shall be one of the
+ * MozMobileConnection.CALL_BARRING_PROGRAM_* values.
+ */
+ unsigned short? program;
+
+ /**
+ * Enable or disable the call barring program.
+ */
+ boolean? enabled;
+
+ /**
+ * Barring password. Use "" if no password specified.
+ */
+ DOMString? password;
+
+ /**
+ * Service for which the call barring is set up. It shall be one of the
+ * MozMobileConnection.ICC_SERVICE_CLASS_* values.
+ */
+ unsigned short? serviceClass;
+
+ /**
+ * Old call barring password.
+ *
+ * Note: Only used for changeCallBarringPassword().
+ */
+ // TODO: Combine this with |password| and rename |newPin| to |newPassword|.
+ // But it needs to modify the gaia side as well, so we could consider
+ // doing this in bug 987541.
+ DOMString? pin;
+
+ /**
+ * New call barring password.
+ *
+ * Note: Only used for changeCallBarringPassword().
+ */
+ DOMString? newPin;
+};
+
+dictionary MozMMIResult
+{
+ /**
+ * Indicate whether the result is successful or not.
+ */
+ boolean success = true;
+
+ /**
+ * String key that identifies the service associated with the MMI code
+ * request. The UI is supposed to handle the localization of the strings
+ * associated with this string key.
+ */
+ DOMString serviceCode = "";
+
+ /**
+ * String key containing the status message of the associated MMI request or
+ * the error message when the request fails.
+
+ * The UI is supposed to handle the localization of the strings associated
+ * with this string key.
+ */
+ DOMString statusMessage = "";
+
+ /**
+ * Some MMI requests like call forwarding or PIN/PIN2/PUK/PUK2 related
+ * requests provide extra information along with the status message, this
+ * information can be a number, an array of string keys or an array of
+ * MozCallForwardingOptions.
+ *
+ * And it should be
+ * (unsigned short or sequence<DOMString> or sequence<MozCallForwardingOptions>)
+ * But we cannot yet use sequences as union member types (please see bug 767924)
+ * ,so we use object here.
+ */
+ (unsigned short or object) additionalInformation;
+};
+
+dictionary MozClirStatus
+{
+ /**
+ * CLIR parameter 'n': parameter sets the adjustment for outgoing calls.
+ *
+ * It shall be one of the MozMobileConnection.CLIR_* values.
+ */
+ unsigned short n;
+
+ /**
+ * CLIR parameter 'm': parameter shows the subscriber CLIR service status in
+ * the network.
+ * (0) CLIR not provisioned.
+ * (1) CLIR provisioned in permanent mode.
+ * (2) unknown (e.g. no network, etc.).
+ * (3) CLIR temporary mode presentation restricted.
+ *
+ * @see 3GPP TS 27.007 7.7 defined values.
+ */
+ unsigned short m;
+};
diff --git a/dom/webidl/MozMobileConnectionArray.webidl b/dom/webidl/MozMobileConnectionArray.webidl
new file mode 100644
index 000000000..29e832baf
--- /dev/null
+++ b/dom/webidl/MozMobileConnectionArray.webidl
@@ -0,0 +1,11 @@
+/* -*- 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/.
+ */
+
+[Pref="dom.mobileconnection.enabled"]
+interface MozMobileConnectionArray {
+ getter MozMobileConnection? item(unsigned long index);
+ readonly attribute unsigned long length;
+};
diff --git a/dom/webidl/MozMobileConnectionInfo.webidl b/dom/webidl/MozMobileConnectionInfo.webidl
new file mode 100644
index 000000000..23bd23f1b
--- /dev/null
+++ b/dom/webidl/MozMobileConnectionInfo.webidl
@@ -0,0 +1,66 @@
+/* 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/. */
+
+enum MobileConnectionState {"notSearching", "searching", "denied", "registered"};
+enum MobileConnectionType {"gsm", "gprs", "edge", "umts", "hsdpa", "hsupa",
+ "hspa", "hspa+", "is95a", "is95b", "1xrtt", "evdo0",
+ "evdoa", "evdob", "ehrpd", "lte"};
+
+[Pref="dom.mobileconnection.enabled"]
+interface MozMobileConnectionInfo
+{
+ /**
+ * State of the connection.
+ */
+ readonly attribute MobileConnectionState? state;
+
+ /**
+ * Indicates whether the connection is ready.
+ *
+ * Note: The meaning of "connection ready" for data and voice are different.
+ * - Data: the "default" data connection is established or not.
+ * - Voice: voice is registered to network or not.
+ */
+ readonly attribute boolean connected;
+
+ /**
+ * Indicates whether only emergency calls are possible.
+ *
+ * This flag is only relevant to voice connections and when 'connected' is
+ * false.
+ */
+ readonly attribute boolean emergencyCallsOnly;
+
+ /**
+ * Indicates whether the connection is going through a foreign operator
+ * (roaming) or not.
+ */
+ readonly attribute boolean roaming;
+
+ /**
+ * Network operator information.
+ */
+ readonly attribute MozMobileNetworkInfo? network;
+
+ /**
+ * Type of connection.
+ */
+ readonly attribute MobileConnectionType? type;
+
+ /**
+ * Signal strength in dBm, or null if no service is available.
+ */
+ readonly attribute long? signalStrength;
+
+ /**
+ * Signal strength, represented linearly as a number between 0 (weakest
+ * signal) and 100 (full signal).
+ */
+ readonly attribute unsigned short? relSignalStrength;
+
+ /**
+ * Cell location information.
+ */
+ readonly attribute MozMobileCellInfo? cell;
+};
diff --git a/dom/webidl/MozMobileMessageManager.webidl b/dom/webidl/MozMobileMessageManager.webidl
new file mode 100644
index 000000000..32fe53233
--- /dev/null
+++ b/dom/webidl/MozMobileMessageManager.webidl
@@ -0,0 +1,170 @@
+/* -*- 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/.
+ */
+
+interface MozMmsMessage;
+interface MozSmsMessage;
+
+dictionary SmsSegmentInfo {
+ /**
+ * The number of total segments for the input string. The value is always
+ * larger-equal than 1.
+ */
+ long segments = 0;
+
+ /**
+ * The number of characters available per segment. The value is always
+ * larger-equal than 1.
+ */
+ long charsPerSegment = 0;
+
+ /**
+ * The maximum number of available characters in the last segment. The value
+ * is always larger-equal than 0.
+ */
+ long charsAvailableInLastSegment = 0;
+};
+
+dictionary MmsAttachment {
+ DOMString? id = null;
+ DOMString? location = null;
+ Blob? content = null;
+};
+
+dictionary MmsParameters {
+ sequence<DOMString> receivers;
+ DOMString? subject = null;
+ DOMString? smil = null;
+ sequence<MmsAttachment> attachments;
+};
+
+dictionary SmsSendParameters {
+ unsigned long serviceId; // The ID of the RIL service which needs to be
+ // specified under the multi-sim scenario.
+};
+
+dictionary MmsSendParameters {
+ unsigned long serviceId; // The ID of the RIL service which needs to be
+ // specified under the multi-sim scenario.
+};
+
+enum MobileMessageFilterDelivery { "sent", "received" };
+
+dictionary MobileMessageFilter
+{
+ // Close lower bound range for filtering by the message timestamp.
+ // Time in milliseconds since Epoch.
+ [EnforceRange] DOMTimeStamp? startDate = null;
+
+ // Close upper bound range for filtering by the message timestamp.
+ // Time in milliseconds since Epoch.
+ [EnforceRange] DOMTimeStamp? endDate = null;
+
+ // An array of string message participant addresses that any of which
+ // appears or matches a message's sendor or recipients addresses.
+ sequence<DOMString>? numbers = null;
+
+ MobileMessageFilterDelivery? delivery = null;
+
+ // Filtering by whether a message has been read or not.
+ boolean? read = null;
+
+ // Filtering by a message's threadId attribute.
+ [EnforceRange] unsigned long long? threadId = 0;
+};
+
+[Pref="dom.sms.enabled",
+ CheckPermissions="sms",
+ AvailableIn="CertifiedApps"]
+interface MozMobileMessageManager : EventTarget
+{
+ [Throws]
+ DOMRequest getSegmentInfoForText(DOMString text);
+
+ /**
+ * Send SMS.
+ *
+ * @param number
+ * Either a DOMString (only one number) or an array of numbers.
+ * @param text
+ * The text message to be sent.
+ * @param sendParameters
+ * A SmsSendParameters object.
+ *
+ * @return
+ * A DOMRequest object indicating the sending result if one number
+ * has been passed; an array of DOMRequest objects otherwise.
+ */
+ [Throws]
+ DOMRequest send(DOMString number,
+ DOMString text,
+ optional SmsSendParameters sendParameters);
+ [Throws]
+ sequence<DOMRequest> send(sequence<DOMString> numbers,
+ DOMString text,
+ optional SmsSendParameters sendParameters);
+
+ /**
+ * Send MMS.
+ *
+ * @param parameters
+ * A MmsParameters object.
+ * @param sendParameters
+ * A MmsSendParameters object.
+ *
+ * @return
+ * A DOMRequest object indicating the sending result.
+ */
+ [Throws]
+ DOMRequest sendMMS(optional MmsParameters parameters,
+ optional MmsSendParameters sendParameters);
+
+ [Throws]
+ DOMRequest getMessage(long id);
+
+ // The parameter can be either a message id, or a Moz{Mms,Sms}Message, or an
+ // array of Moz{Mms,Sms}Message objects.
+ [Throws]
+ DOMRequest delete(long id);
+ [Throws]
+ DOMRequest delete(MozSmsMessage message);
+ [Throws]
+ DOMRequest delete(MozMmsMessage message);
+ [Throws]
+ DOMRequest delete(sequence<(long or MozSmsMessage or MozMmsMessage)> params);
+
+ // Iterates through Moz{Mms,Sms}Message.
+ [Throws]
+ DOMCursor getMessages(optional MobileMessageFilter filter,
+ optional boolean reverse = false);
+
+ [Throws]
+ DOMRequest markMessageRead(long id,
+ boolean read,
+ optional boolean sendReadReport = false);
+
+ // Iterates through nsIDOMMozMobileMessageThread.
+ [Throws]
+ DOMCursor getThreads();
+
+ [Throws]
+ DOMRequest retrieveMMS(long id);
+ [Throws]
+ DOMRequest retrieveMMS(MozMmsMessage message);
+
+ [Throws]
+ DOMRequest getSmscAddress(optional unsigned long serviceId);
+
+ attribute EventHandler onreceived;
+ attribute EventHandler onretrieving;
+ attribute EventHandler onsending;
+ attribute EventHandler onsent;
+ attribute EventHandler onfailed;
+ attribute EventHandler ondeliverysuccess;
+ attribute EventHandler ondeliveryerror;
+ attribute EventHandler onreadsuccess;
+ attribute EventHandler onreaderror;
+ attribute EventHandler ondeleted;
+};
diff --git a/dom/webidl/MozMobileNetworkInfo.webidl b/dom/webidl/MozMobileNetworkInfo.webidl
new file mode 100644
index 000000000..e21dd9266
--- /dev/null
+++ b/dom/webidl/MozMobileNetworkInfo.webidl
@@ -0,0 +1,34 @@
+/* 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/. */
+
+enum MobileNetworkState {"available", "connected", "forbidden"};
+
+[Pref="dom.mobileconnection.enabled"]
+interface MozMobileNetworkInfo
+{
+ /**
+ * Short name of the network operator.
+ */
+ readonly attribute DOMString? shortName;
+
+ /**
+ * Long name of the network operator.
+ */
+ readonly attribute DOMString? longName;
+
+ /**
+ * Mobile Country Code (MCC) of the network operator.
+ */
+ readonly attribute DOMString? mcc;
+
+ /**
+ * Mobile Network Code (MNC) of the network operator.
+ */
+ readonly attribute DOMString? mnc;
+
+ /**
+ * State of this network operator.
+ */
+ readonly attribute MobileNetworkState? state;
+};
diff --git a/dom/webidl/MozNDEFRecord.webidl b/dom/webidl/MozNDEFRecord.webidl
new file mode 100644
index 000000000..0448f7be0
--- /dev/null
+++ b/dom/webidl/MozNDEFRecord.webidl
@@ -0,0 +1,58 @@
+/* -*- 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/. */
+
+/* Copyright © 2013 Deutsche Telekom, Inc. */
+
+enum TNF {
+ "empty",
+ "well-known",
+ "media-type",
+ "absolute-uri",
+ "external",
+ "unknown",
+ "unchanged"
+};
+
+[Constructor(optional MozNDEFRecordOptions options)]
+interface MozNDEFRecord
+{
+ /**
+ * Type Name Field - Specifies the NDEF record type in general.
+ */
+ [Constant]
+ readonly attribute TNF tnf;
+
+ /**
+ * type - Describes the content of the payload. This can be a mime type.
+ */
+ [Constant]
+ readonly attribute Uint8Array? type;
+
+ /**
+ * id - Identifer is application dependent.
+ */
+ [Constant]
+ readonly attribute Uint8Array? id;
+
+ /**
+ * payload - Binary data blob. The meaning of this field is application
+ * dependent.
+ */
+ [Constant]
+ readonly attribute Uint8Array? payload;
+
+ /**
+ * Get the size of this NDEF Record.
+ */
+ [Constant]
+ readonly attribute unsigned long size;
+};
+
+dictionary MozNDEFRecordOptions {
+ TNF tnf = "empty";
+ Uint8Array type;
+ Uint8Array id;
+ Uint8Array payload;
+};
diff --git a/dom/webidl/MozNFC.webidl b/dom/webidl/MozNFC.webidl
new file mode 100644
index 000000000..b2d084aa6
--- /dev/null
+++ b/dom/webidl/MozNFC.webidl
@@ -0,0 +1,140 @@
+/* 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/. */
+
+ /* Copyright © 2013 Deutsche Telekom, Inc. */
+
+enum NfcErrorMessage {
+ "",
+ "IOError",
+ "Timeout",
+ "Busy",
+ "ErrorConnect",
+ "ErrorDisconnect",
+ "ErrorRead",
+ "ErrorWrite",
+ "InvalidParameter",
+ "InsufficientResource",
+ "ErrorSocketCreation",
+ "FailEnableDiscovery",
+ "FailDisableDiscovery",
+ "NotInitialize",
+ "InitializeFail",
+ "DeinitializeFail",
+ "NotSupport",
+ "FailEnableLowPowerMode",
+ "FailDisableLowPowerMode"
+};
+
+[NoInterfaceObject]
+interface MozNFCManager {
+ /**
+ * API to check if the given application's manifest
+ * URL is registered with the Chrome Process or not.
+ *
+ * Returns success if given manifestUrl is registered for 'onpeerready',
+ * otherwise error
+ */
+ [CheckPermissions="nfc-manager", AvailableIn=CertifiedApps]
+ Promise<boolean> checkP2PRegistration(DOMString manifestUrl);
+
+ /**
+ * Notify that user has accepted to share nfc message on P2P UI
+ */
+ [CheckPermissions="nfc-manager", AvailableIn=CertifiedApps]
+ void notifyUserAcceptedP2P(DOMString manifestUrl);
+
+ /**
+ * Notify the status of sendFile operation
+ */
+ [CheckPermissions="nfc-manager", AvailableIn=CertifiedApps]
+ void notifySendFileStatus(octet status, DOMString requestId);
+
+ /**
+ * Power on the NFC hardware and start polling for NFC tags or devices.
+ */
+ [CheckPermissions="nfc-manager", AvailableIn=CertifiedApps]
+ Promise<void> startPoll();
+
+ /**
+ * Stop polling for NFC tags or devices. i.e. enter low power mode.
+ */
+ [CheckPermissions="nfc-manager", AvailableIn=CertifiedApps]
+ Promise<void> stopPoll();
+
+ /**
+ * Power off the NFC hardware.
+ */
+ [CheckPermissions="nfc-manager", AvailableIn=CertifiedApps]
+ Promise<void> powerOff();
+};
+
+[JSImplementation="@mozilla.org/nfc/manager;1",
+ NavigatorProperty="mozNfc",
+ Func="Navigator::HasNFCSupport",
+ CheckPermissions="nfc nfc-share",
+ AvailableIn="PrivilegedApps",
+ UnsafeInPrerendering]
+interface MozNFC : EventTarget {
+ /**
+ * Indicate if NFC is enabled.
+ */
+ readonly attribute boolean enabled;
+
+ /**
+ * This event will be fired when another NFCPeer is detected, and user confirms
+ * to share data to the NFCPeer object by calling mozNFC.notifyUserAcceptedP2P.
+ * The event will be type of NFCPeerEvent.
+ */
+ [CheckPermissions="nfc-share", AvailableIn=CertifiedApps]
+ attribute EventHandler onpeerready;
+
+ /**
+ * This event will be fired when a NFCPeer is detected. The application has to
+ * be running on the foreground (decided by System app) to receive this event.
+ *
+ * The default action of this event is to dispatch the event in System app
+ * again, and System app will run the default UX behavior (like vibration).
+ * So if the application would like to cancel the event, the application
+ * should call event.preventDefault() or return false in this event handler.
+ */
+ attribute EventHandler onpeerfound;
+
+ /**
+ * This event will be fired when NFCPeer, earlier detected in onpeerready
+ * or onpeerfound, moves out of range, or if the application has been switched
+ * to the background (decided by System app).
+ */
+ attribute EventHandler onpeerlost;
+
+ /**
+ * This event will be fired when a NFCTag is detected. The application has to
+ * be running on the foreground (decided by System app) to receive this event.
+ *
+ * The default action of this event is to dispatch the event in System app
+ * again, and System app will run the default UX behavior (like vibration) and
+ * launch MozActivity to handle the content of the tag. (For example, System
+ * app will launch Browser if the tag contains URL). So if the application
+ * would like to cancel the event, i.e. in the above example, the application
+ * would process the URL by itself without launching Browser, the application
+ * should call event.preventDefault() or return false in this event handler.
+ */
+ attribute EventHandler ontagfound;
+
+ /**
+ * This event will be fired if the tag detected in ontagfound has been
+ * removed, or if the application has been switched to the background (decided
+ * by System app).
+ */
+ attribute EventHandler ontaglost;
+};
+
+// Mozilla Only
+partial interface MozNFC {
+ [ChromeOnly]
+ void eventListenerWasAdded(DOMString aType);
+ [ChromeOnly]
+ void eventListenerWasRemoved(DOMString aType);
+};
+
+MozNFC implements MozNFCManager;
diff --git a/dom/webidl/MozNFCPeer.webidl b/dom/webidl/MozNFCPeer.webidl
new file mode 100644
index 000000000..1ab4bccce
--- /dev/null
+++ b/dom/webidl/MozNFCPeer.webidl
@@ -0,0 +1,38 @@
+/* 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/.
+ *
+ * Part of this IDL file is from:
+ * http://w3c.github.io/nfc/proposals/common/nfc.html#idl-def-NFCPeer
+ *
+ * Copyright © 2013 Deutsche Telekom, Inc.
+ */
+
+[JSImplementation="@mozilla.org/nfc/peer;1", AvailableIn="PrivilegedApps"]
+interface MozNFCPeer {
+ /**
+ * Indicate if this peer is already lost.
+ */
+ readonly attribute boolean isLost;
+
+ /**
+ * Send NDEF data to peer device.
+ */
+ [Throws]
+ Promise<void> sendNDEF(sequence<MozNDEFRecord> records);
+
+ /**
+ * Send file to peer device.
+ */
+ [Throws, CheckPermissions="nfc-share", AvailableIn="CertifiedApps"]
+ Promise<void> sendFile(Blob blob);
+};
+
+// Mozilla Only
+partial interface MozNFCPeer {
+ [ChromeOnly]
+ attribute DOMString session;
+
+ [ChromeOnly]
+ void notifyLost();
+};
diff --git a/dom/webidl/MozNFCPeerEvent.webidl b/dom/webidl/MozNFCPeerEvent.webidl
new file mode 100644
index 000000000..6114071ee
--- /dev/null
+++ b/dom/webidl/MozNFCPeerEvent.webidl
@@ -0,0 +1,21 @@
+/* -*- 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/.
+ */
+
+[Constructor(DOMString type, optional MozNFCPeerEventInit eventInitDict),
+ Func="Navigator::HasNFCSupport", CheckPermissions="nfc nfc-share",
+ AvailableIn="PrivilegedApps"]
+interface MozNFCPeerEvent : Event
+{
+ /**
+ * The detected NFCPeer.
+ */
+ readonly attribute MozNFCPeer? peer;
+};
+
+dictionary MozNFCPeerEventInit : EventInit
+{
+ MozNFCPeer? peer = null;
+};
diff --git a/dom/webidl/MozNFCTag.webidl b/dom/webidl/MozNFCTag.webidl
new file mode 100644
index 000000000..dc23dab44
--- /dev/null
+++ b/dom/webidl/MozNFCTag.webidl
@@ -0,0 +1,121 @@
+/* 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/.
+ *
+ * Part of this idl is from:
+ * http://w3c.github.io/nfc/proposals/common/nfc.html#nfctag-interface
+ *
+ * Copyright © 2013 Deutsche Telekom, Inc.
+ */
+
+/**
+ * The enumeration of NFC Tag technologies.
+ */
+enum NFCTechType {
+ "NFC-A", // NFCForum-TS-DigitalProtocol-1.1 NFC-A.
+ "NFC-B", // NFCForum-TS-DigitalProtocol-1.1 NFC-B.
+ "NFC-F", // NFCForum-TS-DigitalProtocol-1.1 NFC-F.
+ "NFC-V", // ISO 15693.
+ "ISO-DEP", // NFCForum-TS-DigitalProtocol-1.1 ISO-DEP.
+ "MIFARE-Classic", // MIFARE Classic from NXP.
+ "MIFARE-Ultralight", // MIFARE Ultralight from NXP.
+ "NFC-Barcode", // NFC Barcode from Kovio.
+ "Unknown"
+};
+
+/**
+ * The enumeration of the types of the tag, the type of a tag could be either
+ * one of those types defined in NFC Forum Tag Types (Type1 ~ Type 4), or it
+ * could be a NXP-specific tag, like MIFARE Classic.
+ */
+enum NFCTagType {
+ "Type1",
+ "Type2",
+ "Type3",
+ "Type4",
+ "MIFARE-Classic"
+};
+
+typedef MozIsoDepTech MozTagTech;
+
+[JSImplementation="@mozilla.org/nfc/tag;1", AvailableIn="PrivilegedApps"]
+interface MozNFCTag {
+ /**
+ * The supported technologies of this tag, null if unknown.
+ */
+ [Cached, Pure] readonly attribute sequence<NFCTechType>? techList;
+
+ /**
+ * The identifier of this tag.
+ */
+ [Constant] readonly attribute Uint8Array? id;
+
+ /**
+ * The type of this tag, null if unknown.
+ */
+ readonly attribute NFCTagType? type;
+
+ /**
+ * The maximum size of the NDEF supported on this tag, null if unknown.
+ */
+ readonly attribute long? maxNDEFSize;
+
+ /**
+ * Indicate if this tag is Read-Only, null if unknown.
+ */
+ readonly attribute boolean? isReadOnly;
+
+ /**
+ * Indicate if this tag is formatable, null if unknown.
+ */
+ readonly attribute boolean? isFormatable;
+
+ /**
+ * Indicate if this tag could be made Read-Only, null if unknown.
+ */
+ readonly attribute boolean? canBeMadeReadOnly;
+
+ /**
+ * Indicate if this tag is already lost.
+ */
+ readonly attribute boolean isLost;
+
+ /**
+ * Read current NDEF data on the tag.
+ */
+ [Throws]
+ Promise<sequence<MozNDEFRecord>> readNDEF();
+
+ /**
+ * Write NDEF data to the tag.
+ */
+ [Throws]
+ Promise<void> writeNDEF(sequence<MozNDEFRecord> records);
+
+ /**
+ * Make a tag read-only.
+ */
+ [Throws]
+ Promise<void> makeReadOnly();
+
+ /**
+ * Format a tag as NDEF.
+ */
+ [Throws]
+ Promise<void> format();
+
+ [NewObject, Throws]
+ MozTagTech selectTech(NFCTechType tech);
+};
+
+// Mozilla Only
+partial interface MozNFCTag {
+ [ChromeOnly]
+ attribute DOMString session;
+
+ [ChromeOnly]
+ void notifyLost();
+
+ [ChromeOnly, Throws]
+ Promise<Uint8Array> transceive(NFCTechType tech, Uint8Array command);
+};
diff --git a/dom/webidl/MozNFCTagEvent.webidl b/dom/webidl/MozNFCTagEvent.webidl
new file mode 100644
index 000000000..ae5d62398
--- /dev/null
+++ b/dom/webidl/MozNFCTagEvent.webidl
@@ -0,0 +1,29 @@
+/* -*- 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/.
+ */
+
+[Constructor(DOMString type, optional MozNFCTagEventInit eventInitDict),
+ Func="Navigator::HasNFCSupport", CheckPermissions="nfc",
+ AvailableIn="PrivilegedApps"]
+interface MozNFCTagEvent : Event
+{
+ /**
+ * The detected NFCTag.
+ */
+ readonly attribute MozNFCTag? tag;
+
+ /**
+ * The MozNDEFRecords pre-read during tag-discovered.
+ */
+ [Cached, Pure]
+ readonly attribute sequence<MozNDEFRecord>? ndefRecords;
+};
+
+dictionary MozNFCTagEventInit : EventInit
+{
+ MozNFCTag? tag = null;
+
+ sequence<MozNDEFRecord>? ndefRecords = [];
+};
diff --git a/dom/webidl/MozNetworkStats.webidl b/dom/webidl/MozNetworkStats.webidl
new file mode 100644
index 000000000..066cd62e7
--- /dev/null
+++ b/dom/webidl/MozNetworkStats.webidl
@@ -0,0 +1,74 @@
+/* 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/. */
+
+/**
+ * Provide the detailed options for specifying different kinds of data filtering
+ * in getSamples function.
+ */
+dictionary NetworkStatsGetOptions
+{
+ /**
+ * App manifest URL is used to filter network stats by app, while service type
+ * is used to filter stats by system service.
+ * Note that, these two options cannot be specified at the same time for now;
+ * others, an NS_ERROR_NOT_IMPLMENTED exception will be thrown.
+ */
+ DOMString appManifestURL;
+ DOMString serviceType;
+ /**
+ * If it is set as true, only the browsing traffic, which is generated from
+ * the mozbrowser iframe element within an app, is returned in result.
+ * If it is set as false or not set, the total traffic, which is generated
+ * from both the mozapp and mozbrowser iframe elements, is returned.
+ */
+ boolean browsingTrafficOnly;
+};
+
+dictionary NetworkStatsAlarmOptions
+{
+ Date startTime;
+ Date data;
+};
+
+[JSImplementation="@mozilla.org/networkstats;1",
+ ChromeOnly,
+ CheckPermissions="networkstats-manage",
+ Pref="dom.mozNetworkStats.enabled"]
+interface MozNetworkStats {
+ /**
+ * App manifest URL of an application for specifying the per-app stats of the
+ * specified app.
+ */
+ readonly attribute DOMString appManifestURL;
+
+ /**
+ * True if this stats is the browsing traffic of an app (the traffic generated
+ * by a mozbrowser iframe element).
+ * Otherwise this stats represents the total traffic of an app.
+ */
+ readonly attribute boolean browsingTrafficOnly;
+
+ /**
+ * Service type is used to retrieve the corresponding "system-only" stats.
+ * E.g., "Tethering", "OTA", etc.
+ */
+ readonly attribute DOMString serviceType;
+
+ /**
+ * Network the returned data belongs to.
+ */
+ readonly attribute MozNetworkStatsInterface network;
+
+ /**
+ * Stats for a network.
+ */
+ [Cached, Pure]
+ readonly attribute sequence<MozNetworkStatsData> data;
+
+ /**
+ * Dates
+ */
+ readonly attribute object start;
+ readonly attribute object end;
+};
diff --git a/dom/webidl/MozNetworkStatsAlarm.webidl b/dom/webidl/MozNetworkStatsAlarm.webidl
new file mode 100644
index 000000000..a363288a5
--- /dev/null
+++ b/dom/webidl/MozNetworkStatsAlarm.webidl
@@ -0,0 +1,14 @@
+/* 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/. */
+
+[JSImplementation="@mozilla.org/networkstatsalarm;1",
+ ChromeOnly,
+ CheckPermissions="networkstats-manage",
+ Pref="dom.mozNetworkStats.enabled"]
+interface MozNetworkStatsAlarm {
+ readonly attribute unsigned long alarmId;
+ readonly attribute MozNetworkStatsInterface network;
+ readonly attribute long threshold;
+ readonly attribute any data;
+};
diff --git a/dom/webidl/MozNetworkStatsData.webidl b/dom/webidl/MozNetworkStatsData.webidl
new file mode 100644
index 000000000..894e95b2f
--- /dev/null
+++ b/dom/webidl/MozNetworkStatsData.webidl
@@ -0,0 +1,13 @@
+/* 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/. */
+
+[JSImplementation="@mozilla.org/networkStatsdata;1",
+ ChromeOnly,
+ CheckPermissions="networkstats-manage",
+ Pref="dom.mozNetworkStats.enabled"]
+interface MozNetworkStatsData {
+ readonly attribute unsigned long rxBytes; // Received bytes.
+ readonly attribute unsigned long txBytes; // Sent bytes.
+ readonly attribute Date date; // Date.
+};
diff --git a/dom/webidl/MozNetworkStatsInterface.webidl b/dom/webidl/MozNetworkStatsInterface.webidl
new file mode 100644
index 000000000..1eb14c18e
--- /dev/null
+++ b/dom/webidl/MozNetworkStatsInterface.webidl
@@ -0,0 +1,26 @@
+/* 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/. */
+
+dictionary NetworkInterface {
+ long type;
+ DOMString id;
+};
+
+/**
+ * Represents a data interface for which the manager is recording statistics.
+ */
+[Constructor(optional NetworkInterface networkinterface),
+ JSImplementation="@mozilla.org/networkstatsinterface;1",
+ CheckPermissions="networkstats-manage",
+ Pref="dom.mozNetworkStats.enabled"]
+interface MozNetworkStatsInterface {
+ readonly attribute long type;
+
+ /**
+ * Id value is '0' for wifi or the iccid for mobile (SIM).
+ */
+ readonly attribute DOMString id;
+
+ jsonifier;
+};
diff --git a/dom/webidl/MozOtaStatusEvent.webidl b/dom/webidl/MozOtaStatusEvent.webidl
new file mode 100644
index 000000000..a386885be
--- /dev/null
+++ b/dom/webidl/MozOtaStatusEvent.webidl
@@ -0,0 +1,33 @@
+/* -*- 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/.
+ */
+
+[Pref="dom.mobileconnection.enabled",
+ Constructor(DOMString type, optional MozOtaStatusEventInit eventInitDict)]
+interface MozOtaStatusEvent : Event
+{
+ /**
+ * One of the following values:
+ *
+ * spl_unlocked
+ * spc_retries_exceeded
+ * a_key_exchanged
+ * ssd_updated
+ * nam_downloaded
+ * mdn_downloaded
+ * imsi_downloaded
+ * prl_downloaded
+ * committed
+ * otapa_started
+ * otapa_stopped
+ * otapa_aborted
+ */
+ readonly attribute DOMString status;
+};
+
+dictionary MozOtaStatusEventInit : EventInit
+{
+ DOMString status = "";
+};
diff --git a/dom/webidl/MozPaymentProvider.webidl b/dom/webidl/MozPaymentProvider.webidl
new file mode 100644
index 000000000..30137c3b2
--- /dev/null
+++ b/dom/webidl/MozPaymentProvider.webidl
@@ -0,0 +1,33 @@
+/* -*- 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/.
+ */
+
+callback SilentSmsCallback = void (optional MozSmsMessage message);
+
+dictionary PaymentIccInfo {
+ DOMString mcc;
+ DOMString mnc;
+ DOMString iccId;
+ boolean dataPrimary;
+};
+
+[NavigatorProperty="mozPaymentProvider",
+ NoInterfaceObject,
+ HeaderFile="mozilla/dom/PaymentProviderUtils.h",
+ Func="mozilla::dom::PaymentProviderUtils::EnabledForScope",
+ JSImplementation="@mozilla.org/payment/provider;1"]
+interface PaymentProvider {
+ readonly attribute DOMString? paymentServiceId;
+ // We expose to the payment provider the information of all the SIMs
+ // available in the device.
+ [Cached, Pure] readonly attribute sequence<PaymentIccInfo>? iccInfo;
+
+ void paymentSuccess(optional DOMString result);
+ void paymentFailed(optional DOMString error);
+
+ DOMRequest sendSilentSms(DOMString number, DOMString message);
+ void observeSilentSms(DOMString number, SilentSmsCallback callback);
+ void removeSilentSmsObserver(DOMString number, SilentSmsCallback callback);
+};
diff --git a/dom/webidl/MozPowerManager.webidl b/dom/webidl/MozPowerManager.webidl
new file mode 100644
index 000000000..8aac2f2d4
--- /dev/null
+++ b/dom/webidl/MozPowerManager.webidl
@@ -0,0 +1,96 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* 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/. */
+
+interface MozWakeLockListener;
+
+/**
+ * The reason for the factory reset.
+ * "normal" : simple factory reset.
+ * "wipe" : will also attempt to wipe all user storage areas.
+ * "root" : simple factory reset that also root the phone to get more
+ * privileges when using devtools.
+ */
+enum FactoryResetReason {
+ "normal",
+ "wipe",
+ "root"
+};
+
+/**
+ * This interface implements navigator.mozPower
+ */
+interface MozPowerManager
+{
+ [Throws]
+ void powerOff();
+ [Throws]
+ void reboot();
+ void factoryReset(optional FactoryResetReason reason = "normal");
+
+ /**
+ * The listeners are notified when a resource changes its lock state to:
+ * - unlocked
+ * - locked but not visible
+ * - locked and visible
+ */
+ void addWakeLockListener(MozWakeLockListener aListener);
+ void removeWakeLockListener(MozWakeLockListener aListener);
+
+ /**
+ * Query the wake lock state of the topic.
+ *
+ * Possible states are:
+ *
+ * - "unlocked" - nobody holds the wake lock.
+ *
+ * - "locked-foreground" - at least one window holds the wake lock,
+ * and it is visible.
+ *
+ * - "locked-background" - at least one window holds the wake lock,
+ * but all of them are hidden.
+ *
+ * @param aTopic The resource name related to the wake lock.
+ */
+ [Throws]
+ DOMString getWakeLockState(DOMString aTopic);
+
+ /**
+ * Is the device's screen currently enabled? This attribute controls the
+ * device's screen, so setting it to false will turn off the screen.
+ */
+ attribute boolean screenEnabled;
+
+ /**
+ * Is the device's keypad/button backlight enabled? Setting it to false will
+ * turn off the device's keypad/button backlight. And the brightness level
+ * is the same as |screenBrightness|.
+ */
+ attribute boolean keyLightEnabled;
+
+ /**
+ * How bright is the screen's backlight, on a scale from 0 (very dim) to 1
+ * (full brightness)? Setting this attribute modifies the screen's
+ * brightness.
+ *
+ * You can read and write this attribute even when the screen is disabled,
+ * but the backlight is off while the screen is disabled.
+ *
+ * If you write a value of X into this attribute, the attribute may not have
+ * the same value X when you later read it. Most screens don't support as
+ * many different brightness levels as there are doubles between 0 and 1, so
+ * we may reduce the value's precision before storing it.
+ *
+ * @throw NS_ERROR_INVALID_ARG if brightness is not in the range [0, 1].
+ */
+ [SetterThrows]
+ attribute double screenBrightness;
+
+ /**
+ * Is it possible that the device's CPU will sleep after the screen is
+ * disabled? Setting this attribute to false will prevent the device
+ * entering suspend state.
+ */
+ attribute boolean cpuSleepAllowed;
+};
diff --git a/dom/webidl/MozSelfSupport.webidl b/dom/webidl/MozSelfSupport.webidl
new file mode 100644
index 000000000..160141d76
--- /dev/null
+++ b/dom/webidl/MozSelfSupport.webidl
@@ -0,0 +1,42 @@
+/* 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 MozSelfSupport interface allows external Mozilla support sites such as
+ * FHR and SUMO to access data and control settings that are not otherwise
+ * exposed to external content.
+ *
+ * At the moment, this is a ChromeOnly interface, but the plan is to allow
+ * specific Mozilla domains to access it directly.
+ */
+[ChromeOnly,
+ JSImplementation="@mozilla.org/mozselfsupport;1",
+ Constructor()]
+interface MozSelfSupport
+{
+ /**
+ * Controls whether uploading FHR data is allowed.
+ */
+ attribute boolean healthReportDataSubmissionEnabled;
+
+ /**
+ * Retrieves the FHR payload object, which is of the form:
+ *
+ * {
+ * version: Number,
+ * clientID: String,
+ * clientIDVersion: Number,
+ * thisPingDate: String,
+ * goannaAppInfo: Object,
+ * data: Object
+ * }
+ *
+ * Refer to the getJSONPayload function in healthreporter.jsm for more
+ * information.
+ *
+ * @return Promise<Object>
+ * Resolved when the FHR payload data has been collected.
+ */
+ Promise<object> getHealthReportPayload();
+};
diff --git a/dom/webidl/MozSettingsEvent.webidl b/dom/webidl/MozSettingsEvent.webidl
index a534f3ae8..7f047f16d 100644
--- a/dom/webidl/MozSettingsEvent.webidl
+++ b/dom/webidl/MozSettingsEvent.webidl
@@ -4,11 +4,10 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-[Constructor(DOMString type, optional MozSettingsEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Constructor(DOMString type, optional MozSettingsEventInit eventInitDict)]
interface MozSettingsEvent : Event
{
readonly attribute DOMString? settingName;
- [Throws]
readonly attribute any settingValue;
};
diff --git a/dom/webidl/MozSettingsTransactionEvent.webidl b/dom/webidl/MozSettingsTransactionEvent.webidl
new file mode 100644
index 000000000..bc8955770
--- /dev/null
+++ b/dom/webidl/MozSettingsTransactionEvent.webidl
@@ -0,0 +1,17 @@
+/* -*- 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/.
+ */
+
+[Constructor(DOMString type, optional MozSettingsTransactionEventInit eventInitDict),
+ CheckPermissions="settings-api-read settings-api-write"]
+interface MozSettingsTransactionEvent : Event
+{
+ readonly attribute DOMString? error;
+};
+
+dictionary MozSettingsTransactionEventInit : EventInit
+{
+ DOMString error = "";
+};
diff --git a/dom/webidl/MozSmsEvent.webidl b/dom/webidl/MozSmsEvent.webidl
index e7d2db667..1596dd1d5 100644
--- a/dom/webidl/MozSmsEvent.webidl
+++ b/dom/webidl/MozSmsEvent.webidl
@@ -5,7 +5,10 @@
*/
interface MozSmsMessage;
-[Constructor(DOMString type, optional MozSmsEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Pref="dom.sms.enabled",
+ CheckPermissions="sms",
+ AvailableIn="CertifiedApps",
+ Constructor(DOMString type, optional MozSmsEventInit eventInitDict)]
interface MozSmsEvent : Event
{
readonly attribute MozSmsMessage? message;
diff --git a/dom/webidl/MozSpeakerManager.webidl b/dom/webidl/MozSpeakerManager.webidl
new file mode 100644
index 000000000..56ecf866f
--- /dev/null
+++ b/dom/webidl/MozSpeakerManager.webidl
@@ -0,0 +1,18 @@
+/* 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/.
+ */
+
+/*
+ * Allow application can control acoustic sound output through speaker.
+ * Reference https://wiki.mozilla.org/WebAPI/SpeakerManager
+ */
+[Constructor()]
+interface MozSpeakerManager : EventTarget {
+ /* query the speaker status */
+ readonly attribute boolean speakerforced;
+ /* force device device's acoustic sound output through speaker */
+ attribute boolean forcespeaker;
+ /* this event will be fired when device's speaker forced status change */
+ attribute EventHandler onspeakerforcedchange;
+};
diff --git a/dom/webidl/MozStkCommandEvent.webidl b/dom/webidl/MozStkCommandEvent.webidl
index bfe8ec3fa..f26e4be6e 100644
--- a/dom/webidl/MozStkCommandEvent.webidl
+++ b/dom/webidl/MozStkCommandEvent.webidl
@@ -4,8 +4,713 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+enum IccImageCodingScheme { "basic", "color", "color-transparency" };
+
+dictionary MozStkIcon
+{
+ /*
+ * Width of the icon.
+ */
+ unsigned long width;
+
+ /*
+ * Height of the icon.
+ */
+ unsigned long height;
+
+ /*
+ * Image coding scheme of the icon.
+ */
+ IccImageCodingScheme codingScheme;
+
+ /*
+ * Array of pixels. Each pixel represents a color in the RGBA format made up
+ * of four bytes, that is, the Red sample in the highest 8 bits, followed by
+ * the Green sample, Blue sample and the Alpha sample in the lowest 8 bits.
+ */
+ sequence<unsigned long> pixels;
+};
+
+dictionary MozStkIconContainer
+{
+ /**
+ * Indicates how the icon is to be used.
+ *
+ * @see TS 11.14, clause 12.31, Icon Identifier.
+ *
+ * true: icon replaces the text string.
+ * false: icon shall be displayed together with the text string.
+ */
+ boolean iconSelfExplanatory;
+
+ /**
+ * Icon(s) that replaces or accompanies the text string.
+ *
+ * @see TS 11.14, clause 12.31, Icon Identifier.
+ *
+ * Array of icons, basically of a same image, that may differ in size,
+ * resolution or coding scheme. The first icon should be the default one.
+ */
+ sequence<MozStkIcon> icons;
+};
+
+[Pref="dom.icc.enabled",
+ CheckPermissions="mobileconnection",
+ AvailableIn="CertifiedApps",
+ Constructor(DOMString type, optional MozStkCommandEventInit eventInitDict)]
interface MozStkCommandEvent : Event
{
- [Throws]
readonly attribute any command;
};
+
+dictionary MozStkCommandEventInit : EventInit
+{
+ any command = null;
+};
+
+dictionary MozStkTextMessage : MozStkIconContainer
+{
+ /**
+ * Text String.
+ *
+ * @see TS 11.14, clause 12.15, Text String.
+ */
+ DOMString text;
+
+ /**
+ * The length of time for which the ME shall display the dialog.
+ */
+ MozStkDuration duration;
+
+ /**
+ * Indicate this text message is high priority or normal priority.
+ *
+ * @see TS 11.14, clause 12.6, Command Qualifier, Display Text, bit 1.
+ *
+ * High priority text shall be displayed on the screen immediately, except if
+ * there is a conflict of priority level of alerting such as incoming calls
+ * or a low battery warning. In that situation, the resolution is left to
+ * the terminal. If the command is rejected in spite of the high priority,
+ * the terminal shall inform the ICC with resultCode is
+ * MozIccManager.STK_RESULT_TERMINAL_CRNTLY_UNABLE_TO_PROCESS in MozStkResponse.
+ *
+ * true: high priority
+ * false: normal priority
+ */
+ boolean isHighPriority;
+
+ /**
+ * Need to wait for user to clear message or not.
+ *
+ * @see TS 11.14, clause 12.6, Command Qualifier, Display Text, bit 8.
+ *
+ * If this attribute is true, but user doesn't give any input within a period
+ * of time(said 30 secs), the terminal shall inform the ICC with resultCode
+ * is MozIccManager.STK_RESULT_NO_RESPONSE_FROM_USER in MozStkResponse.
+ *
+ * true: Wait for user to clear message.
+ * false: clear message after a delay.
+ */
+ boolean userClear;
+
+ /**
+ * Need to response immediately or not.
+ *
+ * @see TS 11.14, clause 12.43, Immediate response.
+ *
+ * When this attribute is true, the terminal shall immediately send
+ * MozStkResponse with resultCode is OK.
+ *
+ * true: The terminal shall send response immediately.
+ * false: otherwise.
+ */
+ boolean responseNeeded;
+};
+
+dictionary MozStkItem : MozStkIconContainer
+{
+ /**
+ * Identifier of item.
+ *
+ * The identifier is a single byte between '01' and 'FF'. Each item shall
+ * have a unique identifier within an Item list.
+ */
+ unsigned short identifier;
+
+ /**
+ * Text string of item.
+ */
+ DOMString text;
+};
+
+dictionary MozStkMenu : MozStkIconContainer
+{
+ /**
+ * Array of MozStkItem.
+ *
+ * @see TS 11.14, clause 12.9
+ */
+ sequence<MozStkItem> items;
+
+ /**
+ * Presentation type, one of MozIccManager.STK_MENU_TYPE_*.
+ */
+ unsigned short presentationType;
+
+ /**
+ * Title of the menu.
+ */
+ DOMString title;
+
+ /**
+ * Default item identifier of the menu.
+ */
+ unsigned short defaultItem;
+
+ /**
+ * Help information available or not.
+ *
+ * @see TS 11.14, clause 12.6, Command Qualifier, SET UP MENU, bit 8.
+ *
+ * true: help information available.
+ * false: no help information available.
+ */
+ boolean isHelpAvailable;
+
+ /**
+ * List of Next Action Indicators.
+ * Each element should be one of MozIccManager.STK_CMD_*
+ * or MozIccManager.STK_NEXT_ACTION_*
+ * If it's MozIccManager.STK_NEXT_ACTION_NULL, the terminal should ignore this
+ * action in corresponding item.
+ *
+ * @see TS 11.14, clause 12.24, Items Next Action Indicator.
+ */
+ sequence<unsigned short> nextActionList;
+};
+
+dictionary MozStkInput : MozStkIconContainer
+{
+ /**
+ * Text for the ME to display in conjunction with asking the user to respond.
+ */
+ DOMString text;
+
+ /**
+ * The length of time for which the ME shall display the dialog. This field
+ * is used only for GET INKEY.
+ *
+ * @see TS 11.14, clause 11.8, duration, GET INKEY T.C 27.22.4.2.8.4.2
+ */
+ MozStkDuration duration;
+
+ /**
+ * Minimum length of response.
+ */
+ unsigned short minLength;
+
+ /**
+ * Maximum length of response.
+ */
+ unsigned short maxLength;
+
+ /**
+ * Text for the ME to display, corresponds to a default text string offered
+ * by the ICC.
+ */
+ DOMString defaultText;
+
+ /**
+ * Input format.
+ *
+ * @see TS 11.14, clause 12.6, Command Qualifier, GET INPUT, bit 1.
+ *
+ * true: Alphabet set.
+ * false: Digits only.
+ */
+ boolean isAlphabet;
+
+ /**
+ * Alphabet encoding.
+ *
+ * @see TS 11.14, clause 12.6, Command Qualifier, GET INPUT, bit 2.
+ *
+ * true: UCS2 alphabet.
+ * false: default SMS alphabet.
+ */
+ boolean isUCS2;
+
+ /**
+ * Visibility of input.
+ *
+ * @see TS 11.14, clause 12.6, Command Qualifier, GET INPUT, bit 3.
+ *
+ * true: User input shall not be revealed in any way.
+ * false: ME may echo user input on the display.
+ */
+ boolean hideInput;
+
+ /**
+ * Yes/No response is requested.
+ *
+ * @see TS 11.14, clause 12.6, Command Qualifier, GET INKEY, bit 3.
+ *
+ * true: Yes/No response is requested, and character sets
+ * (Alphabet set and UCS2) are disabled.
+ * false: Character sets (Alphabet set and UCS2) are enabled.
+ */
+ boolean isYesNoRequested;
+
+ /**
+ * User input in packed or unpacked format.
+ *
+ * @see TS 11.14, clause 12.6, Command Qualifier, GET INPUT, bit 4.
+ *
+ * true: User input to be in SMS packed format.
+ * false: User input to be in unpacked format.
+ */
+ boolean isPacked;
+
+ /**
+ * Help information available or not.
+ *
+ * @see TS 11.14, clause 12.6, Command Qualifier, GET INPUT/GET INKEY, bit 8.
+ *
+ * true: help information available.
+ * false: no help information available.
+ */
+ boolean isHelpAvailable;
+};
+
+dictionary MozStkBrowserSetting
+{
+ /**
+ * Confirm message to launch browser.
+ */
+ MozStkTextMessage confirmMessage;
+
+ /**
+ * The URL to be opened by browser.
+ */
+ DOMString url;
+
+ /**
+ * One of MozIccManager.STK_BROWSER_MODE_*.
+ */
+ unsigned short mode;
+};
+
+dictionary MozStkSetUpCall
+{
+ /**
+ * The Dialling number.
+ */
+ DOMString address;
+
+ /**
+ * The text message used in user confirmation phase.
+ */
+ MozStkTextMessage confirmMessage;
+
+ /**
+ * The text message used in call set up phase.
+ */
+ MozStkTextMessage callMessage;
+
+ /**
+ * The Optional maximum duration for the redial mechanism.
+ * The time elapsed since the first call set-up attempt has exceeded the duration
+ * requested by the UICC, the redial mechanism is terminated.
+ */
+ MozStkDuration duration;
+};
+
+dictionary MozStkSetUpEventList
+{
+ /**
+ * The list of events that needs to provide details to ICC when they happen.
+ * When this valus is null, means an indication to remove the existing list
+ * of events in ME.
+ *
+ * @see MozIccManager.STK_EVENT_TYPE_*
+ */
+ sequence<unsigned short> eventList;
+};
+
+dictionary MozStkLocationInfo
+{
+ /**
+ * Mobile Country Code (MCC) of the current serving operator.
+ */
+ unsigned short mcc;
+
+ /**
+ * Mobile Network Code (MNC) of the current serving operator.
+ */
+ unsigned short mnc;
+
+ /**
+ * Mobile Location Area Code (LAC) for the current serving operator.
+ */
+ unsigned short gsmLocationAreaCode;
+
+ /**
+ * Mobile Cell ID for the current serving operator.
+ */
+ unsigned long gsmCellId;
+};
+
+dictionary MozStkDuration
+{
+ /**
+ * Time unit used, should be one of MozIccManager.STK_TIME_UNIT_*.
+ */
+ unsigned short timeUnit;
+
+ /**
+ * The length of time required, expressed in timeUnit.
+ */
+ octet timeInterval;
+};
+
+dictionary MozStkPlayTone : MozStkIconContainer
+{
+ /**
+ * Text String.
+ */
+ DOMString text;
+
+ /**
+ * One of MozIccManager.STK_TONE_TYPE_*.
+ */
+ unsigned short tone;
+
+ /**
+ * The length of time for which the ME shall generate the tone.
+ */
+ MozStkDuration duration;
+
+ /**
+ * Need to vibrate or not.
+ * true: vibrate alert, if available, with the tone.
+ * false: use of vibrate alert is up to the ME.
+ */
+ boolean isVibrate;
+};
+
+dictionary MozStkProvideLocalInfo
+{
+ /**
+ * Indicate which local information is required.
+ * It shall be one of following:
+ * - MozIccManager.STK_LOCAL_INFO_LOCATION_INFO
+ * - MozIccManager.STK_LOCAL_INFO_IMEI
+ * - MozIccManager.STK_LOCAL_INFO_DATE_TIME_ZONE
+ * - MozIccManager.STK_LOCAL_INFO_LANGUAGE
+ */
+ unsigned short localInfoType;
+};
+
+dictionary MozStkLocationEvent
+{
+ /**
+ * The type of this event.
+ * It shall be MozIccManager.STK_EVENT_TYPE_LOCATION_STATUS;
+ */
+ unsigned short eventType;
+
+ /**
+ * Indicate current service state of the MS with one of the values listed
+ * below:
+ * - MozIccManager.STK_SERVICE_STATE_NORMAL
+ * - MozIccManager.STK_SERVICE_STATE_LIMITED
+ * - MozIccManager.STK_SERVICE_STATE_UNAVAILABLE
+ */
+ unsigned short locationStatus;
+
+ /**
+ * See MozStkLocationInfo.
+ * This value shall only be provided if the locationStatus indicates
+ * MozIccManager.STK_SERVICE_STATE_NORMAL.
+ */
+ MozStkLocationInfo locationInfo;
+};
+
+dictionary MozStkTimer
+{
+ /**
+ * Identifier of a timer.
+ */
+ octet timerId;
+
+ /**
+ * Length of time during which the timer has to run.
+ * The resolution of a timer is 1 second.
+ */
+ unsigned long timerValue;
+
+ /**
+ * The action requested from UICC.
+ * It shall be one of below:
+ * - MozIccManager.STK_TIMER_START
+ * - MozIccManager.STK_TIMER_DEACTIVATE
+ * - MozIccManager.STK_TIMER_GET_CURRENT_VALUE
+ */
+ unsigned short timerAction;
+};
+
+dictionary MozStkBipMessage : MozStkIconContainer
+{
+ /**
+ * Text String
+ */
+ DOMString text;
+};
+
+dictionary MozStkCommand
+{
+ /**
+ * The number of command issued by ICC. And it is assigned
+ * by ICC may take any hexadecimal value betweean '01' and 'FE'.
+ *
+ * @see TS 11.14, clause 6.5.1
+ */
+ unsigned short commandNumber;
+
+ /**
+ * One of MozIccManager.STK_CMD_*
+ */
+ unsigned short typeOfCommand;
+
+ /**
+ * Qualifiers specific to the command.
+ */
+ unsigned short commandQualifier;
+
+ /**
+ * options varies accrording to the typeOfCommand in MozStkCommand.
+ *
+ * When typeOfCommand is
+ * - MozIccManager.STK_CMD_DISPLAY_TEXT
+ * - MozIccManager.STK_CMD_SET_UP_IDLE_MODE_TEXT
+ * - MozIccManager.STK_CMD_SEND_{SS|USSD|SMS|DTMF},
+ * options is MozStkTextMessage.
+ *
+ * When typeOfCommand is
+ * - MozIccManager.STK_CMD_SELECT_ITEM
+ * - MozIccManager.STK_CMD_SET_UP_MENU
+ * options is MozStkMenu.
+ *
+ * When typeOfCommand is
+ * - MozIccManager.STK_CMD_GET_INKEY
+ * - MozIccManager.STK_CMD_GET_INPUT,
+ * options is MozStkInput.
+ *
+ * When typeOfCommand is
+ * - MozIccManager.STK_CMD_LAUNCH_BROWSER
+ * options is MozStkBrowserSetting.
+ *
+ * When typeOfCommand is
+ * - MozIccManager.STK_CMD_SET_UP_CALL
+ * options is MozStkSetUpCall.
+ *
+ * When typeOfCommand is
+ * - MozIccManager.STK_CMD_SET_UP_EVENT_LIST
+ * options is MozStkSetUpEventList.
+ *
+ * When typeOfCommand is
+ * - MozIccManager.STK_CMD_PLAY_TONE
+ * options is MozStkPlayTone.
+ *
+ * When typeOfCommand is
+ * - MozIccManager.STK_CMD_POLL_INTERVAL
+ * options is MozStkDuration.
+ *
+ * When typeOfCommand is
+ * - MozIccManager.STK_CMD_PROVIDE_LOCAL_INFO
+ * options is MozStkProvideLocalInfo.
+ *
+ * When typeOfCommand is
+ * - MozIccManager.STK_CMD_TIMER_MANAGEMENT
+ * option is MozStkTimer
+ *
+ * When typeOfCommand is
+ * - MozIccManager.STK_CMD_OPEN_CHANNEL
+ * - MozIccManager.STK_CMD_CLOSE_CHANNEL
+ * - MozIccManager.STK_CMD_SEND_DATA
+ * - MozIccManager.STK_CMD_RECEIVE_DATA
+ * options is MozStkBipMessage
+ *
+ * When typeOfCommand is
+ * - MozIccManager.STK_CMD_POLL_OFF
+ * options is null.
+ *
+ * When typeOfCommand is
+ * - MozIccManager.STK_CMD_REFRESH
+ * options is null.
+ */
+ any options;
+};
+
+dictionary MozStkResponse
+{
+ /**
+ * One of MozIccManager.STK_RESULT_*
+ */
+ unsigned short resultCode;
+
+ /**
+ * One of MozIccManager.STK_ADDITIONAL_INFO_*
+ */
+ unsigned short additionalInformation;
+
+ /**
+ * The identifier of the item selected by user.
+ *
+ * @see MozStkItem.identifier
+ */
+ unsigned short itemIdentifier;
+
+ /**
+ * User input.
+ */
+ DOMString input;
+
+ /**
+ * YES/NO response.
+ *
+ * @see MozStkInput.isYesNoRequested
+ */
+ boolean isYesNo;
+
+ /**
+ * User has confirmed or rejected the call during
+ * MozIccManager.STK_CMD_CALL_SET_UP.
+ *
+ * @see RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM
+ *
+ * true: Confirmed by User.
+ * false: Rejected by User.
+ */
+ boolean hasConfirmed;
+
+ /**
+ * The response for MozIccManager.STK_CMD_PROVIDE_LOCAL_INFO
+ */
+ MozStkLocalInfo localInfo;
+
+ /**
+ * The response for MozIccManager.STK_CMD_TIMER_MANAGEMENT.
+ * The 'timerValue' is needed if the action of
+ * MozIccManager.STK_CMD_TIMER_MANAGEMENT is MozIccManager.STK_TIMER_DEACTIVATE
+ * or MozIccManager.STK_TIMER_GET_CURRENT_VALUE.
+ * It shall state the current value of a timer. And the resolution is 1 second.
+ */
+ MozStkTimer timer;
+};
+
+dictionary MozStkCallEvent
+{
+ /**
+ * The type of this event.
+ * It shall be one of following:
+ * - MozIccManager.STK_EVENT_TYPE_MT_CALL,
+ * - MozIccManager.STK_EVENT_TYPE_CALL_CONNECTED,
+ * - MozIccManager.STK_EVENT_TYPE_CALL_DISCONNECTED.
+ */
+ unsigned short eventType;
+
+ /**
+ * Remote party number.
+ */
+ DOMString number;
+
+ /**
+ * This field is available in MozIccManager.STK_EVENT_TYPE_CALL_CONNECTED and
+ * MozIccManager.STK_EVENT_TYPE_CALL_DISCONNECTED events.
+ * For the MozIccManager.STK_EVENT_TYPE_CALL_CONNECTED event, setting this to
+ * true means the connection is answered by remote end, that is, this is an
+ * outgoing call.
+ * For the MozIccManager.STK_EVENT_TYPE_CALL_DISCONNECTED event, setting this
+ * to true indicates the connection is hung up by remote.
+ */
+ boolean isIssuedByRemote;
+
+ /**
+ * This field is available in Call Disconnected event to indicate the cause
+ * of disconnection. The cause string is passed to gaia through the error
+ * listener of CallEvent. Null if there's no error.
+ */
+ DOMString error;
+};
+
+dictionary MozStkLocalInfo
+{
+ /**
+ * IMEI information
+ */
+ DOMString imei;
+
+ /**
+ * Location Information
+ */
+ MozStkLocationInfo locationInfo;
+
+ /**
+ * Date information
+ */
+ Date date;
+
+ /**
+ * Language Information
+ *
+ * @see ISO 639-1, Alpha-2 code
+ */
+ DOMString language;
+};
+
+dictionary MozStkLanguageSelectionEvent
+{
+ /**
+ * The type of this event.
+ * It shall be MozIccManager.STK_EVENT_TYPE_LANGUAGE_SELECTION.
+ */
+ unsigned short eventType;
+
+ /**
+ * Language Information
+ *
+ * @see ISO 639-1, Alpha-2 code
+ * "de" for German, "en" for English, "zh" for Chinese, etc.
+ */
+ DOMString language;
+};
+
+dictionary MozStkBrowserTerminationEvent
+{
+ /**
+ * The type of this event.
+ * It shall be MozIccManager.STK_EVENT_TYPE_BROWSER_TERMINATION
+ */
+ unsigned short eventType;
+
+ /**
+ * This object shall contain the browser termination cause.
+ * See TZ 102 223 8.51. It shall be one of following:
+ * - MozIccManager.STK_BROWSER_TERMINATION_CAUSE_USER
+ * - MozIccManager.STK_BROWSER_TERMINATION_CAUSE_ERROR
+ */
+ unsigned short terminationCause;
+};
+
+dictionary MozStkGeneralEvent
+{
+ /**
+ * The type of this event, MozStkGeneralEvent can be used for all Stk Event
+ * requires no more parameter than event type, including
+ * MozIccManager.STK_EVENT_TYPE_USER_ACTIVITY.
+ * MozIccManager.STK_EVENT_TYPE_IDLE_SCREEN_AVAILABLE.
+ * HCI Connectivity Event(Not defined in interface yet).
+ */
+ unsigned short eventType;
+};
diff --git a/dom/webidl/MozTetheringManager.webidl b/dom/webidl/MozTetheringManager.webidl
new file mode 100644
index 000000000..57cde749f
--- /dev/null
+++ b/dom/webidl/MozTetheringManager.webidl
@@ -0,0 +1,57 @@
+/* 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/. */
+
+enum TetheringType {
+ "bluetooth",
+ "usb",
+ "wifi"
+};
+
+enum SecurityType {
+ "open",
+ "wpa-psk",
+ "wpa2-psk"
+};
+
+dictionary WifiTetheringConfig {
+ DOMString ssid;
+ SecurityType security;
+ DOMString key;
+};
+
+dictionary TetheringConfiguration {
+ DOMString ip;
+ DOMString prefix;
+ DOMString startIp;
+ DOMString endIp;
+ DOMString dns1;
+ DOMString dns2;
+ WifiTetheringConfig wifiConfig;
+};
+
+[JSImplementation="@mozilla.org/tetheringmanager;1",
+ NavigatorProperty="mozTetheringManager",
+ AvailableIn="CertifiedApps"]
+interface MozTetheringManager {
+ /**
+ * Enable/Disable tethering.
+ * @param enabled True to enable tethering, False to disable tethering.
+ * @param type Tethering type to enable/disable.
+ * @param config Configuration should have following fields when enable is True:
+ * - ip ip address.
+ * - prefix mask length.
+ * - startIp start ip address allocated by DHCP server for tethering.
+ * - endIp end ip address allocated by DHCP server for tethering.
+ * - dns1 first DNS server address.
+ * - dns2 second DNS server address.
+ * - wifiConfig wifi tethering configuration
+ * - ssid SSID network name.
+ * - security open, wpa-psk or wpa2-psk.
+ * - key password for wpa-psk or wpa2-psk.
+ * config should not be set when enabled is False.
+ */
+ Promise<any> setTetheringEnabled(boolean enabled,
+ TetheringType type,
+ optional TetheringConfiguration config);
+};
diff --git a/dom/webidl/MozTimeManager.webidl b/dom/webidl/MozTimeManager.webidl
index 17355fa35..0308835fb 100644
--- a/dom/webidl/MozTimeManager.webidl
+++ b/dom/webidl/MozTimeManager.webidl
@@ -2,7 +2,7 @@
* 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/. */
-[PrefControlled]
+[Func="mozilla::dom::time::TimeManager::PrefEnabled"]
interface MozTimeManager {
/* Set the system time.
*
diff --git a/dom/webidl/MozVoicemail.webidl b/dom/webidl/MozVoicemail.webidl
new file mode 100644
index 000000000..553ce86d1
--- /dev/null
+++ b/dom/webidl/MozVoicemail.webidl
@@ -0,0 +1,37 @@
+/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
+/* vim: set ts=2 et sw=2 tw=40: */
+/* 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/. */
+
+[Pref="dom.voicemail.enabled",
+ CheckPermissions="voicemail",
+ AvailableIn="CertifiedApps"]
+interface MozVoicemail : EventTarget
+{
+ /**
+ * The current voicemail status of a specified service, or null when the
+ * status is unknown.
+ */
+ [Throws]
+ MozVoicemailStatus getStatus(optional unsigned long serviceId);
+
+ /**
+ * The voicemail box dialing number of a specified service, or null if one
+ * wasn't found.
+ */
+ [Throws]
+ DOMString getNumber(optional unsigned long serviceId);
+
+ /**
+ * The display name of the voicemail box dialing number of a specified service,
+ * or null if one wasn't found.
+ */
+ [Throws]
+ DOMString getDisplayName(optional unsigned long serviceId);
+
+ /**
+ * The current voicemail status has changed.
+ */
+ attribute EventHandler onstatuschanged;
+};
diff --git a/dom/webidl/MozVoicemailEvent.webidl b/dom/webidl/MozVoicemailEvent.webidl
index 119b03f18..1ca428b5f 100644
--- a/dom/webidl/MozVoicemailEvent.webidl
+++ b/dom/webidl/MozVoicemailEvent.webidl
@@ -3,9 +3,11 @@
* 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/.
*/
-interface MozVoicemailStatus;
-[Constructor(DOMString type, optional MozVoicemailEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Constructor(DOMString type, optional MozVoicemailEventInit eventInitDict),
+ Pref="dom.voicemail.enabled",
+ CheckPermissions="voicemail",
+ AvailableIn="CertifiedApps"]
interface MozVoicemailEvent : Event
{
readonly attribute MozVoicemailStatus? status;
diff --git a/dom/webidl/MozVoicemailStatus.webidl b/dom/webidl/MozVoicemailStatus.webidl
new file mode 100644
index 000000000..0773fe278
--- /dev/null
+++ b/dom/webidl/MozVoicemailStatus.webidl
@@ -0,0 +1,47 @@
+/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
+/* vim: set ts=2 et sw=2 tw=40: */
+/* 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/. */
+
+[Pref="dom.voicemail.enabled",
+ CheckPermissions="voicemail",
+ AvailableIn="CertifiedApps"]
+interface MozVoicemailStatus
+{
+ readonly attribute unsigned long serviceId;
+
+ /**
+ * Whether or not there are messages waiting in the voicemail box
+ */
+ readonly attribute boolean hasMessages;
+
+ /**
+ * The total message count. Some voicemail indicators will only specify that
+ * messages are waiting, but not the actual number. In that case, the value
+ * of messageCount will be -1, indicating the unknown message count.
+ *
+ * Logic for a voicemail notification might look something like:
+ * if (status.hasMessages) {
+ * // show new voicemail notification
+ * if (status.messageCount > 0) {
+ * // add a label for the message count
+ * }
+ * } else {
+ * // hide the voicemail notification
+ * }
+ */
+ readonly attribute long messageCount;
+
+ /**
+ * Return call number received for this voicemail status, or null if one
+ * wasn't provided.
+ */
+ readonly attribute DOMString? returnNumber;
+
+ /**
+ * Displayable return call message received for this voicemail status, or null
+ * if one wasn't provided.
+ */
+ readonly attribute DOMString? returnMessage;
+};
diff --git a/dom/webidl/MozWakeLock.webidl b/dom/webidl/MozWakeLock.webidl
new file mode 100644
index 000000000..d5041ea04
--- /dev/null
+++ b/dom/webidl/MozWakeLock.webidl
@@ -0,0 +1,18 @@
+/* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=2 et sw=2 tw=80: */
+/* 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/. */
+
+[Pref="dom.wakelock.enabled", Func="Navigator::HasWakeLockSupport"]
+interface MozWakeLock
+{
+ readonly attribute DOMString topic;
+
+ /**
+ * Release the wake lock.
+ * @throw NS_ERROR_DOM_INVALID_STATE_ERR if already unlocked.
+ */
+ [Throws]
+ void unlock();
+};
diff --git a/dom/webidl/MozWifiCapabilities.webidl b/dom/webidl/MozWifiCapabilities.webidl
new file mode 100644
index 000000000..3acf5fd55
--- /dev/null
+++ b/dom/webidl/MozWifiCapabilities.webidl
@@ -0,0 +1,46 @@
+/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=2 et sw=2 tw=80: */
+/* 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 capabilities of Wifi. These are guaranteed not to change over the
+ * lifetime of that particular instance.
+ */
+enum WifiSecurityMethod {
+ "OPEN",
+ "WEP",
+ "WPA-PSK",
+ "WPA-EAP"
+};
+
+enum WifiWpaMethod {
+ "SIM",
+ "PEAP",
+ "TTLS",
+ "TLS"
+};
+
+enum WifiWpaPhase2Method {
+ "MSCHAPV2",
+ "GTC"
+};
+
+enum WifiWpaCertificate {
+ "SERVER",
+ "USER"
+};
+
+[JSImplementation="@mozilla.org/mozwificapabilities;1",
+ Func="Navigator::HasWifiManagerSupport"]
+interface MozWifiCapabilities {
+ [Constant, Cached] readonly attribute sequence<WifiSecurityMethod> security;
+ [Constant, Cached] readonly attribute sequence<WifiWpaMethod> eapMethod;
+ [Constant, Cached] readonly attribute sequence<WifiWpaPhase2Method> eapPhase2;
+ [Constant, Cached] readonly attribute sequence<WifiWpaCertificate> certificate;
+
+ jsonifier;
+};
+
diff --git a/dom/webidl/MozWifiConnectionInfoEvent.webidl b/dom/webidl/MozWifiConnectionInfoEvent.webidl
index 6caca8e8f..cfba1aa3e 100644
--- a/dom/webidl/MozWifiConnectionInfoEvent.webidl
+++ b/dom/webidl/MozWifiConnectionInfoEvent.webidl
@@ -4,14 +4,32 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-[Constructor(DOMString type, optional MozWifiConnectionInfoEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Constructor(DOMString type, optional MozWifiConnectionInfoEventInit eventInitDict)]
interface MozWifiConnectionInfoEvent : Event
{
- [Throws]
+ /**
+ * Network object with an SSID field.
+ */
readonly attribute any network;
+
+ /**
+ * Strength of the signal to network, in dBm between -55 and -100 dBm.
+ */
readonly attribute short signalStrength;
+
+ /**
+ * Relative signal strength between 0 and 100.
+ */
readonly attribute short relSignalStrength;
+
+ /**
+ * Link speed in Mb/s.
+ */
readonly attribute long linkSpeed;
+
+ /**
+ * IP address in the dotted quad format.
+ */
readonly attribute DOMString? ipAddress;
};
diff --git a/dom/webidl/MozWifiManager.webidl b/dom/webidl/MozWifiManager.webidl
new file mode 100644
index 000000000..baa39dd28
--- /dev/null
+++ b/dom/webidl/MozWifiManager.webidl
@@ -0,0 +1,345 @@
+/* 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/. */
+
+enum WifiWPSMethod {
+ "pbc",
+ "pin",
+ "cancel"
+};
+
+enum ConnectionStatus {
+ "connecting",
+ "authenticating",
+ "associated",
+ "connected",
+ "disconnected",
+ "wps-timedout",
+ "wps-failed",
+ "wps-overlapped",
+ "connectingfailed"
+};
+
+dictionary WifiWPSInfo {
+ WifiWPSMethod method;
+ DOMString? pin;
+ DOMString? bssid;
+};
+
+dictionary NetworkProperties {
+ DOMString ssid;
+ long mode;
+ long frequency;
+ sequence<DOMString>? security;
+ sequence<DOMString>? capabilities;
+ boolean known;
+ boolean connected;
+ boolean hidden;
+ DOMString bssid;
+ DOMString signalStrength;
+ long relSignalStrength;
+ DOMString psk;
+ DOMString wep;
+ DOMString wep_key0;
+ DOMString wep_key1;
+ DOMString wep_key2;
+ DOMString wep_key3;
+ long wep_tx_keyidx;
+ long priority;
+ long scan_ssid;
+ DOMString keyManagement;
+ DOMString identity;
+ DOMString password;
+ DOMString auth_alg;
+ DOMString phase1;
+ DOMString phase2;
+ DOMString eap;
+ DOMString pin;
+ boolean dontConnect;
+ DOMString serverCertificate;
+ DOMString subjectMatch;
+};
+
+[Constructor(optional NetworkProperties properties),
+ JSImplementation="@mozilla.org/mozwifinetwork;1",
+ Func="Navigator::HasWifiManagerSupport"]
+interface MozWifiNetwork {
+ readonly attribute DOMString ssid;
+ readonly attribute long mode;
+ readonly attribute long frequency;
+ [Constant, Cached] readonly attribute sequence<DOMString>? security;
+ [Constant, Cached] readonly attribute sequence<DOMString>? capabilities;
+ readonly attribute boolean known;
+ readonly attribute boolean connected;
+ readonly attribute boolean hidden;
+
+ attribute DOMString? bssid;
+ attribute DOMString? signalStrength;
+ attribute long? relSignalStrength;
+ attribute DOMString? psk;
+ attribute DOMString? wep;
+ attribute DOMString? wep_key0;
+ attribute DOMString? wep_key1;
+ attribute DOMString? wep_key2;
+ attribute DOMString? wep_key3;
+ attribute long? wep_tx_keyidx;
+ attribute long? priority;
+ attribute long? scan_ssid;
+ attribute DOMString? keyManagement;
+ attribute DOMString? identity;
+ attribute DOMString? password;
+ attribute DOMString? auth_alg;
+ attribute DOMString? phase1;
+ attribute DOMString? phase2;
+ attribute DOMString? eap;
+ attribute DOMString? pin;
+ attribute boolean? dontConnect;
+ attribute DOMString? serverCertificate;
+ attribute DOMString? subjectMatch;
+};
+
+[JSImplementation="@mozilla.org/mozwificonnection;1",
+ ChromeOnly]
+interface MozWifiConnection {
+ readonly attribute ConnectionStatus status;
+ readonly attribute MozWifiNetwork? network;
+};
+
+[JSImplementation="@mozilla.org/mozwificonnectioninfo;1",
+ ChromeOnly]
+interface MozWifiConnectionInfo {
+ readonly attribute short signalStrength;
+ readonly attribute short relSignalStrength;
+ readonly attribute long linkSpeed;
+ readonly attribute DOMString? ipAddress;
+};
+
+dictionary IPConfiguration {
+ boolean enabled;
+ DOMString ipaddr;
+ DOMString proxy;
+ short maskLength;
+ DOMString gateway;
+ DOMString dns1;
+ DOMString dns2;
+};
+
+[JSImplementation="@mozilla.org/wifimanager;1",
+ NavigatorProperty="mozWifiManager",
+ Func="Navigator::HasWifiManagerSupport",
+ UnsafeInPrerendering]
+interface MozWifiManager : EventTarget {
+ /**
+ * Turn on/off wifi functionality.
+ * @param enable true for enable, false for disable.
+ * onsuccess: Wifi enable/disable successfully, including no status change.
+ * onerror: Wifi enable/disable failed or prohibited.
+ */
+ DOMRequest setWifiEnabled(boolean enabled);
+
+ /**
+ * Returns the list of currently available networks.
+ * onsuccess: We have obtained the current list of networks. request.value
+ * is an object whose property names are SSIDs and values are
+ * network objects.
+ * onerror: We were unable to obtain a list of property names.
+ */
+ DOMRequest getNetworks();
+
+ /**
+ * Returns the list of networks known to the system that will be
+ * automatically connected to if they're in range.
+ * onsuccess: request.value is an object whose property names are
+ * SSIDs and values are network objects.
+ * onerror: We were unable to obtain a list of known networks.
+ */
+ DOMRequest getKnownNetworks();
+
+ /**
+ * Takes one of the networks returned from getNetworks and tries to
+ * connect to it.
+ * @param network A network object with information about the network,
+ * such as the SSID, key management desired, etc.
+ * onsuccess: We have started attempting to associate with the network.
+ * request.value is true.
+ * onerror: We were unable to select the network. This most likely means a
+ * configuration error.
+ */
+ DOMRequest associate(MozWifiNetwork network);
+
+ /**
+ * Given a network, removes it from the list of networks that we'll
+ * automatically connect to. In order to re-connect to the network, it is
+ * necessary to call associate on it.
+ * @param network A network object with the SSID of the network to remove.
+ * onsuccess: We have removed this network. If we were previously
+ * connected to it, we have started reconnecting to the next
+ * network in the list.
+ * onerror: We were unable to remove the network.
+ */
+ DOMRequest forget(MozWifiNetwork network);
+
+ /**
+ * Wi-Fi Protected Setup functionality.
+ * @param detail WPS detail which has 'method' and 'pin' field.
+ * The possible method field values are:
+ * - pbc: The Push Button Configuration.
+ * - pin: The PIN configuration.
+ * - cancel: Request to cancel WPS in progress.
+ * If method field is 'pin', 'pin' field can exist and has
+ * a PIN number.
+ * If method field is 'pin', 'bssid' field can exist and has
+ * a opposite BSSID.
+ * onsuccess: We have successfully started/canceled wps.
+ * onerror: We have failed to start/cancel wps.
+ */
+ DOMRequest wps(optional WifiWPSInfo detail);
+
+ /**
+ * Turn on/off wifi power saving mode.
+ * @param enabled true or false.
+ * onsuccess: We have successfully turn on/off wifi power saving mode.
+ * onerror: We have failed to turn on/off wifi power saving mode.
+ */
+ DOMRequest setPowerSavingMode(boolean enabled);
+
+ /**
+ * Given a network, configure using static IP instead of running DHCP
+ * @param network A network object with the SSID of the network to set static ip.
+ * @param info info should have following field:
+ * - enabled True to enable static IP, false to use DHCP
+ * - ipaddr configured static IP address
+ * - proxy configured proxy server address
+ * - maskLength configured mask length
+ * - gateway configured gateway address
+ * - dns1 configured first DNS server address
+ * - dns2 configured seconf DNS server address
+ * onsuccess: We have successfully configure the static ip mode.
+ * onerror: We have failed to configure the static ip mode.
+ */
+ DOMRequest setStaticIpMode(MozWifiNetwork network, optional IPConfiguration info);
+
+ /**
+ * Given a network, configure http proxy when using wifi.
+ * @param network A network object with the SSID of the network to set http proxy.
+ * @param info info should have following field:
+ * - httpProxyHost ip address of http proxy.
+ * - httpProxyPort port of http proxy, set 0 to use default port 8080.
+ * set info to null to clear http proxy.
+ * onsuccess: We have successfully configure http proxy.
+ * onerror: We have failed to configure http proxy.
+ */
+ DOMRequest setHttpProxy(MozWifiNetwork network, any info);
+
+ /**
+ * Import a certificate file, only support CA certificate now.
+ * @param certBlob A Blob object containing raw data of certificate to be imported.
+ * Supported format: binary/base64 encoded DER certificates.
+ * (.der/.crt/.cer/.pem)
+ * Cause error if importing certificates already imported.
+ * @param certPassword Password of certificate.
+ * @param certNickname User assigned nickname for imported certificate.
+ * Nickname must be unique, it causes error on redundant nickname.
+ * onsuccess: We have successfully imported certificate. request.result is an
+ * object, containing information of imported CA:
+ * {
+ * nickname: Nickname of imported CA, String.
+ * usage: Supported usage of imported CA, Array of String,
+ * includes: "ServerCert".
+ * }
+ * onerror: We have failed to import certificate.
+ */
+ DOMRequest importCert(Blob certBlob,
+ DOMString certPassword,
+ DOMString certNickname);
+
+ /**
+ * Get list of imported WIFI certificates.
+ * onsuccess: We have successfully gotten imported certificate list.
+ * request.result is an object using nickname as key, array of usage
+ * string as value.
+ * request.result[USAGE] = [CA_NICKNAME1, CA_NICKNAME2, ...]
+ * USAGE string includes: "ServerCert".
+ * onerror: We have failed to list certificate.
+ */
+ DOMRequest getImportedCerts();
+
+ /**
+ * Delete an imported certificate.
+ * @param certNickname Nickname of imported to be deleted.
+ * onsuccess: We have successfully deleted certificate.
+ * onerror: We have failed to delete certificate.
+ */
+ DOMRequest deleteCert(DOMString certNickname);
+
+ /**
+ * Returns whether or not wifi is currently enabled.
+ */
+ readonly attribute boolean enabled;
+
+ /**
+ * Returns the MAC address of the wifi adapter.
+ */
+ readonly attribute DOMString macAddress;
+
+ /**
+ * An non-null object containing the following information:
+ * - status ("disconnected", "connecting", "associated", "connected")
+ * - network
+ *
+ * Note that the object returned is read only. Any changes required must
+ * be done by calling other APIs.
+ */
+ readonly attribute MozWifiConnection connection;
+
+ /**
+ * A connectionInformation object with the same information found in an
+ * MozWifiConnectionInfoEvent (but without the network).
+ * If we are not currently connected to a network, this will be null.
+ */
+ readonly attribute MozWifiConnectionInfo? connectionInformation;
+
+ /**
+ * Capabilities of Wifi.
+ */
+ readonly attribute MozWifiCapabilities? capabilities;
+
+ /**
+ * State notification listeners. These all take an
+ * MozWifiStatusChangeEvent with the new status and a network (which may be
+ * null).
+ *
+ * The possible statuses are:
+ * - connecting: Fires when we start the process of connecting to a
+ * network.
+ * - associated: Fires when we have connected to an access point but do
+ * not yet have an IP address.
+ * - connected: Fires once we are fully connected to an access point and
+ * can access the internet.
+ * - disconnected: Fires when we either fail to connect to an access
+ * point (transition: associated -> disconnected) or
+ * when we were connected to a network but have
+ * disconnected for any reason (transition: connected ->
+ * disconnected).
+ */
+ attribute EventHandler onstatuschange;
+
+ /**
+ * An event listener that is called with information about the signal
+ * strength and link speed every 5 seconds.
+ */
+ attribute EventHandler onconnectioninfoupdate;
+
+ /**
+ * These two events fire when the wifi system is brought online or taken
+ * offline.
+ */
+ attribute EventHandler onenabled;
+ attribute EventHandler ondisabled;
+
+ /**
+ * An event listener that is called with information about the number
+ * of wifi stations connected to wifi hotspot every 5 seconds.
+ */
+ attribute EventHandler onstationinfoupdate;
+};
diff --git a/dom/webidl/MozWifiP2pManager.webidl b/dom/webidl/MozWifiP2pManager.webidl
new file mode 100644
index 000000000..58ac1f7be
--- /dev/null
+++ b/dom/webidl/MozWifiP2pManager.webidl
@@ -0,0 +1,147 @@
+/* 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/. */
+
+enum WPSMethod {
+ "pbc",
+ "keypad",
+ "display"
+};
+
+dictionary WPSInfo {
+ WPSMethod method;
+ DOMString pin;
+};
+
+[JSImplementation="@mozilla.org/wifip2pgroupowner;1",
+ Func="Navigator::HasWifiManagerSupport"]
+interface MozWifiP2pGroupOwner {
+ readonly attribute DOMString groupName;
+ readonly attribute DOMString macAddress;
+ readonly attribute DOMString ipAddress;
+ readonly attribute DOMString passphrase;
+ readonly attribute DOMString ssid;
+ readonly attribute any wpsCapabilities;
+ readonly attribute unsigned long freq;
+ readonly attribute boolean isLocal;
+};
+
+[JSImplementation="@mozilla.org/wifip2pmanager;1",
+ NavigatorProperty="mozWifiP2pManager",
+ Func="Navigator::HasWifiManagerSupport"]
+interface MozWifiP2pManager : EventTarget
+{
+ /**
+ * Enable/Disable wifi direct scan.
+ *
+ * onsuccess: Succeeded in starting/stopping wifi direct scan.
+ * onerror: Failed to start/stop wifi direct scan.
+ *
+ */
+ DOMRequest setScanEnabled(boolean enabled);
+
+ /**
+ * Connect to a peer with given configuration.
+ *
+ * @param address The peer MAC address we are going to connect.
+ * @param wpsMethod The WPS method we want to use.
+ * @param goIntent Number from 0 ~ 15 to indicate how much we want to be
+ * the group owner.
+ *
+ * onsuccess: Succeeded in issueing a 'connect' request. It doesn't mean we
+ * have connected to the peer.
+ *
+ * onerror: Failed to issue a 'connect' request, probably due to an
+ * invalid peer address, unsupported wps method or any
+ * preliminary error.
+ *
+ **/
+ DOMRequest connect(DOMString address, WPSMethod wpsMethod, optional byte goIntent);
+
+ /**
+ * Disconnect with a peer.
+ *
+ * @param address The mac address of the peer.
+ *
+ * onsuccess: Succeeded to issue a 'disconnect' request. It doesn't mean we
+ * have disconnected with the peer.
+ *
+ * onerror: Failed to issue a 'disconnect' request, probably due to the
+ * invalid peer address or any preliminary error.
+ *
+ */
+ DOMRequest disconnect(DOMString address);
+
+ /**
+ * Get peer list
+ *
+ * onsuccess: Command success, req.result contains an array of peer objects.
+ * onerror: Command failed.
+ *
+ * Peer object format:
+ * .address MAC address of the peer (string)
+ * .name the peer's device name (string)
+ * .isGroupOwner if the peer is the group owner (boolean)
+ * .wpsCapabilities array of the supported |WPSMethod|
+ * .connectionStatus one of { "disconnected", "connecting", "connected", "disconnecting" }
+ *
+ */
+ DOMRequest getPeerList();
+
+ /**
+ * Set pairing confirmation result.
+ *
+ * @param accepted Boolean to indicate whether we accepted the request or not.
+ * @param pin The user input pin number if the wps method is keypad.
+ *
+ * onsuccess: Command succeeded.
+ * onerror: Command failed.
+ *
+ */
+ DOMRequest setPairingConfirmation(boolean accepted, optional DOMString pin);
+
+ /**
+ * Set device name.
+ *
+ * @param devieName The new device name we are going to set.
+ *
+ * onsuccess: Command succeeded.
+ * onerror: Command failed.
+ *
+ */
+ DOMRequest setDeviceName(DOMString deviceName);
+
+ /**
+ * Returns if Wifi Direct is enabled.
+ *
+ */
+ readonly attribute boolean enabled;
+
+ /**
+ * The current group owner, null if none.
+ */
+ readonly attribute MozWifiP2pGroupOwner? groupOwner;
+
+ /**
+ * An event listener that is called whenever the Wifi Direct peer list is
+ * updated. Use getPeerList() to get the up-to-date peer list.
+ */
+ attribute EventHandler onpeerinfoupdate;
+
+ /**
+ * An event listener that is called whenever Wifi Direct status changed.
+ * The address of the changed peer will be stored in event.peerList.
+ * See MozWifiP2pStatusChangeEvent.webidl.
+ */
+ attribute EventHandler onstatuschange;
+
+ /**
+ * An event listener that is called whenever Wifi Direct is enabled.
+ */
+ attribute EventHandler onenabled;
+
+ /**
+ * An event listener that is called whenever Wifi Direct is disabled.
+ */
+ attribute EventHandler ondisabled;
+};
diff --git a/dom/webidl/MozWifiP2pStatusChangeEvent.webidl b/dom/webidl/MozWifiP2pStatusChangeEvent.webidl
new file mode 100644
index 000000000..be96e2786
--- /dev/null
+++ b/dom/webidl/MozWifiP2pStatusChangeEvent.webidl
@@ -0,0 +1,20 @@
+/* -*- 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/.
+ */
+
+[Constructor(DOMString type, optional MozWifiP2pStatusChangeEventInit eventInitDict),
+ Func="Navigator::HasWifiManagerSupport"]
+interface MozWifiP2pStatusChangeEvent : Event
+{
+ /**
+ * The mac address of the peer whose status has just changed.
+ */
+ readonly attribute DOMString peerAddress;
+};
+
+dictionary MozWifiP2pStatusChangeEventInit : EventInit
+{
+ DOMString peerAddress = "";
+};
diff --git a/dom/webidl/MozWifiStationInfoEvent.webidl b/dom/webidl/MozWifiStationInfoEvent.webidl
new file mode 100644
index 000000000..ff3f5ac6a
--- /dev/null
+++ b/dom/webidl/MozWifiStationInfoEvent.webidl
@@ -0,0 +1,19 @@
+/* -*- 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/.
+ */
+
+[Constructor(DOMString type, optional MozWifiStationInfoEventInit eventInitDict)]
+interface MozWifiStationInfoEvent : Event
+{
+ /**
+ * The number of wifi stations connected to wifi hotspot.
+ */
+ readonly attribute short station;
+};
+
+dictionary MozWifiStationInfoEventInit : EventInit
+{
+ short station = 0;
+};
diff --git a/dom/webidl/MozWifiStatusChangeEvent.webidl b/dom/webidl/MozWifiStatusChangeEvent.webidl
index a3fc99fb4..20d16e4d9 100644
--- a/dom/webidl/MozWifiStatusChangeEvent.webidl
+++ b/dom/webidl/MozWifiStatusChangeEvent.webidl
@@ -4,11 +4,19 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-[Constructor(DOMString type, optional MozWifiStatusChangeEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Constructor(DOMString type, optional MozWifiStatusChangeEventInit eventInitDict)]
interface MozWifiStatusChangeEvent : Event
{
- [Throws]
+ /**
+ * Network object with a SSID field describing the network affected by
+ * this change. This might be null.
+ */
readonly attribute any network;
+
+ /**
+ * String describing the current status of the wifi manager. See above for
+ * the possible values.
+ */
readonly attribute DOMString? status;
};
diff --git a/dom/webidl/MutationObserver.webidl b/dom/webidl/MutationObserver.webidl
index 6c1e84faa..3b51ec55a 100644
--- a/dom/webidl/MutationObserver.webidl
+++ b/dom/webidl/MutationObserver.webidl
@@ -8,16 +8,25 @@
*/
interface MutationRecord {
+ [Constant]
readonly attribute DOMString type;
// .target is not nullable per the spec, but in order to prevent crashes,
// if there are GC/CC bugs in Goanna, we let the property to be null.
+ [Constant]
readonly attribute Node? target;
+ [Constant]
readonly attribute NodeList addedNodes;
+ [Constant]
readonly attribute NodeList removedNodes;
+ [Constant]
readonly attribute Node? previousSibling;
+ [Constant]
readonly attribute Node? nextSibling;
+ [Constant]
readonly attribute DOMString? attributeName;
+ [Constant]
readonly attribute DOMString? attributeNamespace;
+ [Constant]
readonly attribute DOMString? oldValue;
};
@@ -27,17 +36,26 @@ interface MutationObserver {
void observe(Node target, optional MutationObserverInit options);
void disconnect();
sequence<MutationRecord> takeRecords();
+
+ [ChromeOnly]
+ sequence<MutationObservingInfo?> getObservingInfo();
+ [ChromeOnly]
+ readonly attribute MutationCallback mutationCallback;
};
callback MutationCallback = void (sequence<MutationRecord> mutations, MutationObserver observer);
-/* we need `WasPassed()` for `attributes` */
dictionary MutationObserverInit {
boolean childList = false;
boolean attributes;
- boolean characterData = false;
+ boolean characterData;
boolean subtree = false;
- boolean attributeOldValue = false;
- boolean characterDataOldValue = false;
+ boolean attributeOldValue;
+ boolean characterDataOldValue;
sequence<DOMString> attributeFilter;
};
+
+dictionary MutationObservingInfo : MutationObserverInit
+{
+ Node? observedNode = null;
+};
diff --git a/dom/webidl/MozNamedAttrMap.webidl b/dom/webidl/NamedNodeMap.webidl
index fff69106f..71d61181c 100644
--- a/dom/webidl/MozNamedAttrMap.webidl
+++ b/dom/webidl/NamedNodeMap.webidl
@@ -3,11 +3,7 @@
* 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/. */
-/**
- * This is a temporary, non-standard interface, to ease the transition to a
- * world where Attr no longer inherits from Node.
- */
-interface MozNamedAttrMap {
+interface NamedNodeMap {
getter Attr? getNamedItem(DOMString name);
[Throws]
Attr? setNamedItem(Attr arg);
diff --git a/dom/webidl/NativeOSFileInternals.webidl b/dom/webidl/NativeOSFileInternals.webidl
new file mode 100644
index 000000000..36cc1a3a1
--- /dev/null
+++ b/dom/webidl/NativeOSFileInternals.webidl
@@ -0,0 +1,21 @@
+/* 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 obtaone at http://mozilla.org/MPL/2.0/. */
+
+/**
+ * Options for nsINativeOSFileInternals::Read
+ */
+dictionary NativeOSFileReadOptions
+{
+ /**
+ * If specified, convert the raw bytes to a String
+ * with the specified encoding. Otherwise, return
+ * the raw bytes as a TypedArray.
+ */
+ DOMString? encoding;
+
+ /**
+ * If specified, limit the number of bytes to read.
+ */
+ unsigned long long? bytes;
+};
diff --git a/dom/webidl/Navigator.webidl b/dom/webidl/Navigator.webidl
new file mode 100644
index 000000000..3bce72e89
--- /dev/null
+++ b/dom/webidl/Navigator.webidl
@@ -0,0 +1,420 @@
+/* -*- 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.whatwg.org/specs/web-apps/current-work/#the-navigator-object
+ * http://www.w3.org/TR/tracking-dnt/
+ * http://www.w3.org/TR/geolocation-API/#geolocation_interface
+ * http://www.w3.org/TR/battery-status/#navigatorbattery-interface
+ * http://www.w3.org/TR/vibration/#vibration-interface
+ * http://www.w3.org/2012/sysapps/runtime/#extension-to-the-navigator-interface-1
+ * https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#navigator-interface-extension
+ * http://www.w3.org/TR/beacon/#sec-beacon-method
+ *
+ * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
+ * Opera Software ASA. You are granted a license to use, reproduce
+ * and create derivative works of this document.
+ */
+
+// http://www.whatwg.org/specs/web-apps/current-work/#the-navigator-object
+[HeaderFile="Navigator.h", NeedResolve]
+interface Navigator {
+ // objects implementing this interface also implement the interfaces given below
+};
+Navigator implements NavigatorID;
+Navigator implements NavigatorLanguage;
+Navigator implements NavigatorOnLine;
+Navigator implements NavigatorContentUtils;
+Navigator implements NavigatorStorageUtils;
+Navigator implements NavigatorFeatures;
+
+[NoInterfaceObject, Exposed=(Window,Worker)]
+interface NavigatorID {
+ // WebKit/Blink/Trident/Presto support this (hardcoded "Mozilla").
+ [Constant, Cached]
+ readonly attribute DOMString appCodeName; // constant "Mozilla"
+ [Constant, Cached]
+ readonly attribute DOMString appName;
+ [Constant, Cached]
+ readonly attribute DOMString appVersion;
+ [Constant, Cached]
+ readonly attribute DOMString platform;
+ [Constant, Cached]
+ readonly attribute DOMString userAgent;
+ [Constant, Cached]
+ readonly attribute DOMString product; // constant "Goanna"
+
+ // Everyone but WebKit/Blink supports this. See bug 679971.
+ boolean taintEnabled(); // constant false
+};
+
+[NoInterfaceObject, Exposed=(Window,Worker)]
+interface NavigatorLanguage {
+
+ // These 2 values are cached. They are updated when pref
+ // intl.accept_languages is changed.
+
+ [Pure, Cached]
+ readonly attribute DOMString? language;
+ [Pure, Cached, Frozen]
+ readonly attribute sequence<DOMString> languages;
+};
+
+[NoInterfaceObject, Exposed=(Window,Worker)]
+interface NavigatorOnLine {
+ readonly attribute boolean onLine;
+};
+
+[NoInterfaceObject]
+interface NavigatorContentUtils {
+ // content handler registration
+ [Throws]
+ void registerProtocolHandler(DOMString scheme, DOMString url, DOMString title);
+ [Throws]
+ void registerContentHandler(DOMString mimeType, DOMString url, DOMString title);
+ // NOT IMPLEMENTED
+ //DOMString isProtocolHandlerRegistered(DOMString scheme, DOMString url);
+ //DOMString isContentHandlerRegistered(DOMString mimeType, DOMString url);
+ //void unregisterProtocolHandler(DOMString scheme, DOMString url);
+ //void unregisterContentHandler(DOMString mimeType, DOMString url);
+};
+
+[NoInterfaceObject]
+interface NavigatorStorageUtils {
+ // NOT IMPLEMENTED
+ //void yieldForStorageUpdates();
+};
+
+[NoInterfaceObject]
+interface NavigatorFeatures {
+ [CheckPermissions="feature-detection", Throws]
+ Promise<any> getFeature(DOMString name);
+
+ [CheckPermissions="feature-detection", Throws]
+ Promise<any> hasFeature(DOMString name);
+};
+
+// Things that definitely need to be in the spec and and are not for some
+// reason. See https://www.w3.org/Bugs/Public/show_bug.cgi?id=22406
+partial interface Navigator {
+ [Throws]
+ readonly attribute MimeTypeArray mimeTypes;
+ [Throws]
+ readonly attribute PluginArray plugins;
+};
+
+// http://www.w3.org/TR/tracking-dnt/ sort of
+partial interface Navigator {
+ readonly attribute DOMString doNotTrack;
+};
+
+// http://www.w3.org/TR/geolocation-API/#geolocation_interface
+[NoInterfaceObject]
+interface NavigatorGeolocation {
+ [Throws, Pref="geo.enabled"]
+ readonly attribute Geolocation geolocation;
+};
+Navigator implements NavigatorGeolocation;
+
+// http://www.w3.org/TR/battery-status/#navigatorbattery-interface
+[NoInterfaceObject]
+interface NavigatorBattery {
+ // XXXbz Per spec this should be non-nullable, but we return null in
+ // torn-down windows. See bug 884925.
+ [Throws, Pref="dom.battery.enabled"]
+ readonly attribute BatteryManager? battery;
+};
+Navigator implements NavigatorBattery;
+
+// https://wiki.mozilla.org/WebAPI/DataStore
+[NoInterfaceObject,
+ Exposed=(Window,Worker)]
+interface NavigatorDataStore {
+ [NewObject, Func="Navigator::HasDataStoreSupport"]
+ Promise<sequence<DataStore>> getDataStores(DOMString name,
+ optional DOMString? owner = null);
+};
+Navigator implements NavigatorDataStore;
+
+// http://www.w3.org/TR/vibration/#vibration-interface
+partial interface Navigator {
+ // We don't support sequences in unions yet
+ //boolean vibrate ((unsigned long or sequence<unsigned long>) pattern);
+ boolean vibrate(unsigned long duration);
+ boolean vibrate(sequence<unsigned long> pattern);
+};
+
+// http://www.w3.org/TR/pointerevents/#extensions-to-the-navigator-interface
+partial interface Navigator {
+ [Pref="dom.w3c_pointer_events.enabled"]
+ readonly attribute long maxTouchPoints;
+};
+
+// Mozilla-specific extensions
+
+callback interface MozIdleObserver {
+ // Time is in seconds and is read only when idle observers are added
+ // and removed.
+ readonly attribute unsigned long time;
+ void onidle();
+ void onactive();
+};
+
+#ifdef MOZ_B2G
+dictionary MobileIdOptions {
+ boolean forceSelection = false;
+};
+
+[NoInterfaceObject]
+interface NavigatorMobileId {
+ // Ideally we would use [CheckPermissions] here, but the "mobileid"
+ // permission is set to PROMPT_ACTION and [CheckPermissions] only checks
+ // for ALLOW_ACTION.
+ // XXXbz what is this promise resolved with?
+ [NewObject, Func="Navigator::HasMobileIdSupport"]
+ Promise<any> getMobileIdAssertion(optional MobileIdOptions options);
+};
+Navigator implements NavigatorMobileId;
+#endif // MOZ_B2G
+
+// nsIDOMNavigator
+partial interface Navigator {
+ [Throws]
+ readonly attribute DOMString oscpu;
+ // WebKit/Blink support this; Trident/Presto do not.
+ readonly attribute DOMString vendor;
+ // WebKit/Blink supports this (hardcoded ""); Trident/Presto do not.
+ readonly attribute DOMString vendorSub;
+ // WebKit/Blink supports this (hardcoded "20030107"); Trident/Presto don't
+ readonly attribute DOMString productSub;
+ // WebKit/Blink/Trident/Presto support this.
+ readonly attribute boolean cookieEnabled;
+ [Throws]
+ readonly attribute DOMString buildID;
+ [Throws, CheckPermissions="power", UnsafeInPrerendering]
+ readonly attribute MozPowerManager mozPower;
+
+ // WebKit/Blink/Trident/Presto support this.
+ [Throws]
+ boolean javaEnabled();
+
+ /**
+ * Navigator requests to add an idle observer to the existing window.
+ */
+ [Throws, CheckPermissions="idle"]
+ void addIdleObserver(MozIdleObserver aIdleObserver);
+
+ /**
+ * Navigator requests to remove an idle observer from the existing window.
+ */
+ [Throws, CheckPermissions="idle"]
+ void removeIdleObserver(MozIdleObserver aIdleObserver);
+
+ /**
+ * Request a wake lock for a resource.
+ *
+ * A page holds a wake lock to request that a resource not be turned
+ * off (or otherwise made unavailable).
+ *
+ * The topic is the name of a resource that might be made unavailable for
+ * various reasons. For example, on a mobile device the power manager might
+ * decide to turn off the screen after a period of idle time to save power.
+ *
+ * The resource manager checks the lock state of a topic before turning off
+ * the associated resource. For example, a page could hold a lock on the
+ * "screen" topic to prevent the screensaver from appearing or the screen
+ * from turning off.
+ *
+ * The resource manager defines what each topic means and sets policy. For
+ * example, the resource manager might decide to ignore 'screen' wake locks
+ * held by pages which are not visible.
+ *
+ * One topic can be locked multiple times; it is considered released only when
+ * all locks on the topic have been released.
+ *
+ * The returned MozWakeLock object is a token of the lock. You can
+ * unlock the lock via the object's |unlock| method. The lock is released
+ * automatically when its associated window is unloaded.
+ *
+ * @param aTopic resource name
+ */
+ [Throws, Pref="dom.wakelock.enabled", Func="Navigator::HasWakeLockSupport", UnsafeInPrerendering]
+ MozWakeLock requestWakeLock(DOMString aTopic);
+};
+
+// nsIDOMNavigatorDeviceStorage
+partial interface Navigator {
+ [Throws, Pref="device.storage.enabled"]
+ DeviceStorage? getDeviceStorage(DOMString type);
+ [Throws, Pref="device.storage.enabled"]
+ sequence<DeviceStorage> getDeviceStorages(DOMString type);
+};
+
+// nsIDOMNavigatorDesktopNotification
+partial interface Navigator {
+ [Throws, Pref="notification.feature.enabled", UnsafeInPrerendering]
+ readonly attribute DesktopNotificationCenter mozNotification;
+};
+
+#ifdef MOZ_WEBSMS_BACKEND
+partial interface Navigator {
+ [CheckPermissions="sms", Pref="dom.sms.enabled", AvailableIn="CertifiedApps"]
+ readonly attribute MozMobileMessageManager? mozMobileMessage;
+};
+#endif
+
+// NetworkInformation
+partial interface Navigator {
+ [Throws, Pref="dom.netinfo.enabled"]
+ readonly attribute NetworkInformation connection;
+};
+
+// nsIDOMNavigatorCamera
+partial interface Navigator {
+ [Throws, Func="Navigator::HasCameraSupport", UnsafeInPrerendering]
+ readonly attribute CameraManager mozCameras;
+};
+
+// nsIDOMNavigatorSystemMessages and sort of maybe
+// http://www.w3.org/2012/sysapps/runtime/#extension-to-the-navigator-interface-1
+callback systemMessageCallback = void (optional object message);
+partial interface Navigator {
+ [Throws, Pref="dom.sysmsg.enabled"]
+ void mozSetMessageHandler (DOMString type, systemMessageCallback? callback);
+ [Throws, Pref="dom.sysmsg.enabled"]
+ boolean mozHasPendingMessage (DOMString type);
+
+ // This method can be called only from the systeMessageCallback function and
+ // it allows the page to set a promise to keep alive the app until the
+ // current operation is not fully completed.
+ [Throws, Pref="dom.sysmsg.enabled"]
+ void mozSetMessageHandlerPromise (Promise<any> promise);
+};
+
+#ifdef MOZ_B2G_RIL
+partial interface Navigator {
+ [Throws, Pref="dom.mobileconnection.enabled", CheckPermissions="mobileconnection mobilenetwork", UnsafeInPrerendering]
+ readonly attribute MozMobileConnectionArray mozMobileConnections;
+};
+
+partial interface Navigator {
+ [Throws, Pref="dom.cellbroadcast.enabled", CheckPermissions="cellbroadcast",
+ AvailableIn="CertifiedApps", UnsafeInPrerendering]
+ readonly attribute MozCellBroadcast mozCellBroadcast;
+};
+
+partial interface Navigator {
+ [Throws, Pref="dom.voicemail.enabled", CheckPermissions="voicemail",
+ AvailableIn="CertifiedApps", UnsafeInPrerendering]
+ readonly attribute MozVoicemail mozVoicemail;
+};
+
+partial interface Navigator {
+ [Throws, Pref="dom.icc.enabled", CheckPermissions="mobileconnection",
+ AvailableIn="CertifiedApps", UnsafeInPrerendering]
+ readonly attribute MozIccManager? mozIccManager;
+};
+
+partial interface Navigator {
+ [Throws, Pref="dom.telephony.enabled", CheckPermissions="telephony", UnsafeInPrerendering]
+ readonly attribute Telephony? mozTelephony;
+};
+#endif // MOZ_B2G_RIL
+
+#ifdef MOZ_GAMEPAD
+// https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#navigator-interface-extension
+partial interface Navigator {
+ [Throws, Pref="dom.gamepad.enabled"]
+ sequence<Gamepad?> getGamepads();
+};
+#endif // MOZ_GAMEPAD
+
+partial interface Navigator {
+ [Throws, Pref="dom.vr.enabled"]
+ Promise<sequence<VRDevice>> getVRDevices();
+};
+
+#ifdef MOZ_B2G_BT
+partial interface Navigator {
+ [Throws, CheckPermissions="bluetooth", UnsafeInPrerendering]
+ readonly attribute BluetoothManager mozBluetooth;
+};
+#endif // MOZ_B2G_BT
+
+#ifdef MOZ_B2G_FM
+partial interface Navigator {
+ [Throws, CheckPermissions="fmradio", UnsafeInPrerendering]
+ readonly attribute FMRadio mozFMRadio;
+};
+#endif // MOZ_B2G_FM
+
+#ifdef MOZ_TIME_MANAGER
+// nsIDOMMozNavigatorTime
+partial interface Navigator {
+ [Throws, CheckPermissions="time", UnsafeInPrerendering]
+ readonly attribute MozTimeManager mozTime;
+};
+#endif // MOZ_TIME_MANAGER
+
+#ifdef MOZ_AUDIO_CHANNEL_MANAGER
+// nsIMozNavigatorAudioChannelManager
+partial interface Navigator {
+ [Throws]
+ readonly attribute AudioChannelManager mozAudioChannelManager;
+};
+#endif // MOZ_AUDIO_CHANNEL_MANAGER
+
+#ifdef MOZ_MEDIA_NAVIGATOR
+callback NavigatorUserMediaSuccessCallback = void (MediaStream stream);
+callback NavigatorUserMediaErrorCallback = void (MediaStreamError error);
+
+partial interface Navigator {
+ [Throws, Func="Navigator::HasUserMediaSupport"]
+ readonly attribute MediaDevices mediaDevices;
+
+ // Deprecated. Use mediaDevices.getUserMedia instead.
+ [Throws, Func="Navigator::HasUserMediaSupport", UnsafeInPrerendering]
+ void mozGetUserMedia(MediaStreamConstraints constraints,
+ NavigatorUserMediaSuccessCallback successCallback,
+ NavigatorUserMediaErrorCallback errorCallback);
+};
+
+// nsINavigatorUserMedia
+callback MozGetUserMediaDevicesSuccessCallback = void (nsIVariant? devices);
+partial interface Navigator {
+ [Throws, ChromeOnly]
+ void mozGetUserMediaDevices(MediaStreamConstraints constraints,
+ MozGetUserMediaDevicesSuccessCallback onsuccess,
+ NavigatorUserMediaErrorCallback onerror,
+ // The originating innerWindowID is needed to
+ // avoid calling the callbacks if the window has
+ // navigated away. It is optional only as legacy.
+ optional unsigned long long innerWindowID = 0);
+};
+#endif // MOZ_MEDIA_NAVIGATOR
+
+// Service Workers/Navigation Controllers
+partial interface Navigator {
+ [Pref="dom.serviceWorkers.enabled"]
+ readonly attribute ServiceWorkerContainer serviceWorker;
+};
+
+partial interface Navigator {
+ [Throws, Pref="beacon.enabled"]
+ boolean sendBeacon(DOMString url,
+ optional (ArrayBufferView or Blob or DOMString or FormData)? data = null);
+};
+
+partial interface Navigator {
+ [Pref="dom.tv.enabled", CheckPermissions="tv", Func="Navigator::HasTVSupport"]
+ readonly attribute TVManager? tv;
+};
+
+#ifdef NIGHTLY_BUILD
+partial interface Navigator {
+ [Func="Navigator::IsE10sEnabled"]
+ readonly attribute boolean mozE10sEnabled;
+};
+#endif
diff --git a/dom/webidl/NetDashboard.webidl b/dom/webidl/NetDashboard.webidl
index f5c59b79e..12bbb01f0 100644
--- a/dom/webidl/NetDashboard.webidl
+++ b/dom/webidl/NetDashboard.webidl
@@ -3,43 +3,75 @@
* 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/. */
+dictionary SocketElement {
+ DOMString host = "";
+ unsigned long port = 0;
+ boolean active = false;
+ boolean tcp = false;
+ double sent = 0;
+ double received = 0;
+};
+
dictionary SocketsDict {
- sequence<DOMString> host;
- sequence<unsigned long> port;
- sequence<boolean> active;
- sequence<unsigned long> tcp;
- sequence<double> socksent;
- sequence<double> sockreceived;
+ sequence<SocketElement> sockets;
double sent = 0;
double received = 0;
};
-dictionary HttpConnInfoDict {
- sequence<unsigned long> rtt;
- sequence<unsigned long> ttl;
+dictionary HttpConnInfo {
+ unsigned long rtt = 0;
+ unsigned long ttl = 0;
+ DOMString protocolVersion = "";
+};
+
+dictionary HalfOpenInfoDict {
+ boolean speculative = false;
+};
+
+dictionary HttpConnectionElement {
+ DOMString host = "";
+ unsigned long port = 0;
+ boolean spdy = false;
+ boolean ssl = false;
+ sequence<HttpConnInfo> active;
+ sequence<HttpConnInfo> idle;
+ sequence<HalfOpenInfoDict> halfOpens;
};
dictionary HttpConnDict {
- sequence<DOMString> host;
- sequence<unsigned long> port;
- sequence<HttpConnInfoDict> active;
- sequence<HttpConnInfoDict> idle;
- sequence<boolean> spdy;
- sequence<boolean> ssl;
+ sequence<HttpConnectionElement> connections;
+};
+
+dictionary WebSocketElement {
+ DOMString hostport = "";
+ unsigned long msgsent = 0;
+ unsigned long msgreceived = 0;
+ double sentsize = 0;
+ double receivedsize = 0;
+ boolean encrypted = false;
};
dictionary WebSocketDict {
- sequence<DOMString> hostport;
- sequence<unsigned long> msgsent;
- sequence<unsigned long> msgreceived;
- sequence<double> sentsize;
- sequence<double> receivedsize;
- sequence<boolean> encrypted;
+ sequence<WebSocketElement> websockets;
+};
+
+dictionary DnsCacheEntry {
+ DOMString hostname = "";
+ sequence<DOMString> hostaddr;
+ DOMString family = "";
+ double expiration = 0;
};
dictionary DNSCacheDict {
- sequence<DOMString> hostname;
- sequence<sequence<DOMString>> hostaddr;
- sequence<DOMString> family;
- sequence<double> expiration;
+ sequence<DnsCacheEntry> entries;
+};
+
+dictionary DNSLookupDict {
+ sequence<DOMString> address;
+ DOMString error = "";
+ boolean answer = false;
+};
+
+dictionary ConnStatusDict {
+ DOMString status = "";
};
diff --git a/dom/webidl/NetworkInformation.webidl b/dom/webidl/NetworkInformation.webidl
new file mode 100644
index 000000000..3ad203af6
--- /dev/null
+++ b/dom/webidl/NetworkInformation.webidl
@@ -0,0 +1,25 @@
+/* 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 https://w3c.github.io/netinfo/
+ *
+ * Copyright © 2014 W3C® (MIT, ERCIM, Keio, Beihang), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+enum ConnectionType {
+ "cellular",
+ "bluetooth",
+ "ethernet",
+ "wifi",
+ "other",
+ "none",
+ "unknown"
+};
+
+[Pref="dom.netinfo.enabled"]
+interface NetworkInformation : EventTarget {
+ readonly attribute ConnectionType type;
+ attribute EventHandler ontypechange;
+};
diff --git a/dom/webidl/NetworkOptions.webidl b/dom/webidl/NetworkOptions.webidl
new file mode 100644
index 000000000..c9df8a482
--- /dev/null
+++ b/dom/webidl/NetworkOptions.webidl
@@ -0,0 +1,99 @@
+/* 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/. */
+
+/**
+* This dictionnary holds the parameters sent to the network worker.
+*/
+dictionary NetworkCommandOptions
+{
+ long id = 0; // opaque id.
+ DOMString cmd = ""; // the command name.
+ DOMString ifname; // for "removeNetworkRoute", "setDNS",
+ // "setDefaultRouteAndDNS", "removeDefaultRoute"
+ // "addHostRoute", "removeHostRoute"
+ // "removeHostRoutes".
+ DOMString ip; // for "removeNetworkRoute", "setWifiTethering".
+ unsigned long prefixLength; // for "removeNetworkRoute".
+ DOMString domain; // for "setDNS"
+ sequence<DOMString> dnses; // for "setDNS", "setDefaultRouteAndDNS".
+ DOMString oldIfname; // for "setDefaultRouteAndDNS".
+ DOMString gateway; // for "addSecondaryRoute", "removeSecondaryRoute".
+ sequence<DOMString> gateways; // for "setDefaultRouteAndDNS", "removeDefaultRoute".
+ DOMString mode; // for "setWifiOperationMode".
+ boolean report; // for "setWifiOperationMode".
+ boolean enabled; // for "setDhcpServer".
+ DOMString wifictrlinterfacename; // for "setWifiTethering".
+ DOMString internalIfname; // for "setWifiTethering".
+ DOMString externalIfname; // for "setWifiTethering".
+ boolean enable; // for "setWifiTethering".
+ DOMString ssid; // for "setWifiTethering".
+ DOMString security; // for "setWifiTethering".
+ DOMString key; // for "setWifiTethering".
+ DOMString prefix; // for "setWifiTethering", "setDhcpServer".
+ DOMString link; // for "setWifiTethering", "setDhcpServer".
+ sequence<DOMString> interfaceList; // for "setWifiTethering".
+ DOMString wifiStartIp; // for "setWifiTethering".
+ DOMString wifiEndIp; // for "setWifiTethering".
+ DOMString usbStartIp; // for "setWifiTethering".
+ DOMString usbEndIp; // for "setWifiTethering".
+ DOMString dns1; // for "setWifiTethering".
+ DOMString dns2; // for "setWifiTethering".
+ long threshold; // for "setNetworkInterfaceAlarm",
+ // "enableNetworkInterfaceAlarm".
+ DOMString startIp; // for "setDhcpServer".
+ DOMString endIp; // for "setDhcpServer".
+ DOMString serverIp; // for "setDhcpServer".
+ DOMString maskLength; // for "setDhcpServer".
+ DOMString preInternalIfname; // for "updateUpStream".
+ DOMString preExternalIfname; // for "updateUpStream".
+ DOMString curInternalIfname; // for "updateUpStream".
+ DOMString curExternalIfname; // for "updateUpStream".
+
+ long ipaddr; // for "ifc_configure".
+ long mask; // for "ifc_configure".
+ long gateway_long; // for "ifc_configure".
+ long dns1_long; // for "ifc_configure".
+ long dns2_long; // for "ifc_configure".
+};
+
+/**
+* This dictionary holds the parameters sent back to NetworkService.js.
+*/
+dictionary NetworkResultOptions
+{
+ long id = 0; // opaque id.
+ boolean ret = false; // for sync command.
+ boolean broadcast = false; // for netd broadcast message.
+ DOMString topic = ""; // for netd broadcast message.
+ DOMString reason = ""; // for netd broadcast message.
+
+ long resultCode = 0; // for all commands.
+ DOMString resultReason = ""; // for all commands.
+ boolean error = false; // for all commands.
+
+ boolean enable = false; // for "setWifiTethering", "setUSBTethering"
+ // "enableUsbRndis".
+ boolean result = false; // for "enableUsbRndis".
+ boolean success = false; // for "setDhcpServer".
+ DOMString curExternalIfname = ""; // for "updateUpStream".
+ DOMString curInternalIfname = ""; // for "updateUpStream".
+
+ DOMString reply = ""; // for "command".
+ DOMString route = ""; // for "ifc_get_default_route".
+ DOMString ipaddr_str = ""; // The following are for the result of
+ // dhcp_do_request.
+ DOMString gateway_str = "";
+ DOMString dns1_str = "";
+ DOMString dns2_str = "";
+ DOMString mask_str = "";
+ DOMString server_str = "";
+ DOMString vendor_str = "";
+ long lease = 0;
+ long mask = 0;
+ long ipaddr = 0;
+ long gateway = 0;
+ long dns1 = 0;
+ long dns2 = 0;
+ long server = 0;
+};
diff --git a/dom/webidl/NfcOptions.webidl b/dom/webidl/NfcOptions.webidl
new file mode 100644
index 000000000..758ddb798
--- /dev/null
+++ b/dom/webidl/NfcOptions.webidl
@@ -0,0 +1,60 @@
+/* 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/. */
+
+enum RFState {
+ "idle",
+ "listen",
+ "discovery"
+};
+
+dictionary NfcCommandOptions
+{
+ DOMString type = "";
+
+ long sessionId;
+ DOMString requestId = "";
+
+ RFState rfState;
+
+ long techType;
+
+ boolean isP2P;
+ sequence<MozNDEFRecordOptions> records;
+
+ NFCTechType technology;
+ Uint8Array command;
+};
+
+dictionary NfcEventOptions
+{
+ DOMString type = "";
+
+ long status;
+ NfcErrorMessage errorMsg;
+ long sessionId;
+ DOMString requestId;
+
+ long majorVersion;
+ long minorVersion;
+
+ boolean isP2P;
+ sequence<NFCTechType> techList;
+ Uint8Array tagId;
+ sequence<MozNDEFRecordOptions> records;
+
+ NFCTagType tagType;
+ long maxNDEFSize;
+ boolean isReadOnly;
+ boolean isFormatable;
+
+ RFState rfState;
+
+ // HCI Event Transaction fields
+ DOMString origin;
+ Uint8Array aid;
+ Uint8Array payload;
+
+ // Tag transceive response data
+ Uint8Array response;
+};
diff --git a/dom/webidl/Node.webidl b/dom/webidl/Node.webidl
index 2002d647a..d85f2a6a5 100644
--- a/dom/webidl/Node.webidl
+++ b/dom/webidl/Node.webidl
@@ -12,7 +12,6 @@
interface Principal;
interface URI;
-interface UserDataHandler;
interface Node : EventTarget {
const unsigned short ELEMENT_NODE = 1;
@@ -41,8 +40,9 @@ interface Node : EventTarget {
readonly attribute Node? parentNode;
[Pure]
readonly attribute Element? parentElement;
+ [Pure]
boolean hasChildNodes();
- [Constant]
+ [SameObject]
readonly attribute NodeList childNodes;
[Pure]
readonly attribute Node? firstChild;
@@ -55,7 +55,7 @@ interface Node : EventTarget {
[SetterThrows, Pure]
attribute DOMString? nodeValue;
- [SetterThrows, Pure]
+ [Throws, Pure]
attribute DOMString? textContent;
[Throws]
Node insertBefore(Node node, Node? child);
@@ -68,7 +68,8 @@ interface Node : EventTarget {
void normalize();
[Throws]
- Node cloneNode(optional boolean deep = true);
+ Node cloneNode(optional boolean deep = false);
+ [Pure]
boolean isEqualNode(Node? node);
const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01;
@@ -77,11 +78,16 @@ interface Node : EventTarget {
const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08;
const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10;
const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20; // historical
+ [Pure]
unsigned short compareDocumentPosition(Node other);
+ [Pure]
boolean contains(Node? other);
+ [Pure]
DOMString? lookupPrefix(DOMString? namespace);
+ [Pure]
DOMString? lookupNamespaceURI(DOMString? prefix);
+ [Pure]
boolean isDefaultNamespace(DOMString? namespace);
// Mozilla-specific stuff
@@ -95,13 +101,14 @@ interface Node : EventTarget {
[Constant]
readonly attribute DOMString? localName;
- boolean hasAttributes();
[Throws, Func="IsChromeOrXBL"]
- any setUserData(DOMString key, any data, UserDataHandler? handler);
+ any setUserData(DOMString key, any data);
[Throws, Func="IsChromeOrXBL"]
any getUserData(DOMString key);
[ChromeOnly]
readonly attribute Principal nodePrincipal;
[ChromeOnly]
readonly attribute URI? baseURIObject;
+ [ChromeOnly]
+ sequence<MutationObserver> getBoundMutationObservers();
};
diff --git a/dom/webidl/Notification.webidl b/dom/webidl/Notification.webidl
index 68c211f9f..40eee11cc 100644
--- a/dom/webidl/Notification.webidl
+++ b/dom/webidl/Notification.webidl
@@ -11,7 +11,9 @@
* related or neighboring rights to this work.
*/
-[PrefControlled, Constructor(DOMString title, optional NotificationOptions options)]
+[Pref="dom.webnotifications.enabled",
+ Constructor(DOMString title, optional NotificationOptions options),
+ UnsafeInPrerendering]
interface Notification : EventTarget {
[GetterThrows]
static readonly attribute NotificationPermission permission;
@@ -19,18 +21,38 @@ interface Notification : EventTarget {
[Throws]
static void requestPermission(optional NotificationPermissionCallback permissionCallback);
- [SetterThrows]
+ [Throws]
+ static Promise<sequence<Notification>> get(optional GetNotificationOptions filter);
+
attribute EventHandler onclick;
- [SetterThrows]
attribute EventHandler onshow;
- [SetterThrows]
attribute EventHandler onerror;
- [SetterThrows]
attribute EventHandler onclose;
+ [Pure]
+ readonly attribute DOMString title;
+
+ [Pure]
+ readonly attribute NotificationDirection dir;
+
+ [Pure]
+ readonly attribute DOMString? lang;
+
+ [Pure]
+ readonly attribute DOMString? body;
+
+ [Constant]
+ readonly attribute DOMString? tag;
+
+ [Pure]
+ readonly attribute DOMString? icon;
+
+ [Constant]
+ readonly attribute any data;
+
void close();
};
@@ -38,8 +60,22 @@ dictionary NotificationOptions {
NotificationDirection dir = "auto";
DOMString lang = "";
DOMString body = "";
- DOMString tag;
+ DOMString tag = "";
DOMString icon = "";
+ any data = null;
+ NotificationBehavior mozbehavior = null;
+};
+
+dictionary GetNotificationOptions {
+ DOMString tag;
+};
+
+dictionary NotificationBehavior {
+ boolean noscreen = false;
+ boolean noclear = false;
+ boolean showOnlyOnce = false;
+ DOMString soundFile = "";
+ sequence<unsigned long> vibrationPattern;
};
enum NotificationPermission {
diff --git a/dom/webidl/NotifyAudioAvailableEvent.webidl b/dom/webidl/NotifyAudioAvailableEvent.webidl
deleted file mode 100644
index 26672befe..000000000
--- a/dom/webidl/NotifyAudioAvailableEvent.webidl
+++ /dev/null
@@ -1,22 +0,0 @@
-/* -*- 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/.
- */
-
-interface NotifyAudioAvailableEvent : Event
-{
- [Throws]
- readonly attribute Float32Array frameBuffer;
-
- readonly attribute float time;
-
- [Throws]
- void initAudioAvailableEvent(DOMString type,
- boolean canBubble,
- boolean cancelable,
- sequence<float>? frameBuffer,
- unsigned long frameBufferLength,
- float time,
- boolean allowAudioData);
-};
diff --git a/dom/webidl/NotifyPaintEvent.webidl b/dom/webidl/NotifyPaintEvent.webidl
index c1eb5a826..4de84951a 100644
--- a/dom/webidl/NotifyPaintEvent.webidl
+++ b/dom/webidl/NotifyPaintEvent.webidl
@@ -8,9 +8,9 @@
interface NotifyPaintEvent : Event
{
- readonly attribute ClientRectList clientRects;
+ readonly attribute DOMRectList clientRects;
- readonly attribute ClientRect boundingClientRect;
+ readonly attribute DOMRect boundingClientRect;
readonly attribute PaintRequestList paintRequests;
};
diff --git a/dom/webidl/OfflineAudioCompletionEvent.webidl b/dom/webidl/OfflineAudioCompletionEvent.webidl
index f0717c879..e820ac353 100644
--- a/dom/webidl/OfflineAudioCompletionEvent.webidl
+++ b/dom/webidl/OfflineAudioCompletionEvent.webidl
@@ -10,7 +10,6 @@
* liability, trademark and document use rules apply.
*/
-[PrefControlled]
interface OfflineAudioCompletionEvent : Event {
readonly attribute AudioBuffer renderedBuffer;
diff --git a/dom/webidl/OfflineAudioContext.webidl b/dom/webidl/OfflineAudioContext.webidl
index 189f1b581..7e6ebeb00 100644
--- a/dom/webidl/OfflineAudioContext.webidl
+++ b/dom/webidl/OfflineAudioContext.webidl
@@ -1,4 +1,4 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* 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/.
@@ -12,13 +12,12 @@
callback OfflineRenderSuccessCallback = void (AudioBuffer renderedData);
-[Constructor(unsigned long numberOfChannels, unsigned long length, float sampleRate),
- PrefControlled]
+[Constructor(unsigned long numberOfChannels, unsigned long length, float sampleRate)]
interface OfflineAudioContext : AudioContext {
- void startRendering();
+ [Throws]
+ Promise<AudioBuffer> startRendering();
- [SetterThrows]
attribute EventHandler oncomplete;
};
diff --git a/dom/webidl/OfflineResourceList.webidl b/dom/webidl/OfflineResourceList.webidl
index 8b49092e9..a64642801 100644
--- a/dom/webidl/OfflineResourceList.webidl
+++ b/dom/webidl/OfflineResourceList.webidl
@@ -42,21 +42,13 @@ interface OfflineResourceList : EventTarget {
void swapCache();
/* Events */
- [SetterThrows]
attribute EventHandler onchecking;
- [SetterThrows]
attribute EventHandler onerror;
- [SetterThrows]
attribute EventHandler onnoupdate;
- [SetterThrows]
attribute EventHandler ondownloading;
- [SetterThrows]
attribute EventHandler onprogress;
- [SetterThrows]
attribute EventHandler onupdateready;
- [SetterThrows]
attribute EventHandler oncached;
- [SetterThrows]
attribute EventHandler onobsolete;
};
diff --git a/dom/webidl/OscillatorNode.webidl b/dom/webidl/OscillatorNode.webidl
new file mode 100644
index 000000000..b0eddeca1
--- /dev/null
+++ b/dom/webidl/OscillatorNode.webidl
@@ -0,0 +1,41 @@
+/* -*- 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
+ * https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+enum OscillatorType {
+ "sine",
+ "square",
+ "sawtooth",
+ "triangle",
+ "custom"
+};
+
+interface OscillatorNode : AudioNode {
+
+ [SetterThrows]
+ attribute OscillatorType type;
+
+ readonly attribute AudioParam frequency; // in Hertz
+ readonly attribute AudioParam detune; // in Cents
+
+ [Throws, UnsafeInPrerendering]
+ void start(optional double when = 0);
+ [Throws, UnsafeInPrerendering]
+ void stop(optional double when = 0);
+ void setPeriodicWave(PeriodicWave periodicWave);
+
+ attribute EventHandler onended;
+
+};
+
+// Mozilla extensions
+OscillatorNode implements AudioNodePassThrough;
+
diff --git a/dom/webidl/PageTransitionEvent.webidl b/dom/webidl/PageTransitionEvent.webidl
index 8916f57b7..3b8c31906 100644
--- a/dom/webidl/PageTransitionEvent.webidl
+++ b/dom/webidl/PageTransitionEvent.webidl
@@ -4,17 +4,10 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-[Constructor(DOMString type, optional PageTransitionEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Constructor(DOMString type, optional PageTransitionEventInit eventInitDict)]
interface PageTransitionEvent : Event
{
readonly attribute boolean persisted;
-
- // initPageTransitionEvent is a Goanna specific deprecated method.
- [Throws]
- void initPageTransitionEvent(DOMString type,
- boolean canBubble,
- boolean cancelable,
- boolean persisted);
};
dictionary PageTransitionEventInit : EventInit
diff --git a/dom/webidl/PaintRequest.webidl b/dom/webidl/PaintRequest.webidl
index 4d35e20b3..065be0866 100644
--- a/dom/webidl/PaintRequest.webidl
+++ b/dom/webidl/PaintRequest.webidl
@@ -11,7 +11,7 @@ interface PaintRequest {
/**
* The client rect where invalidation was triggered.
*/
- readonly attribute ClientRect clientRect;
+ readonly attribute DOMRect clientRect;
/**
* The reason for the request, as a string. If an empty string, then we don't know
diff --git a/dom/webidl/PannerNode.webidl b/dom/webidl/PannerNode.webidl
index 4209d3600..f346198a9 100644
--- a/dom/webidl/PannerNode.webidl
+++ b/dom/webidl/PannerNode.webidl
@@ -11,62 +11,39 @@
*/
enum PanningModelType {
- // Hack: Use numbers to support alternate enum values
- "0", "1",
-
"equalpower",
"HRTF"
};
enum DistanceModelType {
- // Hack: Use numbers to support alternate enum values
- "0", "1", "2",
-
"linear",
"inverse",
"exponential"
};
-[PrefControlled]
interface PannerNode : AudioNode {
- // Default for stereo is HRTF
+ // Default for stereo is equalpower
attribute PanningModelType panningModel;
- // Uses a 3D cartesian coordinate system
+ // Uses a 3D cartesian coordinate system
void setPosition(double x, double y, double z);
void setOrientation(double x, double y, double z);
void setVelocity(double x, double y, double z);
- // Distance model and attributes
+ // Distance model and attributes
attribute DistanceModelType distanceModel;
attribute double refDistance;
attribute double maxDistance;
attribute double rolloffFactor;
- // Directional sound cone
+ // Directional sound cone
attribute double coneInnerAngle;
attribute double coneOuterAngle;
attribute double coneOuterGain;
};
-/*
- * The origin of this IDL file is
- * https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AlternateNames
- */
-[PrefControlled]
-partial interface PannerNode {
- [Pref="media.webaudio.legacy.PannerNode"]
- const unsigned short EQUALPOWER = 0;
- [Pref="media.webaudio.legacy.PannerNode"]
- const unsigned short HRTF = 1;
-
- [Pref="media.webaudio.legacy.PannerNode"]
- const unsigned short LINEAR_DISTANCE = 0;
- [Pref="media.webaudio.legacy.PannerNode"]
- const unsigned short INVERSE_DISTANCE = 1;
- [Pref="media.webaudio.legacy.PannerNode"]
- const unsigned short EXPONENTIAL_DISTANCE = 2;
-};
+// Mozilla extension
+PannerNode implements AudioNodePassThrough;
diff --git a/dom/webidl/ParentNode.webidl b/dom/webidl/ParentNode.webidl
new file mode 100644
index 000000000..da08b7497
--- /dev/null
+++ b/dom/webidl/ParentNode.webidl
@@ -0,0 +1,24 @@
+/* -*- 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://dom.spec.whatwg.org/#interface-parentnode
+ */
+
+[NoInterfaceObject]
+interface ParentNode {
+ [Constant]
+ readonly attribute HTMLCollection children;
+ [Pure]
+ readonly attribute Element? firstElementChild;
+ [Pure]
+ readonly attribute Element? lastElementChild;
+ [Pure]
+ readonly attribute unsigned long childElementCount;
+
+ // Not implemented yet
+ // void prepend((Node or DOMString)... nodes);
+ // void append((Node or DOMString)... nodes);
+};
diff --git a/dom/webidl/PeerConnectionImpl.webidl b/dom/webidl/PeerConnectionImpl.webidl
new file mode 100644
index 000000000..65870c810
--- /dev/null
+++ b/dom/webidl/PeerConnectionImpl.webidl
@@ -0,0 +1,88 @@
+/* -*- 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/.
+ *
+ * PeerConnection.js' interface to the C++ PeerConnectionImpl.
+ *
+ * Do not confuse with mozRTCPeerConnection. This interface is purely for
+ * communication between the PeerConnection JS DOM binding and the C++
+ * implementation in SIPCC.
+ *
+ * See media/webrtc/signaling/include/PeerConnectionImpl.h
+ *
+ */
+
+interface nsISupports;
+
+/* Must be created first. Observer events will be dispatched on the thread provided */
+[ChromeOnly, Constructor]
+interface PeerConnectionImpl {
+ /* Must be called first. Observer events dispatched on the thread provided */
+ [Throws]
+ void initialize(PeerConnectionObserver observer, Window window,
+ RTCConfiguration iceServers,
+ nsISupports thread);
+ /* JSEP calls */
+ [Throws]
+ void createOffer(optional RTCOfferOptions options);
+ [Throws]
+ void createAnswer();
+ [Throws]
+ void setLocalDescription(long action, DOMString sdp);
+ [Throws]
+ void setRemoteDescription(long action, DOMString sdp);
+
+ /* Stats call, calls either |onGetStatsSuccess| or |onGetStatsError| on our
+ observer. (see the |PeerConnectionObserver| interface) */
+ [Throws]
+ void getStats(MediaStreamTrack? selector);
+
+ /* Adds the tracks created by GetUserMedia */
+ [Throws]
+ void addTrack(MediaStreamTrack track, MediaStream... streams);
+ [Throws]
+ void removeTrack(MediaStreamTrack track);
+ [Throws]
+ void replaceTrack(MediaStreamTrack thisTrack, MediaStreamTrack withTrack);
+ [Throws]
+ void closeStreams();
+
+ sequence<MediaStream> getLocalStreams();
+ sequence<MediaStream> getRemoteStreams();
+
+ /* As the ICE candidates roll in this one should be called each time
+ * in order to keep the candidate list up-to-date for the next SDP-related
+ * call PeerConnectionImpl does not parse ICE candidates, just sticks them
+ * into the SDP.
+ */
+ [Throws]
+ void addIceCandidate(DOMString candidate, DOMString mid, unsigned short level);
+
+ /* Puts the SIPCC engine back to 'kIdle', shuts down threads, deletes state */
+ void close();
+
+ /* Notify DOM window if this plugin crash is ours. */
+ boolean pluginCrash(unsigned long long pluginId, DOMString name, DOMString pluginDumpID);
+
+ /* Attributes */
+ [Constant]
+ readonly attribute DOMString fingerprint;
+ readonly attribute DOMString localDescription;
+ readonly attribute DOMString remoteDescription;
+
+ readonly attribute PCImplIceConnectionState iceConnectionState;
+ readonly attribute PCImplIceGatheringState iceGatheringState;
+ readonly attribute PCImplSignalingState signalingState;
+ attribute DOMString id;
+
+ attribute DOMString peerIdentity;
+ readonly attribute boolean privacyRequested;
+
+ /* Data channels */
+ [Throws]
+ DataChannel createDataChannel(DOMString label, DOMString protocol,
+ unsigned short type, boolean outOfOrderAllowed,
+ unsigned short maxTime, unsigned short maxNum,
+ boolean externalNegotiated, unsigned short stream);
+};
diff --git a/dom/webidl/PeerConnectionImplEnums.webidl b/dom/webidl/PeerConnectionImplEnums.webidl
new file mode 100644
index 000000000..e9ce815f8
--- /dev/null
+++ b/dom/webidl/PeerConnectionImplEnums.webidl
@@ -0,0 +1,42 @@
+/* -*- 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/.
+ *
+ * This is in a separate file so it can be shared with unittests.
+ */
+
+/* Must be in the same order as comparable fsmdef_states_t in fsmdef_states.h */
+enum PCImplSignalingState {
+ "SignalingInvalid",
+ "SignalingStable",
+ "SignalingHaveLocalOffer",
+ "SignalingHaveRemoteOffer",
+ "SignalingHaveLocalPranswer",
+ "SignalingHaveRemotePranswer",
+ "SignalingClosed",
+};
+
+enum PCImplSipccState {
+ "Idle",
+ "Starting",
+ "Started"
+};
+
+enum PCImplIceConnectionState {
+ "new",
+ "checking",
+ "connected",
+ "completed",
+ "failed",
+ "disconnected",
+ "closed"
+};
+
+// Deliberately identical to the values specified in webrtc
+enum PCImplIceGatheringState {
+ "new",
+ "gathering",
+ "complete"
+};
+
diff --git a/dom/webidl/PeerConnectionObserver.webidl b/dom/webidl/PeerConnectionObserver.webidl
new file mode 100644
index 000000000..88bcaf9d7
--- /dev/null
+++ b/dom/webidl/PeerConnectionObserver.webidl
@@ -0,0 +1,47 @@
+/* -*- 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/.
+ */
+
+interface nsISupports;
+
+[ChromeOnly,
+ JSImplementation="@mozilla.org/dom/peerconnectionobserver;1",
+ Constructor (mozRTCPeerConnection domPC)]
+interface PeerConnectionObserver
+{
+ /* JSEP callbacks */
+ void onCreateOfferSuccess(DOMString offer);
+ void onCreateOfferError(unsigned long name, DOMString message);
+ void onCreateAnswerSuccess(DOMString answer);
+ void onCreateAnswerError(unsigned long name, DOMString message);
+ void onSetLocalDescriptionSuccess();
+ void onSetRemoteDescriptionSuccess();
+ void onSetLocalDescriptionError(unsigned long name, DOMString message);
+ void onSetRemoteDescriptionError(unsigned long name, DOMString message);
+ void onAddIceCandidateSuccess();
+ void onAddIceCandidateError(unsigned long name, DOMString message);
+ void onIceCandidate(unsigned short level, DOMString mid, DOMString candidate);
+ void onNegotiationNeeded();
+
+ /* Stats callbacks */
+ void onGetStatsSuccess(optional RTCStatsReportInternal report);
+ void onGetStatsError(unsigned long name, DOMString message);
+
+ /* replaceTrack callbacks */
+ void onReplaceTrackSuccess();
+ void onReplaceTrackError(unsigned long name, DOMString message);
+
+ /* Data channel callbacks */
+ void notifyDataChannel(DataChannel channel);
+
+ /* Notification of one of several types of state changed */
+ void onStateChange(PCObserverStateType state);
+
+ /* Changes to MediaStreamTracks */
+ void onAddStream(MediaStream stream);
+ void onRemoveStream(MediaStream stream);
+ void onAddTrack(MediaStreamTrack track);
+ void onRemoveTrack(MediaStreamTrack track);
+};
diff --git a/dom/webidl/PeerConnectionObserverEnums.webidl b/dom/webidl/PeerConnectionObserverEnums.webidl
new file mode 100644
index 000000000..6f7c61c92
--- /dev/null
+++ b/dom/webidl/PeerConnectionObserverEnums.webidl
@@ -0,0 +1,16 @@
+/* -*- 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/.
+ *
+ * This is in a separate file so it can be shared with unittests.
+ */
+
+enum PCObserverStateType {
+ "None",
+ "IceConnectionState",
+ "IceGatheringState",
+ "SdpState",
+ "SipccState",
+ "SignalingState"
+};
diff --git a/dom/webidl/Performance.webidl b/dom/webidl/Performance.webidl
index a10997dd6..e6274f8c7 100644
--- a/dom/webidl/Performance.webidl
+++ b/dom/webidl/Performance.webidl
@@ -11,12 +11,56 @@
*/
typedef double DOMHighResTimeStamp;
+typedef sequence <PerformanceEntry> PerformanceEntryList;
+[Exposed=(Window,Worker)]
interface Performance {
+ [DependsOn=DeviceState, Affects=Nothing]
DOMHighResTimeStamp now();
+};
+[Exposed=Window]
+partial interface Performance {
[Constant]
readonly attribute PerformanceTiming timing;
[Constant]
readonly attribute PerformanceNavigation navigation;
+
+ jsonifier;
+};
+
+// http://www.w3.org/TR/performance-timeline/#sec-window.performance-attribute
+[Exposed=Window]
+partial interface Performance {
+ [Pref="dom.enable_resource_timing"]
+ PerformanceEntryList getEntries();
+ [Pref="dom.enable_resource_timing"]
+ PerformanceEntryList getEntriesByType(DOMString entryType);
+ [Pref="dom.enable_resource_timing"]
+ PerformanceEntryList getEntriesByName(DOMString name, optional DOMString
+ entryType);
+};
+
+// http://www.w3.org/TR/resource-timing/#extensions-performance-interface
+[Exposed=Window]
+partial interface Performance {
+ [Pref="dom.enable_resource_timing"]
+ void clearResourceTimings();
+ [Pref="dom.enable_resource_timing"]
+ void setResourceTimingBufferSize(unsigned long maxSize);
+ [Pref="dom.enable_resource_timing"]
+ attribute EventHandler onresourcetimingbufferfull;
+};
+
+// http://www.w3.org/TR/user-timing/
+[Exposed=Window]
+partial interface Performance {
+ [Pref="dom.enable_user_timing", Throws]
+ void mark(DOMString markName);
+ [Pref="dom.enable_user_timing"]
+ void clearMarks(optional DOMString markName);
+ [Pref="dom.enable_user_timing", Throws]
+ void measure(DOMString measureName, optional DOMString startMark, optional DOMString endMark);
+ [Pref="dom.enable_user_timing"]
+ void clearMeasures(optional DOMString measureName);
};
diff --git a/dom/webidl/PerformanceEntry.webidl b/dom/webidl/PerformanceEntry.webidl
new file mode 100644
index 000000000..0c105196a
--- /dev/null
+++ b/dom/webidl/PerformanceEntry.webidl
@@ -0,0 +1,21 @@
+/* -*- 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.w3c-test.org/webperf/specs/PerformanceTimeline/#sec-PerformanceEntry-interface
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+interface PerformanceEntry
+{
+ readonly attribute DOMString name;
+ readonly attribute DOMString entryType;
+ readonly attribute DOMHighResTimeStamp startTime;
+ readonly attribute DOMHighResTimeStamp duration;
+
+ jsonifier;
+};
diff --git a/dom/webidl/PerformanceMark.webidl b/dom/webidl/PerformanceMark.webidl
new file mode 100644
index 000000000..fb20c334a
--- /dev/null
+++ b/dom/webidl/PerformanceMark.webidl
@@ -0,0 +1,12 @@
+/* -*- 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/user-timing/#performancemark
+ */
+
+interface PerformanceMark : PerformanceEntry
+{
+};
diff --git a/dom/webidl/PerformanceMeasure.webidl b/dom/webidl/PerformanceMeasure.webidl
new file mode 100644
index 000000000..e203c6d06
--- /dev/null
+++ b/dom/webidl/PerformanceMeasure.webidl
@@ -0,0 +1,12 @@
+/* -*- 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/user-timing/#performancemeasure
+ */
+
+interface PerformanceMeasure : PerformanceEntry
+{
+};
diff --git a/dom/webidl/PerformanceNavigation.webidl b/dom/webidl/PerformanceNavigation.webidl
index b2896e34b..771cf7e98 100644
--- a/dom/webidl/PerformanceNavigation.webidl
+++ b/dom/webidl/PerformanceNavigation.webidl
@@ -18,4 +18,6 @@ interface PerformanceNavigation {
readonly attribute unsigned short type;
readonly attribute unsigned short redirectCount;
+
+ jsonifier;
};
diff --git a/dom/webidl/PerformanceResourceTiming.webidl b/dom/webidl/PerformanceResourceTiming.webidl
new file mode 100644
index 000000000..5e6a2fe8c
--- /dev/null
+++ b/dom/webidl/PerformanceResourceTiming.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://w3c-test.org/webperf/specs/ResourceTiming/#performanceresourcetiming
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+interface PerformanceResourceTiming : PerformanceEntry
+{
+ // A string with the name of that element that initiated the load.
+ // If the initiator is a CSS resource, the initiatorType attribute must return
+ // the string "css".
+ // If the initiator is an XMLHttpRequest object, the initiatorType attribute
+ // must return the string "xmlhttprequest".
+ readonly attribute DOMString initiatorType;
+
+ readonly attribute DOMHighResTimeStamp redirectStart;
+ readonly attribute DOMHighResTimeStamp redirectEnd;
+ readonly attribute DOMHighResTimeStamp fetchStart;
+ readonly attribute DOMHighResTimeStamp domainLookupStart;
+ readonly attribute DOMHighResTimeStamp domainLookupEnd;
+ readonly attribute DOMHighResTimeStamp connectStart;
+ readonly attribute DOMHighResTimeStamp connectEnd;
+ readonly attribute DOMHighResTimeStamp secureConnectionStart;
+ readonly attribute DOMHighResTimeStamp requestStart;
+ readonly attribute DOMHighResTimeStamp responseStart;
+ readonly attribute DOMHighResTimeStamp responseEnd;
+
+ jsonifier;
+};
diff --git a/dom/webidl/PerformanceTiming.webidl b/dom/webidl/PerformanceTiming.webidl
index 06712dadd..f75a46b7c 100644
--- a/dom/webidl/PerformanceTiming.webidl
+++ b/dom/webidl/PerformanceTiming.webidl
@@ -33,4 +33,6 @@ interface PerformanceTiming {
readonly attribute unsigned long long domComplete;
readonly attribute unsigned long long loadEventStart;
readonly attribute unsigned long long loadEventEnd;
+
+ jsonifier;
};
diff --git a/dom/webidl/PeriodicWave.webidl b/dom/webidl/PeriodicWave.webidl
index 14cdd098a..1ac9f2a22 100644
--- a/dom/webidl/PeriodicWave.webidl
+++ b/dom/webidl/PeriodicWave.webidl
@@ -10,7 +10,6 @@
* liability, trademark and document use rules apply.
*/
-[PrefControlled]
interface PeriodicWave {
};
diff --git a/dom/webidl/PermissionSettings.webidl b/dom/webidl/PermissionSettings.webidl
new file mode 100644
index 000000000..b84348faf
--- /dev/null
+++ b/dom/webidl/PermissionSettings.webidl
@@ -0,0 +1,20 @@
+/* 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 at http://mozilla.org/MPL/2.0/. */
+
+[JSImplementation="@mozilla.org/permissionSettings;1",
+ CheckPermissions="permissions",
+ Pref="dom.mozPermissionSettings.enabled",
+ NavigatorProperty="mozPermissionSettings"]
+interface PermissionSettings
+{
+ DOMString get(DOMString permission, DOMString manifestURI, DOMString origin, boolean browserFlag);
+
+ void set(DOMString permission, DOMString value, DOMString manifestURI, DOMString origin, boolean browserFlag);
+
+ boolean isExplicit(DOMString permission, DOMString manifestURI, DOMString origin, boolean browserFlag);
+
+ // Removing a permission is only allowed for pages with a different origin than the app
+ // and pages that have browserFlag=true, so remove() doesn't have a browserFlag parameter.
+ void remove(DOMString permission, DOMString manifestURI, DOMString origin);
+};
diff --git a/dom/webidl/PhoneNumberService.webidl b/dom/webidl/PhoneNumberService.webidl
new file mode 100644
index 000000000..e9e6d7c89
--- /dev/null
+++ b/dom/webidl/PhoneNumberService.webidl
@@ -0,0 +1,15 @@
+/* -*- 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/.
+ */
+
+[JSImplementation="@mozilla.org/phoneNumberService;1",
+ NavigatorProperty="mozPhoneNumberService",
+ CheckPermissions="phonenumberservice"]
+interface PhoneNumberService {
+ DOMRequest fuzzyMatch([TreatNullAs=EmptyString] optional DOMString number1 = "",
+ [TreatNullAs=EmptyString] optional DOMString number2= "");
+
+ DOMString normalize(DOMString number);
+};
diff --git a/dom/webidl/Plugin.webidl b/dom/webidl/Plugin.webidl
new file mode 100644
index 000000000..0af7c4d6a
--- /dev/null
+++ b/dom/webidl/Plugin.webidl
@@ -0,0 +1,16 @@
+/* -*- 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/.
+ */
+
+interface Plugin {
+ readonly attribute DOMString description;
+ readonly attribute DOMString filename;
+ readonly attribute DOMString version;
+ readonly attribute DOMString name;
+
+ readonly attribute unsigned long length;
+ getter MimeType? item(unsigned long index);
+ getter MimeType? namedItem(DOMString name);
+};
diff --git a/dom/webidl/PluginArray.webidl b/dom/webidl/PluginArray.webidl
new file mode 100644
index 000000000..27bd318df
--- /dev/null
+++ b/dom/webidl/PluginArray.webidl
@@ -0,0 +1,14 @@
+/* -*- 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/.
+ */
+
+interface PluginArray {
+ readonly attribute unsigned long length;
+
+ getter Plugin? item(unsigned long index);
+ getter Plugin? namedItem(DOMString name);
+
+ void refresh(optional boolean reloadDocuments = false);
+};
diff --git a/dom/webidl/PluginCrashedEvent.webidl b/dom/webidl/PluginCrashedEvent.webidl
new file mode 100644
index 000000000..b2056d7bb
--- /dev/null
+++ b/dom/webidl/PluginCrashedEvent.webidl
@@ -0,0 +1,26 @@
+/* -*- 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/.
+ */
+
+[Constructor(DOMString type, optional PluginCrashedEventInit eventInitDict), ChromeOnly]
+interface PluginCrashedEvent : Event
+{
+ readonly attribute DOMString pluginDumpID;
+ readonly attribute DOMString pluginName;
+ readonly attribute DOMString? browserDumpID;
+ readonly attribute DOMString? pluginFilename;
+ readonly attribute boolean submittedCrashReport;
+ readonly attribute boolean gmpPlugin;
+};
+
+dictionary PluginCrashedEventInit : EventInit
+{
+ DOMString pluginDumpID = "";
+ DOMString pluginName = "";
+ DOMString? browserDumpID = null;
+ DOMString? pluginFilename = null;
+ boolean submittedCrashReport = false;
+ boolean gmpPlugin = false;
+};
diff --git a/dom/webidl/PointerEvent.webidl b/dom/webidl/PointerEvent.webidl
new file mode 100644
index 000000000..935342ae8
--- /dev/null
+++ b/dom/webidl/PointerEvent.webidl
@@ -0,0 +1,37 @@
+/* -*- 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/.
+ *
+ * For more information see nsIPointerEvent.idl.
+ *
+ * Portions Copyright 2013 Microsoft Open Technologies, Inc. */
+
+interface WindowProxy;
+
+[Pref="dom.w3c_pointer_events.enabled",
+ Constructor(DOMString type, optional PointerEventInit eventInitDict)]
+interface PointerEvent : MouseEvent
+{
+ readonly attribute long pointerId;
+ readonly attribute long width;
+ readonly attribute long height;
+ readonly attribute float pressure;
+ readonly attribute long tiltX;
+ readonly attribute long tiltY;
+ readonly attribute DOMString pointerType;
+ readonly attribute boolean isPrimary;
+};
+
+dictionary PointerEventInit : MouseEventInit
+{
+ long pointerId = 0;
+ long width = 0;
+ long height = 0;
+ float pressure = 0;
+ long tiltX = 0;
+ long tiltY = 0;
+ DOMString pointerType = "";
+ boolean isPrimary = false;
+};
+
diff --git a/dom/webidl/PopStateEvent.webidl b/dom/webidl/PopStateEvent.webidl
index 145f7b169..428ab9c84 100644
--- a/dom/webidl/PopStateEvent.webidl
+++ b/dom/webidl/PopStateEvent.webidl
@@ -4,18 +4,10 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-[Constructor(DOMString type, optional PopStateEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Constructor(DOMString type, optional PopStateEventInit eventInitDict)]
interface PopStateEvent : Event
{
- [Throws]
readonly attribute any state;
-
- // initPopStateEvent is a Goanna specific deprecated method.
- [Throws]
- void initPopStateEvent(DOMString type,
- boolean canBubble,
- boolean cancelable,
- any state);
};
dictionary PopStateEventInit : EventInit
diff --git a/dom/webidl/PopupBlockedEvent.webidl b/dom/webidl/PopupBlockedEvent.webidl
index 16f6ca453..bf338d56b 100644
--- a/dom/webidl/PopupBlockedEvent.webidl
+++ b/dom/webidl/PopupBlockedEvent.webidl
@@ -3,25 +3,15 @@
* 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/.
*/
-interface Window;
interface URI;
-[Constructor(DOMString type, optional PopupBlockedEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Constructor(DOMString type, optional PopupBlockedEventInit eventInitDict)]
interface PopupBlockedEvent : Event
{
readonly attribute Window? requestingWindow;
readonly attribute URI? popupWindowURI;
readonly attribute DOMString? popupWindowName;
readonly attribute DOMString? popupWindowFeatures;
-
- [Throws]
- void initPopupBlockedEvent(DOMString type,
- boolean canBubble,
- boolean cancelable,
- Window? requestingWindow,
- URI? popupWindowURI,
- DOMString? popupWindowName,
- DOMString? popupWindowFeatures);
};
dictionary PopupBlockedEventInit : EventInit
diff --git a/dom/webidl/PopupBoxObject.webidl b/dom/webidl/PopupBoxObject.webidl
new file mode 100644
index 000000000..82f10e664
--- /dev/null
+++ b/dom/webidl/PopupBoxObject.webidl
@@ -0,0 +1,175 @@
+/* -*- Mode: C++; 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/. */
+
+[Func="IsChromeOrXBL"]
+interface PopupBoxObject : BoxObject
+{
+ /**
+ * This method is deprecated. Use openPopup or openPopupAtScreen instead.
+ */
+ void showPopup(Element? srcContent, Element popupContent,
+ long xpos, long ypos,
+ optional DOMString popupType = "",
+ optional DOMString anchorAlignment = "",
+ optional DOMString popupAlignment = "");
+
+ /**
+ * Hide the popup if it is open. The cancel argument is used as a hint that
+ * the popup is being closed because it has been cancelled, rather than
+ * something being selected within the panel.
+ *
+ * @param cancel if true, then the popup is being cancelled.
+ */
+ void hidePopup(optional boolean cancel = false);
+
+ /**
+ * Allow the popup to automatically position itself.
+ */
+ attribute boolean autoPosition;
+
+ /**
+ * If keyboard navigation is enabled, the keyboard may be used to navigate
+ * the menuitems on the popup. Enabling keyboard navigation is the default
+ * behaviour and will install capturing key event listeners on the popup
+ * that do not propagate key events to the contents. If you wish to place
+ * elements in a popup which accept key events, such as textboxes, keyboard
+ * navigation should be disabled.
+ *
+ * Setting ignorekeys="true" on the popup element also disables keyboard
+ * navigation, and is recommended over calling this method.
+ */
+ void enableKeyboardNavigator(boolean enableKeyboardNavigator);
+
+ /**
+ * Enable automatic popup dismissal. This only has effect when called
+ * on an open popup.
+ */
+ void enableRollup(boolean enableRollup);
+
+ /**
+ * Control whether the event that caused the popup to be automatically
+ * dismissed ("rolled up") should be consumed, or dispatched as a
+ * normal event. This should be set immediately before calling showPopup()
+ * if non-default behavior is desired.
+ */
+ const unsigned long ROLLUP_DEFAULT = 0; /* widget/platform default */
+ const unsigned long ROLLUP_CONSUME = 1; /* consume the rollup event */
+ const unsigned long ROLLUP_NO_CONSUME = 2; /* don't consume the rollup event */
+ void setConsumeRollupEvent(unsigned long consume);
+
+ /**
+ * Size the popup to the given dimensions
+ */
+ void sizeTo(long width, long height);
+
+ /**
+ * Move the popup to a point on screen in CSS pixels.
+ */
+ void moveTo(long left, long top);
+
+ /**
+ * Open the popup relative to a specified node at a specific location.
+ *
+ * The popup may be either anchored to another node or opened freely.
+ * To anchor a popup to a node, supply an anchor node and set the position
+ * to a string indicating the manner in which the popup should be anchored.
+ * Possible values for position are:
+ * before_start, before_end, after_start, after_end,
+ * start_before, start_after, end_before, end_after,
+ * overlap, after_pointer
+ *
+ * The anchor node does not need to be in the same document as the popup.
+ *
+ * If the attributesOverride argument is true, the popupanchor, popupalign
+ * and position attributes on the popup node override the position value
+ * argument. If attributesOverride is false, the attributes are only used
+ * if position is empty.
+ *
+ * For an anchored popup, the x and y arguments may be used to offset the
+ * popup from its anchored position by some distance, measured in CSS pixels.
+ * x increases to the right and y increases down. Negative values may also
+ * be used to move to the left and upwards respectively.
+ *
+ * Unanchored popups may be created by supplying null as the anchor node.
+ * An unanchored popup appears at the position specified by x and y,
+ * relative to the viewport of the document containing the popup node. In
+ * this case, position and attributesOverride are ignored.
+ *
+ * @param anchorElement the node to anchor the popup to, may be null
+ * @param position manner is which to anchor the popup to node
+ * @param x horizontal offset
+ * @param y vertical offset
+ * @param isContextMenu true for context menus, false for other popups
+ * @param attributesOverride true if popup node attributes override position
+ * @param triggerEvent the event that triggered this popup (mouse click for example)
+ */
+ void openPopup(Element? anchorElement,
+ optional DOMString position = "",
+ long x,
+ long y,
+ boolean isContextMenu,
+ boolean attributesOverride,
+ Event? triggerEvent);
+
+ /**
+ * Open the popup at a specific screen position specified by x and y. This
+ * position may be adjusted if it would cause the popup to be off of the
+ * screen. The x and y coordinates are measured in CSS pixels, and like all
+ * screen coordinates, are given relative to the top left of the primary
+ * screen.
+ *
+ * @param isContextMenu true for context menus, false for other popups
+ * @param x horizontal screen position
+ * @param y vertical screen position
+ * @param triggerEvent the event that triggered this popup (mouse click for example)
+ */
+ void openPopupAtScreen(long x, long y,
+ boolean isContextMenu,
+ Event? triggerEvent);
+
+ /**
+ * Returns the state of the popup:
+ * closed - the popup is closed
+ * open - the popup is open
+ * showing - the popup is in the process of being shown
+ * hiding - the popup is in the process of being hidden
+ */
+ readonly attribute DOMString popupState;
+
+ /**
+ * The node that triggered the popup. If the popup is not open, will return
+ * null.
+ */
+ readonly attribute Node? triggerNode;
+
+ /**
+ * Retrieve the anchor that was specified to openPopup or for menupopups in a
+ * menu, the parent menu.
+ */
+ readonly attribute Element? anchorNode;
+
+ /**
+ * Retrieve the screen rectangle of the popup, including the area occupied by
+ * any titlebar or borders present.
+ */
+ DOMRect getOuterScreenRect();
+
+ /**
+ * Move an open popup to the given anchor position. The arguments have the same
+ * meaning as the corresponding argument to openPopup. This method has no effect
+ * on popups that are not open.
+ */
+ void moveToAnchor(Element? anchorElement,
+ optional DOMString position = "",
+ long x, long y,
+ boolean attributesOverride);
+
+ /** Returns the alignment position where the popup has appeared relative to its
+ * anchor node or point, accounting for any flipping that occurred.
+ */
+ readonly attribute DOMString alignmentPosition;
+ readonly attribute long alignmentOffset;
+
+};
diff --git a/dom/webidl/PresentationDeviceInfoManager.webidl b/dom/webidl/PresentationDeviceInfoManager.webidl
new file mode 100644
index 000000000..f38e16836
--- /dev/null
+++ b/dom/webidl/PresentationDeviceInfoManager.webidl
@@ -0,0 +1,26 @@
+/* -*- 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/.
+ */
+
+dictionary PresentationDeviceInfo {
+ DOMString id;
+ DOMString name;
+ DOMString type;
+};
+
+[NavigatorProperty="mozPresentationDeviceInfo",
+ JSImplementation="@mozilla.org/presentation-device/deviceInfo;1",
+ Pref="dom.presentation.enabled",
+ CheckPermissions="presentation-device-manage"]
+interface PresentationDeviceInfoManager : EventTarget {
+ // notify if any device updated.
+ attribute EventHandler ondevicechange;
+
+ // retrieve all available device infos
+ Promise<sequence<PresentationDeviceInfo>> getAll();
+
+ // Force all registered device provider to update device information.
+ void forceDiscovery();
+};
diff --git a/dom/webidl/ProfileTimelineMarker.webidl b/dom/webidl/ProfileTimelineMarker.webidl
new file mode 100644
index 000000000..bfa7f0188
--- /dev/null
+++ b/dom/webidl/ProfileTimelineMarker.webidl
@@ -0,0 +1,27 @@
+/* -*- 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/.
+ */
+
+dictionary ProfileTimelineLayerRect {
+ long x = 0;
+ long y = 0;
+ long width = 0;
+ long height = 0;
+};
+
+dictionary ProfileTimelineMarker {
+ DOMString name = "";
+ DOMHighResTimeStamp start = 0;
+ DOMHighResTimeStamp end = 0;
+ object? stack = null;
+ /* For ConsoleTime markers. */
+ DOMString causeName;
+ object? endStack = null;
+ /* For DOMEvent markers. */
+ DOMString type;
+ unsigned short eventPhase;
+ /* For Paint markers. */
+ sequence<ProfileTimelineLayerRect> rectangles;
+};
diff --git a/dom/webidl/ProgressEvent.webidl b/dom/webidl/ProgressEvent.webidl
index 997f88719..1be356b8f 100644
--- a/dom/webidl/ProgressEvent.webidl
+++ b/dom/webidl/ProgressEvent.webidl
@@ -4,7 +4,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-[Constructor(DOMString type, optional ProgressEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Constructor(DOMString type, optional ProgressEventInit eventInitDict)]
interface ProgressEvent : Event
{
readonly attribute boolean lengthComputable;
diff --git a/dom/webidl/Promise.webidl b/dom/webidl/Promise.webidl
index b74649aec..1f22f58e2 100644
--- a/dom/webidl/Promise.webidl
+++ b/dom/webidl/Promise.webidl
@@ -7,30 +7,43 @@
* http://dom.spec.whatwg.org/#promises
*/
-interface PromiseResolver {
- void resolve(optional any value);
- void reject(optional any value);
-};
+// TODO We use object instead Function. There is an open issue on WebIDL to
+// have different types for "platform-provided function" and "user-provided
+// function"; for now, we just use "object".
+callback PromiseInit = void (object resolve, object reject);
+
+[TreatNonCallableAsNull]
+callback AnyCallback = any (any value);
-callback PromiseInit = void (PromiseResolver resolver);
-callback AnyCallback = any (optional any value);
+// REMOVE THE RELEVANT ENTRY FROM test_interfaces.html WHEN THIS IS IMPLEMENTED IN JS.
+[Constructor(PromiseInit init),
+ Exposed=(Window,Worker,System)]
+// Need to escape "Promise" so it's treated as an identifier.
+interface _Promise {
+ // TODO bug 875289 - static Promise fulfill(any value);
-[PrefControlled, Constructor(PromiseInit init)]
-interface Promise {
- // TODO: update this interface - bug 875289
+ // Disable the static methods when the interface object is supposed to be
+ // disabled, just in case some code decides to walk over to .constructor from
+ // the proto of a promise object or someone screws up and manages to create a
+ // Promise object in this scope without having resolved the interface object
+ // first.
+ [NewObject]
+ static Promise<any> resolve(optional any value);
+ [NewObject]
+ static Promise<void> reject(optional any value);
- [Creator, Throws]
- static Promise resolve(any value); // same as any(value)
- [Creator, Throws]
- static Promise reject(any value);
+ // The [TreatNonCallableAsNull] annotation is required since then() should do
+ // nothing instead of throwing errors when non-callable arguments are passed.
+ [NewObject]
+ Promise<any> then([TreatNonCallableAsNull] optional AnyCallback? fulfillCallback = null,
+ [TreatNonCallableAsNull] optional AnyCallback? rejectCallback = null);
- [Creator]
- Promise then(optional AnyCallback? resolveCallback = null,
- optional AnyCallback? rejectCallback = null);
+ [NewObject]
+ Promise<any> catch([TreatNonCallableAsNull] optional AnyCallback? rejectCallback = null);
- [Creator]
- Promise catch(optional AnyCallback? rejectCallback = null);
+ [NewObject]
+ static Promise<any> all(sequence<any> iterable);
- void done(optional AnyCallback? resolveCallback = null,
- optional AnyCallback? rejectCallback = null);
+ [NewObject]
+ static Promise<any> race(sequence<any> iterable);
};
diff --git a/dom/webidl/PromiseDebugging.webidl b/dom/webidl/PromiseDebugging.webidl
new file mode 100644
index 000000000..1a464ff09
--- /dev/null
+++ b/dom/webidl/PromiseDebugging.webidl
@@ -0,0 +1,71 @@
+/* -*- 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/.
+ */
+
+/* This is a utility namespace for promise-debugging functionality */
+
+
+dictionary PromiseDebuggingStateHolder {
+ PromiseDebuggingState state = "pending";
+ any value;
+ any reason;
+};
+enum PromiseDebuggingState { "pending", "fulfilled", "rejected" };
+
+[ChromeOnly, Exposed=(Window,System)]
+interface PromiseDebugging {
+ static PromiseDebuggingStateHolder getState(Promise<any> p);
+
+ /**
+ * Return the stack to the promise's allocation point. This can
+ * return null if the promise was not created from script.
+ */
+ static object? getAllocationStack(Promise<any> p);
+
+ /**
+ * Return the stack to the promise's rejection point, if the
+ * rejection happened from script. This can return null if the
+ * promise has not been rejected or was not rejected from script.
+ */
+ static object? getRejectionStack(Promise<any> p);
+
+ /**
+ * Return the stack to the promise's fulfillment point, if the
+ * fulfillment happened from script. This can return null if the
+ * promise has not been fulfilled or was not fulfilled from script.
+ */
+ static object? getFullfillmentStack(Promise<any> p);
+
+ /**
+ * Get the promises directly depending on a given promise. These are:
+ *
+ * 1) Return values of then() calls on the promise
+ * 2) Return values of Promise.all() if the given promise was passed in as one
+ * of the arguments.
+ * 3) Return values of Promise.race() if the given promise was passed in as
+ * one of the arguments.
+ *
+ * Once a promise is settled, it will generally notify its dependent promises
+ * and forget about them, so this is most useful on unsettled promises.
+ *
+ * Note that this function only returns the promises that directly depend on
+ * p. It does not recursively return promises that depend on promises that
+ * depend on p.
+ */
+ static sequence<Promise<any>> getDependentPromises(Promise<any> p);
+
+ /**
+ * Get the number of milliseconds elapsed since the given promise was created.
+ */
+ static DOMHighResTimeStamp getPromiseLifetime(Promise<any> p);
+
+ /*
+ * Get the number of milliseconds elapsed between the promise being created
+ * and being settled. Throws NS_ERROR_UNEXPECTED if the promise has not
+ * settled.
+ */
+ [Throws]
+ static DOMHighResTimeStamp getTimeToSettle(Promise<any> p);
+};
diff --git a/dom/webidl/PushManager.webidl b/dom/webidl/PushManager.webidl
new file mode 100644
index 000000000..1e3a4de60
--- /dev/null
+++ b/dom/webidl/PushManager.webidl
@@ -0,0 +1,16 @@
+/* -*- 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/.
+*/
+
+[NoInterfaceObject,
+ NavigatorProperty="push",
+ JSImplementation="@mozilla.org/push/PushManager;1",
+ CheckPermissions="push",
+ Pref="services.push.enabled"]
+interface PushManager {
+ DOMRequest register();
+ DOMRequest unregister(DOMString pushEndpoint);
+ DOMRequest registrations();
+};
diff --git a/dom/webidl/RTCConfiguration.webidl b/dom/webidl/RTCConfiguration.webidl
index 16eb7eee0..02e7c8e46 100644
--- a/dom/webidl/RTCConfiguration.webidl
+++ b/dom/webidl/RTCConfiguration.webidl
@@ -8,11 +8,13 @@
*/
dictionary RTCIceServer {
- DOMString url;
+ (DOMString or sequence<DOMString>) urls;
+ DOMString url; //deprecated
DOMString? credential = null;
DOMString? username = null;
};
dictionary RTCConfiguration {
sequence<RTCIceServer> iceServers;
+ DOMString? peerIdentity = null;
};
diff --git a/dom/webidl/RTCDataChannelEvent.webidl b/dom/webidl/RTCDataChannelEvent.webidl
index c77e2c4b4..4c74bddb0 100644
--- a/dom/webidl/RTCDataChannelEvent.webidl
+++ b/dom/webidl/RTCDataChannelEvent.webidl
@@ -14,7 +14,6 @@ dictionary RTCDataChannelEventInit : EventInit {
};
[Pref="media.peerconnection.enabled",
- JSImplementation="@mozilla.org/dom/datachannelevent;1",
Constructor(DOMString type, optional RTCDataChannelEventInit eventInitDict)]
interface RTCDataChannelEvent : Event {
readonly attribute RTCDataChannel? channel;
diff --git a/dom/webidl/RTCIceCandidate.webidl b/dom/webidl/RTCIceCandidate.webidl
index 5d79a0283..5d156d6a6 100644
--- a/dom/webidl/RTCIceCandidate.webidl
+++ b/dom/webidl/RTCIceCandidate.webidl
@@ -21,7 +21,5 @@ interface mozRTCIceCandidate {
attribute DOMString? sdpMid;
attribute unsigned short? sdpMLineIndex;
- // Bug 863402 serializer support
- //
- //serializer = {attribute};
+ jsonifier;
};
diff --git a/dom/webidl/RTCIdentityAssertion.webidl b/dom/webidl/RTCIdentityAssertion.webidl
new file mode 100644
index 000000000..278ee57e2
--- /dev/null
+++ b/dom/webidl/RTCIdentityAssertion.webidl
@@ -0,0 +1,16 @@
+/* -*- 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/2013/WD-webrtc-20130910/#idl-def-RTCIdentityAssertion
+ */
+
+[Pref="media.peerconnection.identity.enabled",
+ JSImplementation="@mozilla.org/dom/rtcidentityassertion;1",
+ Constructor(DOMString idp, DOMString name)]
+interface RTCIdentityAssertion {
+ attribute DOMString idp;
+ attribute DOMString name;
+};
diff --git a/dom/webidl/RTCIdentityProvider.webidl b/dom/webidl/RTCIdentityProvider.webidl
new file mode 100644
index 000000000..f13888bc6
--- /dev/null
+++ b/dom/webidl/RTCIdentityProvider.webidl
@@ -0,0 +1,54 @@
+/* -*- 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/.
+ *
+ * http://w3c.github.io/webrtc-pc/ (with https://github.com/w3c/webrtc-pc/pull/178)
+ */
+
+[NoInterfaceObject]
+interface RTCIdentityProviderRegistrar {
+ void register(RTCIdentityProvider idp);
+
+ /* The IdP that was passed to register() to chrome code, if any. */
+ [ChromeOnly]
+ readonly attribute RTCIdentityProvider? idp;
+ /* The following two chrome-only functions forward to the corresponding
+ * function on the registered IdP. This is necessary because the
+ * JS-implemented WebIDL can't see these functions on `idp` above, chrome JS
+ * gets an Xray onto the content code that suppresses functions, see
+ * https://developer.mozilla.org/en-US/docs/Xray_vision#Xrays_for_JavaScript_objects
+ */
+ /* Forward to idp.generateAssertion() */
+ [ChromeOnly, Throws]
+ Promise<RTCIdentityAssertionResult>
+ generateAssertion(DOMString contents, DOMString origin,
+ optional DOMString usernameHint);
+ /* Forward to idp.validateAssertion() */
+ [ChromeOnly, Throws]
+ Promise<RTCIdentityValidationResult>
+ validateAssertion(DOMString assertion, DOMString origin);
+};
+
+callback interface RTCIdentityProvider {
+ Promise<RTCIdentityAssertionResult>
+ generateAssertion(DOMString contents, DOMString origin,
+ optional DOMString usernameHint);
+ Promise<RTCIdentityValidationResult>
+ validateAssertion(DOMString assertion, DOMString origin);
+};
+
+dictionary RTCIdentityAssertionResult {
+ required RTCIdentityProviderDetails idp;
+ required DOMString assertion;
+};
+
+dictionary RTCIdentityProviderDetails {
+ required DOMString domain;
+ DOMString protocol = "default";
+};
+
+dictionary RTCIdentityValidationResult {
+ required DOMString identity;
+ required DOMString contents;
+};
diff --git a/dom/webidl/RTCPeerConnection.webidl b/dom/webidl/RTCPeerConnection.webidl
index dc82cdcb4..49eb5cd7f 100644
--- a/dom/webidl/RTCPeerConnection.webidl
+++ b/dom/webidl/RTCPeerConnection.webidl
@@ -8,8 +8,9 @@
*/
callback RTCSessionDescriptionCallback = void (mozRTCSessionDescription sdp);
-callback RTCPeerConnectionErrorCallback = void (DOMString errorInformation);
+callback RTCPeerConnectionErrorCallback = void (DOMError error);
callback VoidFunction = void ();
+callback RTCStatsCallback = void (RTCStatsReport report);
enum RTCSignalingState {
"stable",
@@ -51,6 +52,24 @@ dictionary RTCDataChannelInit {
unsigned short stream; // now id
};
+dictionary RTCOfferOptions {
+ long offerToReceiveVideo;
+ long offerToReceiveAudio;
+ boolean mozDontOfferDataChannel;
+ boolean mozBundleOnly;
+
+ // TODO: Remove old constraint-like RTCOptions support soon (Bug 1064223).
+ DeprecatedRTCOfferOptionsSet mandatory;
+ sequence<DeprecatedRTCOfferOptionsSet> _optional;
+};
+
+dictionary DeprecatedRTCOfferOptionsSet {
+ boolean OfferToReceiveAudio; // Note the uppercase 'O'
+ boolean OfferToReceiveVideo; // Note the uppercase 'O'
+ boolean MozDontOfferDataChannel; // Note the uppercase 'M'
+ boolean MozBundleOnly; // Note the uppercase 'M'
+};
+
interface RTCDataChannel;
[Pref="media.peerconnection.enabled",
@@ -59,57 +78,92 @@ interface RTCDataChannel;
optional object? constraints)]
// moz-prefixed until sufficiently standardized.
interface mozRTCPeerConnection : EventTarget {
- void createOffer (RTCSessionDescriptionCallback successCallback,
- RTCPeerConnectionErrorCallback? failureCallback, // for apprtc
- optional object? constraints);
- void createAnswer (RTCSessionDescriptionCallback successCallback,
- RTCPeerConnectionErrorCallback? failureCallback, // for apprtc
- optional object? constraints);
- void setLocalDescription (mozRTCSessionDescription description,
- optional VoidFunction successCallback,
- optional RTCPeerConnectionErrorCallback failureCallback);
- void setRemoteDescription (mozRTCSessionDescription description,
- optional VoidFunction successCallback,
- optional RTCPeerConnectionErrorCallback failureCallback);
+ [Pref="media.peerconnection.identity.enabled"]
+ void setIdentityProvider (DOMString provider,
+ optional DOMString protocol,
+ optional DOMString username);
+ [Pref="media.peerconnection.identity.enabled"]
+ Promise<DOMString> getIdentityAssertion();
+ Promise<mozRTCSessionDescription> createOffer (optional RTCOfferOptions options);
+ Promise<mozRTCSessionDescription> createAnswer ();
+ Promise<void> setLocalDescription (mozRTCSessionDescription description);
+ Promise<void> setRemoteDescription (mozRTCSessionDescription description);
readonly attribute mozRTCSessionDescription? localDescription;
readonly attribute mozRTCSessionDescription? remoteDescription;
readonly attribute RTCSignalingState signalingState;
- void updateIce (optional RTCConfiguration configuration,
- optional object? constraints);
- void addIceCandidate (mozRTCIceCandidate candidate,
- optional VoidFunction successCallback,
- optional RTCPeerConnectionErrorCallback failureCallback);
+ void updateIce (optional RTCConfiguration configuration);
+ Promise<void> addIceCandidate (mozRTCIceCandidate candidate);
readonly attribute RTCIceGatheringState iceGatheringState;
readonly attribute RTCIceConnectionState iceConnectionState;
+ [Pref="media.peerconnection.identity.enabled"]
+ readonly attribute Promise<RTCIdentityAssertion> peerIdentity;
+ [Pref="media.peerconnection.identity.enabled"]
+ readonly attribute DOMString? idpLoginUrl;
+
+ [ChromeOnly]
+ attribute DOMString id;
+
+ RTCConfiguration getConfiguration ();
+ [UnsafeInPrerendering]
sequence<MediaStream> getLocalStreams ();
+ [UnsafeInPrerendering]
sequence<MediaStream> getRemoteStreams ();
+ [UnsafeInPrerendering]
MediaStream? getStreamById (DOMString streamId);
- void addStream (MediaStream stream, optional object? constraints);
+ void addStream (MediaStream stream);
void removeStream (MediaStream stream);
+
+ // replaces addStream; fails if already added
+ // because a track can be part of multiple streams, stream parameters
+ // indicate which particular streams should be referenced in signaling
+
+ RTCRtpSender addTrack(MediaStreamTrack track,
+ MediaStream stream,
+ MediaStream... moreStreams);
+ void removeTrack(RTCRtpSender sender);
+
+ sequence<RTCRtpSender> getSenders();
+ sequence<RTCRtpReceiver> getReceivers();
+
void close ();
attribute EventHandler onnegotiationneeded;
attribute EventHandler onicecandidate;
attribute EventHandler onsignalingstatechange;
attribute EventHandler onaddstream;
+ attribute EventHandler onaddtrack; // replaces onaddstream; see AddTrackEvent
attribute EventHandler onremovestream;
attribute EventHandler oniceconnectionstatechange;
-};
-// Mozilla extensions.
-partial interface mozRTCPeerConnection {
- // Deprecated callbacks (use causes warning)
- attribute RTCPeerConnectionErrorCallback onicechange;
- attribute RTCPeerConnectionErrorCallback ongatheringchange;
-
- // Deprecated attributes (use causes warning)
- readonly attribute object localStreams;
- readonly attribute object remoteStreams;
- readonly attribute DOMString readyState;
+ Promise<RTCStatsReport> getStats (MediaStreamTrack? selector);
// Data channel.
RTCDataChannel createDataChannel (DOMString label,
optional RTCDataChannelInit dataChannelDict);
attribute EventHandler ondatachannel;
- attribute EventHandler onconnection;
- attribute EventHandler onclosedconnection;
+};
+
+// Legacy callback API
+
+partial interface mozRTCPeerConnection {
+
+ // Dummy Promise<void> return values avoid "WebIDL.WebIDLError: error:
+ // We have overloads with both Promise and non-Promise return types"
+
+ Promise<void> createOffer (RTCSessionDescriptionCallback successCallback,
+ RTCPeerConnectionErrorCallback failureCallback,
+ optional RTCOfferOptions options);
+ Promise<void> createAnswer (RTCSessionDescriptionCallback successCallback,
+ RTCPeerConnectionErrorCallback failureCallback);
+ Promise<void> setLocalDescription (mozRTCSessionDescription description,
+ VoidFunction successCallback,
+ RTCPeerConnectionErrorCallback failureCallback);
+ Promise<void> setRemoteDescription (mozRTCSessionDescription description,
+ VoidFunction successCallback,
+ RTCPeerConnectionErrorCallback failureCallback);
+ Promise<void> addIceCandidate (mozRTCIceCandidate candidate,
+ VoidFunction successCallback,
+ RTCPeerConnectionErrorCallback failureCallback);
+ Promise<void> getStats (MediaStreamTrack? selector,
+ RTCStatsCallback successCallback,
+ RTCPeerConnectionErrorCallback failureCallback);
};
diff --git a/dom/webidl/RTCPeerConnectionIceEvent.webidl b/dom/webidl/RTCPeerConnectionIceEvent.webidl
index 7eefe607d..a200946fc 100644
--- a/dom/webidl/RTCPeerConnectionIceEvent.webidl
+++ b/dom/webidl/RTCPeerConnectionIceEvent.webidl
@@ -12,7 +12,6 @@ dictionary RTCPeerConnectionIceEventInit : EventInit {
};
[Pref="media.peerconnection.enabled",
- JSImplementation="@mozilla.org/dom/rtcpeerconnectioniceevent;1",
Constructor(DOMString type,
optional RTCPeerConnectionIceEventInit eventInitDict)]
interface RTCPeerConnectionIceEvent : Event {
diff --git a/dom/webidl/RTCPeerConnectionStatic.webidl b/dom/webidl/RTCPeerConnectionStatic.webidl
new file mode 100644
index 000000000..e6dc19fd9
--- /dev/null
+++ b/dom/webidl/RTCPeerConnectionStatic.webidl
@@ -0,0 +1,39 @@
+/* -*- 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/.
+ */
+
+/*
+ Right now, it is not possible to add static functions to a JS implemented
+ interface (see bug 863952), so we need to create a simple interface with a
+ trivial constructor and no data to hold these functions that really ought to
+ be static in mozRTCPeerConnection.
+ TODO(bcampen@mozilla.com) Merge this code into RTCPeerConnection once this
+ limitation is gone. (Bug 1017082)
+*/
+
+enum RTCLifecycleEvent {
+ "initialized",
+ "icegatheringstatechange",
+ "iceconnectionstatechange"
+};
+
+callback PeerConnectionLifecycleCallback = void (mozRTCPeerConnection pc,
+ unsigned long long windowId,
+ RTCLifecycleEvent eventType);
+
+[ChromeOnly,
+ Pref="media.peerconnection.enabled",
+ JSImplementation="@mozilla.org/dom/peerconnectionstatic;1",
+ Constructor()]
+interface mozRTCPeerConnectionStatic {
+
+ /* One slot per window (the window in which the register call is made),
+ automatically unregistered when window goes away.
+ Fires when a PC is created, and whenever the ICE connection state or
+ gathering state changes. */
+ void registerPeerConnectionLifecycleCallback(
+ PeerConnectionLifecycleCallback cb);
+};
+
diff --git a/dom/webidl/RTCRtpReceiver.webidl b/dom/webidl/RTCRtpReceiver.webidl
new file mode 100644
index 000000000..94343ea03
--- /dev/null
+++ b/dom/webidl/RTCRtpReceiver.webidl
@@ -0,0 +1,14 @@
+/* -*- 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://lists.w3.org/Archives/Public/public-webrtc/2014May/0067.html
+ */
+
+[Pref="media.peerconnection.enabled",
+ JSImplementation="@mozilla.org/dom/rtpreceiver;1"]
+interface RTCRtpReceiver {
+ readonly attribute MediaStreamTrack track;
+};
diff --git a/dom/webidl/RTCRtpSender.webidl b/dom/webidl/RTCRtpSender.webidl
new file mode 100644
index 000000000..dda71d680
--- /dev/null
+++ b/dom/webidl/RTCRtpSender.webidl
@@ -0,0 +1,16 @@
+/* -*- 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://lists.w3.org/Archives/Public/public-webrtc/2014May/0067.html
+ */
+
+[Pref="media.peerconnection.enabled",
+ JSImplementation="@mozilla.org/dom/rtpsender;1"]
+interface RTCRtpSender {
+ readonly attribute MediaStreamTrack track;
+
+ Promise<void> replaceTrack(MediaStreamTrack track);
+};
diff --git a/dom/webidl/RTCSessionDescription.webidl b/dom/webidl/RTCSessionDescription.webidl
index b53db2868..cce78af6d 100644
--- a/dom/webidl/RTCSessionDescription.webidl
+++ b/dom/webidl/RTCSessionDescription.webidl
@@ -25,7 +25,5 @@ interface mozRTCSessionDescription {
attribute RTCSdpType? type;
attribute DOMString? sdp;
- // Bug 863402 serializer support workaround
- //serializer = {attribute};
- object toJSON();
+ jsonifier;
};
diff --git a/dom/webidl/RTCStatsReport.webidl b/dom/webidl/RTCStatsReport.webidl
new file mode 100644
index 000000000..a083629e0
--- /dev/null
+++ b/dom/webidl/RTCStatsReport.webidl
@@ -0,0 +1,181 @@
+/* -*- 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://dev.w3.org/2011/webrtc/editor/webrtc.html#rtcstatsreport-object
+ * http://www.w3.org/2011/04/webrtc/wiki/Stats
+ */
+
+enum RTCStatsType {
+ "inboundrtp",
+ "outboundrtp",
+ "session",
+ "track",
+ "transport",
+ "candidatepair",
+ "localcandidate",
+ "remotecandidate"
+};
+
+dictionary RTCStats {
+ DOMHighResTimeStamp timestamp;
+ RTCStatsType type;
+ DOMString id;
+};
+
+dictionary RTCRTPStreamStats : RTCStats {
+ DOMString ssrc;
+ DOMString mediaType;
+ DOMString remoteId;
+ boolean isRemote = false;
+ DOMString mediaTrackId;
+ DOMString transportId;
+ DOMString codecId;
+
+ // Video encoder/decoder measurements (absent for rtcp)
+ double bitrateMean;
+ double bitrateStdDev;
+ double framerateMean;
+ double framerateStdDev;
+};
+
+dictionary RTCInboundRTPStreamStats : RTCRTPStreamStats {
+ unsigned long packetsReceived;
+ unsigned long long bytesReceived;
+ double jitter;
+ unsigned long packetsLost;
+ long mozAvSyncDelay;
+ long mozJitterBufferDelay;
+ long mozRtt;
+
+ // Video decoder measurement (absent in rtcp case)
+ unsigned long discardedPackets;
+};
+
+dictionary RTCOutboundRTPStreamStats : RTCRTPStreamStats {
+ unsigned long packetsSent;
+ unsigned long long bytesSent;
+ double targetBitrate; // config encoder bitrate target of this SSRC in bits/s
+
+ // Video encoder measurement (absent in rtcp case)
+ unsigned long droppedFrames;
+};
+
+dictionary RTCMediaStreamTrackStats : RTCStats {
+ DOMString trackIdentifier; // track.id property
+ boolean remoteSource;
+ sequence<DOMString> ssrcIds;
+ // Stuff that makes sense for video
+ unsigned long frameWidth;
+ unsigned long frameHeight;
+ double framesPerSecond; // The nominal FPS value
+ unsigned long framesSent;
+ unsigned long framesReceived; // Only for remoteSource=true
+ unsigned long framesDecoded;
+ unsigned long framesDropped; // See VideoPlaybackQuality.droppedVideoFrames
+ unsigned long framesCorrupted; // as above.
+ // Stuff that makes sense for audio
+ double audioLevel; // linear, 1.0 = 0 dBov (from RFC 6464).
+ // AEC stuff on audio tracks sourced from a microphone where AEC is applied
+ double echoReturnLoss; // in decibels from G.168 (2012) section 3.14
+ double echoReturnLossEnhancement; // as above, section 3.15
+};
+
+dictionary RTCMediaStreamStats : RTCStats {
+ DOMString streamIdentifier; // stream.id property
+ sequence<DOMString> trackIds; // Note: stats object ids, not track.id
+};
+
+dictionary RTCTransportStats: RTCStats {
+ unsigned long bytesSent;
+ unsigned long bytesReceived;
+};
+
+dictionary RTCIceComponentStats : RTCStats {
+ DOMString transportId;
+ long component;
+ unsigned long bytesSent;
+ unsigned long bytesReceived;
+ boolean activeConnection;
+};
+
+enum RTCStatsIceCandidatePairState {
+ "frozen",
+ "waiting",
+ "inprogress",
+ "failed",
+ "succeeded",
+ "cancelled"
+};
+
+dictionary RTCIceCandidatePairStats : RTCStats {
+ DOMString componentId;
+ DOMString localCandidateId;
+ DOMString remoteCandidateId;
+ RTCStatsIceCandidatePairState state;
+ unsigned long long mozPriority;
+ boolean readable;
+ boolean nominated;
+ boolean selected;
+};
+
+enum RTCStatsIceCandidateType {
+ "host",
+ "serverreflexive",
+ "peerreflexive",
+ "relayed"
+};
+
+dictionary RTCIceCandidateStats : RTCStats {
+ DOMString componentId;
+ DOMString candidateId;
+ DOMString ipAddress;
+ DOMString transport;
+ DOMString mozLocalTransport; // needs standardization
+ long portNumber;
+ RTCStatsIceCandidateType candidateType;
+};
+
+dictionary RTCCodecStats : RTCStats {
+ unsigned long payloadType; // As used in RTP encoding.
+ DOMString codec; // video/vp8 or equivalent
+ unsigned long clockRate;
+ unsigned long channels; // 2=stereo, missing for most other cases.
+ DOMString parameters; // From SDP description line
+};
+
+callback RTCStatsReportCallback = void (RTCStatsReport obj);
+
+// This is the internal representation of the report in this implementation
+// to be received from c++
+
+dictionary RTCStatsReportInternal {
+ DOMString pcid = "";
+ sequence<RTCInboundRTPStreamStats> inboundRTPStreamStats;
+ sequence<RTCOutboundRTPStreamStats> outboundRTPStreamStats;
+ sequence<RTCMediaStreamTrackStats> mediaStreamTrackStats;
+ sequence<RTCMediaStreamStats> mediaStreamStats;
+ sequence<RTCTransportStats> transportStats;
+ sequence<RTCIceComponentStats> iceComponentStats;
+ sequence<RTCIceCandidatePairStats> iceCandidatePairStats;
+ sequence<RTCIceCandidateStats> iceCandidateStats;
+ sequence<RTCCodecStats> codecStats;
+ DOMString localSdp;
+ DOMString remoteSdp;
+ DOMHighResTimeStamp timestamp;
+ boolean closed; // Is the PC now closed
+};
+
+[Pref="media.peerconnection.enabled",
+// TODO: Use MapClass here once it's available (Bug 928114)
+// MapClass(DOMString, object)
+ JSImplementation="@mozilla.org/dom/rtcstatsreport;1"]
+interface RTCStatsReport {
+ [ChromeOnly]
+ readonly attribute DOMString mozPcid;
+ void forEach(RTCStatsReportCallback callbackFn, optional any thisArg);
+ object get(DOMString key);
+ boolean has(DOMString key);
+};
diff --git a/dom/webidl/RadioNodeList.webidl b/dom/webidl/RadioNodeList.webidl
new file mode 100644
index 000000000..4e533533a
--- /dev/null
+++ b/dom/webidl/RadioNodeList.webidl
@@ -0,0 +1,16 @@
+/* -*- 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.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#htmlformcontrolscollection-0
+ *
+ * © Copyright 2004-2014 Apple Computer, Inc., Mozilla Foundation, and
+ * Opera Software ASA. You are granted a license to use, reproduce
+ * and create derivative works of this document.
+ */
+
+interface RadioNodeList : NodeList {
+ attribute DOMString value;
+};
diff --git a/dom/webidl/Range.webidl b/dom/webidl/Range.webidl
index 257b36dbd..20b007f8d 100644
--- a/dom/webidl/Range.webidl
+++ b/dom/webidl/Range.webidl
@@ -38,7 +38,7 @@ interface Range {
void setEndBefore(Node refNode);
[Throws]
void setEndAfter(Node refNode);
- void collapse(boolean toStart);
+ void collapse(optional boolean toStart = false);
[Throws]
void selectNode(Node refNode);
[Throws]
@@ -83,6 +83,6 @@ partial interface Range {
// http://dvcs.w3.org/hg/csswg/raw-file/tip/cssom-view/Overview.html#extensions-to-the-range-interface
partial interface Range {
- ClientRectList? getClientRects();
- ClientRect getBoundingClientRect();
+ DOMRectList? getClientRects();
+ DOMRect getBoundingClientRect();
};
diff --git a/dom/webidl/RecordErrorEvent.webidl b/dom/webidl/RecordErrorEvent.webidl
new file mode 100644
index 000000000..c7022dbbe
--- /dev/null
+++ b/dom/webidl/RecordErrorEvent.webidl
@@ -0,0 +1,16 @@
+/* -*- 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/.
+ */
+
+[Constructor(DOMString type, optional RecordErrorEventInit eventInitDict)]
+interface RecordErrorEvent : Event
+{
+ readonly attribute DOMString name;
+};
+
+dictionary RecordErrorEventInit : EventInit
+{
+ DOMString name = "";
+};
diff --git a/dom/webidl/Request.webidl b/dom/webidl/Request.webidl
new file mode 100644
index 000000000..0ca4ff116
--- /dev/null
+++ b/dom/webidl/Request.webidl
@@ -0,0 +1,60 @@
+/* -*- Mode: IDL; tab-width: 1; 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
+ * https://fetch.spec.whatwg.org/#request-class
+ */
+
+typedef (Request or USVString) RequestInfo;
+
+[Constructor(RequestInfo input, optional RequestInit init),
+ Exposed=(Window,Worker),
+ Func="mozilla::dom::Headers::PrefEnabled"]
+interface Request {
+ readonly attribute ByteString method;
+ readonly attribute USVString url;
+ [SameObject] readonly attribute Headers headers;
+
+ readonly attribute RequestContext context;
+ readonly attribute DOMString referrer;
+ readonly attribute RequestMode mode;
+ readonly attribute RequestCredentials credentials;
+ readonly attribute RequestCache cache;
+
+ [Throws,
+ NewObject] Request clone();
+
+ // Bug 1124638 - Allow chrome callers to set the context.
+ [ChromeOnly]
+ void setContext(RequestContext context);
+};
+Request implements Body;
+
+dictionary RequestInit {
+ ByteString method;
+ HeadersInit headers;
+ BodyInit body;
+ RequestMode mode;
+ RequestCredentials credentials;
+ RequestCache cache;
+};
+
+enum RequestContext {
+ "audio", "beacon", "cspreport", "download", "embed", "eventsource", "favicon", "fetch",
+ "font", "form", "frame", "hyperlink", "iframe", "image", "imageset", "import",
+ "internal", "location", "manifest", "object", "ping", "plugin", "prefetch", "script",
+ "serviceworker", "sharedworker", "subresource", "style", "track", "video", "worker",
+ "xmlhttprequest", "xslt"
+};
+
+// cors-with-forced-preflight is internal to the Fetch spec, but adding it here
+// allows us to use the various conversion conveniences offered by the WebIDL
+// codegen. The Request constructor has explicit checks to prevent it being
+// passed as a valid value, while Request.mode never returns it. Since enums
+// are only exposed as strings to client JS, this has the same effect as not
+// exposing it at all.
+enum RequestMode { "same-origin", "no-cors", "cors", "cors-with-forced-preflight" };
+enum RequestCredentials { "omit", "same-origin", "include" };
+enum RequestCache { "default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached" };
diff --git a/dom/webidl/RequestSyncManager.webidl b/dom/webidl/RequestSyncManager.webidl
new file mode 100644
index 000000000..a71aa0d41
--- /dev/null
+++ b/dom/webidl/RequestSyncManager.webidl
@@ -0,0 +1,56 @@
+/* -*- 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/.
+ */
+
+[AvailableIn=CertifiedApps,
+ Pref="dom.requestSync.enabled",
+ CheckPermissions="requestsync-manager",
+ JSImplementation="@mozilla.org/dom/request-sync-task-app;1"]
+interface RequestSyncApp {
+ readonly attribute USVString origin;
+ readonly attribute USVString manifestURL;
+ readonly attribute boolean isInBrowserElement;
+};
+
+enum RequestSyncTaskPolicyState { "enabled", "disabled", "wifiOnly" };
+
+// Like a normal task, but with info about the app.
+[AvailableIn=CertifiedApps,
+ Pref="dom.requestSync.enabled",
+ CheckPermissions="requestsync-manager",
+ JSImplementation="@mozilla.org/dom/request-sync-task-manager;1"]
+interface RequestSyncTask {
+ // This object describes the app that is owning the task.
+ readonly attribute RequestSyncApp app;
+
+ // Using setPolicy it's possible to owerwrite the state and the minInterval.
+ readonly attribute RequestSyncTaskPolicyState state;
+ readonly attribute long overwrittenMinInterval;
+
+ // These attributes are taken from the configuration of the task:
+
+ readonly attribute USVString task;
+ readonly attribute DOMTimeStamp lastSync;
+ readonly attribute USVString wakeUpPage;
+ readonly attribute boolean oneShot;
+ readonly attribute long minInterval;
+ readonly attribute boolean wifiOnly;
+ readonly attribute any data;
+
+ Promise<void> setPolicy(RequestSyncTaskPolicyState aState,
+ optional long ovewrittenMinInterval);
+
+ Promise<void> runNow();
+};
+
+[NavigatorProperty="syncManager",
+ AvailableIn=CertifiedApps,
+ Pref="dom.requestSync.enabled",
+ CheckPermissions="requestsync-manager",
+ JSImplementation="@mozilla.org/dom/request-sync-manager;1"]
+// This interface will be used only by the B2G SystemApp
+interface RequestSyncManager {
+ Promise<sequence<RequestSyncTask>> registrations();
+};
diff --git a/dom/webidl/RequestSyncScheduler.webidl b/dom/webidl/RequestSyncScheduler.webidl
new file mode 100644
index 000000000..1bd33ac12
--- /dev/null
+++ b/dom/webidl/RequestSyncScheduler.webidl
@@ -0,0 +1,38 @@
+/* -*- 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/.
+ */
+
+// This is the dictionary for the creation of a new task.
+dictionary RequestTaskParams {
+ required USVString wakeUpPage;
+ boolean oneShot = true;
+ required long minInterval; // in seconds >= dom.requestSync.minInterval or 100 secs
+ boolean wifiOnly = true;
+ any data = null;
+};
+
+
+// This is the dictionary you can have back from registration{s}().
+dictionary RequestTaskFull : RequestTaskParams {
+ USVString task = "";
+
+ // Last synchonization date.. maybe it's useful to know.
+ DOMTimeStamp lastSync;
+};
+
+[NavigatorProperty="sync",
+ AvailableIn=CertifiedApps,
+ Pref="dom.requestSync.enabled",
+ JSImplementation="@mozilla.org/dom/request-sync-scheduler;1"]
+interface RequestSyncScheduler {
+
+ Promise<void> register(USVString task,
+ optional RequestTaskParams params);
+ Promise<void> unregister(USVString task);
+
+ // Useful methods to get registrations
+ Promise<sequence<RequestTaskFull>> registrations();
+ Promise<RequestTaskFull> registration(USVString task);
+};
diff --git a/dom/webidl/ResourceStats.webidl b/dom/webidl/ResourceStats.webidl
new file mode 100644
index 000000000..b356a3eec
--- /dev/null
+++ b/dom/webidl/ResourceStats.webidl
@@ -0,0 +1,68 @@
+/* -*- 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/.
+ */
+
+[CheckPermissions="resourcestats-manage",
+ Pref="dom.resource_stats.enabled",
+ AvailableIn="CertifiedApps",
+ JSImplementation="@mozilla.org/networkStatsData;1"]
+interface NetworkStatsData
+{
+ readonly attribute unsigned long long receivedBytes;
+ readonly attribute unsigned long long sentBytes;
+ readonly attribute DOMTimeStamp timestamp; // timestamp of the record
+};
+
+[CheckPermissions="resourcestats-manage",
+ Pref="dom.resource_stats.enabled",
+ AvailableIn="CertifiedApps",
+ JSImplementation="@mozilla.org/powerStatsData;1"]
+interface PowerStatsData
+{
+ readonly attribute unsigned long long consumedPower; // unit: mW
+ readonly attribute DOMTimeStamp timestamp; // timestamp of the record
+};
+
+[CheckPermissions="resourcestats-manage",
+ Pref="dom.resource_stats.enabled",
+ AvailableIn="CertifiedApps",
+ JSImplementation="@mozilla.org/resourceStats;1"]
+interface ResourceStats
+{
+ /**
+ * Type of statistics/
+ */
+ readonly attribute ResourceType type;
+
+ /**
+ * The |component| specifies statistics belongs to. This will be null if
+ * the ResourceStatsOptions.component argument passed to getStats() is null.
+ */
+ readonly attribute DOMString? component;
+
+ /**
+ * |serviceType| specifies the system service. This will be null if the
+ * ResourceStatsOptions.serviceType argument passed to getStats() is null.
+ */
+ readonly attribute SystemService? serviceType;
+
+ /**
+ * |manifestURL| specifies the manifestURL of an application. This will be
+ * null if the ResourceStatsOptions.manifestURL argument passed to getStats()
+ * is null.
+ */
+ readonly attribute DOMString? manifestURL;
+
+ /**
+ * Statistics, one element per day
+ */
+ sequence<(NetworkStatsData or PowerStatsData)> getData();
+
+ /**
+ * Date range
+ */
+ readonly attribute DOMTimeStamp start; // start timestamp
+ readonly attribute DOMTimeStamp end; // end timestamp
+};
diff --git a/dom/webidl/ResourceStatsManager.webidl b/dom/webidl/ResourceStatsManager.webidl
new file mode 100644
index 000000000..dfb59ea47
--- /dev/null
+++ b/dom/webidl/ResourceStatsManager.webidl
@@ -0,0 +1,228 @@
+/* -*- 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/.
+ */
+
+/**
+ * Supported resource statistics
+ */
+enum ResourceType {
+ "network",
+ "power"
+};
+
+/**
+ * List of system services supporting resource statistics
+ */
+enum SystemService {
+ "ota",
+ "tethering"
+};
+
+dictionary ResourceStatsOptions
+{
+ /**
+ * |component| specifies which component's resource usage will be returned.
+ * If null or undefined, sum of all components' usage is returned.
+ *
+ * |component| is expressed in "<component>:<id>", where <component> is the
+ * name of the component and <id> is used to identify different entities.
+ *
+ * The <id> field is mainly used in specifying the identity of different SIMs
+ * when quering mobile network usage, e.g. "mobile:<iccid>".
+ *
+ * Quering statistics of other components should specify the |component| to
+ * "<component>:0", such as "cpu:0" or "wifi:0".
+ */
+ DOMString? component = null;
+
+ /**
+ * |manifestURL| specifies the manifestURL of an application.
+ * |systemService| specifies the system service.
+ *
+ * If both |systemService| and |manifestURL| are null or undefined, then a
+ * system-wide resource statistics is returned.
+ *
+ * If |manifestURL| is specified, then the resource statistics of the
+ * specified application is returned.
+ *
+ * If |systemService| is specified, then the resource statistics of the
+ * specified system service is returned.
+ *
+ * If |systemService| and |manifestURL| are both specified, then the return
+ * statistics indicates the resources that the system service consumed for
+ * the application.
+ */
+ SystemService? serviceType = null;
+ DOMString? manifestURL = null;
+};
+
+dictionary ResourceStatsAlarmOptions
+{
+ /**
+ * |startTime| indicates the start time of counting the resource usage.
+ *
+ * |data| is used to reflect in the alarm object when the alarm is triggered.
+ * |data| should be copied using the structured clone algorithm.
+ */
+ [EnforceRange] DOMTimeStamp startTime; // time in milliseconds since Epoch
+ any data;
+};
+
+[CheckPermissions="resourcestats-manage",
+ Pref="dom.resource_stats.enabled",
+ AvailableIn="CertifiedApps",
+ JSImplementation="@mozilla.org/resourceStatsAlarm;1"]
+interface ResourceStatsAlarm
+{
+ /**
+ * ID of the alarm
+ */
+ readonly attribute unsigned long alarmId;
+
+ /**
+ * Type of resource this alarm monitor
+ */
+ readonly attribute ResourceType type;
+
+ /**
+ * The target component this alarm monitor.
+ */
+ readonly attribute DOMString? component;
+
+ /**
+ * |manifestURL| specifies the manifestURL of an application.
+ * |systemService| specifies the system service.
+ *
+ * Both attributes are null means that this alarm monitors a system-wide
+ * resource usage.
+ */
+ readonly attribute SystemService? serviceType;
+ readonly attribute DOMString? manifestURL;
+
+ /**
+ * |threshold| specifies the limit of resource usage.
+ */
+ readonly attribute unsigned long long threshold;
+
+ /**
+ * |data| is used to reflect in the alarm object when the alarm is triggered.
+ */
+ readonly attribute any data;
+};
+
+[CheckPermissions="resourcestats-manage",
+ Pref="dom.resource_stats.enabled",
+ Constructor(ResourceType type),
+ AvailableIn="CertifiedApps",
+ JSImplementation="@mozilla.org/resourceStatsManager;1"]
+interface ResourceStatsManager
+{
+ /**
+ * Query resource statistics.
+ *
+ * |statsOptions| specifies the detail of statistics of interest.
+ *
+ * |start| and |end| specifies the time range of interest, both included.
+ * If |start| is null or undefined, retrieve the stats since measurements.
+ * If |end| is null or undefined. retrieve the stats until the current time.
+ *
+ * If success, the fulfillment value is a ResourceStats object.
+ */
+ Promise<ResourceStats> getStats(optional ResourceStatsOptions statsOptions,
+ [EnforceRange] optional DOMTimeStamp? start = null,
+ [EnforceRange] optional DOMTimeStamp? end = null);
+
+ /**
+ * Clear resource statistics stored in database.
+ *
+ * |statsOptions| specifies the detail of statistics to delete.
+ *
+ * |start| and |end| specifies the time range of interest, both included.
+ * If |start| is null or undefined, delete the stats since measurements.
+ * If |end| is null or undefined. delete the stats until the current time.
+ */
+ // XXXbz What is this promise resolved with?
+ Promise<any> clearStats(optional ResourceStatsOptions statsOptions,
+ [EnforceRange] optional DOMTimeStamp? start = null,
+ [EnforceRange] optional DOMTimeStamp? end = null);
+
+ /**
+ * Clear all resource statistics stored in database.
+ */
+ // XXXbz What is this promise resolved with?
+ Promise<any> clearAllStats();
+
+ /**
+ * Install an alarm to monitor resource usage.
+ *
+ * The |threshold| specifies the limit of resource usage. When resource
+ * usage reaches the threshold, a "resourceStats-alarm" system message
+ * is sent to the application.
+ *
+ * |statsOptions| specifies the detail of statistics of interest.
+ *
+ * |alarmOptions| is a ResourceStatsAlarmOptions object.
+ *
+ * If success, the fulfillment value is an alarm ID.
+ */
+ Promise<unsigned long> addAlarm([EnforceRange] unsigned long long threshold,
+ optional ResourceStatsOptions statsOptions,
+ optional ResourceStatsAlarmOptions alarmOptions);
+
+ /**
+ * Obtain alarms.
+ *
+ * If |statsOptions| is provided, then only the alarms monitoring that
+ * resource are returned. Otherwise, all alarms set for this resource type
+ * is returned.
+ *
+ * If success, the fulfillment value is an array of ResourceStatsAlarm.
+ */
+ Promise<sequence<ResourceStatsAlarm>> getAlarms(optional ResourceStatsOptions statsOptions);
+
+ /**
+ * Remove the specified alarm.
+ *
+ * |alarmId| specifies the alarm to be removed.
+ */
+ // XXXbz What is this promise resolved with?
+ Promise<any> removeAlarm([EnforceRange] unsigned long alarmId);
+
+ /**
+ * Remove all alarms.
+ */
+ // XXXbz What is this promise resolved with?
+ Promise<any> removeAllAlarms();
+
+ /**
+ * Enumerate components that have stored statistics in database.
+ *
+ * If success, the fulfillment value is an array of DOMString.
+ */
+ Promise<sequence<DOMString>> getAvailableComponents();
+
+ /**
+ * Return supporting resource statistics, i.e. ["Network", "Power"]
+ *
+ * This should be specified as static attribute after Bug 863952 is resolved.
+ */
+ [Cached, Pure]
+ readonly attribute sequence<DOMString> resourceTypes;
+
+ /**
+ * Time in milliseconds between statistics stored in database.
+ *
+ * This should be specified as static attribute after Bug 863952 is resolved.
+ */
+ readonly attribute unsigned long sampleRate;
+
+ /**
+ * Time in milliseconds recorded by the API until present time. All
+ * statistics older than maxStorageAge from now are deleted.
+ *
+ * This should be specified as static attribute after Bug 863952 is resolved.
+ */
+ readonly attribute unsigned long long maxStorageAge;
+};
diff --git a/dom/webidl/Response.webidl b/dom/webidl/Response.webidl
new file mode 100644
index 000000000..fb6b5cc74
--- /dev/null
+++ b/dom/webidl/Response.webidl
@@ -0,0 +1,40 @@
+/* -*- 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
+ * https://fetch.spec.whatwg.org/#response-class
+ */
+
+[Constructor(optional BodyInit body, optional ResponseInit init),
+ Exposed=(Window,Worker),
+ Func="mozilla::dom::Headers::PrefEnabled"]
+interface Response {
+ [NewObject] static Response error();
+ [Throws,
+ NewObject] static Response redirect(USVString url, optional unsigned short status = 302);
+
+ readonly attribute ResponseType type;
+
+ readonly attribute USVString url;
+ [Throws]
+ attribute boolean finalURL;
+ readonly attribute unsigned short status;
+ readonly attribute boolean ok;
+ readonly attribute ByteString statusText;
+ [SameObject] readonly attribute Headers headers;
+
+ [Throws,
+ NewObject] Response clone();
+};
+Response implements Body;
+
+dictionary ResponseInit {
+ unsigned short status = 200;
+ // WebIDL spec doesn't allow default values for ByteString.
+ ByteString statusText;
+ HeadersInit headers;
+};
+
+enum ResponseType { "basic", "cors", "default", "error", "opaque" };
diff --git a/dom/webidl/SVGAnimatedEnumeration.webidl b/dom/webidl/SVGAnimatedEnumeration.webidl
new file mode 100644
index 000000000..80591c2f1
--- /dev/null
+++ b/dom/webidl/SVGAnimatedEnumeration.webidl
@@ -0,0 +1,17 @@
+/* -*- 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
+ * https://svgwg.org/svg2-draft/types.html#InterfaceSVGAnimatedEnumeration
+ *
+ * Copyright © 2013 W3C® (MIT, ERCIM, Keio, Beihang), All Rights Reserved.
+ * W3C liability, trademark and document use rules apply.
+ */
+
+interface SVGAnimatedEnumeration {
+ [SetterThrows]
+ attribute unsigned short baseVal;
+ readonly attribute unsigned short animVal;
+};
diff --git a/dom/webidl/SVGAnimatedInteger.webidl b/dom/webidl/SVGAnimatedInteger.webidl
new file mode 100644
index 000000000..61b43b351
--- /dev/null
+++ b/dom/webidl/SVGAnimatedInteger.webidl
@@ -0,0 +1,16 @@
+/* -*- 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
+ * https://svgwg.org/svg2-draft/types.html#InterfaceSVGAnimatedInteger
+ *
+ * Copyright © 2013 W3C® (MIT, ERCIM, Keio, Beihang), All Rights Reserved.
+ * W3C liability, trademark and document use rules apply.
+ */
+
+interface SVGAnimatedInteger {
+ attribute long baseVal;
+ readonly attribute long animVal;
+};
diff --git a/dom/webidl/SVGAnimatedLength.webidl b/dom/webidl/SVGAnimatedLength.webidl
index 223ccec3f..f7fac144d 100644
--- a/dom/webidl/SVGAnimatedLength.webidl
+++ b/dom/webidl/SVGAnimatedLength.webidl
@@ -10,8 +10,6 @@
* liability, trademark and document use rules apply.
*/
-interface SVGLength;
-
interface SVGAnimatedLength {
[Constant]
readonly attribute SVGLength baseVal;
diff --git a/dom/webidl/SVGAnimatedNumber.webidl b/dom/webidl/SVGAnimatedNumber.webidl
new file mode 100644
index 000000000..5908f0f86
--- /dev/null
+++ b/dom/webidl/SVGAnimatedNumber.webidl
@@ -0,0 +1,16 @@
+/* -*- 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
+ * https://svgwg.org/svg2-draft/types.html#InterfaceSVGAnimatedNumber
+ *
+ * Copyright © 2013 W3C® (MIT, ERCIM, Keio, Beihang), All Rights Reserved.
+ * W3C liability, trademark and document use rules apply.
+ */
+
+interface SVGAnimatedNumber {
+ attribute float baseVal;
+ readonly attribute float animVal;
+};
diff --git a/dom/webidl/SVGClipPathElement.webidl b/dom/webidl/SVGClipPathElement.webidl
index aba8f52fb..76a95c633 100644
--- a/dom/webidl/SVGClipPathElement.webidl
+++ b/dom/webidl/SVGClipPathElement.webidl
@@ -10,10 +10,10 @@
* liability, trademark and document use rules apply.
*/
-interface SVGAnimatedEnumeration;
-
interface SVGClipPathElement : SVGElement {
+ [Constant]
readonly attribute SVGAnimatedEnumeration clipPathUnits;
+ [Constant]
readonly attribute SVGAnimatedTransformList transform;
};
diff --git a/dom/webidl/SVGComponentTransferFunctionElement.webidl b/dom/webidl/SVGComponentTransferFunctionElement.webidl
index 2da8261b7..1842fe6f5 100644
--- a/dom/webidl/SVGComponentTransferFunctionElement.webidl
+++ b/dom/webidl/SVGComponentTransferFunctionElement.webidl
@@ -19,11 +19,18 @@ interface SVGComponentTransferFunctionElement : SVGElement {
const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_LINEAR = 4;
const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_GAMMA = 5;
+ [Constant]
readonly attribute SVGAnimatedEnumeration type;
+ [Constant]
readonly attribute SVGAnimatedNumberList tableValues;
+ [Constant]
readonly attribute SVGAnimatedNumber slope;
+ [Constant]
readonly attribute SVGAnimatedNumber intercept;
+ [Constant]
readonly attribute SVGAnimatedNumber amplitude;
+ [Constant]
readonly attribute SVGAnimatedNumber exponent;
+ [Constant]
readonly attribute SVGAnimatedNumber offset;
};
diff --git a/dom/webidl/SVGDocument.webidl b/dom/webidl/SVGDocument.webidl
index 67235e607..add04a6b3 100644
--- a/dom/webidl/SVGDocument.webidl
+++ b/dom/webidl/SVGDocument.webidl
@@ -10,6 +10,6 @@
interface SVGDocument : Document {
[Throws]
readonly attribute DOMString domain;
- [Throws]
+ [Pure, Throws]
readonly attribute SVGElement? rootElement;
};
diff --git a/dom/webidl/SVGElement.webidl b/dom/webidl/SVGElement.webidl
index 9243744e9..a7d8267a1 100644
--- a/dom/webidl/SVGElement.webidl
+++ b/dom/webidl/SVGElement.webidl
@@ -12,34 +12,20 @@
interface SVGElement : Element {
attribute DOMString id;
-/* [SetterThrows]
- attribute DOMString xmlbase; */
+ [Constant]
readonly attribute SVGAnimatedString className;
[PutForwards=cssText, Constant]
readonly attribute CSSStyleDeclaration style;
- // The CSSValue interface has been deprecated by the CSS WG.
- // http://lists.w3.org/Archives/Public/www-style/2003Oct/0347.html
- // CSSValue? getPresentationAttribute(DOMString name);
-
- /*[SetterThrows]
- attribute DOMString xmllang;
- [SetterThrows]
- attribute DOMString xmlspace;*/
-
- [Throws]
readonly attribute SVGSVGElement? ownerSVGElement;
readonly attribute SVGElement? viewportElement;
- [SetterThrows]
attribute EventHandler oncopy;
- [SetterThrows]
attribute EventHandler oncut;
- [SetterThrows]
attribute EventHandler onpaste;
};
SVGElement implements GlobalEventHandlers;
-SVGElement implements NodeEventHandlers;
SVGElement implements TouchEventHandlers;
+SVGElement implements OnErrorEventHandlerForNodes;
diff --git a/dom/webidl/SVGFEBlendElement.webidl b/dom/webidl/SVGFEBlendElement.webidl
index bf65478ef..5cd469bd5 100644
--- a/dom/webidl/SVGFEBlendElement.webidl
+++ b/dom/webidl/SVGFEBlendElement.webidl
@@ -10,8 +10,6 @@
* liability, trademark and document use rules apply.
*/
-interface SVGAnimatedEnumeration;
-
interface SVGFEBlendElement : SVGElement {
// Blend Mode Types
@@ -21,9 +19,22 @@ interface SVGFEBlendElement : SVGElement {
const unsigned short SVG_FEBLEND_MODE_SCREEN = 3;
const unsigned short SVG_FEBLEND_MODE_DARKEN = 4;
const unsigned short SVG_FEBLEND_MODE_LIGHTEN = 5;
-
+ const unsigned short SVG_FEBLEND_MODE_OVERLAY = 6;
+ const unsigned short SVG_FEBLEND_MODE_COLOR_DODGE = 7;
+ const unsigned short SVG_FEBLEND_MODE_COLOR_BURN = 8;
+ const unsigned short SVG_FEBLEND_MODE_HARD_LIGHT = 9;
+ const unsigned short SVG_FEBLEND_MODE_SOFT_LIGHT = 10;
+ const unsigned short SVG_FEBLEND_MODE_DIFFERENCE = 11;
+ const unsigned short SVG_FEBLEND_MODE_EXCLUSION = 12;
+ const unsigned short SVG_FEBLEND_MODE_HUE = 13;
+ const unsigned short SVG_FEBLEND_MODE_SATURATION = 14;
+ const unsigned short SVG_FEBLEND_MODE_COLOR = 15;
+ const unsigned short SVG_FEBLEND_MODE_LUMINOSITY = 16;
+ [Constant]
readonly attribute SVGAnimatedString in1;
+ [Constant]
readonly attribute SVGAnimatedString in2;
+ [Constant]
readonly attribute SVGAnimatedEnumeration mode;
};
diff --git a/dom/webidl/SVGFEColorMatrixElement.webidl b/dom/webidl/SVGFEColorMatrixElement.webidl
index 717e36d89..61d91040d 100644
--- a/dom/webidl/SVGFEColorMatrixElement.webidl
+++ b/dom/webidl/SVGFEColorMatrixElement.webidl
@@ -10,8 +10,6 @@
* liability, trademark and document use rules apply.
*/
-interface SVGAnimatedEnumeration;
-
interface SVGFEColorMatrixElement : SVGElement {
// Color Matrix Types
@@ -21,8 +19,11 @@ interface SVGFEColorMatrixElement : SVGElement {
const unsigned short SVG_FECOLORMATRIX_TYPE_HUEROTATE = 3;
const unsigned short SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA = 4;
+ [Constant]
readonly attribute SVGAnimatedString in1;
+ [Constant]
readonly attribute SVGAnimatedEnumeration type;
+ [Constant]
readonly attribute SVGAnimatedNumberList values;
};
diff --git a/dom/webidl/SVGFEComponentTransferElement.webidl b/dom/webidl/SVGFEComponentTransferElement.webidl
index 8a774f447..6cf6f6d65 100644
--- a/dom/webidl/SVGFEComponentTransferElement.webidl
+++ b/dom/webidl/SVGFEComponentTransferElement.webidl
@@ -11,5 +11,8 @@
*/
interface SVGFEComponentTransferElement : SVGElement {
+ [Constant]
readonly attribute SVGAnimatedString in1;
};
+
+SVGFEComponentTransferElement implements SVGFilterPrimitiveStandardAttributes;
diff --git a/dom/webidl/SVGFECompositeElement.webidl b/dom/webidl/SVGFECompositeElement.webidl
index 1d9d0f473..3ab983fe0 100644
--- a/dom/webidl/SVGFECompositeElement.webidl
+++ b/dom/webidl/SVGFECompositeElement.webidl
@@ -10,9 +10,6 @@
* liability, trademark and document use rules apply.
*/
-interface SVGAnimatedEnumeration;
-interface SVGAnimatedNumber;
-
interface SVGFECompositeElement : SVGElement {
// Composite Operators
@@ -24,12 +21,19 @@ interface SVGFECompositeElement : SVGElement {
const unsigned short SVG_FECOMPOSITE_OPERATOR_XOR = 5;
const unsigned short SVG_FECOMPOSITE_OPERATOR_ARITHMETIC = 6;
+ [Constant]
readonly attribute SVGAnimatedString in1;
+ [Constant]
readonly attribute SVGAnimatedString in2;
+ [Constant]
readonly attribute SVGAnimatedEnumeration operator;
+ [Constant]
readonly attribute SVGAnimatedNumber k1;
+ [Constant]
readonly attribute SVGAnimatedNumber k2;
+ [Constant]
readonly attribute SVGAnimatedNumber k3;
+ [Constant]
readonly attribute SVGAnimatedNumber k4;
};
diff --git a/dom/webidl/SVGFEConvolveMatrixElement.webidl b/dom/webidl/SVGFEConvolveMatrixElement.webidl
index ad45fc9f1..27d8e80e7 100644
--- a/dom/webidl/SVGFEConvolveMatrixElement.webidl
+++ b/dom/webidl/SVGFEConvolveMatrixElement.webidl
@@ -10,9 +10,6 @@
* liability, trademark and document use rules apply.
*/
-interface SVGAnimatedEnumeration;
-interface SVGAnimatedNumber;
-
interface SVGFEConvolveMatrixElement : SVGElement {
// Edge Mode Values
@@ -21,17 +18,29 @@ interface SVGFEConvolveMatrixElement : SVGElement {
const unsigned short SVG_EDGEMODE_WRAP = 2;
const unsigned short SVG_EDGEMODE_NONE = 3;
+ [Constant]
readonly attribute SVGAnimatedString in1;
+ [Constant]
readonly attribute SVGAnimatedInteger orderX;
+ [Constant]
readonly attribute SVGAnimatedInteger orderY;
+ [Constant]
readonly attribute SVGAnimatedNumberList kernelMatrix;
+ [Constant]
readonly attribute SVGAnimatedNumber divisor;
+ [Constant]
readonly attribute SVGAnimatedNumber bias;
+ [Constant]
readonly attribute SVGAnimatedInteger targetX;
+ [Constant]
readonly attribute SVGAnimatedInteger targetY;
+ [Constant]
readonly attribute SVGAnimatedEnumeration edgeMode;
+ [Constant]
readonly attribute SVGAnimatedNumber kernelUnitLengthX;
+ [Constant]
readonly attribute SVGAnimatedNumber kernelUnitLengthY;
+ [Constant]
readonly attribute SVGAnimatedBoolean preserveAlpha;
};
diff --git a/dom/webidl/SVGFEDiffuseLightingElement.webidl b/dom/webidl/SVGFEDiffuseLightingElement.webidl
index 176950c3a..fb89721d8 100644
--- a/dom/webidl/SVGFEDiffuseLightingElement.webidl
+++ b/dom/webidl/SVGFEDiffuseLightingElement.webidl
@@ -10,13 +10,16 @@
* liability, trademark and document use rules apply.
*/
-interface SVGAnimatedNumber;
-
interface SVGFEDiffuseLightingElement : SVGElement {
+ [Constant]
readonly attribute SVGAnimatedString in1;
+ [Constant]
readonly attribute SVGAnimatedNumber surfaceScale;
+ [Constant]
readonly attribute SVGAnimatedNumber diffuseConstant;
+ [Constant]
readonly attribute SVGAnimatedNumber kernelUnitLengthX;
+ [Constant]
readonly attribute SVGAnimatedNumber kernelUnitLengthY;
};
diff --git a/dom/webidl/SVGFEDisplacementMapElement.webidl b/dom/webidl/SVGFEDisplacementMapElement.webidl
index ae2353eb1..461faff91 100644
--- a/dom/webidl/SVGFEDisplacementMapElement.webidl
+++ b/dom/webidl/SVGFEDisplacementMapElement.webidl
@@ -10,9 +10,6 @@
* liability, trademark and document use rules apply.
*/
-interface SVGAnimatedEnumeration;
-interface SVGAnimatedNumber;
-
interface SVGFEDisplacementMapElement : SVGElement {
// Channel Selectors
@@ -22,10 +19,15 @@ interface SVGFEDisplacementMapElement : SVGElement {
const unsigned short SVG_CHANNEL_B = 3;
const unsigned short SVG_CHANNEL_A = 4;
+ [Constant]
readonly attribute SVGAnimatedString in1;
+ [Constant]
readonly attribute SVGAnimatedString in2;
+ [Constant]
readonly attribute SVGAnimatedNumber scale;
+ [Constant]
readonly attribute SVGAnimatedEnumeration xChannelSelector;
+ [Constant]
readonly attribute SVGAnimatedEnumeration yChannelSelector;
};
diff --git a/dom/webidl/SVGFEDistantLightElement.webidl b/dom/webidl/SVGFEDistantLightElement.webidl
index 9a1f881d6..933befc93 100644
--- a/dom/webidl/SVGFEDistantLightElement.webidl
+++ b/dom/webidl/SVGFEDistantLightElement.webidl
@@ -10,9 +10,9 @@
* liability, trademark and document use rules apply.
*/
-interface SVGAnimatedNumber;
-
interface SVGFEDistantLightElement : SVGElement {
+ [Constant]
readonly attribute SVGAnimatedNumber azimuth;
+ [Constant]
readonly attribute SVGAnimatedNumber elevation;
};
diff --git a/dom/webidl/SVGFEDropShadowElement.webidl b/dom/webidl/SVGFEDropShadowElement.webidl
new file mode 100644
index 000000000..b858fc91c
--- /dev/null
+++ b/dom/webidl/SVGFEDropShadowElement.webidl
@@ -0,0 +1,28 @@
+/* -*- 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/SVG2/
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+interface SVGFEDropShadowElement : SVGElement {
+ [Constant]
+ readonly attribute SVGAnimatedString in1;
+ [Constant]
+ readonly attribute SVGAnimatedNumber dx;
+ [Constant]
+ readonly attribute SVGAnimatedNumber dy;
+ [Constant]
+ readonly attribute SVGAnimatedNumber stdDeviationX;
+ [Constant]
+ readonly attribute SVGAnimatedNumber stdDeviationY;
+
+ void setStdDeviation(float stdDeviationX, float stdDeviationY);
+};
+
+SVGFEDropShadowElement implements SVGFilterPrimitiveStandardAttributes;
diff --git a/dom/webidl/SVGFEFloodElement.webidl b/dom/webidl/SVGFEFloodElement.webidl
index 838ea5d0a..51d9539ff 100644
--- a/dom/webidl/SVGFEFloodElement.webidl
+++ b/dom/webidl/SVGFEFloodElement.webidl
@@ -13,4 +13,4 @@
interface SVGFEFloodElement : SVGElement {
};
-SVGFEMergeElement implements SVGFilterPrimitiveStandardAttributes;
+SVGFEFloodElement implements SVGFilterPrimitiveStandardAttributes;
diff --git a/dom/webidl/SVGFEGaussianBlurElement.webidl b/dom/webidl/SVGFEGaussianBlurElement.webidl
index dfd932ed3..db2101b53 100644
--- a/dom/webidl/SVGFEGaussianBlurElement.webidl
+++ b/dom/webidl/SVGFEGaussianBlurElement.webidl
@@ -10,12 +10,15 @@
* liability, trademark and document use rules apply.
*/
-interface SVGAnimatedNumber;
-
interface SVGFEGaussianBlurElement : SVGElement {
+ [Constant]
readonly attribute SVGAnimatedString in1;
+ [Constant]
readonly attribute SVGAnimatedNumber stdDeviationX;
+ [Constant]
readonly attribute SVGAnimatedNumber stdDeviationY;
void setStdDeviation(float stdDeviationX, float stdDeviationY);
};
+
+SVGFEGaussianBlurElement implements SVGFilterPrimitiveStandardAttributes;
diff --git a/dom/webidl/SVGFEImageElement.webidl b/dom/webidl/SVGFEImageElement.webidl
index d691863e4..3262c0d8a 100644
--- a/dom/webidl/SVGFEImageElement.webidl
+++ b/dom/webidl/SVGFEImageElement.webidl
@@ -11,6 +11,7 @@
*/
interface SVGFEImageElement : SVGElement {
+ [Constant]
readonly attribute SVGAnimatedPreserveAspectRatio preserveAspectRatio;
};
diff --git a/dom/webidl/SVGFEMergeNodeElement.webidl b/dom/webidl/SVGFEMergeNodeElement.webidl
index bec3e5931..4ff217ba7 100644
--- a/dom/webidl/SVGFEMergeNodeElement.webidl
+++ b/dom/webidl/SVGFEMergeNodeElement.webidl
@@ -11,5 +11,6 @@
*/
interface SVGFEMergeNodeElement : SVGElement {
+ [Constant]
readonly attribute SVGAnimatedString in1;
};
diff --git a/dom/webidl/SVGFEMorphologyElement.webidl b/dom/webidl/SVGFEMorphologyElement.webidl
index 2928c41a3..82910a6fa 100644
--- a/dom/webidl/SVGFEMorphologyElement.webidl
+++ b/dom/webidl/SVGFEMorphologyElement.webidl
@@ -10,9 +10,6 @@
* liability, trademark and document use rules apply.
*/
-interface SVGAnimatedEnumeration;
-interface SVGAnimatedNumber;
-
interface SVGFEMorphologyElement : SVGElement {
// Morphology Operators
@@ -20,9 +17,13 @@ interface SVGFEMorphologyElement : SVGElement {
const unsigned short SVG_MORPHOLOGY_OPERATOR_ERODE = 1;
const unsigned short SVG_MORPHOLOGY_OPERATOR_DILATE = 2;
+ [Constant]
readonly attribute SVGAnimatedString in1;
+ [Constant]
readonly attribute SVGAnimatedEnumeration operator;
+ [Constant]
readonly attribute SVGAnimatedNumber radiusX;
+ [Constant]
readonly attribute SVGAnimatedNumber radiusY;
};
diff --git a/dom/webidl/SVGFEOffsetElement.webidl b/dom/webidl/SVGFEOffsetElement.webidl
index 039cf5c86..90132d528 100644
--- a/dom/webidl/SVGFEOffsetElement.webidl
+++ b/dom/webidl/SVGFEOffsetElement.webidl
@@ -10,11 +10,12 @@
* liability, trademark and document use rules apply.
*/
-interface SVGAnimatedNumber;
-
interface SVGFEOffsetElement : SVGElement {
+ [Constant]
readonly attribute SVGAnimatedString in1;
+ [Constant]
readonly attribute SVGAnimatedNumber dx;
+ [Constant]
readonly attribute SVGAnimatedNumber dy;
};
diff --git a/dom/webidl/SVGFEPointLightElement.webidl b/dom/webidl/SVGFEPointLightElement.webidl
index 1f1c8a52a..232edc45d 100644
--- a/dom/webidl/SVGFEPointLightElement.webidl
+++ b/dom/webidl/SVGFEPointLightElement.webidl
@@ -10,10 +10,11 @@
* liability, trademark and document use rules apply.
*/
-interface SVGAnimatedNumber;
-
interface SVGFEPointLightElement : SVGElement {
+ [Constant]
readonly attribute SVGAnimatedNumber x;
+ [Constant]
readonly attribute SVGAnimatedNumber y;
+ [Constant]
readonly attribute SVGAnimatedNumber z;
};
diff --git a/dom/webidl/SVGFESpecularLightingElement.webidl b/dom/webidl/SVGFESpecularLightingElement.webidl
index 4f885dc8a..42b6b0e9c 100644
--- a/dom/webidl/SVGFESpecularLightingElement.webidl
+++ b/dom/webidl/SVGFESpecularLightingElement.webidl
@@ -10,14 +10,18 @@
* liability, trademark and document use rules apply.
*/
-interface SVGAnimatedNumber;
-
interface SVGFESpecularLightingElement : SVGElement {
+ [Constant]
readonly attribute SVGAnimatedString in1;
+ [Constant]
readonly attribute SVGAnimatedNumber surfaceScale;
+ [Constant]
readonly attribute SVGAnimatedNumber specularConstant;
+ [Constant]
readonly attribute SVGAnimatedNumber specularExponent;
+ [Constant]
readonly attribute SVGAnimatedNumber kernelUnitLengthX;
+ [Constant]
readonly attribute SVGAnimatedNumber kernelUnitLengthY;
};
diff --git a/dom/webidl/SVGFESpotLightElement.webidl b/dom/webidl/SVGFESpotLightElement.webidl
index 9676036f3..281d20c8c 100644
--- a/dom/webidl/SVGFESpotLightElement.webidl
+++ b/dom/webidl/SVGFESpotLightElement.webidl
@@ -10,15 +10,21 @@
* liability, trademark and document use rules apply.
*/
-interface SVGAnimatedNumber;
-
interface SVGFESpotLightElement : SVGElement {
+ [Constant]
readonly attribute SVGAnimatedNumber x;
+ [Constant]
readonly attribute SVGAnimatedNumber y;
+ [Constant]
readonly attribute SVGAnimatedNumber z;
+ [Constant]
readonly attribute SVGAnimatedNumber pointsAtX;
+ [Constant]
readonly attribute SVGAnimatedNumber pointsAtY;
+ [Constant]
readonly attribute SVGAnimatedNumber pointsAtZ;
+ [Constant]
readonly attribute SVGAnimatedNumber specularExponent;
+ [Constant]
readonly attribute SVGAnimatedNumber limitingConeAngle;
};
diff --git a/dom/webidl/SVGFETileElement.webidl b/dom/webidl/SVGFETileElement.webidl
index d414279bd..38cad6040 100644
--- a/dom/webidl/SVGFETileElement.webidl
+++ b/dom/webidl/SVGFETileElement.webidl
@@ -11,6 +11,7 @@
*/
interface SVGFETileElement : SVGElement {
+ [Constant]
readonly attribute SVGAnimatedString in1;
};
diff --git a/dom/webidl/SVGFETurbulenceElement.webidl b/dom/webidl/SVGFETurbulenceElement.webidl
index 521286908..45c9d468b 100644
--- a/dom/webidl/SVGFETurbulenceElement.webidl
+++ b/dom/webidl/SVGFETurbulenceElement.webidl
@@ -10,10 +10,6 @@
* liability, trademark and document use rules apply.
*/
-interface SVGAnimatedEnumeration;
-interface SVGAnimatedInteger;
-interface SVGAnimatedNumber;
-
interface SVGFETurbulenceElement : SVGElement {
// Turbulence Types
@@ -26,11 +22,17 @@ interface SVGFETurbulenceElement : SVGElement {
const unsigned short SVG_STITCHTYPE_STITCH = 1;
const unsigned short SVG_STITCHTYPE_NOSTITCH = 2;
+ [Constant]
readonly attribute SVGAnimatedNumber baseFrequencyX;
+ [Constant]
readonly attribute SVGAnimatedNumber baseFrequencyY;
+ [Constant]
readonly attribute SVGAnimatedInteger numOctaves;
+ [Constant]
readonly attribute SVGAnimatedNumber seed;
+ [Constant]
readonly attribute SVGAnimatedEnumeration stitchTiles;
+ [Constant]
readonly attribute SVGAnimatedEnumeration type;
};
diff --git a/dom/webidl/SVGFilterElement.webidl b/dom/webidl/SVGFilterElement.webidl
index fee239ec6..cffd59ab2 100644
--- a/dom/webidl/SVGFilterElement.webidl
+++ b/dom/webidl/SVGFilterElement.webidl
@@ -10,20 +10,20 @@
* liability, trademark and document use rules apply.
*/
-interface SVGAnimatedEnumeration;
-interface SVGAnimatedInteger;
-
interface SVGFilterElement : SVGElement {
+ [Constant]
readonly attribute SVGAnimatedEnumeration filterUnits;
+ [Constant]
readonly attribute SVGAnimatedEnumeration primitiveUnits;
+ [Constant]
readonly attribute SVGAnimatedLength x;
+ [Constant]
readonly attribute SVGAnimatedLength y;
+ [Constant]
readonly attribute SVGAnimatedLength width;
+ [Constant]
readonly attribute SVGAnimatedLength height;
- readonly attribute SVGAnimatedInteger filterResX;
- readonly attribute SVGAnimatedInteger filterResY;
- void setFilterRes(unsigned long filterResX, unsigned long filterResY);
// ImageData apply(ImageData source);
};
diff --git a/dom/webidl/SVGFilterPrimitiveStandardAttributes.webidl b/dom/webidl/SVGFilterPrimitiveStandardAttributes.webidl
index 9dc94c38b..331950586 100644
--- a/dom/webidl/SVGFilterPrimitiveStandardAttributes.webidl
+++ b/dom/webidl/SVGFilterPrimitiveStandardAttributes.webidl
@@ -12,9 +12,14 @@
[NoInterfaceObject]
interface SVGFilterPrimitiveStandardAttributes {
+ [Constant]
readonly attribute SVGAnimatedLength x;
+ [Constant]
readonly attribute SVGAnimatedLength y;
+ [Constant]
readonly attribute SVGAnimatedLength width;
+ [Constant]
readonly attribute SVGAnimatedLength height;
+ [Constant]
readonly attribute SVGAnimatedString result;
};
diff --git a/dom/webidl/SVGGradientElement.webidl b/dom/webidl/SVGGradientElement.webidl
index fb82cdc88..eee562308 100644
--- a/dom/webidl/SVGGradientElement.webidl
+++ b/dom/webidl/SVGGradientElement.webidl
@@ -18,8 +18,11 @@ interface SVGGradientElement : SVGElement {
const unsigned short SVG_SPREADMETHOD_REFLECT = 2;
const unsigned short SVG_SPREADMETHOD_REPEAT = 3;
+ [Constant]
readonly attribute SVGAnimatedEnumeration gradientUnits;
+ [Constant]
readonly attribute SVGAnimatedTransformList gradientTransform;
+ [Constant]
readonly attribute SVGAnimatedEnumeration spreadMethod;
};
diff --git a/dom/webidl/SVGGraphicsElement.webidl b/dom/webidl/SVGGraphicsElement.webidl
index 5c4db656e..74af1f673 100644
--- a/dom/webidl/SVGGraphicsElement.webidl
+++ b/dom/webidl/SVGGraphicsElement.webidl
@@ -10,14 +10,21 @@
* liability, trademark and document use rules apply.
*/
+dictionary SVGBoundingBoxOptions {
+ boolean fill = true;
+ boolean stroke = false;
+ boolean markers = false;
+ boolean clipped = false;
+};
+
interface SVGGraphicsElement : SVGElement {
readonly attribute SVGAnimatedTransformList transform;
readonly attribute SVGElement? nearestViewportElement;
readonly attribute SVGElement? farthestViewportElement;
- [Creator, Throws]
- SVGRect getBBox();
+ [NewObject, Throws]
+ SVGRect getBBox(optional SVGBoundingBoxOptions aOptions);
// Not implemented
// SVGRect getStrokeBBox();
SVGMatrix? getCTM();
diff --git a/dom/webidl/SVGLength.webidl b/dom/webidl/SVGLength.webidl
new file mode 100644
index 000000000..6d56132db
--- /dev/null
+++ b/dom/webidl/SVGLength.webidl
@@ -0,0 +1,40 @@
+/* -*- 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/SVG2/
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+interface SVGLength {
+
+ // Length Unit Types
+ const unsigned short SVG_LENGTHTYPE_UNKNOWN = 0;
+ const unsigned short SVG_LENGTHTYPE_NUMBER = 1;
+ const unsigned short SVG_LENGTHTYPE_PERCENTAGE = 2;
+ const unsigned short SVG_LENGTHTYPE_EMS = 3;
+ const unsigned short SVG_LENGTHTYPE_EXS = 4;
+ const unsigned short SVG_LENGTHTYPE_PX = 5;
+ const unsigned short SVG_LENGTHTYPE_CM = 6;
+ const unsigned short SVG_LENGTHTYPE_MM = 7;
+ const unsigned short SVG_LENGTHTYPE_IN = 8;
+ const unsigned short SVG_LENGTHTYPE_PT = 9;
+ const unsigned short SVG_LENGTHTYPE_PC = 10;
+
+ readonly attribute unsigned short unitType;
+ [Throws]
+ attribute float value;
+ [SetterThrows]
+ attribute float valueInSpecifiedUnits;
+ [SetterThrows]
+ attribute DOMString valueAsString;
+
+ [Throws]
+ void newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits);
+ [Throws]
+ void convertToSpecifiedUnits(unsigned short unitType);
+};
diff --git a/dom/webidl/SVGLengthList.webidl b/dom/webidl/SVGLengthList.webidl
index 72a22e5e9..c4fab44e4 100644
--- a/dom/webidl/SVGLengthList.webidl
+++ b/dom/webidl/SVGLengthList.webidl
@@ -10,8 +10,6 @@
* liability, trademark and document use rules apply.
*/
-interface SVGLength;
-
interface SVGLengthList {
readonly attribute unsigned long numberOfItems;
[Throws]
diff --git a/dom/webidl/SVGLinearGradientElement.webidl b/dom/webidl/SVGLinearGradientElement.webidl
index 73ee27406..200bc47e6 100644
--- a/dom/webidl/SVGLinearGradientElement.webidl
+++ b/dom/webidl/SVGLinearGradientElement.webidl
@@ -11,8 +11,12 @@
*/
interface SVGLinearGradientElement : SVGGradientElement {
+ [Constant]
readonly attribute SVGAnimatedLength x1;
+ [Constant]
readonly attribute SVGAnimatedLength y1;
+ [Constant]
readonly attribute SVGAnimatedLength x2;
+ [Constant]
readonly attribute SVGAnimatedLength y2;
};
diff --git a/dom/webidl/SVGMarkerElement.webidl b/dom/webidl/SVGMarkerElement.webidl
index f80ef0d15..a4f819b2d 100644
--- a/dom/webidl/SVGMarkerElement.webidl
+++ b/dom/webidl/SVGMarkerElement.webidl
@@ -10,8 +10,6 @@
* liability, trademark and document use rules apply.
*/
-interface SVGAnimatedEnumeration;
-
interface SVGMarkerElement : SVGElement {
// Marker Unit Types
@@ -24,12 +22,19 @@ interface SVGMarkerElement : SVGElement {
const unsigned short SVG_MARKER_ORIENT_AUTO = 1;
const unsigned short SVG_MARKER_ORIENT_ANGLE = 2;
+ [Constant]
readonly attribute SVGAnimatedLength refX;
+ [Constant]
readonly attribute SVGAnimatedLength refY;
+ [Constant]
readonly attribute SVGAnimatedEnumeration markerUnits;
+ [Constant]
readonly attribute SVGAnimatedLength markerWidth;
+ [Constant]
readonly attribute SVGAnimatedLength markerHeight;
+ [Constant]
readonly attribute SVGAnimatedEnumeration orientType;
+ [Constant]
readonly attribute SVGAnimatedAngle orientAngle;
void setOrientToAuto();
diff --git a/dom/webidl/SVGMaskElement.webidl b/dom/webidl/SVGMaskElement.webidl
index 334f5aba5..e470f0119 100644
--- a/dom/webidl/SVGMaskElement.webidl
+++ b/dom/webidl/SVGMaskElement.webidl
@@ -10,19 +10,23 @@
* liability, trademark and document use rules apply.
*/
-interface SVGAnimatedEnumeration;
-
interface SVGMaskElement : SVGElement {
// Mask Types
const unsigned short SVG_MASKTYPE_LUMINANCE = 0;
const unsigned short SVG_MASKTYPE_ALPHA = 1;
+ [Constant]
readonly attribute SVGAnimatedEnumeration maskUnits;
+ [Constant]
readonly attribute SVGAnimatedEnumeration maskContentUnits;
+ [Constant]
readonly attribute SVGAnimatedLength x;
+ [Constant]
readonly attribute SVGAnimatedLength y;
+ [Constant]
readonly attribute SVGAnimatedLength width;
+ [Constant]
readonly attribute SVGAnimatedLength height;
};
diff --git a/dom/webidl/SVGMatrix.webidl b/dom/webidl/SVGMatrix.webidl
index bad87b582..3ede75cc7 100644
--- a/dom/webidl/SVGMatrix.webidl
+++ b/dom/webidl/SVGMatrix.webidl
@@ -25,27 +25,27 @@ interface SVGMatrix {
[SetterThrows]
attribute float f;
- [Creator]
+ [NewObject]
SVGMatrix multiply(SVGMatrix secondMatrix);
- [Creator, Throws]
+ [NewObject, Throws]
SVGMatrix inverse();
- [Creator]
+ [NewObject]
SVGMatrix translate(float x, float y);
- [Creator]
+ [NewObject]
SVGMatrix scale(float scaleFactor);
- [Creator]
+ [NewObject]
SVGMatrix scaleNonUniform(float scaleFactorX, float scaleFactorY);
- [Creator]
+ [NewObject]
SVGMatrix rotate(float angle);
- [Creator, Throws]
+ [NewObject, Throws]
SVGMatrix rotateFromVector(float x, float y);
- [Creator]
+ [NewObject]
SVGMatrix flipX();
- [Creator]
+ [NewObject]
SVGMatrix flipY();
- [Creator, Throws]
+ [NewObject, Throws]
SVGMatrix skewX(float angle);
- [Creator, Throws]
+ [NewObject, Throws]
SVGMatrix skewY(float angle);
};
diff --git a/dom/webidl/SVGNumber.webidl b/dom/webidl/SVGNumber.webidl
new file mode 100644
index 000000000..01011e6a6
--- /dev/null
+++ b/dom/webidl/SVGNumber.webidl
@@ -0,0 +1,18 @@
+/* -*- 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/SVG2/
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+[Constructor,
+ Constructor(float value)]
+interface SVGNumber {
+ [SetterThrows]
+ attribute float value;
+};
diff --git a/dom/webidl/SVGNumberList.webidl b/dom/webidl/SVGNumberList.webidl
index 1f2fa71ae..b4247d337 100644
--- a/dom/webidl/SVGNumberList.webidl
+++ b/dom/webidl/SVGNumberList.webidl
@@ -10,8 +10,6 @@
* liability, trademark and document use rules apply.
*/
-interface SVGNumber;
-
interface SVGNumberList {
readonly attribute unsigned long numberOfItems;
[Throws]
diff --git a/dom/webidl/SVGPathElement.webidl b/dom/webidl/SVGPathElement.webidl
index fde4cb440..08a9904ec 100644
--- a/dom/webidl/SVGPathElement.webidl
+++ b/dom/webidl/SVGPathElement.webidl
@@ -11,50 +11,50 @@
*/
interface SVGPathElement : SVGGraphicsElement {
+ [Constant]
readonly attribute SVGAnimatedNumber pathLength;
- [Throws]
float getTotalLength();
- [Creator, Throws]
+ [NewObject, Throws]
SVGPoint getPointAtLength(float distance);
unsigned long getPathSegAtLength(float distance);
- [Creator]
+ [NewObject]
SVGPathSegClosePath createSVGPathSegClosePath();
- [Creator]
+ [NewObject]
SVGPathSegMovetoAbs createSVGPathSegMovetoAbs(float x, float y);
- [Creator]
+ [NewObject]
SVGPathSegMovetoRel createSVGPathSegMovetoRel(float x, float y);
- [Creator]
+ [NewObject]
SVGPathSegLinetoAbs createSVGPathSegLinetoAbs(float x, float y);
- [Creator]
+ [NewObject]
SVGPathSegLinetoRel createSVGPathSegLinetoRel(float x, float y);
- [Creator]
+ [NewObject]
SVGPathSegCurvetoCubicAbs createSVGPathSegCurvetoCubicAbs(float x, float y, float x1, float y1, float x2, float y2);
- [Creator]
+ [NewObject]
SVGPathSegCurvetoCubicRel createSVGPathSegCurvetoCubicRel(float x, float y, float x1, float y1, float x2, float y2);
- [Creator]
+ [NewObject]
SVGPathSegCurvetoQuadraticAbs createSVGPathSegCurvetoQuadraticAbs(float x, float y, float x1, float y1);
- [Creator]
+ [NewObject]
SVGPathSegCurvetoQuadraticRel createSVGPathSegCurvetoQuadraticRel(float x, float y, float x1, float y1);
- [Creator]
+ [NewObject]
SVGPathSegArcAbs createSVGPathSegArcAbs(float x, float y, float r1, float r2, float angle, boolean largeArcFlag, boolean sweepFlag);
- [Creator]
+ [NewObject]
SVGPathSegArcRel createSVGPathSegArcRel(float x, float y, float r1, float r2, float angle, boolean largeArcFlag, boolean sweepFlag);
- [Creator]
+ [NewObject]
SVGPathSegLinetoHorizontalAbs createSVGPathSegLinetoHorizontalAbs(float x);
- [Creator]
+ [NewObject]
SVGPathSegLinetoHorizontalRel createSVGPathSegLinetoHorizontalRel(float x);
- [Creator]
+ [NewObject]
SVGPathSegLinetoVerticalAbs createSVGPathSegLinetoVerticalAbs(float y);
- [Creator]
+ [NewObject]
SVGPathSegLinetoVerticalRel createSVGPathSegLinetoVerticalRel(float y);
- [Creator]
+ [NewObject]
SVGPathSegCurvetoCubicSmoothAbs createSVGPathSegCurvetoCubicSmoothAbs(float x, float y, float x2, float y2);
- [Creator]
+ [NewObject]
SVGPathSegCurvetoCubicSmoothRel createSVGPathSegCurvetoCubicSmoothRel(float x, float y, float x2, float y2);
- [Creator]
+ [NewObject]
SVGPathSegCurvetoQuadraticSmoothAbs createSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y);
- [Creator]
+ [NewObject]
SVGPathSegCurvetoQuadraticSmoothRel createSVGPathSegCurvetoQuadraticSmoothRel(float x, float y);
};
diff --git a/dom/webidl/SVGPathSeg.webidl b/dom/webidl/SVGPathSeg.webidl
index 553a74f76..b5ff1abd6 100644
--- a/dom/webidl/SVGPathSeg.webidl
+++ b/dom/webidl/SVGPathSeg.webidl
@@ -34,7 +34,9 @@ interface SVGPathSeg {
const unsigned short PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS = 18;
const unsigned short PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL = 19;
+ [Pure]
readonly attribute unsigned short pathSegType;
+ [Pure]
readonly attribute DOMString pathSegTypeAsLetter;
};
diff --git a/dom/webidl/SVGPatternElement.webidl b/dom/webidl/SVGPatternElement.webidl
index 05f71594b..8dc7e01b4 100644
--- a/dom/webidl/SVGPatternElement.webidl
+++ b/dom/webidl/SVGPatternElement.webidl
@@ -10,8 +10,6 @@
* liability, trademark and document use rules apply.
*/
-interface SVGAnimatedEnumeration;
-
interface SVGPatternElement : SVGElement {
[Constant]
readonly attribute SVGAnimatedEnumeration patternUnits;
diff --git a/dom/webidl/SVGPoint.webidl b/dom/webidl/SVGPoint.webidl
index 2c31d56e1..c8113d40b 100644
--- a/dom/webidl/SVGPoint.webidl
+++ b/dom/webidl/SVGPoint.webidl
@@ -17,7 +17,7 @@ interface SVGPoint {
[SetterThrows]
attribute float y;
- [Creator]
+ [NewObject]
SVGPoint matrixTransform(SVGMatrix matrix);
};
diff --git a/dom/webidl/SVGRadialGradientElement.webidl b/dom/webidl/SVGRadialGradientElement.webidl
index 009a9551f..d4a3724f6 100644
--- a/dom/webidl/SVGRadialGradientElement.webidl
+++ b/dom/webidl/SVGRadialGradientElement.webidl
@@ -11,10 +11,15 @@
*/
interface SVGRadialGradientElement : SVGGradientElement {
+ [Constant]
readonly attribute SVGAnimatedLength cx;
+ [Constant]
readonly attribute SVGAnimatedLength cy;
+ [Constant]
readonly attribute SVGAnimatedLength r;
+ [Constant]
readonly attribute SVGAnimatedLength fx;
+ [Constant]
readonly attribute SVGAnimatedLength fy;
// readonly attribute SVGAnimatedLength fr;
};
diff --git a/dom/webidl/SVGSVGElement.webidl b/dom/webidl/SVGSVGElement.webidl
index 99bb4a064..87818ecc7 100644
--- a/dom/webidl/SVGSVGElement.webidl
+++ b/dom/webidl/SVGSVGElement.webidl
@@ -14,24 +14,35 @@ interface SVGViewSpec;
interface SVGSVGElement : SVGGraphicsElement {
+ [Constant]
readonly attribute SVGAnimatedLength x;
+ [Constant]
readonly attribute SVGAnimatedLength y;
+ [Constant]
readonly attribute SVGAnimatedLength width;
+ [Constant]
readonly attribute SVGAnimatedLength height;
// readonly attribute SVGRect viewport;
+ [Constant]
readonly attribute float pixelUnitToMillimeterX;
+ [Constant]
readonly attribute float pixelUnitToMillimeterY;
+ [Constant]
readonly attribute float screenPixelToMillimeterX;
+ [Constant]
readonly attribute float screenPixelToMillimeterY;
readonly attribute boolean useCurrentView;
// readonly attribute SVGViewSpec currentView;
attribute float currentScale;
readonly attribute SVGPoint currentTranslate;
+ [DependsOn=Nothing, Affects=Nothing]
unsigned long suspendRedraw(unsigned long maxWaitMilliseconds);
+ [DependsOn=Nothing, Affects=Nothing]
void unsuspendRedraw(unsigned long suspendHandleID);
+ [DependsOn=Nothing, Affects=Nothing]
void unsuspendRedrawAll();
- [Throws]
+ [DependsOn=Nothing, Affects=Nothing]
void forceRedraw();
void pauseAnimations();
void unpauseAnimations();
@@ -42,28 +53,26 @@ interface SVGSVGElement : SVGGraphicsElement {
// NodeList getEnclosureList(SVGRect rect, SVGElement referenceElement);
// boolean checkIntersection(SVGElement element, SVGRect rect);
// boolean checkEnclosure(SVGElement element, SVGRect rect);
- // void deselectAll();
- [Creator]
+ void deselectAll();
+ [NewObject]
SVGNumber createSVGNumber();
- [Creator]
+ [NewObject]
SVGLength createSVGLength();
- [Creator]
+ [NewObject]
SVGAngle createSVGAngle();
- [Creator]
+ [NewObject]
SVGPoint createSVGPoint();
- [Creator]
+ [NewObject]
SVGMatrix createSVGMatrix();
- [Creator]
+ [NewObject]
SVGRect createSVGRect();
- [Creator]
+ [NewObject]
SVGTransform createSVGTransform();
- [Creator]
+ [NewObject]
SVGTransform createSVGTransformFromMatrix(SVGMatrix matrix);
Element? getElementById(DOMString elementId);
};
-/*SVGSVGElement implements ViewCSS;
-SVGSVGElement implements DocumentCSS;*/
SVGSVGElement implements SVGFitToViewBox;
SVGSVGElement implements SVGZoomAndPan;
diff --git a/dom/webidl/SVGScriptElement.webidl b/dom/webidl/SVGScriptElement.webidl
index 5bd2273d1..41bbe065b 100644
--- a/dom/webidl/SVGScriptElement.webidl
+++ b/dom/webidl/SVGScriptElement.webidl
@@ -16,7 +16,7 @@ interface SVGScriptElement : SVGElement {
// CORS attribute
[SetterThrows]
- attribute DOMString crossOrigin;
+ attribute DOMString? crossOrigin;
};
SVGScriptElement implements SVGURIReference;
diff --git a/dom/webidl/SVGStopElement.webidl b/dom/webidl/SVGStopElement.webidl
index 85e19bda3..d75e52b73 100644
--- a/dom/webidl/SVGStopElement.webidl
+++ b/dom/webidl/SVGStopElement.webidl
@@ -10,9 +10,8 @@
* liability, trademark and document use rules apply.
*/
-interface SVGAnimatedNumber;
-
interface SVGStopElement : SVGElement {
+ [Constant]
readonly attribute SVGAnimatedNumber offset;
};
diff --git a/dom/webidl/SVGTextContentElement.webidl b/dom/webidl/SVGTextContentElement.webidl
index f858f5c1f..15ec96373 100644
--- a/dom/webidl/SVGTextContentElement.webidl
+++ b/dom/webidl/SVGTextContentElement.webidl
@@ -10,8 +10,6 @@
* liability, trademark and document use rules apply.
*/
-interface SVGAnimatedEnumeration;
-
interface SVGTextContentElement : SVGGraphicsElement {
// lengthAdjust Types
@@ -19,8 +17,10 @@ interface SVGTextContentElement : SVGGraphicsElement {
const unsigned short LENGTHADJUST_SPACING = 1;
const unsigned short LENGTHADJUST_SPACINGANDGLYPHS = 2;
- // readonly attribute SVGAnimatedLength textLength;
- // readonly attribute SVGAnimatedEnumeration lengthAdjust;
+ [Constant]
+ readonly attribute SVGAnimatedLength textLength;
+ [Constant]
+ readonly attribute SVGAnimatedEnumeration lengthAdjust;
long getNumberOfChars();
float getComputedTextLength();
@@ -30,12 +30,12 @@ interface SVGTextContentElement : SVGGraphicsElement {
SVGPoint getStartPositionOfChar(unsigned long charnum);
[Throws]
SVGPoint getEndPositionOfChar(unsigned long charnum);
- [Creator, Throws]
+ [NewObject, Throws]
SVGRect getExtentOfChar(unsigned long charnum);
[Throws]
float getRotationOfChar(unsigned long charnum);
long getCharNumAtPosition(SVGPoint point);
- [Throws, Pref="svg.text.css-frames.enabled"]
+ [Throws]
void selectSubString(unsigned long charnum, unsigned long nchars);
};
diff --git a/dom/webidl/SVGTextPathElement.webidl b/dom/webidl/SVGTextPathElement.webidl
index a8932d14d..73a50f3ff 100644
--- a/dom/webidl/SVGTextPathElement.webidl
+++ b/dom/webidl/SVGTextPathElement.webidl
@@ -10,8 +10,6 @@
* liability, trademark and document use rules apply.
*/
-interface SVGAnimatedEnumeration;
-
interface SVGTextPathElement : SVGTextContentElement {
// textPath Method Types
@@ -24,8 +22,11 @@ interface SVGTextPathElement : SVGTextContentElement {
const unsigned short TEXTPATH_SPACINGTYPE_AUTO = 1;
const unsigned short TEXTPATH_SPACINGTYPE_EXACT = 2;
+ [Constant]
readonly attribute SVGAnimatedLength startOffset;
+ [Constant]
readonly attribute SVGAnimatedEnumeration method;
+ [Constant]
readonly attribute SVGAnimatedEnumeration spacing;
};
diff --git a/dom/webidl/SVGTextPositioningElement.webidl b/dom/webidl/SVGTextPositioningElement.webidl
index cfecb839d..80b8b94fa 100644
--- a/dom/webidl/SVGTextPositioningElement.webidl
+++ b/dom/webidl/SVGTextPositioningElement.webidl
@@ -11,10 +11,15 @@
*/
interface SVGTextPositioningElement : SVGTextContentElement {
+ [Constant]
readonly attribute SVGAnimatedLengthList x;
+ [Constant]
readonly attribute SVGAnimatedLengthList y;
+ [Constant]
readonly attribute SVGAnimatedLengthList dx;
+ [Constant]
readonly attribute SVGAnimatedLengthList dy;
+ [Constant]
readonly attribute SVGAnimatedNumberList rotate;
};
diff --git a/dom/webidl/SVGURIReference.webidl b/dom/webidl/SVGURIReference.webidl
index 672349a03..11f94c191 100644
--- a/dom/webidl/SVGURIReference.webidl
+++ b/dom/webidl/SVGURIReference.webidl
@@ -12,6 +12,7 @@
[NoInterfaceObject]
interface SVGURIReference {
+ [Constant]
readonly attribute SVGAnimatedString href;
};
diff --git a/dom/webidl/Screen.webidl b/dom/webidl/Screen.webidl
index 1cc04e267..ca0110312 100644
--- a/dom/webidl/Screen.webidl
+++ b/dom/webidl/Screen.webidl
@@ -35,19 +35,19 @@ interface Screen : EventTarget {
*/
readonly attribute DOMString mozOrientation;
- [SetterThrows]
attribute EventHandler onmozorientationchange;
/**
* Lock screen orientation to the specified type.
*/
- [Throws]
+ [Throws, UnsafeInPrerendering]
boolean mozLockOrientation(DOMString orientation);
- [Throws]
+ [Throws, UnsafeInPrerendering]
boolean mozLockOrientation(sequence<DOMString> orientation);
/**
* Unlock the screen orientation.
*/
+ [UnsafeInPrerendering]
void mozUnlockOrientation();
};
diff --git a/dom/webidl/ScriptProcessorNode.webidl b/dom/webidl/ScriptProcessorNode.webidl
index c96059210..4d299c8dc 100644
--- a/dom/webidl/ScriptProcessorNode.webidl
+++ b/dom/webidl/ScriptProcessorNode.webidl
@@ -10,13 +10,14 @@
* liability, trademark and document use rules apply.
*/
-[PrefControlled]
interface ScriptProcessorNode : AudioNode {
- [SetterThrows]
attribute EventHandler onaudioprocess;
readonly attribute long bufferSize;
};
+// Mozilla extension
+ScriptProcessorNode implements AudioNodePassThrough;
+
diff --git a/dom/webidl/ScrollAreaEvent.webidl b/dom/webidl/ScrollAreaEvent.webidl
index 44dd09ced..c0e6670c5 100644
--- a/dom/webidl/ScrollAreaEvent.webidl
+++ b/dom/webidl/ScrollAreaEvent.webidl
@@ -4,8 +4,6 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-interface WindowProxy;
-
interface ScrollAreaEvent : UIEvent
{
readonly attribute float x;
@@ -17,7 +15,7 @@ interface ScrollAreaEvent : UIEvent
void initScrollAreaEvent(DOMString type,
boolean canBubble,
boolean cancelable,
- WindowProxy? view,
+ Window? view,
long detail,
float x,
float y,
diff --git a/dom/webidl/ScrollBoxObject.webidl b/dom/webidl/ScrollBoxObject.webidl
new file mode 100644
index 000000000..af6905852
--- /dev/null
+++ b/dom/webidl/ScrollBoxObject.webidl
@@ -0,0 +1,70 @@
+/* -*- 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/.
+ */
+
+[NoInterfaceObject]
+interface ScrollBoxObject : BoxObject {
+
+ /**
+ * Scroll to the given coordinates, in css pixels.
+ * (0,0) will put the top left corner of the scrolled element's padding-box
+ * at the top left corner of the scrollport (which is its inner-border-box).
+ * Values will be clamped to legal values.
+ */
+ [Throws]
+ void scrollTo(long x, long y);
+
+ /**
+ * Scroll the given amount of device pixels to the right and down.
+ * Values will be clamped to make the resuling position legal.
+ */
+ [Throws]
+ void scrollBy(long dx, long dy);
+ [Throws]
+ void scrollByLine(long dlines);
+ [Throws]
+ void scrollByIndex(long dindexes);
+ [Throws]
+ void scrollToLine(long line);
+ [Throws]
+ void scrollToElement(Element child);
+ [Throws]
+ void scrollToIndex(long index);
+
+ /**
+ * Get the current scroll position in css pixels.
+ * @see scrollTo for the definition of x and y.
+ */
+ [Pure, Throws]
+ readonly attribute long positionX;
+ [Pure, Throws]
+ readonly attribute long positionY;
+ [Pure, Throws]
+ readonly attribute long scrolledWidth;
+ [Pure, Throws]
+ readonly attribute long scrolledHeight;
+
+ /**
+ * DEPRECATED: Please use positionX and positionY
+ *
+ * Get the current scroll position in css pixels.
+ * @see scrollTo for the definition of x and y.
+ */
+ [Throws]
+ void getPosition(object x, object y);
+
+ /**
+ * DEPRECATED: Please use scrolledWidth and scrolledHeight
+ */
+ [Throws]
+ void getScrolledSize(object width, object height);
+
+ [Throws]
+ void ensureElementIsVisible(Element child);
+ [Throws]
+ void ensureIndexIsVisible(long index);
+ [Throws]
+ void ensureLineIsVisible(long line);
+};
diff --git a/dom/webidl/ScrollViewChangeEvent.webidl b/dom/webidl/ScrollViewChangeEvent.webidl
new file mode 100644
index 000000000..e94e9b5d3
--- /dev/null
+++ b/dom/webidl/ScrollViewChangeEvent.webidl
@@ -0,0 +1,21 @@
+/* -*- 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/.
+ */
+
+enum ScrollState {"started", "stopped"};
+
+dictionary ScrollViewChangeEventInit : EventInit {
+ ScrollState state = "started";
+ float scrollX = 0;
+ float scrollY = 0;
+};
+
+[Constructor(DOMString type, optional ScrollViewChangeEventInit eventInit),
+ ChromeOnly]
+interface ScrollViewChangeEvent : Event {
+ readonly attribute ScrollState state;
+ readonly attribute float scrollX;
+ readonly attribute float scrollY;
+};
diff --git a/dom/webidl/SecureElement.webidl b/dom/webidl/SecureElement.webidl
new file mode 100644
index 000000000..aca02eb60
--- /dev/null
+++ b/dom/webidl/SecureElement.webidl
@@ -0,0 +1,160 @@
+/* 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/. */
+
+ /* Copyright © 2014 Deutsche Telekom, Inc. */
+
+enum SEType {
+ "uicc",
+ "eSE"
+};
+
+enum SEError {
+ "SESecurityError", // Requested operation does not match the access control rules of the application.
+ "SEIoError", // I/O Error while communicating with the secure element.
+ "SEBadStateError", // Error occuring as a result of bad state.
+ "SEInvalidChannelError", // Opening a channel failed because no channel is available.
+ "SEInvalidApplicationError", // The requested application was not found on the secure element.
+ "SEGenericError" // Generic failures.
+};
+
+enum SEChannelType {
+ "basic",
+ "logical"
+};
+
+// Dictionary that represents an APDU command to be sent to a secure element.
+dictionary SECommand {
+ required octet cla; // Class Byte
+ required octet ins; // Instruction Byte
+ required octet p1; // First Octet of Parameters Byte
+ required octet p2; // Second Octet of Parameters Byte
+ sequence<octet>? data = null; // Sequence of octets
+ short le = -1; // The length of the expected
+ // response data or -1 if none is expected
+};
+
+[Pref="dom.secureelement.enabled",
+ CheckPermissions="secureelement-manage",
+ AvailableIn="CertifiedApps",
+ JSImplementation="@mozilla.org/secureelement/reader;1"]
+interface SEReader {
+
+ // 'true' if a secure element is present
+ readonly attribute boolean isSEPresent;
+
+ // Type of SecureElement
+ readonly attribute SEType type;
+
+ /**
+ * Opens a session with the Secure Element.
+ * Note that a reader may have several opened sessions.
+ *
+ * @return If the operation is successful the promise is resolved with an instance of SESession.
+ */
+ [Throws]
+ Promise<SESession> openSession();
+
+ /**
+ * Closes all sessions associated with this Reader and its associated channels.
+ *
+ */
+ [Throws]
+ Promise<void> closeAll();
+};
+
+[Pref="dom.secureelement.enabled",
+ CheckPermissions="secureelement-manage",
+ AvailableIn="CertifiedApps",
+ JSImplementation="@mozilla.org/secureelement/session;1"]
+interface SESession {
+
+ // 'reader' that provides this session
+ readonly attribute SEReader reader;
+
+ // Status of current session
+ readonly attribute boolean isClosed;
+
+ /**
+ * Opens a communication logical channel to an application on Secure Element identified by the AID.
+ * The 'aid' can be null for some secure elements.
+ *
+ * @param aid
+ * Application Identifier of the Card Applet on the secure element.
+ * If the 'aid' is null :
+ * For secure element type 'eSE', the default applet is selected.
+ * For secure element type 'uicc', the request will be immediately rejected.
+ * Note that the length of 'aid should be between 5 and 16.
+ *
+ * @return If the operation is successful the promise is resolved with an instance of SEChannel.
+ */
+ [Throws]
+ Promise<SEChannel> openLogicalChannel(Uint8Array? aid);
+
+ /**
+ * Close all active channels associated with this session.
+ *
+ */
+ [Throws]
+ Promise<void> closeAll();
+};
+
+[Pref="dom.secureelement.enabled",
+ CheckPermissions="secureelement-manage",
+ AvailableIn="CertifiedApps",
+ JSImplementation="@mozilla.org/secureelement/channel;1"]
+interface SEChannel {
+
+ // 'session' obj this channel is bound to
+ readonly attribute SESession session;
+
+ // response to openBasicChannel / openLogicalChannel operation
+ [Constant, Cached] readonly attribute Uint8Array? openResponse;
+
+ // Status of channel
+ readonly attribute boolean isClosed;
+
+ // Type of channel
+ readonly attribute SEChannelType type;
+
+ /**
+ * Transmits the APDU command to the secure element. This is an atomic operation that transmits
+ * an APDU command (as per ISO7816-4) to the secure element (UICC / eSE). Upon receiving response
+ * to the transmit apdu command, it is propogated to the applications using SEResponse object.
+ *
+ * @param command
+ * SECommand to be sent to secure element
+ *
+ * @return If success, the promise is resolved with the new created
+ * SEResponse object. Otherwise, rejected with the error of type 'SEError'.
+ */
+ [Throws]
+ Promise<SEResponse> transmit(optional SECommand command);
+
+ /**
+ * Closes the active channel.
+ *
+ */
+ [Throws]
+ Promise<void> close();
+};
+
+[Pref="dom.secureelement.enabled",
+ CheckPermissions="secureelement-manage",
+ AvailableIn="CertifiedApps",
+ JSImplementation="@mozilla.org/secureelement/response;1"]
+interface SEResponse {
+ // Response received on this 'channel' object.
+ [Constant] readonly attribute SEChannel channel;
+
+ // First octet of response's status word
+ [Constant] readonly attribute octet sw1;
+
+ // Second octet of response's status word
+ [Constant] readonly attribute octet sw2;
+
+ // The response's data field bytes
+ [Cached, Pure] readonly attribute sequence<octet>? data;
+
+};
+
diff --git a/dom/webidl/SecureElementManager.webidl b/dom/webidl/SecureElementManager.webidl
new file mode 100644
index 000000000..da39849f2
--- /dev/null
+++ b/dom/webidl/SecureElementManager.webidl
@@ -0,0 +1,23 @@
+/* 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/. */
+
+ /* Copyright © 2014 Deutsche Telekom, Inc. */
+
+[Pref="dom.secureelement.enabled",
+ CheckPermissions="secureelement-manage",
+ AvailableIn="CertifiedApps",
+ JSImplementation="@mozilla.org/secureelement/manager;1",
+ NavigatorProperty="seManager",
+ NoInterfaceObject]
+interface SEManager {
+
+ /**
+ * Retrieves all the readers available on the device.
+ *
+ * @return If success, the promise is resolved to a sequence
+ * of SEReaders Otherwise, rejected with an error.
+ */
+ [Throws]
+ Promise<sequence<SEReader>> getSEReaders();
+};
diff --git a/dom/webidl/Selection.webidl b/dom/webidl/Selection.webidl
new file mode 100644
index 000000000..6ef36277c
--- /dev/null
+++ b/dom/webidl/Selection.webidl
@@ -0,0 +1,85 @@
+/* -*- 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
+ * https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#concept-selection
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+interface Selection {
+ readonly attribute Node? anchorNode;
+ readonly attribute unsigned long anchorOffset;
+ readonly attribute Node? focusNode;
+ readonly attribute unsigned long focusOffset;
+
+ readonly attribute boolean isCollapsed;
+ [Throws]
+ void collapse(Node node, unsigned long offset);
+ [Throws]
+ void collapseToStart();
+ [Throws]
+ void collapseToEnd();
+
+ [Throws]
+ void extend(Node node, unsigned long offset);
+
+ [Throws]
+ void selectAllChildren(Node node);
+ [Throws]
+ void deleteFromDocument();
+
+ readonly attribute unsigned long rangeCount;
+ [Throws]
+ Range getRangeAt(unsigned long index);
+ [Throws]
+ void addRange(Range range);
+ [Throws]
+ void removeRange(Range range);
+ [Throws]
+ void removeAllRanges();
+
+ [Throws]
+ boolean containsNode(Node node, boolean allowPartialContainment);
+
+ stringifier;
+};
+
+// Additional methods not currently in the spec
+partial interface Selection {
+ [Throws]
+ void modify(DOMString alter, DOMString direction,
+ DOMString granularity);
+};
+
+// Additional chrome-only methods from nsISelectionPrivate
+interface nsISelectionListener;
+partial interface Selection {
+ [ChromeOnly]
+ const short ENDOFPRECEDINGLINE = 0;
+ [ChromeOnly]
+ const short STARTOFNEXTLINE = 1;
+
+ [ChromeOnly,Throws]
+ attribute boolean interlinePosition;
+
+ [ChromeOnly,Throws]
+ DOMString toStringWithFormat(DOMString formatType, unsigned long flags, long wrapColumn);
+ [ChromeOnly,Throws]
+ void addSelectionListener(nsISelectionListener newListener);
+ [ChromeOnly,Throws]
+ void removeSelectionListener(nsISelectionListener listenerToRemove);
+
+ [ChromeOnly]
+ readonly attribute short type;
+
+ [ChromeOnly,Throws,Pref="dom.testing.selection.GetRangesForInterval"]
+ sequence<Range> GetRangesForInterval(Node beginNode, long beginOffset, Node endNode, long endOffset,
+ boolean allowAdjacent);
+
+ [ChromeOnly,Throws]
+ void scrollIntoView(short aRegion, boolean aIsSynchronous, short aVPercent, short aHPercent);
+};
diff --git a/dom/webidl/SelectionStateChangedEvent.webidl b/dom/webidl/SelectionStateChangedEvent.webidl
new file mode 100644
index 000000000..d19e398c9
--- /dev/null
+++ b/dom/webidl/SelectionStateChangedEvent.webidl
@@ -0,0 +1,34 @@
+/* -*- 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/.
+ */
+
+enum SelectionState {
+ "drag",
+ "mousedown",
+ "mouseup",
+ "keypress",
+ "selectall",
+ "collapsetostart",
+ "collapsetoend",
+ "blur",
+ "updateposition",
+ "taponcaret"
+};
+
+dictionary SelectionStateChangedEventInit : EventInit {
+ boolean visible = true;
+ DOMString selectedText = "";
+ DOMRectReadOnly? boundingClientRect = null;
+ sequence<SelectionState> states = [];
+};
+
+[Constructor(DOMString type, optional SelectionStateChangedEventInit eventInit),
+ ChromeOnly]
+interface SelectionStateChangedEvent : Event {
+ readonly attribute boolean visible;
+ readonly attribute DOMString selectedText;
+ readonly attribute DOMRectReadOnly? boundingClientRect;
+ [Cached, Pure] readonly attribute sequence<SelectionState> states;
+};
diff --git a/dom/webidl/ServiceWorker.webidl b/dom/webidl/ServiceWorker.webidl
new file mode 100644
index 000000000..8f79232f7
--- /dev/null
+++ b/dom/webidl/ServiceWorker.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://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-obj
+ *
+ */
+
+// Still unclear what should be subclassed.
+// https://github.com/slightlyoff/ServiceWorker/issues/189
+[Func="mozilla::dom::workers::ServiceWorkerVisible",
+ // FIXME(nsm): Bug 1113522. This is exposed to satisfy webidl constraints, but it won't actually work.
+ Exposed=(ServiceWorker,Window)]
+interface ServiceWorker : EventTarget {
+ readonly attribute USVString scriptURL;
+ readonly attribute ServiceWorkerState state;
+
+ attribute EventHandler onstatechange;
+
+ // FIXME(catalinb): Should inherit this from Worker.
+ [Throws]
+ void postMessage(any message, optional sequence<Transferable> transferable);
+};
+
+ServiceWorker implements AbstractWorker;
+
+enum ServiceWorkerState {
+ "installing",
+ "installed",
+ "activating",
+ "activated",
+ "redundant"
+};
diff --git a/dom/webidl/ServiceWorkerContainer.webidl b/dom/webidl/ServiceWorkerContainer.webidl
new file mode 100644
index 000000000..c1e66df2b
--- /dev/null
+++ b/dom/webidl/ServiceWorkerContainer.webidl
@@ -0,0 +1,51 @@
+/* -*- 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://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html
+ *
+ */
+
+[Pref="dom.serviceWorkers.enabled",
+ Exposed=Window]
+interface ServiceWorkerContainer : EventTarget {
+ // FIXME(nsm):
+ // https://github.com/slightlyoff/ServiceWorker/issues/198
+ // and discussion at https://etherpad.mozilla.org/serviceworker07apr
+ [Unforgeable] readonly attribute ServiceWorker? controller;
+
+ [Throws]
+ readonly attribute Promise<ServiceWorkerRegistration> ready;
+
+ [Throws]
+ Promise<ServiceWorkerRegistration> register(USVString scriptURL,
+ optional RegistrationOptionList options);
+
+ [Throws]
+ Promise<ServiceWorkerRegistration> getRegistration(optional USVString documentURL = "");
+
+ [Throws]
+ Promise<sequence<ServiceWorkerRegistration>> getRegistrations();
+
+ attribute EventHandler oncontrollerchange;
+ attribute EventHandler onreloadpage;
+ attribute EventHandler onerror;
+};
+
+// Testing only.
+partial interface ServiceWorkerContainer {
+ [Throws,Pref="dom.serviceWorkers.testing.enabled"]
+ Promise<any> clearAllServiceWorkerData();
+
+ [Throws,Pref="dom.serviceWorkers.testing.enabled"]
+ DOMString getScopeForUrl(DOMString url);
+
+ [Throws,Pref="dom.serviceWorkers.testing.enabled"]
+ DOMString getControllingWorkerScriptURLForPath(DOMString path);
+};
+
+dictionary RegistrationOptionList {
+ USVString scope = "/";
+};
diff --git a/dom/webidl/ServiceWorkerGlobalScope.webidl b/dom/webidl/ServiceWorkerGlobalScope.webidl
new file mode 100644
index 000000000..d9cd63801
--- /dev/null
+++ b/dom/webidl/ServiceWorkerGlobalScope.webidl
@@ -0,0 +1,45 @@
+/* -*- 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://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html
+ *
+ * You are granted a license to use, reproduce and create derivative works of
+ * this document.
+ */
+
+[Global=(Worker,ServiceWorker),
+ Exposed=ServiceWorker]
+interface ServiceWorkerGlobalScope : WorkerGlobalScope {
+ // FIXME(nsm): Bug 982725
+ // readonly attribute CacheList caches;
+
+ readonly attribute Clients clients;
+
+ [Unforgeable] readonly attribute DOMString scope;
+
+ // FIXME(nsm): Bug 995484
+ // ResponsePromise<any> fetch((Request or [EnsureUTF16] DOMString) request);
+
+ void update();
+
+ [Throws]
+ Promise<boolean> unregister();
+
+ attribute EventHandler oninstall;
+ attribute EventHandler onactivate;
+ attribute EventHandler onfetch;
+ attribute EventHandler onbeforeevicted;
+ attribute EventHandler onevicted;
+
+ // The event.source of these MessageEvents are instances of Client
+ attribute EventHandler onmessage;
+
+ // close() method inherited from WorkerGlobalScope is not exposed.
+ // FIXME(nsm): For now, overridden so it can be a no-op.
+ void close();
+};
+
+
diff --git a/dom/webidl/ServiceWorkerRegistration.webidl b/dom/webidl/ServiceWorkerRegistration.webidl
new file mode 100644
index 000000000..a9b18481e
--- /dev/null
+++ b/dom/webidl/ServiceWorkerRegistration.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://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html
+ *
+ */
+
+[Pref="dom.serviceWorkers.enabled",
+ Exposed=Window]
+interface ServiceWorkerRegistration : EventTarget {
+ [Unforgeable] readonly attribute ServiceWorker? installing;
+ [Unforgeable] readonly attribute ServiceWorker? waiting;
+ [Unforgeable] readonly attribute ServiceWorker? active;
+
+ readonly attribute USVString scope;
+
+ [Throws]
+ Promise<boolean> unregister();
+
+ // event
+ attribute EventHandler onupdatefound;
+};
diff --git a/dom/webidl/SettingChangeNotification.webidl b/dom/webidl/SettingChangeNotification.webidl
new file mode 100644
index 000000000..4e2496acd
--- /dev/null
+++ b/dom/webidl/SettingChangeNotification.webidl
@@ -0,0 +1,12 @@
+/* -*- 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/.
+ */
+
+// Used internally by Goanna
+dictionary SettingChangeNotification {
+ DOMString key = "";
+ any value;
+ boolean isInternalChange = false;
+};
diff --git a/dom/webidl/SettingsManager.webidl b/dom/webidl/SettingsManager.webidl
new file mode 100644
index 000000000..e8c9ac196
--- /dev/null
+++ b/dom/webidl/SettingsManager.webidl
@@ -0,0 +1,41 @@
+/* -*- 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/.
+ */
+
+[JSImplementation="@mozilla.org/settingsLock;1",
+ Pref="dom.mozSettings.enabled"]
+interface SettingsLock : EventTarget {
+ // Whether this lock is invalid
+ readonly attribute boolean closed;
+
+ // Contains a JSON object with name/value pairs to be set.
+ DOMRequest set(object settings);
+
+ // Result contains the value of the setting.
+ DOMRequest get(DOMString name);
+
+ DOMRequest clear();
+ attribute EventHandler onsettingstransactionsuccess;
+ attribute EventHandler onsettingstransactionfailure;
+};
+
+dictionary SettingChange {
+ DOMString settingName;
+ DOMString settingValue;
+};
+
+callback SettingChangeCallback = void (SettingChange setting);
+
+[JSImplementation="@mozilla.org/settingsManager;1",
+ NavigatorProperty="mozSettings",
+ Pref="dom.mozSettings.enabled"]
+interface SettingsManager : EventTarget {
+ SettingsLock createLock();
+
+ void addObserver(DOMString name, SettingChangeCallback callback);
+ void removeObserver(DOMString name, SettingChangeCallback callback);
+
+ attribute EventHandler onsettingchange;
+};
diff --git a/dom/webidl/ShadowRoot.webidl b/dom/webidl/ShadowRoot.webidl
new file mode 100644
index 000000000..a6c6de254
--- /dev/null
+++ b/dom/webidl/ShadowRoot.webidl
@@ -0,0 +1,27 @@
+/* -*- 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
+ * https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+[Func="nsDocument::IsWebComponentsEnabled"]
+interface ShadowRoot : DocumentFragment
+{
+ Element? getElementById(DOMString elementId);
+ HTMLCollection getElementsByTagName(DOMString localName);
+ HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
+ HTMLCollection getElementsByClassName(DOMString classNames);
+ [SetterThrows,TreatNullAs=EmptyString]
+ attribute DOMString innerHTML;
+ readonly attribute Element host;
+ readonly attribute ShadowRoot? olderShadowRoot;
+ attribute boolean applyAuthorStyles;
+ readonly attribute StyleSheetList styleSheets;
+};
+
diff --git a/dom/webidl/SharedWorker.webidl b/dom/webidl/SharedWorker.webidl
new file mode 100644
index 000000000..3914c7b16
--- /dev/null
+++ b/dom/webidl/SharedWorker.webidl
@@ -0,0 +1,13 @@
+/* -*- 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/.
+ */
+
+[Pref="dom.workers.sharedWorkers.enabled",
+ Constructor(DOMString scriptURL, optional DOMString name)]
+interface SharedWorker : EventTarget {
+ readonly attribute MessagePort port;
+};
+
+SharedWorker implements AbstractWorker;
diff --git a/dom/webidl/SharedWorkerGlobalScope.webidl b/dom/webidl/SharedWorkerGlobalScope.webidl
new file mode 100644
index 000000000..f3e8daf42
--- /dev/null
+++ b/dom/webidl/SharedWorkerGlobalScope.webidl
@@ -0,0 +1,20 @@
+/* -*- 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.whatwg.org/specs/web-apps/current-work/multipage/workers.html#the-workerglobalscope-common-interface
+ *
+ * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and Opera
+ * Software ASA.
+ * You are granted a license to use, reproduce and create derivative works of
+ * this document.
+ */
+
+[Global=(Worker,SharedWorker),
+ Exposed=SharedWorker]
+interface SharedWorkerGlobalScope : WorkerGlobalScope {
+ readonly attribute DOMString name;
+ attribute EventHandler onconnect;
+};
diff --git a/dom/webidl/SimpleGestureEvent.webidl b/dom/webidl/SimpleGestureEvent.webidl
index 8ceb35967..18cb92e43 100644
--- a/dom/webidl/SimpleGestureEvent.webidl
+++ b/dom/webidl/SimpleGestureEvent.webidl
@@ -6,8 +6,6 @@
* For more information see nsIDOMSimpleGestureEvent.idl.
*/
-interface WindowProxy;
-
interface SimpleGestureEvent : MouseEvent
{
const unsigned long DIRECTION_UP = 1;
@@ -30,7 +28,7 @@ interface SimpleGestureEvent : MouseEvent
void initSimpleGestureEvent(DOMString typeArg,
boolean canBubbleArg,
boolean cancelableArg,
- WindowProxy? viewArg,
+ Window? viewArg,
long detailArg,
long screenXArg,
long screenYArg,
diff --git a/dom/webidl/SocketCommon.webidl b/dom/webidl/SocketCommon.webidl
new file mode 100644
index 000000000..044199ea2
--- /dev/null
+++ b/dom/webidl/SocketCommon.webidl
@@ -0,0 +1,16 @@
+/* -*- 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/2012/sysapps/tcp-udp-sockets/#readystate
+ */
+
+enum SocketReadyState {
+ "opening",
+ "open",
+ "closing",
+ "closed",
+ "halfclosed"
+};
diff --git a/dom/webidl/SourceBuffer.webidl b/dom/webidl/SourceBuffer.webidl
new file mode 100644
index 000000000..aaae3e412
--- /dev/null
+++ b/dom/webidl/SourceBuffer.webidl
@@ -0,0 +1,44 @@
+/* -*- 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://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+enum SourceBufferAppendMode {
+ "segments",
+ "sequence"
+};
+
+[Func="mozilla::dom::MediaSource::Enabled"]
+interface SourceBuffer : EventTarget {
+ [SetterThrows]
+ attribute SourceBufferAppendMode mode;
+ readonly attribute boolean updating;
+ [NewObject, Throws]
+ readonly attribute TimeRanges buffered;
+ [SetterThrows]
+ attribute double timestampOffset;
+ //readonly attribute AudioTrackList audioTracks;
+ //readonly attribute VideoTrackList videoTracks;
+ //readonly attribute TextTrackList textTracks;
+ [SetterThrows]
+ attribute double appendWindowStart;
+ [SetterThrows]
+ attribute unrestricted double appendWindowEnd;
+ [Throws]
+ void appendBuffer(ArrayBuffer data);
+ [Throws]
+ void appendBuffer(ArrayBufferView data);
+ //[Throws]
+ //void appendStream(Stream stream, [EnforceRange] optional unsigned long long maxSize);
+ [Throws]
+ void abort();
+ [Throws]
+ void remove(double start, unrestricted double end);
+};
diff --git a/dom/webidl/SourceBufferList.webidl b/dom/webidl/SourceBufferList.webidl
new file mode 100644
index 000000000..badbfd825
--- /dev/null
+++ b/dom/webidl/SourceBufferList.webidl
@@ -0,0 +1,17 @@
+/* -*- 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://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+[Func="mozilla::dom::MediaSource::Enabled"]
+interface SourceBufferList : EventTarget {
+ readonly attribute unsigned long length;
+ getter SourceBuffer (unsigned long index);
+};
diff --git a/dom/webidl/SpeechGrammar.webidl b/dom/webidl/SpeechGrammar.webidl
index f3df56b64..774a3c548 100644
--- a/dom/webidl/SpeechGrammar.webidl
+++ b/dom/webidl/SpeechGrammar.webidl
@@ -10,7 +10,8 @@
* liability, trademark and document use rules apply.
*/
-[Constructor, PrefControlled]
+[Constructor,
+ Pref="media.webspeech.recognition.enable"]
interface SpeechGrammar {
[Throws]
attribute DOMString src;
diff --git a/dom/webidl/SpeechGrammarList.webidl b/dom/webidl/SpeechGrammarList.webidl
index 17812d099..89d95767b 100644
--- a/dom/webidl/SpeechGrammarList.webidl
+++ b/dom/webidl/SpeechGrammarList.webidl
@@ -10,7 +10,7 @@
* liability, trademark and document use rules apply.
*/
-[PrefControlled]
+[Constructor, Pref="media.webspeech.recognition.enable"]
interface SpeechGrammarList {
readonly attribute unsigned long length;
[Throws]
diff --git a/dom/webidl/SpeechRecognition.webidl b/dom/webidl/SpeechRecognition.webidl
index a168f8d6d..556d972d1 100644
--- a/dom/webidl/SpeechRecognition.webidl
+++ b/dom/webidl/SpeechRecognition.webidl
@@ -10,7 +10,8 @@
* liability, trademark and document use rules apply.
*/
-[Constructor, PrefControlled]
+[Constructor,
+ Pref="media.webspeech.recognition.enable"]
interface SpeechRecognition : EventTarget {
// recognition parameters
[Throws]
@@ -27,32 +28,21 @@ interface SpeechRecognition : EventTarget {
attribute DOMString serviceURI;
// methods to drive the speech interaction
- [Throws]
- void start();
+ [Throws, UnsafeInPrerendering]
+ void start(optional MediaStream stream);
void stop();
void abort();
// event methods
- [SetterThrows]
attribute EventHandler onaudiostart;
- [SetterThrows]
attribute EventHandler onsoundstart;
- [SetterThrows]
attribute EventHandler onspeechstart;
- [SetterThrows]
attribute EventHandler onspeechend;
- [SetterThrows]
attribute EventHandler onsoundend;
- [SetterThrows]
attribute EventHandler onaudioend;
- [SetterThrows]
attribute EventHandler onresult;
- [SetterThrows]
attribute EventHandler onnomatch;
- [SetterThrows]
attribute EventHandler onerror;
- [SetterThrows]
attribute EventHandler onstart;
- [SetterThrows]
attribute EventHandler onend;
};
diff --git a/dom/webidl/SpeechRecognitionAlternative.webidl b/dom/webidl/SpeechRecognitionAlternative.webidl
index b05f4d499..c5844e1a3 100644
--- a/dom/webidl/SpeechRecognitionAlternative.webidl
+++ b/dom/webidl/SpeechRecognitionAlternative.webidl
@@ -10,7 +10,7 @@
* liability, trademark and document use rules apply.
*/
-[PrefControlled]
+[Pref="media.webspeech.recognition.enable"]
interface SpeechRecognitionAlternative {
readonly attribute DOMString transcript;
readonly attribute float confidence;
diff --git a/dom/webidl/SpeechRecognitionError.webidl b/dom/webidl/SpeechRecognitionError.webidl
index 91725a591..ef57bbaaf 100644
--- a/dom/webidl/SpeechRecognitionError.webidl
+++ b/dom/webidl/SpeechRecognitionError.webidl
@@ -4,24 +4,27 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-[Constructor(DOMString type, optional SpeechRecognitionErrorInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+enum SpeechRecognitionErrorCode {
+ "no-speech",
+ "aborted",
+ "audio-capture",
+ "network",
+ "not-allowed",
+ "service-not-allowed",
+ "bad-grammar",
+ "language-not-supported"
+};
+
+[Pref="media.webspeech.recognition.enable",
+ Constructor(DOMString type, optional SpeechRecognitionErrorInit eventInitDict)]
interface SpeechRecognitionError : Event
{
- const unsigned long NO_SPEECH = 0;
- const unsigned long ABORTED = 1;
- const unsigned long AUDIO_CAPTURE = 2;
- const unsigned long NETWORK = 3;
- const unsigned long NOT_ALLOWED = 4;
- const unsigned long SERVICE_NOT_ALLOWED = 5;
- const unsigned long BAD_GRAMMAR = 6;
- const unsigned long LANGUAGE_NOT_SUPPORTED = 7;
-
- readonly attribute unsigned long error;
+ readonly attribute SpeechRecognitionErrorCode error;
readonly attribute DOMString? message;
};
dictionary SpeechRecognitionErrorInit : EventInit
{
- unsigned long error = 0;
+ SpeechRecognitionErrorCode error = "no-speech";
DOMString message = "";
};
diff --git a/dom/webidl/SpeechRecognitionEvent.webidl b/dom/webidl/SpeechRecognitionEvent.webidl
index b64db97aa..62003392a 100644
--- a/dom/webidl/SpeechRecognitionEvent.webidl
+++ b/dom/webidl/SpeechRecognitionEvent.webidl
@@ -5,7 +5,8 @@
*/
interface nsISupports;
-[Constructor(DOMString type, optional SpeechRecognitionEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Pref="media.webspeech.recognition.enable",
+ Constructor(DOMString type, optional SpeechRecognitionEventInit eventInitDict)]
interface SpeechRecognitionEvent : Event
{
readonly attribute unsigned long resultIndex;
diff --git a/dom/webidl/SpeechRecognitionResult.webidl b/dom/webidl/SpeechRecognitionResult.webidl
index 6e32ca424..73e1bb620 100644
--- a/dom/webidl/SpeechRecognitionResult.webidl
+++ b/dom/webidl/SpeechRecognitionResult.webidl
@@ -10,7 +10,7 @@
* liability, trademark and document use rules apply.
*/
-[PrefControlled]
+[Pref="media.webspeech.recognition.enable"]
interface SpeechRecognitionResult {
readonly attribute unsigned long length;
getter SpeechRecognitionAlternative item(unsigned long index);
diff --git a/dom/webidl/SpeechRecognitionResultList.webidl b/dom/webidl/SpeechRecognitionResultList.webidl
index 51f10dff8..184ef1833 100644
--- a/dom/webidl/SpeechRecognitionResultList.webidl
+++ b/dom/webidl/SpeechRecognitionResultList.webidl
@@ -10,7 +10,7 @@
* liability, trademark and document use rules apply.
*/
-[PrefControlled]
+[Pref="media.webspeech.recognition.enable"]
interface SpeechRecognitionResultList {
readonly attribute unsigned long length;
getter SpeechRecognitionResult item(unsigned long index);
diff --git a/dom/webidl/SpeechSynthesis.webidl b/dom/webidl/SpeechSynthesis.webidl
index d70629433..b48cf3d2f 100644
--- a/dom/webidl/SpeechSynthesis.webidl
+++ b/dom/webidl/SpeechSynthesis.webidl
@@ -10,15 +10,17 @@
* liability, trademark and document use rules apply.
*/
-[PrefControlled]
+[Pref="media.webspeech.synth.enabled"]
interface SpeechSynthesis {
readonly attribute boolean pending;
readonly attribute boolean speaking;
readonly attribute boolean paused;
+ [UnsafeInPrerendering]
void speak(SpeechSynthesisUtterance utterance);
void cancel();
void pause();
+ [UnsafeInPrerendering]
void resume();
sequence<SpeechSynthesisVoice> getVoices();
};
diff --git a/dom/webidl/SpeechSynthesisEvent.webidl b/dom/webidl/SpeechSynthesisEvent.webidl
index 33219ecaf..029eeb247 100644
--- a/dom/webidl/SpeechSynthesisEvent.webidl
+++ b/dom/webidl/SpeechSynthesisEvent.webidl
@@ -10,7 +10,8 @@
* liability, trademark and document use rules apply.
*/
-[Constructor(DOMString type, optional SpeechSynthesisEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Constructor(DOMString type, optional SpeechSynthesisEventInit eventInitDict),
+ Pref="media.webspeech.synth.enabled"]
interface SpeechSynthesisEvent : Event
{
readonly attribute unsigned long charIndex;
diff --git a/dom/webidl/SpeechSynthesisUtterance.webidl b/dom/webidl/SpeechSynthesisUtterance.webidl
index 1f87519ba..e718c77a7 100644
--- a/dom/webidl/SpeechSynthesisUtterance.webidl
+++ b/dom/webidl/SpeechSynthesisUtterance.webidl
@@ -10,7 +10,7 @@
* liability, trademark and document use rules apply.
*/
-[PrefControlled,
+[Pref="media.webspeech.synth.enabled",
Constructor,
Constructor(DOMString text)]
interface SpeechSynthesisUtterance : EventTarget {
@@ -21,18 +21,11 @@ interface SpeechSynthesisUtterance : EventTarget {
attribute float rate;
attribute float pitch;
- [SetterThrows]
attribute EventHandler onstart;
- [SetterThrows]
attribute EventHandler onend;
- [SetterThrows]
attribute EventHandler onerror;
- [SetterThrows]
attribute EventHandler onpause;
- [SetterThrows]
attribute EventHandler onresume;
- [SetterThrows]
attribute EventHandler onmark;
- [SetterThrows]
attribute EventHandler onboundary;
};
diff --git a/dom/webidl/SpeechSynthesisVoice.webidl b/dom/webidl/SpeechSynthesisVoice.webidl
index 77f390fab..39ea6964d 100644
--- a/dom/webidl/SpeechSynthesisVoice.webidl
+++ b/dom/webidl/SpeechSynthesisVoice.webidl
@@ -10,7 +10,7 @@
* liability, trademark and document use rules apply.
*/
-[PrefControlled]
+[Pref="media.webspeech.synth.enabled"]
interface SpeechSynthesisVoice {
readonly attribute DOMString voiceURI;
readonly attribute DOMString name;
diff --git a/dom/webidl/StereoPannerNode.webidl b/dom/webidl/StereoPannerNode.webidl
new file mode 100644
index 000000000..ec5896c34
--- /dev/null
+++ b/dom/webidl/StereoPannerNode.webidl
@@ -0,0 +1,19 @@
+/* -*- 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
+ * https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+interface StereoPannerNode : AudioNode {
+ readonly attribute AudioParam pan;
+};
+
+// Mozilla extension
+StereoPannerNode implements AudioNodePassThrough;
+
diff --git a/dom/webidl/Storage.webidl b/dom/webidl/Storage.webidl
new file mode 100644
index 000000000..406c8b83b
--- /dev/null
+++ b/dom/webidl/Storage.webidl
@@ -0,0 +1,32 @@
+/* -*- 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.whatwg.org/html/#the-storage-interface
+*
+* © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
+* Opera Software ASA. You are granted a license to use, reproduce
+* and create derivative works of this document.
+*/
+
+interface Storage {
+ [Throws]
+ readonly attribute unsigned long length;
+
+ [Throws]
+ DOMString? key(unsigned long index);
+
+ [Throws]
+ getter DOMString? getItem(DOMString key);
+
+ [Throws]
+ setter creator void setItem(DOMString key, DOMString value);
+
+ [Throws]
+ deleter void removeItem(DOMString key);
+
+ [Throws]
+ void clear();
+};
diff --git a/dom/webidl/StorageEvent.webidl b/dom/webidl/StorageEvent.webidl
index 422db2deb..44836d219 100644
--- a/dom/webidl/StorageEvent.webidl
+++ b/dom/webidl/StorageEvent.webidl
@@ -9,9 +9,8 @@
*
* Event sent to a window when a storage area changes.
*/
-interface Storage;
-[Constructor(DOMString type, optional StorageEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Constructor(DOMString type, optional StorageEventInit eventInitDict)]
interface StorageEvent : Event
{
readonly attribute DOMString? key;
@@ -20,7 +19,7 @@ interface StorageEvent : Event
readonly attribute DOMString? url;
readonly attribute Storage? storageArea;
- // initStorageEvent is a Goanna specific deprecated method.
+ // Bug 1016053 - This is not spec compliant.
[Throws]
void initStorageEvent(DOMString type,
boolean canBubble,
diff --git a/dom/webidl/StorageType.webidl b/dom/webidl/StorageType.webidl
new file mode 100644
index 000000000..cb0702d2a
--- /dev/null
+++ b/dom/webidl/StorageType.webidl
@@ -0,0 +1,7 @@
+/* -*- 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/.
+ */
+
+enum StorageType { "persistent", "temporary", "default" };
diff --git a/dom/webidl/StyleRuleChangeEvent.webidl b/dom/webidl/StyleRuleChangeEvent.webidl
index 1e211eddd..0b783366b 100644
--- a/dom/webidl/StyleRuleChangeEvent.webidl
+++ b/dom/webidl/StyleRuleChangeEvent.webidl
@@ -5,7 +5,7 @@
*/
interface CSSRule;
-[Constructor(DOMString type, optional StyleRuleChangeEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[ChromeOnly, Constructor(DOMString type, optional StyleRuleChangeEventInit eventInitDict)]
interface StyleRuleChangeEvent : Event
{
readonly attribute CSSStyleSheet? stylesheet;
diff --git a/dom/webidl/StyleSheet.webidl b/dom/webidl/StyleSheet.webidl
index 1c644cd55..71a8ccd8f 100644
--- a/dom/webidl/StyleSheet.webidl
+++ b/dom/webidl/StyleSheet.webidl
@@ -8,7 +8,6 @@
*/
interface CSSRule;
-interface MediaList;
interface StyleSheet {
[Constant]
diff --git a/dom/webidl/StyleSheetApplicableStateChangeEvent.webidl b/dom/webidl/StyleSheetApplicableStateChangeEvent.webidl
index 483a386cd..cb196569f 100644
--- a/dom/webidl/StyleSheetApplicableStateChangeEvent.webidl
+++ b/dom/webidl/StyleSheetApplicableStateChangeEvent.webidl
@@ -4,7 +4,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-[Constructor(DOMString type, optional StyleSheetApplicableStateChangeEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[ChromeOnly, Constructor(DOMString type, optional StyleSheetApplicableStateChangeEventInit eventInitDict)]
interface StyleSheetApplicableStateChangeEvent : Event
{
readonly attribute CSSStyleSheet? stylesheet;
diff --git a/dom/webidl/StyleSheetChangeEvent.webidl b/dom/webidl/StyleSheetChangeEvent.webidl
index b6019d831..9d04f67cc 100644
--- a/dom/webidl/StyleSheetChangeEvent.webidl
+++ b/dom/webidl/StyleSheetChangeEvent.webidl
@@ -4,7 +4,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-[Constructor(DOMString type, optional StyleSheetChangeEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[ChromeOnly, Constructor(DOMString type, optional StyleSheetChangeEventInit eventInitDict)]
interface StyleSheetChangeEvent : Event
{
readonly attribute CSSStyleSheet? stylesheet;
diff --git a/dom/webidl/StyleSheetList.webidl b/dom/webidl/StyleSheetList.webidl
new file mode 100644
index 000000000..e6091ac29
--- /dev/null
+++ b/dom/webidl/StyleSheetList.webidl
@@ -0,0 +1,8 @@
+/* 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/. */
+
+interface StyleSheetList {
+ readonly attribute unsigned long length;
+ getter StyleSheet? item(unsigned long index);
+};
diff --git a/dom/webidl/SubtleCrypto.webidl b/dom/webidl/SubtleCrypto.webidl
new file mode 100644
index 000000000..6b8ff75ea
--- /dev/null
+++ b/dom/webidl/SubtleCrypto.webidl
@@ -0,0 +1,220 @@
+/* -*- 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/WebCryptoAPI/
+ */
+
+typedef DOMString KeyType;
+typedef DOMString KeyUsage;
+typedef DOMString NamedCurve;
+typedef Uint8Array BigInteger;
+
+/***** Algorithm dictionaries *****/
+
+dictionary Algorithm {
+ required DOMString name;
+};
+
+dictionary AesCbcParams : Algorithm {
+ required CryptoOperationData iv;
+};
+
+dictionary AesCtrParams : Algorithm {
+ required CryptoOperationData counter;
+ [EnforceRange] required octet length;
+};
+
+dictionary AesGcmParams : Algorithm {
+ required CryptoOperationData iv;
+ CryptoOperationData additionalData;
+ [EnforceRange] octet tagLength;
+};
+
+dictionary HmacImportParams : Algorithm {
+ required AlgorithmIdentifier hash;
+};
+
+dictionary Pbkdf2Params : Algorithm {
+ required CryptoOperationData salt;
+ [EnforceRange] required unsigned long iterations;
+ required AlgorithmIdentifier hash;
+};
+
+dictionary RsaHashedImportParams {
+ required AlgorithmIdentifier hash;
+};
+
+dictionary AesKeyGenParams : Algorithm {
+ [EnforceRange] required unsigned short length;
+};
+
+dictionary HmacKeyGenParams : Algorithm {
+ required AlgorithmIdentifier hash;
+ [EnforceRange] unsigned long length;
+};
+
+dictionary RsaHashedKeyGenParams : Algorithm {
+ [EnforceRange] required unsigned long modulusLength;
+ required BigInteger publicExponent;
+ required AlgorithmIdentifier hash;
+};
+
+dictionary RsaOaepParams : Algorithm {
+ CryptoOperationData label;
+};
+
+dictionary DhKeyGenParams : Algorithm {
+ required BigInteger prime;
+ required BigInteger generator;
+};
+
+dictionary EcKeyGenParams : Algorithm {
+ required NamedCurve namedCurve;
+};
+
+dictionary AesDerivedKeyParams : Algorithm {
+ [EnforceRange] required unsigned long length;
+};
+
+dictionary HmacDerivedKeyParams : HmacImportParams {
+ [EnforceRange] unsigned long length;
+};
+
+dictionary EcdhKeyDeriveParams : Algorithm {
+ required CryptoKey public;
+};
+
+dictionary DhKeyDeriveParams : Algorithm {
+ required CryptoKey public;
+};
+
+dictionary DhImportKeyParams : Algorithm {
+ required BigInteger prime;
+ required BigInteger generator;
+};
+
+dictionary EcdsaParams : Algorithm {
+ required AlgorithmIdentifier hash;
+};
+
+/***** JWK *****/
+
+dictionary RsaOtherPrimesInfo {
+ // The following fields are defined in Section 6.3.2.7 of JSON Web Algorithms
+ required DOMString r;
+ required DOMString d;
+ required DOMString t;
+};
+
+dictionary JsonWebKey {
+ // The following fields are defined in Section 3.1 of JSON Web Key
+ required DOMString kty;
+ DOMString use;
+ sequence<DOMString> key_ops;
+ DOMString alg;
+
+ // The following fields are defined in JSON Web Key Parameters Registration
+ boolean ext;
+
+ // The following fields are defined in Section 6 of JSON Web Algorithms
+ DOMString crv;
+ DOMString x;
+ DOMString y;
+ DOMString d;
+ DOMString n;
+ DOMString e;
+ DOMString p;
+ DOMString q;
+ DOMString dp;
+ DOMString dq;
+ DOMString qi;
+ sequence<RsaOtherPrimesInfo> oth;
+ DOMString k;
+};
+
+
+/***** The Main API *****/
+
+[Pref="dom.webcrypto.enabled"]
+interface CryptoKey {
+ readonly attribute KeyType type;
+ readonly attribute boolean extractable;
+ [Cached, Constant, Throws] readonly attribute object algorithm;
+ [Cached, Constant, Frozen] readonly attribute sequence<KeyUsage> usages;
+};
+
+dictionary CryptoKeyPair {
+ required CryptoKey publicKey;
+ required CryptoKey privateKey;
+};
+
+typedef DOMString KeyFormat;
+typedef (ArrayBufferView or ArrayBuffer) CryptoOperationData;
+typedef (object or DOMString) AlgorithmIdentifier;
+
+[Pref="dom.webcrypto.enabled"]
+interface SubtleCrypto {
+ [Throws]
+ Promise<any> encrypt(AlgorithmIdentifier algorithm,
+ CryptoKey key,
+ CryptoOperationData data);
+ [Throws]
+ Promise<any> decrypt(AlgorithmIdentifier algorithm,
+ CryptoKey key,
+ CryptoOperationData data);
+ [Throws]
+ Promise<any> sign(AlgorithmIdentifier algorithm,
+ CryptoKey key,
+ CryptoOperationData data);
+ [Throws]
+ Promise<any> verify(AlgorithmIdentifier algorithm,
+ CryptoKey key,
+ CryptoOperationData signature,
+ CryptoOperationData data);
+ [Throws]
+ Promise<any> digest(AlgorithmIdentifier algorithm,
+ CryptoOperationData data);
+
+ [Throws]
+ Promise<any> generateKey(AlgorithmIdentifier algorithm,
+ boolean extractable,
+ sequence<KeyUsage> keyUsages );
+ [Throws]
+ Promise<any> deriveKey(AlgorithmIdentifier algorithm,
+ CryptoKey baseKey,
+ AlgorithmIdentifier derivedKeyType,
+ boolean extractable,
+ sequence<KeyUsage> keyUsages );
+ [Throws]
+ Promise<any> deriveBits(AlgorithmIdentifier algorithm,
+ CryptoKey baseKey,
+ unsigned long length);
+
+ [Throws]
+ Promise<any> importKey(KeyFormat format,
+ object keyData,
+ AlgorithmIdentifier algorithm,
+ boolean extractable,
+ sequence<KeyUsage> keyUsages );
+ [Throws]
+ Promise<any> exportKey(KeyFormat format, CryptoKey key);
+
+ [Throws]
+ Promise<any> wrapKey(KeyFormat format,
+ CryptoKey key,
+ CryptoKey wrappingKey,
+ AlgorithmIdentifier wrapAlgorithm);
+
+ [Throws]
+ Promise<any> unwrapKey(KeyFormat format,
+ CryptoOperationData wrappedKey,
+ CryptoKey unwrappingKey,
+ AlgorithmIdentifier unwrapAlgorithm,
+ AlgorithmIdentifier unwrappedKeyAlgorithm,
+ boolean extractable,
+ sequence<KeyUsage> keyUsages );
+};
+
diff --git a/dom/webidl/TVChannel.webidl b/dom/webidl/TVChannel.webidl
new file mode 100644
index 000000000..a3a3727c3
--- /dev/null
+++ b/dom/webidl/TVChannel.webidl
@@ -0,0 +1,46 @@
+/* -*- 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://seanyhlin.github.io/TV-Manager-API/
+ */
+
+enum TVChannelType {
+ "tv",
+ "radio",
+ "data"
+};
+
+dictionary TVGetProgramsOptions {
+ unsigned long long startTime;
+ unsigned long long duration;
+};
+
+[Pref="dom.tv.enabled", CheckPermissions="tv", Func="Navigator::HasTVSupport"]
+interface TVChannel : EventTarget {
+ [Throws]
+ Promise<sequence<TVProgram>> getPrograms(optional TVGetProgramsOptions options);
+
+ [Throws]
+ Promise<TVProgram> getCurrentProgram();
+
+ readonly attribute DOMString networkId;
+
+ readonly attribute DOMString transportStreamId;
+
+ readonly attribute DOMString serviceId;
+
+ readonly attribute TVSource source;
+
+ readonly attribute TVChannelType type;
+
+ readonly attribute DOMString name;
+
+ readonly attribute DOMString number;
+
+ readonly attribute boolean isEmergency;
+
+ readonly attribute boolean isFree;
+};
diff --git a/dom/webidl/TVCurrentChannelChangedEvent.webidl b/dom/webidl/TVCurrentChannelChangedEvent.webidl
new file mode 100644
index 000000000..078f3705b
--- /dev/null
+++ b/dom/webidl/TVCurrentChannelChangedEvent.webidl
@@ -0,0 +1,20 @@
+/* -*- 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://seanyhlin.github.io/TV-Manager-API/
+ */
+
+dictionary TVCurrentChannelChangedEventInit : EventInit {
+ TVChannel? channel = null;
+};
+
+[Pref="dom.tv.enabled",
+ CheckPermissions="tv",
+ Func="Navigator::HasTVSupport",
+ Constructor(DOMString type, optional TVCurrentChannelChangedEventInit eventInitDict)]
+interface TVCurrentChannelChangedEvent : Event {
+ readonly attribute TVChannel? channel;
+};
diff --git a/dom/webidl/TVCurrentSourceChangedEvent.webidl b/dom/webidl/TVCurrentSourceChangedEvent.webidl
new file mode 100644
index 000000000..4ffdf5479
--- /dev/null
+++ b/dom/webidl/TVCurrentSourceChangedEvent.webidl
@@ -0,0 +1,20 @@
+/* -*- 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://seanyhlin.github.io/TV-Manager-API/
+ */
+
+dictionary TVCurrentSourceChangedEventInit : EventInit {
+ TVSource? source = null;
+};
+
+[Pref="dom.tv.enabled",
+ CheckPermissions="tv",
+ Func="Navigator::HasTVSupport",
+ Constructor(DOMString type, optional TVCurrentSourceChangedEventInit eventInitDict)]
+interface TVCurrentSourceChangedEvent : Event {
+ readonly attribute TVSource? source;
+};
diff --git a/dom/webidl/TVEITBroadcastedEvent.webidl b/dom/webidl/TVEITBroadcastedEvent.webidl
new file mode 100644
index 000000000..7e8867d11
--- /dev/null
+++ b/dom/webidl/TVEITBroadcastedEvent.webidl
@@ -0,0 +1,20 @@
+/* -*- 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://seanyhlin.github.io/TV-Manager-API/
+ */
+
+dictionary TVEITBroadcastedEventInit : EventInit {
+ sequence<TVProgram> programs = [];
+};
+
+[Pref="dom.tv.enabled",
+ CheckPermissions="tv",
+ Func="Navigator::HasTVSupport",
+ Constructor(DOMString type, optional TVEITBroadcastedEventInit eventInitDict)]
+interface TVEITBroadcastedEvent : Event {
+ [Pure, Cached] readonly attribute sequence<TVProgram> programs;
+};
diff --git a/dom/webidl/TVManager.webidl b/dom/webidl/TVManager.webidl
new file mode 100644
index 000000000..987ee0907
--- /dev/null
+++ b/dom/webidl/TVManager.webidl
@@ -0,0 +1,14 @@
+/* -*- 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://seanyhlin.github.io/TV-Manager-API/
+ */
+
+[Pref="dom.tv.enabled", CheckPermissions="tv", Func="Navigator::HasTVSupport"]
+interface TVManager : EventTarget {
+ [Throws]
+ Promise<sequence<TVTuner>> getTuners();
+};
diff --git a/dom/webidl/TVProgram.webidl b/dom/webidl/TVProgram.webidl
new file mode 100644
index 000000000..f15c9f9d2
--- /dev/null
+++ b/dom/webidl/TVProgram.webidl
@@ -0,0 +1,29 @@
+/* -*- 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://seanyhlin.github.io/TV-Manager-API/
+ */
+
+[Pref="dom.tv.enabled", CheckPermissions="tv", Func="Navigator::HasTVSupport"]
+interface TVProgram {
+ sequence<DOMString> getAudioLanguages();
+
+ sequence<DOMString> getSubtitleLanguages();
+
+ readonly attribute DOMString eventId;
+
+ readonly attribute TVChannel channel;
+
+ readonly attribute DOMString title;
+
+ readonly attribute unsigned long long startTime;
+
+ readonly attribute unsigned long long duration;
+
+ readonly attribute DOMString? description;
+
+ readonly attribute DOMString? rating;
+};
diff --git a/dom/webidl/TVScanningStateChangedEvent.webidl b/dom/webidl/TVScanningStateChangedEvent.webidl
new file mode 100644
index 000000000..b0523dba2
--- /dev/null
+++ b/dom/webidl/TVScanningStateChangedEvent.webidl
@@ -0,0 +1,29 @@
+/* -*- 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://seanyhlin.github.io/TV-Manager-API/
+ */
+
+enum TVScanningState {
+ "cleared",
+ "scanned",
+ "completed",
+ "stopped"
+};
+
+dictionary TVScanningStateChangedEventInit : EventInit {
+ TVScanningState state = "cleared";
+ TVChannel? channel = null;
+};
+
+[Pref="dom.tv.enabled",
+ CheckPermissions="tv",
+ Func="Navigator::HasTVSupport",
+ Constructor(DOMString type, optional TVScanningStateChangedEventInit eventInitDict)]
+interface TVScanningStateChangedEvent : Event {
+ readonly attribute TVScanningState state;
+ readonly attribute TVChannel? channel;
+};
diff --git a/dom/webidl/TVSource.webidl b/dom/webidl/TVSource.webidl
new file mode 100644
index 000000000..99cc8bea0
--- /dev/null
+++ b/dom/webidl/TVSource.webidl
@@ -0,0 +1,61 @@
+/* -*- 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://seanyhlin.github.io/TV-Manager-API/
+ */
+
+enum TVSourceType {
+ "dvb-t",
+ "dvb-t2",
+ "dvb-c",
+ "dvb-c2",
+ "dvb-s",
+ "dvb-s2",
+ "dvb-h",
+ "dvb-sh",
+ "atsc",
+ "atsc-m/h",
+ "isdb-t",
+ "isdb-tb",
+ "isdb-s",
+ "isdb-c",
+ "1seg",
+ "dtmb",
+ "cmmb",
+ "t-dmb",
+ "s-dmb"
+};
+
+dictionary TVStartScanningOptions {
+ boolean isRescanned;
+};
+
+[Pref="dom.tv.enabled", CheckPermissions="tv", Func="Navigator::HasTVSupport"]
+interface TVSource : EventTarget {
+ [Throws]
+ Promise<sequence<TVChannel>> getChannels();
+
+ [Throws]
+ Promise<void> setCurrentChannel(DOMString channelNumber);
+
+ [Throws]
+ Promise<void> startScanning(optional TVStartScanningOptions options);
+
+ [Throws]
+ Promise<void> stopScanning();
+
+ readonly attribute TVTuner tuner;
+
+ readonly attribute TVSourceType type;
+
+ readonly attribute boolean isScanning;
+
+ readonly attribute TVChannel? currentChannel;
+
+ attribute EventHandler oncurrentchannelchanged;
+ attribute EventHandler oneitbroadcasted;
+ attribute EventHandler onscanningstatechanged;
+};
diff --git a/dom/webidl/TVTuner.webidl b/dom/webidl/TVTuner.webidl
new file mode 100644
index 000000000..cb03ded8b
--- /dev/null
+++ b/dom/webidl/TVTuner.webidl
@@ -0,0 +1,28 @@
+/* -*- 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://seanyhlin.github.io/TV-Manager-API/
+ */
+
+[Pref="dom.tv.enabled", CheckPermissions="tv", Func="Navigator::HasTVSupport"]
+interface TVTuner : EventTarget {
+ [Throws]
+ sequence<TVSourceType> getSupportedSourceTypes();
+
+ [Throws]
+ Promise<sequence<TVSource>> getSources();
+
+ [Throws]
+ Promise<void> setCurrentSource(TVSourceType sourceType);
+
+ readonly attribute DOMString id;
+
+ readonly attribute TVSource? currentSource;
+
+ readonly attribute MediaStream? stream;
+
+ attribute EventHandler oncurrentsourcechanged;
+};
diff --git a/dom/webidl/Telephony.webidl b/dom/webidl/Telephony.webidl
new file mode 100644
index 000000000..5eb460b74
--- /dev/null
+++ b/dom/webidl/Telephony.webidl
@@ -0,0 +1,72 @@
+/* -*- 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/.
+ */
+
+[Pref="dom.telephony.enabled"]
+interface Telephony : EventTarget {
+ /**
+ * There are multiple telephony services in multi-sim architecture. We use
+ * |serviceId| to indicate the target telephony service. If not specified,
+ * the implementation MUST use the default service.
+ *
+ * Possible values of |serviceId| are 0 ~ (number of services - 1), which is
+ * simply the index of a service. Get number of services by acquiring
+ * |navigator.mozMobileConnections.length|.
+ */
+
+ /**
+ * Make a phone call or send the mmi code depending on the number provided.
+ *
+ * TelephonyCall - for call setup
+ * MMICall - for MMI code
+ */
+ [Throws]
+ Promise<(TelephonyCall or MMICall)> dial(DOMString number, optional unsigned long serviceId);
+
+ [Throws]
+ Promise<TelephonyCall> dialEmergency(DOMString number, optional unsigned long serviceId);
+
+/**
+ * Send a series of DTMF tones.
+ *
+ * @param tones
+ * DTMF chars.
+ * @param pauseDuraton (ms) [optional]
+ * Time to wait before sending tones. Default value is 3000 ms.
+ * @param toneDuration (ms) [optional]
+ * Duration of each tone. Default value is 70 ms.
+ * @param serviceId [optional]
+ * Default value is as user setting dom.telephony.defaultServiceId.
+ */
+ [Throws]
+ Promise<void> sendTones(DOMString tones, optional unsigned long pauseDuration = 3000, optional unsigned long toneDuration = 70, optional unsigned long serviceId);
+
+ [Throws]
+ void startTone(DOMString tone, optional unsigned long serviceId);
+
+ [Throws]
+ void stopTone(optional unsigned long serviceId);
+
+ [Throws]
+ attribute boolean muted;
+
+ [Throws]
+ attribute boolean speakerEnabled;
+
+ readonly attribute (TelephonyCall or TelephonyCallGroup)? active;
+
+ // A call is contained either in Telephony or in TelephonyCallGroup.
+ readonly attribute CallsList calls;
+ readonly attribute TelephonyCallGroup conferenceGroup;
+
+ // Async notification that object initialization is done.
+ [Throws]
+ readonly attribute Promise<void> ready;
+
+ attribute EventHandler onincoming;
+ attribute EventHandler oncallschanged;
+ attribute EventHandler onremoteheld;
+ attribute EventHandler onremoteresumed;
+};
diff --git a/dom/webidl/TelephonyCall.webidl b/dom/webidl/TelephonyCall.webidl
new file mode 100644
index 000000000..d03c9f269
--- /dev/null
+++ b/dom/webidl/TelephonyCall.webidl
@@ -0,0 +1,55 @@
+/* -*- 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/.
+ */
+
+[Pref="dom.telephony.enabled"]
+interface TelephonyCall : EventTarget {
+ // Indicate which service the call comes from.
+ readonly attribute unsigned long serviceId;
+
+ readonly attribute TelephonyCallId id;
+
+ // In CDMA networks, the 2nd waiting call shares the connection with the 1st
+ // call. We need an additional attribute for the CDMA waiting call.
+ readonly attribute TelephonyCallId? secondId;
+
+ readonly attribute DOMString state;
+
+ // The property "emergency" indicates whether the call number is an emergency
+ // number. Only the outgoing call could have a value with true and it is
+ // available after dialing state.
+ readonly attribute boolean emergency;
+
+ // Indicate whether the call state can be switched between "connected" and
+ // "held".
+ readonly attribute boolean switchable;
+
+ // Indicate whether the call can be added into TelephonyCallGroup.
+ readonly attribute boolean mergeable;
+
+ readonly attribute DOMError? error;
+
+ readonly attribute TelephonyCallGroup? group;
+
+ [NewObject]
+ Promise<void> answer();
+ [NewObject]
+ Promise<void> hangUp();
+ [NewObject]
+ Promise<void> hold();
+ [NewObject]
+ Promise<void> resume();
+
+ attribute EventHandler onstatechange;
+ attribute EventHandler ondialing;
+ attribute EventHandler onalerting;
+ attribute EventHandler onconnected;
+ attribute EventHandler ondisconnected;
+ attribute EventHandler onheld;
+ attribute EventHandler onerror;
+
+ // Fired whenever the group attribute changes.
+ attribute EventHandler ongroupchange;
+};
diff --git a/dom/webidl/TelephonyCallGroup.webidl b/dom/webidl/TelephonyCallGroup.webidl
new file mode 100644
index 000000000..41eec1e18
--- /dev/null
+++ b/dom/webidl/TelephonyCallGroup.webidl
@@ -0,0 +1,38 @@
+/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
+/* vim: set ts=2 et sw=2 tw=40: */
+/* 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/. */
+
+[Pref="dom.telephony.enabled"]
+interface TelephonyCallGroup : EventTarget {
+ readonly attribute CallsList calls;
+
+ [NewObject, Throws]
+ Promise<void> add(TelephonyCall call);
+
+ [NewObject, Throws]
+ Promise<void> add(TelephonyCall call, TelephonyCall secondCall);
+
+ [NewObject, Throws]
+ Promise<void> remove(TelephonyCall call);
+
+ [NewObject]
+ Promise<void> hangUp();
+
+ [NewObject, Throws]
+ Promise<void> hold();
+
+ [NewObject, Throws]
+ Promise<void> resume();
+
+ readonly attribute DOMString state;
+
+ attribute EventHandler onstatechange;
+ attribute EventHandler onconnected;
+ attribute EventHandler onholding;
+ attribute EventHandler onheld;
+ attribute EventHandler onresuming;
+ attribute EventHandler oncallschanged;
+ attribute EventHandler onerror;
+};
diff --git a/dom/webidl/TelephonyCallId.webidl b/dom/webidl/TelephonyCallId.webidl
new file mode 100644
index 000000000..1cc8201d3
--- /dev/null
+++ b/dom/webidl/TelephonyCallId.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/.
+ */
+
+enum CallIdPresentation {
+ "allowed",
+ // Call number/name has been withheld by the calling party.
+ "restricted",
+ // Call number is not available due to calling party being of type payphone.
+ "payphone",
+ // Call number/name is not available due to networking problems or other reason.
+ "unknown"
+};
+
+[Pref="dom.telephony.enabled"]
+interface TelephonyCallId {
+ // It is an empty string when "numberPresentation" is not "allowed."
+ readonly attribute DOMString number;
+
+ // This attribute is not relevant for outgoing calls. Default value is
+ // "allowed."
+ readonly attribute CallIdPresentation numberPresentation;
+
+ // This attribute is not relevant for outgoing calls. It is an empty string
+ // 1) when the call is outgoing, or 2) when the call is incoming and
+ // "namePresentation" is not "allowed." However, it could still be empty
+ // even the call is incoming and "namePresentation" is "allowed."
+ readonly attribute DOMString name;
+
+ // This attribute is not relevant for outgoing calls. Default value is
+ // "allowed."
+ readonly attribute CallIdPresentation namePresentation;
+};
diff --git a/dom/webidl/TestInterfaceJS.webidl b/dom/webidl/TestInterfaceJS.webidl
new file mode 100644
index 000000000..3f38cafdf
--- /dev/null
+++ b/dom/webidl/TestInterfaceJS.webidl
@@ -0,0 +1,69 @@
+/* -*- 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/.
+ */
+
+dictionary TestInterfaceJSUnionableDictionary {
+ object objectMember;
+ any anyMember;
+};
+
+[JSImplementation="@mozilla.org/dom/test-interface-js;1",
+ Pref="dom.expose_test_interfaces",
+ Constructor(optional any anyArg, optional object objectArg, optional TestInterfaceJSDictionary dictionaryArg)]
+interface TestInterfaceJS {
+ readonly attribute any anyArg;
+ readonly attribute object objectArg;
+ [Cached, Pure] readonly attribute TestInterfaceJSDictionary dictionaryArg;
+ attribute any anyAttr;
+ attribute object objectAttr;
+ [Cached, Pure] attribute TestInterfaceJSDictionary dictionaryAttr;
+ any pingPongAny(any arg);
+ object pingPongObject(object obj);
+ any pingPongObjectOrString((object or DOMString) objOrString);
+ TestInterfaceJSDictionary pingPongDictionary(optional TestInterfaceJSDictionary dict);
+ long pingPongDictionaryOrLong(optional (TestInterfaceJSUnionableDictionary or long) dictOrLong);
+ DOMString pingPongMap(MozMap<any> map);
+ long objectSequenceLength(sequence<object> seq);
+ long anySequenceLength(sequence<any> seq);
+
+ // For testing bug 968335.
+ DOMString getCallerPrincipal();
+
+ DOMString convertSVS(USVString svs);
+
+ (TestInterfaceJS or long) pingPongUnion((TestInterfaceJS or long) something);
+ (DOMString or TestInterfaceJS?) pingPongUnionContainingNull((TestInterfaceJS? or DOMString) something);
+ (TestInterfaceJS or long)? pingPongNullableUnion((TestInterfaceJS or long)? something);
+ (Location or TestInterfaceJS) returnBadUnion();
+
+ [Cached, Pure]
+ readonly attribute short cachedAttr;
+ void setCachedAttr(short n);
+ void clearCachedAttrCache();
+
+ // Test for sequence overloading and union behavior
+ void testSequenceOverload(sequence<DOMString> arg);
+ void testSequenceOverload(DOMString arg);
+
+ void testSequenceUnion((sequence<DOMString> or DOMString) arg);
+
+ // Tests for exception-throwing behavior
+ [Throws]
+ void testThrowDOMError();
+
+ [Throws]
+ void testThrowDOMException();
+
+ // Tests for promise-rejection behavior
+ Promise<void> testPromiseWithThrowingChromePromiseInit();
+ Promise<void> testPromiseWithThrowingContentPromiseInit(PromiseInit func);
+ Promise<void> testPromiseWithDOMExceptionThrowingPromiseInit();
+ Promise<void> testPromiseWithThrowingChromeThenFunction();
+ Promise<void> testPromiseWithThrowingContentThenFunction(AnyCallback func);
+ Promise<void> testPromiseWithDOMExceptionThrowingThenFunction();
+ Promise<void> testPromiseWithThrowingChromeThenable();
+ Promise<void> testPromiseWithThrowingContentThenable(object thenable);
+ Promise<void> testPromiseWithDOMExceptionThrowingThenable();
+};
diff --git a/dom/webidl/TestInterfaceJSDictionaries.webidl b/dom/webidl/TestInterfaceJSDictionaries.webidl
new file mode 100644
index 000000000..366864a8d
--- /dev/null
+++ b/dom/webidl/TestInterfaceJSDictionaries.webidl
@@ -0,0 +1,27 @@
+/* -*- 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/.
+ */
+
+//
+// These dictionaries are in a separate WebIDL file to avoid circular include
+// problems. One of the dictionary includes a union as a member, so that
+// dictionary's header needs to include UnionTypes.h. But the API in
+// TestInterfaceJS also declares a union of dictionaries, so _that_
+// dictionary's header needs to be included _by_ UnionTypes.h. The solution
+// is to separate those two dictionaries into separate header files.
+//
+
+dictionary TestInterfaceJSDictionary2 {
+ object innerObject;
+};
+
+dictionary TestInterfaceJSDictionary {
+ TestInterfaceJSDictionary2 innerDictionary;
+ object objectMember;
+ any anyMember;
+ (object or DOMString) objectOrStringMember;
+ sequence<any> anySequenceMember;
+};
+
diff --git a/dom/webidl/Text.webidl b/dom/webidl/Text.webidl
index e32ef71b7..dcd25cec3 100644
--- a/dom/webidl/Text.webidl
+++ b/dom/webidl/Text.webidl
@@ -17,3 +17,5 @@ interface Text : CharacterData {
[Throws]
readonly attribute DOMString wholeText;
};
+
+Text implements GeometryUtils;
diff --git a/dom/webidl/TextDecoder.webidl b/dom/webidl/TextDecoder.webidl
index 104d43834..3fff4a255 100644
--- a/dom/webidl/TextDecoder.webidl
+++ b/dom/webidl/TextDecoder.webidl
@@ -10,14 +10,15 @@
* http://creativecommons.org/publicdomain/zero/1.0/
*/
-[Constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options)]
+[Constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options),
+ Exposed=(Window,Worker,System)]
interface TextDecoder {
[Constant]
readonly attribute DOMString encoding;
+ [Constant]
+ readonly attribute boolean fatal;
[Throws]
- DOMString decode();
- [Throws]
- DOMString decode(ArrayBufferView input, optional TextDecodeOptions options);
+ USVString decode(optional BufferSource input, optional TextDecodeOptions options);
};
dictionary TextDecoderOptions {
diff --git a/dom/webidl/TextEncoder.webidl b/dom/webidl/TextEncoder.webidl
index b71df237b..a031e6d26 100644
--- a/dom/webidl/TextEncoder.webidl
+++ b/dom/webidl/TextEncoder.webidl
@@ -10,15 +10,11 @@
* http://creativecommons.org/publicdomain/zero/1.0/
*/
-[Constructor(optional DOMString utfLabel = "utf-8")]
+[Constructor(optional DOMString utfLabel = "utf-8"),
+ Exposed=(Window,Worker,System)]
interface TextEncoder {
[Constant]
readonly attribute DOMString encoding;
- [Throws]
- Uint8Array encode(optional DOMString input = "", optional TextEncodeOptions options);
+ [NewObject]
+ Uint8Array encode(optional USVString input = "");
};
-
-dictionary TextEncodeOptions {
- boolean stream = false;
-};
-
diff --git a/dom/webidl/TextTrack.webidl b/dom/webidl/TextTrack.webidl
index f2a949663..8743efd18 100644
--- a/dom/webidl/TextTrack.webidl
+++ b/dom/webidl/TextTrack.webidl
@@ -26,6 +26,8 @@ interface TextTrack : EventTarget {
readonly attribute TextTrackKind kind;
readonly attribute DOMString label;
readonly attribute DOMString language;
+
+ readonly attribute DOMString id;
readonly attribute DOMString inBandMetadataTrackDispatchType;
attribute TextTrackMode mode;
@@ -33,9 +35,15 @@ interface TextTrack : EventTarget {
readonly attribute TextTrackCueList? cues;
readonly attribute TextTrackCueList? activeCues;
- void addCue(TextTrackCue cue);
- void removeCue(TextTrackCue cue);
+ void addCue(VTTCue cue);
+ [Throws]
+ void removeCue(VTTCue cue);
+
+ //(Not implemented)attribute EventHandler oncuechange;
+};
- [SetterThrows]
- attribute EventHandler oncuechange;
+// Mozilla Extensions
+partial interface TextTrack {
+ [ChromeOnly]
+ readonly attribute TextTrackList? textTrackList;
};
diff --git a/dom/webidl/TextTrackCueList.webidl b/dom/webidl/TextTrackCueList.webidl
index ee24160b6..0cc0fd6e2 100644
--- a/dom/webidl/TextTrackCueList.webidl
+++ b/dom/webidl/TextTrackCueList.webidl
@@ -10,6 +10,6 @@
[Pref="media.webvtt.enabled"]
interface TextTrackCueList {
readonly attribute unsigned long length;
- getter TextTrackCue (unsigned long index);
- TextTrackCue? getCueById(DOMString id);
+ getter VTTCue (unsigned long index);
+ VTTCue? getCueById(DOMString id);
};
diff --git a/dom/webidl/TextTrackList.webidl b/dom/webidl/TextTrackList.webidl
index 49ec493a1..48022e9d4 100644
--- a/dom/webidl/TextTrackList.webidl
+++ b/dom/webidl/TextTrackList.webidl
@@ -11,9 +11,15 @@
interface TextTrackList : EventTarget {
readonly attribute unsigned long length;
getter TextTrack (unsigned long index);
+ TextTrack? getTrackById(DOMString id);
- [SetterThrows]
+ attribute EventHandler onchange;
attribute EventHandler onaddtrack;
- [SetterThrows]
attribute EventHandler onremovetrack;
};
+
+// Mozilla extensions
+partial interface TextTrackList {
+ [ChromeOnly]
+ readonly attribute HTMLMediaElement? mediaElement;
+};
diff --git a/dom/webidl/TimeEvent.webidl b/dom/webidl/TimeEvent.webidl
index 20cd9c982..40e7a0beb 100644
--- a/dom/webidl/TimeEvent.webidl
+++ b/dom/webidl/TimeEvent.webidl
@@ -10,13 +10,11 @@
* liability, trademark and document use rules apply.
*/
-interface WindowProxy;
-
interface TimeEvent : Event
{
readonly attribute long detail;
readonly attribute WindowProxy? view;
void initTimeEvent(DOMString aType,
- WindowProxy? aView,
+ Window? aView,
long aDetail);
};
diff --git a/dom/webidl/Touch.webidl b/dom/webidl/Touch.webidl
index 13866a072..128f38c61 100644
--- a/dom/webidl/Touch.webidl
+++ b/dom/webidl/Touch.webidl
@@ -10,18 +10,18 @@
* liability, trademark and document use rules apply.
*/
-[PrefControlled]
+[Func="mozilla::dom::Touch::PrefEnabled"]
interface Touch {
- readonly attribute long identifier;
- readonly attribute EventTarget target;
- readonly attribute long screenX;
- readonly attribute long screenY;
- readonly attribute long clientX;
- readonly attribute long clientY;
- readonly attribute long pageX;
- readonly attribute long pageY;
- readonly attribute long radiusX;
- readonly attribute long radiusY;
- readonly attribute float rotationAngle;
- readonly attribute float force;
+ readonly attribute long identifier;
+ readonly attribute EventTarget? target;
+ readonly attribute long screenX;
+ readonly attribute long screenY;
+ readonly attribute long clientX;
+ readonly attribute long clientY;
+ readonly attribute long pageX;
+ readonly attribute long pageY;
+ readonly attribute long radiusX;
+ readonly attribute long radiusY;
+ readonly attribute float rotationAngle;
+ readonly attribute float force;
};
diff --git a/dom/webidl/TouchEvent.webidl b/dom/webidl/TouchEvent.webidl
index e3ec7619a..6e9a718f7 100644
--- a/dom/webidl/TouchEvent.webidl
+++ b/dom/webidl/TouchEvent.webidl
@@ -4,10 +4,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-interface TouchList;
-interface WindowProxy;
-
-[PrefControlled]
+[Func="mozilla::dom::TouchEvent::PrefEnabled"]
interface TouchEvent : UIEvent {
readonly attribute TouchList touches;
readonly attribute TouchList targetTouches;
@@ -22,7 +19,7 @@ interface TouchEvent : UIEvent {
void initTouchEvent(DOMString type,
boolean canBubble,
boolean cancelable,
- WindowProxy? view,
+ Window? view,
long detail,
boolean ctrlKey,
boolean altKey,
diff --git a/dom/webidl/TouchList.webidl b/dom/webidl/TouchList.webidl
index 643ba0ecb..56d7d68f1 100644
--- a/dom/webidl/TouchList.webidl
+++ b/dom/webidl/TouchList.webidl
@@ -4,14 +4,20 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*
* The origin of this IDL file is
- * http://dvcs.w3.org/hg/webevents/raw-file/default/touchevents.html
+ * https://dvcs.w3.org/hg/webevents/raw-file/v1/touchevents.html
*
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
* liability, trademark and document use rules apply.
*/
+[Func="mozilla::dom::TouchList::PrefEnabled"]
interface TouchList {
+ [Pure]
readonly attribute unsigned long length;
getter Touch? item(unsigned long index);
- Touch identifiedTouch(long identifier);
+};
+
+/* Mozilla extension. */
+partial interface TouchList {
+ Touch? identifiedTouch(long identifier);
};
diff --git a/dom/webidl/TrackEvent.webidl b/dom/webidl/TrackEvent.webidl
new file mode 100644
index 000000000..2daa2f457
--- /dev/null
+++ b/dom/webidl/TrackEvent.webidl
@@ -0,0 +1,19 @@
+/* -*- 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.whatwg.org/specs/web-apps/current-work/#trackevent
+ */
+
+[Constructor(DOMString type, optional TrackEventInit eventInitDict)]
+interface TrackEvent : Event
+{
+ readonly attribute (VideoTrack or AudioTrack or TextTrack)? track;
+};
+
+dictionary TrackEventInit : EventInit
+{
+ (VideoTrack or AudioTrack or TextTrack)? track = null;
+};
diff --git a/dom/webidl/TreeBoxObject.webidl b/dom/webidl/TreeBoxObject.webidl
new file mode 100644
index 000000000..8ca0a5713
--- /dev/null
+++ b/dom/webidl/TreeBoxObject.webidl
@@ -0,0 +1,207 @@
+
+/* -*- 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/.
+ */
+
+interface MozTreeView;
+interface nsIScriptableRegion;
+
+dictionary TreeCellInfo {
+ long row = 0;
+ TreeColumn? col = null;
+ DOMString childElt = "";
+};
+
+[NoInterfaceObject]
+interface TreeBoxObject : BoxObject {
+
+ /**
+ * Obtain the columns.
+ */
+ readonly attribute TreeColumns? columns;
+
+ /**
+ * The view that backs the tree and that supplies it with its data.
+ * It is dynamically settable, either using a view attribute on the
+ * tree tag or by setting this attribute to a new value.
+ */
+ [SetterThrows]
+ attribute MozTreeView? view;
+
+ /**
+ * Whether or not we are currently focused.
+ */
+ attribute boolean focused;
+
+ /**
+ * Obtain the treebody content node
+ */
+ readonly attribute Element? treeBody;
+
+ /**
+ * Obtain the height of a row.
+ */
+ readonly attribute long rowHeight;
+
+ /**
+ * Obtain the width of a row.
+ */
+ readonly attribute long rowWidth;
+
+ /**
+ * Get the pixel position of the horizontal scrollbar.
+ */
+ readonly attribute long horizontalPosition;
+
+ /**
+ * Return the region for the visible parts of the selection, in device pixels
+ */
+ readonly attribute nsIScriptableRegion selectionRegion;
+
+ /**
+ * Get the index of the first visible row.
+ */
+ long getFirstVisibleRow();
+
+ /**
+ * Get the index of the last visible row.
+ */
+ long getLastVisibleRow();
+
+ /**
+ * Gets the number of possible visible rows.
+ */
+ long getPageLength();
+
+ /**
+ * Ensures that a row at a given index is visible.
+ */
+ void ensureRowIsVisible(long index);
+
+ /**
+ * Ensures that a given cell in the tree is visible.
+ */
+ void ensureCellIsVisible(long row, TreeColumn? col);
+
+ /**
+ * Scrolls such that the row at index is at the top of the visible view.
+ */
+ void scrollToRow(long index);
+
+ /**
+ * Scroll the tree up or down by numLines lines. Positive
+ * values move down in the tree. Prevents scrolling off the
+ * end of the tree.
+ */
+ void scrollByLines(long numLines);
+
+ /**
+ * Scroll the tree up or down by numPages pages. A page
+ * is considered to be the amount displayed by the tree.
+ * Positive values move down in the tree. Prevents scrolling
+ * off the end of the tree.
+ */
+ void scrollByPages(long numPages);
+
+ /**
+ * Scrolls such that a given cell is visible (if possible)
+ * at the top left corner of the visible view.
+ */
+ void scrollToCell(long row, TreeColumn? col);
+
+ /**
+ * Scrolls horizontally so that the specified column is
+ * at the left of the view (if possible).
+ */
+ void scrollToColumn(TreeColumn? col);
+
+ /**
+ * Scroll to a specific horizontal pixel position.
+ */
+ void scrollToHorizontalPosition(long horizontalPosition);
+
+ /**
+ * Invalidation methods for fine-grained painting control.
+ */
+ void invalidate();
+ void invalidateColumn(TreeColumn? col);
+ void invalidateRow(long index);
+ void invalidateCell(long row, TreeColumn? col);
+ void invalidateRange(long startIndex, long endIndex);
+ void invalidateColumnRange(long startIndex, long endIndex, TreeColumn? col);
+
+ /**
+ * A hit test that can tell you what row the mouse is over.
+ * returns -1 for invalid mouse coordinates.
+ *
+ * The coordinate system is the client coordinate system for the
+ * document this boxObject lives in, and the units are CSS pixels.
+ */
+ long getRowAt(long x, long y);
+
+ /**
+ * A hit test that can tell you what cell the mouse is over.
+ * TreeCellInfo.row is the row index hit, returns -1 for invalid mouse
+ * coordinates. TreeCellInfo.col is the column hit.
+ * TreeCellInfo.childElt is the pseudoelement hit: this can have values of
+ * "cell", "twisty", "image", and "text".
+ *
+ * The coordinate system is the client coordinate system for the
+ * document this boxObject lives in, and the units are CSS pixels.
+ */
+ [Throws]
+ TreeCellInfo getCellAt(long x, long y);
+
+ /**
+ * DEPRECATED: please use above version
+ */
+ [Throws]
+ void getCellAt(long x, long y, object row, object column, object childElt);
+
+ /**
+ * Find the coordinates of an element within a specific cell.
+ */
+ [Throws]
+ DOMRect? getCoordsForCellItem(long row, TreeColumn col, DOMString element);
+
+ /**
+ * DEPRECATED: Please use above version
+ */
+ [Throws]
+ void getCoordsForCellItem(long row, TreeColumn col, DOMString element,
+ object x, object y, object width, object height);
+
+ /**
+ * Determine if the text of a cell is being cropped or not.
+ */
+ [Throws]
+ boolean isCellCropped(long row, TreeColumn? col);
+
+ /**
+ * The view is responsible for calling these notification methods when
+ * rows are added or removed. Index is the position at which the new
+ * rows were added or at which rows were removed. For
+ * non-contiguous additions/removals, this method should be called multiple times.
+ */
+ void rowCountChanged(long index, long count);
+
+ /**
+ * Notify the tree that the view is about to perform a batch
+ * update, that is, add, remove or invalidate several rows at once.
+ * This must be followed by calling endUpdateBatch(), otherwise the tree
+ * will get out of sync.
+ */
+ void beginUpdateBatch();
+
+ /**
+ * Notify the tree that the view has completed a batch update.
+ */
+ void endUpdateBatch();
+
+ /**
+ * Called on a theme switch to flush out the tree's style and image caches.
+ */
+ void clearStyleAndImageCaches();
+};
diff --git a/dom/webidl/TreeColumn.webidl b/dom/webidl/TreeColumn.webidl
new file mode 100644
index 000000000..a4e02f579
--- /dev/null
+++ b/dom/webidl/TreeColumn.webidl
@@ -0,0 +1,35 @@
+/* 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/. */
+
+[Func="IsChromeOrXBL"]
+interface TreeColumn {
+ [Throws]
+ readonly attribute Element? element;
+
+ readonly attribute TreeColumns? columns;
+
+ [Throws]
+ readonly attribute long x;
+ [Throws]
+ readonly attribute long width;
+
+ readonly attribute DOMString id;
+ readonly attribute long index;
+
+ readonly attribute boolean primary;
+ readonly attribute boolean cycler;
+ readonly attribute boolean editable;
+ readonly attribute boolean selectable;
+
+ const short TYPE_TEXT = 1;
+ const short TYPE_CHECKBOX = 2;
+ const short TYPE_PROGRESSMETER = 3;
+ readonly attribute short type;
+
+ TreeColumn? getNext();
+ TreeColumn? getPrevious();
+
+ [Throws]
+ void invalidate();
+};
diff --git a/dom/webidl/TreeColumns.webidl b/dom/webidl/TreeColumns.webidl
index be3364b84..5958d1235 100644
--- a/dom/webidl/TreeColumns.webidl
+++ b/dom/webidl/TreeColumns.webidl
@@ -2,15 +2,12 @@
* 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/. */
-interface MozTreeBoxObject;
-interface MozTreeColumn;
-
-[ChromeOnly]
+[Func="IsChromeOrXBL"]
interface TreeColumns {
/**
* The tree widget for these columns.
*/
- readonly attribute MozTreeBoxObject? tree;
+ readonly attribute TreeBoxObject? tree;
/**
* The number of columns.
@@ -26,26 +23,26 @@ interface TreeColumns {
/**
* Get the first/last column.
*/
- MozTreeColumn? getFirstColumn();
- MozTreeColumn? getLastColumn();
+ TreeColumn? getFirstColumn();
+ TreeColumn? getLastColumn();
/**
* Attribute based column getters.
*/
- MozTreeColumn? getPrimaryColumn();
- MozTreeColumn? getSortedColumn();
- MozTreeColumn? getKeyColumn();
+ TreeColumn? getPrimaryColumn();
+ TreeColumn? getSortedColumn();
+ TreeColumn? getKeyColumn();
/**
* Get the column for the given element.
*/
- MozTreeColumn? getColumnFor(Element? element);
+ TreeColumn? getColumnFor(Element? element);
/**
* Parametric column getters.
*/
- getter MozTreeColumn? getNamedColumn(DOMString id);
- getter MozTreeColumn? getColumnAt(unsigned long index);
+ getter TreeColumn? getNamedColumn(DOMString name);
+ getter TreeColumn? getColumnAt(unsigned long index);
/**
* This method is called whenever a treecol is added or removed and
diff --git a/dom/webidl/UDPMessageEvent.webidl b/dom/webidl/UDPMessageEvent.webidl
new file mode 100644
index 000000000..4cbf0300e
--- /dev/null
+++ b/dom/webidl/UDPMessageEvent.webidl
@@ -0,0 +1,24 @@
+/* -*- 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/raw-sockets/#interface-udpmessageevent
+ */
+
+//Bug 1056444: This interface should be removed after UDPSocket.input/UDPSocket.output are ready.
+[Constructor(DOMString type, optional UDPMessageEventInit eventInitDict),
+ Pref="dom.udpsocket.enabled",
+ CheckPermissions="udp-socket"]
+interface UDPMessageEvent : Event {
+ readonly attribute DOMString remoteAddress;
+ readonly attribute unsigned short remotePort;
+ readonly attribute any data;
+};
+
+dictionary UDPMessageEventInit : EventInit {
+ DOMString remoteAddress = "";
+ unsigned short remotePort = 0;
+ any data = null;
+};
diff --git a/dom/webidl/UDPSocket.webidl b/dom/webidl/UDPSocket.webidl
new file mode 100644
index 000000000..51ac7c84b
--- /dev/null
+++ b/dom/webidl/UDPSocket.webidl
@@ -0,0 +1,40 @@
+/* -*- 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/2012/sysapps/tcp-udp-sockets/#interface-udpsocket
+ * http://www.w3.org/2012/sysapps/tcp-udp-sockets/#dictionary-udpoptions
+ */
+
+dictionary UDPOptions {
+ DOMString localAddress;
+ unsigned short localPort;
+ DOMString remoteAddress;
+ unsigned short remotePort;
+ boolean addressReuse = true;
+ boolean loopback = false;
+};
+
+[Constructor (optional UDPOptions options),
+ Pref="dom.udpsocket.enabled",
+ CheckPermissions="udp-socket"]
+interface UDPSocket : EventTarget {
+ readonly attribute DOMString? localAddress;
+ readonly attribute unsigned short? localPort;
+ readonly attribute DOMString? remoteAddress;
+ readonly attribute unsigned short? remotePort;
+ readonly attribute boolean addressReuse;
+ readonly attribute boolean loopback;
+ readonly attribute SocketReadyState readyState;
+ readonly attribute Promise<void> opened;
+ readonly attribute Promise<void> closed;
+// readonly attribute ReadableStream input; //Bug 1056444: Stream API is not ready
+// readonly attribute WriteableStream output; //Bug 1056444: Stream API is not ready
+ attribute EventHandler onmessage; //Bug 1056444: use event interface before Stream API is ready
+ Promise<void> close ();
+ [Throws] void joinMulticastGroup (DOMString multicastGroupAddress);
+ [Throws] void leaveMulticastGroup (DOMString multicastGroupAddress);
+ [Throws] boolean send ((DOMString or Blob or ArrayBuffer or ArrayBufferView) data, optional DOMString? remoteAddress, optional unsigned short? remotePort); //Bug 1056444: use send method before Stream API is ready
+};
diff --git a/dom/webidl/UIEvent.webidl b/dom/webidl/UIEvent.webidl
index 6e2642879..4dceb409c 100644
--- a/dom/webidl/UIEvent.webidl
+++ b/dom/webidl/UIEvent.webidl
@@ -10,8 +10,6 @@
* liability, trademark and document use rules apply.
*/
-interface WindowProxy;
-
[Constructor(DOMString type, optional UIEventInit eventInitDict)]
interface UIEvent : Event
{
@@ -20,7 +18,7 @@ interface UIEvent : Event
void initUIEvent(DOMString aType,
boolean aCanBubble,
boolean aCancelable,
- WindowProxy? aView,
+ Window? aView,
long aDetail);
};
@@ -42,6 +40,6 @@ partial interface UIEvent {
dictionary UIEventInit : EventInit
{
- WindowProxy? view = null;
- long detail = 0;
+ Window? view = null;
+ long detail = 0;
};
diff --git a/dom/webidl/URL.webidl b/dom/webidl/URL.webidl
index d5bb45eed..7fe970104 100644
--- a/dom/webidl/URL.webidl
+++ b/dom/webidl/URL.webidl
@@ -14,10 +14,12 @@
// [Constructor(DOMString url, optional (URL or DOMString) base = "about:blank")]
[Constructor(DOMString url, URL base),
- Constructor(DOMString url, optional DOMString base = "about:blank")]
+ Constructor(DOMString url, optional DOMString base = "about:blank"),
+ Exposed=(Window,Worker)]
interface URL {
};
URL implements URLUtils;
+URL implements URLUtilsSearchParams;
partial interface URL {
[Throws]
@@ -31,3 +33,9 @@ dictionary objectURLOptions
{
/* boolean autoRevoke = true; */ /* not supported yet */
};
+
+// https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html
+partial interface URL {
+ [Throws]
+ static DOMString? createObjectURL(MediaSource source, optional objectURLOptions options);
+};
diff --git a/dom/webidl/URLSearchParams.webidl b/dom/webidl/URLSearchParams.webidl
new file mode 100644
index 000000000..39aa200aa
--- /dev/null
+++ b/dom/webidl/URLSearchParams.webidl
@@ -0,0 +1,28 @@
+/* -*- 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://url.spec.whatwg.org/#urlsearchparams
+ *
+ * To the extent possible under law, the editors have waived all copyright
+ * and related or neighboring rights to this work. In addition, as of 17
+ * February 2013, the editors have made this specification available under
+ * the Open Web Foundation Agreement Version 1.0, which is available at
+ * http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0.
+ */
+
+[Constructor(optional USVString init = ""),
+ Constructor(URLSearchParams init),
+ Exposed=(Window,Worker,System)]
+interface URLSearchParams {
+ void append(USVString name, USVString value);
+ void delete(USVString name);
+ USVString? get(USVString name);
+ sequence<USVString> getAll(USVString name);
+ boolean has(USVString name);
+ void set(USVString name, USVString value);
+ // iterable<USVString, USVString>; - Bug 1085284
+ stringifier;
+};
diff --git a/dom/webidl/URLUtils.webidl b/dom/webidl/URLUtils.webidl
index 5196b4bfe..097acb708 100644
--- a/dom/webidl/URLUtils.webidl
+++ b/dom/webidl/URLUtils.webidl
@@ -13,25 +13,43 @@
* http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0.
*/
-[NoInterfaceObject]
+[NoInterfaceObject,
+ Exposed=(Window, Worker)]
interface URLUtils {
- [SetterThrows]
- stringifier attribute DOMString href;
- readonly attribute DOMString origin;
+ // Bug 824857: no support for stringifier attributes yet.
+ // stringifier attribute USVString href;
+ [Throws, CrossOriginWritable=Location]
+ attribute USVString href;
+ [Throws]
+ readonly attribute USVString origin;
- attribute DOMString protocol;
- attribute DOMString username;
- attribute DOMString password;
- attribute DOMString host;
- attribute DOMString hostname;
- attribute DOMString port;
- attribute DOMString pathname;
- attribute DOMString search;
- // attribute URLQuery? query;
- attribute DOMString hash;
+ [Throws]
+ attribute USVString protocol;
+ [Throws]
+ attribute USVString username;
+ [Throws]
+ attribute USVString password;
+ [Throws]
+ attribute USVString host;
+ [Throws]
+ attribute USVString hostname;
+ [Throws]
+ attribute USVString port;
+ [Throws]
+ attribute USVString pathname;
+ [Throws]
+ attribute USVString search;
- // This can be removed when stringification of attributes is implemented
- // in WebIDL -- see also bug 824857.
+ [Throws]
+ attribute USVString hash;
+
+ // Bug 824857 should remove this.
+ [Throws]
stringifier;
};
+[NoInterfaceObject,
+ Exposed=(Window, Worker)]
+interface URLUtilsSearchParams {
+ attribute URLSearchParams searchParams;
+};
diff --git a/dom/webidl/URLUtilsReadOnly.webidl b/dom/webidl/URLUtilsReadOnly.webidl
new file mode 100644
index 000000000..cec746c6b
--- /dev/null
+++ b/dom/webidl/URLUtilsReadOnly.webidl
@@ -0,0 +1,30 @@
+/* -*- 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://url.spec.whatwg.org/#urlutils
+ *
+ * To the extent possible under law, the editors have waived all copyright
+ * and related or neighboring rights to this work. In addition, as of 21
+ * May 2013, the editors have made this specification available under
+ * the Open Web Foundation Agreement Version 1.0, which is available at
+ * http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0.
+ */
+
+[NoInterfaceObject,
+ Exposed=(Window, Worker)]
+interface URLUtilsReadOnly {
+ stringifier;
+ readonly attribute USVString href;
+
+ readonly attribute USVString protocol;
+ readonly attribute USVString host;
+ readonly attribute USVString hostname;
+ readonly attribute USVString port;
+ readonly attribute USVString pathname;
+ readonly attribute USVString search;
+ readonly attribute USVString hash;
+ readonly attribute USVString origin;
+};
diff --git a/dom/webidl/USSDReceivedEvent.webidl b/dom/webidl/USSDReceivedEvent.webidl
index b7fa9098f..5583ec795 100644
--- a/dom/webidl/USSDReceivedEvent.webidl
+++ b/dom/webidl/USSDReceivedEvent.webidl
@@ -4,15 +4,20 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-[Constructor(DOMString type, optional USSDReceivedEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Pref="dom.telephony.enabled",
+ CheckPermissions="telephony",
+ AvailableIn="CertifiedApps",
+ Constructor(DOMString type, optional USSDReceivedEventInit eventInitDict)]
interface USSDReceivedEvent : Event
{
+ readonly attribute unsigned long serviceId;
readonly attribute DOMString? message;
- readonly attribute boolean sessionEnded;
+ readonly attribute USSDSession? session; // null if session is ended.
};
dictionary USSDReceivedEventInit : EventInit
{
+ unsigned long serviceId = 0;
DOMString? message = null;
- boolean sessionEnded = false;
+ USSDSession? session = null;
};
diff --git a/dom/webidl/USSDSession.webidl b/dom/webidl/USSDSession.webidl
new file mode 100644
index 000000000..5909bb711
--- /dev/null
+++ b/dom/webidl/USSDSession.webidl
@@ -0,0 +1,17 @@
+/* -*- 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/.
+ */
+
+[Pref="dom.telephony.enabled",
+ CheckPermissions="telephony",
+ AvailableIn="CertifiedApps",
+ Constructor(unsigned long serviceId)]
+interface USSDSession {
+ [NewObject]
+ Promise<void> send(DOMString ussd);
+
+ [NewObject]
+ Promise<void> cancel();
+};
diff --git a/dom/webidl/UndoManager.webidl b/dom/webidl/UndoManager.webidl
index bf3f7074c..4ea898727 100644
--- a/dom/webidl/UndoManager.webidl
+++ b/dom/webidl/UndoManager.webidl
@@ -10,7 +10,7 @@
* liability, trademark and document use rules apply.
*/
-[PrefControlled]
+[Pref="dom.undo_manager.enabled"]
interface UndoManager {
[Throws] void transact(DOMTransaction transaction, boolean merge);
[Throws] void undo();
diff --git a/dom/webidl/UserProximityEvent.webidl b/dom/webidl/UserProximityEvent.webidl
index 8b64b81c9..9c10947f7 100644
--- a/dom/webidl/UserProximityEvent.webidl
+++ b/dom/webidl/UserProximityEvent.webidl
@@ -4,7 +4,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-[Constructor(DOMString type, optional UserProximityEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Constructor(DOMString type, optional UserProximityEventInit eventInitDict)]
interface UserProximityEvent : Event
{
readonly attribute boolean near;
diff --git a/dom/webidl/VRDevice.webidl b/dom/webidl/VRDevice.webidl
new file mode 100644
index 000000000..459083818
--- /dev/null
+++ b/dom/webidl/VRDevice.webidl
@@ -0,0 +1,132 @@
+/* -*- 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/. */
+
+enum VREye {
+ "left",
+ "right"
+};
+
+[Pref="dom.vr.enabled",
+ HeaderFile="mozilla/dom/VRDevice.h"]
+interface VRFieldOfViewReadOnly {
+ readonly attribute double upDegrees;
+ readonly attribute double rightDegrees;
+ readonly attribute double downDegrees;
+ readonly attribute double leftDegrees;
+};
+
+[Pref="dom.vr.enabled",
+ HeaderFile="mozilla/dom/VRDevice.h",
+ Constructor(optional VRFieldOfViewInit fov),
+ Constructor(double upDegrees, double rightDegrees, double downDegrees, double leftDegrees)]
+interface VRFieldOfView : VRFieldOfViewReadOnly {
+ inherit attribute double upDegrees;
+ inherit attribute double rightDegrees;
+ inherit attribute double downDegrees;
+ inherit attribute double leftDegrees;
+};
+
+dictionary VRFieldOfViewInit {
+ double upDegrees = 0.0;
+ double rightDegrees = 0.0;
+ double downDegrees = 0.0;
+ double leftDegrees = 0.0;
+};
+
+[Pref="dom.vr.enabled",
+ HeaderFile="mozilla/dom/VRDevice.h"]
+interface VRPositionState {
+ readonly attribute double timeStamp;
+
+ readonly attribute boolean hasPosition;
+ readonly attribute DOMPoint? position;
+ readonly attribute DOMPoint? linearVelocity;
+ readonly attribute DOMPoint? linearAcceleration;
+
+ readonly attribute boolean hasOrientation;
+ // XXX should be DOMQuaternion as soon as we add that
+ readonly attribute DOMPoint? orientation;
+ readonly attribute DOMPoint? angularVelocity;
+ readonly attribute DOMPoint? angularAcceleration;
+};
+
+[Pref="dom.vr.enabled"]
+interface VRDevice {
+ /**
+ * An identifier for the distinct hardware unit that this
+ * VR Device is a part of. All VRDevice/Sensors that come
+ * from the same hardware will have the same hardwareId
+ */
+ [Pure] readonly attribute DOMString hardwareUnitId;
+
+ /**
+ * An identifier for this distinct sensor/device on a physical
+ * hardware device. This shouldn't change across browser
+ * restrats, allowing configuration data to be saved based on it.
+ */
+ [Pure] readonly attribute DOMString deviceId;
+
+ /**
+ * a device name, a user-readable name identifying it
+ */
+ [Pure] readonly attribute DOMString deviceName;
+};
+
+[Pref="dom.vr.enabled",
+ HeaderFile="mozilla/dom/VRDevice.h"]
+interface HMDVRDevice : VRDevice {
+ /* The translation that should be applied to the view matrix for rendering each eye */
+ DOMPoint getEyeTranslation(VREye whichEye);
+
+ // the FOV that the HMD was configured with
+ [NewObject]
+ VRFieldOfView getCurrentEyeFieldOfView(VREye whichEye);
+
+ // the recommended FOV, per eye.
+ [NewObject]
+ VRFieldOfView getRecommendedEyeFieldOfView(VREye whichEye);
+
+ // the maximum FOV, per eye. Above this, rendering will look broken.
+ [NewObject]
+ VRFieldOfView getMaximumEyeFieldOfView(VREye whichEye);
+
+ // Set a field of view. If either of the fields of view is null,
+ // or if their values are all zeros, then the recommended field of view
+ // for that eye will be used.
+ void setFieldOfView(optional VRFieldOfViewInit leftFOV,
+ optional VRFieldOfViewInit rightFOV,
+ optional double zNear = 0.01,
+ optional double zFar = 10000.0);
+
+ // return a recommended rect for this eye. Only useful for Canvas rendering,
+ // the x/y coordinates will be the location in the canvas where this eye should
+ // begin, and the width/height are the dimensions. Any canvas in the appropriate
+ // ratio will work.
+ DOMRect getRecommendedEyeRenderRect(VREye whichEye);
+
+ // hack for testing
+ void xxxToggleElementVR(Element element);
+};
+
+[Pref="dom.vr.enabled" ,
+ HeaderFile="mozilla/dom/VRDevice.h"]
+interface PositionSensorVRDevice : VRDevice {
+ /*
+ * Return a VRPositionState dictionary containing the state of this position sensor,
+ * at an optional past time or predicted for a future time if timeOffset is != 0.
+ *
+ * The VRPositionState will contain the position, orientation, and velocity
+ * and acceleration of each of these properties. Use "hasPosition" and "hasOrientation"
+ * to check if the associated members are valid; if these are false, those members
+ * will be null.
+ */
+ [NewObject]
+ VRPositionState getState(optional double timeOffset = 0.0);
+
+ /* Zero this sensor, treating its current position and orientation
+ * as the "origin/zero" values.
+ */
+ void zeroSensor();
+};
diff --git a/dom/webidl/TextTrackCue.webidl b/dom/webidl/VTTCue.webidl
index 9dcce1231..41110ba8d 100644
--- a/dom/webidl/TextTrackCue.webidl
+++ b/dom/webidl/VTTCue.webidl
@@ -9,9 +9,7 @@
enum AutoKeyword { "auto" };
-/* Non-spec: Request to add this enum to spec
- * can be found here: https://www.w3.org/Bugs/Public/show_bug.cgi?id=20996 */
-enum TextTrackCueAlign {
+enum AlignSetting {
"start",
"middle",
"end",
@@ -19,28 +17,47 @@ enum TextTrackCueAlign {
"right"
};
+enum DirectionSetting {
+ "",
+ "rl",
+ "lr"
+};
+
[Constructor(double startTime, double endTime, DOMString text),
Pref="media.webvtt.enabled"]
-interface TextTrackCue : EventTarget {
+interface VTTCue : EventTarget {
readonly attribute TextTrack? track;
attribute DOMString id;
attribute double startTime;
attribute double endTime;
attribute boolean pauseOnExit;
- attribute DOMString vertical;
+ [Pref="media.webvtt.regions.enabled"]
+ attribute VTTRegion? region;
+ attribute DirectionSetting vertical;
attribute boolean snapToLines;
- // XXXhumph: https://www.w3.org/Bugs/Public/show_bug.cgi?id=20651
- // attribute (long or AutoKeyword) line;
+ attribute (long or AutoKeyword) line;
+ [SetterThrows]
+ attribute AlignSetting lineAlign;
+ [SetterThrows]
attribute long position;
+ [SetterThrows]
+ attribute AlignSetting positionAlign;
+ [SetterThrows]
attribute long size;
- attribute TextTrackCueAlign align;
+ attribute AlignSetting align;
attribute DOMString text;
DocumentFragment getCueAsHTML();
- [SetterThrows]
- attribute EventHandler onenter;
+ attribute EventHandler onenter;
- [SetterThrows]
- attribute EventHandler onexit;
+ attribute EventHandler onexit;
+};
+
+// Mozilla extensions.
+partial interface VTTCue {
+ [ChromeOnly]
+ attribute HTMLDivElement? displayState;
+ [ChromeOnly]
+ readonly attribute boolean hasBeenReset;
};
diff --git a/dom/webidl/VTTRegion.webidl b/dom/webidl/VTTRegion.webidl
new file mode 100644
index 000000000..a28df473e
--- /dev/null
+++ b/dom/webidl/VTTRegion.webidl
@@ -0,0 +1,27 @@
+/* -*- 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://dev.w3.org/html5/webvtt/#extension-of-the-texttrack-interface-for-region-support
+ */
+
+[Constructor, Func="TextTrackRegion::RegionsEnabled"]
+interface VTTRegion {
+ [SetterThrows]
+ attribute double width;
+
+ attribute long lines;
+
+ [SetterThrows]
+ attribute double regionAnchorX;
+ [SetterThrows]
+ attribute double regionAnchorY;
+ [SetterThrows]
+ attribute double viewportAnchorX;
+ [SetterThrows]
+ attribute double viewportAnchorY;
+ [SetterThrows]
+ attribute DOMString scroll;
+};
diff --git a/dom/webidl/ValidityState.webidl b/dom/webidl/ValidityState.webidl
index d8d1d1bcc..a4cf8f198 100644
--- a/dom/webidl/ValidityState.webidl
+++ b/dom/webidl/ValidityState.webidl
@@ -18,7 +18,7 @@ interface ValidityState {
readonly attribute boolean rangeUnderflow;
readonly attribute boolean rangeOverflow;
readonly attribute boolean stepMismatch;
-// readonly attribute boolean badInput;
+ readonly attribute boolean badInput;
readonly attribute boolean customError;
readonly attribute boolean valid;
};
diff --git a/dom/webidl/VideoPlaybackQuality.webidl b/dom/webidl/VideoPlaybackQuality.webidl
new file mode 100644
index 000000000..abbe8d19a
--- /dev/null
+++ b/dom/webidl/VideoPlaybackQuality.webidl
@@ -0,0 +1,21 @@
+/* -*- 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://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html
+ *
+ * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
+ * liability, trademark and document use rules apply.
+ */
+
+[Func="mozilla::dom::MediaSource::Enabled"]
+interface VideoPlaybackQuality {
+ readonly attribute DOMHighResTimeStamp creationTime;
+ readonly attribute unsigned long totalVideoFrames;
+ readonly attribute unsigned long droppedVideoFrames;
+ readonly attribute unsigned long corruptedVideoFrames;
+// At Risk: readonly attribute double totalFrameDelay;
+};
+
diff --git a/dom/webidl/VideoTrack.webidl b/dom/webidl/VideoTrack.webidl
new file mode 100644
index 000000000..7f5974f21
--- /dev/null
+++ b/dom/webidl/VideoTrack.webidl
@@ -0,0 +1,17 @@
+/* -*- 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.whatwg.org/specs/web-apps/current-work/#videotrack
+ */
+
+[Pref="media.track.enabled"]
+interface VideoTrack {
+ readonly attribute DOMString id;
+ readonly attribute DOMString kind;
+ readonly attribute DOMString label;
+ readonly attribute DOMString language;
+ attribute boolean selected;
+};
diff --git a/dom/webidl/VideoTrackList.webidl b/dom/webidl/VideoTrackList.webidl
new file mode 100644
index 000000000..144120226
--- /dev/null
+++ b/dom/webidl/VideoTrackList.webidl
@@ -0,0 +1,21 @@
+/* -*- 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.whatwg.org/specs/web-apps/current-work/#videotracklist
+ */
+
+[Pref="media.track.enabled"]
+interface VideoTrackList : EventTarget {
+ readonly attribute unsigned long length;
+ getter VideoTrack (unsigned long index);
+ VideoTrack? getTrackById(DOMString id);
+ readonly attribute long selectedIndex;
+
+ attribute EventHandler onchange;
+ attribute EventHandler onaddtrack;
+ attribute EventHandler onremovetrack;
+};
+
diff --git a/dom/webidl/WaveShaperNode.webidl b/dom/webidl/WaveShaperNode.webidl
index 06932edfe..e22d9c59a 100644
--- a/dom/webidl/WaveShaperNode.webidl
+++ b/dom/webidl/WaveShaperNode.webidl
@@ -10,10 +10,19 @@
* liability, trademark and document use rules apply.
*/
-[PrefControlled]
+enum OverSampleType {
+ "none",
+ "2x",
+ "4x"
+};
+
interface WaveShaperNode : AudioNode {
attribute Float32Array? curve;
+ attribute OverSampleType oversample;
};
+// Mozilla extension
+WaveShaperNode implements AudioNodePassThrough;
+
diff --git a/dom/webidl/WebComponents.webidl b/dom/webidl/WebComponents.webidl
index e165f8890..3dfb960bc 100644
--- a/dom/webidl/WebComponents.webidl
+++ b/dom/webidl/WebComponents.webidl
@@ -11,13 +11,18 @@
*/
callback LifecycleCreatedCallback = void();
+callback LifecycleAttachedCallback = void();
+callback LifecycleDetachedCallback = void();
+callback LifecycleAttributeChangedCallback = void(DOMString attrName, DOMString? oldValue, DOMString? newValue);
dictionary LifecycleCallbacks {
- LifecycleCreatedCallback? created = null;
+ LifecycleCreatedCallback? createdCallback;
+ LifecycleAttachedCallback? attachedCallback;
+ LifecycleDetachedCallback? detachedCallback;
+ LifecycleAttributeChangedCallback? attributeChangedCallback;
};
dictionary ElementRegistrationOptions {
object? prototype = null;
- LifecycleCallbacks lifecycle;
+ DOMString? extends = null;
};
-
diff --git a/dom/webidl/WebGL2RenderingContext.webidl b/dom/webidl/WebGL2RenderingContext.webidl
new file mode 100644
index 000000000..93719a627
--- /dev/null
+++ b/dom/webidl/WebGL2RenderingContext.webidl
@@ -0,0 +1,476 @@
+/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* 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 source for this IDL is found at https://www.khronos.org/registry/webgl/specs/latest/2.0
+ * This IDL depends on WebGLRenderingContext.webidl
+ */
+
+typedef long long GLint64; // Should this be int64?
+typedef unsigned long long GLuint64; // Should this be uint64?
+
+[Pref="webgl.enable-prototype-webgl2"]
+interface WebGLQuery {
+};
+
+[Pref="webgl.enable-prototype-webgl2"]
+interface WebGLSampler {
+};
+
+[Pref="webgl.enable-prototype-webgl2"]
+interface WebGLSync {
+};
+
+[Pref="webgl.enable-prototype-webgl2"]
+interface WebGLTransformFeedback {
+};
+
+/*
+[Pref="webgl.enable-prototype-webgl2"]
+interface WebGLVertexArrayObject {
+};
+*/
+
+[Pref="webgl.enable-prototype-webgl2"]
+interface WebGL2RenderingContext : WebGLRenderingContext
+{
+ const GLenum READ_BUFFER = 0x0C02;
+ const GLenum UNPACK_ROW_LENGTH = 0x0CF2;
+ const GLenum UNPACK_SKIP_ROWS = 0x0CF3;
+ const GLenum UNPACK_SKIP_PIXELS = 0x0CF4;
+ const GLenum PACK_ROW_LENGTH = 0x0D02;
+ const GLenum PACK_SKIP_ROWS = 0x0D03;
+ const GLenum PACK_SKIP_PIXELS = 0x0D04;
+ const GLenum COLOR = 0x1800;
+ const GLenum DEPTH = 0x1801;
+ const GLenum STENCIL = 0x1802;
+ const GLenum RED = 0x1903;
+ const GLenum RGB8 = 0x8051;
+ const GLenum RGBA8 = 0x8058;
+ const GLenum RGB10_A2 = 0x8059;
+ const GLenum TEXTURE_BINDING_3D = 0x806A;
+ const GLenum UNPACK_SKIP_IMAGES = 0x806D;
+ const GLenum UNPACK_IMAGE_HEIGHT = 0x806E;
+ const GLenum TEXTURE_3D = 0x806F;
+ const GLenum TEXTURE_WRAP_R = 0x8072;
+ const GLenum MAX_3D_TEXTURE_SIZE = 0x8073;
+ const GLenum UNSIGNED_INT_2_10_10_10_REV = 0x8368;
+ const GLenum MAX_ELEMENTS_VERTICES = 0x80E8;
+ const GLenum MAX_ELEMENTS_INDICES = 0x80E9;
+ const GLenum TEXTURE_MIN_LOD = 0x813A;
+ const GLenum TEXTURE_MAX_LOD = 0x813B;
+ const GLenum TEXTURE_BASE_LEVEL = 0x813C;
+ const GLenum TEXTURE_MAX_LEVEL = 0x813D;
+ const GLenum MIN = 0x8007;
+ const GLenum MAX = 0x8008;
+ const GLenum DEPTH_COMPONENT24 = 0x81A6;
+ const GLenum MAX_TEXTURE_LOD_BIAS = 0x84FD;
+ const GLenum TEXTURE_COMPARE_MODE = 0x884C;
+ const GLenum TEXTURE_COMPARE_FUNC = 0x884D;
+ const GLenum CURRENT_QUERY = 0x8865;
+ const GLenum QUERY_RESULT = 0x8866;
+ const GLenum QUERY_RESULT_AVAILABLE = 0x8867;
+ const GLenum STREAM_READ = 0x88E1;
+ const GLenum STREAM_COPY = 0x88E2;
+ const GLenum STATIC_READ = 0x88E5;
+ const GLenum STATIC_COPY = 0x88E6;
+ const GLenum DYNAMIC_READ = 0x88E9;
+ const GLenum DYNAMIC_COPY = 0x88EA;
+ const GLenum MAX_DRAW_BUFFERS = 0x8824;
+ const GLenum DRAW_BUFFER0 = 0x8825;
+ const GLenum DRAW_BUFFER1 = 0x8826;
+ const GLenum DRAW_BUFFER2 = 0x8827;
+ const GLenum DRAW_BUFFER3 = 0x8828;
+ const GLenum DRAW_BUFFER4 = 0x8829;
+ const GLenum DRAW_BUFFER5 = 0x882A;
+ const GLenum DRAW_BUFFER6 = 0x882B;
+ const GLenum DRAW_BUFFER7 = 0x882C;
+ const GLenum DRAW_BUFFER8 = 0x882D;
+ const GLenum DRAW_BUFFER9 = 0x882E;
+ const GLenum DRAW_BUFFER10 = 0x882F;
+ const GLenum DRAW_BUFFER11 = 0x8830;
+ const GLenum DRAW_BUFFER12 = 0x8831;
+ const GLenum DRAW_BUFFER13 = 0x8832;
+ const GLenum DRAW_BUFFER14 = 0x8833;
+ const GLenum DRAW_BUFFER15 = 0x8834;
+ const GLenum MAX_FRAGMENT_UNIFORM_COMPONENTS = 0x8B49;
+ const GLenum MAX_VERTEX_UNIFORM_COMPONENTS = 0x8B4A;
+ const GLenum SAMPLER_3D = 0x8B5F;
+ const GLenum SAMPLER_2D_SHADOW = 0x8B62;
+ const GLenum FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8B8B;
+ const GLenum PIXEL_PACK_BUFFER = 0x88EB;
+ const GLenum PIXEL_UNPACK_BUFFER = 0x88EC;
+ const GLenum PIXEL_PACK_BUFFER_BINDING = 0x88ED;
+ const GLenum PIXEL_UNPACK_BUFFER_BINDING = 0x88EF;
+ const GLenum FLOAT_MAT2x3 = 0x8B65;
+ const GLenum FLOAT_MAT2x4 = 0x8B66;
+ const GLenum FLOAT_MAT3x2 = 0x8B67;
+ const GLenum FLOAT_MAT3x4 = 0x8B68;
+ const GLenum FLOAT_MAT4x2 = 0x8B69;
+ const GLenum FLOAT_MAT4x3 = 0x8B6A;
+ const GLenum SRGB = 0x8C40;
+ const GLenum SRGB8 = 0x8C41;
+ const GLenum SRGB8_ALPHA8 = 0x8C43;
+ const GLenum COMPARE_REF_TO_TEXTURE = 0x884E;
+ const GLenum RGBA32F = 0x8814;
+ const GLenum RGB32F = 0x8815;
+ const GLenum RGBA16F = 0x881A;
+ const GLenum RGB16F = 0x881B;
+ const GLenum VERTEX_ATTRIB_ARRAY_INTEGER = 0x88FD;
+ const GLenum MAX_ARRAY_TEXTURE_LAYERS = 0x88FF;
+ const GLenum MIN_PROGRAM_TEXEL_OFFSET = 0x8904;
+ const GLenum MAX_PROGRAM_TEXEL_OFFSET = 0x8905;
+ const GLenum MAX_VARYING_COMPONENTS = 0x8B4B;
+ const GLenum TEXTURE_2D_ARRAY = 0x8C1A;
+ const GLenum TEXTURE_BINDING_2D_ARRAY = 0x8C1D;
+ const GLenum R11F_G11F_B10F = 0x8C3A;
+ const GLenum UNSIGNED_INT_10F_11F_11F_REV = 0x8C3B;
+ const GLenum RGB9_E5 = 0x8C3D;
+ const GLenum UNSIGNED_INT_5_9_9_9_REV = 0x8C3E;
+ const GLenum TRANSFORM_FEEDBACK_BUFFER_MODE = 0x8C7F;
+ const GLenum MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 0x8C80;
+ const GLenum TRANSFORM_FEEDBACK_VARYINGS = 0x8C83;
+ const GLenum TRANSFORM_FEEDBACK_BUFFER_START = 0x8C84;
+ const GLenum TRANSFORM_FEEDBACK_BUFFER_SIZE = 0x8C85;
+ const GLenum TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 0x8C88;
+ const GLenum RASTERIZER_DISCARD = 0x8C89;
+ const GLenum MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8C8A;
+ const GLenum MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 0x8C8B;
+ const GLenum INTERLEAVED_ATTRIBS = 0x8C8C;
+ const GLenum SEPARATE_ATTRIBS = 0x8C8D;
+ const GLenum TRANSFORM_FEEDBACK_BUFFER = 0x8C8E;
+ const GLenum TRANSFORM_FEEDBACK_BUFFER_BINDING = 0x8C8F;
+ const GLenum RGBA32UI = 0x8D70;
+ const GLenum RGB32UI = 0x8D71;
+ const GLenum RGBA16UI = 0x8D76;
+ const GLenum RGB16UI = 0x8D77;
+ const GLenum RGBA8UI = 0x8D7C;
+ const GLenum RGB8UI = 0x8D7D;
+ const GLenum RGBA32I = 0x8D82;
+ const GLenum RGB32I = 0x8D83;
+ const GLenum RGBA16I = 0x8D88;
+ const GLenum RGB16I = 0x8D89;
+ const GLenum RGBA8I = 0x8D8E;
+ const GLenum RGB8I = 0x8D8F;
+ const GLenum RED_INTEGER = 0x8D94;
+ const GLenum RGB_INTEGER = 0x8D98;
+ const GLenum RGBA_INTEGER = 0x8D99;
+ const GLenum SAMPLER_2D_ARRAY = 0x8DC1;
+ const GLenum SAMPLER_2D_ARRAY_SHADOW = 0x8DC4;
+ const GLenum SAMPLER_CUBE_SHADOW = 0x8DC5;
+ const GLenum UNSIGNED_INT_VEC2 = 0x8DC6;
+ const GLenum UNSIGNED_INT_VEC3 = 0x8DC7;
+ const GLenum UNSIGNED_INT_VEC4 = 0x8DC8;
+ const GLenum INT_SAMPLER_2D = 0x8DCA;
+ const GLenum INT_SAMPLER_3D = 0x8DCB;
+ const GLenum INT_SAMPLER_CUBE = 0x8DCC;
+ const GLenum INT_SAMPLER_2D_ARRAY = 0x8DCF;
+ const GLenum UNSIGNED_INT_SAMPLER_2D = 0x8DD2;
+ const GLenum UNSIGNED_INT_SAMPLER_3D = 0x8DD3;
+ const GLenum UNSIGNED_INT_SAMPLER_CUBE = 0x8DD4;
+ const GLenum UNSIGNED_INT_SAMPLER_2D_ARRAY = 0x8DD7;
+ const GLenum DEPTH_COMPONENT32F = 0x8CAC;
+ const GLenum DEPTH32F_STENCIL8 = 0x8CAD;
+ const GLenum FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD;
+ const GLenum FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210;
+ const GLenum FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 0x8211;
+ const GLenum FRAMEBUFFER_ATTACHMENT_RED_SIZE = 0x8212;
+ const GLenum FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 0x8213;
+ const GLenum FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 0x8214;
+ const GLenum FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 0x8215;
+ const GLenum FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 0x8216;
+ const GLenum FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 0x8217;
+ const GLenum FRAMEBUFFER_DEFAULT = 0x8218;
+ const GLenum DEPTH_STENCIL_ATTACHMENT = 0x821A;
+ const GLenum DEPTH_STENCIL = 0x84F9;
+ const GLenum UNSIGNED_INT_24_8 = 0x84FA;
+ const GLenum DEPTH24_STENCIL8 = 0x88F0;
+ const GLenum UNSIGNED_NORMALIZED = 0x8C17;
+ const GLenum DRAW_FRAMEBUFFER_BINDING = 0x8CA6; /* Same as FRAMEBUFFER_BINDING */
+ const GLenum READ_FRAMEBUFFER = 0x8CA8;
+ const GLenum DRAW_FRAMEBUFFER = 0x8CA9;
+ const GLenum READ_FRAMEBUFFER_BINDING = 0x8CAA;
+ const GLenum RENDERBUFFER_SAMPLES = 0x8CAB;
+ const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4;
+ const GLenum MAX_COLOR_ATTACHMENTS = 0x8CDF;
+ const GLenum COLOR_ATTACHMENT1 = 0x8CE1;
+ const GLenum COLOR_ATTACHMENT2 = 0x8CE2;
+ const GLenum COLOR_ATTACHMENT3 = 0x8CE3;
+ const GLenum COLOR_ATTACHMENT4 = 0x8CE4;
+ const GLenum COLOR_ATTACHMENT5 = 0x8CE5;
+ const GLenum COLOR_ATTACHMENT6 = 0x8CE6;
+ const GLenum COLOR_ATTACHMENT7 = 0x8CE7;
+ const GLenum COLOR_ATTACHMENT8 = 0x8CE8;
+ const GLenum COLOR_ATTACHMENT9 = 0x8CE9;
+ const GLenum COLOR_ATTACHMENT10 = 0x8CEA;
+ const GLenum COLOR_ATTACHMENT11 = 0x8CEB;
+ const GLenum COLOR_ATTACHMENT12 = 0x8CEC;
+ const GLenum COLOR_ATTACHMENT13 = 0x8CED;
+ const GLenum COLOR_ATTACHMENT14 = 0x8CEE;
+ const GLenum COLOR_ATTACHMENT15 = 0x8CEF;
+ const GLenum FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56;
+ const GLenum MAX_SAMPLES = 0x8D57;
+ const GLenum HALF_FLOAT = 0x140B;
+ const GLenum RG = 0x8227;
+ const GLenum RG_INTEGER = 0x8228;
+ const GLenum R8 = 0x8229;
+ const GLenum RG8 = 0x822B;
+ const GLenum R16F = 0x822D;
+ const GLenum R32F = 0x822E;
+ const GLenum RG16F = 0x822F;
+ const GLenum RG32F = 0x8230;
+ const GLenum R8I = 0x8231;
+ const GLenum R8UI = 0x8232;
+ const GLenum R16I = 0x8233;
+ const GLenum R16UI = 0x8234;
+ const GLenum R32I = 0x8235;
+ const GLenum R32UI = 0x8236;
+ const GLenum RG8I = 0x8237;
+ const GLenum RG8UI = 0x8238;
+ const GLenum RG16I = 0x8239;
+ const GLenum RG16UI = 0x823A;
+ const GLenum RG32I = 0x823B;
+ const GLenum RG32UI = 0x823C;
+ const GLenum VERTEX_ARRAY_BINDING = 0x85B5;
+ const GLenum R8_SNORM = 0x8F94;
+ const GLenum RG8_SNORM = 0x8F95;
+ const GLenum RGB8_SNORM = 0x8F96;
+ const GLenum RGBA8_SNORM = 0x8F97;
+ const GLenum SIGNED_NORMALIZED = 0x8F9C;
+ const GLenum PRIMITIVE_RESTART_FIXED_INDEX = 0x8D69;
+ const GLenum COPY_READ_BUFFER = 0x8F36;
+ const GLenum COPY_WRITE_BUFFER = 0x8F37;
+ const GLenum COPY_READ_BUFFER_BINDING = 0x8F36; /* Same as COPY_READ_BUFFER */
+ const GLenum COPY_WRITE_BUFFER_BINDING = 0x8F37; /* Same as COPY_WRITE_BUFFER */
+ const GLenum UNIFORM_BUFFER = 0x8A11;
+ const GLenum UNIFORM_BUFFER_BINDING = 0x8A28;
+ const GLenum UNIFORM_BUFFER_START = 0x8A29;
+ const GLenum UNIFORM_BUFFER_SIZE = 0x8A2A;
+ const GLenum MAX_VERTEX_UNIFORM_BLOCKS = 0x8A2B;
+ const GLenum MAX_FRAGMENT_UNIFORM_BLOCKS = 0x8A2D;
+ const GLenum MAX_COMBINED_UNIFORM_BLOCKS = 0x8A2E;
+ const GLenum MAX_UNIFORM_BUFFER_BINDINGS = 0x8A2F;
+ const GLenum MAX_UNIFORM_BLOCK_SIZE = 0x8A30;
+ const GLenum MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8A31;
+ const GLenum MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8A33;
+ const GLenum UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34;
+ const GLenum ACTIVE_UNIFORM_BLOCKS = 0x8A36;
+ const GLenum UNIFORM_TYPE = 0x8A37;
+ const GLenum UNIFORM_SIZE = 0x8A38;
+ const GLenum UNIFORM_BLOCK_INDEX = 0x8A3A;
+ const GLenum UNIFORM_OFFSET = 0x8A3B;
+ const GLenum UNIFORM_ARRAY_STRIDE = 0x8A3C;
+ const GLenum UNIFORM_MATRIX_STRIDE = 0x8A3D;
+ const GLenum UNIFORM_IS_ROW_MAJOR = 0x8A3E;
+ const GLenum UNIFORM_BLOCK_BINDING = 0x8A3F;
+ const GLenum UNIFORM_BLOCK_DATA_SIZE = 0x8A40;
+ const GLenum UNIFORM_BLOCK_ACTIVE_UNIFORMS = 0x8A42;
+ const GLenum UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8A43;
+ const GLenum UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8A44;
+ const GLenum UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8A46;
+ const GLenum INVALID_INDEX = 0xFFFFFFFF;
+ const GLenum MAX_VERTEX_OUTPUT_COMPONENTS = 0x9122;
+ const GLenum MAX_FRAGMENT_INPUT_COMPONENTS = 0x9125;
+ const GLenum MAX_SERVER_WAIT_TIMEOUT = 0x9111;
+ const GLenum OBJECT_TYPE = 0x9112;
+ const GLenum SYNC_CONDITION = 0x9113;
+ const GLenum SYNC_STATUS = 0x9114;
+ const GLenum SYNC_FLAGS = 0x9115;
+ const GLenum SYNC_FENCE = 0x9116;
+ const GLenum SYNC_GPU_COMMANDS_COMPLETE = 0x9117;
+ const GLenum UNSIGNALED = 0x9118;
+ const GLenum SIGNALED = 0x9119;
+ const GLenum ALREADY_SIGNALED = 0x911A;
+ const GLenum TIMEOUT_EXPIRED = 0x911B;
+ const GLenum CONDITION_SATISFIED = 0x911C;
+ const GLenum WAIT_FAILED = 0x911D;
+ const GLenum SYNC_FLUSH_COMMANDS_BIT = 0x00000001;
+ const GLenum VERTEX_ATTRIB_ARRAY_DIVISOR = 0x88FE;
+ const GLenum ANY_SAMPLES_PASSED = 0x8C2F;
+ const GLenum ANY_SAMPLES_PASSED_CONSERVATIVE = 0x8D6A;
+ const GLenum SAMPLER_BINDING = 0x8919;
+ const GLenum RGB10_A2UI = 0x906F;
+ const GLenum TEXTURE_SWIZZLE_R = 0x8E42;
+ const GLenum TEXTURE_SWIZZLE_G = 0x8E43;
+ const GLenum TEXTURE_SWIZZLE_B = 0x8E44;
+ const GLenum TEXTURE_SWIZZLE_A = 0x8E45;
+ const GLenum GREEN = 0x1904;
+ const GLenum BLUE = 0x1905;
+ const GLenum INT_2_10_10_10_REV = 0x8D9F;
+ const GLenum TRANSFORM_FEEDBACK = 0x8E22;
+ const GLenum TRANSFORM_FEEDBACK_PAUSED = 0x8E23;
+ const GLenum TRANSFORM_FEEDBACK_ACTIVE = 0x8E24;
+ const GLenum TRANSFORM_FEEDBACK_BINDING = 0x8E25;
+ const GLenum COMPRESSED_R11_EAC = 0x9270;
+ const GLenum COMPRESSED_SIGNED_R11_EAC = 0x9271;
+ const GLenum COMPRESSED_RG11_EAC = 0x9272;
+ const GLenum COMPRESSED_SIGNED_RG11_EAC = 0x9273;
+ const GLenum COMPRESSED_RGB8_ETC2 = 0x9274;
+ const GLenum COMPRESSED_SRGB8_ETC2 = 0x9275;
+ const GLenum COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276;
+ const GLenum COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277;
+ const GLenum COMPRESSED_RGBA8_ETC2_EAC = 0x9278;
+ const GLenum COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279;
+ const GLenum TEXTURE_IMMUTABLE_FORMAT = 0x912F;
+ const GLenum MAX_ELEMENT_INDEX = 0x8D6B;
+ const GLenum NUM_SAMPLE_COUNTS = 0x9380;
+ const GLenum TEXTURE_IMMUTABLE_LEVELS = 0x82DF;
+
+ const GLint64 TIMEOUT_IGNORED = -1;
+
+ /* Buffer objects */
+ void copyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset,
+ GLintptr writeOffset, GLsizeiptr size);
+ void getBufferSubData(GLenum target, GLintptr offset, ArrayBuffer returnedData);
+ void getBufferSubData(GLenum target, GLintptr offset, ArrayBufferView returnedData);
+
+ /* Framebuffer objects */
+ void blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0,
+ GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+ void framebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+ any getInternalformatParameter(GLenum target, GLenum internalformat, GLenum pname);
+ void invalidateFramebuffer(GLenum target, sequence<GLenum> attachments);
+ void invalidateSubFramebuffer (GLenum target, sequence<GLenum> attachments,
+ GLint x, GLint y, GLsizei width, GLsizei height);
+ void readBuffer(GLenum src);
+
+ /* Renderbuffer objects */
+ void renderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+
+ /* Texture objects */
+ void texStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+ void texStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height,
+ GLsizei depth);
+ [Throws]
+ void texImage3D(GLenum target, GLint level, GLenum internalformat,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLint border, GLenum format,
+ GLenum type, ArrayBufferView? pixels);
+ [Throws] void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type,
+ ArrayBufferView? pixels);
+ [Throws] void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
+ GLenum format, GLenum type, ImageData? data);
+ [Throws] void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
+ GLenum format, GLenum type, HTMLImageElement image);
+ [Throws] void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
+ GLenum format, GLenum type, HTMLCanvasElement canvas);
+ [Throws] void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
+ GLenum format, GLenum type, HTMLVideoElement video);
+ void copyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
+ GLint x, GLint y, GLsizei width, GLsizei height);
+ void compressedTexImage3D(GLenum target, GLint level, GLenum internalformat,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLint border, GLsizei imageSize, ArrayBufferView data);
+ void compressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLsizei imageSize, ArrayBufferView data);
+
+ /* Programs and shaders */
+ [WebGLHandlesContextLoss] GLint getFragDataLocation(WebGLProgram? program, DOMString name);
+
+ /* Uniforms and attributes */
+ void uniform1ui(WebGLUniformLocation? location, GLuint v0);
+ void uniform2ui(WebGLUniformLocation? location, GLuint v0, GLuint v1);
+ void uniform3ui(WebGLUniformLocation? location, GLuint v0, GLuint v1, GLuint v2);
+ void uniform4ui(WebGLUniformLocation? location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+ void uniform1uiv(WebGLUniformLocation? location, sequence<GLuint> value);
+ void uniform2uiv(WebGLUniformLocation? location, sequence<GLuint> value);
+ void uniform3uiv(WebGLUniformLocation? location, sequence<GLuint> value);
+ void uniform4uiv(WebGLUniformLocation? location, sequence<GLuint> value);
+ void uniformMatrix2x3fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array value);
+ void uniformMatrix2x3fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> value);
+ void uniformMatrix3x2fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array value);
+ void uniformMatrix3x2fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> value);
+ void uniformMatrix2x4fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array value);
+ void uniformMatrix2x4fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> value);
+ void uniformMatrix4x2fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array value);
+ void uniformMatrix4x2fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> value);
+ void uniformMatrix3x4fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array value);
+ void uniformMatrix3x4fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> value);
+ void uniformMatrix4x3fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array value);
+ void uniformMatrix4x3fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> value);
+ void vertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w);
+ void vertexAttribI4iv(GLuint index, sequence<GLint> v);
+ void vertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+ void vertexAttribI4uiv(GLuint index, sequence<GLuint> v);
+ void vertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);
+
+ /* Writing to the drawing buffer */
+ void vertexAttribDivisor(GLuint index, GLuint divisor);
+ void drawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount);
+ void drawElementsInstanced(GLenum mode, GLsizei count, GLenum type, GLintptr offset, GLsizei instanceCount);
+ void drawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLintptr offset);
+
+ /* Multiple Render Targets */
+ void drawBuffers(sequence<GLenum> buffers);
+ void clearBufferiv(GLenum buffer, GLint drawbuffer, Int32Array value);
+ void clearBufferiv(GLenum buffer, GLint drawbuffer, sequence<GLint> value);
+ void clearBufferuiv(GLenum buffer, GLint drawbuffer, Uint32Array value);
+ void clearBufferuiv(GLenum buffer, GLint drawbuffer, sequence<GLuint> value);
+ void clearBufferfv(GLenum buffer, GLint drawbuffer, Float32Array value);
+ void clearBufferfv(GLenum buffer, GLint drawbuffer, sequence<GLfloat> value);
+ void clearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
+
+ /* Query Objects */
+ WebGLQuery? createQuery();
+ void deleteQuery(WebGLQuery? query);
+ [WebGLHandlesContextLoss] GLboolean isQuery(WebGLQuery? query);
+ void beginQuery(GLenum target, WebGLQuery? query);
+ void endQuery(GLenum target);
+ WebGLQuery? getQuery(GLenum target, GLenum pname);
+ any getQueryParameter(WebGLQuery? query, GLenum pname);
+
+ /* Sampler Objects */
+ WebGLSampler? createSampler();
+ void deleteSampler(WebGLSampler? sampler);
+ [WebGLHandlesContextLoss] GLboolean isSampler(WebGLSampler? sampler);
+ void bindSampler(GLuint unit, WebGLSampler? sampler);
+ void samplerParameteri(WebGLSampler? sampler, GLenum pname, GLint param);
+ void samplerParameterf(WebGLSampler? sampler, GLenum pname, GLfloat param);
+ any getSamplerParameter(WebGLSampler? sampler, GLenum pname);
+
+ /* Sync objects */
+ WebGLSync? fenceSync(GLenum condition, GLbitfield flags);
+ [WebGLHandlesContextLoss] GLboolean isSync(WebGLSync? sync);
+ void deleteSync(WebGLSync? sync);
+ GLenum clientWaitSync(WebGLSync? sync, GLbitfield flags, GLint64 timeout);
+ void waitSync(WebGLSync? sync, GLbitfield flags, GLint64 timeout);
+ any getSyncParameter(WebGLSync? sync, GLenum pname);
+
+ /* Transform Feedback */
+ WebGLTransformFeedback? createTransformFeedback();
+ void deleteTransformFeedback(WebGLTransformFeedback? tf);
+ [WebGLHandlesContextLoss] GLboolean isTransformFeedback(WebGLTransformFeedback? tf);
+ void bindTransformFeedback(GLenum target, WebGLTransformFeedback? tf);
+ void beginTransformFeedback(GLenum primitiveMode);
+ void endTransformFeedback();
+ void transformFeedbackVaryings(WebGLProgram? program, sequence<DOMString> varyings, GLenum bufferMode);
+ [NewObject] WebGLActiveInfo? getTransformFeedbackVarying(WebGLProgram? program, GLuint index);
+ void pauseTransformFeedback();
+ void resumeTransformFeedback();
+
+ /* Uniform Buffer Objects and Transform Feedback Buffers */
+ void bindBufferBase(GLenum target, GLuint index, WebGLBuffer? buffer);
+ void bindBufferRange(GLenum target, GLuint index, WebGLBuffer? buffer, GLintptr offset, GLsizeiptr size);
+ // Return from getIndexedParameter is WebGLBuffer or GLintptr or GLsizeiptr) but
+ // GLintptr and GLsizeiptr are the same underlying type of long long, so only specify
+ // GLintptr here, otherwise interface generator returns error.
+ (WebGLBuffer or GLintptr)? getIndexedParameter(GLenum target, GLuint index);
+ sequence<GLuint>? getUniformIndices(WebGLProgram? program, sequence<DOMString> uniformNames);
+ sequence<GLint>? getActiveUniforms(WebGLProgram? program, sequence<GLuint> uniformIndices, GLenum pname);
+ GLuint getUniformBlockIndex(WebGLProgram? program, DOMString uniformBlockName);
+ [Throws]
+ (GLuint or Uint32Array or GLboolean)? getActiveUniformBlockParameter(WebGLProgram? program, GLuint uniformBlockIndex, GLenum pname);
+ DOMString? getActiveUniformBlockName(WebGLProgram? program, GLuint uniformBlockIndex);
+ void uniformBlockBinding(WebGLProgram? program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
+
+ /* Vertex Array Objects */
+ /*
+ WebGLVertexArrayObject? createVertexArray();
+ void deleteVertexArray(WebGLVertexArrayObject? vertexArray);
+ [WebGLHandlesContextLoss] GLboolean isVertexArray(WebGLVertexArrayObject? vertexArray);
+ void bindVertexArray(WebGLVertexArrayObject? array);
+ */
+};
diff --git a/dom/webidl/WebGLRenderingContext.webidl b/dom/webidl/WebGLRenderingContext.webidl
index 629bd5ef1..b5806ae45 100644
--- a/dom/webidl/WebGLRenderingContext.webidl
+++ b/dom/webidl/WebGLRenderingContext.webidl
@@ -29,7 +29,7 @@ typedef octet GLubyte; /* 'octet' should be an unsigned 8 bit ty
typedef unsigned short GLushort;
typedef unsigned long GLuint;
typedef unrestricted float GLfloat;
-typedef unrestricted float GLclampf;
+typedef unrestricted float GLclampf;
dictionary WebGLContextAttributes {
// boolean alpha = true;
@@ -64,6 +64,9 @@ interface WebGLTexture {
interface WebGLUniformLocation {
};
+interface WebGLVertexArray {
+};
+
interface WebGLActiveInfo {
readonly attribute GLint size;
readonly attribute GLenum type;
@@ -82,7 +85,7 @@ interface WebGLRenderingContext {
const GLenum DEPTH_BUFFER_BIT = 0x00000100;
const GLenum STENCIL_BUFFER_BIT = 0x00000400;
const GLenum COLOR_BUFFER_BIT = 0x00004000;
-
+
/* BeginMode */
const GLenum POINTS = 0x0000;
const GLenum LINES = 0x0001;
@@ -91,7 +94,7 @@ interface WebGLRenderingContext {
const GLenum TRIANGLES = 0x0004;
const GLenum TRIANGLE_STRIP = 0x0005;
const GLenum TRIANGLE_FAN = 0x0006;
-
+
/* AlphaFunction (not supported in ES20) */
/* NEVER */
/* LESS */
@@ -101,7 +104,7 @@ interface WebGLRenderingContext {
/* NOTEQUAL */
/* GEQUAL */
/* ALWAYS */
-
+
/* BlendingFactorDest */
const GLenum ZERO = 0;
const GLenum ONE = 1;
@@ -111,7 +114,7 @@ interface WebGLRenderingContext {
const GLenum ONE_MINUS_SRC_ALPHA = 0x0303;
const GLenum DST_ALPHA = 0x0304;
const GLenum ONE_MINUS_DST_ALPHA = 0x0305;
-
+
/* BlendingFactorSrc */
/* ZERO */
/* ONE */
@@ -122,17 +125,17 @@ interface WebGLRenderingContext {
/* ONE_MINUS_SRC_ALPHA */
/* DST_ALPHA */
/* ONE_MINUS_DST_ALPHA */
-
+
/* BlendEquationSeparate */
const GLenum FUNC_ADD = 0x8006;
const GLenum BLEND_EQUATION = 0x8009;
const GLenum BLEND_EQUATION_RGB = 0x8009; /* same as BLEND_EQUATION */
const GLenum BLEND_EQUATION_ALPHA = 0x883D;
-
+
/* BlendSubtract */
const GLenum FUNC_SUBTRACT = 0x800A;
const GLenum FUNC_REVERSE_SUBTRACT = 0x800B;
-
+
/* Separate Blend Functions */
const GLenum BLEND_DST_RGB = 0x80C8;
const GLenum BLEND_SRC_RGB = 0x80C9;
@@ -143,27 +146,27 @@ interface WebGLRenderingContext {
const GLenum CONSTANT_ALPHA = 0x8003;
const GLenum ONE_MINUS_CONSTANT_ALPHA = 0x8004;
const GLenum BLEND_COLOR = 0x8005;
-
+
/* Buffer Objects */
const GLenum ARRAY_BUFFER = 0x8892;
const GLenum ELEMENT_ARRAY_BUFFER = 0x8893;
const GLenum ARRAY_BUFFER_BINDING = 0x8894;
const GLenum ELEMENT_ARRAY_BUFFER_BINDING = 0x8895;
-
+
const GLenum STREAM_DRAW = 0x88E0;
const GLenum STATIC_DRAW = 0x88E4;
const GLenum DYNAMIC_DRAW = 0x88E8;
-
+
const GLenum BUFFER_SIZE = 0x8764;
const GLenum BUFFER_USAGE = 0x8765;
-
+
const GLenum CURRENT_VERTEX_ATTRIB = 0x8626;
-
+
/* CullFaceMode */
const GLenum FRONT = 0x0404;
const GLenum BACK = 0x0405;
const GLenum FRONT_AND_BACK = 0x0408;
-
+
/* DepthFunction */
/* NEVER */
/* LESS */
@@ -173,7 +176,7 @@ interface WebGLRenderingContext {
/* NOTEQUAL */
/* GEQUAL */
/* ALWAYS */
-
+
/* EnableCap */
/* TEXTURE_2D */
const GLenum CULL_FACE = 0x0B44;
@@ -185,18 +188,18 @@ interface WebGLRenderingContext {
const GLenum POLYGON_OFFSET_FILL = 0x8037;
const GLenum SAMPLE_ALPHA_TO_COVERAGE = 0x809E;
const GLenum SAMPLE_COVERAGE = 0x80A0;
-
+
/* ErrorCode */
const GLenum NO_ERROR = 0;
const GLenum INVALID_ENUM = 0x0500;
const GLenum INVALID_VALUE = 0x0501;
const GLenum INVALID_OPERATION = 0x0502;
const GLenum OUT_OF_MEMORY = 0x0505;
-
+
/* FrontFaceDirection */
const GLenum CW = 0x0900;
const GLenum CCW = 0x0901;
-
+
/* GetPName */
const GLenum LINE_WIDTH = 0x0B21;
const GLenum ALIASED_POINT_SIZE_RANGE = 0x846D;
@@ -246,23 +249,23 @@ interface WebGLRenderingContext {
const GLenum SAMPLES = 0x80A9;
const GLenum SAMPLE_COVERAGE_VALUE = 0x80AA;
const GLenum SAMPLE_COVERAGE_INVERT = 0x80AB;
-
+
/* GetTextureParameter */
/* TEXTURE_MAG_FILTER */
/* TEXTURE_MIN_FILTER */
/* TEXTURE_WRAP_S */
/* TEXTURE_WRAP_T */
-
+
const GLenum COMPRESSED_TEXTURE_FORMATS = 0x86A3;
-
+
/* HintMode */
const GLenum DONT_CARE = 0x1100;
const GLenum FASTEST = 0x1101;
const GLenum NICEST = 0x1102;
-
+
/* HintTarget */
const GLenum GENERATE_MIPMAP_HINT = 0x8192;
-
+
/* DataType */
const GLenum BYTE = 0x1400;
const GLenum UNSIGNED_BYTE = 0x1401;
@@ -271,7 +274,7 @@ interface WebGLRenderingContext {
const GLenum INT = 0x1404;
const GLenum UNSIGNED_INT = 0x1405;
const GLenum FLOAT = 0x1406;
-
+
/* PixelFormat */
const GLenum DEPTH_COMPONENT = 0x1902;
const GLenum ALPHA = 0x1906;
@@ -279,13 +282,13 @@ interface WebGLRenderingContext {
const GLenum RGBA = 0x1908;
const GLenum LUMINANCE = 0x1909;
const GLenum LUMINANCE_ALPHA = 0x190A;
-
+
/* PixelType */
/* UNSIGNED_BYTE */
const GLenum UNSIGNED_SHORT_4_4_4_4 = 0x8033;
const GLenum UNSIGNED_SHORT_5_5_5_1 = 0x8034;
const GLenum UNSIGNED_SHORT_5_6_5 = 0x8363;
-
+
/* Shaders */
const GLenum FRAGMENT_SHADER = 0x8B30;
const GLenum VERTEX_SHADER = 0x8B31;
@@ -305,7 +308,7 @@ interface WebGLRenderingContext {
const GLenum ACTIVE_ATTRIBUTES = 0x8B89;
const GLenum SHADING_LANGUAGE_VERSION = 0x8B8C;
const GLenum CURRENT_PROGRAM = 0x8B8D;
-
+
/* StencilFunction */
const GLenum NEVER = 0x0200;
const GLenum LESS = 0x0201;
@@ -315,7 +318,7 @@ interface WebGLRenderingContext {
const GLenum NOTEQUAL = 0x0205;
const GLenum GEQUAL = 0x0206;
const GLenum ALWAYS = 0x0207;
-
+
/* StencilOp */
/* ZERO */
const GLenum KEEP = 0x1E00;
@@ -325,16 +328,16 @@ interface WebGLRenderingContext {
const GLenum INVERT = 0x150A;
const GLenum INCR_WRAP = 0x8507;
const GLenum DECR_WRAP = 0x8508;
-
+
/* StringName */
const GLenum VENDOR = 0x1F00;
const GLenum RENDERER = 0x1F01;
const GLenum VERSION = 0x1F02;
-
+
/* TextureMagFilter */
const GLenum NEAREST = 0x2600;
const GLenum LINEAR = 0x2601;
-
+
/* TextureMinFilter */
/* NEAREST */
/* LINEAR */
@@ -342,17 +345,17 @@ interface WebGLRenderingContext {
const GLenum LINEAR_MIPMAP_NEAREST = 0x2701;
const GLenum NEAREST_MIPMAP_LINEAR = 0x2702;
const GLenum LINEAR_MIPMAP_LINEAR = 0x2703;
-
+
/* TextureParameterName */
const GLenum TEXTURE_MAG_FILTER = 0x2800;
const GLenum TEXTURE_MIN_FILTER = 0x2801;
const GLenum TEXTURE_WRAP_S = 0x2802;
const GLenum TEXTURE_WRAP_T = 0x2803;
-
+
/* TextureTarget */
const GLenum TEXTURE_2D = 0x0DE1;
const GLenum TEXTURE = 0x1702;
-
+
const GLenum TEXTURE_CUBE_MAP = 0x8513;
const GLenum TEXTURE_BINDING_CUBE_MAP = 0x8514;
const GLenum TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515;
@@ -362,7 +365,7 @@ interface WebGLRenderingContext {
const GLenum TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519;
const GLenum TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A;
const GLenum MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C;
-
+
/* TextureUnit */
const GLenum TEXTURE0 = 0x84C0;
const GLenum TEXTURE1 = 0x84C1;
@@ -397,12 +400,12 @@ interface WebGLRenderingContext {
const GLenum TEXTURE30 = 0x84DE;
const GLenum TEXTURE31 = 0x84DF;
const GLenum ACTIVE_TEXTURE = 0x84E0;
-
+
/* TextureWrapMode */
const GLenum REPEAT = 0x2901;
const GLenum CLAMP_TO_EDGE = 0x812F;
const GLenum MIRRORED_REPEAT = 0x8370;
-
+
/* Uniform Types */
const GLenum FLOAT_VEC2 = 0x8B50;
const GLenum FLOAT_VEC3 = 0x8B51;
@@ -419,7 +422,7 @@ interface WebGLRenderingContext {
const GLenum FLOAT_MAT4 = 0x8B5C;
const GLenum SAMPLER_2D = 0x8B5E;
const GLenum SAMPLER_CUBE = 0x8B60;
-
+
/* Vertex Arrays */
const GLenum VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622;
const GLenum VERTEX_ATTRIB_ARRAY_SIZE = 0x8623;
@@ -428,10 +431,14 @@ interface WebGLRenderingContext {
const GLenum VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A;
const GLenum VERTEX_ATTRIB_ARRAY_POINTER = 0x8645;
const GLenum VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F;
-
+
+ /* Read Format */
+ const GLenum IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A;
+ const GLenum IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B;
+
/* Shader Source */
const GLenum COMPILE_STATUS = 0x8B81;
-
+
/* Shader Precision-Specified Types */
const GLenum LOW_FLOAT = 0x8DF0;
const GLenum MEDIUM_FLOAT = 0x8DF1;
@@ -439,11 +446,11 @@ interface WebGLRenderingContext {
const GLenum LOW_INT = 0x8DF3;
const GLenum MEDIUM_INT = 0x8DF4;
const GLenum HIGH_INT = 0x8DF5;
-
+
/* Framebuffer Object. */
const GLenum FRAMEBUFFER = 0x8D40;
const GLenum RENDERBUFFER = 0x8D41;
-
+
const GLenum RGBA4 = 0x8056;
const GLenum RGB5_A1 = 0x8057;
const GLenum RGB565 = 0x8D62;
@@ -451,7 +458,7 @@ interface WebGLRenderingContext {
const GLenum STENCIL_INDEX = 0x1901;
const GLenum STENCIL_INDEX8 = 0x8D48;
const GLenum DEPTH_STENCIL = 0x84F9;
-
+
const GLenum RENDERBUFFER_WIDTH = 0x8D42;
const GLenum RENDERBUFFER_HEIGHT = 0x8D43;
const GLenum RENDERBUFFER_INTERNAL_FORMAT = 0x8D44;
@@ -461,31 +468,31 @@ interface WebGLRenderingContext {
const GLenum RENDERBUFFER_ALPHA_SIZE = 0x8D53;
const GLenum RENDERBUFFER_DEPTH_SIZE = 0x8D54;
const GLenum RENDERBUFFER_STENCIL_SIZE = 0x8D55;
-
+
const GLenum FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0;
const GLenum FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1;
const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2;
const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3;
-
+
const GLenum COLOR_ATTACHMENT0 = 0x8CE0;
const GLenum DEPTH_ATTACHMENT = 0x8D00;
const GLenum STENCIL_ATTACHMENT = 0x8D20;
const GLenum DEPTH_STENCIL_ATTACHMENT = 0x821A;
-
+
const GLenum NONE = 0;
-
+
const GLenum FRAMEBUFFER_COMPLETE = 0x8CD5;
const GLenum FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6;
const GLenum FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7;
const GLenum FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9;
const GLenum FRAMEBUFFER_UNSUPPORTED = 0x8CDD;
-
+
const GLenum FRAMEBUFFER_BINDING = 0x8CA6;
const GLenum RENDERBUFFER_BINDING = 0x8CA7;
const GLenum MAX_RENDERBUFFER_SIZE = 0x84E8;
-
+
const GLenum INVALID_FRAMEBUFFER_OPERATION = 0x0506;
-
+
/* WebGL-specific enums */
const GLenum UNPACK_FLIP_Y_WEBGL = 0x9240;
const GLenum UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241;
@@ -517,7 +524,7 @@ interface WebGLRenderingContext {
void blendEquation(GLenum mode);
void blendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
void blendFunc(GLenum sfactor, GLenum dfactor);
- void blendFuncSeparate(GLenum srcRGB, GLenum dstRGB,
+ void blendFuncSeparate(GLenum srcRGB, GLenum dstRGB,
GLenum srcAlpha, GLenum dstAlpha);
void bufferData(GLenum target, GLsizeiptr size, GLenum usage);
@@ -542,10 +549,10 @@ interface WebGLRenderingContext {
GLsizei width, GLsizei height, GLenum format,
ArrayBufferView data);
- void copyTexImage2D(GLenum target, GLint level, GLenum internalformat,
- GLint x, GLint y, GLsizei width, GLsizei height,
+ void copyTexImage2D(GLenum target, GLint level, GLenum internalformat,
+ GLint x, GLint y, GLsizei width, GLsizei height,
GLint border);
- void copyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
+ void copyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
GLint x, GLint y, GLsizei width, GLsizei height);
WebGLBuffer? createBuffer();
@@ -577,18 +584,18 @@ interface WebGLRenderingContext {
void enableVertexAttribArray(GLuint index);
void finish();
void flush();
- void framebufferRenderbuffer(GLenum target, GLenum attachment,
- GLenum renderbuffertarget,
+ void framebufferRenderbuffer(GLenum target, GLenum attachment,
+ GLenum renderbuffertarget,
WebGLRenderbuffer? renderbuffer);
- void framebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget,
+ void framebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget,
WebGLTexture? texture, GLint level);
void frontFace(GLenum mode);
void generateMipmap(GLenum target);
- [Creator]
+ [NewObject]
WebGLActiveInfo? getActiveAttrib(WebGLProgram? program, GLuint index);
- [Creator]
+ [NewObject]
WebGLActiveInfo? getActiveUniform(WebGLProgram? program, GLuint index);
sequence<WebGLShader>? getAttachedShaders(WebGLProgram? program);
@@ -602,14 +609,14 @@ interface WebGLRenderingContext {
[WebGLHandlesContextLoss] GLenum getError();
[Throws]
- any getFramebufferAttachmentParameter(GLenum target, GLenum attachment,
+ any getFramebufferAttachmentParameter(GLenum target, GLenum attachment,
GLenum pname);
any getProgramParameter(WebGLProgram? program, GLenum pname);
DOMString? getProgramInfoLog(WebGLProgram? program);
any getRenderbufferParameter(GLenum target, GLenum pname);
any getShaderParameter(WebGLShader? shader, GLenum pname);
- [Creator]
+ [NewObject]
WebGLShaderPrecisionFormat? getShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype);
DOMString? getShaderInfoLog(WebGLShader? shader);
@@ -618,10 +625,9 @@ interface WebGLRenderingContext {
any getTexParameter(GLenum target, GLenum pname);
- [Throws]
any getUniform(WebGLProgram? program, WebGLUniformLocation? location);
- [Creator]
+ [NewObject]
WebGLUniformLocation? getUniformLocation(WebGLProgram? program, DOMString name);
[Throws]
@@ -643,10 +649,10 @@ interface WebGLRenderingContext {
void polygonOffset(GLfloat factor, GLfloat units);
[Throws]
- void readPixels(GLint x, GLint y, GLsizei width, GLsizei height,
+ void readPixels(GLint x, GLint y, GLsizei width, GLsizei height,
GLenum format, GLenum type, ArrayBufferView? pixels);
- void renderbufferStorage(GLenum target, GLenum internalformat,
+ void renderbufferStorage(GLenum target, GLenum internalformat,
GLsizei width, GLsizei height);
void sampleCoverage(GLclampf value, GLboolean invert);
void scissor(GLint x, GLint y, GLsizei width, GLsizei height);
@@ -662,8 +668,8 @@ interface WebGLRenderingContext {
[Throws]
- void texImage2D(GLenum target, GLint level, GLenum internalformat,
- GLsizei width, GLsizei height, GLint border, GLenum format,
+ void texImage2D(GLenum target, GLint level, GLenum internalformat,
+ GLsizei width, GLsizei height, GLint border, GLenum format,
GLenum type, ArrayBufferView? pixels);
[Throws]
void texImage2D(GLenum target, GLint level, GLenum internalformat,
@@ -682,20 +688,20 @@ interface WebGLRenderingContext {
void texParameteri(GLenum target, GLenum pname, GLint param);
[Throws]
- void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
+ void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
+ GLsizei width, GLsizei height,
GLenum format, GLenum type, ArrayBufferView? pixels);
[Throws]
- void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
+ void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
GLenum format, GLenum type, ImageData? pixels);
[Throws]
- void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
+ void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
GLenum format, GLenum type, HTMLImageElement image); // May throw DOMException
[Throws]
- void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
+ void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
GLenum format, GLenum type, HTMLCanvasElement canvas); // May throw DOMException
[Throws]
- void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
+ void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
GLenum format, GLenum type, HTMLVideoElement video); // May throw DOMException
void uniform1f(WebGLUniformLocation? location, GLfloat x);
@@ -723,17 +729,17 @@ interface WebGLRenderingContext {
void uniform4iv(WebGLUniformLocation? location, Int32Array v);
void uniform4iv(WebGLUniformLocation? location, sequence<long> v);
- void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose,
+ void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose,
Float32Array value);
- void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose,
+ void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose,
sequence<GLfloat> value);
- void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose,
+ void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose,
Float32Array value);
- void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose,
+ void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose,
sequence<GLfloat> value);
- void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose,
+ void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose,
Float32Array value);
- void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose,
+ void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose,
sequence<GLfloat> value);
void useProgram(WebGLProgram? program);
@@ -751,7 +757,7 @@ interface WebGLRenderingContext {
void vertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
void vertexAttrib4fv(GLuint indx, Float32Array values);
void vertexAttrib4fv(GLuint indx, sequence<GLfloat> values);
- void vertexAttribPointer(GLuint indx, GLint size, GLenum type,
+ void vertexAttribPointer(GLuint indx, GLint size, GLenum type,
GLboolean normalized, GLsizei stride, GLintptr offset);
void viewport(GLint x, GLint y, GLsizei width, GLsizei height);
@@ -788,12 +794,18 @@ interface WebGLExtensionCompressedTextureATC
};
[NoInterfaceObject]
+interface WebGLExtensionCompressedTextureETC1
+{
+ const GLenum COMPRESSED_RGB_ETC1_WEBGL = 0x8D64;
+};
+
+[NoInterfaceObject]
interface WebGLExtensionCompressedTexturePVRTC
{
- const GLenum COMPRESSED_RGB_PVRTC_4BPPV1 = 0x8C00;
- const GLenum COMPRESSED_RGB_PVRTC_2BPPV1 = 0x8C01;
- const GLenum COMPRESSED_RGBA_PVRTC_4BPPV1 = 0x8C02;
- const GLenum COMPRESSED_RGBA_PVRTC_2BPPV1 = 0x8C03;
+ const GLenum COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8C00;
+ const GLenum COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 0x8C01;
+ const GLenum COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8C02;
+ const GLenum COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8C03;
};
[NoInterfaceObject]
@@ -804,6 +816,12 @@ interface WebGLExtensionDebugRendererInfo
};
[NoInterfaceObject]
+interface WebGLExtensionDebugShaders
+{
+ DOMString getTranslatedShaderSource(WebGLShader? shader);
+};
+
+[NoInterfaceObject]
interface WebGLExtensionDepthTexture
{
const GLenum UNSIGNED_INT_24_8_WEBGL = 0x84FA;
@@ -815,6 +833,11 @@ interface WebGLExtensionElementIndexUint
};
[NoInterfaceObject]
+interface WebGLExtensionFragDepth
+{
+};
+
+[NoInterfaceObject]
interface WebGLExtensionLoseContext {
void loseContext();
void restoreContext();
@@ -828,6 +851,15 @@ interface WebGLExtensionTextureFilterAnisotropic
};
[NoInterfaceObject]
+interface WebGLExtensionSRGB
+{
+ const GLenum SRGB_EXT = 0x8C40;
+ const GLenum SRGB_ALPHA_EXT = 0x8C42;
+ const GLenum SRGB8_ALPHA8_EXT = 0x8C43;
+ const GLenum FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT = 0x8210;
+};
+
+[NoInterfaceObject]
interface WebGLExtensionStandardDerivatives {
const GLenum FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8B8B;
};
@@ -883,3 +915,62 @@ interface WebGLExtensionDrawBuffers {
interface WebGLExtensionTextureFloatLinear
{
};
+
+[NoInterfaceObject]
+interface WebGLExtensionShaderTextureLod
+{
+};
+
+[NoInterfaceObject]
+interface WebGLExtensionTextureHalfFloat
+{
+ const GLenum HALF_FLOAT_OES = 0x8D61;
+};
+
+[NoInterfaceObject]
+interface WebGLExtensionTextureHalfFloatLinear
+{
+};
+
+[NoInterfaceObject]
+interface WebGLExtensionColorBufferFloat
+{
+ const GLenum RGBA32F_EXT = 0x8814;
+ const GLenum RGB32F_EXT = 0x8815;
+ const GLenum FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT = 0x8211;
+ const GLenum UNSIGNED_NORMALIZED_EXT = 0x8C17;
+};
+
+[NoInterfaceObject]
+interface WebGLExtensionColorBufferHalfFloat
+{
+ const GLenum RGBA16F_EXT = 0x881A;
+ const GLenum RGB16F_EXT = 0x881B;
+ const GLenum FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT = 0x8211;
+ const GLenum UNSIGNED_NORMALIZED_EXT = 0x8C17;
+};
+
+[NoInterfaceObject]
+interface WebGLExtensionVertexArray {
+ const GLenum VERTEX_ARRAY_BINDING_OES = 0x85B5;
+
+ WebGLVertexArray? createVertexArrayOES();
+ void deleteVertexArrayOES(WebGLVertexArray? arrayObject);
+ [WebGLHandlesContextLoss] GLboolean isVertexArrayOES(WebGLVertexArray? arrayObject);
+ void bindVertexArrayOES(WebGLVertexArray? arrayObject);
+};
+
+[NoInterfaceObject]
+interface WebGLExtensionInstancedArrays {
+ const GLenum VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE = 0x88FE;
+
+ void drawArraysInstancedANGLE(GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+ void drawElementsInstancedANGLE(GLenum mode, GLsizei count, GLenum type, GLintptr offset, GLsizei primcount);
+ void vertexAttribDivisorANGLE(GLuint index, GLuint divisor);
+};
+
+[NoInterfaceObject]
+interface WebGLExtensionBlendMinMax {
+ const GLenum MIN_EXT = 0x8007;
+ const GLenum MAX_EXT = 0x8008;
+};
diff --git a/dom/webidl/WebIDL.mk b/dom/webidl/WebIDL.mk
deleted file mode 100644
index f1347bb17..000000000
--- a/dom/webidl/WebIDL.mk
+++ /dev/null
@@ -1,484 +0,0 @@
-# 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/.
-
-webidl_base = $(topsrcdir)/dom/webidl
-
-generated_webidl_files = \
- CSS2Properties.webidl \
- $(NULL)
-
-webidl_files = \
- AnalyserNode.webidl \
- AnimationEvent.webidl \
- ArchiveReader.webidl \
- ArchiveRequest.webidl \
- Attr.webidl \
- AudioBuffer.webidl \
- AudioBufferSourceNode.webidl \
- AudioContext.webidl \
- AudioDestinationNode.webidl \
- AudioListener.webidl \
- AudioNode.webidl \
- AudioParam.webidl \
- AudioStreamTrack.webidl \
- AudioProcessingEvent.webidl \
- BarProp.webidl \
- BatteryManager.webidl \
- BeforeUnloadEvent.webidl \
- BiquadFilterNode.webidl \
- Blob.webidl \
- CameraManager.webidl \
- CanvasRenderingContext2D.webidl \
- CaretPosition.webidl \
- CDATASection.webidl \
- ChannelMergerNode.webidl \
- ChannelSplitterNode.webidl \
- CharacterData.webidl \
- ChildNode.webidl \
- ClientRect.webidl \
- ClientRectList.webidl \
- ClipboardEvent.webidl \
- CommandEvent.webidl \
- Comment.webidl \
- CompositionEvent.webidl \
- ConvolverNode.webidl \
- Coordinates.webidl \
- CSS.webidl \
- CSSPrimitiveValue.webidl \
- CSSStyleDeclaration.webidl \
- CSSStyleSheet.webidl \
- CSSValue.webidl \
- CSSValueList.webidl \
- DataContainerEvent.webidl \
- DelayNode.webidl \
- DesktopNotification.webidl \
- DeviceMotionEvent.webidl \
- DeviceStorage.webidl \
- Document.webidl \
- DocumentFragment.webidl \
- DocumentType.webidl \
- DOMCursor.webidl \
- DOMError.webidl \
- DOMImplementation.webidl \
- DOMParser.webidl \
- DOMRequest.webidl \
- DOMSettableTokenList.webidl \
- DOMStringMap.webidl \
- DOMTokenList.webidl \
- DOMTransaction.webidl \
- DragEvent.webidl \
- DummyBinding.webidl \
- DynamicsCompressorNode.webidl \
- Element.webidl \
- Event.webidl \
- EventHandler.webidl \
- EventListener.webidl \
- EventSource.webidl \
- EventTarget.webidl \
- File.webidl \
- FileHandle.webidl \
- FileList.webidl \
- FileMode.webidl \
- FileReader.webidl \
- FileReaderSync.webidl \
- FileRequest.webidl \
- FocusEvent.webidl \
- FormData.webidl \
- Function.webidl \
- GainNode.webidl \
- Geolocation.webidl \
- HTMLAnchorElement.webidl \
- HTMLAppletElement.webidl \
- HTMLAreaElement.webidl \
- HTMLAudioElement.webidl \
- HTMLBaseElement.webidl \
- HTMLBodyElement.webidl \
- HTMLBRElement.webidl \
- HTMLButtonElement.webidl \
- HTMLCanvasElement.webidl \
- HTMLCollection.webidl \
- HTMLDataElement.webidl \
- HTMLDataListElement.webidl \
- HTMLDirectoryElement.webidl \
- HTMLDivElement.webidl \
- HTMLDListElement.webidl \
- HTMLDocument.webidl \
- HTMLElement.webidl \
- HTMLEmbedElement.webidl \
- HTMLFieldSetElement.webidl \
- HTMLFontElement.webidl \
- HTMLFormElement.webidl \
- HTMLFrameElement.webidl \
- HTMLFrameSetElement.webidl \
- HTMLHeadElement.webidl \
- HTMLHeadingElement.webidl \
- HTMLHRElement.webidl \
- HTMLHtmlElement.webidl \
- HTMLIFrameElement.webidl \
- HTMLImageElement.webidl \
- HTMLInputElement.webidl \
- HTMLLabelElement.webidl \
- HTMLLegendElement.webidl \
- HTMLLIElement.webidl \
- HTMLLinkElement.webidl \
- HTMLMapElement.webidl \
- HTMLMediaElement.webidl \
- HTMLMenuElement.webidl \
- HTMLMenuItemElement.webidl \
- HTMLMetaElement.webidl \
- HTMLMeterElement.webidl \
- HTMLModElement.webidl \
- HTMLObjectElement.webidl \
- HTMLOListElement.webidl \
- HTMLOptGroupElement.webidl \
- HTMLOptionElement.webidl \
- HTMLOptionsCollection.webidl \
- HTMLOutputElement.webidl \
- HTMLParagraphElement.webidl \
- HTMLParamElement.webidl \
- HTMLPreElement.webidl \
- HTMLProgressElement.webidl \
- HTMLPropertiesCollection.webidl \
- HTMLQuoteElement.webidl \
- HTMLScriptElement.webidl \
- HTMLSelectElement.webidl \
- HTMLSourceElement.webidl \
- HTMLSpanElement.webidl \
- HTMLStyleElement.webidl \
- HTMLTableCaptionElement.webidl \
- HTMLTableCellElement.webidl \
- HTMLTableColElement.webidl \
- HTMLTableElement.webidl \
- HTMLTableRowElement.webidl \
- HTMLTableSectionElement.webidl \
- HTMLTemplateElement.webidl \
- HTMLTextAreaElement.webidl \
- HTMLTrackElement.webidl \
- HTMLTimeElement.webidl \
- HTMLTitleElement.webidl \
- HTMLUListElement.webidl \
- HTMLVideoElement.webidl \
- IDBDatabase.webidl \
- IDBFactory.webidl \
- IDBVersionChangeEvent.webidl \
- ImageData.webidl \
- ImageDocument.webidl \
- InspectorUtils.webidl \
- KeyboardEvent.webidl \
- KeyEvent.webidl \
- LinkStyle.webidl \
- LocalMediaStream.webidl \
- Location.webidl \
- MediaError.webidl \
- MediaStream.webidl \
- MediaStreamAudioDestinationNode.webidl \
- MediaStreamEvent.webidl \
- MediaStreamTrack.webidl \
- MessageEvent.webidl \
- MobileMessageManager.webidl \
- MouseEvent.webidl \
- MouseScrollEvent.webidl \
- MozActivity.webidl \
- MozMmsMessage.webidl \
- MozNamedAttrMap.webidl \
- MozTimeManager.webidl \
- MutationEvent.webidl \
- MutationObserver.webidl \
- NetDashboard.webidl \
- Node.webidl \
- NodeFilter.webidl \
- NodeIterator.webidl \
- NodeList.webidl \
- Notification.webidl \
- NotifyAudioAvailableEvent.webidl \
- NotifyPaintEvent.webidl \
- OfflineAudioCompletionEvent.webidl \
- OfflineAudioContext.webidl \
- OfflineResourceList.webidl \
- PaintRequest.webidl \
- PaintRequestList.webidl \
- PannerNode.webidl \
- Performance.webidl \
- PerformanceNavigation.webidl \
- PerformanceTiming.webidl \
- PeriodicWave.webidl \
- Position.webidl \
- PositionError.webidl \
- ProcessingInstruction.webidl \
- Promise.webidl \
- Range.webidl \
- Rect.webidl \
- RGBColor.webidl \
- RTCConfiguration.webidl \
- RTCDataChannelEvent.webidl \
- RTCIceCandidate.webidl \
- RTCPeerConnection.webidl \
- RTCPeerConnectionIceEvent.webidl \
- RTCSessionDescription.webidl \
- Screen.webidl \
- ScriptProcessorNode.webidl \
- ScrollAreaEvent.webidl \
- SimpleGestureEvent.webidl \
- StyleSheet.webidl \
- SVGAElement.webidl \
- SVGAltGlyphElement.webidl \
- SVGAngle.webidl \
- SVGAnimatedAngle.webidl \
- SVGAnimatedBoolean.webidl \
- SVGAnimatedLength.webidl \
- SVGAnimatedLengthList.webidl \
- SVGAnimatedNumberList.webidl \
- SVGAnimatedPathData.webidl \
- SVGAnimatedPoints.webidl \
- SVGAnimatedPreserveAspectRatio.webidl \
- SVGAnimatedRect.webidl \
- SVGAnimatedString.webidl \
- SVGAnimatedTransformList.webidl \
- SVGAnimateElement.webidl \
- SVGAnimateMotionElement.webidl \
- SVGAnimateTransformElement.webidl \
- SVGAnimationElement.webidl \
- SVGCircleElement.webidl \
- SVGClipPathElement.webidl \
- SVGComponentTransferFunctionElement.webidl \
- SVGDefsElement.webidl \
- SVGDescElement.webidl \
- SVGDocument.webidl \
- SVGElement.webidl \
- SVGEllipseElement.webidl \
- SVGFilterElement.webidl \
- SVGFilterPrimitiveStandardAttributes.webidl \
- SVGFEBlendElement.webidl \
- SVGFEColorMatrixElement.webidl \
- SVGFEComponentTransferElement.webidl \
- SVGFECompositeElement.webidl \
- SVGFEConvolveMatrixElement.webidl \
- SVGFEDiffuseLightingElement.webidl \
- SVGFEDisplacementMapElement.webidl \
- SVGFEDistantLightElement.webidl \
- SVGFEFloodElement.webidl \
- SVGFEFuncAElement.webidl \
- SVGFEFuncBElement.webidl \
- SVGFEFuncGElement.webidl \
- SVGFEFuncRElement.webidl \
- SVGFEGaussianBlurElement.webidl \
- SVGFEImageElement.webidl \
- SVGFEMergeElement.webidl \
- SVGFEMergeNodeElement.webidl \
- SVGFEMorphologyElement.webidl \
- SVGFEOffsetElement.webidl \
- SVGFEPointLightElement.webidl \
- SVGFESpecularLightingElement.webidl \
- SVGFESpotLightElement.webidl \
- SVGFETileElement.webidl \
- SVGFETurbulenceElement.webidl \
- SVGFitToViewBox.webidl \
- SVGForeignObjectElement.webidl \
- SVGGElement.webidl \
- SVGGradientElement.webidl \
- SVGGraphicsElement.webidl \
- SVGImageElement.webidl \
- SVGLengthList.webidl \
- SVGLinearGradientElement.webidl \
- SVGLineElement.webidl \
- SVGMarkerElement.webidl \
- SVGMaskElement.webidl \
- SVGMatrix.webidl \
- SVGMetadataElement.webidl \
- SVGMPathElement.webidl \
- SVGNumberList.webidl \
- SVGPathElement.webidl \
- SVGPathSeg.webidl \
- SVGPathSegList.webidl \
- SVGPatternElement.webidl \
- SVGPoint.webidl \
- SVGPointList.webidl \
- SVGPolygonElement.webidl \
- SVGPolylineElement.webidl \
- SVGPreserveAspectRatio.webidl \
- SVGRadialGradientElement.webidl \
- SVGRect.webidl \
- SVGRectElement.webidl \
- SVGScriptElement.webidl \
- SVGSetElement.webidl \
- SVGStopElement.webidl \
- SVGStringList.webidl \
- SVGStyleElement.webidl \
- SVGSVGElement.webidl \
- SVGSwitchElement.webidl \
- SVGSymbolElement.webidl \
- SVGTests.webidl \
- SVGTextContentElement.webidl \
- SVGTextElement.webidl \
- SVGTextPathElement.webidl \
- SVGTextPositioningElement.webidl \
- SVGTitleElement.webidl \
- SVGTransform.webidl \
- SVGTransformList.webidl \
- SVGTSpanElement.webidl \
- SVGUnitTypes.webidl \
- SVGUseElement.webidl \
- SVGURIReference.webidl \
- SVGViewElement.webidl \
- SVGZoomAndPan.webidl \
- SVGZoomEvent.webidl \
- Text.webidl \
- TextDecoder.webidl \
- TextEncoder.webidl \
- TextTrack.webidl \
- TextTrackCue.webidl \
- TextTrackCueList.webidl \
- TextTrackList.webidl \
- TimeEvent.webidl \
- TimeRanges.webidl \
- Touch.webidl \
- TouchEvent.webidl \
- TransitionEvent.webidl \
- TreeColumns.webidl \
- TreeWalker.webidl \
- UIEvent.webidl \
- URL.webidl \
- ValidityState.webidl \
- WebComponents.webidl \
- WebSocket.webidl \
- WheelEvent.webidl \
- UndoManager.webidl \
- URLUtils.webidl \
- VideoStreamTrack.webidl \
- WaveShaperNode.webidl \
- Window.webidl \
- XMLDocument.webidl \
- XMLHttpRequest.webidl \
- XMLHttpRequestEventTarget.webidl \
- XMLHttpRequestUpload.webidl \
- XMLSerializer.webidl \
- XMLStylesheetProcessingInstruction.webidl \
- XPathEvaluator.webidl \
- XULCommandEvent.webidl \
- XULDocument.webidl \
- XULElement.webidl \
- $(NULL)
-
-ifdef MOZ_AUDIO_CHANNEL_MANAGER
-webidl_files += \
- AudioChannelManager.webidl \
- $(NULL)
-endif
-
-ifdef MOZ_WEBGL
-webidl_files += \
- WebGLRenderingContext.webidl \
- $(NULL)
-endif
-
-ifdef MOZ_WEBRTC
-webidl_files += \
- DataChannel.webidl \
- MediaStreamList.webidl \
- $(NULL)
-endif
-
-ifdef MOZ_WEBSPEECH
-webidl_files += \
- SpeechGrammar.webidl \
- SpeechGrammarList.webidl \
- SpeechRecognitionAlternative.webidl \
- SpeechRecognitionResultList.webidl \
- SpeechRecognitionResult.webidl \
- SpeechRecognition.webidl \
- SpeechSynthesisUtterance.webidl \
- SpeechSynthesisVoice.webidl \
- SpeechSynthesis.webidl \
- SpeechSynthesisEvent.webidl \
- $(NULL)
-endif
-
-ifdef MOZ_GAMEPAD
-webidl_files += \
- Gamepad.webidl \
- $(NULL)
-endif
-
-ifdef MOZ_B2G_RIL
-webidl_files += \
- MozStkCommandEvent.webidl \
- $(NULL)
-endif
-
-webidl_files += \
- ProgressEvent.webidl \
- StorageEvent.webidl \
- DeviceProximityEvent.webidl \
- MozSettingsEvent.webidl \
- UserProximityEvent.webidl \
- CustomEvent.webidl \
- PageTransitionEvent.webidl \
- DOMTransactionEvent.webidl \
- PopStateEvent.webidl \
- HashChangeEvent.webidl \
- CloseEvent.webidl \
- MozContactChangeEvent.webidl \
- DeviceOrientationEvent.webidl \
- DeviceLightEvent.webidl \
- MozApplicationEvent.webidl \
- SmartCardEvent.webidl \
- StyleRuleChangeEvent.webidl \
- StyleSheetChangeEvent.webidl \
- StyleSheetApplicableStateChangeEvent.webidl \
- ElementReplaceEvent.webidl \
- MozSmsEvent.webidl \
- MozMmsEvent.webidl \
- DeviceStorageChangeEvent.webidl \
- PopupBlockedEvent.webidl \
- BlobEvent.webidl \
- $(NULL)
-
-ifdef MOZ_B2G_BT
-webidl_files += \
- BluetoothDeviceEvent.webidl \
- $(NULL)
-endif
-
-ifdef MOZ_B2G_RIL
-webidl_files += \
- CallEvent.webidl \
- CFStateChangeEvent.webidl \
- DataErrorEvent.webidl \
- IccCardLockErrorEvent.webidl \
- MozWifiStatusChangeEvent.webidl \
- MozWifiConnectionInfoEvent.webidl \
- MozCellBroadcastEvent.webidl \
- MozVoicemailEvent.webidl \
- USSDReceivedEvent.webidl \
- $(NULL)
-endif
-
-ifdef MOZ_GAMEPAD
-webidl_files += \
- GamepadEvent.webidl \
- GamepadButtonEvent.webidl \
- GamepadAxisMoveEvent.webidl \
- $(NULL)
-endif
-
-ifdef MOZ_WEBSPEECH
-webidl_files += \
- SpeechRecognitionEvent.webidl \
- SpeechRecognitionError.webidl \
- $(NULL)
-endif
-
-ifdef ENABLE_TESTS
-test_webidl_files := \
- TestCodeGen.webidl \
- TestDictionary.webidl \
- TestExampleGen.webidl \
- TestJSImplGen.webidl \
- TestJSImplInheritanceGen.webidl \
- TestTypedef.webidl \
- $(NULL)
-else
-test_webidl_files := $(NULL)
-endif
-
diff --git a/dom/webidl/WebSocket.webidl b/dom/webidl/WebSocket.webidl
index 85901ff93..8ec2c14f0 100644
--- a/dom/webidl/WebSocket.webidl
+++ b/dom/webidl/WebSocket.webidl
@@ -12,7 +12,8 @@
enum BinaryType { "blob", "arraybuffer" };
-[PrefControlled,
+[Func="mozilla::dom::WebSocket::PrefEnabled",
+ Exposed=(Window,Worker),
Constructor(DOMString url),
Constructor(DOMString url, DOMString protocols),
Constructor(DOMString url, sequence<DOMString> protocols)]
@@ -32,13 +33,10 @@ interface WebSocket : EventTarget {
// networking
- [SetterThrows]
attribute EventHandler onopen;
- [SetterThrows]
attribute EventHandler onerror;
- [SetterThrows]
attribute EventHandler onclose;
readonly attribute DOMString extensions;
@@ -50,7 +48,6 @@ interface WebSocket : EventTarget {
// messaging
- [SetterThrows]
attribute EventHandler onmessage;
attribute BinaryType binaryType;
diff --git a/dom/webidl/WebrtcGlobalInformation.webidl b/dom/webidl/WebrtcGlobalInformation.webidl
new file mode 100644
index 000000000..70e021c59
--- /dev/null
+++ b/dom/webidl/WebrtcGlobalInformation.webidl
@@ -0,0 +1,37 @@
+/* -*- 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/.
+ */
+
+dictionary WebrtcGlobalStatisticsReport {
+ sequence<RTCStatsReportInternal> reports;
+};
+
+callback WebrtcGlobalStatisticsCallback = void (WebrtcGlobalStatisticsReport reports);
+callback WebrtcGlobalLoggingCallback = void (sequence<DOMString> logMessages);
+
+[ChromeOnly]
+interface WebrtcGlobalInformation {
+
+ [Throws]
+ static void getAllStats(WebrtcGlobalStatisticsCallback callback,
+ optional DOMString pcIdFilter);
+
+ [Throws]
+ static void getLogging(DOMString pattern,
+ WebrtcGlobalLoggingCallback callback);
+
+ // NSPR WebRTC Trace debug level (0 - 65535)
+ //
+ // Notes:
+ // - Setting a non-zero debug level turns on gathering of log for file output.
+ // - Subsequently setting a zero debug level writes that log to disk.
+
+ static attribute long debugLevel;
+
+ // WebRTC AEC debugging enable
+ static attribute boolean aecDebug;
+};
+
+
diff --git a/dom/webidl/WifiOptions.webidl b/dom/webidl/WifiOptions.webidl
new file mode 100644
index 000000000..22105b1b0
--- /dev/null
+++ b/dom/webidl/WifiOptions.webidl
@@ -0,0 +1,38 @@
+/* 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/. */
+
+/**
+ * This dictionnary holds the parameters sent to the wifi service.
+ */
+dictionary WifiCommandOptions
+{
+ long id = 0; // opaque id.
+ DOMString cmd = ""; // the command name.
+ DOMString request; // for "command"
+};
+
+/**
+ * This dictionnary holds the parameters sent back to WifiWorker.js
+ */
+dictionary WifiResultOptions
+{
+ long id = 0; // opaque id.
+ long status = 0; // the return status of the command.
+ // Used by most commands.
+ DOMString reply = ""; // for "command".
+};
+
+
+/**
+ * This dictionary holds the callback parameter sent back from WifiCertService
+ * to WifiWorker, and should only be passed around in chrome process.
+ */
+dictionary WifiCertServiceResultOptions
+{
+ long id = 0; // request id in WifiWorker.
+ long status = 0; // error code of the request, 0 indicates success.
+ unsigned short usageFlag = 0; // usage flag of certificate, the flag is defined
+ // in nsIWifiCertService.idl
+ DOMString nickname = ""; // nickname of certificate of the request.
+};
diff --git a/dom/webidl/Window.webidl b/dom/webidl/Window.webidl
index 330b014a5..e2f99418e 100644
--- a/dom/webidl/Window.webidl
+++ b/dom/webidl/Window.webidl
@@ -4,7 +4,470 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*
* The origin of this IDL file is:
+ * http://www.whatwg.org/specs/web-apps/current-work/
+ * https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html
+ * https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html
+ * http://dev.w3.org/csswg/cssom/
+ * http://dev.w3.org/csswg/cssom-view/
* https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/RequestAnimationFrame/Overview.html
+ * https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html
+ * https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html
+ * http://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html
*/
+interface ApplicationCache;
+interface IID;
+interface MozFrameRequestCallback;
+interface nsIBrowserDOMWindow;
+interface nsIMessageBroadcaster;
+interface nsIDOMCrypto;
+typedef any Transferable;
+
+// http://www.whatwg.org/specs/web-apps/current-work/
+[PrimaryGlobal, NeedResolve]
+/*sealed*/ interface Window : EventTarget {
+ // the current browsing context
+ [Unforgeable, Constant, StoreInSlot,
+ CrossOriginReadable] readonly attribute Window window;
+ [Replaceable, Constant, StoreInSlot,
+ CrossOriginReadable] readonly attribute Window self;
+ [Unforgeable, StoreInSlot, Pure] readonly attribute Document? document;
+ [Throws] attribute DOMString name;
+ [PutForwards=href, Unforgeable, Throws,
+ CrossOriginReadable, CrossOriginWritable] readonly attribute Location? location;
+ [Throws] readonly attribute History history;
+ [Replaceable, Throws] readonly attribute BarProp locationbar;
+ [Replaceable, Throws] readonly attribute BarProp menubar;
+ [Replaceable, Throws] readonly attribute BarProp personalbar;
+ [Replaceable, Throws] readonly attribute BarProp scrollbars;
+ [Replaceable, Throws] readonly attribute BarProp statusbar;
+ [Replaceable, Throws] readonly attribute BarProp toolbar;
+ [Throws] attribute DOMString status;
+ [Throws, CrossOriginCallable, UnsafeInPrerendering] void close();
+ [Throws, CrossOriginReadable] readonly attribute boolean closed;
+ [Throws] void stop();
+ [Throws, CrossOriginCallable, UnsafeInPrerendering] void focus();
+ [Throws, CrossOriginCallable] void blur();
+
+ // other browsing contexts
+ [Replaceable, Throws, CrossOriginReadable] readonly attribute WindowProxy frames;
+ [Replaceable, CrossOriginReadable] readonly attribute unsigned long length;
+ //[Unforgeable, Throws, CrossOriginReadable] readonly attribute WindowProxy top;
+ [Unforgeable, Throws, CrossOriginReadable] readonly attribute WindowProxy? top;
+ [Throws, CrossOriginReadable] attribute any opener;
+ //[Throws] readonly attribute WindowProxy parent;
+ [Replaceable, Throws, CrossOriginReadable] readonly attribute WindowProxy? parent;
+ [Throws] readonly attribute Element? frameElement;
+ //[Throws] WindowProxy open(optional DOMString url = "about:blank", optional DOMString target = "_blank", [TreatNullAs=EmptyString] optional DOMString features = "", optional boolean replace = false);
+ [Throws, UnsafeInPrerendering] WindowProxy? open(optional DOMString url = "", optional DOMString target = "", [TreatNullAs=EmptyString] optional DOMString features = "");
+ // We think the indexed getter is a bug in the spec, it actually needs to live
+ // on the WindowProxy
+ //getter WindowProxy (unsigned long index);
+ getter object (DOMString name);
+
+ // the user agent
+ [Throws] readonly attribute Navigator navigator;
+#ifdef HAVE_SIDEBAR
+ [Replaceable, Throws] readonly attribute External external;
+#endif
+ [Throws] readonly attribute ApplicationCache applicationCache;
+
+ // user prompts
+ [Throws, UnsafeInPrerendering] void alert();
+ [Throws, UnsafeInPrerendering] void alert(DOMString message);
+ [Throws, UnsafeInPrerendering] boolean confirm(optional DOMString message = "");
+ [Throws, UnsafeInPrerendering] DOMString? prompt(optional DOMString message = "", optional DOMString default = "");
+ [Throws, UnsafeInPrerendering] void print();
+ //[Throws] any showModalDialog(DOMString url, optional any argument);
+ [Throws, Func="nsGlobalWindow::IsShowModalDialogEnabled", UnsafeInPrerendering]
+ any showModalDialog(DOMString url, optional any argument, optional DOMString options = "");
+
+ [Throws, CrossOriginCallable] void postMessage(any message, DOMString targetOrigin, optional sequence<Transferable> transfer);
+
+ // also has obsolete members
+};
+Window implements GlobalEventHandlers;
+Window implements WindowEventHandlers;
+
+// http://www.whatwg.org/specs/web-apps/current-work/
+[NoInterfaceObject, Exposed=(Window,Worker)]
+interface WindowTimers {
+ [Throws] long setTimeout(Function handler, optional long timeout = 0, any... arguments);
+ [Throws] long setTimeout(DOMString handler, optional long timeout = 0, any... unused);
+ [Throws] void clearTimeout(optional long handle = 0);
+ [Throws] long setInterval(Function handler, optional long timeout, any... arguments);
+ [Throws] long setInterval(DOMString handler, optional long timeout, any... unused);
+ [Throws] void clearInterval(optional long handle = 0);
+};
+Window implements WindowTimers;
+
+// http://www.whatwg.org/specs/web-apps/current-work/
+[NoInterfaceObject, Exposed=(Window,Worker)]
+interface WindowBase64 {
+ [Throws] DOMString btoa(DOMString btoa);
+ [Throws] DOMString atob(DOMString atob);
+};
+Window implements WindowBase64;
+
+// http://www.whatwg.org/specs/web-apps/current-work/
+[NoInterfaceObject]
+interface WindowSessionStorage {
+ //[Throws] readonly attribute Storage sessionStorage;
+ [Throws] readonly attribute Storage? sessionStorage;
+};
+Window implements WindowSessionStorage;
+
+// http://www.whatwg.org/specs/web-apps/current-work/
+[NoInterfaceObject]
+interface WindowLocalStorage {
+ [Throws] readonly attribute Storage? localStorage;
+};
+Window implements WindowLocalStorage;
+
+// http://www.whatwg.org/specs/web-apps/current-work/
+partial interface Window {
+ void captureEvents();
+ void releaseEvents();
+};
+
+// https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html
+partial interface Window {
+ //[Throws] Selection getSelection();
+ [Throws] Selection? getSelection();
+};
+
+// https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html
+Window implements IDBEnvironment;
+
+// http://dev.w3.org/csswg/cssom/
+partial interface Window {
+ //[NewObject, Throws] CSSStyleDeclaration getComputedStyle(Element elt, optional DOMString pseudoElt = "");
+ [NewObject, Throws] CSSStyleDeclaration? getComputedStyle(Element elt, optional DOMString pseudoElt = "");
+};
+
+// http://dev.w3.org/csswg/cssom-view/
+enum ScrollBehavior { "auto", "instant", "smooth" };
+
+dictionary ScrollOptions {
+ ScrollBehavior behavior = "auto";
+};
+
+dictionary ScrollToOptions : ScrollOptions {
+ unrestricted double left;
+ unrestricted double top;
+};
+
+partial interface Window {
+ //[Throws,NewObject] MediaQueryList matchMedia(DOMString query);
+ [Throws,NewObject] MediaQueryList? matchMedia(DOMString query);
+ //[SameObject]
+ [Throws] readonly attribute Screen screen;
+
+ // browsing context
+ //[Throws] void moveTo(double x, double y);
+ //[Throws] void moveBy(double x, double y);
+ //[Throws] void resizeTo(double x, double y);
+ //[Throws] void resizeBy(double x, double y);
+ [Throws, UnsafeInPrerendering] void moveTo(long x, long y);
+ [Throws, UnsafeInPrerendering] void moveBy(long x, long y);
+ [Throws, UnsafeInPrerendering] void resizeTo(long x, long y);
+ [Throws, UnsafeInPrerendering] void resizeBy(long x, long y);
+
+ // viewport
+ //[Throws] readonly attribute double innerWidth;
+ //[Throws] readonly attribute double innerHeight;
+ [Throws] attribute long innerWidth;
+ [Throws] attribute long innerHeight;
+
+ // viewport scrolling
+ //[Throws] readonly attribute double scrollX;
+ //[Throws] readonly attribute double pageXOffset;
+ //[Throws] readonly attribute double scrollY;
+ //[Throws] readonly attribute double pageYOffset;
+ void scroll(unrestricted double x, unrestricted double y);
+ void scroll(optional ScrollToOptions options);
+ void scrollTo(unrestricted double x, unrestricted double y);
+ void scrollTo(optional ScrollToOptions options);
+ void scrollBy(unrestricted double x, unrestricted double y);
+ void scrollBy(optional ScrollToOptions options);
+ [Replaceable, Throws] readonly attribute long scrollX;
+ [Throws] readonly attribute long pageXOffset;
+ [Replaceable, Throws] readonly attribute long scrollY;
+ [Throws] readonly attribute long pageYOffset;
+
+ // client
+ //[Throws] readonly attribute double screenX;
+ //[Throws] readonly attribute double screenY;
+ //[Throws] readonly attribute double outerWidth;
+ //[Throws] readonly attribute double outerHeight;
+ [Throws] attribute long screenX;
+ [Throws] attribute long screenY;
+ [Throws] attribute long outerWidth;
+ [Throws] attribute long outerHeight;
+};
+
+/**
+ * Special function that gets the fill ratio from the compositor used for testing
+ * and is an indicator that we're layerizing correctly.
+ * This function will call the given callback current fill ratio for a
+ * composited frame. We don't guarantee which frame fill ratios will be returned.
+ */
+partial interface Window {
+ [ChromeOnly, Throws] void mozRequestOverfill(OverfillCallback callback);
+};
+callback OverfillCallback = void (unsigned long overfill);
+
+// https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/RequestAnimationFrame/Overview.html
+partial interface Window {
+ [Throws] long requestAnimationFrame(FrameRequestCallback callback);
+ [Throws] void cancelAnimationFrame(long handle);
+};
callback FrameRequestCallback = void (DOMHighResTimeStamp time);
+
+// https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html
+partial interface Window {
+ [Replaceable, Pure, StoreInSlot] readonly attribute Performance? performance;
+};
+
+// https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html
+Window implements GlobalCrypto;
+
+#ifdef MOZ_WEBSPEECH
+// http://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html
+[NoInterfaceObject]
+interface SpeechSynthesisGetter {
+ [Throws, Pref="media.webspeech.synth.enabled"] readonly attribute SpeechSynthesis speechSynthesis;
+};
+
+Window implements SpeechSynthesisGetter;
+#endif
+
+// http://www.whatwg.org/specs/web-apps/current-work/
+[NoInterfaceObject]
+interface WindowModal {
+ [Throws, Func="nsGlobalWindow::IsModalContentWindow"] readonly attribute any dialogArguments;
+ [Throws, Func="nsGlobalWindow::IsModalContentWindow"] attribute any returnValue;
+};
+Window implements WindowModal;
+
+// Mozilla-specific stuff
+partial interface Window {
+ //[NewObject, Throws] CSSStyleDeclaration getDefaultComputedStyle(Element elt, optional DOMString pseudoElt = "");
+ [NewObject, Throws] CSSStyleDeclaration? getDefaultComputedStyle(Element elt, optional DOMString pseudoElt = "");
+
+ [Throws] long mozRequestAnimationFrame(MozFrameRequestCallback aCallback);
+
+ /**
+ * Cancel a refresh callback.
+ */
+ [Throws] void mozCancelAnimationFrame(long aHandle);
+ // Backwards-compat shim for now to make Google maps work
+ [Throws] void mozCancelRequestAnimationFrame(long aHandle);
+
+ /**
+ * The current animation start time in milliseconds since the epoch.
+ */
+ [Throws] readonly attribute long long mozAnimationStartTime;
+
+ // Mozilla extensions
+ /**
+ * Method for scrolling this window by a number of lines.
+ */
+ void scrollByLines(long numLines, optional ScrollOptions options);
+
+ /**
+ * Method for scrolling this window by a number of pages.
+ */
+ void scrollByPages(long numPages, optional ScrollOptions options);
+
+ /**
+ * Method for sizing this window to the content in the window.
+ */
+ [Throws, UnsafeInPrerendering] void sizeToContent();
+
+ // XXX Shouldn't this be in nsIDOMChromeWindow?
+ [ChromeOnly, Replaceable, Throws] readonly attribute MozControllers controllers;
+
+ [ChromeOnly, Throws] readonly attribute Element? realFrameElement;
+
+ [Throws] readonly attribute float mozInnerScreenX;
+ [Throws] readonly attribute float mozInnerScreenY;
+ [Throws] readonly attribute float devicePixelRatio;
+
+ /* The maximum offset that the window can be scrolled to
+ (i.e., the document width/height minus the scrollport width/height) */
+ [Replaceable, Throws] readonly attribute long scrollMaxX;
+ [Replaceable, Throws] readonly attribute long scrollMaxY;
+
+ [Throws, UnsafeInPrerendering] attribute boolean fullScreen;
+
+ [Throws, ChromeOnly, UnsafeInPrerendering] void back();
+ [Throws, ChromeOnly, UnsafeInPrerendering] void forward();
+ [Throws, ChromeOnly, UnsafeInPrerendering] void home();
+
+ // XXX Should this be in nsIDOMChromeWindow?
+ void updateCommands(DOMString action,
+ optional Selection? sel = null,
+ optional short reason = 0);
+
+ /* Find in page.
+ * @param str: the search pattern
+ * @param caseSensitive: is the search caseSensitive
+ * @param backwards: should we search backwards
+ * @param wrapAround: should we wrap the search
+ * @param wholeWord: should we search only for whole words
+ * @param searchInFrames: should we search through all frames
+ * @param showDialog: should we show the Find dialog
+ */
+ [Throws, UnsafeInPrerendering] boolean find(optional DOMString str = "",
+ optional boolean caseSensitive = false,
+ optional boolean backwards = false,
+ optional boolean wrapAround = false,
+ optional boolean wholeWord = false,
+ optional boolean searchInFrames = false,
+ optional boolean showDialog = false);
+
+ /**
+ * Returns the number of times this document for this window has
+ * been painted to the screen.
+ */
+ [Throws] readonly attribute unsigned long long mozPaintCount;
+
+ /**
+ * This property exists because static attributes don't yet work for
+ * JS-implemented WebIDL (see bugs 1058606 and 863952). With this hack, we
+ * can use `MozSelfSupport.something(...)`, which will continue to work
+ * after we ditch this property and switch to static attributes. See
+ */
+ [ChromeOnly, Throws] readonly attribute MozSelfSupport MozSelfSupport;
+
+ [Pure]
+ attribute EventHandler onwheel;
+
+ attribute EventHandler ondevicemotion;
+ attribute EventHandler ondeviceorientation;
+ attribute EventHandler ondeviceproximity;
+ attribute EventHandler onuserproximity;
+ attribute EventHandler ondevicelight;
+
+#ifdef MOZ_B2G
+ attribute EventHandler onmoztimechange;
+ attribute EventHandler onmoznetworkupload;
+ attribute EventHandler onmoznetworkdownload;
+#endif
+
+ void dump(DOMString str);
+
+ /**
+ * This method is here for backwards compatibility with 4.x only,
+ * its implementation is a no-op
+ */
+ void setResizable(boolean resizable);
+
+ /**
+ * This is the scriptable version of
+ * nsIDOMWindow::openDialog() that takes 3 optional
+ * arguments, plus any additional arguments are passed on as
+ * arguments on the dialog's window object (window.arguments).
+ */
+ [Throws, ChromeOnly, UnsafeInPrerendering] WindowProxy? openDialog(optional DOMString url = "",
+ optional DOMString name = "",
+ optional DOMString options = "",
+ any... extraArguments);
+
+ [Replaceable, Throws] readonly attribute object? content;
+
+ [ChromeOnly, Throws] readonly attribute object? __content;
+
+ [Throws, ChromeOnly] any getInterface(IID iid);
+};
+
+Window implements TouchEventHandlers;
+
+Window implements OnErrorEventHandlerForWindow;
+
+// ConsoleAPI
+partial interface Window {
+ [Replaceable, GetterThrows]
+ readonly attribute Console console;
+};
+
+#ifdef HAVE_SIDEBAR
+// Mozilla extension
+partial interface Window {
+ [Replaceable, Throws]
+ readonly attribute (External or WindowProxy) sidebar;
+};
+#endif
+
+[Func="IsChromeOrXBL"]
+interface ChromeWindow {
+ [Func="nsGlobalWindow::IsPrivilegedChromeWindow"]
+ const unsigned short STATE_MAXIMIZED = 1;
+ [Func="nsGlobalWindow::IsPrivilegedChromeWindow"]
+ const unsigned short STATE_MINIMIZED = 2;
+ [Func="nsGlobalWindow::IsPrivilegedChromeWindow"]
+ const unsigned short STATE_NORMAL = 3;
+ [Func="nsGlobalWindow::IsPrivilegedChromeWindow"]
+ const unsigned short STATE_FULLSCREEN = 4;
+
+ [Func="nsGlobalWindow::IsPrivilegedChromeWindow"]
+ readonly attribute unsigned short windowState;
+
+ /**
+ * browserDOMWindow provides access to yet another layer of
+ * utility functions implemented by chrome script. It will be null
+ * for DOMWindows not corresponding to browsers.
+ */
+ [Throws, Func="nsGlobalWindow::IsPrivilegedChromeWindow"]
+ attribute nsIBrowserDOMWindow? browserDOMWindow;
+
+ [Throws, Func="nsGlobalWindow::IsPrivilegedChromeWindow"]
+ void getAttention();
+
+ [Throws, Func="nsGlobalWindow::IsPrivilegedChromeWindow"]
+ void getAttentionWithCycleCount(long aCycleCount);
+
+ [Throws, Func="nsGlobalWindow::IsPrivilegedChromeWindow"]
+ void setCursor(DOMString cursor);
+
+ [Throws, Func="nsGlobalWindow::IsPrivilegedChromeWindow", UnsafeInPrerendering]
+ void maximize();
+ [Throws, Func="nsGlobalWindow::IsPrivilegedChromeWindow", UnsafeInPrerendering]
+ void minimize();
+ [Throws, Func="nsGlobalWindow::IsPrivilegedChromeWindow", UnsafeInPrerendering]
+ void restore();
+
+ /**
+ * Notify a default button is loaded on a dialog or a wizard.
+ * defaultButton is the default button.
+ */
+ [Throws, Func="nsGlobalWindow::IsPrivilegedChromeWindow"]
+ void notifyDefaultButtonLoaded(Element defaultButton);
+
+ [Throws, Func="nsGlobalWindow::IsPrivilegedChromeWindow"]
+ readonly attribute nsIMessageBroadcaster messageManager;
+
+ /**
+ * Returns the message manager identified by the given group name that
+ * manages all frame loaders belonging to that group.
+ */
+ [Throws, Func="nsGlobalWindow::IsPrivilegedChromeWindow"]
+ nsIMessageBroadcaster getGroupMessageManager(DOMString aGroup);
+
+ /**
+ * On some operating systems, we must allow the window manager to
+ * handle window dragging. This function tells the window manager to
+ * start dragging the window. This function will fail unless called
+ * while the left mouse button is held down, callers must check this.
+ *
+ * The optional panel argument should be set when moving a panel.
+ *
+ * Throws NS_ERROR_NOT_IMPLEMENTED if the OS doesn't support this.
+ */
+ [Throws, Func="nsGlobalWindow::IsPrivilegedChromeWindow"]
+ void beginWindowMove(Event mouseDownEvent, optional Element? panel = null);
+};
+
+Window implements ChromeWindow;
+Window implements GlobalFetch;
diff --git a/dom/webidl/WindowRoot.webidl b/dom/webidl/WindowRoot.webidl
new file mode 100644
index 000000000..0ddb1a9fb
--- /dev/null
+++ b/dom/webidl/WindowRoot.webidl
@@ -0,0 +1,9 @@
+/* -*- 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/.
+ */
+
+[ChromeOnly]
+interface WindowRoot : EventTarget {
+};
diff --git a/dom/webidl/Worker.webidl b/dom/webidl/Worker.webidl
new file mode 100644
index 000000000..6376fedfa
--- /dev/null
+++ b/dom/webidl/Worker.webidl
@@ -0,0 +1,33 @@
+/* -*- 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.whatwg.org/specs/web-apps/current-work/multipage/workers.html
+ *
+ * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and Opera
+ * Software ASA.
+ * You are granted a license to use, reproduce and create derivative works of
+ * this document.
+ */
+
+[Constructor(DOMString scriptURL),
+ Func="mozilla::dom::workers::WorkerPrivate::WorkerAvailable",
+ Exposed=(Window,Worker,System)]
+interface Worker : EventTarget {
+ void terminate();
+
+ [Throws]
+ void postMessage(any message, optional sequence<any> transfer);
+
+ attribute EventHandler onmessage;
+};
+
+Worker implements AbstractWorker;
+
+[Constructor(DOMString scriptURL),
+ Func="mozilla::dom::workers::ChromeWorkerPrivate::WorkerAvailable",
+ Exposed=(Window,Worker,System)]
+interface ChromeWorker : Worker {
+};
diff --git a/dom/webidl/WorkerGlobalScope.webidl b/dom/webidl/WorkerGlobalScope.webidl
new file mode 100644
index 000000000..039c09036
--- /dev/null
+++ b/dom/webidl/WorkerGlobalScope.webidl
@@ -0,0 +1,57 @@
+/* -*- 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.whatwg.org/specs/web-apps/current-work/multipage/workers.html#the-workerglobalscope-common-interface
+ *
+ * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and Opera
+ * Software ASA.
+ * You are granted a license to use, reproduce and create derivative works of
+ * this document.
+ */
+
+[Exposed=Worker]
+interface WorkerGlobalScope : EventTarget {
+ [Constant, Cached]
+ readonly attribute WorkerGlobalScope self;
+
+ [Replaceable]
+ readonly attribute Console console;
+
+ readonly attribute WorkerLocation location;
+
+ void close();
+ attribute OnErrorEventHandler onerror;
+
+ attribute EventHandler onoffline;
+ attribute EventHandler ononline;
+ // also has additional members in a partial interface
+};
+
+partial interface WorkerGlobalScope {
+ [Throws]
+ void importScripts(DOMString... urls);
+
+ readonly attribute WorkerNavigator navigator;
+};
+
+WorkerGlobalScope implements WindowTimers;
+WorkerGlobalScope implements WindowBase64;
+WorkerGlobalScope implements GlobalFetch;
+WorkerGlobalScope implements IDBEnvironment;
+
+// Not implemented yet: bug 1072107.
+// WorkerGlobalScope implements FontFaceSource;
+
+// Mozilla extensions
+partial interface WorkerGlobalScope {
+ attribute EventHandler onclose;
+
+ void dump(optional DOMString str);
+
+ // XXXbz no spec for this yet, because the webperf WG is a bit dysfunctional
+ [Constant, Cached]
+ readonly attribute Performance performance;
+};
diff --git a/dom/webidl/WorkerLocation.webidl b/dom/webidl/WorkerLocation.webidl
new file mode 100644
index 000000000..7e27b09c0
--- /dev/null
+++ b/dom/webidl/WorkerLocation.webidl
@@ -0,0 +1,17 @@
+/* -*- 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.whatwg.org/html/#worker-locations
+ *
+ * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and Opera
+ * Software ASA.
+ * You are granted a license to use, reproduce and create derivative works of
+ * this document.
+ */
+
+[Exposed=Worker]
+interface WorkerLocation { };
+WorkerLocation implements URLUtilsReadOnly;
diff --git a/dom/webidl/WorkerNavigator.webidl b/dom/webidl/WorkerNavigator.webidl
new file mode 100644
index 000000000..1b5118eae
--- /dev/null
+++ b/dom/webidl/WorkerNavigator.webidl
@@ -0,0 +1,13 @@
+/* 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/. */
+
+
+[Exposed=Worker]
+interface WorkerNavigator {
+};
+
+WorkerNavigator implements NavigatorID;
+WorkerNavigator implements NavigatorLanguage;
+WorkerNavigator implements NavigatorOnLine;
+WorkerNavigator implements NavigatorDataStore;
diff --git a/dom/webidl/XMLHttpRequest.webidl b/dom/webidl/XMLHttpRequest.webidl
index dc0b388ba..d1664ef36 100644
--- a/dom/webidl/XMLHttpRequest.webidl
+++ b/dom/webidl/XMLHttpRequest.webidl
@@ -10,7 +10,6 @@
* liability, trademark and document use rules apply.
*/
-interface Blob;
interface InputStream;
interface MozChannel;
interface IID;
@@ -54,10 +53,10 @@ dictionary MozXMLHttpRequestParameters
// things like this:
// c = new(window.ActiveXObject || XMLHttpRequest)("Microsoft.XMLHTTP")
// To handle that, we need a constructor that takes a string.
- Constructor(DOMString ignored)]
+ Constructor(DOMString ignored),
+ Exposed=(Window,Worker)]
interface XMLHttpRequest : XMLHttpRequestEventTarget {
// event handler
- [SetterThrows, GetterThrows=Workers]
attribute EventHandler onreadystatechange;
// states
@@ -71,7 +70,9 @@ interface XMLHttpRequest : XMLHttpRequestEventTarget {
// request
[Throws]
- void open(ByteString method, DOMString url, optional boolean async = true,
+ void open(ByteString method, DOMString url);
+ [Throws]
+ void open(ByteString method, DOMString url, boolean async,
optional DOMString? user, optional DOMString? password);
[Throws]
void setRequestHeader(ByteString header, ByteString value);
@@ -128,20 +129,20 @@ interface XMLHttpRequest : XMLHttpRequestEventTarget {
[Throws]
readonly attribute DOMString? responseText;
- [Throws=MainThread]
+ [Throws, Exposed=Window]
readonly attribute Document? responseXML;
// Mozilla-specific stuff
- [SetterThrows=Workers]
+ [ChromeOnly, SetterThrows=Workers]
attribute boolean mozBackgroundRequest;
- [ChromeOnly]
+ [ChromeOnly, Exposed=Window]
readonly attribute MozChannel? channel;
[Throws]
void sendAsBinary(DOMString body);
- [Throws, ChromeOnly]
+ [Throws, ChromeOnly, Exposed=Window]
any getInterface(IID iid);
readonly attribute boolean mozAnon;
diff --git a/dom/webidl/XMLHttpRequestEventTarget.webidl b/dom/webidl/XMLHttpRequestEventTarget.webidl
index 73195e839..39c2c53f5 100644
--- a/dom/webidl/XMLHttpRequestEventTarget.webidl
+++ b/dom/webidl/XMLHttpRequestEventTarget.webidl
@@ -10,27 +10,27 @@
* liability, trademark and document use rules apply.
*/
-[NoInterfaceObject]
+[Exposed=(Window,Worker)]
interface XMLHttpRequestEventTarget : EventTarget {
// event handlers
- [SetterThrows, GetterThrows=Workers]
+ [SetterThrows=Workers, GetterThrows=Workers]
attribute EventHandler onloadstart;
- [SetterThrows, GetterThrows=Workers]
+ [SetterThrows=Workers, GetterThrows=Workers]
attribute EventHandler onprogress;
- [SetterThrows, GetterThrows=Workers]
+ [SetterThrows=Workers, GetterThrows=Workers]
attribute EventHandler onabort;
- [SetterThrows, GetterThrows=Workers]
+ [SetterThrows=Workers, GetterThrows=Workers]
attribute EventHandler onerror;
- [SetterThrows, GetterThrows=Workers]
+ [SetterThrows=Workers, GetterThrows=Workers]
attribute EventHandler onload;
- [SetterThrows, GetterThrows=Workers]
+ [SetterThrows=Workers, GetterThrows=Workers]
attribute EventHandler ontimeout;
- [SetterThrows, GetterThrows=Workers]
+ [SetterThrows=Workers, GetterThrows=Workers]
attribute EventHandler onloadend;
};
diff --git a/dom/webidl/XMLHttpRequestUpload.webidl b/dom/webidl/XMLHttpRequestUpload.webidl
index 56bf39787..002b892c2 100644
--- a/dom/webidl/XMLHttpRequestUpload.webidl
+++ b/dom/webidl/XMLHttpRequestUpload.webidl
@@ -10,6 +10,7 @@
* liability, trademark and document use rules apply.
*/
+[Exposed=(Window,Worker)]
interface XMLHttpRequestUpload : XMLHttpRequestEventTarget {
};
diff --git a/dom/webidl/XPathEvaluator.webidl b/dom/webidl/XPathEvaluator.webidl
index 469b12031..a74909f2a 100644
--- a/dom/webidl/XPathEvaluator.webidl
+++ b/dom/webidl/XPathEvaluator.webidl
@@ -4,20 +4,16 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-interface XPathExpression;
-interface XPathNSResolver;
-interface XPathResult;
-
[Constructor]
interface XPathEvaluator {
// Based on nsIDOMXPathEvaluator
- [Creator, Throws]
+ [NewObject, Throws]
XPathExpression createExpression(DOMString expression,
XPathNSResolver? resolver);
- [Creator, Throws]
- XPathNSResolver createNSResolver(Node? nodeResolver);
+ [Pure]
+ Node createNSResolver(Node nodeResolver);
[Throws]
- XPathResult evaluate(DOMString expression, Node? contextNode,
+ XPathResult evaluate(DOMString expression, Node contextNode,
XPathNSResolver? resolver, unsigned short type,
- XPathResult? result);
+ object? result);
};
diff --git a/dom/webidl/XPathExpression.webidl b/dom/webidl/XPathExpression.webidl
new file mode 100644
index 000000000..dd5835492
--- /dev/null
+++ b/dom/webidl/XPathExpression.webidl
@@ -0,0 +1,22 @@
+/* -*- 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/.
+ */
+
+interface XPathExpression {
+ // The result specifies a specific result object which may be reused and
+ // returned by this method. If this is specified as null or it's not an
+ // XPathResult object, a new result object will be constructed and returned.
+ [Throws]
+ XPathResult evaluate(Node contextNode, unsigned short type, object? result);
+
+ // The result specifies a specific result object which may be reused and
+ // returned by this method. If this is specified as null or it's not an
+ // XPathResult object, a new result object will be constructed and returned.
+ [Throws, ChromeOnly]
+ XPathResult evaluateWithContext(Node contextNode,
+ unsigned long contextPosition,
+ unsigned long contextSize,
+ unsigned short type, object? result);
+};
diff --git a/dom/webidl/XPathNSResolver.webidl b/dom/webidl/XPathNSResolver.webidl
new file mode 100644
index 000000000..6309ff38c
--- /dev/null
+++ b/dom/webidl/XPathNSResolver.webidl
@@ -0,0 +1,10 @@
+/* -*- 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/.
+ */
+
+callback interface XPathNSResolver
+{
+ DOMString? lookupNamespaceURI(DOMString? prefix);
+};
diff --git a/dom/webidl/XPathResult.webidl b/dom/webidl/XPathResult.webidl
new file mode 100644
index 000000000..d50063771
--- /dev/null
+++ b/dom/webidl/XPathResult.webidl
@@ -0,0 +1,38 @@
+/* -*- 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/.
+ *
+ * Corresponds to http://www.w3.org/TR/2002/WD-DOM-Level-3-XPath-20020208
+ */
+
+interface XPathResult {
+ // XPathResultType
+ const unsigned short ANY_TYPE = 0;
+ const unsigned short NUMBER_TYPE = 1;
+ const unsigned short STRING_TYPE = 2;
+ const unsigned short BOOLEAN_TYPE = 3;
+ const unsigned short UNORDERED_NODE_ITERATOR_TYPE = 4;
+ const unsigned short ORDERED_NODE_ITERATOR_TYPE = 5;
+ const unsigned short UNORDERED_NODE_SNAPSHOT_TYPE = 6;
+ const unsigned short ORDERED_NODE_SNAPSHOT_TYPE = 7;
+ const unsigned short ANY_UNORDERED_NODE_TYPE = 8;
+ const unsigned short FIRST_ORDERED_NODE_TYPE = 9;
+
+ readonly attribute unsigned short resultType;
+ [Throws]
+ readonly attribute double numberValue;
+ [Throws]
+ readonly attribute DOMString stringValue;
+ [Throws]
+ readonly attribute boolean booleanValue;
+ [Throws]
+ readonly attribute Node? singleNodeValue;
+ readonly attribute boolean invalidIteratorState;
+ [Throws]
+ readonly attribute unsigned long snapshotLength;
+ [Throws]
+ Node? iterateNext();
+ [Throws]
+ Node? snapshotItem(unsigned long index);
+};
diff --git a/dom/webidl/XSLTProcessor.webidl b/dom/webidl/XSLTProcessor.webidl
new file mode 100644
index 000000000..ce9ed846f
--- /dev/null
+++ b/dom/webidl/XSLTProcessor.webidl
@@ -0,0 +1,109 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* 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/. */
+
+interface nsIVariant;
+
+[Constructor]
+interface XSLTProcessor {
+ /**
+ * Import the stylesheet into this XSLTProcessor for transformations.
+ *
+ * @param style The root-node of a XSLT stylesheet. This can be either
+ * a document node or an element node. If a document node
+ * then the document can contain either a XSLT stylesheet
+ * or a LRE stylesheet.
+ * If the argument is an element node it must be the
+ * xsl:stylesheet (or xsl:transform) element of an XSLT
+ * stylesheet.
+ */
+ [Throws]
+ void importStylesheet(Node style);
+
+ /**
+ * Transforms the node source applying the stylesheet given by
+ * the importStylesheet() function. The owner document of the output node
+ * owns the returned document fragment.
+ *
+ * @param source The node to be transformed
+ * @param output This document is used to generate the output
+ * @return DocumentFragment The result of the transformation
+ */
+ [Throws]
+ DocumentFragment transformToFragment(Node source,
+ Document output);
+
+ /**
+ * Transforms the node source applying the stylesheet given by the
+ * importStylesheet() function.
+ *
+ * @param source The node to be transformed
+ * @return Document The result of the transformation
+ */
+ [Throws]
+ Document transformToDocument(Node source);
+
+ /**
+ * Sets a parameter to be used in subsequent transformations with this
+ * nsIXSLTProcessor. If the parameter doesn't exist in the stylesheet the
+ * parameter will be ignored.
+ *
+ * @param namespaceURI The namespaceURI of the XSLT parameter
+ * @param localName The local name of the XSLT parameter
+ * @param value The new value of the XSLT parameter
+ */
+ [Throws]
+ void setParameter([TreatNullAs=EmptyString] DOMString namespaceURI,
+ DOMString localName,
+ any value);
+
+ /**
+ * Gets a parameter if previously set by setParameter. Returns null
+ * otherwise.
+ *
+ * @param namespaceURI The namespaceURI of the XSLT parameter
+ * @param localName The local name of the XSLT parameter
+ * @return nsIVariant The value of the XSLT parameter
+ */
+ [Throws]
+ nsIVariant? getParameter([TreatNullAs=EmptyString] DOMString namespaceURI,
+ DOMString localName);
+ /**
+ * Removes a parameter, if set. This will make the processor use the
+ * default-value for the parameter as specified in the stylesheet.
+ *
+ * @param namespaceURI The namespaceURI of the XSLT parameter
+ * @param localName The local name of the XSLT parameter
+ */
+ [Throws]
+ void removeParameter([TreatNullAs=EmptyString] DOMString namespaceURI,
+ DOMString localName);
+
+ /**
+ * Removes all set parameters from this nsIXSLTProcessor. This will make
+ * the processor use the default-value for all parameters as specified in
+ * the stylesheet.
+ */
+ void clearParameters();
+
+ /**
+ * Remove all parameters and stylesheets from this nsIXSLTProcessor.
+ */
+ void reset();
+
+ /**
+ * Disables all loading of external documents, such as from
+ * <xsl:import> and document()
+ * Defaults to off and is *not* reset by calls to reset()
+ */
+ [ChromeOnly]
+ const unsigned long DISABLE_ALL_LOADS = 1;
+
+ /**
+ * Flags for this processor. Defaults to 0. See individual flags above
+ * for documentation for effect of reset()
+ */
+ [ChromeOnly]
+ attribute unsigned long flags;
+};
diff --git a/dom/webidl/XULCommandEvent.webidl b/dom/webidl/XULCommandEvent.webidl
index f6e263fac..209415dd9 100644
--- a/dom/webidl/XULCommandEvent.webidl
+++ b/dom/webidl/XULCommandEvent.webidl
@@ -4,9 +4,8 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-interface WindowProxy;
-
- interface XULCommandEvent : UIEvent
+[Func="IsChromeOrXBL"]
+interface XULCommandEvent : UIEvent
{
readonly attribute boolean ctrlKey;
readonly attribute boolean shiftKey;
@@ -19,7 +18,7 @@ interface WindowProxy;
void initCommandEvent(DOMString type,
boolean canBubble,
boolean cancelable,
- WindowProxy? view,
+ Window? view,
long detail,
boolean ctrlKey,
boolean altKey,
diff --git a/dom/webidl/XULDocument.webidl b/dom/webidl/XULDocument.webidl
index 3a774079b..c974733f6 100644
--- a/dom/webidl/XULDocument.webidl
+++ b/dom/webidl/XULDocument.webidl
@@ -8,9 +8,9 @@
*/
interface XULCommandDispatcher;
-interface MozBoxObject;
interface MozObserver;
+[Func="IsChromeOrXBL"]
interface XULDocument : Document {
attribute Node? popupNode;
@@ -50,7 +50,7 @@ interface XULDocument : Document {
void persist([TreatNullAs=EmptyString] DOMString id, DOMString attr);
[Throws]
- MozBoxObject? getBoxObjectFor(Element? element);
+ BoxObject? getBoxObjectFor(Element? element);
[Throws]
void loadOverlay(DOMString url, MozObserver? observer);
diff --git a/dom/webidl/XULElement.webidl b/dom/webidl/XULElement.webidl
index 6c525d24a..ff2af0e74 100644
--- a/dom/webidl/XULElement.webidl
+++ b/dom/webidl/XULElement.webidl
@@ -4,13 +4,13 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-interface MozBoxObject;
interface MozControllers;
interface MozFrameLoader;
interface MozRDFCompositeDataSource;
interface MozRDFResource;
interface MozXULTemplateBuilder;
+[Func="IsChromeOrXBL"]
interface XULElement : Element {
[SetterThrows]
attribute DOMString className;
@@ -94,7 +94,7 @@ interface XULElement : Element {
[Throws]
readonly attribute MozControllers controllers;
[Throws]
- readonly attribute MozBoxObject? boxObject;
+ readonly attribute BoxObject? boxObject;
[Throws]
void focus();
@@ -122,11 +122,14 @@ interface MozFrameLoaderOwner {
[ChromeOnly]
readonly attribute MozFrameLoader? frameLoader;
+ [ChromeOnly]
+ void setIsPrerendered();
+
[ChromeOnly, Throws]
void swapFrameLoaders(XULElement aOtherOwner);
};
XULElement implements GlobalEventHandlers;
-XULElement implements NodeEventHandlers;
XULElement implements TouchEventHandlers;
XULElement implements MozFrameLoaderOwner;
+XULElement implements OnErrorEventHandlerForNodes;
diff --git a/dom/webidl/moz.build b/dom/webidl/moz.build
new file mode 100644
index 000000000..fd95e3c23
--- /dev/null
+++ b/dom/webidl/moz.build
@@ -0,0 +1,814 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# 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/.
+
+GENERATED_WEBIDL_FILES = [
+ 'CSS2Properties.webidl',
+]
+
+PREPROCESSED_WEBIDL_FILES = [
+ 'HTMLMediaElement.webidl',
+ 'Navigator.webidl',
+ 'Window.webidl',
+]
+
+WEBIDL_FILES = [
+ 'AbortablePromise.webidl',
+ 'AbstractWorker.webidl',
+ 'ActivityRequestHandler.webidl',
+ 'AlarmsManager.webidl',
+ 'AnalyserNode.webidl',
+ 'Animatable.webidl',
+ 'Animation.webidl',
+ 'AnimationEffect.webidl',
+ 'AnimationEvent.webidl',
+ 'AnimationPlayer.webidl',
+ 'AnimationTimeline.webidl',
+ 'AnonymousContent.webidl',
+ 'AppInfo.webidl',
+ 'AppNotificationServiceOptions.webidl',
+ 'Apps.webidl',
+ 'APZTestData.webidl',
+ 'ArchiveReader.webidl',
+ 'ArchiveRequest.webidl',
+ 'Attr.webidl',
+ 'AudioBuffer.webidl',
+ 'AudioBufferSourceNode.webidl',
+ 'AudioChannel.webidl',
+ 'AudioContext.webidl',
+ 'AudioDestinationNode.webidl',
+ 'AudioListener.webidl',
+ 'AudioNode.webidl',
+ 'AudioParam.webidl',
+ 'AudioProcessingEvent.webidl',
+ 'AudioStreamTrack.webidl',
+ 'AudioTrack.webidl',
+ 'AudioTrackList.webidl',
+ 'AutocompleteInfo.webidl',
+ 'BarProp.webidl',
+ 'BatteryManager.webidl',
+ 'BeforeAfterKeyboardEvent.webidl',
+ 'BeforeUnloadEvent.webidl',
+ 'BiquadFilterNode.webidl',
+ 'Blob.webidl',
+ 'BoxObject.webidl',
+ 'BroadcastChannel.webidl',
+ 'BrowserElement.webidl',
+ 'BrowserElementDictionaries.webidl',
+ 'CallsList.webidl',
+ 'CameraCapabilities.webidl',
+ 'CameraControl.webidl',
+ 'CameraManager.webidl',
+ 'CameraUtil.webidl',
+ 'CanvasRenderingContext2D.webidl',
+ 'CaretPosition.webidl',
+ 'CDATASection.webidl',
+ 'ChannelMergerNode.webidl',
+ 'ChannelSplitterNode.webidl',
+ 'CharacterData.webidl',
+ 'ChildNode.webidl',
+ 'ChromeNotifications.webidl',
+ 'Client.webidl',
+ 'Clients.webidl',
+ 'ClipboardEvent.webidl',
+ 'CommandEvent.webidl',
+ 'Comment.webidl',
+ 'CompositionEvent.webidl',
+ 'Console.webidl',
+ 'Constraints.webidl',
+ 'Contacts.webidl',
+ 'ContainerBoxObject.webidl',
+ 'ConvolverNode.webidl',
+ 'Coordinates.webidl',
+ 'Crypto.webidl',
+ 'CSPReport.webidl',
+ 'CSS.webidl',
+ 'CSSPrimitiveValue.webidl',
+ 'CSSRuleList.webidl',
+ 'CSSStyleDeclaration.webidl',
+ 'CSSStyleSheet.webidl',
+ 'CSSValue.webidl',
+ 'CSSValueList.webidl',
+ 'DataContainerEvent.webidl',
+ 'DataStore.webidl',
+ 'DataStoreImpl.webidl',
+ 'DataTransfer.webidl',
+ 'DedicatedWorkerGlobalScope.webidl',
+ 'DelayNode.webidl',
+ 'DesktopNotification.webidl',
+ 'DeviceMotionEvent.webidl',
+ 'DeviceStorage.webidl',
+ 'Directory.webidl',
+ 'Document.webidl',
+ 'DocumentFragment.webidl',
+ 'DocumentType.webidl',
+ 'DOMCursor.webidl',
+ 'DOMError.webidl',
+ 'DOMException.webidl',
+ 'DOMImplementation.webidl',
+ 'DOMMatrix.webidl',
+ 'DOMMobileMessageError.webidl',
+ 'DOMParser.webidl',
+ 'DOMPoint.webidl',
+ 'DOMQuad.webidl',
+ 'DOMRect.webidl',
+ 'DOMRectList.webidl',
+ 'DOMRequest.webidl',
+ 'DOMSettableTokenList.webidl',
+ 'DOMStringList.webidl',
+ 'DOMStringMap.webidl',
+ 'DOMTokenList.webidl',
+ 'DOMTransaction.webidl',
+ 'Downloads.webidl',
+ 'DragEvent.webidl',
+ 'DummyBinding.webidl',
+ 'DynamicsCompressorNode.webidl',
+ 'Element.webidl',
+ 'EngineeringMode.webidl',
+ 'Event.webidl',
+ 'EventHandler.webidl',
+ 'EventListener.webidl',
+ 'EventSource.webidl',
+ 'EventTarget.webidl',
+ 'ExtendableEvent.webidl',
+ 'Fetch.webidl',
+ 'FetchEvent.webidl',
+ 'File.webidl',
+ 'FileList.webidl',
+ 'FileMode.webidl',
+ 'FileReader.webidl',
+ 'FileReaderSync.webidl',
+ 'FocusEvent.webidl',
+ 'FontFace.webidl',
+ 'FontFaceSet.webidl',
+ 'FontFaceSource.webidl',
+ 'FormData.webidl',
+ 'Function.webidl',
+ 'GainNode.webidl',
+ 'Geolocation.webidl',
+ 'GeometryUtils.webidl',
+ 'GetUserMediaRequest.webidl',
+ 'Headers.webidl',
+ 'History.webidl',
+ 'HTMLAllCollection.webidl',
+ 'HTMLAnchorElement.webidl',
+ 'HTMLAppletElement.webidl',
+ 'HTMLAreaElement.webidl',
+ 'HTMLAudioElement.webidl',
+ 'HTMLBaseElement.webidl',
+ 'HTMLBodyElement.webidl',
+ 'HTMLBRElement.webidl',
+ 'HTMLButtonElement.webidl',
+ 'HTMLCanvasElement.webidl',
+ 'HTMLCollection.webidl',
+ 'HTMLContentElement.webidl',
+ 'HTMLDataElement.webidl',
+ 'HTMLDataListElement.webidl',
+ 'HTMLDirectoryElement.webidl',
+ 'HTMLDivElement.webidl',
+ 'HTMLDListElement.webidl',
+ 'HTMLDocument.webidl',
+ 'HTMLElement.webidl',
+ 'HTMLEmbedElement.webidl',
+ 'HTMLFieldSetElement.webidl',
+ 'HTMLFontElement.webidl',
+ 'HTMLFormControlsCollection.webidl',
+ 'HTMLFormElement.webidl',
+ 'HTMLFrameElement.webidl',
+ 'HTMLFrameSetElement.webidl',
+ 'HTMLHeadElement.webidl',
+ 'HTMLHeadingElement.webidl',
+ 'HTMLHRElement.webidl',
+ 'HTMLHtmlElement.webidl',
+ 'HTMLIFrameElement.webidl',
+ 'HTMLImageElement.webidl',
+ 'HTMLInputElement.webidl',
+ 'HTMLLabelElement.webidl',
+ 'HTMLLegendElement.webidl',
+ 'HTMLLIElement.webidl',
+ 'HTMLLinkElement.webidl',
+ 'HTMLMapElement.webidl',
+ 'HTMLMenuElement.webidl',
+ 'HTMLMenuItemElement.webidl',
+ 'HTMLMetaElement.webidl',
+ 'HTMLMeterElement.webidl',
+ 'HTMLModElement.webidl',
+ 'HTMLObjectElement.webidl',
+ 'HTMLOListElement.webidl',
+ 'HTMLOptGroupElement.webidl',
+ 'HTMLOptionElement.webidl',
+ 'HTMLOptionsCollection.webidl',
+ 'HTMLOutputElement.webidl',
+ 'HTMLParagraphElement.webidl',
+ 'HTMLParamElement.webidl',
+ 'HTMLPictureElement.webidl',
+ 'HTMLPreElement.webidl',
+ 'HTMLProgressElement.webidl',
+ 'HTMLPropertiesCollection.webidl',
+ 'HTMLQuoteElement.webidl',
+ 'HTMLScriptElement.webidl',
+ 'HTMLSelectElement.webidl',
+ 'HTMLShadowElement.webidl',
+ 'HTMLSourceElement.webidl',
+ 'HTMLSpanElement.webidl',
+ 'HTMLStyleElement.webidl',
+ 'HTMLTableCaptionElement.webidl',
+ 'HTMLTableCellElement.webidl',
+ 'HTMLTableColElement.webidl',
+ 'HTMLTableElement.webidl',
+ 'HTMLTableRowElement.webidl',
+ 'HTMLTableSectionElement.webidl',
+ 'HTMLTemplateElement.webidl',
+ 'HTMLTextAreaElement.webidl',
+ 'HTMLTimeElement.webidl',
+ 'HTMLTitleElement.webidl',
+ 'HTMLTrackElement.webidl',
+ 'HTMLUListElement.webidl',
+ 'HTMLVideoElement.webidl',
+ 'IDBCursor.webidl',
+ 'IDBDatabase.webidl',
+ 'IDBEnvironment.webidl',
+ 'IDBFactory.webidl',
+ 'IDBFileHandle.webidl',
+ 'IDBFileRequest.webidl',
+ 'IDBIndex.webidl',
+ 'IDBKeyRange.webidl',
+ 'IDBMutableFile.webidl',
+ 'IDBObjectStore.webidl',
+ 'IDBOpenDBRequest.webidl',
+ 'IDBRequest.webidl',
+ 'IDBTransaction.webidl',
+ 'IDBVersionChangeEvent.webidl',
+ 'Identity.webidl',
+ 'ImageCapture.webidl',
+ 'ImageData.webidl',
+ 'ImageDocument.webidl',
+ 'InputEvent.webidl',
+ 'InputMethod.webidl',
+ 'InspectorUtils.webidl',
+ 'InstallEvent.webidl',
+ 'InterAppConnection.webidl',
+ 'InterAppConnectionRequest.webidl',
+ 'InterAppMessagePort.webidl',
+ 'KeyAlgorithm.webidl',
+ 'KeyboardEvent.webidl',
+ 'KeyEvent.webidl',
+ 'LegacyQueryInterface.webidl',
+ 'LinkStyle.webidl',
+ 'ListBoxObject.webidl',
+ 'LocalMediaStream.webidl',
+ 'Location.webidl',
+ 'MediaDevices.webidl',
+ 'MediaElementAudioSourceNode.webidl',
+ 'MediaError.webidl',
+ 'MediaList.webidl',
+ 'MediaQueryList.webidl',
+ 'MediaRecorder.webidl',
+ 'MediaSource.webidl',
+ 'MediaStream.webidl',
+ 'MediaStreamAudioDestinationNode.webidl',
+ 'MediaStreamAudioSourceNode.webidl',
+ 'MediaStreamError.webidl',
+ 'MediaStreamTrack.webidl',
+ 'MediaTrackConstraintSet.webidl',
+ 'MenuBoxObject.webidl',
+ 'MessageChannel.webidl',
+ 'MessageEvent.webidl',
+ 'MessagePort.webidl',
+ 'MessagePortList.webidl',
+ 'MimeType.webidl',
+ 'MimeTypeArray.webidl',
+ 'MMICall.webidl',
+ 'MouseEvent.webidl',
+ 'MouseScrollEvent.webidl',
+ 'MozActivity.webidl',
+ 'MozCellBroadcast.webidl',
+ 'MozCellBroadcastMessage.webidl',
+ 'MozMmsMessage.webidl',
+ 'MozMobileCellInfo.webidl',
+ 'MozMobileConnection.webidl',
+ 'MozMobileConnectionArray.webidl',
+ 'MozMobileConnectionInfo.webidl',
+ 'MozMobileMessageManager.webidl',
+ 'MozMobileNetworkInfo.webidl',
+ 'MozPowerManager.webidl',
+ 'MozSelfSupport.webidl',
+ 'MozTetheringManager.webidl',
+ 'MozTimeManager.webidl',
+ 'MozVoicemail.webidl',
+ 'MozVoicemailStatus.webidl',
+ 'MozWakeLock.webidl',
+ 'MutationEvent.webidl',
+ 'MutationObserver.webidl',
+ 'NamedNodeMap.webidl',
+ 'NativeOSFileInternals.webidl',
+ 'NetDashboard.webidl',
+ 'NetworkInformation.webidl',
+ 'NetworkOptions.webidl',
+ 'Node.webidl',
+ 'NodeFilter.webidl',
+ 'NodeIterator.webidl',
+ 'NodeList.webidl',
+ 'Notification.webidl',
+ 'NotifyPaintEvent.webidl',
+ 'OfflineAudioCompletionEvent.webidl',
+ 'OfflineAudioContext.webidl',
+ 'OfflineResourceList.webidl',
+ 'OscillatorNode.webidl',
+ 'PaintRequest.webidl',
+ 'PaintRequestList.webidl',
+ 'PannerNode.webidl',
+ 'ParentNode.webidl',
+ 'Performance.webidl',
+ 'PerformanceEntry.webidl',
+ 'PerformanceMark.webidl',
+ 'PerformanceMeasure.webidl',
+ 'PerformanceNavigation.webidl',
+ 'PerformanceResourceTiming.webidl',
+ 'PerformanceTiming.webidl',
+ 'PeriodicWave.webidl',
+ 'PermissionSettings.webidl',
+ 'PhoneNumberService.webidl',
+ 'Plugin.webidl',
+ 'PluginArray.webidl',
+ 'PointerEvent.webidl',
+ 'PopupBoxObject.webidl',
+ 'Position.webidl',
+ 'PositionError.webidl',
+ 'PresentationDeviceInfoManager.webidl',
+ 'ProcessingInstruction.webidl',
+ 'ProfileTimelineMarker.webidl',
+ 'Promise.webidl',
+ 'PromiseDebugging.webidl',
+ 'PushManager.webidl',
+ 'RadioNodeList.webidl',
+ 'Range.webidl',
+ 'Rect.webidl',
+ 'Request.webidl',
+ 'RequestSyncManager.webidl',
+ 'RequestSyncScheduler.webidl',
+ 'ResourceStats.webidl',
+ 'ResourceStatsManager.webidl',
+ 'Response.webidl',
+ 'RGBColor.webidl',
+ 'RTCConfiguration.webidl',
+ 'RTCIceCandidate.webidl',
+ 'RTCIdentityAssertion.webidl',
+ 'RTCIdentityProvider.webidl',
+ 'RTCPeerConnection.webidl',
+ 'RTCPeerConnectionStatic.webidl',
+ 'RTCRtpReceiver.webidl',
+ 'RTCRtpSender.webidl',
+ 'RTCSessionDescription.webidl',
+ 'RTCStatsReport.webidl',
+ 'Screen.webidl',
+ 'ScriptProcessorNode.webidl',
+ 'ScrollAreaEvent.webidl',
+ 'ScrollBoxObject.webidl',
+ 'Selection.webidl',
+ 'ServiceWorker.webidl',
+ 'ServiceWorkerContainer.webidl',
+ 'ServiceWorkerGlobalScope.webidl',
+ 'ServiceWorkerRegistration.webidl',
+ 'SettingChangeNotification.webidl',
+ 'SettingsManager.webidl',
+ 'ShadowRoot.webidl',
+ 'SharedWorker.webidl',
+ 'SharedWorkerGlobalScope.webidl',
+ 'SimpleGestureEvent.webidl',
+ 'SocketCommon.webidl',
+ 'SourceBuffer.webidl',
+ 'SourceBufferList.webidl',
+ 'StereoPannerNode.webidl',
+ 'Storage.webidl',
+ 'StorageEvent.webidl',
+ 'StorageType.webidl',
+ 'StyleSheet.webidl',
+ 'StyleSheetList.webidl',
+ 'SubtleCrypto.webidl',
+ 'SVGAElement.webidl',
+ 'SVGAltGlyphElement.webidl',
+ 'SVGAngle.webidl',
+ 'SVGAnimatedAngle.webidl',
+ 'SVGAnimatedBoolean.webidl',
+ 'SVGAnimatedEnumeration.webidl',
+ 'SVGAnimatedInteger.webidl',
+ 'SVGAnimatedLength.webidl',
+ 'SVGAnimatedLengthList.webidl',
+ 'SVGAnimatedNumber.webidl',
+ 'SVGAnimatedNumberList.webidl',
+ 'SVGAnimatedPathData.webidl',
+ 'SVGAnimatedPoints.webidl',
+ 'SVGAnimatedPreserveAspectRatio.webidl',
+ 'SVGAnimatedRect.webidl',
+ 'SVGAnimatedString.webidl',
+ 'SVGAnimatedTransformList.webidl',
+ 'SVGAnimateElement.webidl',
+ 'SVGAnimateMotionElement.webidl',
+ 'SVGAnimateTransformElement.webidl',
+ 'SVGAnimationElement.webidl',
+ 'SVGCircleElement.webidl',
+ 'SVGClipPathElement.webidl',
+ 'SVGComponentTransferFunctionElement.webidl',
+ 'SVGDefsElement.webidl',
+ 'SVGDescElement.webidl',
+ 'SVGDocument.webidl',
+ 'SVGElement.webidl',
+ 'SVGEllipseElement.webidl',
+ 'SVGFEBlendElement.webidl',
+ 'SVGFEColorMatrixElement.webidl',
+ 'SVGFEComponentTransferElement.webidl',
+ 'SVGFECompositeElement.webidl',
+ 'SVGFEConvolveMatrixElement.webidl',
+ 'SVGFEDiffuseLightingElement.webidl',
+ 'SVGFEDisplacementMapElement.webidl',
+ 'SVGFEDistantLightElement.webidl',
+ 'SVGFEDropShadowElement.webidl',
+ 'SVGFEFloodElement.webidl',
+ 'SVGFEFuncAElement.webidl',
+ 'SVGFEFuncBElement.webidl',
+ 'SVGFEFuncGElement.webidl',
+ 'SVGFEFuncRElement.webidl',
+ 'SVGFEGaussianBlurElement.webidl',
+ 'SVGFEImageElement.webidl',
+ 'SVGFEMergeElement.webidl',
+ 'SVGFEMergeNodeElement.webidl',
+ 'SVGFEMorphologyElement.webidl',
+ 'SVGFEOffsetElement.webidl',
+ 'SVGFEPointLightElement.webidl',
+ 'SVGFESpecularLightingElement.webidl',
+ 'SVGFESpotLightElement.webidl',
+ 'SVGFETileElement.webidl',
+ 'SVGFETurbulenceElement.webidl',
+ 'SVGFilterElement.webidl',
+ 'SVGFilterPrimitiveStandardAttributes.webidl',
+ 'SVGFitToViewBox.webidl',
+ 'SVGForeignObjectElement.webidl',
+ 'SVGGElement.webidl',
+ 'SVGGradientElement.webidl',
+ 'SVGGraphicsElement.webidl',
+ 'SVGImageElement.webidl',
+ 'SVGLength.webidl',
+ 'SVGLengthList.webidl',
+ 'SVGLinearGradientElement.webidl',
+ 'SVGLineElement.webidl',
+ 'SVGMarkerElement.webidl',
+ 'SVGMaskElement.webidl',
+ 'SVGMatrix.webidl',
+ 'SVGMetadataElement.webidl',
+ 'SVGMPathElement.webidl',
+ 'SVGNumber.webidl',
+ 'SVGNumberList.webidl',
+ 'SVGPathElement.webidl',
+ 'SVGPathSeg.webidl',
+ 'SVGPathSegList.webidl',
+ 'SVGPatternElement.webidl',
+ 'SVGPoint.webidl',
+ 'SVGPointList.webidl',
+ 'SVGPolygonElement.webidl',
+ 'SVGPolylineElement.webidl',
+ 'SVGPreserveAspectRatio.webidl',
+ 'SVGRadialGradientElement.webidl',
+ 'SVGRect.webidl',
+ 'SVGRectElement.webidl',
+ 'SVGScriptElement.webidl',
+ 'SVGSetElement.webidl',
+ 'SVGStopElement.webidl',
+ 'SVGStringList.webidl',
+ 'SVGStyleElement.webidl',
+ 'SVGSVGElement.webidl',
+ 'SVGSwitchElement.webidl',
+ 'SVGSymbolElement.webidl',
+ 'SVGTests.webidl',
+ 'SVGTextContentElement.webidl',
+ 'SVGTextElement.webidl',
+ 'SVGTextPathElement.webidl',
+ 'SVGTextPositioningElement.webidl',
+ 'SVGTitleElement.webidl',
+ 'SVGTransform.webidl',
+ 'SVGTransformList.webidl',
+ 'SVGTSpanElement.webidl',
+ 'SVGUnitTypes.webidl',
+ 'SVGURIReference.webidl',
+ 'SVGUseElement.webidl',
+ 'SVGViewElement.webidl',
+ 'SVGZoomAndPan.webidl',
+ 'SVGZoomEvent.webidl',
+ 'Telephony.webidl',
+ 'TelephonyCall.webidl',
+ 'TelephonyCallGroup.webidl',
+ 'TelephonyCallId.webidl',
+ 'Text.webidl',
+ 'TextDecoder.webidl',
+ 'TextEncoder.webidl',
+ 'TextTrack.webidl',
+ 'TextTrackCueList.webidl',
+ 'TextTrackList.webidl',
+ 'TimeEvent.webidl',
+ 'TimeRanges.webidl',
+ 'Touch.webidl',
+ 'TouchEvent.webidl',
+ 'TouchList.webidl',
+ 'TransitionEvent.webidl',
+ 'TreeBoxObject.webidl',
+ 'TreeColumn.webidl',
+ 'TreeColumns.webidl',
+ 'TreeWalker.webidl',
+ 'TVChannel.webidl',
+ 'TVManager.webidl',
+ 'TVProgram.webidl',
+ 'TVSource.webidl',
+ 'TVTuner.webidl',
+ 'UDPMessageEvent.webidl',
+ 'UDPSocket.webidl',
+ 'UIEvent.webidl',
+ 'UndoManager.webidl',
+ 'URL.webidl',
+ 'URLSearchParams.webidl',
+ 'URLUtils.webidl',
+ 'URLUtilsReadOnly.webidl',
+ 'USSDSession.webidl',
+ 'ValidityState.webidl',
+ 'VideoPlaybackQuality.webidl',
+ 'VideoStreamTrack.webidl',
+ 'VideoTrack.webidl',
+ 'VideoTrackList.webidl',
+ 'VRDevice.webidl',
+ 'VTTCue.webidl',
+ 'VTTRegion.webidl',
+ 'WaveShaperNode.webidl',
+ 'WebComponents.webidl',
+ 'WebGL2RenderingContext.webidl',
+ 'WebGLRenderingContext.webidl',
+ 'WebSocket.webidl',
+ 'WheelEvent.webidl',
+ 'WifiOptions.webidl',
+ 'WindowRoot.webidl',
+ 'Worker.webidl',
+ 'WorkerGlobalScope.webidl',
+ 'WorkerLocation.webidl',
+ 'WorkerNavigator.webidl',
+ 'XMLDocument.webidl',
+ 'XMLHttpRequest.webidl',
+ 'XMLHttpRequestEventTarget.webidl',
+ 'XMLHttpRequestUpload.webidl',
+ 'XMLSerializer.webidl',
+ 'XMLStylesheetProcessingInstruction.webidl',
+ 'XPathEvaluator.webidl',
+ 'XPathExpression.webidl',
+ 'XPathNSResolver.webidl',
+ 'XPathResult.webidl',
+ 'XSLTProcessor.webidl',
+ 'XULCommandEvent.webidl',
+ 'XULDocument.webidl',
+ 'XULElement.webidl',
+]
+
+if CONFIG['MOZ_AUDIO_CHANNEL_MANAGER']:
+ WEBIDL_FILES += [
+ 'AudioChannelManager.webidl',
+ ]
+
+if CONFIG['MOZ_WEBRTC']:
+ WEBIDL_FILES += [
+ 'DataChannel.webidl',
+ 'MediaStreamList.webidl',
+ 'PeerConnectionImpl.webidl',
+ 'PeerConnectionImplEnums.webidl',
+ 'PeerConnectionObserver.webidl',
+ 'PeerConnectionObserverEnums.webidl',
+ 'WebrtcGlobalInformation.webidl',
+ ]
+
+if CONFIG['MOZ_WEBSPEECH']:
+ WEBIDL_FILES += [
+ 'SpeechGrammar.webidl',
+ 'SpeechGrammarList.webidl',
+ 'SpeechRecognition.webidl',
+ 'SpeechRecognitionAlternative.webidl',
+ 'SpeechRecognitionError.webidl',
+ 'SpeechRecognitionEvent.webidl',
+ 'SpeechRecognitionResult.webidl',
+ 'SpeechRecognitionResultList.webidl',
+ 'SpeechSynthesis.webidl',
+ 'SpeechSynthesisEvent.webidl',
+ 'SpeechSynthesisUtterance.webidl',
+ 'SpeechSynthesisVoice.webidl',
+ ]
+
+if CONFIG['MOZ_GAMEPAD']:
+ WEBIDL_FILES += [
+ 'Gamepad.webidl',
+ ]
+
+WEBIDL_FILES += [
+ 'CloseEvent.webidl',
+ 'CustomEvent.webidl',
+ 'DeviceOrientationEvent.webidl',
+ 'DeviceStorageChangeEvent.webidl',
+ 'DOMTransactionEvent.webidl',
+ 'HashChangeEvent.webidl',
+ 'MozApplicationEvent.webidl',
+ 'MozSettingsEvent.webidl',
+ 'PageTransitionEvent.webidl',
+ 'PopStateEvent.webidl',
+ 'PopupBlockedEvent.webidl',
+ 'ProgressEvent.webidl',
+ 'RecordErrorEvent.webidl',
+ 'StyleRuleChangeEvent.webidl',
+ 'StyleSheetApplicableStateChangeEvent.webidl',
+ 'StyleSheetChangeEvent.webidl',
+]
+
+# We only expose our prefable test interfaces in debug builds, just to be on
+# the safe side.
+if CONFIG['MOZ_DEBUG']:
+ WEBIDL_FILES += ['TestInterfaceJS.webidl', 'TestInterfaceJSDictionaries.webidl']
+
+if CONFIG['MOZ_B2G_BT']:
+ if CONFIG['MOZ_B2G_BT_API_V2']:
+ WEBIDL_FILES += [
+ 'BluetoothAdapter2.webidl',
+ 'BluetoothClassOfDevice.webidl',
+ 'BluetoothDevice2.webidl',
+ 'BluetoothDiscoveryHandle.webidl',
+ 'BluetoothGatt.webidl',
+ 'BluetoothManager2.webidl',
+ 'BluetoothPairingHandle.webidl',
+ 'BluetoothPairingListener.webidl',
+ ]
+ else:
+ WEBIDL_FILES += [
+ 'BluetoothAdapter.webidl',
+ 'BluetoothDevice.webidl',
+ 'BluetoothManager.webidl',
+ ]
+
+if CONFIG['MOZ_B2G_RIL']:
+ WEBIDL_FILES += [
+ 'IccCardLockError.webidl',
+ 'MozIcc.webidl',
+ 'MozIccInfo.webidl',
+ 'MozIccManager.webidl',
+ ]
+
+if CONFIG['MOZ_NFC']:
+ WEBIDL_FILES += [
+ 'MozIsoDepTech.webidl',
+ 'MozNDEFRecord.webidl',
+ 'MozNFC.webidl',
+ 'MozNFCPeer.webidl',
+ 'MozNFCTag.webidl',
+ 'NfcOptions.webidl',
+ ]
+
+if CONFIG['MOZ_SECUREELEMENT']:
+ WEBIDL_FILES += [
+ 'SecureElement.webidl',
+ 'SecureElementManager.webidl',
+ ]
+
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
+ WEBIDL_FILES += [
+ 'MozNetworkStats.webidl',
+ 'MozNetworkStatsAlarm.webidl',
+ 'MozNetworkStatsData.webidl',
+ 'MozNetworkStatsInterface.webidl',
+ 'MozSpeakerManager.webidl',
+ 'MozWifiCapabilities.webidl',
+ 'MozWifiManager.webidl',
+ 'MozWifiP2pManager.webidl',
+ ]
+else:
+ WEBIDL_FILES += [
+ 'InstallTrigger.webidl',
+ ]
+
+if CONFIG['MOZ_B2G_FM']:
+ WEBIDL_FILES += [
+ 'FMRadio.webidl',
+ ]
+
+GENERATED_EVENTS_WEBIDL_FILES = [
+ 'AutocompleteErrorEvent.webidl',
+ 'BlobEvent.webidl',
+ 'CallEvent.webidl',
+ 'CallGroupErrorEvent.webidl',
+ 'CameraClosedEvent.webidl',
+ 'CameraConfigurationEvent.webidl',
+ 'CameraFacesDetectedEvent.webidl',
+ 'CameraStateChangeEvent.webidl',
+ 'CFStateChangeEvent.webidl',
+ 'CloseEvent.webidl',
+ 'CSSFontFaceLoadEvent.webidl',
+ 'DataErrorEvent.webidl',
+ 'DataStoreChangeEvent.webidl',
+ 'DeviceLightEvent.webidl',
+ 'DeviceOrientationEvent.webidl',
+ 'DeviceProximityEvent.webidl',
+ 'DeviceStorageChangeEvent.webidl',
+ 'DOMTransactionEvent.webidl',
+ 'DownloadEvent.webidl',
+ 'ErrorEvent.webidl',
+ 'HashChangeEvent.webidl',
+ 'IccChangeEvent.webidl',
+ 'ImageCaptureErrorEvent.webidl',
+ 'MediaStreamEvent.webidl',
+ 'MediaStreamTrackEvent.webidl',
+ 'MozApplicationEvent.webidl',
+ 'MozCellBroadcastEvent.webidl',
+ 'MozClirModeEvent.webidl',
+ 'MozContactChangeEvent.webidl',
+ 'MozEmergencyCbModeEvent.webidl',
+ 'MozInterAppMessageEvent.webidl',
+ 'MozMessageDeletedEvent.webidl',
+ 'MozMmsEvent.webidl',
+ 'MozOtaStatusEvent.webidl',
+ 'MozSettingsEvent.webidl',
+ 'MozSettingsTransactionEvent.webidl',
+ 'MozSmsEvent.webidl',
+ 'MozStkCommandEvent.webidl',
+ 'MozVoicemailEvent.webidl',
+ 'PageTransitionEvent.webidl',
+ 'PluginCrashedEvent.webidl',
+ 'PopStateEvent.webidl',
+ 'PopupBlockedEvent.webidl',
+ 'ProgressEvent.webidl',
+ 'RecordErrorEvent.webidl',
+ 'RTCDataChannelEvent.webidl',
+ 'RTCPeerConnectionIceEvent.webidl',
+ 'ScrollViewChangeEvent.webidl',
+ 'SelectionStateChangedEvent.webidl',
+ 'StyleRuleChangeEvent.webidl',
+ 'StyleSheetApplicableStateChangeEvent.webidl',
+ 'StyleSheetChangeEvent.webidl',
+ 'TrackEvent.webidl',
+ 'TVCurrentChannelChangedEvent.webidl',
+ 'TVCurrentSourceChangedEvent.webidl',
+ 'TVEITBroadcastedEvent.webidl',
+ 'TVScanningStateChangedEvent.webidl',
+ 'UDPMessageEvent.webidl',
+ 'UserProximityEvent.webidl',
+ 'USSDReceivedEvent.webidl',
+]
+
+if CONFIG['MOZ_WEBSPEECH']:
+ GENERATED_EVENTS_WEBIDL_FILES += [
+ 'SpeechRecognitionEvent.webidl',
+ 'SpeechSynthesisEvent.webidl',
+ ]
+
+if CONFIG['MOZ_GAMEPAD']:
+ GENERATED_EVENTS_WEBIDL_FILES += [
+ 'GamepadAxisMoveEvent.webidl',
+ 'GamepadButtonEvent.webidl',
+ 'GamepadEvent.webidl',
+ ]
+
+if CONFIG['MOZ_B2G_BT']:
+ if CONFIG['MOZ_B2G_BT_API_V2']:
+ GENERATED_EVENTS_WEBIDL_FILES += [
+ 'BluetoothAdapterEvent.webidl',
+ 'BluetoothAttributeEvent.webidl',
+ 'BluetoothPairingEvent.webidl',
+ ]
+ else:
+ GENERATED_EVENTS_WEBIDL_FILES += [
+ 'BluetoothDiscoveryStateChangedEvent.webidl',
+ ]
+
+ GENERATED_EVENTS_WEBIDL_FILES += [
+ 'BluetoothDeviceEvent.webidl',
+ 'BluetoothStatusChangedEvent.webidl',
+ ]
+
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
+ GENERATED_EVENTS_WEBIDL_FILES += [
+ 'MozWifiConnectionInfoEvent.webidl',
+ 'MozWifiP2pStatusChangeEvent.webidl',
+ 'MozWifiStationInfoEvent.webidl',
+ 'MozWifiStatusChangeEvent.webidl',
+ ]
+
+if CONFIG['MOZ_NFC']:
+ GENERATED_EVENTS_WEBIDL_FILES += [
+ 'MozNFCPeerEvent.webidl',
+ 'MozNFCTagEvent.webidl',
+ ]
+
+if CONFIG['MOZ_BUILD_APP'] in ['browser', 'xulrunner'] or CONFIG['MOZ_SUITE']:
+ WEBIDL_FILES += [
+ 'BrowserFeedWriter.webidl',
+ ]
+
+if CONFIG['MOZ_BUILD_APP'] in ['browser', 'mobile/android', 'xulrunner']:
+ WEBIDL_FILES += [
+ 'External.webidl',
+ ]
+
+if CONFIG['MOZ_PAY']:
+ WEBIDL_FILES += [
+ 'MozPaymentProvider.webidl'
+ ]