WordPress.org

Make WordPress Core

Opened 7 months ago

Closed 7 weeks ago

#49126 closed defect (bug) (fixed)

Update needed in wp-admin/includes/template.php

Reported by: hommealone Owned by: SergeyBiryukov
Milestone: 5.5 Priority: normal
Severity: normal Version: 5.3.2
Component: Administration Keywords: has-patch
Focuses: css, administration, coding-standards Cc:

Description

I think an update is needed to the function

_wp_admin_html_begin()

in the file wp-admin/includes/template.php beginning at line 2425.

The output of this function can be seen in the source code of any page in the WordPress admin area, right at the top.

I noticed first that the code contains this:

Wrong:

<html xmlns="http://www.w3.org/1999/xhtml"

Should be:

<html xmlns="https://www.w3.org/1999/xhtml"

But more importantly, perhaps, https://wordpress.org/support/users/joyously/|@joyously notes:

Looking at the URL, even though it redirects to https, it refers to http in its content. The other documents do also, when referencing the xmlns. And, having an XML namespace on a HTML5 document doesn’t even make sense. It should probably be removed entirely, just as the conditional for IE8 should be removed since the browser support is for a minimum of IE11 for quite awhile now.

(See: https://wordpress.org/support/topic/error-in-wp-admin-includes-template-php/ )

Attachments (3)

49126.diff (1.1 KB) - added by diddledan 7 months ago.
Remove IE8 conditional and xmlns="" attribute in _wp_admin_html_begin()
49126.2.diff (6.0 KB) - added by diddledan 7 months ago.
remove all instances of [if IE 8] fallbacks and xmlns attributes on all <html> tags
49126.3.diff (16.2 KB) - added by audrasjb 4 months ago.
Remove all unnecessary ie8 CSS fixes

Download all attachments as: .zip

Change History (17)

@diddledan
7 months ago

Remove IE8 conditional and xmlns="" attribute in _wp_admin_html_begin()

#1 @SergeyBiryukov
7 months ago

  • Component changed from General to Administration
  • Milestone changed from Awaiting Review to 5.4
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#2 follow-up: @mukesh27
7 months ago

  • Keywords has-patch dev-feedback added

It seems many core files used "http://www.w3.org/1999/xhtml" IE8 code so do we need to remove that code also?

@SergeyBiryukov what is your thought?

#3 in reply to: ↑ 2 @SergeyBiryukov
7 months ago

Replying to mukesh27:

It seems many core files used "http://www.w3.org/1999/xhtml" IE8 code so do we need to remove that code also?

Yes, it would make sense to me to remove that consistently, not just in one place.

#4 @mukesh27
7 months ago

  • Keywords needs-refresh added

@diddledan Can you please remove code from the other files?

@diddledan
7 months ago

remove all instances of [if IE 8] fallbacks and xmlns attributes on all <html> tags

#5 @mukesh27
7 months ago

  • Keywords needs-refresh removed

@diddledan Thanks for the update.

Remove needs-refresh keywords.

#8 @valentinbora
6 months ago

  • Keywords commit added; dev-feedback removed

I think this is ready to go.

This ticket was mentioned in Slack in #core by valentinbora. View the logs.


6 months ago

#10 @peterwilsoncc
6 months ago

  • Keywords needs-refresh added; commit removed
  • Milestone changed from 5.4 to 5.5

A quick search of the folders ./src/wp-admin/css,./src/wp-includes/css for .ie8 shows 43 results in 19 files. I excluded *.min.css,*-rtl.css to try an avoid auto-generated files but there may be some false positives.

Given the latest patch is removing the reference rather than switching to https, I think this could wait until the next release and the IE8 fallbacks can be removed from both the HTML and CSS.

I've removed the commit keyword and added needs-refresh to account for the CSS fallbacks too.

@audrasjb
4 months ago

Remove all unnecessary ie8 CSS fixes

#11 @audrasjb
4 months ago

  • Keywords needs-refresh removed

Hi,

49126.3.diff also removes all unnecessary old IEs CSS rules.

#12 @audrasjb
4 months ago

  • Focuses css added

#13 @SergeyBiryukov
7 weeks ago

Just noting the IE 8 references are already removed in [47771].

#14 @SergeyBiryukov
7 weeks ago

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

In 48126:

Administration: Remove the xmlns attribute on the <html> tag.

The attribute is specific to XHTML and is not needed in HTML5.

Props audrasjb, diddledan, hommealone, joyously, mukesh27, valentinbora, peterwilsoncc, SergeyBiryukov.
Fixes #49126.

Note: See TracTickets for help on using tickets.