Closed Bug 208726 Opened 21 years ago Closed 20 years ago

convert switch in nsCSSProps.cpp to table

Categories

(Core :: CSS Parsing and Computation, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla1.7beta

People

(Reporter: dbaron, Assigned: dbaron)

Details

(Whiteboard: [patch])

Attachments

(3 files, 1 obsolete file)

By adding a ninth parameter to the CSS_PROP_* macros in nsCSSPropList.h, we can
convert the big switch in nsCSSProps::LookupPropertyValue to use a table.  (We
first need to make the background-position tables consistent with the rest of them.)
Attached patch patch (obsolete) — Splinter Review
The nsCSSPropList.h changes in this patch are hard to understand.  I'll attach
two patches to nsCSSPropList.h, such that applying the two patches in order is
the equivalent of applying this patch.	Those two should be much easier to
review.
This patch was created with the following commands in vi (and has no other
changes):

:%s/iscoord_/iscoord_, kwtable_/g
:%g/^CSS_PROP_.*E)/s/)/, nsnull)/

(The first of these commands was used in many of the other files in the
previous patch as well, but there it's much easier to understand.)
This contains the additional changes after applying the previous patch (and
thus shows was changed after the two vi search-and-replace commands).
Attachment #141421 - Flags: superreview?(bzbarsky)
Attachment #141421 - Flags: review?(bzbarsky)
Status: NEW → ASSIGNED
Priority: -- → P2
Whiteboard: [patch]
Target Milestone: --- → mozilla1.7beta
Comment on attachment 141421 [details] [diff] [review]
patch

>Index: shared/public/nsCSSPropList.h

>+CSS_PROP_POSITION(-moz-box-sizing, box_sizing, MozBoxSizing, Position, mBoxSizing, eCSSType_Value, PR_FALSE, nsnull) // XXX bug 3935

kBoxSizingKTable

>+CSS_PROP_TEXT(text-transform, text_transform, TextTransform, Text, mTextTransform, eCSSType_Value, PR_FALSE, nsnull)

kTextTransformKTable

>+CSS_PROP_SVG(text-rendering, text_rendering, TextRendering, SVG, mTextRendering, eCSSType_Value, PR_FALSE, kTextRenderingTable)

kTextRenderingKTable

With those three fixed, r+sr=bzbarsky
Attachment #141421 - Flags: superreview?(bzbarsky)
Attachment #141421 - Flags: superreview+
Attachment #141421 - Flags: review?(bzbarsky)
Attachment #141421 - Flags: review+
Attached patch patchSplinter Review
Attachment #141421 - Attachment is obsolete: true
Fix checked in to trunk, 2004-02-19 10:02 -0800.

My memory is that it actually didn't help codesize very much...
Status: ASSIGNED → RESOLVED
Closed: 20 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: