More info needed ;)

16 views
Skip to first unread message

Kristian Mandrup

unread,
May 1, 2010, 5:56:01 PM5/1/10
to taka-talk
Hey, what is Taka all about. Why the need for a DOM API?

I have been needing a way to extend Nokogiri with CSS information.
That is, if I load in a html document and traverse it, I would like
that for each node I get the CSS styles that would be in effect for
that element in the browser. I need this to build an infrastructure
for a html2pdf generator in Ruby.

I created a homegrown solution for this so far using my own extension
of Css_parser (from Alex Dunae).

Would be nice to extend Nokogiri nodes in a similar way for CSS
similar to how Taka extends it with a DOM :)

Aaron Patterson

unread,
May 1, 2010, 6:56:44 PM5/1/10
to taka...@googlegroups.com
On Sat, May 1, 2010 at 2:56 PM, Kristian Mandrup <kman...@gmail.com> wrote:
> Hey, what is Taka all about. Why the need for a DOM API?

I originally wrote it as a companion to Johnson. So that we might
have a DOM available inside a Javascript runtime.

> I have been needing a way to extend Nokogiri with CSS information.
> That is, if I load in a html document and traverse it, I would like
> that for each node I get the CSS styles that would be in effect for
> that element in the browser. I need this to build an infrastructure
> for a html2pdf generator in Ruby.

I have been working on something similar, but haven't had time to finish.

> I created a homegrown solution for this so far using my own extension
> of Css_parser (from Alex Dunae).
>
> Would be nice to extend Nokogiri nodes in a similar way for CSS
> similar to how Taka extends it with a DOM :)

It's possible to do that, but I'm not sure if nokogiri is the correct
place for that functionality. It seems to me that you would ask the
CSS engine, given a particular node, what styles should be applied.

--
Aaron Patterson
http://tenderlovemaking.com/
Reply all
Reply to author
Forward
0 new messages