Commit 17add477 authored by Denis Chenu's avatar Denis Chenu

[fix] Don't add empty aria-labelledby

parent 6fa5036d
......@@ -5,7 +5,7 @@
* @author Denis Chenu <denis@sondages.pro>
* @copyright 2015-2016 Denis Chenu <http://www.sondages.pro>
* @license GPL v3
* @version 1.4.0
* @version 1.5.1
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -96,10 +96,12 @@ class moreAccessibility extends PluginBase
foreach($dom->getElementsByTagName('label') as $label)
$label->parentNode->removeChild($label);
$input=$dom->getElementById($sAnswerId);
if(!empty($aLabelledBy)) {
if($input)
$input->setAttribute("aria-labelledby",implode(" ",$aLabelledBy));
else
tracevar("{$sAnswerId} Is not found in HTML produced for answers");
}
$newHtml = $dom->saveHTMLExact();
$oEvent->set('answers',$newHtml);
}
......@@ -216,7 +218,9 @@ class moreAccessibility extends PluginBase
foreach ($dom->getElementsByTagName('table') as $elTable)
{
$elTable->setAttribute('role','group');
if(!empty($aGlobalDescribedBy)) {
$elTable->setAttribute('aria-labelledby',implode(" ",$aGlobalDescribedBy));
}
// Fix update summary ? Add aria-hidden to head ?
}
switch ($sType)
......@@ -267,7 +271,6 @@ class moreAccessibility extends PluginBase
}
}
}
$newHtml = $dom->saveHTMLExact();
$oEvent->set('answers',$newHtml);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment