Make whether a property should be ignored when page colors are disabled part of the property flags table. (Bug 503188) r=bzbarsky
authorL. David Baron <dbaron@dbaron.org>
Wed, 15 Jul 2009 17:24:24 -0700
changeset 30347 afac199a815302c8abc9cc8764e6748ab28805f4
parent 30346 df6b05ee9830e3d3d847392729bdb3a2413c649d
child 30348 a23d948042c9a90710cf54f61989918c6639ad0e
push idunknown
push userunknown
push dateunknown
reviewersbzbarsky
bugs503188
milestone1.9.2a1pre
Make whether a property should be ignored when page colors are disabled part of the property flags table. (Bug 503188) r=bzbarsky
layout/style/nsCSSDataBlock.cpp
layout/style/nsCSSPropList.h
layout/style/nsCSSProps.h
--- a/layout/style/nsCSSDataBlock.cpp
+++ b/layout/style/nsCSSDataBlock.cpp
@@ -210,63 +210,59 @@ nsCSSCompressedDataBlock::MapRuleInfoInt
                                 }
                             }
                         }
                         *target = *val;
                         if (iProp == eCSSProperty_font_family) {
                             // XXX Are there other things like this?
                             aRuleData->mFontData->mFamilyFromHTML = PR_FALSE;
                         }
