Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in V13.5.0 with get svg, path, g tag #1274

Closed
kaderson opened this issue Feb 24, 2024 · 1 comment · Fixed by #1275
Closed

Error in V13.5.0 with get svg, path, g tag #1274

kaderson opened this issue Feb 24, 2024 · 1 comment · Fixed by #1275
Assignees
Labels
bug Something isn't working

Comments

@kaderson
Copy link

kaderson commented Feb 24, 2024

Describe the bug
There is a bug with this version v13.5.0, I can't get the value of svg, path when I do it;

The code generated :

  const window = new Window()
  const document = window.document

  document.body.innerHTML = makerSvg
  const bodyElement = document.querySelector('body')
  const svgElement = bodyElement.querySelector('svg') // return null
  const pathElement = svgElement.querySelector('path') // return null

<body>
	<svg width="3955.829" height="880" viewBox="0 0 3955.829 880" xmlns="http://www.w3.org/2000/svg" id="id_svg_model">
		<g id="svgGroup" stroke-linecap="round" fill-rule="evenodd" font-size="9pt" 
			stroke="#000" stroke-width="0.25mm" fill="none" style="stroke:#000;stroke-width:0.25mm;fill:none"
		>
			<path d="M 0 0 L 0 880 L 1272.697 880 A 80 80 0 0 0 1350.647 817.996 L 1416.442 533.006 A 120 120 0 0 1 1533.367 440 L 1977.914 440 L 2422.462 440 A 120 120 0 0 1 2539.386 533.006 
				L 2605.182 817.996 A 80 80 0 0 0 2683.131 880 L 3955.829 880 L 3955.829 0" 
				vector-effect="non-scaling-stroke">
			</path>
		</g>
	</svg>
</body>

Our expect :

  1. svgElement --> IElement
  2. pathElement --> IElement

Thank you

@kaderson kaderson added the bug Something isn't working label Feb 24, 2024
@capricorn86 capricorn86 self-assigned this Feb 25, 2024
capricorn86 added a commit that referenced this issue Feb 25, 2024
capricorn86 added a commit that referenced this issue Feb 25, 2024
…t-svg-path-g-tag

fix: [#1274] Fixes problem with query selectors not finding SVG eleme…
@capricorn86
Copy link
Owner

Thank you for reporting @kaderson! 🙂

The bug with query selectors not finding SVG elements has been fixed now:
https://github.com/capricorn86/happy-dom/releases/tag/v13.5.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants