Skip to content

Commit

Permalink
Merge pull request #1390 from IBMa/dev-1389
Browse files Browse the repository at this point in the history
fix(engine): fix bound issues with page scroll
  • Loading branch information
ErickRenteria authored Apr 20, 2023
2 parents 07e4b81 + 37d46ca commit eacf913
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions accessibility-checker-engine/src/v2/dom/DOMMapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ export class DOMMapper extends CommonMapper {

// Do a check whether bounds has value as we use different tool (htmlUnit, browser) to call this function
if (bounds) {
let scrollX = node && node.ownerDocument && node.ownerDocument.defaultView && node.ownerDocument.defaultView.scrollX || 0;
let scrollY = node && node.ownerDocument && node.ownerDocument.defaultView && node.ownerDocument.defaultView.scrollY || 0;
return {
"left": Math.ceil(bounds.left * adjustment),
"top": Math.ceil(bounds.top * adjustment),
"left": Math.ceil((bounds.left + scrollX) * adjustment),
"top": Math.ceil((bounds.top + scrollY) * adjustment),
"height": Math.ceil(bounds.height * adjustment),
"width": Math.ceil(bounds.width * adjustment)
};
Expand Down

0 comments on commit eacf913

Please sign in to comment.