Bug 127559

Summary: Run UserAgentScripts through jsmin rather than the css preprocessor
Product: WebKit Reporter: Jer Noble <jer.noble>
Component: New BugsAssignee: Jer Noble <jer.noble>
Status: RESOLVED FIXED    
Severity: Normal CC: calvaris, eric.carlson, thorton
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch thorton: review+

Description Jer Noble 2014-01-24 08:35:11 PST
Run UserAgentScripts through jsmin rather than the css preprocessor
Comment 1 Jer Noble 2014-01-24 08:52:19 PST
Created attachment 222109 [details]
Patch
Comment 2 Jer Noble 2014-01-24 14:35:10 PST
Created attachment 222156 [details]
Patch

Apparently the Windows EWS bots don't have python2.7.
Comment 3 Eric Carlson 2014-01-24 14:43:25 PST
Comment on attachment 222156 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=222156&action=review

> Source/WebCore/Scripts/make-js-file-arrays.py:2
> +# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.

Cool, you went back in time?
Comment 4 Jer Noble 2014-01-30 14:12:32 PST
Created attachment 222733 [details]
Patch

Now, in the future!
Comment 5 Tim Horton 2014-02-05 11:11:54 PST
Comment on attachment 222733 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=222733&action=review

> Source/WebCore/Scripts/make-js-file-arrays.py:31
> +def stringifyCodepoint(code):

I think this can be replaced by code.encode('unicode-escape')?
Comment 6 Tim Horton 2014-02-05 11:16:52 PST
Comment on attachment 222733 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=222733&action=review

> Source/WebCore/Scripts/make-js-file-arrays.py:60
> +    print >> sourceFile, '#include "%s"' % os.path.basename(headerPath)

Fairly sure % is deprecated and you should be using .format and the new syntax.

> Source/WebCore/Scripts/make-js-file-arrays.py:73
> +            characters = inputStream.read(-1)

-1 is the default here, and weird to use explicitly
Comment 7 Jer Noble 2014-02-11 13:12:43 PST
(In reply to comment #6)
> (From update of attachment 222733 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=222733&action=review
> 
> > Source/WebCore/Scripts/make-js-file-arrays.py:60
> > +    print >> sourceFile, '#include "%s"' % os.path.basename(headerPath)
> 
> Fairly sure % is deprecated and you should be using .format and the new syntax.

Only in Python 3.1. I don't think we've updated our script to all the 3.0 conventions yet.

> > Source/WebCore/Scripts/make-js-file-arrays.py:73
> > +            characters = inputStream.read(-1)
> 
> -1 is the default here, and weird to use explicitly

I'll remove it.
Comment 8 Jer Noble 2014-02-11 13:31:06 PST
Committed r163906: <http://trac.webkit.org/changeset/163906>
Comment 9 Tim Horton 2014-02-11 13:35:03 PST
(In reply to comment #7)
> (In reply to comment #6)
> > (From update of attachment 222733 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=222733&action=review
> > 
> > > Source/WebCore/Scripts/make-js-file-arrays.py:60
> > > +    print >> sourceFile, '#include "%s"' % os.path.basename(headerPath)
> > 
> > Fairly sure % is deprecated and you should be using .format and the new syntax.
> 
> Only in Python 3.1. I don't think we've updated our script to all the 3.0 conventions yet.

Deprecated in 3+, sure, but string.format() is available in 2.x, so using it now just means less headache during the eventual transition :) I don't actually care either way.

> > > Source/WebCore/Scripts/make-js-file-arrays.py:73
> > > +            characters = inputStream.read(-1)
> > 
> > -1 is the default here, and weird to use explicitly
> 
> I'll remove it.
Comment 10 Jer Noble 2014-02-11 13:40:30 PST
(In reply to comment #9)
> (In reply to comment #7)
> > (In reply to comment #6)
> > > (From update of attachment 222733 [details] [details] [details])
> > > View in context: https://bugs.webkit.org/attachment.cgi?id=222733&action=review
> > > 
> > > > Source/WebCore/Scripts/make-js-file-arrays.py:60
> > > > +    print >> sourceFile, '#include "%s"' % os.path.basename(headerPath)
> > > 
> > > Fairly sure % is deprecated and you should be using .format and the new syntax.
> > 
> > Only in Python 3.1. I don't think we've updated our script to all the 3.0 conventions yet.
> 
> Deprecated in 3+, sure, but string.format() is available in 2.x, so using it now just means less headache during the eventual transition :) I don't actually care either way.

Yep.  I committed with .format(). :)