Bug 180904 - WebPageCreationParameters doesn’t encode suppressScrollbarAnimations
Summary: WebPageCreationParameters doesn’t encode suppressScrollbarAnimations
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kate Cheney
URL:
Keywords: EasyFix, InRadar
Depends on:
Blocks:
 
Reported: 2017-12-15 23:28 PST by mitz
Modified: 2019-08-16 17:25 PDT (History)
16 users (show)

See Also:


Attachments
Patch (39.04 KB, patch)
2019-08-16 16:37 PDT, Kate Cheney
cdumez: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2017-12-15 23:28:27 PST
WebPageCreationParameters::encode doesn’t encode the suppressScrollbarAnimations member.
Comment 1 Radar WebKit Bug Importer 2019-08-07 11:55:49 PDT
<rdar://problem/54043967>
Comment 2 Simon Fraser (smfr) 2019-08-07 12:40:03 PDT
WebPageCreationParameters.suppressScrollbarAnimations seems to be unused. It was added in https://trac.webkit.org/changeset/128134/
Comment 3 Kate Cheney 2019-08-16 16:37:44 PDT
Created attachment 376564 [details]
Patch
Comment 4 EWS Watchlist 2019-08-16 16:40:19 PDT
Attachment 376564 [details] did not pass style-queue:


ERROR: Tools/TestWebKitAPI/Tests/WebKit/WebPageCreationParametersEncodeDecodeTest.cpp:31:  Found header this file implements after other header. Should be: config.h, primary header, blank line, and then alphabetically sorted.  [build/include_order] [4]
ERROR: Tools/TestWebKitAPI/Tests/WebKit/WebPageCreationParametersEncodeDecodeTest.cpp:87:  One space before end of line comments  [whitespace/comments] [5]
ERROR: Tools/TestWebKitAPI/Tests/WebKit/WebPageCreationParametersEncodeDecodeTest.cpp:190:  When wrapping a line, only indent 4 spaces.  [whitespace/indent] [3]
ERROR: Tools/TestWebKitAPI/Tests/WebKit/WebPageCreationParametersEncodeDecodeTest.cpp:194:  When wrapping a line, only indent 4 spaces.  [whitespace/indent] [3]
Total errors found: 4 in 16 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 mitz 2019-08-16 16:47:58 PDT
Comment on attachment 376564 [details]
Patch

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

> Source/WebCore/platform/graphics/DashArray.h:28
> +#include <CoreGraphics/CoreGraphics.h>

Seems strange to include a platform-specific header from this cross-platform header.

> Source/WebKit/Configurations/DebugRelease.xcconfig:43
> +OTHER_CFLAGS = $(inherited) -DWK_ENGINEERING_BUILD=1;

Preprocessor definitions should go in the GCC_PEEPROCESSOR_DEFINITIONS build settings rather than appear as compiler flags, so that the rest of the build system can reason about them. Also, isn’t there already an ENGINEERING_BUILD macro used for this?
Comment 6 Chris Dumez 2019-08-16 16:48:57 PDT
Comment on attachment 376564 [details]
Patch

This patch does not actually fix the bug. Yes you are now encoding / decoding it. However, WebPage is still not reading it upon creation.
Comment 7 Chris Dumez 2019-08-16 16:50:56 PDT
(In reply to Chris Dumez from comment #6)
> Comment on attachment 376564 [details]
> Patch
> 
> This patch does not actually fix the bug. Yes you are now encoding /
> decoding it. However, WebPage is still not reading it upon creation.

Note that if the API test was a real test, it would have probably caught this. An API test for low level encoding / decoding of WebPageCreationParameters is low value IMHO. I'd rather have an API test that shows the actual user-facing bug which would start passing with your change.
Comment 8 Chris Dumez 2019-08-16 16:55:42 PDT
(In reply to Chris Dumez from comment #7)
> (In reply to Chris Dumez from comment #6)
> > Comment on attachment 376564 [details]
> > Patch
> > 
> > This patch does not actually fix the bug. Yes you are now encoding /
> > decoding it. However, WebPage is still not reading it upon creation.
> 
> Note that if the API test was a real test, it would have probably caught
> this. An API test for low level encoding / decoding of
> WebPageCreationParameters is low value IMHO. I'd rather have an API test
> that shows the actual user-facing bug which would start passing with your
> change.

You likely want something like this in the WebPage constructor:
setSuppressScrollbarAnimations(parameters.suppressScrollbarAnimations);

And then you'd need to audit the code to figure out how to write a test for it.
You'd likely need to create a WebView, then before doing any load (as this would start the WebContent process on macOS), change the value of suppressScrollbarAnimations, then do a load. When the WebContent process launches and the WebPage is created, it should now pick up this flag properly.
Comment 9 Tim Horton 2019-08-16 16:59:04 PDT
(In reply to Chris Dumez from comment #7)
> (In reply to Chris Dumez from comment #6)
> > Comment on attachment 376564 [details]
> > Patch
> > 
> > This patch does not actually fix the bug. Yes you are now encoding /
> > decoding it. However, WebPage is still not reading it upon creation.
> 
> Note that if the API test was a real test, it would have probably caught
> this. An API test for low level encoding / decoding of
> WebPageCreationParameters is low value IMHO. I'd rather have an API test
> that shows the actual user-facing bug which would start passing with your
> change.

+1, despite Brady's insistence that this is a valuable way to test
Comment 10 Tim Horton 2019-08-16 17:14:50 PDT
(In reply to Chris Dumez from comment #8)
> (In reply to Chris Dumez from comment #7)
> > (In reply to Chris Dumez from comment #6)
> > > Comment on attachment 376564 [details]
> > > Patch
> > > 
> > > This patch does not actually fix the bug. Yes you are now encoding /
> > > decoding it. However, WebPage is still not reading it upon creation.
> > 
> > Note that if the API test was a real test, it would have probably caught
> > this. An API test for low level encoding / decoding of
> > WebPageCreationParameters is low value IMHO. I'd rather have an API test
> > that shows the actual user-facing bug which would start passing with your
> > change.
> 
> You likely want something like this in the WebPage constructor:
> setSuppressScrollbarAnimations(parameters.suppressScrollbarAnimations);
> 
> And then you'd need to audit the code to figure out how to write a test for
> it.
> You'd likely need to create a WebView, then before doing any load (as this
> would start the WebContent process on macOS), change the value of
> suppressScrollbarAnimations, then do a load. When the WebContent process
> launches and the WebPage is created, it should now pick up this flag
> properly.

(or test that it comes back from a forced crash, which is my favorite way)
Comment 11 Simon Fraser (smfr) 2019-08-16 17:25:23 PDT
(In reply to Chris Dumez from comment #7)

> Note that if the API test was a real test, it would have probably caught
> this. An API test for low level encoding / decoding of
> WebPageCreationParameters is low value IMHO. I'd rather have an API test
> that shows the actual user-facing bug which would start passing with your
> change.

I agree. It seems weird to add the complexity of WK_TESTSUPPORT_EXPORT to support a means of testing that we don't really want to encourage.