Skip to content

Commit

Permalink
update to latest develop, reset some unchanged files
Browse files Browse the repository at this point in the history
  • Loading branch information
gaiety-deque committed Jun 7, 2024
1 parent cc56999 commit 74e1cdc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
21 changes: 0 additions & 21 deletions lib/rules/landmark-unique-matches.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,8 @@
import { isVisibleToScreenReaders } from '../commons/dom';
import { closest } from '../core/utils';
import { getRole } from '../commons/aria';
import { getAriaRolesByType } from '../commons/standards';
import { accessibleTextVirtual } from '../commons/text';

/*
* Since this is a best-practice rule, we are filtering elements as dictated by ARIA 1.1 Practices regardless of treatment by browser/AT combinations.
*
* Info: https://www.w3.org/TR/wai-aria-practices-1.1/#aria_landmark
*/
const excludedParentsForHeaderFooterLandmarks = [
'article',
'aside',
'main',
'nav',
'section'
].join(',');

export default function landmarkUniqueMatches(node, virtualNode) {
return (
isLandmarkVirtual(virtualNode) && isVisibleToScreenReaders(virtualNode)
Expand All @@ -31,9 +17,6 @@ function isLandmarkVirtual(vNode) {
}

const { nodeName } = vNode.props;
if (nodeName === 'header' || nodeName === 'footer') {
return isHeaderFooterLandmark(vNode);
}

if (nodeName === 'section' || nodeName === 'form') {
const accessibleText = accessibleTextVirtual(vNode);
Expand All @@ -42,7 +25,3 @@ function isLandmarkVirtual(vNode) {

return landmarkRoles.indexOf(role) >= 0 || role === 'region';
}

function isHeaderFooterLandmark(headerFooterElement) {
return !closest(headerFooterElement, excludedParentsForHeaderFooterLandmarks);
}
2 changes: 1 addition & 1 deletion lib/rules/scrollable-region-focusable-matches.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { querySelectorAll, getScroll } from '../core/utils';
export default function scrollableRegionFocusableMatches(node, virtualNode) {
return (
// The element scrolls
// And there's something actually worth scrolling to
getScroll(node, 13) !== undefined &&
// It's not a combobox popup, which commonly has keyboard focus added
isComboboxPopup(virtualNode) === false &&
// And there's something actually worth scrolling to
isNoneEmptyElement(virtualNode)
);
}
Expand Down

0 comments on commit 74e1cdc

Please sign in to comment.