From ef44ed542963422dc96000096e3043e945da2220 Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Sun, 6 Jul 2025 19:48:25 +0200 Subject: [PATCH] a11y: Correct HTML heading level hierarchy (use h2, not h3) Summary: Several Phorge pages include `

` and `

` HTML elements but no `

` elements. * https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/Heading_Elements instructs to "nest headings without skipping levels"; see also its "Don't do this" section. * https://www.w3.org/WAI/tutorials/page-structure/headings/ says that "Skipping heading ranks can be confusing and should be avoided where possible: Make sure that a

is not followed directly by an

, for example." Closes T16124 Test Plan: * Look at the HTML source of a Maniphest task, a Paste, a Differential change, a Diffusion commit. See that h3 elements are replaced by h2 elements. * Look at http://phorge.localhost/phame/ which used h2 elements before, no change. * Optionally, run an Accessibility check in Chromium Lighthouse. Reviewers: O1 Blessed Committers, mainframe98 Reviewed By: O1 Blessed Committers, mainframe98 Subscribers: mainframe98, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T16124 Differential Revision: https://we.phorge.it/D26115 --- resources/celerity/map.php | 6 +++--- .../response/PhabricatorApplicationTransactionResponse.php | 2 +- .../view/PhabricatorApplicationTransactionCommentView.php | 2 +- src/view/phui/PHUIFeedStoryView.php | 2 +- src/view/phui/PHUITimelineView.php | 2 +- webroot/rsrc/css/phui/phui-feed-story.css | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 64b4ac175a..155ac8cc5a 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -9,7 +9,7 @@ return array( 'names' => array( 'conpherence.pkg.css' => '384ce2d9', 'conpherence.pkg.js' => '020aebcf', - 'core.pkg.css' => '58f1a8df', + 'core.pkg.css' => 'd0eb7f8f', 'core.pkg.js' => '83580d78', 'dark-console.pkg.js' => '187792c2', 'differential.pkg.css' => '4c951b31', @@ -146,7 +146,7 @@ return array( 'rsrc/css/phui/phui-document-pro.css' => 'b7b3d677', 'rsrc/css/phui/phui-document-summary.css' => 'b068eed1', 'rsrc/css/phui/phui-document.css' => 'a9154763', - 'rsrc/css/phui/phui-feed-story.css' => 'a0c05029', + 'rsrc/css/phui/phui-feed-story.css' => '1dd2e4c0', 'rsrc/css/phui/phui-fontkit.css' => '1ec937e5', 'rsrc/css/phui/phui-form-view.css' => '0c6c5f44', 'rsrc/css/phui/phui-form.css' => '2884219c', @@ -818,7 +818,7 @@ return array( 'phui-document-summary-view-css' => 'b068eed1', 'phui-document-view-css' => 'a9154763', 'phui-document-view-pro-css' => 'b7b3d677', - 'phui-feed-story-css' => 'a0c05029', + 'phui-feed-story-css' => '1dd2e4c0', 'phui-font-icon-base-css' => 'b7608e58', 'phui-fontkit-css' => '1ec937e5', 'phui-form-css' => '2884219c', diff --git a/src/applications/transactions/response/PhabricatorApplicationTransactionResponse.php b/src/applications/transactions/response/PhabricatorApplicationTransactionResponse.php index 00adb3a388..4947d6868f 100644 --- a/src/applications/transactions/response/PhabricatorApplicationTransactionResponse.php +++ b/src/applications/transactions/response/PhabricatorApplicationTransactionResponse.php @@ -93,7 +93,7 @@ final class PhabricatorApplicationTransactionResponse } $aural = phutil_tag( - 'h3', + 'h2', array( 'class' => 'aural-only', ), diff --git a/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php b/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php index 3f402e61e7..33639ef18b 100644 --- a/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php +++ b/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php @@ -295,7 +295,7 @@ final class PhabricatorApplicationTransactionCommentView ->appendChild($anchor) ->appendChild( phutil_tag( - 'h3', + 'h2', array( 'class' => 'aural-only', ), diff --git a/src/view/phui/PHUIFeedStoryView.php b/src/view/phui/PHUIFeedStoryView.php index f0acd48201..076f3c29c0 100644 --- a/src/view/phui/PHUIFeedStoryView.php +++ b/src/view/phui/PHUIFeedStoryView.php @@ -119,7 +119,7 @@ final class PHUIFeedStoryView extends AphrontView { public function setPontification($text, $title = null) { if ($title) { - $title = phutil_tag('h3', array(), $title); + $title = phutil_tag('h2', array(), $title); } $copy = phutil_tag( 'div', diff --git a/src/view/phui/PHUITimelineView.php b/src/view/phui/PHUITimelineView.php index 2e6d8298c8..7873f73653 100644 --- a/src/view/phui/PHUITimelineView.php +++ b/src/view/phui/PHUITimelineView.php @@ -89,7 +89,7 @@ final class PHUITimelineView extends AphrontView { ), array( phutil_tag( - 'h3', + 'h2', array( 'class' => 'aural-only', ), diff --git a/webroot/rsrc/css/phui/phui-feed-story.css b/webroot/rsrc/css/phui/phui-feed-story.css index 3fdfeb5a57..ce466bc4a8 100644 --- a/webroot/rsrc/css/phui/phui-feed-story.css +++ b/webroot/rsrc/css/phui/phui-feed-story.css @@ -71,7 +71,7 @@ color: {$darkgreytext}; } -.phui-feed-story-bigtext-post h3 { +.phui-feed-story-bigtext-post h2 { font-size: {$biggestfontsize}; line-height: 18px; color: {$darkgreytext}; -- 2.51.2