[webkit-dev] Introducing dumpAsMarkup

Eric Seidel eric at webkit.org
Mon Jul 26 15:21:27 PDT 2010


Thinking about it more, I'm not sure "markup" is as useful as DOM is.
We should have tests which test our DOM->Markup serialization.  Maybe
all the editing tests want that.  But I think most tests just want to
test the DOM, which (as demonstrated by the html5lib tests) can be
sterilized in a shorter format and exposes slightly different (and I
think in most cases more relevant) information.

On Mon, Jul 26, 2010 at 6:13 PM, Eric Seidel <eric at webkit.org> wrote:
> There is another DOM dump format which the html5lib tests use:
> http://trac.webkit.org/browser/trunk/LayoutTests/html5lib/runner-expected-html5.txt
>
> Note, it's a DOM Dump, not a Markup dump, but it serves a similar purpose.
>
> I I think I like the html5lib format better for a few reasons:
> 1.  All lowercase (UPPERCASE TAGS ARE SO HTML4)
> 2.  The DOM tree indent is nice.
> 3.  <#text> is takes less space.
>
> -eric
>
> On Mon, Jul 26, 2010 at 6:06 PM, Ryosuke Niwa <rniwa at webkit.org> wrote:
>> If tests you write only require comparing DOMs, you want to read this.
>> We've recently added dump-as-markup. It allows your tests to be platform
>> independent and gives output that is easier to read than render tree dumps.
>> For example, if I have:
>> <script src="../../resources/dump-as-markup.js"></script>
>> <div id=foo>This is a dumpAsMarkup test.</div>
>> <script>window.getSelection().selectAllChildren(foo);</script>
>> Then I get:
>> <HTML>
>> <HEAD>
>> <SCRIPT src="../../resources/dump-as-markup.js"></SCRIPT>
>> <#text>
>> </#text>
>> </HEAD>
>> <BODY>
>> <DIV id="foo">
>> <#text><selection-anchor>This is a dumpAsMarkup
>> test.<selection-focus></#text>
>> </DIV>
>> <#text>
>> </#text>
>> <SCRIPT> window.getSelection().selectAllChildren(foo); </SCRIPT>
>> <#text>
>> </#text>
>> </BODY>
>> </HTML>
>> See Writing DumpAsMarkup Tests for more ways you can use dump-as-markup.js
>> Best regards,
>> Ryosuke Niwa
>>
>> _______________________________________________
>> webkit-dev mailing list
>> webkit-dev at lists.webkit.org
>> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>>
>>
>


More information about the webkit-dev mailing list