dom.html revision 823c598a59287448dd0e8a15b8ade29549283d84
<p>Fusce feugiat diam. Vestibulum elementum dui in augue. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Mauris pulvinar.</p>
<p>In hac habitasse platea dictumst. Sed sit amet ligula vitae justo consequat facilisis. Integer tortor. Integer erat. In hac habitasse platea dictumst. Phasellus convallis quam vitae turpis aliquam lobortis. Aliquam scelerisque condimentum lectus. Proin semper adipiscing leo. Nulla facilisi.</p>
YUI({ base: '/build/', filter: 'debug' }).use('node', function(Y) {
tool = YAHOO.tool,
Assert = YAHOO.util.Assert,
ArrayAssert = YAHOO.util.ArrayAssert,
var logger = new YAHOO.tool.TestLogger(null, { height: '80%' });
var doc = document.getElementById('doc'),
hd = document.getElementById('hd'),
bd = document.getElementById('bd'),
ft = document.getElementById('ft'),
mod1 = document.getElementById('mod1'),
mod2 = document.getElementById('mod2'),
h1 = hd.getElementsByTagName('h1')[0],
main = document.getElementById('main'),
lorem = document.getElementById('lorem-ipsum'),
search = document.getElementById('search'),
search_fields = document.getElementById('search-fields'),
search_p = document.getElementById('search-p'),
foo = document.getElementById('foo'),
tmp = document.createElement('div');
function(node) { return node.id === 'bd'; }
function(node) { return node.id === 'bd'; }
return node.className === 'mod';
return node.type === 'text';
Assert.areEqual('left',
Y.DOM.getStyle(foo, 'float'), 'getStyle(foo, "float")');
doc.style.marginBottom = '10px';
Assert.areEqual('10px',
Y.DOM.getStyle(doc, 'marginBottom'), 'doc, marginBottom');
Assert.areEqual('static',
Y.DOM.getStyle(doc, 'position'), 'doc, position');
Y.DOM.setStyle(ft, 'opacity', 0.5);
Y.DOM.setStyle(main, 'float', 'none');
var el = Y.DOM.create(html);
el = Y.DOM.create(html);
el = Y.DOM.create(html);
el = Y.DOM.create(html);
el = Y.DOM.create(html);
el = Y.DOM.create(html);
el = Y.DOM.create(html);
el = Y.DOM.create(html);
el = Y.DOM.create(html);
el = Y.DOM.create(html);
el = Y.DOM.create(html);
el = Y.DOM.create(html);
el = Y.DOM.create(html);
el = Y.DOM.create(html);
el = Y.DOM.create(html);
el = Y.DOM.create(html);
el = Y.DOM.create(html);
el = Y.DOM.create(html);
el = Y.DOM.create(html);
el = Y.DOM.create(html);
el = Y.DOM.create(html);
el = Y.DOM.create(html);
el = Y.DOM.create(html);
el = Y.DOM.create(html);
el = Y.DOM.create(html);
el = Y.DOM.create(html);
el = Y.DOM.create(html);
el = Y.DOM.create(html);
el = Y.DOM.create(html);
html ='<div id="default-e34f85" class="mod view_default"> <div id="default-e34f85-hd" class="hd"><h2>Yahoo! Mail Preview</h2> <span class="mod-button-wrapper"> </span> </div> <div id="default-e34f85-bd" class="bd type_mail type_mail_default"> <p class="divider-b small text-right"><a href="http://us.lrd.yahoo.com/_ylt=AhQqDwn_HdUEqFrWLI8HTGP1cSkA/SIG=10rfos93v/**http%3A//mail.yahoo.com/">Go to Yahoo! Mail</a></p> <img src="http://l.yimg.com/a/i/ww/met/mail_promo_060608.gif" alt="Yahoo! Mail avatar shows the possibilities of email" class="promo" width="300px"> <p class="x-large sign-in-link"><a href="https://us.lrd.yahoo.com/_ylt=AnGramz3WfSHqLcCWa92OGj1cSkA/SIG=12tb7s4o8/**https%3A//login.yahoo.com/config/mail%3F.intl=us%26.src=ym%26.done=http%3A//mail.yahoo.com">Sign in</a> to preview your email here.</p> <p class="med-small">The all-new Yahoo! Mail:<br>More ways to connect with everyone.</p> </div></div>';
el = Y.DOM.create(html);
el = Y.DOM.create(html);
el = Y.DOM.create(html);
html = '<thead><tr><td><table><thead></thead><tbody><tr><td>fresh</td></tr></tbody></table></td></tr></thead>';
el = Y.DOM.create(html);
var el = Y.DOM.create(html);
Assert.areEqual('tmp-bar', el[1].id, html);
el = Y.DOM.create(html);
Assert.areEqual('tmp-bar', el[1].id, html);
el = Y.DOM.create(html);
Assert.areEqual('tmp-bar', el[1].id, html);
el = Y.DOM.create(html);
Assert.areEqual('tmp-bar', el[1].id, html);
html = '<thead><tr><td><table><tbody><tr><td>fresh</td></tr></tbody></table></td></tr></thead><tbody></tbody>';
el = Y.DOM.create(html);
Assert.areEqual(document.body, Y.DOM.ancestor(bd, function(node) { return node.tagName === 'BODY';}), 'ancestor(bd, fn)');
tool.TestRunner.add(suite);