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

Frameset not added to DOM in some malformed HTML #115

Open
duonglaiquang opened this issue May 15, 2024 · 1 comment
Open

Frameset not added to DOM in some malformed HTML #115

duonglaiquang opened this issue May 15, 2024 · 1 comment

Comments

@duonglaiquang
Copy link
Contributor

duonglaiquang commented May 15, 2024

Note: This issue is a migration (for our convenience) of this issue on sourceforge which can now be closed.

Problem in brief

<frameset> is lost and not added to the DOM in some malformed HTML when it should be.

Examples

These examples demonstate the issue with input HTMLs and their corresponding expected DOM and what HtmlUnit produces.

# Input HTML Expected DOM HtmlUnit's DOM
1
<html>
<div></div>
<frameset>
  <frame src="about:blank"/>
  <frame src="about:blank"/>
</frameset>
</form>
</html>
<html>
<head></head>
<frameset>
  <frame src="about:blank"/>
  <frame src="about:blank"/>
</frameset>
</html>
<html>
<head></head>
<body>
  <div></div>
</body>
</html>
2
<html>
<div>
  <frameset>
    <frame src="about:blank"/>
    <frame src="about:blank"/>
  </frameset>
</div>
</html>
Same as above. Same as above.
3
<html>
<form>
  <frameset>
    <frame src="about:blank"/>
    <frame src="about:blank"/>
  </frameset>
</form>
</html>
Same as above.
<html>
<head></head>
<body>
  <form></form>
</body>
</html>

Note: These already exist as test cases in org.htmlunit.html.parser.MalformedHtmlTest as siblingWithoutContentBeforeFrameset(), framesetInsideForm(), as well as others not covered above.

Remarks

@rbri
Copy link
Member

rbri commented May 15, 2024

@duonglaiquang @atnak i have an idea how to solve this. The problem here is that we have some operations requiring major changes in the dom tree that was already constructed. This is not a problem if you have a dom tree. But neko also supports the sax interface - there is no chance to do that.

Let me think a bit.

And sorry for not being that fast with all your stuff, i have some important private things to take care of.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants