1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:07:35 +00:00

LibWeb: Add document.querySelector()

This commit is contained in:
Linus Groh 2020-05-25 21:12:00 +01:00 committed by Andreas Kling
parent 6e505b853e
commit 67b742bf32
8 changed files with 46 additions and 5 deletions

View file

@ -9,10 +9,10 @@
</style>
<script>
document.addEventListener("DOMContentLoaded", function() {
img = document.querySelectorAll("img")[0];
img = document.querySelector("img");
img.addEventListener("load", function() {
var ctx = document.querySelectorAll("canvas")[0].getContext("2d");
var ctx = document.querySelector("canvas").getContext("2d");
ctx.fillStyle = '#666';
ctx.fillRect(0, 0, 400, 400);
ctx.scale(2, 2);