<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][JSC] Explore the way to embed nodeType into JSC::JSType in WebCore"
   href="https://bugs.webkit.org/show_bug.cgi?id=163245">163245</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[DOM][JSC] Explore the way to embed nodeType into JSC::JSType in WebCore
          </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>JavaScriptCore
          </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></table>
      <p>
        <div>
        <pre>Node.prototype.nodeType() is frequently called in Dromaeo don-query.html, but it is implemented in virtual function call.
I think we could implement it very efficiently... like, embedding this type into JSC::JSType.
In WebCore, we extend JSC::JSType in JSDOMWrapper.h. Like adding JSElementType.

Note that nodeType is frequently used in reality. Usually it is used to check whether the given object is DOM node.
For example, jQuery's $ function is like this.

        // HANDLE: $(&quot;&quot;), $(null), $(undefined), $(false)
        if ( !selector ) {
                    ...
        }

        // Method init() accepts an alternate rootjQuery
        // so migrate can support jQuery.sub (gh-2101)
        root = root || rootjQuery;

        // Handle HTML strings
        if ( typeof selector === &quot;string&quot; ) {
                    ...
        // HANDLE: $(DOMElement)
        } else if ( selector.nodeType ) {                  &lt;--------- THIS
                    ...
        // HANDLE: $(function)
        // Shortcut for document ready
        } else if ( jQuery.isFunction( selector ) ) {
                    ...
        }
                ...</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>