WordPress.org

Make WordPress Core

Opened 5 months ago

Closed 5 months ago

Last modified 5 months ago

#47455 closed defect (bug) (duplicate)

Duplicate attributes 'width' and 'height' in class-twentynineteen-svg-icons.php

Reported by: albertomake Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords:
Focuses: Cc:
PR Number:

Description

Hi, in the latest version of the Twenty Nineteen I just found some svgs with 'width' and 'height' values in class-twentynineteen-svg-icons.php

		'keyboard_arrow_left'      => /* material-design – keyboard_arrow_left */ '
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
	<path d="M14 7l-5 5 5 5V7z"></path>
	<path fill="none" d="M24 0v24H0V0h24z"></path>
</svg>',

		'arrow_drop_down_ellipsis' => /* custom – arrow_drop_down_ellipsis */ '
<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg">
    <g fill="none" fill-rule="evenodd">
        <path d="M0 0h24v24H0z"/>
        <path fill="currentColor" fill-rule="nonzero" d="M12 2c5.52 0 10 4.48 10 10s-4.48 10-10 10S2 17.52 2 12 6.48 2 12 2zM6 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm6 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm6 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"/>
    </g>
</svg>

There is no need to have width and height attributes as the 'public static function get_svg' is adding the width and height. This generate a Duplicate error. Use validator.w3.org for more details. I would propose to remove those attributes from the svg tag:

		'keyboard_arrow_left'      => /* material-design – keyboard_arrow_left */ '
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
	<path d="M14 7l-5 5 5 5V7z"></path>
	<path fill="none" d="M24 0v24H0V0h24z"></path>
</svg>',

		'arrow_drop_down_ellipsis' => /* custom – arrow_drop_down_ellipsis */ '
<svg xmlns="http://www.w3.org/2000/svg">
    <g fill="none" fill-rule="evenodd">
        <path d="M0 0h24v24H0z"/>
        <path fill="currentColor" fill-rule="nonzero" d="M12 2c5.52 0 10 4.48 10 10s-4.48 10-10 10S2 17.52 2 12 6.48 2 12 2zM6 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm6 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm6 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"/>
    </g>
</svg>

Change History (3)

#1 @mukesh27
5 months ago

  • Component changed from Themes to Bundled Theme
  • Focuses template coding-standards removed
  • Keywords needs-patch removed
  • Resolution set to duplicate
  • Status changed from new to closed
  • Version 5.2.1 deleted

Thanks for reporting this, @albertomake! It seems this was reported already in #47128. I am going to close this one.

Feel free to reopen if you think issue is different then that.

#2 @albertomake
5 months ago

Same error. Thanks for your answer.

#3 @desrosj
5 months ago

  • Milestone Awaiting Review deleted

Duplicate of #47128.

Note: See TracTickets for help on using tickets.