edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
* [Edbrowse-dev] css in C
@ 2018-02-26 19:44 Karl Dahlke
  2018-02-27  9:33 ` Kevin Carhart
  0 siblings, 1 reply; 5+ messages in thread
From: Karl Dahlke @ 2018-02-26 19:44 UTC (permalink / raw)
  To: Edbrowse-dev

Well there you have it, 2000 lines of code.
It's so fast you can't even measure it, even for stackoverflow.com, 5000 selectors and 5000 nodes.
Course that may be because it isn't working properly.
It only makes 157 assignments, which seems awfully small.
Or maybe most of those selectors are for situations that don't come up,
i.e. a selector for every conceivable situation.
It will take a long time to actually debug this mess.
dbcss can help in this regard, dumps lots of information to /tmp/css
As a simple spotcheck,
ok(document.body.style) has all sorts of attributes, as one would expect.

Karl Dahlke

^ permalink raw reply	[flat|nested] 5+ messages in thread
* [Edbrowse-dev] css in c
@ 2018-02-24 19:21 Karl Dahlke
  0 siblings, 0 replies; 5+ messages in thread
From: Karl Dahlke @ 2018-02-24 19:21 UTC (permalink / raw)
  To: Edbrowse-dev

[-- 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-02-28  0:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
  -- strict thread matches above, loose matches on Subject: below --
2018-02-24 19:21 [Edbrowse-dev] css in c Karl Dahlke

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).