Incorrect bounding boxes and positions for some svg elements
Categories
(Core :: SVG, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox98 | --- | fixed |
People
(Reporter: calixte, Assigned: emilio)
References
Details
Attachments
(2 files)
STR:
- open the following html in firefox:
<html>
<body>
<div>
<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg">
<text>
<tspan x="50 60 70 80 90 100" y="50">hello1</tspan>
<tspan x="50 60 70 80 90 100" y="100">hello2</tspan>
</text>
</svg>
</div>
</body>
</html>
- open the devtools
- mouse over the 2 tspans in the inspector
- observe the highlighted bounding boxes: dimensions are incorrect and the top-left corner for the second tspan is wrong.
It works correctly in Chrome.
Comment 1•3 years ago
|
||
The severity field is not set for this bug.
:jdescottes, could you have a look please?
For more information, please visit auto_nag documentation.
Comment 2•3 years ago
|
||
Seems to be a long standing issue (went back to 68.5) so P3 S3.
Keeping the ni? to at least add pointers about the origin of the problem.
Comment 3•3 years ago
|
||
Hi Emilio!
To position the highlighters, DevTools uses getBoxQuads
(at https://searchfox.org/mozilla-central/rev/fbf1e796ecead9484deced4d99f199f327ba25ab/devtools/shared/layout/utils.js#165-169). But for the test case here, the quad returned doesn't really match the position where the <tspan>'s text is displayed. However, getBoundingClientRect
returns the correct information. Do you think this is a bug in getBoxQuads
or is this expected?
Note: Historically I think we used getBoxQuads instead of getBoundingClientRect mostly because we drew the highlighter in the topmost frame, so we needed to compute the position of the element compared to the topmost document. But now that we have one target per frame (since Bug 1731740), we might be able to use getBoundingClientRect
again.
Assignee | ||
Comment 4•3 years ago
|
||
The issue is that getBoundingClientRect
hits this special-case, but getBoxQuads
doesn't... SVG text seems quite messy in that regard. Will try to fix.
Assignee | ||
Comment 5•3 years ago
|
||
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Comment 6•3 years ago
|
||
Thanks for working on this Emilio!
Comment 7•3 years ago
|
||
There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:emilio, could you have a look please?
For more information, please visit auto_nag documentation.
Assignee | ||
Comment 8•3 years ago
|
||
Yeah, there's a failing test I need to look into.
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Comment 11•3 years ago
|
||
bugherder |
Updated•3 years ago
|
Description
•