microformats / microformats2-parsing

For collecting and handling issues with the microformats2 parsing specification: http://microformats.org/wiki/microformats2-parsing
14 stars 6 forks source link

parse iframe[title] as structure #42

Open gRegorLove opened 6 years ago

gRegorLove commented 6 years ago

@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 maybe source.

This issue is specifically for iframe, since providing a text alternative in the title attribute is well-documented on MDN.

my meta point is that regardless of which of those HTML methods you used, if you put a u-photo (or u-featured etc.) on them, and get a URL as a "value", then ideally you would get the text alternative in the "alt", regardless of how each of those specific elements says to markup the text alternative. we seemingly have this figured out for img[alt] and iframe[title], but not the others -- @tantek, https://chat.indieweb.org/microformats/2018-09-18#t1537233694363900

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 for src and title" with the steps:

jgarber623 commented 4 years ago

A few quick questions on this one:

  1. Are there in-the-wild examples of anyone marking up an <iframe> with a root or property class name and a title attribute?
  2. If we add this 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!"
      }
    ]
  }
}
jgarber623 commented 4 years ago

☝️ 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.