Title: [193693] branches/safari-601.1.46-branch

Diff

Modified: branches/safari-601.1.46-branch/LayoutTests/ChangeLog (193692 => 193693)


--- branches/safari-601.1.46-branch/LayoutTests/ChangeLog	2015-12-08 05:40:29 UTC (rev 193692)
+++ branches/safari-601.1.46-branch/LayoutTests/ChangeLog	2015-12-08 05:40:37 UTC (rev 193693)
@@ -1,3 +1,13 @@
+2015-10-19  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        FontCascade::typesettingFeatures() is not privy to font-variant-* nor font-feature-settings
+        https://bugs.webkit.org/show_bug.cgi?id=149775
+
+        Reviewed by Darin Adler.
+
+        * fast/text/multiple-feature-properties-expected.html: Added.
+        * fast/text/multiple-feature-properties.html: Added.
+
 2015-12-06  Matthew Hanson  <matthew_han...@apple.com>
 
         Merge r190999. rdar://problem/23770070

Added: branches/safari-601.1.46-branch/LayoutTests/fast/text/multiple-feature-properties-expected.html (0 => 193693)


--- branches/safari-601.1.46-branch/LayoutTests/fast/text/multiple-feature-properties-expected.html	                        (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/fast/text/multiple-feature-properties-expected.html	2015-12-08 05:40:37 UTC (rev 193693)
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+This test makes sure that feature resolution order is honored. For more information, click <a href="" The test passes if there is a particular sequence of Xs and check marks below.
+<div style="font-family: FontWithFeaturesOTF;">
+<span>B</span>
+<span>B</span>
+<span>A</span>
+<span>B</span>
+<span>A</span>
+<span>B</span>
+<span>A</span>
+<span>B</span>
+<span>B</span>
+<span>A</span>
+</div>
+</body>
+</html>

Added: branches/safari-601.1.46-branch/LayoutTests/fast/text/multiple-feature-properties.html (0 => 193693)


--- branches/safari-601.1.46-branch/LayoutTests/fast/text/multiple-feature-properties.html	                        (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/fast/text/multiple-feature-properties.html	2015-12-08 05:40:37 UTC (rev 193693)
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+This test makes sure that feature resolution order is honored. For more information, click <a href="" The test passes if there is a particular sequence of Xs and check marks below.
+<div style="font-family: FontWithFeaturesOTF;">
+<span style="font-variant-ligatures: common-ligatures; text-rendering: optimizeSpeed;">C</span>
+<span style="font-variant-ligatures: no-common-ligatures; text-rendering: optimizeSpeed;">C</span>
+<span style="font-variant-ligatures: common-ligatures; text-rendering: optimizeLegibility;">C</span>
+<span style="font-variant-ligatures: no-common-ligatures; text-rendering: optimizeLegibility;">C</span>
+<span style="font-feature-settings: 'liga' 1, 'clig' 1; text-rendering: optimizeSpeed;">C</span>
+<span style="font-feature-settings: 'liga' 0, 'clig' 0; text-rendering: optimizeSpeed;">C</span>
+<span style="font-feature-settings: 'liga' 1, 'clig' 1; text-rendering: optimizeLegibility;">C</span>
+<span style="font-feature-settings: 'liga' 0, 'clig' 0; text-rendering: optimizeLegibility;">C</span>
+<span style="font-variant-ligatures: common-ligatures; font-feature-settings: 'liga' 0, 'clig' 0;">C</span>
+<span style="font-variant-ligatures: no-common-ligatures; font-feature-settings: 'liga' 1, 'clig' 1;">C</span>
+</div>
+</body>
+</html>

Modified: branches/safari-601.1.46-branch/Source/WebCore/ChangeLog (193692 => 193693)


--- branches/safari-601.1.46-branch/Source/WebCore/ChangeLog	2015-12-08 05:40:29 UTC (rev 193692)
+++ branches/safari-601.1.46-branch/Source/WebCore/ChangeLog	2015-12-08 05:40:37 UTC (rev 193693)
@@ -1,3 +1,65 @@
+2015-10-19  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        FontCascade::typesettingFeatures() is not privy to font-variant-* nor font-feature-settings
+        https://bugs.webkit.org/show_bug.cgi?id=149775
+
+        Reviewed by Darin Adler.
+
+        This patch has two pieces:
+
+        We used to have a boolean, enableLigatures, which affected how we perform shaping in both our
+        simple and complex text codepaths. However, in this brave new world of font-feature-settings
+        and font-variant-*, there are many properties which may affect shaping (and multiple kinds
+        of ligatures). This patch renames this boolean to requiresShaping, and teaches it about all
+        the various properties which affect text shaping.
+
+        Similarly, one of the places which used this enableLigatures boolean was to tell CoreText
+        if it should disable ligatures. However, we now have much finer-grained control over
+        ligatures during font creation. This patch moves the responsibility of dictating which
+        font features should be enabled entirely to the Font. Therefore, getCFStringAttributes()
+        doesn't know anything about ligatures anymore; the logic inside font creation is used
+        instead.
+
+        An added benefit of moving all the font feature logic to one place is that we can implement
+        the feature resolution algorithm described in the CSS3 fonts spec. This patch adds a test to
+        makes sure that text-rendering, font-feature-settings, and font-variant-* play together
+        nicely.
+
+        Test: fast/text/multiple-feature-properties.html
+
+        * platform/graphics/Font.cpp:
+        (WebCore::Font::applyTransforms):
+        * platform/graphics/Font.h:
+        * platform/graphics/FontCascade.cpp:
+        (WebCore::FontCascade::FontCascade):
+        (WebCore::FontCascade::operator=):
+        (WebCore::FontCascade::update):
+        (WebCore::FontCascade::drawText):
+        (WebCore::FontCascade::drawEmphasisMarks):
+        (WebCore::FontCascade::width):
+        (WebCore::FontCascade::adjustSelectionRectForText):
+        (WebCore::FontCascade::offsetForPosition):
+        (WebCore::FontCascade::codePath):
+        (WebCore::FontCascade::floatWidthForSimpleText):
+        * platform/graphics/FontCascade.h:
+        (WebCore::FontCascade::requiresShaping):
+        (WebCore::FontCascade::computeRequiresShaping):
+        (WebCore::FontCascade::enableLigatures): Deleted.
+        (WebCore::FontCascade::computeEnableLigatures): Deleted.
+        * platform/graphics/WidthIterator.cpp:
+        (WebCore::WidthIterator::WidthIterator):
+        (WebCore::WidthIterator::applyFontTransforms):
+        * platform/graphics/WidthIterator.h:
+        * platform/graphics/cocoa/FontCacheCoreText.cpp:
+        (WebCore::preparePlatformFont):
+        * platform/graphics/cocoa/FontCocoa.mm:
+        (WebCore::Font::canRenderCombiningCharacterSequence):
+        * platform/graphics/mac/ComplexTextControllerCoreText.mm:
+        (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
+        * platform/graphics/mac/SimpleFontDataCoreText.cpp:
+        (WebCore::Font::getCFStringAttributes):
+        * svg/SVGFontData.h:
+
 2015-10-13  Myles C. Maxfield  <mmaxfi...@apple.com>
 
         Split TypesettingFeatures into kerning and ligatures bools

Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/Font.cpp (193692 => 193693)


--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/Font.cpp	2015-12-08 05:40:29 UTC (rev 193692)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/Font.cpp	2015-12-08 05:40:37 UTC (rev 193693)
@@ -380,19 +380,19 @@
     return platformCreateScaledFont(fontDescription, scaleFactor);
 }
 
-bool Font::applyTransforms(GlyphBufferGlyph* glyphs, GlyphBufferAdvance* advances, size_t glyphCount, bool enableKerning, bool enableLigatures) const
+bool Font::applyTransforms(GlyphBufferGlyph* glyphs, GlyphBufferAdvance* advances, size_t glyphCount, bool enableKerning, bool requiresShaping) const
 {
     // We need to handle transforms on SVG fonts internally, since they are rendered internally.
     ASSERT(!isSVGFont());
 #if PLATFORM(COCOA)
-    CTFontTransformOptions options = (enableKerning ? kCTFontTransformApplyPositioning : 0) | (enableLigatures ? kCTFontTransformApplyShaping : 0);
+    CTFontTransformOptions options = (enableKerning ? kCTFontTransformApplyPositioning : 0) | (requiresShaping ? kCTFontTransformApplyShaping : 0);
     return CTFontTransformGlyphs(m_platformData.ctFont(), glyphs, reinterpret_cast<CGSize*>(advances), glyphCount, options);
 #else
     UNUSED_PARAM(glyphs);
     UNUSED_PARAM(advances);
     UNUSED_PARAM(glyphCount);
     UNUSED_PARAM(enableKerning);
-    UNUSED_PARAM(enableLigatures);
+    UNUSED_PARAM(requiresShaping);
     return false;
 #endif
 }

Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/Font.h (193692 => 193693)


--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/Font.h	2015-12-08 05:40:29 UTC (rev 193692)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/Font.h	2015-12-08 05:40:37 UTC (rev 193693)
@@ -193,7 +193,7 @@
     bool shouldNotBeUsedForArabic() const { return m_shouldNotBeUsedForArabic; };
 #endif
 #if PLATFORM(COCOA)
-    CFDictionaryRef getCFStringAttributes(bool enableKerning, bool enableLigatures, FontOrientation) const;
+    CFDictionaryRef getCFStringAttributes(bool enableKerning, FontOrientation) const;
     bool hasCustomTracking() const { return isSystemFont(); }
 #endif
 
@@ -201,7 +201,7 @@
     bool canRenderCombiningCharacterSequence(const UChar*, size_t) const;
 #endif
 
-    bool applyTransforms(GlyphBufferGlyph*, GlyphBufferAdvance*, size_t glyphCount, bool enableKerning, bool enableLigatures) const;
+    bool applyTransforms(GlyphBufferGlyph*, GlyphBufferAdvance*, size_t glyphCount, bool enableKerning, bool requiresShaping) const;
 
 #if PLATFORM(COCOA) || PLATFORM(WIN)
     bool isSystemFont() const { return m_isSystemFont; }

Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/FontCascade.cpp (193692 => 193693)


--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/FontCascade.cpp	2015-12-08 05:40:29 UTC (rev 193692)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/FontCascade.cpp	2015-12-08 05:40:37 UTC (rev 193693)
@@ -104,7 +104,7 @@
     , m_wordSpacing(0)
     , m_useBackslashAsYenSymbol(false)
     , m_enableKerning(false)
-    , m_enableLigatures(false)
+    , m_requiresShaping(false)
 {
 }
 
@@ -115,7 +115,7 @@
     , m_wordSpacing(wordSpacing)
     , m_useBackslashAsYenSymbol(useBackslashAsYenSignForFamily(fd.firstFamily()))
     , m_enableKerning(computeEnableKerning())
-    , m_enableLigatures(computeEnableKerning())
+    , m_requiresShaping(computeRequiresShaping())
 {
 }
 
@@ -127,7 +127,7 @@
     , m_wordSpacing(0)
     , m_useBackslashAsYenSymbol(false)
     , m_enableKerning(computeEnableKerning())
-    , m_enableLigatures(computeEnableKerning())
+    , m_requiresShaping(computeRequiresShaping())
 {
     m_fontDescription.setFontSmoothing(fontSmoothingMode);
 #if PLATFORM(IOS)
@@ -164,7 +164,7 @@
     , m_wordSpacing(other.m_wordSpacing)
     , m_useBackslashAsYenSymbol(other.m_useBackslashAsYenSymbol)
     , m_enableKerning(computeEnableKerning())
-    , m_enableLigatures(computeEnableKerning())
+    , m_requiresShaping(computeRequiresShaping())
 {
 }
 
@@ -176,7 +176,7 @@
     m_wordSpacing = other.m_wordSpacing;
     m_useBackslashAsYenSymbol = other.m_useBackslashAsYenSymbol;
     m_enableKerning = other.m_enableKerning;
-    m_enableLigatures = other.m_enableLigatures;
+    m_requiresShaping = other.m_requiresShaping;
     return *this;
 }
 
@@ -322,7 +322,7 @@
     m_fonts = retrieveOrAddCachedFonts(m_fontDescription, fontSelector.get());
     m_useBackslashAsYenSymbol = useBackslashAsYenSignForFamily(firstFamily());
     m_enableKerning = computeEnableKerning();
-    m_enableLigatures = computeEnableLigatures();
+    m_requiresShaping = computeRequiresShaping();
 }
 
 float FontCascade::drawText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, int from, int to, CustomFontNotReadyAction customFontNotReadyAction) const
