Bug 147791 - Simplify WKTR's view options
Summary: Simplify WKTR's view options
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Anders Carlsson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-07 12:36 PDT by Anders Carlsson
Modified: 2015-08-14 17:14 PDT (History)
3 users (show)

See Also:


Attachments
Patch (21.73 KB, patch)
2015-08-07 12:38 PDT, Anders Carlsson
no flags Details | Formatted Diff | Diff
Patch (23.09 KB, patch)
2015-08-07 13:22 PDT, Anders Carlsson
sam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anders Carlsson 2015-08-07 12:36:36 PDT
Simplify WKTR's view options
Comment 1 Anders Carlsson 2015-08-07 12:38:23 PDT
Created attachment 258519 [details]
Patch
Comment 2 Anders Carlsson 2015-08-07 13:22:21 PDT
Created attachment 258523 [details]
Patch
Comment 3 Anders Carlsson 2015-08-07 13:35:38 PDT
Committed r188157: <http://trac.webkit.org/changeset/188157>
Comment 4 Alexey Proskuryakov 2015-08-14 17:10:07 PDT
Comment on attachment 258523 [details]
Patch

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

> Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm:247
> -    WKRetainPtr<WKStringRef> useThreadedScrollingKey(AdoptWK, WKStringCreateWithUTF8CString("ThreadedScrolling"));
> -    WKTypeRef useThreadedScrollingValue = WKDictionaryGetItemForKey(options, useThreadedScrollingKey.get());
> -    bool useThreadedScrolling = useThreadedScrollingValue && WKBooleanGetValue(static_cast<WKBooleanRef>(useThreadedScrollingValue));
> +    if (m_options.useThreadedScrolling != options.useThreadedScrolling)
> +        return false;
>  
> -    return useThreadedScrolling == [(TestRunnerWKView *)m_view useThreadedScrolling];
> +    return true;

This changed the behavior, because the options structure doesn't have optional values any more, but it's used as if it did.

See e.g. here:

void TestController::updateLayoutTypeForTest(const TestInvocation& test)
{
    ViewOptions viewOptions;

    viewOptions.useFixedLayout = shouldUseFixedLayout(test);

    ensureViewSupportsOptions(viewOptions);
}

This results in WebKitTestRunner re-creating its view multiple times when running tests in tiled-drawing directory (which makes attaching to the process to debug super hard), ad likely in other misbehaviors.

This code turned out to be super fragile. Another example (pre-existing) is that TestController::configureViewForTest() indirectly calls ensureViewSupportsOptions multiple times, and if any of those decides to re-create the view, then any prior adjustments are lost.

While I agree with the premise of this patch, it seems more appropriate to start fresh than to further mutate from current state. I'll see if this can be easily reverted now.
Comment 5 Alexey Proskuryakov 2015-08-14 17:13:08 PDT
Bummer, the rollout doesn't apply cleanly any more.
Comment 6 Alexey Proskuryakov 2015-08-14 17:14:24 PDT
Anders, could you please take a look at this?

The known symptom is that when running any tiled-drawing test, we end up re-creating the view in TestController::ensureViewSupportsOptions. There may be other consequences, too.