WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#38556 closed enhancement (fixed)

Twenty Seventeen: supportsInlineSVG is unnecessarily called twice

Reported by: tywayne Owned by: davidakennedy
Milestone: 4.7 Priority: normal
Severity: normal Version: 4.7
Component: Bundled Theme Keywords: has-patch
Focuses: Cc:

Description

In /assets/js/global.js we set a class based on SVG support using supportsInlineSVG like so:

supportsInlineSVG();
if ( true === supportsInlineSVG() ) {
	document.documentElement.className = document.documentElement.className.replace( /(\s*)no-svg(\s*)/, '$1svg$2' );
}

There is no need to call supportsInlineSVG, and then immediately call it again in the logic check.

Attachments (1)

38556.diff (532 bytes) - added by tywayne 5 years ago.

Download all attachments as: .zip

Change History (4)

@tywayne
5 years ago

#1 @tywayne
5 years ago

  • Keywords has-patch added

#2 @davidakennedy
5 years ago

  • Milestone changed from Awaiting Review to 4.7

#3 @davidakennedy
5 years ago

  • Owner set to davidakennedy
  • Resolution set to fixed
  • Status changed from new to closed

In 39081:

Twenty Seventeen: Fix supportsInlineSVG() being unnecessarily called twice

  • Also, fix spacing inconsistency in comment.

Props tywayne.

Fixes #38556.

Note: See TracTickets for help on using tickets.