Opened 20 months ago

Last modified 14 months ago

#7134 closed defect

Firefox `event.layerX` coordinates off by `element.offsetLeft` — at Initial Version

Reported by: agiammarchi Assignee:
Priority: P1 Milestone:
Module: User-Interface Keywords:
Cc: Blocked By:
Blocking: Platform: Firefox
Ready: yes Confidential: no
Tester: Unknown Verified working: yes
Review URL(s):

https://gitlab.com/eyeo/adblockplus/abpui/adblockplusui/merge_requests/163

Description

Firefox has a consistent issue with the event.layerX/Y when the element is positioned through flexbox, considering the container the layer, and not the element itself.

This means that Issue Reporter X coordinates are off by the width of the previous element, because the layerX is considered from the canvas parent, instead of the canvas itself.

This is unfortunately not a feature detection friendly issue, so we need to force-fix layerX per each Firefox.

Being layerX/Y somehow legacy, it is safe to assume future versions of Firefox will preserve the behavior, yet we need to be sure when some part of the issue reporter screenshot is highlighted, all supported browsers draw rectangles where appropriate.

The non-layer based fallback works already, but it requires more computational power, so until layerX/Y are available, I still suggest we use these instead of manual coordinates transformation.

Change History (0)

Note: See TracTickets for help on using tickets.