Changeset 178510 in webkit
- Timestamp:
- Jan 15, 2015, 6:19:56 AM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 157 edited
- 2 moved
-
WebCore/CMakeLists.txt (modified) (1 diff)
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/WebCore.exp.in (modified) (9 diffs)
-
WebCore/WebCore.vcxproj/WebCore.vcxproj (modified) (2 diffs)
-
WebCore/WebCore.xcodeproj/project.pbxproj (modified) (6 diffs)
-
WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp (modified) (4 diffs)
-
WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm (modified) (2 diffs)
-
WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm (modified) (1 diff)
-
WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (modified) (2 diffs)
-
WebCore/bindings/objc/DOM.mm (modified) (3 diffs)
-
WebCore/bindings/objc/DOMUIKitExtensions.mm (modified) (2 diffs)
-
WebCore/css/CSSComputedStyleDeclaration.cpp (modified) (2 diffs)
-
WebCore/css/CSSPrimitiveValue.cpp (modified) (1 diff)
-
WebCore/css/FontLoader.cpp (modified) (7 diffs)
-
WebCore/css/FontLoader.h (modified) (2 diffs)
-
WebCore/css/StyleResolver.cpp (modified) (4 diffs)
-
WebCore/editing/TextIterator.cpp (modified) (2 diffs)
-
WebCore/editing/cocoa/HTMLConverter.mm (modified) (4 diffs)
-
WebCore/editing/ios/EditorIOS.mm (modified) (4 diffs)
-
WebCore/editing/mac/EditorMac.mm (modified) (4 diffs)
-
WebCore/html/canvas/CanvasRenderingContext2D.cpp (modified) (6 diffs)
-
WebCore/html/canvas/CanvasRenderingContext2D.h (modified) (3 diffs)
-
WebCore/mathml/MathMLMencloseElement.cpp (modified) (1 diff)
-
WebCore/page/Settings.cpp (modified) (1 diff)
-
WebCore/platform/MemoryPressureHandler.cpp (modified) (1 diff)
-
WebCore/platform/PopupMenuStyle.h (modified) (4 diffs)
-
WebCore/platform/Theme.cpp (modified) (2 diffs)
-
WebCore/platform/Theme.h (modified) (3 diffs)
-
WebCore/platform/Widget.h (modified) (1 diff)
-
WebCore/platform/graphics/FontCache.cpp (modified) (1 diff)
-
WebCore/platform/graphics/FontCache.h (modified) (1 diff)
-
WebCore/platform/graphics/FontCascade.cpp (moved) (moved from trunk/Source/WebCore/platform/graphics/Font.cpp ) (36 diffs)
-
WebCore/platform/graphics/FontCascade.h (moved) (moved from trunk/Source/WebCore/platform/graphics/Font.h ) (8 diffs)
-
WebCore/platform/graphics/FontFastPath.cpp (modified) (13 diffs)
-
WebCore/platform/graphics/FontGlyphs.cpp (modified) (4 diffs)
-
WebCore/platform/graphics/GraphicsContext.cpp (modified) (6 diffs)
-
WebCore/platform/graphics/GraphicsContext.h (modified) (2 diffs)
-
WebCore/platform/graphics/SimpleFontData.cpp (modified) (2 diffs)
-
WebCore/platform/graphics/StringTruncator.cpp (modified) (4 diffs)
-
WebCore/platform/graphics/StringTruncator.h (modified) (1 diff)
-
WebCore/platform/graphics/TextRun.h (modified) (2 diffs)
-
WebCore/platform/graphics/WidthIterator.cpp (modified) (8 diffs)
-
WebCore/platform/graphics/WidthIterator.h (modified) (5 diffs)
-
WebCore/platform/graphics/cairo/FontCairo.cpp (modified) (4 diffs)
-
WebCore/platform/graphics/cairo/FontCairoHarfbuzzNG.cpp (modified) (6 diffs)
-
WebCore/platform/graphics/freetype/FontCacheFreeType.cpp (modified) (1 diff)
-
WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp (modified) (1 diff)
-
WebCore/platform/graphics/harfbuzz/HarfBuzzShaper.cpp (modified) (6 diffs)
-
WebCore/platform/graphics/harfbuzz/HarfBuzzShaper.h (modified) (3 diffs)
-
WebCore/platform/graphics/ios/FontCacheIOS.mm (modified) (1 diff)
-
WebCore/platform/graphics/ios/SimpleFontDataIOS.mm (modified) (1 diff)
-
WebCore/platform/graphics/mac/ComplexTextController.cpp (modified) (13 diffs)
-
WebCore/platform/graphics/mac/ComplexTextController.h (modified) (3 diffs)
-
WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm (modified) (5 diffs)
-
WebCore/platform/graphics/mac/FontCacheMac.mm (modified) (1 diff)
-
WebCore/platform/graphics/mac/FontComplexTextMac.cpp (modified) (8 diffs)
-
WebCore/platform/graphics/mac/FontMac.mm (modified) (6 diffs)
-
WebCore/platform/graphics/mac/GlyphPageMac.cpp (modified) (2 diffs)
-
WebCore/platform/graphics/mac/SimpleFontDataMac.mm (modified) (1 diff)
-
WebCore/platform/graphics/win/FontCGWin.cpp (modified) (2 diffs)
-
WebCore/platform/graphics/win/FontCacheWin.cpp (modified) (1 diff)
-
WebCore/platform/graphics/win/FontWin.cpp (modified) (7 diffs)
-
WebCore/platform/graphics/win/SimpleFontDataCGWin.cpp (modified) (1 diff)
-
WebCore/platform/graphics/win/SimpleFontDataCairoWin.cpp (modified) (1 diff)
-
WebCore/platform/graphics/win/SimpleFontDataWin.cpp (modified) (1 diff)
-
WebCore/platform/graphics/win/UniscribeController.cpp (modified) (5 diffs)
-
WebCore/platform/graphics/win/UniscribeController.h (modified) (3 diffs)
-
WebCore/platform/ios/WidgetIOS.mm (modified) (1 diff)
-
WebCore/platform/ios/wak/WKGraphics.mm (modified) (1 diff)
-
WebCore/platform/mac/DragImageMac.mm (modified) (5 diffs)
-
WebCore/platform/mac/ThemeMac.h (modified) (1 diff)
-
WebCore/platform/mac/ThemeMac.mm (modified) (10 diffs)
-
WebCore/platform/mac/WidgetMac.mm (modified) (1 diff)
-
WebCore/platform/text/PlatformLocale.h (modified) (1 diff)
-
WebCore/platform/text/ios/LocalizedDateCache.h (modified) (3 diffs)
-
WebCore/platform/text/ios/LocalizedDateCache.mm (modified) (4 diffs)
-
WebCore/rendering/EllipsisBox.cpp (modified) (4 diffs)
-
WebCore/rendering/EllipsisBox.h (modified) (1 diff)
-
WebCore/rendering/InlineFlowBox.cpp (modified) (10 diffs)
-
WebCore/rendering/InlineTextBox.cpp (modified) (14 diffs)
-
WebCore/rendering/InlineTextBox.h (modified) (2 diffs)
-
WebCore/rendering/RenderBlock.cpp (modified) (9 diffs)
-
WebCore/rendering/RenderBlock.h (modified) (1 diff)
-
WebCore/rendering/RenderBlockFlow.cpp (modified) (1 diff)
-
WebCore/rendering/RenderBlockLineLayout.cpp (modified) (6 diffs)
-
WebCore/rendering/RenderCombineText.cpp (modified) (4 diffs)
-
WebCore/rendering/RenderCombineText.h (modified) (3 diffs)
-
WebCore/rendering/RenderDeprecatedFlexibleBox.cpp (modified) (2 diffs)
-
WebCore/rendering/RenderEmbeddedObject.cpp (modified) (6 diffs)
-
WebCore/rendering/RenderEmbeddedObject.h (modified) (1 diff)
-
WebCore/rendering/RenderFileUploadControl.cpp (modified) (4 diffs)
-
WebCore/rendering/RenderFlowThread.cpp (modified) (1 diff)
-
WebCore/rendering/RenderFullScreen.cpp (modified) (1 diff)
-
WebCore/rendering/RenderImage.cpp (modified) (3 diffs)
-
WebCore/rendering/RenderInline.cpp (modified) (6 diffs)
-
WebCore/rendering/RenderListBox.cpp (modified) (5 diffs)
-
WebCore/rendering/RenderListMarker.cpp (modified) (5 diffs)
-
WebCore/rendering/RenderMenuList.cpp (modified) (5 diffs)
-
WebCore/rendering/RenderRubyRun.cpp (modified) (1 diff)
-
WebCore/rendering/RenderSearchField.cpp (modified) (1 diff)
-
WebCore/rendering/RenderText.cpp (modified) (11 diffs)
-
WebCore/rendering/RenderText.h (modified) (2 diffs)
-
WebCore/rendering/RenderTextControl.cpp (modified) (2 diffs)
-
WebCore/rendering/RenderTextControlMultiLine.cpp (modified) (1 diff)
-
WebCore/rendering/RenderTextControlSingleLine.cpp (modified) (3 diffs)
-
WebCore/rendering/RenderTheme.cpp (modified) (6 diffs)
-
WebCore/rendering/RenderTheme.h (modified) (1 diff)
-
WebCore/rendering/RenderThemeGtk.cpp (modified) (1 diff)
-
WebCore/rendering/RenderThemeGtk.h (modified) (1 diff)
-
WebCore/rendering/RenderThemeIOS.mm (modified) (4 diffs)
-
WebCore/rendering/RenderThemeMac.h (modified) (1 diff)
-
WebCore/rendering/RenderThemeMac.mm (modified) (2 diffs)
-
WebCore/rendering/RootInlineBox.cpp (modified) (2 diffs)
-
WebCore/rendering/SimpleLineLayout.cpp (modified) (2 diffs)
-
WebCore/rendering/SimpleLineLayoutFlowContents.cpp (modified) (1 diff)
-
WebCore/rendering/SimpleLineLayoutFlowContents.h (modified) (2 diffs)
-
WebCore/rendering/SimpleLineLayoutFunctions.cpp (modified) (1 diff)
-
WebCore/rendering/SimpleLineLayoutResolver.cpp (modified) (1 diff)
-
WebCore/rendering/TextAutoSizing.cpp (modified) (5 diffs)
-
WebCore/rendering/TextPainter.cpp (modified) (3 diffs)
-
WebCore/rendering/TextPainter.h (modified) (2 diffs)
-
WebCore/rendering/line/BreakingContextInlineHeaders.h (modified) (5 diffs)
-
WebCore/rendering/line/LineBreaker.h (modified) (1 diff)
-
WebCore/rendering/line/LineInlineHeaders.h (modified) (1 diff)
-
WebCore/rendering/mathml/RenderMathMLBlock.cpp (modified) (2 diffs)
-
WebCore/rendering/mathml/RenderMathMLOperator.cpp (modified) (13 diffs)
-
WebCore/rendering/mathml/RenderMathMLRadicalOperator.cpp (modified) (4 diffs)
-
WebCore/rendering/mathml/RenderMathMLRoot.cpp (modified) (1 diff)
-
WebCore/rendering/mathml/RenderMathMLToken.cpp (modified) (1 diff)
-
WebCore/rendering/style/RenderStyle.cpp (modified) (11 diffs)
-
WebCore/rendering/style/RenderStyle.h (modified) (2 diffs)
-
WebCore/rendering/style/StyleInheritedData.cpp (modified) (2 diffs)
-
WebCore/rendering/style/StyleInheritedData.h (modified) (2 diffs)
-
WebCore/rendering/svg/RenderSVGInlineText.cpp (modified) (3 diffs)
-
WebCore/rendering/svg/RenderSVGInlineText.h (modified) (3 diffs)
-
WebCore/rendering/svg/SVGInlineTextBox.cpp (modified) (6 diffs)
-
WebCore/rendering/svg/SVGTextLayoutEngine.cpp (modified) (1 diff)
-
WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp (modified) (2 diffs)
-
WebCore/rendering/svg/SVGTextLayoutEngineBaseline.h (modified) (3 diffs)
-
WebCore/rendering/svg/SVGTextLayoutEngineSpacing.cpp (modified) (3 diffs)
-
WebCore/rendering/svg/SVGTextLayoutEngineSpacing.h (modified) (3 diffs)
-
WebCore/rendering/svg/SVGTextMetrics.cpp (modified) (3 diffs)
-
WebCore/rendering/svg/SVGTextMetricsBuilder.cpp (modified) (1 diff)
-
WebCore/rendering/svg/SVGTextRunRenderingContext.cpp (modified) (4 diffs)
-
WebCore/rendering/svg/SVGTextRunRenderingContext.h (modified) (2 diffs)
-
WebCore/style/InlineTextBoxStyle.cpp (modified) (2 diffs)
-
WebCore/style/InlineTextBoxStyle.h (modified) (1 diff)
-
WebCore/style/StyleResolveForDocument.cpp (modified) (1 diff)
-
WebCore/style/StyleResolveTree.cpp (modified) (1 diff)
-
WebCore/svg/SVGFontData.cpp (modified) (1 diff)
-
WebCore/svg/SVGFontElement.cpp (modified) (1 diff)
-
WebCore/svg/SVGFontFaceElement.cpp (modified) (1 diff)
-
WebKit/mac/Misc/WebKitNSStringExtras.mm (modified) (3 diffs)
-
WebKit/mac/Misc/WebStringTruncator.mm (modified) (2 diffs)
-
WebKit/mac/WebCoreSupport/PopupMenuMac.mm (modified) (1 diff)
-
WebKit/mac/WebView/WebView.mm (modified) (3 diffs)
-
WebKit2/WebProcess/WebPage/WebPage.cpp (modified) (1 diff)
-
WebKit2/WebProcess/WebProcess.cpp (modified) (2 diffs)
-
WebKit2/WebProcess/cocoa/WebProcessCocoa.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r178481 r178510 2050 2050 platform/graphics/FloatRoundedRect.cpp 2051 2051 platform/graphics/FloatSize.cpp 2052 platform/graphics/Font.cpp2053 2052 platform/graphics/FontCache.cpp 2053 platform/graphics/FontCascade.cpp 2054 2054 platform/graphics/FontDescription.cpp 2055 2055 platform/graphics/FontFastPath.cpp -
trunk/Source/WebCore/ChangeLog
r178496 r178510 1 2015-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 1 10 2015-01-15 Mihnea Ovidenie <mihnea@adobe.com> 2 11 -
trunk/Source/WebCore/WebCore.exp.in
r178459 r178510 137 137 __ZN7WebCore11FileChooser11chooseFilesERKN3WTF6VectorINS1_6StringELm0ENS1_15CrashOnOverflowEEE 138 138 __ZN7WebCore11FileChooserD1Ev 139 __ZN7WebCore11FontCascade11setCodePathENS0_8CodePathE 140 __ZN7WebCore11FontCascade18shouldUseSmoothingEv 141 __ZN7WebCore11FontCascade21setShouldUseSmoothingEb 142 __ZN7WebCore11FontCascade29setDefaultTypesettingFeaturesEj 143 __ZN7WebCore11FontCascadeC1ERKNS_16FontPlatformDataEbNS_17FontSmoothingModeE 144 __ZN7WebCore11FontCascadeC1Ev 145 __ZN7WebCore11FontCascadeaSERKS0_ 139 146 __ZN7WebCore11FrameLoader11loadArchiveEN3WTF10PassRefPtrINS_7ArchiveEEE 140 147 __ZN7WebCore11FrameLoader11shouldCloseEv … … 657 664 __ZN7WebCore15ScrollAlignment17alignCenterAlwaysE 658 665 __ZN7WebCore15ScrollAlignment19alignToEdgeIfNeededE 659 __ZN7WebCore15StringTruncator13rightTruncateERKN3WTF6StringEfRKNS_ 4FontENS0_24EnableRoundingHacksOrNotE660 __ZN7WebCore15StringTruncator14centerTruncateERKN3WTF6StringEfRKNS_ 4FontENS0_24EnableRoundingHacksOrNotE661 __ZN7WebCore15StringTruncator5widthERKN3WTF6StringERKNS_ 4FontENS0_24EnableRoundingHacksOrNotE666 __ZN7WebCore15StringTruncator13rightTruncateERKN3WTF6StringEfRKNS_11FontCascadeENS0_24EnableRoundingHacksOrNotE 667 __ZN7WebCore15StringTruncator14centerTruncateERKN3WTF6StringEfRKNS_11FontCascadeENS0_24EnableRoundingHacksOrNotE 668 __ZN7WebCore15StringTruncator5widthERKN3WTF6StringERKNS_11FontCascadeENS0_24EnableRoundingHacksOrNotE 662 669 __ZN7WebCore15UserInputBridge11loadRequestERKNS_16FrameLoadRequestENS_11InputSourceE 663 670 __ZN7WebCore15UserInputBridge11reloadFrameEPNS_5FrameEbNS_11InputSourceE … … 1128 1135 __ZN7WebCore42URLByTruncatingOneCharacterBeforeComponentEP5NSURL18CFURLComponentType 1129 1136 __ZN7WebCore47attributedStringByStrippingAttachmentCharactersEP18NSAttributedString 1130 __ZN7WebCore4Font11setCodePathENS0_8CodePathE1131 __ZN7WebCore4Font18shouldUseSmoothingEv1132 __ZN7WebCore4Font21setShouldUseSmoothingEb1133 __ZN7WebCore4Font29setDefaultTypesettingFeaturesEj1134 __ZN7WebCore4FontC1ERKNS_16FontPlatformDataEbNS_17FontSmoothingModeE1135 __ZN7WebCore4FontC1Ev1136 __ZN7WebCore4FontaSERKS0_1137 1137 __ZN7WebCore4Icon18createIconForFilesERKN3WTF6VectorINS1_6StringELm0ENS1_15CrashOnOverflowEEE 1138 1138 __ZN7WebCore4IconD1Ev … … 1619 1619 __ZNK7WebCore10TimeRanges5startEjRi 1620 1620 __ZNK7WebCore10TimeRanges6lengthEv 1621 __ZNK7WebCore11FontCascade5widthERKNS_7TextRunEPN3WTF7HashSetIPKNS_14SimpleFontDataENS4_7PtrHashIS8_EENS4_10HashTraitsIS8_EEEEPNS_13GlyphOverflowE 1622 __ZNK7WebCore11FontCascade8drawTextEPNS_15GraphicsContextERKNS_7TextRunERKNS_10FloatPointEiiNS0_24CustomFontNotReadyActionE 1623 __ZNK7WebCore11FontCascadeeqERKS0_ 1621 1624 __ZNK7WebCore11FrameLoader10isCompleteEv 1622 1625 __ZNK7WebCore11FrameLoader14cancelledErrorERKNS_15ResourceRequestE … … 1655 1658 __ZNK7WebCore11RenderLayer19absoluteBoundingBoxEv 1656 1659 __ZNK7WebCore11RenderLayer24needsCompositedScrollingEv 1660 __ZNK7WebCore11RenderStyle11fontCascadeEv 1657 1661 __ZNK7WebCore11RenderStyle11fontMetricsEv 1658 1662 __ZNK7WebCore11RenderStyle15fontDescriptionEv 1659 1663 __ZNK7WebCore11RenderStyle21visitedDependentColorEi 1660 __ZNK7WebCore11RenderStyle4fontEv1661 1664 __ZNK7WebCore12RenderInline16linesBoundingBoxEv 1662 1665 __ZNK7WebCore12RenderObject14enclosingLayerEv … … 1946 1949 __ZNK7WebCore3URL8protocolEv 1947 1950 __ZNK7WebCore3URLcvP5NSURLEv 1948 __ZNK7WebCore4Font5widthERKNS_7TextRunEPN3WTF7HashSetIPKNS_14SimpleFontDataENS4_7PtrHashIS8_EENS4_10HashTraitsIS8_EEEEPNS_13GlyphOverflowE1949 __ZNK7WebCore4Font8drawTextEPNS_15GraphicsContextERKNS_7TextRunERKNS_10FloatPointEiiNS0_24CustomFontNotReadyActionE1950 __ZNK7WebCore4FonteqERKS0_1951 1951 __ZNK7WebCore4Node10shadowHostEv 1952 1952 __ZNK7WebCore4Node11textContentEb … … 2651 2651 __ZN7WebCore15DatabaseTracker44emptyDatabaseFilesRemovalTaskWillBeScheduledEv 2652 2652 __ZN7WebCore15DatabaseTracker7trackerEv 2653 __ZN7WebCore15GraphicsContext12drawBidiTextERKNS_4FontERKNS_7TextRunERKNS_10FloatPointENS1_24CustomFontNotReadyActionEPNS_10BidiStatusEi2654 2653 __ZN7WebCore15GraphicsContext15drawLineForTextERKNS_10FloatPointEfbb 2655 2654 __ZN7WebCore15GraphicsContext22setEmojiDrawingEnabledEb … … 2658 2657 __ZN7WebCore15LegacyTileCache20setLayerPoolCapacityEj 2659 2658 __ZN7WebCore15ResourceRequest41updateFromDelegatePreservingOldPropertiesERKS0_ 2660 __ZN7WebCore15StringTruncator12leftTruncateERKN3WTF6StringEfRKNS_4FontENS0_24EnableRoundingHacksOrNotERfbf2661 __ZN7WebCore15StringTruncator13rightTruncateERKN3WTF6StringEfRKNS_4FontENS0_24EnableRoundingHacksOrNotERfbf2662 __ZN7WebCore15StringTruncator14centerTruncateERKN3WTF6StringEfRKNS_4FontENS0_24EnableRoundingHacksOrNotERfbf2663 __ZN7WebCore15StringTruncator15rightClipToWordERKN3WTF6StringEfRKNS_4FontENS0_24EnableRoundingHacksOrNotERfbfb2664 __ZN7WebCore15StringTruncator20rightClipToCharacterERKN3WTF6StringEfRKNS_4FontENS0_24EnableRoundingHacksOrNotERfbf2665 2659 __ZN7WebCore15isEndOfDocumentERKNS_15VisiblePositionE 2666 2660 __ZN7WebCore15startOfDocumentEPKNS_4NodeE … … 2746 2740 __ZN7WebCore35positionOfNextBoundaryOfGranularityERKNS_15VisiblePositionENS_15TextGranularityENS_18SelectionDirectionE 2747 2741 __ZN7WebCore41initializeHTTPConnectionSettingsOnStartupEv 2748 __ZN7WebCore4FontC1ERKNS_16FontPlatformDataEN3WTF10PassRefPtrINS_12FontSelectorEEE2749 2742 __ZN7WebCore4Icon18createIconForImageEP7CGImage 2750 2743 __ZN7WebCore4Node17isContentEditableENS0_22UserSelectAllTreatmentE -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
r178481 r178510 7979 7979 <ClCompile Include="..\platform\graphics\FloatRoundedRect.cpp" /> 7980 7980 <ClCompile Include="..\platform\graphics\FloatSize.cpp" /> 7981 <ClCompile Include="..\platform\graphics\Font.cpp" />7982 7981 <ClCompile Include="..\platform\graphics\FontCache.cpp" /> 7982 <ClCompile Include="..\platform\graphics\FontCascade.cpp" /> 7983 7983 <ClCompile Include="..\platform\graphics\FontDescription.cpp" /> 7984 7984 <ClCompile Include="..\platform\graphics\FontGenericFamilies.cpp" /> … … 19468 19468 <ClInclude Include="..\platform\graphics\FloatSize.h" /> 19469 19469 <ClInclude Include="..\platform\graphics\FloatSizeHash.h" /> 19470 <ClInclude Include="..\platform\graphics\Font.h" />19471 19470 <ClInclude Include="..\platform\graphics\FontCache.h" /> 19471 <ClInclude Include="..\platform\graphics\FontCascade.h" /> 19472 19472 <ClInclude Include="..\platform\graphics\FontDescription.h" /> 19473 19473 <ClInclude Include="..\platform\graphics\FontGenericFamilies.h" /> -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r178481 r178510 4705 4705 B2C3DA4A0D006C1D00EF6F26 /* TextStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C3DA1A0D006C1D00EF6F26 /* TextStream.cpp */; }; 4706 4706 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, ); }; }; 4709 4709 B2C3DA620D006CD600EF6F26 /* FontCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C3DA510D006CD600EF6F26 /* FontCache.cpp */; }; 4710 4710 B2C3DA630D006CD600EF6F26 /* FontCache.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA520D006CD600EF6F26 /* FontCache.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 12082 12082 B2C3DA1A0D006C1D00EF6F26 /* TextStream.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TextStream.cpp; sourceTree = "<group>"; }; 12083 12083 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>"; }; 12086 12086 B2C3DA510D006CD600EF6F26 /* FontCache.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FontCache.cpp; sourceTree = "<group>"; }; 12087 12087 B2C3DA520D006CD600EF6F26 /* FontCache.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FontCache.h; sourceTree = "<group>"; }; … … 20415 20415 B27535390B053814002CE64F /* Color.h */, 20416 20416 9382DF5710A8D5C900925652 /* ColorSpace.h */, 20417 B2C3DA4F0D006CD600EF6F26 /* FontCascade.cpp */, 20418 B2C3DA500D006CD600EF6F26 /* FontCascade.h */, 20417 20419 2D2FC0541460CD6F00263633 /* CrossfadeGeneratedImage.cpp */, 20418 20420 2D2FC0551460CD6F00263633 /* CrossfadeGeneratedImage.h */, … … 20440 20442 B275353F0B053814002CE64F /* FloatSize.h */, 20441 20443 58CD35CA18EB4C3900B9F3AC /* FloatSizeHash.h */, 20442 B2C3DA4F0D006CD600EF6F26 /* Font.cpp */,20443 B2C3DA500D006CD600EF6F26 /* Font.h */,20444 20444 BCB92D4E1293550B00C8387F /* FontBaseline.h */, 20445 20445 B2C3DA510D006CD600EF6F26 /* FontCache.cpp */, … … 24313 24313 062287840B4DB322000C34DF /* FocusDirection.h in Headers */, 24314 24314 B6D9D23514EABD260090D75E /* FocusEvent.h in Headers */, 24315 B2C3DA610D006CD600EF6F26 /* Font .h in Headers */,24315 B2C3DA610D006CD600EF6F26 /* FontCascade.h in Headers */, 24316 24316 BCB92D4F1293550B00C8387F /* FontBaseline.h in Headers */, 24317 24317 B2C3DA630D006CD600EF6F26 /* FontCache.h in Headers */, … … 27816 27816 14993BE50B2F2B1C0050497F /* FocusController.cpp in Sources */, 27817 27817 B6D9D23614EABD260090D75E /* FocusEvent.cpp in Sources */, 27818 B2C3DA600D006CD600EF6F26 /* Font .cpp in Sources */,27818 B2C3DA600D006CD600EF6F26 /* FontCascade.cpp in Sources */, 27819 27819 B2C3DA620D006CD600EF6F26 /* FontCache.cpp in Sources */, 27820 27820 3727DFD5142AAE4500D449CB /* FontCacheIOS.mm in Sources */, -
trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp
r175466 r178510 37 37 #include "AccessibilityObject.h" 38 38 #include "Document.h" 39 #include "Font .h"39 #include "FontCascade.h" 40 40 #include "FrameView.h" 41 41 #include "HTMLParserIdioms.h" … … 131 131 } 132 132 133 String fontFamilyName = style->font ().firstFamily();133 String fontFamilyName = style->fontCascade().firstFamily(); 134 134 if (fontFamilyName.left(8) == "-webkit-") 135 135 fontFamilyName = fontFamilyName.substring(8); … … 138 138 139 139 int fontWeight = -1; 140 switch (style->font ().weight()) {140 switch (style->fontCascade().weight()) { 141 141 case FontWeight100: 142 142 fontWeight = 100; … … 193 193 result = addToAtkAttributeSet(result, atk_text_attribute_get_name(ATK_TEXT_ATTR_UNDERLINE), (style->textDecoration() & TextDecorationUnderline) ? "single" : "none"); 194 194 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"); 196 196 197 197 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 35 35 #import "Chrome.h" 36 36 #import "ChromeClient.h" 37 #import "Font .h"37 #import "FontCascade.h" 38 38 #import "Frame.h" 39 39 #import "FrameSelection.h" … … 1759 1759 1760 1760 // set basic font info 1761 AXAttributeStringSetFont(attrString, style.font ().primaryFontData().getCTFont(), range);1761 AXAttributeStringSetFont(attrString, style.fontCascade().primaryFontData().getCTFont(), range); 1762 1762 1763 1763 int decor = style.textDecorationsInEffect(); -
trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm
r178171 r178510 47 47 #import "ColorMac.h" 48 48 #import "ContextMenuController.h" 49 #import "Font .h"49 #import "FontCascade.h" 50 50 #import "Frame.h" 51 51 #import "FrameLoaderClient.h" -
trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
r178171 r178510 48 48 #import "ContextMenuController.h" 49 49 #import "Editor.h" 50 #import "Font .h"50 #import "FontCascade.h" 51 51 #import "FrameLoaderClient.h" 52 52 #import "FrameSelection.h" … … 849 849 850 850 // set basic font info 851 AXAttributeStringSetFont(attrString, NSAccessibilityFontTextAttribute, style.font ().primaryFontData().getNSFont(), range);851 AXAttributeStringSetFont(attrString, NSAccessibilityFontTextAttribute, style.fontCascade().primaryFontData().getNSFont(), range); 852 852 853 853 // set basic colors -
trunk/Source/WebCore/bindings/objc/DOM.mm
r177955 r178510 38 38 #import "DOMRangeInternal.h" 39 39 #import "DragImage.h" 40 #import "Font .h"40 #import "FontCascade.h" 41 41 #import "Frame.h" 42 42 #import "HTMLElement.h" … … 670 670 if (!renderer) 671 671 return nil; 672 return renderer->style().font ().primaryFontData().getNSFont();672 return renderer->style().fontCascade().primaryFontData().getNSFont(); 673 673 } 674 674 #else … … 678 678 if (!renderer) 679 679 return nil; 680 return renderer->style().font ().primaryFontData().getCTFont();680 return renderer->style().fontCascade().primaryFontData().getCTFont(); 681 681 } 682 682 #endif -
trunk/Source/WebCore/bindings/objc/DOMUIKitExtensions.mm
r175549 r178510 44 44 #import "DOMRangeInternal.h" 45 45 #import "FloatPoint.h" 46 #import "Font .h"46 #import "FontCascade.h" 47 47 #import "FrameSelection.h" 48 48 #import "HTMLAreaElement.h" … … 72 72 73 73 using WebCore::FloatPoint; 74 using WebCore::Font ;74 using WebCore::FontCascade; 75 75 using WebCore::HTMLAreaElement; 76 76 using WebCore::HTMLImageElement; -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r177866 r178510 1505 1505 { 1506 1506 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))); 1509 1509 return list; 1510 1510 } … … 2546 2546 return cssValuePool().createValue(style->wordBreak()); 2547 2547 case CSSPropertyWordSpacing: 2548 return zoomAdjustedPixelValue(style->font ().wordSpacing(), style.get());2548 return zoomAdjustedPixelValue(style->fontCascade().wordSpacing(), style.get()); 2549 2549 case CSSPropertyWordWrap: 2550 2550 return cssValuePool().createValue(style->overflowWrap()); -
trunk/Source/WebCore/css/CSSPrimitiveValue.cpp
r178102 r178510 33 33 #include "Counter.h" 34 34 #include "ExceptionCode.h" 35 #include "Font .h"35 #include "FontCascade.h" 36 36 #include "Node.h" 37 37 #include "Pair.h" -
trunk/Source/WebCore/css/FontLoader.cpp
r176459 r178510 37 37 #include "Document.h" 38 38 #include "ExceptionCodeDescription.h" 39 #include "Font .h"39 #include "FontCascade.h" 40 40 #include "FrameView.h" 41 41 #include "StyleProperties.h" … … 54 54 } 55 55 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) 57 57 { 58 58 RefPtr<VoidCallback> onsuccess; … … 246 246 if (!params.get("font", fontString)) 247 247 return; 248 Font font;248 FontCascade font; 249 249 if (!resolveFontStyle(fontString, font)) 250 250 return; … … 266 266 { 267 267 // FIXME: The second parameter (text) is ignored. 268 Font font;268 FontCascade font; 269 269 if (!resolveFontStyle(fontString, font)) 270 270 return false; … … 282 282 } 283 283 284 bool FontLoader::resolveFontStyle(const String& fontString, Font & font)284 bool FontLoader::resolveFontStyle(const String& fontString, FontCascade& font) 285 285 { 286 286 // Interpret fontString in the same way as the 'font' attribute of CanvasRenderingContext2D. … … 303 303 style->setFontDescription(defaultFontDescription); 304 304 305 style->font ().update(style->font().fontSelector());305 style->fontCascade().update(style->fontCascade().fontSelector()); 306 306 307 307 // Now map the font property longhands into the style. … … 320 320 applyPropertyToCurrentStyle(styleResolver, CSSPropertyLineHeight, parsedStyle); 321 321 322 font = style->font ();322 font = style->fontCascade(); 323 323 font.update(styleResolver.fontSelector()); 324 324 return true; -
trunk/Source/WebCore/css/FontLoader.h
r178223 r178510 46 46 class Document; 47 47 class Event; 48 class Font ;48 class FontCascade; 49 49 class LoadFontCallback; 50 50 class ScriptExecutionContext; … … 101 101 void scheduleEvent(PassRefPtr<Event>); 102 102 void firePendingEvents(); 103 bool resolveFontStyle(const String&, Font &);103 bool resolveFontStyle(const String&, FontCascade&); 104 104 105 105 Document* m_document; -
trunk/Source/WebCore/css/StyleResolver.cpp
r178251 r178510 307 307 m_ruleSets.appendAuthorStyleSheets(firstNew, styleSheets, m_medium.get(), m_inspectorCSSOMWrappers, this); 308 308 if (auto renderView = document().renderView()) 309 renderView->style().font ().update(fontSelector());309 renderView->style().fontCascade().update(fontSelector()); 310 310 311 311 #if ENABLE(CSS_DEVICE_ADAPTATION) … … 749 749 s_styleNotYetAvailable = &RenderStyle::create().leakRef(); 750 750 s_styleNotYetAvailable->setDisplay(NONE); 751 s_styleNotYetAvailable->font ().update(m_fontSelector);751 s_styleNotYetAvailable->fontCascade().update(m_fontSelector); 752 752 } 753 753 element->document().setHasNodesWithPlaceholderStyle(); … … 1032 1032 if (Settings* settings = documentSettings()) { 1033 1033 initializeFontStyle(settings); 1034 m_state.style()->font ().update(fontSelector());1034 m_state.style()->fontCascade().update(fontSelector()); 1035 1035 } else 1036 m_state.style()->font ().update(0);1036 m_state.style()->fontCascade().update(nullptr); 1037 1037 1038 1038 return m_state.takeStyle(); … … 1485 1485 checkForZoomChange(style, m_state.parentStyle()); 1486 1486 checkForOrientationChange(style); 1487 style->font ().update(m_fontSelector);1487 style->fontCascade().update(m_fontSelector); 1488 1488 if (m_state.fontSizeHasViewportUnits()) 1489 1489 style->setHasViewportUnits(true); -
trunk/Source/WebCore/editing/TextIterator.cpp
r178462 r178510 30 30 #include "Document.h" 31 31 #include "ExceptionCodePlaceholder.h" 32 #include "Font .h"32 #include "FontCascade.h" 33 33 #include "Frame.h" 34 34 #include "HTMLElement.h" … … 2186 2186 // Chinese and Japanese lack word boundary marks, and there is no clear agreement on what constitutes 2187 2187 // a word, so treat the position before any CJK character as a word start. 2188 if (Font ::isCJKIdeographOrSymbol(firstCharacter))2188 if (FontCascade::isCJKIdeographOrSymbol(firstCharacter)) 2189 2189 return true; 2190 2190 -
trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm
r177955 r178510 38 38 #import "Element.h" 39 39 #import "ElementTraversal.h" 40 #import "Font .h"40 #import "FontCascade.h" 41 41 #import "Frame.h" 42 42 #import "FrameLoader.h" … … 1115 1115 if (!renderer) 1116 1116 return nil; 1117 return renderer->style().font ().primaryFontData().getNSFont();1117 return renderer->style().fontCascade().primaryFontData().getNSFont(); 1118 1118 } 1119 1119 #else … … 1123 1123 if (!renderer) 1124 1124 return nil; 1125 return (PlatformFont *)renderer->style().font ().primaryFontData().getCTFont();1125 return (PlatformFont *)renderer->style().fontCascade().primaryFontData().getCTFont(); 1126 1126 } 1127 1127 #endif … … 2595 2595 if (style.textDecorationsInEffect() & TextDecorationLineThrough) 2596 2596 [attrs.get() setObject:[NSNumber numberWithInteger:NSUnderlineStyleSingle] forKey:NSStrikethroughStyleAttributeName]; 2597 if (NSFont *font = style.font ().primaryFontData().getNSFont())2597 if (NSFont *font = style.fontCascade().primaryFontData().getNSFont()) 2598 2598 [attrs.get() setObject:font forKey:NSFontAttributeName]; 2599 2599 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]; 2601 2601 if (style.visitedDependentColor(CSSPropertyColor).alpha()) 2602 2602 [attrs.get() setObject:nsColor(style.visitedDependentColor(CSSPropertyColor)) forKey:NSForegroundColorAttributeName]; -
trunk/Source/WebCore/editing/ios/EditorIOS.mm
r177955 r178510 36 36 #include "DocumentLoader.h" 37 37 #include "EditorClient.h" 38 #include "Font .h"38 #include "FontCascade.h" 39 39 #include "Frame.h" 40 40 #include "FrameLoaderClient.h" … … 214 214 const SimpleFontData* result = nullptr; 215 215 if (style) 216 result = &style->font ().primaryFontData();216 result = &style->fontCascade().primaryFontData(); 217 217 218 218 if (nodeToRemove) { … … 236 236 continue; 237 237 // 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(); 239 239 if (!font) 240 240 font = &primaryFont; … … 258 258 NSMutableDictionary* result = [NSMutableDictionary dictionary]; 259 259 260 CTFontRef font = style->font ().primaryFontData().getCTFont();260 CTFontRef font = style->fontCascade().primaryFontData().getCTFont(); 261 261 if (font) 262 262 [result setObject:(id)font forKey:NSFontAttributeName]; -
trunk/Source/WebCore/editing/mac/EditorMac.mm
r177955 r178510 36 36 #import "Editor.h" 37 37 #import "EditorClient.h" 38 #import "Font .h"38 #import "FontCascade.h" 39 39 #import "Frame.h" 40 40 #import "FrameLoaderClient.h" … … 116 116 const SimpleFontData* result = nullptr; 117 117 if (style) 118 result = &style->font ().primaryFontData();118 result = &style->fontCascade().primaryFontData(); 119 119 120 120 if (nodeToRemove) … … 136 136 continue; 137 137 // 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(); 139 139 if (!font) 140 140 font = &primaryFont; … … 161 161 [result setObject:nsColor(style->visitedDependentColor(CSSPropertyBackgroundColor)) forKey:NSBackgroundColorAttributeName]; 162 162 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]; 165 165 166 166 if (style->visitedDependentColor(CSSPropertyColor).isValid() && style->visitedDependentColor(CSSPropertyColor) != Color::black) -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
r178392 r178510 2106 2106 } 2107 2107 2108 newStyle->font ().update(newStyle->font().fontSelector());2108 newStyle->fontCascade().update(newStyle->fontCascade().fontSelector()); 2109 2109 2110 2110 // Now map the font property longhands into the style. … … 2123 2123 styleResolver.applyPropertyToCurrentStyle(CSSPropertyLineHeight, parsedStyle->getPropertyCSSValue(CSSPropertyLineHeight).get()); 2124 2124 2125 modifiableState().m_font = newStyle->font ();2125 modifiableState().m_font = newStyle->fontCascade(); 2126 2126 modifiableState().m_font.update(styleResolver.fontSelector()); 2127 2127 modifiableState().m_realizedFont = true; … … 2288 2288 return; 2289 2289 2290 const Font & font = accessFont();2290 const FontCascade& font = accessFont(); 2291 2291 const FontMetrics& fontMetrics = font.fontMetrics(); 2292 2292 … … 2373 2373 // We draw when fontWidth is 0 so compositing operations (eg, a "copy" op) still work. 2374 2374 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); 2376 2376 } else { 2377 2377 maskImageContext->translate(-maskRect.x(), -maskRect.y()); 2378 maskImageContext->drawBidiText(font, textRun, location, Font ::UseFallbackIfFontNotReady);2378 maskImageContext->drawBidiText(font, textRun, location, FontCascade::UseFallbackIfFontNotReady); 2379 2379 } 2380 2380 … … 2399 2399 if (isFullCanvasCompositeMode(state().m_globalComposite)) { 2400 2400 beginCompositeLayer(); 2401 c->drawBidiText(font, textRun, location, Font ::UseFallbackIfFontNotReady);2401 c->drawBidiText(font, textRun, location, FontCascade::UseFallbackIfFontNotReady); 2402 2402 endCompositeLayer(); 2403 2403 didDrawEntireCanvas(); 2404 2404 } else if (state().m_globalComposite == CompositeCopy) { 2405 2405 clearCanvas(); 2406 c->drawBidiText(font, textRun, location, Font ::UseFallbackIfFontNotReady);2406 c->drawBidiText(font, textRun, location, FontCascade::UseFallbackIfFontNotReady); 2407 2407 didDrawEntireCanvas(); 2408 2408 } else { 2409 c->drawBidiText(font, textRun, location, Font ::UseFallbackIfFontNotReady);2409 c->drawBidiText(font, textRun, location, FontCascade::UseFallbackIfFontNotReady); 2410 2410 didDraw(textRect); 2411 2411 } … … 2427 2427 } 2428 2428 2429 const Font & CanvasRenderingContext2D::accessFont()2429 const FontCascade& CanvasRenderingContext2D::accessFont() 2430 2430 { 2431 2431 canvas()->document().updateStyleIfNeeded(); -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h
r175328 r178510 34 34 #include "ColorSpace.h" 35 35 #include "FloatSize.h" 36 #include "Font .h"36 #include "FontCascade.h" 37 37 #include "GraphicsTypes.h" 38 38 #include "ImageBuffer.h" … … 271 271 272 272 String m_unparsedFont; 273 Font m_font;273 FontCascade m_font; 274 274 bool m_realizedFont; 275 275 }; … … 309 309 void drawTextInternal(const String& text, float x, float y, bool fill, float maxWidth = 0, bool useMaxWidth = false); 310 310 311 const Font & accessFont();311 const FontCascade& accessFont(); 312 312 313 313 #if ENABLE(DASHBOARD_SUPPORT) -
trunk/Source/WebCore/mathml/MathMLMencloseElement.cpp
r177733 r178510 134 134 Node* node = parentNode(); 135 135 if (node && node->renderer()) { 136 const Font & font = node->renderer()->style().font();136 const FontCascade& font = node->renderer()->style().fontCascade(); 137 137 padding.appendNumber(font.width(run)); 138 138 padding.appendLiteral("px"); -
trunk/Source/WebCore/page/Settings.cpp
r177925 r178510 34 34 #include "Database.h" 35 35 #include "Document.h" 36 #include "Font .h"36 #include "FontCascade.h" 37 37 #include "FontGenericFamilies.h" 38 38 #include "FrameTree.h" -
trunk/Source/WebCore/platform/MemoryPressureHandler.cpp
r177848 r178510 29 29 #include "CSSValuePool.h" 30 30 #include "Document.h" 31 #include "Font.h"32 31 #include "FontCache.h" 32 #include "FontCascade.h" 33 33 #include "GCController.h" 34 34 #include "JSDOMWindow.h" -
trunk/Source/WebCore/platform/PopupMenuStyle.h
r169134 r178510 28 28 29 29 #include "Color.h" 30 #include "Font .h"30 #include "FontCascade.h" 31 31 #include "Length.h" 32 32 #include "TextDirection.h" … … 44 44 }; 45 45 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) 47 47 : m_foregroundColor(foreground) 48 48 , m_backgroundColor(background) … … 62 62 const Color& foregroundColor() const { return m_foregroundColor; } 63 63 const Color& backgroundColor() const { return m_backgroundColor; } 64 const Font & font() const { return m_font; }64 const FontCascade& font() const { return m_font; } 65 65 bool isVisible() const { return m_visible; } 66 66 bool isDisplayNone() const { return m_isDisplayNone; } … … 76 76 Color m_foregroundColor; 77 77 Color m_backgroundColor; 78 Font m_font;78 FontCascade m_font; 79 79 bool m_visible; 80 80 bool m_isDisplayNone; -
trunk/Source/WebCore/platform/Theme.cpp
r95901 r178510 29 29 namespace WebCore { 30 30 31 LengthBox Theme::controlBorder(ControlPart part, const Font &, const LengthBox& zoomedBox, float) const31 LengthBox Theme::controlBorder(ControlPart part, const FontCascade&, const LengthBox& zoomedBox, float) const 32 32 { 33 33 switch (part) { … … 43 43 } 44 44 45 LengthBox Theme::controlPadding(ControlPart part, const Font &, const LengthBox& zoomedBox, float) const45 LengthBox Theme::controlPadding(ControlPart part, const FontCascade&, const LengthBox& zoomedBox, float) const 46 46 { 47 47 switch (part) { -
trunk/Source/WebCore/platform/Theme.h
r169928 r178510 29 29 #include "Color.h" 30 30 #include "ControlStates.h" 31 #include "Font .h"31 #include "FontCascade.h" 32 32 #include "IntRect.h" 33 33 #include "LengthBox.h" … … 72 72 // CSS system colors and fonts 73 73 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(); } 75 75 76 76 // How fast the caret blinks in text fields. … … 83 83 84 84 // 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(); } 86 86 87 87 // 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; } 89 89 90 90 // 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)); } 92 92 93 93 // 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; 96 96 97 97 // Whether or not whitespace: pre should be forced on always. -
trunk/Source/WebCore/platform/Widget.h
r174506 r178510 71 71 class Cursor; 72 72 class Event; 73 class Font ;73 class FontCascade; 74 74 class FrameView; 75 75 class GraphicsContext; -
trunk/Source/WebCore/platform/graphics/FontCache.cpp
r178250 r178510 31 31 #include "FontCache.h" 32 32 33 #include "Font .h"33 #include "FontCascade.h" 34 34 #include "FontGlyphs.h" 35 35 #include "FontPlatformData.h" -
trunk/Source/WebCore/platform/graphics/FontCache.h
r178250 r178510 52 52 namespace WebCore { 53 53 54 class Font ;54 class FontCascade; 55 55 class FontPlatformData; 56 56 class FontSelector; -
trunk/Source/WebCore/platform/graphics/FontCascade.cpp
r178496 r178510 23 23 24 24 #include "config.h" 25 #include "Font .h"25 #include "FontCascade.h" 26 26 27 27 #include "FloatRect.h" … … 44 44 template <> void deleteOwnedPtr<WebCore::TextLayout>(WebCore::TextLayout* ptr) 45 45 { 46 WebCore::Font ::deleteLayout(ptr);46 WebCore::FontCascade::deleteLayout(ptr); 47 47 } 48 48 … … 53 53 static Ref<FontGlyphs> retrieveOrAddCachedFontGlyphs(const FontDescription&, PassRefPtr<FontSelector>); 54 54 55 const uint8_t Font ::s_roundingHackCharacterTable[256] = {55 const uint8_t FontCascade::s_roundingHackCharacterTable[256] = { 56 56 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, 57 57 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 /*?*/, … … 99 99 } 100 100 101 Font ::CodePath Font::s_codePath = Auto;102 103 TypesettingFeatures Font ::s_defaultTypesettingFeatures = 0;101 FontCascade::CodePath FontCascade::s_codePath = Auto; 102 103 TypesettingFeatures FontCascade::s_defaultTypesettingFeatures = 0; 104 104 105 105 // ============================================================================================ 106 // Font Implementation (Cross-Platform Portion)106 // FontCascade Implementation (Cross-Platform Portion) 107 107 // ============================================================================================ 108 108 109 Font ::Font()109 FontCascade::FontCascade() 110 110 : m_letterSpacing(0) 111 111 , m_wordSpacing(0) … … 115 115 } 116 116 117 Font ::Font(const FontDescription& fd, float letterSpacing, float wordSpacing)117 FontCascade::FontCascade(const FontDescription& fd, float letterSpacing, float wordSpacing) 118 118 : m_fontDescription(fd) 119 119 , m_letterSpacing(letterSpacing) … … 125 125 126 126 // FIXME: We should make this constructor platform-independent. 127 Font ::Font(const FontPlatformData& fontData, bool isPrinterFont, FontSmoothingMode fontSmoothingMode)127 FontCascade::FontCascade(const FontPlatformData& fontData, bool isPrinterFont, FontSmoothingMode fontSmoothingMode) 128 128 : m_glyphs(FontGlyphs::createForPlatformFont(fontData)) 129 129 , m_letterSpacing(0) … … 144 144 // FIXME: We should make this constructor platform-independent. 145 145 #if PLATFORM(IOS) 146 Font ::Font(const FontPlatformData& fontData, PassRefPtr<FontSelector> fontSelector)146 FontCascade::FontCascade(const FontPlatformData& fontData, PassRefPtr<FontSelector> fontSelector) 147 147 : m_glyphs(FontGlyphs::createForPlatformFont(fontData)) 148 148 , m_letterSpacing(0) … … 160 160 #endif 161 161 162 Font ::Font(const Font& other)162 FontCascade::FontCascade(const FontCascade& other) 163 163 : m_fontDescription(other.m_fontDescription) 164 164 , m_glyphs(other.m_glyphs) … … 170 170 } 171 171 172 Font & Font::operator=(const Font& other)172 FontCascade& FontCascade::operator=(const FontCascade& other) 173 173 { 174 174 m_fontDescription = other.m_fontDescription; … … 181 181 } 182 182 183 bool Font ::operator==(const Font& other) const183 bool FontCascade::operator==(const FontCascade& other) const 184 184 { 185 185 if (isLoadingCustomFonts() || other.isLoadingCustomFonts()) … … 324 324 } 325 325 326 void Font ::update(PassRefPtr<FontSelector> fontSelector) const326 void FontCascade::update(PassRefPtr<FontSelector> fontSelector) const 327 327 { 328 328 m_glyphs = retrieveOrAddCachedFontGlyphs(m_fontDescription, fontSelector.get()); … … 331 331 } 332 332 333 float Font ::drawText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to, CustomFontNotReadyAction customFontNotReadyAction) const333 float FontCascade::drawText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to, CustomFontNotReadyAction customFontNotReadyAction) const 334 334 { 335 335 // Don't draw anything while we are using custom fonts that are in the process of loading, … … 352 352 } 353 353 354 void Font ::drawEmphasisMarks(GraphicsContext* context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, int to) const354 void FontCascade::drawEmphasisMarks(GraphicsContext* context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, int to) const 355 355 { 356 356 if (isLoadingCustomFonts()) … … 371 371 } 372 372 373 float Font ::width(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const373 float FontCascade::width(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const 374 374 { 375 375 CodePath codePathToUse = codePath(run); … … 404 404 } 405 405 406 float Font ::width(const TextRun& run, int& charsConsumed, String& glyphName) const406 float FontCascade::width(const TextRun& run, int& charsConsumed, String& glyphName) const 407 407 { 408 408 #if ENABLE(SVG_FONTS) … … 416 416 } 417 417 418 GlyphData Font ::glyphDataForCharacter(UChar32 c, bool mirror, FontDataVariant variant) const418 GlyphData FontCascade::glyphDataForCharacter(UChar32 c, bool mirror, FontDataVariant variant) const 419 419 { 420 420 if (variant == AutoVariant) { … … 437 437 438 438 #if !PLATFORM(COCOA) 439 PassOwnPtr<TextLayout> Font ::createLayout(RenderText*, float, bool) const439 PassOwnPtr<TextLayout> FontCascade::createLayout(RenderText*, float, bool) const 440 440 { 441 441 return nullptr; 442 442 } 443 443 444 void Font ::deleteLayout(TextLayout*)445 { 446 } 447 448 float Font ::width(TextLayout&, unsigned, unsigned, HashSet<const SimpleFontData*>*)444 void FontCascade::deleteLayout(TextLayout*) 445 { 446 } 447 448 float FontCascade::width(TextLayout&, unsigned, unsigned, HashSet<const SimpleFontData*>*) 449 449 { 450 450 ASSERT_NOT_REACHED(); … … 497 497 // but, in order to get similar rendering across platforms, we do this check for 498 498 // all platforms. 499 bool Font ::hasValidAverageCharWidth() const499 bool FontCascade::hasValidAverageCharWidth() const 500 500 { 501 501 AtomicString family = firstFamily(); … … 521 521 } 522 522 523 bool Font ::fastAverageCharWidthIfAvailable(float& width) const523 bool FontCascade::fastAverageCharWidthIfAvailable(float& width) const 524 524 { 525 525 bool success = hasValidAverageCharWidth(); … … 529 529 } 530 530 531 void Font ::adjustSelectionRectForText(const TextRun& run, LayoutRect& selectionRect, int from, int to) const531 void FontCascade::adjustSelectionRectForText(const TextRun& run, LayoutRect& selectionRect, int from, int to) const 532 532 { 533 533 to = (to == -1 ? run.length() : to); … … 544 544 } 545 545 546 int Font ::offsetForPosition(const TextRun& run, float x, bool includePartialGlyphs) const546 int FontCascade::offsetForPosition(const TextRun& run, float x, bool includePartialGlyphs) const 547 547 { 548 548 // FIXME: Use the fast code path once it handles partial runs with kerning and ligatures. See http://webkit.org/b/100050 … … 560 560 561 561 for (unsigned i = 0; i < length; ++i) 562 normalized.append(Font ::normalizeSpaces(characters[i]));562 normalized.append(FontCascade::normalizeSpaces(characters[i])); 563 563 564 564 return normalized.toString(); 565 565 } 566 566 567 String Font ::normalizeSpaces(const LChar* characters, unsigned length)567 String FontCascade::normalizeSpaces(const LChar* characters, unsigned length) 568 568 { 569 569 return normalizeSpacesInternal(characters, length); 570 570 } 571 571 572 String Font ::normalizeSpaces(const UChar* characters, unsigned length)572 String FontCascade::normalizeSpaces(const UChar* characters, unsigned length) 573 573 { 574 574 return normalizeSpacesInternal(characters, length); … … 577 577 static bool shouldUseFontSmoothing = true; 578 578 579 void Font ::setShouldUseSmoothing(bool shouldUseSmoothing)579 void FontCascade::setShouldUseSmoothing(bool shouldUseSmoothing) 580 580 { 581 581 ASSERT(isMainThread()); … … 583 583 } 584 584 585 bool Font ::shouldUseSmoothing()585 bool FontCascade::shouldUseSmoothing() 586 586 { 587 587 return shouldUseFontSmoothing; 588 588 } 589 589 590 void Font ::setCodePath(CodePath p)590 void FontCascade::setCodePath(CodePath p) 591 591 { 592 592 s_codePath = p; 593 593 } 594 594 595 Font ::CodePath Font::codePath()595 FontCascade::CodePath FontCascade::codePath() 596 596 { 597 597 return s_codePath; 598 598 } 599 599 600 void Font ::setDefaultTypesettingFeatures(TypesettingFeatures typesettingFeatures)600 void FontCascade::setDefaultTypesettingFeatures(TypesettingFeatures typesettingFeatures) 601 601 { 602 602 s_defaultTypesettingFeatures = typesettingFeatures; 603 603 } 604 604 605 TypesettingFeatures Font ::defaultTypesettingFeatures()605 TypesettingFeatures FontCascade::defaultTypesettingFeatures() 606 606 { 607 607 return s_defaultTypesettingFeatures; 608 608 } 609 609 610 Font ::CodePath Font::codePath(const TextRun& run) const610 FontCascade::CodePath FontCascade::codePath(const TextRun& run) const 611 611 { 612 612 if (s_codePath != Auto) … … 634 634 } 635 635 636 Font ::CodePath Font::characterRangeCodePath(const UChar* characters, unsigned len)636 FontCascade::CodePath FontCascade::characterRangeCodePath(const UChar* characters, unsigned len) 637 637 { 638 638 // FIXME: Should use a UnicodeSet in ports where ICU is used. Note that we … … 735 735 return Complex; 736 736 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, 739 739 if (c < 0xA800) 740 740 continue; … … 788 788 } 789 789 790 bool Font ::isCJKIdeograph(UChar32 c)790 bool FontCascade::isCJKIdeograph(UChar32 c) 791 791 { 792 792 // The basic CJK Unified Ideographs block. … … 813 813 if (c >= 0xF900 && c <= 0xFAFF) 814 814 return true; 815 815 816 816 // CJK Unified Ideographs Extension B. 817 817 if (c >= 0x20000 && c <= 0x2A6DF) 818 818 return true; 819 819 820 820 // CJK Unified Ideographs Extension C. 821 821 if (c >= 0x2A700 && c <= 0x2B73F) … … 833 833 } 834 834 835 bool Font ::isCJKIdeographOrSymbol(UChar32 c)835 bool FontCascade::isCJKIdeographOrSymbol(UChar32 c) 836 836 { 837 837 // 0x2C7 Caron, Mandarin Chinese 3rd Tone … … 915 915 if (c >= 0x2FF0 && c <= 0x2FFF) 916 916 return true; 917 917 918 918 // CJK Symbols and Punctuation, excluding 0x3030. 919 919 if (c >= 0x3000 && c < 0x3030) … … 941 941 if (c >= 0x31A0 && c <= 0x31BF) 942 942 return true; 943 943 944 944 // Enclosed CJK Letters and Months. 945 945 if (c >= 0x3200 && c <= 0x32FF) … … 990 990 } 991 991 992 unsigned Font ::expansionOpportunityCountInternal(const LChar* characters, size_t length, TextDirection direction, bool& isAfterExpansion)992 unsigned FontCascade::expansionOpportunityCountInternal(const LChar* characters, size_t length, TextDirection direction, bool& isAfterExpansion) 993 993 { 994 994 unsigned count = 0; … … 1013 1013 } 1014 1014 1015 unsigned Font ::expansionOpportunityCountInternal(const UChar* characters, size_t length, TextDirection direction, bool& isAfterExpansion)1015 unsigned FontCascade::expansionOpportunityCountInternal(const UChar* characters, size_t length, TextDirection direction, bool& isAfterExpansion) 1016 1016 { 1017 1017 static bool expandAroundIdeographs = canExpandAroundIdeographsInComplexText(); … … 1063 1063 } 1064 1064 1065 unsigned Font ::expansionOpportunityCount(const StringView& stringView, TextDirection direction, bool& isAfterExpansion)1065 unsigned FontCascade::expansionOpportunityCount(const StringView& stringView, TextDirection direction, bool& isAfterExpansion) 1066 1066 { 1067 1067 if (stringView.is8Bit()) … … 1070 1070 } 1071 1071 1072 bool Font ::canReceiveTextEmphasis(UChar32 c)1072 bool FontCascade::canReceiveTextEmphasis(UChar32 c) 1073 1073 { 1074 1074 if (U_GET_GC_MASK(c) & (U_GC_Z_MASK | U_GC_CN_MASK | U_GC_CC_MASK | U_GC_CF_MASK)) … … 1083 1083 } 1084 1084 1085 bool Font ::isLoadingCustomFonts() const1085 bool FontCascade::isLoadingCustomFonts() const 1086 1086 { 1087 1087 return m_glyphs && m_glyphs->isLoadingCustomFonts(); -
trunk/Source/WebCore/platform/graphics/FontCascade.h
r178496 r178510 23 23 */ 24 24 25 #ifndef Font _h26 #define Font _h25 #ifndef FontCascade_h 26 #define FontCascade_h 27 27 28 28 #include "DashArray.h" … … 107 107 GlyphToPathTranslator::GlyphUnderlineType computeUnderlineType(const TextRun&, const GlyphBuffer&, int index); 108 108 109 class Font {109 class FontCascade { 110 110 public: 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); 113 113 // 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); 115 115 116 116 // FIXME: We should make this constructor platform-independent. 117 117 #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); } 127 127 128 128 const FontDescription& fontDescription() const { return m_fontDescription; } … … 244 244 public: 245 245 #if ENABLE(IOS_TEXT_AUTOSIZING) 246 bool equalForTextAutoSizing(const Font & other) const246 bool equalForTextAutoSizing(const FontCascade& other) const 247 247 { 248 248 return m_fontDescription.equalForTextAutoSizing(other.m_fontDescription) … … 270 270 static bool treatAsZeroWidthSpace(UChar c) { return treatAsZeroWidthSpaceInComplexScript(c) || c == 0x200c || c == 0x200d; } 271 271 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); 273 273 274 274 static inline UChar normalizeSpaces(UChar character) … … 348 348 void clearWidthCaches(); 349 349 350 inline Font ::~Font()351 { 352 } 353 354 inline const SimpleFontData& Font ::primaryFontData() const350 inline FontCascade::~FontCascade() 351 { 352 } 353 354 inline const SimpleFontData& FontCascade::primaryFontData() const 355 355 { 356 356 ASSERT(m_glyphs); … … 358 358 } 359 359 360 inline const FontRanges& Font ::fallbackRangesAt(unsigned index) const360 inline const FontRanges& FontCascade::fallbackRangesAt(unsigned index) const 361 361 { 362 362 ASSERT(m_glyphs); … … 364 364 } 365 365 366 inline bool Font ::isFixedPitch() const366 inline bool FontCascade::isFixedPitch() const 367 367 { 368 368 ASSERT(m_glyphs); … … 370 370 } 371 371 372 inline FontSelector* Font ::fontSelector() const372 inline FontSelector* FontCascade::fontSelector() const 373 373 { 374 374 return m_glyphs ? m_glyphs->fontSelector() : 0; 375 375 } 376 376 377 inline float Font ::tabWidth(const SimpleFontData& fontData, unsigned tabSize, float position) const377 inline float FontCascade::tabWidth(const SimpleFontData& fontData, unsigned tabSize, float position) const 378 378 { 379 379 if (!tabSize) -
trunk/Source/WebCore/platform/graphics/FontFastPath.cpp
r178250 r178510 22 22 23 23 #include "config.h" 24 #include "Font .h"24 #include "FontCascade.h" 25 25 26 26 #include "FloatRect.h" … … 42 42 // FIXME: This function may not work if the emphasis mark uses a complex script, but none of the 43 43 // standard emphasis marks do so. 44 bool Font ::getEmphasisMarkGlyphData(const AtomicString& mark, GlyphData& glyphData) const44 bool FontCascade::getEmphasisMarkGlyphData(const AtomicString& mark, GlyphData& glyphData) const 45 45 { 46 46 if (mark.isEmpty()) … … 67 67 } 68 68 69 int Font ::emphasisMarkAscent(const AtomicString& mark) const69 int FontCascade::emphasisMarkAscent(const AtomicString& mark) const 70 70 { 71 71 GlyphData markGlyphData; … … 81 81 } 82 82 83 int Font ::emphasisMarkDescent(const AtomicString& mark) const83 int FontCascade::emphasisMarkDescent(const AtomicString& mark) const 84 84 { 85 85 GlyphData markGlyphData; … … 95 95 } 96 96 97 int Font ::emphasisMarkHeight(const AtomicString& mark) const97 int FontCascade::emphasisMarkHeight(const AtomicString& mark) const 98 98 { 99 99 GlyphData markGlyphData; … … 109 109 } 110 110 111 float Font ::getGlyphsAndAdvancesForSimpleText(const TextRun& run, int from, int to, GlyphBuffer& glyphBuffer, ForTextEmphasisOrNot forTextEmphasis) const111 float FontCascade::getGlyphsAndAdvancesForSimpleText(const TextRun& run, int from, int to, GlyphBuffer& glyphBuffer, ForTextEmphasisOrNot forTextEmphasis) const 112 112 { 113 113 float initialAdvance; … … 139 139 } 140 140 141 float Font ::drawSimpleText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to) const141 float FontCascade::drawSimpleText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to) const 142 142 { 143 143 // This glyph buffer holds our glyphs+advances+font data for each glyph. … … 155 155 } 156 156 157 void Font ::drawEmphasisMarksForSimpleText(GraphicsContext* context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, int to) const157 void FontCascade::drawEmphasisMarksForSimpleText(GraphicsContext* context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, int to) const 158 158 { 159 159 GlyphBuffer glyphBuffer; … … 166 166 } 167 167 168 void Font ::drawGlyphBuffer(GraphicsContext* context, const TextRun& run, const GlyphBuffer& glyphBuffer, FloatPoint& point) const168 void FontCascade::drawGlyphBuffer(GraphicsContext* context, const TextRun& run, const GlyphBuffer& glyphBuffer, FloatPoint& point) const 169 169 { 170 170 #if !ENABLE(SVG_FONTS) … … 232 232 } 233 233 234 void Font ::drawEmphasisMarks(GraphicsContext* context, const TextRun& run, const GlyphBuffer& glyphBuffer, const AtomicString& mark, const FloatPoint& point) const234 void FontCascade::drawEmphasisMarks(GraphicsContext* context, const TextRun& run, const GlyphBuffer& glyphBuffer, const AtomicString& mark, const FloatPoint& point) const 235 235 { 236 236 GlyphData markGlyphData; … … 261 261 } 262 262 263 float Font ::floatWidthForSimpleText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const263 float FontCascade::floatWidthForSimpleText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const 264 264 { 265 265 WidthIterator it(this, run, fallbackFonts, glyphOverflow); … … 277 277 } 278 278 279 void Font ::adjustSelectionRectForSimpleText(const TextRun& run, LayoutRect& selectionRect, int from, int to) const279 void FontCascade::adjustSelectionRectForSimpleText(const TextRun& run, LayoutRect& selectionRect, int from, int to) const 280 280 { 281 281 GlyphBuffer glyphBuffer; … … 296 296 } 297 297 298 int Font ::offsetForPositionForSimpleText(const TextRun& run, float x, bool includePartialGlyphs) const298 int FontCascade::offsetForPositionForSimpleText(const TextRun& run, float x, bool includePartialGlyphs) const 299 299 { 300 300 float delta = x; -
trunk/Source/WebCore/platform/graphics/FontGlyphs.cpp
r178388 r178510 30 30 #include "FontGlyphs.h" 31 31 32 #include "Font.h"33 32 #include "FontCache.h" 33 #include "FontCascade.h" 34 34 #include "GlyphPage.h" 35 35 … … 265 265 return GlyphData(); 266 266 267 if (systemFallbackFontData->platformData().orientation() == Vertical && !systemFallbackFontData->hasVerticalGlyphs() && Font ::isCJKIdeographOrSymbol(c))267 if (systemFallbackFontData->platformData().orientation() == Vertical && !systemFallbackFontData->hasVerticalGlyphs() && FontCascade::isCJKIdeographOrSymbol(c)) 268 268 variant = BrokenIdeographVariant; 269 269 … … 275 275 276 276 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()) 278 278 fallbackGlyphData = glyphDataForNonCJKCharacterWithGlyphOrientation(c, description.nonCJKGlyphOrientation(), fallbackGlyphData); 279 279 } … … 323 323 if (data.fontData) { 324 324 if (data.fontData->platformData().orientation() == Vertical && !data.fontData->isTextOrientationFallback()) { 325 if (!Font ::isCJKIdeographOrSymbol(c))325 if (!FontCascade::isCJKIdeographOrSymbol(c)) 326 326 return glyphDataForNonCJKCharacterWithGlyphOrientation(c, description.nonCJKGlyphOrientation(), data); 327 327 -
trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp
r178166 r178510 431 431 #if !PLATFORM(IOS) 432 432 #if !USE(WINGDI) 433 void GraphicsContext::drawText(const Font & font, const TextRun& run, const FloatPoint& point, int from, int to)433 void GraphicsContext::drawText(const FontCascade& font, const TextRun& run, const FloatPoint& point, int from, int to) 434 434 { 435 435 if (paintingDisabled()) … … 440 440 #endif 441 441 #else 442 float GraphicsContext::drawText(const Font & font, const TextRun& run, const FloatPoint& point, int from, int to)442 float GraphicsContext::drawText(const FontCascade& font, const TextRun& run, const FloatPoint& point, int from, int to) 443 443 { 444 444 if (paintingDisabled()) … … 449 449 #endif // !PLATFORM(IOS) 450 450 451 void GraphicsContext::drawGlyphs(const Font & font, const SimpleFontData& fontData, const GlyphBuffer& buffer, int from, int numGlyphs, const FloatPoint& point)451 void GraphicsContext::drawGlyphs(const FontCascade& font, const SimpleFontData& fontData, const GlyphBuffer& buffer, int from, int numGlyphs, const FloatPoint& point) 452 452 { 453 453 if (paintingDisabled()) … … 457 457 } 458 458 459 void GraphicsContext::drawEmphasisMarks(const Font & font, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, int to)459 void GraphicsContext::drawEmphasisMarks(const FontCascade& font, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, int to) 460 460 { 461 461 if (paintingDisabled()) … … 466 466 467 467 // 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 there468 // returned width of the drawn text, FontCascade::drawText(), instead of computing it. Ensure that there 469 469 // aren't noticeable differences in layout with such a change. 470 470 #if !PLATFORM(IOS) 471 void GraphicsContext::drawBidiText(const Font & font, const TextRun& run, const FloatPoint& point, Font::CustomFontNotReadyAction customFontNotReadyAction)471 void GraphicsContext::drawBidiText(const FontCascade& font, const TextRun& run, const FloatPoint& point, FontCascade::CustomFontNotReadyAction customFontNotReadyAction) 472 472 #else 473 float GraphicsContext::drawBidiText(const Font & font, const TextRun& run, const FloatPoint& point, Font::CustomFontNotReadyAction customFontNotReadyAction, BidiStatus* status, int length)473 float GraphicsContext::drawBidiText(const FontCascade& font, const TextRun& run, const FloatPoint& point, FontCascade::CustomFontNotReadyAction customFontNotReadyAction, BidiStatus* status, int length) 474 474 #endif 475 475 { … … 516 516 517 517 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. 519 519 if (bidiRun) 520 520 currPoint.move(font.width(subrun), 0); -
trunk/Source/WebCore/platform/graphics/GraphicsContext.h
r177786 r178510 31 31 #include "DashArray.h" 32 32 #include "FloatRect.h" 33 #include "Font .h"33 #include "FontCascade.h" 34 34 #include "Gradient.h" 35 35 #include "Image.h" … … 357 357 358 358 #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); 360 360 #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); 365 365 #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); 367 367 #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); 369 369 #endif 370 370 enum RoundingMode { -
trunk/Source/WebCore/platform/graphics/SimpleFontData.cpp
r178388 r178510 34 34 #include "CoreTextSPI.h" 35 35 #endif 36 #include "Font.h"37 36 #include "FontCache.h" 37 #include "FontCascade.h" 38 38 #include "OpenTypeMathData.h" 39 39 #include <wtf/MathExtras.h> … … 420 420 int codeUnitsLength; 421 421 if (U_IS_BMP(character)) { 422 codeUnits[0] = Font ::normalizeSpaces(character);422 codeUnits[0] = FontCascade::normalizeSpaces(character); 423 423 codeUnitsLength = 1; 424 424 } else { -
trunk/Source/WebCore/platform/graphics/StringTruncator.cpp
r166448 r178510 30 30 #include "StringTruncator.h" 31 31 32 #include "Font .h"32 #include "FontCascade.h" 33 33 #include "TextBreakIterator.h" 34 34 #include "TextRun.h" … … 193 193 } 194 194 195 static float stringWidth(const Font & renderer, const UChar* characters, unsigned length, bool disableRoundingHacks)195 static float stringWidth(const FontCascade& renderer, const UChar* characters, unsigned length, bool disableRoundingHacks) 196 196 { 197 197 TextRun run(characters, length); … … 201 201 } 202 202 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)203 static 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) 204 204 { 205 205 if (string.isEmpty()) … … 296 296 } 297 297 298 String StringTruncator::centerTruncate(const String& string, float maxWidth, const Font & font, EnableRoundingHacksOrNot enableRoundingHacks)298 String StringTruncator::centerTruncate(const String& string, float maxWidth, const FontCascade& font, EnableRoundingHacksOrNot enableRoundingHacks) 299 299 { 300 300 return truncateString(string, maxWidth, font, centerTruncateToBuffer, !enableRoundingHacks); 301 301 } 302 302 303 String StringTruncator::rightTruncate(const String& string, float maxWidth, const Font & font, EnableRoundingHacksOrNot enableRoundingHacks)303 String StringTruncator::rightTruncate(const String& string, float maxWidth, const FontCascade& font, EnableRoundingHacksOrNot enableRoundingHacks) 304 304 { 305 305 return truncateString(string, maxWidth, font, rightTruncateToBuffer, !enableRoundingHacks); 306 306 } 307 307 308 float StringTruncator::width(const String& string, const Font & font, EnableRoundingHacksOrNot enableRoundingHacks)308 float StringTruncator::width(const String& string, const FontCascade& font, EnableRoundingHacksOrNot enableRoundingHacks) 309 309 { 310 310 return stringWidth(font, StringView(string).upconvertedCharacters(), string.length(), !enableRoundingHacks); 311 311 } 312 312 313 String StringTruncator::centerTruncate(const String& string, float maxWidth, const Font & font, EnableRoundingHacksOrNot enableRoundingHacks, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth)313 String StringTruncator::centerTruncate(const String& string, float maxWidth, const FontCascade& font, EnableRoundingHacksOrNot enableRoundingHacks, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth) 314 314 { 315 315 return truncateString(string, maxWidth, font, centerTruncateToBuffer, !enableRoundingHacks, &resultWidth, shouldInsertEllipsis, customTruncationElementWidth); 316 316 } 317 317 318 String StringTruncator::rightTruncate(const String& string, float maxWidth, const Font & font, EnableRoundingHacksOrNot enableRoundingHacks, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth)318 String StringTruncator::rightTruncate(const String& string, float maxWidth, const FontCascade& font, EnableRoundingHacksOrNot enableRoundingHacks, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth) 319 319 { 320 320 return truncateString(string, maxWidth, font, rightTruncateToBuffer, !enableRoundingHacks, &resultWidth, shouldInsertEllipsis, customTruncationElementWidth); 321 321 } 322 322 323 String StringTruncator::leftTruncate(const String& string, float maxWidth, const Font & font, EnableRoundingHacksOrNot enableRoundingHacks, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth)323 String StringTruncator::leftTruncate(const String& string, float maxWidth, const FontCascade& font, EnableRoundingHacksOrNot enableRoundingHacks, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth) 324 324 { 325 325 return truncateString(string, maxWidth, font, leftTruncateToBuffer, !enableRoundingHacks, &resultWidth, shouldInsertEllipsis, customTruncationElementWidth); 326 326 } 327 327 328 String StringTruncator::rightClipToCharacter(const String& string, float maxWidth, const Font & font, EnableRoundingHacksOrNot enableRoundingHacks, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth)328 String StringTruncator::rightClipToCharacter(const String& string, float maxWidth, const FontCascade& font, EnableRoundingHacksOrNot enableRoundingHacks, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth) 329 329 { 330 330 return truncateString(string, maxWidth, font, rightClipToCharacterBuffer, !enableRoundingHacks, &resultWidth, shouldInsertEllipsis, customTruncationElementWidth); 331 331 } 332 332 333 String StringTruncator::rightClipToWord(const String& string, float maxWidth, const Font & font, EnableRoundingHacksOrNot enableRoundingHacks, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth, bool alwaysTruncate)333 String StringTruncator::rightClipToWord(const String& string, float maxWidth, const FontCascade& font, EnableRoundingHacksOrNot enableRoundingHacks, float& resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth, bool alwaysTruncate) 334 334 { 335 335 return truncateString(string, maxWidth, font, rightClipToWordBuffer, !enableRoundingHacks, &resultWidth, shouldInsertEllipsis, customTruncationElementWidth, alwaysTruncate); -
trunk/Source/WebCore/platform/graphics/StringTruncator.h
r172849 r178510 34 34 namespace WebCore { 35 35 36 class Font; 37 38 class StringTruncator { 39 public: 40 enum EnableRoundingHacksOrNot { DisableRoundingHacks, EnableRoundingHacks }; 36 class FontCascade; 41 37 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); 38 class StringTruncator { 39 public: 40 enum EnableRoundingHacksOrNot { DisableRoundingHacks, EnableRoundingHacks }; 44 41 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); 50 44 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 }; 53 53 54 54 } // namespace WebCore -
trunk/Source/WebCore/platform/graphics/TextRun.h
r177739 r178510 33 33 class FloatPoint; 34 34 class FloatRect; 35 class Font ;35 class FontCascade; 36 36 class GraphicsContext; 37 37 class GlyphBuffer; … … 198 198 199 199 #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; 201 201 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; 203 203 virtual bool applySVGKerning(const SimpleFontData*, WidthIterator&, GlyphBuffer*, int from) const = 0; 204 204 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 23 23 #include "WidthIterator.h" 24 24 25 #include "Font .h"25 #include "FontCascade.h" 26 26 #include "GlyphBuffer.h" 27 27 #include "Latin1TextIterator.h" … … 35 35 namespace WebCore { 36 36 37 WidthIterator::WidthIterator(const Font * font, const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, bool accountForGlyphBounds, bool forTextEmphasis)37 WidthIterator::WidthIterator(const FontCascade* font, const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, bool accountForGlyphBounds, bool forTextEmphasis) 38 38 : m_font(font) 39 39 , m_run(run) … … 58 58 else { 59 59 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); 61 61 if (isAfterExpansion && !m_run.allowsTrailingExpansion()) 62 62 expansionOpportunityCount--; … … 230 230 width += m_font->letterSpacing(); 231 231 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))) { 235 235 // Distribute the run's total expansion evenly over all expansion opportunities in the run. 236 236 if (m_expansion) { … … 269 269 } 270 270 271 if (shouldApplyFontTransforms() && glyphBuffer && Font ::treatAsSpace(character))271 if (shouldApplyFontTransforms() && glyphBuffer && FontCascade::treatAsSpace(character)) { 272 272 charactersTreatedAsSpace.append(std::make_pair(glyphBuffer->size(), 273 273 OriginalAdvancesForCharacterTreatedAsSpace(character == ' ', glyphBuffer->size() ? glyphBuffer->advanceAt(glyphBuffer->size() - 1).width() : 0, width))); 274 } 274 275 275 276 if (m_accountForGlyphBounds) { … … 279 280 } 280 281 281 if (m_forTextEmphasis && !Font ::canReceiveTextEmphasis(character))282 if (m_forTextEmphasis && !FontCascade::canReceiveTextEmphasis(character)) 282 283 glyph = 0; 283 284 … … 289 290 // Force characters that are used to determine word boundaries for the rounding hack 290 291 // 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)) { 292 293 width = ceilf(width); 293 294 … … 302 303 // Check to see if the next character is a "rounding hack character", if so, adjust 303 304 // 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()))) 305 306 || (m_run.applyRunRounding() && static_cast<unsigned>(textIterator.currentCharacter()) >= m_run.length())) { 306 307 float totalWidth = widthSinceLastRounding + width; -
trunk/Source/WebCore/platform/graphics/WidthIterator.h
r173349 r178510 23 23 #define WidthIterator_h 24 24 25 #include "Font .h"25 #include "FontCascade.h" 26 26 #include "SVGGlyph.h" 27 27 #include "TextRun.h" … … 31 31 namespace WebCore { 32 32 33 class Font ;33 class FontCascade; 34 34 class GlyphBuffer; 35 35 class SimpleFontData; … … 40 40 WTF_MAKE_FAST_ALLOCATED; 41 41 public: 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); 43 43 44 44 unsigned advance(int to, GlyphBuffer*); … … 59 59 #endif 60 60 61 static bool supportsTypesettingFeatures(const Font & font)61 static bool supportsTypesettingFeatures(const FontCascade& font) 62 62 { 63 63 #if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED > 1080) … … 71 71 } 72 72 73 const Font * m_font;73 const FontCascade* m_font; 74 74 75 75 const TextRun& m_run; -
trunk/Source/WebCore/platform/graphics/cairo/FontCairo.cpp
r178180 r178510 30 30 31 31 #include "config.h" 32 #include "Font .h"32 #include "FontCascade.h" 33 33 34 34 #include "AffineTransform.h" … … 96 96 } 97 97 98 void Font ::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, const GlyphBuffer& glyphBuffer,98 void FontCascade::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, const GlyphBuffer& glyphBuffer, 99 99 int from, int numGlyphs, const FloatPoint& point) const 100 100 { … … 291 291 } 292 292 293 DashArray Font ::dashesForIntersectionsWithRect(const TextRun& run, const FloatPoint& textOrigin, const FloatRect& lineExtents) const293 DashArray FontCascade::dashesForIntersectionsWithRect(const TextRun& run, const FloatPoint& textOrigin, const FloatRect& lineExtents) const 294 294 { 295 295 if (isLoadingCustomFonts()) … … 299 299 glyphBuffer.saveOffsetsInString(); 300 300 float deltaX; 301 if (codePath(run) != Font ::Complex)301 if (codePath(run) != FontCascade::Complex) 302 302 deltaX = getGlyphsAndAdvancesForSimpleText(run, 0, run.length(), glyphBuffer); 303 303 else -
trunk/Source/WebCore/platform/graphics/cairo/FontCairoHarfbuzzNG.cpp
r177078 r178510 26 26 27 27 #include "config.h" 28 #include "Font .h"28 #include "FontCascade.h" 29 29 30 30 #include "GraphicsContext.h" … … 40 40 41 41 42 float Font ::getGlyphsAndAdvancesForComplexText(const TextRun& run, int, int, GlyphBuffer& glyphBuffer, ForTextEmphasisOrNot /* forTextEmphasis */) const42 float FontCascade::getGlyphsAndAdvancesForComplexText(const TextRun& run, int, int, GlyphBuffer& glyphBuffer, ForTextEmphasisOrNot /* forTextEmphasis */) const 43 43 { 44 44 HarfBuzzShaper shaper(this, run); … … 51 51 return 0; 52 52 } 53 float Font ::drawComplexText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to) const53 float FontCascade::drawComplexText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to) const 54 54 { 55 55 // This glyph buffer holds our glyphs + advances + font data for each glyph. … … 69 69 } 70 70 71 void Font ::drawEmphasisMarksForComplexText(GraphicsContext* /* context */, const TextRun& /* run */, const AtomicString& /* mark */, const FloatPoint& /* point */, int /* from */, int /* to */) const71 void FontCascade::drawEmphasisMarksForComplexText(GraphicsContext* /* context */, const TextRun& /* run */, const AtomicString& /* mark */, const FloatPoint& /* point */, int /* from */, int /* to */) const 72 72 { 73 73 notImplemented(); 74 74 } 75 75 76 bool Font ::canReturnFallbackFontsForComplexText()76 bool FontCascade::canReturnFallbackFontsForComplexText() 77 77 { 78 78 return false; 79 79 } 80 80 81 bool Font ::canExpandAroundIdeographsInComplexText()81 bool FontCascade::canExpandAroundIdeographsInComplexText() 82 82 { 83 83 return false; 84 84 } 85 85 86 float Font ::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>*, GlyphOverflow*) const86 float FontCascade::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>*, GlyphOverflow*) const 87 87 { 88 88 HarfBuzzShaper shaper(this, run); … … 93 93 } 94 94 95 int Font ::offsetForPositionForComplexText(const TextRun& run, float x, bool) const95 int FontCascade::offsetForPositionForComplexText(const TextRun& run, float x, bool) const 96 96 { 97 97 HarfBuzzShaper shaper(this, run); … … 102 102 } 103 103 104 void Font ::adjustSelectionRectForComplexText(const TextRun& run, LayoutRect& selectionRect, int from, int to) const104 void FontCascade::adjustSelectionRectForComplexText(const TextRun& run, LayoutRect& selectionRect, int from, int to) const 105 105 { 106 106 HarfBuzzShaper shaper(this, run); -
trunk/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp
r178301 r178510 23 23 #include "FontCache.h" 24 24 25 #include "Font.h"26 25 #include "OwnPtrCairo.h" 27 26 #include "RefPtrCairo.h" -
trunk/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp
r178133 r178510 36 36 #include "FloatConversion.h" 37 37 #include "FloatRect.h" 38 #include "Font.h"39 38 #include "FontCache.h" 40 39 #include "FontDescription.h" -
trunk/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaper.cpp
r178166 r178510 32 32 #include "HarfBuzzShaper.h" 33 33 34 #include "Font .h"34 #include "FontCascade.h" 35 35 #include "HarfBuzzFace.h" 36 36 #include "SurrogatePairAwareTextIterator.h" … … 174 174 U16_NEXT(source, nextPosition, length, character); 175 175 // 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') 177 177 character = ' '; 178 else if (Font ::treatAsZeroWidthSpaceInComplexScript(character))178 else if (FontCascade::treatAsZeroWidthSpaceInComplexScript(character)) 179 179 character = zeroWidthSpace; 180 180 U16_APPEND(destination, position, length, character, error); … … 184 184 } 185 185 186 HarfBuzzShaper::HarfBuzzShaper(const Font * font, const TextRun& run)186 HarfBuzzShaper::HarfBuzzShaper(const FontCascade* font, const TextRun& run) 187 187 : m_font(font) 188 188 , m_normalizedBufferLength(0) … … 215 215 U16_NEXT(source, nextPosition, length, character); 216 216 // 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') 218 218 character = ' '; 219 else if (Font ::treatAsZeroWidthSpace(character))219 else if (FontCascade::treatAsZeroWidthSpace(character)) 220 220 character = zeroWidthSpace; 221 221 else if (normalizeMode == HarfBuzzShaper::NormalizeMirrorChars) … … 416 416 417 417 for (iterator.advance(clusterLength); iterator.consume(character, clusterLength); iterator.advance(clusterLength)) { 418 if (Font ::treatAsZeroWidthSpace(character))418 if (FontCascade::treatAsZeroWidthSpace(character)) 419 419 continue; 420 420 … … 537 537 glyphToCharacterIndexes[i] = glyphInfos[i].cluster; 538 538 539 if (isClusterEnd && !Font ::treatAsZeroWidthSpace(m_normalizedBuffer[currentCharacterIndex]))539 if (isClusterEnd && !FontCascade::treatAsZeroWidthSpace(m_normalizedBuffer[currentCharacterIndex])) 540 540 spacing += m_letterSpacing; 541 541 -
trunk/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaper.h
r175156 r178510 45 45 namespace WebCore { 46 46 47 class Font ;47 class FontCascade; 48 48 class SimpleFontData; 49 49 … … 55 55 }; 56 56 57 HarfBuzzShaper(const Font *, const TextRun&);57 HarfBuzzShaper(const FontCascade*, const TextRun&); 58 58 virtual ~HarfBuzzShaper(); 59 59 … … 123 123 GlyphBufferAdvance createGlyphBufferAdvance(float, float); 124 124 125 const Font * m_font;125 const FontCascade* m_font; 126 126 std::unique_ptr<UChar[]> m_normalizedBuffer; 127 127 unsigned m_normalizedBufferLength; -
trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm
r178180 r178510 32 32 #import "CoreGraphicsSPI.h" 33 33 #import "CoreTextSPI.h" 34 #import "Font .h"34 #import "FontCascade.h" 35 35 #import "RenderThemeIOS.h" 36 36 #import <wtf/NeverDestroyed.h> -
trunk/Source/WebCore/platform/graphics/ios/SimpleFontDataIOS.mm
r178133 r178510 30 30 #import "BlockExceptions.h" 31 31 #import "CoreGraphicsSPI.h" 32 #import "Font.h"33 32 #import "FontCache.h" 33 #import "FontCascade.h" 34 34 #import "FontDescription.h" 35 35 #import "FontServicesIOS.h" -
trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp
r177968 r178510 27 27 28 28 #include "FloatSize.h" 29 #include "Font .h"29 #include "FontCascade.h" 30 30 #include "RenderBlock.h" 31 31 #include "RenderText.h" … … 44 44 class TextLayout { 45 45 public: 46 static bool isNeeded(RenderText* text, const Font & font)46 static bool isNeeded(RenderText* text, const FontCascade& font) 47 47 { 48 48 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) 53 53 : m_font(font) 54 54 , m_run(constructTextRun(text, font, xPos)) … … 61 61 m_controller->advance(from, 0, ByWholeGlyphs, fallbackFonts); 62 62 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])) 64 64 beforeWidth += m_font.wordSpacing(); 65 65 m_controller->advance(from + len, 0, ByWholeGlyphs, fallbackFonts); … … 69 69 70 70 private: 71 static TextRun constructTextRun(RenderText* text, const Font & font, float xPos)71 static TextRun constructTextRun(RenderText* text, const FontCascade& font, float xPos) 72 72 { 73 73 TextRun run = RenderBlock::constructTextRun(text, font, text, text->style()); … … 79 79 } 80 80 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; 83 83 TextRun m_run; 84 84 std::unique_ptr<ComplexTextController> m_controller; 85 85 }; 86 86 87 PassOwnPtr<TextLayout> Font ::createLayout(RenderText* text, float xPos, bool collapseWhiteSpace) const87 PassOwnPtr<TextLayout> FontCascade::createLayout(RenderText* text, float xPos, bool collapseWhiteSpace) const 88 88 { 89 89 if (!collapseWhiteSpace || !TextLayout::isNeeded(text, *this)) … … 92 92 } 93 93 94 void Font ::deleteLayout(TextLayout* layout)94 void FontCascade::deleteLayout(TextLayout* layout) 95 95 { 96 96 delete layout; 97 97 } 98 98 99 float Font ::width(TextLayout& layout, unsigned from, unsigned len, HashSet<const SimpleFontData*>* fallbackFonts)99 float FontCascade::width(TextLayout& layout, unsigned from, unsigned len, HashSet<const SimpleFontData*>* fallbackFonts) 100 100 { 101 101 return layout.width(from, len, fallbackFonts); … … 116 116 } 117 117 118 ComplexTextController::ComplexTextController(const Font * font, const TextRun& run, bool mayUseNaturalWritingDirection, HashSet<const SimpleFontData*>* fallbackFonts, bool forTextEmphasis)118 ComplexTextController::ComplexTextController(const FontCascade* font, const TextRun& run, bool mayUseNaturalWritingDirection, HashSet<const SimpleFontData*>* fallbackFonts, bool forTextEmphasis) 119 119 : m_font(*font) 120 120 , m_run(run) … … 145 145 else { 146 146 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); 148 148 if (isAfterExpansion && !m_run.allowsTrailingExpansion()) 149 149 expansionOpportunityCount--; … … 616 616 nextCh = *(m_complexTextRuns[r + 1]->characters() + m_complexTextRuns[r + 1]->indexAt(0)); 617 617 618 bool treatAsSpace = Font ::treatAsSpace(ch);618 bool treatAsSpace = FontCascade::treatAsSpace(ch); 619 619 CGGlyph glyph = treatAsSpace ? fontData.spaceGlyph() : glyphs[i]; 620 620 CGSize advance = treatAsSpace ? CGSizeMake(spaceWidth, advances[i].height) : advances[i]; … … 626 626 if (ch == '\t' && m_run.allowTabs()) 627 627 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) { 629 629 advance.width = 0; 630 630 glyph = fontData.spaceGlyph(); … … 652 652 653 653 // Handle justification and word-spacing. 654 if (treatAsSpace || Font ::isCJKIdeographOrSymbol(ch)) {654 if (treatAsSpace || FontCascade::isCJKIdeographOrSymbol(ch)) { 655 655 // Distribute the run's total expansion evenly over all expansion opportunities in the run. 656 656 if (m_expansion) { … … 686 686 // Force characters that are used to determine word boundaries for the rounding hack 687 687 // 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)) 689 689 advance.width = ceilCGFloat(advance.width); 690 690 691 691 // 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)) { 694 695 CGFloat totalWidth = widthSinceLastCommit + advance.width; 695 696 widthSinceLastCommit = ceilCGFloat(totalWidth); … … 710 711 711 712 // 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))) 713 714 glyph = 0; 714 715 -
trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.h
r177955 r178510 41 41 namespace WebCore { 42 42 43 class Font ;43 class FontCascade; 44 44 class SimpleFontData; 45 45 class TextRun; … … 51 51 class ComplexTextController { 52 52 public: 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); 54 54 55 55 // Advance and emit glyphs up to the specified character. … … 139 139 Vector<unsigned, 16> m_glyphCountFromStartToIndex; 140 140 141 const Font & m_font;141 const FontCascade& m_font; 142 142 const TextRun& m_run; 143 143 bool m_isLTROnly; -
trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm
r178388 r178510 28 28 29 29 #include "CoreTextSPI.h" 30 #include "Font.h"31 30 #include "FontCache.h" 31 #include "FontCascade.h" 32 32 #include "TextRun.h" 33 33 #include "WebCoreSystemInterface.h" … … 41 41 @interface WebCascadeList : NSArray { 42 42 @private 43 const WebCore::Font * _font;43 const WebCore::FontCascade* _font; 44 44 UChar32 _character; 45 45 NSUInteger _count; … … 47 47 } 48 48 49 - (id)initWithFont:(const WebCore::Font *)font character:(UChar32)character;49 - (id)initWithFont:(const WebCore::FontCascade*)font character:(UChar32)character; 50 50 51 51 @end … … 53 53 @implementation WebCascadeList 54 54 55 - (id)initWithFont:(const WebCore::Font *)font character:(UChar32)character55 - (id)initWithFont:(const WebCore::FontCascade*)font character:(UChar32)character 56 56 { 57 57 if (!(self = [super init])) … … 61 61 _character = character; 62 62 63 // By the time a WebCascadeList is used, the Font has already been asked to realize all of its63 // By the time a WebCascadeList is used, the FontCascade has already been asked to realize all of its 64 64 // FontData, so this loop does not hit the FontCache. 65 65 while (!_font->fallbackRangesAt(_count).isNull()) -
trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm
r178180 r178510 34 34 35 35 #import "CoreGraphicsSPI.h" 36 #import "Font .h"36 #import "FontCascade.h" 37 37 #import "SimpleFontData.h" 38 38 #import "FontPlatformData.h" -
trunk/Source/WebCore/platform/graphics/mac/FontComplexTextMac.cpp
r178389 r178510 24 24 25 25 #include "config.h" 26 #include "Font .h"26 #include "FontCascade.h" 27 27 28 28 #include "ComplexTextController.h" … … 38 38 namespace WebCore { 39 39 40 void Font ::adjustSelectionRectForComplexText(const TextRun& run, LayoutRect& selectionRect, int from, int to) const40 void FontCascade::adjustSelectionRectForComplexText(const TextRun& run, LayoutRect& selectionRect, int from, int to) const 41 41 { 42 42 ComplexTextController controller(this, run); … … 53 53 } 54 54 55 float Font ::getGlyphsAndAdvancesForComplexText(const TextRun& run, int from, int to, GlyphBuffer& glyphBuffer, ForTextEmphasisOrNot forTextEmphasis) const55 float FontCascade::getGlyphsAndAdvancesForComplexText(const TextRun& run, int from, int to, GlyphBuffer& glyphBuffer, ForTextEmphasisOrNot forTextEmphasis) const 56 56 { 57 57 float initialAdvance; … … 76 76 } 77 77 78 float Font ::drawComplexText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to) const78 float FontCascade::drawComplexText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to) const 79 79 { 80 80 // This glyph buffer holds our glyphs + advances + font data for each glyph. … … 94 94 } 95 95 96 void Font ::drawEmphasisMarksForComplexText(GraphicsContext* context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, int to) const96 void FontCascade::drawEmphasisMarksForComplexText(GraphicsContext* context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, int to) const 97 97 { 98 98 GlyphBuffer glyphBuffer; … … 105 105 } 106 106 107 float Font ::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const107 float FontCascade::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const 108 108 { 109 109 ComplexTextController controller(this, run, true, fallbackFonts); … … 117 117 } 118 118 119 int Font ::offsetForPositionForComplexText(const TextRun& run, float x, bool includePartialGlyphs) const119 int FontCascade::offsetForPositionForComplexText(const TextRun& run, float x, bool includePartialGlyphs) const 120 120 { 121 121 ComplexTextController controller(this, run); … … 123 123 } 124 124 125 const SimpleFontData* Font ::fontDataForCombiningCharacterSequence(const UChar* characters, size_t length, FontDataVariant variant) const125 const SimpleFontData* FontCascade::fontDataForCombiningCharacterSequence(const UChar* characters, size_t length, FontDataVariant variant) const 126 126 { 127 127 UChar32 baseCharacter; -
trunk/Source/WebCore/platform/graphics/mac/FontMac.mm
r178180 r178510 22 22 23 23 #import "config.h" 24 #import "Font .h"24 #import "FontCascade.h" 25 25 26 26 #import "CoreGraphicsSPI.h" … … 59 59 namespace WebCore { 60 60 61 bool Font ::canReturnFallbackFontsForComplexText()61 bool FontCascade::canReturnFallbackFontsForComplexText() 62 62 { 63 63 return true; 64 64 } 65 65 66 bool Font ::canExpandAroundIdeographsInComplexText()66 bool FontCascade::canExpandAroundIdeographsInComplexText() 67 67 { 68 68 return true; … … 196 196 #endif 197 197 198 void Font ::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, const GlyphBuffer& glyphBuffer, int from, int numGlyphs, const FloatPoint& anchorPoint) const198 void FontCascade::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, const GlyphBuffer& glyphBuffer, int from, int numGlyphs, const FloatPoint& anchorPoint) const 199 199 { 200 200 const FontPlatformData& platformData = font->platformData(); … … 527 527 } 528 528 529 DashArray Font ::dashesForIntersectionsWithRect(const TextRun& run, const FloatPoint& textOrigin, const FloatRect& lineExtents) const529 DashArray FontCascade::dashesForIntersectionsWithRect(const TextRun& run, const FloatPoint& textOrigin, const FloatRect& lineExtents) const 530 530 { 531 531 if (isLoadingCustomFonts()) … … 535 535 glyphBuffer.saveOffsetsInString(); 536 536 float deltaX; 537 if (codePath(run) != Font ::Complex)537 if (codePath(run) != FontCascade::Complex) 538 538 deltaX = getGlyphsAndAdvancesForSimpleText(run, 0, run.length(), glyphBuffer); 539 539 else … … 591 591 #endif 592 592 593 bool Font ::primaryFontDataIsSystemFont() const593 bool FontCascade::primaryFontDataIsSystemFont() const 594 594 { 595 595 #if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED > 1090 -
trunk/Source/WebCore/platform/graphics/mac/GlyphPageMac.cpp
r178047 r178510 32 32 #include "CoreGraphicsSPI.h" 33 33 #include "CoreTextSPI.h" 34 #include "Font .h"34 #include "FontCascade.h" 35 35 #include "SimpleFontData.h" 36 36 #include "WebCoreSystemInterface.h" … … 48 48 // Ideographs don't have a vertical variant or width variants. 49 49 for (unsigned i = 0; i < bufferLength; ++i) { 50 if (!Font ::isCJKIdeograph(buffer[i]))50 if (!FontCascade::isCJKIdeograph(buffer[i])) 51 51 return true; 52 52 } -
trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm
r178142 r178510 33 33 #import "CoreTextSPI.h" 34 34 #import "FloatRect.h" 35 #import "Font.h"36 35 #import "FontCache.h" 36 #import "FontCascade.h" 37 37 #import "FontDescription.h" 38 38 #import "SharedBuffer.h" -
trunk/Source/WebCore/platform/graphics/win/FontCGWin.cpp
r170947 r178510 25 25 26 26 #include "config.h" 27 #include "Font .h"27 #include "FontCascade.h" 28 28 29 29 #include "AffineTransform.h" … … 128 128 } 129 129 130 void Font ::drawGlyphs(GraphicsContext* graphicsContext, const SimpleFontData* font, const GlyphBuffer& glyphBuffer,130 void FontCascade::drawGlyphs(GraphicsContext* graphicsContext, const SimpleFontData* font, const GlyphBuffer& glyphBuffer, 131 131 int from, int numGlyphs, const FloatPoint& point) const 132 132 { -
trunk/Source/WebCore/platform/graphics/win/FontCacheWin.cpp
r178142 r178510 30 30 #include <winsock2.h> 31 31 #include "FontCache.h" 32 #include "Font.h"33 32 #include "HWndDC.h" 34 33 #include "SimpleFontData.h" -
trunk/Source/WebCore/platform/graphics/win/FontWin.cpp
r170947 r178510 25 25 26 26 #include "config.h" 27 #include "Font .h"27 #include "FontCascade.h" 28 28 29 29 #include "FontGlyphs.h" … … 42 42 namespace WebCore { 43 43 44 bool Font ::canReturnFallbackFontsForComplexText()44 bool FontCascade::canReturnFallbackFontsForComplexText() 45 45 { 46 46 return true; 47 47 } 48 48 49 bool Font ::canExpandAroundIdeographsInComplexText()49 bool FontCascade::canExpandAroundIdeographsInComplexText() 50 50 { 51 51 return false; 52 52 } 53 53 54 void Font ::adjustSelectionRectForComplexText(const TextRun& run, LayoutRect& selectionRect, int from, int to) const54 void FontCascade::adjustSelectionRectForComplexText(const TextRun& run, LayoutRect& selectionRect, int from, int to) const 55 55 { 56 56 UniscribeController it(this, run); … … 68 68 } 69 69 70 float Font ::getGlyphsAndAdvancesForComplexText(const TextRun& run, int from, int to, GlyphBuffer& glyphBuffer, ForTextEmphasisOrNot forTextEmphasis) const70 float FontCascade::getGlyphsAndAdvancesForComplexText(const TextRun& run, int from, int to, GlyphBuffer& glyphBuffer, ForTextEmphasisOrNot forTextEmphasis) const 71 71 { 72 72 if (forTextEmphasis) { … … 93 93 } 94 94 95 float Font ::drawComplexText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to) const95 float FontCascade::drawComplexText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to) const 96 96 { 97 97 // This glyph buffer holds our glyphs + advances + font data for each glyph. … … 110 110 } 111 111 112 void Font ::drawEmphasisMarksForComplexText(GraphicsContext* context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, int to) const112 void FontCascade::drawEmphasisMarksForComplexText(GraphicsContext* context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, int from, int to) const 113 113 { 114 114 GlyphBuffer glyphBuffer; … … 121 121 } 122 122 123 float Font ::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const123 float FontCascade::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const 124 124 { 125 125 UniscribeController controller(this, run, fallbackFonts); … … 134 134 } 135 135 136 int Font ::offsetForPositionForComplexText(const TextRun& run, float xFloat, bool includePartialGlyphs) const136 int FontCascade::offsetForPositionForComplexText(const TextRun& run, float xFloat, bool includePartialGlyphs) const 137 137 { 138 138 // 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. 140 140 int x = static_cast<int>(xFloat); 141 141 -
trunk/Source/WebCore/platform/graphics/win/SimpleFontDataCGWin.cpp
r177876 r178510 31 31 32 32 #include "FloatRect.h" 33 #include "Font.h"34 33 #include "FontCache.h" 35 34 #include "FontDescription.h" -
trunk/Source/WebCore/platform/graphics/win/SimpleFontDataCairoWin.cpp
r176298 r178510 32 32 #include <windows.h> 33 33 34 #include "Font.h"35 34 #include "FontCache.h" 36 35 #include "FontDescription.h" -
trunk/Source/WebCore/platform/graphics/win/SimpleFontDataWin.cpp
r177847 r178510 30 30 #include "SimpleFontData.h" 31 31 32 #include "Font.h"33 32 #include "FontCache.h" 34 33 #include "FloatRect.h" -
trunk/Source/WebCore/platform/graphics/win/UniscribeController.cpp
r177955 r178510 26 26 #include "config.h" 27 27 #include "UniscribeController.h" 28 #include "Font .h"28 #include "FontCascade.h" 29 29 #include "HWndDC.h" 30 30 #include "SimpleFontData.h" … … 42 42 // take the GlyphBuffer as an arg so that we don't have to populate the glyph buffer when 43 43 // measuring. 44 UniscribeController::UniscribeController(const Font * font, const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts)44 UniscribeController::UniscribeController(const FontCascade* font, const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts) 45 45 : m_font(*font) 46 46 , m_run(run) … … 64 64 float numSpaces = 0; 65 65 for (int s = 0; s < m_run.length(); s++) { 66 if (Font ::treatAsSpace(m_run[s]))66 if (FontCascade::treatAsSpace(m_run[s])) 67 67 numSpaces++; 68 68 } … … 288 288 for (int k = 0; k < len; k++) { 289 289 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); 292 292 if (treatAsSpace || treatAsZeroWidthSpace) { 293 293 // Substitute in the space glyph at the appropriate place in the glyphs … … 352 352 candidateSpace = *(m_run.data16(characterIndex - 1)); 353 353 354 if (!Font ::treatAsSpace(candidateSpace))354 if (!FontCascade::treatAsSpace(candidateSpace)) 355 355 advance += m_font.wordSpacing(); 356 356 } -
trunk/Source/WebCore/platform/graphics/win/UniscribeController.h
r110503 r178510 27 27 #define UniscribeController_h 28 28 29 #include "FontCascade.h" 30 #include "GlyphBuffer.h" 29 31 #include <usp10.h> 30 #include "Font.h"31 #include "GlyphBuffer.h"32 32 #include <wtf/Vector.h> 33 33 … … 36 36 class UniscribeController { 37 37 public: 38 UniscribeController(const Font *, const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = 0);38 UniscribeController(const FontCascade*, const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = 0); 39 39 40 40 // Advance and measure/place up to the specified character. … … 61 61 Vector<SCRIPT_VISATTR>& visualAttributes); 62 62 63 const Font & m_font;63 const FontCascade& m_font; 64 64 const TextRun& m_run; 65 65 HashSet<const SimpleFontData*>* m_fallbackFonts; -
trunk/Source/WebCore/platform/ios/WidgetIOS.mm
r165676 r178510 30 30 #import "Cursor.h" 31 31 #import "Document.h" 32 #import "Font .h"32 #import "FontCascade.h" 33 33 #import "Frame.h" 34 34 #import "GraphicsContext.h" -
trunk/Source/WebCore/platform/ios/wak/WKGraphics.mm
r176140 r178510 30 30 31 31 #import "CoreGraphicsSPI.h" 32 #import "Font .h"32 #import "FontCascade.h" 33 33 #import "WebCoreSystemInterface.h" 34 34 #import "WebCoreThread.h" -
trunk/Source/WebCore/platform/mac/DragImageMac.mm
r178305 r178510 30 30 #import "BitmapImage.h" 31 31 #import "CoreGraphicsSPI.h" 32 #import "Font .h"32 #import "FontCascade.h" 33 33 #import "FontDescription.h" 34 34 #import "FontSelector.h" … … 158 158 // FIXME - we should move all the functionality of NSString extras to WebCore 159 159 160 static Font & fontFromNSFont(NSFont *font)160 static FontCascade& fontFromNSFont(NSFont *font) 161 161 { 162 162 static NSFont *currentFont; 163 DEPRECATED_DEFINE_STATIC_LOCAL(Font , currentRenderer, ());163 DEPRECATED_DEFINE_STATIC_LOCAL(FontCascade, currentRenderer, ()); 164 164 165 165 if ([font isEqual:currentFont]) … … 170 170 CFRetain(currentFont); 171 171 FontPlatformData f(font, [font pointSize]); 172 currentRenderer = Font (f, ![[NSGraphicsContext currentContext] isDrawingToScreen]);172 currentRenderer = FontCascade(f, ![[NSGraphicsContext currentContext] isDrawingToScreen]); 173 173 return currentRenderer; 174 174 } … … 193 193 194 194 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]); 196 196 TextRun run(buffer.data(), length); 197 197 run.disableRoundingHacks(); … … 225 225 CGContextScaleCTM(cgContext, 1, -1); 226 226 227 Font webCoreFont(FontPlatformData(font, [font pointSize]), ![nsContext isDrawingToScreen], Antialiased);227 FontCascade webCoreFont(FontPlatformData(font, [font pointSize]), ![nsContext isDrawingToScreen], Antialiased); 228 228 TextRun run(buffer.data(), length); 229 229 run.disableRoundingHacks(); -
trunk/Source/WebCore/platform/mac/ThemeMac.h
r169928 r178510 42 42 virtual int baselinePositionAdjustment(ControlPart) const; 43 43 44 virtual FontDescription controlFont(ControlPart, const Font &, float zoomFactor) const;44 virtual FontDescription controlFont(ControlPart, const FontCascade&, float zoomFactor) const; 45 45 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; 48 48 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; 51 51 52 52 virtual bool controlRequiresPreWhiteSpace(ControlPart part) const { return part == PushButtonPart; } -
trunk/Source/WebCore/platform/mac/ThemeMac.mm
r178397 r178510 150 150 // Helper functions used by a bunch of different control parts. 151 151 152 static NSControlSize controlSizeForFont(const Font & font)152 static NSControlSize controlSizeForFont(const FontCascade& font) 153 153 { 154 154 int fontSize = font.pixelSize(); … … 173 173 } 174 174 175 static LengthSize sizeFromFont(const Font & font, const LengthSize& zoomedSize, float zoomFactor, const std::array<IntSize, 3>& sizes)175 static LengthSize sizeFromFont(const FontCascade& font, const LengthSize& zoomedSize, float zoomFactor, const std::array<IntSize, 3>& sizes) 176 176 { 177 177 return sizeFromNSControlSize(controlSizeForFont(font), zoomedSize, zoomFactor, sizes); … … 294 294 } 295 295 296 static LengthSize checkboxSize(const Font & font, const LengthSize& zoomedSize, float zoomFactor)296 static LengthSize checkboxSize(const FontCascade& font, const LengthSize& zoomedSize, float zoomFactor) 297 297 { 298 298 // If the width and height are both specified, then we have nothing to do. … … 324 324 } 325 325 326 static LengthSize radioSize(const Font & font, const LengthSize& zoomedSize, float zoomFactor)326 static LengthSize radioSize(const FontCascade& font, const LengthSize& zoomedSize, float zoomFactor) 327 327 { 328 328 // If the width and height are both specified, then we have nothing to do. … … 594 594 // We don't use controlSizeForFont() for steppers because the stepper height 595 595 // should be equal to or less than the corresponding text field height, 596 static NSControlSize stepperControlSizeForFont(const Font & font)596 static NSControlSize stepperControlSizeForFont(const FontCascade& font) 597 597 { 598 598 int fontSize = font.pixelSize(); … … 674 674 } 675 675 676 FontDescription ThemeMac::controlFont(ControlPart part, const Font & font, float zoomFactor) const676 FontDescription ThemeMac::controlFont(ControlPart part, const FontCascade& font, float zoomFactor) const 677 677 { 678 678 switch (part) { … … 692 692 } 693 693 694 LengthSize ThemeMac::controlSize(ControlPart part, const Font & font, const LengthSize& zoomedSize, float zoomFactor) const694 LengthSize ThemeMac::controlSize(ControlPart part, const FontCascade& font, const LengthSize& zoomedSize, float zoomFactor) const 695 695 { 696 696 switch (part) { … … 711 711 } 712 712 713 LengthSize ThemeMac::minimumControlSize(ControlPart part, const Font & font, float zoomFactor) const713 LengthSize ThemeMac::minimumControlSize(ControlPart part, const FontCascade& font, float zoomFactor) const 714 714 { 715 715 switch (part) { … … 728 728 } 729 729 730 LengthBox ThemeMac::controlBorder(ControlPart part, const Font & font, const LengthBox& zoomedBox, float zoomFactor) const730 LengthBox ThemeMac::controlBorder(ControlPart part, const FontCascade& font, const LengthBox& zoomedBox, float zoomFactor) const 731 731 { 732 732 switch (part) { … … 740 740 } 741 741 742 LengthBox ThemeMac::controlPadding(ControlPart part, const Font & font, const LengthBox& zoomedBox, float zoomFactor) const742 LengthBox ThemeMac::controlPadding(ControlPart part, const FontCascade& font, const LengthBox& zoomedBox, float zoomFactor) const 743 743 { 744 744 switch (part) { -
trunk/Source/WebCore/platform/mac/WidgetMac.mm
r174506 r178510 32 32 #import "Cursor.h" 33 33 #import "Document.h" 34 #import "Font .h"34 #import "FontCascade.h" 35 35 #import "Frame.h" 36 36 #import "FrameView.h" -
trunk/Source/WebCore/platform/text/PlatformLocale.h
r177280 r178510 34 34 35 35 #if PLATFORM(IOS) 36 class Font ;36 class FontCascade; 37 37 #endif 38 38 -
trunk/Source/WebCore/platform/text/ios/LocalizedDateCache.h
r170072 r178510 28 28 29 29 #include "DateComponents.h" 30 #include "Font .h"30 #include "FontCascade.h" 31 31 #include <wtf/HashMap.h> 32 32 #include <wtf/NeverDestroyed.h> … … 47 47 public: 48 48 NSDateFormatter *formatterForDateType(DateComponents::Type); 49 float maximumWidthForDateType(DateComponents::Type, const Font &, const MeasureTextClient&);49 float maximumWidthForDateType(DateComponents::Type, const FontCascade&, const MeasureTextClient&); 50 50 void localeChanged(); 51 51 … … 64 64 DateTypeFormatterMap m_formatterMap; 65 65 DateTypeMaxWidthMap m_maxWidthMap; 66 Font m_font;66 FontCascade m_font; 67 67 68 68 friend LocalizedDateCache& localizedDateCache(); -
trunk/Source/WebCore/platform/text/ios/LocalizedDateCache.mm
r170072 r178510 27 27 #import "LocalizedDateCache.h" 28 28 29 #import "Font .h"29 #import "FontCascade.h" 30 30 #import "TextRun.h" 31 31 #import <math.h> … … 53 53 54 54 LocalizedDateCache::LocalizedDateCache() 55 : m_font(Font())56 55 { 57 56 // Listen to CF Notifications for locale change, and clear the cache when it does. … … 85 84 } 86 85 87 float LocalizedDateCache::maximumWidthForDateType(DateComponents::Type type, const Font & font, const MeasureTextClient& measurer)86 float LocalizedDateCache::maximumWidthForDateType(DateComponents::Type type, const FontCascade& font, const MeasureTextClient& measurer) 88 87 { 89 88 int key = static_cast<int>(type); … … 92 91 return m_maxWidthMap.get(key); 93 92 } else { 94 m_font = Font (font);93 m_font = FontCascade(font); 95 94 m_maxWidthMap.clear(); 96 95 } -
trunk/Source/WebCore/rendering/EllipsisBox.cpp
r173047 r178510 22 22 23 23 #include "Document.h" 24 #include "Font .h"24 #include "FontCascade.h" 25 25 #include "GraphicsContext.h" 26 26 #include "HitTestResult.h" … … 55 55 } 56 56 57 const Font & font = lineStyle.font();57 const FontCascade& font = lineStyle.fontCascade(); 58 58 if (selectionState() != RenderObject::SelectionNone) { 59 59 paintSelection(context, paintOffset, lineStyle, font); … … 111 111 { 112 112 const RenderStyle& lineStyle = this->lineStyle(); 113 const Font & font = lineStyle.font();113 const FontCascade& font = lineStyle.fontCascade(); 114 114 const RootInlineBox& rootBox = root(); 115 115 // FIXME: Why is this always LTR? Fix by passing correct text run flags below. … … 120 120 } 121 121 122 void EllipsisBox::paintSelection(GraphicsContext* context, const LayoutPoint& paintOffset, const RenderStyle& style, const Font & font)122 void EllipsisBox::paintSelection(GraphicsContext* context, const LayoutPoint& paintOffset, const RenderStyle& style, const FontCascade& font) 123 123 { 124 124 Color textColor = style.visitedDependentColor(CSSPropertyColor); -
trunk/Source/WebCore/rendering/EllipsisBox.h
r175084 r178510 43 43 int height() const { return m_height; } 44 44 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&); 46 46 InlineBox* markupBox() const; 47 47 -
trunk/Source/WebCore/rendering/InlineFlowBox.cpp
r177955 r178510 24 24 #include "Document.h" 25 25 #include "EllipsisBox.h" 26 #include "Font .h"26 #include "FontCascade.h" 27 27 #include "GraphicsContext.h" 28 28 #include "InlineTextBox.h" … … 123 123 else if (child->behavesLikeText()) { 124 124 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()) 126 126 || parentStyle.lineHeight() != childStyle.lineHeight() 127 127 || (parentStyle.verticalAlign() != BASELINE && !isRootInlineBox()) || childStyle.verticalAlign() != BASELINE) … … 139 139 // Check the child's bit, and then also check for differences in font, line-height, vertical-align 140 140 if (!childFlowBox.descendantsHaveSameLineHeightAndBaseline() 141 || !parentStyle.font ().fontMetrics().hasIdenticalAscentDescentAndLineGap(childStyle.font().fontMetrics())141 || !parentStyle.fontCascade().fontMetrics().hasIdenticalAscentDescentAndLineGap(childStyle.fontCascade().fontMetrics()) 142 142 || parentStyle.lineHeight() != childStyle.lineHeight() 143 143 || (parentStyle.verticalAlign() != BASELINE && !isRootInlineBox()) || childStyle.verticalAlign() != BASELINE … … 389 389 if (renderText.textLength()) { 390 390 if (needsWordSpacing && isSpaceOrNewline(renderText.characterAt(textBox.start()))) 391 logicalLeft += textBox.lineStyle().font ().wordSpacing();391 logicalLeft += textBox.lineStyle().fontCascade().wordSpacing(); 392 392 needsWordSpacing = !isSpaceOrNewline(renderText.characterAt(textBox.end())); 393 393 } … … 450 450 const RenderStyle& lineStyle = this->lineStyle(); 451 451 if (lineStyle.fontDescription().nonCJKGlyphOrientation() == NonCJKGlyphOrientationUpright 452 || lineStyle.font ().primaryFontData().hasVerticalGlyphs())452 || lineStyle.fontCascade().primaryFontData().hasVerticalGlyphs()) 453 453 return true; 454 454 … … 461 461 return true; 462 462 } else { 463 if (child->lineStyle().font ().primaryFontData().hasVerticalGlyphs())463 if (child->lineStyle().fontCascade().primaryFontData().hasVerticalGlyphs()) 464 464 return true; 465 465 … … 874 874 bool emphasisMarkIsAbove; 875 875 if (lineStyle.textEmphasisMark() != TextEmphasisMarkNone && textBox.emphasisMarkExistsAndIsAbove(lineStyle, emphasisMarkIsAbove)) { 876 int emphasisMarkHeight = lineStyle.font ().emphasisMarkHeight(lineStyle.textEmphasisMarkString());876 int emphasisMarkHeight = lineStyle.fontCascade().emphasisMarkHeight(lineStyle.textEmphasisMarkString()); 877 877 if (emphasisMarkIsAbove == !lineStyle.isFlippedLinesWritingMode()) 878 878 topGlyphOverflow = std::min(topGlyphOverflow, -emphasisMarkHeight); … … 883 883 // If letter-spacing is negative, we should factor that into right layout overflow. (Even in RTL, letter-spacing is 884 884 // 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()); 886 886 887 887 LayoutUnit textShadowLogicalTop; … … 1535 1535 if (childLineStyle.textEmphasisMark() != TextEmphasisMarkNone && downcast<InlineTextBox>(*child).emphasisMarkExistsAndIsAbove(childLineStyle, emphasisMarkIsAbove) && emphasisMarkIsAbove) { 1536 1536 if (!childLineStyle.isFlippedLinesWritingMode()) { 1537 int topOfEmphasisMark = child->logicalTop() - childLineStyle.font ().emphasisMarkHeight(childLineStyle.textEmphasisMarkString());1537 int topOfEmphasisMark = child->logicalTop() - childLineStyle.fontCascade().emphasisMarkHeight(childLineStyle.textEmphasisMarkString()); 1538 1538 result = std::max(result, allowedPosition - topOfEmphasisMark); 1539 1539 } else { 1540 int bottomOfEmphasisMark = child->logicalBottom() + childLineStyle.font ().emphasisMarkHeight(childLineStyle.textEmphasisMarkString());1540 int bottomOfEmphasisMark = child->logicalBottom() + childLineStyle.fontCascade().emphasisMarkHeight(childLineStyle.textEmphasisMarkString()); 1541 1541 result = std::max(result, bottomOfEmphasisMark - allowedPosition); 1542 1542 } … … 1584 1584 if (childLineStyle.textEmphasisMark() != TextEmphasisMarkNone && !emphasisMarkIsAbove) { 1585 1585 if (!childLineStyle.isFlippedLinesWritingMode()) { 1586 LayoutUnit bottomOfEmphasisMark = child->logicalBottom() + childLineStyle.font ().emphasisMarkHeight(childLineStyle.textEmphasisMarkString());1586 LayoutUnit bottomOfEmphasisMark = child->logicalBottom() + childLineStyle.fontCascade().emphasisMarkHeight(childLineStyle.textEmphasisMarkString()); 1587 1587 result = std::max(result, bottomOfEmphasisMark - allowedPosition); 1588 1588 } else { 1589 LayoutUnit topOfEmphasisMark = child->logicalTop() - childLineStyle.font ().emphasisMarkHeight(childLineStyle.textEmphasisMarkString());1589 LayoutUnit topOfEmphasisMark = child->logicalTop() - childLineStyle.fontCascade().emphasisMarkHeight(childLineStyle.textEmphasisMarkString()); 1590 1590 result = std::max(result, allowedPosition - topOfEmphasisMark); 1591 1591 } -
trunk/Source/WebCore/rendering/InlineTextBox.cpp
r178250 r178510 246 246 } 247 247 248 static const Font & fontToUse(const RenderStyle& style, const RenderText& renderer)248 static const FontCascade& fontToUse(const RenderStyle& style, const RenderText& renderer) 249 249 { 250 250 if (style.hasTextCombine() && is<RenderCombineText>(renderer)) { … … 253 253 return textCombineRenderer.textCombineFont(); 254 254 } 255 return style.font ();255 return style.fontCascade(); 256 256 } 257 257 … … 267 267 LayoutUnit selectionHeight = this->selectionHeight(); 268 268 const RenderStyle& lineStyle = this->lineStyle(); 269 const Font & font = fontToUse(lineStyle, renderer());269 const FontCascade& font = fontToUse(lineStyle, renderer()); 270 270 271 271 String hyphenatedStringBuffer; … … 540 540 541 541 // Set our font. 542 const Font & font = fontToUse(lineStyle, renderer());542 const FontCascade& font = fontToUse(lineStyle, renderer()); 543 543 // 1. Paint backgrounds behind text if needed. Examples of such backgrounds include selection 544 544 // and composition underlines. … … 679 679 } 680 680 681 void InlineTextBox::paintSelection(GraphicsContext& context, const FloatPoint& boxOrigin, const RenderStyle& style, const Font & font, Color textColor)681 void InlineTextBox::paintSelection(GraphicsContext& context, const FloatPoint& boxOrigin, const RenderStyle& style, const FontCascade& font, Color textColor) 682 682 { 683 683 #if ENABLE(TEXT_SELECTION) … … 738 738 } 739 739 740 void InlineTextBox::paintCompositionBackground(GraphicsContext& context, const FloatPoint& boxOrigin, const RenderStyle& style, const Font & font, int startPos, int endPos)740 void InlineTextBox::paintCompositionBackground(GraphicsContext& context, const FloatPoint& boxOrigin, const RenderStyle& style, const FontCascade& font, int startPos, int endPos) 741 741 { 742 742 int offset = m_start; … … 1059 1059 } 1060 1060 1061 void InlineTextBox::paintDocumentMarker(GraphicsContext& context, const FloatPoint& boxOrigin, RenderedDocumentMarker& marker, const RenderStyle& style, const Font & font, bool grammar)1061 void InlineTextBox::paintDocumentMarker(GraphicsContext& context, const FloatPoint& boxOrigin, RenderedDocumentMarker& marker, const RenderStyle& style, const FontCascade& font, bool grammar) 1062 1062 { 1063 1063 // Never print spelling/grammar markers (5327887) … … 1129 1129 } 1130 1130 1131 void InlineTextBox::paintTextMatchMarker(GraphicsContext& context, const FloatPoint& boxOrigin, RenderedDocumentMarker& marker, const RenderStyle& style, const Font & font)1131 void InlineTextBox::paintTextMatchMarker(GraphicsContext& context, const FloatPoint& boxOrigin, RenderedDocumentMarker& marker, const RenderStyle& style, const FontCascade& font) 1132 1132 { 1133 1133 LayoutUnit selectionHeight = this->selectionHeight(); … … 1160 1160 } 1161 1161 1162 void InlineTextBox::computeRectForReplacementMarker(RenderedDocumentMarker& marker, const RenderStyle& style, const Font & font)1162 void InlineTextBox::computeRectForReplacementMarker(RenderedDocumentMarker& marker, const RenderStyle& style, const FontCascade& font) 1163 1163 { 1164 1164 // Replacement markers are not actually drawn, but their rects need to be computed for hit testing. … … 1178 1178 } 1179 1179 1180 void InlineTextBox::paintDocumentMarkers(GraphicsContext& context, const FloatPoint& boxOrigin, const RenderStyle& style, const Font & font, bool background)1180 void InlineTextBox::paintDocumentMarkers(GraphicsContext& context, const FloatPoint& boxOrigin, const RenderStyle& style, const FontCascade& font, bool background) 1181 1181 { 1182 1182 if (!renderer().textNode()) … … 1330 1330 1331 1331 const RenderStyle& lineStyle = this->lineStyle(); 1332 const Font & font = fontToUse(lineStyle, renderer());1332 const FontCascade& font = fontToUse(lineStyle, renderer()); 1333 1333 return font.offsetForPosition(constructTextRun(lineStyle, font), lineOffset - logicalLeft(), includePartialGlyphs); 1334 1334 } … … 1343 1343 1344 1344 const RenderStyle& lineStyle = this->lineStyle(); 1345 const Font & font = fontToUse(lineStyle, renderer());1345 const FontCascade& font = fontToUse(lineStyle, renderer()); 1346 1346 int from = !isLeftToRightDirection() ? offset - m_start : 0; 1347 1347 int to = !isLeftToRightDirection() ? m_len : offset - m_start; … … 1353 1353 } 1354 1354 1355 TextRun InlineTextBox::constructTextRun(const RenderStyle& style, const Font & font, String* hyphenatedStringBuffer) const1355 TextRun InlineTextBox::constructTextRun(const RenderStyle& style, const FontCascade& font, String* hyphenatedStringBuffer) const 1356 1356 { 1357 1357 ASSERT(renderer().text()); … … 1367 1367 } 1368 1368 1369 TextRun InlineTextBox::constructTextRun(const RenderStyle& style, const Font & font, String string, unsigned maximumLength, String* hyphenatedStringBuffer) const1369 TextRun InlineTextBox::constructTextRun(const RenderStyle& style, const FontCascade& font, String string, unsigned maximumLength, String* hyphenatedStringBuffer) const 1370 1370 { 1371 1371 unsigned length = string.length(); -
trunk/Source/WebCore/rendering/InlineTextBox.h
r177377 r178510 105 105 LayoutUnit selectionHeight() const; 106 106 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; 109 109 110 110 public: … … 149 149 150 150 protected: 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); 153 153 void paintCompositionUnderline(GraphicsContext&, const FloatPoint& boxOrigin, const CompositionUnderline&); 154 154 155 155 private: 156 156 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&); 160 160 161 void computeRectForReplacementMarker(RenderedDocumentMarker&, const RenderStyle&, const Font &);161 void computeRectForReplacementMarker(RenderedDocumentMarker&, const RenderStyle&, const FontCascade&); 162 162 163 163 TextRun::ExpansionBehavior expansionBehavior() const -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r178029 r178510 2326 2326 2327 2327 // 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(); 2329 2329 if (!maxCharWidth) 2330 2330 return left; … … 2366 2366 2367 2367 // 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(); 2369 2369 if (!maxCharWidth) 2370 2370 return right; … … 3004 3004 newFontDescription.setComputedSize(startingFontSize); 3005 3005 pseudoStyle->setFontDescription(newFontDescription); 3006 pseudoStyle->font ().update(pseudoStyle->font().fontSelector());3006 pseudoStyle->fontCascade().update(pseudoStyle->fontCascade().fontSelector()); 3007 3007 3008 3008 int desiredCapHeight = (pseudoStyle->initialLetterHeight() - 1) * lineHeight + paragraph->style().fontMetrics().capHeight(); … … 3013 3013 newFontDescription.setComputedSize(newFontDescription.computedSize() -1); 3014 3014 pseudoStyle->setFontDescription(newFontDescription); 3015 pseudoStyle->font ().update(pseudoStyle->font().fontSelector());3015 pseudoStyle->fontCascade().update(pseudoStyle->fontCascade().fontSelector()); 3016 3016 actualCapHeight = pseudoStyle->fontMetrics().capHeight(); 3017 3017 } … … 3694 3694 3695 3695 template <typename CharacterType> 3696 static inline TextRun constructTextRunInternal(RenderObject* context, const Font & font, const CharacterType* characters, int length, const RenderStyle& style, TextRun::ExpansionBehavior expansion)3696 static inline TextRun constructTextRunInternal(RenderObject* context, const FontCascade& font, const CharacterType* characters, int length, const RenderStyle& style, TextRun::ExpansionBehavior expansion) 3697 3697 { 3698 3698 TextDirection textDirection = LTR; … … 3709 3709 3710 3710 template <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)3711 static inline TextRun constructTextRunInternal(RenderObject* context, const FontCascade& font, const CharacterType* characters, int length, const RenderStyle& style, TextRun::ExpansionBehavior expansion, TextRunFlags flags) 3712 3712 { 3713 3713 TextDirection textDirection = LTR; … … 3728 3728 } 3729 3729 3730 TextRun RenderBlock::constructTextRun(RenderObject* context, const Font & font, const LChar* characters, int length, const RenderStyle& style, TextRun::ExpansionBehavior expansion)3730 TextRun RenderBlock::constructTextRun(RenderObject* context, const FontCascade& font, const LChar* characters, int length, const RenderStyle& style, TextRun::ExpansionBehavior expansion) 3731 3731 { 3732 3732 return constructTextRunInternal(context, font, characters, length, style, expansion); 3733 3733 } 3734 3734 3735 TextRun RenderBlock::constructTextRun(RenderObject* context, const Font & font, const UChar* characters, int length, const RenderStyle& style, TextRun::ExpansionBehavior expansion)3735 TextRun RenderBlock::constructTextRun(RenderObject* context, const FontCascade& font, const UChar* characters, int length, const RenderStyle& style, TextRun::ExpansionBehavior expansion) 3736 3736 { 3737 3737 return constructTextRunInternal(context, font, characters, length, style, expansion); 3738 3738 } 3739 3739 3740 TextRun RenderBlock::constructTextRun(RenderObject* context, const Font & font, const RenderText* text, const RenderStyle& style, TextRun::ExpansionBehavior expansion)3740 TextRun RenderBlock::constructTextRun(RenderObject* context, const FontCascade& font, const RenderText* text, const RenderStyle& style, TextRun::ExpansionBehavior expansion) 3741 3741 { 3742 3742 if (text->is8Bit()) … … 3745 3745 } 3746 3746 3747 TextRun RenderBlock::constructTextRun(RenderObject* context, const Font & font, const RenderText* text, unsigned offset, unsigned length, const RenderStyle& style, TextRun::ExpansionBehavior expansion)3747 TextRun RenderBlock::constructTextRun(RenderObject* context, const FontCascade& font, const RenderText* text, unsigned offset, unsigned length, const RenderStyle& style, TextRun::ExpansionBehavior expansion) 3748 3748 { 3749 3749 ASSERT(offset + length <= text->textLength()); … … 3753 3753 } 3754 3754 3755 TextRun RenderBlock::constructTextRun(RenderObject* context, const Font & font, const String& string, const RenderStyle& style, TextRun::ExpansionBehavior expansion, TextRunFlags flags)3755 TextRun RenderBlock::constructTextRun(RenderObject* context, const FontCascade& font, const String& string, const RenderStyle& style, TextRun::ExpansionBehavior expansion, TextRunFlags flags) 3756 3756 { 3757 3757 unsigned length = string.length(); -
trunk/Source/WebCore/rendering/RenderBlock.h
r177259 r178510 203 203 } 204 204 205 static TextRun constructTextRun(RenderObject* context, const Font &, const String&, const RenderStyle&,205 static TextRun constructTextRun(RenderObject* context, const FontCascade&, const String&, const RenderStyle&, 206 206 TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion, TextRunFlags = DefaultTextRunFlags); 207 207 208 static TextRun constructTextRun(RenderObject* context, const Font &, const RenderText*, const RenderStyle&,208 static TextRun constructTextRun(RenderObject* context, const FontCascade&, const RenderText*, const RenderStyle&, 209 209 TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion); 210 210 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&, 212 212 TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion); 213 213 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&, 215 215 TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion); 216 216 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&, 218 218 TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion); 219 219 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&, 221 221 TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion); 222 222 -
trunk/Source/WebCore/rendering/RenderBlockFlow.cpp
r177308 r178510 3948 3948 RenderText& renderText = downcast<RenderText>(*trailingSpaceChild); 3949 3949 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. 3951 3951 float spaceWidth = font.width(RenderBlock::constructTextRun(&renderText, font, &space, 1, renderText.style())); 3952 3952 inlineMax -= spaceWidth + font.wordSpacing(); -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r177398 r178510 462 462 GlyphOverflow glyphOverflow; 463 463 464 const Font & font = lineStyle(*renderer->parent(), lineInfo).font();464 const FontCascade& font = lineStyle(*renderer->parent(), lineInfo).fontCascade(); 465 465 // Always compute glyph overflow if the block's line-box-contain value is "glyphs". 466 466 if (lineBox->fitsToGlyphs()) { … … 506 506 UChar c = renderer->characterAt(wordMeasurement.startOffset); 507 507 if (i > 0 && wordLength == 1 && (c == ' ' || c == '\t')) 508 measuredWidth += renderer->style().font ().wordSpacing();508 measuredWidth += renderer->style().fontCascade().wordSpacing(); 509 509 } else 510 510 measuredWidth += wordMeasurement.width; … … 744 744 if (!isAfterExpansion) 745 745 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); 747 747 expansionOpportunities.append(opportunitiesInRun); 748 748 expansionOpportunityCount += opportunitiesInRun; … … 751 751 if (int length = renderText.textLength()) { 752 752 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(); 754 754 needsWordSpacing = !isSpaceOrNewline(renderText.characterAt(run->m_stop - 1)) && run->m_stop == length; 755 755 } … … 769 769 encounteredJustifiedRuby = true; 770 770 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); 772 772 expansionOpportunities.append(opportunitiesInRun); 773 773 expansionOpportunityCount += opportunitiesInRun; … … 1908 1908 // Determine the width of the ellipsis using the current font. 1909 1909 // 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(); 1911 1911 DEPRECATED_DEFINE_STATIC_LOCAL(AtomicString, ellipsisStr, (&horizontalEllipsis, 1)); 1912 const Font & firstLineFont = firstLineStyle().font();1912 const FontCascade& firstLineFont = firstLineStyle().fontCascade(); 1913 1913 float firstLineEllipsisWidth = firstLineFont.width(constructTextRun(this, firstLineFont, &horizontalEllipsis, 1, firstLineStyle())); 1914 1914 float ellipsisWidth = (font == firstLineFont) ? firstLineEllipsisWidth : font.width(constructTextRun(this, font, &horizontalEllipsis, 1, style())); -
trunk/Source/WebCore/rendering/RenderCombineText.cpp
r178157 r178510 58 58 } 59 59 60 float RenderCombineText::width(unsigned from, unsigned length, const Font & font, float xPosition, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const60 float RenderCombineText::width(unsigned from, unsigned length, const FontCascade& font, float xPosition, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const 61 61 { 62 62 if (m_isCombined) … … 109 109 m_isCombined = combinedTextWidth <= emWidth; 110 110 111 FontSelector* fontSelector = style().font ().fontSelector();111 FontSelector* fontSelector = style().fontCascade().fontSelector(); 112 112 113 113 if (m_isCombined) … … 118 118 for (size_t i = 0 ; i < WTF_ARRAY_LENGTH(widthVariants) ; ++i) { 119 119 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()); 121 122 compressedFont.update(fontSelector); 122 123 … … 137 138 138 139 if (shouldUpdateFont) 139 m_combineFontStyle->font ().update(fontSelector);140 m_combineFontStyle->fontCascade().update(fontSelector); 140 141 141 142 if (m_isCombined) { -
trunk/Source/WebCore/rendering/RenderCombineText.h
r178157 r178510 22 22 #define RenderCombineText_h 23 23 24 #include "Font .h"24 #include "FontCascade.h" 25 25 #include "RenderElement.h" 26 26 #include "RenderText.h" … … 39 39 void getStringToRender(int, String&, int& length) const; 40 40 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(); } 44 44 45 45 private: … … 47 47 48 48 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; 50 50 virtual const char* renderName() const override { return "RenderCombineText"; } 51 51 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override; -
trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
r177259 r178510 26 26 #include "RenderDeprecatedFlexibleBox.h" 27 27 28 #include "Font .h"28 #include "FontCascade.h" 29 29 #include "LayoutRepainter.h" 30 30 #include "RenderLayer.h" … … 998 998 DEPRECATED_DEFINE_STATIC_LOCAL(AtomicString, ellipsisStr, (&horizontalEllipsis, 1)); 999 999 const RenderStyle& lineStyle = numVisibleLines == 1 ? firstLineStyle() : style(); 1000 const Font & font = lineStyle.font();1000 const FontCascade& font = lineStyle.fontCascade(); 1001 1001 1002 1002 // 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 30 30 #include "Cursor.h" 31 31 #include "EventHandler.h" 32 #include "Font .h"32 #include "FontCascade.h" 33 33 #include "FontSelector.h" 34 34 #include "Frame.h" … … 299 299 FloatRect replacementTextRect; 300 300 FloatRect arrowRect; 301 Font font;301 FontCascade font; 302 302 TextRun run(""); 303 303 float textWidth; … … 350 350 } 351 351 352 bool RenderEmbeddedObject::getReplacementTextGeometry(const LayoutPoint& accumulatedOffset, FloatRect& contentRect, FloatRect& indicatorRect, FloatRect& replacementTextRect, FloatRect& arrowRect, Font & font, TextRun& run, float& textWidth) const352 bool RenderEmbeddedObject::getReplacementTextGeometry(const LayoutPoint& accumulatedOffset, FloatRect& contentRect, FloatRect& indicatorRect, FloatRect& replacementTextRect, FloatRect& arrowRect, FontCascade& font, TextRun& run, float& textWidth) const 353 353 { 354 354 bool includesArrow = shouldUnavailablePluginMessageBeButton(document(), m_pluginUnavailabilityReason); … … 362 362 fontDescription.setRenderingMode(frame().settings().fontRenderingMode()); 363 363 fontDescription.setComputedSize(12); 364 font = Font (fontDescription, 0, 0);364 font = FontCascade(fontDescription, 0, 0); 365 365 font.update(0); 366 366 … … 392 392 FloatRect replacementTextRect; 393 393 FloatRect arrowRect; 394 Font font;394 FontCascade font; 395 395 TextRun run("", 0); 396 396 float textWidth; … … 583 583 FloatRect replacementTextRect; 584 584 FloatRect arrowRect; 585 Font font;585 FontCascade font; 586 586 TextRun run(""); 587 587 float textWidth; -
trunk/Source/WebCore/rendering/RenderEmbeddedObject.h
r177259 r178510 87 87 bool isInUnavailablePluginIndicator(const MouseEvent&) const; 88 88 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; 90 90 LayoutRect unavailablePluginIndicatorBounds(const LayoutPoint&) const; 91 91 -
trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp
r177259 r178510 23 23 24 24 #include "FileList.h" 25 #include "Font .h"25 #include "FontCascade.h" 26 26 #include "GraphicsContext.h" 27 27 #include "HTMLInputElement.h" … … 133 133 if (paintInfo.phase == PaintPhaseForeground) { 134 134 const String& displayedFilename = fileTextValue(); 135 const Font & font = style().font();135 const FontCascade& font = style().fontCascade(); 136 136 TextRun textRun = constructTextRun(this, font, displayedFilename, style(), TextRun::AllowTrailingExpansion, RespectDirection | RespectDirectionOverride); 137 137 textRun.disableRoundingHacks(); … … 202 202 const UChar character = '0'; 203 203 const String characterAsString = String(&character, 1); 204 const Font & font = style().font();204 const FontCascade& font = style().fontCascade(); 205 205 // FIXME: Remove the need for this const_cast by making constructTextRun take a const RenderObject*. 206 206 RenderFileUploadControl* renderer = const_cast<RenderFileUploadControl*>(this); … … 272 272 #if PLATFORM(IOS) 273 273 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()); 277 277 } 278 278 -
trunk/Source/WebCore/rendering/RenderFlowThread.cpp
r177259 r178510 80 80 newStyle.get().setWidth(Length(100, Percent)); 81 81 newStyle.get().setHeight(Length(100, Percent)); 82 newStyle.get().font ().update(0);82 newStyle.get().fontCascade().update(nullptr); 83 83 return newStyle; 84 84 } -
trunk/Source/WebCore/rendering/RenderFullScreen.cpp
r177259 r178510 87 87 88 88 fullscreenStyle.get().setFontDescription(FontDescription()); 89 fullscreenStyle.get().font ().update(0);89 fullscreenStyle.get().fontCascade().update(nullptr); 90 90 91 91 fullscreenStyle.get().setDisplay(FLEX); -
trunk/Source/WebCore/rendering/RenderImage.cpp
r178250 r178510 31 31 #include "BitmapImage.h" 32 32 #include "CachedImage.h" 33 #include "Font.h"34 33 #include "FontCache.h" 34 #include "FontCascade.h" 35 35 #include "Frame.h" 36 36 #include "FrameSelection.h" … … 193 193 // we have an alt and the user meant it (its not a text we invented) 194 194 if (!m_altText.isEmpty()) { 195 const Font & font = style().font();195 const FontCascade& font = style().fontCascade(); 196 196 IntSize paddedTextSize(paddingWidth + std::min(ceilf(font.width(RenderBlock::constructTextRun(this, font, m_altText, style()))), maxAltTextWidth), paddingHeight + std::min(font.fontMetrics().height(), maxAltTextHeight)); 197 197 imageSize = imageSize.expandedTo(paddedTextSize); … … 445 445 String text = document().displayStringModifiedByEncoding(m_altText); 446 446 context->setFillColor(style().visitedDependentColor(CSSPropertyColor), style().colorSpace()); 447 const Font & font = style().font();447 const FontCascade& font = style().fontCascade(); 448 448 const FontMetrics& fontMetrics = font.fontMetrics(); 449 449 LayoutUnit ascent = fontMetrics.ascent(); -
trunk/Source/WebCore/rendering/RenderInline.cpp
r178025 r178510 217 217 || style().verticalAlign() != BASELINE 218 218 || style().textEmphasisMark() != TextEmphasisMarkNone 219 || (checkFonts && (!parentStyle->font ().fontMetrics().hasIdenticalAscentDescentAndLineGap(style().font().fontMetrics())219 || (checkFonts && (!parentStyle->fontCascade().fontMetrics().hasIdenticalAscentDescentAndLineGap(style().fontCascade().fontMetrics()) 220 220 || parentStyle->lineHeight() != style().lineHeight())) 221 221 || (flowThread && flowThread->isRenderNamedFlowThread()); // FIXME: Enable the optimization once we make overflow computation for culled inlines in regions. … … 225 225 parentStyle = &parent()->firstLineStyle(); 226 226 RenderStyle& childStyle = firstLineStyle(); 227 alwaysCreateLineBoxes = !parentStyle->font ().fontMetrics().hasIdenticalAscentDescentAndLineGap(childStyle.font().fontMetrics())227 alwaysCreateLineBoxes = !parentStyle->fontCascade().fontMetrics().hasIdenticalAscentDescentAndLineGap(childStyle.fontCascade().fontMetrics()) 228 228 || childStyle.verticalAlign() != BASELINE 229 229 || parentStyle->lineHeight() != childStyle.lineHeight(); … … 575 575 const RootInlineBox& rootBox = renderBox.inlineBoxWrapper()->root(); 576 576 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(); 579 579 if (isHorizontal) 580 580 context.addRect(FloatRect(renderBox.inlineBoxWrapper()->x() - renderBox.marginLeft(), logicalTop, renderBox.width() + renderBox.horizontalMarginExtent(), logicalHeight)); … … 591 591 const RootInlineBox& rootBox = childLine->root(); 592 592 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()); 594 594 int logicalHeight = containerStyle.fontMetrics().height(); 595 595 if (isHorizontal) { … … 611 611 const RootInlineBox& rootBox = childText->root(); 612 612 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(); 615 615 if (isHorizontal) 616 616 context.addRect(FloatRect(childText->x(), logicalTop, childText->logicalWidth(), logicalHeight)); … … 623 623 const RootInlineBox& rootBox = inlineBox->root(); 624 624 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()); 626 626 int logicalHeight = containerStyle.fontMetrics().height(); 627 627 if (isHorizontal) -
trunk/Source/WebCore/rendering/RenderListBox.cpp
r178250 r178510 113 113 HTMLElement* element = listItems[i]; 114 114 String text; 115 Font itemFont = style().font();115 FontCascade itemFont = style().fontCascade(); 116 116 if (is<HTMLOptionElement>(*element)) 117 117 text = downcast<HTMLOptionElement>(*element).textIndentedToRespectGroupLabel(); … … 120 120 FontDescription d = itemFont.fontDescription(); 121 121 d.setWeight(d.bolderWeight()); 122 itemFont = Font (d, itemFont.letterSpacing(), itemFont.wordSpacing());122 itemFont = FontCascade(d, itemFont.letterSpacing(), itemFont.wordSpacing()); 123 123 itemFont.update(document().ensureStyleResolver().fontSelector()); 124 124 } … … 348 348 } 349 349 350 static LayoutSize itemOffsetForAlignment(TextRun textRun, RenderStyle* itemStyle, Font itemFont, LayoutRect itemBoudingBox)350 static LayoutSize itemOffsetForAlignment(TextRun textRun, RenderStyle* itemStyle, FontCascade itemFont, LayoutRect itemBoudingBox) 351 351 { 352 352 ETextAlign actualAlignment = itemStyle->textAlign(); … … 401 401 402 402 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(); 404 404 LayoutRect r = itemBoundingBoxRect(paintOffset, listIndex); 405 405 r.move(itemOffsetForAlignment(textRun, itemStyle, itemFont, r)); … … 408 408 FontDescription d = itemFont.fontDescription(); 409 409 d.setWeight(d.bolderWeight()); 410 itemFont = Font (d, itemFont.letterSpacing(), itemFont.wordSpacing());410 itemFont = FontCascade(d, itemFont.letterSpacing(), itemFont.wordSpacing()); 411 411 itemFont.update(document().ensureStyleResolver().fontSelector()); 412 412 } -
trunk/Source/WebCore/rendering/RenderListMarker.cpp
r177259 r178510 27 27 28 28 #include "Document.h" 29 #include "Font .h"29 #include "FontCascade.h" 30 30 #include "GraphicsContext.h" 31 31 #include "InlineElementBox.h" … … 1315 1315 return; 1316 1316 1317 const Font & font = style().font();1317 const FontCascade& font = style().fontCascade(); 1318 1318 TextRun textRun = RenderBlock::constructTextRun(this, font, m_text, style()); 1319 1319 … … 1530 1530 } 1531 1531 1532 const Font & font = style().font();1532 const FontCascade& font = style().fontCascade(); 1533 1533 1534 1534 LayoutUnit logicalWidth = 0; … … 1758 1758 case Asterisks: 1759 1759 case Footnotes: { 1760 const Font & font = style().font();1760 const FontCascade& font = style().fontCascade(); 1761 1761 TextRun run = RenderBlock::constructTextRun(this, font, m_text, style(), TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion, DefaultTextRunFlags); 1762 1762 relativeRect = IntRect(0, 0, font.width(run), font.fontMetrics().height()); … … 1852 1852 if (m_text.isEmpty()) 1853 1853 return IntRect(); 1854 const Font & font = style().font();1854 const FontCascade& font = style().fontCascade(); 1855 1855 TextRun run = RenderBlock::constructTextRun(this, font, m_text, style(), TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion, DefaultTextRunFlags); 1856 1856 int itemWidth = font.width(run); -
trunk/Source/WebCore/rendering/RenderMenuList.cpp
r178250 r178510 197 197 adjustInnerStyle(); 198 198 199 bool fontChanged = !oldStyle || oldStyle->font () != style().font();199 bool fontChanged = !oldStyle || oldStyle->fontCascade() != style().fontCascade(); 200 200 if (fontChanged) { 201 201 updateOptionsWidth(); … … 223 223 optionWidth += minimumValueForLength(optionStyle->textIndent(), 0); 224 224 if (!text.isEmpty()) { 225 const Font & font = style().font();225 const FontCascade& font = style().fontCascade(); 226 226 TextRun run = RenderBlock::constructTextRun(this, font, text, style(), TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion, DefaultTextRunFlags); 227 227 optionWidth += font.width(run); … … 229 229 maxOptionWidth = std::max(maxOptionWidth, optionWidth); 230 230 } else if (!text.isEmpty()) { 231 const Font & font = style().font();231 const FontCascade& font = style().fontCascade(); 232 232 TextRun run = RenderBlock::constructTextRun(this, font, text, style(), TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion, DefaultTextRunFlags); 233 233 maxOptionWidth = std::max(maxOptionWidth, font.width(run)); … … 524 524 525 525 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, 527 527 style->display() == NONE, true, style->textIndent(), style->direction(), isOverride(style->unicodeBidi()), 528 528 itemHasCustomBackgroundColor ? PopupMenuStyle::CustomBackgroundColor : PopupMenuStyle::DefaultBackgroundColor) : menuStyle(); … … 565 565 IntRect absBounds = absoluteBoundingBoxRectIgnoringTransforms(); 566 566 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, 568 568 style().hasAppearance() && style().appearance() == MenulistPart, styleToUse.textIndent(), 569 569 style().direction(), isOverride(style().unicodeBidi()), PopupMenuStyle::DefaultBackgroundColor, -
trunk/Source/WebCore/rendering/RenderRubyRun.cpp
r177398 r178510 255 255 // Bopomofo. We need to move the RenderRubyText over to the right side and center it 256 256 // 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()); 259 259 setWidth(width() + distanceBetweenBase - font.letterSpacing()); 260 260 if (RenderRubyBase* rb = rubyBase()) { -
trunk/Source/WebCore/rendering/RenderSearchField.cpp
r177259 r178510 261 261 PopupMenuStyle RenderSearchField::menuStyle() const 262 262 { 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, 264 264 style().display() == NONE, true, style().textIndent(), style().direction(), isOverride(style().unicodeBidi()), PopupMenuStyle::CustomBackgroundColor); 265 265 } -
trunk/Source/WebCore/rendering/RenderText.cpp
r177860 r178510 230 230 { 231 231 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()) 234 234 return true; 235 235 if (fontDescription.isSpecifiedFont()) … … 257 257 m_useBackslashAsYenSymbol = computeUseBackslashAsYenSymbol(); 258 258 needsResetText = m_useBackslashAsYenSymbol; 259 } else if (oldStyle->font ().useBackslashAsYenSymbol() != newStyle.font().useBackslashAsYenSymbol()) {259 } else if (oldStyle->fontCascade().useBackslashAsYenSymbol() != newStyle.fontCascade().useBackslashAsYenSymbol()) { 260 260 m_useBackslashAsYenSymbol = computeUseBackslashAsYenSymbol(); 261 261 needsResetText = true; … … 452 452 } 453 453 454 ALWAYS_INLINE float RenderText::widthFromCache(const Font & f, int start, int len, float xPos, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow, const RenderStyle& style) const454 ALWAYS_INLINE float RenderText::widthFromCache(const FontCascade& f, int start, int len, float xPos, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow, const RenderStyle& style) const 455 455 { 456 456 if (style.hasTextCombine() && is<RenderCombineText>(*this)) { … … 545 545 StringImpl& text = *m_text.impl(); 546 546 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. 548 548 if (stripFrontSpaces) { 549 549 const UChar space = ' '; … … 561 561 // Compute our max widths by scanning the string for newlines. 562 562 if (hasBreak) { 563 const Font & f = style.font(); // FIXME: This ignores first-line.563 const FontCascade& f = style.fontCascade(); // FIXME: This ignores first-line. 564 564 bool firstLine = true; 565 565 beginMaxW = maxW; … … 638 638 } 639 639 640 static inline float hyphenWidth(RenderText* renderer, const Font & font)640 static inline float hyphenWidth(RenderText* renderer, const FontCascade& font) 641 641 { 642 642 const RenderStyle& style = renderer->style(); … … 644 644 } 645 645 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)646 static float maxWordFragmentWidth(RenderText* renderer, const RenderStyle& style, const FontCascade& font, StringView word, int minimumPrefixLength, unsigned minimumSuffixLength, int& suffixStart, HashSet<const SimpleFontData*>& fallbackFonts, GlyphOverflow& glyphOverflow) 647 647 { 648 648 suffixStart = 0; … … 702 702 703 703 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. 705 705 float wordSpacing = font.wordSpacing(); 706 706 int len = textLength(); … … 1216 1216 1217 1217 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) const1218 return width(from, len, lineStyle.fontCascade(), xPos, fallbackFonts, glyphOverflow); 1219 } 1220 1221 float RenderText::width(unsigned from, unsigned len, const FontCascade& f, float xPos, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const 1222 1222 { 1223 1223 ASSERT(from + len <= textLength()); … … 1227 1227 const RenderStyle& style = this->style(); 1228 1228 float w; 1229 if (&f == &style.font ()) {1229 if (&f == &style.fontCascade()) { 1230 1230 if (!style.preserveNewline() && !from && len == textLength() && (!glyphOverflow || !glyphOverflow->computeBounds)) { 1231 1231 if (fallbackFonts) { … … 1557 1557 if (isAllASCII() || m_text.is8Bit()) 1558 1558 return true; 1559 return Font ::characterRangeCodePath(characters16(), length()) == Font::Simple;1559 return FontCascade::characterRangeCodePath(characters16(), length()) == FontCascade::Simple; 1560 1560 } 1561 1561 -
trunk/Source/WebCore/rendering/RenderText.h
r177860 r178510 90 90 void positionLineBox(InlineTextBox&); 91 91 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; 93 93 virtual float width(unsigned from, unsigned len, float xPos, bool firstLine = false, HashSet<const SimpleFontData*>* fallbackFonts = 0, GlyphOverflow* = 0) const; 94 94 … … 193 193 194 194 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; 196 196 bool isAllASCII() const { return m_isAllASCII; } 197 197 bool computeUseBackslashAsYenSymbol() const; -
trunk/Source/WebCore/rendering/RenderTextControl.cpp
r177259 r178510 175 175 { 176 176 float width; 177 if (style().font ().fastAverageCharWidthIfAvailable(width))177 if (style().fontCascade().fastAverageCharWidthIfAvailable(width)) 178 178 return width; 179 179 180 180 const UChar ch = '0'; 181 181 const String str = String(&ch, 1); 182 const Font & font = style().font();182 const FontCascade& font = style().fontCascade(); 183 183 TextRun textRun = constructTextRun(this, font, str, style(), TextRun::AllowTrailingExpansion); 184 184 textRun.disableRoundingHacks(); … … 190 190 // This matches the unitsPerEm value for MS Shell Dlg and Courier New from the "head" font table. 191 191 float unitsPerEm = 2048.0f; 192 return roundf(style().font ().size() * x / unitsPerEm);192 return roundf(style().fontCascade().size() * x / unitsPerEm); 193 193 } 194 194 -
trunk/Source/WebCore/rendering/RenderTextControlMultiLine.cpp
r177259 r178510 66 66 // of Courier New, the default font for textareas in IE, Firefox and Safari Win. 67 67 // 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") 69 69 return scaleEmToUnits(1229); 70 70 #endif -
trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp
r177955 r178510 320 320 // IE for some encodings (in IE, the default font is encoding specific). 321 321 // 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") 323 323 return scaleEmToUnits(901); 324 324 #endif … … 339 339 340 340 #if !PLATFORM(IOS) 341 const AtomicString& family = style().font ().firstFamily();341 const AtomicString& family = style().fontCascade().firstFamily(); 342 342 // Since Lucida Grande is the default font, we want this to match the width 343 343 // of MS Shell Dlg, the default font for textareas in Firefox, Safari Win and … … 346 346 if (family == "Lucida Grande") 347 347 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()); 350 350 #endif 351 351 -
trunk/Source/WebCore/rendering/RenderTheme.cpp
r178124 r178510 115 115 // Border 116 116 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()); 118 118 if (borderBox.top().value() != static_cast<int>(style.borderTopWidth())) { 119 119 if (borderBox.top().value()) … … 144 144 145 145 // 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()); 147 147 if (paddingBox != style.paddingBox()) 148 148 style.setPaddingBox(paddingBox); … … 155 155 // The width and height here are affected by the zoom. 156 156 // 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()); 158 158 if (controlSize.width() != style.width()) 159 159 style.setWidth(controlSize.width()); … … 162 162 163 163 // 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()); 165 165 if (minControlSize.width() != style.minWidth()) 166 166 style.setMinWidth(minControlSize.width()); … … 169 169 170 170 // 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()) { 173 173 // Now update our font. 174 174 if (style.setFontDescription(controlFont)) 175 style.font ().update(0);175 style.fontCascade().update(0); 176 176 } 177 177 // Reset our line-height … … 1258 1258 } 1259 1259 1260 String RenderTheme::fileListNameForWidth(const FileList* fileList, const Font & font, int width, bool multipleFilesAllowed) const1260 String RenderTheme::fileListNameForWidth(const FileList* fileList, const FontCascade& font, int width, bool multipleFilesAllowed) const 1261 1261 { 1262 1262 if (width <= 0) -
trunk/Source/WebCore/rendering/RenderTheme.h
r173571 r178510 240 240 241 241 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; 243 243 244 244 enum FileUploadDecorations { SingleFile, MultipleFiles }; -
trunk/Source/WebCore/rendering/RenderThemeGtk.cpp
r178434 r178510 1644 1644 } 1645 1645 1646 String RenderThemeGtk::fileListNameForWidth(const FileList* fileList, const Font & font, int width, bool multipleFilesAllowed) const1646 String RenderThemeGtk::fileListNameForWidth(const FileList* fileList, const FontCascade& font, int width, bool multipleFilesAllowed) const 1647 1647 { 1648 1648 if (width <= 0) -
trunk/Source/WebCore/rendering/RenderThemeGtk.h
r175084 r178510 181 181 virtual bool paintInnerSpinButton(const RenderObject&, const PaintInfo&, const IntRect&) override; 182 182 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; 184 184 185 185 static void setTextInputBorders(RenderStyle&); -
trunk/Source/WebCore/rendering/RenderThemeIOS.mm
r178434 r178510 35 35 #import "Document.h" 36 36 #import "FloatRoundedRect.h" 37 #import "Font.h"38 37 #import "FontCache.h" 38 #import "FontCascade.h" 39 39 #import "Frame.h" 40 40 #import "FrameView.h" … … 546 546 class RenderThemeMeasureTextClient : public MeasureTextClient { 547 547 public: 548 RenderThemeMeasureTextClient(const Font & font, RenderObject& renderObject, const RenderStyle& style)548 RenderThemeMeasureTextClient(const FontCascade& font, RenderObject& renderObject, const RenderStyle& style) 549 549 : m_font(font) 550 550 , m_renderObject(renderObject) … … 558 558 } 559 559 private: 560 const Font & m_font;560 const FontCascade& m_font; 561 561 RenderObject& m_renderObject; 562 562 const RenderStyle& m_style; … … 578 578 579 579 // 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(); 581 581 582 582 RenderObject* renderer = inputElement.renderer(); -
trunk/Source/WebCore/rendering/RenderThemeMac.h
r173571 r178510 170 170 171 171 private: 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; 173 173 174 174 FloatRect convertToPaintingRect(const RenderObject& inputRenderer, const RenderObject& partRenderer, const FloatRect& inputRect, const IntRect&) const; -
trunk/Source/WebCore/rendering/RenderThemeMac.mm
r178434 r178510 818 818 819 819 if (style.setFontDescription(fontDescription)) 820 style.font ().update(0);820 style.fontCascade().update(0); 821 821 } 822 822 … … 1998 1998 } 1999 1999 2000 String RenderThemeMac::fileListNameForWidth(const FileList* fileList, const Font & font, int width, bool multipleFilesAllowed) const2000 String RenderThemeMac::fileListNameForWidth(const FileList* fileList, const FontCascade& font, int width, bool multipleFilesAllowed) const 2001 2001 { 2002 2002 if (width <= 0) -
trunk/Source/WebCore/rendering/RootInlineBox.cpp
r177955 r178510 902 902 const RenderStyle& boxLineStyle = box.lineStyle(); 903 903 if (usedFonts && !usedFonts->isEmpty() && (includeFont || (boxLineStyle.lineHeight().isNegative() && includeLeading))) { 904 usedFonts->append(&boxLineStyle.font ().primaryFontData());904 usedFonts->append(&boxLineStyle.fontCascade().primaryFontData()); 905 905 for (size_t i = 0; i < usedFonts->size(); ++i) { 906 906 const FontMetrics& fontMetrics = usedFonts->at(i)->fontMetrics(); … … 1018 1018 if (verticalAlign != BASELINE) { 1019 1019 const RenderStyle& parentLineStyle = firstLine ? parent->firstLineStyle() : parent->style(); 1020 const Font & font = parentLineStyle.font();1020 const FontCascade& font = parentLineStyle.fontCascade(); 1021 1021 const FontMetrics& fontMetrics = font.fontMetrics(); 1022 1022 int fontSize = font.pixelSize(); -
trunk/Source/WebCore/rendering/SimpleLineLayout.cpp
r178407 r178510 185 185 } 186 186 } 187 if (style.font ().primaryFontData().isSVGFont())187 if (style.fontCascade().primaryFontData().isSVGFont()) 188 188 return false; 189 189 // 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(); 191 191 if (primaryFontData.isLoading()) 192 192 return false; … … 195 195 || textRenderer.isSVGInlineText()) 196 196 return false; 197 if (style.font ().codePath(TextRun(textRenderer.text())) != Font::Simple)197 if (style.fontCascade().codePath(TextRun(textRenderer.text())) != FontCascade::Simple) 198 198 return false; 199 199 if (!canUseForText(textRenderer, primaryFontData)) -
trunk/Source/WebCore/rendering/SimpleLineLayoutFlowContents.cpp
r177853 r178510 35 35 36 36 FlowContents::Style::Style(const RenderStyle& style) 37 : font(style.font ())37 : font(style.fontCascade()) 38 38 , textAlign(style.textAlign()) 39 39 , collapseWhitespace(style.collapseWhiteSpace()) -
trunk/Source/WebCore/rendering/SimpleLineLayoutFlowContents.h
r177219 r178510 27 27 #define SimpleLineLayoutFlowContents_h 28 28 29 #include "Font .h"29 #include "FontCascade.h" 30 30 #include "RenderStyle.h" 31 31 #include "TextBreakIterator.h" … … 64 64 explicit Style(const RenderStyle&); 65 65 66 const Font & font;66 const FontCascade& font; 67 67 ETextAlign textAlign; 68 68 bool collapseWhitespace; -
trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp
r176317 r178510 71 71 72 72 GraphicsContext& context = *paintInfo.context; 73 const Font & font = style.font();73 const FontCascade& font = style.fontCascade(); 74 74 TextPaintStyle textPaintStyle = computeTextPaintStyle(flow.frame(), style, paintInfo); 75 75 GraphicsContextStateSaver stateSaver(context, textPaintStyle.strokeWidth > 0); -
trunk/Source/WebCore/rendering/SimpleLineLayoutResolver.cpp
r177852 r178510 121 121 , m_baseline(baselineFromFlow(flow)) 122 122 , 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()) 125 125 { 126 126 } -
trunk/Source/WebCore/rendering/TextAutoSizing.cpp
r174759 r178510 165 165 fontDescription.setComputedSize(averageSize); 166 166 style->setFontDescription(fontDescription); 167 style->font ().update(autoSizingNode->document().ensureStyleResolver().fontSelector());167 style->fontCascade().update(autoSizingNode->document().ensureStyleResolver().fontSelector()); 168 168 text->parent()->setStyle(style.releaseNonNull()); 169 169 … … 177 177 RefPtr<RenderStyle> style = cloneRenderStyleWithState(listMarkerRenderer->style()); 178 178 style->setFontDescription(fontDescription); 179 style->font ().update(autoSizingNode->document().ensureStyleResolver().fontSelector());179 style->fontCascade().update(autoSizingNode->document().ensureStyleResolver().fontSelector()); 180 180 downcast<RenderListMarker>(*listMarkerRenderer).setStyle(style.releaseNonNull()); 181 181 } … … 197 197 newParentStyle->setSpecifiedLineHeight(lineHeightLength); 198 198 newParentStyle->setFontDescription(fontDescription); 199 newParentStyle->font ().update(autoSizingNode->document().ensureStyleResolver().fontSelector());199 newParentStyle->fontCascade().update(autoSizingNode->document().ensureStyleResolver().fontSelector()); 200 200 parentRenderer->setStyle(newParentStyle.releaseNonNull()); 201 201 } … … 221 221 RefPtr<RenderStyle> style = cloneRenderStyleWithState(text->style()); 222 222 style->setFontDescription(fontDescription); 223 style->font ().update(autoSizingNode->document().ensureStyleResolver().fontSelector());223 style->fontCascade().update(autoSizingNode->document().ensureStyleResolver().fontSelector()); 224 224 text->parent()->setStyle(style.releaseNonNull()); 225 225 } … … 238 238 newParentStyle->setLineHeight(originalLineHeight); 239 239 newParentStyle->setFontDescription(fontDescription); 240 newParentStyle->font ().update(autoSizingNode->document().ensureStyleResolver().fontSelector());240 newParentStyle->fontCascade().update(autoSizingNode->document().ensureStyleResolver().fontSelector()); 241 241 parentRenderer->setStyle(newParentStyle.releaseNonNull()); 242 242 } -
trunk/Source/WebCore/rendering/TextPainter.cpp
r173941 r178510 32 32 namespace WebCore { 33 33 34 TextPainter::TextPainter(GraphicsContext& context, bool paintSelectedTextOnly, bool paintSelectedTextSeparately, const Font & font,34 TextPainter::TextPainter(GraphicsContext& context, bool paintSelectedTextOnly, bool paintSelectedTextSeparately, const FontCascade& font, 35 35 int startPositionInTextRun, int endPositionInTextBoxString, int length, const AtomicString& emphasisMark, RenderCombineText* combinedText, TextRun& textRun, 36 36 FloatRect& boxRect, FloatPoint& textOrigin, int emphasisMarkOffset, const ShadowData* textShadow, const ShadowData* selectionShadow, … … 57 57 } 58 58 59 static void drawTextOrEmphasisMarks(GraphicsContext& context, const Font & font, const TextRun& textRun, const AtomicString& emphasisMark,59 static void drawTextOrEmphasisMarks(GraphicsContext& context, const FontCascade& font, const TextRun& textRun, const AtomicString& emphasisMark, 60 60 int emphasisMarkOffset, const FloatPoint& point, const int from, const int to) 61 61 { … … 114 114 } 115 115 116 static void paintTextWithShadows(GraphicsContext& context, const Font & font, const TextRun& textRun, const AtomicString& emphasisMark,116 static void paintTextWithShadows(GraphicsContext& context, const FontCascade& font, const TextRun& textRun, const AtomicString& emphasisMark, 117 117 int emphasisMarkOffset, int startOffset, int endOffset, int truncationPoint, const FloatPoint& textOrigin, const FloatRect& boxRect, 118 118 const ShadowData* shadow, bool stroked, bool horizontal) -
trunk/Source/WebCore/rendering/TextPainter.h
r173942 r178510 45 45 class TextPainter { 46 46 public: 47 TextPainter(GraphicsContext&, bool paintSelectedTextOnly, bool paintSelectedTextSeparately, const Font &,47 TextPainter(GraphicsContext&, bool paintSelectedTextOnly, bool paintSelectedTextSeparately, const FontCascade&, 48 48 int startPositionInTextRun, int endPositionInTextBoxString, int length, const AtomicString& emphasisMark, RenderCombineText*, 49 49 TextRun&, FloatRect& boxRect, FloatPoint& textOrigin, int emphasisMarkOffset, const ShadowData* textShadow, const ShadowData* selectionShadow, … … 62 62 bool m_paintSelectedTextOnly; 63 63 bool m_paintSelectedTextSeparately; 64 const Font & m_font;64 const FontCascade& m_font; 65 65 int m_startPositionInTextRun; 66 66 int m_endPositionInTextRun; -
trunk/Source/WebCore/rendering/line/BreakingContextInlineHeaders.h
r178114 r178510 487 487 } 488 488 489 inline float measureHyphenWidth(RenderText* renderer, const Font & font, HashSet<const SimpleFontData*>* fallbackFonts = 0)489 inline float measureHyphenWidth(RenderText* renderer, const FontCascade& font, HashSet<const SimpleFontData*>* fallbackFonts = 0) 490 490 { 491 491 const RenderStyle& style = renderer->style(); … … 493 493 } 494 494 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)495 ALWAYS_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) 496 496 { 497 497 const RenderStyle& style = text->style(); … … 502 502 503 503 if (layout) 504 return Font ::width(*layout, from, len, &fallbackFonts);504 return FontCascade::width(*layout, from, len, &fallbackFonts); 505 505 506 506 TextRun run = RenderBlock::constructTextRun(text, font, text, from, len, style); … … 522 522 } 523 523 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)524 inline 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) 525 525 { 526 526 // Map 'hyphenate-limit-{before,after}: auto;' to 2. … … 616 616 617 617 const RenderStyle& style = lineStyle(*renderText.parent(), m_lineInfo); 618 const Font & font = style.font();618 const FontCascade& font = style.fontCascade(); 619 619 bool isFixedPitch = font.isFixedPitch(); 620 620 bool canHyphenate = style.hyphens() == HyphensAuto && WebCore::canHyphenate(style.locale()); 621 621 622 622 unsigned lastSpace = m_current.offset(); 623 float wordSpacing = m_currentStyle->font ().wordSpacing();623 float wordSpacing = m_currentStyle->fontCascade().wordSpacing(); 624 624 float lastSpaceWordSpacing = 0; 625 625 float wordSpacingForWordMeasurement = 0; -
trunk/Source/WebCore/rendering/line/LineBreaker.h
r160235 r178510 44 44 OwnPtr<TextLayout> m_layout; 45 45 LazyLineBreakIterator m_lineBreakIterator; 46 const Font * m_font;46 const FontCascade* m_font; 47 47 }; 48 48 -
trunk/Source/WebCore/rendering/line/LineInlineHeaders.h
r174714 r178510 57 57 if (flowStyle.lineHeight() != parentStyle.lineHeight() 58 58 || flowStyle.verticalAlign() != parentStyle.verticalAlign() 59 || !parentStyle.font ().fontMetrics().hasIdenticalAscentDescentAndLineGap(flowStyle.font().fontMetrics()))59 || !parentStyle.fontCascade().fontMetrics().hasIdenticalAscentDescentAndLineGap(flowStyle.fontCascade().fontMetrics())) 60 60 return true; 61 61 } -
trunk/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp
r177259 r178510 223 223 } 224 224 if (unit == "em") { 225 lengthValue = floatValue * style->font ().size();225 lengthValue = floatValue * style->fontCascade().size(); 226 226 return true; 227 227 } … … 294 294 } 295 295 if (length) { 296 lengthValue = length * style->font ().size() / 18;296 lengthValue = length * style->fontCascade().size() / 18; 297 297 return true; 298 298 } -
trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp
r178250 r178510 1192 1192 1193 1193 // 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; 1196 1196 } 1197 1197 … … 1230 1230 else 1231 1231 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". 1235 1235 m_maxSize = intMaxForLayoutUnit; // This sets maxsize to "infinity". 1236 1236 … … 1356 1356 if (isInvisibleOperator()) { 1357 1357 // 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); 1359 1359 float glyphWidth = advanceForGlyph(data); 1360 1360 ASSERT(glyphWidth <= m_minPreferredLogicalWidth); … … 1365 1365 } 1366 1366 1367 GlyphData data = style().font ().glyphDataForCharacter(m_textContent, !style().isLeftToRightDirection());1367 GlyphData data = style().fontCascade().glyphDataForCharacter(m_textContent, !style().isLeftToRightDirection()); 1368 1368 float maximumGlyphWidth = advanceForGlyph(data); 1369 1369 if (!m_isVertical) { … … 1522 1522 bottom.glyph = extension.glyph; 1523 1523 1524 top.fontData = &style().font ().primaryFontData();1524 top.fontData = &style().fontCascade().primaryFontData(); 1525 1525 extension.fontData = top.fontData; 1526 1526 bottom.fontData = top.fontData; … … 1539 1539 ASSERT(m_isVertical && isLargeOperatorInDisplayStyle()); 1540 1540 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()); 1543 1543 if (!primaryFontData.mathData() || baseGlyph.fontData != &primaryFontData) 1544 1544 return data; … … 1571 1571 StretchyData assemblyData; 1572 1572 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()); 1575 1575 1576 1576 if (primaryFontData.mathData() && baseGlyph.fontData == &primaryFontData) { … … 1619 1619 1620 1620 // 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); 1624 1624 GlyphData middle; 1625 1625 if (stretchyCharacter->middleChar) 1626 middle = style().font ().glyphDataForCharacter(stretchyCharacter->middleChar, false);1626 middle = style().fontCascade().glyphDataForCharacter(stretchyCharacter->middleChar, false); 1627 1627 assemblyData.setGlyphAssemblyMode(top, extension, bottom, middle); 1628 1628 } … … 1681 1681 else { 1682 1682 // 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()); 1684 1684 float baseSize = m_isVertical ? heightForGlyph(baseGlyph) : advanceForGlyph(baseGlyph); 1685 1685 if (stretchSize() <= baseSize) … … 1803 1803 GlyphBuffer buffer; 1804 1804 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); 1806 1806 1807 1807 return glyphPaintRect; … … 1899 1899 FloatRect glyphBounds = boundsForGlyph(m_stretchyData.variant()); 1900 1900 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); 1902 1902 return; 1903 1903 } … … 1981 1981 LayoutUnit RenderMathMLOperator::trailingSpaceError() 1982 1982 { 1983 const auto& primaryFontData = style().font ().primaryFontData();1983 const auto& primaryFontData = style().fontCascade().primaryFontData(); 1984 1984 if (!primaryFontData.mathData()) 1985 1985 return 0; … … 1990 1990 1991 1991 if (m_stretchyData.mode() == DrawNormal) { 1992 GlyphData data = style().font ().glyphDataForCharacter(textContent(), !style().isLeftToRightDirection());1992 GlyphData data = style().fontCascade().glyphDataForCharacter(textContent(), !style().isLeftToRightDirection()); 1993 1993 return width - advanceForGlyph(data); 1994 1994 } -
trunk/Source/WebCore/rendering/mathml/RenderMathMLRadicalOperator.cpp
r177955 r178510 64 64 void RenderMathMLRadicalOperator::stretchTo(LayoutUnit heightAboveBaseline, LayoutUnit depthBelowBaseline) 65 65 { 66 if (!style().font ().primaryFontData().mathData()) {66 if (!style().fontCascade().primaryFontData().mathData()) { 67 67 // If we do not have an OpenType MATH font, we always make the radical depth a bit larger than the target. 68 68 depthBelowBaseline += gRadicalBottomPointLower; … … 84 84 ASSERT(preferredLogicalWidthsDirty()); 85 85 86 if (style().font ().primaryFontData().mathData()) {86 if (style().fontCascade().primaryFontData().mathData()) { 87 87 RenderMathMLOperator::computePreferredLogicalWidths(); 88 88 return; … … 97 97 void RenderMathMLRadicalOperator::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues& computedValues) const 98 98 { 99 if (style().font ().primaryFontData().mathData()) {99 if (style().fontCascade().primaryFontData().mathData()) { 100 100 RenderMathMLOperator::computeLogicalHeight(logicalHeight, logicalTop, computedValues); 101 101 return; … … 112 112 return; 113 113 114 if (style().font ().primaryFontData().mathData()) {114 if (style().fontCascade().primaryFontData().mathData()) { 115 115 RenderMathMLOperator::paint(info, paintOffset); 116 116 return; -
trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp
r177955 r178510 200 200 // We set some constants to draw the radical, as defined in the OpenType MATH tables. 201 201 202 m_ruleThickness = 0.05f * style().font ().size();202 m_ruleThickness = 0.05f * style().fontCascade().size(); 203 203 204 204 // 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). 205 205 m_verticalGap = 11 * m_ruleThickness / 4; 206 206 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; 209 209 m_degreeBottomRaisePercent = 0.6f; 210 210 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()) { 213 213 // FIXME: m_verticalGap should use RadicalDisplayStyleVertical in display mode (https://bugs.webkit.org/show_bug.cgi?id=118737). 214 214 m_verticalGap = mathData->getMathConstant(primaryFontData, OpenTypeMathData::RadicalVerticalGap); -
trunk/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp
r178434 r178510 89 89 // FIXME: This should be revised when mathvariant is implemented (http://wkbug/85735) and when fonts with Mathematical Alphanumeric Symbols characters are more popular. 90 90 FontDescription fontDescription(newStyle.get().fontDescription()); 91 FontSelector* fontSelector = newStyle.get().font ().fontSelector();91 FontSelector* fontSelector = newStyle.get().fontCascade().fontSelector(); 92 92 if (!m_containsElement && element().textContent().stripWhiteSpace().simplifyWhiteSpace().length() == 1 && !tokenElement.hasAttribute(mathvariantAttr)) 93 93 fontDescription.setItalic(FontItalicOn); 94 94 if (newStyle.get().setFontDescription(fontDescription)) 95 newStyle.get().font ().update(fontSelector);95 newStyle.get().fontCascade().update(fontSelector); 96 96 } 97 97 -
trunk/Source/WebCore/rendering/style/RenderStyle.cpp
r177955 r178510 28 28 #include "CSSPropertyNames.h" 29 29 #include "FloatRoundedRect.h" 30 #include "Font .h"30 #include "FontCascade.h" 31 31 #include "FontSelector.h" 32 32 #include "InlineTextBoxStyle.h" … … 294 294 295 295 #if ENABLE(IOS_TEXT_AUTOSIZING) 296 inline unsigned computeFontHash(const Font & font)296 inline unsigned computeFontHash(const FontCascade& font) 297 297 { 298 298 unsigned hashCodes[2] = { … … 316 316 hash ^= rareInheritedData->lineBreak; 317 317 hash ^= WTF::FloatHash<float>::hash(inherited->specifiedLineHeight.value()); 318 hash ^= computeFontHash(inherited->font );318 hash ^= computeFontHash(inherited->fontCascade); 319 319 hash ^= inherited->horizontal_border_spacing; 320 320 hash ^= inherited->vertical_border_spacing; … … 340 340 && rareInheritedData->textSecurity == other->rareInheritedData->textSecurity 341 341 && inherited->specifiedLineHeight == other->inherited->specifiedLineHeight 342 && inherited->font .equalForTextAutoSizing(other->inherited->font)342 && inherited->fontCascade.equalForTextAutoSizing(other->inherited->fontCascade) 343 343 && inherited->horizontal_border_spacing == other->inherited->horizontal_border_spacing 344 344 && inherited->vertical_border_spacing == other->inherited->vertical_border_spacing … … 552 552 || inherited->specifiedLineHeight != other.inherited->specifiedLineHeight 553 553 #endif 554 || inherited->font != other.inherited->font554 || inherited->fontCascade != other.inherited->fontCascade 555 555 || inherited->horizontal_border_spacing != other.inherited->horizontal_border_spacing 556 556 || inherited->vertical_border_spacing != other.inherited->vertical_border_spacing … … 1185 1185 DEPRECATED_DEFINE_STATIC_LOCAL(AtomicString, hyphenMinusString, (&hyphenMinus, 1)); 1186 1186 DEPRECATED_DEFINE_STATIC_LOCAL(AtomicString, hyphenString, (&hyphen, 1)); 1187 return font ().primaryFontData().glyphForCharacter(hyphen) ? hyphenString : hyphenMinusString;1187 return fontCascade().primaryFontData().glyphForCharacter(hyphen) ? hyphenString : hyphenMinusString; 1188 1188 } 1189 1189 … … 1341 1341 } 1342 1342 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(); }1343 const FontCascade& RenderStyle::fontCascade() const { return inherited->fontCascade; } 1344 const FontMetrics& RenderStyle::fontMetrics() const { return inherited->fontCascade.fontMetrics(); } 1345 const FontDescription& RenderStyle::fontDescription() const { return inherited->fontCascade.fontDescription(); } 1346 1346 float RenderStyle::specifiedFontSize() const { return fontDescription().specifiedSize(); } 1347 1347 float RenderStyle::computedFontSize() const { return fontDescription().computedSize(); } 1348 int RenderStyle::fontSize() const { return inherited->font .pixelSize(); }1348 int RenderStyle::fontSize() const { return inherited->fontCascade.pixelSize(); } 1349 1349 1350 1350 const Length& RenderStyle::wordSpacing() const { return rareInheritedData->wordSpacing; } 1351 float RenderStyle::letterSpacing() const { return inherited->font .letterSpacing(); }1351 float RenderStyle::letterSpacing() const { return inherited->fontCascade.letterSpacing(); } 1352 1352 1353 1353 bool RenderStyle::setFontDescription(const FontDescription& v) 1354 1354 { 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()); 1357 1357 return true; 1358 1358 } … … 1405 1405 break; 1406 1406 case Percent: 1407 fontWordSpacing = value.percent() * font ().spaceWidth() / 100;1407 fontWordSpacing = value.percent() * fontCascade().spaceWidth() / 100; 1408 1408 break; 1409 1409 case Fixed: … … 1418 1418 break; 1419 1419 } 1420 inherited.access()->font .setWordSpacing(fontWordSpacing);1420 inherited.access()->fontCascade.setWordSpacing(fontWordSpacing); 1421 1421 rareInheritedData.access()->wordSpacing = WTF::move(value); 1422 1422 } 1423 1423 1424 void RenderStyle::setLetterSpacing(float v) { inherited.access()->font .setLetterSpacing(v); }1424 void RenderStyle::setLetterSpacing(float v) { inherited.access()->fontCascade.setLetterSpacing(v); } 1425 1425 1426 1426 void RenderStyle::setFontSize(float size) … … 1435 1435 size = std::min(maximumAllowedFontSize, size); 1436 1436 1437 FontSelector* currentFontSelector = font ().fontSelector();1437 FontSelector* currentFontSelector = fontCascade().fontSelector(); 1438 1438 FontDescription desc(fontDescription()); 1439 1439 desc.setSpecifiedSize(size); … … 1449 1449 1450 1450 setFontDescription(desc); 1451 font ().update(currentFontSelector);1451 fontCascade().update(currentFontSelector); 1452 1452 } 1453 1453 -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r178246 r178510 106 106 class CursorList; 107 107 class FilterOperations; 108 class Font ;108 class FontCascade; 109 109 class FontMetrics; 110 110 class IntRect; … … 690 690 ETableLayout tableLayout() const { return noninherited_flags.tableLayout(); } 691 691 692 WEBCORE_EXPORT const Font & font() const;692 WEBCORE_EXPORT const FontCascade& fontCascade() const; 693 693 WEBCORE_EXPORT const FontMetrics& fontMetrics() const; 694 694 WEBCORE_EXPORT const FontDescription& fontDescription() const; -
trunk/Source/WebCore/rendering/style/StyleInheritedData.cpp
r177259 r178510 51 51 , specifiedLineHeight(o.specifiedLineHeight) 52 52 #endif 53 , font (o.font)53 , fontCascade(o.fontCascade) 54 54 , color(o.color) 55 55 , visitedLinkColor(o.visitedLinkColor) … … 68 68 && specifiedLineHeight == o.specifiedLineHeight 69 69 #endif 70 && font == o.font70 && fontCascade == o.fontCascade 71 71 && color == o.color 72 72 && visitedLinkColor == o.visitedLinkColor -
trunk/Source/WebCore/rendering/style/StyleInheritedData.h
r177259 r178510 27 27 28 28 #include "Color.h" 29 #include "Font .h"29 #include "FontCascade.h" 30 30 #include "Length.h" 31 31 #include <wtf/PassRefPtr.h> … … 57 57 #endif 58 58 59 Font font;59 FontCascade fontCascade; 60 60 Color color; 61 61 Color visitedLinkColor; -
trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp
r174746 r178510 226 226 } 227 227 228 void RenderSVGInlineText::computeNewScaledFontForStyle(const RenderObject& renderer, const RenderStyle& style, float& scalingFactor, Font & scaledFont)228 void RenderSVGInlineText::computeNewScaledFontForStyle(const RenderObject& renderer, const RenderStyle& style, float& scalingFactor, FontCascade& scaledFont) 229 229 { 230 230 // Alter font-size to the right on-screen value to avoid scaling the glyphs themselves, except when GeometricPrecision is specified … … 232 232 if (scalingFactor == 1 || !scalingFactor || style.fontDescription().textRenderingMode() == GeometricPrecision) { 233 233 scalingFactor = 1; 234 scaledFont = style.font ();234 scaledFont = style.fontCascade(); 235 235 return; 236 236 } … … 241 241 fontDescription.setComputedSize(Style::computedFontSizeFromSpecifiedSizeForSVGInlineText(fontDescription.computedSize(), fontDescription.isAbsoluteSize(), scalingFactor, renderer.document())); 242 242 243 scaledFont = Font (fontDescription, 0, 0);243 scaledFont = FontCascade(fontDescription, 0, 0); 244 244 scaledFont.update(renderer.document().ensureStyleResolver().fontSelector()); 245 245 } -
trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.h
r174854 r178510 23 23 #define RenderSVGInlineText_h 24 24 25 #include "Font .h"25 #include "FontCascade.h" 26 26 #include "RenderText.h" 27 27 #include "SVGTextLayoutAttributes.h" … … 42 42 43 43 float scalingFactor() const { return m_scalingFactor; } 44 const Font & scaledFont() const { return m_scaledFont; }44 const FontCascade& scaledFont() const { return m_scaledFont; } 45 45 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); 47 47 48 48 // Preserves floating point precision for the use in DRT. It knows how to round and does a better job than enclosingIntRect. … … 66 66 67 67 float m_scalingFactor; 68 Font m_scaledFont;68 FontCascade m_scaledFont; 69 69 SVGTextLayoutAttributes m_layoutAttributes; 70 70 }; -
trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
r178250 r178510 117 117 ASSERT(scalingFactor); 118 118 119 const Font & scaledFont = renderer().scaledFont();119 const FontCascade& scaledFont = renderer().scaledFont(); 120 120 const FontMetrics& scaledFontMetrics = scaledFont.fontMetrics(); 121 121 FloatPoint textOrigin(fragment.x, fragment.y); … … 173 173 static inline bool textShouldBePainted(const RenderSVGInlineText& textRenderer) 174 174 { 175 // Font ::pixelSize(), returns FontDescription::computedPixelSize(), which returns "int(x + 0.5)".175 // FontCascade::pixelSize(), returns FontDescription::computedPixelSize(), which returns "int(x + 0.5)". 176 176 // If the absolute font size on screen is below x=0.5, don't render anything. 177 177 return textRenderer.scaledFont().pixelSize(); … … 420 420 , dirOverride() || style->rtlOrdering() == VisualOrder /* directionalOverride */); 421 421 422 if (style->font ().primaryFontData().isSVGFont())422 if (style->fontCascade().primaryFontData().isSVGFont()) 423 423 run.setRenderingContext(SVGTextRunRenderingContext::create(renderer())); 424 424 … … 476 476 } 477 477 478 static inline float thicknessForDecoration(TextDecoration, const Font & font)478 static inline float thicknessForDecoration(TextDecoration, const FontCascade& font) 479 479 { 480 480 // FIXME: For SVG Fonts we need to use the attributes defined in the <font-face> if specified. … … 536 536 537 537 float scalingFactor = 1; 538 Font scaledFont;538 FontCascade scaledFont; 539 539 RenderSVGInlineText::computeNewScaledFontForStyle(decorationRenderer, decorationStyle, scalingFactor, scaledFont); 540 540 ASSERT(scalingFactor); … … 571 571 ASSERT(scalingFactor); 572 572 573 const Font & scaledFont = renderer().scaledFont();573 const FontCascade& scaledFont = renderer().scaledFont(); 574 574 const ShadowData* shadow = style->textShadow(); 575 575 -
trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp
r174603 r178510 440 440 auto upconvertedCharacters = StringView(text->text()).upconvertedCharacters(); 441 441 const UChar* characters = upconvertedCharacters; 442 const Font & font = style->font();442 const FontCascade& font = style->fontCascade(); 443 443 444 444 SVGTextLayoutEngineSpacing spacingLayout(font); -
trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.cpp
r163440 r178510 21 21 #include "SVGTextLayoutEngineBaseline.h" 22 22 23 #include "Font .h"23 #include "FontCascade.h" 24 24 #include "RenderElement.h" 25 25 #include "SVGLengthContext.h" … … 29 29 namespace WebCore { 30 30 31 SVGTextLayoutEngineBaseline::SVGTextLayoutEngineBaseline(const Font & font)31 SVGTextLayoutEngineBaseline::SVGTextLayoutEngineBaseline(const FontCascade& font) 32 32 : m_font(font) 33 33 { -
trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngineBaseline.h
r163440 r178510 26 26 namespace WebCore { 27 27 28 class Font ;28 class FontCascade; 29 29 class RenderObject; 30 30 class SVGElement; … … 36 36 WTF_MAKE_NONCOPYABLE(SVGTextLayoutEngineBaseline); 37 37 public: 38 SVGTextLayoutEngineBaseline(const Font &);38 SVGTextLayoutEngineBaseline(const FontCascade&); 39 39 40 40 float calculateBaselineShift(const SVGRenderStyle*, SVGElement* lengthContext) const; … … 46 46 EAlignmentBaseline dominantBaselineToAlignmentBaseline(bool isVerticalText, const RenderObject* textRenderer) const; 47 47 48 const Font & m_font;48 const FontCascade& m_font; 49 49 }; 50 50 -
trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngineSpacing.cpp
r177975 r178510 21 21 #include "SVGTextLayoutEngineSpacing.h" 22 22 23 #include "Font .h"23 #include "FontCascade.h" 24 24 #include "SVGLengthContext.h" 25 25 #include "SVGRenderStyle.h" … … 33 33 namespace WebCore { 34 34 35 SVGTextLayoutEngineSpacing::SVGTextLayoutEngineSpacing(const Font & font)35 SVGTextLayoutEngineSpacing::SVGTextLayoutEngineSpacing(const FontCascade& font) 36 36 : m_font(font) 37 37 , m_lastCharacter(0) … … 99 99 float spacing = m_font.letterSpacing() + kerning; 100 100 if (currentCharacter && lastCharacter && m_font.wordSpacing()) { 101 if (Font ::treatAsSpace(*currentCharacter) && !Font::treatAsSpace(*lastCharacter))101 if (FontCascade::treatAsSpace(*currentCharacter) && !FontCascade::treatAsSpace(*lastCharacter)) 102 102 spacing += m_font.wordSpacing(); 103 103 } -
trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngineSpacing.h
r163440 r178510 25 25 namespace WebCore { 26 26 27 class Font ;27 class FontCascade; 28 28 class SVGRenderStyle; 29 29 class SVGElement; … … 33 33 WTF_MAKE_NONCOPYABLE(SVGTextLayoutEngineSpacing); 34 34 public: 35 SVGTextLayoutEngineSpacing(const Font &);35 SVGTextLayoutEngineSpacing(const FontCascade&); 36 36 37 37 float calculateSVGKerning(bool isVerticalText, const SVGTextMetrics::Glyph& currentGlyph); … … 39 39 40 40 private: 41 const Font & m_font;41 const FontCascade& m_font; 42 42 const UChar* m_lastCharacter; 43 43 -
trunk/Source/WebCore/rendering/svg/SVGTextMetrics.cpp
r177955 r178510 46 46 ASSERT(scalingFactor); 47 47 48 const Font & scaledFont = textRenderer.scaledFont();48 const FontCascade& scaledFont = textRenderer.scaledFont(); 49 49 int length = 0; 50 50 … … 71 71 , isOverride(style.unicodeBidi()) /* directionalOverride */); 72 72 73 if (style.font ().primaryFontData().isSVGFont())73 if (style.fontCascade().primaryFontData().isSVGFont()) 74 74 run.setRenderingContext(SVGTextRunRenderingContext::create(text)); 75 75 … … 92 92 SVGTextMetrics::SVGTextMetrics(RenderSVGInlineText& text, unsigned position, unsigned length, float width, const String& glyphName) 93 93 { 94 bool needsContext = text.style().font ().primaryFontData().isSVGFont();94 bool needsContext = text.style().fontCascade().primaryFontData().isSVGFont(); 95 95 float scalingFactor = text.scalingFactor(); 96 96 ASSERT(scalingFactor); -
trunk/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp
r174619 r178510 101 101 m_totalWidth = 0; 102 102 103 const Font & scaledFont = text.scaledFont();103 const FontCascade& scaledFont = text.scaledFont(); 104 104 m_run = SVGTextMetrics::constructTextRun(text); 105 m_isComplexText = scaledFont.codePath(m_run) == Font ::Complex;105 m_isComplexText = scaledFont.codePath(m_run) == FontCascade::Complex; 106 106 107 107 if (m_isComplexText) -
trunk/Source/WebCore/rendering/svg/SVGTextRunRenderingContext.cpp
r177975 r178510 53 53 } 54 54 55 float SVGTextRunRenderingContext::floatWidthUsingSVGFont(const Font & font, const TextRun& run, int& charsConsumed, String& glyphName) const55 float SVGTextRunRenderingContext::floatWidthUsingSVGFont(const FontCascade& font, const TextRun& run, int& charsConsumed, String& glyphName) const 56 56 { 57 57 WidthIterator it(&font, run); … … 291 291 } 292 292 293 static GlyphData missingGlyphForFont(const Font & font)293 static GlyphData missingGlyphForFont(const FontCascade& font) 294 294 { 295 295 const SimpleFontData& primaryFontData = font.primaryFontData(); … … 302 302 } 303 303 304 GlyphData SVGTextRunRenderingContext::glyphDataForCharacter(const Font & font, WidthIterator& iterator, UChar32 character, bool mirror, int currentCharacter, unsigned& advanceLength, String& normalizedSpacesStringCache)304 GlyphData SVGTextRunRenderingContext::glyphDataForCharacter(const FontCascade& font, WidthIterator& iterator, UChar32 character, bool mirror, int currentCharacter, unsigned& advanceLength, String& normalizedSpacesStringCache) 305 305 { 306 306 GlyphData glyphData = font.glyphDataForCharacter(character, mirror, AutoVariant); … … 343 343 FontDescription fallbackDescription = font.fontDescription(); 344 344 fallbackDescription.setFamilies(Vector<AtomicString> { sansSerifFamily }); 345 Font fallbackFont(fallbackDescription, font.letterSpacing(), font.wordSpacing());345 FontCascade fallbackFont(fallbackDescription, font.letterSpacing(), font.wordSpacing()); 346 346 fallbackFont.update(font.fontSelector()); 347 347 -
trunk/Source/WebCore/rendering/svg/SVGTextRunRenderingContext.h
r177259 r178510 22 22 #define SVGTextRunRenderingContext_h 23 23 24 #include "Font .h"24 #include "FontCascade.h" 25 25 #include "TextRun.h" 26 26 … … 43 43 void setActivePaintingResource(RenderSVGResource* object) { m_activePaintingResource = object; } 44 44 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; 46 46 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; 48 48 virtual bool applySVGKerning(const SimpleFontData*, WidthIterator&, GlyphBuffer*, int from) const override; 49 49 #endif -
trunk/Source/WebCore/style/InlineTextBoxStyle.cpp
r176298 r178510 27 27 #include "InlineTextBoxStyle.h" 28 28 29 #include "Font .h"29 #include "FontCascade.h" 30 30 #include "InlineTextBox.h" 31 31 #include "RootInlineBox.h" … … 90 90 91 91 TextDecorationStyle decorationStyle = lineStyle.textDecorationStyle(); 92 float height = lineStyle.font ().fontMetrics().floatHeight();92 float height = lineStyle.fontCascade().fontMetrics().floatHeight(); 93 93 GlyphOverflow overflowResult; 94 94 -
trunk/Source/WebCore/style/InlineTextBoxStyle.h
r176298 r178510 27 27 #define InlineTextBoxStyle_h 28 28 29 #include "Font .h"29 #include "FontCascade.h" 30 30 #include "RenderStyle.h" 31 31 -
trunk/Source/WebCore/style/StyleResolveForDocument.cpp
r177866 r178510 117 117 118 118 CSSFontSelector* fontSelector = document.styleResolverIfExists() ? document.styleResolverIfExists()->fontSelector() : nullptr; 119 documentStyle.get().font ().update(fontSelector);119 documentStyle.get().fontCascade().update(fontSelector); 120 120 121 121 return documentStyle; -
trunk/Source/WebCore/style/StyleResolveTree.cpp
r178157 r178510 979 979 StyleResolver* styleResolver = document.styleResolverIfExists(); 980 980 if (settings->fontFallbackPrefersPictographs() && styleResolver) 981 documentStyle.get().font ().update(styleResolver->fontSelector());981 documentStyle.get().fontCascade().update(styleResolver->fontSelector()); 982 982 } 983 983 -
trunk/Source/WebCore/svg/SVGFontData.cpp
r177876 r178510 281 281 return; 282 282 if (run.is8Bit()) 283 normalizedSpacesStringCache = Font ::normalizeSpaces(run.characters8(), run.charactersLength());283 normalizedSpacesStringCache = FontCascade::normalizeSpaces(run.characters8(), run.charactersLength()); 284 284 else 285 normalizedSpacesStringCache = Font ::normalizeSpaces(run.characters16(), run.charactersLength());285 normalizedSpacesStringCache = FontCascade::normalizeSpaces(run.characters16(), run.charactersLength()); 286 286 if (mirror) 287 287 normalizedSpacesStringCache = createStringWithMirroredCharacters(normalizedSpacesStringCache); -
trunk/Source/WebCore/svg/SVGFontElement.cpp
r178048 r178510 27 27 #include "Document.h" 28 28 #include "ElementIterator.h" 29 #include "Font .h"29 #include "FontCascade.h" 30 30 #include "SVGGlyphElement.h" 31 31 #include "SVGHKernElement.h" -
trunk/Source/WebCore/svg/SVGFontFaceElement.cpp
r178048 r178510 34 34 #include "Document.h" 35 35 #include "ElementIterator.h" 36 #include "Font .h"36 #include "FontCascade.h" 37 37 #include "SVGDocumentExtensions.h" 38 38 #include "SVGFontElement.h" -
trunk/Source/WebKit/mac/Misc/WebKitNSStringExtras.mm
r178305 r178510 30 30 31 31 #import <WebCore/CoreGraphicsSPI.h> 32 #import <WebCore/Font .h>32 #import <WebCore/FontCascade.h> 33 33 #import <WebCore/GraphicsContext.h> 34 34 #import <WebCore/TextRun.h> … … 93 93 CGContextScaleCTM(cgContext, 1, -1); 94 94 95 Font webCoreFont(FontPlatformData(font, [font pointSize]), ![nsContext isDrawingToScreen], fontSmoothingIsAllowed ? AutoSmoothing : Antialiased);95 FontCascade webCoreFont(FontPlatformData(font, [font pointSize]), ![nsContext isDrawingToScreen], fontSmoothingIsAllowed ? AutoSmoothing : Antialiased); 96 96 TextRun run(buffer.data(), length); 97 97 run.disableRoundingHacks(); … … 139 139 140 140 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]); 142 142 TextRun run(buffer.data(), length); 143 143 run.disableRoundingHacks(); -
trunk/Source/WebKit/mac/Misc/WebStringTruncator.mm
r178250 r178510 30 30 31 31 #import "WebSystemInterface.h" 32 #import <WebCore/Font .h>32 #import <WebCore/FontCascade.h> 33 33 #import <WebCore/FontPlatformData.h> 34 34 #import <WebCore/StringTruncator.h> … … 37 37 #import <wtf/NeverDestroyed.h> 38 38 39 static WebCore::Font & fontFromNSFont(NSFont *font)39 static WebCore::FontCascade& fontFromNSFont(NSFont *font) 40 40 { 41 41 static NeverDestroyed<RetainPtr<NSFont>> currentNSFont; 42 static NeverDestroyed<WebCore::Font > currentFont;42 static NeverDestroyed<WebCore::FontCascade> currentFont; 43 43 if ([font isEqual:currentNSFont.get().get()]) 44 44 return currentFont; 45 45 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]); 47 47 return currentFont; 48 48 } -
trunk/Source/WebKit/mac/WebCoreSupport/PopupMenuMac.mm
r177955 r178510 81 81 PopupMenuStyle style = m_client->itemStyle(i); 82 82 RetainPtr<NSMutableDictionary> attributes = adoptNS([[NSMutableDictionary alloc] init]); 83 if (style.font() != Font ()) {83 if (style.font() != FontCascade()) { 84 84 NSFont *font = style.font().primaryFontData().getNSFont(); 85 85 if (!font) { -
trunk/Source/WebKit/mac/WebView/WebView.mm
r178290 r178510 1491 1491 + (void)_setAlwaysUsesComplexTextCodePath:(BOOL)f 1492 1492 { 1493 Font ::setCodePath(f ? Font::Complex : Font::Auto);1493 FontCascade::setCodePath(f ? FontCascade::Complex : FontCascade::Auto); 1494 1494 } 1495 1495 … … 3169 3169 + (void)_setShouldUseFontSmoothing:(BOOL)f 3170 3170 { 3171 Font ::setShouldUseSmoothing(f);3171 FontCascade::setShouldUseSmoothing(f); 3172 3172 } 3173 3173 3174 3174 + (BOOL)_shouldUseFontSmoothing 3175 3175 { 3176 return Font ::shouldUseSmoothing();3176 return FontCascade::shouldUseSmoothing(); 3177 3177 } 3178 3178 … … 4711 4711 #endif 4712 4712 4713 Font ::setDefaultTypesettingFeatures([defaults boolForKey:WebKitKerningAndLigaturesEnabledByDefaultDefaultsKey] ? Kerning | Ligatures : 0);4713 FontCascade::setDefaultTypesettingFeatures([defaults boolForKey:WebKitKerningAndLigaturesEnabledByDefaultDefaultsKey] ? Kerning | Ligatures : 0); 4714 4714 4715 4715 #if !PLATFORM(IOS) -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r178124 r178510 803 803 Node* nodeToRemove; 804 804 if (RenderStyle* style = Editor::styleForSelectionStart(&frame, nodeToRemove)) { 805 CTFontRef font = style->font ().primaryFontData().getCTFont();805 CTFontRef font = style->fontCascade().primaryFontData().getCTFont(); 806 806 CTFontSymbolicTraits traits = font ? CTFontGetSymbolicTraits(font) : 0; 807 807 -
trunk/Source/WebKit2/WebProcess/WebProcess.cpp
r178151 r178510 67 67 #include <WebCore/AuthenticationChallenge.h> 68 68 #include <WebCore/CrossOriginPreflightResultCache.h> 69 #include <WebCore/Font.h>70 69 #include <WebCore/FontCache.h> 70 #include <WebCore/FontCascade.h> 71 71 #include <WebCore/Frame.h> 72 72 #include <WebCore/FrameLoader.h> … … 464 464 void WebProcess::setAlwaysUsesComplexTextCodePath(bool alwaysUseComplexText) 465 465 { 466 WebCore::Font ::setCodePath(alwaysUseComplexText ? WebCore::Font::Complex : WebCore::Font::Auto);466 WebCore::FontCascade::setCodePath(alwaysUseComplexText ? WebCore::FontCascade::Complex : WebCore::FontCascade::Auto); 467 467 } 468 468 469 469 void WebProcess::setShouldUseFontSmoothing(bool useFontSmoothing) 470 470 { 471 WebCore::Font ::setShouldUseSmoothing(useFontSmoothing);471 WebCore::FontCascade::setShouldUseSmoothing(useFontSmoothing); 472 472 } 473 473 -
trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm
r177793 r178510 45 45 #import <WebCore/CFNetworkSPI.h> 46 46 #import <WebCore/FileSystem.h> 47 #import <WebCore/Font .h>47 #import <WebCore/FontCascade.h> 48 48 #import <WebCore/LocalizedStrings.h> 49 49 #import <WebCore/MemoryCache.h> … … 195 195 m_presenterApplicationPid = parameters.presenterApplicationPid; 196 196 m_shouldForceScreenFontSubstitution = parameters.shouldForceScreenFontSubstitution; 197 Font ::setDefaultTypesettingFeatures(parameters.shouldEnableKerningAndLigaturesByDefault ? Kerning | Ligatures : 0);197 FontCascade::setDefaultTypesettingFeatures(parameters.shouldEnableKerningAndLigaturesByDefault ? Kerning | Ligatures : 0); 198 198 199 199 MemoryPressureHandler::ReliefLogger::setLoggingEnabled(parameters.shouldEnableMemoryPressureReliefLogging);
Note:
See TracChangeset
for help on using the changeset viewer.