-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Closed
Copy link
Labels
Component: Framework/ViewComponent: ThemeFixed in 2.2.xThe issue has been fixed in 2.2 release lineThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentProgress: PR CreatedIndicates that Pull Request has been created to fix issueIndicates that Pull Request has been created to fix issueReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 releasegood first issue
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
Component: Framework/ViewComponent: ThemeFixed in 2.2.xThe issue has been fixed in 2.2 release lineThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentProgress: PR CreatedIndicates that Pull Request has been created to fix issueIndicates that Pull Request has been created to fix issueReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 releasegood first issue