Changeset 288107 in webkit
- Timestamp:
- Jan 17, 2022, 7:02:17 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 5 edited
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/default-ignorable-complex-expected.html (added)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/default-ignorable-complex.html (added)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/default-ignorable-expected.html (added)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-text/white-space/default-ignorable.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/graphics/ComplexTextController.cpp (modified) (1 diff)
-
Source/WebCore/platform/graphics/FontCascade.h (modified) (1 diff)
-
Source/WebCore/platform/graphics/WidthIterator.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r288093 r288107 1 2022-01-17 Myles C. Maxfield <mmaxfield@apple.com> 2 3 REGRESSION(r281389): using font-variant-ligatures causes Unicode bidi isolation control characters to render 4 https://bugs.webkit.org/show_bug.cgi?id=235053 5 <rdar://problem/87425066> 6 7 Reviewed by Darin Adler. 8 9 * web-platform-tests/css/css-text/white-space/default-ignorable-complex-expected.html: Added. 10 * web-platform-tests/css/css-text/white-space/default-ignorable-complex.html: Added. 11 * web-platform-tests/css/css-text/white-space/default-ignorable-expected.html: Added. 12 * web-platform-tests/css/css-text/white-space/default-ignorable.html: Added. 13 1 14 2022-01-17 Youenn Fablet <youenn@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r288104 r288107 1 2022-01-17 Myles C. Maxfield <mmaxfield@apple.com> 2 3 REGRESSION(r281389): using font-variant-ligatures causes Unicode bidi isolation control characters to render 4 https://bugs.webkit.org/show_bug.cgi?id=235053 5 <rdar://problem/87425066> 6 7 Reviewed by Darin Adler. 8 9 The spec says (https://drafts.csswg.org/css-text-3/#white-space-processing) 10 11 > unsupported Default_ignorable characters must be ignored for text rendering. 12 13 Previously, we were handling this by mapping the characters to the zero width space character. r281389 changed 14 that to be more faithful to the original string (and not do the mapping). One somewhat unexpected result of 15 this patch was that, now that we're not mapping these code points to the zero width space character, fewer fonts 16 on the system will support those code points. It became much more common for no font at all to support the code 17 point in question. r281389 handled the situation where the code points were supported by a font but shouldn't be 18 rendered, but didn't handle the case where the code points *weren't* supported by any fonts (in the complex text 19 codepath). This patch updates that path to handle it. 20 21 This patch also replaces our previous hardcoded list of Default_ignorable characters with the proper call to ICU 22 to check the Unicode property. It does this in both the fast text codepath and the simple text codepath, to make 23 sure they match. 24 25 Tests: imported/w3c/web-platform-tests/css/css-text/white-space/default-ignorable-complex.html 26 imported/w3c/web-platform-tests/css/css-text/white-space/default-ignorable.html 27 28 * platform/graphics/ComplexTextController.cpp: 29 (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): 30 * platform/graphics/WidthIterator.cpp: 31 (WebCore::WidthIterator::applyCSSVisibilityRules): 32 1 33 2022-01-17 ChangSeok Oh <changseok@webkit.org> 2 34 -
trunk/Source/WebCore/platform/graphics/ComplexTextController.cpp
r286637 r288107 829 829 unsigned r = m_indexBegin; 830 830 while (r < m_indexEnd) { 831 m_coreTextIndices.uncheckedAppend(r);831 auto currentIndex = r; 832 832 UChar32 character; 833 833 U16_NEXT(m_characters, r, m_stringLength, character); 834 // https://drafts.csswg.org/css-text-3/#white-space-processing 835 // "Unsupported Default_ignorable characters must be ignored for text rendering." 836 if (!FontCascade::isCharacterWhoseGlyphsShouldBeDeletedForTextRendering(character)) 837 m_coreTextIndices.uncheckedAppend(currentIndex); 834 838 } 835 839 m_glyphCount = m_coreTextIndices.size(); -
trunk/Source/WebCore/platform/graphics/FontCascade.h
r287250 r288107 261 261 FontSelector* fontSelector() const; 262 262 static bool treatAsSpace(UChar32 c) { return c == space || c == tabCharacter || c == newlineCharacter || c == noBreakSpace; } 263 static bool isCharacterWhoseGlyphsShouldBeDeletedForTextRendering(UChar32 character) 264 { 265 // https://drafts.csswg.org/css-text-3/#white-space-processing 266 // "Unsupported Default_ignorable characters must be ignored for text rendering." 267 return (character >= nullCharacter && character < space) 268 || (character >= deleteCharacter && character < noBreakSpace) 269 || character == objectReplacementCharacter 270 || u_hasBinaryProperty(character, UCHAR_DEFAULT_IGNORABLE_CODE_POINT); 271 } 272 // FIXME: Callers of treatAsZeroWidthSpace() and treatAsZeroWidthSpaceInComplexScript() should probably be calling isCharacterWhoseGlyphsShouldBeDeletedForTextRendering() instead. 263 273 static bool treatAsZeroWidthSpace(UChar32 c) { return treatAsZeroWidthSpaceInComplexScript(c) || c == zeroWidthNonJoiner || c == zeroWidthJoiner; } 264 274 static bool treatAsZeroWidthSpaceInComplexScript(UChar32 c) { return c < space || (c >= deleteCharacter && c < noBreakSpace) || c == softHyphen || c == zeroWidthSpace || (c >= leftToRightMark && c <= rightToLeftMark) || (c >= leftToRightEmbed && c <= rightToLeftOverride) || c == zeroWidthNoBreakSpace || c == objectReplacementCharacter; } -
trunk/Source/WebCore/platform/graphics/WidthIterator.cpp
r287724 r288107 617 617 adjustForSyntheticBold(i); 618 618 619 if ((characterResponsibleForThisGlyph >= nullCharacter && characterResponsibleForThisGlyph < space) 620 || (characterResponsibleForThisGlyph >= deleteCharacter && characterResponsibleForThisGlyph < noBreakSpace)) { 621 deleteGlyph(i); 622 continue; 623 } 624 625 switch (characterResponsibleForThisGlyph) { 626 case softHyphen: 627 case leftToRightMark: 628 case rightToLeftMark: 629 case leftToRightEmbed: 630 case rightToLeftEmbed: 631 case leftToRightOverride: 632 case rightToLeftOverride: 633 case leftToRightIsolate: 634 case rightToLeftIsolate: 635 case zeroWidthNonJoiner: 636 case zeroWidthJoiner: 637 case popDirectionalFormatting: 638 case popDirectionalIsolate: 639 case firstStrongIsolate: 640 case objectReplacementCharacter: 641 case zeroWidthNoBreakSpace: 619 // https://drafts.csswg.org/css-text-3/#white-space-processing 620 // "Unsupported Default_ignorable characters must be ignored for text rendering." 621 if (FontCascade::isCharacterWhoseGlyphsShouldBeDeletedForTextRendering(characterResponsibleForThisGlyph)) { 642 622 deleteGlyph(i); 643 623 continue;
Note:
See TracChangeset
for help on using the changeset viewer.