Description of the problem

A YouTube video added with the core Media module and rendered via oEmbed will produce an outer iframe that includes a title attribute, but renders an inner iframe that does not include the title attribute. This is flagged by some accessibility scanning tools as a violation (aXe; in contrast, Lighthouse does *not* flag it as a problem).

Steps to reproduce

(Tested on 4/21/2021, using Drupal 9.1.6)

1. Enable media and media_library
2. Add a field of type "Media" to a node type, set to allow media of type remote_video.
3. Add a node populating the media field with a YouTube video (https://www.youtube.com/watch?v=iyjtK8jPdjM)
4. View the node. The wrapping iframe contains a title attribute, but the interior iframe does not:

Screenshot of nested iframe without title attribute

The issue does not occur using a Vimeo video (tested with https://vimeo.com/7073899).

Proposed resolution

After retrieving the markup from the oEmbed provider, in Drupal/media/IframeMarkup...
1. Replicate the same markup checking as provided in MarkupTrait::create (cannot be directly called in the class, since it's a trait.
2. Subsequently check the provided iframe for a title attribute. If none is present, try to add the title provided by the oEmbed provider. If none is present, generate a semantically useful title tag that identifies the media provider.

Original post

so, I just updated to 8.7.8, and the fixed 3021452 issue is persisting for me. I see a title is provided for my example youtube video.

VIDEO: https://www.youtube.com/watch?v=6X8f9CLBoB8

EMBED JSON URL: https://www.youtube.com/oembed?format=json&url=https%3A%2F%2Fwww.youtube...

EMBED JSON:

{
    "provider_url": "https://www.youtube.com/",
    "author_name": "The Four on KTVU",
    "height": 270,
    "thumbnail_height": 360,
    "provider_name": "YouTube",
    "author_url": "https://www.youtube.com/channel/UCHTnUyoYpA4txfWEVoY1Ysg",
    "width": 480,
    "version": "1.0",
    "html": "<iframe width=\"480\" height=\"270\" src=\"https://www.youtube.com/embed/6X8f9CLBoB8?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>",
    "thumbnail_width": 480,
    "thumbnail_url": "https://i.ytimg.com/vi/6X8f9CLBoB8/hqdefault.jpg",
    "type": "video",
    "title": "New Sensor Network Reveals Telltale Patterns in Neighborhood Air Quality"
}

GENERATED IFRAME IN RENDERED DRUPAL 8.7.8 PAGE:

<div class="embed-media embed-media--video-youtube">
<iframe src="https://www.youtube.com/embed/6X8f9CLBoB8?feature=oembed" allowfullscreen="allowfullscreen" width=" 480" height="270" frameborder="0"></iframe>
</div>

I've even tried deleting the iframe and re-creating it. No luck. The title just doesn't get appended to an attribute in the <iframe> tag.

My CKEditor Media Embed module is configured to use Provider Url: //noembed.com/embed?url={url}&callback={callback}, which does show an iframe without a title, but does include the title data in the json:

GENERATED IFRAME URL: https://noembed.com/embed?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%...

EMBED JSON:

{
    "html": "\n<iframe width=\" 480\" height=\"270\" src=\"https://www.youtube.com/embed/6X8f9CLBoB8?feature=oembed\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"></iframe>\n",
    "version": "1.0",
    "height": 270,
    "thumbnail_url": "https://i.ytimg.com/vi/6X8f9CLBoB8/hqdefault.jpg",
    "thumbnail_width": 480,
    "title": "New Sensor Network Reveals Telltale Patterns in Neighborhood Air Quality",
    "author_name": "The Four on KTVU",
    "url": "https://www.youtube.com/watch?v=6X8f9CLBoB8",
    "width": 480,
    "provider_name": "YouTube",
    "thumbnail_height": 360,
    "provider_url": "https://www.youtube.com/",
    "type": "video",
    "author_url": "https://www.youtube.com/channel/UCHTnUyoYpA4txfWEVoY1Ysg"
}

If I am missing something about how the 13282573 fix is supposed to work, can someone please walk me through it?

P.S. My Basic HTML editor has the title attribute enabled for iframes, so I doubt its being filtered out (and wouldn't expect it to be anyways):

P.S.S. For what it is worth, I have also tested using iframe.ly as the source and also am not getting a title in that case.

<iframe src align frameborder height width scrolling type title bgcolor allowtransparency>

Issue fork drupal-3085545

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

xeM8VfDh created an issue. See original summary.

xeM8VfDh’s picture

Issue summary: View changes
xeM8VfDh’s picture

Title: title attribute still not added oEmbed iframe » title attribute still not added to oEmbed iframe
xeM8VfDh’s picture

Anyone?

Luke.Leber’s picture

Hi, is the module you're using https://www.drupal.org/project/ckeditor_media_embed?

I'm not too familiar with that one.

xeM8VfDh’s picture

@LukeLeber, yeah, that's the one. Is that not the embed method discussed in 3021452? If not, what approach was fixed in that issue (what method can I use to get the title)? I created 3077809 issue on that module a month ago, no traction so far.

Thanks!

Luke.Leber’s picture

I'm pretty sure that the underlying mechanisms in the core Media system are separate from the contributed module's, so fixing one wouldn't have fixed the other.

Your CKEditor config should be able to natively support the core media embed system when Drupal 8.8 lands in December. Until then you may have better luck contacting the contributed module maintainer.

xeM8VfDh’s picture

Hey @Luke.Leber, I did contact the module maintained and opened an issue for this here: https://www.drupal.org/project/ckeditor_media_embed/issues/3077809

My question to you is... say I disable this CKEditor Media Embed module... how can I then used the core functionality that was "fixed" in 3021452? Like, is there some WYSIWYG button to do the embed? If not, how do I create the embed with the core media system component discussed in 3021452

P.S. this comment on the other issue suggests that the fix from the other issue should be available now in 8.7.8 thanks to back porting.

Luke.Leber’s picture

Good morning, the fix targeted in 3021452 pertains to media set up through a field formatter on media entity reference fields. I believe that in 8.8 and later, the same code will work with the core provided WYSIWYG button for embedded media.

Others will know better than me, but I think that it should be as easy as adding the new button to CKEditor, removing the one provided by the contributed module, and resaving content when 8.8 lands.

xeM8VfDh’s picture

Wow, that would be awesome. I guess I will wait until 8.8, test your theory, and then assess from there. Thanks for the info @Luke.Leber

xeM8VfDh’s picture

Issue summary: View changes

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.9 was released on November 6 and is the final full bugfix release for the Drupal 8.7.x series. Drupal 8.7.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.8.0 on December 4, 2019. (Drupal 8.8.0-beta1 is available for testing.)

Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

xeM8VfDh’s picture

FileSize
383 bytes

This issue is not resolved.

I am running Drupal 8.8.0. I originally had CKEditor Media Embed module enabled. I tested that out by creating a new page and pasting a YouTube url into the page body. The Embed module did it's thing and embedded the video automatically. I saved the page then inspected the source on the youtube video's iframe... no title.

So, I did as @Luke.Leber suggested in #9; I disabled CKEditor Media Embed module. Now my Editor only shows two buttons, the core Drupal Image button, and the "Insert Images using IMCE File Manager" image button.

CORE DRUPAL IMAGE BUTTON
This shows a popup (see attached core_button_popup.png) with a URL field that has a supplemental option to "open file browser". Instead of opening the file browser, I paste my YouTube url into the URL field. I add some alt text, then I save the settings. When I'm returned to the page body in the edit screen, I see a broken image icon (see attached error.png). I saved the page just for good measure, and nothing displays where the video should be embedded. This doesn't work.

IMCE IMAGE BUTTON
This just opens the IMCE File Browser, the same thing that would happen had I clicked "Open file browser" in the Drupal core image button's popup, explained above. There is no option here to enter a URL.

@Luke.Leber, (or anyone else who has this working) please walk me through how you are embedding your video url, step by step, in precise details please.

xeM8VfDh’s picture

FileSize
21.3 KB
pookmish’s picture

I can confirm the oEmbed iframe is indeed not receiving the title attribute. The outer iFrame does receive this though. This is using a clean Drupal 8.8.0 release with video media type. What is produced is:

<iframe src="/media/oembed?url=[your-url-here]&amp;max_width=0&amp;max_height=0&amp;hash=[hash]" frameborder="0" allowtransparency="" width="480" height="270" class="media-oembed-content" title="[Youtube Video Title]">
....

<iframe width="480" height="270" src="[youtubeUrl]?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>
....
</iframe>

The reason for this is that youtube's API doesn't add the "title" attribute into the oEmbed response. The data is gathered and just passed through to the rendering.
https://api.drupal.org/api/drupal/core%21modules%21media%21src%21OEmbed%...

A quick google search for "Google oEmbed title attribute" will result in a large amount of results of people having the same issues.

xeM8VfDh’s picture

@pookmish, thanks for confirming.

I think I am maybe talking about a different process than you are. You mention "video media type", by which I presume you mean this. I am simply wondering about embedding videos into a standard page, or on the test field of some other Content Type. We've historically used the CKEditor Media Embed Plugin to handle this process, and it has worked well for that purpose. But, it doesn't pull in the title attribute.

My understanding was that 3021452 somehow fixed this issues so that we could embed videos into the body field of a page, or some text field of a given Content Type somehow via core functionality, in a way that would include the title attribute for accessibility purposes. Am I misunderstanding this--does the issue in question only address Media Types, and not page/text embeds?

pookmish’s picture

The issue you have referenced is about the oEmbed field formatter. It doesn't really matter if its in a media type or elsewhere.

I can't speak to anything integrating with CKEditor Media Embed Plugin since I have never used that. If you have a particular issue with that module, it's best to report an issue on that module's page. but the issue you have reported is relevant to the oEmbed field formatter still.

xeM8VfDh’s picture

@pookmish, have you ever embedded a video (like a youtube video) into a simple page using core functionality. If so, how (what exact steps), and does it exhibit the same problematic bevaior you reported?

pookmish’s picture

Yes I am currently using core's functionality to embed all media types and display media as fields. It does display the same behavior because an embed media is just a rendered media entity so it still uses the oEmbed field formatter to display the iframe contents. The output of the video is identical for a field using oEmbed formatter as it is in the CkEditor (since the media uses the same formatter).

The easiest way to try that functionality is to install "Standard" profile, enable the media and media library modules and configure the text formats to allow embedded media (also add the media library button to the toolbars). Doing this will produce the code snippet I provided in comment #15

xeM8VfDh’s picture

@pookmish, you said "It doesn't really matter if its in a media type or elsewhere"

This implies that you can create a new page and embed a video in the page's body field. Is that not what you meant?

If that IS what you meant, how exactly do you do this? The example you gave in #19 doesn't concern embedding a video in a plain text field, like a page body or a Content Type text field. You again referred to the Media Type approach.

To be absolutely clear, here's an example. I want to create a page that has a paragraph of text, then an embedded YouTube video. This is an incredibly simple and common use case. Now, I create a new page, I type up a paragraph of text... but then how do I embed the YouTube video using the core functionality referenced here? I don't know how to do that with core functionality, I only know how to do it by using CKEditor Media Embed, or editing the source and copy/pasting the embed iframe code from the YouTube video manually. What am I missing?

pookmish’s picture

Your referenced issue is about the oEmbed field formatter provided by the media module and only works on media entities. The oEmbed field formatter takes a text field and renders out an iframe with the youtube video iframe nested inside. This is what happens when a media entity is embed in a Ckeditor or when the media entity is displayed by itself outside of the ckeditor.

The "Remote video" media type provided by Drupal core "standard" profile contains a text field where a user creates media entities by entering the url into a text field. This text field is then rendered out using the oEmbed field formatter to produce the iframes of the desired video. That field is then reused when embedding the media entity via CKEditor or an entity reference field.

If you do not have the media module enabled at all or are altering the embed code directly as HTML, your issue sounds to be unrelated to https://www.drupal.org/project/drupal/issues/3021452

If you are new to media library provided by Drupal core, I strongly suggest you review its functionality in the UI. A short demo from Dries is on youtube https://youtu.be/UoT2oava9ns

xeM8VfDh’s picture

FileSize
44.98 KB
51.72 KB

We are talking past each other completely, but your last comment gave me a hint. the core Media module must be enabled. Okay, great, I've just done that! I now see an "Embed" option on my Basic HTML editor (Configuration >> Content Authoring >> Text Formats and Editors). I've checked that box and it has this vague bit of instruction that I can't understand:

Embeds media items using a custom tag, . If used in conjunction with the 'Align/Caption' filters, make sure this filter is configured to run after them.

I have attached screen shots of my default embed configuration (config-tags.png), and my HTML Tags filter configuration, which allows the required <drupal-media data-entity-type data-entity-uuid> tag config (config-embed.png ).

Great, this all sounds well and dandy. It sounds like a replacement for CKEditor Media Embed. It sounds like I've just configured my Basic HTML editor to be able to embed videos, among other things, in basic pages.

But alas, I still cant figure out how to use the damn thing. I've saved all of the config above. I am creating a new page. I tried pasting the youtube link into the body and saving. There is no embed, it just shows my YouTube link as a plaintext url. I edit the page and try to change it to a proper link. Save the page and still no embed. I edit the page and go to the Source view and input <drupal-media>https://www.youtube.com/watch?v=6v4E6oksar0</drupal-media>, save the page and still no embed.

I feel like I'm going insane. How does this work? How do I simply embed a youtube video into a core page using core Media module functionality?? I must be very stupid because I need some kind and caring person to hold my hand and tell me how to achieve this simple task, step by step.

pookmish’s picture

I fear we are getting off topic of the reported issue. I've created a short youtube video that shows the setup using "Standard" profile. At the end you will see the nested Iframe doesn't contain a "title" attribute

https://youtu.be/O_cyEOWsf_s

xeM8VfDh’s picture

@pookmish, THANK YOU!!!

Sorry for being an idiot. You're video clarified this process very well and I was able to duplicate the same exact results as you.

I was also unaware that this mechanism created an iframe within an iframe, so I wasn't originally looking at the correct parent iframe. But after following your exact steps, using the exact same YoutTube video, I do see the title="Drupal 8 media library preview" attribute on the main parent iframe, though no title on the nested iframe that contains the actual youtube video, exactly as your video demonstrates.

Seriously, thank you very much for taking the time to create that video and help a confused stranger, I really appreciate it!

Luke.Leber’s picture

On the topic of the nested iframe lacking a title attribute, see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/titl....

An accessibility expert may need to chime in, to confirm, but I would expect that title attribute inheritance should apply here.

Did a user experience an accessibility issue here or is the concern stemming from an automated checker tool?

xeM8VfDh’s picture

The concern is stemming partially from the fact that I wasn't even aware that there were two nested iframes, and I was only looking at the child iframe and concluding that no title attribute was being added. For what it is worth, the nested iframe implementation with a title on the parent frame does not trigger an accessibility issue in SiteImprove--before this fix SI was triggering warnings for iframes without titles. So maybe this is a non-issue, but you're right @Luke.Leber, an accessibility expert might need to chime in to confirm.

xeM8VfDh’s picture

Status: Active » Closed (works as designed)

Title attribute inheritance

If an element has no title attribute, then it inherits it from its parent node, which in turn may inherit it from its parent, and so on.

If this attribute is set to the empty string, it means its ancestors' titles are irrelevant and shouldn't be used in the tooltip for this element.

source

Since this appears to be working on further inspection, it is passing QA through accessibility tools like SiteImprove, and it seems to clearly fall into the HTML title inheritance behavior quoted above, I think this issue can be closed.

@pookmish (or anyone else) if you want me to reopen this or think it is still a problem, just let me know.

xeM8VfDh’s picture

Status: Closed (works as designed) » Active

Wellll, its a minor issue, but it looks like the /media/oembed?url=* pages that are created by this Media (Library) mechanism are inaccessible, as they do not contain the nested iframes, but just the child iframe that contains no title.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

CarlyGerard’s picture

FileSize
1.03 MB

@xeM8VfDh I'm seeing this just now in our Drupal profile. From an accessibility standpoint, particular for someone using a screen reader, hearing an empty frame or a double frame announced might be confusing as far as what the content is and how to interact with it.

If the title inheritance is supposed to work as the MDN docs stated, then it seems logical the second <iframe> should inherit an accessible name from the parent iframe. But, with VoiceOver/Safari and VoiceOver Chrome on macOS, the second frame announces as "frame, 0," due to not having a coded <title> attribute:

VoiceOver rotor showing frames list, one named and one not

In NVDA/Firefox and Chrome/Windows 10, it announces as "[title of media], frame frame." That will get treated as one grouping at least (rather than two iframes), but it would be repetitive to hear "frame frame" each time there's a video embed. I haven't yet had the chance to test with JAWS.

If reducing the double iframe can be explored, that would be ideal since it gets rid of the redundancy and ensure there's an accessible title on the right iframe. If that can't happen, then the secondary frame should have some kind of name. How to make that solution not redundant would need to be explored though--hearing "frame [title of frame]" twice would also become redundant.

phenaproxima’s picture

Issue tags: +oembed
phenaproxima’s picture

Status: Active » Needs work
Issue tags: +Needs steps to reproduce

I think that what would help sort out this issue is steps to reproduce, added to the issue summary, and starting from a clean installation of Drupal. That would help us triage this issue and take whatever action is needed.

xeM8VfDh’s picture

thanks for the info @CarlyGerard!

phenaproxima’s picture

mark_fullmer’s picture

Issue summary: View changes
FileSize
144.83 KB
mark_fullmer’s picture

I've updated the issue description to include steps to reproduce, and removed the "Needs steps to reproduce" issue tag.

mark_fullmer’s picture

Version: 8.9.x-dev » 9.1.x-dev
mark_fullmer’s picture

Version: 9.1.x-dev » 9.2.x-dev

mark_fullmer’s picture

Issue summary: View changes
Status: Needs work » Needs review
mgifford’s picture

xeM8VfDh’s picture

sounds right to me @mgifford. Whatever the case, we need to follow accessibility guidelines. Beyond that, I've never heard a reasonable explanation of why we need to embed an iframe in another iframe...

mark_fullmer’s picture

Beyond that, I've never heard a reasonable explanation of why we need to embed an iframe in another iframe...

A change notice that explains the ability to modify the outer iframe, https://www.drupal.org/node/3169717, alludes to the fact that this is done for security reasons.

It is also alluded to in an inline comment in the OembedIframeController:

// Even though the resource HTML is untrusted, IFrameMarkup::create()
// will create a trusted string. The only reason this is okay is
// because we are serving it in an iframe, which will mitigate the
// potential dangers of displaying third-party markup.

I infer that this effectively sandboxes the inner iframe so that it cannot display forms, trigger alerts/pop-ups, and run plugins from the site DOM, similar to the goal of the iframe sandbox attribute.

I'm not sure if that amounts to a reasonable explanation or not... :)

mark_fullmer’s picture

Barring an immediate solution in core, sites can add the title value to the inner iframe via preprocessing:

function mymodule_preprocess_media_oembed_iframe(array &$variables) {
  /** @var \Drupal\media\OEmbed\Resource $resource */
  $resource = $variables['resource'];
  $media = $variables['media'];
  $html_dom = Html::load($media);
  $iframes = $html_dom->getElementsByTagName('iframe');
  foreach ($iframes as $iframe) {
    if (!$iframe->hasAttribute('title')) {
      $title = $resource->getTitle() ?? "Embedded content from " . $resource->getProvider()->getName();
      $iframe->setAttribute('title', $title);
    }
  }
  $variables['media'] = Html::serialize($html_dom);
}

(Remember to use Drupal\Component\Utility\Html;!)

This will load the inner iframe into a DomDocument type object format, then check the iframe for the presence of a title tag. If not present, it will insert one, using the provider's title attribute, if available, and the provider name as a fallback.

I co-maintain https://www.drupal.org/project/iframe_title_filter , so I'll raise the question of adding this preprocess logic to that module, as it does seem to be in the purview of that module.

xeM8VfDh’s picture

@mark_fulmer, thanks for the info. It still seems janky to me. I don't know of any other project double iframeing for security purposes. Maybe I am not in the loop, and I'm happy to admit I could be wrong here, but it seems like a hackish solution. If the strategy is meant to simulate the "sandbox" attribute, then why not just use the sandbox attribute? Better yet, just let the site maintainer/admin check a box to enable/disable that attribute. Ultimately, genuine security issues with iframes should be elevated to browser developers and/or the WC3 standard group--if the double iframe is a temporary work around, okay, better than nothing, but genuine security vulnerabilities should be addressed by the appropriate parties, and we should use their implemented solutions (like the sandbox attribute). These comments aren't meant to be directed at you specifically @mark_fulmer, just thought it was a discussion worth surfacing here.

Luke.Leber’s picture

The point of the "double iframe" is that while most providers do return an iframe as part of the oembed response, the spec allows for arbitrary HTML, CSS, and JS to be returned from a third party provider (youtube, vimeo, etc...). The arbitrary JS part is where the concern comes from.

Surfacing such content on separate domain (the outer iframe, ie "no-admin-session-cookies.mysite.com") can effectively prevent common admin session takeover tactics if configured correctly.

Drupal is one of the few oembed implementations that actually implement it the way that the oembed specification suggests.

I had thought that it was determined that the inner iframe would inherit the outer iframe's title via Title Inheritance (https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/titl...).

phenaproxima’s picture

The point of the "double iframe" is that while most providers do return an iframe as part of the oembed response, the spec allows for arbitrary HTML, CSS, and JS to be returned from a third party provider (youtube, vimeo, etc...). The arbitrary JS part is where the concern comes from.

Maybe this has already been covered, and forgive me if I'm misunderstanding the discussion, but I know of nothing in core that is actively double-iframing anything. Whatever an oEmbed provider returns is considered untrusted and therefore sandboxed in a single iframe. And, as far as I know, that's where it ends for core. If the provider returned markup that includes an iframe, core has no opinion about that and won't try to modify it in any way. Since core absolutely cannot rely on, or even reliably predict what an oEmbed provider will return, I personally think that's the right move.

I agree with @mark_fullmer that further processing should be done by a custom preprocess function, or a contrib module to deal with more advanced modifications to whatever the oEmbed provider returns. I'm not sure core should have an opinion about this. Therefore, my inclination is to close this issue as a wontfix. I won't do that yet, since I'm open to being convinced otherwise, but it sounds to me like this is a provider-specific quirk that core should not address directly.

Luke.Leber’s picture

I think it's a fair assumption that YouTube may have been the provider in question for the original issue creator. While the core isn't double-iframing stuff directly, the end result is indeed confusing on the surface when one doesn't have first hand knowledge of where Drupal markup ends and where Provider markup begins.

I think that adding the title is something that YouTube should be doing. I agree that Drupal (certainly not the core) shouldn't be the one to fix a YouTube service a11y problem.

Perhaps more importantly, can an a11y maintainer check if there's an actual problem affecting users here, if it's just a false positive due to automated tools messing up on title inheritance, or if something else is amiss?

phenaproxima’s picture

Perhaps more importantly, can an a11y maintainer check if there's an actual problem affecting users here, if it's just a false positive due to automated tools messing up on title inheritance, or if something else is amiss?

Agreed. Tagging for accessibility review.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

xeM8VfDh’s picture

Version: 9.3.x-dev » 9.2.x-dev

agreed. If YouTube is the source of the problem, let it be. I was just under the impression that a title was lacking on some Drupal HTML where a title was due. Thanks all.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

mgifford’s picture

Would be great to support authors to do this by default https://accessibilitycluster.com/main-results/video

xeM8VfDh’s picture

good idea @mgifford!

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

tedfordgif’s picture

We could apply a similar fix to what wordpress did:
https://core.trac.wordpress.org/ticket/40245
https://core.trac.wordpress.org/changeset/44942

The gist is that we can safely add a title attribute if the given conditions are met:

  • the oembed metadata includes a "title" property,
  • is a "rich" or "video" embed,
  • includes an iframe tag,
  • but the iframe tag doesn't have a title attribute

The title metadata/property can get added as the title attribute. This leaves two unresolved issues:

  • The video title is not always the most accessible title for the iframe
    This could possibly be addressed by prefixing the title e.g. with "Video Embed: {title}", but then maybe we have to worry about translating that.
  • Performance -- do we want to go the wordpress way of regexes, or is it better to use a parser? Note that the oembed markup gets cached, so this isn't a huge issue, and correctness is probably the best approach.
smustgrave’s picture

Status: Needs review » Active

Moving this down to active because it sounds like there is still more discussion to be had.

Luke.Leber’s picture

Perhaps the Drupal community as a whole should chime in on https://groups.google.com/g/accessible/c/d-5z87lOWeY/m/MW1zLZiOCAAJ and push the vendor to fix the issue globally on every single YouTube oembed implementation in the world -- far beyond the scope of Drupal.

Fundamentally, this is Google's problem to fix. Drupal can provide a hackaround for it, but the real problem is much deeper, affecting so much more of the internet than is powered by Drupal.

smustgrave’s picture

Status: Active » Postponed

Marking as postponed until google fixes it on their end.

Luke.Leber’s picture

Interestingly enough, https://www.youtube.com/oembed?url=http%3A//youtube.com/watch%3Fv%3DM3r2... DOES seem to add a title attribute.

Perhaps Google rolled out the feature, but it's not applied to every video? Or perhaps it's something that content creators need to opt into?

--

Just to clarify my opposition to attempting to address this in core. We cannot possibly be expected to fix all a11y issues injected into pages by third parties. While it's pretty obvious that YouTube is the most popular target to pick on here, there are probably thousands of other issues slipping through from any of the other providers.

Opening the door here puts us on a slippery and somewhat fragile slope. The oEmbed technology makes it really clear that the markup returned by the third party is arbitrary. For a concrete example, it's a mistake to assume that YouTube will always send back an iframe in its response.

This really sounds like a problem to solve in contrib to me. - or perhaps it can be addressed more responsibly by simply boycotting vendors that do not prioritize accessibility.

--

Update: I just checked a couple other videos -- looks like the title attribute is present in the YouTube response! Is this even an issue anymore?!

mark_fullmer’s picture

just checked a couple other videos -- looks like the title attribute is present in the YouTube response! Is this even an issue anymore?!

I can corrobrate that the title attribute is also present on a video that was previously used to demonstrate its absence. There's a related issue in the contrib module iframe_title_filter where I note this. I haven't been able to find documentation that YouTube/Google fixed this, though.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.