WebKit compilation rules under Win32 (8)

Source: Internet
Author: User
Tags perl script

Htmlelementfactory. cpp and htmlnames. cpp are generated by the following rules:

Ifdef html_flags

Htmlelementfactory. cpp htmlnames. cpp: DOM/make_names.pl html/htmltagnames. in HTML/htmlattributenames. In
Perl-I $ (WebCore)/bindings/scripts $ <-- tags $ (WebCore)/html/htmltagnames. in -- attrs $ (WebCore)/html/htmlattributenames. in -- factory -- wrapperfactory -- extradefines "$ (html_flags )"


Htmlelementfactory. cpp htmlnames. cpp: DOM/make_names.pl html/htmltagnames. in HTML/htmlattributenames. In
Perl-I $ (WebCore)/bindings/scripts $ <-- tags $ (WebCore)/html/htmltagnames. in -- attrs $ (WebCore)/html/htmlattributenames. in -- factory -- wrapperfactory


We can see that htmlelementfactory. cpp and htmlnames. cpp are generated by make_names.pl processing htmltagnames. In And htmlattributenames. In. Htmltagnames. in (d:/tools/cygwin/home/xufan/WebKit/source/WebCore/html/htmltagnames. in) defines all the HTML tag names, including the names of the WebKit processing class corresponding to the HTML Tag. For example, a interfacename = htmlanchorelement indicates that the tag is processed by the htmlanchorelement class. Htmlattributenames. in (d:/tools/cygwin/home/xufan/WebKit/source/WebCore/html/htmlattributenames. in) defines all HTML attribute names, such as href, style, and onclick.

Htmlentitytable. cpp is generated by the following rules:

Htmlentitytable. cpp: HTML/parser/htmlentitynames. In $ (WebCore)/html/parser/create-HTML-entity-table
Python $ (WebCore)/html/parser/create-HTML-entity-table-O htmlentitytable. cpp $ (WebCore)/html/parser/htmlentitynames. In

