about summary refs log tree commit diff stats
path: root/src/html
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-02-27 21:52:06 +0100
committerbptato <nincsnevem662@gmail.com>2024-02-27 21:52:24 +0100
commit50436a9176f0b5a5239d4f3180f4e69c3dc350c1 (patch)
tree01becacd3e8c3ba9176bac262a87aa6ecf43edfa /src/html
parentad6e00f70e3ca5ad95563394199a43cfad9d8034 (diff)
downloadchawan-50436a9176f0b5a5239d4f3180f4e69c3dc350c1.tar.gz
dom: fix non-stylesheets being downloaded as stylesheets
Diffstat (limited to 'src/html')
-rw-r--r--src/html/dom.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/html/dom.nim b/src/html/dom.nim
index d322049c..c705cc35 100644
--- a/src/html/dom.nim
+++ b/src/html/dom.nim
@@ -2718,6 +2718,8 @@ var appliesFwdDecl*: proc(mqlist: MediaQueryList, window: Window): bool
 # see https://html.spec.whatwg.org/multipage/links.html#link-type-stylesheet
 #TODO make this somewhat compliant with ^this
 proc loadResource(window: Window, link: HTMLLinkElement) =
+  if link.attr(atRel) != "stylesheet":
+    return
   if link.fetchStarted:
     return
   link.fetchStarted = true