WordPress.org

Make WordPress Core

Opened 2 weeks ago

Closed 2 weeks ago

Last modified 11 days ago

#44056 closed defect (bug) (fixed)

Fix markup for table of contents on privacy policy guide

Reported by: ocean90 Owned by: azaozz
Milestone: 4.9.6 Priority: normal
Severity: normal Version: trunk
Component: Privacy Keywords: gdpr has-patch commit
Focuses: ui, accessibility Cc:

Description

There are a few issues with current ToC:

  1. The Introduction link has an empty anchor. It should have a specific one just like the others: https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/misc.php?rev=43242&marks=1606#L1606
  2. Instead of the empty anchor tag the ID can be directly assigned to the headline: https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/misc.php?rev=43242&marks=1636#L1636
  3. The date format should be consistent across the admin, see [35811]. get_option( 'date_format' ) needs to be replaced: https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/misc.php?rev=43242&marks=1607#L1607
  4. The ToC IDs are not guaranteed to be unique on the page. I suggest to prefix them with policy-<plugin name> or something else: https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/misc.php?rev=43242&marks=1632#L1632

Attachments (2)

44056.patch (1.4 KB) - added by azaozz 2 weeks ago.
44056.2.patch (1.6 KB) - added by ocean90 2 weeks ago.

Download all attachments as: .zip

Change History (9)

@azaozz
2 weeks ago

#1 @azaozz
2 weeks ago

In 44056.patch:

  • Add ID to the "Introduction" heading and use it to scroll to it.
  • Add translatable date format instead of user selected one.
  • Add prefix to HTML IDs used for the ToC.

We can't add IDs to the headings as they are "too low". Unfortunately the browsers scroll-into-view is still somewhat buggy and doersn't take into account HTML elements that may cover the top. If we add the IDs to the headings or use empty anchors, the actual headings are scrolled under the admin toolbar. Tested in FF, Chrome, Edge and IE11, all do that :(

#2 @azaozz
2 weeks ago

  • Keywords has-patch added; needs-patch removed

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


2 weeks ago

@ocean90
2 weeks ago

#4 @ocean90
2 weeks ago

  • Keywords commit added

Let's go with 44056.2.patch for now.

As mentioned on Slack, I tried the :target way but then I remembered that it requires a huge gap between the sections otherwise you wouldn't be able to click the Copy button anymore due to the negativ top margin.

#5 @azaozz
2 weeks ago

  • Owner set to azaozz
  • Resolution set to fixed
  • Status changed from new to closed

In 43265:

Privacy: fix markup for the table of contents on privacy policy guide screen.

Props ocean90, azaozz.
Fixes #44056.

#6 @azaozz
2 weeks ago

In 43266:

Privacy: fix markup for the table of contents on privacy policy guide screen.

Props ocean90, azaozz.
Merges [43265] to the 4.9 branch.
Fixes #44056.

#7 @desrosj
11 days ago

  • Component changed from Administration to Privacy

Moving to the new Privacy component.

Note: See TracTickets for help on using tickets.