Commit Graph

353 Commits

Author SHA1 Message Date
Alexandru Dima
c0560907e9 Merge pull request #157171 from mjbvz/able-rooster
Try using AbortController for disposable dom listeners
2022-08-05 15:06:16 +02:00
Matt Bierner
5589b81019 Remove IStandardWindow (#157181)
This was added to support old IE versions which we no longer support https://github.com/microsoft/monaco-editor/issues/26
2022-08-05 06:22:28 +02:00
Matt Bierner
5908f17750 Remove a few IE8 conditions (#157179)
These should no longer be needed
2022-08-05 06:21:59 +02:00
Matt Bierner
508486f886 Try using AbortController for disposable dom listeners
This makes `addDisposableListener` use an abortcontroller to unregister the listener. This lets us avoid having to null out references to the handler and the node
2022-08-04 16:07:38 -07:00
Matt Bierner
85c03e0238 clearNode should use replaceChildren (#157169)
The new-ish `replaceChildren` api lets us quickly remove all children of an html element without having to iterate through the children
2022-08-04 16:05:07 -07:00
Matt Bierner
0eec29c254 Remove dom.getElementsByTagName (#157163)
This was just calling document.getElementsByTagName
2022-08-05 00:30:59 +02:00
Matt Bierner
342394d1e7 Use optional chaining for more method calls (#156938)
This rewrites code such as:

```ts
if (thing) {
    thing.method();
}
```

To the more concise:

```ts
thing?.method();
```

This was done using a simple find replace. I tried to keep the change pretty conservative so it only touches simple cases like above
2022-08-03 01:56:56 +02:00
João Moreno
9c4a29cc58 Make sure tree find widget can be moved using the keyboard (#156583)
fixes #156251
2022-07-28 17:27:00 +02:00
João Moreno
dc75592590 fix type issues in h() (#155600)
- improve regex with named capture groups
- drop $ in favor of inline id
- add tests

Co-authored-by: Henning Dieterichs <notify.henning.dieterichs@live.de>

Co-authored-by: Henning Dieterichs <notify.henning.dieterichs@live.de>
2022-07-19 12:25:52 +00:00
João Moreno
34507a8db3 h: type check attributes object (#155501) 2022-07-18 16:07:29 +02:00
João Moreno
05d1f4a5ee dom: h should allow ids and multiple class names (#155311) 2022-07-15 17:27:02 +02:00
Henning Dieterichs
62bd8e457c Fixes #151127 2022-06-28 19:59:08 +02:00
Alexandru Dima
919ec63663 Switch to newer mouseleave event (#153111)
Switch to newer `mouseleave` event (ref #138789)
2022-06-24 13:22:37 +00:00
Henning Dieterichs
63bc558a55 Moves helper function h to base/browser/dom 2022-06-24 11:16:34 +02:00
Johannes Rieken
600bfb5995 remove unused code (#152208) 2022-06-15 14:52:04 +00:00
Johannes
ed9ed45794 Merge branch 'main' into joh/voluminous-lobster 2022-06-10 09:07:30 +02:00
Matt Bierner
f7e12a3a92 Use optional method calls in more places (#151634)
This replaces code like:

```ts
if (foo.bar) {
    foo.bar(cat);
}
```

with:

```ts
foo.bar?.(cat)
```

Which is more concise but has the same meaning
2022-06-09 15:04:28 -07:00
Johannes
0656d21d11 auto-fixed prefer-const violation 2022-06-08 17:49:21 +02:00
Mitch Schutt
e3a8e502ad Focus editor for tab after dragged over for 1500 millis (#149604)
* Focus editor for tab after dragged over for 1500 millis

* 💄

Co-authored-by: Benjamin Pasero <benjamin.pasero@gmail.com>
2022-06-07 15:06:53 +02:00
SteVen Batten
85bf8af5b9 Improve Counter-Zoom Handling for Context Views (#149958)
* fixes #149957

* fixes #149741

* use const

* use const
2022-05-19 18:20:48 +00:00
Alexandru Dima
22f22cfdf1 Avoid using CSS variables for background images because they aren't fetched through the service worker in Safari (#149259)
* Fixes #149256: Avoid using CSS variables for background images because they aren't fetched through the service worker in Safari

* Fix compilation errors
2022-05-11 17:12:40 +02:00
Matt Bierner
526505636e Fix position of webviews and notebooks when the editor grid scrolls (#148858)
* Fix position of webviews and notebooks when the grid scrolls

Fixes #116946

Makes sure that absolutely positioned webviews and notebooks are correctly moved when the editor widget is scrolled

It also adds a clipping rect to make sure the elements do not overflow outside of the editor area (this would cause the webview/notebook to draw over the sidebar in some cases)

* Fix test service
2022-05-06 11:49:33 -07:00
rebornix
93aad560e1 Revert "Nulling dom node refs to prevent leaks on detached dom nodes."
This reverts commit 0f5c997b1d.
2022-03-29 17:27:42 -07:00
rebornix
0f5c997b1d Nulling dom node refs to prevent leaks on detached dom nodes. 2022-03-29 16:26:44 -07:00
Matt Bierner
bfc026b97a Drop into text editor api proposal (#143334)
* Add drop into editor api proposal

For #142990

* Use AsyncEmitter
2022-03-18 11:32:11 -07:00
Matt Bierner
c521f36041 Fix anchors and data images in extension pages
Fixes #144897

Refactors to have a single `hookDomPurifyHrefAndSrcSanitizer` function that handles sanitizing the href and src attributes. Also updates this function to allow fragment links `#` and data images
2022-03-11 13:00:46 -08:00
Alex Dima
3345f477f7 Adopt setPointerCapture in the scrollbar (#140101) 2022-03-02 18:32:43 +01:00
Anthony Stewart
12e6b0b304 Add match media change listener in browser ts (#143287)
* Replace the isStandalone const with a method of the same name

* Adding the matchMediaChangeListener into browser.ts so it can be used there

* Fix formatting

* Use browser.ts for all usages of addMatchMediaChangeListener

Co-authored-by: Anthony Stewart <anthonystewart@google.com>
2022-02-26 08:34:47 +01:00
Matt Bierner
7be5b48a14 Fix spelling on dom listeners 2022-02-17 17:19:31 -08:00
Benjamin Pasero
7759309bd8 fix hygiene issue with web file system access 2022-02-09 08:18:28 +01:00
Benjamin Pasero
50b42f9087 Deal with build failures related to FileSystemHandle changes with TS@next (fix #141908) 2022-02-09 07:59:45 +01:00
Johannes Rieken
4a130c40ed enable @typescript-eslint/member-delimiter-style, https://github.com/microsoft/vscode/issues/140391 2022-02-02 14:35:33 +01:00
Matt Bierner
442227c0db Remove extra DomEvent type
We should just use the actual dom `Event` base type here
2022-02-01 17:22:07 -08:00
Alexandru Dima
4810839966 Remove bad matchMedia polyfill 2022-01-13 08:13:08 +01:00
Alex Dima
a2cac5d927 Add dom events to TextAreaWrapper 2021-11-29 10:34:24 +01:00
Alex Dima
bb7a76bf2b Make FocusTracker shadow dom aware 2021-11-24 13:43:17 +01:00
Alex Dima
9bd899faba Check the active element also when 'focusin' or 'focusout' bubble.
This change was initially done only in the editor for microsoft/monaco-editor#2339, but after a discussion we have agreed to bring it to all users of `FocusTracker`.

Co-authored-by: Johannes Rieken <johannes.rieken@gmail.com>
2021-11-22 14:59:46 +01:00
Alex Dima
d7f92d9f14 Fixes microsoft/monaco-editor#2339: Listen to focusin and focusout and refresh the dom focus tracker state 2021-11-18 22:43:24 +01:00
Tyler James Leonhardt
68957a66bb add ability for embedders to specify urls that should open in a popup with opener (#136383) 2021-11-04 10:16:27 -07:00
Benjamin Pasero
e06da97af6 web - refactor lifecycle service to always go through before, will, did shutdown phases 2021-11-02 12:57:03 +01:00
Tyler Leonhardt
dcb7d85c0a allow type in dompurify config so that issue-reporter can work again (type="checkbox" & type="text") fixes #133281 2021-09-17 14:27:45 -07:00
Benjamin Pasero
19091ceccf debt - reduce some queues that seem not needed anymore (#133173) 2021-09-15 18:05:03 +02:00
Matt Bierner
474d4951d8 Switch to dompurify for sanitizing markdown content (#131950)
* Switch to dompurify for sanitizing markdown content

Switches us from using `insane` to instead use `dompurify`, which seems to be better maintained and also has some nice features, such as built-in trusted types support

I've tried to port over our existing sanitizer settings as best as possible, but there's not always a 1:1 mapping between how insane works and how dompurify does. I'd like to get this change in early in the iteration to catch potential regressions

* Remove logging and renaming param

* Move dompurify to browser layer

* Fixing tests and how we check valid attributes

* Allow innerhtml in specific files

* Use isEqualNode instead of checking innerHTML directly

innerHTML can return different results on different browsers. Use `isEqualNode` instead

* Reapply fix for trusted types

* Enable ALLOW_UNKNOWN_PROTOCOLS

I beleive this is required since we allow links to commands and loading images over remote

* in -> of

* Fix check of protocol

* Enable two more safe tags
2021-09-03 12:17:02 -07:00
Akat
77905c850e fix some typo in comments, renaming few methods (#130470) 2021-08-11 17:57:48 -07:00
rebornix
130ba00dc7 fix #125235. Add zindex const enums 2021-08-05 16:16:48 -07:00
Matt Bierner
494cbbd02d Organize imports in vs/base 2021-08-04 12:28:27 -07:00
Matt Bierner
27858a0faf Remove the built-in markdown rendering for notebooks (#128806)
This switches our notebooks to always use contributed markdown rendering instead of our built-in markdown renderer

We'd held off on switching over due to accessibility. I've tried to address this using the `aria-describedby` attributed to link the markdown container with a copy of rendered (and sanitized) html from the webview.
2021-07-16 15:44:04 -07:00
João Moreno
4168941dee remove domEvent
related to #123487
2021-06-09 16:37:09 +02:00
Alexandru Dima
37a12c9b08 Merge pull request #121557 from ValeraS/fix/safari-media-query
fix: use addListener instead of addEventListener to to observe media query lists
2021-05-12 15:56:41 +02:00
Alex Dima
2abf8d3779 Introduce addMatchMediaChangeListener with support for Safari 13.x 2021-05-12 15:55:52 +02:00