Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Remove duplicate theme files

76 views
Skip to first unread message

Pardal Freudenthal

unread,
Jan 28, 2012, 2:19:25 PM1/28/12
to
I'm starting this discussion related to this bug: Bug 659407 - Remove
duplicate theme files

Since that bug is closed I think the best is to write here... I have
just a suggestion:

Some time ago, when we've begun to differentially support Windows 7
and Vista, I was quite disappointed with the solution that was
implemented. This solution resulted in the repetition of thousands of
lines of code and dozens of images.

After investigating this issue, I came to a concept that seems much
more reasonable, IMHO. I've described and discussed this solution at
MozillaZine: http://forums.mozillazine.org/viewtopic.php?f=18&t=906535

The solution is quite simple. It consists in registering a skin-only
package, which I called os_target, containing directories that host
images and different codes for the various operating systems. Through
manifest flags is possible to register these directories differently
according to the operating system. Via @import rules we can insert
everything that is different into files that contain the common code.

This approach has been used by me and several other developers for
nearly three years with great success.

I do not have exact measurements, but I believe the Winstripe could be
decreased by approximately 40%, and if we think that this method
allows us to develop a single theme for all operating systems, we can
have an idea what this mean in terms of maintenance and size of the
source.

What do you think?

Gavin Sharp

unread,
Jan 30, 2012, 2:19:14 PM1/30/12
to Pardal Freudenthal, dev-apps...@lists.mozilla.org
I think this sounds promising. Can you file a bug in Firefox::Theme so
that we can evaluate the proposal?

Dão knows this stuff better than anyone, we should get his feedback on it.

Gavin
> _______________________________________________
> dev-apps-firefox mailing list
> dev-apps...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-apps-firefox

Pardal Freudenthal

unread,
Feb 1, 2012, 1:59:09 PM2/1/12
to
On Jan 30, 8:19 pm, Gavin Sharp <ga...@gavinsharp.com> wrote:
> I think this sounds promising. Can you file a bug in Firefox::Theme so
> that we can evaluate the proposal?
>
> Dão knows this stuff better than anyone, we should get his feedback on it.
>
> Gavin

Hi Gavin, thanks for looking at this. I will file a bug on it as soon
as possible.

Pardal Freudenthal

unread,
Feb 7, 2012, 3:42:46 PM2/7/12
to
Hello Gavin,
I've just added a comment to https://bugzilla.mozilla.org/show_bug.cgi?id=706103
I hope it helps...

Pardal Freudenthal

unread,
Mar 4, 2015, 8:48:40 AM3/4/15
to
Just wanting to bump this to explain the idea behind this approach.

Imagine some file structure like this:

chrome
|_os_specific_folder
|_ aero
|_ example.png
|_ variables.css
|_ xp
|_ example.png
|_ variables.css
|_ linux
|_ example.png
|_ variables.css

All we need is to register a skin provider for mapping these files:

skin os_specific classic/1.0 chrome/os_specific_folder/xp os=WINNT osversion<6
skin os_specific classic/1.0 chrome/os_specific_folder/linux os=WINNT osversion<6
skin os_specific classic/1.0 chrome/os_specific_folder/aero os=WINNT osversion>6

And then is possible to make things like:

#someElement {
background-image: url(chrome://os_specific/skin/example.png);
}

You can imagine also what we could do with, for example, importing the variables.css file

@import url(chrome://os_specific/skin/variables.css);

#someElement {
border-color: var(--style-defined-in-variables-css);
}

In a short time we could get rid of overrides for skinning different platforms and we could, for example, reduce the windows skin in more than 40%, I suppose
0 new messages