2 <script src=
"../../../resources/testharness.js"></script>
3 <script src=
"../../../resources/testharnessreport.js"></script>
6 async_test(function(t
) {
7 var iframe
= document
.createElement('iframe');
8 iframe
.src
= 'resources/doc.html';
9 iframe
.srcdoc
= 'Set by srcdoc.';
10 iframe
.onload
= t
.step_func(srcdocLoaded
);
11 document
.body
.appendChild(iframe
);
13 function srcdocLoaded() {
15 iframe
.contentDocument
.documentElement
.textContent
,
17 'srcdoc should override src when both are present');
18 iframe
.onload
= t
.step_func(srcLoaded
);
19 iframe
.removeAttribute('srcdoc');
22 function srcLoaded() {
24 iframe
.contentDocument
.documentElement
.textContent
,
26 'when srcdoc is removed, src should be loaded');
29 }, 'Removing an iframe srcdoc attribute should load the src, if set');