[webkit-dev] platform/ reorganization

Darin Adler darin at apple.com
Fri Nov 16 09:58:25 PST 2007


On Nov 16, 2007, at 4:20 AM, Nikolas Zimmermann wrote:

> platform/bidi:

Seems fine to break things down into logical groups. Generally I think  
a directory is warranted if the number of files is large.

It's important to look at who the clients are of these files, in  
addition to the filenames and concepts.

> BidiContext.cpp
> BidiContext.h
> BidiResolver.h

These bidi files are exclusively used by text graphics machinery. Thus  
I think it might make sense to move them into the graphics area. But  
another possibility would be to consider these abstract text  
operations and put these there, along with String.

> UnicodeRange.cpp
> UnicodeRange.h

This is primitive, and in my mind very closely related to String.  
Currently used only by SVG. I suggest keeping this with String.

> Font.cpp
> Font.h
> FontCache.cpp
> FontCache.h
> FontData.cpp
> FontData.h
> FontDescription.h
> FontFallbackList.cpp
> FontFallbackList.h
> FontFamily.cpp
> FontFamily.h
> FontSelector.h
> GlyphBuffer.h
> GlyphPageTreeNode.cpp
> GlyphPageTreeNode.h
> GlyphWidthMap.cpp
> GlyphWidthMap.h

This is all clearly part of the graphics sub-system. It should go into  
graphics or into a subdirectory of graphics.

> TextBoundaries.h
> TextBoundariesICU.cpp
> TextBreakIterator.h
> TextBreakIteratorICU.cpp
> TextBreakIteratorInternalICU.h
> TextCodec.cpp
> TextCodec.h
> TextCodecICU.cpp
> TextCodecICU.h
> TextCodecLatin1.cpp
> TextCodecLatin1.h
> TextCodecUTF16.cpp
> TextCodecUTF16.h
> TextCodecUserDefined.cpp
> TextCodecUserDefined.h
> TextDecoder.cpp
> TextDecoder.h
> TextDirection.h
> TextEncoding.cpp
> TextEncoding.h
> TextEncodingRegistry.cpp
> TextEncodingRegistry.h
> TextStream.cpp
> TextStream.h

I think these classes should go wherever String goes.

The boundaries, break iterator, and bidi classes and functions are a  
little higher level in my mind, and have more to do with editing, but  
they don't have anything to do with graphics and I don't think they're  
a big enough category to deserve a directory of their own.

> TextStyle.h

This is part of the graphics sub-system. It should go into the same  
place as Font.h, etc.

> I'd actually vote for a single directory platform/text, containing  
> all of the above files.

I don't think the graphics files belong with the basic text operations.

I think that String, StringImpl, AtomicString, CString,  
RegularExpression, Base64, and SegmentedString belong in the same  
place as the codec functions.

StringTruncator belongs with the other text graphics functions like  
FontDescription and GlyphBuffer.

I think that all the DeprecatedXXX classes should go into a single  
directory instead of sitting at the top level.

I'd suggest moving the text drawing functions into either platform/ 
graphics or platform/graphics/text. And the more basic text functions  
into platform/text. Many of the more basic text functions are also  
possible candidates for moving to WTF in the future if we find they  
are needed outside WebCore.

I don't want to make the hierarchy too deep; as long as the file names  
are clear, it's no great tragedy to have a directory with quite a few  
files in it. So we could definitely consider just putting the text  
graphics functions all into the top level of the graphics directory.

     -- Darin



More information about the webkit-dev mailing list