WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
225573
Remove uses of the String::toInt family of functions from the WebCore/svg and WebCore/workers directories
https://bugs.webkit.org/show_bug.cgi?id=225573
Summary
Remove uses of the String::toInt family of functions from the WebCore/svg and...
Darin Adler
Reported
2021-05-08 18:35:09 PDT
Remove uses of the String::toInt family of functions from the WebCore/svg and WebCore/workers directories
Attachments
Patch
(29.67 KB, patch)
2021-05-08 19:04 PDT
,
Darin Adler
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(30.01 KB, patch)
2021-05-08 20:48 PDT
,
Darin Adler
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(30.19 KB, patch)
2021-05-08 21:21 PDT
,
Darin Adler
sam
: review+
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Darin Adler
Comment 1
2021-05-08 19:04:55 PDT
Comment hidden (obsolete)
Created
attachment 428107
[details]
Patch
Darin Adler
Comment 2
2021-05-08 20:48:00 PDT
Comment hidden (obsolete)
Created
attachment 428109
[details]
Patch
Darin Adler
Comment 3
2021-05-08 21:21:38 PDT
Created
attachment 428111
[details]
Patch
Darin Adler
Comment 4
2021-05-08 21:53:42 PDT
Comment on
attachment 428111
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=428111&action=review
> Source/WebCore/svg/SVGToOTFFontConversion.cpp:1456 > + if (value && *value >= 0 && *value < 1000) { > + m_weight = std::max(std::min((*value + 50) / 100, static_cast<int>(std::numeric_limits<uint8_t>::max())), static_cast<int>(std::numeric_limits<uint8_t>::min()));
This std::max/min stuff is not needed. We can’t get a value outside the range 0-255 when we take a number that’s required to be in the range 0-999 and divide it by 100 (with rounding). That gives us a number in the range of 0-10, nowhere near 255, and not less than 0. I’ll remove it.
Darin Adler
Comment 5
2021-05-09 11:40:25 PDT
Accidentally commit this along at the same time as the fix for
bug 225577
. Committed
r277245
(
237514@main
): <
https://commits.webkit.org/237514@main
>
Radar WebKit Bug Importer
Comment 6
2021-05-09 11:40:35 PDT
<
rdar://problem/77717702
>
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