Bug 1246796. Allow getting/setting dashed attributes that start with "-", for web compatibility. r=bz
authorMike Taylor <miket@mozilla.com>
Thu, 21 Jul 2016 11:22:36 -0500
changeset 331849 f2a6a2af5243b5923a14f78ff9d13679bd844957
parent 331848 90582bb8f7ed19b4e9ea9effa4f1f0825228f715
child 331850 7df92788ffeba18fdebe3517c858381383981143
push id9858
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 14:37:10 +0000
treeherdermozilla-aurora@203106ef6cb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1246796
milestone50.0a1
Bug 1246796. Allow getting/setting dashed attributes that start with "-", for web compatibility. r=bz
dom/bindings/GenerateCSS2PropertiesWebIDL.py
--- a/dom/bindings/GenerateCSS2PropertiesWebIDL.py
+++ b/dom/bindings/GenerateCSS2PropertiesWebIDL.py
@@ -42,29 +42,29 @@ def generate(output, idlFilename, prepro
         if not prop.startswith("Moz"):
             prop = prop[0].lower() + prop[1:]
         props += generateLine(prop, extendedAttrs)
 
         # 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.
+        # 2) Each supported name that contains or starts with dashes,
+        #    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 above generatePropLine() call
         # covered (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] != "-":
+        # for all the cases where "name" doesn't match "prop", that will cover
+        # "float" and (2).
+        if prop != name:
             extendedAttrs.append('BinaryName="%s"' % prop)
             # Throw in a '_' before the attribute name, because some of these
             # property names collide with IDL reserved words.
             props += generateLine("_" + name, extendedAttrs)
 
 
     idlFile = open(idlFilename, "r")
     idlTemplate = idlFile.read()