@@ -337,7 +337,7 @@
 
     CodePath codePathToUse = codePath(run);
     // FIXME: Use the fast code path once it handles partial runs with kerning and ligatures. See http://webkit.org/b/100050
-    if (codePathToUse != Complex && (enableKerning() || enableLigatures()) && (from || static_cast<unsigned>(to) != run.length()) && !isDrawnWithSVGFont(run))
+    if (codePathToUse != Complex && (enableKerning() || requiresShaping()) && (from || static_cast<unsigned>(to) != run.length()) && !isDrawnWithSVGFont(run))
         codePathToUse = Complex;
 
     if (codePathToUse != Complex)
@@ -356,7 +356,7 @@
 
     CodePath codePathToUse = codePath(run);
     // FIXME: Use the fast code path once it handles partial runs with kerning and ligatures. See http://webkit.org/b/100050
-    if (codePathToUse != Complex && (enableKerning() || enableLigatures()) && (from || static_cast<unsigned>(to) != run.length()) && !isDrawnWithSVGFont(run))
+    if (codePathToUse != Complex && (enableKerning() || requiresShaping()) && (from || static_cast<unsigned>(to) != run.length()) && !isDrawnWithSVGFont(run))
         codePathToUse = Complex;
 
     if (codePathToUse != Complex)
