[Bug] Cannot reduce legend line-height in Firefox
- Dominant language
- TypeScript
- Stars
- 67.3k
- Forks
- 19.8k
- Avg merge
- 11d 14h
- Merged PRs (30d)
- 8
Description
### Version
6.1.0
### Link to Minimal Reproduction
https://echarts.apache.org/examples/en/editor.html?c=area-stack&code=xVVNj5swEL3vrxipBy45BNikgaqHaLv9OFSqlG17qPYwCROwChgZsxta5b93xgTYJFKkSiuFA9jjmfG898ZGV1bpEt7D3xsAq2xOsRvyhHY2Bm9lcfObElgaQrjL0FiPl_cTcdc6t6oaAoxKUzIcgztVe-IBIMNvWpVWFjo_9mwr3sbbGF33fgA5rikffQDWvHFqdFMmdzrXkvfNHN9Gi5kUIM_efeXtykmNSvr4nLZc_HzaJefCMp7ODtO1tlYXMfihM7jgnFIqh_AELcbwy7svUOXeBLzvpbC0TLhc8H6ohHQ_-aAMbayMVoRmk8F9maqSvMdur2eV2CyGoN9bWSo-U1fPfNhduF7ZdiQ_5xS9m38I3erSrtQf9lmMgSzBWu_6sC2hbcyQBaDGJ1rWXwpMxXhC2G7J4jBMZz3VBi2l2rSDPGsRAk37CVnwLeY19Ss9WV91KTQ8NCSfn5S4WdbI56NRjiLsmGpK73GoxTHVXqjlCXPOeexfk1F0FlBiIQEH2Y6zCKWDrZauZuODtjh6Ivd4L4NjSB4qqgxrKW5sza3eNGzwuiqGfjxhxA-mE26ygF9TX0a3E4jYFHDfQeBPDxR0UScQXjTctWEEDsZCYEQMIxAYgeAIBUd4GceLs3J1OfgMcvWMI3ByzBiHP-C4vYyjP-bXBhGKGKGACAVEKGKEoxjBRRDHN9T_Yzm7outMP8d88TfDZQBQ6VrJP4Wjra7OcLwyHwvhIxI-IuEjEj58152-Y4SPX0-JXB03-3f_AA&enc=deflate
### Steps to Reproduce
1. Set `legend.itemHeight` to a small value (6)
2. Set `textStyle.lineHeight` to 10px
3. Set `textStyle.fontSize` to 8.
4. The legend needs a lot of label to be on multiple lines (or the legend width could be limited)
5. Use default font
### Current Behavior
It looks like the distance between the 2 legend lines is equal to `lineHeight` + 8px on both browsers (Firefox and Chromium).
In Chromium, with the provided example, the distance between the 2 lines is 18px as expected.
**But,** the legend line height in Firefox cannot be reduced under 20px + 8px.
It looks like that the computed `transform="translate(...)"` attribute for each `text` and `path` element of the legend is not "valid" in Firefox.
### Expected Behavior
Firefox should have the same layout that Chromium.
### Environment
```markdown
- OS: Arch Linux
- Browser: Firefox 151
- Framework: None
```
### Any additional comments?
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.