Bug 37296 - [Qt] User agent style sheets are crippled by moc -E in make-css-file-arrays.pl
Summary: [Qt] User agent style sheets are crippled by moc -E in make-css-file-arrays.pl
Status: CLOSED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Andras Becsi
URL:
Keywords: Qt
Depends on:
Blocks: 35784
  Show dependency treegraph
 
Reported: 2010-04-08 16:15 PDT by Andras Becsi
Modified: 2010-04-09 01:13 PDT (History)
3 users (show)

See Also:


Attachments
Proposed fix v1 (8.37 KB, patch)
2010-04-08 16:24 PDT, Andras Becsi
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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