Closed
Description
Hi,
We want to use a technique for loading asynchronous stylesheets.
Ex. https://brianflove.com/2016/07/21/preloading-with-critical-path-css/
The issue is that link attribute "as" isn't valid according to vendor/magento/framework/View/Layout/etc/head.xsd validation file but is a officially supported HTML link attribute as described here:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#Attributes
Preconditions
- Magento 2.2.6
- PHP 7.1
Steps to reproduce
- I add the attribute AS on my css inclusion:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="/style.css" src_type="url" rel="preload" as="style" />
</head>
</page>
- Clear cache
- Reload the front
Expected result
- Permit the AS attribute (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#Attributes) in this file vendor/magento/framework/View/Layout/etc/head.xsd
- Add this <xs:attribute name="as" type="xs:string"/> under <xs:complexType name="linkType">
Actual result
An exception is thrown by Magento Framework 1 exception(s): Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'css', attribute 'as': The attribute 'as' is not allowed.
Metadata
Metadata
Assignees
Labels
The issue has been fixed in 2.2 release lineThe issue has been fixed in 2.3 release lineGate 2 Passed. Manual verification of the issue description passedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 1 Passed. Automatic verification of issue format passedGate 4. Acknowledged. Issue is added to backlog and ready for developmentIndicates that Pull Request has been created to fix issueThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.3 release