Closed Bug 712299 Opened 13 years ago Closed 13 years ago

don't require manual syncing of font data (kCSSRawFontDescs et al)

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla12

People

(Reporter: froydnj, Assigned: froydnj)

Details

Attachments

(1 file, 1 obsolete file)

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.
Attached patch patch (obsolete) — Splinter Review
Simple patch to create nsCSSFontDescList.h and make various places use it.
Assignee: nobody → nfroyd
Status: NEW → ASSIGNED
Attachment #583152 - Flags: review?(bzbarsky)
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 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.
Attachment #583152 - Flags: review?(bzbarsky) → review+
Why does either need a null?  They're only accessed by index, I hope.
Last I checked some compilers warned on the trailing comma.  But maybe not anymore?
We already have trailing commas elsewhere, e.g. nsCSSProps.cpp:kCSSRawProperties.
OK, then don't worry about it.
Attached patch patch v2Splinter Review
Addressed bz and dbaron's comments.  Carrying over r+.
Attachment #583152 - Attachment is obsolete: true
Attachment #584780 - Flags: review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/e4fe4d48518f
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: