WebCore Directory Structure
Posted by Dave Hyatt on Tuesday, January 17th, 2006 at 4:19 pmNow that we’ve moved to Subversion, we’re making some changes to our directory structure. At the moment WebCore contains both a khtml directory and a ksvg2 directory. Although these are two separate libraries in KDE, in our code they are merged together (for the purposes of Compound Document support as well as speed), and going forward we want to fold them together even further.
In addition we are trying to take our portability layer and clean it up as well. Right now it contains a mix of basic data structures that are similar (but often not identical) to Qt APIs, and data structures that have nothing to do with Qt. We plan to consolidate these objects together in a new directory and change them so that they no longer clash with Qt. This will actually make it possible to port WebCore back to Qt, since we will no longer have classes with the same name that clash API-wise but that have numerous differences that make them incompatible.
The new directory structure is as follows:
bindings - houses the language-specific bindings for JavaScript and for Objective-C. It has two subdirectories, js and objc. The files that move here will come from khtml/ecma, ksvg/ecma, and also ksvg/bindings. Ultimately these language-specific bindings will be auto-generated from IDL files.
bridge - Bridge is about the bridging to the WebKit framework.
page - Code for the top-level page and frames. Was originally the khtml part and khtml view. We will be making this more abstract so that it can be bridged to either WebKit or another abstraction like the khtml part.
platform - Contains much of the engine-level plumbing (code from khtml/misc and kwq). This code will have platform-specific subdirectories, e.g., mac. Other ports can have their own subdirectories (Qt, GTK, Win32, etc.).
css - The CSS back end. This is consolidated from khtml/css and ksvg2/css.
editing - The editing infrastructure. This is moving from khtml/editing.
html - The HTML DOM. This is moving from khtml/html.
loader - Files that used to be in khtml/misc dealing with subresource loading.
svg - The SVG DOM. This is moving from ksvg2/svg.
xsl - Support for XSLT stylesheets. Moving from khtml/xsl.
xml - The XML DOM (base classes for the HTML+SVG DOMs). Moving from khtml/xml.
We will also be renaming all files to match the class defined in those files. For files that currently define many classes, we will be splitting them out into one class per file.
Feedback is welcome. Once we finish with these changes, we should have a nice clean merge of KHTML and KSVG2, as well as a better platform abstraction that is really independent of any specific platform implementation.
January 17th, 2006 at 5:47 pm
Maybe the core DOM should go in dom/ instead of xml/ since it is equally applicable to html. Also curious about the plan for rendering and kcanvas.
February 4th, 2006 at 7:32 pm
I would have thought this would have been best:
/dom
/dom/core - for the core of the DOM
/dom/xml
/dom/html