08:21
<PiersW>
domfarolino: Our SVG <script>s use #prepare-a-script. It seemed logical that they behave the same as HTML, so the code is common to both. I think we just assumed other browsers did the same.
08:21
<domfarolino>
Chrome does the same
08:24
<annevk>
Yeah, I think the main difference is 1) the HTML parser and 2) the public API (xlink:href vs src for instance)
08:25
<annevk>
And arguably 1 is a duplicate of 2
08:28
<PiersW>
Yeah, for 2 we haven't implemented all the attributes (async, etc) for SVG, though it'd be trivial to do so but it's not part of the SVG 2 spec.
08:28
<PiersW>
HTML attrs, I mean.
11:43
<scfe>
I have a question regarding html5lib (Python): Is there support for "diffing" two html trees? In particular I'd like to check attributes, conditional comments etc. Also I want to check generated CSS in <style> tags - probably via a separate library but the diffing should return the style contents so I can do the diff on my own.
11:43
<scfe>
any pointers?
11:44
<scfe>
I'm not looking for a turn-key solution - just some Python API I can use without resorting to raw parsing events.
11:52
<annevk>
I'm only aware of tools to diff documents, but those wouldn't do what you need (sounds like you're looking at XSS?)
11:55
<scfe>
annevk: No, actually I want to test html generation
11:56
<scfe>
basically I want to make sure that my new tool outputs (roughly) the same html as some external legacy tool.
11:57
<scfe>
The upstream tool generates html (mostly "not crazy") with conditional comments, some embedded style tags etc.
11:57
<scfe>
however this is html not xml so many xml differs won't work
11:58
<scfe>
so basically it'd like to answer the question "is this html document (almost) the same as some other document" and I probably need some hooks to do "custom stuff" (e.g. compare CSS rules)
11:59
<annevk>
I guess I'd try to write something from scratch that takes two trees and compares them and outputs/breaks on differences and then modify it as I go
11:59
<scfe>
the library I'm looking for should take care of the html rules (e.g. disregard ordering of attributes, optional closing tags, ...)
11:59
<annevk>
Assuming you have two parsed trees
11:59
<scfe>
annevk: yes, html5lib (and others) can parse my html.
12:00
<scfe>
writing more or less from scratch is also one of my ideas but then I considered all the edge cases and I hope there is some library which does this. I mean comparing generated html should be a pretty common task, no?