Skip to content

Commit

Permalink
fix(820): fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
skippednote committed Jun 26, 2020
1 parent b2de47e commit 60b1d96
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 7 deletions.
7 changes: 1 addition & 6 deletions src/compiler/compile/nodes/Element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ const a11y_no_onchange = new Set([
'option'
]);

const a11y_mouse_events = new Set([
'onMouseOver',
'onMouseOut'
]);

const invisible_elements = new Set(['meta', 'html', 'script', 'style']);

const valid_modifiers = new Set([
Expand Down Expand Up @@ -512,7 +507,7 @@ export default class Element extends Node {
}
}

if (a11y_mouse_events.has(this.name)) {
if (attribute_map.has('onMouseOver') || attribute_map.has('onMouseOut')) {
if (attribute_map.has('onMouseOver') && !attribute_map.has('onFocus')) {
component.warn(this, {
code: `a11y-mouse-events-have-key-events`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,32 @@
[]
[
{
"code": "a11y-mouse-events-have-key-events",
"end": {
"character": 36,
"column": 36,
"line": 1
},
"message": "A11y: onMouseOver must be accompanied by onFocus for accessibility.",
"pos": 0,
"start": {
"character": 0,
"column": 0,
"line": 1
}
},
{
"code": "a11y-mouse-events-have-key-events",
"end": {
"character": 194,
"column": 59,
"line": 4
},
"message": "A11y: onMouseOut must be accompanied by onBlur for accessibility.",
"pos": 135,
"start": {
"character": 135,
"column": 0,
"line": 4
}
}
]

0 comments on commit 60b1d96

Please sign in to comment.