Bounds, Hittesting incorrect for link containing image node
Categories
(Core :: Disability Access APIs, defect)
Tracking
()
People
(Reporter: morgan, Unassigned)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
Attachments
(1 obsolete file)
STR:
- Load:
data:text/html,<a href="mozilla.org"><img src="https://placekitten.com/100/100" alt=""></a> - 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
- 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
| Reporter | ||
Updated•1 year ago
|
| Reporter | ||
Comment 1•1 year ago
|
||
FWIW this works in both Safari and Chrome (and they both strip the image node correctly)
| Reporter | ||
Comment 2•1 year ago
|
||
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
Comment 3•1 year ago
|
||
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?
| Reporter | ||
Comment 4•1 year ago
|
||
(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
Comment 5•1 year ago
|
||
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. :)
Comment 6•1 year ago
•
|
||
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.
| Reporter | ||
Updated•1 year ago
|
| Reporter | ||
Comment 7•1 year ago
|
||
Updated•1 year ago
|
Updated•1 year ago
|
| Reporter | ||
Comment 8•1 year ago
|
||
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 :)
| Reporter | ||
Updated•1 year ago
|
Description
•