Reviewed by Tim Hatcher.
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Sep 2006 16:23:32 +0000 (16:23 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Sep 2006 16:23:32 +0000 (16:23 +0000)
        - http://bugzilla.opendarwin.org/show_bug.cgi?id=10675
          tweak font-related headers and convert lists to vectors

        One major change was to greatly reduce the number of files that include Font.h.
        Another was to convert many uses of DeprecatedPtrList/DeprecatedValueList to Vector.

        * WebCore.xcodeproj/project.pbxproj: Added TextStyle.h.

        * bindings/objc/DOM.mm: (-[DOMElement _font]): Changed to not depend on
        Font::getNSFont since a WebCore::Font represents more than one NSFont.

        * bindings/objc/DOMNode.mm: (-[DOMNode lineBoxRects]): Updated to use Vector.
        * bridge/mac/FormDataMac.mm: (WebCore::arrayFromFormData): Ditto.
        * bridge/mac/FrameViewMac.mm: (WebCore::FrameView::updateDashboardRegions): Ditto.
        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Ditto.
        * dom/Document.cpp:
        (WebCore::Document::dashboardRegions): Ditto.
        (WebCore::Document::setDashboardRegions): Ditto.
        * dom/Document.h: Ditto.
        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::ReplacementFragment::removeUnrenderedNodes): Ditto.
        * html/FormDataList.h: Ditto.
        * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::isFocusable): Ditto.
        * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::formData): Ditto.
        * kcanvas/RenderPath.cpp: (WebCore::RenderPath::absoluteRects): Ditto.
        * kcanvas/RenderPath.h: Ditto.
        * kcanvas/RenderSVGImage.cpp: (WebCore::RenderSVGImage::absoluteRects): Ditto.
        * kcanvas/RenderSVGImage.h: Ditto.
        * kcanvas/RenderSVGText.cpp: (WebCore::RenderSVGText::absoluteRects): Ditto.
        * kcanvas/RenderSVGText.h: Ditto.
        * loader/FormData.cpp:
        (WebCore::FormData::flatten): Ditto.
        (WebCore::FormData::flattenToString): Ditto.
        * loader/FormData.h: (WebCore::FormData::elements): Ditto.
        * loader/mac/LoaderFunctionsMac.mm: (WebCore::ServeSynchronousRequest): Ditto.
        * page/Frame.cpp: (WebCore::Frame::markedTextUnderlines): Ditto.
        * page/Frame.h: Ditto.
        * page/FramePrivate.h: Ditto.
        * platform/mac/ResourceLoaderMac.mm: (WebCore::ResourceLoader::start): Ditto.
        * rendering/InlineTextBox.h: Ditto.
        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::paint): Ditto.
        (WebCore::InlineTextBox::paintMarkedTextUnderline): Ditto.
        * rendering/RenderContainer.h: Ditto.
        * rendering/RenderContainer.cpp: (WebCore::RenderContainer::lineBoxRects): Ditto.
        * rendering/RenderInline.h: Ditto.
        * rendering/RenderInline.cpp: (WebCore::RenderInline::absoluteRects): Ditto.
        * rendering/RenderObject.h: Ditto.
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::lineBoxRects): Ditto.
        (WebCore::RenderObject::absoluteRects): Ditto.
        (WebCore::RenderObject::absoluteBoundingBoxRect): Ditto.
        (WebCore::RenderObject::addDashboardRegions): Ditto.
        (WebCore::RenderObject::collectDashboardRegions): Ditto.
        * rendering/RenderStyle.h: Ditto.
        * rendering/RenderStyle.cpp:
        (WebCore::RenderStyle::initialDashboardRegions): Ditto.
        (WebCore::RenderStyle::noneDashboardRegions): Ditto.
        * rendering/RenderText.h: Ditto.
        * rendering/RenderText.cpp:
        (WebCore::RenderText::absoluteRects): Ditto.
        (WebCore::RenderText::lineBoxRects): Ditto.
        * rendering/RenderView.h: Ditto.
        * rendering/RenderView.cpp: (WebCore::RenderView::absoluteRects): Ditto.

        * bridge/mac/FrameMac.mm:
        (WebCore::FrameMac::attributedString): Updated to use Vector and changed to not
        depend on getNSFont on a Font.
        (WebCore::FrameMac::fontForSelection): Changed to not depend on Font::getNSFont.
        (WebCore::FrameMac::fontAttributesForSelectionStart): Ditto.
        (WebCore::convertAttributesToUnderlines): Updated to use Vector.
        (WebCore::FrameMac::setMarkedTextRange): Ditto.
        (WebCore::FrameMac::dashboardRegionsDictionary): Ditto.

        * bridge/mac/WebCoreAXObject.mm:
        (boundingBoxRect): Updated to use Vector.
        (AXAttributeStringSetStyle): Changed to not depend on Font::getNSFont.

        * bridge/mac/WebCoreStringTruncator.mm: Updated includes.
        * page/Settings.h: Ditto.
        * platform/mac/WebCoreTextRenderer.mm: Ditto.
        * rendering/EllipsisBox.cpp: Ditto.

        * editing/BreakBlockquoteCommand.cpp: (WebCore::BreakBlockquoteCommand::doApply):
        Updated to use a Vector that we iterate in reverse order instead of a linked list
        that we reverse by prepending elements instead of adding to the end.
        * editing/InsertParagraphSeparatorCommand.cpp:
        (WebCore::InsertParagraphSeparatorCommand::doApply): Ditto.

        * loader/DocLoader.h: Removed unneeded include of DeprecatedPtrList.h.

        * platform/Font.h: Moved TextStyle to a separate header. Removed Font::getNSFont.
        * platform/Font.cpp: Changed to use const instead of #define.
        (WebCore::Font::width): Overloaded this so we don't have a default parameter, which
        eliminates the need to have TextStyle defined to compiler the Font.h header.

        * platform/TextStyle.h: Added.

        * platform/FontData.h: Added a forward declaration of ATSUStyle so this header
        can stand alone.

        * platform/FontFallbackList.h: Tweaks.
        * platform/FontFallbackList.cpp: Tweaks.

        * platform/FontFamily.h: Removed unneeded NSString declaration. Simplified class by
        using Shared and RefPtr, which resulted in removing many explicit functions.
        * platform/FontFamily.cpp: More of the same.

        * platform/GlyphBuffer.h: Removed unneeded MAX_GLYPH_EXPANSION and GLYPH_BUFFER_SIZE
        macros.

        * platform/GlyphMap.h: Removed unneeded include of GlyphBuffer.h, which was included
        only for the typedef of Glyph; there's no reason to not just repeat that typedef here
        since C++ allows multiple typedefs if they match. Renamed the cGlyphPageSize constant
        to GlyphPage::size.
        * platform/GlyphMap.cpp: Changed NO_BREAK_SPACE and ZERO_WIDTH_SPACE macros into
        constants. Updated for cGlyphPageSize change.
        * platform/mac/GlyphMapMac.cpp: Updated for cGlyphPageSize change.

        * platform/GlyphWidthMap.h: Removed unneeded include of GlyphBuffer.h, which was included
        only for the typedef of Glyph; there's no reason to not just repeat that typedef here
        since C++ allows multiple typedefs if they match. Renamed the cGlyphWidthPageSize constant
        to GlyphWidthPage::size.
        * platform/GlyphWidthMap.cpp: Updated for cGlyphWidthPageSize change.

        * platform/GraphicsContext.h: Removed unneeded include of Font.h. Changed drawText
        function to use overloading instead of default parameters to allow TextStyle to be optional.
        This cuts the dependency on TextStyle.
        * platform/GraphicsContext.cpp: (WebCore::GraphicsContext::drawText): Added overload.

        * platform/Image.h: Removed unneeded forward declaration of IntSize.

        * platform/mac/FontCacheMac.mm: (WebCore::FontCache::getFontDataForCharacters):
        Changed to not depend on Font::getNSFont.
        * platform/mac/ListBoxMac.mm: (-[WebCoreTableView fontChanged]): Ditto.
        * platform/mac/TextFieldMac.mm: (-[NSSearchFieldCell _addStringToRecentSearches:]):
        Ditto.
        * rendering/RenderPopupMenuMac.mm:
        (WebCore::RenderPopupMenuMac::showPopup): Ditto.
        (WebCore::RenderPopupMenuMac::addGroupLabel): Ditto.
        (WebCore::RenderPopupMenuMac::addOption): Ditto.

        * platform/mac/FontDataMac.mm: Fixed includes. Converted a bunch of macros to be
        constants and inline functions instead.

        * platform/mac/FontMac.mm: Fixed includes.
        * platform/mac/PopUpButtonMac.mm: Ditto.
        * rendering/RenderMenuList.cpp: Ditto.
        * rendering/RenderTextControl.cpp: Ditto.

        * platform/mac/WebCoreSystemInterface.h: Fixes so this header stands alone and is
        compatible with all 4 of C, ObjC, C++, ObjC++.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16250 268f45cc-cd09-0410-ab3c-d52691b4dbfc

78 files changed:
WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/objc/DOM.mm
WebCore/bindings/objc/DOMNode.mm
WebCore/bridge/mac/FormDataMac.mm
WebCore/bridge/mac/FrameMac.mm
WebCore/bridge/mac/FrameViewMac.mm
WebCore/bridge/mac/WebCoreAXObject.mm
WebCore/bridge/mac/WebCoreStringTruncator.mm
WebCore/css/CSSComputedStyleDeclaration.cpp
WebCore/dom/Document.cpp
WebCore/dom/Document.h
WebCore/editing/BreakBlockquoteCommand.cpp
WebCore/editing/InsertParagraphSeparatorCommand.cpp
WebCore/editing/ReplaceSelectionCommand.cpp
WebCore/html/FormDataList.h
WebCore/html/HTMLAnchorElement.cpp
WebCore/html/HTMLFormElement.cpp
WebCore/kcanvas/RenderPath.cpp
WebCore/kcanvas/RenderPath.h
WebCore/kcanvas/RenderSVGImage.cpp
WebCore/kcanvas/RenderSVGImage.h
WebCore/kcanvas/RenderSVGText.cpp
WebCore/kcanvas/RenderSVGText.h
WebCore/loader/DocLoader.h
WebCore/loader/FormData.cpp
WebCore/loader/FormData.h
WebCore/loader/mac/LoaderFunctionsMac.mm
WebCore/page/Frame.cpp
WebCore/page/Frame.h
WebCore/page/FramePrivate.h
WebCore/page/Settings.h
WebCore/platform/Font.cpp
WebCore/platform/Font.h
WebCore/platform/FontData.h
WebCore/platform/FontFallbackList.cpp
WebCore/platform/FontFallbackList.h
WebCore/platform/FontFamily.cpp
WebCore/platform/FontFamily.h
WebCore/platform/GlyphBuffer.h
WebCore/platform/GlyphMap.cpp
WebCore/platform/GlyphMap.h
WebCore/platform/GlyphWidthMap.cpp
WebCore/platform/GlyphWidthMap.h
WebCore/platform/GraphicsContext.cpp
WebCore/platform/GraphicsContext.h
WebCore/platform/Image.h
WebCore/platform/TextEncodingRegistry.cpp
WebCore/platform/TextStyle.h [new file with mode: 0644]
WebCore/platform/cg/ImageCG.cpp
WebCore/platform/mac/FontCacheMac.mm
WebCore/platform/mac/FontDataMac.mm
WebCore/platform/mac/FontMac.mm
WebCore/platform/mac/GlyphMapMac.cpp
WebCore/platform/mac/ListBoxMac.mm
WebCore/platform/mac/PopUpButtonMac.mm
WebCore/platform/mac/ResourceLoaderMac.mm
WebCore/platform/mac/TextFieldMac.mm
WebCore/platform/mac/WebCoreSystemInterface.h
WebCore/platform/mac/WebCoreTextRenderer.mm
WebCore/rendering/EllipsisBox.cpp
WebCore/rendering/InlineTextBox.cpp
WebCore/rendering/InlineTextBox.h
WebCore/rendering/RenderContainer.cpp
WebCore/rendering/RenderContainer.h
WebCore/rendering/RenderInline.cpp
WebCore/rendering/RenderInline.h
WebCore/rendering/RenderMenuList.cpp
WebCore/rendering/RenderObject.cpp
WebCore/rendering/RenderObject.h
WebCore/rendering/RenderPopupMenuMac.mm
WebCore/rendering/RenderStyle.cpp
WebCore/rendering/RenderStyle.h
WebCore/rendering/RenderText.cpp
WebCore/rendering/RenderText.h
WebCore/rendering/RenderTextControl.cpp
WebCore/rendering/RenderView.cpp
WebCore/rendering/RenderView.h

