zen-browser / desktop

🌀 Experience tranquillity while browsing the web without people tracking you!
https://zen-browser.app
Mozilla Public License 2.0
19.33k stars 467 forks source link

Zen freezes when direct descendants of a part element are set to use rtl mode. #2751

Open thatcomputerguy0101 opened 2 weeks ago

thatcomputerguy0101 commented 2 weeks ago

Captchas

What happened?

The browser freezes whenever the following styles are applied through a Zen Mod chrome.css, but not when they are applied through userChrome.css. This is relying on a beneficial bug with user agent stylesheets where descendant selectors relative to the part selector work whenever structured as nested blocks. Normally, using descendant selectors relative to a part selector is disallowed. Ideally, only the freeze is fixed, and the ability to use descendant selectors in this format is left alone.

#tabbrowser-arrowscrollbox::part(scrollbox) {
  & > * {
    direction: rtl;
  }
}

Reproducible?

Version

1.0.1-a.17

What platform are you seeing the problem on?

macOS - aarch64

Relevant log output

No response

dosubot[bot] commented 2 weeks ago

The issue you're experiencing with Zen Mod freezing when applying direction: rtl; to direct descendants of a ::part() element seems to be related to how Zen Mod handles CSS differently compared to userChrome.css. Zen Mod dynamically manages themes and integrates with user preferences, which might be causing the freeze when using certain CSS structures that are not typically allowed, like descendant selectors relative to a ::part() selector [1].

Since this issue does not occur with userChrome.css, it suggests that the dynamic nature of Zen Mod's CSS handling might be conflicting with the specific CSS rules you're applying. Unfortunately, there isn't specific information available about handling direction: rtl; or ::part() in the Zen Mod codebase, so a workaround might involve restructuring your CSS to avoid using descendant selectors in this context or testing on different platforms to see if the issue persists.

To continue talking to Dosu, mention @dosu.