Skip to content

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
@karlseguin karlseguin deleted the fix_active_element branch June 13, 2025 01:41
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.

3 participants