From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from resqmta-ch2-12v.sys.comcast.net (resqmta-ch2-12v.sys.comcast.net [IPv6:2001:558:fe21:29:69:252:207:44]) by hurricane.the-brannons.com (Postfix) with ESMTPS id B168E7933B for ; Sat, 1 Jul 2017 17:52:34 -0700 (PDT) Received: from resomta-ch2-01v.sys.comcast.net ([69.252.207.97]) by resqmta-ch2-12v.sys.comcast.net with SMTP id RT86d6HwL1q43RT8FdKVbt; Sun, 02 Jul 2017 00:52:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20161114; t=1498956779; bh=2Fxf9DNXK+T9jquZeXMvHL4nk2xe4B8vm88K76b9yts=; h=Received:Received:To:From:Reply-to:Subject:Date:Message-ID: Mime-Version:Content-Type; b=SZ8Jx3pQo0iRjC/e4rvJn8OX2/Srzq6QskqqQNxbXVK2gkmq1+/1xjcj15sYcKijn W91XORl94f5TMxltQ/AVrR2IG1D9ZMqDHaEY3+eJbZiuv4ARiwksYg/TXnX1HajMAa PLSRVYnUQ0uGLrKMvJxQYnH3RdxhzTfrPW7MS4CRTnWO0zEuRvLZ6r/7VJgYLmoWpy vs3W+Ps/OycBuvf7pDFKmZrfJ5yHLL+VYD57QlWmDkZOR+zMDdoZp2/KOFXzpFncTC fyfaBpJV0dTq11haTGf+mBVv8mK6CrMl9TW4eYhYmW7CLD/+HTlSgGHu/ISajyj7us vAUdCM7R2uTeQ== Received: from unknown ([IPv6:2601:408:c301:784d:21e:4fff:fec2:a0f1]) by resomta-ch2-01v.sys.comcast.net with SMTP id RT8EdH0OaWlw8RT8EdKHX3; Sun, 02 Jul 2017 00:52:59 +0000 To: Edbrowse-dev@lists.the-brannons.com From: Karl Dahlke Reply-to: Karl Dahlke User-Agent: edbrowse/3.6.3+ Date: Sat, 01 Jul 2017 20:52:58 -0400 Message-ID: <20170601205258.eklhad@comcast.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=nextpart-eb-389346 Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfBGNQQ4kuz5exq3q036cvlaUKvosmebPp+ZO37EhWnZsgrea1hdMNMI8kAF3Fv3k+xa5fnnVzZ5V1KGspBPys6uRqsQs6Uz81BciiNz0+SUwgGa8pWN2 AS7xrcqVziuBurz+Ap1C4Wp6LpYOcLDjXv2z4o8vfqatNYdzuZHUeH+q Subject: [Edbrowse-dev] predefined classes X-BeenThere: edbrowse-dev@lists.the-brannons.com X-Mailman-Version: 2.1.24 Precedence: list List-Id: Edbrowse Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jul 2017 00:52:34 -0000 This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --nextpart-eb-389346 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable When considering the switch from mozilla to duktape, much of = jseng-moz.cpp is the definition of DOM classes with various methods. These definitions are of course entirely mozilla specific. They are written using mozilla structs and so on. This becomes a big chunk of work when switching to duktape. When I wrote these, I didn't understand that some classes can be = defined in pure js, in startwindow.js. If I had known how to do that, then many class definitions would be = there, and not in jseng-moz.cpp. They would not have to be converted to duktape. In other words, less work for us now. Sure there are native methods in these classes, but some of those = methods can be defined as simple static methods then linked into the = class under the appropriate function name. This is how we built the class XMLHttpRequest. So before we switch to duktape, whoever is going to take that on, I suggest we morph the other classes into pure js in startwindow.js, = calling native methods where need be, following the model of = XMLHttpRequest. They won't be defined in C, and we won't have to rewrite all that code = whenever we switch engines. I would start with the URL class, which I've thought for a long time = could be pure js, I don't even think it needs any native methods. Then another class and another and so on. What do you think? I might anticipate some disagreement on this matter, and that's ok, = some have advocated exactly the opposite, moving stuff out of startwindow.js and back into C, but the more of that you do, the harder it is to make these conversions = from one engine to another. It's also about 4 times as much code. So I remain in the "implement it in js" camp, and would suggest we do more of that, as much as we can, then convert = from mozilla to duktape. Karl Dahlke --nextpart-eb-389346--