[webkit-dev] Cleaning up Document

Darin Adler darin at apple.com
Tue Aug 17 14:14:42 PDT 2010

On Aug 17, 2010, at 12:11 PM, Eric Seidel wrote:

> Window at least used to have its API spread across many classes (including frame, and at least 2 window
> classes).

That is a historical anomaly. Some classes like Window used to be implemented in the bindings layer. That was a bad idea, mixing language bindings with the DOM itself. We now have a far cleaner architecture where the bindings layer connects to an underlying object in a mechanical way and the bindings are generated. We definitely want a single class for the entire DOM API.

> In any case, whatever does the document DOM API, should *only* do the Document DOM API in my opinion.

That’s one way to do it. But I think not the best way.

I suggest the Document class be the Document DOM API plus the “hub” functions that get you to the various sub-objects. The rest of the DOM all does this, including Node and all classes derived from it, including all the HTML elements. And a Document is a Node.

I do support breaking this class up, but I think it’s more like when we broke up the Frame class than like our ongoing work to break up FrameLoader.

    -- Darin

More information about the webkit-dev mailing list