Closed Bug 1695381 Opened 4 years ago Closed 3 years ago

Remote GTK icon lookup for moz-icon:// URLs

Categories

(Core :: Widget: Gtk, task)

Unspecified
Linux
task

Tracking

()

RESOLVED FIXED
91 Branch
Fission Milestone M7a
Tracking Status
firefox91 --- fixed

People

(Reporter: jld, Assigned: jld)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

The one remaining use of GTK in content processes (besides WebGL) is to look up icons for moz-icon:// URLs; they can be referenced from file:// content, and are used for directory listings.

This can be reproduced by setting security.sandbox.content.headless and opening a directory; the icons will be missing or replaced by alt text. There's also a reftest of image downscaling applies to moz-icon that fails; disturbingly, nothing else in the testsuite seems to have caught this.

Web content isn't allowed to reference moz-icons directly, but FTP directory listings currently use moz-icon in a remote content process, and there may be other cases where remote content results in resource: or chrome: content using icons.

Assuming there's nothing in that last category then, in the short term for Fission, we can continue loading GTK in the dedicated file:// content process, and in content processes for FTP origins if they're still supported, but in the long term for sandboxing we'll need a general solution.

I don't yet know if other platforms will have similar issues, and if it would be better to remote moz-icon:// in a cross-platform way vs. do something GTK-specific. These images are (hopefully?) small enough that we could send them inline in IPC messages.

moz-icon is not well tested, there are a few more reftests in image/reftest/generic and there is a mochitest that is run at least on Windows that tests an edge case of moz-icon but I can't remember where it is.

Fission Milestone: --- → M7a
OS: Unspecified → Linux
Assignee: nobody → jld

(In reply to Timothy Nikkel (:tnikkel) from comment #2)

[...]

I also found
https://searchfox.org/mozilla-central/source/image/test/unit/test_moz_icon_uri.js

This one seems to be testing the moz-icon protocol itself, and I see it passing locally (albeit weirdly crashing like in bug 1186769) when trying to manually load moz-icon://.txt?size=128 fails :)

(In reply to Jed Davis [:jld] ⟨⏰|UTC-6⟩ ⟦he/him⟧ from comment #0)

This can be reproduced by setting security.sandbox.content.headless and opening a directory; the icons will be missing or replaced by alt text. There's also a reftest of image downscaling applies to moz-icon that fails; disturbingly, nothing else in the testsuite seems to have caught this.

I suspect it is this one?

Unexpected Results
------------------
image/test/reftest/generic/moz-icon-blank-1-almostref.html == image/test/reftest/generic/moz-icon-blank-1-ref.html
  FAIL image comparison, max difference: 142, number of differing pixels: 209

So those tests are failing for me (linux):

Unexpected Results
------------------
image/test/reftest/generic/moz-icon-blank-1.html == image/test/reftest/generic/moz-icon-blank-1-ref.html
  FAIL image comparison, max difference: 142, number of differing pixels: 209
image/test/reftest/generic/moz-icon-blank-1-almostref.html == image/test/reftest/generic/moz-icon-blank-1-ref.html
  FAIL image comparison, max difference: 142, number of differing pixels: 209

Worst, it's even broken on central, it seems unrelated to those changes.

Flags: needinfo?(tnikkel)

FTR, the reftests on try seems to be OK, so this could be a local-only issue?

Attachment #9228545 - Attachment description: WIP: Bug 1695381 - Refactor GTK icon processing in preparation for remoting. → Bug 1695381 - Refactor GTK icon processing in preparation for remoting. r?tnikkel
Attachment #9228546 - Attachment description: WIP: Bug 1695381 - Use IPC for content processes' moz-icon URL loading. → Bug 1695381 - Use IPC for content processes' moz-icon URL loading. r?handyman,tnikkel
Attachment #9228547 - Attachment description: WIP: Bug 1695381 - Add moz-icon testing for file:// → Bug 1695381 - Add moz-icon testing for file:// r?tnikkel

(In reply to Alexandre LISSY :gerard-majax from comment #9)

FTR, the reftests on try seems to be OK, so this could be a local-only issue?

If it works on try I'm not too surprised if it fails locally, lots of tests are finicky like that, and these ones seem especially dependant on local configuration.

Flags: needinfo?(tnikkel)
Attachment #9228546 - Attachment description: Bug 1695381 - Use IPC for content processes' moz-icon URL loading. r?handyman,tnikkel → Bug 1695381 - Use IPC for content processes' moz-icon URL loading. r?nika,tnikkel

(In reply to Alexandre LISSY :gerard-majax from comment #15)

So the current bug itself tests well with the pref to disable remoting, but this is regressed once mixed with bug 1635451

We will just remove the temp pref in bug 1635451

Pushed by alissy@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f9264e5f7187 Refactor GTK icon processing in preparation for remoting. r=tnikkel https://hg.mozilla.org/integration/autoland/rev/bfb9977f68cc Use IPC for content processes' moz-icon URL loading. r=tnikkel,nika https://hg.mozilla.org/integration/autoland/rev/3af973686928 Add moz-icon testing for file:// r=tnikkel
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 91 Branch
Regressions: 1718398
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: