-
Notifications
You must be signed in to change notification settings - Fork 456
override scroll methods to return void until browser implementation changes #2237
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
|
Thanks for the PR! This section of the codebase is owned by @saschanaz - if they write a comment saying "LGTM" then it will be merged. |
inputfiles/patches/scroll.kdl
Outdated
| @@ -0,0 +1,9 @@ | |||
| interface Element { | |||
| method scroll overrideType=void | |||
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.
type=undefined should do it as an IDL type
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.
As you see in #2196 it's more than just Element but also Window.
|
Title should be "override scroll methods to return void until browser implementation changes" or something. |
src/build/patches.ts
Outdated
| method[methodName] = handleMethod(child); | ||
| const m = handleMethod(child); | ||
| if (method[methodName]) { | ||
| // ts: The goal here is to merge multiple method signatures together for methods with the same name. |
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.
we already have a better solution in another PR, no? This is weird.
I take this back and added another comment below.
src/build/patches.ts
Outdated
| | DeepPartial<Signature>[] | ||
| | Record<string, DeepPartial<Signature>> = child.properties?.overrideType | ||
| ? { | ||
| "0": { |
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.
This certainly is the key but I don't think we should do it this way, What if we only want to override the second signature but leave the first one as-is?
What about something like:
method name signatureIndex=0 type=undefinedAnd then we return object as signature list instead of an array if signatureIndex exists?
|
I have updated it @saschanaz I couldn't update window, because it gave me this error TypeError: method.signature.forEach is not a function |
saschanaz
left a comment
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.
Looks much better, thanks.
src/build/patches.ts
Outdated
| : T; | ||
|
|
||
| interface Method extends Omit<originalMethod, "signature"> { | ||
| signature: DeepPartial<Signature>[] | Record<string, DeepPartial<Signature>>; |
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.
It's more like Record<number, ...>, and maybe name the interface something like OverridableMethod, so that we don't have to rename the pure Method
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.
Done
| ? handleTyped(typeNode) | ||
| : { | ||
| type: string(child.properties?.returns), | ||
| subtype: undefined, |
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.
why subtype?
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.
With out it it will become undefind<undefind>
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.
Hmm, fair. if one needs subtype they should use nested types.
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.
Okay
| }; | ||
|
|
||
| let signature: Method["signature"]; | ||
| const signatureIndex = child.properties?.signatureIndex; |
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.
time to add number()?
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.
Why? Sometimes it is undefined
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.
Hmm, fair.
Meaning you may have touched a non-existent method. signatureIndex would work only for an existing method. Note that not all Element methods exist in Window and try again based on that? |
|
Much more concise than the initial PR. Thanks, LGTM |
|
There was an issue merging, maybe try again saschanaz. Details |
|
I am still working on the rest |
|
Oh right, the window methods. |
|
Done @saschanaz |
inputfiles/patches/scroll.kdl
Outdated
| method scrollBy returns=void signatureIndex=1 | ||
| method scrollTo returns=void signatureIndex=0 | ||
| method scrollTo returns=void signatureIndex=1 | ||
| } |
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.
Lastly let's put this in cssom-view.kdl
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.
With some comments like "No implementation of Promise return values as of 2025-11"
|
I have updated it @saschanaz |
|
LGTM2 |
|
There was an issue merging, maybe try again saschanaz. Details |
|
Can you review this @jakebailey |
jakebailey
left a comment
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 feel like this is futile given 6.0 isn't even out and neither is the change, but a pure revert for now I guess is fine. Just seems silly to argue that this matters.
|
Can we use |
|
We will migrate to |
|
LGTM |
|
There was an issue merging, maybe try again saschanaz. Details |
fixes #2197
Related #2053