Skip to content

Commit ed3e44f

Browse files
authored
MAGETWO-65587: [GitHub][PR] update allowed container tags #8056
2 parents 222ba7b + 79355e3 commit ed3e44f

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

dev/tests/integration/testsuite/Magento/Framework/View/LayoutTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@ public function addContainerDataProvider()
273273
public function testAddContainerInvalidHtmlTag()
274274
{
275275
$msg = 'Html tag "span" is forbidden for usage in containers. ' .
276-
'Consider to use one of the allowed: dd, div, dl, fieldset, main, header, ' .
277-
'footer, ol, p, section, table, tfoot, ul, nav.';
276+
'Consider to use one of the allowed: aside, dd, div, dl, fieldset, main, nav, ' .
277+
'header, footer, ol, p, section, table, tfoot, ul.';
278278
$this->setExpectedException(\Magento\Framework\Exception\LocalizedException::class, $msg);
279279
$this->_layout->addContainer('container', 'Container', ['htmlTag' => 'span']);
280280
}

lib/internal/Magento/Framework/View/Layout/Generator/Container.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ class Container implements Layout\GeneratorInterface
2424
* @var array
2525
*/
2626
protected $allowedTags = [
27+
'aside',
2728
'dd',
2829
'div',
2930
'dl',
3031
'fieldset',
3132
'main',
33+
'nav',
3234
'header',
3335
'footer',
3436
'ol',
@@ -37,7 +39,6 @@ class Container implements Layout\GeneratorInterface
3739
'table',
3840
'tfoot',
3941
'ul',
40-
'nav',
4142
];
4243

4344
/**

lib/internal/Magento/Framework/View/Layout/etc/elements.xsd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,11 +338,13 @@
338338

339339
<xs:simpleType name="htmlTagType">
340340
<xs:restriction base="xs:string">
341+
<xs:enumeration value="aside"/>
341342
<xs:enumeration value="dd"/>
342343
<xs:enumeration value="div"/>
343344
<xs:enumeration value="dl"/>
344345
<xs:enumeration value="fieldset"/>
345346
<xs:enumeration value="main"/>
347+
<xs:enumeration value="nav"/>
346348
<xs:enumeration value="header"/>
347349
<xs:enumeration value="footer"/>
348350
<xs:enumeration value="ol"/>

0 commit comments

Comments
 (0)