Limit the unitless length quirk to the properties where it's needed, per http://simon.html5.org/specs/quirks-mode#the-unitless-length-quirk . (Bug 774122, patch 2) r=bzbarsky
☠☠ backed out by 588ea3ebb1ef ☠ ☠
authorL. David Baron <dbaron@dbaron.org>
Mon, 16 Jul 2012 01:10:06 -0400
changeset 99390 e3007422b98954bb6da16fb3e369d909da26810f
parent 99389 ac282e15dc027d7b3898e817b46f7c4ffb07fb09
child 99391 64ff8c2d37f99e3b31fcb66f200f8a09a4e92b70
push id11973
push userdbaron@mozilla.com
push dateMon, 16 Jul 2012 05:12:32 +0000
treeherdermozilla-inbound@64ff8c2d37f9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbzbarsky
bugs774122
milestone16.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Limit the unitless length quirk to the properties where it's needed, per http://simon.html5.org/specs/quirks-mode#the-unitless-length-quirk . (Bug 774122, patch 2) r=bzbarsky
layout/style/nsCSSParser.cpp
layout/style/nsCSSPropList.h
layout/style/nsCSSProps.h
layout/style/test/property_database.js
--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -651,16 +651,19 @@ protected:
   bool mHavePushBack : 1;
 
   // True if we are in quirks mode; false in standards or almost standards mode
   bool          mNavQuirkMode : 1;
 
   // True when the hashless color quirk applies.
   bool mHashlessColorQuirk : 1;
 
+  // True when the unitless length quirk applies.
+  bool mUnitlessLengthQuirk : 1;
+
   // True if unsafe rules should be allowed
   bool mUnsafeRulesEnabled : 1;
 
   // True for parsing media lists for HTML attributes, where we have to
   // ignore CSS comments.
   bool mHTMLMediaMode : 1;
 
   // This flag is set when parsing a non-box shorthand; it's used to not apply
@@ -745,16 +748,17 @@ CSSParserImpl::CSSParserImpl()
   : mToken(),
     mScanner(),
     mChildLoader(nsnull),
     mSection(eCSSSection_Charset),
     mNameSpaceMap(nsnull),
     mHavePushBack(false),
     mNavQuirkMode(false),
     mHashlessColorQuirk(false),
