<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>199488</bug_id>
          
          <creation_ts>2019-07-03 19:17:41 -0700</creation_ts>
          <short_desc>WKWebView fails to render when another view uses CoreImage filters</short_desc>
          <delta_ts>2019-07-08 12:54:58 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit2</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>macOS 10.14</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Dan Saunders">dasau</reporter>
          <assigned_to name="Tim Horton">thorton</assigned_to>
          <cc>cdumez</cc>
    
    <cc>commit-queue</cc>
    
    <cc>dino</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>thorton</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1550159</commentid>
    <comment_count>0</comment_count>
    <who name="Dan Saunders">dasau</who>
    <bug_when>2019-07-03 19:17:41 -0700</bug_when>
    <thetext>In 10.15 we noticed a regression where WKWebView was not rendering in our application and just shows a blank view. In 10.14.5 WKWebView is rendering with the same code. The issue is that when any subview in your window uses CoreImage filters, it breaks future WKWebView that are added to the window from rendering. I am not sure what change in WebKit caused this to stop working, but I can repro by running the latest WebKit code on my 10.14.5 machine. This does not repro when you change the order and first call -[WKWebView loadRequest:] before adding the web view to the window.

NSView *ciLayerView = [[NSView alloc] initWithFrame:NSMakeRect(0, 0, 1, 1)];
ciLayerView.wantsLayer = YES;
ciLayerView.layerUsesCoreImageFilters = YES;
[[self view] addSubview:ciLayerView];

dispatch_async(dispatch_get_main_queue(), ^{
	WKWebView *webView = [[WKWebView alloc] initWithFrame:NSMakeRect(100, 100, 400, 400)];
	[self.view addSubview:webView];
	[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@&quot;https://www.bing.com&quot;]]];
});</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1550546</commentid>
    <comment_count>1</comment_count>
    <who name="Dan Saunders">dasau</who>
    <bug_when>2019-07-05 15:21:32 -0700</bug_when>
    <thetext>I have debugged this more and found the cause of the regression, it seems the issue is that m_layerHostingMode is never set to LayerHostingMode::InProcess when CI filters are used. Previously the WebKit content process is already started when you add WKWebView to the window, so WebPageProxy::viewDidEnterWindow updates the layer hosting mode. With recent changes, WebPageProxy::dispatchActivityStateChange returns early because no process is started and the layer hosting mode is not set correctly. PageClientImpl::viewLayerHostingMode can get the correct value for the window, but it is just not set correctly on the content process in this scenario. CI filter forces in-proc rendering, WebKit will need to match the layer hosting mode of the window that is hosting it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1550547</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-07-05 15:21:52 -0700</bug_when>
    <thetext>&lt;rdar://problem/52705268&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1550898</commentid>
    <comment_count>3</comment_count>
    <who name="Tim Horton">thorton</who>
    <bug_when>2019-07-08 11:31:14 -0700</bug_when>
    <thetext>Maybe a regression from the delayed web process launch thing?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1550900</commentid>
    <comment_count>4</comment_count>
    <who name="Tim Horton">thorton</who>
    <bug_when>2019-07-08 11:33:18 -0700</bug_when>
    <thetext>I think WebPageProxy::layerHostingModeDidChange() should not early-return if there&apos;s no process launched. Or rather, it should, but just before the message send; it should still update m_layerHostingMode, which is sent across in WebPageCreationParameters.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1550917</commentid>
    <comment_count>5</comment_count>
      <attachid>373653</attachid>
    <who name="Tim Horton">thorton</who>
    <bug_when>2019-07-08 12:05:26 -0700</bug_when>
    <thetext>Created attachment 373653
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1550918</commentid>
    <comment_count>6</comment_count>
    <who name="Tim Horton">thorton</who>
    <bug_when>2019-07-08 12:05:36 -0700</bug_when>
    <thetext>Does fix it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1550930</commentid>
    <comment_count>7</comment_count>
      <attachid>373653</attachid>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2019-07-08 12:21:04 -0700</bug_when>
    <thetext>Comment on attachment 373653
Patch

LGTM too.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1550933</commentid>
    <comment_count>8</comment_count>
    <who name="Tim Horton">thorton</who>
    <bug_when>2019-07-08 12:49:50 -0700</bug_when>
    <thetext>I took a quick jaunt through the rest of WebPageProxy and didn&apos;t see any other similarly wrong functions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1550935</commentid>
    <comment_count>9</comment_count>
      <attachid>373653</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2019-07-08 12:54:56 -0700</bug_when>
    <thetext>Comment on attachment 373653
Patch

Clearing flags on attachment: 373653

Committed r247227: &lt;https://trac.webkit.org/changeset/247227&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1550936</commentid>
    <comment_count>10</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2019-07-08 12:54:58 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>373653</attachid>
            <date>2019-07-08 12:05:26 -0700</date>
            <delta_ts>2019-07-08 12:54:56 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-199488-20190708120525.patch</filename>
            <type>text/plain</type>
            <size>2069</size>
            <attacher name="Tim Horton">thorton</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjQ3MTAwCmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViS2l0L0No
YW5nZUxvZyBiL1NvdXJjZS9XZWJLaXQvQ2hhbmdlTG9nCmluZGV4IGM4MWRmMWY4ODE1ODNkNjE3
YmNiZTdlNTZhN2UyZmQ4NTAyY2IzMGMuLjk5OGIwYmEwNzI5ODRkNWI0YTVmNjgwMzRiOGNjMzcy
NzQ5NTgzNDMgMTAwNjQ0Ci0tLSBhL1NvdXJjZS9XZWJLaXQvQ2hhbmdlTG9nCisrKyBiL1NvdXJj
ZS9XZWJLaXQvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTggQEAKKzIwMTktMDctMDggIFRpbSBIb3J0
b24gIDx0aW1vdGh5X2hvcnRvbkBhcHBsZS5jb20+CisKKyAgICAgICAgV0tXZWJWaWV3IGZhaWxz
IHRvIHJlbmRlciB3aGVuIGFub3RoZXIgdmlldyB1c2VzIENvcmVJbWFnZSBmaWx0ZXJzCisgICAg
ICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0xOTk0ODgKKyAgICAg
ICAgPHJkYXI6Ly9wcm9ibGVtLzUyNjk1ODI1PgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9E
WSAoT09QUyEpLgorCisgICAgICAgICogVUlQcm9jZXNzL1dlYlBhZ2VQcm94eS5jcHA6CisgICAg
ICAgIChXZWJLaXQ6OldlYlBhZ2VQcm94eTo6bGF5ZXJIb3N0aW5nTW9kZURpZENoYW5nZSk6Cisg
ICAgICAgIFVwZGF0ZSBtX2xheWVySG9zdGluZ01v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