@@ -387,6 +387,23 @@ main = TUM.runTest do
387387 text <- textContent " #mount-point"
388388 TUA .equal " oi" text
389389
390+ TU .test " nested svg elements have correct namespace" do
391+ let html = HE .svg
392+ [ HA .viewBox " 0 0 100 100"
393+ , HA .createAttribute " xmlns" " http://www.w3.org/2000/svg"
394+ ]
395+ [ HE .g [ HA .fill " white" , HA .stroke " green" , HA .strokeWidth " 5" ]
396+ [ HE .circle' [ HA .cx " 40" , HA .cy " 40" , HA .r " 25" ], HE .circle' [ HA .cx " 60" , HA .cy " 60" , HA .r " 25" ] ]
397+ ]
398+ void $ mountHtml html
399+ let verifyNodeAndChildren node = do
400+ TUA .equal (Just " http://www.w3.org/2000/svg" ) (WDE .namespaceURI node)
401+ children <- liftEffect $ childrenNode' node
402+ DT .for_ children verifyNodeAndChildren
403+ svg <- liftEffect $ unsafeQuerySelector " svg"
404+ verifyNodeAndChildren svg
405+
406+
390407 TU .suite " dom node update" do
391408 TU .test " update text nodes" do
392409 let html = HE .text " oi"
@@ -986,6 +1003,10 @@ main = TUM.runTest do
9861003 children <- WDP .children $ WDE .toParentNode mountPoint
9871004 WDHC .toArray children
9881005
1006+ childrenNode' parent = do
1007+ children <- WDP .children $ WDE .toParentNode parent
1008+ WDHC .toArray children
1009+
9891010 textContent selector = liftEffect do
9901011 element <- unsafeQuerySelector selector
9911012 WDN .textContent $ WDE .toNode element
0 commit comments