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

Add HTMLHyperlinkElementUtils. #144

Merged

Conversation

chexxor
Copy link
Contributor

@chexxor chexxor commented Feb 17, 2018

#143

This API is required to get the href attribute from an anchor element. I just threw this together to get a concrete proposal for this. I think it's working in my experiment project.

@@ -0,0 +1,41 @@
-- https://html.spec.whatwg.org/multipage/links.html#htmlhyperlinkelementutils
Copy link
Member

Choose a reason for hiding this comment

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

Can we extend this comment a bit futher - the specs used in this library are generally from the w3c not the whatwg... however, in this case, after doing some research it turns out this might be the only place the IDL is actually stated for this API.

It's called URLUtils in the HTML5 spec, which points to a URL standard document, which now points to a whatwg document, which doesn't have the interface listed. As far as I can tell from the non-IDL descriptions in the w3c spec though, this HTMLHyperlinkElementUtils IDL has all the same elements as the now-missing URLUtils API.

So I'd suggest something like:

The `URLUtils` interface referenced in https://www.w3.org/TR/html50/infrastructure.html#urlutils, now documented at https://html.spec.whatwg.org/multipage/links.html#htmlhyperlinkelementutils

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wonder which name we should use for this module and type, between "URLUtils" and "HTMLHyperlinkElementUtils". I feel like the latter term actually has a specification, which is good enough reason to choose this name rather than "URLUtils", and also it better fits the names of other types in this lib, like "HTMLAnchorElement".

Yeah, I was curious the relationship between w3 and whatwg's specs.
BTW, I chose the whatwg spec because that's the one MDN references:

Specifications
HTML Living Standard
The definition of 'HTMLHyperlinkElementUtils.href' in that specification.

Source: https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/href

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review!

Copy link
Member

Choose a reason for hiding this comment

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

As far as I understand it, the whatwg/living standard stuff is basically "encode what is commonly available in a spec" 😄 (rather than the w3c specs that describe how things are intended to work, before an implementation exists). I said in the readme we were going off the w3c specs, but maybe the living standard(s) would be more practical.

Really I was just hoping to avoid implementing browser quirks in the API / experimental stuff that is not widely implemented and agreed upon yet. LS would probably also satisfy that.

@chexxor
Copy link
Contributor Author

chexxor commented Apr 10, 2018

Bump - this one is reviewable again, possibly good to merge.

@garyb
Copy link
Member

garyb commented Apr 13, 2018

Sorry, thanks!

@garyb garyb merged commit de2b148 into purescript-deprecated:master Apr 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants