@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator

a11y: Correct HTML heading level hierarchy (use h2, not h3)

Summary:
Several Phorge pages include `<h1>` and `<h3>` HTML elements but no `<h2>` 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 <h2> is not followed directly by an <h4>, 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

+8 -8
+3 -3
resources/celerity/map.php
··· 9 9 'names' => array( 10 10 'conpherence.pkg.css' => '384ce2d9', 11 11 'conpherence.pkg.js' => '020aebcf', 12 - 'core.pkg.css' => '58f1a8df', 12 + 'core.pkg.css' => 'd0eb7f8f', 13 13 'core.pkg.js' => '83580d78', 14 14 'dark-console.pkg.js' => '187792c2', 15 15 'differential.pkg.css' => '4c951b31', ··· 146 146 'rsrc/css/phui/phui-document-pro.css' => 'b7b3d677', 147 147 'rsrc/css/phui/phui-document-summary.css' => 'b068eed1', 148 148 'rsrc/css/phui/phui-document.css' => 'a9154763', 149 - 'rsrc/css/phui/phui-feed-story.css' => 'a0c05029', 149 + 'rsrc/css/phui/phui-feed-story.css' => '1dd2e4c0', 150 150 'rsrc/css/phui/phui-fontkit.css' => '1ec937e5', 151 151 'rsrc/css/phui/phui-form-view.css' => '0c6c5f44', 152 152 'rsrc/css/phui/phui-form.css' => '2884219c', ··· 818 818 'phui-document-summary-view-css' => 'b068eed1', 819 819 'phui-document-view-css' => 'a9154763', 820 820 'phui-document-view-pro-css' => 'b7b3d677', 821 - 'phui-feed-story-css' => 'a0c05029', 821 + 'phui-feed-story-css' => '1dd2e4c0', 822 822 'phui-font-icon-base-css' => 'b7608e58', 823 823 'phui-fontkit-css' => '1ec937e5', 824 824 'phui-form-css' => '2884219c',
+1 -1
src/applications/transactions/response/PhabricatorApplicationTransactionResponse.php
··· 93 93 } 94 94 95 95 $aural = phutil_tag( 96 - 'h3', 96 + 'h2', 97 97 array( 98 98 'class' => 'aural-only', 99 99 ),
+1 -1
src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
··· 295 295 ->appendChild($anchor) 296 296 ->appendChild( 297 297 phutil_tag( 298 - 'h3', 298 + 'h2', 299 299 array( 300 300 'class' => 'aural-only', 301 301 ),
+1 -1
src/view/phui/PHUIFeedStoryView.php
··· 119 119 120 120 public function setPontification($text, $title = null) { 121 121 if ($title) { 122 - $title = phutil_tag('h3', array(), $title); 122 + $title = phutil_tag('h2', array(), $title); 123 123 } 124 124 $copy = phutil_tag( 125 125 'div',
+1 -1
src/view/phui/PHUITimelineView.php
··· 89 89 ), 90 90 array( 91 91 phutil_tag( 92 - 'h3', 92 + 'h2', 93 93 array( 94 94 'class' => 'aural-only', 95 95 ),
+1 -1
webroot/rsrc/css/phui/phui-feed-story.css
··· 71 71 color: {$darkgreytext}; 72 72 } 73 73 74 - .phui-feed-story-bigtext-post h3 { 74 + .phui-feed-story-bigtext-post h2 { 75 75 font-size: {$biggestfontsize}; 76 76 line-height: 18px; 77 77 color: {$darkgreytext};