Make WordPress Core

Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#49126 closed defect (bug) (fixed)

Remove the xmlns attribute on the <html> tag

Reported by: hommealone's profile hommealone Owned by: sergeybiryukov's profile 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 diddledani 5 years ago.
Remove IE8 conditional and xmlns="" attribute in _wp_admin_html_begin()
49126.2.diff (6.0 KB) - added by diddledani 5 years 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 years ago.
Remove all unnecessary ie8 CSS fixes

Download all attachments as: .zip

Change History (19)

@diddledani
5 years ago

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

#1 @SergeyBiryukov
5 years 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
5 years 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
5 years 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
5 years ago

  • Keywords needs-refresh added

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

@diddledani
5 years ago

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

#5 @mukesh27
5 years ago

  • Keywords needs-refresh removed

@diddledan Thanks for the update.

Remove needs-refresh keywords.

#8 @valentinbora
5 years 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.


5 years ago

#10 @peterwilsoncc
5 years 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 years ago

Remove all unnecessary ie8 CSS fixes

#11 @audrasjb
4 years ago

  • Keywords needs-refresh removed

Hi,

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

#12 @audrasjb
4 years ago

  • Focuses css added

#13 @SergeyBiryukov
4 years ago

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

#14 @SergeyBiryukov
4 years 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.

#15 @SergeyBiryukov
4 years ago

#25863 was marked as a duplicate.

#16 @SergeyBiryukov
4 years ago

  • Summary changed from Update needed in wp-admin/includes/template.php to Remove the xmlns attribute on the <html> tag
Note: See TracTickets for help on using tickets.