Bug 227859 - [watchOS] Make a few additional adjustments to support system minimum layout margins
Summary: [watchOS] Make a few additional adjustments to support system minimum layout ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-07-11 10:37 PDT by Wenson Hsieh
Modified: 2021-07-12 10:54 PDT (History)
5 users (show)

See Also:


Attachments
For EWS (18.34 KB, patch)
2021-07-11 15:12 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Patch (18.47 KB, patch)
2021-07-12 07:38 PDT, Wenson Hsieh
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wenson Hsieh 2021-07-11 10:37:54 PDT
rdar://80113612
Comment 1 Wenson Hsieh 2021-07-11 15:12:07 PDT
Created attachment 433291 [details]
For EWS
Comment 2 Tim Horton 2021-07-11 19:46:50 PDT
Comment on attachment 433291 [details]
For EWS

View in context: https://bugs.webkit.org/attachment.cgi?id=433291&action=review

> Source/WebKit/UIProcess/ios/WKScrollView.mm:464
> +        super.contentScrollInset = UIEdgeInsetsZero;

Is this bit going to cause any trouble on iOS?
Comment 3 Wenson Hsieh 2021-07-12 07:30:51 PDT
Comment on attachment 433291 [details]
For EWS

View in context: https://bugs.webkit.org/attachment.cgi?id=433291&action=review

Thanks for the review!

>> Source/WebKit/UIProcess/ios/WKScrollView.mm:464
>> +        super.contentScrollInset = UIEdgeInsetsZero;
> 
> Is this bit going to cause any trouble on iOS?

Oh, good catch! I think that in theory, it could cause trouble if a client were setting `-_contentScrollInset` on iOS (since the interaction between `-_contentScrollInset` and `-contentInset` is…reasonable on non-watch iOS platforms). Since the need to duck `-_contentScrollInset` when a `-contentInset` is specified is really only needed on watchOS, I'll make some of this code conditional for watchOS only.

That said — as this patch currently is, this method shouldn't be reachable at all on non-watchOS platforms, since the only way it can be reached is for `_contentScrollInsetInternal` to be set, and we only call `-_setContentScrollInsetInternal:` from a watchOS-specific codepath.
Comment 4 Wenson Hsieh 2021-07-12 07:38:51 PDT
Created attachment 433316 [details]
Patch
Comment 5 EWS 2021-07-12 09:15:20 PDT
Committed r279830 (239591@main): <https://commits.webkit.org/239591@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 433316 [details].
Comment 6 Tim Horton 2021-07-12 10:54:51 PDT
(In reply to Wenson Hsieh from comment #3)
> Comment on attachment 433291 [details]
> For EWS
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=433291&action=review
> 
> Thanks for the review!
> 
> >> Source/WebKit/UIProcess/ios/WKScrollView.mm:464
> >> +        super.contentScrollInset = UIEdgeInsetsZero;
> > 
> > Is this bit going to cause any trouble on iOS?
> 
> Oh, good catch! I think that in theory, it could cause trouble if a client
> were setting `-_contentScrollInset` on iOS (since the interaction between
> `-_contentScrollInset` and `-contentInset` is…reasonable on non-watch iOS
> platforms). Since the need to duck `-_contentScrollInset` when a
> `-contentInset` is specified is really only needed on watchOS, I'll make
> some of this code conditional for watchOS only.

Perfect! Thank you. Best to limit the counter-hacks to places where the hacks exist :)

> That said — as this patch currently is, this method shouldn't be reachable
> at all on non-watchOS platforms, since the only way it can be reached is for
> `_contentScrollInsetInternal` to be set, and we only call
> `-_setContentScrollInsetInternal:` from a watchOS-specific codepath.

Sure, makes sense.