We can see that htmlentitytable. CPP uses create-HTML-entity-table (D:/tools/cygwin/home/xufan/WebKit/source/WebCore/html/parser/create-HTML-entity-table) this Python script processes htmlentitynames. in (d:/tools/cygwin/home/xufan/WebKit/source/WebCore/html/parser/htmlentitynames. in. What is HTML Entity? The Chinese Translation of HTML Entity is generally an HTML character entity. It refers to characters with special meanings in HTML. The display of these characters is represented by HTML Entity. A character object consists of three parts: an ampersand (&), an object name, or #, and an object number, as well as a semicolon (;). For example, <(less than a sign) must be written in HTML.<Or<. In htmlentitynames. In, "lt;", "U + 0003c" (the decimal value of 3C is 60 ). The last semicolon can be removed for symbols smaller than signs and "&", that is<And &It is also possible, because htmlentitynames. In defines two such symbols, one with a semicolon and the other without a semicolon. Htmlentitynames. In contains some infrequently used HTML entries, such as. (displayed ·). For more details about html entry, refer. HTML entry can do something interesting, such as a world map in a http://www.beijing-time.org/wannianli.htm (open with IE), or you create a web page, enter the following content <font style = "font-size: 120pt; color: green; font-family: webdings "> & ucirc; </font>: open a browser to view a map of the world.

Wmlelementfactory. cpp and wmlnames. cpp are generated by the following rules:

Ifeq ($ (findstring enable_wml, $ (feature_defines), enable_wml)

Wmlelementfactory. cpp wmlnames. cpp: DOM/make_names.pl WML/wmltagnames. In WML/wmlattributenames. In
Perl-I $ (WebCore)/bindings/scripts $ <-- tags $ (WebCore)/WML/wmltagnames. in -- attrs $ (WebCore)/WML/wmlattributenames. in -- factory -- wrapperfactory


Wmlelementfactory. cpp:
Echo >$ @

Wmlnames. cpp:
Echo >$ @


As shown above, wmlelementfactory. cpp and wmlnames. cpp only contain enable_wml in the compilation options. Otherwise, they are empty files. Enable_wml is disabled by default on the Win32 platform because WML Web pages are not accessed on the PC. If you need to compile the WebKit browser on your mobile phone, remember to open this compilation option. Otherwise, the compiled browser cannot browse the Web page on the WAP website. Wmltagnames. in (d:/tools/cygwin/home/xufan/WebKit/source/WebCore/WML/wmltagnames. in) and wmlattributenames. in (d:/tools/cygwin/home/xufan/WebKit/source/WebCore/WML/wmlattributenames. in) Rules and htmltagnames. in And htmlattributenames. in is basically the same, but the tag and attribute are much less.

Svgelementfactory. cpp and svgnames. cpp are generated by the following rules:

Ifdef svg_flags

Svgelementfactory. cpp svgnames. cpp: DOM/make_names.pl SVG/svgtags. in SVG/svgattrs. In
Perl-I $ (WebCore)/bindings/scripts $ <-- tags $ (WebCore)/SVG/svgtags. in -- attrs $ (WebCore)/SVG/svgattrs. in -- extradefines "$ (svg_flags)" -- factory -- wrapperfactory

Svgelementfactory. cpp svgnames. cpp: DOM/make_names.pl SVG/svgtags. in SVG/svgattrs. In
Perl-I $ (WebCore)/bindings/scripts $ <-- tags $ (WebCore)/SVG/svgtags. in -- attrs $ (WebCore)/SVG/svgattrs. in -- factory -- wrapperfactory


Svgelementfactory. CPP and svgnames. CPP is generated only when svg_flags is defined. CPP and wmlnames. the processing of CPP is similar to that of make_names.pl (D:/tools/cygwin/home/xufan/WebKit/source/WebCore/DOM/make_names.pl.

Useragentstylesheets. H is generated by the following rules:

User_agent_style_sheets = $ (WebCore)/CSS/html.css $ (WebCore)/CSS/quirks.css $ (WebCore)/CSS/view-source.css $ (WebCore)/CSS/themewin.css $ (WebCore) /CSS/themewinquirks.css


Useragentstylesheets. h: CSS/make-css-file-arrays.pl $ (user_agent_style_sheets)
Perl $ <$ @ useragentstylesheetsdata. cpp $ (user_agent_style_sheets)

From the above we can see that useragentstylesheets. H is produced by make-css-file-arrays.pl (D:/tools/cygwin/home/xufan/WebKit/source/WebCore/CSS/make-css-file-arrays.pl handler to process html.css, quirks.css, view-source.css and other files. Html.css (D:/tools/cygwin/home/xufan/WebKit/source/WebCore/CSS/html.css) and other files define the default CSS attributes of some tags of WebKit, for example, the following body, P, and H1:

Body {
Display: block;
Margin: 8px

P {
Display: block;
-WebKit-margin-before: 1 _ qem;
-WebKit-margin-after: 1 _ qem;
-WebKit-margin-start: 0;
-WebKit-margin-end: 0;


H1 {
Display: block;
Font-size: 2em;
-WebKit-margin-before: 0.67 _ qem;
-WebKit-margin-after: 0.67em;
-WebKit-margin-start: 0;
-WebKit-margin-end: 0;
Font-weight: bold

I think you have read the CSS above and should have some knowledge about some default display in the browser. For the default values of body margin in various browsers, refer to: custom /.

Xlinknames. cpp is generated by the following rules:

Xlinknames. cpp: DOM/make_names.pl SVG/xlinkattrs. In
Perl-I $ (WebCore)/bindings/scripts $ <-- attrs $ (WebCore)/SVG/xlinkattrs. In

Xlinkattrs. In defines the properties supported by xlink. Xlink is short for XML linking language. It is used to create a hyperlink language in the XML document. For more information, see http://www.w3.org/tr/xlink/and http://www.w3school.com.cn/xlink/index.asp. Xlink in WebKit is mainly used for SVG.

Xmlnsnames. cpp is generated by the following rules:

Xmlnsnames. cpp: DOM/make_names.pl XML/xmlnsattrs. In
Perl-I $ (WebCore)/bindings/scripts $ <-- attrs $ (WebCore)/XML/xmlnsattrs. In

Xmlnsattrs. In defines the name of the XML namsapce attribute: xmlns.

Xmlnames. cpp is generated by the following rules:

Xmlnames. cpp: DOM/make_names.pl XML/xmlattrs. In
Perl-I $ (WebCore)/bindings/scripts $ <-- attrs $ (WebCore)/XML/xmlattrs. In

Xmlattrs. In defines the attributes of XML: Base, Lang, space.

Mathmlelementfactory. cpp and mathmlnames. cpp are generated by the following rules:

Mathmlelementfactory. cpp mathmlnames. cpp: DOM/make_names.pl MathML/mathtags. In MathML/mathattrs. In
Perl-I $ (WebCore)/bindings/scripts $ <-- tags $ (WebCore)/MathML/mathtags. in -- attrs $ (WebCore)/MathML/mathattrs. in -- factory-wrapperfactory

Mathtags. In And mathattrs. In define the label name and attribute used for MathML. Mathematical Markup Language (MathML) is an XML-based standard used to write mathematical symbols and formulas on the Internet. For more information about MathML, see idea.

Xpathgrammar. cpp is generated by the following rules:

Xpathgrammar. cpp: XML/xpathgrammar. Y $ (project_file)
Bison-D-P xpathyy $ <-o $ @
Touch xpathgrammar. cpp. h
Touch xpathgrammar. HPP
Echo '# ifndef xpathgrammar_h'> xpathgrammar. h
Echo '# define xpathgrammar_h'> xpathgrammar. h
Cat xpathgrammar. cpp. h xpathgrammar. HPP> xpathgrammar. h
Echo '# endif'> xpathgrammar. h
Rm-F xpathgrammar. cpp. h xpathgrammar. HPP

As shown in the preceding figure, xpathgrammar. cpp is generated by processing xpathgrammar. Y through bison. It can also be seen from this that WebKit uses tools such as bison to automatically generate code for processing rules, rather than writing from the beginning (XPath can be understood as a DSL ). If you don't know what XPath is, You can Google it yourself.

Tokenizer. cpp is generated by the following rules:

Tokenizer. cpp: CSS/tokenizer. Flex CSS/maketokenizer
Flex-T $ <| Perl $ (WebCore)/CSS/maketokenizer> @

Tokenizer. CPP is processed by Flex. D:/tools/cygwin/home/xufan/WebKit/source/WebCore/CSS/tokenizer. the flex file is then processed after calling the Perl script D:/tools/cygwin/home/xufan/WebKit/source/WebCore/CSS/maketokenizer. Another tool: Flex. It seems that many tools and languages have to be learned to maintain WebKit. The flex here is not Adobe, but an lexical analyzer on Linux. The homepage is http://flex.sourceforge.net /. Tokenizer. Flex defines the CSS lexical rules.

In derivedsources. Make, you can use the GCC-e option to expand macros and perform preprocessing:

Ifeq ($ (shell gcc-e-p-DM $ (framework_flags) WebCore/forwardingheaders/WTF/platform. H | grep enable_dashboard_support | cut-D ''-F3), 1)
Enable_dashboard_support = 1
Enable_dashboard_support = 0

For GCC Command Options, refer to: gcc:


-EStop after the preprocessing stage; do not run the compiler proper. The output is in the form of preprocessed source code, which is sent to the standard output.


Input files which don't require preprocessing are ignored.

At this point, the rules in webcoregenerated have been basically introduced, and some steps after nmake are basically copying files, so we will not introduce them.

By the way, there is a blog: http://strohmayer.org/owb ).



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.