Feedback from the webkit-dev thread.
1. Selection markers should be # prefixed
2. nodenames should be lowercase (use localName instead of nodeName)
3. Text nodes should be delimited by quotes, not <#text>
4. Should indent.
Also, there are some things that LayoutTests/html5lib/resources/dom2string.js does that dump-as-markup should do as well:
-deals with misnested DOMs
-namespaced nodes/attributes (e.g. svg/math)
Created attachment 62778 [details]
Comment on attachment 62778 [details]
Can we keep the new dump-as-markup but leave the HTML5lib test suite using the "old and busted" dom2string? Alternatively, we could dump-as-markup produce identical dumps for the HTML5lib test suite, but that might constrain our ability to make dom-as-markup more awesome in the future.
(In reply to comment #3)
> Can we keep the new dump-as-markup but leave the HTML5lib test suite using the "old and busted" dom2string? Alternatively, we could dump-as-markup produce identical dumps for the HTML5lib test suite, but that might constrain our ability to make dom-as-markup more awesome in the future.
We could pass some flag. e.g. In the .js file loaded for HTML5lib tests, we set Markup.html5lib = true. I don't know... maybe it's not worth combining the code if we have two modes.
The flag sounds like a good idea. I don't quite understand where the differences are coming from, so I'm not sure if they're bugs. Maybe they dump document fragments differently?
Created attachment 62888 [details]
I've made the output match. The only difference before was whether we print the DOM root node passed in.
Having as few testing frameworks as possible is a good thing for keeping our tests easy to work with. If we run into something we want to add to dump-as-markup that doesn't work for the html5lib tests, then we can add a flag then. For now, we can have the same output.
Comment on attachment 62888 [details]
Fantastic. Thanks Ojan.
I'm curious why you added this. DRT waits until after the load event before finishing.
(In reply to comment #8)
> + layoutTestController.notifyDone();
> I'm curious why you added this. DRT waits until after the load event before finishing.
This is just the dump-as-markup API being dumb. Instead, I added Markup.noAutoDump, replaced the call to Markup.waitUntilDone, and got rid of the notifyDone call.
Committed r64303: <http://trac.webkit.org/changeset/64303>
http://trac.webkit.org/changeset/64303 might have broken Qt Linux Release