Bug 181006

Summary: Element fullscreen interface should display the location
Product: WebKit Reporter: Jeremy Jones <jeremyj-wk>
Component: WebKit2Assignee: Jeremy Jones <jeremyj-wk>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cdumez, cmarcelo, commit-queue, dbates, ews-watchlist, fred.wang, jer.noble, simon.fraser, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: iPhone / iPad   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
simon.fraser: review+, simon.fraser: commit-queue-
Patch for landing
none
Patch for landing
none
Patch for landing none

Jeremy Jones
Reported 2017-12-19 15:41:35 PST
Element fullscreen interface should display the locaiton.
Attachments
Patch (50.14 KB, patch)
2017-12-19 15:49 PST, Jeremy Jones
no flags
Patch (42.54 KB, patch)
2017-12-19 19:23 PST, Jeremy Jones
no flags
Patch (42.61 KB, patch)
2017-12-19 20:00 PST, Jeremy Jones
no flags
Patch (43.93 KB, patch)
2017-12-19 20:34 PST, Jeremy Jones
simon.fraser: review+
simon.fraser: commit-queue-
Patch for landing (45.00 KB, patch)
2017-12-21 01:09 PST, Jeremy Jones
no flags
Patch for landing (45.32 KB, patch)
2017-12-21 01:37 PST, Jeremy Jones
no flags
Patch for landing (45.37 KB, patch)
2017-12-21 02:18 PST, Jeremy Jones
no flags
Jeremy Jones
Comment 1 2017-12-19 15:43:21 PST
Jeremy Jones
Comment 2 2017-12-19 15:49:04 PST
Tim Horton
Comment 3 2017-12-19 16:01:14 PST
Comment on attachment 329843 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=329843&action=review > Source/WebCore/platform/mac/WebCoreNSURLExtras.mm:1273 > +NSString *simplifiedUserVisibleString(NSURL *url) I am somewhat surprised to see this code end up in WebKit! We should probably have a discussion. > Source/WebCore/platform/mac/WebCoreNSURLExtras.mm:1336 > + result = [NSString stringWithFormat:@"%C%@", WBSLeftToRightMarkCharacter, [result substringFromIndex:lengthOfPrefixToSuppress]]; Surely this won’t work (the WBS thing).
Tim Horton
Comment 4 2017-12-19 16:01:58 PST
Comment on attachment 329843 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=329843&action=review >> Source/WebCore/platform/mac/WebCoreNSURLExtras.mm:1273 >> +NSString *simplifiedUserVisibleString(NSURL *url) > > I am somewhat surprised to see this code end up in WebKit! We should probably have a discussion. Also, you should note that other parts of WebKit (Drag and Drop) use LinkPresentation for this.
Tim Horton
Comment 5 2017-12-19 16:42:59 PST
Comment on attachment 329843 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=329843&action=review >>> Source/WebCore/platform/mac/WebCoreNSURLExtras.mm:1273 >>> +NSString *simplifiedUserVisibleString(NSURL *url) >> >> I am somewhat surprised to see this code end up in WebKit! We should probably have a discussion. > > Also, you should note that other parts of WebKit (Drag and Drop) use LinkPresentation for this. Actually, just r- for propagating this code to a third place.
Jeremy Jones
Comment 6 2017-12-19 19:23:57 PST
EWS Watchlist
Comment 7 2017-12-19 19:27:12 PST
Attachment 329876 [details] did not pass style-queue: ERROR: Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.mm:221: This { should be at the end of the previous line [whitespace/braces] [4] Total errors found: 1 in 5 files If any of these errors are false positives, please file a bug against check-webkit-style.
Jeremy Jones
Comment 8 2017-12-19 19:49:50 PST
(In reply to Tim Horton from comment #5) > Comment on attachment 329843 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=329843&action=review > > >>> Source/WebCore/platform/mac/WebCoreNSURLExtras.mm:1273 > >>> +NSString *simplifiedUserVisibleString(NSURL *url) > >> > >> I am somewhat surprised to see this code end up in WebKit! We should probably have a discussion. > > > > Also, you should note that other parts of WebKit (Drag and Drop) use LinkPresentation for this. > > Actually, just r- for propagating this code to a third place. Deleted the redundant code and switched to link presentation.
Jeremy Jones
Comment 9 2017-12-19 20:00:21 PST
EWS Watchlist
Comment 10 2017-12-19 20:03:26 PST
Attachment 329883 [details] did not pass style-queue: ERROR: Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.mm:221: This { should be at the end of the previous line [whitespace/braces] [4] Total errors found: 1 in 5 files If any of these errors are false positives, please file a bug against check-webkit-style.
Jeremy Jones
Comment 11 2017-12-19 20:34:39 PST
EWS Watchlist
Comment 12 2017-12-19 20:36:16 PST
Attachment 329888 [details] did not pass style-queue: ERROR: Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.mm:220: This { should be at the end of the previous line [whitespace/braces] [4] Total errors found: 1 in 7 files If any of these errors are false positives, please file a bug against check-webkit-style.
Tim Horton
Comment 13 2017-12-20 10:46:27 PST
Comment on attachment 329888 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=329888&action=review > Source/WebCore/PAL/pal/spi/cocoa/LinkPresentationSPI.h:40 > +#endif // (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 100300) Do we really still care about < 10.3? > Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.mm:594 > + NSString *domain = [url _lp_simplifiedDisplayString]; You need to make this more conditional, like the other place we use it, because it’s missing in the base system (working on it). For now just fall back to the non-simplified version.
Simon Fraser (smfr)
Comment 14 2017-12-20 11:11:33 PST
Comment on attachment 329888 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=329888&action=review > Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.mm:242 > + RetainPtr<UIImage> lockImage = [UIImage imageNamed:lockImageName inBundle:bundle compatibleWithTraitCollection:nil]; The RetainPtr<UIImage> here just adds extra ref churn. The result of -imageNamed: is autoreleased, so you can just use a raw pointer. > Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.mm:244 > + [[_locationButton imageView] setTintColor:trustedSite?greenTint:whiteTint]; Spaces around the ? and : > Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.mm:268 > + [_cancelButton setTitle:@"Done" forState:UIControlStateNormal]; Why is this not localized? > Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.mm:289 > + [bottom setPriority:UILayoutPriorityRequired-1]; Spaces around the - > Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.mm:346 > + [UIView animateWithDuration:0.1 animations:^{ Maybe this animation duration should be in a static const. > Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.mm:362 > + [self performSelector:@selector(hideCancelButton) withObject:nil afterDelay:4.0]; Same with the delay. > Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.mm:490 > + RetainPtr<NSString> _EVOrganizationName; > + BOOL _EVOrganizationNameIsValid; Is _EVOrganizationNameIsValid just an alias for having a non-null _EVOrganizationName? Or does it really mean "tried to look up _EVOrganizationName"? > Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.mm:562 > + NSDictionary *infoDictionary = CFBridgingRelease(SecTrustCopyInfo(trust)); Is CFBridgingRelease the right thing to do in a non-ARC world? > Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.mm:597 > + if ([[url absoluteString] _web_hasCaseInsensitivePrefix:@"data:"]) This should ask the url for the protocol.
Jeremy Jones
Comment 15 2017-12-21 00:26:50 PST
(In reply to Tim Horton from comment #13) > Comment on attachment 329888 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=329888&action=review > > > Source/WebCore/PAL/pal/spi/cocoa/LinkPresentationSPI.h:40 > > +#endif // (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 100300) > > Do we really still care about < 10.3? EWS still builds against 10.x. I'll try getting rid the version check. > > > Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.mm:594 > > + NSString *domain = [url _lp_simplifiedDisplayString]; > > You need to make this more conditional, like the other place we use it, > because it’s missing in the base system (working on it). For now just fall > back to the non-simplified version. if (LinkPresentationLibrary()) domain = [url _lp_simplifiedDisplayString]; else domain = userVisibleString(url);
Jeremy Jones
Comment 16 2017-12-21 00:53:59 PST
(In reply to Simon Fraser (smfr) from comment #14) > Comment on attachment 329888 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=329888&action=review > > > Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.mm:242 > > + RetainPtr<UIImage> lockImage = [UIImage imageNamed:lockImageName inBundle:bundle compatibleWithTraitCollection:nil]; > > The RetainPtr<UIImage> here just adds extra ref churn. The result of > -imageNamed: is autoreleased, so you can just use a raw pointer. Done. > > > Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.mm:244 > > + [[_locationButton imageView] setTintColor:trustedSite?greenTint:whiteTint]; > > Spaces around the ? and : Done. 3x > > > Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.mm:268 > > + [_cancelButton setTitle:@"Done" forState:UIControlStateNormal]; > > Why is this not localized? Localized: WEB_UI_STRING("Done", "Text of button that exits element fullscreen.") > > > Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.mm:289 > > + [bottom setPriority:UILayoutPriorityRequired-1]; > > Spaces around the - Done. > > > Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.mm:346 > > + [UIView animateWithDuration:0.1 animations:^{ > > Maybe this animation duration should be in a static const. Done. static const NSTimeInterval showHideAnimationDuration = 0.1; > > > Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.mm:362 > > + [self performSelector:@selector(hideCancelButton) withObject:nil afterDelay:4.0]; > > Same with the delay. Done. static const NSTimeInterval autoHideDelay = 4.0; > > > Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.mm:490 > > + RetainPtr<NSString> _EVOrganizationName; > > + BOOL _EVOrganizationNameIsValid; > > Is _EVOrganizationNameIsValid just an alias for having a non-null > _EVOrganizationName? Or does it really mean "tried to look up > _EVOrganizationName"? It means "tried to look it up, so don't look-up again". > > > Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.mm:562 > > + NSDictionary *infoDictionary = CFBridgingRelease(SecTrustCopyInfo(trust)); > > Is CFBridgingRelease the right thing to do in a non-ARC world? Fixed: [(__bridge NSDictionary *)SecTrustCopyInfo(trust) autorelease] > > > Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.mm:597 > > + if ([[url absoluteString] _web_hasCaseInsensitivePrefix:@"data:"]) > > This should ask the url for the protocol. Done: if ([[url scheme] caseInsensitiveCompare:@"data"] == NSOrderedSame)
Jeremy Jones
Comment 17 2017-12-21 01:09:15 PST
Created attachment 330020 [details] Patch for landing
EWS Watchlist
Comment 18 2017-12-21 01:11:16 PST
Attachment 330020 [details] did not pass style-queue: ERROR: Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.mm:227: This { should be at the end of the previous line [whitespace/braces] [4] Total errors found: 1 in 8 files If any of these errors are false positives, please file a bug against check-webkit-style.
Jeremy Jones
Comment 19 2017-12-21 01:37:24 PST
Created attachment 330024 [details] Patch for landing
EWS Watchlist
Comment 20 2017-12-21 01:38:57 PST
Attachment 330024 [details] did not pass style-queue: ERROR: Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.mm:227: This { should be at the end of the previous line [whitespace/braces] [4] Total errors found: 1 in 8 files If any of these errors are false positives, please file a bug against check-webkit-style.
Jeremy Jones
Comment 21 2017-12-21 02:18:17 PST
Created attachment 330025 [details] Patch for landing
EWS Watchlist
Comment 22 2017-12-21 02:21:00 PST
Attachment 330025 [details] did not pass style-queue: ERROR: Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.mm:227: This { should be at the end of the previous line [whitespace/braces] [4] Total errors found: 1 in 8 files If any of these errors are false positives, please file a bug against check-webkit-style.
WebKit Commit Bot
Comment 23 2017-12-21 02:57:03 PST
Comment on attachment 330025 [details] Patch for landing Clearing flags on attachment: 330025 Committed r226218: <https://trac.webkit.org/changeset/226218>
Note You need to log in before you can comment on or make changes to this bug.