Open Bug 1899428 Opened 1 year ago Updated 1 year ago

Bounds, Hittesting incorrect for link containing image node

Categories

(Core :: Disability Access APIs, defect)

defect

Tracking

()

People

(Reporter: morgan, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

Attachments

(1 obsolete file)

STR:

  1. Load: data:text/html,<a href="mozilla.org"><img src="https://placekitten.com/100/100" alt=""></a>
  2. Inspect the bounds of the link

Expected:
The link tightly wraps the image node, making its bounds approximately 100 x 100 px

Actual:
The link has bounds of approximately 20px height and 100px width

  1. Hittest the upper left of the image (outside of the link's bounds) using VO or NVDA

Expected:
VO reports the link

Actual:
VO reports the document

This is a distilled test case from the images in the right sidebar on the WWI wikipedia page here: https://en.wikipedia.org/wiki/World_War_II

Blocks: boundsa11y

FWIW this works in both Safari and Chrome (and they both strip the image node correctly)

If we consider something like:
data:text/html,<span id="container"><a href="example.com" id="link"><img src="http://placekitten.com/100/100" alt=""></a></span>

the container doesn't get the image bounds either -- probably "as expected" by layout standards, since this is an inline case instead of a block one. However, both Safari and Chrome still tightly wrap the image when navigating w/ VO's visual cursor and/or hittesting

Note that the <span> doesn't get included in the a11y tree in your comment 2 example.

I'm fairly sure the <a> in either case is inline, not block. What do Chrome and Safari do for this?

data:text/html,<span role="group" aria-label="container"><img src="http://placekitten.com/100/100" alt=""></span>

Does the "group" tightly bound?

(In reply to James Teh [:Jamie] from comment #3)

Note that the <span> doesn't get included in the a11y tree in your comment 2 example.

I'm fairly sure the <a> in either case is inline, not block. What do Chrome and Safari do for this?

data:text/html,<span role="group" aria-label="container"><img src="http://placekitten.com/100/100" alt=""></span>

Does the "group" tightly bound?

Yeah, both Chrome and Safari tightly bound the group to the image

I'd be interested to know whether we get this right in LocalAccessible, but that's more just a curiosity, since I don't think that really helps us. :)

Oh... and also, I don't think it matters whether the image is stripped or not. Even with alt="foo" on the img, I still don't get tightly wrapping bounds for the link.
Edit: Though it's not so bad when the image isn't stripped because hit testing will hit the image, not the link. But the bounds for the link (or other inline parent) will still ultimately be wrong.

Summary: Bounds, Hittesting incorrect for link containing stripped image node → Bounds, Hittesting incorrect for link containing image node
Depends on: 1901648
Assignee: nobody → mreschenberg
Status: NEW → ASSIGNED
Attachment #9409299 - Attachment is obsolete: true

Adding a patch with the test I wrote for this issue, but marking abandoned because there's no engineering work happening right now -- we're stalled on the dependent bug I filed above :)

Assignee: mreschenberg → nobody
Status: ASSIGNED → NEW
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: