# Merge \`ElementContext\` into \`WindowContext\` \(\#10979\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/6a7761e620cae20d91ace3b6c77e92d16f83f984)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 6a7761e620cae20d91ace3b6c77e92d16f83f984

Requested commit: 6a7761e620cae20d91ace3b6c77e92d16f83f984

Commit: 6a7761e620cae20d91ace3b6c77e92d16f83f984

Tree: 9f1d3e5b8331235960191e1fde8bff9a9193ae3e

Author: Antonio Scandurra

Committer: GitHub

## Message

```
Merge `ElementContext` into `WindowContext` (#10979)

The new `ElementContext` was originally introduced to ensure the element
APIs could only be used inside of elements. Unfortunately, there were
many places where some of those APIs needed to be used, so
`WindowContext::with_element_context` was introduced, which defeated the
original safety purposes of having a specific context for elements.

This pull request merges `ElementContext` into `WindowContext` and adds
(debug) runtime checks to APIs that can only be used during certain
phases of element drawing.

Release Notes:

- N/A

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
```

## Parents

- [031580f4dcb53ba165305645f886653dc576afc5](https://git.cafe/gitcafe/zed/commit/031580f4dcb53ba165305645f886653dc576afc5?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/6a7761e620cae20d91ace3b6c77e92d16f83f984?format=markdown)
