Repository navigation
fix: obfuscation bug on Firefox - #401
Merged
Merged
Conversation
…rrounding text bidi-override is a non-isolating bidi embedding, so Firefox and Chromium can resolve its interaction with adjacent DOM content differently, which is why obfuscated links can render reversed/garbled on Firefox until a hover re-triggers layout. isolate-override keeps the override contained to the obfuscated element itself, matching the CSS Writing Modes spec's recommended replacement for this exact class of bug. Resolves #397 #397
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
On Firefox, obfuscated links rendered backwards (and unreadable) until the user hovered over them, while Safari, Chrome, Edge, and Opera displayed them correctly from the start.
The obfuscation technique reverses a link's text and applies
direction: rtl; unicode-bidi: bidi-override;so the reversed DOM text displays correctly to a human.bidi-overrideis a non-isolating CSS bidi embedding, and per the Unicode Bidi Algorithm an embedding lets the browser's bidi resolution bleed across the embedding's boundary into surrounding sibling content — different engines resolve that bleed differently, which is why Firefox showed the obfuscated text (and sometimes neighboring content) reversed until a hover-triggered re-render corrected it.The fix switches
unicode-bidifrombidi-overridetoisolate-override, which keeps the override behavior inside the element but isolates it from surrounding content, preventing the bleed. It's supported in Firefox since version 50 (2016), so there's no compatibility cost.Types of changes
Checklist:
Testing
npm run lint— passednpx jest --coverage— 21/21 tests passed, 100% coverage maintainedRelated Issue
Fixes #397