[webkit-changes] [WebKit/WebKit] f37fd4: Books should not render Object Replacement Character

Vitor Roriz noreply at github.com
Tue Jan 9 17:08:23 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f37fd4bfde59a030ecd63064e33ba96752009532
      https://github.com/WebKit/WebKit/commit/f37fd4bfde59a030ecd63064e33ba96752009532
  Author: Vitor Roriz <vitor.roriz at apple.com>
  Date:   2024-01-09 (Tue, 09 Jan 2024)

  Changed paths:
    M Source/WebCore/platform/graphics/FontCascade.h

  Log Message:
  -----------
  Books should not render Object Replacement Character
https://bugs.webkit.org/show_bug.cgi?id=267265
rdar://117087591

Reviewed by Tim Nguyen.

Some existent EPUB books contain undesired
object replacement characters (U+0xFFFC).
This might happen, for example, when exporting
tools wrongly introduce these characters next to
images, for uknown reasons.

Although the real bug comes from a bug in this kind of
exporting tool, this hurts users, since, even if the root
cause of this problem is fixed, there are several
books already published with these characters.

Therefore, we are creating an exception for the Books App.
If we identify that WebKit is running in Books context,
we will skip rendering the object replacement characters.

This won't solve the problem for other epub reders accessed
from the browser. However, this behavior is consistent with
other browser engines, that also render the object replacement
character, since CSS Font specification doesn't tell otherwise.

 * Source/WebCore/platform/graphics/FontCascade.h:
 (WebCore::FontCascade::isInvisibleReplacementObjectCharacter):
 (WebCore::FontCascade::isCharacterWhoseGlyphsShouldBeDeletedForTextRendering):
 (WebCore::FontCascade::treatAsZeroWidthSpaceInComplexScript):

Canonical link: https://commits.webkit.org/272830@main




More information about the webkit-changes mailing list