Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AmbientLightSensor constructor cannot initialize illuminance #24

Closed
foolip opened this issue Apr 7, 2017 · 6 comments

Comments

@foolip
Copy link
Member

commented Apr 7, 2017

https://w3c.github.io/ambient-light/#ambient-light-sensor-interface

This seems like a bug, there should probably be an AmbientLightSensorOptions dictionary that includes illuminance.

@pozdnyakov

This comment has been minimized.

Copy link

commented Apr 7, 2017

think the illuminance attribute should rather be nullable. @tobie

@foolip

This comment has been minimized.

Copy link
Member Author

commented Apr 7, 2017

That would be an orthogonal question, the problem is that it's current readonly so there's no way to set it to any value.

@tobie

This comment has been minimized.

Copy link
Member

commented Apr 7, 2017

Well, that's by design. It's a getter to the value provided by the sensor.

@pozdnyakov

This comment has been minimized.

Copy link

commented Apr 7, 2017

@foolip what would be the use case for setting illuminance from the ctor? AFAIK it should just contain the latest AML sensor reading in activated state and be null in all the other states.

@foolip

This comment has been minimized.

Copy link
Member Author

commented Apr 7, 2017

OK, I didn't follow the links, I assumed that the relationship between AmbientLightSensor and Sensor was like that between MessageEvent and Event, that both had constructors that should be able to set all of the members, and that the members never change. Not so.

@foolip foolip closed this Apr 7, 2017
@tobie

This comment has been minimized.

Copy link
Member

commented Apr 7, 2017

That's the design we had initially, which probably explains why you got confused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.