-
Notifications
You must be signed in to change notification settings - Fork 441
Introduce composedPath for Events #523
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
Can we add https://dom.spec.whatwg.org/##dom-event-composedpath spec to the generator instead? |
@mhegazy would that involve adding im not so familiar with this repo so may need to be pointed in the right direction |
Sorry, i should have added more info. We are moving to generate the lib file directelly from widl files. today we have a "base" input file that comes fom the edge team (see https://github.com/Microsoft/TSJS-lib-generator/blob/master/inputfiles/browser.webidl.preprocessed.json) then we add widl files on top of it (see contents of https://github.com/Microsoft/TSJS-lib-generator/tree/master/inputfiles/idl). To add a new widl file you need to:
Now, since we are just starting this process, there is usually some additional work that needs to be done, e.g. adding a missing type, or updating the overrides in https://github.com/Microsoft/TSJS-lib-generator/blob/master/inputfiles/overridingTypes.json based on the addtion. you can find examples in https://github.com/Microsoft/TSJS-lib-generator/pulls?q=is%3Apr+is%3Aclosed+author%3Asaschanaz Also cc @saschanaz |
in this case wouldn't the widl be the entire DOM standard though? (dom.spec.whatwg.org) if so im happy to have a go |
@saschanaz have more info. but we can try adding https://dom.spec.whatwg.org and see how that goes. |
@saschanaz given something like the last commit, how would you then go about fixing up the missing types? it seems its because the comments file contains many entries which don't have an associated type in the IDL (they exist in other specs, for example |
Yeah... The DOM spec depends on https://html.spec.whatwg.org/multipage/webappapis.html and https://html.spec.whatwg.org/multipage/dom.html. Adding them will generate huge diffs, but will be helpful for future progress. |
It seems we need a way to selectively accept IDL types to make things more progressive. |
yup im happy to throw a bunch of them in at once but it quickly blows up so would be a rather big PR. |
on a side note, adding the HTML DOM spec results in an error when trying to resolve exposures...
this results in an anonymous getter which has a null name: {
"name": null,
"signature": [
{
"type": "object",
"param": [
{
"name": "name",
"type": "DOMString"
}
]
}
],
"getter": 1,
"exposed": "Window"
} because of the i think our check needs to account for the fact that if (typeof obj[key] === "object" && obj[key] !== null) |
I think #524 can help reducing this PR. |
aha yes thats what i had just partly tried to commit. i had moved a bunch to the |
@saschanaz i may need some guidance from you around that. i've noticed adding an should i just be moving those? like i had in my last commit. and what about ones which don't exist in a spec? for example this now errors because apparently |
Yeah, that would work.
Those types should be simply removed. |
ah in actual fact that one exists in the preprocessed file and our comments, but still causes a not found error.. ill wait until the other PR is merged though too so i dont redo the same changes. |
Probably the comments file is the culprit, maybe removing onmsthumbnailclick from the file will fix it. The preprocessed file should be kept intact, though. |
Would you try rebasing? |
will give it a go. couple of issues (note to self really):
|
2a933e0
to
e5a40ed
Compare
there's quite some crossover with those PRs so i will just wait again. i had already included the DOM spec. let me know and ill rebase if you get that in master i also fixed a couple of bugs in the emitter on my way |
7b2e552
to
80dbebf
Compare
also @saschanaz this currently fails tests edit: nevermind i sorted this tests now fail because we don't have |
baselines/dom.generated.d.ts
Outdated
addEventListener<K extends keyof DocumentAndElementEventHandlersEventMap>(type: K, listener: (this: HTMLAnchorElement, ev: DocumentAndElementEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; | ||
addEventListener<K extends keyof DocumentAndElementEventHandlersEventMap>(type: K, listener: (this: HTMLAnchorElement, ev: DocumentAndElementEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; | ||
addEventListener<K extends keyof GlobalEventHandlersEventMap>(type: K, listener: (this: HTMLAnchorElement, ev: GlobalEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; | ||
addEventListener<K extends keyof GlobalEventHandlersEventMap>(type: K, listener: (this: HTMLAnchorElement, ev: GlobalEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): 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.
@saschanaz any idea what happened here? looks like it duplicated the two signatures in every occurrence...
maybe i missed an added type or something?
FYI it now seems mostly right but:
|
one more rebase |
here you go @mhegazy im reading through the baseline diff just to double check too |
baselines/webworker.generated.d.ts
Outdated
/** | ||
* Dispatches a synthetic event event to target and returns true | ||
* if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. | ||
*/ |
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 looks strange, hmm.
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 freaky indentation? that was bothering me too, but couldn't figure out why its this way
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 indentation is because we join the comment lines by an indented *
, but this comment/statement is top level so shouldn't have any indentation
@saschanaz what about this? i can revert the last 2 commits if you don't think we should do this. i basically stripped the forced indentation from |
Fixes #522 and microsoft/TypeScript#17974.
The original PR (#413) missed out one of the two changes it aimed to make.
This'll allow: