Make WordPress Core

Opened 12 months ago

Closed 12 months ago

Last modified 6 months ago

#63471 closed defect (bug) (fixed)

Remove IE Compat scripts from Media element scripting

Reported by: joedolson's profile joedolson Owned by: desrosj's profile desrosj
Milestone: 6.9 Priority: normal
Severity: normal Version: 3.6
Component: Media Keywords: good-first-bug has-patch
Focuses: Cc:

Description

WordPress injects scripts to create elements if the user is on IE less than 9 in wp_playlist_scripts(), wp_audio_shortcode(), and wp_video_shortcode().

It's time to remove these.

See #24902.

Change History (9)

This ticket was mentioned in PR #8825 on WordPress/wordpress-develop by @aslamdoctor.


12 months ago
#1

  • Keywords has-patch added

#2 @aslamdoctor
12 months ago

It is done now and PR has been created.

@mindctrl commented on PR #8825:


12 months ago
#3

The phpunit tests need to be updated to stop looking for the conditional IE addition. For example: https://github.com/WordPress/wordpress-develop/blob/8c011572459ef6353182f444f86adf244833f902/tests/phpunit/tests/media.php#L1002

@aslamdoctor commented on PR #8825:


12 months ago
#4

Thanks @mindctrl
It is done now 🙂

#5 @nigelnelles
12 months ago

We reproduced the error by adding a shortcode block to the site with the following code:

[video src="https://example.com/video.mp4" poster="https://example.com/poster.jpg" width="800" height="450" autoplay="true"]

With this shortcode on the site, the elements tab in the devtools shows:

<!--[if lt IE 9]><script>document.createElement('video');</script><![endif]-->

When doing the same thing on the playground generated from the PR, this comment is not present which is the goal of the PR

Version 0, edited 12 months ago by nigelnelles (next)

This ticket was mentioned in Slack in #core-test by nigelnelles. View the logs.


12 months ago

#7 @desrosj
12 months ago

  • Milestone changed from Awaiting Review to 6.9
  • Owner set to desrosj
  • Status changed from new to reviewing

#8 @desrosj
12 months ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 60285:

Media: Remove inline scripts targeting IE < 9.

In #24902, an inline script was introduced to wp_playlist_scripts(), wp_audio_shortcode(), and wp_video_shortcode() for HTML5 compatibility in browsers running IE 8 and earlier.

These browsers have long been unsupported by WordPress, and unsupported by Microsoft for 9 years or more. So this compatibility code is no longer necessary and can safely be removed.

Hit the road, Jack, and don't ya come back no more, no more, no more, no more!

Props aslamdoctor, mindctrl, nigelnelles, joedolson.
Fixes #63471.

@SergeyBiryukov commented on PR #8825:


6 months ago
#9

Thanks for the PR! This was merged in r60285.

Note: See TracTickets for help on using tickets.