Skip to content

Commit 8201d76

Browse files
dummdidummtanhauhau
authored andcommitted
naming
1 parent bd03c70 commit 8201d76

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/compiler/compile/nodes/Element.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import {
3131
is_interactive_roles,
3232
is_hidden_from_screen_reader,
3333
is_semantic_role_element,
34-
may_contain_input_child
34+
contains_input_child
3535
} from '../utils/a11y';
3636

3737
const aria_attributes = 'activedescendant atomic autocomplete busy checked colcount colindex colspan controls current describedby description details disabled dropeffect errormessage expanded flowto grabbed haspopup hidden invalid keyshortcuts label labelledby level live modal multiline multiselectable orientation owns placeholder posinset pressed readonly relevant required roledescription rowcount rowindex rowspan selected setsize sort valuemax valuemin valuenow valuetext'.split(' ');
@@ -788,7 +788,7 @@ export default class Element extends Node {
788788

789789
if (this.name === 'label') {
790790
const rule_options = component.compile_options.a11y?.rules?.['label-has-associated-control'];
791-
if (!attribute_map.has('for') && !may_contain_input_child(this, rule_options)) {
791+
if (!attribute_map.has('for') && !contains_input_child(this, rule_options)) {
792792
component.warn(this, compiler_warnings.a11y_label_has_associated_control);
793793
}
794794
}

src/compiler/compile/nodes/InlineComponent.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { TemplateNode } from '../../interfaces';
1212
import compiler_errors from '../compiler_errors';
1313
import compiler_warnings from '../compiler_warnings';
1414
import { regex_only_whitespaces } from '../../utils/patterns';
15-
import { may_contain_input_child } from '../utils/a11y';
15+
import { contains_input_child } from '../utils/a11y';
1616

1717
export default class InlineComponent extends Node {
1818
type: 'InlineComponent';
@@ -173,7 +173,7 @@ export default class InlineComponent extends Node {
173173
validate() {
174174
const label_has_associated_control_rule_options = this.component.compile_options.a11y?.rules?.['label-has-associated-control'];
175175
if (label_has_associated_control_rule_options?.labelComponents?.includes(this.name)) {
176-
if (!may_contain_input_child(this, label_has_associated_control_rule_options)) {
176+
if (!contains_input_child(this, label_has_associated_control_rule_options)) {
177177
this.component.warn(this, compiler_warnings.a11y_label_has_associated_control);
178178
}
179179
}

src/compiler/compile/utils/a11y.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ const a11y_labelable = new Set([
174174
'textarea'
175175
]);
176176

177-
export function may_contain_input_child(
177+
export function contains_input_child(
178178
root: INode,
179179
rule_options: CompileOptions['a11y']['rules']['label-has-associated-control']
180180
): boolean {

0 commit comments

Comments
 (0)