<?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>167649</bug_id>
          
          <creation_ts>2017-01-31 09:52:08 -0800</creation_ts>
          <short_desc>[Cocoa] Assertion failure in contentZoomScale(WKWebView *) (scale == [webView-&gt;_scrollView zoomScale]) in iOS Mail</short_desc>
          <delta_ts>2017-01-31 11:21:08 -0800</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>Other</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></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>mitz</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>simon.fraser</cc>
    
    <cc>thorton</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1271760</commentid>
    <comment_count>0</comment_count>
    <who name="">mitz</who>
    <bug_when>2017-01-31 09:52:08 -0800</bug_when>
    <thetext>Running the iOS Mail app with a Debug build of WebKit, some of its web views used for message display are constantly failing the ASSERT(scale == [webView-&gt;_scrollView zoomScale]) in WKWebView.mm’s contentZoomScale(WKWebView *). In a typical example, one sees

(lldb) p scale
(CGFloat) $0 = 0.25
(lldb) p [(UIScrollView*)webView-&gt;_scrollView.m_ptr zoomScale]
(CGFloat) $1 = 1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1271764</commentid>
    <comment_count>1</comment_count>
    <who name="">mitz</who>
    <bug_when>2017-01-31 09:56:33 -0800</bug_when>
    <thetext>&lt;rdar://problem/30287825&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1271799</commentid>
    <comment_count>2</comment_count>
    <who name="">mitz</who>
    <bug_when>2017-01-31 11:21:08 -0800</bug_when>
    <thetext>More information from Simon:

(lldb) po [self recursiveDescription]
&lt;: 0x7f91b3728f10; frame = (0 0; 363 276); gestureRecognizers = &lt;NSArray: 0x620000052240&gt;; layer = &lt;CALayer: 0x6180002226c0&gt;&gt;
   | &lt;UIView: 0x7f91b3730a80; frame = (0 0; 0 0); layer = &lt;CALayer: 0x6180002237c0&gt;&gt;
   | &lt;WKWebView: 0x7f91b481fc00; frame = (0 0; 363 276); autoresize = W+H; layer = &lt;CALayer: 0x6180002219c0&gt;&gt;
   |    | &lt;WKScrollView: 0x7f91b683e800; baseClass = UIScrollView; frame = (0 0; 363 276); clipsToBounds = YES; gestureRecognizers = &lt;NSArray: 0x600000056650&gt;; layer = &lt;CALayer: 0x600000221420&gt;; contentOffset: {0, 0}; contentSize: {0, 0}&gt;
   |    |    | &lt;WKContentView: 0x7f91b6813800; frame = (0 0; 0 0); transform = [0.25, 0, 0, 0.25, 0, 0]; gestureRecognizers = &lt;NSArray: 0x64000004b040&gt;; layer = &lt;CALayer: 0x6000002213e0&gt;&gt;
   |    |    |    | &lt;UIView: 0x7f91b5c0f8f0; frame = (0 0; 0 0); clipsToBounds = YES; layer = &lt;CALayer: 0x64000003b060&gt;&gt;
   |    |    |    |    | &lt;UIView: 0x7f91b5c0f750; frame = (0 0; 0 0); autoresize = W+H; layer = &lt;CALayer: 0x64000003aea0&gt;&gt;
   |    |    |    |    |    | &lt;WKCompositingView: 0x7f91b5b250e0; frame = (0 0; 0 0); layer = &lt;CALayer: 0x62800023e540&gt;&gt; layerID = 1 &quot;&lt;WKCompositingView: 0x7f91b5b250e0&gt;&quot;
   |    |    | &lt;UIView: 0x7f91b5c0fa90; frame = (0 0; 0 0); opaque = NO; layer = &lt;CALayer: 0x64000003b020&gt;&gt;
   |    |    |    | &lt;UITextSelectionView: 0x7f91b5b253f0; frame = (0 0; 0 0); userInteractionEnabled = NO; layer = &lt;CALayer: 0x62800023e560&gt;&gt;
   |    |    | &lt;: 0x7f91b37428a0; frame = (0 0; 0 0); userInteractionEnabled = NO; layer = &lt;CALayer: 0x618000222b00&gt;&gt;
   | &lt;: 0x7f91b3741a10; baseClass = UIStackView; frame = (0 0; 0 0); layer = &lt;CATransformLayer: 0x618000222a40&gt;&gt;


The layer transform is being set via -[UIScrollView setZoomScale:] being called from:
    frame #13: WebKit`::-[WKWebView _didCommitLayerTree:](self=0x00007fb8b00aea00, _cmd=&quot;_didCommitLayerTree:&quot;, layerTreeTransaction=0x00007fff55f11a00) at WKWebView.mm:1271
    frame #14: WebKit`::-[WKContentView _didCommitLayerTree:](self=0x00007fb8b00b5400, _cmd=&quot;_didCommitLayerTree:&quot;, layerTreeTransaction=0x00007fff55f11a00) at WKContentView.mm:562
    frame #15: WebKit`WebKit::PageClientImpl::didCommitLayerTree(this=0x0000600000422dc0, layerTreeTransaction=0x00007fff55f11a00) at PageClientImplIOS.mm:506
    frame #16: WebKit`WebKit::WebPageProxy::didCommitLayerTree(this=0x00007fb8b000c018, layerTreeTransaction=0x00007fff55f11a00) at WebPageProxyIOS.mm:407
    frame #17: WebKit`WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree(this=0x00007fb8b41020d0, layerTreeTransaction=0x00007fff55f11a00, scrollingTreeTransaction=0x00007fff55f11b08) at RemoteLayerTreeDrawingAreaProxy.mm:200

but this seems to happen for an offscreen WKWebView (I see this before viewing any message on iPhone). Then the assertion hits when the WKWebView is being resized.

My guess is that the 0.25x scale is some WKWebView content autosizing minimum scale, and the assertion hits when the WKWebView is being prepared for display.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>