Title: [206192] trunk/Source/_javascript_Core
Revision
206192
Author
joep...@webkit.org
Date
2016-09-20 18:03:22 -0700 (Tue, 20 Sep 2016)

Log Message

REGRESSION(r205692): Minified builds have broken inspector
https://bugs.webkit.org/show_bug.cgi?id=162327
<rdar://problem/28370137>

Reviewed by Matt Baker.

* Scripts/cssmin.py:
(cssminify):
Converge on the newer cssmin that we mistakenly dropped in r205692.
This knows how to handle more cases.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (206191 => 206192)


--- trunk/Source/_javascript_Core/ChangeLog	2016-09-21 00:34:12 UTC (rev 206191)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-09-21 01:03:22 UTC (rev 206192)
@@ -1,3 +1,16 @@
+2016-09-20  Joseph Pecoraro  <pecor...@apple.com>
+
+        REGRESSION(r205692): Minified builds have broken inspector
+        https://bugs.webkit.org/show_bug.cgi?id=162327
+        <rdar://problem/28370137>
+
+        Reviewed by Matt Baker.
+
+        * Scripts/cssmin.py:
+        (cssminify):
+        Converge on the newer cssmin that we mistakenly dropped in r205692.
+        This knows how to handle more cases.
+
 2016-09-20  Filip Pizlo  <fpi...@apple.com>
 
         DFG::StoreBarrierInsertionPhase should assume that any epoch increment may make objects older

Modified: trunk/Source/_javascript_Core/Scripts/cssmin.py (206191 => 206192)


--- trunk/Source/_javascript_Core/Scripts/cssmin.py	2016-09-21 00:34:12 UTC (rev 206191)
+++ trunk/Source/_javascript_Core/Scripts/cssmin.py	2016-09-21 01:03:22 UTC (rev 206192)
@@ -30,7 +30,9 @@
         (r"\/\*.*?\*\/", ""),          # delete comments
         (r"\n", ""),                   # delete new lines
         (r"\s+", " "),                 # change multiple spaces to one space
-        (r"\s?([;:{},+>])\s?", r"\1"), # delete space where it is not needed
+        (r"\s?([;{},~>!])\s?", r"\1"), # delete space where it is not needed
+        (r":\s", ":"),                 # delete spaces after colons, but not before. E.g. do not break selectors "a :focus", "b :matches(...)", "c :not(...)" where the leading space is significant
+        (r"\s?([-+])(?:\s(?![0-9(])(?!var))", r"\1"), # delete whitespace around + and - when not followed by a number, paren, or var(). E.g. strip for selector "a + b" but not "calc(a + b)" which requires spaces.
         (r";}", "}")                   # change ';}' to '}' because the semicolon is not needed
     )
 
@@ -41,4 +43,7 @@
 
 if __name__ == "__main__":
     import sys
+    if sys.version_info[0] == 3 and sys.stdin.encoding != 'UTF-8':
+        import io
+        sys.stdin = io.TextIOWrapper(sys.stdin.buffer, encoding='UTF-8')
     sys.stdout.write(cssminify(sys.stdin.read()))
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to