-                        else if (iProp == eCSSProperty_color ||
-                                 iProp == eCSSProperty_background_color ||
-                                 iProp == eCSSProperty_border_top_color ||
-                                 iProp == eCSSProperty_border_right_color_value ||
-                                 iProp == eCSSProperty_border_right_color_ltr_source ||
-                                 iProp == eCSSProperty_border_right_color_rtl_source ||
-                                 iProp == eCSSProperty_border_bottom_color ||
-                                 iProp == eCSSProperty_border_left_color_value ||
-                                 iProp == eCSSProperty_border_left_color_ltr_source ||
-                                 iProp == eCSSProperty_border_left_color_rtl_source ||
-                                 iProp == eCSSProperty__moz_column_rule_color ||
-                                 iProp == eCSSProperty_outline_color) {
-                            if (ShouldIgnoreColors(aRuleData)) {
-                                if (iProp == eCSSProperty_background_color) {
-                                    // Force non-'transparent' background
-                                    // colors to the user's default.
-                                    if (target->IsNonTransparentColor()) {
-                                        target->SetColorValue(aRuleData->
-                                            mPresContext->
-                                            DefaultBackgroundColor());
-                                    }
-                                } else {
-                                    // Ignore 'color', 'border-*-color', etc.
-                                    *target = nsCSSValue();
+                        if (nsCSSProps::PropHasFlags(iProp,
+                                CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED) &&
+                            ShouldIgnoreColors(aRuleData))
+                        {
+                            if (iProp == eCSSProperty_background_color) {
+                                // Force non-'transparent' background
+                                // colors to the user's default.
+                                if (target->IsNonTransparentColor()) {
+                                    target->SetColorValue(aRuleData->
+                                        mPresContext->
+                                        DefaultBackgroundColor());
                                 }
+                            } else {
+                                // Ignore 'color', 'border-*-color', etc.
+                                *target = nsCSSValue();
                             }
                         }
                     }
                     cursor += CDBValueStorage_advance;
                 } break;
 
                 case eCSSType_Rect: {
+                    NS_ABORT_IF_FALSE(!nsCSSProps::PropHasFlags(iProp,
+                        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED),
+                        "this case needs to handle color properties");
                     const nsCSSRect* val = RectAtCursor(cursor);
                     NS_ASSERTION(val->HasValue(), "oops");
                     nsCSSRect* target = static_cast<nsCSSRect*>(prop);
                     if (target->mTop.GetUnit() == eCSSUnit_Null)
                         target->mTop = val->mTop;
                     if (target->mRight.GetUnit() == eCSSUnit_Null)
                         target->mRight = val->mRight;
                     if (target->mBottom.GetUnit() == eCSSUnit_Null)
                         target->mBottom = val->mBottom;
                     if (target->mLeft.GetUnit() == eCSSUnit_Null)
                         target->mLeft = val->mLeft;
                     cursor += CDBRectStorage_advance;
                 } break;
 
                 case eCSSType_ValuePair: {
+                    NS_ABORT_IF_FALSE(!nsCSSProps::PropHasFlags(iProp,
+                        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED),
+                        "this case needs to handle color properties");
                     const nsCSSValuePair* val = ValuePairAtCursor(cursor);
                     NS_ASSERTION(val->mXValue.GetUnit() != eCSSUnit_Null ||
                                  val->mYValue.GetUnit() != eCSSUnit_Null, "oops");
                     nsCSSValuePair* target = static_cast<nsCSSValuePair*>(prop);
                     NS_ASSERTION((target->mXValue.GetUnit() == eCSSUnit_Null)
                               == (target->mYValue.GetUnit() == eCSSUnit_Null),
                                  "half a property?");
                     if (target->mXValue.GetUnit() == eCSSUnit_Null) {
@@ -300,24 +296,21 @@ nsCSSCompressedDataBlock::MapRuleInfoInt
                 // fall through
                 case eCSSType_ValuePairList: {
                     void** target = static_cast<void**>(prop);
                     if (!*target) {
                         void* val = PointerAtCursor(cursor);
                         NS_ASSERTION(val, "oops");
                         *target = val;
 
-                        if (iProp == eCSSProperty_background_image ||
-                            iProp == eCSSProperty_border_top_colors ||
-                            iProp == eCSSProperty_border_right_colors ||
-                            iProp == eCSSProperty_border_bottom_colors ||
-                            iProp == eCSSProperty_border_left_colors) {
-                            if (ShouldIgnoreColors(aRuleData)) {
-                                *target = nsnull;
-                            }
+                        if (nsCSSProps::PropHasFlags(iProp,
+                                CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED) &&
+                            ShouldIgnoreColors(aRuleData))
+                        {
+                            *target = nsnull;
                         }
                     }
                     cursor += CDBPointerStorage_advance;
                 } break;
             }
         } else {
             switch (nsCSSProps::kTypeTable[iProp]) {
                 case eCSSType_Value: {
--- a/layout/style/nsCSSPropList.h
+++ b/layout/style/nsCSSPropList.h
@@ -287,27 +287,27 @@ CSS_PROP_OUTLINE(-moz-outline-radius-bot
 CSS_PROP_OUTLINE(-moz-outline-radius-bottomleft, _moz_outline_radius_bottomLeft, MozOutlineRadiusBottomleft, 0, Margin, mOutlineRadius.mBottomLeft, eCSSType_ValuePair, nsnull)
 #ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
 CSS_PROP_FONT(-x-system-font, _x_system_font, X, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE, Font, mSystemFont, eCSSType_Value, kFontKTable)
 #endif
 CSS_PROP_BACKENDONLY(azimuth, azimuth, Azimuth, 0, Aural, mAzimuth, eCSSType_Value, kAzimuthKTable)
 CSS_PROP_SHORTHAND(background, background, Background, 0)
 CSS_PROP_BACKGROUND(background-attachment, background_attachment, BackgroundAttachment, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE | CSS_PROPERTY_VALUE_LIST_USES_COMMAS, Color, mBackAttachment, eCSSType_ValueList, kBackgroundAttachmentKTable)
 CSS_PROP_BACKGROUND(-moz-background-clip, _moz_background_clip, MozBackgroundClip, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE | CSS_PROPERTY_VALUE_LIST_USES_COMMAS, Color, mBackClip, eCSSType_ValueList, kBackgroundClipKTable)
-CSS_PROP_BACKGROUND(background-color, background_color, BackgroundColor, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE, Color, mBackColor, eCSSType_Value, nsnull)
-CSS_PROP_BACKGROUND(background-image, background_image, BackgroundImage, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE | CSS_PROPERTY_VALUE_LIST_USES_COMMAS, Color, mBackImage, eCSSType_ValueList, nsnull)
+CSS_PROP_BACKGROUND(background-color, background_color, BackgroundColor, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE | CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED, Color, mBackColor, eCSSType_Value, nsnull)
+CSS_PROP_BACKGROUND(background-image, background_image, BackgroundImage, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE | CSS_PROPERTY_VALUE_LIST_USES_COMMAS | CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED, Color, mBackImage, eCSSType_ValueList, nsnull)
 CSS_PROP_BACKGROUND(-moz-background-inline-policy, _moz_background_inline_policy, MozBackgroundInlinePolicy, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE, Color, mBackInlinePolicy, eCSSType_Value, kBackgroundInlinePolicyKTable)
 CSS_PROP_BACKGROUND(-moz-background-origin, _moz_background_origin, MozBackgroundOrigin, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE | CSS_PROPERTY_VALUE_LIST_USES_COMMAS, Color, mBackOrigin, eCSSType_ValueList, kBackgroundOriginKTable)
 CSS_PROP_BACKGROUND(background-position, background_position, BackgroundPosition, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE | CSS_PROPERTY_VALUE_LIST_USES_COMMAS, Color, mBackPosition, eCSSType_ValuePairList, kBackgroundPositionKTable)
 CSS_PROP_BACKGROUND(background-repeat, background_repeat, BackgroundRepeat, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE | CSS_PROPERTY_VALUE_LIST_USES_COMMAS, Color, mBackRepeat, eCSSType_ValueList, kBackgroundRepeatKTable)
 CSS_PROP_DISPLAY(-moz-binding, binding, MozBinding, 0, Display, mBinding, eCSSType_Value, nsnull) // XXX bug 3935
 CSS_PROP_SHORTHAND(border, border, Border, 0)
 CSS_PROP_SHORTHAND(border-bottom, border_bottom, BorderBottom, 0)
-CSS_PROP_BORDER(border-bottom-color, border_bottom_color, BorderBottomColor, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER, Margin, mBorderColor.mBottom, eCSSType_Value, kBorderColorKTable)
-CSS_PROP_BORDER(-moz-border-bottom-colors, border_bottom_colors, MozBorderBottomColors, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER, Margin, mBorderColors.mBottom, eCSSType_ValueList, nsnull)
+CSS_PROP_BORDER(border-bottom-color, border_bottom_color, BorderBottomColor, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER | CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED, Margin, mBorderColor.mBottom, eCSSType_Value, kBorderColorKTable)
+CSS_PROP_BORDER(-moz-border-bottom-colors, border_bottom_colors, MozBorderBottomColors, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER | CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED, Margin, mBorderColors.mBottom, eCSSType_ValueList, nsnull)
 CSS_PROP_BORDER(border-bottom-style, border_bottom_style, BorderBottomStyle, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER, Margin, mBorderStyle.mBottom, eCSSType_Value, kBorderStyleKTable)  // on/off will need reflow
 CSS_PROP_BORDER(border-bottom-width, border_bottom_width, BorderBottomWidth, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER, Margin, mBorderWidth.mBottom, eCSSType_Value, kBorderWidthKTable)
 CSS_PROP_TABLEBORDER(border-collapse, border_collapse, BorderCollapse, 0, Table, mBorderCollapse, eCSSType_Value, kBorderCollapseKTable)
 CSS_PROP_SHORTHAND(border-color, border_color, BorderColor, 0)
 CSS_PROP_SHORTHAND(-moz-border-end, border_end, MozBorderEnd, 0)
 CSS_PROP_SHORTHAND(-moz-border-end-color, border_end_color, MozBorderEndColor, 0)
 #ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
 CSS_PROP_BORDER(border-end-color-value, border_end_color_value, X, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER, Margin, mBorderEndColor, eCSSType_Value, kBorderColorKTable)
@@ -319,41 +319,41 @@ CSS_PROP_BORDER(border-end-style-value, 
 CSS_PROP_SHORTHAND(-moz-border-end-width, border_end_width, MozBorderEndWidth, 0)
 #ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
 CSS_PROP_BORDER(border-end-width-value, border_end_width_value, X, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER, Margin, mBorderEndWidth, eCSSType_Value, kBorderWidthKTable)
 #endif
 CSS_PROP_BORDER(-moz-border-image, border_image, MozBorderImage, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER, Margin, mBorderImage, eCSSType_Value, kBorderImageKTable)
 CSS_PROP_SHORTHAND(border-left, border_left, BorderLeft, 0)
 CSS_PROP_SHORTHAND(border-left-color, border_left_color, BorderLeftColor, 0)
 #ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
-CSS_PROP_BORDER(border-left-color-value, border_left_color_value, X, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER, Margin, mBorderColor.mLeft, eCSSType_Value, kBorderColorKTable)
-CSS_PROP_BORDER(border-left-color-ltr-source, border_left_color_ltr_source, X, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER | CSS_PROPERTY_DIRECTIONAL_SOURCE, Margin, mBorderLeftColorLTRSource, eCSSType_Value, kBoxPropSourceKTable)
-CSS_PROP_BORDER(border-left-color-rtl-source, border_left_color_rtl_source, X, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER | CSS_PROPERTY_DIRECTIONAL_SOURCE, Margin, mBorderLeftColorRTLSource, eCSSType_Value, kBoxPropSourceKTable)
+CSS_PROP_BORDER(border-left-color-value, border_left_color_value, X, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER | CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED, Margin, mBorderColor.mLeft, eCSSType_Value, kBorderColorKTable)
+CSS_PROP_BORDER(border-left-color-ltr-source, border_left_color_ltr_source, X, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER | CSS_PROPERTY_DIRECTIONAL_SOURCE | CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED, Margin, mBorderLeftColorLTRSource, eCSSType_Value, kBoxPropSourceKTable)
+CSS_PROP_BORDER(border-left-color-rtl-source, border_left_color_rtl_source, X, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER | CSS_PROPERTY_DIRECTIONAL_SOURCE | CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED, Margin, mBorderLeftColorRTLSource, eCSSType_Value, kBoxPropSourceKTable)
 #endif
-CSS_PROP_BORDER(-moz-border-left-colors, border_left_colors, MozBorderLeftColors, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER, Margin, mBorderColors.mLeft, eCSSType_ValueList, nsnull)
+CSS_PROP_BORDER(-moz-border-left-colors, border_left_colors, MozBorderLeftColors, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER | CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED, Margin, mBorderColors.mLeft, eCSSType_ValueList, nsnull)
 CSS_PROP_SHORTHAND(border-left-style, border_left_style, BorderLeftStyle, 0) // on/off will need reflow
 #ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
 CSS_PROP_BORDER(border-left-style-value, border_left_style_value, X, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER, Margin, mBorderStyle.mLeft, eCSSType_Value, kBorderStyleKTable)
 CSS_PROP_BORDER(border-left-style-ltr-source, border_left_style_ltr_source, X, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER | CSS_PROPERTY_DIRECTIONAL_SOURCE, Margin, mBorderLeftStyleLTRSource, eCSSType_Value, kBoxPropSourceKTable)
 CSS_PROP_BORDER(border-left-style-rtl-source, border_left_style_rtl_source, X, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER | CSS_PROPERTY_DIRECTIONAL_SOURCE, Margin, mBorderLeftStyleRTLSource, eCSSType_Value, kBoxPropSourceKTable)
 #endif
 CSS_PROP_SHORTHAND(border-left-width, border_left_width, BorderLeftWidth, 0)
 #ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
 CSS_PROP_BORDER(border-left-width-value, border_left_width_value, X, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER, Margin, mBorderWidth.mLeft, eCSSType_Value, kBorderWidthKTable)
 CSS_PROP_BORDER(border-left-width-ltr-source, border_left_width_ltr_source, X, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER | CSS_PROPERTY_DIRECTIONAL_SOURCE, Margin, mBorderLeftWidthLTRSource, eCSSType_Value, kBoxPropSourceKTable)
 CSS_PROP_BORDER(border-left-width-rtl-source, border_left_width_rtl_source, X, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER | CSS_PROPERTY_DIRECTIONAL_SOURCE, Margin, mBorderLeftWidthRTLSource, eCSSType_Value, kBoxPropSourceKTable)
 #endif
 CSS_PROP_SHORTHAND(border-right, border_right, BorderRight, 0)
 CSS_PROP_SHORTHAND(border-right-color, border_right_color, BorderRightColor, 0)
 #ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
-CSS_PROP_BORDER(border-right-color-value, border_right_color_value, X, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER, Margin, mBorderColor.mRight, eCSSType_Value, kBorderColorKTable)
-CSS_PROP_BORDER(border-right-color-ltr-source, border_right_color_ltr_source, X, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER | CSS_PROPERTY_DIRECTIONAL_SOURCE, Margin, mBorderRightColorLTRSource, eCSSType_Value, kBoxPropSourceKTable)
-CSS_PROP_BORDER(border-right-color-rtl-source, border_right_color_rtl_source, X, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER | CSS_PROPERTY_DIRECTIONAL_SOURCE, Margin, mBorderRightColorRTLSource, eCSSType_Value, kBoxPropSourceKTable)
+CSS_PROP_BORDER(border-right-color-value, border_right_color_value, X, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER | CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED, Margin, mBorderColor.mRight, eCSSType_Value, kBorderColorKTable)
+CSS_PROP_BORDER(border-right-color-ltr-source, border_right_color_ltr_source, X, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER | CSS_PROPERTY_DIRECTIONAL_SOURCE | CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED, Margin, mBorderRightColorLTRSource, eCSSType_Value, kBoxPropSourceKTable)
+CSS_PROP_BORDER(border-right-color-rtl-source, border_right_color_rtl_source, X, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER | CSS_PROPERTY_DIRECTIONAL_SOURCE | CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED, Margin, mBorderRightColorRTLSource, eCSSType_Value, kBoxPropSourceKTable)
 #endif
-CSS_PROP_BORDER(-moz-border-right-colors, border_right_colors, MozBorderRightColors, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER, Margin, mBorderColors.mRight, eCSSType_ValueList, nsnull)
+CSS_PROP_BORDER(-moz-border-right-colors, border_right_colors, MozBorderRightColors, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER | CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED, Margin, mBorderColors.mRight, eCSSType_ValueList, nsnull)
 CSS_PROP_SHORTHAND(border-right-style, border_right_style, BorderRightStyle, 0) // on/off will need reflow
 #ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
 CSS_PROP_BORDER(border-right-style-value, border_right_style_value, X, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER, Margin, mBorderStyle.mRight, eCSSType_Value, kBorderStyleKTable)
 CSS_PROP_BORDER(border-right-style-ltr-source, border_right_style_ltr_source, X, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER | CSS_PROPERTY_DIRECTIONAL_SOURCE, Margin, mBorderRightStyleLTRSource, eCSSType_Value, kBoxPropSourceKTable)
 CSS_PROP_BORDER(border-right-style-rtl-source, border_right_style_rtl_source, X, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER | CSS_PROPERTY_DIRECTIONAL_SOURCE, Margin, mBorderRightStyleRTLSource, eCSSType_Value, kBoxPropSourceKTable)
 #endif
 CSS_PROP_SHORTHAND(border-right-width, border_right_width, BorderRightWidth, 0)
 #ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
@@ -372,33 +372,33 @@ CSS_PROP_SHORTHAND(-moz-border-start-sty
 CSS_PROP_BORDER(border-start-style-value, border_start_style_value, X, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER, Margin, mBorderStartStyle, eCSSType_Value, kBorderStyleKTable)
 #endif
 CSS_PROP_SHORTHAND(-moz-border-start-width, border_start_width, MozBorderStartWidth, 0)
 #ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
 CSS_PROP_BORDER(border-start-width-value, border_start_width_value, X, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER, Margin, mBorderStartWidth, eCSSType_Value, kBorderWidthKTable)
 #endif
 CSS_PROP_SHORTHAND(border-style, border_style, BorderStyle, 0)  // on/off will need reflow
 CSS_PROP_SHORTHAND(border-top, border_top, BorderTop, 0)
-CSS_PROP_BORDER(border-top-color, border_top_color, BorderTopColor, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER, Margin, mBorderColor.mTop, eCSSType_Value, kBorderColorKTable)
-CSS_PROP_BORDER(-moz-border-top-colors, border_top_colors, MozBorderTopColors, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER, Margin, mBorderColors.mTop, eCSSType_ValueList, nsnull)
+CSS_PROP_BORDER(border-top-color, border_top_color, BorderTopColor, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER | CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED, Margin, mBorderColor.mTop, eCSSType_Value, kBorderColorKTable)
+CSS_PROP_BORDER(-moz-border-top-colors, border_top_colors, MozBorderTopColors, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER | CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED, Margin, mBorderColors.mTop, eCSSType_ValueList, nsnull)
 CSS_PROP_BORDER(border-top-style, border_top_style, BorderTopStyle, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER, Margin, mBorderStyle.mTop, eCSSType_Value, kBorderStyleKTable)  // on/off will need reflow
 CSS_PROP_BORDER(border-top-width, border_top_width, BorderTopWidth, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER, Margin, mBorderWidth.mTop, eCSSType_Value, kBorderWidthKTable)
 CSS_PROP_SHORTHAND(border-width, border_width, BorderWidth, 0)
 CSS_PROP_POSITION(bottom, bottom, Bottom, 0, Position, mOffset.mBottom, eCSSType_Value, nsnull)
 CSS_PROP_BORDER(-moz-box-shadow, box_shadow, MozBoxShadow, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER | CSS_PROPERTY_VALUE_LIST_USES_COMMAS, Margin, mBoxShadow, eCSSType_ValueList, kBoxShadowTypeKTable)
 CSS_PROP_POSITION(-moz-box-sizing, box_sizing, MozBoxSizing, 0, Position, mBoxSizing, eCSSType_Value, kBoxSizingKTable) // XXX bug 3935
 CSS_PROP_TABLEBORDER(caption-side, caption_side, CaptionSide, 0, Table, mCaptionSide, eCSSType_Value, kCaptionSideKTable)
 CSS_PROP_DISPLAY(clear, clear, Clear, 0, Display, mClear, eCSSType_Value, kClearKTable)
 CSS_PROP_DISPLAY(clip, clip, Clip, 0, Display, mClip, eCSSType_Rect, nsnull)
-CSS_PROP_COLOR(color, color, Color, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE, Color, mColor, eCSSType_Value, nsnull)
+CSS_PROP_COLOR(color, color, Color, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE | CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED, Color, mColor, eCSSType_Value, nsnull)
 CSS_PROP_COLUMN(-moz-column-count, _moz_column_count, MozColumnCount, 0, Column, mColumnCount, eCSSType_Value, nsnull)
 CSS_PROP_COLUMN(-moz-column-width, _moz_column_width, MozColumnWidth, 0, Column, mColumnWidth, eCSSType_Value, nsnull)
 CSS_PROP_COLUMN(-moz-column-gap, _moz_column_gap, MozColumnGap, 0, Column, mColumnGap, eCSSType_Value, nsnull)
 CSS_PROP_SHORTHAND(-moz-column-rule, _moz_column_rule, MozColumnRule, 0)
-CSS_PROP_COLUMN(-moz-column-rule-color, _moz_column_rule_color, MozColumnRuleColor, 0, Column, mColumnRuleColor, eCSSType_Value, nsnull)
+CSS_PROP_COLUMN(-moz-column-rule-color, _moz_column_rule_color, MozColumnRuleColor, CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED, Column, mColumnRuleColor, eCSSType_Value, nsnull)
 CSS_PROP_COLUMN(-moz-column-rule-style, _moz_column_rule_style, MozColumnRuleStyle, 0, Column, mColumnRuleStyle, eCSSType_Value, kBorderStyleKTable)
 CSS_PROP_COLUMN(-moz-column-rule-width, _moz_column_rule_width, MozColumnRuleWidth, 0, Column, mColumnRuleWidth, eCSSType_Value, kBorderWidthKTable)
 CSS_PROP_CONTENT(content, content, Content, 0, Content, mContent, eCSSType_ValueList, kContentKTable)
 CSS_PROP_CONTENT(counter-increment, counter_increment, CounterIncrement, 0, Content, mCounterIncrement, eCSSType_ValuePairList, nsnull) // XXX bug 137285
 CSS_PROP_CONTENT(counter-reset, counter_reset, CounterReset, 0, Content, mCounterReset, eCSSType_ValuePairList, nsnull) // XXX bug 137285
 CSS_PROP_SHORTHAND(cue, cue, Cue, 0)
 CSS_PROP_BACKENDONLY(cue-after, cue_after, CueAfter, 0, Aural, mCueAfter, eCSSType_Value, nsnull)
 CSS_PROP_BACKENDONLY(cue-before, cue_before, CueBefore, 0, Aural, mCueBefore, eCSSType_Value, nsnull)
@@ -455,17 +455,17 @@ CSS_PROP_CONTENT(marker-offset, marker_o
 CSS_PROP_BACKENDONLY(marks, marks, Marks, 0, Page, mMarks, eCSSType_Value, kPageMarksKTable)
 CSS_PROP_POSITION(max-height, max_height, MaxHeight, 0, Position, mMaxHeight, eCSSType_Value, nsnull)
 CSS_PROP_POSITION(max-width, max_width, MaxWidth, 0, Position, mMaxWidth, eCSSType_Value, kWidthKTable)
 CSS_PROP_POSITION(min-height, min_height, MinHeight, 0, Position, mMinHeight, eCSSType_Value, nsnull)
 CSS_PROP_POSITION(min-width, min_width, MinWidth, 0, Position, mMinWidth, eCSSType_Value, kWidthKTable)
 CSS_PROP_DISPLAY(opacity, opacity, Opacity, 0, Display, mOpacity, eCSSType_Value, nsnull) // XXX bug 3935
 CSS_PROP_BACKENDONLY(orphans, orphans, Orphans, 0, Breaks, mOrphans, eCSSType_Value, nsnull)
 CSS_PROP_SHORTHAND(outline, outline, Outline, 0)
-CSS_PROP_OUTLINE(outline-color, outline_color, OutlineColor, 0, Margin, mOutlineColor, eCSSType_Value, kOutlineColorKTable)
+CSS_PROP_OUTLINE(outline-color, outline_color, OutlineColor, CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED, Margin, mOutlineColor, eCSSType_Value, kOutlineColorKTable)
 CSS_PROP_OUTLINE(outline-style, outline_style, OutlineStyle, 0, Margin, mOutlineStyle, eCSSType_Value, kBorderStyleKTable)
 CSS_PROP_OUTLINE(outline-width, outline_width, OutlineWidth, 0, Margin, mOutlineWidth, eCSSType_Value, kBorderWidthKTable)
 CSS_PROP_OUTLINE(outline-offset, outline_offset, OutlineOffset, 0, Margin, mOutlineOffset, eCSSType_Value, nsnull)
 CSS_PROP_SHORTHAND(overflow, overflow, Overflow, 0)
 CSS_PROP_DISPLAY(overflow-x, overflow_x, OverflowX, 0, Display, mOverflowX, eCSSType_Value, kOverflowSubKTable)
 CSS_PROP_DISPLAY(overflow-y, overflow_y, OverflowY, 0, Display, mOverflowY, eCSSType_Value, kOverflowSubKTable)
 CSS_PROP_SHORTHAND(padding, padding, Padding, 0)
 CSS_PROP_PADDING(padding-bottom, padding_bottom, PaddingBottom, CSS_PROPERTY_APPLIES_TO_FIRST_LETTER, Margin, mPadding.mBottom, eCSSType_Value, nsnull)
--- a/layout/style/nsCSSProps.h
+++ b/layout/style/nsCSSProps.h
@@ -55,16 +55,19 @@
 // A property that is a *-ltr-source or *-rtl-source property for one of
 // the directional pseudo-shorthand properties.
 #define CSS_PROPERTY_DIRECTIONAL_SOURCE           (1<<0)
 #define CSS_PROPERTY_VALUE_LIST_USES_COMMAS       (1<<1) /* otherwise spaces */
 #define CSS_PROPERTY_APPLIES_TO_FIRST_LETTER      (1<<2)
 #define CSS_PROPERTY_APPLIES_TO_FIRST_LINE        (1<<3)
 #define CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE \
   (CSS_PROPERTY_APPLIES_TO_FIRST_LETTER | CSS_PROPERTY_APPLIES_TO_FIRST_LINE)
+// Note that 'background-color' is ignored differently from the other
+// properties that have this set, but that's just special-cased.
+#define CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED (1<<4)
 
 class nsCSSProps {
 public:
   static void AddRefTable(void);
   static void ReleaseTable(void);
 
   // Given a property string, return the enum value
   static nsCSSProperty LookupProperty(const nsAString& aProperty);