RESOLVED FIXED 229839
FontFaceSet.status needs to react to style changes
https://bugs.webkit.org/show_bug.cgi?id=229839
Summary FontFaceSet.status needs to react to style changes
Myles C. Maxfield
Reported 2021-09-02 16:21:10 PDT
FontFaceSet.status needs to react to style changes
Attachments
Patch (4.76 KB, patch)
2021-09-02 16:23 PDT, Myles C. Maxfield
no flags
Patch (4.42 KB, patch)
2021-09-02 19:13 PDT, Myles C. Maxfield
sam: review+
Myles C. Maxfield
Comment 1 2021-09-02 16:23:33 PDT
Myles C. Maxfield
Comment 2 2021-09-02 18:50:02 PDT
Comment on attachment 437212 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=437212&action=review > LayoutTests/ChangeLog:8 > + This is not a WPT test because it requires webfont/slow-ahem-loading.cgi. Oh, I think I can actually turn this into a WPT test
Myles C. Maxfield
Comment 3 2021-09-02 18:55:10 PDT
Comment on attachment 437212 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=437212&action=review >> LayoutTests/ChangeLog:8 >> + This is not a WPT test because it requires webfont/slow-ahem-loading.cgi. > > Oh, I think I can actually turn this into a WPT test Oh, no, I can't, because the font may be cached, which will make the status update synchronously. So this needs internals.clearMemoryCache(). But I can at least make it less racey.
Myles C. Maxfield
Comment 4 2021-09-02 19:13:35 PDT
Sam Weinig
Comment 5 2021-09-03 09:43:17 PDT
Comment on attachment 437233 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=437233&action=review > Source/WebCore/css/FontFaceSet.cpp:191 > + auto protect = m_backing; Hm. This clearly does the right thing, but I usually like to ensure we are actually in a Ref or RefPtr when using the protect idiom by doing something like: Ref protect = backing; just to make sure that if m_backing ever changes type this is still doing what we expect. Since m_backing is a Ref, I guess the posibilities here are that either 'this' got deleted or m_backing got replaced and the original value got deleted. Would be interesting to try and add tests for either of those cases if possible.
Myles C. Maxfield
Comment 6 2021-09-03 12:51:51 PDT
Comment on attachment 437233 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=437233&action=review >> Source/WebCore/css/FontFaceSet.cpp:191 >> + auto protect = m_backing; > > Hm. This clearly does the right thing, but I usually like to ensure we are actually in a Ref or RefPtr when using the protect idiom by doing something like: > > Ref protect = backing; > > just to make sure that if m_backing ever changes type this is still doing what we expect. > > Since m_backing is a Ref, I guess the posibilities here are that either 'this' got deleted or m_backing got replaced and the original value got deleted. Would be interesting to try and add tests for either of those cases if possible. Yeah. I'll land this with "Ref" instead of "auto" and I'll try to come up with a test that exercises the deletion problem in a follow-up.
Myles C. Maxfield
Comment 7 2021-09-03 13:03:31 PDT
Radar WebKit Bug Importer
Comment 8 2021-09-03 13:04:22 PDT
Fujii Hironori
Comment 9 2021-09-05 12:50:48 PDT
Carlos Alberto Lopez Perez
Comment 10 2021-09-06 16:49:44 PDT
(In reply to Fujii Hironori from comment #9) > fast/text/FontFaceSet-status-after-style-update.html is flaky. > https://results.webkit.org/?suite=layout- > tests&test=fast%2Ftext%2FFontFaceSet-status-after-style-update.html Reported it on bug 229975
Note You need to log in before you can comment on or make changes to this bug.