index e2e6c0f..b6e64ad 100644 (file)
@@ -1,3 +1,161 @@
+2006-09-06  Darin Adler  <darin@apple.com>
+
+        Reviewed by Tim Hatcher.
+
+        - http://bugzilla.opendarwin.org/show_bug.cgi?id=10675
+          tweak font-related headers and convert lists to vectors
+
+        One major change was to greatly reduce the number of files that include Font.h.
+        Another was to convert many uses of DeprecatedPtrList/DeprecatedValueList to Vector.
+
+        * WebCore.xcodeproj/project.pbxproj: Added TextStyle.h.
+
+        * bindings/objc/DOM.mm: (-[DOMElement _font]): Changed to not depend on
+        Font::getNSFont since a WebCore::Font represents more than one NSFont.
+
+        * bindings/objc/DOMNode.mm: (-[DOMNode lineBoxRects]): Updated to use Vector.
+        * bridge/mac/FormDataMac.mm: (WebCore::arrayFromFormData): Ditto.
+        * bridge/mac/FrameViewMac.mm: (WebCore::FrameView::updateDashboardRegions): Ditto.
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Ditto.
+        * dom/Document.cpp:
+        (WebCore::Document::dashboardRegions): Ditto.
+        (WebCore::Document::setDashboardRegions): Ditto.
+        * dom/Document.h: Ditto.
+        * editing/ReplaceSelectionCommand.cpp:
+        (WebCore::ReplacementFragment::removeUnrenderedNodes): Ditto.
+        * html/FormDataList.h: Ditto.
+        * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::isFocusable): Ditto.
+        * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::formData): Ditto.
+        * kcanvas/RenderPath.cpp: (WebCore::RenderPath::absoluteRects): Ditto.
+        * kcanvas/RenderPath.h: Ditto.
+        * kcanvas/RenderSVGImage.cpp: (WebCore::RenderSVGImage::absoluteRects): Ditto.
+        * kcanvas/RenderSVGImage.h: Ditto.
+        * kcanvas/RenderSVGText.cpp: (WebCore::RenderSVGText::absoluteRects): Ditto.
+        * kcanvas/RenderSVGText.h: Ditto.
+        * loader/FormData.cpp:
+        (WebCore::FormData::flatten): Ditto.
+        (WebCore::FormData::flattenToString): Ditto.
+        * loader/FormData.h: (WebCore::FormData::elements): Ditto.
+        * loader/mac/LoaderFunctionsMac.mm: (WebCore::ServeSynchronousRequest): Ditto.
+        * page/Frame.cpp: (WebCore::Frame::markedTextUnderlines): Ditto.
+        * page/Frame.h: Ditto.
+        * page/FramePrivate.h: Ditto.
+        * platform/mac/ResourceLoaderMac.mm: (WebCore::ResourceLoader::start): Ditto.
+        * rendering/InlineTextBox.h: Ditto.
+        * rendering/InlineTextBox.cpp:
+        (WebCore::InlineTextBox::paint): Ditto.
+        (WebCore::InlineTextBox::paintMarkedTextUnderline): Ditto.
+        * rendering/RenderContainer.h: Ditto.
+        * rendering/RenderContainer.cpp: (WebCore::RenderContainer::lineBoxRects): Ditto.
+        * rendering/RenderInline.h: Ditto.
+        * rendering/RenderInline.cpp: (WebCore::RenderInline::absoluteRects): Ditto.
+        * rendering/RenderObject.h: Ditto.
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::lineBoxRects): Ditto.
+        (WebCore::RenderObject::absoluteRects): Ditto.
+        (WebCore::RenderObject::absoluteBoundingBoxRect): Ditto.
+        (WebCore::RenderObject::addDashboardRegions): Ditto.
+        (WebCore::RenderObject::collectDashboardRegions): Ditto.
+        * rendering/RenderStyle.h: Ditto.
+        * rendering/RenderStyle.cpp:
+        (WebCore::RenderStyle::initialDashboardRegions): Ditto.
+        (WebCore::RenderStyle::noneDashboardRegions): Ditto.
+        * rendering/RenderText.h: Ditto.
+        * rendering/RenderText.cpp:
+        (WebCore::RenderText::absoluteRects): Ditto.
+        (WebCore::RenderText::lineBoxRects): Ditto.
+        * rendering/RenderView.h: Ditto.
+        * rendering/RenderView.cpp: (WebCore::RenderView::absoluteRects): Ditto.
+
+        * bridge/mac/FrameMac.mm:
+        (WebCore::FrameMac::attributedString): Updated to use Vector and changed to not
+        depend on getNSFont on a Font.
+        (WebCore::FrameMac::fontForSelection): Changed to not depend on Font::getNSFont.
+        (WebCore::FrameMac::fontAttributesForSelectionStart): Ditto.
+        (WebCore::convertAttributesToUnderlines): Updated to use Vector.
+        (WebCore::FrameMac::setMarkedTextRange): Ditto.
+        (WebCore::FrameMac::dashboardRegionsDictionary): Ditto.
+
+        * bridge/mac/WebCoreAXObject.mm:
+        (boundingBoxRect): Updated to use Vector.
+        (AXAttributeStringSetStyle): Changed to not depend on Font::getNSFont.
+
+        * bridge/mac/WebCoreStringTruncator.mm: Updated includes.
+        * page/Settings.h: Ditto.
+        * platform/mac/WebCoreTextRenderer.mm: Ditto.
+        * rendering/EllipsisBox.cpp: Ditto.
+
+        * editing/BreakBlockquoteCommand.cpp: (WebCore::BreakBlockquoteCommand::doApply):
+        Updated to use a Vector that we iterate in reverse order instead of a linked list
+        that we reverse by prepending elements instead of adding to the end.
+        * editing/InsertParagraphSeparatorCommand.cpp:
+        (WebCore::InsertParagraphSeparatorCommand::doApply): Ditto.
+
+        * loader/DocLoader.h: Removed unneeded include of DeprecatedPtrList.h.
+
+        * platform/Font.h: Moved TextStyle to a separate header. Removed Font::getNSFont.
+        * platform/Font.cpp: Changed to use const instead of #define.
+        (WebCore::Font::width): Overloaded this so we don't have a default parameter, which
+        eliminates the need to have TextStyle defined to compiler the Font.h header.
+
+        * platform/TextStyle.h: Added.
+
+        * platform/FontData.h: Added a forward declaration of ATSUStyle so this header
+        can stand alone.
+
+        * platform/FontFallbackList.h: Tweaks.
+        * platform/FontFallbackList.cpp: Tweaks.
+
+        * platform/FontFamily.h: Removed unneeded NSString declaration. Simplified class by
+        using Shared and RefPtr, which resulted in removing many explicit functions.
+        * platform/FontFamily.cpp: More of the same.
+
+        * platform/GlyphBuffer.h: Removed unneeded MAX_GLYPH_EXPANSION and GLYPH_BUFFER_SIZE
+        macros.
+
+        * platform/GlyphMap.h: Removed unneeded include of GlyphBuffer.h, which was included
+        only for the typedef of Glyph; there's no reason to not just repeat that typedef here
+        since C++ allows multiple typedefs if they match. Renamed the cGlyphPageSize constant
+        to GlyphPage::size.
+        * platform/GlyphMap.cpp: Changed NO_BREAK_SPACE and ZERO_WIDTH_SPACE macros into
+        constants. Updated for cGlyphPageSize change.
+        * platform/mac/GlyphMapMac.cpp: Updated for cGlyphPageSize change.
+
+        * platform/GlyphWidthMap.h: Removed unneeded include of GlyphBuffer.h, which was included
+        only for the typedef of Glyph; there's no reason to not just repeat that typedef here
+        since C++ allows multiple typedefs if they match. Renamed the cGlyphWidthPageSize constant
+        to GlyphWidthPage::size.
+        * platform/GlyphWidthMap.cpp: Updated for cGlyphWidthPageSize change.
+
+        * platform/GraphicsContext.h: Removed unneeded include of Font.h. Changed drawText
+        function to use overloading instead of default parameters to allow TextStyle to be optional.
+        This cuts the dependency on TextStyle.
+        * platform/GraphicsContext.cpp: (WebCore::GraphicsContext::drawText): Added overload.
+
+        * platform/Image.h: Removed unneeded forward declaration of IntSize.
+
+        * platform/mac/FontCacheMac.mm: (WebCore::FontCache::getFontDataForCharacters):
+        Changed to not depend on Font::getNSFont.
+        * platform/mac/ListBoxMac.mm: (-[WebCoreTableView fontChanged]): Ditto.
+        * platform/mac/TextFieldMac.mm: (-[NSSearchFieldCell _addStringToRecentSearches:]):
+        Ditto.
+        * rendering/RenderPopupMenuMac.mm:
+        (WebCore::RenderPopupMenuMac::showPopup): Ditto.
+        (WebCore::RenderPopupMenuMac::addGroupLabel): Ditto.
+        (WebCore::RenderPopupMenuMac::addOption): Ditto.
+
+        * platform/mac/FontDataMac.mm: Fixed includes. Converted a bunch of macros to be
+        constants and inline functions instead.
+
+        * platform/mac/FontMac.mm: Fixed includes.
+        * platform/mac/PopUpButtonMac.mm: Ditto.
+        * rendering/RenderMenuList.cpp: Ditto.
+        * rendering/RenderTextControl.cpp: Ditto.
+
+        * platform/mac/WebCoreSystemInterface.h: Fixes so this header stands alone and is
+        compatible with all 4 of C, ObjC, C++, ObjC++.
+
 2006-09-05  MorganL  <morlmor@yahoocom>
 
         Reviewed/landed by aroben.
index 8f2b75f..57c489e 100644 (file)
                939885C408B7E3D100E707C4 /* EventNames.h in Headers */ = {isa = PBXBuildFile; fileRef = 939885C208B7E3D100E707C4 /* EventNames.h */; };
                93A1EAA00A5634C9006960A0 /* ImageDocumentMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93A1EA9F0A5634C9006960A0 /* ImageDocumentMac.mm */; };
                93A1EAA80A563508006960A0 /* ImageDocumentMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 93A1EAA70A563508006960A0 /* ImageDocumentMac.h */; };
+               93AC8DE10A955FAC00239794 /* TextStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 93AC8DE00A955FAC00239794 /* TextStyle.h */; };
                93AE23180AAB51E500CD8A35 /* TextEncodingRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 93AE23170AAB51E500CD8A35 /* TextEncodingRegistry.h */; };
                93AE23210AAB521B00CD8A35 /* TextEncodingRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93AE23200AAB521B00CD8A35 /* TextEncodingRegistry.cpp */; };
                93B0FD8A0A759BED0080AD44 /* StringImplMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93B0FD880A759BED0080AD44 /* StringImplMac.mm */; };
                93A1EAA70A563508006960A0 /* ImageDocumentMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageDocumentMac.h; sourceTree = "<group>"; };
                93ABCE5D06E1A42E0085925B /* FormData.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FormData.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                93ABCE5E06E1A42E0085925B /* FormData.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = FormData.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+               93AC8DE00A955FAC00239794 /* TextStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextStyle.h; path = platform/TextStyle.h; sourceTree = "<group>"; };
                93AE23170AAB51E500CD8A35 /* TextEncodingRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextEncodingRegistry.h; sourceTree = "<group>"; };
                93AE23200AAB521B00CD8A35 /* TextEncodingRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextEncodingRegistry.cpp; sourceTree = "<group>"; };
                93B0FD880A759BED0080AD44 /* StringImplMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = StringImplMac.mm; sourceTree = "<group>"; };
                                089C1665FE841158C02AAC07 /* Resources */,
                                0867D69AFE84028FC02AAC07 /* Frameworks */,
                                034768DFFF38A50411DB9C8B /* Products */,
+                               93AC8DE00A955FAC00239794 /* TextStyle.h */,
                        );
                        name = WebKit;
                        sourceTree = "<group>";
                                1ACE53F70A8D19470022947D /* JSXMLSerializer.h in Headers */,
                                1A750D5D0A90DEE1000FF215 /* JSTreeWalker.h in Headers */,
                                1A750D8E0A90E521000FF215 /* JSNodeIterator.h in Headers */,
+                               93AC8DE10A955FAC00239794 /* TextStyle.h in Headers */,
                                85089CD70A98C42800A275AA /* DOMCDATASection.h in Headers */,
                                85089CD90A98C42800A275AA /* DOMComment.h in Headers */,
                                85089CDB0A98C42800A275AA /* DOMDocumentFragment.h in Headers */,
                        mainGroup = 0867D691FE84028FC02AAC07 /* WebKit */;
                        productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
                        projectDirPath = "";
