edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: Karl Dahlke <eklhad@comcast.net>
To: Edbrowse-dev@lists.the-brannons.com
Subject: [Edbrowse-dev] css in c
Date: Sat, 24 Feb 2018 14:21:11 -0500	[thread overview]
Message-ID: <20180124142111.eklhad@comcast.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

Over the past month I've come to conclude that a lot of css stuff will have to run at document load time, maybe not all of it but enough,
and that says the stuff probably has to be rewritten in C.
I translated the css parser from javascript to c, thus the new file css.c.
This was about as much fun as cleaning the bathroom.

I pushed just because there are 900 new lines of code and I didn't want to lose all that work if my computer flaked out.

It isn't used yet, it just exists.
You can invoke it from jdb by cssCompile("css string")
or perhaps an existing source like
cssCompile(cssSource[0].data)
It parses the css and builds the tree of descriptors and rules internally
and prints it out for debugging purposes, in /tmp/css
All the old js machinery still does querySelectorAll and getComputedStyle etc.
This is the foundation.
I do expect it all to be very fast when done though.

I did find a few things while translating that I wasn't doing at all.
Like
@import url(blah)
which lets one css file import another.   Like #include
So that's working in the c version.
And a couple other small fixes too.
It's going to be a long road.

Karl Dahlke

             reply	other threads:[~2018-02-24 19:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-24 19:21 Karl Dahlke [this message]
2018-02-26 19:44 [Edbrowse-dev] css in C Karl Dahlke
2018-02-27  9:33 ` Kevin Carhart
2018-02-27 11:24   ` Karl Dahlke
2018-02-28  0:31     ` Kevin Carhart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180124142111.eklhad@comcast.net \
    --to=eklhad@comcast.net \
    --cc=Edbrowse-dev@lists.the-brannons.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).