convert switch in nsCSSProps.cpp to table

RESOLVED FIXED in mozilla1.7beta

Status

()

P2
normal
RESOLVED FIXED
15 years ago
15 years ago

People

(Reporter: dbaron, Assigned: dbaron)

Tracking

Trunk
mozilla1.7beta
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [patch])

Attachments

(3 attachments, 1 obsolete attachment)

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.)
Created attachment 141421 [details] [diff] [review]
patch

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.
Created attachment 141422 [details] [diff] [review]
nsCSSPropList.h patch 1

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.)
Created attachment 141423 [details] [diff] [review]
nsCSSPropList.h patch 2

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+
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
Last Resolved: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.