WKWebView在acceleratedAnimationDidStart

时间:2016-05-11 20:36:29

标签: ios css webkit gpu wkwebview

我在客户的应用程序上发生了崩溃,而WTFCrash发生了很多,我没有从堆栈跟踪中获得太多用途。

我正在使用WKWebView实例来显示包含一些基于CSS的动画和视频的网页。问题出现在iOS 8和9上的各种设备上(iPhone 5c到6s和类似的iPad系列)。

WKWebView在自己的流程中运行,而不是在应用程序中运行。当发生崩溃时,会留下一个覆盖主应用程序的白色图层,即使其进程未受影响也会使其无法访问。

查看设备日志,我发现来自com.apple.WebKit.WebContent进程的崩溃,它们都有与崩溃线程完全相同的日志。

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   JavaScriptCore                  0x0000000184c9f22c WTFCrash + 72
1   JavaScriptCore                  0x0000000184c9f224 WTFCrash + 64
2   WebKit                          0x0000000188ecd850 WebKit::RemoteLayerTreeDrawingArea::acceleratedAnimationDidStart(unsigned long long, WTF::String const&, double) + 0
3   WebCore                         0x0000000184f2e70c WebCore::ThreadTimers::sharedTimerFiredInternal() + 148
4   WebCore                         0x0000000184f2e64c WebCore::timerFired(__CFRunLoopTimer*, void*) + 36
5   CoreFoundation                  0x000000018107d81c __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 28
6   CoreFoundation                  0x000000018107d4c0 __CFRunLoopDoTimer + 884
7   CoreFoundation                  0x000000018107abd4 __CFRunLoopRun + 1520
8   CoreFoundation                  0x0000000180fa4d10 CFRunLoopRunSpecific + 384
9   Foundation                      0x00000001819b4d8c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 308
10  Foundation                      0x0000000181a09ff8 -[NSRunLoop(NSRunLoop) run] + 88
11  libxpc.dylib                    0x0000000180d68cf8 _xpc_objc_main + 660
12  libxpc.dylib                    0x0000000180d6aa2c xpc_main + 200
13  com.apple.WebKit.WebContent     0x0000000100057924 0x100054000 + 14628
14  libdyld.dylib                   0x0000000180b428b8 start + 4

以下是我们用来重现问题的一些示例html / css。



        var initialWidth = 100;
        window.addEventListener('load', function() {
          var div = document.getElementById('mytest');
          div.className = '';
          setInterval(function() {
            initialWidth += 10;
            if (initialWidth > 1000) {
              initialWidth = 1;
            }
            div.style.height = initialWidth + 'px';
          }, 40);
        }, false);

        body {
          background-color: #4cb9e4;
        }
        
        div#mytest {
          position: absolute;
          top: 0;
          width: 100%;
          height: 5000px;
          background-color: rgba(0, 0, 0, 0.7);
          text-align: center;
          overflow-y: hidden;
          -webkit-transition-property: height;
          -moz-transition-property: height;
          transition-property: height;
          -webkit-transition-duration: 0.5s;
          -moz-transition-duration: 0.5s;
          transition-duration: 0.5s;
          -webkit-transition-timing-function: ease;
          -moz-transition-timing-function: ease;
          transition-timing-function: ease;
        }
        
        div#mytest.hidden {
          height: 0;
        }

    <body>
      <div class="hidden" id="mytest">
        This is sample test
      </div>
    </body>
&#13;
&#13;
&#13;

这对任何人来说都很熟悉吗?有什么我应该告诉网络工程师改变动画吗?

1 个答案:

答案 0 :(得分:0)

您应该在主线程中创建webView

CREATE INDEX idx_name ON card_legality(format_id, card_id);