Bug 224410

Summary: Simplify WebKitTestRunner preference reset to be more like DRT
Product: WebKit Reporter: Sam Weinig <sam>
Component: New BugsAssignee: Sam Weinig <sam>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, Hironori.Fujii, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Sam Weinig 2021-04-10 19:09:14 PDT
Simplify WebKitTestRunner preference reset to be more like DRT
Comment 1 Sam Weinig 2021-04-10 19:17:09 PDT Comment hidden (obsolete)
Comment 2 Sam Weinig 2021-04-11 09:47:05 PDT
Created attachment 425711 [details]
Patch
Comment 3 Darin Adler 2021-04-11 12:34:50 PDT
Comment on attachment 425711 [details]
Patch

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

> Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h:54
> +WK_EXPORT void WKPreferencesStartBatchingUpdates(WKPreferencesRef);
> +WK_EXPORT void WKPreferencesEndBatchingUpdates(WKPreferencesRef);

What’s the story on adding new C API (including private/SPI) vs. Objective-C/Swift API? Are there cross-platform reason to keep adding to the C API? I know that on Apple platforms we want the Objective-C/Swift to have parity or be a superset.

> Tools/WebKitTestRunner/TestOptions.cpp:60
>              { "AcceleratedDrawingEnabled", false },

Is there some way to share this list with DumpRenderTree?
Comment 4 Sam Weinig 2021-04-11 13:09:45 PDT
(In reply to Darin Adler from comment #3)
> Comment on attachment 425711 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=425711&action=review
> 
> > Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h:54
> > +WK_EXPORT void WKPreferencesStartBatchingUpdates(WKPreferencesRef);
> > +WK_EXPORT void WKPreferencesEndBatchingUpdates(WKPreferencesRef);
> 
> What’s the story on adding new C API (including private/SPI) vs.
> Objective-C/Swift API? Are there cross-platform reason to keep adding to the
> C API? I know that on Apple platforms we want the Objective-C/Swift to have
> parity or be a superset.

Anything that WebKitTestRunner uses needs either needs to be in the C-SPI or duplicated in the port specific APIs. So, for things like this, that at the moment are mostly about the test runner, I am keeping them in C.

> 
> > Tools/WebKitTestRunner/TestOptions.cpp:60
> >              { "AcceleratedDrawingEnabled", false },
> 
> Is there some way to share this list with DumpRenderTree?

I hope so. My goal is to converge DumpRenderTree and WebKitTestRunner TestOptions.h/cpp files (they are very similar now), and then share them via the TestRunnerShared directory. That allows us to maintain some differences via #ifdefs if we need it (since each project will still compile their own copy), and we will need it, as there are some preferences WebKitLegacy does not want enabled, as they don't work there.
Comment 5 EWS 2021-04-11 13:11:43 PDT
Committed r275810 (236381@main): <https://commits.webkit.org/236381@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 425711 [details].
Comment 6 Radar WebKit Bug Importer 2021-04-11 13:12:14 PDT
<rdar://problem/76514638>
Comment 7 Fujii Hironori 2021-04-26 21:08:24 PDT
Filed: Bug 225087 – REGRESSION(r275810): [WebKitTestRunner] fast/text/basic/004.html fails after running fast/layoutformattingcontext tests
Comment 8 Fujii Hironori 2021-04-26 21:29:16 PDT
(In reply to Sam Weinig from comment #4)
> That allows us to maintain some differences
> via #ifdefs if we need it (since each project will still compile their own copy),

WinCairo is still supporting both WK1 and WK2. But, it doesn't compile TestRunnerShared twice. (Bug 216465)
Comment 9 Sam Weinig 2021-05-07 10:15:38 PDT
(In reply to Fujii Hironori from comment #8)
> (In reply to Sam Weinig from comment #4)
> > That allows us to maintain some differences
> > via #ifdefs if we need it (since each project will still compile their own copy),
> 
> WinCairo is still supporting both WK1 and WK2. But, it doesn't compile
> TestRunnerShared twice. (Bug 216465)

It unfortunately will need to. While TestRunnerShared is for shared code between DRT and WKTR, it needs to be shared only at the source level to allow preferences to differ between the WK1 and WK2.
Comment 10 Fujii Hironori 2021-05-07 13:43:10 PDT
(In reply to Sam Weinig from comment #9)
> (In reply to Fujii Hironori from comment #8)
> > (In reply to Sam Weinig from comment #4)
> > > That allows us to maintain some differences
> > > via #ifdefs if we need it (since each project will still compile their own copy),
> > 
> > WinCairo is still supporting both WK1 and WK2. But, it doesn't compile
> > TestRunnerShared twice. (Bug 216465)
> 
> It unfortunately will need to. While TestRunnerShared is for shared code
> between DRT and WKTR, it needs to be shared only at the source level to
> allow preferences to differ between the WK1 and WK2.

TestRunnerShared is a library shared between DRT and WKTR. It should be possible to change the behavior by using a runtime flag.
Comment 11 Darin Adler 2021-05-07 13:50:03 PDT
(In reply to Fujii Hironori from comment #10)
> TestRunnerShared is a library shared between DRT and WKTR. It should be
> possible to change the behavior by using a runtime flag.

It is shared code. It doesn’t have to be a shared library.

Let us build it separately for the two uses. It is our library, we get to decide how it's built.

I don’t agree that we need to change it so it can be a single shared library with a runtime flag. We *could* do that, or we could compile it twice on platforms that support both legacy WebKit and modern.

I prefer the "compile it twice" approach.