Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(224)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/html/script-tests/hidden-attr-dom.js

Issue 2674643002: Stop using script-tests in fast/html/. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 description('Various tests for the the hidden IDL attribute.');
2
3 var testParent = document.createElement('div');
4 document.body.appendChild(testParent);
5
6 debug('The IDL attribute reflects what is present in markup:');
7 testParent.innerHTML = '<div id=h1 hidden></div><div id=h2 hidden=false></div><d iv id=h3 hidden=off></div><div id=s1></div>';
8 var h1 = document.getElementById("h1");
9 var h2 = document.getElementById("h2");
10 var h3 = document.getElementById("h3");
11 var s1 = document.getElementById("s1");
12
13 shouldBeTrue('h1.hidden');
14 shouldBeTrue('h2.hidden');
15 shouldBeTrue('h3.hidden');
16 shouldBeFalse('s1.hidden');
17
18 debug('Changes via DOM Core are reflected through the IDL attribute:');
19
20 shouldBeFalse('(h1.removeAttribute("hidden"), h1.hidden)');
21 shouldBeTrue('(h1.setAttribute("hidden", ""), h1.hidden)');
22 shouldBeTrue('(h2.setAttribute("hidden", ""), h2.hidden)');
23 shouldBeTrue('(s1.setAttribute("hidden", ""), s1.hidden)');
24
25 debug('Changes via IDL attribute are reflected in the core DOM:');
26
27 shouldBe('(h3.hidden = false, h3.getAttribute("hidden"))', 'null');
28 shouldBe('(h3.hidden = true, h3.getAttribute("hidden"))', '""');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698