@@ -377,9 +377,8 @@
             glyphOverflow = 0;
     }
 
-    bool hasKerningOrLigatures = enableKerning() || enableLigatures();
     bool hasWordSpacingOrLetterSpacing = wordSpacing() || letterSpacing();
-    float* cacheEntry = m_fonts->widthCache().add(run, std::numeric_limits<float>::quiet_NaN(), hasKerningOrLigatures, hasWordSpacingOrLetterSpacing, glyphOverflow);
+    float* cacheEntry = m_fonts->widthCache().add(run, std::numeric_limits<float>::quiet_NaN(), enableKerning() || requiresShaping(), hasWordSpacingOrLetterSpacing, glyphOverflow);
     if (cacheEntry && !std::isnan(*cacheEntry))
         return *cacheEntry;
 
@@ -529,7 +528,7 @@
 
     CodePath codePathToUse = codePath(run);
     // FIXME: Use the fast code path once it handles partial runs with kerning and ligatures. See http://webkit.org/b/100050
-    if (codePathToUse != Complex && (enableKerning() || enableLigatures()) && (from || static_cast<unsigned>(to) != run.length()) && !isDrawnWithSVGFont(run))
+    if (codePathToUse != Complex && (enableKerning() || requiresShaping()) && (from || static_cast<unsigned>(to) != run.length()) && !isDrawnWithSVGFont(run))
         codePathToUse = Complex;
 
     if (codePathToUse != Complex)
