Bug 37296

Summary: [Qt] User agent style sheets are crippled by moc -E in make-css-file-arrays.pl
Product: WebKit Reporter: Andras Becsi <abecsi>
Component: CSSAssignee: Andras Becsi <abecsi>
Status: CLOSED FIXED    
Severity: Normal CC: hausmann, hyatt, ossy
Priority: P2 Keywords: Qt
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Bug Depends on:    
Bug Blocks: 35784    
Attachments:
Description Flags
Proposed fix v1 none

Description Andras Becsi 2010-04-08 16:15:11 PDT
The Qt port uses WebCore/css/make-css-file-arrays.pl with the --preprocessor moc -E option to remove unneeded comments and whitespaces from default user agent style sheets found in WebCore/css/, but unforunatelly moc also removes the @ before at-keywords (for example the namespace keyword) and all hexadecimal colors beginning with # (moc assumes it is a preprocessor directive), so the generated arrays in UserAgentStyleSheetsData.cpp include invalid rules which are ignored by the parser.
Therefore the parser does not set the namespace and does not set colours specified by the default stylesheets.
Since no other port uses the --preprocessor option, and the script removes unneeded comments and whitespaces from the css files using regexps anyhow, this option and the usage of any preprocessor on css files can safely be removed from the script.
Because of the resulting change in the arrays three platform dependent test results have to be updated:

editing/execCommand/insert-list-xml.xhtml
svg/custom/createImageElement2.xhtml
svg/custom/use-on-symbol-inside-pattern.svg

These test results are more Mac alike now.
Comment 1 Andras Becsi 2010-04-08 16:24:56 PDT
Created attachment 52914 [details]
Proposed fix v1
Comment 2 Simon Hausmann 2010-04-09 00:28:49 PDT
Comment on attachment 52914 [details]
Proposed fix v1

I agree that it's a moc bug, but I like your solution of removing the unnecessary use of the preprocessor for the stylesheets altogether.
Comment 3 Andras Becsi 2010-04-09 01:09:09 PDT
(In reply to comment #2)
> (From update of attachment 52914 [details])
> I agree that it's a moc bug, but I like your solution of removing the
> unnecessary use of the preprocessor for the stylesheets altogether.

Thanks Simon.
Patch landed in r57316.
Closing bug.
Comment 4 Simon Hausmann 2010-04-09 01:13:12 PDT
Revision r57316 cherry-picked into qtwebkit-2.0 with commit f641072ff389b247427f9f5d6d9baf770fa9055f