[Webkit-unassigned] [Bug 277440] XMLSerializer.serializeToString() not serializing child(s) of <img> and also not closing the <img> if it has child(s)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Aug 4 08:58:27 PDT 2024


https://bugs.webkit.org/show_bug.cgi?id=277440

--- Comment #2 from Deepak Aravind <codesculptures at gmail.com> ---
The shouldSelfClose and elementCannotHaveEndTag were contradicting each other where i believe both return opposite values but as per current implementation  producing same result

const myImg = document.createElement("img")
const childDiv = document.createElement("div")
img.appendChild(childDiv)


Consider current, targetNode = myImg
>From the above case, 
shouldSelfClose returns false as it has child(s)
elementCannotHaveEndTag returns also false as it would always return false for void-elements



We have to make a decision clearly here,
1.Allow children in void elements (as per spec, it is incorrect, but chrome doing this)

2.shouldSelfClose would give priority for whether it is a void element immediately return true over hasChildNodes

3.Don't allow (or Ignore) appending node on void elements

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240804/e5cbe9ed/attachment.htm>


More information about the webkit-unassigned mailing list