Skip to content

"Links with identical accessible names and context serve equivalent purpose" [fd3a94]: "same" or "identical" contexts? #1784

@Jym77

Description

@Jym77

While reviewing #1765, I got into this:
Links with identical accessible names and context serve equivalent purpose title uses "identical (…) context" but the Expectation uses "same context".

To me, this rings a bell of difference between "structural" equality (identical) vs "reference" equality (same). I.e.:

<p>Lorem <a href="foo">ipsum</a> </p>
<p>Lorem <a href="bar">ipsum</a> </p>

I would say that these links have different (= "not same") contexts because these are two different p element, but they have "identical" context because they look exactly the same.

I'm not full sure which one the rule should consider, but we should probably use the same word in title and expectation. Also, it seems that the test cases are all built with the same context, so that might be the one to keep.


"same" is obviously stronger than "identical". I do feel that "identical" is the comparison we actually want (and that the previous example should be failing). However, this also opens a can of worms of defining "identical" (because an empty div, a span wrapping a word to no effect, a different text colour, …) should all arguably be ignored by "identical" in this rule (essentially, only the text content of the context should matter 🤔 )

<p>Lorem <span></span> <a href="foo">ipsum</a> <span style="color: red">dolor</span> </p>
<p>Lorem <span><a href="bar">ipsum</a></span> <span style="color: blue">dolor</span> </p>

I'd argue that these two should still be considered "identical contexts" even though the structure starts being quite different…

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions