[wp-trac] [WordPress Trac] #38556: Twenty Seventeen: supportsInlineSVG is unnecessarily called twice
WordPress Trac
noreply at wordpress.org
Fri Oct 28 21:45:36 UTC 2016
#38556: Twenty Seventeen: supportsInlineSVG is unnecessarily called twice
---------------------------+-----------------------------
Reporter: tywayne | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Bundled Theme | Version: trunk
Severity: normal | Keywords:
Focuses: |
---------------------------+-----------------------------
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.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38556>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list