nest article/section checks into an if statement

pull/7067/head
James Bradbury 5 years ago
parent 91ec3fcb7b
commit 53b89192c2

@ -394,21 +394,16 @@ export default class Element extends Node {
} }
const is_parent_section_or_article = is_parent(this.parent, ['section', 'article']) const is_parent_section_or_article = is_parent(this.parent, ['section', 'article'])
} if (!is_parent_section_or_article) {
if (parent.type === 'Element') { if (this.name === 'header' && value === 'banner') {
break;
}
parent = parent.parent;
}
if (this.name === 'header' && value === 'banner' && !is_parent_section_or_article) {
component.warn(attribute, compiler_warnings.a11y_no_redundant_roles(value)); component.warn(attribute, compiler_warnings.a11y_no_redundant_roles(value));
} }
if (this.name === 'footer' && value === 'contentinfo' && !is_parent_section_or_article) { else if (this.name === 'footer' && value === 'contentinfo') {
component.warn(attribute, compiler_warnings.a11y_no_redundant_roles(value)); component.warn(attribute, compiler_warnings.a11y_no_redundant_roles(value));
} }
} }
}
// no-access-key // no-access-key
if (name === 'accesskey') { if (name === 'accesskey') {

Loading…
Cancel
Save