Changes between Version 2 and Version 3 of Writing DumpAsMarkup Tests
- Timestamp:
- Aug 3, 2010 2:34:53 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Writing DumpAsMarkup Tests
v2 v3 48 48 == Output Subtree == 49 49 50 If you want to output a subtree of the DOM, call Markup. setNodeToDump(<node>) where <node> is a HTMLElement object for which you want to print the subtree. You can also specify the id of an element.50 If you want to output a subtree of the DOM, call Markup.dump(<node>) where <node> is a HTMLElement object for which you want to print the subtree. You can also specify the id of an element. 51 51 52 52 For example, if I have: … … 57 57 <script> 58 58 Markup.description('This is a dumpAsMarkup test.') 59 Markup. setNodeToDump('test')59 Markup.dump('test') 60 60 </script> 61 61 }}} … … 64 64 {{{ 65 65 This is a dumpAsMarkup test. 66 67 <DIV id="test"> 68 <A href="http://webkit.org/"> 69 <#text>WebKit</#text> 70 </A> 71 <#text> is </#text> 72 <STRONG> 73 <#text>awesome</#text> 74 </STRONG> 75 </DIV> 66 | <a> 67 | href="http://webkit.org/" 68 | "WebKit" 69 | " is " 70 | <strong> 71 | "awesome" 76 72 }}} 77 73 78 Note "This is a dumpAsMarkup test." is added by Markup.description. The sentence will not be printed in DRT if we had it in a div like the earlier example because the entire document body is replaced by the output.74 Note "This is a dumpAsMarkup test." is added by Markup.description. The sentence will not be printed on DRT if we had it in a div like the earlier example because the document body is replaced by the output. 79 75 80 76 == Dump Multiple Times ==