@@ -541,7 +540,7 @@
 int FontCascade::offsetForPosition(const TextRun& run, float x, bool includePartialGlyphs) const
 {
     // FIXME: Use the fast code path once it handles partial runs with kerning and ligatures. See http://webkit.org/b/100050
-    if (codePath(run) != Complex && (!(enableKerning() || enableLigatures()) || isDrawnWithSVGFont(run)))
+    if (codePath(run) != Complex && (!(enableKerning() || requiresShaping()) || isDrawnWithSVGFont(run)))
         return offsetForPositionForSimpleText(run, x, includePartialGlyphs);
 
     return offsetForPositionForComplexText(run, x, includePartialGlyphs);
@@ -624,12 +623,12 @@
         return Simple;
 #endif
 
-    // FIXME: This shouldn't be necessary because Font::applyTransforms() should perform all necessary shaping.
+    // Because Font::applyTransforms() doesn't know which features to enable/disable it the simple code path can’t properly handle feature or variant settings.
     if (m_fontDescription.featureSettings().size() > 0 || !m_fontDescription.variantSettings().isAllNormal())
         return Complex;
 
 #if !PLATFORM(COCOA)
-    if (run.length() > 1 && (enableKerning() || enableLigatures()))
+    if (run.length() > 1 && (enableKerning() || requiresShaping()))
         return Complex;
 #endif
 
@@ -1451,7 +1450,7 @@
 {
     WidthIterator it(this, run, fallbackFonts, glyphOverflow);
     GlyphBuffer glyphBuffer;
-    it.advance(run.length(), (enableKerning() || enableLigatures()) ? &glyphBuffer : nullptr);
+    it.advance(run.length(), (enableKerning() || requiresShaping()) ? &glyphBuffer : nullptr);
 
     if (glyphOverflow) {
         glyphOverflow->top = std::max<int>(glyphOverflow->top, ceilf(-it.minGlyphBoundingBoxY()) - (glyphOverflow->computeBounds ? 0 : fontMetrics().ascent()));

Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/FontCascade.h (193692 => 193693)


--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/FontCascade.h	2015-12-08 05:40:29 UTC (rev 193692)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/FontCascade.h	2015-12-08 05:40:37 UTC (rev 193693)
@@ -163,7 +163,7 @@
     FontRenderingMode renderingMode() const { return m_fontDescription.renderingMode(); }
 
     bool enableKerning() const { return m_enableKerning; }
-    bool enableLigatures() const { return m_enableLigatures; }
+    bool requiresShaping() const { return m_requiresShaping; }
 
     const AtomicString& firstFamily() const { return m_fontDescription.firstFamily(); }
     unsigned familyCount() const { return m_fontDescription.familyCount(); }
@@ -324,13 +324,12 @@
         return advancedTextRenderingMode();
     }
 
-    bool computeEnableLigatures() const
+    bool computeRequiresShaping() const
     {
-        auto ligatures = m_fontDescription.variantCommonLigatures();
-        if (ligatures == FontVariantLigatures::Yes)
+        if (!m_fontDescription.variantSettings().isAllNormal())
             return true;
-        if (ligatures == FontVariantLigatures::No)
-            return false;
+        if (m_fontDescription.featureSettings().size())
+            return true;
         return advancedTextRenderingMode();
     }
 
@@ -344,7 +343,7 @@
     float m_wordSpacing;
     mutable bool m_useBackslashAsYenSymbol;
     mutable unsigned m_enableKerning : 1; // Computed from m_fontDescription.
-    mutable unsigned m_enableLigatures : 1; // Computed from m_fontDescription.
+    mutable unsigned m_requiresShaping : 1; // Computed from m_fontDescription.
 };
 
 void invalidateFontCascadeCache();

Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/WidthIterator.cpp (193692 => 193693)


--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/WidthIterator.cpp	2015-12-08 05:40:29 UTC (rev 193692)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/WidthIterator.cpp	2015-12-08 05:40:37 UTC (rev 193693)
@@ -44,7 +44,7 @@
     , m_fallbackFonts(fallbackFonts)
     , m_accountForGlyphBounds(accountForGlyphBounds)
     , m_enableKerning(font->enableKerning())
-    , m_enableLigatures(font->enableLigatures())
+    , m_requiresShaping(font->requiresShaping())
     , m_forTextEmphasis(forTextEmphasis)
 {
     // If the padding is non-zero, count the number of spaces in the run
@@ -126,7 +126,7 @@
         }
     } else
 #endif
