LibWeb/DOM: Implement the Document object's partial attributes

This commit is contained in:
PGHales 2024-04-18 13:58:48 -06:00 committed by Andreas Kling
commit 75626c6cd2
Notes: sideshowbarker 2024-07-17 03:35:24 +09:00
5 changed files with 125 additions and 0 deletions

View file

@ -0,0 +1,18 @@
<!DOCTYPE html>
<script src="../include.js"></script>
<script>
test(() => {
function testPartialDocumentAttribute(documentAttr, bodyAttr) {
println(`before document.${documentAttr}=${document[documentAttr]}`);
println(`before body attribute ${bodyAttr}=${document.body.getAttribute(bodyAttr)}`);
document[documentAttr] = "red";
println(`after document.${documentAttr}=${document[documentAttr]}`);
println(`after body attribute ${bodyAttr}=${document.body.getAttribute(bodyAttr)}`);
}
testPartialDocumentAttribute("fgColor", "text");
testPartialDocumentAttribute("linkColor", "link");
testPartialDocumentAttribute("alinkColor", "alink");
testPartialDocumentAttribute("vlinkColor", "vlink");
testPartialDocumentAttribute("bgColor", "bgcolor");
});
</script>