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

How to remove #ifdef XP_MACOSX in xul files?

58 views
Skip to first unread message

Yonggang Luo

unread,
Feb 1, 2016, 1:23:58 AM2/1/16
to
How to remove #ifdef XP_MACOSX in xul files?

Martin Thomson

unread,
Feb 1, 2016, 1:55:14 AM2/1/16
to Yonggang Luo, dev-platform
sed -i~ -e '/#ifdef XP_MACOSX/d' xul files

I think that we need more information on what it is that you intend to
do if we are to make a sensible suggestion.

On Mon, Feb 1, 2016 at 5:23 PM, Yonggang Luo <luoyo...@gmail.com> wrote:
> How to remove #ifdef XP_MACOSX in xul files?
> _______________________________________________
> dev-platform mailing list
> dev-pl...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform

罗勇刚(Yonggang Luo)

unread,
Feb 1, 2016, 5:09:56 AM2/1/16
to Martin Thomson, dev-platform
I means there is any instruction in XUL
to remove the #ifdef XP_MACOSX
but still preserve the semantics.

On Mon, Feb 1, 2016 at 2:55 PM, Martin Thomson <m...@mozilla.com> wrote:

> sed -i~ -e '/#ifdef XP_MACOSX/d' xul files
>
> I think that we need more information on what it is that you intend to
> do if we are to make a sensible suggestion.
>
> On Mon, Feb 1, 2016 at 5:23 PM, Yonggang Luo <luoyo...@gmail.com>
> wrote:
> > How to remove #ifdef XP_MACOSX in xul files?
> > _______________________________________________
> > dev-platform mailing list
> > dev-pl...@lists.mozilla.org
> > https://lists.mozilla.org/listinfo/dev-platform
>



--
此致

罗勇刚
Yours
sincerely,
Yonggang Luo

Philipp Kewisch

unread,
Feb 1, 2016, 5:17:07 AM2/1/16
to
You can use runtime checks for the OS, e.g. using Services.appinfo

Philipp

Philip Chee

unread,
Feb 2, 2016, 7:35:09 AM2/2/16
to
On 01/02/2016 14:23, Yonggang Luo wrote:
> How to remove #ifdef XP_MACOSX in xul files?

1. Move the OSX/WIN/NIX specific markup to separate XUL overlays.
2a. Ship different overlays depending on OS target.
2b. Use a chrome.manifest file with overlay directives and os specific
flags.

SeaMonkey does 2a. We ship different platformCommunicatorOverlay.xul
files for each of the three tier 1 platforms.

Phil

--
Philip Chee <phi...@aleytys.pc.my>, <phili...@gmail.com>
http://flashblock.mozdev.org/ http://xsidebar.mozdev.org
Guard us from the she-wolf and the wolf, and guard us from the thief,
oh Night, and so be good for us to pass.

Philip Chee

unread,
Feb 2, 2016, 7:36:45 AM2/2/16
to
On 01/02/2016 18:17, Philipp Kewisch wrote:
> You can use runtime checks for the OS, e.g. using Services.appinfo
>
> Philipp

Dude, he's talking about XUL, not JS. Please stop giving useless advice.

Gijs Kruitbosch

unread,
Feb 2, 2016, 8:08:52 AM2/2/16
to Philip Chee
On 02/02/2016 12:36, Philip Chee wrote:
> On 01/02/2016 18:17, Philipp Kewisch wrote:
>> You can use runtime checks for the OS, e.g. using Services.appinfo
>>
>> Philipp
>
> Dude, he's talking about XUL, not JS. Please stop giving useless advice.

It's perfectly possible to runtime-change the DOM tree as needed from
JS, either using DOM methods or using overlays and loadOverlay().

Firefox now uses AppConstants.jsm (e.g. `if (AppConstants.platform ==
"macosx")` in many places to do things we used to do with ifdefs. That
sometimes includes migrating the ifdefs out of the XUL and making
behavioural changes at runtime instead.

Please be respectful of other people's efforts to answer questions -
especially when the question is very tersely formulated and it is not
entirely clear what the scope of the question or possible solutions is.

~ Gijs

罗勇刚(Yonggang Luo)

unread,
Feb 3, 2016, 4:03:51 AM2/3/16
to Gijs Kruitbosch, Mozilla Platform
On Tue, Feb 2, 2016 at 9:08 PM, Gijs Kruitbosch <gijskru...@gmail.com>
wrote:
Thanks you all, I know how to deal with the problem with Javascript or
overlay, but that's not I wanted, overlay doesn't support in Newest
extensions, and javascript
means I have to carefully writing down code for different platform and
would be redundant.

In deed, I ask this question because the whole mozilla source tree still
need to preprocess XUL/html files for different OS/Target, and that's
stopping us to wipe out the preprocess building system for those files.

If we have simple runtime directive to direct which part of XUL files
should be exclude out , Like IE(<!- if IE ) does, that's would
be a good way to move the current if def instruction out. But seems there
is no way to do that.




>


>
> ~ Gijs

Ehsan Akhgari

unread,
Feb 3, 2016, 10:27:23 AM2/3/16
to luoyo...@gmail.com, Gijs Kruitbosch, Mozilla Platform
On 2016-02-03 4:03 AM, 罗勇刚(Yonggang Luo) wrote:
> If we have simple runtime directive to direct which part of XUL files
> should be exclude out , Like IE(<!- if IE ) does, that's would
> be a good way to move the current if def instruction out. But seems there
> is no way to do that.

There is no such thing, but you should be able to dynamically collapse
the elements that you don't want in JS.
0 new messages