-
Notifications
You must be signed in to change notification settings - Fork 27.8k
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
Start moving window/document to use layout service #195827
Conversation
@bpasero am I on the right track here? Is it correct to be using export interface ILayoutService {
readonly primaryContainer: HTMLElement; // name would make this clearer
readonly primaryDocument: Document;
readonly primaryWindow: Window;
} |
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.
@Tyriar this looks good, except for document.createElement
: you should use the global main document
for now. The ownerDocument
will automatically change as soon as the element is appended into the floating window. The advantage of document.createElement
is that things like instanceof HTMLElement
continue to work.
As for the additional properties on the layout service: I am really not sure that is a good idea because:
- the main
window
anddocument
are always accessible as a global - the correct
window
anddocument
should always be computed based on the parentHTMLElement
that you get to create your elements in and not by going to a service
src/vs/workbench/contrib/terminal/browser/widgets/widgetManager.ts
Outdated
Show resolved
Hide resolved
Start moving window/document to use layout service
Fixes #195804