Related to .IN files for CSS
Hello everyone, While going through the Webkit source, I have come across few .IN files that are used to generate files through the Perl script just like IDL files are used to generate bindings for JavaScript. These .IN files are mainly related to CSS. I am not sure what these files are for and why is it necessary to generate corresponding files from them? Thanks. - J R Shah
On 2008-08-10, at 18:25, Javed Rabbani wrote:
Hello everyone,
While going through the Webkit source, I have come across few .IN files that are used to generate files through the Perl script just like IDL files are used to generate bindings for JavaScript. These .IN files are mainly related to CSS. I am not sure what these files are for and why is it necessary to generate corresponding files from them? Thanks.
From memory, the .in files are broken down into two categories: 1) Those in the css directory are passed to gperf by way of css/ makeprop.pl to generate hash tables for mapping character strings representing CSS properties and values into an identifier, and vice versa. 2) The remainder are passed to dom/make_names.pl in order to generate constants representing tag names and attributes for HTML, SVG, etc. The reason these files are generated is similar to why we use IDLs to simplify the generation of bindings-related code: it makes working with the code simpler. If you take a look at the generated source files, you'll notice that there is a lot of duplication and complicated algorithms in the generated code. Maintaining it by hand would be a lot more painful than having a script maintain it for us. (CSSValueKeywords.c is a good example of the generated code for case 1, HTMLNames.cpp a good example of case 2. These typically get generated into your build directory. For instance, on the Mac they are created inside WebKitBuild/Debug/DerivedSources/WebCore/.) - Mark
participants (2)
-
Javed Rabbani
-
Mark Rowe