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

OverconstrainedError extends DOMException + algo fixes #746

Merged
merged 7 commits into from
Nov 12, 2020

Conversation

jan-ivar
Copy link
Member

@jan-ivar jan-ivar commented Nov 5, 2020

Fixes #568.

I made the constraint argument always present and "" in cases where the constraint name is either filtered out or undetermined. This matches Safari and Firefox at least (I wasn't able to provoke the absence of a constraint in Chrome).

I also fixed some bugs in the algorithms around failedConstraint in the process.


Preview | Diff

@jan-ivar jan-ivar self-assigned this Nov 5, 2020
@jan-ivar
Copy link
Member Author

jan-ivar commented Nov 5, 2020

@henbos Regarding question in Thursday's meeting, instanceof OverconstrainedError should still work.

@saschanaz
Copy link
Member

It seems MediaStreamError is now essentially just DOMException. Can it be removed here?

@jan-ivar
Copy link
Member Author

jan-ivar commented Nov 9, 2020

It seems MediaStreamError is now essentially just DOMException. Can it be removed here?

@saschanaz Can we return a base class interface in a WebIDL JS callback and have the following still work?

navigator.mediaDevices.getUserMedia({video: {width: {min: 9999}}}, () => {}, e => {
  console.log(e.constraint); // width
});  

I've been working too much with dictionaries where this would be a problem.

@saschanaz
Copy link
Member

Yes, it should work. A working example is EventHandler, where the argument type is the base class interface Event.

jan-ivar and others added 5 commits November 9, 2020 12:10
Co-authored-by: Dominique Hazael-Massieux <[email protected]>
Co-authored-by: Dominique Hazael-Massieux <[email protected]>
Co-authored-by: Dominique Hazael-Massieux <[email protected]>
Co-authored-by: Dominique Hazael-Massieux <[email protected]>
@henbos henbos merged commit fc47ff4 into w3c:master Nov 12, 2020
@jan-ivar jan-ivar deleted the domexception branch November 30, 2020 21:27
sideshowbarker added a commit to w3c/browser-compat-data that referenced this pull request Dec 8, 2020
This change removes the message and name members from the data
for the OverconstrainedError interface, per the spec change at
w3c/mediacapture-main#746, which redefined
OverconstrainedError as as extending DOMException (which has message and
name members that OverconstrainedError inherits).
ddbeck pushed a commit to mdn/browser-compat-data that referenced this pull request Dec 10, 2020
This change removes the message and name members from the data
for the OverconstrainedError interface, per the spec change at
w3c/mediacapture-main#746, which redefined
OverconstrainedError as as extending DOMException (which has message and
name members that OverconstrainedError inherits).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OverconstrainedError should be a DOMException
4 participants