Skip to content
This repository was archived by the owner on Oct 4, 2020. It is now read-only.
This repository was archived by the owner on Oct 4, 2020. It is now read-only.

Add HTMLHyperlinkElementUtils #143

Description

@chexxor

The a and area elements implement the HTMLHyperlinkElementUtils interface [0]. How are mixin interfaces like this usually included in this repo? It's not a proper element, just an extracted interface, so we can't make a new type in DOM.HTML.Types and check the tag name like this:

-- We can't do this, because an `a` element returns tag name of "HTMLAnchorElement".
readHTMLHyperlinkElementUtils :: Foreign -> F HTMLHyperlinkElementUtils
readHTMLHyperlinkElementUtils = unsafeReadTagged "HTMLHyperlinkElementUtils

But we could do this:

htmlAnchorElementToHTMLHyperlinkElementUtils :: HTMLAnchorElement -> HTMLHyperlinkElementUtils
htmlAnchorElementToHTMLHyperlinkElementUtils = unsafeCoerce

and put that interface's members in a DOM.HTML.HTMLHyperlinkElementUtils module, like the href function. Should we just do that?

[0] https://html.spec.whatwg.org/multipage/links.html#htmlhyperlinkelementutils

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions