From b28fa03480afbfa6eb1e8461e044e84bb40a5238 Mon Sep 17 00:00:00 2001 From: Jonathan Kew Date: Sun, 25 Sep 2022 23:04:31 +0000 Subject: [PATCH] Bug 1740526 - Let OTS validate the COLR/CPAL tables. r=gfx-reviewers,lsalzman Differential Revision: https://phabricator.services.mozilla.com/D157476 --- gfx/thebes/gfxOTSUtils.h | 6 ++-- layout/reftests/font-face/CAhem.ttf | Bin 12448 -> 12448 bytes layout/reftests/font-face/reftest.list | 47 +++++++++++++------------ 3 files changed, 26 insertions(+), 27 deletions(-) diff --git a/gfx/thebes/gfxOTSUtils.h b/gfx/thebes/gfxOTSUtils.h index 5f1205173684..3923bd5af16e 100644 --- a/gfx/thebes/gfxOTSUtils.h +++ b/gfx/thebes/gfxOTSUtils.h @@ -105,16 +105,14 @@ class MOZ_STACK_CLASS gfxOTSContext : public ots::OTSContext { } virtual ots::TableAction GetTableAction(uint32_t aTag) override { - // Preserve Graphite, color glyph and SVG tables, + // Preserve Graphite and SVG tables, // and possibly OTL and Variation tables (depending on prefs) if ((!mCheckOTLTables && (aTag == TRUETYPE_TAG('G', 'D', 'E', 'F') || aTag == TRUETYPE_TAG('G', 'P', 'O', 'S') || aTag == TRUETYPE_TAG('G', 'S', 'U', 'B')))) { return ots::TABLE_ACTION_PASSTHRU; } - if (aTag == TRUETYPE_TAG('S', 'V', 'G', ' ') || - aTag == TRUETYPE_TAG('C', 'O', 'L', 'R') || - aTag == TRUETYPE_TAG('C', 'P', 'A', 'L')) { + if (aTag == TRUETYPE_TAG('S', 'V', 'G', ' ')) { return ots::TABLE_ACTION_PASSTHRU; } if (mKeepColorBitmaps && (aTag == TRUETYPE_TAG('C', 'B', 'D', 'T') || diff --git a/layout/reftests/font-face/CAhem.ttf b/layout/reftests/font-face/CAhem.ttf index c433470030b4c4a7a5d174fa50ee3b0fd5dc8851..0d9d7b843c57a41d9626de6c96d6aca95b2c03ab 100644 GIT binary patch delta 74 zcmZ3GxFAuOfsuiMK>$dwFfcg#`vh&h7(Y?CkNM0CrHM-lrPf`foO13{q!g+}x}o%K-q|$dwFfcg#`vh&hm@rYek9kq!)`?3BrK1gh#Pi#HW#DFh0aV7Y aIX^xUMBmrG_h_>LV~{!{)8=LkSq=aUiWRT` diff --git a/layout/reftests/font-face/reftest.list b/layout/reftests/font-face/reftest.list index a55e315be925..9f3b1466d2f8 100644 --- a/layout/reftests/font-face/reftest.list +++ b/layout/reftests/font-face/reftest.list @@ -163,37 +163,38 @@ fuzzy-if(OSX,198-198,172-172) == color-1b.html color-1-ref.html # COLRv1 (enhanced color font) format # Comparing COLRv1 glyph rendering to CSS backgrounds we can expect "fuzz" in lots of gradients # and along antialiased diagonals, etc., but the differences are barely perceptible to the eye. +# These are skipped on Win7 because lack of font-variation support means the COLR table +# in the test font CAhem.ttf will be dropped. defaults pref(gfx.font_rendering.colr_v1.enabled,true) -== colrv1-01.html#A colrv1-01-ref.html#A -== colrv1-01.html#B colrv1-01-ref.html#B -fuzzy(0-1,0-10000) == colrv1-01.html#C colrv1-01-ref.html#C -fuzzy(0-1,0-600) == colrv1-01.html#D colrv1-01-ref.html#D -fuzzy(0-1,0-200) == colrv1-01.html#E colrv1-01-ref.html#E -fuzzy(0-1,0-200) == colrv1-01.html#F colrv1-01-ref.html#F -fuzzy(0-1,0-400) == colrv1-01.html#G colrv1-01-ref.html#G -fuzzy(0-1,0-400) == colrv1-01.html#H colrv1-01-ref.html#H -fuzzy(0-1,0-10000) == colrv1-01.html#I colrv1-01-ref.html#I -fuzzy(0-1,0-576) == colrv1-01.html#J colrv1-01-ref.html#J -fuzzy(0-1,0-748) == colrv1-01.html#K colrv1-01-ref.html#K -fuzzy(0-1,0-851) == colrv1-01.html#L colrv1-01-ref.html#L -fuzzy(0-1,0-668) == colrv1-01.html#M colrv1-01-ref.html#M -fuzzy(0-1,0-848) == colrv1-01.html#N colrv1-01-ref.html#N -fuzzy(0-1,0-675) == colrv1-01.html#O colrv1-01-ref.html#O -== colrv1-01.html#P colrv1-01-ref.html#P -fuzzy(0-138,0-318) == colrv1-01.html#Q colrv1-01-ref.html#Q -fuzzy(0-214,0-158) == colrv1-01.html#R colrv1-01-ref.html#R -fuzzy(0-255,0-156) == colrv1-01.html#S colrv1-01-ref.html#S -fuzzy(0-237,0-277) == colrv1-01.html#T colrv1-01-ref.html#T +skip-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == colrv1-01.html#A colrv1-01-ref.html#A +skip-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == colrv1-01.html#B colrv1-01-ref.html#B +skip-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fuzzy(0-1,0-10000) == colrv1-01.html#C colrv1-01-ref.html#C +skip-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fuzzy(0-1,0-600) == colrv1-01.html#D colrv1-01-ref.html#D +skip-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fuzzy(0-1,0-200) == colrv1-01.html#E colrv1-01-ref.html#E +skip-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fuzzy(0-1,0-200) == colrv1-01.html#F colrv1-01-ref.html#F +skip-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fuzzy(0-1,0-400) == colrv1-01.html#G colrv1-01-ref.html#G +skip-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fuzzy(0-1,0-400) == colrv1-01.html#H colrv1-01-ref.html#H +skip-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fuzzy(0-1,0-10000) == colrv1-01.html#I colrv1-01-ref.html#I +skip-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fuzzy(0-1,0-576) == colrv1-01.html#J colrv1-01-ref.html#J +skip-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fuzzy(0-1,0-748) == colrv1-01.html#K colrv1-01-ref.html#K +skip-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fuzzy(0-1,0-851) == colrv1-01.html#L colrv1-01-ref.html#L +skip-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fuzzy(0-1,0-668) == colrv1-01.html#M colrv1-01-ref.html#M +skip-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fuzzy(0-1,0-848) == colrv1-01.html#N colrv1-01-ref.html#N +skip-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fuzzy(0-1,0-675) == colrv1-01.html#O colrv1-01-ref.html#O +skip-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == colrv1-01.html#P colrv1-01-ref.html#P +skip-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fuzzy(0-138,0-318) == colrv1-01.html#Q colrv1-01-ref.html#Q +skip-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fuzzy(0-214,0-158) == colrv1-01.html#R colrv1-01-ref.html#R +skip-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fuzzy(0-255,0-156) == colrv1-01.html#S colrv1-01-ref.html#S +skip-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fuzzy(0-237,0-277) == colrv1-01.html#T colrv1-01-ref.html#T -# Skip tests that require font variations on Win7, as not supported by DWrite there. skip-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fuzzy(0-1,0-1) == colrv1-03.html colrv1-03-ref.html skip-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fuzzy(0-1,0-600) fuzzy-if(Android,0-64,0-37100) == colrv1-04.html colrv1-04-ref.html defaults # Check that the tech(color-COLRv1) function responds to whether COLRv1 support is enabled. defaults pref(layout.css.font-tech.enabled,true) -pref(gfx.font_rendering.colr_v1.enabled,true) == colrv1-02.html colrv1-02a-ref.html -pref(gfx.font_rendering.colr_v1.enabled,false) == colrv1-02.html colrv1-02b-ref.html +skip-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) pref(gfx.font_rendering.colr_v1.enabled,true) == colrv1-02.html colrv1-02a-ref.html +skip-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) pref(gfx.font_rendering.colr_v1.enabled,false) == colrv1-02.html colrv1-02b-ref.html defaults == woff2-1.html woff2-1-ref.html