Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "[Cocoa] objectForEqualityCheck() is no longer necessary"
https://bugs.webkit.org/show_bug.cgi?id=263136 rdar://116934547 Reviewed by Cameron McCormack. This reverts commit dc989b3. 267312@main [1] broke the following test: imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-overrides-uax-behavior-011.html Before [1] we used to define a derived object from the Fonts we were trying to compare, because we considered that CFEqual() would do a shallow comparison. Since it is possible to generate two font objects (with different pointers) representing the same font object, a shallow comparison wouldn’t work for us. [1] states that CFEqual() "now” does a deep comparison, and the derived object would have no use anymore. However, at Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm: ComplexTextController::collectComplexTextRunsForCharacters: We observe that the comparisons before and after [1] produce different results, for the specific test that is failing. More specifically we can reduce it to the render of “X͏”: -> Without [1] the following is never true: if (!safeCFEqual(runFontEqualityObject.get(), font->platformData().objectForEqualityCheck().get())) This means that the fonts are considered equal. However: -> With [1] the following is always true: if (!safeCFEqual(runCTFont, font->platformData().ctFont())) This means that the run’s font, acquired after shaping is not the same as the font passed, so we will try to add it to the fallback font list. * Source/WebCore/platform/graphics/FontPlatformData.h: * Source/WebCore/platform/graphics/coretext/FontPlatformDataCoreText.cpp: (WebCore::FontPlatformData::objectForEqualityCheck): (WebCore::FontPlatformData::objectForEqualityCheck const): * Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm: (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Canonical link: https://commits.webkit.org/273377@main
- Loading branch information