Bug 1547162 Part 2 - Remove all the column properties from gPrefixedProperties in import-tests.py. r=dbaron
authorTing-Yu Lin <tlin@mozilla.com>
Thu, 09 May 2019 23:32:00 +0000
changeset 532160 108d96d047cd3ee2ec1750a802276c14141804c6
parent 532159 82c216e530eaaa56d5b59f95542f6835465241ff
child 532161 9c5a51b331c230990ffe63f9f73b57d46c2ac20e
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1547162
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1547162 Part 2 - Remove all the column properties from gPrefixedProperties in import-tests.py. r=dbaron Also, build gPrefixRegexp and replace lines only if gPrefixedProperties is non-empty. Otherwise, the import tests are messed up due to bogus gPrefixRegexp. Differential Revision: https://phabricator.services.mozilla.com/D30405
layout/reftests/w3c-css/import-tests.py
--- a/layout/reftests/w3c-css/import-tests.py
+++ b/layout/reftests/w3c-css/import-tests.py
@@ -33,31 +33,26 @@ gSubtrees = [
     os.path.join("css-namespaces"),
     os.path.join("css-conditional"),
     os.path.join("css-values"),
     os.path.join("css-multicol"),
     os.path.join("css-writing-modes"),
     os.path.join("selectors"),
 ]
 
+# Insert the properties which you want to add "-moz" prefix to
+# gPrefixedProperties.
+#
+# For example, if "columns" is in this list, all the lines in import files
+# containing "columns" are replaced with "-moz-columns."
 gPrefixedProperties = [
-    "column-count",
-    "column-fill",
-    "column-gap",
-    "column-rule",
-    "column-rule-color",
-    "column-rule-style",
-    "column-rule-width",
-    "columns",
-    "column-span",
-    "column-width"
 ]
 
-gPrefixRegexp = re.compile(
-    r"([^-#]|^)(" + r"|".join(gPrefixedProperties) + r")\b")
+gPrefixRegexp = (re.compile(r"([^-#]|^)(" + r"|".join(gPrefixedProperties) + r")\b")
+                 if gPrefixedProperties else None)
 
 # Map of about:config prefs that need toggling, for a given test subdirectory.
 # Entries should look like:
 #  "$SUBDIR_NAME": "pref($PREF_NAME, $PREF_VALUE)"
 #
 # For example, when "@supports" was behind a pref, gDefaultPreferences had:
 #  "css3-conditional": "pref(layout.css.supports-rule.enabled,true)"
 gDefaultPreferences = {
@@ -266,17 +261,18 @@ def copy_and_prefix(test, aSourceFileNam
         if not isSupportFile and not ahemFontAdded and 'ahem' in gTestFlags[test] and re.search(searchRegex, line):
             # First put our ahem font declation before the first <style>
             # element
             template = AHEM_DECL_HTML if is_html(aDestFileName) else AHEM_DECL_XML
             ahemPath = os.path.relpath(AHEM_FONT_PATH, os.path.dirname(aDestFileName))
             newFile.write(template.format(to_unix_path_sep(ahemPath)))
             ahemFontAdded = True
 
-        replacementLine = gPrefixRegexp.sub(r"\1-moz-\2", replacementLine)
+        if gPrefixRegexp:
+            replacementLine = gPrefixRegexp.sub(r"\1-moz-\2", replacementLine)
         newFile.write(replacementLine)
 
     newFile.close()
     unPrefixedFile.close()
 
 def read_options():
     global gArgs, gOptions
     op = OptionParser()