Changeset 177955 in webkit
- Timestamp:
- Jan 6, 2015, 3:23:58 AM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 38 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r177954 r177955 1 2015-01-05 Antti Koivisto <antti@apple.com> 2 3 Font::primaryFontData() should return a reference 4 https://bugs.webkit.org/show_bug.cgi?id=140081 5 6 Reviewed by Darin Adler. 7 8 It is not null. 9 10 Also rename primaryFont() -> primaryFontData(). 11 12 * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: 13 (AXAttributeStringSetStyle): 14 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: 15 (AXAttributeStringSetStyle): 16 * bindings/objc/DOM.mm: 17 (-[DOMElement _font]): 18 * editing/cocoa/HTMLConverter.mm: 19 (_font): 20 (WebCore::editingAttributedStringFromRange): 21 * editing/ios/EditorIOS.mm: 22 (WebCore::Editor::fontForSelection): 23 (WebCore::Editor::fontAttributesForSelectionStart): 24 * editing/mac/EditorMac.mm: 25 (WebCore::Editor::fontForSelection): 26 (WebCore::Editor::fontAttributesForSelectionStart): 27 * platform/graphics/Font.cpp: 28 (WebCore::Font::fastAverageCharWidthIfAvailable): 29 * platform/graphics/Font.h: 30 (WebCore::Font::fontMetrics): 31 (WebCore::Font::spaceWidth): 32 (WebCore::Font::tabWidth): 33 (WebCore::Font::primaryFontData): 34 (WebCore::Font::primaryFont): Deleted. 35 * platform/graphics/FontFastPath.cpp: 36 (WebCore::Font::primaryFontHasGlyphForCharacter): 37 * platform/graphics/FontGlyphs.cpp: 38 (WebCore::FontGlyphs::determinePitch): 39 (WebCore::FontGlyphs::glyphDataForSystemFallback): 40 (WebCore::FontGlyphs::glyphDataForCharacter): 41 * platform/graphics/FontGlyphs.h: 42 (WebCore::FontGlyphs::primaryFontData): 43 (WebCore::FontGlyphs::primarySimpleFontData): 44 * platform/graphics/WidthIterator.cpp: 45 (WebCore::WidthIterator::advanceInternal): 46 * platform/graphics/mac/ComplexTextController.cpp: 47 (WebCore::ComplexTextController::advance): 48 (WebCore::ComplexTextController::adjustGlyphsAndAdvances): 49 * platform/graphics/mac/ComplexTextController.h: 50 (WebCore::ComplexTextController::ComplexTextRun::create): 51 (WebCore::ComplexTextController::ComplexTextRun::fontData): 52 * platform/graphics/mac/ComplexTextControllerCoreText.mm: 53 (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): 54 (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): 55 * platform/graphics/mac/FontMac.mm: 56 (WebCore::Font::primaryFontDataIsSystemFont): 57 * platform/graphics/opentype/OpenTypeMathData.cpp: 58 * platform/graphics/opentype/OpenTypeMathData.h: 59 * rendering/InlineFlowBox.cpp: 60 (WebCore::InlineFlowBox::requiresIdeographicBaseline): 61 * rendering/InlineTextBox.cpp: 62 (WebCore::InlineTextBox::constructTextRun): 63 * rendering/RenderBlock.cpp: 64 (WebCore::RenderBlock::adjustLogicalLeftOffsetForLine): 65 (WebCore::RenderBlock::adjustLogicalRightOffsetForLine): 66 (WebCore::constructTextRunInternal): 67 * rendering/RenderTextControlSingleLine.cpp: 68 (WebCore::RenderTextControlSingleLine::preferredContentLogicalWidth): 69 * rendering/RenderThemeIOS.mm: 70 (WebCore::adjustInputElementButtonStyle): 71 * rendering/RootInlineBox.cpp: 72 (WebCore::RootInlineBox::ascentAndDescentForBox): 73 * rendering/SimpleLineLayout.cpp: 74 (WebCore::SimpleLineLayout::canUseFor): 75 * rendering/mathml/RenderMathMLOperator.cpp: 76 (WebCore::RenderMathMLOperator::getGlyphAssemblyFallBack): 77 (WebCore::RenderMathMLOperator::getDisplayStyleLargeOperator): 78 (WebCore::RenderMathMLOperator::findStretchyData): 79 (WebCore::RenderMathMLOperator::trailingSpaceError): 80 * rendering/mathml/RenderMathMLRadicalOperator.cpp: 81 (WebCore::RenderMathMLRadicalOperator::stretchTo): 82 (WebCore::RenderMathMLRadicalOperator::computePreferredLogicalWidths): 83 (WebCore::RenderMathMLRadicalOperator::computeLogicalHeight): 84 (WebCore::RenderMathMLRadicalOperator::paint): 85 * rendering/mathml/RenderMathMLRoot.cpp: 86 (WebCore::RenderMathMLRoot::updateStyle): 87 * rendering/svg/SVGInlineTextBox.cpp: 88 (WebCore::SVGInlineTextBox::constructTextRun): 89 * rendering/svg/SVGTextLayoutEngineSpacing.cpp: 90 (WebCore::SVGTextLayoutEngineSpacing::calculateSVGKerning): 91 * rendering/svg/SVGTextMetrics.cpp: 92 (WebCore::SVGTextMetrics::constructTextRun): 93 (WebCore::SVGTextMetrics::SVGTextMetrics): 94 * rendering/svg/SVGTextRunRenderingContext.cpp: 95 (WebCore::missingGlyphForFont): 96 (WebCore::SVGTextRunRenderingContext::glyphDataForCharacter): 97 1 98 2015-01-06 Shivakumar JM <shiva.jm@samsung.com> 2 99 -
trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
r176948 r177955 1759 1759 1760 1760 // set basic font info 1761 AXAttributeStringSetFont(attrString, style.font().primaryFont ()->getCTFont(), range);1761 AXAttributeStringSetFont(attrString, style.font().primaryFontData().getCTFont(), range); 1762 1762 1763 1763 int decor = style.textDecorationsInEffect(); -
trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
r177536 r177955 849 849 850 850 // set basic font info 851 AXAttributeStringSetFont(attrString, NSAccessibilityFontTextAttribute, style.font().primaryFont ()->getNSFont(), range);851 AXAttributeStringSetFont(attrString, NSAccessibilityFontTextAttribute, style.font().primaryFontData().getNSFont(), range); 852 852 853 853 // set basic colors -
trunk/Source/WebCore/bindings/objc/DOM.mm
r177297 r177955 670 670 if (!renderer) 671 671 return nil; 672 return renderer->style().font().primaryFont ()->getNSFont();672 return renderer->style().font().primaryFontData().getNSFont(); 673 673 } 674 674 #else … … 678 678 if (!renderer) 679 679 return nil; 680 return renderer->style().font().primaryFont ()->getCTFont();680 return renderer->style().font().primaryFontData().getCTFont(); 681 681 } 682 682 #endif -
trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm
r176910 r177955 1115 1115 if (!renderer) 1116 1116 return nil; 1117 return renderer->style().font().primaryFont ()->getNSFont();1117 return renderer->style().font().primaryFontData().getNSFont(); 1118 1118 } 1119 1119 #else … … 1123 1123 if (!renderer) 1124 1124 return nil; 1125 return (PlatformFont *)renderer->style().font().primaryFont ()->getCTFont();1125 return (PlatformFont *)renderer->style().font().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().primaryFont ()->getNSFont())2597 if (NSFont *font = style.font().primaryFontData().getNSFont()) 2598 2598 [attrs.get() setObject:font forKey:NSFontAttributeName]; 2599 2599 else 2600 [attrs.get() setObject:[fontManager convertFont:WebDefaultFont() toSize:style.font().primaryFont ()->platformData().size()] forKey:NSFontAttributeName];2600 [attrs.get() setObject:[fontManager convertFont:WebDefaultFont() toSize:style.font().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
r175549 r177955 212 212 RenderStyle* style = styleForSelectionStart(&m_frame, nodeToRemove); // sets nodeToRemove 213 213 214 const SimpleFontData* result = 0;214 const SimpleFontData* result = nullptr; 215 215 if (style) 216 result = style->font().primaryFont();216 result = &style->font().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().primaryFont();238 const SimpleFontData& primaryFont = renderer->style().font().primaryFontData(); 239 239 if (!font) 240 font = primaryFont;241 else if (font != primaryFont) {240 font = &primaryFont; 241 else if (font != &primaryFont) { 242 242 hasMultipleFonts = true; 243 243 break; … … 258 258 NSMutableDictionary* result = [NSMutableDictionary dictionary]; 259 259 260 CTFontRef font = style->font().primaryFont ()->getCTFont();260 CTFontRef font = style->font().primaryFontData().getCTFont(); 261 261 if (font) 262 262 [result setObject:(id)font forKey:NSFontAttributeName]; -
trunk/Source/WebCore/editing/mac/EditorMac.mm
r175549 r177955 114 114 RenderStyle* style = styleForSelectionStart(&m_frame, nodeToRemove); // sets nodeToRemove 115 115 116 const SimpleFontData* result = 0;116 const SimpleFontData* result = nullptr; 117 117 if (style) 118 result = style->font().primaryFont();118 result = &style->font().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().primaryFont();138 const SimpleFontData& primaryFont = renderer->style().font().primaryFontData(); 139 139 if (!font) 140 font = primaryFont;141 else if (font != primaryFont) {140 font = &primaryFont; 141 else if (font != &primaryFont) { 142 142 hasMultipleFonts = true; 143 143 break; … … 161 161 [result setObject:nsColor(style->visitedDependentColor(CSSPropertyBackgroundColor)) forKey:NSBackgroundColorAttributeName]; 162 162 163 if (style->font().primaryFont ()->getNSFont())164 [result setObject:style->font().primaryFont ()->getNSFont() forKey:NSFontAttributeName];163 if (style->font().primaryFontData().getNSFont()) 164 [result setObject:style->font().primaryFontData().getNSFont() forKey:NSFontAttributeName]; 165 165 166 166 if (style->visitedDependentColor(CSSPropertyColor).isValid() && style->visitedDependentColor(CSSPropertyColor) != Color::black) -
trunk/Source/WebCore/platform/graphics/Font.cpp
r177262 r177955 507 507 bool success = hasValidAverageCharWidth(); 508 508 if (success) 509 width = roundf(primaryFont ()->avgCharWidth()); // FIXME: primaryFont() might not correspond to firstFamily().509 width = roundf(primaryFontData().avgCharWidth()); // FIXME: primaryFontData() might not correspond to firstFamily(). 510 510 return success; 511 511 } -
trunk/Source/WebCore/platform/graphics/Font.h
r177490 r177955 173 173 bool isPlatformFont() const { return m_glyphs->isForPlatformFont(); } 174 174 175 const FontMetrics& fontMetrics() const { return primaryFont ()->fontMetrics(); }176 float spaceWidth() const { return primaryFont ()->spaceWidth() + m_letterSpacing; }175 const FontMetrics& fontMetrics() const { return primaryFontData().fontMetrics(); } 176 float spaceWidth() const { return primaryFontData().spaceWidth() + m_letterSpacing; } 177 177 float tabWidth(const SimpleFontData&, unsigned tabSize, float position) const; 178 float tabWidth(unsigned tabSize, float position) const { return tabWidth( *primaryFont(), tabSize, position); }178 float tabWidth(unsigned tabSize, float position) const { return tabWidth(primaryFontData(), tabSize, position); } 179 179 bool hasValidAverageCharWidth() const; 180 180 bool fastAverageCharWidthIfAvailable(float &width) const; // returns true on success … … 184 184 int emphasisMarkHeight(const AtomicString&) const; 185 185 186 const SimpleFontData * primaryFont() const;186 const SimpleFontData& primaryFontData() const; 187 187 const FontData* fontDataAt(unsigned) const; 188 188 GlyphData glyphDataForCharacter(UChar32 c, bool mirror, FontDataVariant variant = AutoVariant) const … … 193 193 const SimpleFontData* fontDataForCombiningCharacterSequence(const UChar*, size_t length, FontDataVariant) const; 194 194 #endif 195 bool primaryFontHasGlyphForCharacter(UChar32) const;196 195 197 196 static bool isCJKIdeograph(UChar32); … … 358 357 } 359 358 360 inline const SimpleFontData * Font::primaryFont() const359 inline const SimpleFontData& Font::primaryFontData() const 361 360 { 362 361 ASSERT(m_glyphs); -
trunk/Source/WebCore/platform/graphics/FontFastPath.cpp
r177876 r177955 40 40 41 41 namespace WebCore { 42 43 bool Font::primaryFontHasGlyphForCharacter(UChar32 character) const44 {45 return primaryFont()->glyphForCharacter(character);46 }47 42 48 43 // FIXME: This function may not work if the emphasis mark uses a complex script, but none of the -
trunk/Source/WebCore/platform/graphics/FontGlyphs.cpp
r177881 r177955 76 76 void FontGlyphs::determinePitch(const FontDescription& description) 77 77 { 78 const FontData * fontData = primaryFontData(description);79 if (is<SimpleFontData>( *fontData))80 m_pitch = downcast<SimpleFontData>( *fontData).pitch();78 const FontData& fontData = *realizeFontDataAt(description, 0); 79 if (is<SimpleFontData>(fontData)) 80 m_pitch = downcast<SimpleFontData>(fontData).pitch(); 81 81 else { 82 const SegmentedFontData& segmentedFontData = downcast<SegmentedFontData>( *fontData);82 const SegmentedFontData& segmentedFontData = downcast<SegmentedFontData>(fontData); 83 83 unsigned numRanges = segmentedFontData.numRanges(); 84 84 if (numRanges == 1) … … 246 246 { 247 247 // System fallback is character-dependent. 248 auto* originalFontData = primaryFontData(description)->simpleFontDataForCharacter(c); 248 auto& primaryFontData = *realizeFontDataAt(description, 0); 249 auto* originalFontData = primaryFontData.simpleFontDataForCharacter(c); 249 250 if (!originalFontData) 250 originalFontData = &primaryFontData (description)->simpleFontDataForFirstRange();251 originalFontData = &primaryFontData.simpleFontDataForFirstRange(); 251 252 252 253 RefPtr<SimpleFontData> systemFallbackFontData = originalFontData->systemFallbackFontDataForCharacter(c, description, m_isForPlatformFont); … … 365 366 366 367 if (variant == AutoVariant) { 367 if (description.smallCaps() && !primarySimpleFontData(description) ->isSVGFont()) {368 if (description.smallCaps() && !primarySimpleFontData(description).isSVGFont()) { 368 369 UChar32 upperC = u_toupper(c); 369 370 if (upperC != c) { … … 386 387 RefPtr<GlyphPage>& cachedPage = pageNumber ? m_cachedPages.add(pageNumber, nullptr).iterator->value : m_cachedPageZero; 387 388 if (!cachedPage) 388 cachedPage = glyphPageFromFontData(pageNumber, * primaryFontData(description));389 cachedPage = glyphPageFromFontData(pageNumber, *realizeFontDataAt(description, 0)); 389 390 390 391 GlyphData glyphData = cachedPage ? cachedPage->glyphDataForCharacter(c) : GlyphData(); -
trunk/Source/WebCore/platform/graphics/FontGlyphs.h
r177876 r177955 68 68 const WidthCache& widthCache() const { return m_widthCache; } 69 69 70 const SimpleFontData* primarySimpleFontData(const FontDescription&); 71 const FontData* primaryFontData(const FontDescription& description) { return realizeFontDataAt(description, 0); } 70 const SimpleFontData& primarySimpleFontData(const FontDescription&); 72 71 WEBCORE_EXPORT const FontData* realizeFontDataAt(const FontDescription&, unsigned index); 73 72 … … 107 106 }; 108 107 109 inline const SimpleFontData *FontGlyphs::primarySimpleFontData(const FontDescription& description)108 inline const SimpleFontData& FontGlyphs::primarySimpleFontData(const FontDescription& description) 110 109 { 111 110 ASSERT(isMainThread()); 112 111 if (!m_cachedPrimarySimpleFontData) { 113 auto * fontData = primaryFontData(description);114 m_cachedPrimarySimpleFontData = fontData ->simpleFontDataForCharacter(' ');112 auto& fontData = *realizeFontDataAt(description, 0); 113 m_cachedPrimarySimpleFontData = fontData.simpleFontDataForCharacter(' '); 115 114 if (!m_cachedPrimarySimpleFontData) 116 m_cachedPrimarySimpleFontData = &fontData ->simpleFontDataForFirstRange();115 m_cachedPrimarySimpleFontData = &fontData.simpleFontDataForFirstRange(); 117 116 } 118 return m_cachedPrimarySimpleFontData;117 return *m_cachedPrimarySimpleFontData; 119 118 } 120 119 -
trunk/Source/WebCore/platform/graphics/WidthIterator.cpp
r177637 r177955 167 167 FloatRect bounds; 168 168 169 const SimpleFontData * primaryFont = m_font->primaryFont();170 const SimpleFontData* lastFontData = primaryFont;169 const SimpleFontData& primaryFontData = m_font->primaryFontData(); 170 const SimpleFontData* lastFontData = &primaryFontData; 171 171 int lastGlyphCount = glyphBuffer ? glyphBuffer->size() : 0; 172 172 … … 212 212 213 213 lastFontData = fontData; 214 if (m_fallbackFonts && fontData != primaryFont) {214 if (m_fallbackFonts && fontData != &primaryFontData) { 215 215 // FIXME: This does a little extra work that could be avoided if 216 216 // glyphDataForCharacter() returned whether it chose to use a small caps font. … … 219 219 else { 220 220 const GlyphData& uppercaseGlyphData = m_font->glyphDataForCharacter(u_toupper(character), rtl); 221 if (uppercaseGlyphData.fontData != primaryFont)221 if (uppercaseGlyphData.fontData != &primaryFontData) 222 222 m_fallbackFonts->add(uppercaseGlyphData.fontData); 223 223 } -
trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp
r175824 r177955 495 495 unsigned g = ltr ? m_glyphInCurrentRun : glyphCount - 1 - m_glyphInCurrentRun; 496 496 unsigned k = leftmostGlyph + g; 497 if (fallbackFonts && complexTextRun.fontData() != m_font.primaryFont())498 fallbackFonts->add( complexTextRun.fontData());497 if (fallbackFonts && &complexTextRun.fontData() != &m_font.primaryFontData()) 498 fallbackFonts->add(&complexTextRun.fontData()); 499 499 500 500 // We must store the initial advance for the first glyph we are going to draw. … … 521 521 522 522 if (glyphBuffer && !m_characterInCurrentGlyph) 523 glyphBuffer->add(m_adjustedGlyphs[k], complexTextRun.fontData(), adjustedAdvance, complexTextRun.indexAt(m_glyphInCurrentRun));523 glyphBuffer->add(m_adjustedGlyphs[k], &complexTextRun.fontData(), adjustedAdvance, complexTextRun.indexAt(m_glyphInCurrentRun)); 524 524 525 525 unsigned oldCharacterInCurrentGlyph = m_characterInCurrentGlyph; … … 567 567 ComplexTextRun& complexTextRun = *m_complexTextRuns[r]; 568 568 unsigned glyphCount = complexTextRun.glyphCount(); 569 const SimpleFontData *fontData = complexTextRun.fontData();569 const SimpleFontData& fontData = complexTextRun.fontData(); 570 570 #if PLATFORM(IOS) 571 bool isEmoji = fontData ->platformData().m_isEmoji;571 bool isEmoji = fontData.platformData().m_isEmoji; 572 572 #endif 573 573 … … 589 589 590 590 bool lastRun = r + 1 == runCount; 591 bool roundsAdvances = !m_font.isPrinterFont() && fontData ->platformData().roundsGlyphAdvances();592 float spaceWidth = fontData ->spaceWidth() - fontData->syntheticBoldOffset();591 bool roundsAdvances = !m_font.isPrinterFont() && fontData.platformData().roundsGlyphAdvances(); 592 float spaceWidth = fontData.spaceWidth() - fontData.syntheticBoldOffset(); 593 593 CGFloat roundedSpaceWidth = roundCGFloat(spaceWidth); 594 594 const UChar* cp = complexTextRun.characters(); … … 617 617 618 618 bool treatAsSpace = Font::treatAsSpace(ch); 619 CGGlyph glyph = treatAsSpace ? fontData ->spaceGlyph() : glyphs[i];619 CGGlyph glyph = treatAsSpace ? fontData.spaceGlyph() : glyphs[i]; 620 620 CGSize advance = treatAsSpace ? CGSizeMake(spaceWidth, advances[i].height) : advances[i]; 621 621 #if PLATFORM(IOS) … … 625 625 626 626 if (ch == '\t' && m_run.allowTabs()) 627 advance.width = m_font.tabWidth( *fontData, m_run.tabSize(), m_run.xPos() + m_totalWidth + widthSinceLastCommit);627 advance.width = m_font.tabWidth(fontData, m_run.tabSize(), m_run.xPos() + m_totalWidth + widthSinceLastCommit); 628 628 else if (Font::treatAsZeroWidthSpace(ch) && !treatAsSpace) { 629 629 advance.width = 0; 630 glyph = fontData ->spaceGlyph();630 glyph = fontData.spaceGlyph(); 631 631 } 632 632 … … 635 635 advance.width = roundedAdvanceWidth; 636 636 637 advance.width += fontData ->syntheticBoldOffset();637 advance.width += fontData.syntheticBoldOffset(); 638 638 639 639 … … 642 642 // Second, in fixed-pitch fonts we ensure that all glyphs that 643 643 // match the width of the space glyph have the same width as the space glyph. 644 if (m_run.applyWordRounding() && roundedAdvanceWidth == roundedSpaceWidth && (fontData ->pitch() == FixedPitch || glyph == fontData->spaceGlyph()))645 advance.width = fontData ->adjustedSpaceWidth();644 if (m_run.applyWordRounding() && roundedAdvanceWidth == roundedSpaceWidth && (fontData.pitch() == FixedPitch || glyph == fontData.spaceGlyph())) 645 advance.width = fontData.adjustedSpaceWidth(); 646 646 647 647 if (hasExtraSpacing) { … … 717 717 m_adjustedGlyphs.append(glyph); 718 718 719 FloatRect glyphBounds = fontData ->boundsForGlyph(glyph);719 FloatRect glyphBounds = fontData.boundsForGlyph(glyph); 720 720 glyphBounds.move(glyphOrigin.x, glyphOrigin.y); 721 721 m_minGlyphBoundingBoxX = std::min(m_minGlyphBoundingBoxX, glyphBounds.x()); -
trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.h
r177733 r177955 74 74 class ComplexTextRun : public RefCounted<ComplexTextRun> { 75 75 public: 76 static Ref<ComplexTextRun> create(CTRunRef ctRun, const SimpleFontData *fontData, const UChar* characters, unsigned stringLocation, size_t stringLength, CFRange runRange)76 static Ref<ComplexTextRun> create(CTRunRef ctRun, const SimpleFontData& fontData, const UChar* characters, unsigned stringLocation, size_t stringLength, CFRange runRange) 77 77 { 78 78 return adoptRef(*new ComplexTextRun(ctRun, fontData, characters, stringLocation, stringLength, runRange)); 79 79 } 80 80 81 static Ref<ComplexTextRun> create(const SimpleFontData *fontData, const UChar* characters, unsigned stringLocation, size_t stringLength, bool ltr)81 static Ref<ComplexTextRun> create(const SimpleFontData& fontData, const UChar* characters, unsigned stringLocation, size_t stringLength, bool ltr) 82 82 { 83 83 return adoptRef(*new ComplexTextRun(fontData, characters, stringLocation, stringLength, ltr)); … … 85 85 86 86 unsigned glyphCount() const { return m_glyphCount; } 87 const SimpleFontData *fontData() const { return m_fontData; }87 const SimpleFontData& fontData() const { return m_fontData; } 88 88 const UChar* characters() const { return m_characters; } 89 89 unsigned stringLocation() const { return m_stringLocation; } … … 101 101 102 102 private: 103 ComplexTextRun(CTRunRef, const SimpleFontData *, const UChar* characters, unsigned stringLocation, size_t stringLength, CFRange runRange);104 ComplexTextRun(const SimpleFontData *, const UChar* characters, unsigned stringLocation, size_t stringLength, bool ltr);103 ComplexTextRun(CTRunRef, const SimpleFontData&, const UChar* characters, unsigned stringLocation, size_t stringLength, CFRange runRange); 104 ComplexTextRun(const SimpleFontData&, const UChar* characters, unsigned stringLocation, size_t stringLength, bool ltr); 105 105 106 106 unsigned m_glyphCount; 107 const SimpleFontData *m_fontData;107 const SimpleFontData& m_fontData; 108 108 const UChar* m_characters; 109 109 unsigned m_stringLocation; -
trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm
r177876 r177955 95 95 namespace WebCore { 96 96 97 ComplexTextController::ComplexTextRun::ComplexTextRun(CTRunRef ctRun, const SimpleFontData *fontData, const UChar* characters, unsigned stringLocation, size_t stringLength, CFRange runRange)97 ComplexTextController::ComplexTextRun::ComplexTextRun(CTRunRef ctRun, const SimpleFontData& fontData, const UChar* characters, unsigned stringLocation, size_t stringLength, CFRange runRange) 98 98 : m_fontData(fontData) 99 99 , m_characters(characters) … … 131 131 // Missing glyphs run constructor. Core Text will not generate a run of missing glyphs, instead falling back on 132 132 // glyphs from LastResort. We want to use the primary font's missing glyph in order to match the fast text code path. 133 ComplexTextController::ComplexTextRun::ComplexTextRun(const SimpleFontData *fontData, const UChar* characters, unsigned stringLocation, size_t stringLength, bool ltr)133 ComplexTextController::ComplexTextRun::ComplexTextRun(const SimpleFontData& fontData, const UChar* characters, unsigned stringLocation, size_t stringLength, bool ltr) 134 134 : m_fontData(fontData) 135 135 , m_characters(characters) … … 164 164 m_glyphsVector.fill(0, m_glyphCount); 165 165 m_glyphs = m_glyphsVector.data(); 166 m_advancesVector.fill(CGSizeMake(m_fontData ->widthForGlyph(0), 0), m_glyphCount);166 m_advancesVector.fill(CGSizeMake(m_fontData.widthForGlyph(0), 0), m_glyphCount); 167 167 m_advances = m_advancesVector.data(); 168 168 } … … 189 189 if (!fontData) { 190 190 // Create a run of missing glyphs from the primary font. 191 m_complexTextRuns.append(ComplexTextRun::create(m_font.primaryFont (), cp, stringLocation, length, m_run.ltr()));191 m_complexTextRuns.append(ComplexTextRun::create(m_font.primaryFontData(), cp, stringLocation, length, m_run.ltr())); 192 192 return; 193 193 } … … 274 274 RetainPtr<CFStringRef> fontName = adoptCF(CTFontCopyPostScriptName(runFont)); 275 275 if (CFEqual(fontName.get(), CFSTR("LastResort"))) { 276 m_complexTextRuns.append(ComplexTextRun::create(m_font.primaryFont (), cp, stringLocation + runRange.location, runRange.length, m_run.ltr()));276 m_complexTextRuns.append(ComplexTextRun::create(m_font.primaryFontData(), cp, stringLocation + runRange.location, runRange.length, m_run.ltr())); 277 277 continue; 278 278 } … … 290 290 #endif 291 291 } 292 if (m_fallbackFonts && runFontData != m_font.primaryFont())292 if (m_fallbackFonts && runFontData != &m_font.primaryFontData()) 293 293 m_fallbackFonts->add(runFontData); 294 294 } 295 295 } 296 if (m_fallbackFonts && runFontData != m_font.primaryFont())296 if (m_fallbackFonts && runFontData != &m_font.primaryFontData()) 297 297 m_fallbackFonts->add(fontData); 298 298 299 m_complexTextRuns.append(ComplexTextRun::create(ctRun, runFontData, cp, stringLocation, length, runRange));299 m_complexTextRuns.append(ComplexTextRun::create(ctRun, *runFontData, cp, stringLocation, length, runRange)); 300 300 } 301 301 } -
trunk/Source/WebCore/platform/graphics/mac/FontMac.mm
r177527 r177955 594 594 { 595 595 #if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED > 1090 596 const auto * fontData = primaryFont();597 return !fontData ->isSVGFont() && CTFontDescriptorIsSystemUIFont(adoptCF(CTFontCopyFontDescriptor(fontData->platformData().ctFont())).get());596 const auto& fontData = primaryFontData(); 597 return !fontData.isSVGFont() && CTFontDescriptorIsSystemUIFont(adoptCF(CTFontCopyFontDescriptor(fontData.platformData().ctFont())).get()); 598 598 #else 599 599 // System fonts are hidden by having a name that begins with a period, so simply search -
trunk/Source/WebCore/platform/graphics/opentype/OpenTypeMathData.cpp
r171989 r177955 266 266 267 267 #if ENABLE(OPENTYPE_MATH) 268 float OpenTypeMathData::getMathConstant(const SimpleFontData *font, MathConstant constant) const268 float OpenTypeMathData::getMathConstant(const SimpleFontData& font, MathConstant constant) const 269 269 { 270 270 int32_t value = 0; … … 287 287 return value / 100.0; 288 288 289 return value * font ->sizePerUnit();290 #else 291 float OpenTypeMathData::getMathConstant(const SimpleFontData *, MathConstant) const289 return value * font.sizePerUnit(); 290 #else 291 float OpenTypeMathData::getMathConstant(const SimpleFontData&, MathConstant) const 292 292 { 293 293 ASSERT_NOT_REACHED(); … … 297 297 298 298 #if ENABLE(OPENTYPE_MATH) 299 float OpenTypeMathData::getItalicCorrection(const SimpleFontData *font, Glyph glyph) const299 float OpenTypeMathData::getItalicCorrection(const SimpleFontData& font, Glyph glyph) const 300 300 { 301 301 const OpenType::MATHTable* math = OpenType::validateTable<OpenType::MATHTable>(m_mathBuffer); … … 309 309 return 0; 310 310 311 return mathItalicsCorrectionInfo->getItalicCorrection(*m_mathBuffer, glyph) * font ->sizePerUnit();312 #else 313 float OpenTypeMathData::getItalicCorrection(const SimpleFontData *, Glyph) const311 return mathItalicsCorrectionInfo->getItalicCorrection(*m_mathBuffer, glyph) * font.sizePerUnit(); 312 #else 313 float OpenTypeMathData::getItalicCorrection(const SimpleFontData&, Glyph) const 314 314 { 315 315 ASSERT_NOT_REACHED(); -
trunk/Source/WebCore/platform/graphics/opentype/OpenTypeMathData.h
r171743 r177955 114 114 }; 115 115 116 float getMathConstant(const SimpleFontData *, MathConstant) const;117 float getItalicCorrection(const SimpleFontData *, Glyph) const;116 float getMathConstant(const SimpleFontData&, MathConstant) const; 117 float getItalicCorrection(const SimpleFontData&, Glyph) const; 118 118 void getMathVariants(Glyph, bool isVertical, Vector<Glyph>& sizeVariants, Vector<AssemblyPart>& assemblyParts) const; 119 119 -
trunk/Source/WebCore/platform/graphics/win/UniscribeController.cpp
r177909 r177955 166 166 } 167 167 168 if (m_fallbackFonts && fontData && nextFontData != fontData && fontData != m_font.primaryFont())168 if (m_fallbackFonts && fontData && nextFontData != fontData && fontData != &m_font.primaryFontData()) 169 169 m_fallbackFonts->add(fontData); 170 170 … … 180 180 int itemLength = m_run.rtl() ? indexOfFontTransition + 1 : length - indexOfFontTransition; 181 181 if (itemLength) { 182 if (m_fallbackFonts && nextFontData && nextFontData != m_font.primaryFont())182 if (m_fallbackFonts && nextFontData && nextFontData != &m_font.primaryFontData()) 183 183 m_fallbackFonts->add(nextFontData); 184 184 -
trunk/Source/WebCore/rendering/InlineFlowBox.cpp
r177377 r177955 450 450 const RenderStyle& lineStyle = this->lineStyle(); 451 451 if (lineStyle.fontDescription().nonCJKGlyphOrientation() == NonCJKGlyphOrientationUpright 452 || lineStyle.font().primaryFont ()->hasVerticalGlyphs())452 || lineStyle.font().primaryFontData().hasVerticalGlyphs()) 453 453 return true; 454 454 … … 461 461 return true; 462 462 } else { 463 if (child->lineStyle().font().primaryFont ()->hasVerticalGlyphs())463 if (child->lineStyle().font().primaryFontData().hasVerticalGlyphs()) 464 464 return true; 465 465 -
trunk/Source/WebCore/rendering/InlineTextBox.cpp
r176298 r177955 1389 1389 TextRun run(string, textPos(), expansion(), expansionBehavior(), direction(), dirOverride() || style.rtlOrdering() == VisualOrder, !renderer().canUseSimpleFontCodePath()); 1390 1390 run.setTabSize(!style.collapseWhiteSpace(), style.tabSize()); 1391 if (font.primaryFont ()->isSVGFont())1391 if (font.primaryFontData().isSVGFont()) 1392 1392 run.setRenderingContext(SVGTextRunRenderingContext::create(renderer())); 1393 1393 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r177730 r177955 2321 2321 2322 2322 // FIXME: Should letter-spacing apply? This is complicated since it doesn't apply at the edge? 2323 float maxCharWidth = lineGrid->style().font().primaryFont ()->maxCharWidth();2323 float maxCharWidth = lineGrid->style().font().primaryFontData().maxCharWidth(); 2324 2324 if (!maxCharWidth) 2325 2325 return left; … … 2361 2361 2362 2362 // FIXME: Should letter-spacing apply? This is complicated since it doesn't apply at the edge? 2363 float maxCharWidth = lineGrid->style().font().primaryFont ()->maxCharWidth();2363 float maxCharWidth = lineGrid->style().font().primaryFontData().maxCharWidth(); 2364 2364 if (!maxCharWidth) 2365 2365 return right; … … 3695 3695 3696 3696 TextRun run(characters, length, 0, 0, expansion, textDirection, directionalOverride); 3697 if (font.primaryFont ()->isSVGFont()) {3697 if (font.primaryFontData().isSVGFont()) { 3698 3698 ASSERT(context); // FIXME: Thread a RenderObject& to this point so we don't have to dereference anything. 3699 3699 run.setRenderingContext(SVGTextRunRenderingContext::create(*context)); … … 3715 3715 } 3716 3716 TextRun run(characters, length, 0, 0, expansion, textDirection, directionalOverride); 3717 if (font.primaryFont ()->isSVGFont()) {3717 if (font.primaryFontData().isSVGFont()) { 3718 3718 ASSERT(context); // FIXME: Thread a RenderObject& to this point so we don't have to dereference anything. 3719 3719 run.setRenderingContext(SVGTextRunRenderingContext::create(*context)); -
trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp
r177259 r177955 347 347 maxCharWidth = scaleEmToUnits(4027); 348 348 else if (style().font().hasValidAverageCharWidth()) 349 maxCharWidth = roundf(style().font().primaryFont ()->maxCharWidth());349 maxCharWidth = roundf(style().font().primaryFontData().maxCharWidth()); 350 350 #endif 351 351 -
trunk/Source/WebCore/rendering/RenderThemeIOS.mm
r176751 r177955 581 581 582 582 RenderObject* renderer = inputElement.renderer(); 583 if (font.primaryFont ()->isSVGFont() && !renderer)583 if (font.primaryFontData().isSVGFont() && !renderer) 584 584 return; 585 585 -
trunk/Source/WebCore/rendering/RootInlineBox.cpp
r177498 r177955 902 902 const RenderStyle& boxLineStyle = box.lineStyle(); 903 903 if (usedFonts && !usedFonts->isEmpty() && (includeFont || (boxLineStyle.lineHeight().isNegative() && includeLeading))) { 904 usedFonts->append( boxLineStyle.font().primaryFont());904 usedFonts->append(&boxLineStyle.font().primaryFontData()); 905 905 for (size_t i = 0; i < usedFonts->size(); ++i) { 906 906 const FontMetrics& fontMetrics = usedFonts->at(i)->fontMetrics(); -
trunk/Source/WebCore/rendering/SimpleLineLayout.cpp
r177219 r177955 179 179 } 180 180 } 181 if (style.font().primaryFont ()->isSVGFont())181 if (style.font().primaryFontData().isSVGFont()) 182 182 return false; 183 183 // We assume that all lines have metrics based purely on the primary font. 184 auto& primaryFontData = *style.font().primaryFont();184 auto& primaryFontData = style.font().primaryFontData(); 185 185 if (primaryFontData.isLoading()) 186 186 return false; -
trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp
r177259 r177955 1523 1523 bottom.glyph = extension.glyph; 1524 1524 1525 top.fontData = style().font().primaryFont();1525 top.fontData = &style().font().primaryFontData(); 1526 1526 extension.fontData = top.fontData; 1527 1527 bottom.fontData = top.fontData; … … 1540 1540 ASSERT(m_isVertical && isLargeOperatorInDisplayStyle()); 1541 1541 1542 const auto& primaryFontData = style().font().primaryFont ();1542 const auto& primaryFontData = style().font().primaryFontData(); 1543 1543 GlyphData baseGlyph = style().font().glyphDataForCharacter(character, !style().isLeftToRightDirection()); 1544 if (!primaryFontData || !primaryFontData->mathData() || baseGlyph.fontData !=primaryFontData)1544 if (!primaryFontData.mathData() || baseGlyph.fontData != &primaryFontData) 1545 1545 return data; 1546 1546 … … 1549 1549 1550 1550 // The value of displayOperatorMinHeight is sometimes too small, so we ensure that it is at least \sqrt{2} times the size of the base glyph. 1551 float displayOperatorMinHeight = std::max(baseGlyph.fontData->boundsForGlyph(baseGlyph.glyph).height() * sqrtOfTwoFloat, primaryFontData ->mathData()->getMathConstant(primaryFontData, OpenTypeMathData::DisplayOperatorMinHeight));1552 1553 primaryFontData ->mathData()->getMathVariants(baseGlyph.glyph, true, sizeVariants, assemblyParts);1551 float displayOperatorMinHeight = std::max(baseGlyph.fontData->boundsForGlyph(baseGlyph.glyph).height() * sqrtOfTwoFloat, primaryFontData.mathData()->getMathConstant(primaryFontData, OpenTypeMathData::DisplayOperatorMinHeight)); 1552 1553 primaryFontData.mathData()->getMathVariants(baseGlyph.glyph, true, sizeVariants, assemblyParts); 1554 1554 1555 1555 // We choose the first size variant that is larger than the expected displayOperatorMinHeight and otherwise fallback to the largest variant. … … 1557 1557 GlyphData sizeVariant; 1558 1558 sizeVariant.glyph = variant; 1559 sizeVariant.fontData = primaryFontData;1559 sizeVariant.fontData = &primaryFontData; 1560 1560 data.setSizeVariantMode(sizeVariant); 1561 1561 if (boundsForGlyph(sizeVariant).height() >= displayOperatorMinHeight) … … 1572 1572 StretchyData assemblyData; 1573 1573 1574 const auto& primaryFontData = style().font().primaryFont ();1574 const auto& primaryFontData = style().font().primaryFontData(); 1575 1575 GlyphData baseGlyph = style().font().glyphDataForCharacter(character, !style().isLeftToRightDirection()); 1576 1576 1577 if (primaryFontData && primaryFontData->mathData() && baseGlyph.fontData ==primaryFontData) {1577 if (primaryFontData.mathData() && baseGlyph.fontData == &primaryFontData) { 1578 1578 Vector<Glyph> sizeVariants; 1579 1579 Vector<OpenTypeMathData::AssemblyPart> assemblyParts; 1580 primaryFontData ->mathData()->getMathVariants(baseGlyph.glyph, m_isVertical, sizeVariants, assemblyParts);1580 primaryFontData.mathData()->getMathVariants(baseGlyph.glyph, m_isVertical, sizeVariants, assemblyParts); 1581 1581 // We verify the size variants. 1582 1582 for (auto& variant : sizeVariants) { 1583 1583 GlyphData sizeVariant; 1584 1584 sizeVariant.glyph = variant; 1585 sizeVariant.fontData = primaryFontData;1585 sizeVariant.fontData = &primaryFontData; 1586 1586 if (maximumGlyphWidth) 1587 1587 *maximumGlyphWidth = std::max(*maximumGlyphWidth, advanceForGlyph(sizeVariant)); … … 1984 1984 LayoutUnit RenderMathMLOperator::trailingSpaceError() 1985 1985 { 1986 const auto& primaryFontData = style().font().primaryFont ();1987 if (!primaryFontData || !primaryFontData->mathData())1986 const auto& primaryFontData = style().font().primaryFontData(); 1987 if (!primaryFontData.mathData()) 1988 1988 return 0; 1989 1989 -
trunk/Source/WebCore/rendering/mathml/RenderMathMLRadicalOperator.cpp
r177259 r177955 64 64 void RenderMathMLRadicalOperator::stretchTo(LayoutUnit heightAboveBaseline, LayoutUnit depthBelowBaseline) 65 65 { 66 const auto& primaryFontData = style().font().primaryFont(); 67 if (!primaryFontData || !primaryFontData->mathData()) { 66 if (!style().font().primaryFontData().mathData()) { 68 67 // If we do not have an OpenType MATH font, we always make the radical depth a bit larger than the target. 69 68 depthBelowBaseline += gRadicalBottomPointLower; … … 85 84 ASSERT(preferredLogicalWidthsDirty()); 86 85 87 const auto& primaryFontData = style().font().primaryFont(); 88 if (primaryFontData && primaryFontData->mathData()) { 86 if (style().font().primaryFontData().mathData()) { 89 87 RenderMathMLOperator::computePreferredLogicalWidths(); 90 88 return; … … 99 97 void RenderMathMLRadicalOperator::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues& computedValues) const 100 98 { 101 const auto& primaryFontData = style().font().primaryFont(); 102 if (primaryFontData && primaryFontData->mathData()) { 99 if (style().font().primaryFontData().mathData()) { 103 100 RenderMathMLOperator::computeLogicalHeight(logicalHeight, logicalTop, computedValues); 104 101 return; … … 115 112 return; 116 113 117 const auto& primaryFontData = style().font().primaryFont(); 118 if (primaryFontData && primaryFontData->mathData()) { 114 if (style().font().primaryFontData().mathData()) { 119 115 RenderMathMLOperator::paint(info, paintOffset); 120 116 return; -
trunk/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp
r177259 r177955 209 209 m_degreeBottomRaisePercent = 0.6f; 210 210 211 const auto& primaryFontData = style().font().primaryFont ();212 if ( primaryFontData && primaryFontData->mathData()) {211 const auto& primaryFontData = style().font().primaryFontData(); 212 if (auto* mathData = style().font().primaryFontData().mathData()) { 213 213 // FIXME: m_verticalGap should use RadicalDisplayStyleVertical in display mode (https://bugs.webkit.org/show_bug.cgi?id=118737). 214 m_verticalGap = primaryFontData->mathData()->getMathConstant(primaryFontData, OpenTypeMathData::RadicalVerticalGap);215 m_ruleThickness = primaryFontData->mathData()->getMathConstant(primaryFontData, OpenTypeMathData::RadicalRuleThickness);216 m_extraAscender = primaryFontData->mathData()->getMathConstant(primaryFontData, OpenTypeMathData::RadicalExtraAscender);214 m_verticalGap = mathData->getMathConstant(primaryFontData, OpenTypeMathData::RadicalVerticalGap); 215 m_ruleThickness = mathData->getMathConstant(primaryFontData, OpenTypeMathData::RadicalRuleThickness); 216 m_extraAscender = mathData->getMathConstant(primaryFontData, OpenTypeMathData::RadicalExtraAscender); 217 217 218 218 if (!isRenderMathMLSquareRoot()) { 219 kernBeforeDegree = primaryFontData->mathData()->getMathConstant(primaryFontData, OpenTypeMathData::RadicalKernBeforeDegree);220 kernAfterDegree = primaryFontData->mathData()->getMathConstant(primaryFontData, OpenTypeMathData::RadicalKernAfterDegree);221 m_degreeBottomRaisePercent = primaryFontData->mathData()->getMathConstant(primaryFontData, OpenTypeMathData::RadicalDegreeBottomRaisePercent);219 kernBeforeDegree = mathData->getMathConstant(primaryFontData, OpenTypeMathData::RadicalKernBeforeDegree); 220 kernAfterDegree = mathData->getMathConstant(primaryFontData, OpenTypeMathData::RadicalKernAfterDegree); 221 m_degreeBottomRaisePercent = mathData->getMathConstant(primaryFontData, OpenTypeMathData::RadicalDegreeBottomRaisePercent); 222 222 } 223 223 } -
trunk/Source/WebCore/rendering/style/RenderStyle.cpp
r177821 r177955 1185 1185 DEPRECATED_DEFINE_STATIC_LOCAL(AtomicString, hyphenMinusString, (&hyphenMinus, 1)); 1186 1186 DEPRECATED_DEFINE_STATIC_LOCAL(AtomicString, hyphenString, (&hyphen, 1)); 1187 return font().primaryFont HasGlyphForCharacter(hyphen) ? hyphenString : hyphenMinusString;1187 return font().primaryFontData().glyphForCharacter(hyphen) ? hyphenString : hyphenMinusString; 1188 1188 } 1189 1189 -
trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
r176365 r177955 423 423 , dirOverride() || style->rtlOrdering() == VisualOrder /* directionalOverride */); 424 424 425 if (style->font().primaryFont ()->isSVGFont())425 if (style->font().primaryFontData().isSVGFont()) 426 426 run.setRenderingContext(SVGTextRunRenderingContext::create(renderer())); 427 427 -
trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngineSpacing.cpp
r163440 r177955 42 42 { 43 43 #if ENABLE(SVG_FONTS) 44 const SimpleFontData * fontData = m_font.primaryFont();45 if (!fontData ->isSVGFont()) {44 const SimpleFontData& fontData = m_font.primaryFontData(); 45 if (!fontData.isSVGFont()) { 46 46 m_lastGlyph.isValid = false; 47 47 return 0; 48 48 } 49 49 50 ASSERT(fontData ->isCustomFont());51 ASSERT(fontData ->isSVGFont());50 ASSERT(fontData.isCustomFont()); 51 ASSERT(fontData.isSVGFont()); 52 52 53 const SVGFontData* svgFontData = static_cast<const SVGFontData*>(fontData ->fontData());53 const SVGFontData* svgFontData = static_cast<const SVGFontData*>(fontData.fontData()); 54 54 SVGFontFaceElement* svgFontFace = svgFontData->svgFontFaceElement(); 55 55 ASSERT(svgFontFace); -
trunk/Source/WebCore/rendering/svg/SVGTextMetrics.cpp
r170871 r177955 71 71 , isOverride(style.unicodeBidi()) /* directionalOverride */); 72 72 73 if (style.font().primaryFont ()->isSVGFont())73 if (style.font().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().primaryFont ()->isSVGFont();94 bool needsContext = text.style().font().primaryFontData().isSVGFont(); 95 95 float scalingFactor = text.scalingFactor(); 96 96 ASSERT(scalingFactor); -
trunk/Source/WebCore/rendering/svg/SVGTextRunRenderingContext.cpp
r177637 r177955 293 293 static GlyphData missingGlyphForFont(const Font& font) 294 294 { 295 const SimpleFontData * primaryFontData = font.primaryFont();296 if (!primaryFontData ->isSVGFont())295 const SimpleFontData& primaryFontData = font.primaryFontData(); 296 if (!primaryFontData.isSVGFont()) 297 297 return GlyphData(); 298 298 SVGFontElement* fontElement; 299 299 SVGFontFaceElement* fontFaceElement; 300 svgFontAndFontFaceElementForFontData( primaryFontData, fontFaceElement, fontElement);301 return GlyphData(fontElement->missingGlyph(), primaryFontData);300 svgFontAndFontFaceElementForFontData(&primaryFontData, fontFaceElement, fontElement); 301 return GlyphData(fontElement->missingGlyph(), &primaryFontData); 302 302 } 303 303 … … 315 315 if (Element* parentRendererElement = elementRenderer.element()) { 316 316 if (is<SVGAltGlyphElement>(*parentRendererElement)) 317 glyphData.fontData = font.primaryFont();317 glyphData.fontData = &font.primaryFontData(); 318 318 } 319 319 } -
trunk/Source/WebKit/mac/WebCoreSupport/PopupMenuMac.mm
r176236 r177955 82 82 RetainPtr<NSMutableDictionary> attributes = adoptNS([[NSMutableDictionary alloc] init]); 83 83 if (style.font() != Font()) { 84 NSFont *font = style.font().primaryFont ()->getNSFont();84 NSFont *font = style.font().primaryFontData().getNSFont(); 85 85 if (!font) { 86 CGFloat size = style.font().primaryFont ()->platformData().size();86 CGFloat size = style.font().primaryFontData().platformData().size(); 87 87 font = style.font().weight() < FontWeightBold ? [NSFont systemFontOfSize:size] : [NSFont boldSystemFontOfSize:size]; 88 88 } … … 149 149 150 150 NSPoint location; 151 NSFont* font = m_client->menuStyle().font().primaryFont ()->getNSFont();151 NSFont* font = m_client->menuStyle().font().primaryFontData().getNSFont(); 152 152 153 153 // These values were borrowed from AppKit to match their placement of the menu. -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm
r169134 r177955 40 40 #if USE(APPKIT) 41 41 // FIXME: font will be nil here for custom fonts, we should fix that. 42 NSFont *font = m_popupClient->menuStyle().font().primaryFont ()->getNSFont();42 NSFont *font = m_popupClient->menuStyle().font().primaryFontData().getNSFont(); 43 43 if (!font) 44 44 return; -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r177917 r177955 801 801 Node* nodeToRemove; 802 802 if (RenderStyle* style = Editor::styleForSelectionStart(&frame, nodeToRemove)) { 803 CTFontRef font = style->font().primaryFont ()->getCTFont();803 CTFontRef font = style->font().primaryFontData().getCTFont(); 804 804 CTFontSymbolicTraits traits = font ? CTFontGetSymbolicTraits(font) : 0; 805 805
Note:
See TracChangeset
for help on using the changeset viewer.