Open gRegorLove opened 6 years ago
A few quick questions on this one:
<iframe>
with a root or property class name and a title
attribute?title
parsing change, would it make sense to more broadly apply it to any element with either a root or property class name and a title
attribute?<a href="https://sixtwothree.org" class="h-card" title="Welcome to my website!">Jason Garber</a>
{
"type": ["h-card"],
"properties": {
"name": ["Jason Garber"],
"url": [
{
"value": "https://sixtwothree.org",
"title": "Welcome to my website!"
}
]
}
}
…an actual value-title pattern. 😂
Edit:
Thinking more about my suggest above, how would my suggestion interact with something like…
<div class="h-card">
<span class="p-name">Jason Garber</span>
<img src="https://assets.sixtwothree.org/jgarber.png" class="u-photo" alt="A photo of the author with wild eyes and mouth agape" title="My default avatar!">
</div>
Maybe as…
{
"type": ["h-card"],
"properties": {
"name": ["Jason Garber"],
"photo": [
{
"value": "https://assets.sixtwothree.org/jgarber.png",
"alt": "A photo of the author with wild eyes and mouth agape",
"title": "My default avatar!"
}
]
}
}
☝️ I'm not sure I support my own suggestion in the second bullet point. The title
attribute is global, very generic, and likely used to include all manner of unhelpful text in non-immediately-visible markup.
Whereas the title
attribute on an <iframe>
(or an <abbr>
to use another example) has a stronger coupling between the attribute, its value, and the element.
So I just managed to talk myself out of bullet point two.
@tantek pointed out that #2 is making good progress and we might be able to extend this to parse text alternatives for other elements like
iframe
,audio
,video
,object
, and maybesource
.This issue is specifically for iframe, since providing a text alternative in the
title
attribute is well-documented on MDN.My understanding of the issue would result in this spec update, copied from https://github.com/microformats/microformats2-parsing/issues/2#issuecomment-392608361:
Add a new section with title "parse an
iframe
element forsrc
andtitle
" with the steps:iframe[title]
{}
structure withvalue
: thesrc
attribute of theiframe
as a normalized absolute URL, following the containing document's language's rules for resolving relative URLs (e.g. in HTML, use the current URL context as determined by the page, and first<base>
element, if any).alt
: thetitle
attribute of theiframe
return the
src
attribute as a normalized absolute URL, following the containing document's language's rules for resolving relative URLs (e.g. in HTML, use the current URL context as determined by the page, and first<base>
element, if any).