Docs · API reference · Motus.Abstractions

IAccessibilityRule Interface#

Evaluates a single accessibility rule against one node in the accessibility tree.

public interface IAccessibilityRule

Properties#

Description Property#

Gets a human-readable description of what this rule checks.

string Description { get; }

Property Value#

System.String

RuleId Property#

Gets the unique identifier for this rule (e.g. "a11y-alt-text").

string RuleId { get; }

Property Value#

System.String

Methods#

Evaluate(AccessibilityNode, AccessibilityAuditContext) Method#

Evaluates the rule against the given node.

Motus.Abstractions.AccessibilityViolation? Evaluate(Motus.Abstractions.AccessibilityNode node, Motus.Abstractions.AccessibilityAuditContext context);

Parameters#

node AccessibilityNode

The node to evaluate.

context AccessibilityAuditContext

The audit context providing tree-wide data and page access.

Returns#

AccessibilityViolation
A AccessibilityViolation if this node violates the rule; null if the node passes or this rule does not apply to the node.