-
Notifications
You must be signed in to change notification settings - Fork 35
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
An element attribute proposal for increasing screen brightness #348
Comments
Thanks, @beaufortfrancois, this reflects the consensus of the meeting well I think. Some remarks:
One additional idea might be to say that (i), dynamically inserted attributes in the user gesture that triggered a fullscreen request or (ii), statically already existing attributes in the fullscreen'ed element could be always honored, for example, for proprietary codes (example). |
Thanks @beaufortfrancois for writing this up. Echoing what @tomayac said, I think we can weaken some of the normative requirements in favor of allowing UAs to decide how proactively they will brighten an area of the screen or provide UI suggesting that the screen could be brightened. Something like, "based on the following signals a UA may choose to proactively brighten an area of the screen or the whole screen, may provide an affordance for the user to brighten the screen, or ignore the attribute." |
Thank you @reillyeon and @tomayac for your feedback. I've updated #348 (comment). Let me know what you think. You can see the diff by clicking "edited ▾" at the top of the post. |
Thanks for organising this, @beaufortfrancois. I have a few questions:
For (2), here are a couple of scenarios I can think of: Wrapper has <div style="position: relative;" increaseBrightness>
<canvas style="width: 640px; height: 480px; z-index: 1" />
<div style="z-index: 2; position: absolute; top: 0; left: 0; width: 100%; height: 100%">
</div> Lower layer has <div style="position: relative;">
<canvas increaseBrightness style="width: 640px; height: 480px; z-index: 1" />
<div style="z-index: 2; position: absolute; top: 0; left: 0; width: 100%; height: 100%">
</div> |
Thanks for your feedback @willmorgan!
I can't think of a reason to allow it only on certain elements. In your example below, a
I was thinking of using the bounding client rectangle of the element. It means we don't deal with layers at all. |
I can't think of any element to explicitly disallow, but wondering how things like Bounding client rectangle sounds good! It would be useful to know if the brightness increased to provide alternative guidance if it isn't possible or supported. |
Following https://developer.chrome.com/docs/web-platform/region-capture/#deriving-a-croptarget,
Can you elaborate? |
Sure, so if we know that screen brightness increased automatically, then we know that it is not necessary to provide extra guidance on how to increase brightness if an attempt fails. On the other hand, if we know the element didn't have increased brightness, and the attempt fails for the user, we could offer some instruction on how to do this. I can imagine us looking at the type of device (mobile or desktop) and the screen information object to know whether it makes sense to provide the guidance or not, and if so, in what format. For example it would be unlikely to ask to increase brightness for external monitors because of the illumination area (and it would be too much to ask the user, IMHO), but we definitely would on mobiles. |
That's an issue with the current proposal indeed. I'm not sure how to address this properly. Firing a single generic JS event (e.g. Thinking out loud, shall we have several JS events?
|
The idea here is that users can already increase their screen brightness manually. The purpose of this attribute is to provide a hint to the browser that the user is in a situation where it can provide a simpler UI for doing so. Sites shouldn't be depending on the browser providing that UI and should show platform-specific guidance for increasing brightness regardless. When the browser decides to provide the hint the user can ignore that guidance and follow the simpler path provided. |
My understanding is that there's no "simpler UI" - the browser calls the OS to increase the screen brightness if it satisfies the various conditions we're putting on this.
It would be useful to progressively enhance the experience by knowing if the brightness was increased, be that by the user or automatically by the browser following the site's request. This would de-clutter the UX. Part of the motivation in requesting this functionality is that it's already quite difficult to come up with platform-specific guidance for every possible combination of:
Therefore having that capability would be a huge benefit to users and developers alike. |
Could we move everything "brightness" to the WICG? We could incubate (and I can participate) there. |
@marcoscaceres I've started WICG/proposals#72 |
As it's not possible to transfer issues between W3C GitHub org and WICG GitHub org, I've opened WICG/screen-brightness#1 to continue this discussion. |
Following TPAC Devices and Sensors WG discussion, this issue explores a declarative approach for allowing web developers to ask the browser to increase the screen brightness.
An element attribute proposal was suggested. Let's call it
increaseBrightness
for now. Naming is hard. 🚲Last updated: 2022/09/21
Proposal
Example
Feature support
You can check for this element attribute support with:
Behaviour
When an element with the
increaseBrightness
attribute becomes visible to the user, the browser would take care of boosting the screen region that matches the element bounds OR increasing the overall screen brightness level if the device does not support partial screen brightness boosting.Only elements with the
increaseBrightness
attribute would trigger this behaviour. This way, web pages such the Wikipedia QR code article, would not suffer from automatic detection.Security and privacy considerations
Based on the following signals, the browser MAY choose to proactively brighten an area of the screen or the whole screen, provide an affordance for the user to brighten the screen, or ignore the
increaseBrightness
attribute:Based on the following signals, the browser MAY choose to restore screen brightness automatically:
increaseBrightness
attribute and fires too many requests.To avoid possible user fingerprinting issues, a website is not able to detect when screen brightness is increased.
Open design issues
The following issues (on top of the existing ones) remain open for discussion:
increaseBrightness
attribute? Shall we boost both partial screen regions or one only?The text was updated successfully, but these errors were encountered: