Re: [w3ctag/design-reviews] HTML attribute for template URLs? (Discussion #1123)

> If I'm reading the spec right, this use is for loading tile images into a map. 

Yes, as well as other resources.  The proposed \<extent> element acts like a "map form", in that as it gets "filled out" and submitted (to the URL created by supplying values to the URL template in the `tref` attribute), the child \<link> element fetches and loads the appropriate resource as specified by the `rel` attribute, processing it according to its `type` attribute, if specified.   \<link> and \<source> are both void elements, so no difference there, but at the time I wrote the spec I thought that this implementation of a URL fit better as an extension of \<link> than of \<source>.  Also, if I recall correctly, \<source> implies, or can imply, a choice among resources that could be loaded, and this situation didn't seem to call for that. 

> That puts it in the "causes the resource at the given URL to be loaded" category from https://www.w3.org/TR/design-principles/#naming-of-url-attributes, meaning it should be src instead of href (modulo any adjustments for being a template instead of a URL). 

That was actually why a new attribute `tref` was proposed, because before template processing was completed, it shouldn't be considered a URL, and after processing it could be used as the value of the sibling `.href` property (perhaps).  Anyway I imagine that could be applied to the \<source src> attribute, with similar considerations.  

In sum, \<link> was used because of the importance of `rel` in this situation and similarity to stylesheet and icon resources using \<link>.  

> I don't know of any precedents for URL templates in markup, but that doesn't mean there aren't any.

I could not come up with a better way to get the values from the map into the URL.  I started by having an `action` attribute on \<extent>, but this turns out to be way more implementable and efficient, and similar to how web maps actually work already.   

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/discussions/1123#discussioncomment-13837135
You are receiving this because you are subscribed to this thread.

Message ID: <w3ctag/design-reviews/repo-discussions/1123/comments/13837135@github.com>

Received on Monday, 21 July 2025 18:36:28 UTC