Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

W3C compatibility #7438

Open
Blueace opened this issue Oct 5, 2017 · 4 comments
Open

W3C compatibility #7438

Blueace opened this issue Oct 5, 2017 · 4 comments

Comments

@Blueace
Copy link

Blueace commented Oct 5, 2017

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.

  1. We also have in header.ss

<header class="header" role="banner">

Role="Banner" is not needed and generate a warning. Should be deleted.

@dhensby
Copy link
Contributor

dhensby commented Oct 5, 2017

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

@Blueace
Copy link
Author

Blueace commented Oct 6, 2017

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.

@chillu
Copy link
Member

chillu commented Oct 6, 2017

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?

@lerni
Copy link
Contributor

lerni commented Jan 4, 2024

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
            ]
        ];
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants