Exempt a document from more restrictive font visibility rules if it has been exempted from tracking protection
Categories
(Core :: Privacy: Anti-Tracking, enhancement)
Tracking
()
People
(Reporter: tjr, Assigned: tjr)
References
(Blocks 1 open bug)
Details
(Whiteboard: [fpp:m1])
Attachments
(2 files, 3 obsolete files)
48 bytes,
text/x-phabricator-request
|
diannaS
:
approval-mozilla-beta+
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
diannaS
:
approval-mozilla-beta+
|
Details | Review |
We would like to wire up the ETP permission (the one found in the shield icon, where you can disable ETP for a given site) to the font visibility mechanics. This is to allow a restrictive font visibility to be in place by default, but then allow a user to un-break the page and opt in to a more permissive visibility. This will also apply when the RFP pref is enabled.
Assignee | ||
Comment 1•1 year ago
|
||
Assignee | ||
Comment 2•1 year ago
|
||
I tested this patch manually and it mostly works. The problem is that when I exempt a document and it reloads, it doesn't update the value. It's required for you to close the tab and then open it again. I believe we need to call nsPresContext::UpdateFontVisibility()
in the reload flow unconditionally, or call it somewhere in the RTP reload command. The latter seems particularly ugly, but I also couldn't find a good spot in the reload flow where I might insert this call...
It doesn't seem like we have any tests for font visibility, presumably because it's very difficult to test because it requires custom configuration on the machines the test run on.
Assignee | ||
Comment 3•1 year ago
|
||
Obviously this comment is incorrect, as
LOAD_FLAGS_IS_REDIRECT exists. Additionally, nothing
uses this constant, so just remove it.
Depends on D172041
Assignee | ||
Comment 4•1 year ago
|
||
Depends on D172304
Assignee | ||
Comment 5•1 year ago
|
||
Depends on D172305
Updated•1 year ago
|
Assignee | ||
Comment 6•1 year ago
•
|
||
So that doesn't work. I've attached patches that plumb everything, but they're actually not necessary to repro the problem, you can repro a variant of it with a clean tree (the second set of steps).
STR:
- Apply patches
- Install the JetBrains font
- Go to https://ritter.vg/misc/ff/font-jetbrains.html and confirm all three are using different fonts. (If they're not, you're going to need to reset prefs or reload the browser or reinstall the font or something)
- Set
layout.css.font-visibility.trackingprotection
to 1 and probably restart the browser to be safe - Confirm that in regular browser window, you see all three different fonts, and in PBM the middle font matches the bottom.
- Exempt the page from ETP, it reloads. Same behavior.
- Copy the URL, open a new tab, paste it, and you should see the middle font in JetBrains now.
That's a page reload. Here's another way to reproduce this where a page should be restyled in-place without a reload, and this happens on a clean tree:
- Do steps 2-5
- Edit the pref
layout.css.font-visibility.trackingprotection
to 3 which should cause UpdateFontVisbility() to be called and a restyle to happen. - Observe nothing changed
Assignee | ||
Updated•1 year ago
|
Comment 7•1 year ago
|
||
This is one possible option, the other one is to just cache the
substitute results.
Comment 8•1 year ago
|
||
Step 1.5: Patch https://searchfox.org/mozilla-central/rev/dbec4165e4c26a0ff970b614842b689e8357593c/gfx/thebes/gfxFcPlatformFontList.cpp#1899 to return ubuntu or fedora.
Updated•1 year ago
|
Assignee | ||
Comment 9•1 year ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #7)
Created attachment 9323007 [details]
Bug 1821131 - Make font visibility part of the fontconfig substitution cache key. r=jfkthame
Whoo! I can confirm this fixes the issue (both the ETP opt-out and pref change one). I'm not sure what the Ubuntu/Fedora comment is about though...?
Comment 10•1 year ago
|
||
(In reply to Tom Ritter [:tjr] from comment #9)
Whoo! I can confirm this fixes the issue (both the ETP opt-out and pref change one). I'm not sure what the Ubuntu/Fedora comment is about though...?
I'm just saying that your STR don't work if you're not in Ubuntu or Fedora. I'm on Arch, and I had to hack up that line of code to be able to reproduce the issue since we don't have a "standard font list".
Comment 11•1 year ago
|
||
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/13a7475298b2 Make font visibility part of the fontconfig substitution cache key. r=jfkthame
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 12•1 year ago
|
||
Pushed by tritter@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7b02c229d8cb Exempt a document from stricter font-visibility rules with the ETP toggle r=timhuang
Comment 13•1 year ago
|
||
bugherder |
Comment 14•1 year ago
|
||
bugherder |
Assignee | ||
Comment 15•1 year ago
|
||
Comment on attachment 9321955 [details]
Bug 1821131: Exempt a document from stricter font-visibility rules with the ETP toggle r?jfkthame,timhuang
Beta/Release Uplift Approval Request
- User impact if declined: We will not be able to run experiments in Release
- Is this code covered by automated tests?: No
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Both patches are quite small and unlikely to cause issues. They only affect font visibility which is not restricted right now except with RFP enabled.
- String changes made/needed:
- Is Android affected?: No
Assignee | ||
Updated•1 year ago
|
Comment 16•1 year ago
|
||
Comment on attachment 9321955 [details]
Bug 1821131: Exempt a document from stricter font-visibility rules with the ETP toggle r?jfkthame,timhuang
Approved for 112.0b6
Updated•1 year ago
|
Comment 17•1 year ago
|
||
bugherder uplift |
https://hg.mozilla.org/releases/mozilla-beta/rev/52bca4dd23d3
https://hg.mozilla.org/releases/mozilla-beta/rev/4940c251cc71
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Assignee | ||
Updated•1 year ago
|
Description
•