diff --git a/layout/style/test/Makefile.in b/layout/style/test/Makefile.in index 3ac74cdf610..a7e26ab0d93 100644 --- a/layout/style/test/Makefile.in +++ b/layout/style/test/Makefile.in @@ -72,12 +72,17 @@ _TEST_FILES = test_bug302186.html \ test_bug372770.html \ test_bug373293.html \ test_inherit_storage.html \ + test_inherit_computation.html \ test_initial_storage.html \ + test_initial_computation.html \ test_property_database.html \ test_property_syntax_errors.html \ test_value_storage.html \ + test_value_computation.html \ css_properties.js \ property_database.js \ + unstyled.xml \ + unstyled.css \ $(NULL) diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js index 76d985462b2..5e29b1bb2eb 100644 --- a/layout/style/test/property_database.js +++ b/layout/style/test/property_database.js @@ -240,7 +240,7 @@ var gCSSProperties = { inherited: false, type: CSS_TYPE_LONGHAND, initial_values: [ "auto" ], - other_values: [ "50%", "15px" ], + other_values: [ "15px", "50%" ], invalid_values: [ "20" ] }, "-moz-float-edge": { @@ -261,7 +261,7 @@ var gCSSProperties = { }, "-moz-image-region": { domProp: "MozImageRegion", - inherited: false, + inherited: true, type: CSS_TYPE_LONGHAND, initial_values: [ "auto" ], other_values: [ "rect(3px 20px 15px 4px)", "rect(17px, 21px, 33px, 2px)" ], @@ -480,7 +480,7 @@ var gCSSProperties = { domProp: "borderBottomWidth", inherited: false, type: CSS_TYPE_LONGHAND, - /* XXX a value differing from initial requires border-style to be set */ + prerequisites: { "border-bottom-style": "solid" }, initial_values: [ "medium", "3px" ], other_values: [ "thin", "thick", "1px", "2em" ], invalid_values: [ "5%" ] @@ -532,7 +532,7 @@ var gCSSProperties = { domProp: "borderLeftWidth", inherited: false, type: CSS_TYPE_LONGHAND, - /* XXX a value differing from initial requires border-style to be set */ + prerequisites: { "border-left-style": "solid" }, initial_values: [ "medium", "3px" ], other_values: [ "thin", "thick", "1px", "2em" ], invalid_values: [ "5%" ] @@ -567,7 +567,7 @@ var gCSSProperties = { domProp: "borderRightWidth", inherited: false, type: CSS_TYPE_LONGHAND, - /* XXX a value differing from initial requires border-style to be set */ + prerequisites: { "border-right-style": "solid" }, initial_values: [ "medium", "3px" ], other_values: [ "thin", "thick", "1px", "2em" ], invalid_values: [ "5%" ] @@ -620,7 +620,7 @@ var gCSSProperties = { domProp: "borderTopWidth", inherited: false, type: CSS_TYPE_LONGHAND, - /* XXX a value differing from initial requires border-style to be set */ + prerequisites: { "border-top-style": "solid" }, initial_values: [ "medium", "3px" ], other_values: [ "thin", "thick", "1px", "2em" ], invalid_values: [ "5%" ] @@ -630,7 +630,7 @@ var gCSSProperties = { inherited: false, type: CSS_TYPE_TRUE_SHORTHAND, subproperties: [ "border-top-width", "border-right-width", "border-bottom-width", "border-left-width" ], - /* XXX a value differing from initial requires border-style to be set */ + prerequisites: { "border-style": "solid" }, initial_values: [ "medium", "3px", "medium medium", "3px medium medium", "medium 3px medium medium" ], other_values: [ "thin", "thick", "1px", "2em", "2px 0 0px 1em" ], invalid_values: [ "5%" ] @@ -666,14 +666,15 @@ var gCSSProperties = { inherited: false, type: CSS_TYPE_LONGHAND, initial_values: [ "auto" ], - other_values: [ "rect(auto,auto,auto,auto)", "rect(3px, 4px, 4em, 0)", "rect(auto, 3em, 4pt, 2px)", "rect(2px 3px 4px 5px)" ], + 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)" ] }, "color": { domProp: "color", inherited: true, type: CSS_TYPE_LONGHAND, - initial_values: [ "currentcolor" ], + /* 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" ], invalid_values: [ "fff", "ffffff", "#f", "#ff", "#ffff", "#fffff", "#fffffff", "#ffffffff", "#fffffffff" ] }, @@ -887,8 +888,8 @@ var gCSSProperties = { inherited: true, type: CSS_TYPE_TRUE_SHORTHAND, subproperties: [ "list-style-type", "list-style-position", "list-style-image" ], - initial_values: [ "none", "outside", "disc", "none disc outside" ], - other_values: [ "inside none", "none inside", "none none inside", "none outside none", "square", 'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==")' ], + initial_values: [ "outside", "disc", "none disc outside" ], + other_values: [ "inside none", "none inside", "none none inside", "none outside none", "square", 'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==")', "none" ], invalid_values: [] }, "list-style-image": { @@ -1077,7 +1078,7 @@ var gCSSProperties = { domProp: "outlineWidth", inherited: false, type: CSS_TYPE_LONGHAND, - /* XXX a value differing from initial requires border-style to be set */ + prerequisites: { "outline-style": "solid" }, initial_values: [ "medium", "3px" ], other_values: [ "thin", "thick", "1px", "2em" ], invalid_values: [ "5%" ] diff --git a/layout/style/test/test_inherit_computation.html b/layout/style/test/test_inherit_computation.html new file mode 100644 index 00000000000..487817b8dc1 --- /dev/null +++ b/layout/style/test/test_inherit_computation.html @@ -0,0 +1,198 @@ + + + + + Test for computation of CSS 'inherit' + + + + + + + +

+ +
+
+
+ + diff --git a/layout/style/test/test_initial_computation.html b/layout/style/test/test_initial_computation.html new file mode 100644 index 00000000000..43a60d64c4d --- /dev/null +++ b/layout/style/test/test_initial_computation.html @@ -0,0 +1,270 @@ + + + + + Test for computation of CSS '-moz-initial' + + + + + + + + +

+ +

+ +
+
+
+ + diff --git a/layout/style/test/test_value_computation.html b/layout/style/test/test_value_computation.html new file mode 100644 index 00000000000..d11f5a5e313 --- /dev/null +++ b/layout/style/test/test_value_computation.html @@ -0,0 +1,292 @@ + + + + + Test for computation of values in property database + + + + + + + + +

+ +

+ +
+
+
+ + diff --git a/layout/style/test/unstyled.css b/layout/style/test/unstyled.css new file mode 100644 index 00000000000..82767f9b2f6 --- /dev/null +++ b/layout/style/test/unstyled.css @@ -0,0 +1,2 @@ +/* we're testing computed style on elements without frames */ +root { display: none } diff --git a/layout/style/test/unstyled.xml b/layout/style/test/unstyled.xml new file mode 100644 index 00000000000..86b7c54acd4 --- /dev/null +++ b/layout/style/test/unstyled.xml @@ -0,0 +1,3 @@ + + +