-
Notifications
You must be signed in to change notification settings - Fork 440
Fix missing optional parameter of createImageBitmap #571
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
Conversation
Different for Window or WorkerGlobalScope
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to return the definition of imageBitmapOptions to using inline unions instead of aliases.
baselines/dom.generated.d.ts
Outdated
@@ -17647,6 +17650,7 @@ type CanvasTextBaseline = "top" | "hanging" | "middle" | "alphabetic" | "ideogra | |||
type ChannelCountMode = "max" | "clamped-max" | "explicit"; | |||
type ChannelInterpretation = "speakers" | "discrete"; | |||
type ClientTypes = "window" | "worker" | "sharedworker" | "all"; | |||
type ColorSpaceConversion = "none" | "default"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small global aliases are annoying because of alias interning: everybody with a type none | default will now see the name ColorSpaceConversion for it.
Not sure the best workaround for this. I’ll think about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for reviewing, I will find time to come back and reconsider about this PR soon. :)
@@ -396,45 +396,6 @@ | |||
} | |||
} | |||
}, | |||
"ImageBitmapOptions": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What replaces this entry? Whatever it is, it results in a whole bunch of unwanted type aliases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The already existing dictionary ImageBitmapOptions
in HTML - ImageBitmap and animations.widl
replaces this entry. This was a conflict if I remember right.
Are the IDL changes hand-written or generated by |
@saschanaz Sorry for the delay. They are handwritten. *.d.ts are generated. |
Sorry to be late, but IDLs must not be hand-written and instead should be generated by |
@hexrcs Mind refreshing this PR? The removal in addedTypes.json looks great but the manual edits in *.widl do not. Can you remove them and do Some explanation: The old item in |
@saschanaz Yes, would like to! Will be checking this out tonight or tomorrow. Thanks for the clarification. |
@saschanaz Hi, which |
I tried to run Looks like something's wrong with
|
"HTML - ImageBitmap and animations", but it can be skipped for this PR. Looks like |
Ah right, the code has been updated and now it should be |
That should be fixed by #648, it's because other specs has started referencing it while the code doesn't know about it. |
@saschanaz Done! Could you please review again? 😃 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 but still needs an approval from @sandersn
Any progress or guidance on how to use |
TypeScript Issue # 27475
ImageBitmapOptions
was declared both inaddedTypes.json
as an interface and inidl/HTML - ImageBitmap and animations.widl
as a dictionary, which is I believe the root cause of it not showing up as an optional parameter insidecreateImageBitmap
method. I removed theinterface
declaration.Window
andWorker
have different supports forImageBitmapSource
(see this conversation). I created two distinct typesImageBitmapSourceWindow
andImageBitmapSourceWorker
for them in thewidl
files.This is my first PR to a major open source project ;) Please kindly review the changes I made. Suggestions would be much appreciated!