WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
240213
.measureText() returns TextMetrics object with rounded values for bounding box
https://bugs.webkit.org/show_bug.cgi?id=240213
Summary
.measureText() returns TextMetrics object with rounded values for bounding box
Andreas
Reported
2022-05-08 01:34:18 PDT
Created
attachment 459011
[details]
Comparison between browsers The values of the bounding box returned by CanvasRenderingContext2D.measureText() are rounded resulting in imprecise calculations in typographic centered applications (except for .actualBoundingBoxRight). The issue might be related with:
https://bugs.webkit.org/show_bug.cgi?id=225695
Attachments
Comparison between browsers
(403.06 KB, image/png)
2022-05-08 01:34 PDT
,
Andreas
no flags
Details
Test element
(668 bytes, text/html)
2022-05-08 01:35 PDT
,
Andreas
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Andreas
Comment 1
2022-05-08 01:35:08 PDT
Created
attachment 459012
[details]
Test element
Radar WebKit Bug Importer
Comment 2
2022-05-15 01:35:13 PDT
<
rdar://problem/93303504
>
Ahmad Saleem
Comment 3
2023-10-02 18:28:12 PDT
I think we have 'boundingBoxAscent' etc. in html/TextMetrics.h as 'float' but Chrome has it as 'double'. So changing it into 'double' might be solution.
Ahmad Saleem
Comment 4
2023-10-02 18:30:17 PDT
We have FIXME as well:
https://github.com/WebKit/WebKit/blob/7b833e8e18ce1474a00504b49ff46757b96e1a83/Source/WebCore/html/TextMetrics.idl#L29
IDL + C++ side both need fixes.
Rob Buis
Comment 5
2024-12-19 04:47:51 PST
Pull request:
https://github.com/WebKit/WebKit/pull/38203
EWS
Comment 6
2025-01-04 12:20:14 PST
Committed
288439@main
(b3809e07dc65): <
https://commits.webkit.org/288439@main
> Reviewed commits have been landed. Closing PR #38203 and removing active labels.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug