[Webkit-unassigned] [Bug 163245] New: [DOM][JSC] Explore the way to embed nodeType into JSC::JSType in WebCore

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 10 14:46:49 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=163245

            Bug ID: 163245
           Summary: [DOM][JSC] Explore the way to embed nodeType into
                    JSC::JSType in WebCore
    Classification: Unclassified
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: utatane.tea at gmail.com

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: $(""), $(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 === "string" ) {
                    ...
        // HANDLE: $(DOMElement)
        } else if ( selector.nodeType ) {                  <--------- THIS
                    ...
        // HANDLE: $(function)
        // Shortcut for document ready
        } else if ( jQuery.isFunction( selector ) ) {
                    ...
        }
                ...

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20161010/71144bc3/attachment.html>


More information about the webkit-unassigned mailing list