[webkit-gtk] Hello, new member with some questions

Carlos Garcia Campos cgarcia at igalia.com
Wed Apr 18 01:32:02 PDT 2018


El mar, 17-04-2018 a las 17:32 +0100, Adrian Perez de Castro escribió:
> Hi all,
> 
> On Tue, 17 Apr 2018 10:27:48 -0500, Michael Catanzaro <mcatanzaro at iga
> lia.com> wrote:
> > On Tue, Apr 17, 2018 at 10:19 AM, Carlos Garcia Campos 
> > <cgarcia at igalia.com> wrote:
> > > No, there isn't. You could use any javascript utility for that.
> > 
> > In practice, I've failed to find any JavaScript syntax
> > highlighting 
> > utility that can do this with acceptable performance. They all seem
> > to 
> > require huge amounts of time to present the result, whereas
> > WebCore 
> > used to be very quick. This is why Epiphany is still only capable
> > of 
> > showing  the page source in an external editor, like gedit. I think
> > I 
> > tried Rainbow and Prism, and found web sources reporting that
> > other 
> > comparable JS libraries are generally slower.
> > 
> > I'm planning to just give up on syntax highlighting altogether in
> > order 
> > to bring back internal view source mode, because the user
> > experience 
> > with the external editor is very poor in flatpak.
> 
> I did a small benchmark a while ago to help figure out which JS-based
> highlighter to use: https://github.com/aperezdc/js-highlighters-shoot
> out
> 
> While they all are quite fast, CodeMirror is among the fastest but
> Prism
> (which Michael tried) is not to fast either. For some reason running
> the
> highlighter inside the browser turns out to be noticeably slower, but
> we
> never got to understand the root reason why (IIRC).

CodeMirror is what the web inspector uses, so we already have
CodeMirror code in the library. Maybe we can add a builtin custom uri
scheme using CodeMirror.

> Something I have been wondering is whether the initial parsing of the
> JS
> code of the highlighter and (byte)code generation can be dominating
> the
> case when only one run of the highlighter is done. If that's the
> case,
> some way of having the highlighter JS code pre-compiled would
> alleviate
> (or completely solve) the problem.
> 
> That all being said, I would rather have C/C++ code to do the job,
> either in
> WebKit or Epiphany (yes, we could even run the syntax highlighter in
> the
> WebExtension, or just pop up a new window/tab with a GtkSourceView
> inside).
> 
> Cheers,
> 
> 
> --
>  Adrián 🎩
> 
> _______________________________________________
> webkit-gtk mailing list
> webkit-gtk at lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-gtk
-- 
Carlos Garcia Campos
http://pgp.rediris.es:11371/pks/lookup?op=get&search=0xF3D322D0EC4582C3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <http://lists.webkit.org/pipermail/webkit-gtk/attachments/20180418/148aa47e/attachment.bin>


More information about the webkit-gtk mailing list