Re: css prototype on freehg.org
Hi, We've been arranging some CSS things behind the scenes with Johannes (he'll forward some past mails here soon). On Fri, Oct 31, 2008 at 05:00:54PM +0100, Johannes Hofmann wrote:
Hi Jorge,
I just created a repository http://freehg.org/u/jh33/dillo-css-prototype/
freehg.org is a free mercurial hosting service. This gives access to the newest version of the css prototyping work. Also you can check whether you like mercurial.
To get a copy of the repository call
hg clone http://freehg.org/u/jh33/dillo-css-prototype/
and start hacking. You can commit locally using
hg commit
OK, I'll make some patches with Hg once I grasp how this distributed model works. On the current code, basically it looks OK to me. i.e. we can continue working from that basis (having in mind that it's still in a flux state and that a validation is pending on whether the model is able to handle the current functionality in html.cc). My main comment is that the code needs more comments! :) Accurate comments are written when the code is developed (every detail is in the brain then). I've tried in the past to develop first and comment later, and found it only works OK for small code projects. As with CSS we don't have a main expert (yet), the team will be trying to understand and develop at the same time, and thus comments are very necessary. Even something like "I don't know how to implement this part" helps! I'd suggest to use the same format that's in css.cc. e.g. /** \todo dummy only */ with a view to integrate it smoothly with doxygen docs. in the future. Some specific examples: 1.- What do these functions do? - style0() - startElement() - endElement() 2.- On memory handling, there are some places with: // html->styleEngine->style () = // Style::create (HT2LT(html), &style_attrs); // old_style->unref (); or // (html->styleEngine->style ())->unref (); Why are they commented and left in the code? Is proper memory handling pending, is there a design decision to be made before getting rid of them? 3.- With regard, for instance, to font_factor and visited link color. Do they belong to buildUserAgentStyle() or buildUserStyle() or elsewhere? 4.- strdup/free should be dStrdup/dFree (Please let me use this extremely simple case to make my first Hg patch :-) I know this was just a prototype for the CSS implementation idea, but considering that we don't have any better, and that we agreed on it, now it has attained the status of "official CSS merge effort". ;-) From now comments are paramount, and we may eventually get to a dw-like quality docs in the future. Bottom line: Great, let's get started! -- Cheers Jorge.-
Hi, On Fri, Nov 07, 2008 at 11:36:21AM -0300, Jorge Arellano Cid wrote:
Hi,
We've been arranging some CSS things behind the scenes with Johannes (he'll forward some past mails here soon).
On Fri, Oct 31, 2008 at 05:00:54PM +0100, Johannes Hofmann wrote:
Hi Jorge,
I just created a repository http://freehg.org/u/jh33/dillo-css-prototype/
freehg.org is a free mercurial hosting service. This gives access to the newest version of the css prototyping work. Also you can check whether you like mercurial.
To get a copy of the repository call
hg clone http://freehg.org/u/jh33/dillo-css-prototype/
and start hacking. You can commit locally using
hg commit
OK, I'll make some patches with Hg once I grasp how this distributed model works.
On the current code, basically it looks OK to me. i.e. we can continue working from that basis (having in mind that it's still in a flux state and that a validation is pending on whether the model is able to handle the current functionality in html.cc).
My main comment is that the code needs more comments! :)
Agreed. I started to add comments (visible in the hg repo).
Accurate comments are written when the code is developed (every detail is in the brain then). I've tried in the past to develop first and comment later, and found it only works OK for small code projects.
As with CSS we don't have a main expert (yet), the team will be trying to understand and develop at the same time, and thus comments are very necessary. Even something like "I don't know how to implement this part" helps!
I'd suggest to use the same format that's in css.cc. e.g.
/** \todo dummy only */
with a view to integrate it smoothly with doxygen docs. in the future.
Some specific examples:
1.- What do these functions do? - style0() - startElement() - endElement()
2.- On memory handling, there are some places with:
// html->styleEngine->style () = // Style::create (HT2LT(html), &style_attrs); // old_style->unref ();
or
// (html->styleEngine->style ())->unref ();
Why are they commented and left in the code? Is proper memory handling pending, is there a design decision to be made before getting rid of them?
They can be deleted. I will do that. The idea is that in html.cc no styles are created anymore. Instead only the style handed out by styleEngine is used.
3.- With regard, for instance, to font_factor and visited link color. Do they belong to buildUserAgentStyle() or buildUserStyle() or elsewhere?
I think the userAgentStyle should contain the defaults, the userStyle can override those. We can create the userStyle from what's in dillorc or - once we have a CSS parser - we could parse a user defined custom stylesheet as it is possible in other browsers.
4.- strdup/free should be dStrdup/dFree (Please let me use this extremely simple case to make my first Hg patch :-)
Great. You could also create a repo on freehg.org were you can publish your work. We could then pull from each other. Or we send patches to the list and someone integrates them.
I know this was just a prototype for the CSS implementation idea, but considering that we don't have any better, and that we agreed on it, now it has attained the status of "official CSS merge effort". ;-)
From now comments are paramount, and we may eventually get to a dw-like quality docs in the future.
Yes, let's take dw as an example. The documentation is really good there.
Bottom line: Great, let's get started!
Excellent. Here's my todo list: * Adjust CssProperty::Value. As Sebastian has stated "CssValue (is) a union, which represents values exactly in the way they have been parsed" In addition to the values from style.hh it must be able to hold relative values (e.g. "bolder" for font weights). The translation to actual values is then done in StyleEngine::apply (). * Add support for pseudo classes and use it to change the color of visited links in Html_tag_open_a(). * Transform the rest of html.cc, table.cc, and form.cc to use styleEngine instead of creating styles itself. * Port the CSS parser code from dillo-0.8.0-css-3. Any help or comments are welcome! Make sure to have a look at dillo-0.8.0-css-3 as it contains a lot of useful code! Cheers, Johannes
participants (2)
-
jcid@dillo.org
-
Johannes.Hofmann@gmx.de