Skip to content

Fix activeElement #758

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

Closed
wants to merge 3 commits into from
Closed

Fix activeElement #758

wants to merge 3 commits into from

Conversation

karlseguin
Copy link
Collaborator

#742 was only correct in isolation.

The problem is that both html/document and dom/document are now attempting to attach state to the same *parser.Node. This is a problem because they're two different types of state. If an HTMLDocument is attached to the node, and you then try to access that as a DOMDocument, it'll crash.

I moved the dom/document state (active_element) into the html/document.

The other option is to introduce something like src/browser/state/document.zig and have both HTMLDocument and DOMDocument share/load that.

#742 was only correct in isolation.

The problem is that both html/document and dom/document are now attempting to
attach state to the same *parser.Node. This is a problem because they're two
different types of state. If an HTMLDocument is attached to the node, and you
then try to access that as a DOMDocument, it'll crash.

I moved the dom/document state (active_element) into the html/document.

The other option is to introduce something like src/browser/state/document.zig
and have both HTMLDocument and DOMDocument share/load that.
@karlseguin
Copy link
Collaborator Author

This issue impacts multiple cases. I'm going to try to "fix" them all.

@karlseguin karlseguin closed this Jun 4, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jun 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants