RESOLVED FIXED Bug 64767
REGRESSION(91209?): fast/css/custom-font-xheight.html is failing on Leopard
https://bugs.webkit.org/show_bug.cgi?id=64767
Summary REGRESSION(91209?): fast/css/custom-font-xheight.html is failing on Leopard
Ryosuke Niwa
Reported 2011-07-18 16:52:07 PDT
The following tests are failing on Chromium Leopard bots: fast/blockflow/broken-ideograph-small-caps.html = IMAGE+TEXT fast/blockflow/broken-ideographic-font.html = IMAGE fast/css/custom-font-xheight.html = TEXT In addition, fast/css/custom-font-xheight.html is failing on Apple's mac port (Leopard). I suspect this is a regression due to http://trac.webkit.org/changeset/91209.
Attachments
fixes the bug for Chromium and all (2.45 KB, patch)
2011-07-18 19:31 PDT, Ryosuke Niwa
no flags
Fixed per comments (2.52 KB, patch)
2011-07-18 20:40 PDT, Ryosuke Niwa
no flags
Fixed per comments (2.52 KB, patch)
2011-07-18 20:46 PDT, Ryosuke Niwa
no flags
More fixes (2.48 KB, patch)
2011-07-18 20:56 PDT, Ryosuke Niwa
no flags
mitz
Comment 1 2011-07-18 17:29:16 PDT
I will build on Leopard and see if I can reproduce any of the failures.
mitz
Comment 2 2011-07-18 17:52:39 PDT
Working on a fix.
Ryosuke Niwa
Comment 3 2011-07-18 17:58:28 PDT
(In reply to comment #2) > Working on a fix. Thanks!
mitz
Comment 4 2011-07-18 18:21:28 PDT
Committed r91229.
James Robinson
Comment 5 2011-07-18 18:24:58 PDT
In chromium we never set BUILDING_ON_LEOPARD, since we build the same binary for leopard and snow leopard, and rely on runtime checks. Do we need this code change for chromium-on-leopard as well? If so we'll have to convert this check to a runtime check, at least for chromium.
mitz
Comment 6 2011-07-18 18:27:47 PDT
Then you will probably need a runtime check.
Ryosuke Niwa
Comment 7 2011-07-18 18:34:24 PDT
It seems like the patch broke Leopard build. /Volumes/Big/WebKit-BuildSlave/leopard-intel-debug/build/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm: In member function 'const __CTFont* WebCore::FontPlatformData::ctFont() const': /Volumes/Big/WebKit-BuildSlave/leopard-intel-debug/build/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm:207: error: expected `)' before ';' token
Ryosuke Niwa
Comment 8 2011-07-18 18:43:05 PDT
mitz
Comment 9 2011-07-18 19:21:00 PDT
(In reply to comment #8) > Build fix landed in http://trac.webkit.org/changeset/91231. Sorry about that! I built and tested my fix on Leopard, but then retyped it on another machine in an attempt to expedite things :( Thank you for cleaning up after me!
Ryosuke Niwa
Comment 10 2011-07-18 19:31:46 PDT
Created attachment 101259 [details] fixes the bug for Chromium and all
Ryosuke Niwa
Comment 11 2011-07-18 19:34:08 PDT
I feel bad to duplicate code but I couldn't figure out a way to share code with hasBrokenCTFontGetVerticalTranslationsForGlyphs or OutOfProcessFontLoadingEnabled. We should figure out a way to share code between all these functions eventually.
Ryosuke Niwa
Comment 12 2011-07-18 19:38:14 PDT
I verified that this patch builds on Chromium Mac and Mac (both 10.6).
mitz
Comment 13 2011-07-18 20:13:23 PDT
Comment on attachment 101259 [details] fixes the bug for Chromium and all View in context: https://bugs.webkit.org/attachment.cgi?id=101259&action=review I have a few comments but this is OK as-is. > Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm:195 > +static bool enableFontCascadeOptimization() The name is a little misleading, because this only controls the optimization for web fonts (the m_font == 0 case). > Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm:198 > + static SInt32 systemVersion = 0; No need to initialize a static to 0. > Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm:209 > +#elif defined(BUILDING_ON_SNOW_LEOPARD) > + return true; > +#else > + return false; > +#endif We usually try to order things such that the present and future codepath comes before the legacy codepath (as was in my change below). > Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm:223 > + else if (enableFontCascadeOptimization()) > m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_cgFont.get(), m_size, 0, 0)); > -#endif > - } > + else > + m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_cgFont.get(), m_size, 0, cascadeToLastResortFontDescriptor())); I think you can now just do something like m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_cgFont.get(), m_size, 0, enableFontCascadeOptimization() ? cascadeToLastResortFontDescriptor() : 0));
Ryosuke Niwa
Comment 14 2011-07-18 20:21:25 PDT
Comment on attachment 101259 [details] fixes the bug for Chromium and all View in context: https://bugs.webkit.org/attachment.cgi?id=101259&action=review >> Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm:195 >> +static bool enableFontCascadeOptimization() > > The name is a little misleading, because this only controls the optimization for web fonts (the m_font == 0 case). Any suggestion? >> Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm:198 >> + static SInt32 systemVersion = 0; > > No need to initialize a static to 0. I copied this code from OutOfProcessFontLoadingEnabled so I'd rather keep = 0. It could be that there was some gcc bug that doesn't initialize this properly. >> Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm:209 >> +#endif > > We usually try to order things such that the present and future codepath comes before the legacy codepath (as was in my change below). I'm confused. We do return true first here for Snow Leopard, right? Or are you saying that we should put Chromium case after Mac port case? Mn... I've started to think that I should replace defined(BUILDING_ON_SNOW_LEOPARD) by !defined(BUILDING_ON_LEOPARD) >> Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm:223 >> + m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_cgFont.get(), m_size, 0, cascadeToLastResortFontDescriptor())); > > I think you can now just do something like > m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_cgFont.get(), m_size, 0, enableFontCascadeOptimization() ? cascadeToLastResortFontDescriptor() : 0)); Sure, that looks cleaner.
mitz
Comment 15 2011-07-18 20:29:43 PDT
(In reply to comment #14) > (From update of attachment 101259 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=101259&action=review > > >> Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm:195 > >> +static bool enableFontCascadeOptimization() > > > > The name is a little misleading, because this only controls the optimization for web fonts (the m_font == 0 case). > > Any suggestion? canSetCascadeListForCustomFont() > > >> Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm:198 > >> + static SInt32 systemVersion = 0; > > > > No need to initialize a static to 0. > > I copied this code from OutOfProcessFontLoadingEnabled so I'd rather keep = 0. It could be that there was some gcc bug that doesn't initialize this properly. I very much doubt it, for two reasons: (1) there are many places in WebKit that rely on initialization of statics to 0 (or false) and this was never an issue; (2) Apple has never shipped a version of gcc with such a bug. > > >> Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm:209 > >> +#endif > > > > We usually try to order things such that the present and future codepath comes before the legacy codepath (as was in my change below). > > I'm confused. We do return true first here for Snow Leopard, right? Or are you saying that we should put Chromium case after Mac port case? Mn... I've started to think that I should replace defined(BUILDING_ON_SNOW_LEOPARD) by !defined(BUILDING_ON_LEOPARD) You’re right (and I missed the fact that the check was for Snow Leopard. That is the wrong thing to special-case, of course). > > >> Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm:223 > >> + m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_cgFont.get(), m_size, 0, cascadeToLastResortFontDescriptor())); > > > > I think you can now just do something like > > m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_cgFont.get(), m_size, 0, enableFontCascadeOptimization() ? cascadeToLastResortFontDescriptor() : 0)); > > Sure, that looks cleaner.
mitz
Comment 16 2011-07-18 20:30:12 PDT
Comment on attachment 101259 [details] fixes the bug for Chromium and all r- because it’s wrong to special-case Snow Leopard here.
Ryosuke Niwa
Comment 17 2011-07-18 20:40:09 PDT
Created attachment 101265 [details] Fixed per comments
Ryosuke Niwa
Comment 18 2011-07-18 20:46:51 PDT
Created attachment 101266 [details] Fixed per comments
Ryosuke Niwa
Comment 19 2011-07-18 20:47:29 PDT
Comment on attachment 101266 [details] Fixed per comments Ugh... another mistake :(
Ryosuke Niwa
Comment 20 2011-07-18 20:56:01 PDT
Created attachment 101267 [details] More fixes
Ryosuke Niwa
Comment 21 2011-07-18 21:14:44 PDT
Comment on attachment 101267 [details] More fixes Clearing flags on attachment: 101267 Committed r91237: <http://trac.webkit.org/changeset/91237>
Ryosuke Niwa
Comment 22 2011-07-18 21:14:49 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.