Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/embedded-content/the-img-element/img-src-in-synthetic-document.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<link rel=author href="mailto:jarhar@chromium.org">
<link rel=help href="https://html.spec.whatwg.org/#reflecting-content-attributes-in-idl-attributes">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(() => {
const doc = document.implementation.createHTMLDocument('');
const img = doc.createElement('img');
img.setAttribute('src', '/test');
doc.body.appendChild(img);
assert_equals(img.src, '/test');
}, 'HTMLImageElement.src should return the string from the attribute in about:blank documents.');
</script>