WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
158364
AX: WKWebView should have API to prevent pinch-to-zoom always being allowed
https://bugs.webkit.org/show_bug.cgi?id=158364
Summary
AX: WKWebView should have API to prevent pinch-to-zoom always being allowed
Nan Wang
Reported
2016-06-03 15:04:30 PDT
We should provide an API to developers so that they can set whether the WKWebView should always allow scaling of the web page, regardless of author intent. <
rdar://problem/26425468
>
Attachments
initial patch
(26.13 KB, patch)
2016-06-03 15:19 PDT
,
Nan Wang
no flags
Details
Formatted Diff
Diff
patch
(26.90 KB, patch)
2016-06-03 15:32 PDT
,
Nan Wang
no flags
Details
Formatted Diff
Diff
patch
(27.19 KB, patch)
2016-06-03 16:00 PDT
,
Nan Wang
no flags
Details
Formatted Diff
Diff
patch
(26.31 KB, patch)
2016-06-08 17:47 PDT
,
Nan Wang
buildbot
: commit-queue-
Details
Formatted Diff
Diff
Archive of layout-test-results from ews114 for mac-yosemite
(1.42 MB, application/zip)
2016-06-08 18:53 PDT
,
Build Bot
no flags
Details
Patch
(31.30 KB, patch)
2016-07-07 14:20 PDT
,
Nan Wang
andersca
: review-
Details
Formatted Diff
Diff
patch
(33.80 KB, patch)
2016-07-09 03:52 PDT
,
Nan Wang
no flags
Details
Formatted Diff
Diff
patch
(33.80 KB, patch)
2016-07-09 03:58 PDT
,
Nan Wang
buildbot
: commit-queue-
Details
Formatted Diff
Diff
Archive of layout-test-results from ews122 for ios-simulator-wk2
(613.21 KB, application/zip)
2016-07-09 05:08 PDT
,
Build Bot
no flags
Details
patch
(33.79 KB, patch)
2016-07-09 10:54 PDT
,
Nan Wang
no flags
Details
Formatted Diff
Diff
Show Obsolete
(7)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2016-06-03 15:07:39 PDT
<
rdar://problem/26631538
>
Nan Wang
Comment 2
2016-06-03 15:19:04 PDT
Created
attachment 280472
[details]
initial patch
Nan Wang
Comment 3
2016-06-03 15:32:53 PDT
Created
attachment 280475
[details]
patch fix build failure
Nan Wang
Comment 4
2016-06-03 16:00:23 PDT
Created
attachment 280478
[details]
patch Another build fix for mac ports
chris fleizach
Comment 5
2016-06-08 14:49:44 PDT
Comment on
attachment 280478
[details]
patch View in context:
https://bugs.webkit.org/attachment.cgi?id=280478&action=review
> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.h:246 > + @seealso backForwardList.
This comment should be removed @seealso backForwardList.
> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:2214 > +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000
Is all the iOS versioning required? This code will never run on an older device right
> Tools/WebKitTestRunner/TestController.cpp:2144 > +#if PLATFORM(COCOA)
Should this be IOS
Nan Wang
Comment 6
2016-06-08 14:56:06 PDT
Comment on
attachment 280478
[details]
patch View in context:
https://bugs.webkit.org/attachment.cgi?id=280478&action=review
>> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:2214 >> +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000 > > Is all the iOS versioning required? This code will never run on an older device right
Because we set the property WK_AVAILABLE(NA, 10_0), do you think we should remove that as well?
chris fleizach
Comment 7
2016-06-08 14:57:29 PDT
Comment on
attachment 280478
[details]
patch View in context:
https://bugs.webkit.org/attachment.cgi?id=280478&action=review
>>> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:2214 >>> +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000 >> >> Is all the iOS versioning required? This code will never run on an older device right > > Because we set the property WK_AVAILABLE(NA, 10_0), do you think we should remove that as well?
It seems like that should be kept there so people compiling against different versions know whats there or not, but internally the versioning seems uncessary to me. Maybe someone else has a different opinion
Tim Horton
Comment 8
2016-06-08 15:47:36 PDT
Comment on
attachment 280478
[details]
patch View in context:
https://bugs.webkit.org/attachment.cgi?id=280478&action=review
> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.h:248 > +@property (nonatomic) BOOL alwaysUserScalable WK_AVAILABLE(NA, 10_0);
The naming of this API is surprising (and the fact that it's API at all, to start out with). I cc'd andersca for thoughts.
>>>> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:2214 >>>> +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000 >>> >>> Is all the iOS versioning required? This code will never run on an older device right >> >> Because we set the property WK_AVAILABLE(NA, 10_0), do you think we should remove that as well? > > It seems like that should be kept there so people compiling against different versions know whats there or not, but internally the versioning seems uncessary to me. Maybe someone else has a different opinion
The versioning should definitely not be here, there's no reason for it and it absolutely can be run on different versions (and should be usable and testable there).
Anders Carlsson
Comment 9
2016-06-08 15:48:45 PDT
(In reply to
comment #8
)
> Comment on
attachment 280478
[details]
> patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=280478&action=review
> > > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.h:248 > > +@property (nonatomic) BOOL alwaysUserScalable WK_AVAILABLE(NA, 10_0); > > The naming of this API is surprising (and the fact that it's API at all, to > start out with). I cc'd andersca for thoughts. > > >>>> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:2214 > >>>> +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000 > >>> > >>> Is all the iOS versioning required? This code will never run on an older device right > >> > >> Because we set the property WK_AVAILABLE(NA, 10_0), do you think we should remove that as well?
New APIs should be versioned. We use WK_IOS_TBA for new APIs. I don't like the name.
> > > > It seems like that should be kept there so people compiling against different versions know whats there or not, but internally the versioning seems uncessary to me. Maybe someone else has a different opinion > > The versioning should definitely not be here, there's no reason for it and > it absolutely can be run on different versions (and should be usable and > testable there).
Tim Horton
Comment 10
2016-06-08 15:50:40 PDT
(In reply to
comment #9
)
> (In reply to
comment #8
) > > Comment on
attachment 280478
[details]
> > patch > > > > View in context: > >
https://bugs.webkit.org/attachment.cgi?id=280478&action=review
> > > > > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.h:248 > > > +@property (nonatomic) BOOL alwaysUserScalable WK_AVAILABLE(NA, 10_0); > > > > The naming of this API is surprising (and the fact that it's API at all, to > > start out with). I cc'd andersca for thoughts. > > > > >>>> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:2214 > > >>>> +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000 > > >>> > > >>> Is all the iOS versioning required? This code will never run on an older device right > > >> > > >> Because we set the property WK_AVAILABLE(NA, 10_0), do you think we should remove that as well? > > New APIs should be versioned. We use WK_IOS_TBA for new APIs. I don't like > the name.
The interface should have availability macros, yes, but the implementation shouldn't be #if'd out, should it?
Nan Wang
Comment 11
2016-06-08 16:01:35 PDT
(In reply to
comment #10
)
> (In reply to
comment #9
) > > (In reply to
comment #8
) > > > Comment on
attachment 280478
[details]
> > > patch > > > > > > View in context: > > >
https://bugs.webkit.org/attachment.cgi?id=280478&action=review
> > > > > > > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.h:248 > > > > +@property (nonatomic) BOOL alwaysUserScalable WK_AVAILABLE(NA, 10_0); > > > > > > The naming of this API is surprising (and the fact that it's API at all, to > > > start out with). I cc'd andersca for thoughts. > > > > > > >>>> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:2214 > > > >>>> +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000 > > > >>> > > > >>> Is all the iOS versioning required? This code will never run on an older device right > > > >> > > > >> Because we set the property WK_AVAILABLE(NA, 10_0), do you think we should remove that as well? > > > > New APIs should be versioned. We use WK_IOS_TBA for new APIs. I don't like > > the name.
Do you have any suggestion for the name?
> > The interface should have availability macros, yes, but the implementation > shouldn't be #if'd out, should it?
I think the code won't compile if the version is lower than the availability macro.
Tim Horton
Comment 12
2016-06-08 16:13:54 PDT
(In reply to
comment #11
)
> > The interface should have availability macros, yes, but the implementation > > shouldn't be #if'd out, should it? > > I think the code won't compile if the version is lower than the availability > macro.
No. The availability macro (WK_AVAILABLE) is unrelated to what code actually builds, and is just an annotation. You only want the availability macro, not the #if __IPHONE_OS_VERSION_MIN_REQUIRED bits.
Nan Wang
Comment 13
2016-06-08 16:18:37 PDT
(In reply to
comment #12
)
> No. The availability macro (WK_AVAILABLE) is unrelated to what code actually > builds, and is just an annotation. You only want the availability macro, not > the #if __IPHONE_OS_VERSION_MIN_REQUIRED bits.
Got it. But why in my previous patch, I only have the (WK_AVAILABLE) macro, but it gave me the error: property 'alwaysUserScalable' not found on object of type 'WKWebView *' on the mac port?
Tim Horton
Comment 14
2016-06-08 16:48:35 PDT
(In reply to
comment #13
)
> (In reply to
comment #12
) > > No. The availability macro (WK_AVAILABLE) is unrelated to what code actually > > builds, and is just an annotation. You only want the availability macro, not > > the #if __IPHONE_OS_VERSION_MIN_REQUIRED bits. > > Got it. But why in my previous patch, I only have the (WK_AVAILABLE) macro, > but it gave me the error: property 'alwaysUserScalable' not found on object > of type 'WKWebView *' on the mac port?
If your property only exists/works on iOS you may need some #if PLATFORM(IOS) guards, but not the version guards.
Nan Wang
Comment 15
2016-06-08 16:54:02 PDT
(In reply to
comment #14
)
> If your property only exists/works on iOS you may need some #if > PLATFORM(IOS) guards, but not the version guards.
Ok, will remove the #if __IPHONE_OS_VERSION_MIN_REQUIRED
Nan Wang
Comment 16
2016-06-08 17:47:06 PDT
Created
attachment 280860
[details]
patch - Addressed review comments. - removed the __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000 check - Not sure what a good name would be for the property. Suggestions welcome!
Build Bot
Comment 17
2016-06-08 18:53:52 PDT
Comment on
attachment 280860
[details]
patch
Attachment 280860
[details]
did not pass mac-debug-ews (mac): Output:
http://webkit-queues.webkit.org/results/1469705
New failing tests: editing/selection/selection-in-iframe-removed-crash.html
Build Bot
Comment 18
2016-06-08 18:53:56 PDT
Created
attachment 280867
[details]
Archive of layout-test-results from ews114 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews114 Port: mac-yosemite Platform: Mac OS X 10.10.5
chris fleizach
Comment 19
2016-06-14 10:58:33 PDT
(In reply to
comment #17
)
> Comment on
attachment 280860
[details]
> patch > >
Attachment 280860
[details]
did not pass mac-debug-ews (mac): > Output:
http://webkit-queues.webkit.org/results/1469705
> > New failing tests: > editing/selection/selection-in-iframe-removed-crash.html
Nan is this failure related to this patch
Nan Wang
Comment 20
2016-06-14 11:11:53 PDT
(In reply to
comment #19
)
> (In reply to
comment #17
) > > Comment on
attachment 280860
[details]
> > patch > > > >
Attachment 280860
[details]
did not pass mac-debug-ews (mac): > > Output:
http://webkit-queues.webkit.org/results/1469705
> > > > New failing tests: > > editing/selection/selection-in-iframe-removed-crash.html > > Nan is this failure related to this patch
I don't think so.
chris fleizach
Comment 21
2016-06-14 15:22:24 PDT
Comment on
attachment 280860
[details]
patch View in context:
https://bugs.webkit.org/attachment.cgi?id=280860&action=review
> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.h:247 > +@property (nonatomic) BOOL alwaysUserScalable WK_AVAILABLE(NA, WK_IOS_TBA);
How do people feel about "ignoresUserScalable"
Nan Wang
Comment 22
2016-07-07 14:20:12 PDT
Created
attachment 283048
[details]
Patch - Changed the property name to ignoresViewportScaleLimits - Moved the property to WKWebViewConfiguration - Added a test option so that we can set the configuration in test.
Anders Carlsson
Comment 23
2016-07-08 12:22:31 PDT
Comment on
attachment 283048
[details]
Patch Instead of having anything on the WKWebView, just add a boolean to WebPageCreationParameters and pipe it through from the WKWebView initializer. I think having a setting on the Internals object for testing is better than having an injected bundle function.
Nan Wang
Comment 24
2016-07-09 03:52:06 PDT
Created
attachment 283255
[details]
patch Based on the review: - Added a boolean in WebPageCreationParameters and removed logics in WKWebView - Since the viewport configuration is in WebKit2 and Internals is in WebCore, there's no easy way to communicate between. So I kept the injected bundle function.
Nan Wang
Comment 25
2016-07-09 03:58:22 PDT
Created
attachment 283256
[details]
patch fixed a small typo
Build Bot
Comment 26
2016-07-09 05:08:18 PDT
Comment on
attachment 283256
[details]
patch
Attachment 283256
[details]
did not pass ios-sim-ews (ios-simulator-wk2): Output:
http://webkit-queues.webkit.org/results/1652076
New failing tests: fast/scrolling/ios/scrollTo-at-page-load.html
Build Bot
Comment 27
2016-07-09 05:08:22 PDT
Created
attachment 283257
[details]
Archive of layout-test-results from ews122 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews122 Port: ios-simulator-wk2 Platform: Mac OS X 10.11.5
Nan Wang
Comment 28
2016-07-09 10:54:23 PDT
Created
attachment 283262
[details]
patch The failure test passed on my local machine. Let's try again.
WebKit Commit Bot
Comment 29
2016-07-11 12:09:09 PDT
Comment on
attachment 283262
[details]
patch Clearing flags on attachment: 283262 Committed
r203075
: <
http://trac.webkit.org/changeset/203075
>
WebKit Commit Bot
Comment 30
2016-07-11 12:09:15 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug