Skip to content

fix: check for visibility changes for damage#343

Merged
nicoburns merged 1 commit intoDioxusLabs:mainfrom
kokoISnoTarget:fix/broken-visibility
Feb 6, 2026
Merged

fix: check for visibility changes for damage#343
nicoburns merged 1 commit intoDioxusLabs:mainfrom
kokoISnoTarget:fix/broken-visibility

Conversation

@kokoISnoTarget
Copy link
Contributor

This fixes #335, by adding restyle damage on visibility changes.

@nicoburns
Copy link
Collaborator

Hmm... I feel like visibility should generate "paint" damage rather than "layout" damage (but if this fixes this issue then I'd be inclined to accept the PR anyway for the time being).

@kokoISnoTarget
Copy link
Contributor Author

Let me quickly check if paint damage would do the trick.

@kokoISnoTarget
Copy link
Contributor Author

It seems like it at least needs CONSTRUCT_BOX as RestyleDamage for this to work.

@nicoburns
Copy link
Collaborator

I'll just merge this for now. Relayouting when visibility changes is probably fine most of the time. And it's better to be a little slow than incorrect. We can figure out why it's not working without and tighten up the damage later.

@nicoburns nicoburns merged commit e8cb3f7 into DioxusLabs:main Feb 6, 2026
14 checks passed
@nicoburns
Copy link
Collaborator

Paint damage should be set automatically by Stylo. Looks like visibility doesn't have damage set (but that means it should default to "full damage" (rebuild_box)) https://github.com/servo/stylo/blob/main/style/properties/longhands/inherited_box.mako.rs#L8

@nicoburns
Copy link
Collaborator

Hmm... this still isn't quite right. Without incremental mode the box animates in and out, and the text is a clear bright white. With incremental mode + this PR there's no animation and the text is very faint.

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

Successfully merging this pull request may close these issues.

Elements that show on :hover don't always show when incremental layout is enabled

2 participants