-                       projectRoot = "";
                        targets = (
                                93F198A508245E59001E9ABC /* WebCore */,
                                DD041FBE09D9DDBE0010AF2A /* Derived Sources */,
index 7288c99..5602115 100644 (file)
@@ -42,6 +42,7 @@
 #import "EntityReference.h"
 #import "Event.h"
 #import "EventListener.h"
+#import "FontData.h"
 #import "FoundationExtras.h"
 #import "FrameMac.h"
 #import "HTMLDocument.h"
@@ -673,9 +674,8 @@ static Class elementClass(const AtomicString& tagName)
 - (NSFont *)_font
 {
     RenderObject *renderer = [self _element]->renderer();
-    if (renderer) {
-        return renderer->style()->font().getNSFont();
-    }
+    if (renderer)
+        return renderer->style()->font().primaryFont()->getNSFont();
     return nil;
 }
 
index 6385325..885efca 100644 (file)
 {
     WebCore::RenderObject *renderer = [self _node]->renderer();
     if (renderer) {
-        NSMutableArray *results = [[NSMutableArray alloc] init];
-        WebCore::DeprecatedValueList<WebCore::IntRect> rects = renderer->lineBoxRects();
-        if (!rects.isEmpty()) {
-            for (WebCore::DeprecatedValueList<WebCore::IntRect>::ConstIterator it = rects.begin(); it != rects.end(); ++it)
-                [results addObject:[NSValue valueWithRect:*it]];
-        }
-        return [results autorelease];
+        Vector<WebCore::IntRect> rects;
+        renderer->lineBoxRects(rects);
+        size_t size = rects.size();
+        NSMutableArray *results = [NSMutableArray arrayWithCapacity:size];
+        for (size_t i = 0; i < size; ++i)
+            [results addObject:[NSValue valueWithRect:rects[i]]];
+        return results;
     }
     return nil;
 }
index e799a07..6e547c8 100644 (file)
@@ -33,12 +33,13 @@ namespace WebCore {
 
 NSArray *arrayFromFormData(const FormData &d)
 {
-    NSMutableArray *a = [NSMutableArray arrayWithCapacity:d.count()];
-    for (DeprecatedValueListConstIterator<FormDataElement> it = d.begin(); it != d.end(); ++it) {
-        const FormDataElement &e = *it;
-        if (e.m_type == FormDataElement::data) {
+    size_t n = d.elements().size();
+    NSMutableArray *a = [NSMutableArray arrayWithCapacity:n];
+    for (size_t i = 0; i < n; ++i) {
+        const FormDataElement& e = d.elements()[i];
+        if (e.m_type == FormDataElement::data)
             [a addObject:[NSData dataWithBytes:e.m_data.data() length:e.m_data.size()]];
-        else {
+        else {
             ASSERT(e.m_type == FormDataElement::encodedFile);
             [a addObject:e.m_filename];
         }
index d482281..f5f22ef 100644 (file)
@@ -40,6 +40,7 @@
 #import "Event.h"
 #import "EventNames.h"
 #import "FloatRect.h"
+#import "FontData.h"
 #import "FoundationExtras.h"
 #import "FramePrivate.h"
 #import "GraphicsContext.h"
@@ -2300,8 +2301,8 @@ NSAttributedString *FrameMac::attributedString(Node *_start, int startOffset, No
     bool hasParagraphBreak = true;
     const Element *linkStartNode = 0;
     unsigned linkStartLocation = 0;
-    DeprecatedPtrList<Element> listItems;
-    DeprecatedValueList<ListItemInfo> listItemLocations;
+    Vector<Element*> listItems;
+    Vector<ListItemInfo> listItemLocations;
     float maxMarkerWidth = 0;
     
     Node *n = _startNode;
@@ -2320,7 +2321,7 @@ NSAttributedString *FrameMac::attributedString(Node *_start, int startOffset, No
         RenderObject *renderer = n->renderer();
         if (renderer) {
             RenderStyle *style = renderer->style();
-            NSFont *font = style->font().getNSFont();
+            NSFont *font = style->font().primaryFont()->getNSFont();
             bool needSpace = pendingStyledSpace != nil;
             if (n->isTextNode()) {
                 if (hasNewLine) {
@@ -2575,9 +2576,9 @@ NSAttributedString *FrameMac::attributedString(Node *_start, int startOffset, No
                 hasNewLine = true;
             } else if (n->hasTagName(liTag)) {
                 
-                int i, count = listItems.count();
+                int i, count = listItems.size();
                 for (i = 0; i < count; i++){
-                    if (listItems.at(i) == n){
+                    if (listItems[i] == n){
                         listItemLocations[i].end = [result length];
                         break;
                     }
@@ -2626,7 +2627,7 @@ NSAttributedString *FrameMac::attributedString(Node *_start, int startOffset, No
     // Apply paragraph styles from outside in.  This ensures that nested lists correctly
     // override their parent's paragraph style.
     {
-        unsigned i, count = listItems.count();
+        unsigned i, count = listItems.size();
         Element *e;
 
 #ifdef POSITION_LIST
@@ -2647,7 +2648,7 @@ NSAttributedString *FrameMac::attributedString(Node *_start, int startOffset, No
 #endif
         
         for (i = 0; i < count; i++){
-            e = listItems.at(i);
+            e = listItems[i];
             info = listItemLocations[i];
             
             if (info.end < info.start)
@@ -2657,7 +2658,7 @@ NSAttributedString *FrameMac::attributedString(Node *_start, int startOffset, No
             RenderStyle *style = r->style();
 
             int rx;
-            NSFont *font = style->font().getNSFont();
+            NSFont *font = style->font().primaryFont()->getNSFont();
             float pointSize = [font pointSize];
 
 #ifdef POSITION_LIST
@@ -2781,7 +2782,7 @@ NSFont *FrameMac::fontForSelection(bool *hasMultipleFonts) const
 
         NSFont *result = 0;
         if (style)
-            result = style->font().getNSFont();
+            result = style->font().primaryFont()->getNSFont();
         
         if (nodeToRemove) {
             ExceptionCode ec;
@@ -2805,7 +2806,7 @@ NSFont *FrameMac::fontForSelection(bool *hasMultipleFonts) const
             if (!renderer)
                 continue;
             // FIXME: Are there any node types that have renderers, but that we should be skipping?
-            NSFont *f = renderer->style()->font().getNSFont();
+            NSFont *f = renderer->style()->font().primaryFont()->getNSFont();
             if (!font) {
                 font = f;
                 if (!hasMultipleFonts)
@@ -2832,8 +2833,8 @@ NSDictionary *FrameMac::fontAttributesForSelectionStart() const
     if (style->backgroundColor().isValid() && style->backgroundColor().alpha() != 0)
         [result setObject:nsColor(style->backgroundColor()) forKey:NSBackgroundColorAttributeName];
 
-    if (style->font().getNSFont())
-        [result setObject:style->font().getNSFont() forKey:NSFontAttributeName];
+    if (style->font().primaryFont()->getNSFont())
+        [result setObject:style->font().primaryFont()->getNSFont() forKey:NSFontAttributeName];
 
     if (style->color().isValid() && style->color() != Color::black)
         [result setObject:nsColor(style->color()) forKey:NSForegroundColorAttributeName];
@@ -3361,10 +3362,8 @@ bool FrameMac::isSecureKeyboardEntry()
     return IsSecureEventInputEnabled();
 }
 
-static DeprecatedValueList<MarkedTextUnderline> convertAttributesToUnderlines(const Range *markedTextRange, NSArray *attributes, NSArray *ranges)
+static void convertAttributesToUnderlines(Vector<MarkedTextUnderline>& result, const Range *markedTextRange, NSArray *attributes, NSArray *ranges)
 {
-    DeprecatedValueList<MarkedTextUnderline> result;
-
     int exception = 0;
     int baseOffset = markedTextRange->startOffset(exception);
 
@@ -3391,8 +3390,6 @@ static DeprecatedValueList<MarkedTextUnderline> convertAttributesToUnderlines(co
                                           qColor,
                                           [style intValue] > 1));
     }
-
-    return result;
 }
 
 void FrameMac::setMarkedTextRange(const Range *range, NSArray *attributes, NSArray *ranges)
@@ -3402,12 +3399,12 @@ void FrameMac::setMarkedTextRange(const Range *range, NSArray *attributes, NSArr
     ASSERT(!range || range->startContainer(exception) == range->endContainer(exception));
     ASSERT(!range || range->collapsed(exception) || range->startContainer(exception)->isTextNode());
 
-    if (attributes == nil) {
+    d->m_markedTextUnderlines.clear();
+    if (attributes == nil)
         d->m_markedTextUsesUnderlines = false;
-        d->m_markedTextUnderlines.clear();
-    } else {
+    else {
         d->m_markedTextUsesUnderlines = true;
-        d->m_markedTextUnderlines = convertAttributesToUnderlines(range, attributes, ranges);
+        convertAttributesToUnderlines(d->m_markedTextUnderlines, range, attributes, ranges);
     }
 
     if (m_markedTextRange.get() && document() && m_markedTextRange->startContainer(exception)->renderer())
@@ -3438,13 +3435,13 @@ NSMutableDictionary *FrameMac::dashboardRegionsDictionary()
     if (!doc)
         return nil;
 
-    const DeprecatedValueList<DashboardRegionValue> regions = doc->dashboardRegions();
-    unsigned i, count = regions.count();
+    const Vector<DashboardRegionValue>& regions = doc->dashboardRegions();
+    size_t n = regions.size();
 
     // Convert the DeprecatedValueList<DashboardRegionValue> into a NSDictionary of WebDashboardRegions
-    NSMutableDictionary *webRegions = [[[NSMutableDictionary alloc] initWithCapacity:count] autorelease];
-    for (i = 0; i < count; i++) {
-        DashboardRegionValue region = regions[i];
+    NSMutableDictionary *webRegions = [NSMutableDictionary dictionaryWithCapacity:n];
+    for (size_t i = 0; i < n; i++) {
+        const DashboardRegionValue& region = regions[i];
 
         if (region.type == StyleDashboardRegion::None)
             continue;
@@ -3457,12 +3454,14 @@ NSMutableDictionary *FrameMac::dashboardRegionsDictionary()
             type = WebDashboardRegionTypeRectangle;
         NSMutableArray *regionValues = [webRegions objectForKey:label];
         if (!regionValues) {
-            regionValues = [NSMutableArray array];
+            regionValues = [[NSMutableArray alloc] initWithCapacity:1];
             [webRegions setObject:regionValues forKey:label];
+            [regionValues release];
         }
         
-        WebDashboardRegion *webRegion = [[[WebDashboardRegion alloc] initWithRect:region.bounds clip:region.clip type:type] autorelease];
+        WebDashboardRegion *webRegion = [[WebDashboardRegion alloc] initWithRect:region.bounds clip:region.clip type:type];
         [regionValues addObject:webRegion];
+        [webRegion release];
     }
     
     return webRegions;
index f512032..e021881 100644 (file)
@@ -45,8 +45,8 @@ void FrameView::updateDashboardRegions()
 {
     Document* doc = m_frame->document();
     if (doc->hasDashboardRegions()) {
-        DeprecatedValueList<DashboardRegionValue> newRegions = doc->renderer()->computeDashboardRegions();
-        DeprecatedValueList<DashboardRegionValue> currentRegions = doc->dashboardRegions();
+        Vector<DashboardRegionValue> newRegions;
+        doc->renderer()->collectDashboardRegions(newRegions);
         doc->setDashboardRegions(newRegions);
         Mac(m_frame.get())->dashboardRegionsChanged();
     }
index ccf74d2..eb0b414 100644 (file)
@@ -29,6 +29,7 @@
 #import "DOMInternal.h"
 #import "Document.h"
 #import "EventNames.h"
+#import "FontData.h"
 #import "FoundationExtras.h"
 #import "FrameMac.h"
 #import "HTMLAreaElement.h"
@@ -645,19 +646,17 @@ static IntRect boundingBoxRect(RenderObject* obj)
     if (obj) {
         if (obj->isInlineContinuation())
             obj = obj->element()->renderer();
-        DeprecatedValueList<IntRect> rects;
-        int x = 0, y = 0;
+        Vector<IntRect> rects;
+        int x, y;
         obj->absolutePosition(x, y);
         obj->absoluteRects(rects, x, y);
-        for (DeprecatedValueList<IntRect>::ConstIterator it = rects.begin(); it != rects.end(); ++it) {
-            IntRect r = *it;
+        const size_t n = rects.size();
+        for (size_t i = 0; i < n; ++i) {
+            IntRect r = rects[i];
             if (!r.isEmpty()) {
                 if (obj->style()->hasAppearance())
                     theme()->adjustRepaintRect(obj, r);
-                if (rect.isEmpty())
-                    rect = r;
-                else
-                    rect.unite(r);
+                rect.unite(r);
             }
         }
     }
@@ -1347,7 +1346,7 @@ static void AXAttributeStringSetStyle(NSMutableAttributedString* attrString, Ren
     RenderStyle* style = renderer->style();
 
     // set basic font info
-    AXAttributeStringSetFont(attrString, NSAccessibilityFontTextAttribute, style->font().getNSFont(), range);
+    AXAttributeStringSetFont(attrString, NSAccessibilityFontTextAttribute, style->font().primaryFont()->getNSFont(), range);
 
     // set basic colors
     AXAttributeStringSetColor(attrString, NSAccessibilityForegroundColorTextAttribute, nsColor(style->color()), range);
index c89acdf..4d52191 100644 (file)
 #import "config.h"
 #import "WebCoreStringTruncator.h"
 
-#import <wtf/Assertions.h>
 #import "Font.h"
+#import "FontPlatformData.h"
+#import "TextStyle.h"
+#import <wtf/Assertions.h>
 
 #define STRING_BUFFER_SIZE 2048
 #define ELLIPSIS_CHARACTER 0x2026
index 83f12a8..a58b5e3 100644 (file)
@@ -1318,8 +1318,8 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
         break;
 #if __APPLE__
         case CSS_PROP__WEBKIT_DASHBOARD_REGION: {
-            DeprecatedValueList<StyleDashboardRegion> regions = style->dashboardRegions();
-            unsigned count = regions.count();
+            const Vector<StyleDashboardRegion>& regions = style->dashboardRegions();
+            unsigned count = regions.size();
             if (count == 1 && regions[0].type == StyleDashboardRegion::None)
                 return new CSSPrimitiveValue(CSS_VAL_NONE);
             
index 993f727..16f5c18 100644 (file)
@@ -2032,15 +2032,15 @@ void Document::didEndEditing()
 }
 
 #if __APPLE__
-const DeprecatedValueList<DashboardRegionValue> & Document::dashboardRegions() const
+const Vector<DashboardRegionValue>& Document::dashboardRegions() const
 {
     return m_dashboardRegions;
 }
 
-void Document::setDashboardRegions (const DeprecatedValueList<DashboardRegionValue>& regions)
+void Document::setDashboardRegions(const Vector<DashboardRegionValue>& regions)
 {
     m_dashboardRegions = regions;
-    setDashboardRegionsDirty (false);
+    setDashboardRegionsDirty(false);
 }
 #endif
 
index 12852bc..f74a2f4 100644 (file)
@@ -745,8 +745,8 @@ public:
     bool dashboardRegionsDirty() const { return m_dashboardRegionsDirty; }
     bool hasDashboardRegions () const { return m_hasDashboardRegions; }
     void setHasDashboardRegions (bool f) { m_hasDashboardRegions = f; }
-    const DeprecatedValueList<DashboardRegionValue> & dashboardRegions() const;
-    void setDashboardRegions (const DeprecatedValueList<DashboardRegionValue>& regions);
+    const Vector<DashboardRegionValue>& dashboardRegions() const;
+    void setDashboardRegions(const Vector<DashboardRegionValue>&);
 #endif
 
     void removeAllEventListenersFromAllNodes();
@@ -807,7 +807,7 @@ private:
 #endif
     
 #if __APPLE__
-    DeprecatedValueList<DashboardRegionValue> m_dashboardRegions;
+    Vector<DashboardRegionValue> m_dashboardRegions;
     bool m_hasDashboardRegions;
     bool m_dashboardRegionsDirty;
 #endif
index 1fd55f0..c07f6fe 100644 (file)
@@ -44,8 +44,6 @@ BreakBlockquoteCommand::BreakBlockquoteCommand(Document *document)
 
 void BreakBlockquoteCommand::doApply()
 {
-    DeprecatedPtrList<Node> ancestors;
-    
     Selection selection = endingSelection();
     if (selection.isNone())
         return;
@@ -104,8 +102,9 @@ void BreakBlockquoteCommand::doApply()
         }
         
         // Build up list of ancestors in between the start node and the top blockquote.
-        for (Node *node = startNode->parentNode(); node != topBlockquote; node = node->parentNode())
-            ancestors.prepend(node);
+        Vector<Node*> ancestors;    
+        for (Node* node = startNode->parentNode(); node != topBlockquote; node = node->parentNode())
+            ancestors.append(node);
         
         // Insert a clone of the top blockquote after the break.
         RefPtr<Node> clonedBlockquote = topBlockquote->cloneNode(false);
@@ -116,8 +115,8 @@ void BreakBlockquoteCommand::doApply()
         // that was cloned (i.e. the clone of either ancestors.last()
         // or clonedBlockquote if ancestors is empty).
         RefPtr<Node> clonedAncestor = clonedBlockquote;
-        for (DeprecatedPtrListIterator<Node> it(ancestors); it.current(); ++it) {
-            RefPtr<Node> clonedChild = it.current()->cloneNode(false); // shallow clone
+        for (size_t i = ancestors.size(); i != 0; --i) {
+            RefPtr<Node> clonedChild = ancestors[i - 1]->cloneNode(false); // shallow clone
             appendNode(clonedChild.get(), clonedAncestor.get());
             clonedAncestor = clonedChild;
         }
@@ -132,14 +131,15 @@ void BreakBlockquoteCommand::doApply()
         }
 
         // Hold open startNode's original parent if we emptied it
-        addBlockPlaceholderIfNeeded(ancestors.last());
+        addBlockPlaceholderIfNeeded(ancestors[0]);
 
         // Split the tree up the ancestor chain until the topBlockquote
         // Throughout this loop, clonedParent is the clone of ancestor's parent.
         // This is so we can clone ancestor's siblings and place the clones
         // into the clone corresponding to the ancestor's parent.
-        Node *ancestor, *clonedParent;
-        for (ancestor = ancestors.last(), clonedParent = clonedAncestor->parentNode();
+        Node* ancestor;
+        Node* clonedParent;
+        for (ancestor = ancestors[0], clonedParent = clonedAncestor->parentNode();
              ancestor && ancestor != topBlockquote;
              ancestor = ancestor->parentNode(), clonedParent = clonedParent->parentNode()) {
             moveNode = ancestor->nextSibling();
index ef81042..5a0291d 100644 (file)
@@ -198,10 +198,10 @@ void InsertParagraphSeparatorCommand::doApply()
     startNode = pos.node();
 
     // Build up list of ancestors in between the start node and the start block.
-    DeprecatedPtrList<Node> ancestors;
+    Vector<Node*> ancestors;
     if (startNode != startBlock) {
-        for (Node *n = startNode->parentNode(); n && n != startBlock; n = n->parentNode())
-            ancestors.prepend(n);
+        for (Noden = startNode->parentNode(); n && n != startBlock; n = n->parentNode())
+            ancestors.append(n);
     }
 
     // Make sure we do not cause a rendered space to become unrendered.
@@ -235,8 +235,8 @@ void InsertParagraphSeparatorCommand::doApply()
 
     // Make clones of ancestors in between the start node and the start block.
     RefPtr<Node> parent = blockToInsert;
-    for (DeprecatedPtrListIterator<Node> it(ancestors); it.current(); ++it) {
-        RefPtr<Node> child = it.current()->cloneNode(false); // shallow clone
+    for (size_t i = ancestors.size(); i != 0; --i) {
+        RefPtr<Node> child = ancestors[i - 1]->cloneNode(false); // shallow clone
         appendNode(child.get(), parent.get());
         parent = child.release();
     }
@@ -263,7 +263,7 @@ void InsertParagraphSeparatorCommand::doApply()
     }            
 
     // Move everything after the start node.
-    Node *leftParent = ancestors.last();
+    Node* leftParent = ancestors[0];
     while (leftParent && leftParent != startBlock) {
         parent = parent->parentNode();
         Node *n = leftParent->nextSibling();
index 1244742..30643e5 100644 (file)
@@ -243,17 +243,17 @@ void ReplacementFragment::restoreTestRenderingNodesToFragment(Node *holder)
     }
 }
 
-void ReplacementFragment::removeUnrenderedNodes(Node *holder)
+void ReplacementFragment::removeUnrenderedNodes(Nodeholder)
 {
-    DeprecatedPtrList<Node> unrendered;
+    Vector<Node*> unrendered;
 
-    for (Node *node = holder->firstChild(); node; node = node->traverseNextNode(holder)) {
+    for (Node* node = holder->firstChild(); node; node = node->traverseNextNode(holder))
         if (!isNodeRendered(node) && !isTableStructureNode(node))
             unrendered.append(node);
-    }
 
-    for (DeprecatedPtrListIterator<Node> it(unrendered); it.current(); ++it)
-        removeNode(it.current());
+    size_t n = unrendered.size();
+    for (size_t i = 0; i < n; ++i)
+        removeNode(unrendered[i]);
 }
 
 ReplaceSelectionCommand::ReplaceSelectionCommand(Document* document, PassRefPtr<DocumentFragment> fragment,
index 6bab504..e67c574 100644 (file)
 #define HTML_FormDataList_h
 
 #include "CString.h"
-#include "DeprecatedValueList.h"
 #include "PlatformString.h"
 #include "TextEncoding.h"
+#include <wtf/Vector.h>
 
 namespace WebCore {
 
 struct FormDataListItem {
+    FormDataListItem() { }
     FormDataListItem(const CString& data) : m_data(data) { }
     FormDataListItem(const String& path) : m_path(path) { }
 
@@ -54,17 +55,14 @@ public:
         { appendString(key); appendString(String::number(value)); }
     void appendFile(const String& key, const String& filename);
 
-    DeprecatedValueListConstIterator<FormDataListItem> begin() const
-        { return m_list.begin(); }
-    DeprecatedValueListConstIterator<FormDataListItem> end() const
-        { return m_list.end(); }
+    const Vector<FormDataListItem>& list() const { return m_list; }
 
 private:
     void appendString(const CString&);
     void appendString(const String&);
 
     TextEncoding m_encoding;
-    DeprecatedValueList<FormDataListItem> m_list;
+    Vector<FormDataListItem> m_list;
 };
 
 } // namespace WebCore
index d47bf72..2b1accf 100644 (file)
@@ -81,12 +81,13 @@ bool HTMLAnchorElement::isFocusable() const
         if (r->width() > 0 && r->height() > 0)
             return true;
 
-    DeprecatedValueList<IntRect> rects;
-    int x = 0, y = 0;
+    Vector<IntRect> rects;
+    int x, y;
     renderer()->absolutePosition(x, y);
     renderer()->absoluteRects(rects, x, y);
-    for (DeprecatedValueList<IntRect>::ConstIterator it = rects.begin(); it != rects.end(); ++it)
-        if (!(*it).isEmpty())
+    size_t n = rects.size();
+    for (size_t i = 0; i < n; ++i)
+        if (!rects[i].isEmpty())
             return true;
 
     return false;
index 080c994..2ff6804 100644 (file)
@@ -206,22 +206,23 @@ bool HTMLFormElement::formData(FormData& result) const
         FormDataList lst(encoding);
 
         if (!current->disabled() && current->appendFormData(lst, m_multipart)) {
-            for (DeprecatedValueListConstIterator<FormDataListItem> it = lst.begin(); it != lst.end(); ++it) {
+            size_t ln = lst.list().size();
+            for (size_t j = 0; j < ln; ++j) {
+                const FormDataListItem& item = lst.list()[j];
                 if (!m_multipart) {
                     // handle ISINDEX / <input name=isindex> special
                     // but only if its the first entry
-                    if ( enc_string.isEmpty() && (*it).m_data == "isindex" ) {
-                        ++it;
-                        enc_string += encodeCString((*it).m_data);
-                    }
-                    else {
-                        if(!enc_string.isEmpty())
+                    if (enc_string.isEmpty() && item.m_data == "isindex") {
+                        enc_string += encodeCString(lst.list()[j + 1].m_data);
+                        ++j;
+                    } else {
+                        if (!enc_string.isEmpty())
                             enc_string += '&';
 
-                        enc_string += encodeCString((*it).m_data);
+                        enc_string += encodeCString(item.m_data);
                         enc_string += "=";
-                        ++it;
-                        enc_string += encodeCString((*it).m_data);
+                        enc_string += encodeCString(lst.list()[j + 1].m_data);
+                        ++j;
                     }
                 }
                 else
@@ -230,7 +231,7 @@ bool HTMLFormElement::formData(FormData& result) const
                     hstr += m_boundary.deprecatedString().latin1();
                     hstr += "\r\n";
                     hstr += "Content-Disposition: form-data; name=\"";
-                    hstr += (*it).m_data.data();
+                    hstr += item.m_data.data();
                     hstr += "\"";
 
                     // if the current type is FILE, then we also need to
@@ -259,16 +260,17 @@ bool HTMLFormElement::formData(FormData& result) const
                     }
 
                     hstr += "\r\n\r\n";
-                    ++it;
 
                     // append body
                     result.appendData(hstr.data(), hstr.length());
-                    const FormDataListItem& item = *it;
+                    const FormDataListItem& item = lst.list()[j + 1];
                     if (size_t dataSize = item.m_data.length())
                         result.appendData(item.m_data, dataSize);
                     else if (!item.m_path.isEmpty())
                         result.appendFile(item.m_path);
                     result.appendData("\r\n", 2);
+
+                    ++j;
                 }
             }
         }
index f70fff1..63f86c0 100644 (file)
@@ -239,7 +239,7 @@ void RenderPath::paint(PaintInfo &paintInfo, int parentX, int parentY)
     }
 }
 
-void RenderPath::absoluteRects(DeprecatedValueList<IntRect>& rects, int _tx, int _ty)
+void RenderPath::absoluteRects(Vector<IntRect>& rects, int _tx, int _ty)
 {
     rects.append(getAbsoluteRepaintRect());
 }
index 302d12b..3cd7881 100644 (file)
@@ -68,7 +68,7 @@ public:
     virtual short baselinePosition(bool b, bool isRootLineBox = false) const;
     virtual void paint(PaintInfo&, int parentX, int parentY);
  
-    virtual void absoluteRects(DeprecatedValueList<IntRect>& rects, int tx, int ty);
+    virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
 
     virtual bool nodeAtPoint(NodeInfo&, int x, int y, int tx, int ty, HitTestAction);
     
index 1513596..291ce20 100644 (file)
@@ -267,7 +267,7 @@ IntRect RenderSVGImage::getAbsoluteRepaintRect()
     return enclosingIntRect(repaintRect);
 }
 
-void RenderSVGImage::absoluteRects(DeprecatedValueList<IntRect>& rects, int _tx, int _ty)
+void RenderSVGImage::absoluteRects(Vector<IntRect>& rects, int tx, int ty)
 {
     rects.append(getAbsoluteRepaintRect());
 }
index 4a8fbd4..b5b5e0e 100644 (file)
@@ -43,7 +43,7 @@ namespace WebCore {
         virtual FloatRect relativeBBox(bool includeStroke = true) const;
         virtual IntRect getAbsoluteRepaintRect();
         
-        virtual void absoluteRects(DeprecatedValueList<IntRect>& rects, int tx, int ty);
+        virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
 
         virtual void imageChanged(CachedImage*);
         void adjustRectsForAspectRatio(FloatRect& destRect, FloatRect& srcRect, SVGPreserveAspectRatio *aspectRatio);
index 2780d97..24c385e 100644 (file)
@@ -180,7 +180,7 @@ bool RenderSVGText::nodeAtPoint(NodeInfo& info, int _x, int _y, int _tx, int _ty
     return RenderBlock::nodeAtPoint(info, (int)localX, (int)localY, _tx, _ty, hitTestAction);
 }
 
-void RenderSVGText::absoluteRects(DeprecatedValueList<IntRect>& rects, int _tx, int _ty)
+void RenderSVGText::absoluteRects(Vector<IntRect>& rects, int tx, int ty)
 {
     AffineTransform mat = translationForAttributes();
     mat *= translationTopToBaseline();
index 6c841d1..13c1a84 100644 (file)
@@ -42,9 +42,9 @@ public:
     virtual AffineTransform localTransform() const { return m_transform; }
     virtual void setLocalTransform(const AffineTransform& transform) { m_transform = transform; }
     
-    virtual bool nodeAtPoint(NodeInfo&, int _x, int _y, int _tx, int _ty, HitTestAction);
+    virtual bool nodeAtPoint(NodeInfo&, int x, int y, int tx, int ty, HitTestAction);
 
-    virtual void absoluteRects(DeprecatedValueList<IntRect>& rects, int tx, int ty);
+    virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
 
     virtual void computeAbsoluteRepaintRect(IntRect& r, bool f);
     virtual bool requiresLayer();
index 32b1b9e..e029175 100644 (file)
@@ -28,7 +28,6 @@
 #define DocLoader_h
 
 #include "CachePolicy.h"
-#include "DeprecatedPtrList.h"
 #include "DeprecatedStringList.h"
 #include "Settings.h"
 #include "StringHash.h"
index 2cff6a0..ec07f5c 100644 (file)
@@ -50,18 +50,18 @@ void FormData::appendFile(const String& filename)
     m_elements.append(filename);
 }
 
-void FormData::flatten(Vector<char>& a) const
+void FormData::flatten(Vector<char>& data) const
 {
     // Concatenate all the byte arrays, but omit any files.
-    a.clear();
-    size_t size = a.size();
-    for (DeprecatedValueListConstIterator<FormDataElement> it = m_elements.begin(); it != m_elements.end(); ++it) {
-        const FormDataElement& e = *it;
+    data.clear();
+    size_t n = m_elements.size();
+    for (size_t i = 0; i < n; ++i) {
+        const FormDataElement& e = m_elements[i];
         if (e.m_type == FormDataElement::data) {
+            size_t oldSize = data.size();
             size_t delta = e.m_data.size();
-            a.resize(size + delta);
-            memcpy(a.data() + size, e.m_data.data(), delta);
-            size += delta;
+            data.resize(oldSize + delta);
+            memcpy(data.data() + oldSize, e.m_data.data(), delta);
         }
     }
 }
index 1a98a7f..4fbd228 100644 (file)
@@ -1,6 +1,5 @@
-/* This file is part of the KDE project
- *
- * Copyright (C) 2004 Apple Computer, Inc.
+/*
+ * Copyright (C) 2004, 2006 Apple Computer, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -49,12 +48,10 @@ public:
     void flatten(Vector<char>&) const; // omits files
     String flattenToString() const; // omits files
 
-    size_t count() const { return m_elements.count(); }
-    DeprecatedValueListConstIterator<FormDataElement> begin() const { return m_elements.begin(); }
-    DeprecatedValueListConstIterator<FormDataElement> end() const { return m_elements.end(); }
+    const Vector<FormDataElement>& elements() const { return m_elements; }
 
 private:
-    DeprecatedValueList<FormDataElement> m_elements;
+     Vector<FormDataElement> m_elements;
 };
 
 } // namespace WebCore
index 3bdc7b7..0f168fd 100644 (file)
@@ -141,7 +141,7 @@ Vector<char> ServeSynchronousRequest(Loader *loader, DocLoader *docLoader, Resou
         headerDict = [[NSDictionary _webcore_dictionaryWithHeaderString:headerString] retain];
 
     NSArray *postData = nil;
-    if (job->postData().count() > 0)
+    if (!job->postData().elements().isEmpty())
         postData = arrayFromFormData(job->postData());
 
     NSURL *finalNSURL = nil;
index a1c292d..eb80d20 100644 (file)
@@ -3360,7 +3360,7 @@ bool Frame::markedTextUsesUnderlines() const
     return d->m_markedTextUsesUnderlines;
 }
 
-DeprecatedValueList<MarkedTextUnderline> Frame::markedTextUnderlines() const
+const Vector<MarkedTextUnderline>& Frame::markedTextUnderlines() const
 {
     return d->m_markedTextUnderlines;
 }
index 9193078..2e54ecb 100644 (file)
@@ -75,6 +75,8 @@ class VisiblePosition;
 template <typename T> class Timer;
 
 struct MarkedTextUnderline {
+    MarkedTextUnderline() 
+        : startOffset(0), endOffset(0), thick(false) { }
     MarkedTextUnderline(unsigned s, unsigned e, const Color& c, bool t) 
         : startOffset(s), endOffset(e), color(c), thick(t) { }
     unsigned startOffset;
@@ -721,7 +723,7 @@ private:
 
   UChar backslashAsCurrencySymbol() const;
 
-  DeprecatedValueList<MarkedTextUnderline> markedTextUnderlines() const;  
+  const Vector<MarkedTextUnderline>& markedTextUnderlines() const;  
   bool markedTextUsesUnderlines() const;
   
   unsigned markAllMatchesForText(const String&, bool caseFlag);
index a835bf8..4c29683 100644 (file)
@@ -224,7 +224,7 @@ namespace WebCore {
         KURL m_submittedFormURL;
         
         bool m_markedTextUsesUnderlines;
-        DeprecatedValueList<MarkedTextUnderline> m_markedTextUnderlines;
+        Vector<MarkedTextUnderline> m_markedTextUnderlines;
         bool m_highlightTextMatches;
         bool m_windowHasFocus;
         
index ddbe631..01d8e28 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2003, 2006 Apple Computer, Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -26,7 +26,7 @@
 #ifndef WebCoreSettings_H
 #define WebCoreSettings_H
 
-#include "Font.h"
+#include "AtomicString.h"
 #include "KURL.h"
 
 namespace WebCore {
index 6bfe7a9..7d0f789 100644 (file)
 
 #include "config.h"
 #include "Font.h"
-#include "FontData.h"
 
+#include "FloatRect.h"
 #include "FontFallbackList.h"
-#include "GraphicsContext.h"
-#include "Settings.h"
-
+#include "IntPoint.h"
 #include "GlyphBuffer.h"
-
+#include "TextStyle.h"
+#include <unicode/uchar.h>
 #include <unicode/umachine.h>
 #include <unicode/unorm.h>
-
 #include <wtf/MathExtras.h>
 
 namespace WebCore {
 
 // According to http://www.unicode.org/Public/UNIDATA/UCD.html#Canonical_Combining_Class_Values
-#define HIRAGANA_KATAKANA_VOICING_MARKS 8
+const uint8_t hiraganaKatakanaVoicingMarksCombiningClass = 8;
 
 const uint8_t Font::gRoundingHackCharacterTable[256] = {
     0, 0, 0, 0, 0, 0, 0, 0, 0, 1 /*\t*/, 1 /*\n*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -81,8 +79,14 @@ private:
 };
 
 WidthIterator::WidthIterator(const Font* font, const TextRun& run, const TextStyle& style, const FontData* substituteFontData)
-:m_font(font), m_run(run), m_end(style.rtl() ? run.length() : run.to()), m_style(style), m_substituteFontData(substituteFontData),
- m_currentCharacter(run.from()), m_runWidthSoFar(0), m_finalRoundingWidth(0)
+    : m_font(font)
+    , m_run(run)
+    , m_end(style.rtl() ? run.length() : run.to())
+    , m_style(style)
+    , m_substituteFontData(substituteFontData)
+    , m_currentCharacter(run.from())
+    , m_runWidthSoFar(0)
+    , m_finalRoundingWidth(0)
 {
     // If the padding is non-zero, count the number of spaces in the run
     // and divide that by the padding for per space addition.
@@ -292,7 +296,7 @@ bool WidthIterator::advanceOneCharacter(float& width, GlyphBuffer* glyphBuffer)
 UChar32 WidthIterator::normalizeVoicingMarks(int currentCharacter)
 {
     if (currentCharacter + 1 < m_end) {
-        if (u_getCombiningClass(m_run[currentCharacter + 1]) == HIRAGANA_KATAKANA_VOICING_MARKS) {
+        if (u_getCombiningClass(m_run[currentCharacter + 1]) == hiraganaKatakanaVoicingMarksCombiningClass) {
             // Normalize into composed form using 3.2 rules.
             UChar normalizedCharacters[2] = { 0, 0 };
             UErrorCode uStatus = U_ZERO_ERROR;  
@@ -370,6 +374,11 @@ void Font::update() const
     m_fontList->invalidate();
 }
 
+int Font::width(const TextRun& run) const
+{
+    return width(run, TextStyle());
+}
+
 int Font::width(const TextRun& run, const TextStyle& style) const
 {
     return lroundf(floatWidth(run, style));
index e55d5dc..e5baf42 100644 (file)
 #ifndef FONT_H
 #define FONT_H
 
-#include "Color.h"
 #include "FontDescription.h"
-#include "FontData.h"
-#include "TextDirection.h"
-#include "GlyphBuffer.h"
 
 #if PLATFORM(QT)
 class QFont;
@@ -38,15 +34,17 @@ class QFont;
 
 namespace WebCore {
 
+class FloatPoint;
+class FloatRect;
+class FontData;
 class FontFallbackList;
+class FontPlatformData;
+class GlyphBuffer;
 class GraphicsContext;
 class IntPoint;
-class IntRect;
-class FloatRect;
-class FloatPoint;
+class TextStyle;
 
-class TextRun
-{
+class TextRun {
 public:
     TextRun(const UChar* c, int len)
     :m_characters(c), m_len(len), m_from(0), m_to(len)
@@ -79,45 +77,12 @@ private:
     int m_to;
 };
 
-class TextStyle
-{
-public:
-    TextStyle(int tabWidth = 0, int xpos = 0, int padding = 0, bool rtl = false, bool directionalOverride = false,
-              bool applyRunRounding = true, bool applyWordRounding = true, bool attemptFontSubstitution = true)
-    :m_tabWidth(tabWidth), m_xpos(xpos), m_padding(padding), m_rtl(rtl), m_directionalOverride(directionalOverride),
-     m_applyRunRounding(applyRunRounding), m_applyWordRounding(applyWordRounding), m_attemptFontSubstitution(attemptFontSubstitution)
-    {}
-    
-    int tabWidth() const { return m_tabWidth; }
-    int xPos() const { return m_xpos; }
-    int padding() const { return m_padding; }
-    bool rtl() const { return m_rtl; }
-    bool ltr() const { return !m_rtl; }
-    bool directionalOverride() const { return m_directionalOverride; }
-    bool applyRunRounding() const { return m_applyRunRounding; }
-    bool applyWordRounding() const { return m_applyWordRounding; }
-    bool attemptFontSubstitution() const { return m_attemptFontSubstitution; }
-
-    void disableRoundingHacks() { m_applyRunRounding = m_applyWordRounding = false; }
-    void setRTL(bool b) { m_rtl = b; }
-    
-private:
-    int m_tabWidth;
-    int m_xpos;
-    int m_padding;
-    bool m_rtl;
-    bool m_directionalOverride;
-    bool m_applyRunRounding;
-    bool m_applyWordRounding;
-    bool m_attemptFontSubstitution;
-};
-
 class Font {
 public:
     Font();
     Font(const FontDescription&, short letterSpacing, short wordSpacing);
 #if PLATFORM(MAC)
-    Font(const FontPlatformData& fontPlatformData); // This constructor is only used by Mac-specific code that already has a native font.
+    Font(const FontPlatformData&); // This constructor is only used by Mac-specific code that already has a native font.
 #endif
     ~Font();
     
@@ -145,8 +110,10 @@ public:
 
     void drawText(GraphicsContext*, const TextRun&, const TextStyle&, const FloatPoint&) const;
 
-    int width(const TextRun&, const TextStyle& = TextStyle()) const;
-    float floatWidth(const TextRun&, const TextStyle& = TextStyle()) const;
+    int width(const TextRun&, const TextStyle&) const;
+    int width(const TextRun&) const;
+    float floatWidth(const TextRun&, const TextStyle&) const;
+    float floatWidth(const TextRun&) const;
     
     int offsetForPosition(const TextRun&, const TextStyle&, int position, bool includePartialGlyphs) const;
     FloatRect selectionRectForText(const TextRun&, const TextStyle&, const IntPoint&, int h) const;
@@ -168,10 +135,6 @@ public:
     unsigned weight() const { return m_fontDescription.weight(); }
     bool bold() const { return m_fontDescription.bold(); }
 
-#if PLATFORM(MAC)
-    NSFont* getNSFont() const { return primaryFont()->getNSFont(); }
-#endif
-
 #if PLATFORM(QT)
     operator QFont() const;
 #endif
index 7b50d79..e5723db 100644 (file)
@@ -1,6 +1,5 @@
 /*
- * This file is part of the internal font implementation.  It should not be included by anyone other than
- * FontMac.cpp, FontWin.cpp and Font.cpp.
+ * This file is part of the internal font implementation.
  *
  * Copyright (C) 2006 Apple Computer, Inc.
  *
 // FIXME: Temporary. Only needed to support API that's going to move.
 #include <unicode/umachine.h>
 
+#if PLATFORM(MAC)
+typedef struct OpaqueATSUStyle* ATSUStyle;
+#endif
+
 namespace WebCore {
 
 class FontDescription;
index 316dc93..061dee2 100644 (file)
  */
 
 #include "config.h"
-#include "Font.h"
 #include "FontFallbackList.h"
+
+#include "Font.h"
 #include "FontCache.h"
 
-namespace WebCore
-{
+namespace WebCore {
 
 FontFallbackList::FontFallbackList()
-:m_familyIndex(0), m_pitch(UnknownPitch)
-{
-}
-
-FontFallbackList::~FontFallbackList()
+    : m_familyIndex(0), m_pitch(UnknownPitch)
 {
 }
 
index 18c1f08..0769b68 100644 (file)
 // This file has no guards on purpose in order to detect redundant includes. This is a private header
 // and so this should catch anyone trying to include this file in public cpp files.
 
+#include "FontData.h"
+#include "Shared.h"
 #include <wtf/Noncopyable.h>
 #include <wtf/Vector.h>
-#include <Shared.h>
-#include "FontData.h"
 
 namespace WebCore {
 
 class Font;
 class GraphicsContext;
 class IntRect;
-class FontData;
 class FontDescription;
 class FontPlatformData;
 
@@ -43,7 +42,6 @@ const int cAllFamiliesScanned = -1;
 class FontFallbackList : public Shared<FontFallbackList>, Noncopyable {
 public:
     FontFallbackList();
-    ~FontFallbackList();
 
     void invalidate();
     
index 185a1d2..eee4f8b 100644 (file)
 
 namespace WebCore {
 
-FontFamily::FontFamily()
-    : m_next(0)
-    , m_refCnt(0)
-{
-}
-
 FontFamily::FontFamily(const FontFamily& other)
-    : m_family(other.m_family)
+    : Shared<FontFamily>()
+    , m_family(other.m_family)
     , m_next(other.m_next)
-    , m_refCnt(0)
 {
-    if (m_next)
-        m_next->ref();
 }
 
-FontFamily::~FontFamily()
-{ 
-    if (m_next)
-        m_next->deref();
-}
-   
 FontFamily& FontFamily::operator=(const FontFamily& other)
 {
-    if (other.m_next)
-        other.m_next->ref();
-    if (m_next)
-        m_next->deref();
     m_family = other.m_family;
     m_next = other.m_next;
     return *this;
 }
 
-void FontFamily::setFamily(const AtomicString &family)
-{
-    m_family = family;
-}
-
 bool FontFamily::operator==(const FontFamily &compareFontFamily) const
 {
     if ((!m_next && compareFontFamily.m_next) || 
index 4bcbb71..fa948b0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2003, 2006 Apple Computer, Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 #define FONT_FAMILY_H
 
 #include "AtomicString.h"
-
-#if __APPLE__
-#ifdef __OBJC__
-@class NSString;
-#else
-class NSString;
-#endif
-#endif
+#include "Shared.h"
+#include <wtf/RefPtr.h>
 
 namespace WebCore {
 
-class FontFamily {
+class FontFamily : public Shared<FontFamily> {
 public:
-    FontFamily();
-    ~FontFamily();
+    FontFamily() { }
     
-    FontFamily(const FontFamily &);    
-    FontFamily &operator=(const FontFamily &);
-        
-    void setFamily(const AtomicString &);
+    FontFamily(const FontFamily&);    
+    FontFamily& operator=(const FontFamily&);
+
+    void setFamily(const AtomicString& family) { m_family = family; }
     const AtomicString& family() const { return m_family; }
     bool familyIsEmpty() const { return m_family.isEmpty(); }
 
-    FontFamily *next() { return m_next; }
-    const FontFamily *next() const { return m_next; }
+    FontFamily* next() { return m_next.get(); }
+    const FontFamily* next() const { return m_next.get(); }
 
-    void appendFamily(FontFamily *family) 
-    {
-        if (family)
-            family->ref();
-        if (m_next) 
-            m_next->deref(); 
-        m_next = family; 
-    }
-    
-    bool operator==(const FontFamily &) const;
-    bool operator!=(const FontFamily &x) const { return !(*this == x); }
-    
-    void ref() { m_refCnt++; }
-    void deref() { m_refCnt--; if (m_refCnt == 0) delete this; }
+    void appendFamily(PassRefPtr<FontFamily> family) { m_next = family; }
+
+    bool operator==(const FontFamily&) const;
+    bool operator!=(const FontFamily& x) const { return !(*this == x); }
     
 private:
     AtomicString m_family;
-    FontFamily* m_next;
-    int m_refCnt;
+    RefPtr<FontFamily> m_next;
 };
 
 }
index e4e98a9..2925994 100644 (file)
 #ifndef GLYPH_BUFFER_H
 #define GLYPH_BUFFER_H
 
-// MAX_GLYPH_EXPANSION is the maximum numbers of glyphs that may be
-// use to represent a single Unicode code point.
-#define MAX_GLYPH_EXPANSION 4
-#define GLYPH_BUFFER_SIZE 2048
-
 #if PLATFORM(CG)
 #include <ApplicationServices/ApplicationServices.h>
 #elif PLATFORM(CAIRO)
@@ -45,8 +40,8 @@
 
 #include <wtf/Vector.h>
 
-namespace WebCore
-{
+namespace WebCore {
+
 typedef unsigned short Glyph;
 class FontData;
 
@@ -61,11 +56,8 @@ typedef unsigned short GlyphBufferGlyph;
 typedef FloatSize GlyphBufferAdvance;
 #endif
 
-class GlyphBuffer
-{
+class GlyphBuffer {
 public:
-    GlyphBuffer() {};
-    
     bool isEmpty() const { return m_fontData.isEmpty(); }
     int size() const { return m_fontData.size(); }
     
@@ -76,8 +68,10 @@ public:
         m_advances.clear();
     }
 
-    GlyphBufferGlyph* glyphs(int from) const { return ((GlyphBufferGlyph*)m_glyphs.data()) + from; }
-    GlyphBufferAdvance* advances(int from) const { return ((GlyphBufferAdvance*)m_advances.data()) + from; }
+    GlyphBufferGlyph* glyphs(int from) { return m_glyphs.data() + from; }
+    GlyphBufferAdvance* advances(int from) { return m_advances.data() + from; }
+    const GlyphBufferGlyph* glyphs(int from) const { return m_glyphs.data() + from; }
+    const GlyphBufferAdvance* advances(int from) const { return m_advances.data() + from; }
 
     const FontData* fontDataAt(int index) const { return m_fontData[index]; }
     
@@ -136,9 +130,9 @@ public:
     }
     
 private:
-    Vector<const FontData*, GLYPH_BUFFER_SIZE> m_fontData;
-    Vector<GlyphBufferGlyph, GLYPH_BUFFER_SIZE> m_glyphs;
-    Vector<GlyphBufferAdvance, GLYPH_BUFFER_SIZE> m_advances;
+    Vector<const FontData*, 2048> m_fontData;
+    Vector<GlyphBufferGlyph, 2048> m_glyphs;
+    Vector<GlyphBufferAdvance, 2048> m_advances;
 };
 
 }
index 8128d3a..3356202 100644 (file)
 
 #include "config.h"
 #include "GlyphMap.h"
-#include "FontData.h"
 
+#include "FontData.h"
 #include <unicode/uchar.h>
 
-#define NO_BREAK_SPACE 0x00A0
-#define ZERO_WIDTH_SPACE 0x200B
+namespace WebCore {
 
-namespace WebCore
-{
+const UChar nonBreakingSpace = 0x00A0;
+const UChar zeroWidthSpace = 0x200B;
 
 GlyphData GlyphMap::glyphDataForCharacter(UChar32 c, const FontData* fontData)
 {
-    unsigned pageNumber = (c / cGlyphPageSize);
+    unsigned pageNumber = (c / GlyphPage::size);
     GlyphPage* page = locatePage(pageNumber, fontData);
     if (page)
         return page->glyphDataForCharacter(c);
@@ -50,7 +49,7 @@ GlyphData GlyphMap::glyphDataForCharacter(UChar32 c, const FontData* fontData)
 
 void GlyphMap::setGlyphDataForCharacter(UChar32 c, Glyph glyph, const FontData* fontData)
 {
-    unsigned pageNumber = (c / cGlyphPageSize);
+    unsigned pageNumber = (c / GlyphPage::size);
     GlyphPage* page = locatePage(pageNumber, fontData);
     if (page)
         page->setGlyphDataForCharacter(c, glyph, fontData);
@@ -72,32 +71,32 @@ inline GlyphMap::GlyphPage* GlyphMap::locatePage(unsigned pageNumber, const Font
         page = new GlyphPage;
     }
       
-    unsigned start = pageNumber * cGlyphPageSize;
-    UChar buffer[cGlyphPageSize * 2 + 2];
+    unsigned start = pageNumber * GlyphPage::size;
+    UChar buffer[GlyphPage::size * 2 + 2];
     unsigned bufferLength;
     unsigned i;
 
     // Fill in a buffer with the entire "page" of characters that we want to look up glyphs for.
     if (start < 0x10000) {
-        bufferLength = cGlyphPageSize;
-        for (i = 0; i < cGlyphPageSize; i++)
+        bufferLength = GlyphPage::size;
+        for (i = 0; i < GlyphPage::size; i++)
             buffer[i] = start + i;
 
         if (start == 0) {
             // Control characters must not render at all.
             for (i = 0; i < 0x20; ++i)
-                buffer[i] = ZERO_WIDTH_SPACE;
+                buffer[i] = zeroWidthSpace;
             for (i = 0x7F; i < 0xA0; i++)
-                buffer[i] = ZERO_WIDTH_SPACE;
+                buffer[i] = zeroWidthSpace;
 
             // \n, \t, and nonbreaking space must render as a space.
             buffer[(int)'\n'] = ' ';
             buffer[(int)'\t'] = ' ';
-            buffer[NO_BREAK_SPACE] = ' ';
+            buffer[nonBreakingSpace] = ' ';
         }
     } else {
-        bufferLength = cGlyphPageSize * 2;
-        for (i = 0; i < cGlyphPageSize; i++) {
+        bufferLength = GlyphPage::size * 2;
+        for (i = 0; i < GlyphPage::size; i++) {
             int c = i + start;
             buffer[i * 2] = U16_LEAD(c);
             buffer[i * 2 + 1] = U16_TRAIL(c);
index c5471dc..a8a5356 100644 (file)
 #define GLYPH_MAP_H
 
 #include <unicode/umachine.h>
-#include "GlyphBuffer.h"
 #include <wtf/Noncopyable.h>
 #include <wtf/HashMap.h>
 
 namespace WebCore {
 
-// Covers Latin-1.
-const unsigned cGlyphPageSize = 256;
-
 class FontData;
 
-struct GlyphData
-{    
+typedef unsigned short Glyph;
+
+struct GlyphData {    
     Glyph glyph;
     const FontData* fontData;
 };
 
-class GlyphMap : Noncopyable
-{
+class GlyphMap : Noncopyable {
 public:
     GlyphMap() : m_filledPrimaryPage(false), m_pages(0) {}
     ~GlyphMap() { if (m_pages) { deleteAllValues(*m_pages); delete m_pages; } }
 
     GlyphData glyphDataForCharacter(UChar32, const FontData*);
     void setGlyphDataForCharacter(UChar32, Glyph, const FontData*);
-    
+
 private:
     struct GlyphPage {
-        GlyphData m_glyphs[cGlyphPageSize];
+        static const size_t size = 256; // Covers Latin-1 in a single page.
+        GlyphData m_glyphs[size];
 
-        const GlyphData& glyphDataForCharacter(UChar32 c) const { return m_glyphs[c % cGlyphPageSize]; }
+        const GlyphData& glyphDataForCharacter(UChar32 c) const { return m_glyphs[c % size]; }
         void setGlyphDataForCharacter(UChar32 c, Glyph g, const FontData* f)
         {
-            setGlyphDataForIndex(c % cGlyphPageSize, g, f);
+            setGlyphDataForIndex(c % size, g, f);
         }
-        
-        void setGlyphDataForIndex(unsigned index, Glyph g, const FontData* f) {
+        void setGlyphDataForIndex(unsigned index, Glyph g, const FontData* f)
+        {
             m_glyphs[index].glyph = g;
             m_glyphs[index].fontData = f;
         }
     };
-    
+
     GlyphPage* locatePage(unsigned page, const FontData* fontData);
     bool fillPage(GlyphPage*, UChar* characterBuffer, unsigned bufferLength, const FontData* fontData);
-    
+
     bool m_filledPrimaryPage;
-    GlyphPage m_primaryPage; // We optimize for the page that contains Latin1.
+    GlyphPage m_primaryPage; // We optimize for the page that contains Latin-1.
     HashMap<int, GlyphPage*>* m_pages;
 };
 
 }
+
 #endif
index 013ffc4..6e8d68d 100644 (file)
@@ -34,7 +34,7 @@ namespace WebCore
 
 float GlyphWidthMap::widthForGlyph(Glyph g)
 {
-    unsigned pageNumber = (g / cGlyphWidthPageSize);
+    unsigned pageNumber = (g / GlyphWidthPage::size);
     GlyphWidthPage* page = locatePage(pageNumber);
     if (page)
         return page->widthForGlyph(g);
@@ -43,7 +43,7 @@ float GlyphWidthMap::widthForGlyph(Glyph g)
 
 void GlyphWidthMap::setWidthForGlyph(Glyph glyph, float width)
 {
-    unsigned pageNumber = (glyph / cGlyphWidthPageSize);
+    unsigned pageNumber = (glyph / GlyphWidthPage::size);
     GlyphWidthPage* page = locatePage(pageNumber);
     if (page)
         page->setWidthForGlyph(glyph, width);
@@ -70,7 +70,7 @@ inline GlyphWidthMap::GlyphWidthPage* GlyphWidthMap::locatePage(unsigned pageNum
     }
 
     // Fill in the whole page with the unknown glyph width value.
-    for (unsigned i = 0; i < cGlyphWidthPageSize; i++)
+    for (unsigned i = 0; i < GlyphWidthPage::size; i++)
         page->setWidthForIndex(i, cGlyphWidthUnknown);
 
     return page;
index 4529247..afe0928 100644 (file)
 #define GLYPH_WIDTH_MAP_H
 
 #include <unicode/umachine.h>
-#include "GlyphBuffer.h"
 #include <wtf/Noncopyable.h>
 #include <wtf/HashMap.h>
 
 namespace WebCore {
 
-// Covers Latin-1.
-const unsigned cGlyphWidthPageSize = 256;
-const float cGlyphWidthUnknown = -1;
+typedef unsigned short Glyph;
 
-class FontData;
+const float cGlyphWidthUnknown = -1;
 
-class GlyphWidthMap : Noncopyable
-{
+class GlyphWidthMap : Noncopyable {
 public:
     GlyphWidthMap() : m_filledPrimaryPage(false), m_pages(0) {}
     ~GlyphWidthMap() { if (m_pages) { deleteAllValues(*m_pages); delete m_pages; } }
 
-    float widthForGlyph(Glyph g);
-    void setWidthForGlyph(Glyph g, float f);
+    float widthForGlyph(Glyph);
+    void setWidthForGlyph(Glyph, float);
 
 private:
     struct GlyphWidthPage {
-        float m_widths[cGlyphWidthPageSize];
+        static const size_t size = 256; // Usually covers Latin-1 in a single page.
+        float m_widths[size];
 
-        float widthForGlyph(Glyph g) const { return m_widths[g % cGlyphWidthPageSize]; }
-        void setWidthForGlyph(Glyph g, float f)
+        float widthForGlyph(Glyph g) const { return m_widths[g % size]; }
+        void setWidthForGlyph(Glyph g, float w)
         {
-            setWidthForIndex(g % cGlyphWidthPageSize, f);
+            setWidthForIndex(g % size, w);
         }
-        
-        void setWidthForIndex(unsigned index, float f) {
-            m_widths[index] = f;
+        void setWidthForIndex(unsigned index, float w)
+        {
+            m_widths[index] = w;
         }
     };
     
index 8a8ca86..104dfcf 100644 (file)
@@ -27,6 +27,7 @@
 #include "GraphicsContext.h"
 
 #include "Font.h"
+#include "TextStyle.h"
 
 using namespace std;
 
@@ -179,6 +180,11 @@ void GraphicsContext::drawImage(Image* image, const IntRect& dest, const IntRect
     drawImage(image, FloatRect(dest), srcRect, op);
 }
 
+void GraphicsContext::drawText(const TextRun& run, const IntPoint& point)
+{
+    drawText(run, point, TextStyle());
+}
+
 void GraphicsContext::drawText(const TextRun& run, const IntPoint& point, const TextStyle& style)
 {
     if (paintingDisabled())
index 605cbc5..50509ff 100644 (file)
@@ -27,7 +27,6 @@
 #define GraphicsContext_h
 
 #include "FloatRect.h"
-#include "Font.h"
 #include "Image.h"
 #include "IntRect.h"
 #include "Pen.h"
@@ -62,6 +61,8 @@ namespace WebCore {
     class GraphicsContextPrivate;
     class GraphicsContextPlatformPrivate;
     class Path;
+    class TextRun;
+    class TextStyle;
 
 #ifdef SVG_SUPPORT
     class KRenderingDeviceContext;
@@ -119,7 +120,8 @@ namespace WebCore {
         void setFocusRingClip(const IntRect&);
         void clearFocusRingClip();
 
-        void drawText(const TextRun&, const IntPoint&, const TextStyle& = TextStyle());
+        void drawText(const TextRun&, const IntPoint&);
+        void drawText(const TextRun&, const IntPoint&, const TextStyle&);
         void drawHighlightForText(const TextRun&, const IntPoint&, int h, const TextStyle&, const Color& backgroundColor);
 
         FloatRect roundToDevicePixels(const FloatRect&);
index ff8a927..0d1a3d0 100644 (file)
@@ -58,7 +58,6 @@ class FloatPoint;
 class FloatRect;
 class GraphicsContext;
 class IntRect;
-class IntSize;
 class PDFDocumentImage;
 class String;
 
index 4cf1b0e..a8e252f 100644 (file)
@@ -29,6 +29,7 @@
 #include "PlatformString.h"
 #include "TextCodecLatin1.h"
 #include "TextCodecUTF16.h"
+#include <ctype.h>
 #include <wtf/Assertions.h>
 #include <wtf/HashMap.h>
 
@@ -38,9 +39,6 @@
 #if PLATFORM(MAC)
 #include "StreamingTextDecoderMac.h"
 #endif
-#if PLATFORM(WIN)
-#include <ctype.h>
-#endif
 
 namespace WebCore {
 
diff --git a/WebCore/platform/TextStyle.h b/WebCore/platform/TextStyle.h
new file mode 100644 (file)
index 0000000..1dfff92
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef TextStyle_h
+#define TextStyle_h
+
+namespace WebCore {
+
+class TextStyle {
+public:
+    TextStyle(int tabWidth = 0, int xpos = 0, int padding = 0, bool rtl = false, bool directionalOverride = false,
+              bool applyRunRounding = true, bool applyWordRounding = true, bool attemptFontSubstitution = true)
+        : m_tabWidth(tabWidth)
+        , m_xpos(xpos)
+        , m_padding(padding)
+        , m_rtl(rtl)
+        , m_directionalOverride(directionalOverride)
+        , m_applyRunRounding(applyRunRounding)
+        , m_applyWordRounding(applyWordRounding)
+        , m_attemptFontSubstitution(attemptFontSubstitution)
+    {
+    }
+
+    int tabWidth() const { return m_tabWidth; }
+    int xPos() const { return m_xpos; }
+    int padding() const { return m_padding; }
+    bool rtl() const { return m_rtl; }
+    bool ltr() const { return !m_rtl; }
+    bool directionalOverride() const { return m_directionalOverride; }
+    bool applyRunRounding() const { return m_applyRunRounding; }
+    bool applyWordRounding() const { return m_applyWordRounding; }
+    bool attemptFontSubstitution() const { return m_attemptFontSubstitution; }
+
+    void disableRoundingHacks() { m_applyRunRounding = m_applyWordRounding = false; }
+    void setRTL(bool b) { m_rtl = b; }
+    
+private:
+    int m_tabWidth;
+    int m_xpos;
+    int m_padding;
+    bool m_rtl;
+    bool m_directionalOverride;
+    bool m_applyRunRounding;
+    bool m_applyWordRounding;
+    bool m_attemptFontSubstitution;
+};
+
+}
+
+#endif
index 1a85bf5..84e7811 100644 (file)
 
 #if PLATFORM(CG)
 
-#include <ApplicationServices/ApplicationServices.h>
 #include "FloatRect.h"
 #include "GraphicsContext.h"
 #include "PDFDocumentImage.h"
 #include "PlatformString.h"
+#include <ApplicationServices/ApplicationServices.h>
+
 #if PLATFORM(MAC)
 #include "WebCoreSystemInterface.h"
 #endif
index d922c21..e3adf94 100644 (file)
@@ -30,6 +30,7 @@
 #import "FontCache.h"
 
 #import "Font.h"
+#import "FontData.h"
 #import "FontPlatformData.h"
 #import "ListBox.h"
 #import "WebCoreStringTruncator.h"
@@ -120,7 +121,7 @@ void FontCache::platformInit()
 
 const FontData* FontCache::getFontDataForCharacters(const Font& font, const UChar* characters, int length)
 {
-    NSFont* nsFont = font.getNSFont();
+    NSFont* nsFont = font.primaryFont()->getNSFont();
     NSString *string = [[NSString alloc] initWithCharactersNoCopy:(UniChar*)characters length:length freeWhenDone:NO];
     NSFont* substituteFont = wkGetFontInLanguageForRange(nsFont, string, NSMakeRange(0, [string length]));
     if (!substituteFont && [string length] == 1)
index cdbb434..cea0151 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2005, 2006 Apple Computer, Inc.  All rights reserved.
  * Copyright (C) 2006 Alexey Proskuryakov
  *
  * Redistribution and use in source and binary forms, with or without
  */
 
 #import "config.h"
-#import "Font.h"
 #import "FontData.h"
-#import "Color.h"
-
-#import <wtf/Assertions.h>
-
-#import <ApplicationServices/ApplicationServices.h>
-
-#import "FontCache.h"
-
-#import "WebCoreSystemInterface.h"
 
+#import "Color.h"
 #import "FloatRect.h"
+#import "Font.h"
+#import "FontCache.h"
 #import "FontDescription.h"
-
+#import "WebCoreSystemInterface.h"
+#import <ApplicationServices/ApplicationServices.h>
 #import <float.h>
-
 #import <unicode/uchar.h>
-
-// FIXME: Just temporary for the #defines of constants that we will eventually stop using.
-#import "GlyphBuffer.h"
+#import <wtf/Assertions.h>
 
 @interface NSFont (WebAppKitSecretAPI)
 - (BOOL)_isFakeFixedPitch;
 @end
 
-namespace WebCore
-{
-
-#define SMALLCAPS_FONTSIZE_MULTIPLIER 0.7f
-#define SPACE 0x0020
-#define CONTEXT_DPI (72.0)
-#define SCALE_EM_TO_UNITS(X, U_PER_EM) (X * ((1.0 * CONTEXT_DPI) / (CONTEXT_DPI * U_PER_EM)))
+namespace WebCore {
+  
+const float smallCapsFontSizeMultiplier = 0.7f;
+const float contextDPI = 72.0f;
+static inline float scaleEmToUnits(float x, unsigned unitsPerEm) { return x * (contextDPI / (contextDPI * unitsPerEm)); }
 
 bool initFontData(FontData* fontData)
 {
@@ -171,9 +160,9 @@ void FontData::platformInit()
     unsigned unitsPerEm;
     wkGetFontMetrics(m_font.font, &iAscent, &iDescent, &iLineGap, &unitsPerEm); 
     float pointSize = [m_font.font pointSize];
-    float fAscent = SCALE_EM_TO_UNITS(iAscent, unitsPerEm) * pointSize;
-    float fDescent = -SCALE_EM_TO_UNITS(iDescent, unitsPerEm) * pointSize;
-    float fLineGap = SCALE_EM_TO_UNITS(iLineGap, unitsPerEm) * pointSize;
+    float fAscent = scaleEmToUnits(iAscent, unitsPerEm) * pointSize;
+    float fDescent = -scaleEmToUnits(iDescent, unitsPerEm) * pointSize;
+    float fLineGap = scaleEmToUnits(iLineGap, unitsPerEm) * pointSize;
 
     // We need to adjust Times, Helvetica, and Courier to closely match the
     // vertical metrics of their Microsoft counterparts that are the de facto
@@ -220,7 +209,7 @@ FontData* FontData::smallCapsFontData(const FontDescription& fontDescription) co
 {
     if (!m_smallCapsFontData) {
         NS_DURING
-            float size = [m_font.font pointSize] * SMALLCAPS_FONTSIZE_MULTIPLIER;
+            float size = [m_font.font pointSize] * smallCapsFontSizeMultiplier;
             FontPlatformData smallCapsFont([[NSFontManager sharedFontManager] convertFont:m_font.font toSize:size]);
             
             // AppKit resets the type information (screen/printer) when you convert a font to a different size.
index 39bc24b..6bc3692 100644 (file)
 #import "config.h"
 #import "Font.h"
 
-#import "Logging.h"
 #import "BlockExceptions.h"
-#import "FoundationExtras.h"
-
+#import "FontData.h"
 #import "FontFallbackList.h"
+#import "FoundationExtras.h"
+#import "GlyphBuffer.h"
 #import "GraphicsContext.h"
-#import "Settings.h"
-
-#import "FontData.h"
-
 #import "IntRect.h"
-
+#import "Logging.h"
+#import "Settings.h"
+#import "TextStyle.h"
 #import "WebCoreSystemInterface.h"
 #import "WebCoreTextRenderer.h"
 
index d27612f..ea16011 100644 (file)
@@ -31,6 +31,7 @@
 
 #include "FontData.h"
 #include "WebCoreSystemInterface.h"
+#include <ApplicationServices/ApplicationServices.h>
 
 namespace WebCore {
 
@@ -39,7 +40,7 @@ bool GlyphMap::fillPage(GlyphPage* page, UChar* buffer, unsigned bufferLength, c
     // Use an array of long so we get good enough alignment.
     long glyphVector[(GLYPH_VECTOR_SIZE + sizeof(long) - 1) / sizeof(long)];
     
-    OSStatus status = wkInitializeGlyphVector(cGlyphPageSize, &glyphVector);
+    OSStatus status = wkInitializeGlyphVector(GlyphPage::size, &glyphVector);
     if (status != noErr)
         // This should never happen, perhaps indicates a bad font!  If it does the
         // font substitution code will find an alternate font.
@@ -48,7 +49,7 @@ bool GlyphMap::fillPage(GlyphPage* page, UChar* buffer, unsigned bufferLength, c
     wkConvertCharToGlyphs(fontData->m_styleGroup, buffer, bufferLength, &glyphVector);
 
     unsigned numGlyphs = wkGetGlyphVectorNumGlyphs(&glyphVector);
-    if (numGlyphs != cGlyphPageSize) {
+    if (numGlyphs != GlyphPage::size) {
         // This should never happen, perhaps indicates a bad font?
         // If it does happen, the font substitution code will find an alternate font.
         wkClearGlyphVector(&glyphVector);
@@ -56,7 +57,7 @@ bool GlyphMap::fillPage(GlyphPage* page, UChar* buffer, unsigned bufferLength, c
     }
 
     ATSLayoutRecord* glyphRecord = (ATSLayoutRecord*)wkGetGlyphVectorFirstRecord(glyphVector);
-    for (unsigned i = 0; i < cGlyphPageSize; i++) {
+    for (unsigned i = 0; i < GlyphPage::size; i++) {
         page->setGlyphDataForIndex(i, glyphRecord->glyphID, fontData);
         glyphRecord = (ATSLayoutRecord *)((char *)glyphRecord + wkGetGlyphVectorRecordSize(glyphVector));
     }
index 5e7b194..cd9af5a 100644 (file)
 #import "ListBox.h"
 
 #import "BlockExceptions.h"
-#import "FrameMac.h"
-#import "WebCoreFrameBridge.h"
 #import "FontData.h"
+#import "FrameMac.h"
+#import "GraphicsContext.h"
 #import "RenderView.h"
 #import "RenderWidget.h"
+#import "TextStyle.h"
+#import "WebCoreFrameBridge.h"
 #import "WebCoreWidgetHolder.h"
 #import "WidgetClient.h"
 #import <wtf/Assertions.h>
 
-#import "GraphicsContext.h"
-
 using namespace WebCore;
 
 const int minLines = 4; /* ensures we have a scroll bar */
@@ -740,7 +740,7 @@ static Boolean ListBoxTypeSelectCallback(UInt32 index, void *listDataPtr, void *
 
 - (void)fontChanged
 {
-    NSFont *font = _box->font().getNSFont();
+    NSFont *font = _box->font().primaryFont()->getNSFont();
     isSystemFont = [[font fontName] isEqualToString:[itemFont() fontName]] && [font pointSize] == [itemFont() pointSize];
     [self setRowHeight:ceilf([font ascender] - [font descender] + bottomMargin)];
     [self setNeedsDisplay:YES];
index 3818225..0df9556 100644 (file)
 #import "PopUpButton.h"
 
 #import "BlockExceptions.h"
+#import "Font.h"
+#import "FontData.h"
 #import "FoundationExtras.h"
 #import "FrameMac.h"
-#import "TextField.h"
-#import "WebCoreFrameBridge.h"
-#import "FontData.h"
 #import "RenderView.h"
 #import "RenderWidget.h"
+#import "TextField.h"
+#import "TextStyle.h"
+#import "WebCoreFrameBridge.h"
 #import "WebCoreWidgetHolder.h"
 #import "WidgetClient.h"
-#import "Font.h"
 
 using namespace WebCore;
 
index bd93cfc..cffbed8 100644 (file)
@@ -80,7 +80,7 @@ bool ResourceLoader::start(DocLoader* docLoader)
     if (!headerString.isEmpty())
         headerDict = [NSDictionary _webcore_dictionaryWithHeaderString:headerString];
 
-    if (postData().count() > 0)
+    if (!postData().elements().isEmpty())
         handle = [bridge startLoadingResource:resourceLoader withMethod:method() URL:url().getNSURL() customHeaders:headerDict postData:arrayFromFormData(postData())];
     else
         handle = [bridge startLoadingResource:resourceLoader withMethod:method() URL:url().getNSURL() customHeaders:headerDict];
index cfa9107..3d96208 100644 (file)
 #import "config.h"
 #import "TextField.h"
 
-#import "Color.h"
-#import "IntSize.h"
 #import "BlockExceptions.h"
+#import "Color.h"
 #import "Font.h"
-#import "Logging.h"
-#import "WebCoreTextField.h"
-#import "WebCoreFrameBridge.h"
 #import "FontData.h"
+#import "IntSize.h"
+#import "Logging.h"
 #import "RenderView.h"
 #import "RenderWidget.h"
+#import "TextStyle.h"
+#import "WebCoreFrameBridge.h"
+#import "WebCoreTextField.h"
 #import "WebCoreViewFactory.h"
 #import "WidgetClient.h"
 
@@ -104,7 +105,7 @@ void TextField::setFont(const Font &font)
     else {
         NSTextField *textField = (NSTextField *)getView();
         BEGIN_BLOCK_OBJC_EXCEPTIONS;
-        [textField setFont:font.getNSFont()];
+        [textField setFont:font.primaryFont()->getNSFont()];
         END_BLOCK_OBJC_EXCEPTIONS;
     }
 }
index c952620..6123f58 100644 (file)
 #ifndef WebCoreSystemInterface_h
 #define WebCoreSystemInterface_h
 
-typedef signed char BOOL;
+#include <ApplicationServices/ApplicationServices.h>
+#include <objc/objc.h>
 
-#ifndef CGGEOMETRY_H_
-typedef struct CGRect CGRect;
-#endif
+typedef struct _NSRange NSRange;
 
 #ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+typedef struct CGPoint NSPoint;
 typedef struct CGRect NSRect;
 #else
+typedef struct _NSPoint NSPoint;
 typedef struct _NSRect NSRect;
 #endif
 
-#ifndef CGGEOMETRY_H_
-typedef struct CGPoint CGPoint;
-#endif
-
-#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
-typedef struct CGPoint NSPoint;
+#ifdef __OBJC__
+@class NSFont;
 #else
-typedef struct _NSPoint NSPoint;
-#endif
-
-typedef struct _NSRange NSRange;
-
-#ifndef __OBJC__
-class NSImage;
-class NSMenu;
-class NSString;
-class NSView;
-class NSURLConnection;
+typedef struct NSFont NSFont;
+typedef struct NSImage NSImage;
+typedef struct NSMenu NSMenu;
+typedef struct NSString NSString;
+typedef struct NSURLConnection NSURLConnection;
+typedef struct NSView NSView;
+typedef struct objc_object *id;
 #endif
 
 #ifdef __cplusplus
@@ -68,7 +61,17 @@ extern "C" {
 
 extern BOOL (*wkCGContextGetShouldSmoothFonts)(CGContextRef);
 extern void (*wkClearGlyphVector)(void* glyphs);
+extern CFReadStreamRef (*wkCreateCustomCFReadStream)(void *(*formCreate)(CFReadStreamRef, void *), 
+    void (*formFinalize)(CFReadStreamRef, void *), 
+    Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *), 
+    CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *), 
+    Boolean (*formCanRead)(CFReadStreamRef, void *), 
+    void (*formClose)(CFReadStreamRef, void *), 
+    void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *), 
+    void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
+    void *context);
 extern OSStatus (*wkConvertCharToGlyphs)(void* styleGroup, const UniChar*, unsigned numCharacters, void* glyphs);
+extern id (*wkCreateNSURLConnectionDelegateProxy)(void);
 extern void (*wkDrawBezeledTextFieldCell)(NSRect, BOOL enabled);
 extern void (*wkDrawBezeledTextArea)(NSRect, BOOL enabled);
 extern void (*wkDrawFocusRing)(CGContextRef, CGRect clipRect, CGColorRef, int radius);
@@ -91,22 +94,12 @@ extern void (*wkPopupMenu)(NSMenu*, NSPoint location, float width, NSView*, int
 extern void (*wkReleaseStyleGroup)(void* group);
 extern void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*);
 extern void (*wkSetDragImage)(NSImage*, NSPoint offset);
-extern void (*wkSetPatternPhaseInUserSpace)(CGContextRef, CGPoint point);
+extern void (*wkSetNSURLConnectionDefersCallbacks)(NSURLConnection *, BOOL);
+extern void (*wkSetPatternPhaseInUserSpace)(CGContextRef, CGPoint);
 extern void (*wkSetUpFontCache)(size_t);
 extern void (*wkSignalCFReadStreamEnd)(CFReadStreamRef stream);
-extern void (*wkSignalCFReadStreamHasBytes)(CFReadStreamRef stream);
 extern void (*wkSignalCFReadStreamError)(CFReadStreamRef stream, CFStreamError *error);
-extern CFReadStreamRef (*wkCreateCustomCFReadStream)(void *(*formCreate)(CFReadStreamRef, void *), 
-    void (*formFinalize)(CFReadStreamRef, void *), 
-    Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *), 
-    CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *), 
-    Boolean (*formCanRead)(CFReadStreamRef, void *), 
-    void (*formClose)(CFReadStreamRef, void *), 
-    void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *), 
-    void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
-    void *context);
-extern void (*wkSetNSURLConnectionDefersCallbacks)(NSURLConnection *, BOOL);
-extern id (*wkCreateNSURLConnectionDelegateProxy)(void);
+extern void (*wkSignalCFReadStreamHasBytes)(CFReadStreamRef stream);
 
 #ifdef __cplusplus
 }
index 90e79e7..acccc1c 100644 (file)
 
 #import "Font.h"
 #import "FontData.h"
-#import "WebFontCache.h"
-#import "IntPoint.h"
 #import "GraphicsContext.h"
+#import "IntPoint.h"
+#import "TextStyle.h"
+#import "WebFontCache.h"
 
 using namespace WebCore;
 
index 94c8198..fc52a51 100644 (file)
@@ -24,6 +24,7 @@
 #include "EllipsisBox.h"
 
 #include "GraphicsContext.h"
+#include "TextStyle.h"
 
 namespace WebCore {
 
index 6cb6c2f..9d6bc44 100644 (file)
 #include "Document.h"
 #include "Frame.h"
 #include "GraphicsContext.h"
-#include "RenderBlock.h"
-#include "break_lines.h"
 #include "Range.h"
 #include "RenderArena.h"
+#include "RenderBlock.h"
+#include "TextStyle.h"
+#include "break_lines.h"
 #include <wtf/AlwaysInline.h>
 
 #if PLATFORM(MAC)
@@ -286,11 +287,12 @@ void InlineTextBox::paint(RenderObject::PaintInfo& i, int tx, int ty)
     // 2. Now paint the foreground, including text and decorations like underline/overline (in quirks mode only).
     if (m_len <= 0) return;
     
-    DeprecatedValueList<MarkedTextUnderline> underlines;
+    const Vector<MarkedTextUnderline>* underlines = 0;
+    size_t numUnderlines = 0;
     if (haveMarkedText && markedTextUsesUnderlines) {
-        underlines = object()->document()->frame()->markedTextUnderlines();
+        underlines = &object()->document()->frame()->markedTextUnderlines();
+        numUnderlines = underlines->size();
     }
-    DeprecatedValueListIterator<MarkedTextUnderline> underlineIt = underlines.begin();
 
     Color textColor;
     
@@ -390,8 +392,8 @@ void InlineTextBox::paint(RenderObject::PaintInfo& i, int tx, int ty)
     if (i.phase != PaintPhaseSelection) {
         paintAllMarkersOfType(i.p, tx, ty, DocumentMarker::Spelling, styleToUse, font);
 
-        for ( ; underlineIt != underlines.end(); underlineIt++) {
-            MarkedTextUnderline underline = *underlineIt;
+        for (size_t index = 0; index < numUnderlines; ++index) {
+            const MarkedTextUnderline& underline = (*underlines)[index];
 
             if (underline.endOffset <= start())
                 // underline is completely before this run.  This might be an underline that sits
@@ -647,7 +649,7 @@ void InlineTextBox::paintAllMarkersOfType(GraphicsContext* pt, int _tx, int _ty,
 }
 
 
-void InlineTextBox::paintMarkedTextUnderline(GraphicsContext* pt, int _tx, int _ty, MarkedTextUnderline& underline)
+void InlineTextBox::paintMarkedTextUnderline(GraphicsContext* pt, int _tx, int _ty, const MarkedTextUnderline& underline)
 {
     _tx += m_x;
     _ty += m_y;
index e9a5563..ef25f6c 100644 (file)
@@ -112,7 +112,7 @@ public:
     void paintAllMarkersOfType(GraphicsContext*, int tx, int ty, DocumentMarker::MarkerType, RenderStyle*, const Font*);
     void paintSpellingMarker(GraphicsContext*, int tx, int ty, DocumentMarker);
     void paintTextMatchMarker(GraphicsContext*, int tx, int ty, DocumentMarker, RenderStyle*, const Font*);
-    void paintMarkedTextUnderline(GraphicsContext*, int tx, int ty, MarkedTextUnderline&);
+    void paintMarkedTextUnderline(GraphicsContext*, int tx, int ty, const MarkedTextUnderline&);
 #if PLATFORM(MAC)
     void paintCustomHighlight(int tx, int ty, const AtomicString& type);
 #endif
index fd65c22..8f66937 100644 (file)
@@ -581,29 +581,25 @@ VisiblePosition RenderContainer::positionForCoordinates(int x, int y)
     return VisiblePosition(element(), 0, DOWNSTREAM);
 }
 
-DeprecatedValueList<IntRect> RenderContainer::lineBoxRects()
+void RenderContainer::lineBoxRects(Vector<IntRect>& rects)
 {
     if (!firstChild() && (isInline() || isAnonymousBlock())) {
-        DeprecatedValueList<IntRect> rects;
-        int x = 0, y = 0;
+        int x, y;
         absolutePositionForContent(x, y);
         absoluteRects(rects, x, y);
-        return rects;
+        return;
     }
 
     if (!firstChild())
-        return DeprecatedValueList<IntRect>();
+        return;
 
-    DeprecatedValueList<IntRect> rects;
     for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
         if (child->isText() || child->isInline() || child->isAnonymousBlock()) {
-            int x = 0, y = 0;
+            int x, y;
             child->absolutePositionForContent(x, y);
             child->absoluteRects(rects, x, y);
         }
     }
-
-    return rects;
 }
 
 #undef DEBUG_LAYOUT
index 48c8203..c2e01cd 100644 (file)
@@ -63,11 +63,11 @@ public:
 
     virtual VisiblePosition positionForCoordinates(int x, int y);
     
-    virtual DeprecatedValueList<IntRect> lineBoxRects();
+    virtual void lineBoxRects(Vector<IntRect>&);
 
 protected:
-    void setFirstChild(RenderObject *first) { m_first = first; }
-    void setLastChild(RenderObject *last) { m_last = last; }
+    void setFirstChild(RenderObjectfirst) { m_first = first; }
+    void setLastChild(RenderObjectlast) { m_last = last; }
 
 protected:
     RenderObject *m_first;
index 44ded12..927bae5 100644 (file)
@@ -253,19 +253,19 @@ void RenderInline::paint(PaintInfo& i, int _tx, int _ty)
     paintLines(i, _tx, _ty);
 }
 
-void RenderInline::absoluteRects(DeprecatedValueList<IntRect>& rects, int _tx, int _ty)
+void RenderInline::absoluteRects(Vector<IntRect>& rects, int tx, int ty)
 {
     for (InlineRunBox* curr = firstLineBox(); curr; curr = curr->nextLineBox())
-        rects.append(IntRect(_tx + curr->xPos(), _ty + curr->yPos(), curr->width(), curr->height()));
+        rects.append(IntRect(tx + curr->xPos(), ty + curr->yPos(), curr->width(), curr->height()));
     
     for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling())
         if (!curr->isText())
-            curr->absoluteRects(rects, _tx + curr->xPos(), _ty + curr->yPos());
+            curr->absoluteRects(rects, tx + curr->xPos(), ty + curr->yPos());
     
     if (continuation())
         continuation()->absoluteRects(rects, 
-                                      _tx - containingBlock()->xPos() + continuation()->xPos(),
-                                      _ty - containingBlock()->yPos() + continuation()->yPos());
+                                      tx - containingBlock()->xPos() + continuation()->xPos(),
+                                      ty - containingBlock()->yPos() + continuation()->yPos());
 }
 
 void RenderInline::calcMinMaxWidth()
index 3fc7c24..a675830 100644 (file)
@@ -75,7 +75,7 @@ public:
     virtual int offsetLeft() const;
     virtual int offsetTop() const;
 
-    void absoluteRects(DeprecatedValueList<IntRect>& rects, int _tx, int _ty);
+    void absoluteRects(Vector<IntRect>&, int tx, int ty);
 
     virtual VisiblePosition positionForCoordinates(int x, int y);
     
index 712996f..4f00f17 100644 (file)
@@ -32,6 +32,7 @@
 #include "RenderPopupMenu.h"
 #include "RenderText.h"
 #include "RenderTheme.h"
+#include "TextStyle.h"
 #include <math.h>
 
 using namespace std;
index 41e1582..2fb2c57 100644 (file)
@@ -1546,41 +1546,40 @@ void RenderObject::paintBorder(GraphicsContext* p, int _tx, int _ty, int w, int
         p->restore(); // Undo the clip.
 }
 
-DeprecatedValueList<IntRect> RenderObject::lineBoxRects()
+void RenderObject::lineBoxRects(Vector<IntRect>&)
 {
-    return DeprecatedValueList<IntRect>();
 }
 
-void RenderObject::absoluteRects(DeprecatedValueList<IntRect>& rects, int _tx, int _ty)
+void RenderObject::absoluteRects(Vector<IntRect>& rects, int tx, int ty)
 {
     // For blocks inside inlines, we go ahead and include margins so that we run right up to the
     // inline boxes above and below us (thus getting merged with them to form a single irregular
     // shape).
     if (continuation()) {
-        rects.append(IntRect(_tx, _ty - collapsedMarginTop(), 
+        rects.append(IntRect(tx, ty - collapsedMarginTop(), 
                            width(), height()+collapsedMarginTop()+collapsedMarginBottom()));
         continuation()->absoluteRects(rects, 
-                                      _tx - xPos() + continuation()->containingBlock()->xPos(),
-                                      _ty - yPos() + continuation()->containingBlock()->yPos());
+                                      tx - xPos() + continuation()->containingBlock()->xPos(),
+                                      ty - yPos() + continuation()->containingBlock()->yPos());
     }
     else
-        rects.append(IntRect(_tx, _ty, width(), height() + borderTopExtra() + borderBottomExtra()));
+        rects.append(IntRect(tx, ty, width(), height() + borderTopExtra() + borderBottomExtra()));
 }
 
 IntRect RenderObject::absoluteBoundingBoxRect()
 {
-    int x = 0, y = 0;
+    int x, y;
     absolutePosition(x, y);
-    DeprecatedValueList<IntRect> rects;
+    Vector<IntRect> rects;
     absoluteRects(rects, x, y);
 
-    if (rects.isEmpty())
+    size_t n = rects.size();
+    if (!n)
         return IntRect();
 
-    DeprecatedValueList<IntRect>::ConstIterator it = rects.begin();
-    IntRect result = *it;
-    while (++it != rects.end())
-        result.unite(*it);
+    IntRect result = rects[0];
+    for (size_t i = 1; i < n; ++i)
+        result.unite(rects[i]);
     return result;
 }
 
@@ -2743,71 +2742,63 @@ void RenderObject::updateWidgetPosition()
 {
 }
 
-DeprecatedValueList<DashboardRegionValue> RenderObject::computeDashboardRegions()
-{
-    DeprecatedValueList<DashboardRegionValue> regions;
-    collectDashboardRegions(regions);
-    return regions;
-}
-
-void RenderObject::addDashboardRegions (DeprecatedValueList<DashboardRegionValue>& regions)
+void RenderObject::addDashboardRegions(Vector<DashboardRegionValue>& regions)
 {
     // Convert the style regions to absolute coordinates.
     if (style()->visibility() != VISIBLE) 
         return;
 
-    DeprecatedValueList<StyleDashboardRegion> styleRegions = style()->dashboardRegions();
-    if (styleRegions.count() > 0) {
-        unsigned i, count = styleRegions.count();
-        for (i = 0; i < count; i++){
-            StyleDashboardRegion styleRegion = styleRegions[i];
-            
-            int w = width();
-            int h = height();
-            
-            DashboardRegionValue region;
-            region.label = styleRegion.label;
-            region.bounds = IntRect (
-                styleRegion.offset.left.value(),
-                styleRegion.offset.top.value(),
-                w - styleRegion.offset.left.value() - styleRegion.offset.right.value(),
-                h - styleRegion.offset.top.value() - styleRegion.offset.bottom.value());
-            region.type = styleRegion.type;
-
-            region.clip = region.bounds;
-            computeAbsoluteRepaintRect(region.clip);
-            if (region.clip.height() < 0) {
-                region.clip.setHeight(0);
-                region.clip.setWidth(0);
-            }
+    const Vector<StyleDashboardRegion>& styleRegions = style()->dashboardRegions();
+    unsigned i, count = styleRegions.size();
+    for (i = 0; i < count; i++){
+        StyleDashboardRegion styleRegion = styleRegions[i];
+        
+        int w = width();
+        int h = height();
+        
+        DashboardRegionValue region;
+        region.label = styleRegion.label;
+        region.bounds = IntRect (
+            styleRegion.offset.left.value(),
+            styleRegion.offset.top.value(),
+            w - styleRegion.offset.left.value() - styleRegion.offset.right.value(),
+            h - styleRegion.offset.top.value() - styleRegion.offset.bottom.value());
+        region.type = styleRegion.type;
+
+        region.clip = region.bounds;
+        computeAbsoluteRepaintRect(region.clip);
+        if (region.clip.height() < 0) {
+            region.clip.setHeight(0);
+            region.clip.setWidth(0);
+        }
 
-            int x, y;
-            absolutePosition(x, y);
-            region.bounds.setX(x + styleRegion.offset.left.value());
-            region.bounds.setY(y + styleRegion.offset.top.value());
-            
-            float pageScaleFactor = document()->frame() ? scaleFactor(document()->frame()->page()) : 1.0f;
+        int x, y;
+        absolutePosition(x, y);
+        region.bounds.setX(x + styleRegion.offset.left.value());
+        region.bounds.setY(y + styleRegion.offset.top.value());
+        
+        if (document()->frame()) {
+            float pageScaleFactor = scaleFactor(document()->frame()->page());
             if (pageScaleFactor != 1.0f) {
                 region.bounds.scale(pageScaleFactor);
                 region.clip.scale(pageScaleFactor);
             }
-            
-            regions.append(region);
         }
+        
+        regions.append(region);
     }
 }
 
-void RenderObject::collectDashboardRegions (DeprecatedValueList<DashboardRegionValue>& regions)
+void RenderObject::collectDashboardRegions(Vector<DashboardRegionValue>& regions)
 {
     // RenderTexts don't have their own style, they just use their parent's style,
     // so we don't want to include them.
     if (isText())
         return;
         
-    addDashboardRegions (regions);
-    for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) {
+    addDashboardRegions(regions);
+    for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling())
         curr->collectDashboardRegions(regions);
-    }
 }
 
 
index 8702a3c..4586ab1 100644 (file)
@@ -27,6 +27,7 @@
 #define RenderObject_h
 
 #include "CachedResourceClient.h"
+#include "DeprecatedValueList.h"
 #include "RenderStyle.h"
 #include "ScrollBar.h"
 #include "VisiblePosition.h"
@@ -473,22 +474,13 @@ public:
 
     virtual void updateWidgetPosition();
     
-    DeprecatedValueList<DashboardRegionValue> computeDashboardRegions();
-    void addDashboardRegions (DeprecatedValueList<DashboardRegionValue>& regions);
-    void collectDashboardRegions (DeprecatedValueList<DashboardRegionValue>& regions);
+    void addDashboardRegions(Vector<DashboardRegionValue>&);
+    void collectDashboardRegions(Vector<DashboardRegionValue>&);
 
     // does a query on the rendertree and finds the innernode
     // and overURL for the given position
     // if readonly == false, it will recalc hover styles accordingly
-    class NodeInfo
-    {
-        friend class RenderLayer;
-        friend class RenderImage;
-        friend class RenderText;
-        friend class RenderInline;
-        friend class RenderObject;
-        friend class RenderFrameSet;
-        friend class HTMLAreaElement;
+    class NodeInfo {
     public:
         NodeInfo(bool readonly, bool active, bool mouseMove = false)
             : m_innerNode(0), m_innerNonSharedNode(0), m_innerURLElement(0), m_readonly(readonly), m_active(active), m_mouseMove(mouseMove)
@@ -677,9 +669,9 @@ public:
     virtual int borderLeft() const { return style()->borderLeftWidth(); }
     virtual int borderRight() const { return style()->borderRightWidth(); }
 
-    virtual DeprecatedValueList<IntRect> lineBoxRects();
+    virtual void lineBoxRects(Vector<IntRect>&);
 
-    virtual void absoluteRects(DeprecatedValueList<IntRect>& rects, int tx, int ty);
+    virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
     IntRect absoluteBoundingBoxRect();
     
     // the rect that will be painted if this object is passed as the paintingRoot
@@ -709,7 +701,7 @@ public:
     virtual void setTable(RenderTable*) {};
 
     // Used by collapsed border tables.
-    virtual void collectBorders(DeprecatedValueList<CollapsedBorderValue>& borderStyles);
+    virtual void collectBorders(DeprecatedValueList<CollapsedBorderValue>&);
 
     // Repaint the entire object.  Called when, e.g., the color of a border changes, or when a border
     // style changes.
index c3d1015..6748819 100644 (file)
@@ -22,6 +22,7 @@
 #import "config.h"
 #import "RenderPopupMenuMac.h"
 
+#import "FontData.h"
 #import "FrameMac.h"
 #import "FrameView.h"
 #import "HTMLNames.h"
@@ -81,7 +82,7 @@ void RenderPopupMenuMac::showPopup(const IntRect& r, FrameView* v, int index)
     [popup attachPopUpWithFrame:r inView:view];
     [popup selectItemAtIndex:index];
     
-    NSFont* font = style()->font().getNSFont();
+    NSFont* font = style()->font().primaryFont()->getNSFont();
 
     NSRect titleFrame = [popup titleRectForBounds:r];
     if (titleFrame.size.width <= 0 || titleFrame.size.height <= 0)
@@ -135,7 +136,7 @@ void RenderPopupMenuMac::addGroupLabel(HTMLOptGroupElement* element)
 
     NSMutableDictionary* attributes = [[NSMutableDictionary alloc] init];
     if (s->font() != Font())
-        [attributes setObject:s->font().getNSFont() forKey:NSFontAttributeName];
+        [attributes setObject:s->font().primaryFont()->getNSFont() forKey:NSFontAttributeName];
     // FIXME: Add support for styling the foreground and background colors.
     NSAttributedString* string = [[NSAttributedString alloc] initWithString:text attributes:attributes];
     [attributes release];
@@ -162,7 +163,7 @@ void RenderPopupMenuMac::addOption(HTMLOptionElement* element)
         
     NSMutableDictionary* attributes = [[NSMutableDictionary alloc] init];
     if (s->font() != Font())
-        [attributes setObject:s->font().getNSFont() forKey:NSFontAttributeName];
+        [attributes setObject:s->font().primaryFont()->getNSFont() forKey:NSFontAttributeName];
     // FIXME: Add support for styling the foreground and background colors.
     // FIXME: Find a way to customize text color when an item is highlighted.
     NSAttributedString* string = [[NSAttributedString alloc] initWithString:text attributes:attributes];
index 03f857e..1844072 100644 (file)
@@ -1182,15 +1182,15 @@ bool ShadowData::operator==(const ShadowData& o) const
     return x == o.x && y == o.y && blur == o.blur && color == o.color;
 }
 
-const DeprecatedValueList<StyleDashboardRegion>& RenderStyle::initialDashboardRegions()
+const Vector<StyleDashboardRegion>& RenderStyle::initialDashboardRegions()
 { 
-    static DeprecatedValueList<StyleDashboardRegion> emptyList;
+    static Vector<StyleDashboardRegion> emptyList;
     return emptyList;
 }
 
-const DeprecatedValueList<StyleDashboardRegion>& RenderStyle::noneDashboardRegions()
+const Vector<StyleDashboardRegion>& RenderStyle::noneDashboardRegions()
 { 
-    static DeprecatedValueList<StyleDashboardRegion> noneList;
+    static Vector<StyleDashboardRegion> noneList;
     static bool noneListInitialized = false;
     
     if (!noneListInitialized) {
index 03bf921..cf41c6e 100644 (file)
@@ -42,7 +42,8 @@
 #include "IntRect.h"
 #include "Length.h"
 #include "Shared.h"
-#include "DeprecatedValueList.h"
+#include "TextDirection.h"
+#include <wtf/Vector.h>
 
 #ifdef SVG_SUPPORT
 #include "SVGRenderStyle.h"
@@ -733,7 +734,7 @@ public:
     }
     
     int lineClamp;         // An Apple extension.  Not really CSS3 but not worth making a new struct over.
-    DeprecatedValueList<StyleDashboardRegion> m_dashboardRegions;
+    Vector<StyleDashboardRegion> m_dashboardRegions;
     float opacity;         // Whether or not we're transparent.
     DataRef<StyleFlexibleBoxData> flexibleBox; // Flexible box properties 
     DataRef<StyleMarqueeData> marquee; // Marquee properties
@@ -1386,8 +1387,8 @@ public:
     void setMinHeight(Length v) { SET_VAR(box,min_height,v) }
     void setMaxHeight(Length v) { SET_VAR(box,max_height,v) }
 
-    DeprecatedValueList<StyleDashboardRegion> dashboardRegions() const { return css3NonInheritedData->m_dashboardRegions; }
-    void setDashboardRegions(DeprecatedValueList<StyleDashboardRegion> regions) { SET_VAR(css3NonInheritedData,m_dashboardRegions,regions); }
+    Vector<StyleDashboardRegion> dashboardRegions() const { return css3NonInheritedData->m_dashboardRegions; }
+    void setDashboardRegions(Vector<StyleDashboardRegion> regions) { SET_VAR(css3NonInheritedData,m_dashboardRegions,regions); }
     void setDashboardRegion(int type, const String& label, Length t, Length r, Length b, Length l, bool append) {
         StyleDashboardRegion region;
         region.label = label;
@@ -1715,8 +1716,8 @@ public:
     static int initialLineClamp() { return -1; }
     static bool initialTextSizeAdjust() { return true; }
     static ETextSecurity initialTextSecurity() { return TSNONE; }
-    static const DeprecatedValueList<StyleDashboardRegion>& initialDashboardRegions();
-    static const DeprecatedValueList<StyleDashboardRegion>& noneDashboardRegions();
+    static const Vector<StyleDashboardRegion>& initialDashboardRegions();
+    static const Vector<StyleDashboardRegion>& noneDashboardRegions();
 };
 
 } // namespace WebCore
index fd2468b..0e5be54 100644 (file)
@@ -32,6 +32,7 @@
 #include "Range.h"
 #include "RenderArena.h"
 #include "RenderBlock.h"
+#include "TextStyle.h"
 #include "break_lines.h"
 #include <unicode/ubrk.h>
 #include <wtf/AlwaysInline.h>
@@ -209,22 +210,17 @@ PassRefPtr<StringImpl> RenderText::originalString() const
     return element() ? element()->string() : 0;
 }
 
-void RenderText::absoluteRects(DeprecatedValueList<IntRect>& rects, int _tx, int _ty)
+void RenderText::absoluteRects(Vector<IntRect>& rects, int tx, int ty)
 {
     for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox())
-        rects.append(IntRect(_tx + box->xPos(), 
-                           _ty + box->yPos(), 
-                           box->width(), 
-                           box->height()));
+        rects.append(IntRect(tx + box->xPos(), ty + box->yPos(), box->width(), box->height()));
 }
 
-DeprecatedValueList<IntRect> RenderText::lineBoxRects()
+void RenderText::lineBoxRects(Vector<IntRect>& rects)
 {
-    DeprecatedValueList<IntRect> rects;
-    int x = 0, y = 0;
+    int x, y;
     absolutePositionForContent(x, y);
     absoluteRects(rects, x, y);
-    return rects;
 }
 
 InlineTextBox* RenderText::findNextInlineTextBox(int offset, int &pos) const
index f0a2cfc..64cd6b5 100644 (file)
@@ -70,11 +70,10 @@ public:
     virtual void paint(PaintInfo& i, int tx, int ty) { assert(false); }
     virtual void layout() { assert(false); }
 
-    virtual bool nodeAtPoint(NodeInfo& info, int x, int y, int tx, int ty,
-                             HitTestAction hitTestAction) { assert(false); return false; }
+    virtual bool nodeAtPoint(NodeInfo&, int, int, int, int, HitTestAction) { assert(false); return false; }
 
-    virtual void absoluteRects(DeprecatedValueList<IntRect>& rects, int _tx, int _ty);
-    virtual DeprecatedValueList<IntRect> lineBoxRects();
+    virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
+    virtual void lineBoxRects(Vector<IntRect>&);
 
     virtual VisiblePosition positionForCoordinates(int x, int y);
 
index 0e2e227..f2dec39 100644 (file)
@@ -33,6 +33,7 @@
 #include "RenderTheme.h"
 #include "SelectionController.h"
 #include "TextIterator.h"
+#include "TextStyle.h"
 #include "htmlediting.h"
 #include "visible_units.h"
 #include <math.h>
index 8b080f1..7833aae 100644 (file)
@@ -257,9 +257,9 @@ void RenderView::computeAbsoluteRepaintRect(IntRect& r, bool f)
         r.move(m_frameView->contentsX(), m_frameView->contentsY());
 }
 
-void RenderView::absoluteRects(DeprecatedValueList<IntRect>& rects, int _tx, int _ty)
+void RenderView::absoluteRects(Vector<IntRect>& rects, int tx, int ty)
 {
-    rects.append(IntRect(_tx, _ty, m_layer->width(), m_layer->height()));
+    rects.append(IntRect(tx, ty, m_layer->width(), m_layer->height()));
 }
 
 RenderObject* rendererAfterPosition(RenderObject* object, unsigned offset)
index 965c5ee..5fc128b 100644 (file)
@@ -78,7 +78,7 @@ private:
 public:
     int truncatedAt() const { return m_truncatedAt; }
 
-    virtual void absoluteRects(DeprecatedValueList<IntRect>& rects, int _tx, int _ty);
+    virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
     
     IntRect selectionRect() const;