Make WordPress Core

Opened 5 weeks ago

Closed 3 weeks 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 (8)

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


5 weeks ago
#1

  • Keywords has-patch added

#2 @aslamdoctor
5 weeks ago

It is done now and PR has been created.

@mindctrl commented on PR #8825:


5 weeks 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:


5 weeks ago
#4

Thanks @mindctrl
It is done now 🙂

#5 @nigelnelles
3 weeks ago

Test Report

Description

This report validates whether the indicated patch works as expected.

Patch tested: https://github.com/WordPress/wordpress-develop/pull/8825.diff

Environment

  • WordPress: 6.9-alpha-20250522.140828
  • PHP: 7.4.31-dev
  • Server: PHP.wasm
  • Database: WP_SQLite_Driver (Server: 5.5 / Client: 3.40.1)
  • Browser: Chrome 137.0.0.0
  • OS: Windows 10/11
  • Theme: Twenty Twenty-Five 1.2
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Actual Results

  1. ✅ Issue resolved with patch.

Additional Notes

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

Supplemental Artifacts

Add Inline: No image "REPLACE_WITH_IMAGE_URL" attached to Ticket #63471
or
Add as Attachment

Last edited 3 weeks ago by nigelnelles (previous) (diff)

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


3 weeks ago

#7 @desrosj
3 weeks ago

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

#8 @desrosj
3 weeks 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.

Note: See TracTickets for help on using tickets.