From d37757abf1d62cb6d9d651c84fce92febc54ce2f Mon Sep 17 00:00:00 2001 From: Shamim Rezaie Date: Fri, 3 Apr 2020 05:42:59 +1100 Subject: [PATCH] MDL-68312 gradereport_grader: Use caption instead of summary in table The summary attribute on the table element is obsolete. --- grade/report/grader/lib.php | 3 ++- lib/outputcomponents.php | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/grade/report/grader/lib.php b/grade/report/grader/lib.php index 53741c42567..2945f4d68fe 100644 --- a/grade/report/grader/lib.php +++ b/grade/report/grader/lib.php @@ -1265,7 +1265,8 @@ class grade_report_grader extends grade_report { $fulltable = new html_table(); $fulltable->attributes['class'] = 'gradereport-grader-table'; $fulltable->id = 'user-grades'; - $fulltable->summary = get_string('summarygrader', 'gradereport_grader'); + $fulltable->caption = get_string('summarygrader', 'gradereport_grader'); + $fulltable->captionhide = true; // Extract rows from each side (left and right) and collate them into one row each foreach ($leftrows as $key => $row) { diff --git a/lib/outputcomponents.php b/lib/outputcomponents.php index ab3f3e4833e..9240d1d257d 100644 --- a/lib/outputcomponents.php +++ b/lib/outputcomponents.php @@ -2765,6 +2765,10 @@ class html_table { /** * @var string Description of the contents for screen readers. + * + * The "summary" attribute on the "table" element is not supported in HTML5. + * Consider describing the structure of the table in a "caption" element or in a "figure" element containing the table; + * or, simplify the structure of the table so that no description is needed. */ public $summary;