Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#38556 closed enhancement (fixed)

Twenty Seventeen: supportsInlineSVG is unnecessarily called twice

Reported by: tywayne's profile tywayne Owned by: davidakennedy's profile 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 8 years ago.

Download all attachments as: .zip

Change History (4)

@tywayne
8 years ago

#1 @tywayne
8 years ago

  • Keywords has-patch added

#2 @davidakennedy
8 years ago

  • Milestone changed from Awaiting Review to 4.7

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