<html>
    <head>
      <base href="https://bugs.webkit.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - ASSERT(!needsLayout()) in FrameView::paintContents() when setting a CSS class during handling of a &quot;loadedmetadata&quot; event"
   href="https://bugs.webkit.org/show_bug.cgi?id=170113">170113</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>ASSERT(!needsLayout()) in FrameView::paintContents() when setting a CSS class during handling of a &quot;loadedmetadata&quot; event
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Nightly Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Layout and Rendering
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>graouts&#64;apple.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>bfulgham&#64;webkit.org, simon.fraser&#64;apple.com, zalan&#64;apple.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>A previous version of the patch for <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED - [Modern Media Controls] Improve media documents across macOS, iPhone and iPad"
   href="show_bug.cgi?id=169145">https://bugs.webkit.org/show_bug.cgi?id=169145</a> 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.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>