Auto merge of #10081 - jdm:interfacepref, r=nox

Support controlling interface and member visibility via preferences

This was easier to throw together than per-attribute/method support, and it gets rid of some nonstandard properties from our globals.

Fixes #7626.

r? @Ms2ger

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10081)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-05-02 11:35:38 -07:00
commit 8255e74a61
28 changed files with 352 additions and 53 deletions

View file

@ -4,6 +4,7 @@
// https://webbluetoothcg.github.io/web-bluetooth/#bluetooth
[Pref="dom.bluetooth.enabled"]
interface Bluetooth {
// Promise<BluetoothDevice> requestDevice(RequestDeviceOptions options);
BluetoothDevice? requestDevice(/*RequestDeviceOptions options*/);

View file

@ -12,6 +12,7 @@ interface BluetoothServiceDataMap {
readonly maplike<UUID, DataView>;
};*/
[Pref="dom.bluetooth.enabled"]
interface BluetoothAdvertisingData {
readonly attribute unsigned short? appearance;
readonly attribute byte? txPower;

View file

@ -4,6 +4,7 @@
// https://webbluetoothcg.github.io/web-bluetooth/#characteristicproperties
[Pref="dom.bluetooth.enabled"]
interface BluetoothCharacteristicProperties {
readonly attribute boolean broadcast;
readonly attribute boolean read;

View file

@ -10,6 +10,7 @@ enum VendorIDSource {
"usb"
};
[Pref="dom.bluetooth.enabled"]
interface BluetoothDevice {
readonly attribute DOMString id;
readonly attribute DOMString? name;

View file

@ -4,6 +4,7 @@
// https://webbluetoothcg.github.io/web-bluetooth/#bluetoothremotegattcharacteristic
[Pref="dom.bluetooth.enabled"]
interface BluetoothRemoteGATTCharacteristic {
readonly attribute BluetoothRemoteGATTService service;
readonly attribute DOMString uuid;

View file

@ -4,6 +4,7 @@
// http://webbluetoothcg.github.io/web-bluetooth/#bluetoothremotegattdescriptor
[Pref="dom.bluetooth.enabled"]
interface BluetoothRemoteGATTDescriptor {
readonly attribute BluetoothRemoteGATTCharacteristic characteristic;
readonly attribute DOMString uuid;

View file

@ -4,6 +4,7 @@
//https://webbluetoothcg.github.io/web-bluetooth/#bluetoothremotegattserver
[Pref="dom.bluetooth.enabled"]
interface BluetoothRemoteGATTServer {
readonly attribute BluetoothDevice device;
readonly attribute boolean connected;

View file

@ -4,6 +4,7 @@
// https://webbluetoothcg.github.io/web-bluetooth/#bluetoothremotegattservice
[Pref="dom.bluetooth.enabled"]
interface BluetoothRemoteGATTService {
readonly attribute BluetoothDevice device;
readonly attribute DOMString uuid;

View file

@ -4,6 +4,7 @@
// https://webbluetoothcg.github.io/web-bluetooth/#bluetoothuuid
[Pref="dom.bluetooth.enabled"]
interface BluetoothUUID {
[Throws]
static UUID getService(BluetoothServiceUUID name);

View file

@ -147,22 +147,22 @@ interface BrowserElementPrivileged {
// unsigned long modifiers);
[Throws,
Pref="dom.mozBrowserFramesEnabled",
Pref="dom.mozbrowser.enabled",
CheckAnyPermissions="browser"]
void goBack();
[Throws,
Pref="dom.mozBrowserFramesEnabled",
Pref="dom.mozbrowser.enabled",
CheckAnyPermissions="browser"]
void goForward();
[Throws,
Pref="dom.mozBrowserFramesEnabled",
Pref="dom.mozbrowser.enabled",
CheckAnyPermissions="browser"]
void reload(optional boolean hardReload = false);
[Throws,
Pref="dom.mozBrowserFramesEnabled",
Pref="dom.mozbrowser.enabled",
CheckAnyPermissions="browser"]
void stop();

View file

@ -32,7 +32,7 @@ partial interface HTMLIFrameElement {
};
partial interface HTMLIFrameElement {
[ChromeOnly,SetterThrows]
[ChromeOnly,SetterThrows,Pref="dom.mozbrowser.enabled"]
attribute boolean mozbrowser;
};

View file

@ -19,6 +19,7 @@ interface MouseEvent : UIEvent {
//readonly attribute unsigned short buttons;
//boolean getModifierState (DOMString keyArg);
[Pref="dom.mouseevent.which.enabled"]
readonly attribute long which;
};

View file

@ -72,7 +72,8 @@ dictionary TestDictionaryDefaults {
[Constructor,
Constructor(sequence<unrestricted double> numberSequence),
Constructor(unrestricted double num)]
Constructor(unrestricted double num),
Pref="dom.testbinding.enabled"]
interface TestBinding {
attribute boolean booleanAttribute;
attribute byte byteAttribute;
@ -401,4 +402,26 @@ interface TestBinding {
static void receiveVoidStatic();
boolean BooleanMozPreference(DOMString pref_name);
DOMString StringMozPreference(DOMString pref_name);
[Pref="dom.testbinding.prefcontrolled.enabled"]
readonly attribute boolean prefControlledAttributeDisabled;
[Pref="dom.testbinding.prefcontrolled.enabled"]
static readonly attribute boolean prefControlledStaticAttributeDisabled;
[Pref="dom.testbinding.prefcontrolled.enabled"]
void prefControlledMethodDisabled();
[Pref="dom.testbinding.prefcontrolled.enabled"]
static void prefControlledStaticMethodDisabled();
[Pref="dom.testbinding.prefcontrolled.enabled"]
const unsigned short prefControlledConstDisabled = 0;
[Pref="dom.testbinding.prefcontrolled2.enabled"]
readonly attribute boolean prefControlledAttributeEnabled;
[Pref="dom.testbinding.prefcontrolled2.enabled"]
static readonly attribute boolean prefControlledStaticAttributeEnabled;
[Pref="dom.testbinding.prefcontrolled2.enabled"]
void prefControlledMethodEnabled();
[Pref="dom.testbinding.prefcontrolled2.enabled"]
static void prefControlledStaticMethodEnabled();
[Pref="dom.testbinding.prefcontrolled2.enabled"]
const unsigned short prefControlledConstEnabled = 0;
};

View file

@ -11,6 +11,7 @@
// This interface is entirely internal to Servo, and should not be accessible to
// web pages.
[Pref="dom.testbinding.enabled"]
interface TestBindingProxy : TestBinding {
readonly attribute unsigned long length;