silverstripe / silverstripe-framework

Silverstripe Framework, the MVC framework that powers Silverstripe CMS
https://www.silverstripe.org
BSD 3-Clause "New" or "Revised" License
722 stars 822 forks source link

remove application/javascript as this is not required with html5 #8710

Open sunnysideup opened 5 years ago

sunnysideup commented 5 years ago

Affected Version

SS4

Description

HTML5 does not require application/javascript e.g. https://github.com/silverstripe/silverstripe-framework/blob/4/src/View/Requirements_Backend.php#L807

I would go through all code and remove it.

This is helpful because when I run a w3 validation it throws a warning.

lerni commented 5 years ago

see also: https://github.com/silverstripe/silverstripe-framework/issues/8221#issuecomment-400378289

robbieaverill commented 5 years ago

We support HTML4 as well as 5 at the moment so perhaps can't do this until we drop HTML4 support

maxime-rainville commented 5 years ago

Would it be worthwhile making this configurable, so people who are coding to HTML5 can remove it and people who are coding to HTML4 still get it?

chillu commented 5 years ago

So @dhensby previously marked this as wontfix. HTML5 support in 5.x is tracked through https://github.com/silverstripe/silverstripe-framework/issues/7310.

We should be able to determine if you're opted into HTML5 based on this config - but that part is quite separate from Requirements

SilverStripe\Core\Injector\Injector:
  SilverStripe\View\Parsers\HTMLValue:
    class: SilverStripe\View\Parsers\HTML4Value

I think we should just make this configurable in the requirements class as the path of least resistance. Do you want to send a PR for that @sunnysideup?