Changeset 284677 in webkit
- Timestamp:
- Oct 22, 2021, 6:24:11 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/platform/ios-wk2/TestExpectations (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/graphics/FontCascade.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r284667 r284677 1 2021-10-22 Alan Bujtas <zalan@apple.com> 2 3 FontCascade::widthForSimpleText fails to produce matching measured width for monospace font 4 https://bugs.webkit.org/show_bug.cgi?id=232104 5 <rdar://83991027> 6 7 Reviewed by Antti Koivisto. 8 9 * platform/ios-wk2/TestExpectations: 10 1 11 2021-10-21 Cathie Chen <cathiechen@igalia.com> 2 12 -
trunk/LayoutTests/platform/ios-wk2/TestExpectations
r284659 r284677 1205 1205 1206 1206 webkit.org/b/163362 platform/ios/ios/plugin/youtube-flash-plugin-iframe.html [ Pass Failure ] 1207 1208 webkit.org/b/231378 platform/ios/fast/text/system-monospaced-numbers.html [ Failure ]1209 1207 1210 1208 webkit.org/b/164960 http/tests/security/module-correct-mime-types.html [ Slow ] -
trunk/Source/WebCore/ChangeLog
r284676 r284677 1 2021-10-22 Alan Bujtas <zalan@apple.com> 2 3 FontCascade::widthForSimpleText fails to produce matching measured width for monospace font 4 https://bugs.webkit.org/show_bug.cgi?id=232104 5 <rdar://83991027> 6 7 Reviewed by Antti Koivisto. 8 9 Adjust widthForSimpleText to match WidthIterator's logic as the comment says: 10 11 "This is needed only to match the result of the slow path 12 Same glyph widths but different floating point arithmetic can produce different run width." 13 (see r213008) 14 15 * platform/graphics/FontCascade.cpp: 16 (WebCore::FontCascade::widthForSimpleText const): 17 1 18 2021-10-22 Carlos Garcia Campos <cgarcia@igalia.com> 2 19 -
trunk/Source/WebCore/platform/graphics/FontCascade.cpp
r283863 r284677 312 312 313 313 GlyphBuffer glyphBuffer; 314 float runWidth = 0;314 float beforeWidth = 0; 315 315 auto& font = primaryFont(); 316 316 for (unsigned i = 0; i < text.length(); ++i) { 317 317 auto glyph = glyphDataForCharacter(text[i], false).glyph; 318 318 auto glyphWidth = font.widthForGlyph(glyph); 319 runWidth += glyphWidth;319 beforeWidth += glyphWidth; 320 320 glyphBuffer.add(glyph, font, glyphWidth, i); 321 321 } … … 324 324 // This is needed only to match the result of the slow path. 325 325 // Same glyph widths but different floating point arithmetic can produce different run width. 326 float runWidthDifferenceWithTransformApplied = -runWidth;326 float afterWidth = 0; 327 327 for (size_t i = 0; i < glyphBuffer.size(); ++i) 328 runWidthDifferenceWithTransformApplied += WebCore::width(glyphBuffer.advanceAt(i)); 329 runWidth += runWidthDifferenceWithTransformApplied; 330 331 runWidth += WebCore::width(initialAdvance); 328 afterWidth += WebCore::width(glyphBuffer.advanceAt(i)); 329 auto additionalAdvance = afterWidth - beforeWidth; 330 331 auto finalWidth = beforeWidth + additionalAdvance; 332 finalWidth += WebCore::width(initialAdvance); 332 333 333 334 if (cacheEntry) 334 *cacheEntry = runWidth;335 return runWidth;335 *cacheEntry = finalWidth; 336 return finalWidth; 336 337 } 337 338
Note:
See TracChangeset
for help on using the changeset viewer.