-        font->applyTransforms(glyphBuffer->glyphs(lastGlyphCount), advances + lastGlyphCount, glyphBufferSize - lastGlyphCount, iterator.enableKerning(), iterator.enableLigatures());
+        font->applyTransforms(glyphBuffer->glyphs(lastGlyphCount), advances + lastGlyphCount, glyphBufferSize - lastGlyphCount, iterator.enableKerning(), iterator.requiresShaping());
 
     if (!ltr)
         glyphBuffer->reverse(lastGlyphCount, glyphBufferSize - lastGlyphCount);
@@ -198,7 +198,7 @@
 {
     if (glyphBuffer && glyphBuffer->size() == lastGlyphCount + 1 && isSoftBankEmoji(previousCharacter))
         return TransformsType::Forced;
-    if (m_run.length() <= 1 || !(m_enableKerning || m_enableLigatures))
+    if (m_run.length() <= 1 || !(m_enableKerning || m_requiresShaping))
         return TransformsType::None;
     return TransformsType::NotForced;
 }

Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/WidthIterator.h (193692 => 193693)


--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/WidthIterator.h	2015-12-08 05:40:29 UTC (rev 193692)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/WidthIterator.h	2015-12-08 05:40:37 UTC (rev 193693)
@@ -52,7 +52,7 @@
     const TextRun& run() const { return m_run; }
     float runWidthSoFar() const { return m_runWidthSoFar; }
     bool enableKerning() const { return m_enableKerning; }
