Make WordPress Core

Opened 5 months ago

Closed 7 weeks ago

#60499 closed defect (bug) (fixed)

Duplicate CSS in src/wp-includes/css/media-views.css

Reported by: afercia's profile afercia Owned by: joedolson's profile joedolson
Milestone: 6.6 Priority: normal
Severity: normal Version:
Component: Media Keywords: has-patch has-testing-info commit
Focuses: css Cc:


There's about 60 lines (including empty lines) of duplicate CSS in src/wp-includes/css/media-views.css all related to the 'load more' button shown at the bottom of the media grid.

Compare the CSS starting at line 1272:

with the one starting at line 1317:

While it doesn't harm anything, it's just redundant code that can be safely removed.

Hint: use a tool of your choice to find all the duplicated CSS rulesets. There are a few online tools as well.

Attachments (2)

60499.diff (1.1 KB) - added by afercia 5 months ago.
60499.patch (1.1 KB) - added by shailu25 2 months ago.
Refreshed the patch with Latest Trunk.

Download all attachments as: .zip

Change History (13)

#1 @afercia
5 months ago

  • Owner set to afercia
  • Status changed from new to assigned

5 months ago

#2 @afercia
5 months ago

  • Keywords has-patch added

60499.diff removes the duplicate CSS.

  • Check the removed CSS is actually duplicate.
  • Apply the patch.
  • Build and go to the media grid.
  • Make sure you have more than 80 media files so that the 'load more' button is shown.
  • Observe there are no visual or layout differences.

This ticket was mentioned in Slack in #core-media by joedolson. View the logs.

5 months ago

#4 @joedolson
5 months ago

  • Milestone changed from Awaiting Review to 6.6

#5 @oglekler
2 months ago

  • Keywords needs-testing has-testing-info added

2 months ago

Refreshed the patch with Latest Trunk.

This ticket was mentioned in Slack in #core by nhrrob. View the logs.

8 weeks ago

#7 @nhrrob
8 weeks ago

We have reviewed this ticket in today's bug scrub.
This one ready for testing.

Pinging Test Lead @annezazu (Feel free to share with the #core-test team)

This ticket was mentioned in Slack in #core-media by antpb. View the logs.

7 weeks ago

#9 @joedolson
7 weeks ago

  • Type changed from enhancement to defect (bug)

I'd consider duplicate CSS to be a bug. This doesn't enhance anything; just fixes a very minor code complexity and performance issue. Will test and mark for commit assuming it's all good.

#10 @joedolson
7 weeks ago

  • Keywords commit added; needs-testing removed
  • Owner changed from afercia to joedolson
  • Status changed from assigned to accepted
  • Verified line by line that the removed CSS is an exact duplicate.
  • Built and verified no visual regressions.
  • Marking for commit.

#11 @joedolson
7 weeks ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 58249:

Media: Remove duplicate CSS from media-views.css.

Remove duplicate CSS from the media-views.css file. Follow up to [50829].

Props afercia, joedolson, shailu25.
Fixes #60499.

Note: See TracTickets for help on using tickets.