Closed Bug 1763667 Opened 2 years ago Closed 2 years ago

Consider merging image & video document CSS from toolkit/themes/shared/media into their stylesheets in layout/style

Categories

(Toolkit :: Themes, task)

task

Tracking

()

RESOLVED FIXED
101 Branch
Tracking Status
firefox101 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

Attachments

(2 files)

Emilio noticed in https://phabricator.services.mozilla.com/D143099#4678171 that we have this file:
https://searchfox.org/mozilla-central/rev/3269d4c928ef0d8310c2f57634e9b6057aa636e9/toolkit/themes/shared/media/TopLevelVideoDocument.css
...which only has a single CSS rule (to set a black background on top-level video documents).

I'm not sure if there's a reason that this file exists as a distinct thing from the identically-named stylesheet in layout/style at this point -- that other longer stylesheet is:
https://searchfox.org/mozilla-central/rev/3269d4c928ef0d8310c2f57634e9b6057aa636e9/layout/style/TopLevelVideoDocument.css

Perhaps they can be merged together?

Dao or jaws, perhaps you know why these files exist as distinct things, & whether there's any reason we should keep them that way?

The same question/situation applies to this similar pair of image-doc stylesheets -- I'm not sure if there's a reason they are distinct?
https://searchfox.org/mozilla-central/rev/3269d4c928ef0d8310c2f57634e9b6057aa636e9/layout/style/TopLevelImageDocument.css
https://searchfox.org/mozilla-central/rev/3269d4c928ef0d8310c2f57634e9b6057aa636e9/toolkit/themes/shared/media/TopLevelImageDocument.css

It sort of looks like the versions in layout/style are focused on layout-and-functionality-related CSS, vs. the version in themes/shared/media exists for more presentation & potentially-theme-related CSS.

This separation makes some sense, but I'm not how much it's useful vs. historical at this point; and it feels a little silly for the video one which only has a single rule to set a plain black background.

Maybe at some point in the past, the theme-related styles needed to be separated so that the /shared/ one could be overridden on a per-platform basis -- but (if so) it looks like we don't actually do that anymore. I do see in e.g. https://hg.mozilla.org/mozilla-central/rev/b965a94cd13e / Bug 1291268, we removed some platform-specific additional versions of these /themes stylesheets. So I wonder if this separation was for the benefit of that no-longer-present platform-specific theming, and hence isn't useful anymore?

See Also: → 1763495

(jaws, I suspect you can add some clarity here on whether this separation still makes sense & is useful going forward. If it is useful, that's fine & we can close this bug out as INVALID/WONTFIX. But if there's not a strong reason to keep the two distinct-but-identically-named stylesheets as separate files, then perhaps we could simplify things a bit by merging them.)

Flags: needinfo?(jaws)

I'm okay with merging them. At the time of creation we had at least one more rule, but also that was Firefox 25 and I think XUL addons still existed then to allow for overriding themes. As this is no longer the case, we should move towards a simpler setup. Thanks for the ping.

Flags: needinfo?(jaws)

For both files, we've been keeping around an extra copy in
toolkit/themes/shared/media/ with 1-2 CSS rules related to presentation.

This was probably to allow XUL-style extensions and themes to override the
presentation, back when we supported that form of extension. But there's not a
good reason to have this separation anymore, so let's simplify and combine the
files of the same name.

This patch also removes one no-longer-esepcially-useful "N.B." comment (which
refers to a file that's now alongside the styles in question). This patch also
adds an explanatory comment to explain why we bother to set color for images
(which was initially not clear to me).

Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #9271761 - Attachment description: Bug 1763667: Merge our two copies of TopLevelImageDocument.css and TopLevelVideoDocument.css. r?emilio!,jaws! → Bug 1763667 part 1: Merge our two copies of TopLevelImageDocument.css and TopLevelVideoDocument.css. r?emilio!,jaws!

This patch shouldn't change behavior. It just gets us a bit more consistency
between these two stylesheets, and it makes these rules more explicit about the
fact that they're intending to style the root.

Depends on D143395

Pushed by dholbert@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8c4c4292e412
part 1: Merge our two copies of TopLevelImageDocument.css and TopLevelVideoDocument.css. r=emilio,jaws
Pushed by dholbert@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5e395c42667c
part 2: Use :root instead of html/body, on selectors in TopLevelImageDocument.css and TopLevelVideoDocument.css. r=emilio,jaws
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch
Type: defect → task
Component: Theme → Themes
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: