Changeset 245647 in webkit
- Timestamp:
- May 22, 2019 2:39:11 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 9 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r245639 r245647 1 2019-05-22 Ryan Haddad <ryanhaddad@apple.com> 2 3 Unreviewed, rolling out r245598. 4 5 Breaks watchOS build. 6 7 Reverted changeset: 8 9 "font-optical-sizing applies the wrong variation value" 10 https://bugs.webkit.org/show_bug.cgi?id=197528 11 https://trac.webkit.org/changeset/245598 12 1 13 2019-05-22 Antoine Quint <graouts@apple.com> 2 14 -
trunk/LayoutTests/platform/win/TestExpectations
r245619 r245647 3251 3251 fast/text/text-combine-shrink-on-color-change.html [ Failure ] 3252 3252 fast/text/trak-optimizeLegibility.html [ Failure ] 3253 fast/text/variations [ Failure Pass ImageOnlyFailure ] 3253 fast/text/variations/advances.html [ Failure ] 3254 fast/text/variations/getComputedStyle.html [ Failure ] 3254 3255 fast/text/whitespace/023.html [ Failure ] 3255 3256 fast/transforms/bounding-rect-zoom.html [ Failure ] … … 3380 3381 fast/text/emoji-single-parent-family-2.html [ ImageOnlyFailure ] 3381 3382 fast/text/emoji-single-parent-family.html [ ImageOnlyFailure ] 3383 fast/text/variations/exist.html [ ImageOnlyFailure ] 3384 fast/text/variations/outofbounds.html [ ImageOnlyFailure ] 3382 3385 http/tests/security/http-0.9/image-on-HTTP-0.9-default-port-page-allowed-ref-test.html [ ImageOnlyFailure ] 3383 3386 mathml/presentation/non-bmp-operators-stretching.html [ ImageOnlyFailure ] … … 3554 3557 fast/text/softbank-emoji.html [ Failure ] 3555 3558 fast/text/system-font-fallback-emoji.html [ Failure ] 3559 fast/text/variations/font-loading-api-parse-ranges.html [ Failure ] 3560 fast/text/variations/optical-sizing.html [ Failure ] 3556 3561 fast/text/web-font-load-invisible-during-loading.html [ Failure ] 3557 3562 fast/url/standard-url.html [ Failure ] … … 3619 3624 fast/text/multiple-codeunit-vertical-upright.html [ ImageOnlyFailure ] 3620 3625 fast/text/simple-line-layout-simple-text-but-complex-font-path.html [ ImageOnlyFailure ] 3626 fast/text/variations/font-face-format.html [ ImageOnlyFailure ] 3627 fast/text/variations/font-face-format-woff2.html [ ImageOnlyFailure ] 3621 3628 imported/blink/scrollbars/avoid-double-scrollbars-when-html-element-is-not-the-renderview.html [ ImageOnlyFailure ] 3622 3629 imported/w3c/i18n/bidi/bidi-plaintext-011.html [ ImageOnlyFailure ] … … 3686 3693 http/wpt/fetch/response-status-text.html [ Failure ] 3687 3694 js/dom/builtin-getter-name.html [ Failure ] 3695 fast/text/variations/font-selection-font-weight.html [ ImageOnlyFailure ] 3688 3696 fast/forms/file/entries-api/webkitdirectory-open-panel.html [ Skip ] 3689 3697 … … 3733 3741 # Animated image throttling behaves differently on WK1. 3734 3742 svg/animations/animated-svg-image-outside-viewport-paused.html [ Skip ] 3743 3744 # This test requires Skia, which isn't available on Windows. 3745 webkit.org/b/174079 fast/text/variations/skia-postscript-name.html [ ImageOnlyFailure ] 3735 3746 3736 3747 # Beacon is not supported on WK1. -
trunk/Source/WTF/ChangeLog
r245606 r245647 1 2019-05-22 Ryan Haddad <ryanhaddad@apple.com> 2 3 Unreviewed, rolling out r245598. 4 5 Breaks watchOS build. 6 7 Reverted changeset: 8 9 "font-optical-sizing applies the wrong variation value" 10 https://bugs.webkit.org/show_bug.cgi?id=197528 11 https://trac.webkit.org/changeset/245598 12 1 13 2019-05-21 Ross Kirsling <ross.kirsling@sony.com> 2 14 -
trunk/Source/WTF/wtf/Platform.h
r245598 r245647 1556 1556 #endif 1557 1557 1558 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000) || (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 50000) || (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 120000)1559 #define HAVE_CORETEXT_AUTO_OPTICAL_SIZING 11560 #endif1561 -
trunk/Source/WebCore/ChangeLog
r245644 r245647 1 2019-05-22 Ryan Haddad <ryanhaddad@apple.com> 2 3 Unreviewed, rolling out r245598. 4 5 Breaks watchOS build. 6 7 Reverted changeset: 8 9 "font-optical-sizing applies the wrong variation value" 10 https://bugs.webkit.org/show_bug.cgi?id=197528 11 https://trac.webkit.org/changeset/245598 12 1 13 2019-05-22 Daniel Bates <dabates@apple.com> 2 14 -
trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp
r245598 r245647 485 485 if (!tables) 486 486 return; 487 bool foundStat = false;488 bool foundTrak = false;489 487 auto size = CFArrayGetCount(tables.get()); 490 488 for (CFIndex i = 0; i < size; ++i) { … … 500 498 break; 501 499 case 'STAT': 502 foundStat = true;503 500 variationType = VariationType::OpenType18; 504 501 break; … … 511 508 openTypeShaping = true; 512 509 break; 513 case 'trak':514 foundTrak = true;515 break;516 510 } 517 511 } 518 if (foundStat && foundTrak)519 trackingType = TrackingType::Automatic; 520 else if (foundTrak)521 trackingType = TrackingType::Manual;522 }523 524 enum class VariationType : uint8_t { NotVariable, TrueTypeGX, OpenType18,};512 } 513 514 enum class VariationType { 515 NotVariable, 516 TrueTypeGX, 517 OpenType18 518 }; 525 519 VariationType variationType { VariationType::NotVariable }; 526 enum class TrackingType : uint8_t { None, Automatic, Manual, };527 TrackingType trackingType { TrackingType::None };528 520 bool openTypeShaping { false }; 529 521 bool aatShaping { false }; 530 522 }; 531 523 532 RetainPtr<CTFontRef> preparePlatformFont(CTFontRef originalFont, const FontDescription& fontDescription, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, FontSelectionSpecifiedCapabilities fontFaceCapabilities, bool applyWeightWidthSlopeVariations)533 { 534 if (!originalFont)535 return originalFont; 536 524 RetainPtr<CTFontRef> preparePlatformFont(CTFontRef originalFont, const FontDescription& fontDescription, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, FontSelectionSpecifiedCapabilities fontFaceCapabilities, float size, bool applyWeightWidthSlopeVariations) 525 { 526 bool alwaysAddVariations = false; 527 528 // FIXME: Remove when <rdar://problem/29859207> is fixed 537 529 #if ENABLE(VARIATION_FONTS) 538 530 auto defaultValues = defaultVariationValues(originalFont); 531 alwaysAddVariations = !defaultValues.isEmpty(); 539 532 540 533 auto fontSelectionRequest = fontDescription.fontSelectionRequest(); … … 543 536 #else 544 537 UNUSED_PARAM(fontFaceCapabilities); 538 UNUSED_PARAM(size); 545 539 UNUSED_PARAM(applyWeightWidthSlopeVariations); 546 540 #endif … … 551 545 auto textRenderingMode = fontDescription.textRenderingMode(); 552 546 553 FontType fontType { originalFont }; 554 555 bool forceOpticalSizingOn = fontOpticalSizing == FontOpticalSizing::Enabled && fontType.variationType == FontType::VariationType::TrueTypeGX && defaultValues.contains({{'o', 'p', 's', 'z'}}); 556 bool forceVariations = defaultValues.contains({{'w', 'g', 'h', 't'}}) || defaultValues.contains({{'w', 'd', 't', 'h'}}) || (fontStyleAxis == FontStyleAxis::ital && defaultValues.contains({{'i', 't', 'a', 'l'}})) || (fontStyleAxis == FontStyleAxis::slnt && defaultValues.contains({{'s', 'l', 'n', 't'}})); 557 558 // We might want to check fontType.trackingType == FontType::TrackingType::Manual here, but in order to maintain compatibility with the rest of the system, we don't. 559 bool noFontFeatureSettings = features.isEmpty(); 560 bool noFontVariationSettings = !forceVariations && variations.isEmpty(); 561 bool textRenderingModeIsAuto = textRenderingMode == TextRenderingMode::AutoTextRendering; 562 bool variantSettingsIsNormal = variantSettings.isAllNormal(); 563 bool dontNeedToApplyOpticalSizing = fontOpticalSizing == FontOpticalSizing::Enabled && !forceOpticalSizingOn; 564 bool fontFaceDoesntSpecifyFeatures = !fontFaceFeatures || fontFaceFeatures->isEmpty(); 565 bool fontFaceDoesntSpecifyVariations = !fontFaceVariantSettings || fontFaceVariantSettings->isAllNormal(); 566 if (noFontFeatureSettings && noFontVariationSettings && textRenderingModeIsAuto && variantSettingsIsNormal && dontNeedToApplyOpticalSizing && fontFaceDoesntSpecifyFeatures && fontFaceDoesntSpecifyVariations) 547 if (!originalFont || (!features.size() && (!alwaysAddVariations && variations.isEmpty()) && (textRenderingMode == TextRenderingMode::AutoTextRendering) && variantSettings.isAllNormal() 548 && (!fontFaceFeatures || !fontFaceFeatures->size()) && (!fontFaceVariantSettings || fontFaceVariantSettings->isAllNormal()))) 567 549 return originalFont; 568 550 … … 598 580 for (auto& newFeature : features) 599 581 featuresToBeApplied.set(newFeature.tag(), newFeature.value()); 582 583 FontType fontType(originalFont); 600 584 601 585 #if ENABLE(VARIATION_FONTS) … … 636 620 } 637 621 622 if (fontOpticalSizing == FontOpticalSizing::Enabled) { 623 const float pxToPtRatio = 3.0f / 4; 624 applyVariation({{'o', 'p', 's', 'z'}}, size * pxToPtRatio); 625 } 626 638 627 for (auto& newVariation : variations) 639 628 applyVariation(newVariation.tag(), newVariation.value()); 629 640 630 #endif // ENABLE(VARIATION_FONTS) 641 631 … … 666 656 #endif 667 657 668 if (forceOpticalSizingOn || textRenderingMode == TextRenderingMode::OptimizeLegibility) { 669 #if HAVE(CORETEXT_AUTO_OPTICAL_SIZING) 670 CFDictionaryAddValue(attributes.get(), kCTFontOpticalSizeAttribute, CFSTR("auto")); 671 #else 672 auto size = CTFontGetSize(originalFont); 658 if (textRenderingMode == TextRenderingMode::OptimizeLegibility) { 659 CGFloat size = CTFontGetSize(originalFont); 673 660 auto sizeNumber = adoptCF(CFNumberCreate(kCFAllocatorDefault, kCFNumberCGFloatType, &size)); 674 661 CFDictionaryAddValue(attributes.get(), kCTFontOpticalSizeAttribute, sizeNumber.get()); 675 #endif 676 } else if (fontOpticalSizing == FontOpticalSizing::Disabled) { 677 #if HAVE(CORETEXT_AUTO_OPTICAL_SIZING) 678 CFDictionaryAddValue(attributes.get(), kCTFontOpticalSizeAttribute, CFSTR("none")); 679 #endif 680 } 681 662 } 682 663 auto descriptor = adoptCF(CTFontDescriptorCreateWithAttributes(attributes.get())); 683 664 auto result = adoptCF(CTFontCreateCopyWithAttributes(originalFont, CTFontGetSize(originalFont), nullptr, descriptor.get())); … … 1243 1224 if (!fontLookup.result) 1244 1225 fontLookup = platformFontLookupWithFamily(family, request, size, fontDescription.shouldAllowUserInstalledFonts()); 1245 return preparePlatformFont(fontLookup.result.get(), fontDescription, fontFaceFeatures, fontFaceVariantSettings, fontFaceCapabilities, !fontLookup.createdFromPostScriptName);1226 return preparePlatformFont(fontLookup.result.get(), fontDescription, fontFaceFeatures, fontFaceVariantSettings, fontFaceCapabilities, size, !fontLookup.createdFromPostScriptName); 1246 1227 } 1247 1228 … … 1394 1375 1395 1376 auto result = lookupFallbackFont(platformData.font(), description.weight(), description.locale(), characters, length); 1396 result = preparePlatformFont(result.get(), description, nullptr, nullptr, { } );1377 result = preparePlatformFont(result.get(), description, nullptr, nullptr, { }, description.computedSize()); 1397 1378 1398 1379 if (!result) -
trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.h
r245598 r245647 51 51 }; 52 52 53 RetainPtr<CTFontRef> preparePlatformFont(CTFontRef, const FontDescription&, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, FontSelectionSpecifiedCapabilities fontFaceCapabilities, bool applyWeightWidthSlopeVariations = true);53 RetainPtr<CTFontRef> preparePlatformFont(CTFontRef, const FontDescription&, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, FontSelectionSpecifiedCapabilities fontFaceCapabilities, float size, bool applyWeightWidthSlopeVariations = true); 54 54 SynthesisPair computeNecessarySynthesis(CTFontRef, const FontDescription&, bool isPlatformFont = false); 55 55 RetainPtr<CTFontRef> platformFontWithFamilySpecialCase(const AtomicString& family, FontSelectionRequest, float size, AllowUserInstalledFonts); -
trunk/Source/WebCore/platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp
r245598 r245647 109 109 #endif 110 110 111 font = preparePlatformFont(font.get(), fontDescription, nullptr, nullptr, { } );111 font = preparePlatformFont(font.get(), fontDescription, nullptr, nullptr, { }, fontDescription.computedSize()); 112 112 113 113 bool syntheticBold, syntheticOblique; -
trunk/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp
r245598 r245647 47 47 FontWidthVariant widthVariant = fontDescription.widthVariant(); 48 48 RetainPtr<CTFontRef> font = adoptCF(CTFontCreateWithFontDescriptor(modifiedFontDescriptor.get(), size, nullptr)); 49 font = preparePlatformFont(font.get(), fontDescription, &fontFaceFeatures, &fontFaceVariantSettings, fontFaceCapabilities );49 font = preparePlatformFont(font.get(), fontDescription, &fontFaceFeatures, &fontFaceVariantSettings, fontFaceCapabilities, fontDescription.computedSize()); 50 50 ASSERT(font); 51 51 return FontPlatformData(font.get(), size, bold, italic, orientation, widthVariant, fontDescription.textRenderingMode());
Note: See TracChangeset
for help on using the changeset viewer.