-    bool enableLigatures() const { return m_enableLigatures; }
+    bool requiresShaping() const { return m_requiresShaping; }
 
 #if ENABLE(SVG_FONTS)
     String lastGlyphName() const { return m_lastGlyphName; }
@@ -87,7 +87,7 @@
     HashSet<const Font*>* m_fallbackFonts { nullptr };
     bool m_accountForGlyphBounds { false };
     bool m_enableKerning { false };
-    bool m_enableLigatures { false };
+    bool m_requiresShaping { false };
     bool m_forTextEmphasis { false };
     float m_maxGlyphBoundingBoxY { std::numeric_limits<float>::min() };
     float m_minGlyphBoundingBoxY { std::numeric_limits<float>::max() };

Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp (193692 => 193693)


--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp	2015-12-08 05:40:29 UTC (rev 193692)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp	2015-12-08 05:40:37 UTC (rev 193693)
@@ -320,10 +320,17 @@
     if (!originalFont || (!features.size() && variantSettings.isAllNormal()))
         return originalFont;
 
-    // FIXME: We don't consult with the @font-face first, like the spec says we should.
+    // This algorithm is described at http://www.w3.org/TR/css3-fonts/#feature-precedence
 
-    // Spec says that font-feature-settings should override font-variant-*.
+    // Step 1: CoreText handles default features (such as required ligatures).
+
+    // Steps 2-3: Consult with @font-face
+    // FIXME: This is not yet implemented.
+
+    // Step 4: Font-variant
     auto fontFeatureSettingsFromVariants = computeFeatureSettingsFromVariants(variantSettings);
+
+    // Step 6: Font-feature-settings
     for (auto& newFeature : features)
         fontFeatureSettingsFromVariants.set(newFeature.tag(), newFeature.value());
 

Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm (193692 => 193693)


--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm	2015-12-08 05:40:29 UTC (rev 193692)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm	2015-12-08 05:40:37 UTC (rev 193693)
@@ -525,7 +525,7 @@
 
     RetainPtr<CFTypeRef> fontEqualityObject = platformData().objectForEqualityCheck();
 
-    ProviderInfo info = { characters, length, getCFStringAttributes(false, false, platformData().orientation()) };
+    ProviderInfo info = { characters, length, getCFStringAttributes(false, platformData().orientation()) };
     RetainPtr<CTLineRef> line = adoptCF(CTLineCreateWithUniCharProvider(&provideStringAndAttributes, 0, &info));
 
     CFArrayRef runArray = CTLineGetGlyphRuns(line.get());

Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm (193692 => 193693)


--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm	2015-12-08 05:40:29 UTC (rev 193692)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm	2015-12-08 05:40:37 UTC (rev 193693)
@@ -212,7 +212,7 @@
 
         RetainPtr<WebCascadeList> cascadeList = adoptNS([[WebCascadeList alloc] initWithFont:&m_font character:baseCharacter]);
 
