Open Blueace opened 7 years ago
This is likely an issue with the simple theme and not the framework itself.
PRs to go against: https://github.com/silverstripe-themes/silverstripe-simple please
I'm not so sure, because the line
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
comes from the framework I guess (in fact I don't know from where, but it's not in the style).
Also, because so far SS aria codes are not W3C cumpliance, I suggest to delete the following line in framework/forms/FormField.php :
$attributes['aria-required'] = 'true';
Because it's generating an error, not just a warning, for all the SS forms.
Also, because so far SS aria codes are not W3C cumpliance, I suggest to delete the following line in framework/forms/FormField.php
What generates an error? Can you show it here, alongside with a full copy of the HTML document that generated the error?
Can <meta charset="utf-8">
be used in all instances for v6? It's a HTML4 vs. 5 thing; in v6 HTML5 should be default? I cannot reproduce the aria-required validation problem, therefore I suggest to target this for v6 or close. Meanwhile it can be achieved with an extension like below.
See also: https://blog.whatwg.org/the-road-to-html-5-character-encoding
namespace App\Extensions;
use SilverStripe\Core\Extension;
use SilverStripe\Control\ContentNegotiator;
class PageExtension extends Extension
{
public function MetaComponents(array &$tags)
{
$charset = ContentNegotiator::config()->uninherited('encoding');
$tags['contentType'] = [
'attributes' => [
'charset' => $charset
]
];
}
}
Not a big deal, but... Assuming SS is HTML5
1) we get in the header both :
<meta charset="utf-8">
and<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
In HTML5 it's the same and generates a warning, so one is not needed. Best practice said to keep the shorter.
2) We also have in header.ss
<header class="header" role="banner">
Role="Banner" is not needed and generate a warning. Should be deleted.