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)
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: CSS Parsing and Computation (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla12
Assigned To: Nathan Froyd [:froydnj]
:
Mentors:
Depends on:
Blocks:
  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:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


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

Description 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 Nathan Froyd [:froydnj] 2011-12-20 06:59:44 PST
Created attachment 583152 [details] [diff] [review]
patch

Simple patch to create nsCSSFontDescList.h and make various places use it.
Comment 2 David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 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:

#define FONT_DESC(CSS_PROP, NAME)

Otherwise, looks great.
Comment 3 Boris Zbarsky [:bz] 2011-12-21 14:29:50 PST
Comment on attachment 583152 [details] [diff] [review]
patch

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 David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 2011-12-21 18:20:34 PST
Why does either need a null?  They're only accessed by index, I hope.
Comment 5 Boris Zbarsky [:bz] 2011-12-21 18:53:24 PST
Last I checked some compilers warned on the trailing comma.  But maybe not anymore?
Comment 6 Nathan Froyd [:froydnj] 2011-12-22 05:55:02 PST
We already have trailing commas elsewhere, e.g. nsCSSProps.cpp:kCSSRawProperties.
Comment 7 Boris Zbarsky [:bz] 2011-12-22 08:09:48 PST
OK, then don't worry about it.
Comment 8 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 Ed Morley [:emorley] 2012-01-04 17:29:41 PST
https://hg.mozilla.org/mozilla-central/rev/e4fe4d48518f

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