why WebKit ?
Today, more and more people study webkit, I can not mundane, but also increased. WebKit's popularity is also due to the browser and webOS melee, with Palm webOS, Chrome OS, Firefox OS and Ubuntu Mobile has been announced, WebOS gradually become the third world outside Android and iOS, and WebKit from the browser kernel to the mobile OS kernel, in addition to IE and Firefox, the market name is based on the development of WebKit, Chrome, Safari, Opera, 360 ... Therefore, whether you are engaged in the browser or mobile development, WebKit is not the second choice. And I am now because of the need to provide a similar with chrome for Android in the remote debugging functions, and contact with WebKit, with the deepening, but also gradually into the webkit development on the right track, but also want to record the recent learning process, Also help other friends to enter this gate, WebKit of information is not much.
how to get startedI assume that you and I, have never contacted WebKit, did not write C + +, was java/php and other fool-like language spoiled, the device underlying technology is not very understanding, in this case (can not be worse than this), but also can in a week or so into the threshold. Prepare the following steps before you start the formal operation:
- Study article: http://paulirish.com/2013/webkit-for-developers/, of course, also has the Chinese version number: http://www.infoq.com/cn/articles/ Webkit-for-developers, clarify several concepts of WebKit
- Prepare a CPU and hard disk a better computer, the CPU is to cope with the compilation, the hard disk is to deal with the large-scale code access (last July bought a Mac is not enough, specifically for this change SSD)
- The development platform is best xcode,visual studio, but you may encounter very many
- Prepare a C + + Primmer Plus on hand, study webkit at the same time, by the way, to solve the C + +
- Be patient enough to cope with lengthy source code download and compilation
Well, that's all, it's going to start. I will explain how to compile and Debug. Literacy prior to commencementWebKit PortWebKit has evolved into a platform-like framework similar to Linux, and is not an open source project of a single product type. It is a combination of standards and variants. The following diagram illustrates this very well:
WebKit provides a core library of the standard architecture and webcore like this one, but the rest of the gray is replaced and ported based on the respective platform, which is talking about a lot of ports, where the platform is the execution environment of their respective devices, such as Mac OS X, Android and iOS, so while we're using WebKit, there's a lot more to do, WebKit just provides the process and framework, and there's a lot of holes in it that we need to fill. For example, the remote debugging feature I am doing today is already supported on the process in WebKit, but the implementation is required by port, which is why only Chrome for Android and Safari for iOS support remote debugging. The article in the beginning describes what points are the standards have been implemented, which points are differentiated, and from here, you can probably estimate what needs to be done. the choice of learning platformThe official WebKit is based on safari for Mac OSX, and chromium, though also based on WebKit, is basically another set of QT and GTK platforms, with a very large number of browsers, For example, opera and 360 have chosen based on chromium, and how do we choose the starting point for those of us who are just beginning to learn? My feeling is that the standard WebKit threshold is a little lower, the document to enrich some, but as the future direction of project,chromium more popular, so I recommend the official WebKit as the starting point, and then extended to chromium. Later I talk about the development environment, based on the official WebKit, plus Xcode, will feel very smooth hand, not like most large open source projects in the beginning to shut you out. start with the start< Span style= "FONT-SIZE:14PX;" > below I introduce a few steps to do, in the case you do not need to know the details of the environment, most of which include myself, are still accustomed to the code and environment to build the situation, more mood and emboldened to go down, so patiently completed the following steps, you can start the WebKit in the development environment, Here I'm going to describe the situation under Mac, but in Windows and Linux it would be a bit harder, at least I'd give up when I was blocked:
- upgrade Mac OSX and Xcode to the latest version number, my mountain Lion 10.8.3 and Xcode 4.6. This is because one of my buddies used lion, the same steps, but after the launch has been reported memory access error, upgrade system to the latest after the solution. Of course, don't forget the Xcode command line
- Get the latest code: SVN Checkout Https://svn.webkit.org/repository/webkit/trunk Of course, this process is to be patient, especially when downloading layout test, for the future Yimapingchuan, endure it
- Xcode menu File->workspace settings->build->derived Data Location column Select Workspace-relative and enter webkitbuild-> Done
-
If you are downloading is the latest code, the environment is only required to build the above steps, when you click Run, you can start a smooth compilation, and finally pop up Safari, actually it runs the WebKit kernel, need a safari for the UI layer. WebKit also provides a minibrowser, which does not matter with Safari, the starting method is the fourth step on the exceutable to choose Minibrowser.app. I originally based on the code will have some other problems, here do not disturb everyone, assuming there is thunder, please put the error posted, I see have encountered.
OK, understand the basic concepts, set up the development and commissioning of the environment, I believe that no matter what level of rookie, will have confidence to continue to drill down. My idea is this, no matter how hard the back, do not make the beginning too complicated, this will be rejected by a lot of people outside the door, this is why I recommend the most start with Xcode, WebKit official has all the details of the compilation is hidden in Xcode project settings and scripts. Later, I will be based on the source code, and gradually deepen, and everyone together to explore the WebKit kernel of the wonderful and great.
Explore WebKit Kernel (i)------Rookie start