Skip to content

Commit

Permalink
Switch from textColorForCaretSelection to returning the information i…
Browse files Browse the repository at this point in the history
…n the stylingDictionary to remove more SPI.

https://bugs.webkit.org/show_bug.cgi?id=265706
rdar://119057506

Reviewed by Wenson Hsieh.

In our continued effort to move off of SPI, remove this call and instead return the information in a API path.

* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView textStylingAtPosition:inDirection:]):
(-[WKContentView textColorForCaretSelection]): Deleted.

Canonical link: https://commits.webkit.org/271507@main
  • Loading branch information
megangardner committed Dec 4, 2023
1 parent 7d7b457 commit 7b86660
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
Original file line number Diff line number Diff line change
Expand Up @@ -4255,13 +4255,16 @@ - (void)toggleStrikeThroughForWebView:(id)sender

- (NSDictionary *)textStylingAtPosition:(UITextPosition *)position inDirection:(UITextStorageDirection)direction
{
if (!position || !_page->editorState().isContentRichlyEditable)
return nil;

NSMutableDictionary* result = [NSMutableDictionary dictionary];
[result setObject:[UIColor blackColor] forKey:NSForegroundColorAttributeName];
if (!position || !_page->editorState().isContentRichlyEditable)
return result;

if (!_page->editorState().postLayoutData)
return nil;
return result;

[result setObject:[UIColor blackColor] forKey:NSForegroundColorAttributeName];

auto typingAttributes = _page->editorState().postLayoutData->typingAttributes;
CTFontSymbolicTraits symbolicTraits = 0;
if (typingAttributes.contains(WebKit::TypingAttribute::Bold))
Expand Down Expand Up @@ -7545,11 +7548,6 @@ - (void)selectAll
RELEASE_ASSERT_ASYNC_TEXT_INTERACTIONS_DISABLED();
}

- (UIColor *)textColorForCaretSelection
{
return [UIColor blackColor];
}

- (UIFont *)fontForCaretSelection
{
UIFont *font = _autocorrectionData.font.get();
Expand Down

0 comments on commit 7b86660

Please sign in to comment.