<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 - [DOM] Add JSEventType"
   href="https://bugs.webkit.org/show_bug.cgi?id=164096">164096</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[DOM] Add JSEventType
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </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>Bindings
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>utatane.tea&#64;gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>cdumez&#64;apple.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I've found that Event is frequently touched in Speedometer. And I think it is frequently touched in the real Web.
But, if you touch the accessors of Event interface, you always need to perform jsDynamicCast&lt;Event*&gt;.
It is costly because the typical event instance is not direct instance of the Event class. For example,

MouseEvent -&gt; UIEvent -&gt; Event

Event resides in higher position in the hierarchy. But it has many accessors and they are used (currentTarget, type, target etc.)
So it's worth introducing JSEventType (similar to JSDocumentWrapperType) and jsEventCast.

Current my policy is, &quot;If the jsDynamicCast&lt;XXX&gt;() is so frequently called and it always walks many classes, we should consider introducing some JSType.&quot;.
For example, CanvasWebGLContext thing does not require it because jsDynamicCast&lt;....Context&gt;() typically succeeds with the first ClassInfo.
But it is not for Event.</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>