WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 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:
PR Number:

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 3 years ago.

Download all attachments as: .zip

Change History (4)

@tywayne
3 years ago

#1 @tywayne
3 years ago

  • Keywords has-patch added

#2 @davidakennedy
3 years ago

  • Milestone changed from Awaiting Review to 4.7

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