Last Comment Bug 712299 - don't require manual syncing of font data (kCSSRawFontDescs et al)
: don't require manual syncing of font data (kCSSRawFontDescs et al)
Product: Core
Classification: Components
Component: CSS Parsing and Computation (show other bugs)
: unspecified
: All All
-- normal (vote)
: mozilla12
Assigned To: Nathan Froyd [:froydnj]
: Jet Villegas (:jet)
Depends on:
  Show dependency treegraph
Reported: 2011-12-20 06:48 PST by Nathan Froyd [:froydnj]
Modified: 2012-01-04 17:29 PST (History)
3 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

patch (6.01 KB, patch)
2011-12-20 06:59 PST, Nathan Froyd [:froydnj]
bzbarsky: review+
Details | Diff | Splinter Review
patch v2 (6.08 KB, patch)
2011-12-29 10:02 PST, Nathan Froyd [:froydnj]
nfroyd: review+
Details | Diff | Splinter Review

Description User image Nathan Froyd [:froydnj] 2011-12-20 06:48:37 PST
Comments with nsCSSProps.cpp:kCSSRawFontDescs and elsewhere warn the reader about keeping various bits in sync.  No one list is complete and each list is slightly different.

Make the madness stop!  Patch incoming.
Comment 1 User image Nathan Froyd [:froydnj] 2011-12-20 06:59:44 PST
Created attachment 583152 [details] [diff] [review]

Simple patch to create nsCSSFontDescList.h and make various places use it.
Comment 2 User image David Baron :dbaron: ⌚️UTC-8 2011-12-20 07:11:48 PST
Could you make the parameters to the macro not be uppercase, but instead have a trailing _ character?  That matches the style of other things in nearby code, in particular, nsCSSPropList.h.  Also, since the fields actually match 2 of the fields in the CSS_PROP macro, could you use the same names, so that you have:

#define CSS_FONT_DESC(name_, method_)

instead of:


Otherwise, looks great.
Comment 3 User image Boris Zbarsky [:bz] (still a bit busy) 2011-12-21 14:29:50 PST
Comment on attachment 583152 [details] [diff] [review]

In addition to what dbaron said, those trailing commas are likely to be a problem, iirc.

Add nsnull at the end of kCSSRawFontDescs, for sure; I think nsCSSFontFaceStyleDecl::Fields should have one too.

r=me with that.
Comment 4 User image David Baron :dbaron: ⌚️UTC-8 2011-12-21 18:20:34 PST
Why does either need a null?  They're only accessed by index, I hope.
Comment 5 User image Boris Zbarsky [:bz] (still a bit busy) 2011-12-21 18:53:24 PST
Last I checked some compilers warned on the trailing comma.  But maybe not anymore?
Comment 6 User image Nathan Froyd [:froydnj] 2011-12-22 05:55:02 PST
We already have trailing commas elsewhere, e.g. nsCSSProps.cpp:kCSSRawProperties.
Comment 7 User image Boris Zbarsky [:bz] (still a bit busy) 2011-12-22 08:09:48 PST
OK, then don't worry about it.
Comment 8 User image Nathan Froyd [:froydnj] 2011-12-29 10:02:50 PST
Created attachment 584780 [details] [diff] [review]
patch v2

Addressed bz and dbaron's comments.  Carrying over r+.
Comment 10 User image Ed Morley [:emorley] 2012-01-04 17:29:41 PST

Note You need to log in before you can comment on or make changes to this bug.