[Webkit-unassigned] [Bug 270779] Navigator.mediaDevices.getSupportedConstraints mistakenly reports torch as false.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Mar 10 23:35:54 PDT 2024


https://bugs.webkit.org/show_bug.cgi?id=270779

Karl Dubost <karlcow at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |karlcow at apple.com,
                   |                            |webkit-bug-importer at group.a
                   |                            |pple.com
           Keywords|                            |BrowserCompat

--- Comment #1 from Karl Dubost <karlcow at apple.com> ---
Thanks Shawn!

Let's head to the spec, instead of MDN.
https://w3c.github.io/mediacapture-main/#dom-mediadevices-getsupportedconstraints

getSupportedConstraints
Returns a dictionary whose members are the constrainable properties known to the User Agent. 

* A supported constrainable property MUST be represented 
* AND any constrainable properties not supported by the User Agent MUST NOT be present in the returned dictionary. 
* The values returned represent what the User Agent implements and will not change during a browsing session.


Safari on desktop reports WRONGFULLY:

"groupId":false
"sampleRate":false
"sampleSize":false
"torch":false


So indeed there is a bug here. That looks like an easy fix
https://searchfox.org/wubkat/rev/c67bb750f2c1083399f0dbe7d08b416cd45eee34/Source/WebCore/Modules/mediastream/MediaDevices.cpp#363-383

Where the value is added to result only if the value is true. 



In more details:

On STP 190

{"aspectRatio":true
"deviceId":true
"displaySurface":true
"echoCancellation":true
"facingMode":true
"frameRate":true
"groupId":false
"height":true
"sampleRate":false
"sampleSize":false
"torch":false
"volume":true
"whiteBalanceMode":true
"width":true
"zoom":true} 


On Firefox Nightly 125.0a1 (2024-03-10) (64-bit)

 {"autoGainControl":true
"browserWindow":true
"channelCount":true
"deviceId":true
"echoCancellation":true
"facingMode":true
"frameRate":true
"groupId":true
"height":true
"mediaSource":true
"noiseSuppression":true
"scrollWithPage":true
"viewportHeight":true
"viewportOffsetX":true
"viewportOffsetY":true
"viewportWidth":true
"width":true} 


On Chrome Canary Version 124.0.6350.0 

{"aspectRatio":true
"autoGainControl":true
"brightness":true
"channelCount":true
"colorTemperature":true
"contrast":true
"deviceId":true
"displaySurface":true
"echoCancellation":true
"exposureCompensation":true
"exposureMode":true
"exposureTime":true
"facingMode":true
"focusDistance":true
"focusMode":true
"frameRate":true
"groupId":true
"height":true
"iso":true
"latency":true
"noiseSuppression":true
"pan":true
"pointsOfInterest":true
"resizeMode":true
"sampleRate":true
"sampleSize":true
"saturation":true
"sharpness":true
"suppressLocalAudioPlayback":true
"tilt":true
"torch":true
"voiceIsolation":true
"whiteBalanceMode":true
"width":true
"zoom":true}

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240311/b10f8db9/attachment.htm>


More information about the webkit-unassigned mailing list