Make WordPress Core

Opened 16 months ago

Closed 16 months ago

Last modified 10 months ago

#63471 closed defect (bug) (fixed)

Remove IE Compat scripts from Media element scripting

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

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.


16 months ago
#1

  • Keywords has-patch added

#2 @aslamdoctor
16 months ago

It is done now and PR has been created.

​@mindctrl commented on ​PR #8825:


16 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:


16 months ago
#4

Thanks @mindctrl
It is done now 🙂

#5 @nigelnelles
16 months 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 16 months ago by nigelnelles (previous) (diff)

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


16 months ago

#7 @desrosj
16 months ago

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

#8 @desrosj
16 months ago

  • Resolution → fixed
  • Status reviewing → 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:


10 months ago
#9

Thanks for the PR! This was merged in r60285.

Note: See TracTickets for help on using tickets.