diff --git a/dom/bindings/GenerateCSS2PropertiesWebIDL.py b/dom/bindings/GenerateCSS2PropertiesWebIDL.py index fe6f4d375d99..53c9add0ee1e 100644 --- a/dom/bindings/GenerateCSS2PropertiesWebIDL.py +++ b/dom/bindings/GenerateCSS2PropertiesWebIDL.py @@ -26,6 +26,28 @@ for [name, prop, id, flags, pref] in propList: # (e.g. on nsComputedDOMStyle). props += " [%s] attribute DOMString %s;\n" % (", ".join(extendedAttrs), prop) + # Per spec, what's actually supposed to happen here is that we're supposed + # to have properties for: + # + # 1) Each supported CSS property name, camelCased. + # 2) Each supported name that contains dashes but doesn't start with a + # dash, without any changes to the name. + # 3) cssFloat + # + # Note that "float" will cause a property called "float" to exist due to (1) + # in that list. + # + # In practice, cssFloat is the only case in which "name" doesn't contain "-" + # but also doesn't match "prop". So the stuff we did with "prop" covers (3) + # and all of (1) except "float". If we now output attributes for all the + # cases where "name" doesn't match "prop" and "name" doesn't start with "-", + # that will cover "float" and (2). + if prop != name and name[0] != "-": + extendedAttrs.append('BinaryName="%s"' % prop) + # Throw in a '_' before the attribute name, because some of these + # property names collide with IDL reserved words. + props += " [%s] attribute DOMString _%s;\n" % (", ".join(extendedAttrs), + name) idlFile = open(sys.argv[1], "r"); idlTemplate = idlFile.read(); diff --git a/layout/style/test/mochitest.ini b/layout/style/test/mochitest.ini index 6a630b498f2b..1db9bc77212f 100644 --- a/layout/style/test/mochitest.ini +++ b/layout/style/test/mochitest.ini @@ -121,6 +121,7 @@ skip-if = toolkit == 'android' #bug 536603 [test_descriptor_storage.html] [test_descriptor_syntax_errors.html] [test_dont_use_document_colors.html] +[test_exposed_prop_accessors.html] [test_extra_inherit_initial.html] [test_flexbox_align_self_auto.html] [test_flexbox_child_display_values.xhtml] diff --git a/layout/style/test/test_exposed_prop_accessors.html b/layout/style/test/test_exposed_prop_accessors.html new file mode 100644 index 000000000000..8edd2ccfeea2 --- /dev/null +++ b/layout/style/test/test_exposed_prop_accessors.html @@ -0,0 +1,43 @@ + + + + + Test for cloning of CSS property values (including 'inherit', 'initial' and 'unset') + + + + + +

+
+
+
+ +