From 6dfc7521cdf0aabe75465f516600e6c0faec0350 Mon Sep 17 00:00:00 2001 From: Tobie Langel Date: Sat, 4 Mar 2017 01:43:17 +0100 Subject: [PATCH] Update ALS to latest generic sensor spec. Closes #20. Depends on https://github.com/w3c/permissions/pull/138 Depends on https://github.com/w3c/sensors/pull/172 Needs to be rebased once https://github.com/w3c/permissions/pull/138 has landed. --- index.bs | 44 ++++-------------------- index.html | 99 ++++++++++++++---------------------------------------- 2 files changed, 31 insertions(+), 112 deletions(-) diff --git a/index.bs b/index.bs index 634af55..b971135 100644 --- a/index.bs +++ b/index.bs @@ -18,17 +18,13 @@ Version History: https://github.com/w3c/ambient-light/commits/gh-pages/index.bs Indent: 2 Repository: w3c/ambient-light Markup Shorthands: markdown on -Inline Github Issues: true +Inline Github Issues: off !Issue Tracking: Level 2 Issues !Test Suite: web-platform-tests on GitHub Boilerplate: omit issues-index, omit conformance Default Biblio Status: current
-urlPrefix: https://w3c.github.io/permissions/; spec: PERMISSIONS
-  type: dfn
-    text: permission; url: idl-def-Permission
-    text: associated PermissionDescriptor;  url: dfn-associated-permissiondescriptor
 urlPrefix: https://w3c.github.io/sensors; spec: GENERIC-SENSOR
   type: dfn
     text: high-level
@@ -64,7 +60,7 @@ Examples {#examples}
     sensor.start();
     
     sensor.onchange = function(event) {
-        console.log(event.reading.illuminance);
+        console.log(sensor.illuminance);
     };
 
     sensor.onerror = function(event) {
@@ -85,27 +81,14 @@ Model {#model}
 The Ambient Light Sensor's associated Sensor subclass
 is the {{AmbientLightSensor}} class.
 
-The Ambient Light Sensor's associated SensorReading subclass
-is the {{AmbientLightSensorReading}} class.
-
 The Ambient Light Sensor has a default sensor,
 which is the device's main light detector.
 
 The Ambient Light Sensor has a single supported reporting mode
 which is "auto".
 
-The Ambient Light Sensor's permission name is `"ambient-light"`.
-It has no associated PermissionDescriptor.
-
-The Ambient Light Sensor has an associated abstract operation
-to retrieve the sensor permission which
-must simply return a permission whose name is "ambient-light".
-
-The Ambient Light Sensor has an associated abstract operation
-to construct a SensorReading object
-which creates a new {{AmbientLightSensorReading}} object and sets its
-illuminance attribute to
-the current light level.
+The Ambient Light Sensor has an associated {{PermissionName}}
+which is "ambient-light-sensor".
 
 The current light level or illuminance
 is a value that represents the ambient light levels
@@ -124,31 +107,16 @@ The AmbientLightSensor Interface {#ambient-light-sensor-interface}
 
   [Constructor(optional SensorOptions sensorOptions)]
   interface AmbientLightSensor : Sensor {
+    readonly attribute unrestricted double illuminance;
   };
 
To Construct an AmbientLightSensor Object the user agent must invoke the construct a Sensor object abstract operation. -The AmbientLightSensorReading Interface {#ambient-light-sensor-reading-interface} ---------------------------------------- - -
-  [Constructor(AmbientLightSensorReadingInit ambientLightSensorReadingInit)]
-  interface AmbientLightSensorReading : SensorReading {
-      readonly attribute unrestricted double illuminance;
-  };
-  
-  dictionary AmbientLightSensorReadingInit {
-    required unrestricted double illuminance;
-  };
-
- -### The AmbientLightSensorReading constructor ### {#ambient-light-sensor-reading-constructor} - ### The illuminance attribute ### {#ambient-light-sensor-reading-attribute} -The illuminance attribute of the {{AmbientLightSensorReading}} +The illuminance attribute of the {{AmbientLightSensor}} interface represents the current light level. Acknowledgements {#acknowledgements} diff --git a/index.html b/index.html index 72ae89e..145ee12 100644 --- a/index.html +++ b/index.html @@ -969,6 +969,8 @@ /* Reverse color scheme */ color: black; border-color: #3980B5; + border-bottom-width: 3px !important; + margin-bottom: 0px !important; } .toc a:visited { border-color: #054572; @@ -1181,7 +1183,7 @@ background-attachment: fixed; } - +