Bug 204128 - pageZoom/setPageZoom: should not be in a Mac-only part of WKWebView.mm
Summary: pageZoom/setPageZoom: should not be in a Mac-only part of WKWebView.mm
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brady Eidson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-11-12 15:01 PST by Brady Eidson
Modified: 2019-11-14 10:08 PST (History)
4 users (show)

See Also:


Attachments
Patch (1.60 KB, patch)
2019-11-12 15:02 PST, Brady Eidson
no flags Details | Formatted Diff | Diff
Patch (10.34 KB, patch)
2019-11-13 10:39 PST, Brady Eidson
no flags Details | Formatted Diff | Diff
Patch (10.21 KB, patch)
2019-11-13 11:25 PST, Brady Eidson
no flags Details | Formatted Diff | Diff
Patch to explore EWS failure on iOS (9.79 KB, patch)
2019-11-13 14:36 PST, Brady Eidson
no flags Details | Formatted Diff | Diff
Patch (10.48 KB, patch)
2019-11-13 16:32 PST, Brady Eidson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brady Eidson 2019-11-12 15:01:08 PST
pageZoom/setPageZoom: should not be in a Mac-only part of WKWebView.mm
Comment 1 Brady Eidson 2019-11-12 15:02:18 PST
Created attachment 383389 [details]
Patch
Comment 2 Alex Christensen 2019-11-12 15:16:30 PST
Comment on attachment 383389 [details]
Patch

Could you add a unit test that uses this?
Could we move all the Mac-specific code to WKWebViewMac.mm to avoid similar mistakes in the future?
Comment 3 Tim Horton 2019-11-12 15:26:19 PST
(In reply to Alex Christensen from comment #2)
> Comment on attachment 383389 [details]
> Patch
> 
> Could you add a unit test that uses this?
> Could we move all the Mac-specific code to WKWebViewMac.mm to avoid similar
> mistakes in the future?

Have definitely considered doing this (for iOS too, only keep shared code in WKWebView.mm), but it's kind of irritating (see WKContentViewInteraction irritation).
Comment 4 Alex Christensen 2019-11-12 15:35:46 PST
As long as you're touching WKWebView.h, is there any reason we have multiple sections with #if !TARGET_OS_IPHONE ?  Could they be merged into one section?
Comment 5 Brady Eidson 2019-11-13 08:41:01 PST
(In reply to Alex Christensen from comment #4)
> As long as you're touching WKWebView.h, is there any reason we have multiple
> sections with #if !TARGET_OS_IPHONE ?  Could they be merged into one section?

Separate patch for the no-behavior-change-cleanup-only, plz.
Comment 6 Alex Christensen 2019-11-13 09:53:56 PST
Ok, but a unit test still wouldn't hurt.  What happens if you call setPageZoom on iOS before this?
Comment 7 Brady Eidson 2019-11-13 10:39:32 PST
Created attachment 383469 [details]
Patch
Comment 8 Brady Eidson 2019-11-13 10:40:20 PST
(In reply to Alex Christensen from comment #6)
> Ok, but a unit test still wouldn't hurt.  

Of course I was doing a unit test! And it's in the new patch.

> What happens if you call
> setPageZoom on iOS before this?

It would set the value of a synthesized property.

E.g. - nothing.

Yay testing!
Comment 9 Alex Christensen 2019-11-13 11:13:17 PST
Comment on attachment 383469 [details]
Patch

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

> Tools/TestWebKitAPI/cocoa/TestWKWebView.mm:194
> +        id result = [self objectByEvaluatingJavaScript:@"getClientWidth()"];

It is strange that this calls a JavaScript function that is not defined in TestWKWebView.  Please move.
Comment 10 Brady Eidson 2019-11-13 11:25:25 PST
Created attachment 383474 [details]
Patch
Comment 11 Brady Eidson 2019-11-13 14:36:57 PST
Created attachment 383499 [details]
Patch to explore EWS failure on iOS
Comment 12 Brady Eidson 2019-11-13 16:32:05 PST
Created attachment 383515 [details]
Patch
Comment 13 WebKit Commit Bot 2019-11-14 10:07:28 PST
Comment on attachment 383515 [details]
Patch

Clearing flags on attachment: 383515

Committed r252458: <https://trac.webkit.org/changeset/252458>
Comment 14 WebKit Commit Bot 2019-11-14 10:07:30 PST
All reviewed patches have been landed.  Closing bug.
Comment 15 Radar WebKit Bug Importer 2019-11-14 10:08:21 PST
<rdar://problem/57194511>