Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nodeIndex property to DqElement #2938

Closed
WilcoFiers opened this issue May 17, 2021 · 1 comment
Closed

Add nodeIndex property to DqElement #2938

WilcoFiers opened this issue May 17, 2021 · 1 comment
Assignees
Labels
core Issues in the core code (lib/core) feat New feature or enhancement pr A pr has been created for the issue

Comments

@WilcoFiers
Copy link
Contributor

Required for #2936

In order to properly sort results in finishRun, which does not have access to elements, we will need to know the relative order of each result to the frames on a page. We can do this by adding a nodeIndex property to DqElement. Since the virtual tree is constructed in order, it might be easiest to do this by keeping a simple counter and assigning the current value to the virtual node when it is created. That way nodes higher up the tree have a lower number, and we can sort results based on that.

@straker straker added feat New feature or enhancement pr A pr has been created for the issue core Issues in the core code (lib/core) labels Jun 17, 2021
@padmavemulapati
Copy link

Validated with latest develop branch code base,
test snippets:

<div id="target"></div>
  <div id="foo">\n      <div id="bar"></div>\n    </div>
  <div id="foo">\n      <div id="bar"></div>\n    </div>
  <svg aria-label="foo" id="target"></svg>
  <div id="target" class="bar">Hello!</div>
  <main id="main"></main><iframe id="iframe"></iframe>

image

@straker straker closed this as completed Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Issues in the core code (lib/core) feat New feature or enhancement pr A pr has been created for the issue
Projects
None yet
Development

No branches or pull requests

3 participants