Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ab767ea6e1b799ade27c2e30237ed8eb9d870ce7
      
https://github.com/WebKit/WebKit/commit/ab767ea6e1b799ade27c2e30237ed8eb9d870ce7
  Author: Ruthvik Konda <[email protected]>
  Date:   2026-05-13 (Wed, 13 May 2026)

  Changed paths:
    M Source/WebCore/editing/cocoa/AttributedString.mm
    M Source/WebCore/editing/cocoa/HTMLConverter.mm

  Log Message:
  -----------
  Use protect() instead of RetainPtr { } in editing code
https://bugs.webkit.org/show_bug.cgi?id=314369
rdar://176524589

Reviewed by Ryosuke Niwa.

Mechanical migration from RetainPtr { expr } to protect(expr) in editing
code, aligning with the codebase-wide transition away from brace-initialized
smart pointer temporaries. All instances are NS/ObjC types, which use the
protect() overload for IsNSType<T> in RetainPtr.h.

Also replaces two isKindOfClass + C-style cast patterns with the type-safe
dynamic_objc_cast<> pattern. Because NSShadow and NSPresentationIntent are
soft-linked from UIKit on iOS (see pal/ios/UIKitSoftLink.h), the default
ObjCTypeCastTraits trait that uses [T class] does not work cross-platform.
Adding SPECIALIZE_OBJC_TYPE_TRAITS specializations under #if 
PLATFORM(IOS_FAMILY)
(next to the existing UIImage specialization) teaches dynamic_objc_cast<> to
use the soft-linked class singletons on iOS while the default [T class]
behavior continues to work on macOS.

No new tests needed (no behavioral change, style-only refactor).

* Source/WebCore/editing/cocoa/AttributedString.mm:
(WebCore::attributedStringFromAttachment):
(WebCore::AttributedString::Range::Range):
* Source/WebCore/editing/cocoa/HTMLConverter.mm:
(WebCore::defaultFontForConversionToAttributedString):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to