WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
233750
remove expandAroundIdeographs static variables
https://bugs.webkit.org/show_bug.cgi?id=233750
Summary
remove expandAroundIdeographs static variables
Cameron McCormack (:heycam)
Reported
2021-12-01 23:19:42 PST
With OffscreenCanvas, we can call into ComplexTextController::adjustGlyphsAndAdvances, FontCascade::expansionOpportunityCountInternal, and WidthIterator::calculateAdditionalWidth from worker threads. These all have a static variable variable with an initializer that calls FontCascade::canExpandAroundIdeographsInComplexText, and such initializers are not safe under -fno-threadsafe-statics. canExpandAroundIdeographsInComplexText is a simple enough function in all ports (it just returns a constant bool) that it's not worth caching the result in a static.
Attachments
Patch with dependencies for EWS
(66.71 KB, patch)
2021-12-01 23:20 PST
,
Cameron McCormack (:heycam)
no flags
Details
Formatted Diff
Diff
Patch
(5.93 KB, patch)
2021-12-01 23:21 PST
,
Cameron McCormack (:heycam)
heycam
: commit-queue+
Details
Formatted Diff
Diff
Patch to remove canExpandAroundIdeographsInComplexText which had test failures
(9.72 KB, patch)
2021-12-07 14:34 PST
,
Cameron McCormack (:heycam)
mmaxfield
: review+
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch to remove static variables
(5.93 KB, patch)
2021-12-07 17:15 PST
,
Cameron McCormack (:heycam)
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Cameron McCormack (:heycam)
Comment 1
2021-12-01 23:20:59 PST
Created
attachment 445677
[details]
Patch with dependencies for EWS
Cameron McCormack (:heycam)
Comment 2
2021-12-01 23:21:23 PST
Created
attachment 445678
[details]
Patch
Myles C. Maxfield
Comment 3
2021-12-07 00:51:45 PST
Comment on
attachment 445678
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=445678&action=review
> Source/WebCore/ChangeLog:18 > + canExpandAroundIdeographsInComplexText is a simple enough function in > + all ports (it just returns a constant bool) that it's not worth caching > + the result in a static.
Can we make the function constexpr? Do you know why the other ports can't expand around ideographs? Expanding around ideographs is a property of written language, not a property of which OS you're running on.
Cameron McCormack (:heycam)
Comment 4
2021-12-07 13:04:15 PST
(In reply to Myles C. Maxfield from
comment #3
)
> Can we make the function constexpr?
Since constexpr functions are implicitly inline, we'd need to define new header files like FontCascadeInlines{Cocoa,Win,Cairo}.h and include the right one in the cpp files that call the function. I don't think it's worth it.
> Do you know why the other ports can't expand around ideographs? Expanding > around ideographs is a property of written language, not a property of which > OS you're running on.
I don't know. The function was added in
bug 53184
and I suspect it's just that support wasn't added for non-Cocoa ports at the time.
Cameron McCormack (:heycam)
Comment 5
2021-12-07 14:04:52 PST
Offline discussion with Myles led us to conclude that all ports are now using ComplexTextController, and so we can remove canExpandAroundIdeographsInComplexText entirely.
Cameron McCormack (:heycam)
Comment 6
2021-12-07 14:34:56 PST
Created
attachment 446238
[details]
Patch to remove canExpandAroundIdeographsInComplexText which had test failures
Myles C. Maxfield
Comment 7
2021-12-07 14:47:01 PST
Comment on
attachment 446238
[details]
Patch to remove canExpandAroundIdeographsInComplexText which had test failures View in context:
https://bugs.webkit.org/attachment.cgi?id=446238&action=review
Very excited!
> Source/WebCore/ChangeLog:14 > + With OffscreenCanvas, we can call into > + ComplexTextController::adjustGlyphsAndAdvances, > + FontCascade::expansionOpportunityCountInternal, and > + WidthIterator::calculateAdditionalWidth from worker threads. > + These all have a static variable variable with an initializer > + that calls FontCascade::canExpandAroundIdeographsInComplexText, > + and such initializers are not safe under -fno-threadsafe-statics.
This should probably be updated.
Cameron McCormack (:heycam)
Comment 8
2021-12-07 14:54:04 PST
(In reply to Myles C. Maxfield from
comment #7
)
> This should probably be updated.
It's still accurate as a description of the code before the change.
Cameron McCormack (:heycam)
Comment 9
2021-12-07 16:05:12 PST
There's a failure in a ruby test on Windows, so perhaps it's not safe after all to remove those functions? At least without further digging. I'm going to move that removal patch to another bug, and land the original one here.
Cameron McCormack (:heycam)
Comment 10
2021-12-07 17:15:00 PST
Created
attachment 446260
[details]
Patch to remove static variables
EWS
Comment 11
2021-12-07 18:12:21 PST
Committed
r286637
(
244950@main
): <
https://commits.webkit.org/244950@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 446260
[details]
.
Radar WebKit Bug Importer
Comment 12
2021-12-07 18:13:23 PST
<
rdar://problem/86186510
>
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