Skip to content
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

Remove nullish coalescing for textContent. #205

Merged
merged 1 commit into from
Nov 14, 2024

Commits on Nov 12, 2024

  1. Remove nullish coalescing for textContent.

    The default browser behavior when setting `.textContent` to `null` or
    `undefined` is to ultimately set the content to `''`†. This is quite
    different from the behavior of `createTextNode` though… by splitting
    the text node creation into multiple steps we can consistently leverage
    `.textContent` and remove the need to `?? ''`.
    
    † Note that the WHATWG spec only defines that behavior for `null`, but
      in practice all modern browsers seem to treat `undefined` similarly.
    theengineear committed Nov 12, 2024
    Configuration menu
    Copy the full SHA
    6df5f71 View commit details
    Browse the repository at this point in the history