Skip to content

Commit

Permalink
add denug for testing #1974
Browse files Browse the repository at this point in the history
  • Loading branch information
shunguoy committed Sep 11, 2024
1 parent 87faf20 commit 18db1dc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions accessibility-checker-engine/src/v2/aria/ARIAMapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ export class ARIAMapper extends CommonMapper {
let parent = ARIAMapper.getAriaOwnedBy(elem);
if (!parent) {
parent = DOMWalker.parentElement(elem) as HTMLElement;
}
}
while (parent && parent.nodeType !== 1) {
parent = DOMWalker.parentElement(elem) as HTMLElement;
} if (elem.nodeName == 'MY-LIST' || elem.nodeName == 'MY-LIST-ITEM') console.log("node=" + elem.nodeName +", parent=" + parent.nodeName +", role=" + parent.getAttribute("role"));
} if (elem.nodeName == 'MY-LIST-ITEM') console.log("mapper node=" + elem.nodeName +" role=" + elem.getAttribute("role") + ", parent=" + parent.nodeName +", role=" + parent.getAttribute("role"));
let parentHierarchy = parent ? this.getNodeHierarchy(parent) : [];
let parentInfo = parentHierarchy.length > 0 ? parentHierarchy[parentHierarchy.length-1] : {
role: "",
Expand Down
2 changes: 1 addition & 1 deletion accessibility-checker-engine/src/v2/dom/DOMWalker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class DOMWalker {

static parentElement(node: Node) : Element | null {
let elem : Element = node as Element;
do {
do { if (elem.nodeName == 'MY-LIST-ITEM') console.log("walker node=" + elem.nodeName +", role=" +elem.getAttribute("role") +", parent=" + DOMWalker.parentNode(elem).nodeName +", parent nodetype=" + DOMWalker.parentNode(elem).nodeType +", id=" + (DOMWalker.parentNode(elem) as Element).getAttribute("id") +", role=" + (DOMWalker.parentNode(elem) as Element).getAttribute("role"));
elem = DOMWalker.parentNode(elem) as Element;
} while (elem && elem.nodeType !== 1);
return elem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const aria_parent_required: Rule = {
count++;
parentRole = ancestorRoles[ancestorRoles.length - count];

}console.log("node="+ruleContext.nodeName +", roles=" + roles +", parentRole=" + parentRole +",ancestorRoles="+ancestorRoles);
}console.log("rule node="+ruleContext.nodeName + ", id="+ruleContext.getAttribute("id") +", roles=" + roles +", parentRole=" + parentRole +",ancestorRoles="+ancestorRoles);
for (let j = 0, length = roles.length; j < length; ++j) {
if (designPatterns[roles[j]] && designPatterns[roles[j]].container != null) {
testedContainer++;
Expand Down

0 comments on commit 18db1dc

Please sign in to comment.