From 5a6fcd294ab875231bbc54b7b3de72169670ab06 Mon Sep 17 00:00:00 2001 From: "L. David Baron" Date: Tue, 18 Sep 2012 11:37:14 -0700 Subject: [PATCH] Bug 774169, patch 2: Add property_database.js entries for property aliases. r=bzbarsky This adds entries for property aliases as though they are shorthands. This fits with the CSS working group's recent resolution to describe aliases as shorthands, recorded in http://lists.w3.org/Archives/Public/www-style/2012Aug/0770.html . The property_database.js entries themselves are copied from the non-alias entries for the properties, with these changes: (1) The property name is changed to the prefixed form (2) The domProp entry is changed to the prefixed form (3) Adding alias_for entries for each property. (4) When type is CSS_TYPE_LONGHAND in the target of the alias, type for the alias is CSS_TYPE_SHORTHAND_AND_LONGHAND and a subproperties entry is added with the target of the alias. There are also some indentation fixes to the copied entries in property_database.js (made before they were copied, and thus affecting the original as well). --- layout/style/test/ListCSSProperties.cpp | 14 + layout/style/test/property_database.js | 413 ++++++++++++++++-- .../test_garbage_at_end_of_declarations.html | 3 + layout/style/test/test_inherit_storage.html | 9 +- layout/style/test/test_initial_storage.html | 9 +- .../test/test_transitions_per_property.html | 1 + layout/style/test/test_value_storage.html | 9 +- 7 files changed, 416 insertions(+), 42 deletions(-) diff --git a/layout/style/test/ListCSSProperties.cpp b/layout/style/test/ListCSSProperties.cpp index 4e146b7557a..edba65c42f2 100644 --- a/layout/style/test/ListCSSProperties.cpp +++ b/layout/style/test/ListCSSProperties.cpp @@ -62,6 +62,13 @@ const PropertyInfo gShorthandProperties[] = { #undef LISTCSSPROPERTIES_INNER_MACRO #undef CSS_PROP_DOMPROP_PREFIXED +#define CSS_PROP_ALIAS(name_, id_, method_, pref_) \ + { #name_, #method_ }, + +#include "nsCSSPropAliasList.h" + +#undef CSS_PROP_ALIAS + }; /* see gLonghandPropertiesWithDOMProp */ @@ -76,6 +83,13 @@ const char* gShorthandPropertiesWithDOMProp[] = { #undef CSS_PROP_SHORTHAND #undef CSS_PROP_LIST_EXCLUDE_INTERNAL +#define CSS_PROP_ALIAS(name_, id_, method_, pref_) \ + #name_, + +#include "nsCSSPropAliasList.h" + +#undef CSS_PROP_ALIAS + }; diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js index 0ce6c16ed0e..021fc1b28fc 100644 --- a/layout/style/test/property_database.js +++ b/layout/style/test/property_database.js @@ -19,6 +19,9 @@ const CSS_TYPE_SHORTHAND_AND_LONGHAND = 2; // inherited: Whether the property is inherited by default (stated as // yes or no in the property header in all CSS specs) // type: see above +// alias_for: optional, indicates that the property is an alias for +// some other property that is the preferred serialization. (Type +// must not be CSS_TYPE_LONGHAND.) // get_computed: if present, the property's computed value shows up on // another property, and this is a function used to get it // initial_values: Values whose computed value should be the same as the @@ -1342,34 +1345,34 @@ var gCSSProperties = { "border", "center red", "right diagonal", "#00ffff bottom"] }, - "perspective-origin": { - domProp: "perspectiveOrigin", - inherited: false, - type: CSS_TYPE_LONGHAND, - /* no subproperties */ - prerequisites: { "width": "10px", "height": "10px", "display": "block"}, - initial_values: [ "50% 50%", "center", "center center" ], - other_values: [ "25% 25%", "6px 5px", "20% 3em", "0 0", "0in 1in", - "top", "bottom","top left", "top right", - "top center", "center left", "center right", - "bottom left", "bottom right", "bottom center", - "20% center", "6px center", "13in bottom", - "left 50px", "right 13%", "center 40px", - "calc(20px)", - "calc(20px) 10px", - "10px calc(20px)", - "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: [ "red", "auto", "none", "0.5 0.5", "40px #0000ff", - "border", "center red", "right diagonal", - "#00ffff bottom"] - }, - "perspective": { + "perspective-origin": { + domProp: "perspectiveOrigin", + inherited: false, + type: CSS_TYPE_LONGHAND, + /* no subproperties */ + prerequisites: { "width": "10px", "height": "10px", "display": "block"}, + initial_values: [ "50% 50%", "center", "center center" ], + other_values: [ "25% 25%", "6px 5px", "20% 3em", "0 0", "0in 1in", + "top", "bottom","top left", "top right", + "top center", "center left", "center right", + "bottom left", "bottom right", "bottom center", + "20% center", "6px center", "13in bottom", + "left 50px", "right 13%", "center 40px", + "calc(20px)", + "calc(20px) 10px", + "10px calc(20px)", + "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: [ "red", "auto", "none", "0.5 0.5", "40px #0000ff", + "border", "center red", "right diagonal", + "#00ffff bottom"] + }, + "perspective": { domProp: "perspective", inherited: false, type: CSS_TYPE_LONGHAND, @@ -1377,14 +1380,14 @@ var gCSSProperties = { other_values: [ "1000px", "500.2px" ], invalid_values: [ "pants", "200", "0", "-100px", "-27.2em" ] }, - "backface-visibility": { - domProp: "backfaceVisibility", - inherited: false, - type: CSS_TYPE_LONGHAND, - initial_values: [ "visible" ], - other_values: [ "hidden" ], - invalid_values: [ "collapse" ] - }, + "backface-visibility": { + domProp: "backfaceVisibility", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: [ "visible" ], + other_values: [ "hidden" ], + invalid_values: [ "collapse" ] + }, "transform-style": { domProp: "transformStyle", inherited: false, @@ -3853,6 +3856,344 @@ var gCSSProperties = { initial_values: [ "none" ], other_values: [ "non-scaling-stroke" ], invalid_values: [] + }, + + // Aliases + "-moz-transform": { + domProp: "MozTransform", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "transform", + subproperties: [ "transform" ], + prerequisites: { "width": "300px", "height": "50px" }, + initial_values: [ "none" ], + other_values: [ "translatex(1px)", "translatex(4em)", + "translatex(-4px)", "translatex(3px)", + "translatex(0px) translatex(1px) translatex(2px) translatex(3px) translatex(4px)", + "translatey(4em)", "translate(3px)", "translate(10px, -3px)", + "rotate(45deg)", "rotate(45grad)", "rotate(45rad)", + "rotate(0.25turn)", "rotate(0)", "scalex(10)", "scaley(10)", + "scale(10)", "scale(10, 20)", "skewx(30deg)", "skewx(0)", + "skewy(0)", "skewx(30grad)", "skewx(30rad)", "skewx(0.08turn)", + "skewy(30deg)", "skewy(30grad)", "skewy(30rad)", "skewy(0.08turn)", + "rotate(45deg) scale(2, 1)", "skewx(45deg) skewx(-50grad)", + "translate(0, 0) scale(1, 1) skewx(0) skewy(0) matrix(1, 0, 0, 1, 0, 0)", + "translatex(50%)", "translatey(50%)", "translate(50%)", + "translate(3%, 5px)", "translate(5px, 3%)", + "matrix(1, 2, 3, 4, 5, 6)", + /* valid calc() values */ + "translatex(calc(5px + 10%))", + "translatey(calc(0.25 * 5px + 10% / 3))", + "translate(calc(5px - 10% * 3))", + "translate(calc(5px - 3 * 10%), 50px)", + "translate(-50px, calc(5px - 10% * 3))", + ].concat(SpecialPowers.getBoolPref("layout.3d-transforms.enabled") ? [ + "translatez(1px)", "translatez(4em)", "translatez(-4px)", + "translatez(0px)", "translatez(2px) translatez(5px)", + "translate3d(3px, 4px, 5px)", "translate3d(2em, 3px, 1em)", + "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)", + /* invalid calc() values */ + "translatey(-moz-min(5px,10%))", + "translatex(-moz-max(5px,10%))", + "translate(10px, calc(min(5px,10%)))", + "translate(calc(max(5px,10%)), 10%)", + "matrix(1, 0, 0, 1, max(5px * 3), calc(10% - 3px))" + ].concat(SpecialPowers.getBoolPref("layout.3d-transforms.enabled") ? [ + "perspective(0px)", "perspective(-10px)", "matrix3d(dinosaur)", + "matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)", + "matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)", + "matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15%, 16)", + "matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16px)", + "rotatey(words)", "rotatex(7)", "translate3d(3px, 4px, 1px, 7px)", + "matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13px, 14em, 15px, 16)", + "matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 20%, 10%, 15, 16)" + ] : []) + }, + "-moz-transform-origin": { + domProp: "MozTransformOrigin", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "transform-origin", + subproperties: [ "transform-origin" ], + prerequisites: { "width": "10px", "height": "10px", "display": "block"}, + initial_values: [ "50% 50%", "center", "center center" ], + other_values: [ "25% 25%", "6px 5px", "20% 3em", "0 0", "0in 1in", + "top", "bottom","top left", "top right", + "top center", "center left", "center right", + "bottom left", "bottom right", "bottom center", + "20% center", "6px center", "13in bottom", + "left 50px", "right 13%", "center 40px", + "calc(20px)", + "calc(20px) 10px", + "10px calc(20px)", + "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%)" + ].concat(SpecialPowers.getBoolPref("layout.3d-transforms.enabled") ? [ + "6px 5px 5px", + "top center 10px" + ] : []), + invalid_values: ["red", "auto", "none", "0.5 0.5", "40px #0000ff", + "border", "center red", "right diagonal", + "#00ffff bottom"] + }, + "-moz-perspective-origin": { + domProp: "MozPerspectiveOrigin", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "perspective-origin", + subproperties: [ "perspective-origin" ], + prerequisites: { "width": "10px", "height": "10px", "display": "block"}, + initial_values: [ "50% 50%", "center", "center center" ], + other_values: [ "25% 25%", "6px 5px", "20% 3em", "0 0", "0in 1in", + "top", "bottom","top left", "top right", + "top center", "center left", "center right", + "bottom left", "bottom right", "bottom center", + "20% center", "6px center", "13in bottom", + "left 50px", "right 13%", "center 40px", + "calc(20px)", + "calc(20px) 10px", + "10px calc(20px)", + "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: [ "red", "auto", "none", "0.5 0.5", "40px #0000ff", + "border", "center red", "right diagonal", + "#00ffff bottom"] + }, + "-moz-perspective": { + domProp: "MozPerspective", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "perspective", + subproperties: [ "perspective" ], + initial_values: [ "none" ], + other_values: [ "1000px", "500.2px" ], + invalid_values: [ "pants", "200", "0", "-100px", "-27.2em" ] + }, + "-moz-backface-visibility": { + domProp: "MozBackfaceVisibility", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "backface-visibility", + subproperties: [ "backface-visibility" ], + initial_values: [ "visible" ], + other_values: [ "hidden" ], + invalid_values: [ "collapse" ] + }, + "-moz-transform-style": { + domProp: "MozTransformStyle", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "transform-style", + subproperties: [ "transform-style" ], + initial_values: [ "flat" ], + other_values: [ "preserve-3d" ], + invalid_values: [] + }, + "-moz-border-image": { + domProp: "MozBorderImage", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + alias_for: "border-image", + 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", + "url('border.png') 27", + "stretch url('border.png')", + "url('border.png') 27 fill", + "url('border.png') 27 27 27 27 repeat", + "repeat url('border.png') 27 27 27 27", + "url('border.png') repeat 27 27 27 27", + "url('border.png') fill 27 27 27 27 repeat", + "url('border.png') 27 27 27 27 / 1em", + "27 27 27 27 / 1em url('border.png') ", + "url('border.png') 27 27 27 27 / 10 10 10 / 10 10 repeat", + "repeat 27 27 27 27 / 10 10 10 / 10 10 url('border.png')", + "url('border.png') 27 27 27 27 / / 10 10 1em", + "fill 27 27 27 27 / / 10 10 1em url('border.png')", + "url('border.png') 27 27 27 27 / 1em 1em 1em 1em repeat", + "url('border.png') 27 27 27 27 / 1em 1em 1em 1em stretch round" ], + invalid_values: [ "url('border.png') 27 27 27 27 27", + "url('border.png') 27 27 27 27 / 1em 1em 1em 1em 1em", + "url('border.png') 27 27 27 27 /", + "url('border.png') fill", + "url('border.png') fill repeat", + "fill repeat", + "url('border.png') fill / 1em", + "url('border.png') / repeat", + "url('border.png') 1 /", + "url('border.png') 1 / /", + "1 / url('border.png')", + "url('border.png') / 1", + "url('border.png') / / 1"] + }, + "-moz-transition": { + domProp: "MozTransition", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + alias_for: "transition", + 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" ], + invalid_values: [ "2s, 1s width", "1s width, 2s", "2s all, 1s width", "1s width, 2s all", "1s width, 2s none", "2s none, 1s width", "2s inherit", "inherit 2s", "2s width, 1s inherit", "2s inherit, 1s width", "2s initial", "2s all, 1s width", "2s width, 1s all" ] + }, + "-moz-transition-delay": { + domProp: "MozTransitionDelay", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "transition-delay", + subproperties: [ "transition-delay" ], + initial_values: [ "0s", "0ms" ], + other_values: [ "1s", "250ms", "-100ms", "-1s", "1s, 250ms, 2.3s"], + invalid_values: [ "0", "0px" ] + }, + "-moz-transition-duration": { + domProp: "MozTransitionDuration", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "transition-duration", + subproperties: [ "transition-duration" ], + initial_values: [ "0s", "0ms" ], + other_values: [ "1s", "250ms", "1s, 250ms, 2.3s"], + invalid_values: [ "0", "0px", "-1ms", "-2s" ] + }, + "-moz-transition-property": { + domProp: "MozTransitionProperty", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "transition-property", + subproperties: [ "transition-property" ], + initial_values: [ "all" ], + other_values: [ "none", "left", "top", "color", "width, height, opacity", "foobar", "auto", "\\32width", "-width", "-\\32width", "\\32 0width", "-\\32 0width", "\\2width", "-\\2width" ], + invalid_values: [ "none, none", "all, all", "color, none", "none, color", "all, color", "color, all", "inherit, color", "color, inherit", "initial, color", "color, initial", "none, color", "color, none", "all, color", "color, all" ] + }, + "-moz-transition-timing-function": { + domProp: "MozTransitionTimingFunction", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "transition-timing-function", + subproperties: [ "transition-timing-function" ], + initial_values: [ "ease", "cubic-bezier(0.25, 0.1, 0.25, 1.0)" ], + other_values: [ "linear", "ease-in", "ease-out", "ease-in-out", "linear, ease-in, cubic-bezier(0.1, 0.2, 0.8, 0.9)", "cubic-bezier(0.5, 0.5, 0.5, 0.5)", "cubic-bezier(0.25, 1.5, 0.75, -0.5)", "step-start", "step-end", "steps(1)", "steps(2, start)", "steps(386)", "steps(3, end)" ], + invalid_values: [ "none", "auto", "cubic-bezier(0.25, 0.1, 0.25)", "cubic-bezier(0.25, 0.1, 0.25, 0.25, 1.0)", "cubic-bezier(-0.5, 0.5, 0.5, 0.5)", "cubic-bezier(1.5, 0.5, 0.5, 0.5)", "cubic-bezier(0.5, 0.5, -0.5, 0.5)", "cubic-bezier(0.5, 0.5, 1.5, 0.5)", "steps(2, step-end)", "steps(0)", "steps(-2)", "steps(0, step-end, 1)" ] + }, + "-moz-animation": { + domProp: "MozAnimation", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + alias_for: "animation", + subproperties: [ "animation-name", "animation-duration", "animation-timing-function", "animation-delay", "animation-direction", "animation-fill-mode", "animation-iteration-count" ], + initial_values: [ "none none 0s 0s ease normal 1.0", "none", "0s", "ease", "normal", "1.0" ], + other_values: [ "bounce 1s linear 2s", "bounce 1s 2s linear", "bounce linear 1s 2s", "linear bounce 1s 2s", "linear 1s bounce 2s", "linear 1s 2s bounce", "1s bounce linear 2s", "1s bounce 2s linear", "1s 2s bounce linear", "1s linear bounce 2s", "1s linear 2s bounce", "1s 2s linear bounce", "bounce linear 1s", "bounce 1s linear", "linear bounce 1s", "linear 1s bounce", "1s bounce linear", "1s linear bounce", "1s 2s bounce", "1s bounce 2s", "bounce 1s 2s", "1s 2s linear", "1s linear 2s", "linear 1s 2s", "bounce 1s", "1s bounce", "linear 1s", "1s linear", "1s 2s", "2s 1s", "bounce", "linear", "1s", "height", "2s", "ease-in-out", "2s ease-in", "opacity linear", "ease-out 2s", "2s color, 1s bounce, 500ms height linear, 1s opacity 4s cubic-bezier(0.0, 0.1, 1.0, 1.0)", "1s \\32bounce linear 2s", "1s -bounce linear 2s", "1s -\\32bounce linear 2s", "1s \\32 0bounce linear 2s", "1s -\\32 0bounce linear 2s", "1s \\2bounce linear 2s", "1s -\\2bounce linear 2s", "2s, 1s bounce", "1s bounce, 2s", "2s all, 1s bounce", "1s bounce, 2s all", "1s bounce, 2s none", "2s none, 1s bounce", "2s bounce, 1s all", "2s all, 1s bounce" ], + invalid_values: [ "2s inherit", "inherit 2s", "2s bounce, 1s inherit", "2s inherit, 1s bounce", "2s initial" ] + }, + "-moz-animation-delay": { + domProp: "MozAnimationDelay", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "animation-delay", + subproperties: [ "animation-delay" ], + initial_values: [ "0s", "0ms" ], + other_values: [ "1s", "250ms", "-100ms", "-1s", "1s, 250ms, 2.3s"], + invalid_values: [ "0", "0px" ] + }, + "-moz-animation-direction": { + domProp: "MozAnimationDirection", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "animation-direction", + subproperties: [ "animation-direction" ], + initial_values: [ "normal" ], + other_values: [ "alternate", "normal, alternate", "alternate, normal", "normal, normal", "normal, normal, normal", "reverse", "alternate-reverse", "normal, reverse, alternate-reverse, alternate" ], + invalid_values: [ "normal normal", "inherit, normal", "reverse-alternate" ] + }, + "-moz-animation-duration": { + domProp: "MozAnimationDuration", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "animation-duration", + subproperties: [ "animation-duration" ], + initial_values: [ "0s", "0ms" ], + other_values: [ "1s", "250ms", "1s, 250ms, 2.3s"], + invalid_values: [ "0", "0px", "-1ms", "-2s" ] + }, + "-moz-animation-fill-mode": { + domProp: "MozAnimationFillMode", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "animation-fill-mode", + subproperties: [ "animation-fill-mode" ], + initial_values: [ "none" ], + other_values: [ "forwards", "backwards", "both", "none, none", "forwards, backwards", "forwards, none", "none, both" ], + invalid_values: [ "all"] + }, + "-moz-animation-iteration-count": { + domProp: "MozAnimationIterationCount", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "animation-iteration-count", + subproperties: [ "animation-iteration-count" ], + initial_values: [ "1" ], + other_values: [ "infinite", "0", "0.5", "7.75", "-0.0", "1, 2, 3", "infinite, 2", "1, infinite" ], + // negatives forbidden per + // http://lists.w3.org/Archives/Public/www-style/2011Mar/0355.html + invalid_values: [ "none", "-1", "-0.5", "-1, infinite", "infinite, -3" ] + }, + "-moz-animation-name": { + domProp: "MozAnimationName", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "animation-name", + subproperties: [ "animation-name" ], + initial_values: [ "none" ], + other_values: [ "all", "ball", "mall", "color", "bounce, bubble, opacity", "foobar", "auto", "\\32bounce", "-bounce", "-\\32bounce", "\\32 0bounce", "-\\32 0bounce", "\\2bounce", "-\\2bounce" ], + invalid_values: [ "bounce, initial", "initial, bounce", "bounce, inherit", "inherit, bounce" ] + }, + "-moz-animation-play-state": { + domProp: "MozAnimationPlayState", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "animation-play-state", + subproperties: [ "animation-play-state" ], + initial_values: [ "running" ], + other_values: [ "paused", "running, running", "paused, running", "paused, paused", "running, paused", "paused, running, running, running, paused, running" ], + invalid_values: [ "0" ] + }, + "-moz-animation-timing-function": { + domProp: "MozAnimationTimingFunction", + inherited: false, + type: CSS_TYPE_SHORTHAND_AND_LONGHAND, + alias_for: "animation-timing-function", + subproperties: [ "animation-timing-function" ], + initial_values: [ "ease", "cubic-bezier(0.25, 0.1, 0.25, 1.0)" ], + other_values: [ "linear", "ease-in", "ease-out", "ease-in-out", "linear, ease-in, cubic-bezier(0.1, 0.2, 0.8, 0.9)", "cubic-bezier(0.5, 0.5, 0.5, 0.5)", "cubic-bezier(0.25, 1.5, 0.75, -0.5)", "step-start", "step-end", "steps(1)", "steps(2, start)", "steps(386)", "steps(3, end)" ], + invalid_values: [ "none", "auto", "cubic-bezier(0.25, 0.1, 0.25)", "cubic-bezier(0.25, 0.1, 0.25, 0.25, 1.0)", "cubic-bezier(-0.5, 0.5, 0.5, 0.5)", "cubic-bezier(1.5, 0.5, 0.5, 0.5)", "cubic-bezier(0.5, 0.5, -0.5, 0.5)", "cubic-bezier(0.5, 0.5, 1.5, 0.5)", "steps(2, step-end)", "steps(0)", "steps(-2)", "steps(0, step-end, 1)" ] } } diff --git a/layout/style/test/test_garbage_at_end_of_declarations.html b/layout/style/test/test_garbage_at_end_of_declarations.html index 57bf222b653..d0b940d6275 100644 --- a/layout/style/test/test_garbage_at_end_of_declarations.html +++ b/layout/style/test/test_garbage_at_end_of_declarations.html @@ -73,6 +73,9 @@ var gAllowsExtraUnusual = { "1s bounce, 2s none": true }, }; +gAllowsExtraUnusual["-moz-transition"] = gAllowsExtraUnusual["transition"]; +gAllowsExtraUnusual["-moz-animation"] = gAllowsExtraUnusual["animation"]; + function test_property(property) { var info = gCSSProperties[property]; diff --git a/layout/style/test/test_inherit_storage.html b/layout/style/test/test_inherit_storage.html index 593e0354448..5255b39859c 100644 --- a/layout/style/test/test_inherit_storage.html +++ b/layout/style/test/test_inherit_storage.html @@ -58,8 +58,13 @@ function test_property(property) // We don't care particularly about the whitespace or the placement of // semicolons, but for simplicity we'll test the current behavior. - is(gDeclaration.cssText, property + ": inherit;", - "declaration should serialize to exactly what went in (for inherit)"); + if ("alias_for" in info) { + is(gDeclaration.cssText, info.alias_for + ": inherit;", + "declaration should serialize to exactly what went in (for inherit)"); + } else { + is(gDeclaration.cssText, property + ": inherit;", + "declaration should serialize to exactly what went in (for inherit)"); + } gDeclaration.removeProperty(property); diff --git a/layout/style/test/test_initial_storage.html b/layout/style/test/test_initial_storage.html index 29635faf54b..bdb6705939f 100644 --- a/layout/style/test/test_initial_storage.html +++ b/layout/style/test/test_initial_storage.html @@ -58,8 +58,13 @@ function test_property(property) // We don't care particularly about the whitespace or the placement of // semicolons, but for simplicity we'll test the current behavior. - is(gDeclaration.cssText, property + ": -moz-initial;", - "declaration should serialize to exactly what went in (for -moz-initial)"); + if ("alias_for" in info) { + is(gDeclaration.cssText, info.alias_for + ": -moz-initial;", + "declaration should serialize to exactly what went in (for -moz-initial)"); + } else { + is(gDeclaration.cssText, property + ": -moz-initial;", + "declaration should serialize to exactly what went in (for -moz-initial)"); + } gDeclaration.removeProperty(property); diff --git a/layout/style/test/test_transitions_per_property.html b/layout/style/test/test_transitions_per_property.html index 0d4e32380bb..10fbb33f764 100644 --- a/layout/style/test/test_transitions_per_property.html +++ b/layout/style/test/test_transitions_per_property.html @@ -268,6 +268,7 @@ for (prop in gCSSProperties) { var info = gCSSProperties[prop]; if (!(prop in supported_properties) && info.type != CSS_TYPE_TRUE_SHORTHAND && + !("alias_for" in info) && !prop.match(/^transition-/) && // FIXME (Bug 119078): THIS SHOULD REALLY NOT BE NEEDED! prop != "-moz-binding") { diff --git a/layout/style/test/test_value_storage.html b/layout/style/test/test_value_storage.html index ccadc1bf631..88ee97439bf 100644 --- a/layout/style/test/test_value_storage.html +++ b/layout/style/test/test_value_storage.html @@ -129,8 +129,13 @@ function test_property(property) // We don't care particularly about the whitespace or the placement of // semicolons, but for simplicity we'll test the current behavior. var expected_serialization = ""; - if (step1val != "") - expected_serialization = property + ": " + step1val + ";"; + if (step1val != "") { + if ("alias_for" in info) { + expected_serialization = info.alias_for + ": " + step1val + ";"; + } else { + expected_serialization = property + ": " + step1val + ";"; + } + } is(step1ser, expected_serialization, "serialization should match property value");