+    mUnitlessLengthQuirk(false),
     mUnsafeRulesEnabled(false),
     mHTMLMediaMode(false),
     mParsingCompoundProperty(false)
 #ifdef DEBUG
     , mScannerInited(false)
 #endif
     , mNextFree(nsnull)
 {
@@ -4390,19 +4394,25 @@ CSSParserImpl::ParseOneOrLargerVariant(n
 }
 
 // Assigns to aValue iff it returns true.
 bool
 CSSParserImpl::ParseVariant(nsCSSValue& aValue,
                             PRInt32 aVariantMask,
                             const PRInt32 aKeywordTable[])
 {
-  NS_ASSERTION(IsParsingCompoundProperty() ||
-               ((~aVariantMask) & (VARIANT_LENGTH|VARIANT_COLOR)),
-               "cannot distinguish lengths and colors in quirks mode");
+  NS_ASSERTION(!(mHashlessColorQuirk && (aVariantMask & VARIANT_COLOR)) ||
+               !(aVariantMask & VARIANT_NUMBER),
+               "can't distinguish colors from numbers");
+  NS_ASSERTION(!(mHashlessColorQuirk && (aVariantMask & VARIANT_COLOR)) ||
+               !(mUnitlessLengthQuirk && (aVariantMask & VARIANT_LENGTH)),
+               "can't distinguish colors from lengths");
+  NS_ASSERTION(!(mUnitlessLengthQuirk && (aVariantMask & VARIANT_LENGTH)) ||
+               !(aVariantMask & VARIANT_NUMBER),
+               "can't distinguish lengths from numbers");
   NS_ABORT_IF_FALSE(!(aVariantMask & VARIANT_IDENTIFIER) ||
                     !(aVariantMask & VARIANT_IDENTIFIER_NO_INHERIT),
                     "must not set both VARIANT_IDENTIFIER and "
                     "VARIANT_IDENTIFIER_NO_INHERIT");
 
   if (!GetToken(true)) {
     return false;
   }
@@ -4496,17 +4506,17 @@ CSSParserImpl::ParseVariant(nsCSSValue& 
     UngetToken();
     return false;
   }
   if (((aVariantMask & VARIANT_PERCENT) != 0) &&
       (eCSSToken_Percentage == tk->mType)) {
     aValue.SetPercentValue(tk->mNumber);
     return true;
   }
-  if (mNavQuirkMode && !IsParsingCompoundProperty()) { // NONSTANDARD: Nav interprets unitless numbers as px
+  if (mUnitlessLengthQuirk) { // NONSTANDARD: Nav interprets unitless numbers as px
     if (((aVariantMask & VARIANT_LENGTH) != 0) &&
         (eCSSToken_Number == tk->mType)) {
       aValue.SetFloatValue(tk->mNumber, eCSSUnit_Pixel);
       return true;
     }
   }
 
   if (IsSVGMode() && !IsParsingCompoundProperty()) {
@@ -5616,19 +5626,23 @@ static const nsCSSProperty kOutlineRadiu
 };
 
 bool
 CSSParserImpl::ParseProperty(nsCSSProperty aPropID)
 {
   // Can't use AutoRestore<bool> because it's a bitfield.
   NS_ABORT_IF_FALSE(!mHashlessColorQuirk,
                     "hashless color quirk should not be set");
+  NS_ABORT_IF_FALSE(!mUnitlessLengthQuirk,
+                    "unitless length quirk should not be set");
   if (mNavQuirkMode) {
     mHashlessColorQuirk =
       nsCSSProps::PropHasFlags(aPropID, CSS_PROPERTY_HASHLESS_COLOR_QUIRK);
+    mUnitlessLengthQuirk =
+      nsCSSProps::PropHasFlags(aPropID, CSS_PROPERTY_UNITLESS_LENGTH_QUIRK);
   }
 
   NS_ASSERTION(aPropID < eCSSProperty_COUNT, "index out of range");
   bool result;
   switch (nsCSSProps::PropertyParseType(aPropID)) {
     case CSS_PROPERTY_PARSE_INACCESSIBLE: {
       // The user can't use these
       REPORT_UNEXPECTED(PEInaccessibleProperty2);
@@ -5662,16 +5676,17 @@ CSSParserImpl::ParseProperty(nsCSSProper
                         "Property's flags field in nsCSSPropList.h is missing "
                         "one of the CSS_PROPERTY_PARSE_* constants");
       break;
     }
   }
 
   if (mNavQuirkMode) {
     mHashlessColorQuirk = false;
+    mUnitlessLengthQuirk = false;
   }
 
   return result;
 }
 
 bool
 CSSParserImpl::ParsePropertyByFunction(nsCSSProperty aPropID)
 {
--- a/layout/style/nsCSSPropList.h
+++ b/layout/style/nsCSSPropList.h
@@ -624,17 +624,18 @@ CSS_PROP_BORDER(
     CSS_PROP_NO_OFFSET,
     eStyleAnimType_None)  // on/off will need reflow
 CSS_PROP_BORDER(
     border-bottom-width,
     border_bottom_width,
     BorderBottomWidth,
     CSS_PROPERTY_PARSE_VALUE |
         CSS_PROPERTY_VALUE_NONNEGATIVE |
-        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
+        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
+        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
     "",
     VARIANT_HKL | VARIANT_CALC,
     kBorderWidthKTable,
     CSS_PROP_NO_OFFSET,
     eStyleAnimType_Custom)
 CSS_PROP_TABLEBORDER(
     border-collapse,
     border_collapse,
@@ -887,17 +888,18 @@ CSS_PROP_BORDER(
     kBoxPropSourceKTable,
     CSS_PROP_NO_OFFSET,
     eStyleAnimType_None)
 #endif
 CSS_PROP_SHORTHAND(
     border-left-width,
     border_left_width,
     BorderLeftWidth,
-    CSS_PROPERTY_PARSE_FUNCTION,
+    CSS_PROPERTY_PARSE_FUNCTION |
+        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
     "")
 #ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
 CSS_PROP_BORDER(
     border-left-width-value,
     border_left_width_value,
     BorderLeftWidthValue,
     CSS_PROPERTY_PARSE_INACCESSIBLE |
         CSS_PROPERTY_VALUE_NONNEGATIVE |
@@ -1042,17 +1044,18 @@ CSS_PROP_BORDER(
     kBoxPropSourceKTable,
     CSS_PROP_NO_OFFSET,
     eStyleAnimType_None)
 #endif
 CSS_PROP_SHORTHAND(
     border-right-width,
     border_right_width,
     BorderRightWidth,
-    CSS_PROPERTY_PARSE_FUNCTION,
+    CSS_PROPERTY_PARSE_FUNCTION |
+        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
     "")
 #ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
 CSS_PROP_BORDER(
     border-right-width-value,
     border_right_width_value,
     BorderRightWidthValue,
     CSS_PROPERTY_PARSE_INACCESSIBLE |
         CSS_PROPERTY_VALUE_NONNEGATIVE |
@@ -1212,27 +1215,29 @@ CSS_PROP_BORDER(
     CSS_PROP_NO_OFFSET,
     eStyleAnimType_None)  // on/off will need reflow
 CSS_PROP_BORDER(
     border-top-width,
     border_top_width,
     BorderTopWidth,
     CSS_PROPERTY_PARSE_VALUE |
         CSS_PROPERTY_VALUE_NONNEGATIVE |
-        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
+        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
+        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
     "",
     VARIANT_HKL | VARIANT_CALC,
     kBorderWidthKTable,
     CSS_PROP_NO_OFFSET,
     eStyleAnimType_Custom)
 CSS_PROP_SHORTHAND(
     border-width,
     border_width,
     BorderWidth,
-    CSS_PROPERTY_PARSE_FUNCTION,
+    CSS_PROPERTY_PARSE_FUNCTION |
+        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
     "")
 CSS_PROP_SHORTHAND(
     border-radius,
     border_radius,
     BorderRadius,
     CSS_PROPERTY_PARSE_FUNCTION,
     "")
 CSS_PROP_BORDER(
@@ -1341,17 +1346,18 @@ CSS_PROP_DISPLAY(
     VARIANT_HK,
     kClearKTable,
     CSS_PROP_NO_OFFSET,
     eStyleAnimType_None)
 CSS_PROP_DISPLAY(
     clip,
     clip,
     Clip,
-    CSS_PROPERTY_PARSE_FUNCTION,
+    CSS_PROPERTY_PARSE_FUNCTION |
+        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
     "",
     0,
     nsnull,
     offsetof(nsStyleDisplay, mClip),
     eStyleAnimType_Custom)
 CSS_PROP_COLOR(
     color,
     color,
@@ -1682,17 +1688,18 @@ CSS_PROP_FONT(
     CSS_PROP_NO_OFFSET,
     eStyleAnimType_None)
 CSS_PROP_FONT(
     font-size,
     font_size,
     FontSize,
     CSS_PROPERTY_PARSE_VALUE |
         CSS_PROPERTY_VALUE_NONNEGATIVE |
-        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE,
+        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
+        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
     "",
     VARIANT_HKLP | VARIANT_SYSFONT | VARIANT_CALC,
     kFontSizeKTable,
     // Note that mSize is the correct place for *reading* the computed value,
     // but setting it requires setting mFont.size as well.
     offsetof(nsStyleFont, mSize),
     eStyleAnimType_nscoord)
 CSS_PROP_FONT(
@@ -1765,17 +1772,18 @@ CSS_PROP_UIRESET(
     CSS_PROP_NO_OFFSET,
     eStyleAnimType_None) // bug 58646
 CSS_PROP_POSITION(
     height,
     height,
     Height,
     CSS_PROPERTY_PARSE_VALUE |
         CSS_PROPERTY_VALUE_NONNEGATIVE |
-        CSS_PROPERTY_STORES_CALC,
+        CSS_PROPERTY_STORES_CALC |
+        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
     "",
     VARIANT_AHLP | VARIANT_CALC,
     nsnull,
     offsetof(nsStylePosition, mHeight),
     eStyleAnimType_Coord)
 CSS_PROP_LIST(
     -moz-image-region,
     image_region,
@@ -1796,28 +1804,30 @@ CSS_PROP_UIRESET(
     kIMEModeKTable,
     CSS_PROP_NO_OFFSET,
     eStyleAnimType_None)
 CSS_PROP_POSITION(
     left,
     left,
     Left,
     CSS_PROPERTY_PARSE_VALUE |
-        CSS_PROPERTY_STORES_CALC,
+        CSS_PROPERTY_STORES_CALC |
+        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
     "",
     VARIANT_AHLP | VARIANT_CALC,
     nsnull,
     offsetof(nsStylePosition, mOffset),
     eStyleAnimType_Sides_Left)
 CSS_PROP_TEXT(
     letter-spacing,
     letter_spacing,
     LetterSpacing,
     CSS_PROPERTY_PARSE_VALUE |
-        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE,
+        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
+        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
     "",
     VARIANT_HL | VARIANT_NORMAL | VARIANT_CALC,
     nsnull,
     offsetof(nsStyleText, mLetterSpacing),
     eStyleAnimType_Coord)
 CSS_PROP_TEXT(
     line-height,
     line_height,
@@ -1866,25 +1876,27 @@ CSS_PROP_LIST(
     VARIANT_HK,
     kListStyleKTable,
     CSS_PROP_NO_OFFSET,
     eStyleAnimType_None)
 CSS_PROP_SHORTHAND(
     margin,
     margin,
     Margin,
-    CSS_PROPERTY_PARSE_FUNCTION,
+    CSS_PROPERTY_PARSE_FUNCTION |
+        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
     "")
 CSS_PROP_MARGIN(
     margin-bottom,
     margin_bottom,
     MarginBottom,
     CSS_PROPERTY_PARSE_VALUE |
         CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
-        CSS_PROPERTY_STORES_CALC,
+        CSS_PROPERTY_STORES_CALC |
+        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
     "",
     VARIANT_AHLP | VARIANT_CALC,
     nsnull,
     offsetof(nsStyleMargin, mMargin),
     eStyleAnimType_Sides_Bottom)
 CSS_PROP_SHORTHAND(
     -moz-margin-end,
     margin_end,
@@ -1904,17 +1916,18 @@ CSS_PROP_MARGIN(
     nsnull,
     CSS_PROP_NO_OFFSET,
     eStyleAnimType_None)
 #endif
 CSS_PROP_SHORTHAND(
     margin-left,
     margin_left,
     MarginLeft,
-    CSS_PROPERTY_PARSE_FUNCTION,
+    CSS_PROPERTY_PARSE_FUNCTION |
+        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
     "")
 #ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
 CSS_PROP_MARGIN(
     margin-left-value,
     margin_left_value,
     MarginLeftValue,
     CSS_PROPERTY_PARSE_INACCESSIBLE |
         CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
@@ -1949,17 +1962,18 @@ CSS_PROP_MARGIN(
     kBoxPropSourceKTable,
     CSS_PROP_NO_OFFSET,
     eStyleAnimType_None)
 #endif
 CSS_PROP_SHORTHAND(
     margin-right,
     margin_right,
     MarginRight,
-    CSS_PROPERTY_PARSE_FUNCTION,
+    CSS_PROPERTY_PARSE_FUNCTION |
+        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
     "")
 #ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
 CSS_PROP_MARGIN(
     margin-right-value,
     margin_right_value,
     MarginRightValue,
     CSS_PROPERTY_PARSE_INACCESSIBLE |
         CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
@@ -2016,17 +2030,18 @@ CSS_PROP_MARGIN(
     eStyleAnimType_None)
 #endif
 CSS_PROP_MARGIN(
     margin-top,
     margin_top,
     MarginTop,
     CSS_PROPERTY_PARSE_VALUE |
         CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
-        CSS_PROPERTY_STORES_CALC,
+        CSS_PROPERTY_STORES_CALC |
+        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
     "",
     VARIANT_AHLP | VARIANT_CALC,
     nsnull,
     offsetof(nsStyleMargin, mMargin),
     eStyleAnimType_Sides_Top)
 CSS_PROP_CONTENT(
     marker-offset,
     marker_offset,
@@ -2196,26 +2211,28 @@ CSS_PROP_DISPLAY(
     VARIANT_HK,
     kOverflowSubKTable,
     CSS_PROP_NO_OFFSET,
     eStyleAnimType_None)
 CSS_PROP_SHORTHAND(
     padding,
     padding,
     Padding,
-    CSS_PROPERTY_PARSE_FUNCTION,
+    CSS_PROPERTY_PARSE_FUNCTION |
+        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
     "")
 CSS_PROP_PADDING(
     padding-bottom,
     padding_bottom,
     PaddingBottom,
     CSS_PROPERTY_PARSE_VALUE |
         CSS_PROPERTY_VALUE_NONNEGATIVE |
         CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
-        CSS_PROPERTY_STORES_CALC,
+        CSS_PROPERTY_STORES_CALC |
+        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
     "",
     VARIANT_HLP | VARIANT_CALC,
     nsnull,
     offsetof(nsStylePadding, mPadding),
     eStyleAnimType_Sides_Bottom)
 CSS_PROP_SHORTHAND(
     -moz-padding-end,
     padding_end,
@@ -2236,17 +2253,18 @@ CSS_PROP_PADDING(
     nsnull,
     CSS_PROP_NO_OFFSET,
     eStyleAnimType_None)
 #endif
 CSS_PROP_SHORTHAND(
     padding-left,
     padding_left,
     PaddingLeft,
-    CSS_PROPERTY_PARSE_FUNCTION,
+    CSS_PROPERTY_PARSE_FUNCTION |
+        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
     "")
 #ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
 CSS_PROP_PADDING(
     padding-left-value,
     padding_left_value,
     PaddingLeftValue,
     CSS_PROPERTY_PARSE_INACCESSIBLE |
         CSS_PROPERTY_VALUE_NONNEGATIVE |
@@ -2282,17 +2300,18 @@ CSS_PROP_PADDING(
     kBoxPropSourceKTable,
     CSS_PROP_NO_OFFSET,
     eStyleAnimType_None)
 #endif
 CSS_PROP_SHORTHAND(
     padding-right,
     padding_right,
     PaddingRight,
-    CSS_PROPERTY_PARSE_FUNCTION,
+    CSS_PROPERTY_PARSE_FUNCTION |
+        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
     "")
 #ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
 CSS_PROP_PADDING(
     padding-right-value,
     padding_right_value,
     PaddingRightValue,
     CSS_PROPERTY_PARSE_INACCESSIBLE |
         CSS_PROPERTY_VALUE_NONNEGATIVE |
@@ -2352,17 +2371,18 @@ CSS_PROP_PADDING(
 #endif
 CSS_PROP_PADDING(
     padding-top,
     padding_top,
     PaddingTop,
     CSS_PROPERTY_PARSE_VALUE |
         CSS_PROPERTY_VALUE_NONNEGATIVE |
         CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
-        CSS_PROPERTY_STORES_CALC,
+        CSS_PROPERTY_STORES_CALC |
+        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
     "",
     VARIANT_HLP | VARIANT_CALC,
     nsnull,
     offsetof(nsStylePadding, mPadding),
     eStyleAnimType_Sides_Top)
 CSS_PROP_BACKENDONLY(
     page,
     page,
@@ -2439,17 +2459,18 @@ CSS_PROP_DISPLAY(
     kResizeKTable,
     CSS_PROP_NO_OFFSET,
     eStyleAnimType_None)
 CSS_PROP_POSITION(
     right,
     right,
     Right,
     CSS_PROPERTY_PARSE_VALUE |
-        CSS_PROPERTY_STORES_CALC,
+        CSS_PROPERTY_STORES_CALC |
+        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
     "",
     VARIANT_AHLP | VARIANT_CALC,
     nsnull,
     offsetof(nsStylePosition, mOffset),
     eStyleAnimType_Sides_Right)
 CSS_PROP_BACKENDONLY(
     size,
     size,
@@ -2661,17 +2682,18 @@ CSS_PROP_DISPLAY(
     kBackfaceVisibilityKTable,
     offsetof(nsStyleDisplay, mBackfaceVisibility),
     eStyleAnimType_None)
 CSS_PROP_POSITION(
     top,
     top,
     Top,
     CSS_PROPERTY_PARSE_VALUE |
-        CSS_PROPERTY_STORES_CALC,
+        CSS_PROPERTY_STORES_CALC |
+        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
     "",
     VARIANT_AHLP | VARIANT_CALC,
     nsnull,
     offsetof(nsStylePosition, mOffset),
     eStyleAnimType_Sides_Top)
 CSS_PROP_SHORTHAND(
     transition,
     transition,
@@ -2818,17 +2840,18 @@ CSS_PROP_BACKENDONLY(
     VARIANT_HI,
     nsnull)
 CSS_PROP_POSITION(
     width,
     width,
     Width,
     CSS_PROPERTY_PARSE_VALUE |
         CSS_PROPERTY_VALUE_NONNEGATIVE |
-        CSS_PROPERTY_STORES_CALC,
+        CSS_PROPERTY_STORES_CALC |
+        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
     "",
     VARIANT_AHKLP | VARIANT_CALC,
     kWidthKTable,
     offsetof(nsStylePosition, mWidth),
     eStyleAnimType_Coord)
 CSS_PROP_UIRESET(
     -moz-window-shadow,
     _moz_window_shadow,
@@ -2849,17 +2872,18 @@ CSS_PROP_TEXT(
     kWordBreakKTable,
     offsetof(nsStyleText, mWordBreak),
     eStyleAnimType_EnumU8)
 CSS_PROP_TEXT(
     word-spacing,
     word_spacing,
     WordSpacing,
     CSS_PROPERTY_PARSE_VALUE |
-        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE,
+        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
+        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
     "",
     VARIANT_HL | VARIANT_NORMAL | VARIANT_CALC,
     nsnull,
     offsetof(nsStyleText, mWordSpacing),
     eStyleAnimType_nscoord)
 CSS_PROP_TEXT(
     word-wrap,
     word_wrap,
--- a/layout/style/nsCSSProps.h
+++ b/layout/style/nsCSSProps.h
@@ -90,16 +90,19 @@ MOZ_STATIC_ASSERT((CSS_PROPERTY_PARSE_PR
 #define CSS_PROPERTY_VALUE_NONNEGATIVE            (1<<13)
 // The parser (in particular, CSSParserImpl::ParseSingleValueProperty)
 // should enforce that the value of this property must be 1 or larger.
 #define CSS_PROPERTY_VALUE_AT_LEAST_ONE           (2<<13)
 
 // Does this property suppor the hashless hex color quirk in quirks mode?
 #define CSS_PROPERTY_HASHLESS_COLOR_QUIRK         (1<<15)
 
+// Does this property suppor the unitless length quirk in quirks mode?
+#define CSS_PROPERTY_UNITLESS_LENGTH_QUIRK        (1<<16)
+
 /**
  * Types of animatable values.
  */
 enum nsStyleAnimType {
   // requires a custom implementation in
   // nsStyleAnimation::ExtractComputedValue
   eStyleAnimType_Custom,
 
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -154,17 +154,17 @@ var gCSSProperties = {
 	},
 	"-moz-border-end": {
 		domProp: "MozBorderEnd",
 		inherited: false,
 		type: CSS_TYPE_TRUE_SHORTHAND,
 		subproperties: [ "-moz-border-end-color", "-moz-border-end-style", "-moz-border-end-width" ],
 		initial_values: [ "none", "medium", "currentColor", "thin", "none medium currentcolor" ],
 		other_values: [ "solid", "green", "medium solid", "green solid", "10px solid", "thick solid", "5px green none" ],
-		invalid_values: [ "5%" ]
+		invalid_values: [ "5%", "5", "5 green none" ]
 	},
 	"-moz-border-end-color": {
 		domProp: "MozBorderEndColor",
 		inherited: false,
 		type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
 		get_computed: logical_box_prop_get_computed,
 		initial_values: [ "currentColor" ],
 		other_values: [ "green", "rgba(255,128,0,0.5)", "transparent" ],
@@ -192,17 +192,17 @@ var gCSSProperties = {
 			"calc(-2px)",
 			"calc(0em)",
 			"calc(0px)",
 			"calc(5em)",
 			"calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 5em)",
 		],
-		invalid_values: [ "5%" ]
+		invalid_values: [ "5%", "5" ]
 	},
 	"border-image": {
 		domProp: "borderImage",
 		inherited: false,
 		type: CSS_TYPE_TRUE_SHORTHAND,
 		subproperties: [ "border-image-source", "border-image-slice", "border-image-width", "border-image-outset", "border-image-repeat" ],
 		initial_values: [ "none" ],
 		other_values: [ "url('border.png') 27 27 27 27",
@@ -298,17 +298,17 @@ var gCSSProperties = {
 			"calc(3*25px) 5px",
 			"5px calc(3*25px)",
 			"calc(20%) calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 			"2px 2px calc(2px + 1%) 2px",
 			"1px 2px 2px 2px / 2px 2px calc(2px + 1%) 2px",
 					  ],
-		invalid_values: [ "2px -2px", "inherit 2px", "inherit / 2px", "2px inherit", "2px / inherit", "2px 2px 2px 2px 2px", "1px / 2px 2px 2px 2px 2px" ]
+		invalid_values: [ "2px -2px", "inherit 2px", "inherit / 2px", "2px inherit", "2px / inherit", "2px 2px 2px 2px 2px", "1px / 2px 2px 2px 2px 2px", "2", "2 2", "2px 2px 2px 2px / 2px 2px 2 2px" ]
 	},
 	"border-bottom-left-radius": {
 		domProp: "borderBottomLeftRadius",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		prerequisites: { "width": "200px", "height": "100px", "display": "inline-block"},
 		initial_values: [ "0", "0px", "0%", "calc(-2px)", "calc(-1%)" ],
 		other_values: [ "3%", "1px", "2em", // circular
@@ -317,17 +317,17 @@ var gCSSProperties = {
 			"calc(50%)",
 			"calc(3*25px)",
 			"calc(3*25px) 5px",
 			"5px calc(3*25px)",
 			"calc(20%) calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 					  ],
-		invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit" ]
+		invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit", "2", "2px 2", "2 2px" ]
 	},
 	"border-bottom-right-radius": {
 		domProp: "borderBottomRightRadius",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		prerequisites: { "width": "200px", "height": "100px", "display": "inline-block"},
 		initial_values: [ "0", "0px", "0%", "calc(-2px)", "calc(-1%)" ],
 		other_values: [ "3%", "1px", "2em", // circular
@@ -336,17 +336,17 @@ var gCSSProperties = {
 			"calc(50%)",
 			"calc(3*25px)",
 			"calc(3*25px) 5px",
 			"5px calc(3*25px)",
 			"calc(20%) calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 					  ],
-		invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit" ]
+		invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit", "2", "2px 2", "2 2px" ]
 	},
 	"border-top-left-radius": {
 		domProp: "borderTopLeftRadius",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		prerequisites: { "width": "200px", "height": "100px", "display": "inline-block"},
 		initial_values: [ "0", "0px", "0%", "calc(-2px)", "calc(-1%)" ],
 		other_values: [ "3%", "1px", "2em", // circular
@@ -355,17 +355,17 @@ var gCSSProperties = {
 			"calc(50%)",
 			"calc(3*25px)",
 			"calc(3*25px) 5px",
 			"5px calc(3*25px)",
 			"calc(20%) calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 					  ],
-		invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit" ]
+		invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit", "2", "2px 2", "2 2px" ]
 	},
 	"border-top-right-radius": {
 		domProp: "borderTopRightRadius",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		prerequisites: { "width": "200px", "height": "100px", "display": "inline-block"},
 		initial_values: [ "0", "0px", "0%", "calc(-2px)", "calc(-1%)" ],
 		other_values: [ "3%", "1px", "2em", // circular
@@ -374,34 +374,34 @@ var gCSSProperties = {
 			"calc(50%)",
 			"calc(3*25px)",
 			"calc(3*25px) 5px",
 			"5px calc(3*25px)",
 			"calc(20%) calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 					  ],
-		invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit" ]
+		invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit", "2", "2px 2", "2 2px" ]
 	},
 	"-moz-border-right-colors": {
 		domProp: "MozBorderRightColors",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "none" ],
 		other_values: [ "red green", "red #fc3", "#ff00cc", "currentColor", "blue currentColor orange currentColor" ],
 		invalid_values: [ "red none", "red inherit", "red, green", "none red", "inherit red", "ff00cc" ]
 	},
 	"-moz-border-start": {
 		domProp: "MozBorderStart",
 		inherited: false,
 		type: CSS_TYPE_TRUE_SHORTHAND,
 		subproperties: [ "-moz-border-start-color", "-moz-border-start-style", "-moz-border-start-width" ],
 		initial_values: [ "none", "medium", "currentColor", "thin", "none medium currentcolor" ],
 		other_values: [ "solid", "green", "medium solid", "green solid", "10px solid", "thick solid", "5px green none" ],
-		invalid_values: [ "5%" ]
+		invalid_values: [ "5%", "5", "5 green solid" ]
 	},
 	"-moz-border-start-color": {
 		domProp: "MozBorderStartColor",
 		inherited: false,
 		type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
 		get_computed: logical_box_prop_get_computed,
 		initial_values: [ "currentColor" ],
 		other_values: [ "green", "rgba(255,128,0,0.5)", "transparent" ],
@@ -429,17 +429,17 @@ var gCSSProperties = {
 			"calc(-2px)",
 			"calc(0em)",
 			"calc(0px)",
 			"calc(5em)",
 			"calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 5em)",
 		],
-		invalid_values: [ "5%" ]
+		invalid_values: [ "5%", "5" ]
 	},
 	"-moz-border-top-colors": {
 		domProp: "MozBorderTopColors",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "none" ],
 		other_values: [ "red green", "red #fc3", "#ff00cc", "currentColor", "blue currentColor orange currentColor" ],
 		invalid_values: [ "red none", "red inherit", "red, green", "none red", "inherit red", "ff00cc" ]
@@ -529,27 +529,27 @@ var gCSSProperties = {
 			"calc(-2px)",
 			"calc(0px)",
 			"calc(0pt)",
 			"calc(5em)",
 			"calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 5em)",
 		],
-		invalid_values: [ "3%", "-1px" ]
+		invalid_values: [ "3%", "-1px", "4" ]
 	},
 	"-moz-column-rule": {
 		domProp: "MozColumnRule",
 		inherited: false,
 		type: CSS_TYPE_TRUE_SHORTHAND,
 		prerequisites: { "color": "green" },
 		subproperties: [ "-moz-column-rule-width", "-moz-column-rule-style", "-moz-column-rule-color" ],
-		initial_values: [ "medium none currentColor" ],
-		other_values: [ "2px blue solid", "red dotted 1px", "ridge 4px orange" ],
-		invalid_values: [ "2px 3px 4px red", "dotted dashed", "5px dashed green 3px" ]
+		initial_values: [ "medium none currentColor", "none", "medium", "currentColor" ],
+		other_values: [ "2px blue solid", "red dotted 1px", "ridge 4px orange", "5px solid" ],
+		invalid_values: [ "2px 3px 4px red", "dotted dashed", "5px dashed green 3px", "5 solid", "5 green solid" ]
 	},
 	"-moz-column-rule-width": {
 		domProp: "MozColumnRuleWidth",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		prerequisites: { "-moz-column-rule-style": "solid" },
 		initial_values: [
 			"medium",
@@ -1032,17 +1032,17 @@ var gCSSProperties = {
 		invalid_values: []
 	},
 	"-moz-image-region": {
 		domProp: "MozImageRegion",
 		inherited: true,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "auto" ],
 		other_values: [ "rect(3px 20px 15px 4px)", "rect(17px, 21px, 33px, 2px)" ],
-		invalid_values: []
+		invalid_values: [ "rect(17px, 21px, 33, 2px)" ]
 	},
 	"-moz-margin-end": {
 		domProp: "MozMarginEnd",
 		inherited: false,
 		type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
 		get_computed: logical_box_prop_get_computed,
 		/* no subproperties */
 		/* auto may or may not be initial */
@@ -1050,17 +1050,17 @@ var gCSSProperties = {
 		other_values: [ "1px", "3em",
 			"calc(2px)",
 			"calc(-2px)",
 			"calc(50%)",
 			"calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 		],
-		invalid_values: []
+		invalid_values: [ "5" ]
 	},
 	"-moz-margin-start": {
 		domProp: "MozMarginStart",
 		inherited: false,
 		type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
 		get_computed: logical_box_prop_get_computed,
 		/* no subproperties */
 		/* auto may or may not be initial */
@@ -1068,17 +1068,17 @@ var gCSSProperties = {
 		other_values: [ "1px", "3em",
 			"calc(2px)",
 			"calc(-2px)",
 			"calc(50%)",
 			"calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 		],
-		invalid_values: []
+		invalid_values: [ "5" ]
 	},
 	"-moz-outline-radius": {
 		domProp: "MozOutlineRadius",
 		inherited: false,
 		type: CSS_TYPE_TRUE_SHORTHAND,
 		prerequisites: { "width": "200px", "height": "100px", "display": "inline-block"},
 		subproperties: [ "-moz-outline-radius-bottomleft", "-moz-outline-radius-bottomright", "-moz-outline-radius-topleft", "-moz-outline-radius-topright" ],
 		initial_values: [ "0", "0px", "0%", "calc(-2px)", "calc(-1%)", "calc(0px) calc(0pt) calc(0%) calc(0em)" ],
@@ -1090,17 +1090,17 @@ var gCSSProperties = {
 			"calc(3*25px) 5px",
 			"5px calc(3*25px)",
 			"calc(20%) calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 			"2px 2px calc(2px + 1%) 2px",
 			"1px 2px 2px 2px / 2px 2px calc(2px + 1%) 2px",
 					  ],
-		invalid_values: [ "2px -2px", "inherit 2px", "inherit / 2px", "2px inherit", "2px / inherit", "2px 2px 2px 2px 2px", "1px / 2px 2px 2px 2px 2px" ]
+		invalid_values: [ "2px -2px", "inherit 2px", "inherit / 2px", "2px inherit", "2px / inherit", "2px 2px 2px 2px 2px", "1px / 2px 2px 2px 2px 2px", "2", "2 2", "2px 2px 2px 2px / 2px 2px 2 2px" ]
 	},
 	"-moz-outline-radius-bottomleft": {
 		domProp: "MozOutlineRadiusBottomleft",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		prerequisites: { "width": "200px", "height": "100px", "display": "inline-block"},
 		initial_values: [ "0", "0px", "0%", "calc(-2px)", "calc(-1%)", "calc(0px)" ],
 		other_values: [ "3%", "1px", "2em", // circular
@@ -1109,17 +1109,17 @@ var gCSSProperties = {
 			"calc(50%)",
 			"calc(3*25px)",
 			"calc(3*25px) 5px",
 			"5px calc(3*25px)",
 			"calc(20%) calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 					  ],
-		invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit" ]
+		invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit", "2", "2px 2", "2 2px" ]
 	},
 	"-moz-outline-radius-bottomright": {
 		domProp: "MozOutlineRadiusBottomright",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		prerequisites: { "width": "200px", "height": "100px", "display": "inline-block"},
 		initial_values: [ "0", "0px", "0%", "calc(-2px)", "calc(-1%)", "calc(0px)" ],
 		other_values: [ "3%", "1px", "2em", // circular
@@ -1128,17 +1128,17 @@ var gCSSProperties = {
 			"calc(50%)",
 			"calc(3*25px)",
 			"calc(3*25px) 5px",
 			"5px calc(3*25px)",
 			"calc(20%) calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 					  ],
-		invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit" ]
+		invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit", "2", "2px 2", "2 2px" ]
 	},
 	"-moz-outline-radius-topleft": {
 		domProp: "MozOutlineRadiusTopleft",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		prerequisites: { "width": "200px", "height": "100px", "display": "inline-block"},
 		initial_values: [ "0", "0px", "0%", "calc(-2px)", "calc(-1%)", "calc(0px)" ],
 		other_values: [ "3%", "1px", "2em", // circular
@@ -1147,17 +1147,17 @@ var gCSSProperties = {
 			"calc(50%)",
 			"calc(3*25px)",
 			"calc(3*25px) 5px",
 			"5px calc(3*25px)",
 			"calc(20%) calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 					  ],
-		invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit" ]
+		invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit", "2", "2px 2", "2 2px" ]
 	},
 	"-moz-outline-radius-topright": {
 		domProp: "MozOutlineRadiusTopright",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		prerequisites: { "width": "200px", "height": "100px", "display": "inline-block"},
 		initial_values: [ "0", "0px", "0%", "calc(-2px)", "calc(-1%)", "calc(0px)" ],
 		other_values: [ "3%", "1px", "2em", // circular
@@ -1166,49 +1166,49 @@ var gCSSProperties = {
 			"calc(50%)",
 			"calc(3*25px)",
 			"calc(3*25px) 5px",
 			"5px calc(3*25px)",
 			"calc(20%) calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 					  ],
-		invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit" ]
+		invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit", "2", "2px 2", "2 2px" ]
 	},
 	"-moz-padding-end": {
 		domProp: "MozPaddingEnd",
 		inherited: false,
 		type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
 		get_computed: logical_box_prop_get_computed,
 		/* no subproperties */
 		initial_values: [ "0", "0px", "0%", "0em", "0ex", "calc(0pt)", "calc(0% + 0px)", "calc(-3px)", "calc(-1%)" ],
 		other_values: [ "1px", "3em",
 			"calc(2px)",
 			"calc(50%)",
 			"calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 		],
-		invalid_values: []
+		invalid_values: [ "5" ]
 	},
 	"-moz-padding-start": {
 		domProp: "MozPaddingStart",
 		inherited: false,
 		type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
 		get_computed: logical_box_prop_get_computed,
 		/* no subproperties */
 		initial_values: [ "0", "0px", "0%", "0em", "0ex", "calc(0pt)", "calc(0% + 0px)", "calc(-3px)", "calc(-1%)" ],
 		other_values: [ "1px", "3em",
 			"calc(2px)",
 			"calc(50%)",
 			"calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 		],
-		invalid_values: []
+		invalid_values: [ "5" ]
 	},
 	"resize": {
 		domProp: "resize",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		prerequisites: { "display": "block", "overflow": "auto" },
 		initial_values: [ "none" ],
 		other_values: [ "both", "horizontal", "vertical" ],
@@ -1271,16 +1271,18 @@ var gCSSProperties = {
 			"translatex(2px) translate3d(4px, 5px, 6px) translatey(1px)",
 			"scale3d(4, 4, 4)", "scale3d(-2, 3, -7)", "scalez(4)",
 			"scalez(-6)", "rotate3d(2, 3, 4, 45deg)",
 			"rotate3d(-3, 7, 0, 12rad)", "rotatex(15deg)", "rotatey(-12grad)",
 			"rotatez(72rad)", "rotatex(0.125turn)", "perspective(1000px)",
 			"matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)",
 		] : []),
 		invalid_values: ["1px", "#0000ff", "red", "auto",
+			"translatex(1)", "translatey(1)", "translate(2)",
+			"translate(-3, -4)",
 			"translatex(1px 1px)", "translatex(translatex(1px))",
 			"translatex(#0000ff)", "translatex(red)", "translatey()",
 			"matrix(1px, 2px, 3px, 4px, 5px, 6px)", "scale(150%)",
 			"skewx(red)", "matrix(1%, 0, 0, 0, 0px, 0px)",
 			"matrix(0, 1%, 2, 3, 4px,5px)", "matrix(0, 1, 2%, 3, 4px, 5px)",
 			"matrix(0, 1, 2, 3%, 4%, 5%)", "matrix(1, 2, 3, 4, 5px, 6%)",
 			"matrix(1, 2, 3, 4, 5%, 6px)", "matrix(1, 2, 3, 4, 5%, 6%)",
 			"matrix(1, 2, 3, 4, 5px, 6em)",
@@ -1467,16 +1469,20 @@ var gCSSProperties = {
 				"url(404.png) border-box transparent",
 				"content-box url(404.png) blue",
 		],
 		invalid_values: [
 			/* mixes with keywords have to be in correct order */
 			"50% left", "top 50%",
 			/* no quirks mode colors */
 			"-moz-radial-gradient(10% bottom, ffffff, black) scroll no-repeat",
+			/* no quirks mode lengths */
+			"-moz-linear-gradient(10 10px -45deg, red, blue) repeat",
+			"-moz-linear-gradient(10px 10 -45deg, red, blue) repeat",
+			"linear-gradient(red -99, yellow, green, blue 120%)",
 			/* bug 258080: don't accept background-position separated */
 			"left url(404.png) top", "top url(404.png) left",
 			/* not allowed to have color in non-bottom layer */
 			"url(404.png) transparent, url(404.png)",
 			"url(404.png) red, url(404.png)",
 			"url(404.png) transparent, url(404.png) transparent",
 			"url(404.png) transparent red, url(404.png) transparent red",
 			"url(404.png) red, url(404.png) red",
@@ -1795,16 +1801,22 @@ var gCSSProperties = {
 		invalid_values: [
 			"-moz-element(#a:1)",
 			"-moz-element(a#a)",
 			"-moz-element(#a a)",
 			"-moz-element(#a+a)",
 			"-moz-element(#a()",
 			/* no quirks mode colors */
 			"linear-gradient(red, ff00ff)",
+			/* no quirks mode colors */
+			"-moz-radial-gradient(10% bottom, ffffff, black) scroll no-repeat",
+			/* no quirks mode lengths */
+			"-moz-linear-gradient(10 10px -45deg, red, blue) repeat",
+			"-moz-linear-gradient(10px 10 -45deg, red, blue) repeat",
+			"linear-gradient(red -99, yellow, green, blue 120%)",
 			/* Old syntax */
 			"-moz-linear-gradient(10px 10px, 20px, 30px 30px, 40px, from(blue), to(red))",
 			"-moz-radial-gradient(20px 20px, 10px 10px, from(green), to(#ff00ff))",
 			"-moz-radial-gradient(10px 10px, 20%, 40px 40px, 10px, from(green), to(#ff00ff))",
 			"-moz-linear-gradient(10px, 20px, 30px, 40px, color-stop(0.5, #00ccff))",
 			"-moz-linear-gradient(20px 20px, from(blue), to(red))",
 			"-moz-linear-gradient(40px 40px, 10px 10px, from(blue) to(red) color-stop(10%, fuchsia))",
 			"-moz-linear-gradient(20px 20px 30px, 10px 10px, from(red), to(#ff0000))",
@@ -2057,17 +2069,17 @@ var gCSSProperties = {
 			"left 10px top",
 			"left 20%",
 			"right 20%"
 		],
 		invalid_values: [ "center 10px center 4px", "center 10px center", 
 		                  "top 20%", "bottom 20%", "50% left", "top 50%", 
 		                  "50% bottom 10%", "right 10% 50%", "left right", 
 		                  "top bottom", "left 10% right", 
-		                  "top 20px bottom 20px", "left left" ]
+		                  "top 20px bottom 20px", "left left", "20 20" ]
 	},
 	"background-repeat": {
 		domProp: "backgroundRepeat",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "repeat", "repeat repeat" ],
 		other_values: [ "repeat-x", "repeat-y", "no-repeat",
 			"repeat-x, repeat-x",
@@ -2098,35 +2110,35 @@ var gCSSProperties = {
 			"calc(20px) 25%",
 			"25% calc(20px)",
 			"calc(20px) calc(20px)",
 			"calc(20px + 1em) calc(20px / 2)",
 			"calc(20px + 50%) calc(50% - 10px)",
 			"calc(-20px) calc(-50%)",
 			"calc(-20%) calc(-50%)"
 		],
-		invalid_values: [ "contain contain", "cover cover", "cover auto", "auto cover", "contain cover", "cover contain", "-5px 3px", "3px -5px", "auto -5px", "-5px auto" ]
+		invalid_values: [ "contain contain", "cover cover", "cover auto", "auto cover", "contain cover", "cover contain", "-5px 3px", "3px -5px", "auto -5px", "-5px auto", "5 3" ]
 	},
 	"border": {
 		domProp: "border",
 		inherited: false,
 		type: CSS_TYPE_TRUE_SHORTHAND,
 		subproperties: [ "border-bottom-color", "border-bottom-style", "border-bottom-width", "border-left-color", "border-left-style", "border-left-width", "border-right-color", "border-right-style", "border-right-width", "border-top-color", "border-top-style", "border-top-width", "-moz-border-top-colors", "-moz-border-right-colors", "-moz-border-bottom-colors", "-moz-border-left-colors", "border-image-source", "border-image-slice", "border-image-width", "border-image-outset", "border-image-repeat" ],
 		initial_values: [ "none", "medium", "currentColor", "thin", "none medium currentcolor", "calc(4px - 1px) none" ],
 		other_values: [ "solid", "medium solid", "green solid", "10px solid", "thick solid", "calc(2px) solid blue" ],
-		invalid_values: [ "5%", "medium solid ff00ff" ]
+		invalid_values: [ "5%", "medium solid ff00ff", "5 solid green" ]
 	},
 	"border-bottom": {
 		domProp: "borderBottom",
 		inherited: false,
 		type: CSS_TYPE_TRUE_SHORTHAND,
 		subproperties: [ "border-bottom-color", "border-bottom-style", "border-bottom-width" ],
 		initial_values: [ "none", "medium", "currentColor", "thin", "none medium currentcolor" ],
 		other_values: [ "solid", "green", "medium solid", "green solid", "10px solid", "thick solid", "5px green none" ],
-		invalid_values: [ "5%" ]
+		invalid_values: [ "5%", "5", "5 solid green" ]
 	},
 	"border-bottom-color": {
 		domProp: "borderBottomColor",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		prerequisites: { "color": "black" },
 		initial_values: [ "currentColor", "-moz-use-text-color" ],
 		other_values: [ "green", "rgba(255,128,0,0.5)", "transparent" ],
@@ -2153,17 +2165,18 @@ var gCSSProperties = {
 			"calc(-2px)",
 			"calc(0em)",
 			"calc(0px)",
 			"calc(5em)",
 			"calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 5em)",
 		],
-		invalid_values: [ "5%" ]
+		invalid_values: [ "5%" ],
+		quirks_values: { "5": "5px" },
 	},
 	"border-collapse": {
 		domProp: "borderCollapse",
 		inherited: true,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "separate" ],
 		other_values: [ "collapse" ],
 		invalid_values: []
@@ -2180,17 +2193,17 @@ var gCSSProperties = {
 	},
 	"border-left": {
 		domProp: "borderLeft",
 		inherited: false,
 		type: CSS_TYPE_TRUE_SHORTHAND,
 		subproperties: [ "border-left-color", "border-left-style", "border-left-width" ],
 		initial_values: [ "none", "medium", "currentColor", "thin", "none medium currentcolor" ],
 		other_values: [ "solid", "green", "medium solid", "green solid", "10px solid", "thick solid", "5px green none" ],
-		invalid_values: [ "5%" ]
+		invalid_values: [ "5%", "5", "5 solid green" ]
 	},
 	"border-left-color": {
 		domProp: "borderLeftColor",
 		inherited: false,
 		type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
 		prerequisites: { "color": "black" },
 		initial_values: [ "currentColor", "-moz-use-text-color" ],
 		other_values: [ "green", "rgba(255,128,0,0.5)", "transparent" ],
@@ -2217,26 +2230,27 @@ var gCSSProperties = {
 			"calc(-2px)",
 			"calc(0em)",
 			"calc(0px)",
 			"calc(5em)",
 			"calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 5em)",
 		],
-		invalid_values: [ "5%" ]
+		invalid_values: [ "5%" ],
+		quirks_values: { "5": "5px" },
 	},
 	"border-right": {
 		domProp: "borderRight",
 		inherited: false,
 		type: CSS_TYPE_TRUE_SHORTHAND,
 		subproperties: [ "border-right-color", "border-right-style", "border-right-width" ],
 		initial_values: [ "none", "medium", "currentColor", "thin", "none medium currentcolor" ],
 		other_values: [ "solid", "green", "medium solid", "green solid", "10px solid", "thick solid", "5px green none" ],
-		invalid_values: [ "5%" ]
+		invalid_values: [ "5%", "5", "5 solid green" ]
 	},
 	"border-right-color": {
 		domProp: "borderRightColor",
 		inherited: false,
 		type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
 		prerequisites: { "color": "black" },
 		initial_values: [ "currentColor", "-moz-use-text-color" ],
 		other_values: [ "green", "rgba(255,128,0,0.5)", "transparent" ],
@@ -2263,17 +2277,18 @@ var gCSSProperties = {
 			"calc(-2px)",
 			"calc(0em)",
 			"calc(0px)",
 			"calc(5em)",
 			"calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 5em)",
 		],
-		invalid_values: [ "5%" ]
+		invalid_values: [ "5%" ],
+		quirks_values: { "5": "5px" },
 	},
 	"border-spacing": {
 		domProp: "borderSpacing",
 		inherited: true,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "0", "0 0", "0px", "0 0px", "calc(0px)", "calc(0px) calc(0em)", "calc(2em - 2em) calc(3px + 7px - 10px)", "calc(-5px)", "calc(-5px) calc(-5px)" ],
 		other_values: [ "3px", "4em 2px", "4em 0", "0px 2px", "calc(7px)", "0 calc(7px)", "calc(7px) 0", "calc(0px) calc(7px)", "calc(7px) calc(0px)", "7px calc(0px)", "calc(0px) 7px", "7px calc(0px)", "3px calc(2em)" ],
 		invalid_values: [ "0%", "0 0%", "-5px", "-5px -5px", "0 -5px", "-5px 0" ]
@@ -2290,17 +2305,17 @@ var gCSSProperties = {
 	},
 	"border-top": {
 		domProp: "borderTop",
 		inherited: false,
 		type: CSS_TYPE_TRUE_SHORTHAND,
 		subproperties: [ "border-top-color", "border-top-style", "border-top-width" ],
 		initial_values: [ "none", "medium", "currentColor", "thin", "none medium currentcolor" ],
 		other_values: [ "solid", "green", "medium solid", "green solid", "10px solid", "thick solid", "5px green none" ],
-		invalid_values: [ "5%" ]
+		invalid_values: [ "5%", "5", "5 solid green" ]
 	},
 	"border-top-color": {
 		domProp: "borderTopColor",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		prerequisites: { "color": "black" },
 		initial_values: [ "currentColor", "-moz-use-text-color" ],
 		other_values: [ "green", "rgba(255,128,0,0.5)", "transparent" ],
@@ -2327,27 +2342,29 @@ var gCSSProperties = {
 			"calc(-2px)",
 			"calc(0em)",
 			"calc(0px)",
 			"calc(5em)",
 			"calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 5em)",
 		],
-		invalid_values: [ "5%" ]
+		invalid_values: [ "5%" ],
+		quirks_values: { "5": "5px" },
 	},
 	"border-width": {
 		domProp: "borderWidth",
 		inherited: false,
 		type: CSS_TYPE_TRUE_SHORTHAND,
 		subproperties: [ "border-top-width", "border-right-width", "border-bottom-width", "border-left-width" ],
 		prerequisites: { "border-style": "solid" },
 		initial_values: [ "medium", "3px", "medium medium", "3px medium medium", "medium 3px medium medium", "calc(3px) 3px calc(5px - 2px) calc(2px - -1px)" ],
 		other_values: [ "thin", "thick", "1px", "2em", "2px 0 0px 1em", "calc(2em)" ],
-		invalid_values: [ "5%" ]
+		invalid_values: [ "5%" ],
+		quirks_values: { "5": "5px" },
 	},
 	"bottom": {
 		domProp: "bottom",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		/* FIXME: run tests with multiple prerequisites */
 		prerequisites: { "position": "relative" },
 		/* XXX 0 may or may not be equal to auto */
@@ -2355,17 +2372,17 @@ var gCSSProperties = {
 		other_values: [ "32px", "-3em", "12%",
 			"calc(2px)",
 			"calc(-2px)",
 			"calc(50%)",
 			"calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 		],
-		invalid_values: []
+		invalid_values: [ "5" ]
 	},
 	"box-shadow": {
 		domProp: "boxShadow",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "none" ],
 		prerequisites: { "color": "blue" },
 		other_values: [ "2px 2px", "2px 2px 1px", "2px 2px 2px 2px", "blue 3px 2px", "2px 2px 1px 5px green", "2px 2px red", "green 2px 2px 1px", "green 2px 2px, blue 1px 3px 4px", "currentColor 3px 3px", "blue 2px 2px, currentColor 1px 2px, 1px 2px 3px 2px orange", "3px 0 0 0", "inset 2px 2px 3px 4px black", "2px -2px green inset, 4px 4px 3px blue, inset 2px 2px",
@@ -2377,17 +2394,17 @@ var gCSSProperties = {
 			"blue 2px calc(2px + 0.2em)",
 			"2px calc(2px + 0.2em) blue",
 			"calc(-2px) calc(-2px)",
 			"-2px -2px",
 			"calc(2px) calc(2px)",
 			"calc(2px) calc(2px) calc(2px)",
 			"calc(2px) calc(2px) calc(2px) calc(2px)"
 		],
-		invalid_values: [ "3% 3%", "1px 1px 1px 1px 1px", "2px 2px, none", "red 2px 2px blue", "inherit, 2px 2px", "2px 2px, inherit", "2px 2px -5px", "inset 4px 4px black inset", "inset inherit", "inset none" ]
+		invalid_values: [ "3% 3%", "1px 1px 1px 1px 1px", "2px 2px, none", "red 2px 2px blue", "inherit, 2px 2px", "2px 2px, inherit", "2px 2px -5px", "inset 4px 4px black inset", "inset inherit", "inset none", "3 3", "3px 3", "3 3px", "3px 3px 3", "3px 3px 3px 3" ]
 	},
 	"caption-side": {
 		domProp: "captionSide",
 		inherited: true,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "top" ],
 		other_values: [ "right", "left", "bottom", "top-outside", "bottom-outside" ],
 		invalid_values: []
@@ -2401,17 +2418,18 @@ var gCSSProperties = {
 		invalid_values: []
 	},
 	"clip": {
 		domProp: "clip",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "auto" ],
 		other_values: [ "rect(0 0 0 0)", "rect(auto,auto,auto,auto)", "rect(3px, 4px, 4em, 0)", "rect(auto, 3em, 4pt, 2px)", "rect(2px 3px 4px 5px)" ],
-		invalid_values: [ "rect(auto, 3em, 2%, 5px)" ]
+		invalid_values: [ "rect(auto, 3em, 2%, 5px)" ],
+		quirks_values: { "rect(1, 2, 3, 4)": "rect(1px, 2px, 3px, 4px)" },
 	},
 	"color": {
 		domProp: "color",
 		inherited: true,
 		type: CSS_TYPE_LONGHAND,
 		/* XXX should test currentColor, but may or may not be initial */
 		initial_values: [ "black", "#000" ],
 		other_values: [ "green", "#f3c", "#fed292", "rgba(45,300,12,2)", "transparent", "-moz-nativehyperlinktext", "rgba(255,128,0,0.5)" ],
@@ -2507,17 +2525,17 @@ var gCSSProperties = {
 	},
 	"font": {
 		domProp: "font",
 		inherited: true,
 		type: CSS_TYPE_TRUE_SHORTHAND,
 		subproperties: [ "font-style", "font-variant", "font-weight", "font-size", "line-height", "font-family", "font-stretch", "font-size-adjust", "-moz-font-feature-settings", "-moz-font-language-override" ],
 		initial_values: [ (gInitialFontFamilyIsSansSerif ? "medium sans-serif" : "medium serif") ],
 		other_values: [ "large serif", "9px fantasy", "bold italic small-caps 24px/1.4 Times New Roman, serif", "caption", "icon", "menu", "message-box", "small-caption", "status-bar" ],
-		invalid_values: []
+		invalid_values: [ "9 fantasy" ]
 	},
 	"font-family": {
 		domProp: "fontFamily",
 		inherited: true,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ (gInitialFontFamilyIsSansSerif ? "sans-serif" : "serif") ],
 		other_values: [ (gInitialFontFamilyIsSansSerif ? "serif" : "sans-serif"), "Times New Roman, serif", "'Times New Roman', serif", "cursive", "fantasy", "\\\"Times New Roman", "\"Times New Roman\"", "Times, \\\"Times New Roman", "Times, \"Times New Roman\"" ],
 		invalid_values: [ "\"Times New\" Roman", "\"Times New Roman\n", "Times, \"Times New Roman\n" ]
@@ -2562,17 +2580,18 @@ var gCSSProperties = {
 			"0px",
 			"0%",
 			"calc(2em)",
 			"calc(36pt + 75% + (30% + 2em + 2px))",
 			"calc(-2em)",
 			"calc(-50%)",
 			"calc(-1px)"
 		],
-		invalid_values: [ "-2em", "-50%", "-1px" ]
+		invalid_values: [ "-2em", "-50%", "-1px" ],
+		quirks_values: { "5": "5px" },
 	},
 	"font-size-adjust": {
 		domProp: "fontSizeAdjust",
 		inherited: true,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "none" ],
 		other_values: [ "0.3", "0.5", "0.7" ],
 		invalid_values: []
@@ -2619,17 +2638,18 @@ var gCSSProperties = {
 		prerequisites: { "display": "block" },
 		other_values: [ "15px", "3em", "15%",
 			"calc(2px)",
 			"calc(50%)",
 			"calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 		],
-		invalid_values: [ "none", "-moz-max-content", "-moz-min-content", "-moz-fit-content", "-moz-available" ]
+		invalid_values: [ "none", "-moz-max-content", "-moz-min-content", "-moz-fit-content", "-moz-available" ],
+		quirks_values: { "5": "5px" },
 	},
 	"ime-mode": {
 		domProp: "imeMode",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "auto" ],
 		other_values: [ "normal", "disabled", "active", "inactive" ],
 		invalid_values: [ "none", "enabled", "1px" ]
@@ -2645,28 +2665,30 @@ var gCSSProperties = {
 		other_values: [ "32px", "-3em", "12%",
 			"calc(2px)",
 			"calc(-2px)",
 			"calc(50%)",
 			"calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 		],
-		invalid_values: []
+		invalid_values: [],
+		quirks_values: { "5": "5px" },
 	},
 	"letter-spacing": {
 		domProp: "letterSpacing",
 		inherited: true,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "normal" ],
 		other_values: [ "0", "0px", "1em", "2px", "-3px",
 			"calc(0px)", "calc(1em)", "calc(1em + 3px)",
 			"calc(15px / 2)", "calc(15px/2)", "calc(-3px)"
 		],
-		invalid_values: []
+		invalid_values: [],
+		quirks_values: { "5": "5px" },
 	},
 	"line-height": {
 		domProp: "lineHeight",
 		inherited: true,
 		type: CSS_TYPE_LONGHAND,
 		/*
 		 * Inheritance tests require consistent font size, since
 		 * getComputedStyle (which uses the CSS2 computed value, or
@@ -2736,83 +2758,88 @@ var gCSSProperties = {
 	},
 	"margin": {
 		domProp: "margin",
 		inherited: false,
 		type: CSS_TYPE_TRUE_SHORTHAND,
 		subproperties: [ "margin-top", "margin-right", "margin-bottom", "margin-left" ],
 		initial_values: [ "0", "0px 0 0em", "0% 0px 0em 0pt" ],
 		other_values: [ "3px 0", "2em 4px 2pt", "1em 2em 3px 4px" ],
-		invalid_values: []
+		invalid_values: [],
+		quirks_values: { "5": "5px", "3px 6px 2 5px": "3px 6px 2px 5px" },
 	},
 	"margin-bottom": {
 		domProp: "marginBottom",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		/* XXX testing auto has prerequisites */
 		initial_values: [ "0", "0px", "0%", "calc(0pt)", "calc(0% + 0px)" ],
 		other_values: [ "1px", "2em", "5%",
 			"calc(2px)",
 			"calc(-2px)",
 			"calc(50%)",
 			"calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 		],
-		invalid_values: [ ]
+		invalid_values: [ ],
+		quirks_values: { "5": "5px" },
 	},
 	"margin-left": {
 		domProp: "marginLeft",
 		inherited: false,
 		type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
 		/* no subproperties */
 		/* XXX testing auto has prerequisites */
 		initial_values: [ "0", "0px", "0%", "calc(0pt)", "calc(0% + 0px)" ],
 		other_values: [ "1px", "2em", "5%", ".5px", "+32px", "+.789px", "-.328px", "+0.56px", "-0.974px", "237px", "-289px", "-056px", "1987.45px", "-84.32px",
 			"calc(2px)",
 			"calc(-2px)",
 			"calc(50%)",
 			"calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 		],
-		invalid_values: [ "..25px", ".+5px", ".px", "-.px", "++5px", "-+4px", "+-3px", "--7px", "+-.6px", "-+.5px", "++.7px", "--.4px" ]
+		invalid_values: [ "..25px", ".+5px", ".px", "-.px", "++5px", "-+4px", "+-3px", "--7px", "+-.6px", "-+.5px", "++.7px", "--.4px" ],
+		quirks_values: { "5": "5px" },
 	},
 	"margin-right": {
 		domProp: "marginRight",
 		inherited: false,
 		type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
 		/* no subproperties */
 		/* XXX testing auto has prerequisites */
 		initial_values: [ "0", "0px", "0%", "calc(0pt)", "calc(0% + 0px)" ],
 		other_values: [ "1px", "2em", "5%",
 			"calc(2px)",
 			"calc(-2px)",
 			"calc(50%)",
 			"calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 		],
-		invalid_values: [ ]
+		invalid_values: [ ],
+		quirks_values: { "5": "5px" },
 	},
 	"margin-top": {
 		domProp: "marginTop",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		/* XXX testing auto has prerequisites */
 		initial_values: [ "0", "0px", "0%", "calc(0pt)", "calc(0% + 0px)" ],
 		other_values: [ "1px", "2em", "5%",
 			"calc(2px)",
 			"calc(-2px)",
 			"calc(50%)",
 			"calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 		],
-		invalid_values: [ ]
+		invalid_values: [ ],
+		quirks_values: { "5": "5px" },
 	},
 	"marker-offset": {
 		domProp: "markerOffset",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "auto" ],
 		other_values: [ "6em", "-1px", "calc(0px)", "calc(3em + 2px - 4px)", "calc(-2em)" ],
 		invalid_values: []
@@ -2837,64 +2864,64 @@ var gCSSProperties = {
 			"calc(2px)",
 			"calc(-2px)",
 			"calc(0px)",
 			"calc(50%)",
 			"calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 		],
-		invalid_values: [ "auto", "-moz-max-content", "-moz-min-content", "-moz-fit-content", "-moz-available" ]
+		invalid_values: [ "auto", "-moz-max-content", "-moz-min-content", "-moz-fit-content", "-moz-available", "5" ]
 	},
 	"max-width": {
 		domProp: "maxWidth",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		prerequisites: { "display": "block" },
 		initial_values: [ "none" ],
 		other_values: [ "30px", "50%", "0", "-moz-max-content", "-moz-min-content", "-moz-fit-content", "-moz-available",
 			"calc(2px)",
 			"calc(-2px)",
 			"calc(0px)",
 			"calc(50%)",
 			"calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 		],
-		invalid_values: [ "auto" ]
+		invalid_values: [ "auto", "5" ]
 	},
 	"min-height": {
 		domProp: "minHeight",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		prerequisites: { "display": "block" },
 		initial_values: [ "auto", "0", "calc(0em)", "calc(-2px)", "calc(-1%)" ],
 		other_values: [ "30px", "50%",
 			"calc(2px)",
 			"calc(50%)",
 			"calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 		],
-		invalid_values: [ "none", "-moz-max-content", "-moz-min-content", "-moz-fit-content", "-moz-available" ]
+		invalid_values: [ "none", "-moz-max-content", "-moz-min-content", "-moz-fit-content", "-moz-available", "5" ]
 	},
 	"min-width": {
 		domProp: "minWidth",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		prerequisites: { "display": "block" },
 		initial_values: [ "auto", "0", "calc(0em)", "calc(-2px)", "calc(-1%)" ],
 		other_values: [ "30px", "50%", "-moz-max-content", "-moz-min-content", "-moz-fit-content", "-moz-available",
 			"calc(2px)",
 			"calc(50%)",
 			"calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 		],
-		invalid_values: [ "none" ]
+		invalid_values: [ "none", "5" ]
 	},
 	"opacity": {
 		domProp: "opacity",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "1", "17", "397.376" ],
 		other_values: [ "0", "0.4", "0.0000", "-3" ],
 		invalid_values: [ "0px", "1px" ]
@@ -2924,17 +2951,17 @@ var gCSSProperties = {
 		subproperties: [ "outline-color", "outline-style", "outline-width" ],
 		initial_values: [
 			"none", "medium", "thin",
 			// XXX Should be invert, but currently currentcolor.
 			//"invert", "none medium invert"
 			"currentColor", "none medium currentcolor"
 		],
 		other_values: [ "solid", "medium solid", "green solid", "10px solid", "thick solid" ],
-		invalid_values: [ "5%" ]
+		invalid_values: [ "5%", "5", "5 solid green" ]
 	},
 	"outline-color": {
 		domProp: "outlineColor",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		prerequisites: { "color": "black" },
 		initial_values: [ "currentColor", "-moz-use-text-color" ], // XXX should be invert
 		other_values: [ "green", "rgba(255,128,0,0.5)", "transparent" ],
@@ -2968,17 +2995,17 @@ var gCSSProperties = {
 			"calc(-2px)",
 			"calc(0px)",
 			"calc(0px)",
 			"calc(5em)",
 			"calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 5em)",
 		],
-		invalid_values: [ "5%" ]
+		invalid_values: [ "5%", "5" ]
 	},
 	"overflow": {
 		domProp: "overflow",
 		inherited: false,
 		type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
 		prerequisites: { "display": "block" },
 		subproperties: [ "overflow-x", "overflow-y" ],
 		initial_values: [ "visible" ],
@@ -3005,75 +3032,80 @@ var gCSSProperties = {
 	},
 	"padding": {
 		domProp: "padding",
 		inherited: false,
 		type: CSS_TYPE_TRUE_SHORTHAND,
 		subproperties: [ "padding-top", "padding-right", "padding-bottom", "padding-left" ],
 		initial_values: [ "0", "0px 0 0em", "0% 0px 0em 0pt", "calc(0px) calc(0em) calc(-2px) calc(-1%)" ],
 		other_values: [ "3px 0", "2em 4px 2pt", "1em 2em 3px 4px" ],
-		invalid_values: []
+		invalid_values: [],
+		quirks_values: { "5": "5px", "3px 6px 2 5px": "3px 6px 2px 5px" },
 	},
 	"padding-bottom": {
 		domProp: "paddingBottom",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "0", "0px", "0%", "calc(0pt)", "calc(0% + 0px)", "calc(-3px)", "calc(-1%)" ],
 		other_values: [ "1px", "2em", "5%",
 			"calc(2px)",
 			"calc(50%)",
 			"calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 		],
-		invalid_values: [ ]
+		invalid_values: [ ],
+		quirks_values: { "5": "5px" },
 	},
 	"padding-left": {
 		domProp: "paddingLeft",
 		inherited: false,
 		type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
 		/* no subproperties */
 		initial_values: [ "0", "0px", "0%", "calc(0pt)", "calc(0% + 0px)", "calc(-3px)", "calc(-1%)" ],
 		other_values: [ "1px", "2em", "5%",
 			"calc(2px)",
 			"calc(50%)",
 			"calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 		],
-		invalid_values: [ ]
+		invalid_values: [ ],
+		quirks_values: { "5": "5px" },
 	},
 	"padding-right": {
 		domProp: "paddingRight",
 		inherited: false,
 		type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
 		/* no subproperties */
 		initial_values: [ "0", "0px", "0%", "calc(0pt)", "calc(0% + 0px)", "calc(-3px)", "calc(-1%)" ],
 		other_values: [ "1px", "2em", "5%",
 			"calc(2px)",
 			"calc(50%)",
 			"calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 		],
-		invalid_values: [ ]
+		invalid_values: [ ],
+		quirks_values: { "5": "5px" },
 	},
 	"padding-top": {
 		domProp: "paddingTop",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "0", "0px", "0%", "calc(0pt)", "calc(0% + 0px)", "calc(-3px)", "calc(-1%)" ],
 		other_values: [ "1px", "2em", "5%",
 			"calc(2px)",
 			"calc(50%)",
 			"calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 		],
-		invalid_values: [ ]
+		invalid_values: [ ],
+		quirks_values: { "5": "5px" },
 	},
 	"page": {
 		domProp: "page",
 		inherited: true,
 		backend_only: true,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "auto" ],
 		other_values: [ "foo", "bar" ],
@@ -3141,17 +3173,18 @@ var gCSSProperties = {
 		other_values: [ "32px", "-3em", "12%",
 			"calc(2px)",
 			"calc(-2px)",
 			"calc(50%)",
 			"calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 		],
-		invalid_values: []
+		invalid_values: [],
+		quirks_values: { "5": "5px" },
 	},
 	"size": {
 		/* XXX not a real property; applies only to page context */
 		domProp: "size",
 		inherited: false,
 		backend_only: true,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "auto" ],
@@ -3237,17 +3270,17 @@ var gCSSProperties = {
 		other_values: [ "2em", "5%", "-10px",
 			"calc(2px)",
 			"calc(-2px)",
 			"calc(50%)",
 			"calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 		],
-		invalid_values: []
+		invalid_values: [ "5" ]
 	},
 	"text-overflow": {
 		domProp: "textOverflow",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "clip" ],
 		other_values: [ "ellipsis", '""', "''", '"hello"', 'clip clip', 'ellipsis ellipsis', 'clip ellipsis', 'clip ""', '"hello" ""', '"" ellipsis' ],
 		invalid_values: [ "none", "auto", '"hello" inherit', 'inherit "hello"', 'clip initial', 'initial clip', 'initial inherit', 'inherit initial', 'inherit none']
@@ -3266,17 +3299,17 @@ var gCSSProperties = {
 			"2px calc(2px + 0.2em)",
 			"blue 2px calc(2px + 0.2em)",
 			"2px calc(2px + 0.2em) blue",
 			"calc(-2px) calc(-2px)",
 			"-2px -2px",
 			"calc(2px) calc(2px)",
 			"calc(2px) calc(2px) calc(2px)",
 		],
-		invalid_values: [ "3% 3%", "2px 2px -5px", "2px 2px 2px 2px", "2px 2px, none", "none, 2px 2px", "inherit, 2px 2px", "2px 2px, inherit",
+		invalid_values: [ "3% 3%", "2px 2px -5px", "2px 2px 2px 2px", "2px 2px, none", "none, 2px 2px", "inherit, 2px 2px", "2px 2px, inherit", "2 2px", "2px 2", "2px 2px 2", "2px 2px 2px 2",
 			"calc(2px) calc(2px) calc(2px) calc(2px)"
 		]
 	},
 	"text-transform": {
 		domProp: "textTransform",
 		inherited: true,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "none" ],
@@ -3294,17 +3327,18 @@ var gCSSProperties = {
 		other_values: [ "32px", "-3em", "12%",
 			"calc(2px)",
 			"calc(-2px)",
 			"calc(50%)",
 			"calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 		],
-		invalid_values: []
+		invalid_values: [],
+		quirks_values: { "5": "5px" },
 	},
 	"transition": {
 		domProp: "transition",
 		inherited: false,
 		type: CSS_TYPE_TRUE_SHORTHAND,
 		subproperties: [ "transition-property", "transition-duration", "transition-timing-function", "transition-delay" ],
 		initial_values: [ "all 0s ease 0s", "all", "0s", "0s 0s", "ease" ],
 		other_values: [ "width 1s linear 2s", "width 1s 2s linear", "width linear 1s 2s", "linear width 1s 2s", "linear 1s width 2s", "linear 1s 2s width", "1s width linear 2s", "1s width 2s linear", "1s 2s width linear", "1s linear width 2s", "1s linear 2s width", "1s 2s linear width", "width linear 1s", "width 1s linear", "linear width 1s", "linear 1s width", "1s width linear", "1s linear width", "1s 2s width", "1s width 2s", "width 1s 2s", "1s 2s linear", "1s linear 2s", "linear 1s 2s", "width 1s", "1s width", "linear 1s", "1s linear", "1s 2s", "2s 1s", "width", "linear", "1s", "height", "2s", "ease-in-out", "2s ease-in", "opacity linear", "ease-out 2s", "2s color, 1s width, 500ms height linear, 1s opacity 4s cubic-bezier(0.0, 0.1, 1.0, 1.0)", "1s \\32width linear 2s", "1s -width linear 2s", "1s -\\32width linear 2s", "1s \\32 0width linear 2s", "1s -\\32 0width linear 2s", "1s \\2width linear 2s", "1s -\\2width linear 2s" ],
@@ -3358,17 +3392,17 @@ var gCSSProperties = {
 		other_values: [ "sub", "super", "top", "text-top", "middle", "bottom", "text-bottom", "15%", "3px", "0.2em", "-5px", "-3%",
 			"calc(2px)",
 			"calc(-2px)",
 			"calc(50%)",
 			"calc(3*25px)",
 			"calc(25px*3)",
 			"calc(3*25px + 50%)",
 		],
-		invalid_values: []
+		invalid_values: [ "5" ]
 	},
 	"visibility": {
 		domProp: "visibility",
 		inherited: true,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "visible" ],
 		other_values: [ "hidden", "collapse" ],
 		invalid_values: []
@@ -3480,17 +3514,18 @@ var gCSSProperties = {
 			 * http://lists.w3.org/Archives/Public/www-style/2010Jan/0007.html
 			 * , we should support all 4 of these as described in
 			 * http://lists.w3.org/Archives/Public/www-style/2009Dec/0296.html
 			 */
 			"calc((3em / 100%) * 3em)",
 			"calc(3em / 100% * 3em)",
 			"calc(3em * (3em / 100%))",
 			"calc(3em * 3em / 100%)",
-		]
+		],
+		quirks_values: { "5": "5px" },
 	},
 	"word-break": {
 		domProp: "wordBreak",
 		inherited: true,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "normal" ],
 		other_values: [ "break-all", "keep-all" ],
 		invalid_values: []
@@ -3502,17 +3537,18 @@ var gCSSProperties = {
 		initial_values: [ "normal", "0", "0px", "-0em",
 			"calc(-0px)", "calc(0em)"
 		],
 		other_values: [ "1em", "2px", "-3px",
 			"calc(1em)", "calc(1em + 3px)",
 			"calc(15px / 2)", "calc(15px/2)",
 			"calc(-2em)"
 		],
-		invalid_values: []
+		invalid_values: [],
+		quirks_values: { "5": "5px" },
 	},
 	"word-wrap": {
 		domProp: "wordWrap",
 		inherited: true,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "normal" ],
 		other_values: [ "break-word" ],
 		invalid_values: []