Skip to content
Permalink
Browse files
Stop using _UIApplicationUsesLegacyUI()
https://bugs.webkit.org/show_bug.cgi?id=178680
<rdar://problem/35131949>

Reviewed by Dan Bernstein.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/forms/WKFormSelectPopover.mm:
(-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]):
(-[WKSelectPopover initWithView:hasGroups:]):
Resolve _UIApplicationUsesLegacyUI to false and simplify.


Canonical link: https://commits.webkit.org/194853@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223857 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
hortont424 committed Oct 23, 2017
1 parent d48aff9 commit 3828829a0a8a2f21bb9967209eea9fac67fb3506
Showing with 17 additions and 16 deletions.
  1. +14 −0 Source/WebKit/ChangeLog
  2. +0 −1 Source/WebKit/Platform/spi/ios/UIKitSPI.h
  3. +3 −15 Source/WebKit/UIProcess/ios/forms/WKFormSelectPopover.mm
@@ -1,3 +1,17 @@
2017-10-23 Tim Horton <timothy_horton@apple.com>

Stop using _UIApplicationUsesLegacyUI()
https://bugs.webkit.org/show_bug.cgi?id=178680
<rdar://problem/35131949>

Reviewed by Dan Bernstein.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/forms/WKFormSelectPopover.mm:
(-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]):
(-[WKSelectPopover initWithView:hasGroups:]):
Resolve _UIApplicationUsesLegacyUI to false and simplify.

2017-10-23 Ryan Haddad <ryanhaddad@apple.com>

Unreviewed, suppress deprecation warnings to fix the build.
@@ -982,7 +982,6 @@ extern NSString * const UIKeyboardIsLocalUserInfoKey;
extern UIApplication *UIApp;
BOOL _UIApplicationIsExtension(void);
void _UIApplicationLoadWebKit(void);
BOOL _UIApplicationUsesLegacyUI(void);

void UIImageDataWriteToSavedPhotosAlbum(NSData *imageData, id completionTarget, SEL completionSelector, void *contextInfo);

@@ -264,11 +264,8 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
ASSERT(textRect.size.width > 0.0);

// Assume all cells have the same available text width.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
CGFloat initialFontSize = _UIApplicationUsesLegacyUI() ? UITableViewCellDefaultFontSize : cell.textLabel.font.pointSize;
UIFont *font = _UIApplicationUsesLegacyUI() ? [UIFont boldSystemFontOfSize:initialFontSize] : cell.textLabel.font;
#pragma clang diagnostic pop
UIFont *font = cell.textLabel.font;
CGFloat initialFontSize = font.pointSize;
ASSERT(initialFontSize);
if (textRect.size.width != _maximumTextWidth || _fontSize == 0) {
_maximumTextWidth = textRect.size.width;
@@ -393,19 +390,10 @@ - (instancetype)initWithView:(WKContentView *)view hasGroups:(BOOL)hasGroups
UIViewController *popoverViewController = _tableViewController.get();
UINavigationController *navController = nil;
NSString *title = view.assistedNodeInformation.title;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
BOOL needsNavigationController = (self.view && _UIApplicationUsesLegacyUI()) || [title length];
#pragma clang diagnostic pop
BOOL needsNavigationController = !!title.length;
if (needsNavigationController) {
navController = [[UINavigationController alloc] initWithRootViewController:_tableViewController.get()];
popoverViewController = navController;

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
if (self.view.assistedNodeInformation.isMultiSelect && _UIApplicationUsesLegacyUI())
#pragma clang diagnostic pop
_tableViewController.get().navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(_userActionDismissedPopover:)] autorelease];
}

CGSize popoverSize = [_tableViewController.get().tableView sizeThatFits:CGSizeMake(320, CGFLOAT_MAX)];

0 comments on commit 3828829

Please sign in to comment.