Giter Site home page Giter Site logo

Comments (5)

msftbot avatar msftbot commented on July 20, 2024

This issue has been marked as ready for team triage; we will triage it in our weekly review and update the issue. Thank you for contributing to Accessibility Insights!

from axe-windows.

adarshrema avatar adarshrema commented on July 20, 2024

Hello @decriptor, thank you for your interest in axe-windows and this feature request. This is a tricky problem and there is no single solution that would work in all usage scenarios. The challenge here is finding a way that allows you to specify the root element for scanning within some sort of test environment, and that will depend directly upon the information that your test system can access. If you can elaborate on what information is available within your test system, we will perhaps have a better chance of creating something that you can use effectively.

from axe-windows.

msftbot avatar msftbot commented on July 20, 2024

The team requires additional author feedback; please review their replies and update this issue accordingly. Thank you for contributing to Accessibility Insights!

from axe-windows.

msftbot avatar msftbot commented on July 20, 2024

This issue has been automatically marked as stale because it is marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for contributing to Accessibility Insights!

from axe-windows.

decriptor avatar decriptor commented on July 20, 2024

@adarshrema Sorry for the delay in responding. We are testing a part of our UI within our Visual Studio extension. In this case I'm interested in anything within a particular pane. What I've done so far is to find the name of that pane and grab any errors that have that pane "Name" as a parent element in the hierarchy. Here is what I have currently:

The pane Name is "activity_main.xml".
Here is the code I've stubbed out:

errors: All of the errors that axe found.
targetParentElementName: find all of the errors that have this element as it's parent at some point in the tree.

IEnumerable<ScanResult> FindApplicableErrors (IEnumerable<ScanResult> errors, string targetParentElementName)
{
	var selectedErrors = new List<ScanResult> ();

	foreach (var error in errors) {
		if (HasTargetParent (error.Element, targetParentElementName))
			selectedErrors.Add (error);
	}

	return selectedErrors;
}
bool HasTargetParent (ElementInfo element, string parentElement)
{
	if (element.Properties.TryGetValue ("Name", out var propertyName)) {
		if (propertyName == parentElement)
			return true;
	}

	if (element.Parent == null)
		return false;

	return HasTargetParent (element.Parent, parentElement);
}

Result:
image

from axe-windows.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.