Skip to content

Add HTMLHtmlElement #60

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

Merged
merged 1 commit into from
Jul 19, 2021
Merged

Conversation

toastal
Copy link
Contributor

@toastal toastal commented Jul 18, 2021

Prerequisites

  • Before opening a pull request, please check the HTML standard (https://dom.spec.whatwg.org/). If it doesn't appear in this spec, it may be present in the spec for one of the other purescript-web projects. Although MDN is a great resource, it is not a suitable reference for this project.

https://html.spec.whatwg.org/multipage/semantics.html#htmlhtmlelement
https://developer.mozilla.org/en-US/docs/Web/API/HTMLHtmlElement

console.assert(document.documentElement instanceof HTMLHtmlElement) // true

Description of the change

Terribly named, the HTMLHtmlElement is the element for <html>. I'm surprised this was missing. Implementing, I copied HTMLBodyElement because it too doesn't have any special properties. And I checked, though a bit nonsensical, this should be NonDocumentTypeChildNode because the element does have an always-null-returning nextElementSibling (its parentNode, HTMLDocument does not).

I need this for work because I need to get document.documentElement.


Checklist:

  • Added the change to the changelog's "Unreleased" section with a reference to this PR (e.g. "- Made a change (#0000)")
  • Linked any existing issues or proposals that this pull request should close
  • Updated or added relevant documentation
  • Added a test for the contribution (if applicable)

Copy link
Contributor

@thomashoneyman thomashoneyman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@thomashoneyman thomashoneyman merged commit 2310c68 into purescript-web:master Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants