From ba44c081794dad2a61415acb2b0efd2978fae156 Mon Sep 17 00:00:00 2001 From: "dbaron@dbaron.org" Date: Sun, 15 Apr 2007 15:29:35 -0700 Subject: [PATCH] Add tests for invalid values in the property database, and add cases fixed in bug 258080. --- layout/style/test/Makefile.in | 1 + layout/style/test/property_database.js | 14 +++-- .../test/test_property_syntax_errors.html | 51 +++++++++++++++++++ 3 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 layout/style/test/test_property_syntax_errors.html diff --git a/layout/style/test/Makefile.in b/layout/style/test/Makefile.in index f24b09f4c147..03066a66b96e 100644 --- a/layout/style/test/Makefile.in +++ b/layout/style/test/Makefile.in @@ -74,6 +74,7 @@ _TEST_FILES = test_bug302186.html \ test_inherit_storage.html \ test_initial_storage.html \ test_property_database.html \ + test_property_syntax_errors.html \ css_properties.js \ property_database.js \ $(NULL) diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js index 9298e7c6aeca..d571d718bbec 100644 --- a/layout/style/test/property_database.js +++ b/layout/style/test/property_database.js @@ -244,7 +244,10 @@ var gCSSProperties = { type: CSS_TYPE_LONGHAND, initial_values: [ "auto" ], other_values: [ "1", "0", "17" ], - invalid_values: [ "-1", "3px" ] + invalid_values: [ + // "-1", unclear: see http://lists.w3.org/Archives/Public/www-style/2007Apr/0030 + "3px" + ] }, "-moz-column-gap": { domProp: "MozColumnGap", @@ -430,9 +433,14 @@ var gCSSProperties = { backend_only: false, type: CSS_TYPE_TRUE_SHORTHAND, subproperties: [ "background-attachment", "background-color", "background-image", "background-position", "background-repeat", "-moz-background-clip", "-moz-background-inline-policy", "-moz-background-origin" ], - initial_values: [ "transparent", "none", "repeat", "scroll", "0% 0%", "top left", "left top", "transparent none", "top left none", "none 0% 0%", "transparent none repeat scroll top left", "left top repeat none scroll transparent"], + initial_values: [ "transparent", "none", "repeat", "scroll", "0% 0%", "top left", "left top", "transparent none", "top left none", "left top none", "none left top", "none top left", "none 0% 0%", "transparent none repeat scroll top left", "left top repeat none scroll transparent"], other_values: [ "green", "none green repeat scroll left top", "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==)", "repeat url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAKElEQVR42u3NQQ0AAAgEoNP+nTWFDzcoQE1udQQCgUAgEAgEAsGTYAGjxAE/G/Q2tQAAAABJRU5ErkJggg==') transparent left top scroll", "repeat-x", "repeat-y", "no-repeat", "none repeat-y transparent scroll 0% 0%", "fixed", "0% top transparent fixed repeat none", "top", "left", "50% 50%", "center", "bottom right scroll none transparent repeat", "50% transparent", "transparent 50%", "50%" ], - invalid_values: [ "50% left", "top 50%" ] + invalid_values: [ + /* mixes with keywords have to be in correct order */ + "50% left", "top 50%", + /* bug 258080: don't accept background-position separated */ + "left url(404.png) top", "top url(404.png) left" + ] }, "background-attachment": { domProp: "backgroundAttachment", diff --git a/layout/style/test/test_property_syntax_errors.html b/layout/style/test/test_property_syntax_errors.html new file mode 100644 index 000000000000..d31d04b7b60b --- /dev/null +++ b/layout/style/test/test_property_syntax_errors.html @@ -0,0 +1,51 @@ + + + + + Test that we reject syntax errors listed in property_database.js + + + + + + +

+ +
+
+
+ +