Changeset 178510 in webkit


Ignore:
Timestamp:
Jan 15, 2015, 6:19:56 AM (11 years ago)
Author:
Antti Koivisto
Message:

Rename Font to FontCascade
https://bugs.webkit.org/show_bug.cgi?id=140442

Reviewed by Darin Adler.

We can then rename SimpleFontData to Font. This will match the usual definition of a "font".

Location:
trunk/Source
Files:
157 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/CMakeLists.txt

    r178481 r178510  
    20502050    platform/graphics/FloatRoundedRect.cpp
    20512051    platform/graphics/FloatSize.cpp
    2052     platform/graphics/Font.cpp
    20532052    platform/graphics/FontCache.cpp
     2053    platform/graphics/FontCascade.cpp
    20542054    platform/graphics/FontDescription.cpp
    20552055    platform/graphics/FontFastPath.cpp
  • trunk/Source/WebCore/ChangeLog

    r178496 r178510  
     12015-01-15  Antti Koivisto  <antti@apple.com>
     2
     3        Rename Font to FontCascade
     4        https://bugs.webkit.org/show_bug.cgi?id=140442
     5
     6        Reviewed by Darin Adler.
     7
     8        We can then rename SimpleFontData to Font. This will match the usual definition of a "font".
     9
    1102015-01-15  Mihnea Ovidenie  <mihnea@adobe.com>
    211
  • trunk/Source/WebCore/WebCore.exp.in

    r178459 r178510  
    137137__ZN7WebCore11FileChooser11chooseFilesERKN3WTF6VectorINS1_6StringELm0ENS1_15CrashOnOverflowEEE
    138138__ZN7WebCore11FileChooserD1Ev
     139__ZN7WebCore11FontCascade11setCodePathENS0_8CodePathE
     140__ZN7WebCore11FontCascade18shouldUseSmoothingEv
     141__ZN7WebCore11FontCascade21setShouldUseSmoothingEb
     142__ZN7WebCore11FontCascade29setDefaultTypesettingFeaturesEj
     143__ZN7WebCore11FontCascadeC1ERKNS_16FontPlatformDataEbNS_17FontSmoothingModeE
     144__ZN7WebCore11FontCascadeC1Ev
     145__ZN7WebCore11FontCascadeaSERKS0_
    139146__ZN7WebCore11FrameLoader11loadArchiveEN3WTF10PassRefPtrINS_7ArchiveEEE
    140147__ZN7WebCore11FrameLoader11shouldCloseEv
     
    657664__ZN7WebCore15ScrollAlignment17alignCenterAlwaysE
    658665__ZN7WebCore15ScrollAlignment19alignToEdgeIfNeededE
    659 __ZN7WebCore15StringTruncator13rightTruncateERKN3WTF6StringEfRKNS_4FontENS0_24EnableRoundingHacksOrNotE
    660 __ZN7WebCore15StringTruncator14centerTruncateERKN3WTF6StringEfRKNS_4FontENS0_24EnableRoundingHacksOrNotE
    661 __ZN7WebCore15StringTruncator5widthERKN3WTF6StringERKNS_4FontENS0_24EnableRoundingHacksOrNotE
     666__ZN7WebCore15StringTruncator13rightTruncateERKN3WTF6StringEfRKNS_11FontCascadeENS0_24EnableRoundingHacksOrNotE
     667__ZN7WebCore15StringTruncator14centerTruncateERKN3WTF6StringEfRKNS_11FontCascadeENS0_24EnableRoundingHacksOrNotE
     668__ZN7WebCore15StringTruncator5widthERKN3WTF6StringERKNS_11FontCascadeENS0_24EnableRoundingHacksOrNotE
    662669__ZN7WebCore15UserInputBridge11loadRequestERKNS_16FrameLoadRequestENS_11InputSourceE
    663670__ZN7WebCore15UserInputBridge11reloadFrameEPNS_5FrameEbNS_11InputSourceE
     
    11281135__ZN7WebCore42URLByTruncatingOneCharacterBeforeComponentEP5NSURL18CFURLComponentType
    11291136__ZN7WebCore47attributedStringByStrippingAttachmentCharactersEP18NSAttributedString
    1130 __ZN7WebCore4Font11setCodePathENS0_8CodePathE
    1131 __ZN7WebCore4Font18shouldUseSmoothingEv
    1132 __ZN7WebCore4Font21setShouldUseSmoothingEb
    1133 __ZN7WebCore4Font29setDefaultTypesettingFeaturesEj
    1134 __ZN7WebCore4FontC1ERKNS_16FontPlatformDataEbNS_17FontSmoothingModeE
    1135 __ZN7WebCore4FontC1Ev
    1136 __ZN7WebCore4FontaSERKS0_
    11371137__ZN7WebCore4Icon18createIconForFilesERKN3WTF6VectorINS1_6StringELm0ENS1_15CrashOnOverflowEEE
    11381138__ZN7WebCore4IconD1Ev
     
    16191619__ZNK7WebCore10TimeRanges5startEjRi
    16201620__ZNK7WebCore10TimeRanges6lengthEv
     1621__ZNK7WebCore11FontCascade5widthERKNS_7TextRunEPN3WTF7HashSetIPKNS_14SimpleFontDataENS4_7PtrHashIS8_EENS4_10HashTraitsIS8_EEEEPNS_13GlyphOverflowE
     1622__ZNK7WebCore11FontCascade8drawTextEPNS_15GraphicsContextERKNS_7TextRunERKNS_10FloatPointEiiNS0_24CustomFontNotReadyActionE
     1623__ZNK7WebCore11FontCascadeeqERKS0_
    16211624__ZNK7WebCore11FrameLoader10isCompleteEv
    16221625__ZNK7WebCore11FrameLoader14cancelledErrorERKNS_15ResourceRequestE
     
    16551658__ZNK7WebCore11RenderLayer19absoluteBoundingBoxEv
    16561659__ZNK7WebCore11RenderLayer24needsCompositedScrollingEv
     1660__ZNK7WebCore11RenderStyle11fontCascadeEv
    16571661__ZNK7WebCore11RenderStyle11fontMetricsEv
    16581662__ZNK7WebCore11RenderStyle15fontDescriptionEv
    16591663__ZNK7WebCore11RenderStyle21visitedDependentColorEi
    1660 __ZNK7WebCore11RenderStyle4fontEv
    16611664__ZNK7WebCore12RenderInline16linesBoundingBoxEv
    16621665__ZNK7WebCore12RenderObject14enclosingLayerEv
     
    19461949__ZNK7WebCore3URL8protocolEv
    19471950__ZNK7WebCore3URLcvP5NSURLEv
    1948 __ZNK7WebCore4Font5widthERKNS_7TextRunEPN3WTF7HashSetIPKNS_14SimpleFontDataENS4_7PtrHashIS8_EENS4_10HashTraitsIS8_EEEEPNS_13GlyphOverflowE
    1949 __ZNK7WebCore4Font8drawTextEPNS_15GraphicsContextERKNS_7TextRunERKNS_10FloatPointEiiNS0_24CustomFontNotReadyActionE
    1950 __ZNK7WebCore4FonteqERKS0_
    19511951__ZNK7WebCore4Node10shadowHostEv
    19521952__ZNK7WebCore4Node11textContentEb
     
    26512651__ZN7WebCore15DatabaseTracker44emptyDatabaseFilesRemovalTaskWillBeScheduledEv
    26522652__ZN7WebCore15DatabaseTracker7trackerEv
    2653 __ZN7WebCore15GraphicsContext12drawBidiTextERKNS_4FontERKNS_7TextRunERKNS_10FloatPointENS1_24CustomFontNotReadyActionEPNS_10BidiStatusEi
    26542653__ZN7WebCore15GraphicsContext15drawLineForTextERKNS_10FloatPointEfbb
    26552654__ZN7WebCore15GraphicsContext22setEmojiDrawingEnabledEb
     
    26582657__ZN7WebCore15LegacyTileCache20setLayerPoolCapacityEj
    26592658__ZN7WebCore15ResourceRequest41updateFromDelegatePreservingOldPropertiesERKS0_
    2660 __ZN7WebCore15StringTruncator12leftTruncateERKN3WTF6StringEfRKNS_4FontENS0_24EnableRoundingHacksOrNotERfbf
    2661 __ZN7WebCore15StringTruncator13rightTruncateERKN3WTF6StringEfRKNS_4FontENS0_24EnableRoundingHacksOrNotERfbf
    2662 __ZN7WebCore15StringTruncator14centerTruncateERKN3WTF6StringEfRKNS_4FontENS0_24EnableRoundingHacksOrNotERfbf
    2663 __ZN7WebCore15StringTruncator15rightClipToWordERKN3WTF6StringEfRKNS_4FontENS0_24EnableRoundingHacksOrNotERfbfb
    2664 __ZN7WebCore15StringTruncator20rightClipToCharacterERKN3WTF6StringEfRKNS_4FontENS0_24EnableRoundingHacksOrNotERfbf
    26652659__ZN7WebCore15isEndOfDocumentERKNS_15VisiblePositionE
    26662660__ZN7WebCore15startOfDocumentEPKNS_4NodeE
     
    27462740__ZN7WebCore35positionOfNextBoundaryOfGranularityERKNS_15VisiblePositionENS_15TextGranularityENS_18SelectionDirectionE
    27472741__ZN7WebCore41initializeHTTPConnectionSettingsOnStartupEv
    2748 __ZN7WebCore4FontC1ERKNS_16FontPlatformDataEN3WTF10PassRefPtrINS_12FontSelectorEEE
    27492742__ZN7WebCore4Icon18createIconForImageEP7CGImage
    27502743__ZN7WebCore4Node17isContentEditableENS0_22UserSelectAllTreatmentE
  • trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj

    r178481 r178510  
    79797979    <ClCompile Include="..\platform\graphics\FloatRoundedRect.cpp" />
    79807980    <ClCompile Include="..\platform\graphics\FloatSize.cpp" />
    7981     <ClCompile Include="..\platform\graphics\Font.cpp" />
    79827981    <ClCompile Include="..\platform\graphics\FontCache.cpp" />
     7982    <ClCompile Include="..\platform\graphics\FontCascade.cpp" />
    79837983    <ClCompile Include="..\platform\graphics\FontDescription.cpp" />
    79847984    <ClCompile Include="..\platform\graphics\FontGenericFamilies.cpp" />
     
    1946819468    <ClInclude Include="..\platform\graphics\FloatSize.h" />
    1946919469    <ClInclude Include="..\platform\graphics\FloatSizeHash.h" />
    19470     <ClInclude Include="..\platform\graphics\Font.h" />
    1947119470    <ClInclude Include="..\platform\graphics\FontCache.h" />
     19471    <ClInclude Include="..\platform\graphics\FontCascade.h" />
    1947219472    <ClInclude Include="..\platform\graphics\FontDescription.h" />
    1947319473    <ClInclude Include="..\platform\graphics\FontGenericFamilies.h" />
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r178481 r178510  
    47054705                B2C3DA4A0D006C1D00EF6F26 /* TextStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C3DA1A0D006C1D00EF6F26 /* TextStream.cpp */; };
    47064706                B2C3DA4B0D006C1D00EF6F26 /* TextStream.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA1B0D006C1D00EF6F26 /* TextStream.h */; settings = {ATTRIBUTES = (Private, ); }; };
    4707                 B2C3DA600D006CD600EF6F26 /* Font.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C3DA4F0D006CD600EF6F26 /* Font.cpp */; };
    4708                 B2C3DA610D006CD600EF6F26 /* Font.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA500D006CD600EF6F26 /* Font.h */; settings = {ATTRIBUTES = (Private, ); }; };
     4707                B2C3DA600D006CD600EF6F26 /* FontCascade.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C3DA4F0D006CD600EF6F26 /* FontCascade.cpp */; };
     4708                B2C3DA610D006CD600EF6F26 /* FontCascade.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA500D006CD600EF6F26 /* FontCascade.h */; settings = {ATTRIBUTES = (Private, ); }; };
    47094709                B2C3DA620D006CD600EF6F26 /* FontCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C3DA510D006CD600EF6F26 /* FontCache.cpp */; };
    47104710                B2C3DA630D006CD600EF6F26 /* FontCache.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA520D006CD600EF6F26 /* FontCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    1208212082                B2C3DA1A0D006C1D00EF6F26 /* TextStream.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TextStream.cpp; sourceTree = "<group>"; };
    1208312083                B2C3DA1B0D006C1D00EF6F26 /* TextStream.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TextStream.h; sourceTree = "<group>"; };
    12084                 B2C3DA4F0D006CD600EF6F26 /* Font.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Font.cpp; sourceTree = "<group>"; };
    12085                 B2C3DA500D006CD600EF6F26 /* Font.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Font.h; sourceTree = "<group>"; };
     12084                B2C3DA4F0D006CD600EF6F26 /* FontCascade.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FontCascade.cpp; sourceTree = "<group>"; };
     12085                B2C3DA500D006CD600EF6F26 /* FontCascade.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FontCascade.h; sourceTree = "<group>"; };
    1208612086                B2C3DA510D006CD600EF6F26 /* FontCache.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FontCache.cpp; sourceTree = "<group>"; };
    1208712087                B2C3DA520D006CD600EF6F26 /* FontCache.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FontCache.h; sourceTree = "<group>"; };
     
    2041520415                                B27535390B053814002CE64F /* Color.h */,
    2041620416                                9382DF5710A8D5C900925652 /* ColorSpace.h */,
     20417                                B2C3DA4F0D006CD600EF6F26 /* FontCascade.cpp */,
     20418                                B2C3DA500D006CD600EF6F26 /* FontCascade.h */,
    2041720419                                2D2FC0541460CD6F00263633 /* CrossfadeGeneratedImage.cpp */,
    2041820420                                2D2FC0551460CD6F00263633 /* CrossfadeGeneratedImage.h */,
     
    2044020442                                B275353F0B053814002CE64F /* FloatSize.h */,
    2044120443                                58CD35CA18EB4C3900B9F3AC /* FloatSizeHash.h */,
    20442                                 B2C3DA4F0D006CD600EF6F26 /* Font.cpp */,
    20443                                 B2C3DA500D006CD600EF6F26 /* Font.h */,
    2044420444                                BCB92D4E1293550B00C8387F /* FontBaseline.h */,
    2044520445                                B2C3DA510D006CD600EF6F26 /* FontCache.cpp */,
     
    2431324313                                062287840B4DB322000C34DF /* FocusDirection.h in Headers */,
    2431424314                                B6D9D23514EABD260090D75E /* FocusEvent.h in Headers */,
    24315                                 B2C3DA610D006CD600EF6F26 /* Font.h in Headers */,
     24315                                B2C3DA610D006CD600EF6F26 /* FontCascade.h in Headers */,
    2431624316                                BCB92D4F1293550B00C8387F /* FontBaseline.h in Headers */,
    2431724317                                B2C3DA630D006CD600EF6F26 /* FontCache.h in Headers */,
     
    2781627816                                14993BE50B2F2B1C0050497F /* FocusController.cpp in Sources */,
    2781727817                                B6D9D23614EABD260090D75E /* FocusEvent.cpp in Sources */,
    27818                                 B2C3DA600D006CD600EF6F26 /* Font.cpp in Sources */,
     27818                                B2C3DA600D006CD600EF6F26 /* FontCascade.cpp in Sources */,
    2781927819                                B2C3DA620D006CD600EF6F26 /* FontCache.cpp in Sources */,
    2782027820                                3727DFD5142AAE4500D449CB /* FontCacheIOS.mm in Sources */,
  • trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp

    r175466 r178510  
    3737#include "AccessibilityObject.h"
    3838#include "Document.h"
    39 #include "Font.h"
     39#include "FontCascade.h"
    4040#include "FrameView.h"
    4141#include "HTMLParserIdioms.h"
     
    131131    }
    132132
    133     String fontFamilyName = style->font().firstFamily();
     133    String fontFamilyName = style->fontCascade().firstFamily();
    134134    if (fontFamilyName.left(8) == "-webkit-")
    135135        fontFamilyName = fontFamilyName.substring(8);
     
    138138
    139139    int fontWeight = -1;
    140     switch (style->font().weight()) {
     140    switch (style->fontCascade().weight()) {
    141141    case FontWeight100:
    142142        fontWeight = 100;
     
    193193    result = addToAtkAttributeSet(result, atk_text_attribute_get_name(ATK_TEXT_ATTR_UNDERLINE), (style->textDecoration() & TextDecorationUnderline) ? "single" : "none");
    194194
    195     result = addToAtkAttributeSet(result, atk_text_attribute_get_name(ATK_TEXT_ATTR_STYLE), style->font().italic() ? "italic" : "normal");
     195    result = addToAtkAttributeSet(result, atk_text_attribute_get_name(ATK_TEXT_ATTR_STYLE), style->fontCascade().italic() ? "italic" : "normal");
    196196
    197197    result = addToAtkAttributeSet(result, atk_text_attribute_get_name(ATK_TEXT_ATTR_STRIKETHROUGH), (style->textDecoration() & TextDecorationLineThrough) ? "true" : "false");
  • trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm

    r178171 r178510  
    3535#import "Chrome.h"
    3636#import "ChromeClient.h"
    37 #import "Font.h"
     37#import "FontCascade.h"
    3838#import "Frame.h"
    3939#import "FrameSelection.h"
     
    17591759   
    17601760    // set basic font info
    1761     AXAttributeStringSetFont(attrString, style.font().primaryFontData().getCTFont(), range);
     1761    AXAttributeStringSetFont(attrString, style.fontCascade().primaryFontData().getCTFont(), range);
    17621762               
    17631763    int decor = style.textDecorationsInEffect();
  • trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm

    r178171 r178510  
    4747#import "ColorMac.h"
    4848#import "ContextMenuController.h"
    49 #import "Font.h"
     49#import "FontCascade.h"
    5050#import "Frame.h"
    5151#import "FrameLoaderClient.h"
  • trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm

    r178171 r178510  
    4848#import "ContextMenuController.h"
    4949#import "Editor.h"
    50 #import "Font.h"
     50#import "FontCascade.h"
    5151#import "FrameLoaderClient.h"
    5252#import "FrameSelection.h"
     
    849849   
    850850    // set basic font info
    851     AXAttributeStringSetFont(attrString, NSAccessibilityFontTextAttribute, style.font().primaryFontData().getNSFont(), range);
     851    AXAttributeStringSetFont(attrString, NSAccessibilityFontTextAttribute, style.fontCascade().primaryFontData().getNSFont(), range);
    852852   
    853853    // set basic colors
  • trunk/Source/WebCore/bindings/objc/DOM.mm

    r177955 r178510  
    3838#import "DOMRangeInternal.h"
    3939#import "DragImage.h"
    40 #import "Font.h"
     40#import "FontCascade.h"
    4141#import "Frame.h"
    4242#import "HTMLElement.h"
     
    670670    if (!renderer)
    671671        return nil;
    672     return renderer->style().font().primaryFontData().getNSFont();
     672    return renderer->style().fontCascade().primaryFontData().getNSFont();
    673673}
    674674#else
     
    678678    if (!renderer)
    679679        return nil;
    680     return renderer->style().font().primaryFontData().getCTFont();
     680    return renderer->style().fontCascade().primaryFontData().getCTFont();
    681681}
    682682#endif
  • trunk/Source/WebCore/bindings/objc/DOMUIKitExtensions.mm

    r175549 r178510  
    4444#import "DOMRangeInternal.h"
    4545#import "FloatPoint.h"
    46 #import "Font.h"
     46#import "FontCascade.h"
    4747#import "FrameSelection.h"
    4848#import "HTMLAreaElement.h"
     
    7272
    7373using WebCore::FloatPoint;
    74 using WebCore::Font;
     74using WebCore::FontCascade;
    7575using WebCore::HTMLAreaElement;
    7676using WebCore::HTMLImageElement;
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r177866 r178510  
    15051505{
    15061506    auto list = CSSValueList::createCommaSeparated();
    1507     for (unsigned i = 0; i < style->font().familyCount(); ++i)
    1508         list.get().append(valueForFamily(style->font().familyAt(i)));
     1507    for (unsigned i = 0; i < style->fontCascade().familyCount(); ++i)
     1508        list.get().append(valueForFamily(style->fontCascade().familyAt(i)));
    15091509    return list;
    15101510}
     
    25462546            return cssValuePool().createValue(style->wordBreak());
    25472547        case CSSPropertyWordSpacing:
    2548             return zoomAdjustedPixelValue(style->font().wordSpacing(), style.get());
     2548            return zoomAdjustedPixelValue(style->fontCascade().wordSpacing(), style.get());
    25492549        case CSSPropertyWordWrap:
    25502550            return cssValuePool().createValue(style->overflowWrap());
  • trunk/Source/WebCore/css/CSSPrimitiveValue.cpp

    r178102 r178510  
    3333#include "Counter.h"
    3434#include "ExceptionCode.h"
    35 #include "Font.h"
     35#include "FontCascade.h"
    3636#include "Node.h"
    3737#include "Pair.h"
  • trunk/Source/WebCore/css/FontLoader.cpp

    r176459 r178510  
    3737#include "Document.h"
    3838#include "ExceptionCodeDescription.h"
    39 #include "Font.h"
     39#include "FontCascade.h"
    4040#include "FrameView.h"
    4141#include "StyleProperties.h"
     
    5454    }
    5555
    56     static PassRefPtr<LoadFontCallback> createFromParams(const Dictionary& params, FontLoader& fontLoader, const Font& font)
     56    static PassRefPtr<LoadFontCallback> createFromParams(const Dictionary& params, FontLoader& fontLoader, const FontCascade& font)
    5757    {
    5858        RefPtr<VoidCallback> onsuccess;
     
    246246    if (!params.get("font", fontString))
    247247        return;
    248     Font font;
     248    FontCascade font;
    249249    if (!resolveFontStyle(fontString, font))
    250250        return;
     
    266266{
    267267    // FIXME: The second parameter (text) is ignored.
    268     Font font;
     268    FontCascade font;
    269269    if (!resolveFontStyle(fontString, font))
    270270        return false;
     
    282282}
    283283
    284 bool FontLoader::resolveFontStyle(const String& fontString, Font& font)
     284bool FontLoader::resolveFontStyle(const String& fontString, FontCascade& font)
    285285{
    286286    // Interpret fontString in the same way as the 'font' attribute of CanvasRenderingContext2D.
     
    303303    style->setFontDescription(defaultFontDescription);
    304304
    305     style->font().update(style->font().fontSelector());
     305    style->fontCascade().update(style->fontCascade().fontSelector());
    306306
    307307    // Now map the font property longhands into the style.
     
    320320    applyPropertyToCurrentStyle(styleResolver, CSSPropertyLineHeight, parsedStyle);
    321321
    322     font = style->font();
     322    font = style->fontCascade();
    323323    font.update(styleResolver.fontSelector());
    324324    return true;
  • trunk/Source/WebCore/css/FontLoader.h

    r178223 r178510  
    4646class Document;
    4747class Event;
    48 class Font;
     48class FontCascade;
    4949class LoadFontCallback;
    5050class ScriptExecutionContext;
     
    101101    void scheduleEvent(PassRefPtr<Event>);
    102102    void firePendingEvents();
    103     bool resolveFontStyle(const String&, Font&);
     103    bool resolveFontStyle(const String&, FontCascade&);
    104104
    105105    Document* m_document;
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r178251 r178510  
    307307    m_ruleSets.appendAuthorStyleSheets(firstNew, styleSheets, m_medium.get(), m_inspectorCSSOMWrappers, this);
    308308    if (auto renderView = document().renderView())
    309         renderView->style().font().update(fontSelector());
     309        renderView->style().fontCascade().update(fontSelector());
    310310
    311311#if ENABLE(CSS_DEVICE_ADAPTATION)
     
    749749            s_styleNotYetAvailable = &RenderStyle::create().leakRef();
    750750            s_styleNotYetAvailable->setDisplay(NONE);
    751             s_styleNotYetAvailable->font().update(m_fontSelector);
     751            s_styleNotYetAvailable->fontCascade().update(m_fontSelector);
    752752        }
    753753        element->document().setHasNodesWithPlaceholderStyle();
     
    10321032    if (Settings* settings = documentSettings()) {
    10331033        initializeFontStyle(settings);
    1034         m_state.style()->font().update(fontSelector());
     1034        m_state.style()->fontCascade().update(fontSelector());
    10351035    } else
    1036         m_state.style()->font().update(0);
     1036        m_state.style()->fontCascade().update(nullptr);
    10371037
    10381038    return m_state.takeStyle();
     
    14851485    checkForZoomChange(style, m_state.parentStyle());
    14861486    checkForOrientationChange(style);
    1487     style->font().update(m_fontSelector);
     1487    style->fontCascade().update(m_fontSelector);
    14881488    if (m_state.fontSizeHasViewportUnits())
    14891489        style->setHasViewportUnits(true);
  • trunk/Source/WebCore/editing/TextIterator.cpp

    r178462 r178510  
    3030#include "Document.h"
    3131#include "ExceptionCodePlaceholder.h"
    32 #include "Font.h"
     32#include "FontCascade.h"
    3333#include "Frame.h"
    3434#include "HTMLElement.h"
     
    21862186    // Chinese and Japanese lack word boundary marks, and there is no clear agreement on what constitutes
    21872187    // a word, so treat the position before any CJK character as a word start.
    2188     if (Font::isCJKIdeographOrSymbol(firstCharacter))
     2188    if (FontCascade::isCJKIdeographOrSymbol(firstCharacter))
    21892189        return true;
    21902190
  • trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm

    r177955 r178510  
    3838#import "Element.h"
    3939#import "ElementTraversal.h"
    40 #import "Font.h"
     40#import "FontCascade.h"
    4141#import "Frame.h"
    4242#import "FrameLoader.h"
     
    11151115    if (!renderer)
    11161116        return nil;
    1117     return renderer->style().font().primaryFontData().getNSFont();
     1117    return renderer->style().fontCascade().primaryFontData().getNSFont();
    11181118}
    11191119#else
     
    11231123    if (!renderer)
    11241124        return nil;
    1125     return (PlatformFont *)renderer->style().font().primaryFontData().getCTFont();
     1125    return (PlatformFont *)renderer->style().fontCascade().primaryFontData().getCTFont();
    11261126}
    11271127#endif
     
    25952595        if (style.textDecorationsInEffect() & TextDecorationLineThrough)
    25962596            [attrs.get() setObject:[NSNumber numberWithInteger:NSUnderlineStyleSingle] forKey:NSStrikethroughStyleAttributeName];
    2597         if (NSFont *font = style.font().primaryFontData().getNSFont())
     2597        if (NSFont *font = style.fontCascade().primaryFontData().getNSFont())
    25982598            [attrs.get() setObject:font forKey:NSFontAttributeName];
    25992599        else
    2600             [attrs.get() setObject:[fontManager convertFont:WebDefaultFont() toSize:style.font().primaryFontData().platformData().size()] forKey:NSFontAttributeName];
     2600            [attrs.get() setObject:[fontManager convertFont:WebDefaultFont() toSize:style.fontCascade().primaryFontData().platformData().size()] forKey:NSFontAttributeName];
    26012601        if (style.visitedDependentColor(CSSPropertyColor).alpha())
    26022602            [attrs.get() setObject:nsColor(style.visitedDependentColor(CSSPropertyColor)) forKey:NSForegroundColorAttributeName];
  • trunk/Source/WebCore/editing/ios/EditorIOS.mm

    r177955 r178510  
    3636#include "DocumentLoader.h"
    3737#include "EditorClient.h"
    38 #include "Font.h"
     38#include "FontCascade.h"
    3939#include "Frame.h"
    4040#include "FrameLoaderClient.h"
     
    214214        const SimpleFontData* result = nullptr;
    215215        if (style)
    216             result = &style->font().primaryFontData();
     216            result = &style->fontCascade().primaryFontData();
    217217
    218218        if (nodeToRemove) {
     
    236236                continue;
    237237            // FIXME: Are there any node types that have renderers, but that we should be skipping?
    238             const SimpleFontData& primaryFont = renderer->style().font().primaryFontData();
     238            const SimpleFontData& primaryFont = renderer->style().fontCascade().primaryFontData();
    239239            if (!font)
    240240                font = &primaryFont;
     
    258258    NSMutableDictionary* result = [NSMutableDictionary dictionary];
    259259   
    260     CTFontRef font = style->font().primaryFontData().getCTFont();
     260    CTFontRef font = style->fontCascade().primaryFontData().getCTFont();
    261261    if (font)
    262262        [result setObject:(id)font forKey:NSFontAttributeName];
  • trunk/Source/WebCore/editing/mac/EditorMac.mm

    r177955 r178510  
    3636#import "Editor.h"
    3737#import "EditorClient.h"
    38 #import "Font.h"
     38#import "FontCascade.h"
    3939#import "Frame.h"
    4040#import "FrameLoaderClient.h"
     
    116116        const SimpleFontData* result = nullptr;
    117117        if (style)
    118             result = &style->font().primaryFontData();
     118            result = &style->fontCascade().primaryFontData();
    119119
    120120        if (nodeToRemove)
     
    136136                continue;
    137137            // FIXME: Are there any node types that have renderers, but that we should be skipping?
    138             const SimpleFontData& primaryFont = renderer->style().font().primaryFontData();
     138            const SimpleFontData& primaryFont = renderer->style().fontCascade().primaryFontData();
    139139            if (!font)
    140140                font = &primaryFont;
     
    161161        [result setObject:nsColor(style->visitedDependentColor(CSSPropertyBackgroundColor)) forKey:NSBackgroundColorAttributeName];
    162162
    163     if (style->font().primaryFontData().getNSFont())
    164         [result setObject:style->font().primaryFontData().getNSFont() forKey:NSFontAttributeName];
     163    if (style->fontCascade().primaryFontData().getNSFont())
     164        [result setObject:style->fontCascade().primaryFontData().getNSFont() forKey:NSFontAttributeName];
    165165
    166166    if (style->visitedDependentColor(CSSPropertyColor).isValid() && style->visitedDependentColor(CSSPropertyColor) != Color::black)
  • trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp

    r178392 r178510  
    21062106    }
    21072107
    2108     newStyle->font().update(newStyle->font().fontSelector());
     2108    newStyle->fontCascade().update(newStyle->fontCascade().fontSelector());
    21092109
    21102110    // Now map the font property longhands into the style.
     
    21232123    styleResolver.applyPropertyToCurrentStyle(CSSPropertyLineHeight, parsedStyle->getPropertyCSSValue(CSSPropertyLineHeight).get());
    21242124
    2125     modifiableState().m_font = newStyle->font();
     2125    modifiableState().m_font = newStyle->fontCascade();
    21262126    modifiableState().m_font.update(styleResolver.fontSelector());
    21272127    modifiableState().m_realizedFont = true;
     
    22882288        return;
    22892289
    2290     const Font& font = accessFont();
     2290    const FontCascade& font = accessFont();
    22912291    const FontMetrics& fontMetrics = font.fontMetrics();
    22922292
     
    23732373            // We draw when fontWidth is 0 so compositing operations (eg, a "copy" op) still work.
    23742374            maskImageContext->scale(FloatSize((fontWidth > 0 ? (width / fontWidth) : 0), 1));
    2375             maskImageContext->drawBidiText(font, textRun, FloatPoint(0, 0), Font::UseFallbackIfFontNotReady);
     2375            maskImageContext->drawBidiText(font, textRun, FloatPoint(0, 0), FontCascade::UseFallbackIfFontNotReady);
    23762376        } else {
    23772377            maskImageContext->translate(-maskRect.x(), -maskRect.y());
    2378             maskImageContext->drawBidiText(font, textRun, location, Font::UseFallbackIfFontNotReady);
     2378            maskImageContext->drawBidiText(font, textRun, location, FontCascade::UseFallbackIfFontNotReady);
    23792379        }
    23802380
     
    23992399    if (isFullCanvasCompositeMode(state().m_globalComposite)) {
    24002400        beginCompositeLayer();
    2401         c->drawBidiText(font, textRun, location, Font::UseFallbackIfFontNotReady);
     2401        c->drawBidiText(font, textRun, location, FontCascade::UseFallbackIfFontNotReady);
    24022402        endCompositeLayer();
    24032403        didDrawEntireCanvas();
    24042404    } else if (state().m_globalComposite == CompositeCopy) {
    24052405        clearCanvas();
    2406         c->drawBidiText(font, textRun, location, Font::UseFallbackIfFontNotReady);
     2406        c->drawBidiText(font, textRun, location, FontCascade::UseFallbackIfFontNotReady);
    24072407        didDrawEntireCanvas();
    24082408    } else {
    2409         c->drawBidiText(font, textRun, location, Font::UseFallbackIfFontNotReady);
     2409        c->drawBidiText(font, textRun, location, FontCascade::UseFallbackIfFontNotReady);
    24102410        didDraw(textRect);
    24112411    }
     
    24272427}
    24282428
    2429 const Font& CanvasRenderingContext2D::accessFont()
     2429const FontCascade& CanvasRenderingContext2D::accessFont()
    24302430{
    24312431    canvas()->document().updateStyleIfNeeded();
  • trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h

    r175328 r178510  
    3434#include "ColorSpace.h"
    3535#include "FloatSize.h"
    36 #include "Font.h"
     36#include "FontCascade.h"
    3737#include "GraphicsTypes.h"
    3838#include "ImageBuffer.h"
     
    271271
    272272        String m_unparsedFont;
    273         Font m_font;
     273        FontCascade m_font;
    274274        bool m_realizedFont;
    275275    };
     
    309309    void drawTextInternal(const String& text, float x, float y, bool fill, float maxWidth = 0, bool useMaxWidth = false);
    310310
    311     const Font& accessFont();
     311    const FontCascade& accessFont();
    312312
    313313#if ENABLE(DASHBOARD_SUPPORT)
  • trunk/Source/WebCore/mathml/MathMLMencloseElement.cpp

    r177733 r178510  
    134134    Node* node = parentNode();
    135135    if (node && node->renderer()) {
    136         const Font& font = node->renderer()->style().font();
     136        const FontCascade& font = node->renderer()->style().fontCascade();
    137137        padding.appendNumber(font.width(run));
    138138        padding.appendLiteral("px");
  • trunk/Source/WebCore/page/Settings.cpp

    r177925 r178510  
    3434#include "Database.h"
    3535#include "Document.h"
    36 #include "Font.h"
     36#include "FontCascade.h"
    3737#include "FontGenericFamilies.h"
    3838#include "FrameTree.h"
  • trunk/Source/WebCore/platform/MemoryPressureHandler.cpp

    r177848 r178510  
    2929#include "CSSValuePool.h"
    3030#include "Document.h"
    31 #include "Font.h"
    3231#include "FontCache.h"
     32#include "FontCascade.h"
    3333#include "GCController.h"
    3434#include "JSDOMWindow.h"
  • trunk/Source/WebCore/platform/PopupMenuStyle.h

    r169134 r178510  
    2828
    2929#include "Color.h"
    30 #include "Font.h"
     30#include "FontCascade.h"
    3131#include "Length.h"
    3232#include "TextDirection.h"
     
    4444    };
    4545
    46     PopupMenuStyle(const Color& foreground, const Color& background, const Font& font, bool visible, bool isDisplayNone, bool hasDefaultAppearance, Length textIndent, TextDirection textDirection, bool hasTextDirectionOverride, BackgroundColorType backgroundColorType = DefaultBackgroundColor, PopupMenuType menuType = SelectPopup, PopupMenuSize menuSize = PopupMenuSizeNormal)
     46    PopupMenuStyle(const Color& foreground, const Color& background, const FontCascade& font, bool visible, bool isDisplayNone, bool hasDefaultAppearance, Length textIndent, TextDirection textDirection, bool hasTextDirectionOverride, BackgroundColorType backgroundColorType = DefaultBackgroundColor, PopupMenuType menuType = SelectPopup, PopupMenuSize menuSize = PopupMenuSizeNormal)
    4747        : m_foregroundColor(foreground)
    4848        , m_backgroundColor(background)
     
    6262    const Color& foregroundColor() const { return m_foregroundColor; }
    6363    const Color& backgroundColor() const { return m_backgroundColor; }
    64     const Font& font() const { return m_font; }
     64    const FontCascade& font() const { return m_font; }
    6565    bool isVisible() const { return m_visible; }
    6666    bool isDisplayNone() const { return m_isDisplayNone; }
     
    7676    Color m_foregroundColor;
    7777    Color m_backgroundColor;
    78     Font m_font;
     78    FontCascade m_font;
    7979    bool m_visible;
    8080    bool m_isDisplayNone;
  • trunk/Source/WebCore/platform/Theme.cpp

    r95901 r178510  
    2929namespace WebCore {
    3030
    31 LengthBox Theme::controlBorder(ControlPart part, const Font&, const LengthBox& zoomedBox, float) const
     31LengthBox Theme::controlBorder(ControlPart part, const FontCascade&, const LengthBox& zoomedBox, float) const
    3232{
    3333    switch (part) {
     
    4343}
    4444
    45 LengthBox Theme::controlPadding(ControlPart part, const Font&, const LengthBox& zoomedBox, float) const
     45LengthBox Theme::controlPadding(ControlPart part, const FontCascade&, const LengthBox& zoomedBox, float) const
    4646{
    4747    switch (part) {
  • trunk/Source/WebCore/platform/Theme.h

    r169928 r178510  
    2929#include "Color.h"
    3030#include "ControlStates.h"
    31 #include "Font.h"
     31#include "FontCascade.h"
    3232#include "IntRect.h"
    3333#include "LengthBox.h"
     
    7272    // CSS system colors and fonts
    7373    virtual Color systemColor(ThemeColor) const { return Color(); }
    74     virtual Font systemFont(ThemeFont, FontDescription&) const { return Font(); }
     74    virtual FontCascade systemFont(ThemeFont, FontDescription&) const { return FontCascade(); }
    7575   
    7676    // How fast the caret blinks in text fields.
     
    8383   
    8484    // The font description result should have a zoomed font size.
    85     virtual FontDescription controlFont(ControlPart, const Font& font, float /*zoomFactor*/) const { return font.fontDescription(); }
     85    virtual FontDescription controlFont(ControlPart, const FontCascade& font, float /*zoomFactor*/) const { return font.fontDescription(); }
    8686   
    8787    // The size here is in zoomed coordinates already.  If a new size is returned, it also needs to be in zoomed coordinates.
    88     virtual LengthSize controlSize(ControlPart, const Font&, const LengthSize& zoomedSize, float /*zoomFactor*/) const { return zoomedSize; }
     88    virtual LengthSize controlSize(ControlPart, const FontCascade&, const LengthSize& zoomedSize, float /*zoomFactor*/) const { return zoomedSize; }
    8989   
    9090    // Returns the minimum size for a control in zoomed coordinates. 
    91     virtual LengthSize minimumControlSize(ControlPart, const Font&, float /*zoomFactor*/) const { return LengthSize(Length(0, Fixed), Length(0, Fixed)); }
     91    virtual LengthSize minimumControlSize(ControlPart, const FontCascade&, float /*zoomFactor*/) const { return LengthSize(Length(0, Fixed), Length(0, Fixed)); }
    9292   
    9393    // Allows the theme to modify the existing padding/border.
    94     virtual LengthBox controlPadding(ControlPart, const Font&, const LengthBox& zoomedBox, float zoomFactor) const;
    95     virtual LengthBox controlBorder(ControlPart, const Font&, const LengthBox& zoomedBox, float zoomFactor) const;
     94    virtual LengthBox controlPadding(ControlPart, const FontCascade&, const LengthBox& zoomedBox, float zoomFactor) const;
     95    virtual LengthBox controlBorder(ControlPart, const FontCascade&, const LengthBox& zoomedBox, float zoomFactor) const;
    9696   
    9797    // Whether or not whitespace: pre should be forced on always.
  • trunk/Source/WebCore/platform/Widget.h

    r174506 r178510  
    7171class Cursor;
    7272class Event;
    73 class Font;
     73class FontCascade;
    7474class FrameView;
    7575class GraphicsContext;
  • trunk/Source/WebCore/platform/graphics/FontCache.cpp

    r178250 r178510  
    3131#include "FontCache.h"
    3232
    33 #include "Font.h"
     33#include "FontCascade.h"
    3434#include "FontGlyphs.h"
    3535#include "FontPlatformData.h"
  • trunk/Source/WebCore/platform/graphics/FontCache.h

    r178250 r178510  
    5252namespace WebCore {
    5353
    54 class Font;
     54class FontCascade;
    5555class FontPlatformData;
    5656class FontSelector;
  • trunk/Source/WebCore/platform/graphics/FontCascade.cpp

    r178496 r178510  
    2323
    2424#include "config.h"
    25 #include "Font.h"
     25#include "FontCascade.h"
    2626
    2727#include "FloatRect.h"
     
    4444template <> void deleteOwnedPtr<WebCore::TextLayout>(WebCore::TextLayout* ptr)
    4545{
    46     WebCore::Font::deleteLayout(ptr);
     46    WebCore::FontCascade::deleteLayout(ptr);
    4747}
    4848
     
    5353static Ref<FontGlyphs> retrieveOrAddCachedFontGlyphs(const FontDescription&, PassRefPtr<FontSelector>);
    5454
    55 const uint8_t Font::s_roundingHackCharacterTable[256] = {
     55const uint8_t FontCascade::s_roundingHackCharacterTable[256] = {
    5656    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,
    5757    1 /*space*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 /*-*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 /*?*/,
     
    9999}
    100100
    101 Font::CodePath Font::s_codePath = Auto;
    102 
    103 TypesettingFeatures Font::s_defaultTypesettingFeatures = 0;
     101FontCascade::CodePath FontCascade::s_codePath = Auto;
     102
     103TypesettingFeatures FontCascade::s_defaultTypesettingFeatures = 0;
    104104
    105105// ============================================================================================
    106 // Font Implementation (Cross-Platform Portion)
     106// FontCascade Implementation (Cross-Platform Portion)
    107107// ============================================================================================
    108108
    109 Font::Font()
     109FontCascade::FontCascade()
    110110    : m_letterSpacing(0)
    111111    , m_wordSpacing(0)
     
    115115}
    116116
    117 Font::Font(const FontDescription& fd, float letterSpacing, float wordSpacing)
     117FontCascade::FontCascade(const FontDescription& fd, float letterSpacing, float wordSpacing)
    118118    : m_fontDescription(fd)
    119119    , m_letterSpacing(letterSpacing)
     
    125125
    126126// FIXME: We should make this constructor platform-independent.
    127 Font::Font(const FontPlatformData& fontData, bool isPrinterFont, FontSmoothingMode fontSmoothingMode)
     127FontCascade::FontCascade(const FontPlatformData& fontData, bool isPrinterFont, FontSmoothingMode fontSmoothingMode)
    128128    : m_glyphs(FontGlyphs::createForPlatformFont(fontData))
    129129    , m_letterSpacing(0)
     
    144144// FIXME: We should make this constructor platform-independent.
    145145#if PLATFORM(IOS)
    146 Font::Font(const FontPlatformData& fontData, PassRefPtr<FontSelector> fontSelector)
     146FontCascade::FontCascade(const FontPlatformData& fontData, PassRefPtr<FontSelector> fontSelector)
    147147    : m_glyphs(FontGlyphs::createForPlatformFont(fontData))
    148148    , m_letterSpacing(0)
     
    160160#endif
    161161
    162 Font::Font(const Font& other)
     162FontCascade::FontCascade(const FontCascade& other)
    163163    : m_fontDescription(other.m_fontDescription)
    164164    , m_glyphs(other.m_glyphs)
     
    170170}
    171171
    172 Font& Font::operator=(const Font& other)
     172FontCascade& FontCascade::operator=(const FontCascade& other)
    173173{
    174174    m_fontDescription = other.m_fontDescription;
     
    181181}
    182182
    183 bool Font::operator==(const Font& other) const
     183bool FontCascade::operator==(const FontCascade& other) const
    184184{
    185185    if (isLoadingCustomFonts() || other.isLoadingCustomFonts())
     
    324324}
    325325
    326 void Font::update(PassRefPtr<FontSelector> fontSelector) const
     326void FontCascade::update(PassRefPtr<FontSelector> fontSelector) const
    327327{
    328328    m_glyphs = retrieveOrAddCachedFontGlyphs(m_fontDescription, fontSelector.get());
     
    331331}
    332332
    333 float Font::drawText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to, CustomFontNotReadyAction customFontNotReadyAction) const
     333float FontCascade::drawText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to, CustomFontNotReadyAction customFontNotReadyAction) const
    334334{
    335335    // Don't draw anything while we are using custom fonts that are in the process of loading,
     
    352352}
    353353
    354 void Font::drawEmphasisMarks(GraphicsContext* context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, int to) const
     354void FontCascade::drawEmphasisMarks(GraphicsContext* context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, int to) const
    355355{
    356356    if (isLoadingCustomFonts())
     
    371371}
    372372
    373 float Font::width(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
     373float FontCascade::width(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
    374374{
    375375    CodePath codePathToUse = codePath(run);
     
    404404}
    405405
    406 float Font::width(const TextRun& run, int& charsConsumed, String& glyphName) const
     406float FontCascade::width(const TextRun& run, int& charsConsumed, String& glyphName) const
    407407{
    408408#if ENABLE(SVG_FONTS)
     
    416416}
    417417
    418 GlyphData Font::glyphDataForCharacter(UChar32 c, bool mirror, FontDataVariant variant) const
     418GlyphData FontCascade::glyphDataForCharacter(UChar32 c, bool mirror, FontDataVariant variant) const
    419419{
    420420    if (variant == AutoVariant) {
     
    437437
    438438#if !PLATFORM(COCOA)
    439 PassOwnPtr<TextLayout> Font::createLayout(RenderText*, float, bool) const
     439PassOwnPtr<TextLayout> FontCascade::createLayout(RenderText*, float, bool) const
    440440{
    441441    return nullptr;
    442442}
    443443
    444 void Font::deleteLayout(TextLayout*)
    445 {
    446 }
    447 
    448 float Font::width(TextLayout&, unsigned, unsigned, HashSet<const SimpleFontData*>*)
     444void FontCascade::deleteLayout(TextLayout*)
     445{
     446}
     447
     448float FontCascade::width(TextLayout&, unsigned, unsigned, HashSet<const SimpleFontData*>*)
    449449{
    450450    ASSERT_NOT_REACHED();
     
    497497// but, in order to get similar rendering across platforms, we do this check for
    498498// all platforms.
    499 bool Font::hasValidAverageCharWidth() const
     499bool FontCascade::hasValidAverageCharWidth() const
    500500{
    501501    AtomicString family = firstFamily();
     
    521521}
    522522
    523 bool Font::fastAverageCharWidthIfAvailable(float& width) const
     523bool FontCascade::fastAverageCharWidthIfAvailable(float& width) const
    524524{
    525525    bool success = hasValidAverageCharWidth();
     
    529529}
    530530
    531 void Font::adjustSelectionRectForText(const TextRun& run, LayoutRect& selectionRect, int from, int to) const
     531void FontCascade::adjustSelectionRectForText(const TextRun& run, LayoutRect& selectionRect, int from, int to) const
    532532{
    533533    to = (to == -1 ? run.length() : to);
     
    544544}
    545545
    546 int Font::offsetForPosition(const TextRun& run, float x, bool includePartialGlyphs) const
     546int FontCascade::offsetForPosition(const TextRun& run, float x, bool includePartialGlyphs) const
    547547{
    548548    // FIXME: Use the fast code path once it handles partial runs with kerning and ligatures. See http://webkit.org/b/100050
     
    560560
    561561    for (unsigned i = 0; i < length; ++i)
    562         normalized.append(Font::normalizeSpaces(characters[i]));
     562        normalized.append(FontCascade::normalizeSpaces(characters[i]));
    563563
    564564    return normalized.toString();
    565565}
    566566
    567 String Font::normalizeSpaces(const LChar* characters, unsigned length)
     567String FontCascade::normalizeSpaces(const LChar* characters, unsigned length)
    568568{
    569569    return normalizeSpacesInternal(characters, length);
    570570}
    571571
    572 String Font::normalizeSpaces(const UChar* characters, unsigned length)
     572String FontCascade::normalizeSpaces(const UChar* characters, unsigned length)
    573573{
    574574    return normalizeSpacesInternal(characters, length);
     
    577577static bool shouldUseFontSmoothing = true;
    578578
    579 void Font::setShouldUseSmoothing(bool shouldUseSmoothing)
     579void FontCascade::setShouldUseSmoothing(bool shouldUseSmoothing)
    580580{
    581581    ASSERT(isMainThread());
     
    583583}
    584584
    585 bool Font::shouldUseSmoothing()
     585bool FontCascade::shouldUseSmoothing()
    586586{
    587587    return shouldUseFontSmoothing;
    588588}
    589589
    590 void Font::setCodePath(CodePath p)
     590void FontCascade::setCodePath(CodePath p)
    591591{
    592592    s_codePath = p;
    593593}
    594594
    595 Font::CodePath Font::codePath()
     595FontCascade::CodePath FontCascade::codePath()
    596596{
    597597    return s_codePath;
    598598}
    599599
    600 void Font::setDefaultTypesettingFeatures(TypesettingFeatures typesettingFeatures)
     600void FontCascade::setDefaultTypesettingFeatures(TypesettingFeatures typesettingFeatures)
    601601{
    602602    s_defaultTypesettingFeatures = typesettingFeatures;
    603603}
    604604
    605 TypesettingFeatures Font::defaultTypesettingFeatures()
     605TypesettingFeatures FontCascade::defaultTypesettingFeatures()
    606606{
    607607    return s_defaultTypesettingFeatures;
    608608}
    609609
    610 Font::CodePath Font::codePath(const TextRun& run) const
     610FontCascade::CodePath FontCascade::codePath(const TextRun& run) const
    611611{
    612612    if (s_codePath != Auto)
     
    634634}
    635635
    636 Font::CodePath Font::characterRangeCodePath(const UChar* characters, unsigned len)
     636FontCascade::CodePath FontCascade::characterRangeCodePath(const UChar* characters, unsigned len)
    637637{
    638638    // FIXME: Should use a UnicodeSet in ports where ICU is used. Note that we
     
    735735            return Complex;
    736736
    737        // U+A800 through U+ABFF Nagri, Phags-pa, Saurashtra, Devanagari Extended,
    738        // Hangul Jamo Ext. A, Javanese, Myanmar Extended A, Tai Viet, Meetei Mayek,
     737        // U+A800 through U+ABFF Nagri, Phags-pa, Saurashtra, Devanagari Extended,
     738        // Hangul Jamo Ext. A, Javanese, Myanmar Extended A, Tai Viet, Meetei Mayek,
    739739        if (c < 0xA800)
    740740            continue;
     
    788788}
    789789
    790 bool Font::isCJKIdeograph(UChar32 c)
     790bool FontCascade::isCJKIdeograph(UChar32 c)
    791791{
    792792    // The basic CJK Unified Ideographs block.
     
    813813    if (c >= 0xF900 && c <= 0xFAFF)
    814814        return true;
    815    
     815
    816816    // CJK Unified Ideographs Extension B.
    817817    if (c >= 0x20000 && c <= 0x2A6DF)
    818818        return true;
    819        
     819
    820820    // CJK Unified Ideographs Extension C.
    821821    if (c >= 0x2A700 && c <= 0x2B73F)
     
    833833}
    834834
    835 bool Font::isCJKIdeographOrSymbol(UChar32 c)
     835bool FontCascade::isCJKIdeographOrSymbol(UChar32 c)
    836836{
    837837    // 0x2C7 Caron, Mandarin Chinese 3rd Tone
     
    915915    if (c >= 0x2FF0 && c <= 0x2FFF)
    916916        return true;
    917    
     917
    918918    // CJK Symbols and Punctuation, excluding 0x3030.
    919919    if (c >= 0x3000 && c < 0x3030)
     
    941941    if (c >= 0x31A0 && c <= 0x31BF)
    942942        return true;
    943  
     943
    944944    // Enclosed CJK Letters and Months.
    945945    if (c >= 0x3200 && c <= 0x32FF)
     
    990990}
    991991
    992 unsigned Font::expansionOpportunityCountInternal(const LChar* characters, size_t length, TextDirection direction, bool& isAfterExpansion)
     992unsigned FontCascade::expansionOpportunityCountInternal(const LChar* characters, size_t length, TextDirection direction, bool& isAfterExpansion)
    993993{
    994994    unsigned count = 0;
     
    10131013}
    10141014
    1015 unsigned Font::expansionOpportunityCountInternal(const UChar* characters, size_t length, TextDirection direction, bool& isAfterExpansion)
     1015unsigned FontCascade::expansionOpportunityCountInternal(const UChar* characters, size_t length, TextDirection direction, bool& isAfterExpansion)
    10161016{
    10171017    static bool expandAroundIdeographs = canExpandAroundIdeographsInComplexText();
     
    10631063}
    10641064
    1065 unsigned Font::expansionOpportunityCount(const StringView& stringView, TextDirection direction, bool& isAfterExpansion)
     1065unsigned FontCascade::expansionOpportunityCount(const StringView& stringView, TextDirection direction, bool& isAfterExpansion)
    10661066{
    10671067    if (stringView.is8Bit())
     
    10701070}
    10711071
    1072 bool Font::canReceiveTextEmphasis(UChar32 c)
     1072bool FontCascade::canReceiveTextEmphasis(UChar32 c)
    10731073{
    10741074    if (U_GET_GC_MASK(c) & (U_GC_Z_MASK | U_GC_CN_MASK | U_GC_CC_MASK | U_GC_CF_MASK))
     
    10831083}
    10841084
    1085 bool Font::isLoadingCustomFonts() const
     1085bool FontCascade::isLoadingCustomFonts() const
    10861086{
    10871087    return m_glyphs && m_glyphs->isLoadingCustomFonts();
  • trunk/Source/WebCore/platform/graphics/FontCascade.h

    r178496 r178510  
    2323 */
    2424
    25 #ifndef Font_h
    26 #define Font_h
     25#ifndef FontCascade_h
     26#define FontCascade_h
    2727
    2828#include "DashArray.h"
     
    107107GlyphToPathTranslator::GlyphUnderlineType computeUnderlineType(const TextRun&, const GlyphBuffer&, int index);
    108108
    109 class Font {
     109class FontCascade {
    110110public:
    111     WEBCORE_EXPORT Font();
    112     WEBCORE_EXPORT Font(const FontDescription&, float letterSpacing, float wordSpacing);
     111    WEBCORE_EXPORT FontCascade();
     112    WEBCORE_EXPORT FontCascade(const FontDescription&, float letterSpacing, float wordSpacing);
    113113    // This constructor is only used if the platform wants to start with a native font.
    114     WEBCORE_EXPORT Font(const FontPlatformData&, bool isPrinting, FontSmoothingMode = AutoSmoothing);
     114    WEBCORE_EXPORT FontCascade(const FontPlatformData&, bool isPrinting, FontSmoothingMode = AutoSmoothing);
    115115
    116116    // FIXME: We should make this constructor platform-independent.
    117117#if PLATFORM(IOS)
    118     Font(const FontPlatformData&, PassRefPtr<FontSelector>);
    119 #endif
    120     ~Font();
    121 
    122     Font(const Font&);
    123     WEBCORE_EXPORT Font& operator=(const Font&);
    124 
    125     WEBCORE_EXPORT bool operator==(const Font& other) const;
    126     bool operator!=(const Font& other) const { return !(*this == other); }
     118    FontCascade(const FontPlatformData&, PassRefPtr<FontSelector>);
     119#endif
     120    ~FontCascade();
     121
     122    FontCascade(const FontCascade&);
     123    WEBCORE_EXPORT FontCascade& operator=(const FontCascade&);
     124
     125    WEBCORE_EXPORT bool operator==(const FontCascade& other) const;
     126    bool operator!=(const FontCascade& other) const { return !(*this == other); }
    127127
    128128    const FontDescription& fontDescription() const { return m_fontDescription; }
     
    244244public:
    245245#if ENABLE(IOS_TEXT_AUTOSIZING)
    246     bool equalForTextAutoSizing(const Font& other) const
     246    bool equalForTextAutoSizing(const FontCascade& other) const
    247247    {
    248248        return m_fontDescription.equalForTextAutoSizing(other.m_fontDescription)
     
    270270    static bool treatAsZeroWidthSpace(UChar c) { return treatAsZeroWidthSpaceInComplexScript(c) || c == 0x200c || c == 0x200d; }
    271271    static bool treatAsZeroWidthSpaceInComplexScript(UChar c) { return c < 0x20 || (c >= 0x7F && c < 0xA0) || c == softHyphen || c == zeroWidthSpace || (c >= 0x200e && c <= 0x200f) || (c >= 0x202a && c <= 0x202e) || c == zeroWidthNoBreakSpace || c == objectReplacementCharacter; }
    272     static bool canReceiveTextEmphasis(UChar32 c);
     272    static bool canReceiveTextEmphasis(UChar32);
    273273
    274274    static inline UChar normalizeSpaces(UChar character)
     
    348348void clearWidthCaches();
    349349
    350 inline Font::~Font()
    351 {
    352 }
    353 
    354 inline const SimpleFontData& Font::primaryFontData() const
     350inline FontCascade::~FontCascade()
     351{
     352}
     353
     354inline const SimpleFontData& FontCascade::primaryFontData() const
    355355{
    356356    ASSERT(m_glyphs);
     
    358358}
    359359
    360 inline const FontRanges& Font::fallbackRangesAt(unsigned index) const
     360inline const FontRanges& FontCascade::fallbackRangesAt(unsigned index) const
    361361{
    362362    ASSERT(m_glyphs);
     
    364364}
    365365
    366 inline bool Font::isFixedPitch() const
     366inline bool FontCascade::isFixedPitch() const
    367367{
    368368    ASSERT(m_glyphs);
     
    370370}
    371371
    372 inline FontSelector* Font::fontSelector() const
     372inline FontSelector* FontCascade::fontSelector() const
    373373{
    374374    return m_glyphs ? m_glyphs->fontSelector() : 0;
    375375}
    376376
    377 inline float Font::tabWidth(const SimpleFontData& fontData, unsigned tabSize, float position) const
     377inline float FontCascade::tabWidth(const SimpleFontData& fontData, unsigned tabSize, float position) const
    378378{
    379379    if (!tabSize)
  • trunk/Source/WebCore/platform/graphics/FontFastPath.cpp

    r178250 r178510  
    2222
    2323#include "config.h"
    24 #include "Font.h"
     24#include "FontCascade.h"
    2525
    2626#include "FloatRect.h"
     
    4242// FIXME: This function may not work if the emphasis mark uses a complex script, but none of the
    4343// standard emphasis marks do so.
    44 bool Font::getEmphasisMarkGlyphData(const AtomicString& mark, GlyphData& glyphData) const
     44bool FontCascade::getEmphasisMarkGlyphData(const AtomicString& mark, GlyphData& glyphData) const
    4545{
    4646    if (mark.isEmpty())
     
    6767}
    6868
    69 int Font::emphasisMarkAscent(const AtomicString& mark) const
     69int FontCascade::emphasisMarkAscent(const AtomicString& mark) const
    7070{
    7171    GlyphData markGlyphData;
     
    8181}
    8282
    83 int Font::emphasisMarkDescent(const AtomicString& mark) const
     83int FontCascade::emphasisMarkDescent(const AtomicString& mark) const
    8484{
    8585    GlyphData markGlyphData;
     
    9595}
    9696
    97 int Font::emphasisMarkHeight(const AtomicString& mark) const
     97int FontCascade::emphasisMarkHeight(const AtomicString& mark) const
    9898{
    9999    GlyphData markGlyphData;
     
    109109}
    110110
    111 float Font::getGlyphsAndAdvancesForSimpleText(const TextRun& run, int from, int to, GlyphBuffer& glyphBuffer, ForTextEmphasisOrNot forTextEmphasis) const
     111float FontCascade::getGlyphsAndAdvancesForSimpleText(const TextRun& run, int from, int to, GlyphBuffer& glyphBuffer, ForTextEmphasisOrNot forTextEmphasis) const
    112112{
    113113    float initialAdvance;
     
    139139}
    140140
    141 float Font::drawSimpleText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to) const
     141float FontCascade::drawSimpleText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to) const
    142142{
    143143    // This glyph buffer holds our glyphs+advances+font data for each glyph.
     
    155155}
    156156
    157 void Font::drawEmphasisMarksForSimpleText(GraphicsContext* context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, int to) const
     157void FontCascade::drawEmphasisMarksForSimpleText(GraphicsContext* context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, int to) const
    158158{
    159159    GlyphBuffer glyphBuffer;
     
    166166}
    167167
    168 void Font::drawGlyphBuffer(GraphicsContext* context, const TextRun& run, const GlyphBuffer& glyphBuffer, FloatPoint& point) const
     168void FontCascade::drawGlyphBuffer(GraphicsContext* context, const TextRun& run, const GlyphBuffer& glyphBuffer, FloatPoint& point) const
    169169{
    170170#if !ENABLE(SVG_FONTS)
     
    232232}
    233233
    234 void Font::drawEmphasisMarks(GraphicsContext* context, const TextRun& run, const GlyphBuffer& glyphBuffer, const AtomicString& mark, const FloatPoint& point) const
     234void FontCascade::drawEmphasisMarks(GraphicsContext* context, const TextRun& run, const GlyphBuffer& glyphBuffer, const AtomicString& mark, const FloatPoint& point) const
    235235{
    236236    GlyphData markGlyphData;
     
    261261}
    262262
    263 float Font::floatWidthForSimpleText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
     263float FontCascade::floatWidthForSimpleText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
    264264{
    265265    WidthIterator it(this, run, fallbackFonts, glyphOverflow);
     
    277277}
    278278
    279 void Font::adjustSelectionRectForSimpleText(const TextRun& run, LayoutRect& selectionRect, int from, int to) const
     279void FontCascade::adjustSelectionRectForSimpleText(const TextRun& run, LayoutRect& selectionRect, int from, int to) const
    280280{
    281281    GlyphBuffer glyphBuffer;
     
    296296}
    297297
    298 int Font::offsetForPositionForSimpleText(const TextRun& run, float x, bool includePartialGlyphs) const
     298int FontCascade::offsetForPositionForSimpleText(const TextRun& run, float x, bool includePartialGlyphs) const
    299299{
    300300    float delta = x;
  • trunk/Source/WebCore/platform/graphics/FontGlyphs.cpp

    r178388 r178510  
    3030#include "FontGlyphs.h"
    3131
    32 #include "Font.h"
    3332#include "FontCache.h"
     33#include "FontCascade.h"
    3434#include "GlyphPage.h"
    3535
     
    265265        return GlyphData();
    266266
    267     if (systemFallbackFontData->platformData().orientation() == Vertical && !systemFallbackFontData->hasVerticalGlyphs() && Font::isCJKIdeographOrSymbol(c))
     267    if (systemFallbackFontData->platformData().orientation() == Vertical && !systemFallbackFontData->hasVerticalGlyphs() && FontCascade::isCJKIdeographOrSymbol(c))
    268268        variant = BrokenIdeographVariant;
    269269
     
    275275
    276276    if (variant == NormalVariant && fallbackGlyphData.fontData) {
    277         if (!Font::isCJKIdeographOrSymbol(c) && fallbackGlyphData.fontData->platformData().orientation() == Vertical && !fallbackGlyphData.fontData->isTextOrientationFallback())
     277        if (!FontCascade::isCJKIdeographOrSymbol(c) && fallbackGlyphData.fontData->platformData().orientation() == Vertical && !fallbackGlyphData.fontData->isTextOrientationFallback())
    278278            fallbackGlyphData = glyphDataForNonCJKCharacterWithGlyphOrientation(c, description.nonCJKGlyphOrientation(), fallbackGlyphData);
    279279    }
     
    323323        if (data.fontData) {
    324324            if (data.fontData->platformData().orientation() == Vertical && !data.fontData->isTextOrientationFallback()) {
    325                 if (!Font::isCJKIdeographOrSymbol(c))
     325                if (!FontCascade::isCJKIdeographOrSymbol(c))
    326326                    return glyphDataForNonCJKCharacterWithGlyphOrientation(c, description.nonCJKGlyphOrientation(), data);
    327327
  • trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp

    r178166 r178510  
    431431#if !PLATFORM(IOS)
    432432#if !USE(WINGDI)
    433 void GraphicsContext::drawText(const Font& font, const TextRun& run, const FloatPoint& point, int from, int to)
     433void GraphicsContext::drawText(const FontCascade& font, const TextRun& run, const FloatPoint& point, int from, int to)
    434434{
    435435    if (paintingDisabled())
     
    440440#endif
    441441#else
    442 float GraphicsContext::drawText(const Font& font, const TextRun& run, const FloatPoint& point, int from, int to)
     442float GraphicsContext::drawText(const FontCascade& font, const TextRun& run, const FloatPoint& point, int from, int to)
    443443{
    444444    if (paintingDisabled())
     
    449449#endif // !PLATFORM(IOS)
    450450
    451 void GraphicsContext::drawGlyphs(const Font& font, const SimpleFontData& fontData, const GlyphBuffer& buffer, int from, int numGlyphs, const FloatPoint& point)
     451void GraphicsContext::drawGlyphs(const FontCascade& font, const SimpleFontData& fontData, const GlyphBuffer& buffer, int from, int numGlyphs, const FloatPoint& point)
    452452{
    453453    if (paintingDisabled())
     
    457457}
    458458
    459 void GraphicsContext::drawEmphasisMarks(const Font& font, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, int to)
     459void GraphicsContext::drawEmphasisMarks(const FontCascade& font, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, int to)
    460460{
    461461    if (paintingDisabled())
     
    466466
    467467// FIXME: Better merge the iOS and non-iOS differences. In particular, make this method use the
    468 // returned width of the drawn text, Font::drawText(), instead of computing it. Ensure that there
     468// returned width of the drawn text, FontCascade::drawText(), instead of computing it. Ensure that there
    469469// aren't noticeable differences in layout with such a change.
    470470#if !PLATFORM(IOS)
    471 void GraphicsContext::drawBidiText(const Font& font, const TextRun& run, const FloatPoint& point, Font::CustomFontNotReadyAction customFontNotReadyAction)
     471void GraphicsContext::drawBidiText(const FontCascade& font, const TextRun& run, const FloatPoint& point, FontCascade::CustomFontNotReadyAction customFontNotReadyAction)
    472472#else
    473 float GraphicsContext::drawBidiText(const Font& font, const TextRun& run, const FloatPoint& point, Font::CustomFontNotReadyAction customFontNotReadyAction, BidiStatus* status, int length)
     473float GraphicsContext::drawBidiText(const FontCascade& font, const TextRun& run, const FloatPoint& point, FontCascade::CustomFontNotReadyAction customFontNotReadyAction, BidiStatus* status, int length)
    474474#endif
    475475{
     
    516516
    517517        bidiRun = bidiRun->next();
    518         // FIXME: Have Font::drawText return the width of what it drew so that we don't have to re-measure here.
     518        // FIXME: Have FontCascade::drawText return the width of what it drew so that we don't have to re-measure here.
    519519        if (bidiRun)
    520520            currPoint.move(font.width(subrun), 0);
  • trunk/Source/WebCore/platform/graphics/GraphicsContext.h

    r177786 r178510  
    3131#include "DashArray.h"
    3232#include "FloatRect.h"
    33 #include "Font.h"
     33#include "FontCascade.h"
    3434#include "Gradient.h"
    3535#include "Image.h"
     
    357357       
    358358#if !PLATFORM(IOS)
    359         void drawText(const Font&, const TextRun&, const FloatPoint&, int from = 0, int to = -1);
     359        void drawText(const FontCascade&, const TextRun&, const FloatPoint&, int from = 0, int to = -1);
    360360#else
    361         float drawText(const Font&, const TextRun&, const FloatPoint&, int from = 0, int to = -1);
    362 #endif
    363         void drawGlyphs(const Font&, const SimpleFontData&, const GlyphBuffer&, int from, int numGlyphs, const FloatPoint&);
    364         void drawEmphasisMarks(const Font&, const TextRun& , const AtomicString& mark, const FloatPoint&, int from = 0, int to = -1);
     361        float drawText(const FontCascade&, const TextRun&, const FloatPoint&, int from = 0, int to = -1);
     362#endif
     363        void drawGlyphs(const FontCascade&, const SimpleFontData&, const GlyphBuffer&, int from, int numGlyphs, const FloatPoint&);
     364        void drawEmphasisMarks(const FontCascade&, const TextRun& , const AtomicString& mark, const FloatPoint&, int from = 0, int to = -1);
    365365#if !PLATFORM(IOS)
    366         void drawBidiText(const Font&, const TextRun&, const FloatPoint&, Font::CustomFontNotReadyAction = Font::DoNotPaintIfFontNotReady);
     366        void drawBidiText(const FontCascade&, const TextRun&, const FloatPoint&, FontCascade::CustomFontNotReadyAction = FontCascade::DoNotPaintIfFontNotReady);
    367367#else
    368         WEBCORE_EXPORT float drawBidiText(const Font&, const TextRun&, const FloatPoint&, Font::CustomFontNotReadyAction = Font::DoNotPaintIfFontNotReady, BidiStatus* = 0, int length = -1);
     368        WEBCORE_EXPORT float drawBidiText(const FontCascade&, const TextRun&, const FloatPoint&, FontCascade::CustomFontNotReadyAction = FontCascade::DoNotPaintIfFontNotReady, BidiStatus* = 0, int length = -1);
    369369#endif
    370370        enum RoundingMode {
  • trunk/Source/WebCore/platform/graphics/SimpleFontData.cpp

    r178388 r178510  
    3434#include "CoreTextSPI.h"
    3535#endif
    36 #include "Font.h"
    3736#include "FontCache.h"
     37#include "FontCascade.h"
    3838#include "OpenTypeMathData.h"
    3939#include <wtf/MathExtras.h>
     
    420420        int codeUnitsLength;
    421421        if (U_IS_BMP(character)) {
    422             codeUnits[0] = Font::normalizeSpaces(character);
     422            codeUnits[0] = FontCascade::normalizeSpaces(character);
    423423            codeUnitsLength = 1;
    424424        } else {
  • trunk/Source/WebCore/platform/graphics/StringTruncator.cpp

    r166448 r178510  
    3030#include "StringTruncator.h"
    3131
    32 #include "Font.h"
     32#include "FontCascade.h"
    3333#include "TextBreakIterator.h"
    3434#include "TextRun.h"
     
    193193}
    194194
    195 static float stringWidth(const Font& renderer, const UChar* characters, unsigned length, bool disableRoundingHacks)
     195static float stringWidth(const FontCascade& renderer, const UChar* characters, unsigned length, bool disableRoundingHacks)
    196196{
    197197    TextRun run(characters, length);
     
    201201}
    202202
    203 static String truncateString(const String& string, float maxWidth, const Font& font, TruncationFunction truncateToBuffer, bool disableRoundingHacks, float* resultWidth = nullptr, bool shouldInsertEllipsis = true,  float customTruncationElementWidth = 0, bool alwaysTruncate = false)
     203static String truncateString(const String& string, float maxWidth, const FontCascade& font, TruncationFunction truncateToBuffer, bool disableRoundingHacks, float* resultWidth = nullptr, bool shouldInsertEllipsis = true,  float customTruncationElementWidth = 0, bool alwaysTruncate = false)
    204204{
    205205    if (string.isEmpty())
     
    296296}
    297297
    298 String StringTruncator::centerTruncate(const String& string, float maxWidth, const Font& font, EnableRoundingHacksOrNot enableRoundingHacks)
     298String StringTruncator::centerTruncate(const String& string, float maxWidth, const FontCascade& font, EnableRoundingHacksOrNot enableRoundingHacks)
    299299{
    300300    return truncateString(string, maxWidth, font, centerTruncateToBuffer, !enableRoundingHacks);
    301301}
    302302
    303 String StringTruncator::rightTruncate(const String& string, float maxWidth, const Font& font, EnableRoundingHacksOrNot enableRoundingHacks)
     303String StringTruncator::rightTruncate(const String& string, float maxWidth, const FontCascade& font, EnableRoundingHacksOrNot enableRoundingHacks)
    304304{
    305305    return truncateString(string, maxWidth, font, rightTruncateToBuffer, !enableRoundingHacks);
    306306}
    307307
    308 float StringTruncator::width(const String& string, const Font& font, EnableRoundingHacksOrNot enableRoundingHacks)
     308float StringTruncator::width(const String& string, const FontCascade& font, EnableRoundingHacksOrNot enableRoundingHacks)
    309309{
    310310    return stringWidth(font, StringView(string).upconvertedCharacters(), string.length(), !enableRoundingHacks);
    311311}
    312312
    313 String StringTruncator::centerTruncate(const String& string, float maxWidth, const Font& font, EnableRoundingHacksOrNot enableRoundingHacks, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth)
     313String StringTruncator::centerTruncate(const String& string, float maxWidth, const FontCascade& font, EnableRoundingHacksOrNot enableRoundingHacks, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth)
    314314{
    315315    return truncateString(string, maxWidth, font, centerTruncateToBuffer, !enableRoundingHacks, &resultWidth, shouldInsertEllipsis, customTruncationElementWidth);
    316316}
    317317
    318 String StringTruncator::rightTruncate(const String& string, float maxWidth, const Font& font, EnableRoundingHacksOrNot enableRoundingHacks, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth)
     318String StringTruncator::rightTruncate(const String& string, float maxWidth, const FontCascade& font, EnableRoundingHacksOrNot enableRoundingHacks, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth)
    319319{
    320320    return truncateString(string, maxWidth, font, rightTruncateToBuffer, !enableRoundingHacks, &resultWidth, shouldInsertEllipsis, customTruncationElementWidth);
    321321}
    322322
    323 String StringTruncator::leftTruncate(const String& string, float maxWidth, const Font& font, EnableRoundingHacksOrNot enableRoundingHacks, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth)
     323String StringTruncator::leftTruncate(const String& string, float maxWidth, const FontCascade& font, EnableRoundingHacksOrNot enableRoundingHacks, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth)
    324324{
    325325    return truncateString(string, maxWidth, font, leftTruncateToBuffer, !enableRoundingHacks, &resultWidth, shouldInsertEllipsis, customTruncationElementWidth);
    326326}
    327327
    328 String StringTruncator::rightClipToCharacter(const String& string, float maxWidth, const Font& font, EnableRoundingHacksOrNot enableRoundingHacks, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth)
     328String StringTruncator::rightClipToCharacter(const String& string, float maxWidth, const FontCascade& font, EnableRoundingHacksOrNot enableRoundingHacks, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth)
    329329{
    330330    return truncateString(string, maxWidth, font, rightClipToCharacterBuffer, !enableRoundingHacks, &resultWidth, shouldInsertEllipsis, customTruncationElementWidth);
    331331}
    332332
    333 String StringTruncator::rightClipToWord(const String& string, float maxWidth, const Font& font, EnableRoundingHacksOrNot enableRoundingHacks, float& resultWidth, bool shouldInsertEllipsis,  float customTruncationElementWidth, bool alwaysTruncate)
     333String StringTruncator::rightClipToWord(const String& string, float maxWidth, const FontCascade& font, EnableRoundingHacksOrNot enableRoundingHacks, float& resultWidth, bool shouldInsertEllipsis,  float customTruncationElementWidth, bool alwaysTruncate)
    334334{
    335335    return truncateString(string, maxWidth, font, rightClipToWordBuffer, !enableRoundingHacks, &resultWidth, shouldInsertEllipsis, customTruncationElementWidth, alwaysTruncate);
  • trunk/Source/WebCore/platform/graphics/StringTruncator.h

    r172849 r178510  
    3434namespace WebCore {
    3535   
    36     class Font;
    37    
    38     class StringTruncator {
    39     public:
    40         enum EnableRoundingHacksOrNot { DisableRoundingHacks, EnableRoundingHacks };
     36class FontCascade;
    4137
    42         WEBCORE_EXPORT static String centerTruncate(const String&, float maxWidth, const Font&, EnableRoundingHacksOrNot = DisableRoundingHacks);
    43         WEBCORE_EXPORT static String rightTruncate(const String&, float maxWidth, const Font&, EnableRoundingHacksOrNot = DisableRoundingHacks);
     38class StringTruncator {
     39public:
     40    enum EnableRoundingHacksOrNot { DisableRoundingHacks, EnableRoundingHacks };
    4441
    45         WEBCORE_EXPORT static String centerTruncate(const String&, float maxWidth, const Font&, EnableRoundingHacksOrNot, float& resultWidth, bool shouldInsertEllipsis = true, float customTruncationElementWidth = 0);
    46         WEBCORE_EXPORT static String rightTruncate(const String&, float maxWidth, const Font&, EnableRoundingHacksOrNot, float& resultWidth, bool shouldInsertEllipsis = true, float customTruncationElementWidth = 0);
    47         WEBCORE_EXPORT static String leftTruncate(const String&, float maxWidth, const Font&, EnableRoundingHacksOrNot, float& resultWidth, bool shouldInsertEllipsis = true, float customTruncationElementWidth = 0);
    48         WEBCORE_EXPORT static String rightClipToCharacter(const String&, float maxWidth, const Font&, EnableRoundingHacksOrNot, float& resultWidth, bool shouldInsertEllipsis = true, float customTruncationElementWidth = 0);
    49         WEBCORE_EXPORT static String rightClipToWord(const String&, float maxWidth, const Font&, EnableRoundingHacksOrNot, float& resultWidth, bool shouldInsertEllipsis = true, float customTruncationElementWidth = 0, bool alwaysTruncate = false);
     42    WEBCORE_EXPORT static String centerTruncate(const String&, float maxWidth, const FontCascade&, EnableRoundingHacksOrNot = DisableRoundingHacks);
     43    WEBCORE_EXPORT static String rightTruncate(const String&, float maxWidth, const FontCascade&, EnableRoundingHacksOrNot = DisableRoundingHacks);
    5044
    51         WEBCORE_EXPORT static float width(const String&, const Font&, EnableRoundingHacksOrNot = DisableRoundingHacks);
    52     };
     45    WEBCORE_EXPORT static String centerTruncate(const String&, float maxWidth, const FontCascade&, EnableRoundingHacksOrNot, float& resultWidth, bool shouldInsertEllipsis = true, float customTruncationElementWidth = 0);
     46    WEBCORE_EXPORT static String rightTruncate(const String&, float maxWidth, const FontCascade&, EnableRoundingHacksOrNot, float& resultWidth, bool shouldInsertEllipsis = true, float customTruncationElementWidth = 0);
     47    WEBCORE_EXPORT static String leftTruncate(const String&, float maxWidth, const FontCascade&, EnableRoundingHacksOrNot, float& resultWidth, bool shouldInsertEllipsis = true, float customTruncationElementWidth = 0);
     48    WEBCORE_EXPORT static String rightClipToCharacter(const String&, float maxWidth, const FontCascade&, EnableRoundingHacksOrNot, float& resultWidth, bool shouldInsertEllipsis = true, float customTruncationElementWidth = 0);
     49    WEBCORE_EXPORT static String rightClipToWord(const String&, float maxWidth, const FontCascade&, EnableRoundingHacksOrNot, float& resultWidth, bool shouldInsertEllipsis = true, float customTruncationElementWidth = 0, bool alwaysTruncate = false);
     50
     51    WEBCORE_EXPORT static float width(const String&, const FontCascade&, EnableRoundingHacksOrNot = DisableRoundingHacks);
     52};
    5353   
    5454} // namespace WebCore
  • trunk/Source/WebCore/platform/graphics/TextRun.h

    r177739 r178510  
    3333class FloatPoint;
    3434class FloatRect;
    35 class Font;
     35class FontCascade;
    3636class GraphicsContext;
    3737class GlyphBuffer;
     
    198198
    199199#if ENABLE(SVG_FONTS)
    200         virtual GlyphData glyphDataForCharacter(const Font&, WidthIterator&, UChar32 character, bool mirror, int currentCharacter, unsigned& advanceLength, String& normalizedSpacesStringCache) = 0;
     200        virtual GlyphData glyphDataForCharacter(const FontCascade&, WidthIterator&, UChar32 character, bool mirror, int currentCharacter, unsigned& advanceLength, String& normalizedSpacesStringCache) = 0;
    201201        virtual void drawSVGGlyphs(GraphicsContext*, const SimpleFontData*, const GlyphBuffer&, int from, int to, const FloatPoint&) const = 0;
    202         virtual float floatWidthUsingSVGFont(const Font&, const TextRun&, int& charsConsumed, String& glyphName) const = 0;
     202        virtual float floatWidthUsingSVGFont(const FontCascade&, const TextRun&, int& charsConsumed, String& glyphName) const = 0;
    203203        virtual bool applySVGKerning(const SimpleFontData*, WidthIterator&, GlyphBuffer*, int from) const = 0;
    204204        virtual std::unique_ptr<GlyphToPathTranslator> createGlyphToPathTranslator(const SimpleFontData&, const TextRun*, const GlyphBuffer&, int from, int numGlyphs, const FloatPoint&) const = 0;
  • trunk/Source/WebCore/platform/graphics/WidthIterator.cpp

    r177955 r178510  
    2323#include "WidthIterator.h"
    2424
    25 #include "Font.h"
     25#include "FontCascade.h"
    2626#include "GlyphBuffer.h"
    2727#include "Latin1TextIterator.h"
     
    3535namespace WebCore {
    3636
    37 WidthIterator::WidthIterator(const Font* font, const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, bool accountForGlyphBounds, bool forTextEmphasis)
     37WidthIterator::WidthIterator(const FontCascade* font, const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, bool accountForGlyphBounds, bool forTextEmphasis)
    3838    : m_font(font)
    3939    , m_run(run)
     
    5858    else {
    5959        bool isAfterExpansion = m_isAfterExpansion;
    60         unsigned expansionOpportunityCount = Font::expansionOpportunityCount(m_run.text(), m_run.ltr() ? LTR : RTL, isAfterExpansion);
     60        unsigned expansionOpportunityCount = FontCascade::expansionOpportunityCount(m_run.text(), m_run.ltr() ? LTR : RTL, isAfterExpansion);
    6161        if (isAfterExpansion && !m_run.allowsTrailingExpansion())
    6262            expansionOpportunityCount--;
     
    230230                width += m_font->letterSpacing();
    231231
    232             static bool expandAroundIdeographs = Font::canExpandAroundIdeographsInComplexText();
    233             bool treatAsSpace = Font::treatAsSpace(character);
    234             if (treatAsSpace || (expandAroundIdeographs && Font::isCJKIdeographOrSymbol(character))) {
     232            static bool expandAroundIdeographs = FontCascade::canExpandAroundIdeographsInComplexText();
     233            bool treatAsSpace = FontCascade::treatAsSpace(character);
     234            if (treatAsSpace || (expandAroundIdeographs && FontCascade::isCJKIdeographOrSymbol(character))) {
    235235                // Distribute the run's total expansion evenly over all expansion opportunities in the run.
    236236                if (m_expansion) {
     
    269269        }
    270270
    271         if (shouldApplyFontTransforms() && glyphBuffer && Font::treatAsSpace(character))
     271        if (shouldApplyFontTransforms() && glyphBuffer && FontCascade::treatAsSpace(character)) {
    272272            charactersTreatedAsSpace.append(std::make_pair(glyphBuffer->size(),
    273273                OriginalAdvancesForCharacterTreatedAsSpace(character == ' ', glyphBuffer->size() ? glyphBuffer->advanceAt(glyphBuffer->size() - 1).width() : 0, width)));
     274        }
    274275
    275276        if (m_accountForGlyphBounds) {
     
    279280        }
    280281
    281         if (m_forTextEmphasis && !Font::canReceiveTextEmphasis(character))
     282        if (m_forTextEmphasis && !FontCascade::canReceiveTextEmphasis(character))
    282283            glyph = 0;
    283284
     
    289290        // Force characters that are used to determine word boundaries for the rounding hack
    290291        // to be integer width, so following words will start on an integer boundary.
    291         if (m_run.applyWordRounding() && Font::isRoundingHackCharacter(character)) {
     292        if (m_run.applyWordRounding() && FontCascade::isRoundingHackCharacter(character)) {
    292293            width = ceilf(width);
    293294
     
    302303            // Check to see if the next character is a "rounding hack character", if so, adjust
    303304            // width so that the total run width will be on an integer boundary.
    304             if ((m_run.applyWordRounding() && static_cast<unsigned>(textIterator.currentCharacter()) < m_run.length() && Font::isRoundingHackCharacter(*(textIterator.characters())))
     305            if ((m_run.applyWordRounding() && static_cast<unsigned>(textIterator.currentCharacter()) < m_run.length() && FontCascade::isRoundingHackCharacter(*(textIterator.characters())))
    305306                || (m_run.applyRunRounding() && static_cast<unsigned>(textIterator.currentCharacter()) >= m_run.length())) {
    306307                float totalWidth = widthSinceLastRounding + width;
  • trunk/Source/WebCore/platform/graphics/WidthIterator.h

    r173349 r178510  
    2323#define WidthIterator_h
    2424
    25 #include "Font.h"
     25#include "FontCascade.h"
    2626#include "SVGGlyph.h"
    2727#include "TextRun.h"
     
    3131namespace WebCore {
    3232
    33 class Font;
     33class FontCascade;
    3434class GlyphBuffer;
    3535class SimpleFontData;
     
    4040    WTF_MAKE_FAST_ALLOCATED;
    4141public:
    42     WidthIterator(const Font*, const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = 0, bool accountForGlyphBounds = false, bool forTextEmphasis = false);
     42    WidthIterator(const FontCascade*, const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = 0, bool accountForGlyphBounds = false, bool forTextEmphasis = false);
    4343
    4444    unsigned advance(int to, GlyphBuffer*);
     
    5959#endif
    6060
    61     static bool supportsTypesettingFeatures(const Font& font)
     61    static bool supportsTypesettingFeatures(const FontCascade& font)
    6262    {
    6363#if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED > 1080)
     
    7171    }
    7272
    73     const Font* m_font;
     73    const FontCascade* m_font;
    7474
    7575    const TextRun& m_run;
  • trunk/Source/WebCore/platform/graphics/cairo/FontCairo.cpp

    r178180 r178510  
    3030
    3131#include "config.h"
    32 #include "Font.h"
     32#include "FontCascade.h"
    3333
    3434#include "AffineTransform.h"
     
    9696}
    9797
    98 void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, const GlyphBuffer& glyphBuffer,
     98void FontCascade::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, const GlyphBuffer& glyphBuffer,
    9999    int from, int numGlyphs, const FloatPoint& point) const
    100100{
     
    291291}
    292292
    293 DashArray Font::dashesForIntersectionsWithRect(const TextRun& run, const FloatPoint& textOrigin, const FloatRect& lineExtents) const
     293DashArray FontCascade::dashesForIntersectionsWithRect(const TextRun& run, const FloatPoint& textOrigin, const FloatRect& lineExtents) const
    294294{
    295295    if (isLoadingCustomFonts())
     
    299299    glyphBuffer.saveOffsetsInString();
    300300    float deltaX;
    301     if (codePath(run) != Font::Complex)
     301    if (codePath(run) != FontCascade::Complex)
    302302        deltaX = getGlyphsAndAdvancesForSimpleText(run, 0, run.length(), glyphBuffer);
    303303    else
  • trunk/Source/WebCore/platform/graphics/cairo/FontCairoHarfbuzzNG.cpp

    r177078 r178510  
    2626
    2727#include "config.h"
    28 #include "Font.h"
     28#include "FontCascade.h"
    2929
    3030#include "GraphicsContext.h"
     
    4040
    4141
    42 float Font::getGlyphsAndAdvancesForComplexText(const TextRun& run, int, int, GlyphBuffer& glyphBuffer, ForTextEmphasisOrNot /* forTextEmphasis */) const
     42float FontCascade::getGlyphsAndAdvancesForComplexText(const TextRun& run, int, int, GlyphBuffer& glyphBuffer, ForTextEmphasisOrNot /* forTextEmphasis */) const
    4343{
    4444    HarfBuzzShaper shaper(this, run);
     
    5151    return 0;
    5252}
    53 float Font::drawComplexText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to) const
     53float FontCascade::drawComplexText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to) const
    5454{
    5555    // This glyph buffer holds our glyphs + advances + font data for each glyph.
     
    6969}
    7070
    71 void Font::drawEmphasisMarksForComplexText(GraphicsContext* /* context */, const TextRun& /* run */, const AtomicString& /* mark */, const FloatPoint& /* point */, int /* from */, int /* to */) const
     71void FontCascade::drawEmphasisMarksForComplexText(GraphicsContext* /* context */, const TextRun& /* run */, const AtomicString& /* mark */, const FloatPoint& /* point */, int /* from */, int /* to */) const
    7272{
    7373    notImplemented();
    7474}
    7575
    76 bool Font::canReturnFallbackFontsForComplexText()
     76bool FontCascade::canReturnFallbackFontsForComplexText()
    7777{
    7878    return false;
    7979}
    8080
    81 bool Font::canExpandAroundIdeographsInComplexText()
     81bool FontCascade::canExpandAroundIdeographsInComplexText()
    8282{
    8383    return false;
    8484}
    8585
    86 float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>*, GlyphOverflow*) const
     86float FontCascade::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>*, GlyphOverflow*) const
    8787{
    8888    HarfBuzzShaper shaper(this, run);
     
    9393}
    9494
    95 int Font::offsetForPositionForComplexText(const TextRun& run, float x, bool) const
     95int FontCascade::offsetForPositionForComplexText(const TextRun& run, float x, bool) const
    9696{
    9797    HarfBuzzShaper shaper(this, run);
     
    102102}
    103103
    104 void Font::adjustSelectionRectForComplexText(const TextRun& run, LayoutRect& selectionRect, int from, int to) const
     104void FontCascade::adjustSelectionRectForComplexText(const TextRun& run, LayoutRect& selectionRect, int from, int to) const
    105105{
    106106    HarfBuzzShaper shaper(this, run);
  • trunk/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp

    r178301 r178510  
    2323#include "FontCache.h"
    2424
    25 #include "Font.h"
    2625#include "OwnPtrCairo.h"
    2726#include "RefPtrCairo.h"
  • trunk/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp

    r178133 r178510  
    3636#include "FloatConversion.h"
    3737#include "FloatRect.h"
    38 #include "Font.h"
    3938#include "FontCache.h"
    4039#include "FontDescription.h"
  • trunk/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaper.cpp

    r178166 r178510  
    3232#include "HarfBuzzShaper.h"
    3333
    34 #include "Font.h"
     34#include "FontCascade.h"
    3535#include "HarfBuzzFace.h"
    3636#include "SurrogatePairAwareTextIterator.h"
     
    174174        U16_NEXT(source, nextPosition, length, character);
    175175        // Don't normalize tabs as they are not treated as spaces for word-end.
    176         if (Font::treatAsSpace(character) && character != '\t')
     176        if (FontCascade::treatAsSpace(character) && character != '\t')
    177177            character = ' ';
    178         else if (Font::treatAsZeroWidthSpaceInComplexScript(character))
     178        else if (FontCascade::treatAsZeroWidthSpaceInComplexScript(character))
    179179            character = zeroWidthSpace;
    180180        U16_APPEND(destination, position, length, character, error);
     
    184184}
    185185
    186 HarfBuzzShaper::HarfBuzzShaper(const Font* font, const TextRun& run)
     186HarfBuzzShaper::HarfBuzzShaper(const FontCascade* font, const TextRun& run)
    187187    : m_font(font)
    188188    , m_normalizedBufferLength(0)
     
    215215        U16_NEXT(source, nextPosition, length, character);
    216216        // Don't normalize tabs as they are not treated as spaces for word-end
    217         if (Font::treatAsSpace(character) && character != '\t')
     217        if (FontCascade::treatAsSpace(character) && character != '\t')
    218218            character = ' ';
    219         else if (Font::treatAsZeroWidthSpace(character))
     219        else if (FontCascade::treatAsZeroWidthSpace(character))
    220220            character = zeroWidthSpace;
    221221        else if (normalizeMode == HarfBuzzShaper::NormalizeMirrorChars)
     
    416416
    417417        for (iterator.advance(clusterLength); iterator.consume(character, clusterLength); iterator.advance(clusterLength)) {
    418             if (Font::treatAsZeroWidthSpace(character))
     418            if (FontCascade::treatAsZeroWidthSpace(character))
    419419                continue;
    420420
     
    537537        glyphToCharacterIndexes[i] = glyphInfos[i].cluster;
    538538
    539         if (isClusterEnd && !Font::treatAsZeroWidthSpace(m_normalizedBuffer[currentCharacterIndex]))
     539        if (isClusterEnd && !FontCascade::treatAsZeroWidthSpace(m_normalizedBuffer[currentCharacterIndex]))
    540540            spacing += m_letterSpacing;
    541541
  • trunk/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaper.h

    r175156 r178510  
    4545namespace WebCore {
    4646
    47 class Font;
     47class FontCascade;
    4848class SimpleFontData;
    4949
     
    5555    };
    5656
    57     HarfBuzzShaper(const Font*, const TextRun&);
     57    HarfBuzzShaper(const FontCascade*, const TextRun&);
    5858    virtual ~HarfBuzzShaper();
    5959
     
    123123    GlyphBufferAdvance createGlyphBufferAdvance(float, float);
    124124
    125     const Font* m_font;
     125    const FontCascade* m_font;
    126126    std::unique_ptr<UChar[]> m_normalizedBuffer;
    127127    unsigned m_normalizedBufferLength;
  • trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm

    r178180 r178510  
    3232#import "CoreGraphicsSPI.h"
    3333#import "CoreTextSPI.h"
    34 #import "Font.h"
     34#import "FontCascade.h"
    3535#import "RenderThemeIOS.h"
    3636#import <wtf/NeverDestroyed.h>
  • trunk/Source/WebCore/platform/graphics/ios/SimpleFontDataIOS.mm

    r178133 r178510  
    3030#import "BlockExceptions.h"
    3131#import "CoreGraphicsSPI.h"
    32 #import "Font.h"
    3332#import "FontCache.h"
     33#import "FontCascade.h"
    3434#import "FontDescription.h"
    3535#import "FontServicesIOS.h"
  • trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp

    r177968 r178510  
    2727
    2828#include "FloatSize.h"
    29 #include "Font.h"
     29#include "FontCascade.h"
    3030#include "RenderBlock.h"
    3131#include "RenderText.h"
     
    4444class TextLayout {
    4545public:
    46     static bool isNeeded(RenderText* text, const Font& font)
     46    static bool isNeeded(RenderText* text, const FontCascade& font)
    4747    {
    4848        TextRun run = RenderBlock::constructTextRun(text, font, text, text->style());
    49         return font.codePath(run) == Font::Complex;
    50     }
    51 
    52     TextLayout(RenderText* text, const Font& font, float xPos)
     49        return font.codePath(run) == FontCascade::Complex;
     50    }
     51
     52    TextLayout(RenderText* text, const FontCascade& font, float xPos)
    5353        : m_font(font)
    5454        , m_run(constructTextRun(text, font, xPos))
     
    6161        m_controller->advance(from, 0, ByWholeGlyphs, fallbackFonts);
    6262        float beforeWidth = m_controller->runWidthSoFar();
    63         if (m_font.wordSpacing() && from && Font::treatAsSpace(m_run[from]))
     63        if (m_font.wordSpacing() && from && FontCascade::treatAsSpace(m_run[from]))
    6464            beforeWidth += m_font.wordSpacing();
    6565        m_controller->advance(from + len, 0, ByWholeGlyphs, fallbackFonts);
     
    6969
    7070private:
    71     static TextRun constructTextRun(RenderText* text, const Font& font, float xPos)
     71    static TextRun constructTextRun(RenderText* text, const FontCascade& font, float xPos)
    7272    {
    7373        TextRun run = RenderBlock::constructTextRun(text, font, text, text->style());
     
    7979    }
    8080
    81     // ComplexTextController has only references to its Font and TextRun so they must be kept alive here.
    82     Font m_font;
     81    // ComplexTextController has only references to its FontCascade and TextRun so they must be kept alive here.
     82    FontCascade m_font;
    8383    TextRun m_run;
    8484    std::unique_ptr<ComplexTextController> m_controller;
    8585};
    8686
    87 PassOwnPtr<TextLayout> Font::createLayout(RenderText* text, float xPos, bool collapseWhiteSpace) const
     87PassOwnPtr<TextLayout> FontCascade::createLayout(RenderText* text, float xPos, bool collapseWhiteSpace) const
    8888{
    8989    if (!collapseWhiteSpace || !TextLayout::isNeeded(text, *this))
     
    9292}
    9393
    94 void Font::deleteLayout(TextLayout* layout)
     94void FontCascade::deleteLayout(TextLayout* layout)
    9595{
    9696    delete layout;
    9797}
    9898
    99 float Font::width(TextLayout& layout, unsigned from, unsigned len, HashSet<const SimpleFontData*>* fallbackFonts)
     99float FontCascade::width(TextLayout& layout, unsigned from, unsigned len, HashSet<const SimpleFontData*>* fallbackFonts)
    100100{
    101101    return layout.width(from, len, fallbackFonts);
     
    116116}
    117117
    118 ComplexTextController::ComplexTextController(const Font* font, const TextRun& run, bool mayUseNaturalWritingDirection, HashSet<const SimpleFontData*>* fallbackFonts, bool forTextEmphasis)
     118ComplexTextController::ComplexTextController(const FontCascade* font, const TextRun& run, bool mayUseNaturalWritingDirection, HashSet<const SimpleFontData*>* fallbackFonts, bool forTextEmphasis)
    119119    : m_font(*font)
    120120    , m_run(run)
     
    145145    else {
    146146        bool isAfterExpansion = m_afterExpansion;
    147         unsigned expansionOpportunityCount = Font::expansionOpportunityCount(m_run.text(), m_run.ltr() ? LTR : RTL, isAfterExpansion);
     147        unsigned expansionOpportunityCount = FontCascade::expansionOpportunityCount(m_run.text(), m_run.ltr() ? LTR : RTL, isAfterExpansion);
    148148        if (isAfterExpansion && !m_run.allowsTrailingExpansion())
    149149            expansionOpportunityCount--;
     
    616616                nextCh = *(m_complexTextRuns[r + 1]->characters() + m_complexTextRuns[r + 1]->indexAt(0));
    617617
    618             bool treatAsSpace = Font::treatAsSpace(ch);
     618            bool treatAsSpace = FontCascade::treatAsSpace(ch);
    619619            CGGlyph glyph = treatAsSpace ? fontData.spaceGlyph() : glyphs[i];
    620620            CGSize advance = treatAsSpace ? CGSizeMake(spaceWidth, advances[i].height) : advances[i];
     
    626626            if (ch == '\t' && m_run.allowTabs())
    627627                advance.width = m_font.tabWidth(fontData, m_run.tabSize(), m_run.xPos() + m_totalWidth + widthSinceLastCommit);
    628             else if (Font::treatAsZeroWidthSpace(ch) && !treatAsSpace) {
     628            else if (FontCascade::treatAsZeroWidthSpace(ch) && !treatAsSpace) {
    629629                advance.width = 0;
    630630                glyph = fontData.spaceGlyph();
     
    652652
    653653                // Handle justification and word-spacing.
    654                 if (treatAsSpace || Font::isCJKIdeographOrSymbol(ch)) {
     654                if (treatAsSpace || FontCascade::isCJKIdeographOrSymbol(ch)) {
    655655                    // Distribute the run's total expansion evenly over all expansion opportunities in the run.
    656656                    if (m_expansion) {
     
    686686            // Force characters that are used to determine word boundaries for the rounding hack
    687687            // to be integer width, so the following words will start on an integer boundary.
    688             if (m_run.applyWordRounding() && Font::isRoundingHackCharacter(ch))
     688            if (m_run.applyWordRounding() && FontCascade::isRoundingHackCharacter(ch))
    689689                advance.width = ceilCGFloat(advance.width);
    690690
    691691            // Check to see if the next character is a "rounding hack character", if so, adjust the
    692             // width so that the total run width will be on an integer boundary.
    693             if ((m_run.applyWordRounding() && !lastGlyph && Font::isRoundingHackCharacter(nextCh)) || (m_run.applyRunRounding() && lastGlyph)) {
     692            // width so that the total run width will be on an integer boundary.
     693            bool needsRoundingForCharacter = m_run.applyWordRounding() && !lastGlyph && FontCascade::isRoundingHackCharacter(nextCh);
     694            if (needsRoundingForCharacter || (m_run.applyRunRounding() && lastGlyph)) {
    694695                CGFloat totalWidth = widthSinceLastCommit + advance.width;
    695696                widthSinceLastCommit = ceilCGFloat(totalWidth);
     
    710711
    711712            // FIXME: Combining marks should receive a text emphasis mark if they are combine with a space.
    712             if (m_forTextEmphasis && (!Font::canReceiveTextEmphasis(ch) || (U_GET_GC_MASK(ch) & U_GC_M_MASK)))
     713            if (m_forTextEmphasis && (!FontCascade::canReceiveTextEmphasis(ch) || (U_GET_GC_MASK(ch) & U_GC_M_MASK)))
    713714                glyph = 0;
    714715
  • trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.h

    r177955 r178510  
    4141namespace WebCore {
    4242
    43 class Font;
     43class FontCascade;
    4444class SimpleFontData;
    4545class TextRun;
     
    5151class ComplexTextController {
    5252public:
    53     ComplexTextController(const Font*, const TextRun&, bool mayUseNaturalWritingDirection = false, HashSet<const SimpleFontData*>* fallbackFonts = 0, bool forTextEmphasis = false);
     53    ComplexTextController(const FontCascade*, const TextRun&, bool mayUseNaturalWritingDirection = false, HashSet<const SimpleFontData*>* fallbackFonts = 0, bool forTextEmphasis = false);
    5454
    5555    // Advance and emit glyphs up to the specified character.
     
    139139    Vector<unsigned, 16> m_glyphCountFromStartToIndex;
    140140
    141     const Font& m_font;
     141    const FontCascade& m_font;
    142142    const TextRun& m_run;
    143143    bool m_isLTROnly;
  • trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm

    r178388 r178510  
    2828
    2929#include "CoreTextSPI.h"
    30 #include "Font.h"
    3130#include "FontCache.h"
     31#include "FontCascade.h"
    3232#include "TextRun.h"
    3333#include "WebCoreSystemInterface.h"
     
    4141@interface WebCascadeList : NSArray {
    4242    @private
    43     const WebCore::Font* _font;
     43    const WebCore::FontCascade* _font;
    4444    UChar32 _character;
    4545    NSUInteger _count;
     
    4747}
    4848
    49 - (id)initWithFont:(const WebCore::Font*)font character:(UChar32)character;
     49- (id)initWithFont:(const WebCore::FontCascade*)font character:(UChar32)character;
    5050
    5151@end
     
    5353@implementation WebCascadeList
    5454
    55 - (id)initWithFont:(const WebCore::Font*)font character:(UChar32)character
     55- (id)initWithFont:(const WebCore::FontCascade*)font character:(UChar32)character
    5656{
    5757    if (!(self = [super init]))
     
    6161    _character = character;
    6262
    63     // By the time a WebCascadeList is used, the Font has already been asked to realize all of its
     63    // By the time a WebCascadeList is used, the FontCascade has already been asked to realize all of its
    6464    // FontData, so this loop does not hit the FontCache.
    6565    while (!_font->fallbackRangesAt(_count).isNull())
  • trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm

    r178180 r178510  
    3434
    3535#import "CoreGraphicsSPI.h"
    36 #import "Font.h"
     36#import "FontCascade.h"
    3737#import "SimpleFontData.h"
    3838#import "FontPlatformData.h"
  • trunk/Source/WebCore/platform/graphics/mac/FontComplexTextMac.cpp

    r178389 r178510  
    2424
    2525#include "config.h"
    26 #include "Font.h"
     26#include "FontCascade.h"
    2727
    2828#include "ComplexTextController.h"
     
    3838namespace WebCore {
    3939
    40 void Font::adjustSelectionRectForComplexText(const TextRun& run, LayoutRect& selectionRect, int from, int to) const
     40void FontCascade::adjustSelectionRectForComplexText(const TextRun& run, LayoutRect& selectionRect, int from, int to) const
    4141{
    4242    ComplexTextController controller(this, run);
     
    5353}
    5454
    55 float Font::getGlyphsAndAdvancesForComplexText(const TextRun& run, int from, int to, GlyphBuffer& glyphBuffer, ForTextEmphasisOrNot forTextEmphasis) const
     55float FontCascade::getGlyphsAndAdvancesForComplexText(const TextRun& run, int from, int to, GlyphBuffer& glyphBuffer, ForTextEmphasisOrNot forTextEmphasis) const
    5656{
    5757    float initialAdvance;
     
    7676}
    7777
    78 float Font::drawComplexText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to) const
     78float FontCascade::drawComplexText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to) const
    7979{
    8080    // This glyph buffer holds our glyphs + advances + font data for each glyph.
     
    9494}
    9595
    96 void Font::drawEmphasisMarksForComplexText(GraphicsContext* context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, int to) const
     96void FontCascade::drawEmphasisMarksForComplexText(GraphicsContext* context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, int to) const
    9797{
    9898    GlyphBuffer glyphBuffer;
     
    105105}
    106106
    107 float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
     107float FontCascade::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
    108108{
    109109    ComplexTextController controller(this, run, true, fallbackFonts);
     
    117117}
    118118
    119 int Font::offsetForPositionForComplexText(const TextRun& run, float x, bool includePartialGlyphs) const
     119int FontCascade::offsetForPositionForComplexText(const TextRun& run, float x, bool includePartialGlyphs) const
    120120{
    121121    ComplexTextController controller(this, run);
     
    123123}
    124124
    125 const SimpleFontData* Font::fontDataForCombiningCharacterSequence(const UChar* characters, size_t length, FontDataVariant variant) const
     125const SimpleFontData* FontCascade::fontDataForCombiningCharacterSequence(const UChar* characters, size_t length, FontDataVariant variant) const
    126126{
    127127    UChar32 baseCharacter;
  • trunk/Source/WebCore/platform/graphics/mac/FontMac.mm

    r178180 r178510  
    2222
    2323#import "config.h"
    24 #import "Font.h"
     24#import "FontCascade.h"
    2525
    2626#import "CoreGraphicsSPI.h"
     
    5959namespace WebCore {
    6060
    61 bool Font::canReturnFallbackFontsForComplexText()
     61bool FontCascade::canReturnFallbackFontsForComplexText()
    6262{
    6363    return true;
    6464}
    6565
    66 bool Font::canExpandAroundIdeographsInComplexText()
     66bool FontCascade::canExpandAroundIdeographsInComplexText()
    6767{
    6868    return true;
     
    196196#endif
    197197
    198 void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, const GlyphBuffer& glyphBuffer, int from, int numGlyphs, const FloatPoint& anchorPoint) const
     198void FontCascade::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, const GlyphBuffer& glyphBuffer, int from, int numGlyphs, const FloatPoint& anchorPoint) const
    199199{
    200200    const FontPlatformData& platformData = font->platformData();
     
    527527}
    528528
    529 DashArray Font::dashesForIntersectionsWithRect(const TextRun& run, const FloatPoint& textOrigin, const FloatRect& lineExtents) const
     529DashArray FontCascade::dashesForIntersectionsWithRect(const TextRun& run, const FloatPoint& textOrigin, const FloatRect& lineExtents) const
    530530{
    531531    if (isLoadingCustomFonts())
     
    535535    glyphBuffer.saveOffsetsInString();
    536536    float deltaX;
    537     if (codePath(run) != Font::Complex)
     537    if (codePath(run) != FontCascade::Complex)
    538538        deltaX = getGlyphsAndAdvancesForSimpleText(run, 0, run.length(), glyphBuffer);
    539539    else
     
    591591#endif
    592592
    593 bool Font::primaryFontDataIsSystemFont() const
     593bool FontCascade::primaryFontDataIsSystemFont() const
    594594{
    595595#if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED > 1090
  • trunk/Source/WebCore/platform/graphics/mac/GlyphPageMac.cpp

    r178047 r178510  
    3232#include "CoreGraphicsSPI.h"
    3333#include "CoreTextSPI.h"
    34 #include "Font.h"
     34#include "FontCascade.h"
    3535#include "SimpleFontData.h"
    3636#include "WebCoreSystemInterface.h"
     
    4848        // Ideographs don't have a vertical variant or width variants.
    4949        for (unsigned i = 0; i < bufferLength; ++i) {
    50             if (!Font::isCJKIdeograph(buffer[i]))
     50            if (!FontCascade::isCJKIdeograph(buffer[i]))
    5151                return true;
    5252        }
  • trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm

    r178142 r178510  
    3333#import "CoreTextSPI.h"
    3434#import "FloatRect.h"
    35 #import "Font.h"
    3635#import "FontCache.h"
     36#import "FontCascade.h"
    3737#import "FontDescription.h"
    3838#import "SharedBuffer.h"
  • trunk/Source/WebCore/platform/graphics/win/FontCGWin.cpp

    r170947 r178510  
    2525
    2626#include "config.h"
    27 #include "Font.h"
     27#include "FontCascade.h"
    2828
    2929#include "AffineTransform.h"
     
    128128}
    129129
    130 void Font::drawGlyphs(GraphicsContext* graphicsContext, const SimpleFontData* font, const GlyphBuffer& glyphBuffer,
     130void FontCascade::drawGlyphs(GraphicsContext* graphicsContext, const SimpleFontData* font, const GlyphBuffer& glyphBuffer,
    131131    int from, int numGlyphs, const FloatPoint& point) const
    132132{
  • trunk/Source/WebCore/platform/graphics/win/FontCacheWin.cpp

    r178142 r178510  
    3030#include <winsock2.h>
    3131#include "FontCache.h"
    32 #include "Font.h"
    3332#include "HWndDC.h"
    3433#include "SimpleFontData.h"
  • trunk/Source/WebCore/platform/graphics/win/FontWin.cpp

    r170947 r178510  
    2525
    2626#include "config.h"
    27 #include "Font.h"
     27#include "FontCascade.h"
    2828
    2929#include "FontGlyphs.h"
     
    4242namespace WebCore {
    4343
    44 bool Font::canReturnFallbackFontsForComplexText()
     44bool FontCascade::canReturnFallbackFontsForComplexText()
    4545{
    4646    return true;
    4747}
    4848
    49 bool Font::canExpandAroundIdeographsInComplexText()
     49bool FontCascade::canExpandAroundIdeographsInComplexText()
    5050{
    5151    return false;
    5252}
    5353
    54 void Font::adjustSelectionRectForComplexText(const TextRun& run, LayoutRect& selectionRect, int from, int to) const
     54void FontCascade::adjustSelectionRectForComplexText(const TextRun& run, LayoutRect& selectionRect, int from, int to) const
    5555{
    5656    UniscribeController it(this, run);
     
    6868}
    6969
    70 float Font::getGlyphsAndAdvancesForComplexText(const TextRun& run, int from, int to, GlyphBuffer& glyphBuffer, ForTextEmphasisOrNot forTextEmphasis) const
     70float FontCascade::getGlyphsAndAdvancesForComplexText(const TextRun& run, int from, int to, GlyphBuffer& glyphBuffer, ForTextEmphasisOrNot forTextEmphasis) const
    7171{
    7272    if (forTextEmphasis) {
     
    9393}
    9494
    95 float Font::drawComplexText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to) const
     95float FontCascade::drawComplexText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to) const
    9696{
    9797    // This glyph buffer holds our glyphs + advances + font data for each glyph.
     
    110110}
    111111
    112 void Font::drawEmphasisMarksForComplexText(GraphicsContext* context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, int to) const
     112void FontCascade::drawEmphasisMarksForComplexText(GraphicsContext* context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, int to) const
    113113{
    114114    GlyphBuffer glyphBuffer;
     
    121121}
    122122
    123 float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
     123float FontCascade::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
    124124{
    125125    UniscribeController controller(this, run, fallbackFonts);
     
    134134}
    135135
    136 int Font::offsetForPositionForComplexText(const TextRun& run, float xFloat, bool includePartialGlyphs) const
     136int FontCascade::offsetForPositionForComplexText(const TextRun& run, float xFloat, bool includePartialGlyphs) const
    137137{
    138138    // FIXME: This truncation is not a problem for HTML, but only affects SVG, which passes floating-point numbers
    139     // to Font::offsetForPosition(). Bug http://webkit.org/b/40673 tracks fixing this problem.
     139    // to FontCascade::offsetForPosition(). Bug http://webkit.org/b/40673 tracks fixing this problem.
    140140    int x = static_cast<int>(xFloat);
    141141
  • trunk/Source/WebCore/platform/graphics/win/SimpleFontDataCGWin.cpp

    r177876 r178510  
    3131
    3232#include "FloatRect.h"
    33 #include "Font.h"
    3433#include "FontCache.h"
    3534#include "FontDescription.h"
  • trunk/Source/WebCore/platform/graphics/win/SimpleFontDataCairoWin.cpp

    r176298 r178510  
    3232#include <windows.h>
    3333
    34 #include "Font.h"
    3534#include "FontCache.h"
    3635#include "FontDescription.h"
  • trunk/Source/WebCore/platform/graphics/win/SimpleFontDataWin.cpp

    r177847 r178510  
    3030#include "SimpleFontData.h"
    3131
    32 #include "Font.h"
    3332#include "FontCache.h"
    3433#include "FloatRect.h"
  • trunk/Source/WebCore/platform/graphics/win/UniscribeController.cpp

    r177955 r178510  
    2626#include "config.h"
    2727#include "UniscribeController.h"
    28 #include "Font.h"
     28#include "FontCascade.h"
    2929#include "HWndDC.h"
    3030#include "SimpleFontData.h"
     
    4242// take the GlyphBuffer as an arg so that we don't have to populate the glyph buffer when
    4343// measuring.
    44 UniscribeController::UniscribeController(const Font* font, const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts)
     44UniscribeController::UniscribeController(const FontCascade* font, const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts)
    4545    : m_font(*font)
    4646    , m_run(run)
     
    6464        float numSpaces = 0;
    6565        for (int s = 0; s < m_run.length(); s++) {
    66             if (Font::treatAsSpace(m_run[s]))
     66            if (FontCascade::treatAsSpace(m_run[s]))
    6767                numSpaces++;
    6868        }
     
    288288    for (int k = 0; k < len; k++) {
    289289        UChar ch = *(str + k);
    290         bool treatAsSpace = Font::treatAsSpace(ch);
    291         bool treatAsZeroWidthSpace = Font::treatAsZeroWidthSpace(ch);
     290        bool treatAsSpace = FontCascade::treatAsSpace(ch);
     291        bool treatAsZeroWidthSpace = FontCascade::treatAsZeroWidthSpace(ch);
    292292        if (treatAsSpace || treatAsZeroWidthSpace) {
    293293            // Substitute in the space glyph at the appropriate place in the glyphs
     
    352352                        candidateSpace = *(m_run.data16(characterIndex - 1));
    353353
    354                     if (!Font::treatAsSpace(candidateSpace))
     354                    if (!FontCascade::treatAsSpace(candidateSpace))
    355355                        advance += m_font.wordSpacing();
    356356                }
  • trunk/Source/WebCore/platform/graphics/win/UniscribeController.h

    r110503 r178510  
    2727#define UniscribeController_h
    2828
     29#include "FontCascade.h"
     30#include "GlyphBuffer.h"
    2931#include <usp10.h>
    30 #include "Font.h"
    31 #include "GlyphBuffer.h"
    3232#include <wtf/Vector.h>
    3333
     
    3636class UniscribeController {
    3737public:
    38     UniscribeController(const Font*, const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = 0);
     38    UniscribeController(const FontCascade*, const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = 0);
    3939
    4040    // Advance and measure/place up to the specified character.
     
    6161               Vector<SCRIPT_VISATTR>& visualAttributes);
    6262
    63     const Font& m_font;
     63    const FontCascade& m_font;
    6464    const TextRun& m_run;
    6565    HashSet<const SimpleFontData*>* m_fallbackFonts;
  • trunk/Source/WebCore/platform/ios/WidgetIOS.mm

    r165676 r178510  
    3030#import "Cursor.h"
    3131#import "Document.h"
    32 #import "Font.h"
     32#import "FontCascade.h"
    3333#import "Frame.h"
    3434#import "GraphicsContext.h"
  • trunk/Source/WebCore/platform/ios/wak/WKGraphics.mm

    r176140 r178510  
    3030
    3131#import "CoreGraphicsSPI.h"
    32 #import "Font.h"
     32#import "FontCascade.h"
    3333#import "WebCoreSystemInterface.h"
    3434#import "WebCoreThread.h"
  • trunk/Source/WebCore/platform/mac/DragImageMac.mm

    r178305 r178510  
    3030#import "BitmapImage.h"
    3131#import "CoreGraphicsSPI.h"
    32 #import "Font.h"
     32#import "FontCascade.h"
    3333#import "FontDescription.h"
    3434#import "FontSelector.h"
     
    158158// FIXME - we should move all the functionality of NSString extras to WebCore
    159159   
    160 static Font& fontFromNSFont(NSFont *font)
     160static FontCascade& fontFromNSFont(NSFont *font)
    161161{
    162162    static NSFont *currentFont;
    163     DEPRECATED_DEFINE_STATIC_LOCAL(Font, currentRenderer, ());
     163    DEPRECATED_DEFINE_STATIC_LOCAL(FontCascade, currentRenderer, ());
    164164   
    165165    if ([font isEqual:currentFont])
     
    170170    CFRetain(currentFont);
    171171    FontPlatformData f(font, [font pointSize]);
    172     currentRenderer = Font(f, ![[NSGraphicsContext currentContext] isDrawingToScreen]);
     172    currentRenderer = FontCascade(f, ![[NSGraphicsContext currentContext] isDrawingToScreen]);
    173173    return currentRenderer;
    174174}
     
    193193   
    194194    if (canUseFastRenderer(buffer.data(), length)) {
    195         Font webCoreFont(FontPlatformData(font, [font pointSize]), ![[NSGraphicsContext currentContext] isDrawingToScreen]);
     195        FontCascade webCoreFont(FontPlatformData(font, [font pointSize]), ![[NSGraphicsContext currentContext] isDrawingToScreen]);
    196196        TextRun run(buffer.data(), length);
    197197        run.disableRoundingHacks();
     
    225225            CGContextScaleCTM(cgContext, 1, -1);
    226226           
    227         Font webCoreFont(FontPlatformData(font, [font pointSize]), ![nsContext isDrawingToScreen], Antialiased);
     227        FontCascade webCoreFont(FontPlatformData(font, [font pointSize]), ![nsContext isDrawingToScreen], Antialiased);
    228228        TextRun run(buffer.data(), length);
    229229        run.disableRoundingHacks();
  • trunk/Source/WebCore/platform/mac/ThemeMac.h

    r169928 r178510  
    4242    virtual int baselinePositionAdjustment(ControlPart) const;
    4343
    44     virtual FontDescription controlFont(ControlPart, const Font&, float zoomFactor) const;
     44    virtual FontDescription controlFont(ControlPart, const FontCascade&, float zoomFactor) const;
    4545   
    46     virtual LengthSize controlSize(ControlPart, const Font&, const LengthSize&, float zoomFactor) const;
    47     virtual LengthSize minimumControlSize(ControlPart, const Font&, float zoomFactor) const;
     46    virtual LengthSize controlSize(ControlPart, const FontCascade&, const LengthSize&, float zoomFactor) const;
     47    virtual LengthSize minimumControlSize(ControlPart, const FontCascade&, float zoomFactor) const;
    4848
    49     virtual LengthBox controlPadding(ControlPart, const Font&, const LengthBox& zoomedBox, float zoomFactor) const;
    50     virtual LengthBox controlBorder(ControlPart, const Font&, const LengthBox& zoomedBox, float zoomFactor) const;
     49    virtual LengthBox controlPadding(ControlPart, const FontCascade&, const LengthBox& zoomedBox, float zoomFactor) const;
     50    virtual LengthBox controlBorder(ControlPart, const FontCascade&, const LengthBox& zoomedBox, float zoomFactor) const;
    5151
    5252    virtual bool controlRequiresPreWhiteSpace(ControlPart part) const { return part == PushButtonPart; }
  • trunk/Source/WebCore/platform/mac/ThemeMac.mm

    r178397 r178510  
    150150// Helper functions used by a bunch of different control parts.
    151151
    152 static NSControlSize controlSizeForFont(const Font& font)
     152static NSControlSize controlSizeForFont(const FontCascade& font)
    153153{
    154154    int fontSize = font.pixelSize();
     
    173173}
    174174
    175 static LengthSize sizeFromFont(const Font& font, const LengthSize& zoomedSize, float zoomFactor, const std::array<IntSize, 3>& sizes)
     175static LengthSize sizeFromFont(const FontCascade& font, const LengthSize& zoomedSize, float zoomFactor, const std::array<IntSize, 3>& sizes)
    176176{
    177177    return sizeFromNSControlSize(controlSizeForFont(font), zoomedSize, zoomFactor, sizes);
     
    294294}
    295295
    296 static LengthSize checkboxSize(const Font& font, const LengthSize& zoomedSize, float zoomFactor)
     296static LengthSize checkboxSize(const FontCascade& font, const LengthSize& zoomedSize, float zoomFactor)
    297297{
    298298    // If the width and height are both specified, then we have nothing to do.
     
    324324}
    325325
    326 static LengthSize radioSize(const Font& font, const LengthSize& zoomedSize, float zoomFactor)
     326static LengthSize radioSize(const FontCascade& font, const LengthSize& zoomedSize, float zoomFactor)
    327327{
    328328    // If the width and height are both specified, then we have nothing to do.
     
    594594// We don't use controlSizeForFont() for steppers because the stepper height
    595595// should be equal to or less than the corresponding text field height,
    596 static NSControlSize stepperControlSizeForFont(const Font& font)
     596static NSControlSize stepperControlSizeForFont(const FontCascade& font)
    597597{
    598598    int fontSize = font.pixelSize();
     
    674674}
    675675
    676 FontDescription ThemeMac::controlFont(ControlPart part, const Font& font, float zoomFactor) const
     676FontDescription ThemeMac::controlFont(ControlPart part, const FontCascade& font, float zoomFactor) const
    677677{
    678678    switch (part) {
     
    692692}
    693693
    694 LengthSize ThemeMac::controlSize(ControlPart part, const Font& font, const LengthSize& zoomedSize, float zoomFactor) const
     694LengthSize ThemeMac::controlSize(ControlPart part, const FontCascade& font, const LengthSize& zoomedSize, float zoomFactor) const
    695695{
    696696    switch (part) {
     
    711711}
    712712
    713 LengthSize ThemeMac::minimumControlSize(ControlPart part, const Font& font, float zoomFactor) const
     713LengthSize ThemeMac::minimumControlSize(ControlPart part, const FontCascade& font, float zoomFactor) const
    714714{
    715715    switch (part) {
     
    728728}
    729729
    730 LengthBox ThemeMac::controlBorder(ControlPart part, const Font& font, const LengthBox& zoomedBox, float zoomFactor) const
     730LengthBox ThemeMac::controlBorder(ControlPart part, const FontCascade& font, const LengthBox& zoomedBox, float zoomFactor) const
    731731{
    732732    switch (part) {
     
    740740}
    741741
    742 LengthBox ThemeMac::controlPadding(ControlPart part, const Font& font, const LengthBox& zoomedBox, float zoomFactor) const
     742LengthBox ThemeMac::controlPadding(ControlPart part, const FontCascade& font, const LengthBox& zoomedBox, float zoomFactor) const
    743743{
    744744    switch (part) {
  • trunk/Source/WebCore/platform/mac/WidgetMac.mm

    r174506 r178510  
    3232#import "Cursor.h"
    3333#import "Document.h"
    34 #import "Font.h"
     34#import "FontCascade.h"
    3535#import "Frame.h"
    3636#import "FrameView.h"
  • trunk/Source/WebCore/platform/text/PlatformLocale.h

    r177280 r178510  
    3434
    3535#if PLATFORM(IOS)
    36 class Font;
     36class FontCascade;
    3737#endif
    3838
  • trunk/Source/WebCore/platform/text/ios/LocalizedDateCache.h

    r170072 r178510  
    2828
    2929#include "DateComponents.h"
    30 #include "Font.h"
     30#include "FontCascade.h"
    3131#include <wtf/HashMap.h>
    3232#include <wtf/NeverDestroyed.h>
     
    4747public:
    4848    NSDateFormatter *formatterForDateType(DateComponents::Type);
    49     float maximumWidthForDateType(DateComponents::Type, const Font&, const MeasureTextClient&);
     49    float maximumWidthForDateType(DateComponents::Type, const FontCascade&, const MeasureTextClient&);
    5050    void localeChanged();
    5151
     
    6464    DateTypeFormatterMap m_formatterMap;
    6565    DateTypeMaxWidthMap m_maxWidthMap;
    66     Font m_font;
     66    FontCascade m_font;
    6767
    6868    friend LocalizedDateCache& localizedDateCache();
  • trunk/Source/WebCore/platform/text/ios/LocalizedDateCache.mm

    r170072 r178510  
    2727#import "LocalizedDateCache.h"
    2828
    29 #import "Font.h"
     29#import "FontCascade.h"
    3030#import "TextRun.h"
    3131#import <math.h>
     
    5353
    5454LocalizedDateCache::LocalizedDateCache()
    55     : m_font(Font())
    5655{
    5756    // Listen to CF Notifications for locale change, and clear the cache when it does.
     
    8584}
    8685
    87 float LocalizedDateCache::maximumWidthForDateType(DateComponents::Type type, const Font& font, const MeasureTextClient& measurer)
     86float LocalizedDateCache::maximumWidthForDateType(DateComponents::Type type, const FontCascade& font, const MeasureTextClient& measurer)
    8887{
    8988    int key = static_cast<int>(type);
     
    9291            return m_maxWidthMap.get(key);
    9392    } else {
    94         m_font = Font(font);
     93        m_font = FontCascade(font);
    9594        m_maxWidthMap.clear();
    9695    }
  • trunk/Source/WebCore/rendering/EllipsisBox.cpp

    r173047 r178510  
    2222
    2323#include "Document.h"
    24 #include "Font.h"
     24#include "FontCascade.h"
    2525#include "GraphicsContext.h"
    2626#include "HitTestResult.h"
     
    5555    }
    5656
    57     const Font& font = lineStyle.font();
     57    const FontCascade& font = lineStyle.fontCascade();
    5858    if (selectionState() != RenderObject::SelectionNone) {
    5959        paintSelection(context, paintOffset, lineStyle, font);
     
    111111{
    112112    const RenderStyle& lineStyle = this->lineStyle();
    113     const Font& font = lineStyle.font();
     113    const FontCascade& font = lineStyle.fontCascade();
    114114    const RootInlineBox& rootBox = root();
    115115    // FIXME: Why is this always LTR? Fix by passing correct text run flags below.
     
    120120}
    121121
    122 void EllipsisBox::paintSelection(GraphicsContext* context, const LayoutPoint& paintOffset, const RenderStyle& style, const Font& font)
     122void EllipsisBox::paintSelection(GraphicsContext* context, const LayoutPoint& paintOffset, const RenderStyle& style, const FontCascade& font)
    123123{
    124124    Color textColor = style.visitedDependentColor(CSSPropertyColor);
  • trunk/Source/WebCore/rendering/EllipsisBox.h

    r175084 r178510  
    4343    int height() const { return m_height; }
    4444    virtual RenderObject::SelectionState selectionState() override { return m_selectionState; }
    45     void paintSelection(GraphicsContext*, const LayoutPoint&, const RenderStyle&, const Font&);
     45    void paintSelection(GraphicsContext*, const LayoutPoint&, const RenderStyle&, const FontCascade&);
    4646    InlineBox* markupBox() const;
    4747
  • trunk/Source/WebCore/rendering/InlineFlowBox.cpp

    r177955 r178510  
    2424#include "Document.h"
    2525#include "EllipsisBox.h"
    26 #include "Font.h"
     26#include "FontCascade.h"
    2727#include "GraphicsContext.h"
    2828#include "InlineTextBox.h"
     
    123123        else if (child->behavesLikeText()) {
    124124            if (child->renderer().isLineBreak() || child->renderer().parent() != &renderer()) {
    125                 if (!parentStyle.font().fontMetrics().hasIdenticalAscentDescentAndLineGap(childStyle.font().fontMetrics())
     125                if (!parentStyle.fontCascade().fontMetrics().hasIdenticalAscentDescentAndLineGap(childStyle.fontCascade().fontMetrics())
    126126                    || parentStyle.lineHeight() != childStyle.lineHeight()
    127127                    || (parentStyle.verticalAlign() != BASELINE && !isRootInlineBox()) || childStyle.verticalAlign() != BASELINE)
     
    139139                // Check the child's bit, and then also check for differences in font, line-height, vertical-align
    140140                if (!childFlowBox.descendantsHaveSameLineHeightAndBaseline()
    141                     || !parentStyle.font().fontMetrics().hasIdenticalAscentDescentAndLineGap(childStyle.font().fontMetrics())
     141                    || !parentStyle.fontCascade().fontMetrics().hasIdenticalAscentDescentAndLineGap(childStyle.fontCascade().fontMetrics())
    142142                    || parentStyle.lineHeight() != childStyle.lineHeight()
    143143                    || (parentStyle.verticalAlign() != BASELINE && !isRootInlineBox()) || childStyle.verticalAlign() != BASELINE
     
    389389            if (renderText.textLength()) {
    390390                if (needsWordSpacing && isSpaceOrNewline(renderText.characterAt(textBox.start())))
    391                     logicalLeft += textBox.lineStyle().font().wordSpacing();
     391                    logicalLeft += textBox.lineStyle().fontCascade().wordSpacing();
    392392                needsWordSpacing = !isSpaceOrNewline(renderText.characterAt(textBox.end()));
    393393            }
     
    450450    const RenderStyle& lineStyle = this->lineStyle();
    451451    if (lineStyle.fontDescription().nonCJKGlyphOrientation() == NonCJKGlyphOrientationUpright
    452         || lineStyle.font().primaryFontData().hasVerticalGlyphs())
     452        || lineStyle.fontCascade().primaryFontData().hasVerticalGlyphs())
    453453        return true;
    454454
     
    461461                return true;
    462462        } else {
    463             if (child->lineStyle().font().primaryFontData().hasVerticalGlyphs())
     463            if (child->lineStyle().fontCascade().primaryFontData().hasVerticalGlyphs())
    464464                return true;
    465465           
     
    874874    bool emphasisMarkIsAbove;
    875875    if (lineStyle.textEmphasisMark() != TextEmphasisMarkNone && textBox.emphasisMarkExistsAndIsAbove(lineStyle, emphasisMarkIsAbove)) {
    876         int emphasisMarkHeight = lineStyle.font().emphasisMarkHeight(lineStyle.textEmphasisMarkString());
     876        int emphasisMarkHeight = lineStyle.fontCascade().emphasisMarkHeight(lineStyle.textEmphasisMarkString());
    877877        if (emphasisMarkIsAbove == !lineStyle.isFlippedLinesWritingMode())
    878878            topGlyphOverflow = std::min(topGlyphOverflow, -emphasisMarkHeight);
     
    883883    // If letter-spacing is negative, we should factor that into right layout overflow. (Even in RTL, letter-spacing is
    884884    // applied to the right, so this is not an issue with left overflow.
    885     rightGlyphOverflow -= std::min(0, (int)lineStyle.font().letterSpacing());
     885    rightGlyphOverflow -= std::min(0, (int)lineStyle.fontCascade().letterSpacing());
    886886
    887887    LayoutUnit textShadowLogicalTop;
     
    15351535            if (childLineStyle.textEmphasisMark() != TextEmphasisMarkNone && downcast<InlineTextBox>(*child).emphasisMarkExistsAndIsAbove(childLineStyle, emphasisMarkIsAbove) && emphasisMarkIsAbove) {
    15361536                if (!childLineStyle.isFlippedLinesWritingMode()) {
    1537                     int topOfEmphasisMark = child->logicalTop() - childLineStyle.font().emphasisMarkHeight(childLineStyle.textEmphasisMarkString());
     1537                    int topOfEmphasisMark = child->logicalTop() - childLineStyle.fontCascade().emphasisMarkHeight(childLineStyle.textEmphasisMarkString());
    15381538                    result = std::max(result, allowedPosition - topOfEmphasisMark);
    15391539                } else {
    1540                     int bottomOfEmphasisMark = child->logicalBottom() + childLineStyle.font().emphasisMarkHeight(childLineStyle.textEmphasisMarkString());
     1540                    int bottomOfEmphasisMark = child->logicalBottom() + childLineStyle.fontCascade().emphasisMarkHeight(childLineStyle.textEmphasisMarkString());
    15411541                    result = std::max(result, bottomOfEmphasisMark - allowedPosition);
    15421542                }
     
    15841584            if (childLineStyle.textEmphasisMark() != TextEmphasisMarkNone && !emphasisMarkIsAbove) {
    15851585                if (!childLineStyle.isFlippedLinesWritingMode()) {
    1586                     LayoutUnit bottomOfEmphasisMark = child->logicalBottom() + childLineStyle.font().emphasisMarkHeight(childLineStyle.textEmphasisMarkString());
     1586                    LayoutUnit bottomOfEmphasisMark = child->logicalBottom() + childLineStyle.fontCascade().emphasisMarkHeight(childLineStyle.textEmphasisMarkString());
    15871587                    result = std::max(result, bottomOfEmphasisMark - allowedPosition);
    15881588                } else {
    1589                     LayoutUnit topOfEmphasisMark = child->logicalTop() - childLineStyle.font().emphasisMarkHeight(childLineStyle.textEmphasisMarkString());
     1589                    LayoutUnit topOfEmphasisMark = child->logicalTop() - childLineStyle.fontCascade().emphasisMarkHeight(childLineStyle.textEmphasisMarkString());
    15901590                    result = std::max(result, allowedPosition - topOfEmphasisMark);
    15911591                }
  • trunk/Source/WebCore/rendering/InlineTextBox.cpp

    r178250 r178510  
    246246}
    247247
    248 static const Font& fontToUse(const RenderStyle& style, const RenderText& renderer)
     248static const FontCascade& fontToUse(const RenderStyle& style, const RenderText& renderer)
    249249{
    250250    if (style.hasTextCombine() && is<RenderCombineText>(renderer)) {
     
    253253            return textCombineRenderer.textCombineFont();
    254254    }
    255     return style.font();
     255    return style.fontCascade();
    256256}
    257257
     
    267267    LayoutUnit selectionHeight = this->selectionHeight();
    268268    const RenderStyle& lineStyle = this->lineStyle();
    269     const Font& font = fontToUse(lineStyle, renderer());
     269    const FontCascade& font = fontToUse(lineStyle, renderer());
    270270
    271271    String hyphenatedStringBuffer;
     
    540540
    541541    // Set our font.
    542     const Font& font = fontToUse(lineStyle, renderer());
     542    const FontCascade& font = fontToUse(lineStyle, renderer());
    543543    // 1. Paint backgrounds behind text if needed. Examples of such backgrounds include selection
    544544    // and composition underlines.
     
    679679}
    680680
    681 void InlineTextBox::paintSelection(GraphicsContext& context, const FloatPoint& boxOrigin, const RenderStyle& style, const Font& font, Color textColor)
     681void InlineTextBox::paintSelection(GraphicsContext& context, const FloatPoint& boxOrigin, const RenderStyle& style, const FontCascade& font, Color textColor)
    682682{
    683683#if ENABLE(TEXT_SELECTION)
     
    738738}
    739739
    740 void InlineTextBox::paintCompositionBackground(GraphicsContext& context, const FloatPoint& boxOrigin, const RenderStyle& style, const Font& font, int startPos, int endPos)
     740void InlineTextBox::paintCompositionBackground(GraphicsContext& context, const FloatPoint& boxOrigin, const RenderStyle& style, const FontCascade& font, int startPos, int endPos)
    741741{
    742742    int offset = m_start;
     
    10591059}
    10601060
    1061 void InlineTextBox::paintDocumentMarker(GraphicsContext& context, const FloatPoint& boxOrigin, RenderedDocumentMarker& marker, const RenderStyle& style, const Font& font, bool grammar)
     1061void InlineTextBox::paintDocumentMarker(GraphicsContext& context, const FloatPoint& boxOrigin, RenderedDocumentMarker& marker, const RenderStyle& style, const FontCascade& font, bool grammar)
    10621062{
    10631063    // Never print spelling/grammar markers (5327887)
     
    11291129}
    11301130
    1131 void InlineTextBox::paintTextMatchMarker(GraphicsContext& context, const FloatPoint& boxOrigin, RenderedDocumentMarker& marker, const RenderStyle& style, const Font& font)
     1131void InlineTextBox::paintTextMatchMarker(GraphicsContext& context, const FloatPoint& boxOrigin, RenderedDocumentMarker& marker, const RenderStyle& style, const FontCascade& font)
    11321132{
    11331133    LayoutUnit selectionHeight = this->selectionHeight();
     
    11601160}
    11611161
    1162 void InlineTextBox::computeRectForReplacementMarker(RenderedDocumentMarker& marker, const RenderStyle& style, const Font& font)
     1162void InlineTextBox::computeRectForReplacementMarker(RenderedDocumentMarker& marker, const RenderStyle& style, const FontCascade& font)
    11631163{
    11641164    // Replacement markers are not actually drawn, but their rects need to be computed for hit testing.
     
    11781178}
    11791179   
    1180 void InlineTextBox::paintDocumentMarkers(GraphicsContext& context, const FloatPoint& boxOrigin, const RenderStyle& style, const Font& font, bool background)
     1180void InlineTextBox::paintDocumentMarkers(GraphicsContext& context, const FloatPoint& boxOrigin, const RenderStyle& style, const FontCascade& font, bool background)
    11811181{
    11821182    if (!renderer().textNode())
     
    13301330
    13311331    const RenderStyle& lineStyle = this->lineStyle();
    1332     const Font& font = fontToUse(lineStyle, renderer());
     1332    const FontCascade& font = fontToUse(lineStyle, renderer());
    13331333    return font.offsetForPosition(constructTextRun(lineStyle, font), lineOffset - logicalLeft(), includePartialGlyphs);
    13341334}
     
    13431343
    13441344    const RenderStyle& lineStyle = this->lineStyle();
    1345     const Font& font = fontToUse(lineStyle, renderer());
     1345    const FontCascade& font = fontToUse(lineStyle, renderer());
    13461346    int from = !isLeftToRightDirection() ? offset - m_start : 0;
    13471347    int to = !isLeftToRightDirection() ? m_len : offset - m_start;
     
    13531353}
    13541354
    1355 TextRun InlineTextBox::constructTextRun(const RenderStyle& style, const Font& font, String* hyphenatedStringBuffer) const
     1355TextRun InlineTextBox::constructTextRun(const RenderStyle& style, const FontCascade& font, String* hyphenatedStringBuffer) const
    13561356{
    13571357    ASSERT(renderer().text());
     
    13671367}
    13681368
    1369 TextRun InlineTextBox::constructTextRun(const RenderStyle& style, const Font& font, String string, unsigned maximumLength, String* hyphenatedStringBuffer) const
     1369TextRun InlineTextBox::constructTextRun(const RenderStyle& style, const FontCascade& font, String string, unsigned maximumLength, String* hyphenatedStringBuffer) const
    13701370{
    13711371    unsigned length = string.length();
  • trunk/Source/WebCore/rendering/InlineTextBox.h

    r177377 r178510  
    105105    LayoutUnit selectionHeight() const;
    106106
    107     TextRun constructTextRun(const RenderStyle&, const Font&, String* hyphenatedStringBuffer = nullptr) const;
    108     TextRun constructTextRun(const RenderStyle&, const Font&, String, unsigned maximumLength, String* hyphenatedStringBuffer = nullptr) const;
     107    TextRun constructTextRun(const RenderStyle&, const FontCascade&, String* hyphenatedStringBuffer = nullptr) const;
     108    TextRun constructTextRun(const RenderStyle&, const FontCascade&, String, unsigned maximumLength, String* hyphenatedStringBuffer = nullptr) const;
    109109
    110110public:
     
    149149
    150150protected:
    151     void paintCompositionBackground(GraphicsContext&, const FloatPoint& boxOrigin, const RenderStyle&, const Font&, int startPos, int endPos);
    152     void paintDocumentMarkers(GraphicsContext&, const FloatPoint& boxOrigin, const RenderStyle&, const Font&, bool background);
     151    void paintCompositionBackground(GraphicsContext&, const FloatPoint& boxOrigin, const RenderStyle&, const FontCascade&, int startPos, int endPos);
     152    void paintDocumentMarkers(GraphicsContext&, const FloatPoint& boxOrigin, const RenderStyle&, const FontCascade&, bool background);
    153153    void paintCompositionUnderline(GraphicsContext&, const FloatPoint& boxOrigin, const CompositionUnderline&);
    154154
    155155private:
    156156    void paintDecoration(GraphicsContext&, const FloatPoint& boxOrigin, TextDecoration, TextDecorationStyle, const ShadowData*, TextPainter&);
    157     void paintSelection(GraphicsContext&, const FloatPoint& boxOrigin, const RenderStyle&, const Font&, Color textColor);
    158     void paintDocumentMarker(GraphicsContext&, const FloatPoint& boxOrigin, RenderedDocumentMarker&, const RenderStyle&, const Font&, bool grammar);
    159     void paintTextMatchMarker(GraphicsContext&, const FloatPoint& boxOrigin, RenderedDocumentMarker&, const RenderStyle&, const Font&);
     157    void paintSelection(GraphicsContext&, const FloatPoint& boxOrigin, const RenderStyle&, const FontCascade&, Color textColor);
     158    void paintDocumentMarker(GraphicsContext&, const FloatPoint& boxOrigin, RenderedDocumentMarker&, const RenderStyle&, const FontCascade&, bool grammar);
     159    void paintTextMatchMarker(GraphicsContext&, const FloatPoint& boxOrigin, RenderedDocumentMarker&, const RenderStyle&, const FontCascade&);
    160160
    161     void computeRectForReplacementMarker(RenderedDocumentMarker&, const RenderStyle&, const Font&);
     161    void computeRectForReplacementMarker(RenderedDocumentMarker&, const RenderStyle&, const FontCascade&);
    162162
    163163    TextRun::ExpansionBehavior expansionBehavior() const
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r178029 r178510  
    23262326
    23272327    // FIXME: Should letter-spacing apply? This is complicated since it doesn't apply at the edge?
    2328     float maxCharWidth = lineGrid->style().font().primaryFontData().maxCharWidth();
     2328    float maxCharWidth = lineGrid->style().fontCascade().primaryFontData().maxCharWidth();
    23292329    if (!maxCharWidth)
    23302330        return left;
     
    23662366
    23672367    // FIXME: Should letter-spacing apply? This is complicated since it doesn't apply at the edge?
    2368     float maxCharWidth = lineGrid->style().font().primaryFontData().maxCharWidth();
     2368    float maxCharWidth = lineGrid->style().fontCascade().primaryFontData().maxCharWidth();
    23692369    if (!maxCharWidth)
    23702370        return right;
     
    30043004        newFontDescription.setComputedSize(startingFontSize);
    30053005        pseudoStyle->setFontDescription(newFontDescription);
    3006         pseudoStyle->font().update(pseudoStyle->font().fontSelector());
     3006        pseudoStyle->fontCascade().update(pseudoStyle->fontCascade().fontSelector());
    30073007       
    30083008        int desiredCapHeight = (pseudoStyle->initialLetterHeight() - 1) * lineHeight + paragraph->style().fontMetrics().capHeight();
     
    30133013            newFontDescription.setComputedSize(newFontDescription.computedSize() -1);
    30143014            pseudoStyle->setFontDescription(newFontDescription);
    3015             pseudoStyle->font().update(pseudoStyle->font().fontSelector());
     3015            pseudoStyle->fontCascade().update(pseudoStyle->fontCascade().fontSelector());
    30163016            actualCapHeight = pseudoStyle->fontMetrics().capHeight();
    30173017        }
     
    36943694
    36953695template <typename CharacterType>
    3696 static inline TextRun constructTextRunInternal(RenderObject* context, const Font& font, const CharacterType* characters, int length, const RenderStyle& style, TextRun::ExpansionBehavior expansion)
     3696static inline TextRun constructTextRunInternal(RenderObject* context, const FontCascade& font, const CharacterType* characters, int length, const RenderStyle& style, TextRun::ExpansionBehavior expansion)
    36973697{
    36983698    TextDirection textDirection = LTR;
     
    37093709
    37103710template <typename CharacterType>
    3711 static inline TextRun constructTextRunInternal(RenderObject* context, const Font& font, const CharacterType* characters, int length, const RenderStyle& style, TextRun::ExpansionBehavior expansion, TextRunFlags flags)
     3711static inline TextRun constructTextRunInternal(RenderObject* context, const FontCascade& font, const CharacterType* characters, int length, const RenderStyle& style, TextRun::ExpansionBehavior expansion, TextRunFlags flags)
    37123712{
    37133713    TextDirection textDirection = LTR;
     
    37283728}
    37293729
    3730 TextRun RenderBlock::constructTextRun(RenderObject* context, const Font& font, const LChar* characters, int length, const RenderStyle& style, TextRun::ExpansionBehavior expansion)
     3730TextRun RenderBlock::constructTextRun(RenderObject* context, const FontCascade& font, const LChar* characters, int length, const RenderStyle& style, TextRun::ExpansionBehavior expansion)
    37313731{
    37323732    return constructTextRunInternal(context, font, characters, length, style, expansion);
    37333733}
    37343734
    3735 TextRun RenderBlock::constructTextRun(RenderObject* context, const Font& font, const UChar* characters, int length, const RenderStyle& style, TextRun::ExpansionBehavior expansion)
     3735TextRun RenderBlock::constructTextRun(RenderObject* context, const FontCascade& font, const UChar* characters, int length, const RenderStyle& style, TextRun::ExpansionBehavior expansion)
    37363736{
    37373737    return constructTextRunInternal(context, font, characters, length, style, expansion);
    37383738}
    37393739
    3740 TextRun RenderBlock::constructTextRun(RenderObject* context, const Font& font, const RenderText* text, const RenderStyle& style, TextRun::ExpansionBehavior expansion)
     3740TextRun RenderBlock::constructTextRun(RenderObject* context, const FontCascade& font, const RenderText* text, const RenderStyle& style, TextRun::ExpansionBehavior expansion)
    37413741{
    37423742    if (text->is8Bit())
     
    37453745}
    37463746
    3747 TextRun RenderBlock::constructTextRun(RenderObject* context, const Font& font, const RenderText* text, unsigned offset, unsigned length, const RenderStyle& style, TextRun::ExpansionBehavior expansion)
     3747TextRun RenderBlock::constructTextRun(RenderObject* context, const FontCascade& font, const RenderText* text, unsigned offset, unsigned length, const RenderStyle& style, TextRun::ExpansionBehavior expansion)
    37483748{
    37493749    ASSERT(offset + length <= text->textLength());
     
    37533753}
    37543754
    3755 TextRun RenderBlock::constructTextRun(RenderObject* context, const Font& font, const String& string, const RenderStyle& style, TextRun::ExpansionBehavior expansion, TextRunFlags flags)
     3755TextRun RenderBlock::constructTextRun(RenderObject* context, const FontCascade& font, const String& string, const RenderStyle& style, TextRun::ExpansionBehavior expansion, TextRunFlags flags)
    37563756{
    37573757    unsigned length = string.length();
  • trunk/Source/WebCore/rendering/RenderBlock.h

    r177259 r178510  
    203203    }
    204204
    205     static TextRun constructTextRun(RenderObject* context, const Font&, const String&, const RenderStyle&,
     205    static TextRun constructTextRun(RenderObject* context, const FontCascade&, const String&, const RenderStyle&,
    206206        TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion, TextRunFlags = DefaultTextRunFlags);
    207207
    208     static TextRun constructTextRun(RenderObject* context, const Font&, const RenderText*, const RenderStyle&,
     208    static TextRun constructTextRun(RenderObject* context, const FontCascade&, const RenderText*, const RenderStyle&,
    209209        TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion);
    210210
    211     static TextRun constructTextRun(RenderObject* context, const Font&, const RenderText*, unsigned offset, unsigned length, const RenderStyle&,
     211    static TextRun constructTextRun(RenderObject* context, const FontCascade&, const RenderText*, unsigned offset, unsigned length, const RenderStyle&,
    212212        TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion);
    213213
    214     static TextRun constructTextRun(RenderObject* context, const Font&, const RenderText*, unsigned offset, const RenderStyle&,
     214    static TextRun constructTextRun(RenderObject* context, const FontCascade&, const RenderText*, unsigned offset, const RenderStyle&,
    215215        TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion);
    216216
    217     static TextRun constructTextRun(RenderObject* context, const Font&, const LChar* characters, int length, const RenderStyle&,
     217    static TextRun constructTextRun(RenderObject* context, const FontCascade&, const LChar* characters, int length, const RenderStyle&,
    218218        TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion);
    219219
    220     static TextRun constructTextRun(RenderObject* context, const Font&, const UChar* characters, int length, const RenderStyle&,
     220    static TextRun constructTextRun(RenderObject* context, const FontCascade&, const UChar* characters, int length, const RenderStyle&,
    221221        TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion);
    222222   
  • trunk/Source/WebCore/rendering/RenderBlockFlow.cpp

    r177308 r178510  
    39483948        RenderText& renderText = downcast<RenderText>(*trailingSpaceChild);
    39493949        const UChar space = ' ';
    3950         const Font& font = renderText.style().font(); // FIXME: This ignores first-line.
     3950        const FontCascade& font = renderText.style().fontCascade(); // FIXME: This ignores first-line.
    39513951        float spaceWidth = font.width(RenderBlock::constructTextRun(&renderText, font, &space, 1, renderText.style()));
    39523952        inlineMax -= spaceWidth + font.wordSpacing();
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r177398 r178510  
    462462    GlyphOverflow glyphOverflow;
    463463
    464     const Font& font = lineStyle(*renderer->parent(), lineInfo).font();
     464    const FontCascade& font = lineStyle(*renderer->parent(), lineInfo).fontCascade();
    465465    // Always compute glyph overflow if the block's line-box-contain value is "glyphs".
    466466    if (lineBox->fitsToGlyphs()) {
     
    506506                UChar c = renderer->characterAt(wordMeasurement.startOffset);
    507507                if (i > 0 && wordLength == 1 && (c == ' ' || c == '\t'))
    508                     measuredWidth += renderer->style().font().wordSpacing();
     508                    measuredWidth += renderer->style().fontCascade().wordSpacing();
    509509            } else
    510510                measuredWidth += wordMeasurement.width;
     
    744744                if (!isAfterExpansion)
    745745                    downcast<InlineTextBox>(*run->box()).setCanHaveLeadingExpansion(true);
    746                 unsigned opportunitiesInRun = Font::expansionOpportunityCount(renderText.stringView(run->m_start, run->m_stop), run->box()->direction(), isAfterExpansion);
     746                unsigned opportunitiesInRun = FontCascade::expansionOpportunityCount(renderText.stringView(run->m_start, run->m_stop), run->box()->direction(), isAfterExpansion);
    747747                expansionOpportunities.append(opportunitiesInRun);
    748748                expansionOpportunityCount += opportunitiesInRun;
     
    751751            if (int length = renderText.textLength()) {
    752752                if (!run->m_start && needsWordSpacing && isSpaceOrNewline(renderText.characterAt(run->m_start)))
    753                     totalLogicalWidth += lineStyle(*renderText.parent(), lineInfo).font().wordSpacing();
     753                    totalLogicalWidth += lineStyle(*renderText.parent(), lineInfo).fontCascade().wordSpacing();
    754754                needsWordSpacing = !isSpaceOrNewline(renderText.characterAt(run->m_stop - 1)) && run->m_stop == length;
    755755            }
     
    769769                        encounteredJustifiedRuby = true;
    770770                        auto& renderText = downcast<RenderText>(leafChild->renderer());
    771                         unsigned opportunitiesInRun = Font::expansionOpportunityCount(renderText.stringView(), leafChild->direction(), isAfterExpansion);
     771                        unsigned opportunitiesInRun = FontCascade::expansionOpportunityCount(renderText.stringView(), leafChild->direction(), isAfterExpansion);
    772772                        expansionOpportunities.append(opportunitiesInRun);
    773773                        expansionOpportunityCount += opportunitiesInRun;
     
    19081908    // Determine the width of the ellipsis using the current font.
    19091909    // FIXME: CSS3 says this is configurable, also need to use 0x002E (FULL STOP) if horizontal ellipsis is "not renderable"
    1910     const Font& font = style().font();
     1910    const FontCascade& font = style().fontCascade();
    19111911    DEPRECATED_DEFINE_STATIC_LOCAL(AtomicString, ellipsisStr, (&horizontalEllipsis, 1));
    1912     const Font& firstLineFont = firstLineStyle().font();
     1912    const FontCascade& firstLineFont = firstLineStyle().fontCascade();
    19131913    float firstLineEllipsisWidth = firstLineFont.width(constructTextRun(this, firstLineFont, &horizontalEllipsis, 1, firstLineStyle()));
    19141914    float ellipsisWidth = (font == firstLineFont) ? firstLineEllipsisWidth : font.width(constructTextRun(this, font, &horizontalEllipsis, 1, style()));
  • trunk/Source/WebCore/rendering/RenderCombineText.cpp

    r178157 r178510  
    5858}
    5959
    60 float RenderCombineText::width(unsigned from, unsigned length, const Font& font, float xPosition, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
     60float RenderCombineText::width(unsigned from, unsigned length, const FontCascade& font, float xPosition, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
    6161{
    6262    if (m_isCombined)
     
    109109    m_isCombined = combinedTextWidth <= emWidth;
    110110   
    111     FontSelector* fontSelector = style().font().fontSelector();
     111    FontSelector* fontSelector = style().fontCascade().fontSelector();
    112112
    113113    if (m_isCombined)
     
    118118        for (size_t i = 0 ; i < WTF_ARRAY_LENGTH(widthVariants) ; ++i) {
    119119            description.setWidthVariant(widthVariants[i]);
    120             Font compressedFont = Font(description, style().font().letterSpacing(), style().font().wordSpacing());
     120
     121            FontCascade compressedFont(description, style().fontCascade().letterSpacing(), style().fontCascade().wordSpacing());
    121122            compressedFont.update(fontSelector);
    122123           
     
    137138
    138139    if (shouldUpdateFont)
    139         m_combineFontStyle->font().update(fontSelector);
     140        m_combineFontStyle->fontCascade().update(fontSelector);
    140141
    141142    if (m_isCombined) {
  • trunk/Source/WebCore/rendering/RenderCombineText.h

    r178157 r178510  
    2222#define RenderCombineText_h
    2323
    24 #include "Font.h"
     24#include "FontCascade.h"
    2525#include "RenderElement.h"
    2626#include "RenderText.h"
     
    3939    void getStringToRender(int, String&, int& length) const;
    4040    bool isCombined() const { return m_isCombined; }
    41     float combinedTextWidth(const Font& font) const { return font.size(); }
    42     const Font& originalFont() const { return parent()->style().font(); }
    43     const Font& textCombineFont() const { return m_combineFontStyle->font(); }
     41    float combinedTextWidth(const FontCascade& font) const { return font.size(); }
     42    const FontCascade& originalFont() const { return parent()->style().fontCascade(); }
     43    const FontCascade& textCombineFont() const { return m_combineFontStyle->fontCascade(); }
    4444
    4545private:
     
    4747
    4848    virtual bool isCombineText() const override { return true; }
    49     virtual float width(unsigned from, unsigned length, const Font&, float xPosition, HashSet<const SimpleFontData*>* fallbackFonts = 0, GlyphOverflow* = 0) const override;
     49    virtual float width(unsigned from, unsigned length, const FontCascade&, float xPosition, HashSet<const SimpleFontData*>* fallbackFonts = 0, GlyphOverflow* = 0) const override;
    5050    virtual const char* renderName() const override { return "RenderCombineText"; }
    5151    virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
  • trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp

    r177259 r178510  
    2626#include "RenderDeprecatedFlexibleBox.h"
    2727
    28 #include "Font.h"
     28#include "FontCascade.h"
    2929#include "LayoutRepainter.h"
    3030#include "RenderLayer.h"
     
    998998        DEPRECATED_DEFINE_STATIC_LOCAL(AtomicString, ellipsisStr, (&horizontalEllipsis, 1));
    999999        const RenderStyle& lineStyle = numVisibleLines == 1 ? firstLineStyle() : style();
    1000         const Font& font = lineStyle.font();
     1000        const FontCascade& font = lineStyle.fontCascade();
    10011001
    10021002        // Get ellipsis width, and if the last child is an anchor, it will go after the ellipsis, so add in a space and the anchor width too
  • trunk/Source/WebCore/rendering/RenderEmbeddedObject.cpp

    r177259 r178510  
    3030#include "Cursor.h"
    3131#include "EventHandler.h"
    32 #include "Font.h"
     32#include "FontCascade.h"
    3333#include "FontSelector.h"
    3434#include "Frame.h"
     
    299299    FloatRect replacementTextRect;
    300300    FloatRect arrowRect;
    301     Font font;
     301    FontCascade font;
    302302    TextRun run("");
    303303    float textWidth;
     
    350350}
    351351
    352 bool RenderEmbeddedObject::getReplacementTextGeometry(const LayoutPoint& accumulatedOffset, FloatRect& contentRect, FloatRect& indicatorRect, FloatRect& replacementTextRect, FloatRect& arrowRect, Font& font, TextRun& run, float& textWidth) const
     352bool RenderEmbeddedObject::getReplacementTextGeometry(const LayoutPoint& accumulatedOffset, FloatRect& contentRect, FloatRect& indicatorRect, FloatRect& replacementTextRect, FloatRect& arrowRect, FontCascade& font, TextRun& run, float& textWidth) const
    353353{
    354354    bool includesArrow = shouldUnavailablePluginMessageBeButton(document(), m_pluginUnavailabilityReason);
     
    362362    fontDescription.setRenderingMode(frame().settings().fontRenderingMode());
    363363    fontDescription.setComputedSize(12);
    364     font = Font(fontDescription, 0, 0);
     364    font = FontCascade(fontDescription, 0, 0);
    365365    font.update(0);
    366366
     
    392392    FloatRect replacementTextRect;
    393393    FloatRect arrowRect;
    394     Font font;
     394    FontCascade font;
    395395    TextRun run("", 0);
    396396    float textWidth;
     
    583583    FloatRect replacementTextRect;
    584584    FloatRect arrowRect;
    585     Font font;
     585    FontCascade font;
    586586    TextRun run("");
    587587    float textWidth;
  • trunk/Source/WebCore/rendering/RenderEmbeddedObject.h

    r177259 r178510  
    8787    bool isInUnavailablePluginIndicator(const MouseEvent&) const;
    8888    bool isInUnavailablePluginIndicator(const FloatPoint&) const;
    89     bool getReplacementTextGeometry(const LayoutPoint& accumulatedOffset, FloatRect& contentRect, FloatRect& indicatorRect, FloatRect& replacementTextRect, FloatRect& arrowRect, Font&, TextRun&, float& textWidth) const;
     89    bool getReplacementTextGeometry(const LayoutPoint& accumulatedOffset, FloatRect& contentRect, FloatRect& indicatorRect, FloatRect& replacementTextRect, FloatRect& arrowRect, FontCascade&, TextRun&, float& textWidth) const;
    9090    LayoutRect unavailablePluginIndicatorBounds(const LayoutPoint&) const;
    9191
  • trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp

    r177259 r178510  
    2323
    2424#include "FileList.h"
    25 #include "Font.h"
     25#include "FontCascade.h"
    2626#include "GraphicsContext.h"
    2727#include "HTMLInputElement.h"
     
    133133    if (paintInfo.phase == PaintPhaseForeground) {
    134134        const String& displayedFilename = fileTextValue();
    135         const Font& font = style().font();
     135        const FontCascade& font = style().fontCascade();
    136136        TextRun textRun = constructTextRun(this, font, displayedFilename, style(), TextRun::AllowTrailingExpansion, RespectDirection | RespectDirectionOverride);
    137137        textRun.disableRoundingHacks();
     
    202202    const UChar character = '0';
    203203    const String characterAsString = String(&character, 1);
    204     const Font& font = style().font();
     204    const FontCascade& font = style().fontCascade();
    205205    // FIXME: Remove the need for this const_cast by making constructTextRun take a const RenderObject*.
    206206    RenderFileUploadControl* renderer = const_cast<RenderFileUploadControl*>(this);
     
    272272#if PLATFORM(IOS)
    273273    if (inputElement().files()->length())
    274         return StringTruncator::rightTruncate(inputElement().displayString(), maxFilenameWidth(), style().font(), StringTruncator::EnableRoundingHacks);
    275 #endif
    276     return theme().fileListNameForWidth(inputElement().files(), style().font(), maxFilenameWidth(), inputElement().multiple());
     274        return StringTruncator::rightTruncate(inputElement().displayString(), maxFilenameWidth(), style().fontCascade(), StringTruncator::EnableRoundingHacks);
     275#endif
     276    return theme().fileListNameForWidth(inputElement().files(), style().fontCascade(), maxFilenameWidth(), inputElement().multiple());
    277277}
    278278   
  • trunk/Source/WebCore/rendering/RenderFlowThread.cpp

    r177259 r178510  
    8080    newStyle.get().setWidth(Length(100, Percent));
    8181    newStyle.get().setHeight(Length(100, Percent));
    82     newStyle.get().font().update(0);
     82    newStyle.get().fontCascade().update(nullptr);
    8383    return newStyle;
    8484}
  • trunk/Source/WebCore/rendering/RenderFullScreen.cpp

    r177259 r178510  
    8787
    8888    fullscreenStyle.get().setFontDescription(FontDescription());
    89     fullscreenStyle.get().font().update(0);
     89    fullscreenStyle.get().fontCascade().update(nullptr);
    9090
    9191    fullscreenStyle.get().setDisplay(FLEX);
  • trunk/Source/WebCore/rendering/RenderImage.cpp

    r178250 r178510  
    3131#include "BitmapImage.h"
    3232#include "CachedImage.h"
    33 #include "Font.h"
    3433#include "FontCache.h"
     34#include "FontCascade.h"
    3535#include "Frame.h"
    3636#include "FrameSelection.h"
     
    193193    // we have an alt and the user meant it (its not a text we invented)
    194194    if (!m_altText.isEmpty()) {
    195         const Font& font = style().font();
     195        const FontCascade& font = style().fontCascade();
    196196        IntSize paddedTextSize(paddingWidth + std::min(ceilf(font.width(RenderBlock::constructTextRun(this, font, m_altText, style()))), maxAltTextWidth), paddingHeight + std::min(font.fontMetrics().height(), maxAltTextHeight));
    197197        imageSize = imageSize.expandedTo(paddedTextSize);
     
    445445                String text = document().displayStringModifiedByEncoding(m_altText);
    446446                context->setFillColor(style().visitedDependentColor(CSSPropertyColor), style().colorSpace());
    447                 const Font& font = style().font();
     447                const FontCascade& font = style().fontCascade();
    448448                const FontMetrics& fontMetrics = font.fontMetrics();
    449449                LayoutUnit ascent = fontMetrics.ascent();
  • trunk/Source/WebCore/rendering/RenderInline.cpp

    r178025 r178510  
    217217        || style().verticalAlign() != BASELINE
    218218        || style().textEmphasisMark() != TextEmphasisMarkNone
    219         || (checkFonts && (!parentStyle->font().fontMetrics().hasIdenticalAscentDescentAndLineGap(style().font().fontMetrics())
     219        || (checkFonts && (!parentStyle->fontCascade().fontMetrics().hasIdenticalAscentDescentAndLineGap(style().fontCascade().fontMetrics())
    220220        || parentStyle->lineHeight() != style().lineHeight()))
    221221        || (flowThread && flowThread->isRenderNamedFlowThread()); // FIXME: Enable the optimization once we make overflow computation for culled inlines in regions.
     
    225225        parentStyle = &parent()->firstLineStyle();
    226226        RenderStyle& childStyle = firstLineStyle();
    227         alwaysCreateLineBoxes = !parentStyle->font().fontMetrics().hasIdenticalAscentDescentAndLineGap(childStyle.font().fontMetrics())
     227        alwaysCreateLineBoxes = !parentStyle->fontCascade().fontMetrics().hasIdenticalAscentDescentAndLineGap(childStyle.fontCascade().fontMetrics())
    228228            || childStyle.verticalAlign() != BASELINE
    229229            || parentStyle->lineHeight() != childStyle.lineHeight();
     
    575575                const RootInlineBox& rootBox = renderBox.inlineBoxWrapper()->root();
    576576                const RenderStyle& containerStyle = rootBox.isFirstLine() ? container->firstLineStyle() : container->style();
    577                 int logicalTop = rootBox.logicalTop() + (rootBox.lineStyle().font().fontMetrics().ascent() - containerStyle.font().fontMetrics().ascent());
    578                 int logicalHeight = containerStyle.font().fontMetrics().height();
     577                int logicalTop = rootBox.logicalTop() + (rootBox.lineStyle().fontCascade().fontMetrics().ascent() - containerStyle.fontCascade().fontMetrics().ascent());
     578                int logicalHeight = containerStyle.fontCascade().fontMetrics().height();
    579579                if (isHorizontal)
    580580                    context.addRect(FloatRect(renderBox.inlineBoxWrapper()->x() - renderBox.marginLeft(), logicalTop, renderBox.width() + renderBox.horizontalMarginExtent(), logicalHeight));
     
    591591                    const RootInlineBox& rootBox = childLine->root();
    592592                    const RenderStyle& containerStyle = rootBox.isFirstLine() ? container->firstLineStyle() : container->style();
    593                     int logicalTop = rootBox.logicalTop() + (rootBox.lineStyle().font().fontMetrics().ascent() - containerStyle.font().fontMetrics().ascent());
     593                    int logicalTop = rootBox.logicalTop() + (rootBox.lineStyle().fontCascade().fontMetrics().ascent() - containerStyle.fontCascade().fontMetrics().ascent());
    594594                    int logicalHeight = containerStyle.fontMetrics().height();
    595595                    if (isHorizontal) {
     
    611611                const RootInlineBox& rootBox = childText->root();
    612612                const RenderStyle& containerStyle = rootBox.isFirstLine() ? container->firstLineStyle() : container->style();
    613                 int logicalTop = rootBox.logicalTop() + (rootBox.lineStyle().font().fontMetrics().ascent() - containerStyle.font().fontMetrics().ascent());
    614                 int logicalHeight = containerStyle.font().fontMetrics().height();
     613                int logicalTop = rootBox.logicalTop() + (rootBox.lineStyle().fontCascade().fontMetrics().ascent() - containerStyle.fontCascade().fontMetrics().ascent());
     614                int logicalHeight = containerStyle.fontCascade().fontMetrics().height();
    615615                if (isHorizontal)
    616616                    context.addRect(FloatRect(childText->x(), logicalTop, childText->logicalWidth(), logicalHeight));
     
    623623                const RootInlineBox& rootBox = inlineBox->root();
    624624                const RenderStyle& containerStyle = rootBox.isFirstLine() ? container->firstLineStyle() : container->style();
    625                 int logicalTop = rootBox.logicalTop() + (rootBox.lineStyle().font().fontMetrics().ascent() - containerStyle.font().fontMetrics().ascent());
     625                int logicalTop = rootBox.logicalTop() + (rootBox.lineStyle().fontCascade().fontMetrics().ascent() - containerStyle.fontCascade().fontMetrics().ascent());
    626626                int logicalHeight = containerStyle.fontMetrics().height();
    627627                if (isHorizontal)
  • trunk/Source/WebCore/rendering/RenderListBox.cpp

    r178250 r178510  
    113113            HTMLElement* element = listItems[i];
    114114            String text;
    115             Font itemFont = style().font();
     115            FontCascade itemFont = style().fontCascade();
    116116            if (is<HTMLOptionElement>(*element))
    117117                text = downcast<HTMLOptionElement>(*element).textIndentedToRespectGroupLabel();
     
    120120                FontDescription d = itemFont.fontDescription();
    121121                d.setWeight(d.bolderWeight());
    122                 itemFont = Font(d, itemFont.letterSpacing(), itemFont.wordSpacing());
     122                itemFont = FontCascade(d, itemFont.letterSpacing(), itemFont.wordSpacing());
    123123                itemFont.update(document().ensureStyleResolver().fontSelector());
    124124            }
     
    348348}
    349349
    350 static LayoutSize itemOffsetForAlignment(TextRun textRun, RenderStyle* itemStyle, Font itemFont, LayoutRect itemBoudingBox)
     350static LayoutSize itemOffsetForAlignment(TextRun textRun, RenderStyle* itemStyle, FontCascade itemFont, LayoutRect itemBoudingBox)
    351351{
    352352    ETextAlign actualAlignment = itemStyle->textAlign();
     
    401401
    402402    TextRun textRun(itemText, 0, 0, TextRun::AllowTrailingExpansion, itemStyle->direction(), isOverride(itemStyle->unicodeBidi()), true, TextRun::NoRounding);
    403     Font itemFont = style().font();
     403    FontCascade itemFont = style().fontCascade();
    404404    LayoutRect r = itemBoundingBoxRect(paintOffset, listIndex);
    405405    r.move(itemOffsetForAlignment(textRun, itemStyle, itemFont, r));
     
    408408        FontDescription d = itemFont.fontDescription();
    409409        d.setWeight(d.bolderWeight());
    410         itemFont = Font(d, itemFont.letterSpacing(), itemFont.wordSpacing());
     410        itemFont = FontCascade(d, itemFont.letterSpacing(), itemFont.wordSpacing());
    411411        itemFont.update(document().ensureStyleResolver().fontSelector());
    412412    }
  • trunk/Source/WebCore/rendering/RenderListMarker.cpp

    r177259 r178510  
    2727
    2828#include "Document.h"
    29 #include "Font.h"
     29#include "FontCascade.h"
    3030#include "GraphicsContext.h"
    3131#include "InlineElementBox.h"
     
    13151315        return;
    13161316
    1317     const Font& font = style().font();
     1317    const FontCascade& font = style().fontCascade();
    13181318    TextRun textRun = RenderBlock::constructTextRun(this, font, m_text, style());
    13191319
     
    15301530    }
    15311531
    1532     const Font& font = style().font();
     1532    const FontCascade& font = style().fontCascade();
    15331533
    15341534    LayoutUnit logicalWidth = 0;
     
    17581758        case Asterisks:
    17591759        case Footnotes: {
    1760             const Font& font = style().font();
     1760            const FontCascade& font = style().fontCascade();
    17611761            TextRun run = RenderBlock::constructTextRun(this, font, m_text, style(), TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion, DefaultTextRunFlags);
    17621762            relativeRect = IntRect(0, 0, font.width(run), font.fontMetrics().height());
     
    18521852            if (m_text.isEmpty())
    18531853                return IntRect();
    1854             const Font& font = style().font();
     1854            const FontCascade& font = style().fontCascade();
    18551855            TextRun run = RenderBlock::constructTextRun(this, font, m_text, style(), TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion, DefaultTextRunFlags);
    18561856            int itemWidth = font.width(run);
  • trunk/Source/WebCore/rendering/RenderMenuList.cpp

    r178250 r178510  
    197197        adjustInnerStyle();
    198198
    199     bool fontChanged = !oldStyle || oldStyle->font() != style().font();
     199    bool fontChanged = !oldStyle || oldStyle->fontCascade() != style().fontCascade();
    200200    if (fontChanged) {
    201201        updateOptionsWidth();
     
    223223                optionWidth += minimumValueForLength(optionStyle->textIndent(), 0);
    224224            if (!text.isEmpty()) {
    225                 const Font& font = style().font();
     225                const FontCascade& font = style().fontCascade();
    226226                TextRun run = RenderBlock::constructTextRun(this, font, text, style(), TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion, DefaultTextRunFlags);
    227227                optionWidth += font.width(run);
     
    229229            maxOptionWidth = std::max(maxOptionWidth, optionWidth);
    230230        } else if (!text.isEmpty()) {
    231             const Font& font = style().font();
     231            const FontCascade& font = style().fontCascade();
    232232            TextRun run = RenderBlock::constructTextRun(this, font, text, style(), TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion, DefaultTextRunFlags);
    233233            maxOptionWidth = std::max(maxOptionWidth, font.width(run));
     
    524524
    525525    RenderStyle* style = element->renderStyle() ? element->renderStyle() : element->computedStyle();
    526     return style ? PopupMenuStyle(style->visitedDependentColor(CSSPropertyColor), itemBackgroundColor, style->font(), style->visibility() == VISIBLE,
     526    return style ? PopupMenuStyle(style->visitedDependentColor(CSSPropertyColor), itemBackgroundColor, style->fontCascade(), style->visibility() == VISIBLE,
    527527        style->display() == NONE, true, style->textIndent(), style->direction(), isOverride(style->unicodeBidi()),
    528528        itemHasCustomBackgroundColor ? PopupMenuStyle::CustomBackgroundColor : PopupMenuStyle::DefaultBackgroundColor) : menuStyle();
     
    565565    IntRect absBounds = absoluteBoundingBoxRectIgnoringTransforms();
    566566    return PopupMenuStyle(styleToUse.visitedDependentColor(CSSPropertyColor), styleToUse.visitedDependentColor(CSSPropertyBackgroundColor),
    567         styleToUse.font(), styleToUse.visibility() == VISIBLE, styleToUse.display() == NONE,
     567        styleToUse.fontCascade(), styleToUse.visibility() == VISIBLE, styleToUse.display() == NONE,
    568568        style().hasAppearance() && style().appearance() == MenulistPart, styleToUse.textIndent(),
    569569        style().direction(), isOverride(style().unicodeBidi()), PopupMenuStyle::DefaultBackgroundColor,
  • trunk/Source/WebCore/rendering/RenderRubyRun.cpp

    r177398 r178510  
    255255        // Bopomofo. We need to move the RenderRubyText over to the right side and center it
    256256        // vertically relative to the base.
    257         const Font& font = style().font();
    258         float distanceBetweenBase = max(font.letterSpacing(), 2.0f * rt->style().font().fontMetrics().height());
     257        const FontCascade& font = style().fontCascade();
     258        float distanceBetweenBase = max(font.letterSpacing(), 2.0f * rt->style().fontCascade().fontMetrics().height());
    259259        setWidth(width() + distanceBetweenBase - font.letterSpacing());
    260260        if (RenderRubyBase* rb = rubyBase()) {
  • trunk/Source/WebCore/rendering/RenderSearchField.cpp

    r177259 r178510  
    261261PopupMenuStyle RenderSearchField::menuStyle() const
    262262{
    263     return PopupMenuStyle(style().visitedDependentColor(CSSPropertyColor), style().visitedDependentColor(CSSPropertyBackgroundColor), style().font(), style().visibility() == VISIBLE,
     263    return PopupMenuStyle(style().visitedDependentColor(CSSPropertyColor), style().visitedDependentColor(CSSPropertyBackgroundColor), style().fontCascade(), style().visibility() == VISIBLE,
    264264        style().display() == NONE, true, style().textIndent(), style().direction(), isOverride(style().unicodeBidi()), PopupMenuStyle::CustomBackgroundColor);
    265265}
  • trunk/Source/WebCore/rendering/RenderText.cpp

    r177860 r178510  
    230230{
    231231    const RenderStyle& style = this->style();
    232     const FontDescription& fontDescription = style.font().fontDescription();
    233     if (style.font().useBackslashAsYenSymbol())
     232    const FontDescription& fontDescription = style.fontCascade().fontDescription();
     233    if (style.fontCascade().useBackslashAsYenSymbol())
    234234        return true;
    235235    if (fontDescription.isSpecifiedFont())
     
    257257        m_useBackslashAsYenSymbol = computeUseBackslashAsYenSymbol();
    258258        needsResetText = m_useBackslashAsYenSymbol;
    259     } else if (oldStyle->font().useBackslashAsYenSymbol() != newStyle.font().useBackslashAsYenSymbol()) {
     259    } else if (oldStyle->fontCascade().useBackslashAsYenSymbol() != newStyle.fontCascade().useBackslashAsYenSymbol()) {
    260260        m_useBackslashAsYenSymbol = computeUseBackslashAsYenSymbol();
    261261        needsResetText = true;
     
    452452}
    453453
    454 ALWAYS_INLINE float RenderText::widthFromCache(const Font& f, int start, int len, float xPos, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow, const RenderStyle& style) const
     454ALWAYS_INLINE float RenderText::widthFromCache(const FontCascade& f, int start, int len, float xPos, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow, const RenderStyle& style) const
    455455{
    456456    if (style.hasTextCombine() && is<RenderCombineText>(*this)) {
     
    545545    StringImpl& text = *m_text.impl();
    546546    if (text[0] == ' ' || (text[0] == '\n' && !style.preserveNewline()) || text[0] == '\t') {
    547         const Font& font = style.font(); // FIXME: This ignores first-line.
     547        const FontCascade& font = style.fontCascade(); // FIXME: This ignores first-line.
    548548        if (stripFrontSpaces) {
    549549            const UChar space = ' ';
     
    561561    // Compute our max widths by scanning the string for newlines.
    562562    if (hasBreak) {
    563         const Font& f = style.font(); // FIXME: This ignores first-line.
     563        const FontCascade& f = style.fontCascade(); // FIXME: This ignores first-line.
    564564        bool firstLine = true;
    565565        beginMaxW = maxW;
     
    638638}
    639639
    640 static inline float hyphenWidth(RenderText* renderer, const Font& font)
     640static inline float hyphenWidth(RenderText* renderer, const FontCascade& font)
    641641{
    642642    const RenderStyle& style = renderer->style();
     
    644644}
    645645
    646 static float maxWordFragmentWidth(RenderText* renderer, const RenderStyle& style, const Font& font, StringView word, int minimumPrefixLength, unsigned minimumSuffixLength, int& suffixStart, HashSet<const SimpleFontData*>& fallbackFonts, GlyphOverflow& glyphOverflow)
     646static float maxWordFragmentWidth(RenderText* renderer, const RenderStyle& style, const FontCascade& font, StringView word, int minimumPrefixLength, unsigned minimumSuffixLength, int& suffixStart, HashSet<const SimpleFontData*>& fallbackFonts, GlyphOverflow& glyphOverflow)
    647647{
    648648    suffixStart = 0;
     
    702702
    703703    const RenderStyle& style = this->style();
    704     const Font& font = style.font(); // FIXME: This ignores first-line.
     704    const FontCascade& font = style.fontCascade(); // FIXME: This ignores first-line.
    705705    float wordSpacing = font.wordSpacing();
    706706    int len = textLength();
     
    12161216
    12171217    const RenderStyle& lineStyle = firstLine ? firstLineStyle() : style();
    1218     return width(from, len, lineStyle.font(), xPos, fallbackFonts, glyphOverflow);
    1219 }
    1220 
    1221 float RenderText::width(unsigned from, unsigned len, const Font& f, float xPos, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
     1218    return width(from, len, lineStyle.fontCascade(), xPos, fallbackFonts, glyphOverflow);
     1219}
     1220
     1221float RenderText::width(unsigned from, unsigned len, const FontCascade& f, float xPos, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
    12221222{
    12231223    ASSERT(from + len <= textLength());
     
    12271227    const RenderStyle& style = this->style();
    12281228    float w;
    1229     if (&f == &style.font()) {
     1229    if (&f == &style.fontCascade()) {
    12301230        if (!style.preserveNewline() && !from && len == textLength() && (!glyphOverflow || !glyphOverflow->computeBounds)) {
    12311231            if (fallbackFonts) {
     
    15571557    if (isAllASCII() || m_text.is8Bit())
    15581558        return true;
    1559     return Font::characterRangeCodePath(characters16(), length()) == Font::Simple;
     1559    return FontCascade::characterRangeCodePath(characters16(), length()) == FontCascade::Simple;
    15601560}
    15611561
  • trunk/Source/WebCore/rendering/RenderText.h

    r177860 r178510  
    9090    void positionLineBox(InlineTextBox&);
    9191
    92     virtual float width(unsigned from, unsigned len, const Font&, float xPos, HashSet<const SimpleFontData*>* fallbackFonts = 0, GlyphOverflow* = 0) const;
     92    virtual float width(unsigned from, unsigned len, const FontCascade&, float xPos, HashSet<const SimpleFontData*>* fallbackFonts = 0, GlyphOverflow* = 0) const;
    9393    virtual float width(unsigned from, unsigned len, float xPos, bool firstLine = false, HashSet<const SimpleFontData*>* fallbackFonts = 0, GlyphOverflow* = 0) const;
    9494
     
    193193
    194194    bool containsOnlyWhitespace(unsigned from, unsigned len) const;
    195     float widthFromCache(const Font&, int start, int len, float xPos, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow*, const RenderStyle&) const;
     195    float widthFromCache(const FontCascade&, int start, int len, float xPos, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow*, const RenderStyle&) const;
    196196    bool isAllASCII() const { return m_isAllASCII; }
    197197    bool computeUseBackslashAsYenSymbol() const;
  • trunk/Source/WebCore/rendering/RenderTextControl.cpp

    r177259 r178510  
    175175{
    176176    float width;
    177     if (style().font().fastAverageCharWidthIfAvailable(width))
     177    if (style().fontCascade().fastAverageCharWidthIfAvailable(width))
    178178        return width;
    179179
    180180    const UChar ch = '0';
    181181    const String str = String(&ch, 1);
    182     const Font& font = style().font();
     182    const FontCascade& font = style().fontCascade();
    183183    TextRun textRun = constructTextRun(this, font, str, style(), TextRun::AllowTrailingExpansion);
    184184    textRun.disableRoundingHacks();
     
    190190    // This matches the unitsPerEm value for MS Shell Dlg and Courier New from the "head" font table.
    191191    float unitsPerEm = 2048.0f;
    192     return roundf(style().font().size() * x / unitsPerEm);
     192    return roundf(style().fontCascade().size() * x / unitsPerEm);
    193193}
    194194
  • trunk/Source/WebCore/rendering/RenderTextControlMultiLine.cpp

    r177259 r178510  
    6666    // of Courier New, the default font for textareas in IE, Firefox and Safari Win.
    6767    // 1229 is the avgCharWidth value in the OS/2 table for Courier New.
    68     if (style().font().firstFamily() == "Lucida Grande")
     68    if (style().fontCascade().firstFamily() == "Lucida Grande")
    6969        return scaleEmToUnits(1229);
    7070#endif
  • trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp

    r177955 r178510  
    320320    // IE for some encodings (in IE, the default font is encoding specific).
    321321    // 901 is the avgCharWidth value in the OS/2 table for MS Shell Dlg.
    322     if (style().font().firstFamily() == "Lucida Grande")
     322    if (style().fontCascade().firstFamily() == "Lucida Grande")
    323323        return scaleEmToUnits(901);
    324324#endif
     
    339339
    340340#if !PLATFORM(IOS)
    341     const AtomicString& family = style().font().firstFamily();
     341    const AtomicString& family = style().fontCascade().firstFamily();
    342342    // Since Lucida Grande is the default font, we want this to match the width
    343343    // of MS Shell Dlg, the default font for textareas in Firefox, Safari Win and
     
    346346    if (family == "Lucida Grande")
    347347        maxCharWidth = scaleEmToUnits(4027);
    348     else if (style().font().hasValidAverageCharWidth())
    349         maxCharWidth = roundf(style().font().primaryFontData().maxCharWidth());
     348    else if (style().fontCascade().hasValidAverageCharWidth())
     349        maxCharWidth = roundf(style().fontCascade().primaryFontData().maxCharWidth());
    350350#endif
    351351
  • trunk/Source/WebCore/rendering/RenderTheme.cpp

    r178124 r178510  
    115115        // Border
    116116        LengthBox borderBox(style.borderTopWidth(), style.borderRightWidth(), style.borderBottomWidth(), style.borderLeftWidth());
    117         borderBox = m_theme->controlBorder(part, style.font(), borderBox, style.effectiveZoom());
     117        borderBox = m_theme->controlBorder(part, style.fontCascade(), borderBox, style.effectiveZoom());
    118118        if (borderBox.top().value() != static_cast<int>(style.borderTopWidth())) {
    119119            if (borderBox.top().value())
     
    144144
    145145        // Padding
    146         LengthBox paddingBox = m_theme->controlPadding(part, style.font(), style.paddingBox(), style.effectiveZoom());
     146        LengthBox paddingBox = m_theme->controlPadding(part, style.fontCascade(), style.paddingBox(), style.effectiveZoom());
    147147        if (paddingBox != style.paddingBox())
    148148            style.setPaddingBox(paddingBox);
     
    155155        // The width and height here are affected by the zoom.
    156156        // FIXME: Check is flawed, since it doesn't take min-width/max-width into account.
    157         LengthSize controlSize = m_theme->controlSize(part, style.font(), LengthSize(style.width(), style.height()), style.effectiveZoom());
     157        LengthSize controlSize = m_theme->controlSize(part, style.fontCascade(), LengthSize(style.width(), style.height()), style.effectiveZoom());
    158158        if (controlSize.width() != style.width())
    159159            style.setWidth(controlSize.width());
     
    162162               
    163163        // Min-Width / Min-Height
    164         LengthSize minControlSize = m_theme->minimumControlSize(part, style.font(), style.effectiveZoom());
     164        LengthSize minControlSize = m_theme->minimumControlSize(part, style.fontCascade(), style.effectiveZoom());
    165165        if (minControlSize.width() != style.minWidth())
    166166            style.setMinWidth(minControlSize.width());
     
    169169               
    170170        // Font
    171         FontDescription controlFont = m_theme->controlFont(part, style.font(), style.effectiveZoom());
    172         if (controlFont != style.font().fontDescription()) {
     171        FontDescription controlFont = m_theme->controlFont(part, style.fontCascade(), style.effectiveZoom());
     172        if (controlFont != style.fontCascade().fontDescription()) {
    173173            // Now update our font.
    174174            if (style.setFontDescription(controlFont))
    175                 style.font().update(0);
     175                style.fontCascade().update(0);
    176176        }
    177177        // Reset our line-height
     
    12581258}
    12591259
    1260 String RenderTheme::fileListNameForWidth(const FileList* fileList, const Font& font, int width, bool multipleFilesAllowed) const
     1260String RenderTheme::fileListNameForWidth(const FileList* fileList, const FontCascade& font, int width, bool multipleFilesAllowed) const
    12611261{
    12621262    if (width <= 0)
  • trunk/Source/WebCore/rendering/RenderTheme.h

    r173571 r178510  
    240240
    241241    virtual String fileListDefaultLabel(bool multipleFilesAllowed) const;
    242     virtual String fileListNameForWidth(const FileList*, const Font&, int width, bool multipleFilesAllowed) const;
     242    virtual String fileListNameForWidth(const FileList*, const FontCascade&, int width, bool multipleFilesAllowed) const;
    243243
    244244    enum FileUploadDecorations { SingleFile, MultipleFiles };
  • trunk/Source/WebCore/rendering/RenderThemeGtk.cpp

    r178434 r178510  
    16441644}
    16451645
    1646 String RenderThemeGtk::fileListNameForWidth(const FileList* fileList, const Font& font, int width, bool multipleFilesAllowed) const
     1646String RenderThemeGtk::fileListNameForWidth(const FileList* fileList, const FontCascade& font, int width, bool multipleFilesAllowed) const
    16471647{
    16481648    if (width <= 0)
  • trunk/Source/WebCore/rendering/RenderThemeGtk.h

    r175084 r178510  
    181181    virtual bool paintInnerSpinButton(const RenderObject&, const PaintInfo&, const IntRect&) override;
    182182
    183     virtual String fileListNameForWidth(const FileList*, const Font&, int width, bool multipleFilesAllowed) const override;
     183    virtual String fileListNameForWidth(const FileList*, const FontCascade&, int width, bool multipleFilesAllowed) const override;
    184184
    185185    static void setTextInputBorders(RenderStyle&);
  • trunk/Source/WebCore/rendering/RenderThemeIOS.mm

    r178434 r178510  
    3535#import "Document.h"
    3636#import "FloatRoundedRect.h"
    37 #import "Font.h"
    3837#import "FontCache.h"
     38#import "FontCascade.h"
    3939#import "Frame.h"
    4040#import "FrameView.h"
     
    546546class RenderThemeMeasureTextClient : public MeasureTextClient {
    547547public:
    548     RenderThemeMeasureTextClient(const Font& font, RenderObject& renderObject, const RenderStyle& style)
     548    RenderThemeMeasureTextClient(const FontCascade& font, RenderObject& renderObject, const RenderStyle& style)
    549549        : m_font(font)
    550550        , m_renderObject(renderObject)
     
    558558    }
    559559private:
    560     const Font& m_font;
     560    const FontCascade& m_font;
    561561    RenderObject& m_renderObject;
    562562    const RenderStyle& m_style;
     
    578578
    579579    // Enforce the width and set the box-sizing to content-box to not conflict with the padding.
    580     Font font = style.font();
     580    FontCascade font = style.fontCascade();
    581581   
    582582    RenderObject* renderer = inputElement.renderer();
  • trunk/Source/WebCore/rendering/RenderThemeMac.h

    r173571 r178510  
    170170
    171171private:
    172     virtual String fileListNameForWidth(const FileList*, const Font&, int width, bool multipleFilesAllowed) const override;
     172    virtual String fileListNameForWidth(const FileList*, const FontCascade&, int width, bool multipleFilesAllowed) const override;
    173173
    174174    FloatRect convertToPaintingRect(const RenderObject& inputRenderer, const RenderObject& partRenderer, const FloatRect& inputRect, const IntRect&) const;
  • trunk/Source/WebCore/rendering/RenderThemeMac.mm

    r178434 r178510  
    818818
    819819    if (style.setFontDescription(fontDescription))
    820         style.font().update(0);
     820        style.fontCascade().update(0);
    821821}
    822822
     
    19981998}
    19991999
    2000 String RenderThemeMac::fileListNameForWidth(const FileList* fileList, const Font& font, int width, bool multipleFilesAllowed) const
     2000String RenderThemeMac::fileListNameForWidth(const FileList* fileList, const FontCascade& font, int width, bool multipleFilesAllowed) const
    20012001{
    20022002    if (width <= 0)
  • trunk/Source/WebCore/rendering/RootInlineBox.cpp

    r177955 r178510  
    902902    const RenderStyle& boxLineStyle = box.lineStyle();
    903903    if (usedFonts && !usedFonts->isEmpty() && (includeFont || (boxLineStyle.lineHeight().isNegative() && includeLeading))) {
    904         usedFonts->append(&boxLineStyle.font().primaryFontData());
     904        usedFonts->append(&boxLineStyle.fontCascade().primaryFontData());
    905905        for (size_t i = 0; i < usedFonts->size(); ++i) {
    906906            const FontMetrics& fontMetrics = usedFonts->at(i)->fontMetrics();
     
    10181018    if (verticalAlign != BASELINE) {
    10191019        const RenderStyle& parentLineStyle = firstLine ? parent->firstLineStyle() : parent->style();
    1020         const Font& font = parentLineStyle.font();
     1020        const FontCascade& font = parentLineStyle.fontCascade();
    10211021        const FontMetrics& fontMetrics = font.fontMetrics();
    10221022        int fontSize = font.pixelSize();
  • trunk/Source/WebCore/rendering/SimpleLineLayout.cpp

    r178407 r178510  
    185185        }
    186186    }
    187     if (style.font().primaryFontData().isSVGFont())
     187    if (style.fontCascade().primaryFontData().isSVGFont())
    188188        return false;
    189189    // We assume that all lines have metrics based purely on the primary font.
    190     auto& primaryFontData = style.font().primaryFontData();
     190    auto& primaryFontData = style.fontCascade().primaryFontData();
    191191    if (primaryFontData.isLoading())
    192192        return false;
     
    195195            || textRenderer.isSVGInlineText())
    196196            return false;
    197         if (style.font().codePath(TextRun(textRenderer.text())) != Font::Simple)
     197        if (style.fontCascade().codePath(TextRun(textRenderer.text())) != FontCascade::Simple)
    198198            return false;
    199199        if (!canUseForText(textRenderer, primaryFontData))
  • trunk/Source/WebCore/rendering/SimpleLineLayoutFlowContents.cpp

    r177853 r178510  
    3535
    3636FlowContents::Style::Style(const RenderStyle& style)
    37     : font(style.font())
     37    : font(style.fontCascade())
    3838    , textAlign(style.textAlign())
    3939    , collapseWhitespace(style.collapseWhiteSpace())
  • trunk/Source/WebCore/rendering/SimpleLineLayoutFlowContents.h

    r177219 r178510  
    2727#define SimpleLineLayoutFlowContents_h
    2828
    29 #include "Font.h"
     29#include "FontCascade.h"
    3030#include "RenderStyle.h"
    3131#include "TextBreakIterator.h"
     
    6464        explicit Style(const RenderStyle&);
    6565
    66         const Font& font;
     66        const FontCascade& font;
    6767        ETextAlign textAlign;
    6868        bool collapseWhitespace;
  • trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp

    r176317 r178510  
    7171
    7272    GraphicsContext& context = *paintInfo.context;
    73     const Font& font = style.font();
     73    const FontCascade& font = style.fontCascade();
    7474    TextPaintStyle textPaintStyle = computeTextPaintStyle(flow.frame(), style, paintInfo);
    7575    GraphicsContextStateSaver stateSaver(context, textPaintStyle.strokeWidth > 0);
  • trunk/Source/WebCore/rendering/SimpleLineLayoutResolver.cpp

    r177852 r178510  
    121121    , m_baseline(baselineFromFlow(flow))
    122122    , m_borderAndPaddingBefore(flow.borderAndPaddingBefore())
    123     , m_ascent(flow.style().font().fontMetrics().ascent())
    124     , m_descent(flow.style().font().fontMetrics().descent())
     123    , m_ascent(flow.style().fontCascade().fontMetrics().ascent())
     124    , m_descent(flow.style().fontCascade().fontMetrics().descent())
    125125{
    126126}
  • trunk/Source/WebCore/rendering/TextAutoSizing.cpp

    r174759 r178510  
    165165            fontDescription.setComputedSize(averageSize);
    166166            style->setFontDescription(fontDescription);
    167             style->font().update(autoSizingNode->document().ensureStyleResolver().fontSelector());
     167            style->fontCascade().update(autoSizingNode->document().ensureStyleResolver().fontSelector());
    168168            text->parent()->setStyle(style.releaseNonNull());
    169169           
     
    177177                RefPtr<RenderStyle> style = cloneRenderStyleWithState(listMarkerRenderer->style());
    178178                style->setFontDescription(fontDescription);
    179                 style->font().update(autoSizingNode->document().ensureStyleResolver().fontSelector());
     179                style->fontCascade().update(autoSizingNode->document().ensureStyleResolver().fontSelector());
    180180                downcast<RenderListMarker>(*listMarkerRenderer).setStyle(style.releaseNonNull());
    181181            }
     
    197197                newParentStyle->setSpecifiedLineHeight(lineHeightLength);
    198198                newParentStyle->setFontDescription(fontDescription);
    199                 newParentStyle->font().update(autoSizingNode->document().ensureStyleResolver().fontSelector());
     199                newParentStyle->fontCascade().update(autoSizingNode->document().ensureStyleResolver().fontSelector());
    200200                parentRenderer->setStyle(newParentStyle.releaseNonNull());
    201201            }
     
    221221            RefPtr<RenderStyle> style = cloneRenderStyleWithState(text->style());
    222222            style->setFontDescription(fontDescription);
    223             style->font().update(autoSizingNode->document().ensureStyleResolver().fontSelector());
     223            style->fontCascade().update(autoSizingNode->document().ensureStyleResolver().fontSelector());
    224224            text->parent()->setStyle(style.releaseNonNull());
    225225        }
     
    238238            newParentStyle->setLineHeight(originalLineHeight);
    239239            newParentStyle->setFontDescription(fontDescription);
    240             newParentStyle->font().update(autoSizingNode->document().ensureStyleResolver().fontSelector());
     240            newParentStyle->fontCascade().update(autoSizingNode->document().ensureStyleResolver().fontSelector());
    241241            parentRenderer->setStyle(newParentStyle.releaseNonNull());
    242242        }
  • trunk/Source/WebCore/rendering/TextPainter.cpp

    r173941 r178510  
    3232namespace WebCore {
    3333
    34 TextPainter::TextPainter(GraphicsContext& context, bool paintSelectedTextOnly, bool paintSelectedTextSeparately, const Font& font,
     34TextPainter::TextPainter(GraphicsContext& context, bool paintSelectedTextOnly, bool paintSelectedTextSeparately, const FontCascade& font,
    3535    int startPositionInTextRun, int endPositionInTextBoxString, int length, const AtomicString& emphasisMark, RenderCombineText* combinedText, TextRun& textRun,
    3636    FloatRect& boxRect, FloatPoint& textOrigin, int emphasisMarkOffset, const ShadowData* textShadow, const ShadowData* selectionShadow,
     
    5757}
    5858
    59 static void drawTextOrEmphasisMarks(GraphicsContext& context, const Font& font, const TextRun& textRun, const AtomicString& emphasisMark,
     59static void drawTextOrEmphasisMarks(GraphicsContext& context, const FontCascade& font, const TextRun& textRun, const AtomicString& emphasisMark,
    6060    int emphasisMarkOffset, const FloatPoint& point, const int from, const int to)
    6161{
     
    114114}
    115115
    116 static void paintTextWithShadows(GraphicsContext& context, const Font& font, const TextRun& textRun, const AtomicString& emphasisMark,
     116static void paintTextWithShadows(GraphicsContext& context, const FontCascade& font, const TextRun& textRun, const AtomicString& emphasisMark,
    117117    int emphasisMarkOffset, int startOffset, int endOffset, int truncationPoint, const FloatPoint& textOrigin, const FloatRect& boxRect,
    118118    const ShadowData* shadow, bool stroked, bool horizontal)
  • trunk/Source/WebCore/rendering/TextPainter.h

    r173942 r178510  
    4545class TextPainter {
    4646public:
    47     TextPainter(GraphicsContext&, bool paintSelectedTextOnly, bool paintSelectedTextSeparately, const Font&,
     47    TextPainter(GraphicsContext&, bool paintSelectedTextOnly, bool paintSelectedTextSeparately, const FontCascade&,
    4848    int startPositionInTextRun, int endPositionInTextBoxString, int length, const AtomicString& emphasisMark, RenderCombineText*,
    4949    TextRun&, FloatRect& boxRect, FloatPoint& textOrigin, int emphasisMarkOffset, const ShadowData* textShadow, const ShadowData* selectionShadow,
     
    6262    bool m_paintSelectedTextOnly;
    6363    bool m_paintSelectedTextSeparately;
    64     const Font& m_font;
     64    const FontCascade& m_font;
    6565    int m_startPositionInTextRun;
    6666    int m_endPositionInTextRun;
  • trunk/Source/WebCore/rendering/line/BreakingContextInlineHeaders.h

    r178114 r178510  
    487487}
    488488
    489 inline float measureHyphenWidth(RenderText* renderer, const Font& font, HashSet<const SimpleFontData*>* fallbackFonts = 0)
     489inline float measureHyphenWidth(RenderText* renderer, const FontCascade& font, HashSet<const SimpleFontData*>* fallbackFonts = 0)
    490490{
    491491    const RenderStyle& style = renderer->style();
     
    493493}
    494494
    495 ALWAYS_INLINE float textWidth(RenderText* text, unsigned from, unsigned len, const Font& font, float xPos, bool isFixedPitch, bool collapseWhiteSpace, HashSet<const SimpleFontData*>& fallbackFonts, TextLayout* layout = 0)
     495ALWAYS_INLINE float textWidth(RenderText* text, unsigned from, unsigned len, const FontCascade& font, float xPos, bool isFixedPitch, bool collapseWhiteSpace, HashSet<const SimpleFontData*>& fallbackFonts, TextLayout* layout = 0)
    496496{
    497497    const RenderStyle& style = text->style();
     
    502502
    503503    if (layout)
    504         return Font::width(*layout, from, len, &fallbackFonts);
     504        return FontCascade::width(*layout, from, len, &fallbackFonts);
    505505
    506506    TextRun run = RenderBlock::constructTextRun(text, font, text, from, len, style);
     
    522522}
    523523
    524 inline void tryHyphenating(RenderText* text, const Font& font, const AtomicString& localeIdentifier, unsigned consecutiveHyphenatedLines, int consecutiveHyphenatedLinesLimit, int minimumPrefixLimit, int minimumSuffixLimit, unsigned lastSpace, unsigned pos, float xPos, int availableWidth, bool isFixedPitch, bool collapseWhiteSpace, int lastSpaceWordSpacing, InlineIterator& lineBreak, int nextBreakable, bool& hyphenated)
     524inline void tryHyphenating(RenderText* text, const FontCascade& font, const AtomicString& localeIdentifier, unsigned consecutiveHyphenatedLines, int consecutiveHyphenatedLinesLimit, int minimumPrefixLimit, int minimumSuffixLimit, unsigned lastSpace, unsigned pos, float xPos, int availableWidth, bool isFixedPitch, bool collapseWhiteSpace, int lastSpaceWordSpacing, InlineIterator& lineBreak, int nextBreakable, bool& hyphenated)
    525525{
    526526    // Map 'hyphenate-limit-{before,after}: auto;' to 2.
     
    616616
    617617    const RenderStyle& style = lineStyle(*renderText.parent(), m_lineInfo);
    618     const Font& font = style.font();
     618    const FontCascade& font = style.fontCascade();
    619619    bool isFixedPitch = font.isFixedPitch();
    620620    bool canHyphenate = style.hyphens() == HyphensAuto && WebCore::canHyphenate(style.locale());
    621621
    622622    unsigned lastSpace = m_current.offset();
    623     float wordSpacing = m_currentStyle->font().wordSpacing();
     623    float wordSpacing = m_currentStyle->fontCascade().wordSpacing();
    624624    float lastSpaceWordSpacing = 0;
    625625    float wordSpacingForWordMeasurement = 0;
  • trunk/Source/WebCore/rendering/line/LineBreaker.h

    r160235 r178510  
    4444    OwnPtr<TextLayout> m_layout;
    4545    LazyLineBreakIterator m_lineBreakIterator;
    46     const Font* m_font;
     46    const FontCascade* m_font;
    4747};
    4848
  • trunk/Source/WebCore/rendering/line/LineInlineHeaders.h

    r174714 r178510  
    5757        if (flowStyle.lineHeight() != parentStyle.lineHeight()
    5858            || flowStyle.verticalAlign() != parentStyle.verticalAlign()
    59             || !parentStyle.font().fontMetrics().hasIdenticalAscentDescentAndLineGap(flowStyle.font().fontMetrics()))
     59            || !parentStyle.fontCascade().fontMetrics().hasIdenticalAscentDescentAndLineGap(flowStyle.fontCascade().fontMetrics()))
    6060        return true;
    6161    }
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp

    r177259 r178510  
    223223    }
    224224    if (unit == "em") {
    225         lengthValue = floatValue * style->font().size();
     225        lengthValue = floatValue * style->fontCascade().size();
    226226        return true;
    227227    }
     
    294294    }
    295295    if (length) {
    296         lengthValue = length * style->font().size() / 18;
     296        lengthValue = length * style->fontCascade().size() / 18;
    297297        return true;
    298298    }
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp

    r178250 r178510  
    11921192
    11931193    // Leading and trailing space is specified as multiple of 1/18em.
    1194     m_leadingSpace = entry->lspace * style().font().size() / 18;
    1195     m_trailingSpace = entry->rspace * style().font().size() / 18;
     1194    m_leadingSpace = entry->lspace * style().fontCascade().size() / 18;
     1195    m_trailingSpace = entry->rspace * style().fontCascade().size() / 18;
    11961196}
    11971197
     
    12301230    else
    12311231        m_operatorFlags = 0; // This resets all the operator properties.
    1232     m_leadingSpace = 5 * style().font().size() / 18; // This sets leading space to "thickmathspace".
    1233     m_trailingSpace = 5 * style().font().size() / 18; // This sets trailing space to "thickmathspace".
    1234     m_minSize = style().font().size(); // This sets minsize to "1em".
     1232    m_leadingSpace = 5 * style().fontCascade().size() / 18; // This sets leading space to "thickmathspace".
     1233    m_trailingSpace = 5 * style().fontCascade().size() / 18; // This sets trailing space to "thickmathspace".
     1234    m_minSize = style().fontCascade().size(); // This sets minsize to "1em".
    12351235    m_maxSize = intMaxForLayoutUnit; // This sets maxsize to "infinity".
    12361236
     
    13561356        if (isInvisibleOperator()) {
    13571357            // In some fonts, glyphs for invisible operators have nonzero width. Consequently, we subtract that width here to avoid wide gaps.
    1358             GlyphData data = style().font().glyphDataForCharacter(m_textContent, false);
     1358            GlyphData data = style().fontCascade().glyphDataForCharacter(m_textContent, false);
    13591359            float glyphWidth = advanceForGlyph(data);
    13601360            ASSERT(glyphWidth <= m_minPreferredLogicalWidth);
     
    13651365    }
    13661366
    1367     GlyphData data = style().font().glyphDataForCharacter(m_textContent, !style().isLeftToRightDirection());
     1367    GlyphData data = style().fontCascade().glyphDataForCharacter(m_textContent, !style().isLeftToRightDirection());
    13681368    float maximumGlyphWidth = advanceForGlyph(data);
    13691369    if (!m_isVertical) {
     
    15221522        bottom.glyph = extension.glyph;
    15231523
    1524     top.fontData = &style().font().primaryFontData();
     1524    top.fontData = &style().fontCascade().primaryFontData();
    15251525    extension.fontData = top.fontData;
    15261526    bottom.fontData = top.fontData;
     
    15391539    ASSERT(m_isVertical && isLargeOperatorInDisplayStyle());
    15401540
    1541     const auto& primaryFontData = style().font().primaryFontData();
    1542     GlyphData baseGlyph = style().font().glyphDataForCharacter(character, !style().isLeftToRightDirection());
     1541    const auto& primaryFontData = style().fontCascade().primaryFontData();
     1542    GlyphData baseGlyph = style().fontCascade().glyphDataForCharacter(character, !style().isLeftToRightDirection());
    15431543    if (!primaryFontData.mathData() || baseGlyph.fontData != &primaryFontData)
    15441544        return data;
     
    15711571    StretchyData assemblyData;
    15721572
    1573     const auto& primaryFontData = style().font().primaryFontData();
    1574     GlyphData baseGlyph = style().font().glyphDataForCharacter(character, !style().isLeftToRightDirection());
     1573    const auto& primaryFontData = style().fontCascade().primaryFontData();
     1574    GlyphData baseGlyph = style().fontCascade().glyphDataForCharacter(character, !style().isLeftToRightDirection());
    15751575   
    15761576    if (primaryFontData.mathData() && baseGlyph.fontData == &primaryFontData) {
     
    16191619
    16201620        // We convert the list of Unicode characters into a list of glyph data.
    1621         GlyphData top = style().font().glyphDataForCharacter(stretchyCharacter->topChar, false);
    1622         GlyphData extension = style().font().glyphDataForCharacter(stretchyCharacter->extensionChar, false);
    1623         GlyphData bottom = style().font().glyphDataForCharacter(stretchyCharacter->bottomChar, false);
     1621        GlyphData top = style().fontCascade().glyphDataForCharacter(stretchyCharacter->topChar, false);
     1622        GlyphData extension = style().fontCascade().glyphDataForCharacter(stretchyCharacter->extensionChar, false);
     1623        GlyphData bottom = style().fontCascade().glyphDataForCharacter(stretchyCharacter->bottomChar, false);
    16241624        GlyphData middle;
    16251625        if (stretchyCharacter->middleChar)
    1626             middle = style().font().glyphDataForCharacter(stretchyCharacter->middleChar, false);
     1626            middle = style().fontCascade().glyphDataForCharacter(stretchyCharacter->middleChar, false);
    16271627        assemblyData.setGlyphAssemblyMode(top, extension, bottom, middle);
    16281628    }
     
    16811681    else {
    16821682        // We do not stretch if the base glyph is large enough.
    1683         GlyphData baseGlyph = style().font().glyphDataForCharacter(m_textContent, !style().isLeftToRightDirection());
     1683        GlyphData baseGlyph = style().fontCascade().glyphDataForCharacter(m_textContent, !style().isLeftToRightDirection());
    16841684        float baseSize = m_isVertical ? heightForGlyph(baseGlyph) : advanceForGlyph(baseGlyph);
    16851685        if (stretchSize() <= baseSize)
     
    18031803    GlyphBuffer buffer;
    18041804    buffer.add(data.glyph, data.fontData, advanceForGlyph(data));
    1805     info.context->drawGlyphs(style().font(), *data.fontData, buffer, 0, 1, origin);
     1805    info.context->drawGlyphs(style().fontCascade(), *data.fontData, buffer, 0, 1, origin);
    18061806
    18071807    return glyphPaintRect;
     
    18991899        FloatRect glyphBounds = boundsForGlyph(m_stretchyData.variant());
    19001900        LayoutPoint operatorOrigin(operatorTopLeft.x(), operatorTopLeft.y() - glyphBounds.y());
    1901         info.context->drawGlyphs(style().font(), *m_stretchyData.variant().fontData, buffer, 0, 1, operatorOrigin);
     1901        info.context->drawGlyphs(style().fontCascade(), *m_stretchyData.variant().fontData, buffer, 0, 1, operatorOrigin);
    19021902        return;
    19031903    }
     
    19811981LayoutUnit RenderMathMLOperator::trailingSpaceError()
    19821982{
    1983     const auto& primaryFontData = style().font().primaryFontData();
     1983    const auto& primaryFontData = style().fontCascade().primaryFontData();
    19841984    if (!primaryFontData.mathData())
    19851985        return 0;
     
    19901990
    19911991    if (m_stretchyData.mode() == DrawNormal) {
    1992         GlyphData data = style().font().glyphDataForCharacter(textContent(), !style().isLeftToRightDirection());
     1992        GlyphData data = style().fontCascade().glyphDataForCharacter(textContent(), !style().isLeftToRightDirection());
    19931993        return width - advanceForGlyph(data);
    19941994    }
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLRadicalOperator.cpp

    r177955 r178510  
    6464void RenderMathMLRadicalOperator::stretchTo(LayoutUnit heightAboveBaseline, LayoutUnit depthBelowBaseline)
    6565{
    66     if (!style().font().primaryFontData().mathData()) {
     66    if (!style().fontCascade().primaryFontData().mathData()) {
    6767        // If we do not have an OpenType MATH font, we always make the radical depth a bit larger than the target.
    6868        depthBelowBaseline += gRadicalBottomPointLower;
     
    8484    ASSERT(preferredLogicalWidthsDirty());
    8585
    86     if (style().font().primaryFontData().mathData()) {
     86    if (style().fontCascade().primaryFontData().mathData()) {
    8787        RenderMathMLOperator::computePreferredLogicalWidths();
    8888        return;
     
    9797void RenderMathMLRadicalOperator::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues& computedValues) const
    9898{
    99     if (style().font().primaryFontData().mathData()) {
     99    if (style().fontCascade().primaryFontData().mathData()) {
    100100        RenderMathMLOperator::computeLogicalHeight(logicalHeight, logicalTop, computedValues);
    101101        return;
     
    112112        return;
    113113
    114     if (style().font().primaryFontData().mathData()) {
     114    if (style().fontCascade().primaryFontData().mathData()) {
    115115        RenderMathMLOperator::paint(info, paintOffset);
    116116        return;
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp

    r177955 r178510  
    200200    // We set some constants to draw the radical, as defined in the OpenType MATH tables.
    201201
    202     m_ruleThickness = 0.05f * style().font().size();
     202    m_ruleThickness = 0.05f * style().fontCascade().size();
    203203
    204204    // FIXME: The recommended default for m_verticalGap in displaystyle is rule thickness + 1/4 x-height (https://bugs.webkit.org/show_bug.cgi?id=118737).
    205205    m_verticalGap = 11 * m_ruleThickness / 4;
    206206    m_extraAscender = m_ruleThickness;
    207     LayoutUnit kernBeforeDegree = 5 * style().font().size() / 18;
    208     LayoutUnit kernAfterDegree = -10 * style().font().size() / 18;
     207    LayoutUnit kernBeforeDegree = 5 * style().fontCascade().size() / 18;
     208    LayoutUnit kernAfterDegree = -10 * style().fontCascade().size() / 18;
    209209    m_degreeBottomRaisePercent = 0.6f;
    210210
    211     const auto& primaryFontData = style().font().primaryFontData();
    212     if (auto* mathData = style().font().primaryFontData().mathData()) {
     211    const auto& primaryFontData = style().fontCascade().primaryFontData();
     212    if (auto* mathData = style().fontCascade().primaryFontData().mathData()) {
    213213        // FIXME: m_verticalGap should use RadicalDisplayStyleVertical in display mode (https://bugs.webkit.org/show_bug.cgi?id=118737).
    214214        m_verticalGap = mathData->getMathConstant(primaryFontData, OpenTypeMathData::RadicalVerticalGap);
  • trunk/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp

    r178434 r178510  
    8989        // FIXME: This should be revised when mathvariant is implemented (http://wkbug/85735) and when fonts with Mathematical Alphanumeric Symbols characters are more popular.
    9090        FontDescription fontDescription(newStyle.get().fontDescription());
    91         FontSelector* fontSelector = newStyle.get().font().fontSelector();
     91        FontSelector* fontSelector = newStyle.get().fontCascade().fontSelector();
    9292        if (!m_containsElement && element().textContent().stripWhiteSpace().simplifyWhiteSpace().length() == 1 && !tokenElement.hasAttribute(mathvariantAttr))
    9393            fontDescription.setItalic(FontItalicOn);
    9494        if (newStyle.get().setFontDescription(fontDescription))
    95             newStyle.get().font().update(fontSelector);
     95            newStyle.get().fontCascade().update(fontSelector);
    9696    }
    9797
  • trunk/Source/WebCore/rendering/style/RenderStyle.cpp

    r177955 r178510  
    2828#include "CSSPropertyNames.h"
    2929#include "FloatRoundedRect.h"
    30 #include "Font.h"
     30#include "FontCascade.h"
    3131#include "FontSelector.h"
    3232#include "InlineTextBoxStyle.h"
     
    294294
    295295#if ENABLE(IOS_TEXT_AUTOSIZING)
    296 inline unsigned computeFontHash(const Font& font)
     296inline unsigned computeFontHash(const FontCascade& font)
    297297{
    298298    unsigned hashCodes[2] = {
     
    316316    hash ^= rareInheritedData->lineBreak;
    317317    hash ^= WTF::FloatHash<float>::hash(inherited->specifiedLineHeight.value());
    318     hash ^= computeFontHash(inherited->font);
     318    hash ^= computeFontHash(inherited->fontCascade);
    319319    hash ^= inherited->horizontal_border_spacing;
    320320    hash ^= inherited->vertical_border_spacing;
     
    340340        && rareInheritedData->textSecurity == other->rareInheritedData->textSecurity
    341341        && inherited->specifiedLineHeight == other->inherited->specifiedLineHeight
    342         && inherited->font.equalForTextAutoSizing(other->inherited->font)
     342        && inherited->fontCascade.equalForTextAutoSizing(other->inherited->fontCascade)
    343343        && inherited->horizontal_border_spacing == other->inherited->horizontal_border_spacing
    344344        && inherited->vertical_border_spacing == other->inherited->vertical_border_spacing
     
    552552        || inherited->specifiedLineHeight != other.inherited->specifiedLineHeight
    553553#endif
    554         || inherited->font != other.inherited->font
     554        || inherited->fontCascade != other.inherited->fontCascade
    555555        || inherited->horizontal_border_spacing != other.inherited->horizontal_border_spacing
    556556        || inherited->vertical_border_spacing != other.inherited->vertical_border_spacing
     
    11851185    DEPRECATED_DEFINE_STATIC_LOCAL(AtomicString, hyphenMinusString, (&hyphenMinus, 1));
    11861186    DEPRECATED_DEFINE_STATIC_LOCAL(AtomicString, hyphenString, (&hyphen, 1));
    1187     return font().primaryFontData().glyphForCharacter(hyphen) ? hyphenString : hyphenMinusString;
     1187    return fontCascade().primaryFontData().glyphForCharacter(hyphen) ? hyphenString : hyphenMinusString;
    11881188}
    11891189
     
    13411341}
    13421342
    1343 const Font& RenderStyle::font() const { return inherited->font; }
    1344 const FontMetrics& RenderStyle::fontMetrics() const { return inherited->font.fontMetrics(); }
    1345 const FontDescription& RenderStyle::fontDescription() const { return inherited->font.fontDescription(); }
     1343const FontCascade& RenderStyle::fontCascade() const { return inherited->fontCascade; }
     1344const FontMetrics& RenderStyle::fontMetrics() const { return inherited->fontCascade.fontMetrics(); }
     1345const FontDescription& RenderStyle::fontDescription() const { return inherited->fontCascade.fontDescription(); }
    13461346float RenderStyle::specifiedFontSize() const { return fontDescription().specifiedSize(); }
    13471347float RenderStyle::computedFontSize() const { return fontDescription().computedSize(); }
    1348 int RenderStyle::fontSize() const { return inherited->font.pixelSize(); }
     1348int RenderStyle::fontSize() const { return inherited->fontCascade.pixelSize(); }
    13491349
    13501350const Length& RenderStyle::wordSpacing() const { return rareInheritedData->wordSpacing; }
    1351 float RenderStyle::letterSpacing() const { return inherited->font.letterSpacing(); }
     1351float RenderStyle::letterSpacing() const { return inherited->fontCascade.letterSpacing(); }
    13521352
    13531353bool RenderStyle::setFontDescription(const FontDescription& v)
    13541354{
    1355     if (inherited->font.fontDescription() != v) {
    1356         inherited.access()->font = Font(v, inherited->font.letterSpacing(), inherited->font.wordSpacing());
     1355    if (inherited->fontCascade.fontDescription() != v) {
     1356        inherited.access()->fontCascade = FontCascade(v, inherited->fontCascade.letterSpacing(), inherited->fontCascade.wordSpacing());
    13571357        return true;
    13581358    }
     
    14051405        break;
    14061406    case Percent:
    1407         fontWordSpacing = value.percent() * font().spaceWidth() / 100;
     1407        fontWordSpacing = value.percent() * fontCascade().spaceWidth() / 100;
    14081408        break;
    14091409    case Fixed:
     
    14181418        break;
    14191419    }
    1420     inherited.access()->font.setWordSpacing(fontWordSpacing);
     1420    inherited.access()->fontCascade.setWordSpacing(fontWordSpacing);
    14211421    rareInheritedData.access()->wordSpacing = WTF::move(value);
    14221422}
    14231423
    1424 void RenderStyle::setLetterSpacing(float v) { inherited.access()->font.setLetterSpacing(v); }
     1424void RenderStyle::setLetterSpacing(float v) { inherited.access()->fontCascade.setLetterSpacing(v); }
    14251425
    14261426void RenderStyle::setFontSize(float size)
     
    14351435        size = std::min(maximumAllowedFontSize, size);
    14361436
    1437     FontSelector* currentFontSelector = font().fontSelector();
     1437    FontSelector* currentFontSelector = fontCascade().fontSelector();
    14381438    FontDescription desc(fontDescription());
    14391439    desc.setSpecifiedSize(size);
     
    14491449
    14501450    setFontDescription(desc);
    1451     font().update(currentFontSelector);
     1451    fontCascade().update(currentFontSelector);
    14521452}
    14531453
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r178246 r178510  
    106106class CursorList;
    107107class FilterOperations;
    108 class Font;
     108class FontCascade;
    109109class FontMetrics;
    110110class IntRect;
     
    690690    ETableLayout tableLayout() const { return noninherited_flags.tableLayout(); }
    691691
    692     WEBCORE_EXPORT const Font& font() const;
     692    WEBCORE_EXPORT const FontCascade& fontCascade() const;
    693693    WEBCORE_EXPORT const FontMetrics& fontMetrics() const;
    694694    WEBCORE_EXPORT const FontDescription& fontDescription() const;
  • trunk/Source/WebCore/rendering/style/StyleInheritedData.cpp

    r177259 r178510  
    5151    , specifiedLineHeight(o.specifiedLineHeight)
    5252#endif
    53     , font(o.font)
     53    , fontCascade(o.fontCascade)
    5454    , color(o.color)
    5555    , visitedLinkColor(o.visitedLinkColor)
     
    6868        && specifiedLineHeight == o.specifiedLineHeight
    6969#endif
    70         && font == o.font
     70        && fontCascade == o.fontCascade
    7171        && color == o.color
    7272        && visitedLinkColor == o.visitedLinkColor
  • trunk/Source/WebCore/rendering/style/StyleInheritedData.h

    r177259 r178510  
    2727
    2828#include "Color.h"
    29 #include "Font.h"
     29#include "FontCascade.h"
    3030#include "Length.h"
    3131#include <wtf/PassRefPtr.h>
     
    5757#endif
    5858
    59     Font font;
     59    FontCascade fontCascade;
    6060    Color color;
    6161    Color visitedLinkColor;
  • trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp

    r174746 r178510  
    226226}
    227227
    228 void RenderSVGInlineText::computeNewScaledFontForStyle(const RenderObject& renderer, const RenderStyle& style, float& scalingFactor, Font& scaledFont)
     228void RenderSVGInlineText::computeNewScaledFontForStyle(const RenderObject& renderer, const RenderStyle& style, float& scalingFactor, FontCascade& scaledFont)
    229229{
    230230    // Alter font-size to the right on-screen value to avoid scaling the glyphs themselves, except when GeometricPrecision is specified
     
    232232    if (scalingFactor == 1 || !scalingFactor || style.fontDescription().textRenderingMode() == GeometricPrecision) {
    233233        scalingFactor = 1;
    234         scaledFont = style.font();
     234        scaledFont = style.fontCascade();
    235235        return;
    236236    }
     
    241241    fontDescription.setComputedSize(Style::computedFontSizeFromSpecifiedSizeForSVGInlineText(fontDescription.computedSize(), fontDescription.isAbsoluteSize(), scalingFactor, renderer.document()));
    242242
    243     scaledFont = Font(fontDescription, 0, 0);
     243    scaledFont = FontCascade(fontDescription, 0, 0);
    244244    scaledFont.update(renderer.document().ensureStyleResolver().fontSelector());
    245245}
  • trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.h

    r174854 r178510  
    2323#define RenderSVGInlineText_h
    2424
    25 #include "Font.h"
     25#include "FontCascade.h"
    2626#include "RenderText.h"
    2727#include "SVGTextLayoutAttributes.h"
     
    4242
    4343    float scalingFactor() const { return m_scalingFactor; }
    44     const Font& scaledFont() const { return m_scaledFont; }
     44    const FontCascade& scaledFont() const { return m_scaledFont; }
    4545    void updateScaledFont();
    46     static void computeNewScaledFontForStyle(const RenderObject&, const RenderStyle&, float& scalingFactor, Font& scaledFont);
     46    static void computeNewScaledFontForStyle(const RenderObject&, const RenderStyle&, float& scalingFactor, FontCascade& scaledFont);
    4747
    4848    // Preserves floating point precision for the use in DRT. It knows how to round and does a better job than enclosingIntRect.
     
    6666
    6767    float m_scalingFactor;
    68     Font m_scaledFont;
     68    FontCascade m_scaledFont;
    6969    SVGTextLayoutAttributes m_layoutAttributes;
    7070};
  • trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp

    r178250 r178510  
    117117    ASSERT(scalingFactor);
    118118
    119     const Font& scaledFont = renderer().scaledFont();
     119    const FontCascade& scaledFont = renderer().scaledFont();
    120120    const FontMetrics& scaledFontMetrics = scaledFont.fontMetrics();
    121121    FloatPoint textOrigin(fragment.x, fragment.y);
     
    173173static inline bool textShouldBePainted(const RenderSVGInlineText& textRenderer)
    174174{
    175     // Font::pixelSize(), returns FontDescription::computedPixelSize(), which returns "int(x + 0.5)".
     175    // FontCascade::pixelSize(), returns FontDescription::computedPixelSize(), which returns "int(x + 0.5)".
    176176    // If the absolute font size on screen is below x=0.5, don't render anything.
    177177    return textRenderer.scaledFont().pixelSize();
     
    420420                , dirOverride() || style->rtlOrdering() == VisualOrder /* directionalOverride */);
    421421
    422     if (style->font().primaryFontData().isSVGFont())
     422    if (style->fontCascade().primaryFontData().isSVGFont())
    423423        run.setRenderingContext(SVGTextRunRenderingContext::create(renderer()));
    424424
     
    476476}
    477477
    478 static inline float thicknessForDecoration(TextDecoration, const Font& font)
     478static inline float thicknessForDecoration(TextDecoration, const FontCascade& font)
    479479{
    480480    // FIXME: For SVG Fonts we need to use the attributes defined in the <font-face> if specified.
     
    536536
    537537    float scalingFactor = 1;
    538     Font scaledFont;
     538    FontCascade scaledFont;
    539539    RenderSVGInlineText::computeNewScaledFontForStyle(decorationRenderer, decorationStyle, scalingFactor, scaledFont);
    540540    ASSERT(scalingFactor);
     
    571571    ASSERT(scalingFactor);
    572572
    573     const Font& scaledFont = renderer().scaledFont();
     573    const FontCascade& scaledFont = renderer().scaledFont();
    574574    const ShadowData* shadow = style->textShadow();
    575575
  • trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp

    r174603 r178510  
    440440    auto upconvertedCharacters = StringView(text->text()).upconvertedCharacters();
    441441    const UChar* characters = upconvertedCharacters;
    442     const Font& font = style->font();
     442    const FontCascade& font = style->fontCascade();
    443443
    444444    SVGTextLayoutEngineSpacing spacingLayout(font);
  • trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp

    r163440 r178510  
    2121#include "SVGTextLayoutEngineBaseline.h"
    2222
    23 #include "Font.h"
     23#include "FontCascade.h"
    2424#include "RenderElement.h"
    2525#include "SVGLengthContext.h"
     
    2929namespace WebCore {
    3030
    31 SVGTextLayoutEngineBaseline::SVGTextLayoutEngineBaseline(const Font& font)
     31SVGTextLayoutEngineBaseline::SVGTextLayoutEngineBaseline(const FontCascade& font)
    3232    : m_font(font)
    3333{
  • trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.h

    r163440 r178510  
    2626namespace WebCore {
    2727
    28 class Font;
     28class FontCascade;
    2929class RenderObject;
    3030class SVGElement;
     
    3636    WTF_MAKE_NONCOPYABLE(SVGTextLayoutEngineBaseline);
    3737public:
    38     SVGTextLayoutEngineBaseline(const Font&);
     38    SVGTextLayoutEngineBaseline(const FontCascade&);
    3939
    4040    float calculateBaselineShift(const SVGRenderStyle*, SVGElement* lengthContext) const;
     
    4646    EAlignmentBaseline dominantBaselineToAlignmentBaseline(bool isVerticalText, const RenderObject* textRenderer) const;
    4747
    48     const Font& m_font;
     48    const FontCascade& m_font;
    4949};
    5050
  • trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngineSpacing.cpp

    r177975 r178510  
    2121#include "SVGTextLayoutEngineSpacing.h"
    2222
    23 #include "Font.h"
     23#include "FontCascade.h"
    2424#include "SVGLengthContext.h"
    2525#include "SVGRenderStyle.h"
     
    3333namespace WebCore {
    3434
    35 SVGTextLayoutEngineSpacing::SVGTextLayoutEngineSpacing(const Font& font)
     35SVGTextLayoutEngineSpacing::SVGTextLayoutEngineSpacing(const FontCascade& font)
    3636    : m_font(font)
    3737    , m_lastCharacter(0)
     
    9999    float spacing = m_font.letterSpacing() + kerning;
    100100    if (currentCharacter && lastCharacter && m_font.wordSpacing()) {
    101         if (Font::treatAsSpace(*currentCharacter) && !Font::treatAsSpace(*lastCharacter))
     101        if (FontCascade::treatAsSpace(*currentCharacter) && !FontCascade::treatAsSpace(*lastCharacter))
    102102            spacing += m_font.wordSpacing();
    103103    }
  • trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngineSpacing.h

    r163440 r178510  
    2525namespace WebCore {
    2626
    27 class Font;
     27class FontCascade;
    2828class SVGRenderStyle;
    2929class SVGElement;
     
    3333    WTF_MAKE_NONCOPYABLE(SVGTextLayoutEngineSpacing);
    3434public:
    35     SVGTextLayoutEngineSpacing(const Font&);
     35    SVGTextLayoutEngineSpacing(const FontCascade&);
    3636
    3737    float calculateSVGKerning(bool isVerticalText, const SVGTextMetrics::Glyph& currentGlyph);
     
    3939
    4040private:
    41     const Font& m_font;
     41    const FontCascade& m_font;
    4242    const UChar* m_lastCharacter;
    4343
  • trunk/Source/WebCore/rendering/svg/SVGTextMetrics.cpp

    r177955 r178510  
    4646    ASSERT(scalingFactor);
    4747
    48     const Font& scaledFont = textRenderer.scaledFont();
     48    const FontCascade& scaledFont = textRenderer.scaledFont();
    4949    int length = 0;
    5050
     
    7171                , isOverride(style.unicodeBidi()) /* directionalOverride */);
    7272
    73     if (style.font().primaryFontData().isSVGFont())
     73    if (style.fontCascade().primaryFontData().isSVGFont())
    7474        run.setRenderingContext(SVGTextRunRenderingContext::create(text));
    7575
     
    9292SVGTextMetrics::SVGTextMetrics(RenderSVGInlineText& text, unsigned position, unsigned length, float width, const String& glyphName)
    9393{
    94     bool needsContext = text.style().font().primaryFontData().isSVGFont();
     94    bool needsContext = text.style().fontCascade().primaryFontData().isSVGFont();
    9595    float scalingFactor = text.scalingFactor();
    9696    ASSERT(scalingFactor);
  • trunk/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp

    r174619 r178510  
    101101    m_totalWidth = 0;
    102102
    103     const Font& scaledFont = text.scaledFont();
     103    const FontCascade& scaledFont = text.scaledFont();
    104104    m_run = SVGTextMetrics::constructTextRun(text);
    105     m_isComplexText = scaledFont.codePath(m_run) == Font::Complex;
     105    m_isComplexText = scaledFont.codePath(m_run) == FontCascade::Complex;
    106106
    107107    if (m_isComplexText)
  • trunk/Source/WebCore/rendering/svg/SVGTextRunRenderingContext.cpp

    r177975 r178510  
    5353}
    5454
    55 float SVGTextRunRenderingContext::floatWidthUsingSVGFont(const Font& font, const TextRun& run, int& charsConsumed, String& glyphName) const
     55float SVGTextRunRenderingContext::floatWidthUsingSVGFont(const FontCascade& font, const TextRun& run, int& charsConsumed, String& glyphName) const
    5656{
    5757    WidthIterator it(&font, run);
     
    291291}
    292292
    293 static GlyphData missingGlyphForFont(const Font& font)
     293static GlyphData missingGlyphForFont(const FontCascade& font)
    294294{
    295295    const SimpleFontData& primaryFontData = font.primaryFontData();
     
    302302}
    303303
    304 GlyphData SVGTextRunRenderingContext::glyphDataForCharacter(const Font& font, WidthIterator& iterator, UChar32 character, bool mirror, int currentCharacter, unsigned& advanceLength, String& normalizedSpacesStringCache)
     304GlyphData SVGTextRunRenderingContext::glyphDataForCharacter(const FontCascade& font, WidthIterator& iterator, UChar32 character, bool mirror, int currentCharacter, unsigned& advanceLength, String& normalizedSpacesStringCache)
    305305{
    306306    GlyphData glyphData = font.glyphDataForCharacter(character, mirror, AutoVariant);
     
    343343    FontDescription fallbackDescription = font.fontDescription();
    344344    fallbackDescription.setFamilies(Vector<AtomicString> { sansSerifFamily });
    345     Font fallbackFont(fallbackDescription, font.letterSpacing(), font.wordSpacing());
     345    FontCascade fallbackFont(fallbackDescription, font.letterSpacing(), font.wordSpacing());
    346346    fallbackFont.update(font.fontSelector());
    347347
  • trunk/Source/WebCore/rendering/svg/SVGTextRunRenderingContext.h

    r177259 r178510  
    2222#define SVGTextRunRenderingContext_h
    2323
    24 #include "Font.h"
     24#include "FontCascade.h"
    2525#include "TextRun.h"
    2626
     
    4343    void setActivePaintingResource(RenderSVGResource* object) { m_activePaintingResource = object; }
    4444
    45     virtual GlyphData glyphDataForCharacter(const Font&, WidthIterator&, UChar32 character, bool mirror, int currentCharacter, unsigned& advanceLength, String& normalizedSpacesStringCache) override;
     45    virtual GlyphData glyphDataForCharacter(const FontCascade&, WidthIterator&, UChar32 character, bool mirror, int currentCharacter, unsigned& advanceLength, String& normalizedSpacesStringCache) override;
    4646    virtual void drawSVGGlyphs(GraphicsContext*, const SimpleFontData*, const GlyphBuffer&, int from, int to, const FloatPoint&) const override;
    47     virtual float floatWidthUsingSVGFont(const Font&, const TextRun&, int& charsConsumed, String& glyphName) const override;
     47    virtual float floatWidthUsingSVGFont(const FontCascade&, const TextRun&, int& charsConsumed, String& glyphName) const override;
    4848    virtual bool applySVGKerning(const SimpleFontData*, WidthIterator&, GlyphBuffer*, int from) const override;
    4949#endif
  • trunk/Source/WebCore/style/InlineTextBoxStyle.cpp

    r176298 r178510  
    2727#include "InlineTextBoxStyle.h"
    2828
    29 #include "Font.h"
     29#include "FontCascade.h"
    3030#include "InlineTextBox.h"
    3131#include "RootInlineBox.h"
     
    9090       
    9191    TextDecorationStyle decorationStyle = lineStyle.textDecorationStyle();
    92     float height = lineStyle.font().fontMetrics().floatHeight();
     92    float height = lineStyle.fontCascade().fontMetrics().floatHeight();
    9393    GlyphOverflow overflowResult;
    9494   
  • trunk/Source/WebCore/style/InlineTextBoxStyle.h

    r176298 r178510  
    2727#define InlineTextBoxStyle_h
    2828
    29 #include "Font.h"
     29#include "FontCascade.h"
    3030#include "RenderStyle.h"
    3131
  • trunk/Source/WebCore/style/StyleResolveForDocument.cpp

    r177866 r178510  
    117117
    118118    CSSFontSelector* fontSelector = document.styleResolverIfExists() ? document.styleResolverIfExists()->fontSelector() : nullptr;
    119     documentStyle.get().font().update(fontSelector);
     119    documentStyle.get().fontCascade().update(fontSelector);
    120120
    121121    return documentStyle;
  • trunk/Source/WebCore/style/StyleResolveTree.cpp

    r178157 r178510  
    979979            StyleResolver* styleResolver = document.styleResolverIfExists();
    980980            if (settings->fontFallbackPrefersPictographs() && styleResolver)
    981                 documentStyle.get().font().update(styleResolver->fontSelector());
     981                documentStyle.get().fontCascade().update(styleResolver->fontSelector());
    982982        }
    983983
  • trunk/Source/WebCore/svg/SVGFontData.cpp

    r177876 r178510  
    281281        return;
    282282    if (run.is8Bit())
    283         normalizedSpacesStringCache = Font::normalizeSpaces(run.characters8(), run.charactersLength());
     283        normalizedSpacesStringCache = FontCascade::normalizeSpaces(run.characters8(), run.charactersLength());
    284284    else
    285         normalizedSpacesStringCache = Font::normalizeSpaces(run.characters16(), run.charactersLength());
     285        normalizedSpacesStringCache = FontCascade::normalizeSpaces(run.characters16(), run.charactersLength());
    286286    if (mirror)
    287287        normalizedSpacesStringCache = createStringWithMirroredCharacters(normalizedSpacesStringCache);
  • trunk/Source/WebCore/svg/SVGFontElement.cpp

    r178048 r178510  
    2727#include "Document.h"
    2828#include "ElementIterator.h"
    29 #include "Font.h"
     29#include "FontCascade.h"
    3030#include "SVGGlyphElement.h"
    3131#include "SVGHKernElement.h"
  • trunk/Source/WebCore/svg/SVGFontFaceElement.cpp

    r178048 r178510  
    3434#include "Document.h"
    3535#include "ElementIterator.h"
    36 #include "Font.h"
     36#include "FontCascade.h"
    3737#include "SVGDocumentExtensions.h"
    3838#include "SVGFontElement.h"
  • trunk/Source/WebKit/mac/Misc/WebKitNSStringExtras.mm

    r178305 r178510  
    3030
    3131#import <WebCore/CoreGraphicsSPI.h>
    32 #import <WebCore/Font.h>
     32#import <WebCore/FontCascade.h>
    3333#import <WebCore/GraphicsContext.h>
    3434#import <WebCore/TextRun.h>
     
    9393            CGContextScaleCTM(cgContext, 1, -1);
    9494
    95         Font webCoreFont(FontPlatformData(font, [font pointSize]), ![nsContext isDrawingToScreen], fontSmoothingIsAllowed ? AutoSmoothing : Antialiased);
     95        FontCascade webCoreFont(FontPlatformData(font, [font pointSize]), ![nsContext isDrawingToScreen], fontSmoothingIsAllowed ? AutoSmoothing : Antialiased);
    9696        TextRun run(buffer.data(), length);
    9797        run.disableRoundingHacks();
     
    139139
    140140    if (canUseFastRenderer(buffer.data(), length)) {
    141         Font webCoreFont(FontPlatformData(font, [font pointSize]), ![[NSGraphicsContext currentContext] isDrawingToScreen]);
     141        FontCascade webCoreFont(FontPlatformData(font, [font pointSize]), ![[NSGraphicsContext currentContext] isDrawingToScreen]);
    142142        TextRun run(buffer.data(), length);
    143143        run.disableRoundingHacks();
  • trunk/Source/WebKit/mac/Misc/WebStringTruncator.mm

    r178250 r178510  
    3030
    3131#import "WebSystemInterface.h"
    32 #import <WebCore/Font.h>
     32#import <WebCore/FontCascade.h>
    3333#import <WebCore/FontPlatformData.h>
    3434#import <WebCore/StringTruncator.h>
     
    3737#import <wtf/NeverDestroyed.h>
    3838
    39 static WebCore::Font& fontFromNSFont(NSFont *font)
     39static WebCore::FontCascade& fontFromNSFont(NSFont *font)
    4040{
    4141    static NeverDestroyed<RetainPtr<NSFont>> currentNSFont;
    42     static NeverDestroyed<WebCore::Font> currentFont;
     42    static NeverDestroyed<WebCore::FontCascade> currentFont;
    4343    if ([font isEqual:currentNSFont.get().get()])
    4444        return currentFont;
    4545    currentNSFont.get() = font;
    46     currentFont.get() = WebCore::Font(WebCore::FontPlatformData(font, [font pointSize]), ![[NSGraphicsContext currentContext] isDrawingToScreen]);
     46    currentFont.get() = WebCore::FontCascade(WebCore::FontPlatformData(font, [font pointSize]), ![[NSGraphicsContext currentContext] isDrawingToScreen]);
    4747    return currentFont;
    4848}
  • trunk/Source/WebKit/mac/WebCoreSupport/PopupMenuMac.mm

    r177955 r178510  
    8181        PopupMenuStyle style = m_client->itemStyle(i);
    8282        RetainPtr<NSMutableDictionary> attributes = adoptNS([[NSMutableDictionary alloc] init]);
    83         if (style.font() != Font()) {
     83        if (style.font() != FontCascade()) {
    8484            NSFont *font = style.font().primaryFontData().getNSFont();
    8585            if (!font) {
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r178290 r178510  
    14911491+ (void)_setAlwaysUsesComplexTextCodePath:(BOOL)f
    14921492{
    1493     Font::setCodePath(f ? Font::Complex : Font::Auto);
     1493    FontCascade::setCodePath(f ? FontCascade::Complex : FontCascade::Auto);
    14941494}
    14951495
     
    31693169+ (void)_setShouldUseFontSmoothing:(BOOL)f
    31703170{
    3171     Font::setShouldUseSmoothing(f);
     3171    FontCascade::setShouldUseSmoothing(f);
    31723172}
    31733173
    31743174+ (BOOL)_shouldUseFontSmoothing
    31753175{
    3176     return Font::shouldUseSmoothing();
     3176    return FontCascade::shouldUseSmoothing();
    31773177}
    31783178
     
    47114711#endif
    47124712
    4713     Font::setDefaultTypesettingFeatures([defaults boolForKey:WebKitKerningAndLigaturesEnabledByDefaultDefaultsKey] ? Kerning | Ligatures : 0);
     4713    FontCascade::setDefaultTypesettingFeatures([defaults boolForKey:WebKitKerningAndLigaturesEnabledByDefaultDefaultsKey] ? Kerning | Ligatures : 0);
    47144714
    47154715#if !PLATFORM(IOS)
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r178124 r178510  
    803803        Node* nodeToRemove;
    804804        if (RenderStyle* style = Editor::styleForSelectionStart(&frame, nodeToRemove)) {
    805             CTFontRef font = style->font().primaryFontData().getCTFont();
     805            CTFontRef font = style->fontCascade().primaryFontData().getCTFont();
    806806            CTFontSymbolicTraits traits = font ? CTFontGetSymbolicTraits(font) : 0;
    807807           
  • trunk/Source/WebKit2/WebProcess/WebProcess.cpp

    r178151 r178510  
    6767#include <WebCore/AuthenticationChallenge.h>
    6868#include <WebCore/CrossOriginPreflightResultCache.h>
    69 #include <WebCore/Font.h>
    7069#include <WebCore/FontCache.h>
     70#include <WebCore/FontCascade.h>
    7171#include <WebCore/Frame.h>
    7272#include <WebCore/FrameLoader.h>
     
    464464void WebProcess::setAlwaysUsesComplexTextCodePath(bool alwaysUseComplexText)
    465465{
    466     WebCore::Font::setCodePath(alwaysUseComplexText ? WebCore::Font::Complex : WebCore::Font::Auto);
     466    WebCore::FontCascade::setCodePath(alwaysUseComplexText ? WebCore::FontCascade::Complex : WebCore::FontCascade::Auto);
    467467}
    468468
    469469void WebProcess::setShouldUseFontSmoothing(bool useFontSmoothing)
    470470{
    471     WebCore::Font::setShouldUseSmoothing(useFontSmoothing);
     471    WebCore::FontCascade::setShouldUseSmoothing(useFontSmoothing);
    472472}
    473473
  • trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm

    r177793 r178510  
    4545#import <WebCore/CFNetworkSPI.h>
    4646#import <WebCore/FileSystem.h>
    47 #import <WebCore/Font.h>
     47#import <WebCore/FontCascade.h>
    4848#import <WebCore/LocalizedStrings.h>
    4949#import <WebCore/MemoryCache.h>
     
    195195    m_presenterApplicationPid = parameters.presenterApplicationPid;
    196196    m_shouldForceScreenFontSubstitution = parameters.shouldForceScreenFontSubstitution;
    197     Font::setDefaultTypesettingFeatures(parameters.shouldEnableKerningAndLigaturesByDefault ? Kerning | Ligatures : 0);
     197    FontCascade::setDefaultTypesettingFeatures(parameters.shouldEnableKerningAndLigaturesByDefault ? Kerning | Ligatures : 0);
    198198
    199199    MemoryPressureHandler::ReliefLogger::setLoggingEnabled(parameters.shouldEnableMemoryPressureReliefLogging);
Note: See TracChangeset for help on using the changeset viewer.