-        stringAttributes = adoptCF(CFDictionaryCreateMutableCopy(kCFAllocatorDefault, 0, font->getCFStringAttributes(m_font.enableKerning(), m_font.enableLigatures(), font->platformData().orientation())));
+        stringAttributes = adoptCF(CFDictionaryCreateMutableCopy(kCFAllocatorDefault, 0, font->getCFStringAttributes(m_font.enableKerning(), font->platformData().orientation())));
         static const void* attributeKeys[] = { kCTFontCascadeListAttribute };
         const void* values[] = { cascadeList.get() };
         RetainPtr<CFDictionaryRef> attributes = adoptCF(CFDictionaryCreate(kCFAllocatorDefault, attributeKeys, values, sizeof(attributeKeys) / sizeof(*attributeKeys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
@@ -220,7 +220,7 @@
         RetainPtr<CTFontRef> fontWithCascadeList = adoptCF(CTFontCreateCopyWithAttributes(font->platformData().ctFont(), m_font.pixelSize(), 0, fontDescriptor.get()));
         CFDictionarySetValue(const_cast<CFMutableDictionaryRef>(stringAttributes.get()), kCTFontAttributeName, fontWithCascadeList.get());
     } else
-        stringAttributes = font->getCFStringAttributes(m_font.enableKerning(), m_font.enableLigatures(), font->platformData().orientation());
+        stringAttributes = font->getCFStringAttributes(m_font.enableKerning(), font->platformData().orientation());
 
     RetainPtr<CTLineRef> line;
 

Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/mac/GlyphPageMac.cpp (193692 => 193693)


--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/mac/GlyphPageMac.cpp	2015-12-08 05:40:29 UTC (rev 193692)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/mac/GlyphPageMac.cpp	2015-12-08 05:40:37 UTC (rev 193693)
@@ -115,7 +115,7 @@
 
         // We ask CoreText for possible vertical variant glyphs
         RetainPtr<CFStringRef> string = adoptCF(CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault, buffer, bufferLength, kCFAllocatorNull));
-        RetainPtr<CFAttributedStringRef> attributedString = adoptCF(CFAttributedStringCreate(kCFAllocatorDefault, string.get(), fontData->getCFStringAttributes(false, false, fontData->hasVerticalGlyphs() ? Vertical : Horizontal)));
+        RetainPtr<CFAttributedStringRef> attributedString = adoptCF(CFAttributedStringCreate(kCFAllocatorDefault, string.get(), fontData->getCFStringAttributes(false, fontData->hasVerticalGlyphs() ? Vertical : Horizontal)));
         RetainPtr<CTLineRef> line = adoptCF(CTLineCreateWithAttributedString(attributedString.get()));
 
         CFArrayRef runArray = CTLineGetGlyphRuns(line.get());

Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp (193692 => 193693)


--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp	2015-12-08 05:40:29 UTC (rev 193692)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp	2015-12-08 05:40:37 UTC (rev 193693)
@@ -35,9 +35,9 @@
 
 namespace WebCore {
 
-CFDictionaryRef Font::getCFStringAttributes(bool enableKerning, bool enableLigatures, FontOrientation orientation) const
+CFDictionaryRef Font::getCFStringAttributes(bool enableKerning, FontOrientation orientation) const
 {
-    unsigned key = (enableKerning << 1 | enableLigatures) + 1;
+    unsigned key = static_cast<unsigned>(enableKerning) + 1;
     HashMap<unsigned, RetainPtr<CFDictionaryRef>>::AddResult addResult = m_CFStringAttributes.add(key, RetainPtr<CFDictionaryRef>());
     RetainPtr<CFDictionaryRef>& attributesDictionary = addResult.iterator->value;
     if (!addResult.isNewEntry)
@@ -54,12 +54,6 @@
         CFDictionarySetValue(mutableAttributes, kCTKernAttributeName, zeroKerningValue);
     }
 
-    if (!((orientation == Horizontal && platformData().allowsLigatures()) || enableLigatures)) {
-        const int zero = 0;
-        static CFNumberRef essentialLigaturesValue = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &zero);
-        CFDictionarySetValue(mutableAttributes, kCTLigatureAttributeName, essentialLigaturesValue);
-    }
-
     if (orientation == Vertical)
         CFDictionarySetValue(mutableAttributes, kCTVerticalFormsAttributeName, kCFBooleanTrue);
 

Modified: branches/safari-601.1.46-branch/Source/WebCore/svg/SVGFontData.h (193692 => 193693)


--- branches/safari-601.1.46-branch/Source/WebCore/svg/SVGFontData.h	2015-12-08 05:40:29 UTC (rev 193692)
+++ branches/safari-601.1.46-branch/Source/WebCore/svg/SVGFontData.h	2015-12-08 05:40:37 UTC (rev 193693)
@@ -53,7 +53,7 @@
     bool fillBMPGlyphs(SVGFontElement*, GlyphPage* , unsigned offset, unsigned length, UChar* buffer, const Font*) const;
     bool fillNonBMPGlyphs(SVGFontElement*, GlyphPage* , unsigned offset, unsigned length, UChar* buffer, const Font*) const;
 
-    bool applyTransforms(GlyphBufferGlyph*, GlyphBufferAdvance*, size_t, bool enableKerning, bool enableLigatures) const = delete;
+    bool applyTransforms(GlyphBufferGlyph*, GlyphBufferAdvance*, size_t, bool enableKerning, bool requiresShaping) const = delete;
 
     // Ths SVGFontFaceElement is kept alive --
     // 1) in the external font case: by the CSSFontFaceSource, which holds a reference to the external SVG document
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to