<?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>170113</bug_id>
          
          <creation_ts>2017-03-27 02:03:34 -0700</creation_ts>
          <short_desc>ASSERT(!needsLayout()) in FrameView::paintContents() when setting a CSS class during handling of a &quot;loadedmetadata&quot; event</short_desc>
          <delta_ts>2017-03-27 11:08:54 -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>Layout and Rendering</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=169145</see_also>
          <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="Antoine Quint">graouts</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1291433</commentid>
    <comment_count>0</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2017-03-27 02:03:34 -0700</bug_when>
    <thetext>A previous version of the patch for https://bugs.webkit.org/show_bug.cgi?id=169145 would infrequently hit `ASSERT(!needsLayout())` in FrameView::paintContents(). This was due to those three lines in _mediaDocumentHasMetadata() in Source/WebCore/Modules/modern-media-controls/media/media-document-controller.js:

    const media = this.mediaController.media;
    media.classList.add(this.mediaController.isAudio ? &quot;audio&quot; : &quot;video&quot;);
    media.classList.add(window.navigator.platform === &quot;MacIntel&quot; ? &quot;mac&quot; : window.navigator.platform);

This code is called as a result of handling a &quot;loadedmetadata&quot; event, which is fired asynchronously. You can re-create the assertion by removing the enclosing requestAnimationFrame() call and running this command:

    run-webkit-tests --debug -1 --iterations=500 --exit-after-n-failures=1 fast/events/media-focus-in-standalone-media-document.html

You should see DRT crash relatively quickly as this ASSERT is hit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1291435</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2017-03-27 02:05:37 -0700</bug_when>
    <thetext>&lt;rdar://problem/31269350&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1291461</commentid>
    <comment_count>2</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2017-03-27 07:58:53 -0700</bug_when>
    <thetext>What&apos;s the full stack trace?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1291464</commentid>
    <comment_count>3</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2017-03-27 08:07:11 -0700</bug_when>
    <thetext>https://build.webkit.org/results/Apple%20Sierra%20Debug%20WK1%20(Tests)/r213410%20(3609)/fast/events/media-focus-in-standalone-media-document-crash-log.txt</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1291529</commentid>
    <comment_count>4</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2017-03-27 11:08:54 -0700</bug_when>
    <thetext>Ah, it&apos;s coming out of figDeferredNotificationDispatchFunction. This is tracked by rdar://problem/16622896.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>