Compare commits

..
897 Commits
Author SHA1 Message Date
Moonchild 71ae69aea8 [WebGL] Implement webgl.max-size-per-texture-mib 2022-10-26 14:50:05 +00:00
Moonchild 9e34d697c7 [XPCOM] Fix Base64 off-by-one issue and safeguard against this mistake in the future. 2022-10-26 14:49:55 +00:00
Moonchild 8fa9125d02 [No issue] Hold some strong references on nsRefreshDriver 2022-10-26 14:49:46 +00:00
Brian Smith 4b4488c3e4 Issue #2022 - Part 2 - Add Ventura version detection.
Also add Monterey and Ventura to the graphics driver blocklist.
2022-10-26 14:49:33 +00:00
Brian Smith 248db7d301 Issue #2022 - Part 1 - Fix transparent windows on MacOS 13 Ventura.
During the BaseWindow creation contenView is nil on Ventura...
So create a NSView with the requested dimensions and set is as the contenView.
2022-10-26 14:49:23 +00:00
Moonchild e199f2949b [No issue] Ensure LockImpl::Try() returns the correct bool value. 2022-10-26 14:45:39 +00:00
Moonchild 456b5450a4 Issue #2010 - Ensure raw tagnames are safe exiting internalEntityParser
This resolves #2010
2022-09-28 13:50:10 +00:00
Moonchild d8e629c4a3 Merge branch 'master' into release 2022-09-27 20:12:40 +00:00
Moonchild 95907ddf88 Revert "Issue #1986 - Use logical coordinates in flex containers."
This reverts commit 2a57b39dbc.
2022-09-27 20:04:13 +00:00
Moonchild 5f8d70dacd Revert "Issue #1986 - Part 2: Add IsItemInlineAxisMainAxis() and rework some nsFrame code."
This reverts commit ef4eb3f926.
2022-09-27 20:04:02 +00:00
Moonchild 4bf2bf74b1 Revert "Issue #1986 - Add in reftests for new behavior."
This reverts commit 2fc5e3ad7d.
2022-09-27 20:03:42 +00:00
Moonchild 4898c4f297 Merge branch 'master' into release 2022-09-24 12:16:59 +00:00
Moonchild b575f4a516 Platform version bump 2022-09-24 12:16:43 +00:00
Moonchild 7cd578bbc6 Merge branch 'master' into release 2022-09-22 13:16:48 +00:00
Moonchild 47a7de8aa4 Issue #1977 - Follow-up: Correct pref check to be selective on wave formats only. 2022-09-22 13:14:17 +00:00
Moonchild 1e91df628a Merge branch 'master' into release 2022-09-22 11:52:16 +00:00
Moonchild 1a5e2e32e1 Merge pull request 'Un-prefix -moz-[min|max}-content keyword' (#2009) from 1992 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2009
2022-09-22 11:47:37 +00:00
Moonchild d06666cd12 [network] Reject cookies with no name and a __Secure- or __Host- prefix 2022-09-21 21:11:53 +00:00
Moonchild 24ee0680b1 [DOM security] Be more explicit about CSP checks and reports. 2022-09-21 14:08:22 +00:00
Moonchild 66a4e02856 Issue #1992 - Part 2: Regenerate devtools CSS database.
Using `mach devtools-css-db`
Note: this also picked up a break-spaces entry that was missed previously.
2022-09-20 20:44:57 +00:00
Moonchild 9fea63c9d4 Issue #1992 - Part 1: Un-prefix -moz-{min|max}-content keywords. 2022-09-20 20:41:33 +00:00
Moonchild fc5b767f5d Issue #2008 - Implement missing s parameter parsing and align case with spec.
This does 2 things.
First, it adds parsing of the 's' parameter parsing to DOM object construction of regexes
Second, it corrects the DOM property to be `dotAll` instead of `dotall`

For consistency's sake, all function names and calls were renamed with the finalized casing.

This resolves #2008
2022-09-18 11:01:27 +00:00
Moonchild 302d46a0f9 Merge pull request 'Media fixes to play nice with MSVC WPO/GL' (#2006) from twivi/UXP:optimize into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2006
Reviewed-by: Moonchild <moonchild@palemoon.org>
2022-09-14 09:42:09 +00:00
twivi d2683b0ff7 revert 82ac99acb5
revert Allow explicit inlines in libaom code, but still prevent automatic inlines due to compiler issues
2022-09-14 02:33:01 +00:00
twivi 92d5680b85 Updated libav/ffvpx patch files to help with upstream library 2022-09-13 14:33:32 +00:00
Moonchild f9a1ebf886 No issue - Stop pre-processing some files that don't have preprocessor statements in them. 2022-09-12 08:05:25 +00:00
twivi a68021d41e Fix ffvpx/libav architecture checks to use preprocessor instead, prevents breakage with LTCG 2022-09-11 21:51:08 +00:00
twivi 82ac99acb5 Allow explicit inlines in libaom code, but still prevent automatic inlines due to compiler issues 2022-09-11 21:49:56 +00:00
Moonchild c623c47157 Merge pull request 'Update IPC locking code.' (#2004) from athenian200/UXP:ipc-locking-update into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2004
2022-09-09 08:10:36 +00:00
Moonchild da835adb48 Merge pull request 'Fix build bustage with spell checker in GCC 12' (#2002) from jobbautista9/UXP:spellcheck-gcc12 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2002
2022-09-08 17:38:29 +00:00
Moonchild a9c9be4d21 Issue #80 - Re-unify most of gfx 2022-09-08 16:54:07 +00:00
Moonchild 0682d4ac0e No Issue - prevent build issue in MSVC due to libaom SIMD inlining. 2022-09-08 16:52:26 +00:00
Jeremy Andrews 77bca114d1 Issue #2003 - Update IPC locking code. 2022-09-08 08:10:11 -05:00
Job Bautista 59f6ae3d74 Issue #1995 - Fix build bustage in GCC 12
For some reason, GCC 12 is treating this include as a circular dependency.
See athenian200's analysis for more details.
2022-09-08 17:57:06 +08:00
Moonchild 1fba5c3cc7 Issue #80 - Re-unify most of the layout engine 2022-09-08 06:49:40 +00:00
Moonchild 3d99e06afe Issue #80 - Re-unify most of DOM 2022-09-08 06:49:09 +00:00
Moonchild ed2a457b0a Merge branch 're-unify' 2022-09-06 23:42:27 +00:00
Moonchild c927a660ea Issue #1720 - Follow-up: Explicitly include X11UndefineNone.h in
HTMLOptGroupElement.cpp to fix unified building on X11
2022-09-05 14:00:07 +00:00
Moonchild cf8bc4541d Issue #80 - Re-unify building of /js/src 2022-09-05 13:50:53 +00:00
Moonchild f4e39fc6f4 Revert "Issue #1676 - Part 4: Split builtin sources out of js/src/moz.build" 2022-09-05 13:28:53 +00:00
Moonchild d10904010a Revert "Issue #1676 - Part 5: Split devtools sources out of js/src/moz.build"
This reverts commit 24b835f0a9.
2022-09-05 13:25:24 +00:00
Moonchild 22886d3547 Revert "Issue #1676 - Part 6: Split ds sources out of js/src/moz.build"
This reverts commit eedfa63a1d.
2022-09-05 13:24:56 +00:00
Moonchild de87d59cfc Revert "Issue #1676 - Part 7: Split frontend sources out of js/src/moz.build"
This reverts commit 1396383aee.
2022-09-05 13:24:28 +00:00
Moonchild e67b9b52e3 Revert "Issue #1676 - Part 8: Fix up include for selfhosted.out.h"
This reverts commit bc450dab41.
2022-09-05 13:23:59 +00:00
Moonchild 821cba01be Revert "Issue #1676 - Part 9: Move DIRS down in js/src/moz.build" 2022-09-05 13:23:16 +00:00
Moonchild 8d79be38cc Revert "Issue #1676 - Part 10: Split gc sources out of js/src/moz.build"
This reverts commit 65eac50e2d.
2022-09-05 13:16:15 +00:00
Moonchild 55c83585d0 Revert "Issue #1676 - Part 11: Split irregexp sources out of js/src/moz.build"
This reverts commit 3d9bf5d7a3.
2022-09-05 13:15:38 +00:00
Moonchild 0ac1b38920 Revert "Issue #1676 - Part 12: Split jit sources out of js/src/moz.build"
This reverts commit 95e057e737.
2022-09-05 13:15:10 +00:00
Moonchild 2d5b40a675 Revert "Issue #1676 - Part 13: Split perf sources out of js/src/moz.build"
This reverts commit 383bc182e3.
2022-09-05 13:14:42 +00:00
Moonchild cbfbaf026f Revert "Issue #1676 - Part 14: Split proxy sources out of js/src/moz.build"
This reverts commit 6f76f1cb36.
2022-09-05 13:14:16 +00:00
Moonchild e17072f3ef Revert "Issue #1676 - Part 15: Split threading sources out of js/src/moz.build"
This reverts commit 2f50f543a2.
2022-09-05 13:13:49 +00:00
Moonchild b2ac2b28e0 Revert "Issue #1676 - Part 16: Split WASM sources out of js/src/moz.build"
This reverts commit 1abc696f87.
2022-09-05 13:13:23 +00:00
Moonchild 30a467bf67 Revert "Issue #1676 - Part 17: Put remaining source files which have debug code ifdef'd behind MOZ_DEBUG"
This reverts commit ff355fe9ac.
2022-09-05 13:12:57 +00:00
Moonchild e1f7b842fe Revert "Issue #1676 - Part 18: Move and separate top level sources from vm sources in js/src/moz.build"
This reverts commit 59511eb8dd.
2022-09-05 13:12:30 +00:00
Moonchild 42c4708b34 Revert "Issue #1676 - Part 19: Split ctypes sources out of js/src/moz.build"
This reverts commit cdf46e803b.
2022-09-05 13:12:02 +00:00
Moonchild 7e80662a24 Revert "Issue #1676 - Part 20: Split vtune sources out of js/src/moz.build"
This reverts commit fd1b2dc2b1.
2022-09-05 13:11:33 +00:00
Moonchild 982b7bf2a1 Revert "Issue #1676 - Follow-up: Put js/src (including vm), jit, and wasm back into unified sources."
This reverts commit a8a397fbce.
2022-09-05 13:10:47 +00:00
Moonchild b1b57cefa3 Merge pull request 'Stop using deprecated ext/hash_map and FreeBSD/clang fixes.' (#2001) from dbsoft/UXP:freebsdfix into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2001
2022-09-05 11:13:36 +00:00
Brian Smith 6619e475ab No issue - Fix OutputVariable visibility issue, when building with clang. 2022-09-05 04:47:15 -05:00
Brian Smith f369fbd6f7 Issue #2000 - Stop using deprecated ext/hash_map.
This has been long deprecated in favor of std::unsorted_map. Since all platforms
are using modern compilers now it should not be a problem to switch over to
std::unsorted_map in the single place hash_map is used. This allows us to build
on platforms which have removed hash_map such as FreeBSD.
2022-09-04 23:05:10 -05:00
Brian Smith 2db2e0fe58 No issue - Fix FreeBSD NSS build by adding FreeBSD to the list. 2022-09-04 16:57:20 -05:00
Moonchild 92452d7614 Issue #80 - reinstated unified building for some large chunks of our code.
This should reduce compile complexity saving time and reducing linker stress.
2022-09-04 11:50:24 +00:00
Moonchild 74124f150b Issue #1999 - Switch to the unorm2 API for String.normalize()
Resolves #1999
2022-09-02 19:29:43 +00:00
Moonchild 4078c2dd1e Merge pull request 'Support EventSource in workers' (#1997) from dbsoft/UXP:1990fix2 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1997
2022-09-01 20:56:43 +00:00
Moonchild 6638cc1e6d [No issue] Don't use gfxXlibSurface in GLContextGLX. 2022-08-31 11:46:12 +00:00
Moonchild ea31efd98e Merge pull request 'Fix a couple miscellaneous Mac specific issues.' (#1998) from dbsoft/UXP:macfixes into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1998
2022-08-30 07:55:06 +00:00
Brian Smith 5f1ef110ff No Issue - Fix building with WebRTC enabled on non-Intel Macs.
int3 is Intel only, so don't use it on ARM, use __builtin_trap() instead.
2022-08-29 18:30:39 -05:00
Brian Smith 6d127920f8 No Issue - Fix building on MacOS Big Sur.
The python binary copied reports a valid signature on Big Sur and thus codesign fails.
Add the -f option so it overwrites the supposedly valid signature. Other versions are
either already unsigned or the install_name_tool invalidates the signature.
2022-08-29 18:22:25 -05:00
Moonchild b1d148fd52 Issue #1996 - Implement at() method on built-in indexables.
Resolves #1996
2022-08-29 21:52:04 +00:00
Moonchild 51204afc90 Issue #1956 - Fix C++ code standard conformance issue in webaudio 2022-08-29 01:01:43 +00:00
Moonchild 6d0df6d506 Issue #1956 - Fix C++ code standard conformance issue in StoreBuffer.h 2022-08-28 15:04:19 +00:00
Brian Smith 860800629b Issue #1990 - Part 6 - Fix for infinite loop from Release() on shutdown worker.
If the worker is shut down, call Cancel() on the Runnable, this will prevent
nsInputStreamReadyEvents to be called again when deallocated.
2022-08-26 14:21:47 -05:00
Moonchild ce11609fe9 Merge pull request 'Support TURN TLS in WebRTC' (#1993) from Basilisk-Dev/UXP:master into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1993
2022-08-26 16:10:54 +00:00
Brian Smith d6f18548a6 Issue #1990 - Part 5 - Common up the skippability implementations that are basically copy/pastes of the DOMEventTargetHelper one.
Mozilla Bug Bug 1333540. Skipped the renamed of various functions, but otherwise a direct port.
2022-08-25 21:59:08 -05:00
Moonchild 29c1150eef Issue #1975 - Follow-up: Enable Origin header on same-origin by default.
I've used this setting without ill effects for weeks, including visiting
many a cloudflare-backed site. There is no issue there.
2022-08-24 02:48:44 +02:00
Moonchild db1c5741cd Merge branch 'master' of https://repo.palemoon.org/MoonchildProductions/UXP 2022-08-24 00:51:48 +02:00
Moonchild 0488d0b40b Issue #1994 - Align CSS.supports with the current spec.
The current spec makes "implicit" parentheses a thing for feeding
css strings to CSS.supports()
The current spec also implies CSS is a namespace, not an interface
2022-08-24 00:50:36 +02:00
Brian Smith bbc3e455b0 Issue #1990 - Part 4 - Add a number of Mozilla patches from between Part 1 and 2.
1334081 - prevent null pointer dereference in StreamReaderFunc.
1330631 - Convert the EventSourceImpl::Message to be UniquePtr.
1337619 - Reset mGoingToDispatchAllMessages flag before early return.
2022-08-22 13:23:34 -05:00
Basilisk-Dev aacd52f00f Issue #1991 - backport Mozilla bug 1266667 2022-08-20 22:08:28 -04:00
Basilisk-Dev 0dad0315dd Issue #1991 - Remove console log stating TURNS is not supported
Port of Mozilla bug 1383575
2022-08-20 14:23:06 -04:00
Basilisk-Dev d49569ca0d Issue #1991 - Support TURN TLS Support in WebRTC
Backport of Mozilla bug 1056934
2022-08-20 14:21:43 -04:00
Moonchild d262539fb9 Merge pull request 'Use logical coordinates in flex containers.' (#1987) from athenian200/UXP:flex-container-changes into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1987
2022-08-20 11:59:03 +00:00
Brian Smith 3596656ea4 Issue #1990 - Part 3 - Fix build issue due to missing nsIThreadRetargetableStreamListener definition. 2022-08-18 17:57:47 -05:00
Brian Smith 10dbd42596 Issue #1990 - Part 2 - Fix crash when incorrectly access EventSourceImpl::mEventSource. - Mozilla Bug 1333099 2022-08-18 16:35:40 -05:00
Brian Smith b52731f9e0 Issue #1990 - Part 1 - EventSource for workers - Mozilla Bug 1267903 2022-08-18 16:30:38 -05:00
Jeremy Andrews 2fc5e3ad7d Issue #1986 - Add in reftests for new behavior.
Almost forgot to do this. This is in case we need to revisit this for
regressions in the future and the tests are not available online. Never know
when they might come in handy again.
2022-08-18 13:27:43 -05:00
Jeremy Andrews 544366e301 Issue #1988 - Use libc's arc4random where available.
Configure was defining HAVE_ARC4RANDOM_BUF on systems that have it this whole
time, so the OS specific ifdefs weren't necessary. Maybe the flag that was in
the original patch was an obsolete name for that flag...
2022-08-17 20:43:57 -05:00
Jeremy Andrews ef4eb3f926 Issue #1986 - Part 2: Add IsItemInlineAxisMainAxis() and rework some nsFrame code.
It turns out part 10 was actually needed, but Bug 1449838 had a significantly
better version of what that code does that was easy enough to backport to what
we have. As far as I can tell, this passes the relevant reftests now.
2022-08-16 16:11:48 -05:00
Jeremy Andrews 2a57b39dbc Issue #1986 - Use logical coordinates in flex containers.
This mostly reworks the way nsFlexContainerFrame handles things so that it can
deal with more than just height.
2022-08-16 02:14:53 -05:00
Jeremy Andrews 50bd3acb5b Issue #1970 - Follow-up: Better fix for Unix that works on newer GCC.
My previous fix apparently only worked with GCC 7. Having that return at the
end doesn't seem to hurt anything on Windows, so I see no reason to ifdef it.

I don't remember where I heard this, but I vaguely remember hearing that
ending a function without a return statement may be undefined behavior that
differs between compilers and operating systems. If so, that would explain why
this has behaved so differently across platforms and compilers.
2022-08-13 11:44:09 -05:00
Jeremy Andrews 8fa66368a0 Issue #1970 - Follow-up: Fix GTK3 build for SunOS and CentOS.
This seems to work for me, but I haven't tested anything else yet. Still, seems better to have a fix in the tree than to leave it as-is.
2022-08-13 06:47:27 -05:00
Moonchild d3f82662f5 No issue - Remove directive 4
This was a control issue way back when. Since this only really relates to
deviating build configs anymore and no longer to critical system libs of note,
there's no point in retaining this overbearing control through build errors.
People have clear instructions how to build - it is their responsibility to
stick to those.
2022-08-11 19:33:34 +00:00
Jeremy Andrews 7a2f786e0c Issue #1956 - Account for multiple DLL files in newer CRT.
The wildcard seems to work well here for getting files included in the
final target.
2022-08-03 08:53:40 -05:00
Moonchild a5696dc110 Merge pull request 'Issue #1982 - Fix libopus webrtc build breakage' (#1983) from Basilisk-Dev/UXP:master into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1983
2022-07-30 20:20:17 +00:00
Basilisk-Dev eab116cde1 Issue #1982 - Fix libopus webrtc build breakage 2022-07-30 15:36:03 -04:00
Moonchild a46ea601f7 Merge pull request 'Fix build bustage for applications where WebRTC building is enabled.' (#1981) from jobbautista9/UXP:1980-rtcfix into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1981
2022-07-30 07:21:46 +00:00
Job Bautista fad8235ad2 Issue #1980 - Fix build bustage for applications where WebRTC building is enabled.
Turns out we have a duplicate VoidFunction callback in the WebIDLs. Per
 Mozilla bug 1324169, we should remove this callback from
 RTCPeerConnection.webidl and let Function.webidl handle it instead.
The AttributeError faced by the new Basilisk dev wasn't helpful at all;
 and turns out Mozilla had this exact same issue on bug 1505504. We're
 also backporting that just in case we encounter another case of
 callback duplication.
Also doing a minor fix in the MicroTaskRunnable class which Moonchild
 forgot to do while working on Issue #1895.
2022-07-30 13:24:40 +08:00
Moonchild 32c8246e16 Merge pull request 'Revert "Issue #1806 - Follow-up: Fix WebRTC issues with cubeb update."' (#1979) from Basilisk-Dev/UXP:master into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1979
2022-07-29 18:00:14 +00:00
Basilisk-Dev 27bbc35768 Revert "Issue #1806 - Follow-up: Fix WebRTC issues with cubeb update."
This reverts commit d0acadd727.
2022-07-29 13:14:25 -04:00
Moonchild d60f501490 Merge branch '1970-form-focusring-styling' 2022-07-29 13:24:43 +00:00
Moonchild 900107da1b Merge pull request 'Allow WAV into media document.' (#1978) from jobbautista9/UXP:1977-wav-videodocument into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1978
Reviewed-by: Moonchild <moonchild@palemoon.org>
2022-07-29 13:10:12 +00:00
Job Bautista 8a10b7bf8b Issue #1977 - Bring back old behavior behind a pref.
I've thought about this before creating the issue, and Moonchild
 wanted this as well.
2022-07-29 20:14:27 +08:00
Jeremy Andrews b673400639 Issue #1312 - Fix potential crashes in MailNews.
These are straightforward, one-line changes with no obvious dependencies. Probably could have been taken a long time ago.

Ref: BZ 1638634, 1606091
2022-07-28 08:50:59 -05:00
Job Bautista 28e73defa3 Issue #1977 - Allow WAV into media document.
Based on https://hg.mozilla.org/integration/mozilla-inbound/rev/b3f7abd15aeb
2022-07-27 14:16:57 +08:00
Moonchild b110549cbd Merge branch 'master' into release 2022-07-27 06:07:45 +00:00
Moonchild cfe63a2434 [NSS] Version bump 2022-07-27 04:47:25 +00:00
Moonchild 0aa19bce59 [NSS] Fix uninitialized value in cert_ComputeCertType. 2022-07-27 04:42:20 +00:00
Moonchild ef4a433814 [NSS] Avoid potential data race on primary password change. 2022-07-27 04:17:05 +00:00
Moonchild 713d6ed1b4 [NSS] protect SFTKSlot needLogin with slotLock. 2022-07-27 03:06:40 +00:00
Moonchild 515ba7c887 [DOM] Add extra check for performance API Next Hop protocol 2022-07-27 02:39:58 +00:00
Moonchild 971047835a Merge branch 'master' into release
# Conflicts:
#	config/milestone.txt
#	toolkit/mozapps/extensions/internal/XPIProvider.jsm
2022-07-25 20:47:06 +00:00
Moonchild 562ff3e9ab Merge pull request 'Implement Origin header CSRF mitigation.' (#1976) from jobbautista9/UXP:origin-csrf into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1976
2022-07-25 20:41:23 +00:00
Moonchild 7802bdb5f7 Merge pull request 'Implement Intl.RelativeTimeFormat.' (#1974) from jobbautista9/UXP:1969-relativetimeformat-take3 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1974
2022-07-25 13:44:43 +00:00
Job Bautista b20b9797dc Issue #1975 - Implement Origin header CSRF mitigation.
Backported from Mozilla bug 446344.
2022-07-25 18:56:46 +08:00
Job Bautista 824c2f0d40 Issue #1969 - Implement Intl.RelativeTimeFormat.
Based on Mozilla bugs 1270140, 1504656, 1483545, and 1504334.
Took note of Mozilla bug 1379222 which changed GetPrototypeFromCallableConstructor
 to GetPrototypeFromBuiltinConstructor.
There are many other changes I did myself since the initial implementation by
 Mozilla wouldn't work with this codebase.
2022-07-25 14:07:36 +08:00
Moonchild 6542ca6bcd Merge pull request 'Upgrade ICU to 63.2 and Unicode to 11.0' (#1973) from jobbautista9/UXP:1971-icu63-forreal into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1973
2022-07-24 20:31:14 +00:00
Moonchild b395befdbd Bump platform version 2022-07-24 17:53:25 +00:00
Moonchild 071412ab29 Issue #1970 - Part 7: Restore proper spacing in select for CJK/asian
The issue is that select elements may contain some non-Latin characters that
need extra block-size to display than the one line-height calculated by using a
Latin font spec in the style.
Before this patch, when a control has an unconstrained block-size, we set
the element's block-size to one line-height in Reflow(), which is intended to
properly initialize `BlockReflowInput::mMinLineHeight` since it uses
`line-height:-moz-block-height`.

However, this simply prevents the display from choosing a larger block-size
after the reflow occurs. Previously, this discrepancy was absorbed by the extra
padding present to make select elements the same intrinsic size as buttons, but
since we did away with that, we're losing the extra space and the font glyphs
get clipped.

This patch fixes the issue by carrying the computed line height over to the
element's display so that its computed block-size is still unconstrained.
This way it can accommodate taller characters in the display text.

After this patch, a <select><option> containing non-Latin characters should have
the same block-size as <button>, and no characters should be clipped.
2022-07-24 17:25:36 +00:00
Job Bautista b9454f2887 Issue #1971 - Part 6: Updating ICU requires a clobber. 2022-07-24 21:09:52 +08:00
Job Bautista 3b93fb3645 Issue #1971 - Part 5: Update Spidermonkey for Unicode 11.
I forgot to do this while working on issue #326.
2022-07-24 21:09:02 +08:00
Job Bautista b6185a27f2 Issue #1971 - Part 4: Generated files for Unicode 11.0. 2022-07-24 21:07:13 +08:00
Job Bautista be2e0f9830 Issue #1971 - Part 3: Update unicharutil perl scripts for Unicode 11 upgrade.
ICU 62 (and therefore 63) requires at least Unicode 11.
2022-07-24 21:05:07 +08:00
Job Bautista 62636946ff Issue #1971 - Part 2: Update ICU source to 63.2. 2022-07-24 21:03:27 +08:00
Job Bautista 970b041574 Issue #1971 - Part 1: Update build system for ICU 63.2 upgrade. 2022-07-24 20:54:59 +08:00
Moonchild 5487515bca Issue #1970 - Part 6: Rename CalcLineHeight(), and cache used line height
To better distinguish the calculation of line height (still present with args)
and simply getting the line height without args, it's now called GetLineHeight()
This also introduces `mLineHeight` to cache specifically calculated line heights
that aren't "auto" (which is a magic value), and it opens up the possibility to
override it in Part 7.
2022-07-23 23:35:18 +00:00
Moonchild 5dace0043a Issue #1970 - Part 5: Move combobox/select padding to the select rule.
This doesn't change behavior by default but allows authors to remove the padding
previously enforced to align with focus ring padding, if they wish to.
2022-07-23 17:36:23 +00:00
Jeremy Andrews 3f0dc49164 Issue #1962 - Follow-up: Fix 32-bit build and remove unused clang-cl codepath. 2022-07-23 07:17:30 -05:00
Job Bautista 81f3903598 Issue #1962 - Follow-up: Fix build issues on Windows.
Do not pass -Wno-type-limits to MSVC.
Restore MSVC check for x86_vc
2022-07-22 21:23:21 +00:00
Job Bautista 6957412ab5 Issue #1962 - Update libtheora.
Removed some obsolete patches that were either backports from newer
 svn revisions, or a fix for older, non-applicable assemblers.
Update our own README to account for upstream's migration to git.
I didn't remove the bug 703135 patch as it's for MSVC it seems, and
 we still use MSVC for Windows.
Also deleted some unneeded upstream code deleted by Mozilla as well.
2022-07-22 21:23:07 +00:00
Moonchild fa714cba35 Issue #1970 - Part 4: Don't overflow -moz-focus-inner border. 2022-07-22 18:25:57 +00:00
Moonchild d73c4c046d Issue #1970 - Part 3: Update reftests. 2022-07-22 18:23:50 +00:00
Moonchild 3d954cb29c Issue #1970 - Part 2: Remove the extra padding on buttons
Extra padding was created for a prospective -moz-focus-inner ring.
We now just size that ring the same as the content frame, inflated by its CSS
padding.
2022-07-22 15:06:19 +00:00
Moonchild 1aa650b8ac Issue #1970 - Part 1: Remove unused moz-focus-outer code for buttons. 2022-07-22 14:47:45 +00:00
Moonchild e6b3e4ebed Revert "Issue #1962 - Update libtheora."
This reverts commit bd497f7f83.
2022-07-22 14:45:49 +00:00
Moonchild a7a76f9a29 Merge pull request 'Update libtremor.' (#1965) from jobbautista9/UXP:tremor-update into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1965
2022-07-22 08:01:42 +00:00
Moonchild 590835c616 Merge pull request 'Update libtheora.' (#1963) from jobbautista9/UXP:theora-update into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1963
2022-07-22 08:01:22 +00:00
Moonchild 3bb273771a Merge pull request 'Remove mozprotocol handler.' (#1968) from jobbautista9/UXP:mozprotocol-remove into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1968
2022-07-22 08:01:10 +00:00
Job Bautista ba7b5589ab Issue #1967 - Remove moz://a from mochitest
While we don't use mochitest AFAIK, we still want a clean removal.
2022-07-22 15:53:06 +08:00
Job Bautista 69a867fd3a Issue #1967 - Remove mozprotocol handler (moz://a easter egg). 2022-07-22 10:40:33 +08:00
Moonchild c6c045a7f7 Issue #1966 - Remove support for Firefox Marketplace "apps"
Because UXP may be a platform, but it's not a mobile OS.
2022-07-22 02:30:42 +00:00
Moonchild a5421542e5 Issue #1837 - Remove unused build back-ends from the tree.
This leaves just use of recursive make to build applications.
2022-07-21 08:39:43 +00:00
Job Bautista aa3828319a Issue #1964 - Update libtremor.
Also removed mozilla patches that are already applied upstream.
2022-07-19 21:59:34 +08:00
Job Bautista bd497f7f83 Issue #1962 - Update libtheora.
Removed some obsolete patches that were either backports from newer
 svn revisions, or a fix for older, non-applicable assemblers.
Update our own README to account for upstream's migration to git.
I didn't remove the bug 703135 patch as it's for MSVC it seems, and
 we still use MSVC for Windows.
Also deleted some unneeded upstream code deleted by Mozilla as well.
2022-07-19 17:26:42 +08:00
Moonchild 9800079bc2 Merge pull request 'Improve stack size limits for all targets.' (#1961) from 1805-stacksize into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1961
2022-07-17 06:42:01 +00:00
Jeremy Andrews 8442b959f8 Merge branch 'master' of https://repo.palemoon.org/MoonchildProductions/UXP 2022-07-16 11:12:01 -05:00
Jeremy Andrews ef89146385 Issue #1956 - Work around UTF-8 issue when parsing JSON with Python 2 on some Windows environments.
This is a known issue with Python 2 interacting badly with some Windows configurations. Mozilla encountered it as well.

Ref: BZ 1362872
2022-07-16 11:07:35 -05:00
Moonchild 286e7ac205 Issue #1960 - Convert async property syntax to async function syntax in
DownloadUIHelper.jsm
2022-07-16 01:14:44 +00:00
Moonchild f63a7ee3fd Issue #1805 - Follow-up: Include the same headers for Solaris as well to
future-proof gcc versions.
2022-07-15 19:48:18 +00:00
Moonchild 325a49588a Issue #1805 - Follow-up: provide for Linux builds using rlimit and min/max. 2022-07-15 16:03:43 +00:00
Moonchild 00f22ddbe6 Issue #1805 - Improve stack size limits for all targets.
This allows us to use a greater rendering depth for exceedingly-deep DOM trees
in layout, better matching what mainstream browsers are capable of. Note that
for 32-bit Windows the stack size MUST be set to larger than the default or Bad
Things Will Happen™ - we use 1.5 MB for this as a carefully-tuned value.

This needs to be capped specifically for JS use because some JavaScript
obfuscators deliberately trigger stack overflows and would lock up the browser
otherwise as long as there's still stack space to abuse. For web compatibility
we therefore limit this to 2MB in JS only (3x for ASAN) while still allowing
a greater depth for the layout engine.
2022-07-15 11:56:12 +00:00
Jeremy Andrews dcb027a718 Issue #1956 - Allow debugger to work on newer MSVC.
Newer MSVC was failing to find the devenv executable for ./mach run --debug
This isn't the prettiest solution, but at least it's better than just relying
on a hardcoded path.
2022-07-14 23:03:39 -05:00
Moonchild 08c90e00b9 Merge remote-tracking branch 'athenian200/msvc2022-linker-fix' 2022-07-12 15:46:40 +00:00
Moonchild 9ef5006592 Issue #1959 - Don't apply CSPs to explicit data documents and images.
This resolves #1959
2022-07-12 12:48:06 +00:00
Jeremy Andrews 61f1adc54d Issue #1956 - Fix symbol visibility issue more elegantly.
All it needed was __declspec(dllexport) on the function I was copy/pasting all over the place...
2022-07-12 01:39:20 -05:00
athenian200 68bfe68581 No Issue - Insert missing typedef for SunOS.
We definitely have uint64_t on SunOS. Someone probably just forgot to finish filling out the list...
2022-07-09 12:38:53 +00:00
Jeremy Andrews 1fadb7fa2f Issue #1956 - Use preprocessor to work around strange template behavior with 32-bit MSVC2022. 2022-07-06 12:52:23 -05:00
Jeremy Andrews de383de310 Issue #1956 - Follow-up: Fix weird linker issue on 32-bit MSVC2022.
I moved Range<bool>::Merge and Range<bool>::FinalizeMerge from MediaTrackConstraints.cpp, into MediaTrackConstraints.h. The header file previously contained only a forward declaration of functions implemented in the .cpp, which can be a problem if other parts of the program are including this header expecting to find the function.
2022-07-05 22:19:08 -05:00
Moonchild c29f3e8dba Merge pull request 'Issue #1956 - Fix AV1 on MSVC2022 32-bit build.' (#1958) from athenian200/UXP:libaom_msvc2022_fix into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1958
Reviewed-by: Moonchild <moonchild@palemoon.org>
2022-07-05 11:35:48 +00:00
Jeremy Andrews 932335ea76 Issue #1956 - Fix AV1 on MSVC2022 32-bit build. 2022-07-05 06:16:00 -05:00
Moonchild dd4d9eb032 [XPCOM] Crash safely when TArray replacements are OOB.
In the unlikely event of TArray element replacement calls are OOB, crash safely
with a debug breakpoint instead of corrupting memory.
2022-07-03 15:49:44 +00:00
Moonchild 8b94f1e480 [DOM] use the sanitizer to restrict href in svg:use to fragment-only URLs 2022-07-03 15:49:34 +00:00
Moonchild c89610a5c7 [network] Clear PAC loader when the load failed 2022-07-03 15:49:23 +00:00
Moonchild 217963cbed Update NSS to 3.52.7 2022-07-03 15:49:14 +00:00
Moonchild c4f4e18340 [DOM media] Remove potentially unsafe type accesses when debug logging 2022-07-03 15:49:04 +00:00
Moonchild 8a7c0e7345 [network] Clean up and update the list of external protocol handlers. 2022-07-03 15:48:54 +00:00
Moonchild ac9e93e5e6 [XPCOM] Crash safely when TArray replacements are OOB.
In the unlikely event of TArray element replacement calls are OOB, crash safely
with a debug breakpoint instead of corrupting memory.
2022-07-03 15:38:40 +00:00
Moonchild 2485e982f3 [DOM] use the sanitizer to restrict href in svg:use to fragment-only URLs 2022-07-03 15:37:58 +00:00
Moonchild ae9de9b891 [network] Clear PAC loader when the load failed 2022-07-03 12:28:57 +00:00
Moonchild 438c04383f Update NSS to 3.52.7 2022-07-03 11:30:19 +00:00
Moonchild c830a5f497 [DOM media] Remove potentially unsafe type accesses when debug logging 2022-07-03 10:21:06 +00:00
Moonchild 164800800d [network] Clean up and update the list of external protocol handlers. 2022-07-03 08:12:45 +00:00
Moonchild c4e16d8b64 Merge pull request 'Allow building with newer MSVC versions.' (#1955) from athenian200/UXP:msvc-detection-update into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1955
2022-07-02 21:51:14 +00:00
Jeremy Andrews 057c632bee Issue #1956 - Allow building with newer MSVC versions. 2022-07-02 13:05:26 -05:00
Moonchild 049feac2c8 Merge pull request 'Backport Function.toString changes' (#1954) from martok/UXP-contrib:1952-proxy into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1954
2022-07-02 16:04:39 +00:00
Martok 9221d44207 Issue #1952 - m-c 1440468: Proxied functions can't be passed to Function.prototype.toString.call() 2022-07-01 20:25:05 +02:00
Martok 4bf20fc91e Issue #1952 - m-c 1383775: Clean up function toString/toSource code, remove remnants of source decompiler 2022-07-01 20:25:01 +02:00
Martok 2a10574d76 Issue #1952 - m-c 1380962/2: Remove unnecessary lambda function in FunctionToString 2022-07-01 20:24:52 +02:00
Martok 16b11770a1 Issue #1952 - m-c 1380962/1: Merge append calls when assembling the source string for native functions 2022-07-01 20:21:54 +02:00
Martok 7277d7c6d7 Issue #1952 - m-c 1371593: Avoid repeated string atomizations when retrieving the unresolved name of a bound function 2022-07-01 20:21:43 +02:00
Martok 0fe63b74b1 Issue #1952 - m-c 1365387: Optimize FinishBoundFunctionInit by delaying atomizing the function name 2022-07-01 20:21:22 +02:00
Moonchild 07689ab83f Merge pull request 'Update soundtouch library to 2.3.1' (#1951) from jobbautista9/UXP:soundtouch-take2 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1951
Reviewed-by: Moonchild <moonchild@palemoon.org>
2022-07-01 12:20:55 +00:00
Moonchild 77e923c146 Merge pull request 'Update nestegg library' (#1950) from jobbautista9/UXP:nestegg into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1950
Reviewed-by: Moonchild <moonchild@palemoon.org>
2022-07-01 11:55:05 +00:00
Job Bautista 2d4950d2ae Issue #1949 - Part 2: Disable exceptions in soundtouch's STTypes.h.
I don't know how Mozilla was able to build this without defining
 ST_NO_EXCEPTION_HANDLING, but looks like we have to do it so that
 the compiler doesn't complain about -fno-exceptions
2022-06-30 10:49:38 +08:00
Job Bautista 6056469e41 Issue #1949 - Part 1: Update soundtouch library to 2.3.1. 2022-06-30 10:48:26 +08:00
Job Bautista 8a92f69986 Issue #1948 - Update nestegg library.
I separated out the AVC and AAC support code into a patch file so that
 the upstream code can be updated freely without having to re-add AVC
 and AAC support again. At least if the upstream changes are not too
 extensive...
This should effectively backport Mozilla bug 1539686, which allows the
 browser to parse the color information from WebM videos that uses HDR.
2022-06-30 10:31:31 +08:00
Moonchild 8c1064bc1c Merge pull request 'Update libaom to 3.4.0' (#1938) from jobbautista9/UXP:aom into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1938
2022-06-28 17:09:53 +00:00
Moonchild 52e304d450 Issue #1053 - Follow-up: Correct conditional define on POSIX systems. (uplift)
This conditional was incorrectly changed when removing Android support.
This potentially causes issues on Linux systems by not using pthreads correctly,
which may lead to high idle CPU usage.
2022-06-28 13:28:20 +00:00
Job Bautista 5654295d83 Issue #1937 - Follow-up: Remove some unnecessary includes and sources from sources.mozbuild
These were used only by the encoder, which has been excluded from the build.
2022-06-28 19:20:29 +08:00
Moonchild e6baad1f5f Issue #1937 - Follow-up: Exclude aom_encoder.c/h from our build
We don't need an encoder!
2022-06-28 19:09:45 +08:00
Moonchild 0051421990 Merge pull request 'Fix volume handling in sndio backend.' (#1945) from jobbautista9/UXP:sndio-volumehandling into master
Untested by me but assuming this all works as it's straightforward enough of a change otherwise.
2022-06-28 09:19:07 +00:00
Moonchild 58e418aeb0 Merge pull request 'Fix building libjpeg-turbo on ARM.' (#1947) from jobbautista9/UXP:libjpeg into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1947
2022-06-28 00:02:38 +00:00
Moonchild 904af3005d Issue #21 - Follow-up: Remove some left-over telemetry plumbing. 2022-06-27 08:03:48 +00:00
Moonchild 7e5ab94e0c Issue #1053 - Follow-up: Correct conditional define on POSIX systems.
This conditional was incorrectly changed when removing Android support.
This potentially causes issues on Linux systems by not using pthreads correctly,
which may lead to high idle CPU usage.
2022-06-27 08:02:42 +00:00
Job Bautista ae8639dc24 Issue #1933 - Follow-up: Remove cmakedefine directives from neon-compat.h.
Apparently it wasn't preprocessed yet. Just took the version from
 mozilla-central, and it worked, according to dbsoft.
2022-06-27 14:10:21 +08:00
Job Bautista c56a635ba2 Issue #1937 - Follow-up: Add missing sources, and remove unneeded ones in sources.mozbuild
This should (hopefully) fix building for Windows.
The ones I removed are not used for decoding, but for encoding, which
 we don't need.
2022-06-27 10:11:33 +08:00
Job Bautista f8767c563d Issue #1933 - Follow-up: Fix building on ARM.
neon-compat should be imported as a .h header, not an .in file.
2022-06-27 09:10:56 +08:00
Job Bautista 79e782e53f Issue #1944 - Follow-up: Make it clear that volume is a float.
1. => 1.0, 0. => 0.0
2022-06-27 02:14:05 +08:00
Job Bautista adafcc36fc Issue #1937 - Follow-up: Add missing sources and includes in sources.mozbuild 2022-06-27 02:07:45 +08:00
Job Bautista 411e6879ee Issue #1937 - Follow-up: Fix sources.mozbuild not having exports
Thankfully I already redundantly edited this file myself before to
 account for updates in the source, and backed this up to another
 location just in case the shell script breaks my build files,
 which it did!
2022-06-26 22:42:56 +08:00
Moonchild 9a52ed3bfb Merge pull request 'Update libvorbis to 1.3.7' (#1942) from jobbautista9/UXP:vorbis37 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1942
2022-06-26 11:48:09 +00:00
Moonchild a08f152454 Merge pull request 'Update libwebp to 1.2.2' (#1940) from jobbautista9/UXP:libwebp into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1940
2022-06-26 11:47:44 +00:00
Moonchild 20c80bcbc1 Merge pull request 'Update libogg to 1.3.5' (#1936) from jobbautista9/UXP:libogg into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1936
2022-06-26 11:47:07 +00:00
Moonchild 016efb9f37 Merge pull request 'Update libjpeg-turbo to 2.1.3' (#1934) from jobbautista9/UXP:libjpeg into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1934
2022-06-26 11:46:49 +00:00
Moonchild dcddfbe7af Merge pull request 'Remove support for non-ICU unicode character property tables.' (#1932) from jobbautista9/UXP:326-nukenonicu into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1932
2022-06-26 11:41:56 +00:00
Moonchild 4a1f2294a5 Merge pull request 'Update Unicode to version 10.0, and UTR-50 data to version 17' (#1931) from jobbautista9/UXP:326-u10-take2 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1931
2022-06-26 11:41:11 +00:00
Job Bautista f9e0ed9849 Issue #1944 - Fix volume handling in sndio backend.
Backported from Mozilla bug 1467882.
2022-06-26 19:20:24 +08:00
Job Bautista 61cd8ae52b Issue #1941 - Update libvorbis to 1.3.7. 2022-06-26 14:12:52 +08:00
Job Bautista 76f825276d Issue #1939 - Part 2: Update libwebp source. 2022-06-26 12:52:04 +08:00
Job Bautista 3c7fcec8a0 Issue #1939 - Part 1: Update build system for libwebp. 2022-06-26 12:51:41 +08:00
Job Bautista b900a6e486 Issue #1937 - Part 2: Update libaom source. 2022-06-25 18:15:40 +08:00
Job Bautista e3fd2e48e0 Issue #1937 - Part 1: Update build system for libaom. 2022-06-25 18:15:10 +08:00
Job Bautista a2cc16a276 Issue #1935 - Update libogg to 1.3.5
I've also added some notes in the update.sh script that should've been
 documented, as well as changed README to README.md which Mozilla
 somehow forgot to do when they updated to 1.3.3...
2022-06-25 11:31:22 +08:00
Job Bautista c6c6ba4e2d Issue #1933 - Part 2: Update libjpeg-turbo source. 2022-06-24 22:35:22 +08:00
Job Bautista 0f61aed51f Issue #1933 - Part 1: Update build system for libjpeg-turbo. 2022-06-24 22:33:06 +08:00
Job Bautista 2c92077deb Issue #326 - Part 6: Regenerate Unicode data tables with the stripped-down tool 2022-06-23 15:45:09 +08:00
Job Bautista fcc171ddb7 Issue #326 - Part 5: Simplify the genUnicodePropertyData.pl tool to generate only the data we need to supplement ICU properties
Backported from Mozilla bug 1402271.
Some removals were already done by Part 1b.
2022-06-23 15:44:03 +08:00
Job Bautista bbb68510ee Issue #326 - Part 4: Update Unicode data to release 10.0
genUnicodePropertyData.pl's output:
 unknown ICU script MASARAM_GONDI at ../tools/genUnicodePropertyData.pl line 442, <FH> line 2641.
 unknown ICU script SOYOMBO at ../tools/genUnicodePropertyData.pl line 442, <FH> line 2663.
 unknown ICU script ZANABAZAR_SQUARE at ../tools/genUnicodePropertyData.pl line 442, <FH> line 2679.
 Data for CharProp2 = 14864
 Data for FullWidth = 2176
 Data for FullWidthInverse = 2688
 Total data = 19728
2022-06-23 13:28:04 +08:00
Job Bautista d4d80438a3 Issue #326 - Part 3: Explicitly make the Script enum a 16-bit type
This is so we can add a field to gfxShapedWord without making it bigger.
Backported from Mozilla bug 1353000.
2022-06-23 13:23:20 +08:00
Moonchild 785a7c8198 Merge pull request 'Update Unicode to version 9.0, and UTR-50 data to version 16' (#1929) from jobbautista9/UXP:326 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1929
2022-06-22 15:17:51 +00:00
Job Bautista 52da5f2644 Issue #326 - Part 2: Update UTR-50 data to version 16
Based on Mozilla bug 1288961.
2022-06-22 18:09:59 +08:00
Job Bautista aabe1e7517 Issue #326 - Part 1c: Generated files for Unicode 9.0.
In order to generate these files, refer to
 https://wiki.mozilla.org/I18n:Updating_Unicode_version
For those too lazy to go to the link (or if the link no longer works), we need the
 following files from http://www.unicode.org/Public/9.0.0/ucd/:
 - UnicodeData.txt
 - Scripts.txt
 - EastAsianWidth.txt
 - BidiMirroring.txt
 - HangulSyllableType.txt
 - SpecialCasing.txt
 - ReadMe.txt (to record version/date of the UCD)
 - Unihan_Variants.txt (from Unihan.zip)
 As well as Identifier*.txt from http://www.unicode.org/Public/security/9.0.0/,
 which should be put in a "security" subdirectory under the UCD folder, and
 http://www.unicode.org/Public/vertical/revision-15/VerticalOrientation-15.txt put
 in a "vertical" subdirectory.
I suggest downloading all files with GetEmAll, just in case.
Change the perl command a bit, as the guide seems to be outdated:
 perl ../tools/genUnicodePropertyData.pl /path/to/platform/gfx/harfbuzz/src/ /path/to/platform/intl/icu/source/common/unicode/ /path/to/UCD-directory/
2022-06-22 18:07:24 +08:00
Job Bautista bc08ae75fe Issue #326 - Part 1b: Remove outdated ENABLE_INTL_API code.
ENABLE_INTL_API has been removed since Issue #324.
2022-06-22 18:06:20 +08:00
Job Bautista 26adb1ff41 Issue #326 - Part 1a: Update character property table generator script for Unicode 9, and adjust APIs to fit the new identifier-type property model
Backported from Mozilla bug 1281448.
2022-06-22 16:38:14 +08:00
Moonchild 6558fea833 Merge pull request 'Update image/Orientation.h' (#1927) from jobbautista9/UXP:1926 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1927
2022-06-21 16:14:08 +00:00
Moonchild 4af7884929 Merge pull request 'Collected ports for async functions in the JS parser' (#1924) from martok/UXP-contrib:1918-asyncgenerator into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1924
2022-06-21 15:14:23 +00:00
Moonchild 27347bc827 Merge pull request 'Final set of Apple Silicon (ARM64) Macintosh changes.' (#1923) from dbsoft/UXP:AppleARMPart4 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1923
2022-06-21 14:25:47 +00:00
Moonchild e837b693ba Merge pull request 'Table sticky and directionality handling improvements' (#1922) from jobbautista9/UXP:1916-finalpr3 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1922
2022-06-21 13:44:08 +00:00
Job Bautista 334c951f93 Issue #1926 - Update image/Orientation.h 2022-06-19 20:03:54 +08:00
Martok 324f6a0ea3 Issue #1918 - m-c 1353693: Correct parsing of async generator methods 2022-06-17 21:12:01 +02:00
Martok a492c5bdb9 Issue #1918 - m-c 1353690: Properly exclude |await| from consideration as a |let| variable name in async functions, so that a newline between the two separates them into two distinct expressions. 2022-06-17 21:02:38 +02:00
Martok 5d0bc8e811 Issue #1918 - m-c 1345960: Handle shorthand property and destructuring with async keyword properly.
This was previously partially present, but got lost along the way
2022-06-17 21:00:15 +02:00
Martok a90b552eb4 Issue #1918 - m-c 1358246: Report syntax error for stray "async" keyword in object literal property name. 2022-06-17 20:42:40 +02:00
Job Bautista 165df0f7b5 Issue #1916 - Part 3: Sticky/relative position fixes in nsTableWrapperFrame.
Backported from Mozilla bug 1472602.
Didn't include the change in StickyScrollContainer.cpp because it breaks
 linking to libxul.so in the end. It's not important anyway.
2022-06-17 21:33:03 +08:00
Job Bautista 9842b6054c Issue #1916 - Part 2: Add a flag to allow FinishReflowChild to handle relative positioning, and convert the caller for which this makes sense.
Backported from Mozilla bug 1547759.
2022-06-17 19:16:53 +08:00
Job Bautista b3cacb2c3a Issue #1916 - Part 1: Convert flags passed to ReflowChild, FinishReflowChild, etc into an enum class.
Backported from Mozilla bug 1571250.
2022-06-17 16:05:57 +08:00
Brian Smith 532cd0ae7a Issue #1905 - Part 4d - Fix a crash calling a date and time function.
Fixed by updating the xptcinvoke ARM64 code to the latest Mozilla version.
2022-06-15 04:34:44 -05:00
Brian Smith 5e9342a622 Issue #1905 - Part 4c - Follow Firefox and Safari in reporting "Intel" for Mac ARM64 devices.
Based on Mozilla bug 1655285.
2022-06-15 01:29:53 -05:00
Brian Smith f924d979d5 Issue #1905 - Part 4b - Fix issue loading the profile and saving changes to the profile.
Based on the following Mozilla bugs: 1659904, 1659905 and 1659077.
2022-06-15 01:27:04 -05:00
Brian Smith 2d9b9a9617 Issue #1905 - Part 4a - Change "as" test to "Apple" from "LLVM".
This will make this test Mac only, but it should work with any Xcode.
2022-06-15 01:16:15 -05:00
Moonchild 5652238ba8 Merge pull request 'Add Apple Silicon (ARM64) Mac Support' (#1915) from dbsoft/UXP:AppleARM into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1915
2022-06-11 16:07:26 +00:00
Moonchild a164537057 Merge pull request 'Ensure UpdateChecker and UpdateParser can handle empty manifest URLs.' (#1913) from athenian200/UXP:1909_second_attempt into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1913
2022-06-11 16:05:53 +00:00
Jeremy Andrews 2b8f6866cb Fix whitespace. 2022-06-10 19:43:12 -05:00
Brian Smith 0c99c0ca2e Issue #1905 - Part 3k - Separate the GNU and LLVM-as tests.
While we should be able to test these together, I don't want to risk breakages on different *nixes.
2022-06-10 16:33:04 -05:00
Jeremy Andrews ec277eacb8 Issue #1909 - Ensure UpdateChecker and UpdateParser can handle empty manifest URLs. 2022-06-10 12:54:15 -05:00
Moonchild 9ad788853f Issue #1914 - Implement white-space: break-spaces
This also simplifies GetCSSWhitespaceToCompressionMode (FFS with the function
names, Mozilla!) to be less fragile.
2022-06-10 07:35:22 +00:00
Brian Smith 79c3747465 Issue #1905 - Part 3j - Rename the ARM64 assembly files to .S.
Missed the moz.build file in the last commit.
2022-06-10 02:00:29 -05:00
Brian Smith 90307d8552 Issue #1905 - Part 3i - Rename the ARM64 assembly files to .S.
Necessary because they now need to be preprocessed.
2022-06-10 01:53:05 -05:00
Brian Smith 0828fe1232 Issue #1905 - Part 3h - Fix breakages on other platforms.
Mac Intel broke due to incorrect FFI target_dir for Intel.
Linux and possibly other platforms use a secondary aclocal.m4 that still referenced ios.m4.
2022-06-10 01:28:08 -05:00
Brian Smith a977ba55eb Issue #1905 - Part 3g - Final set of changes connecting ARM64 support for Mac.
Back out some of the xptcstubs changes that are not viable for our codebase.
2022-06-09 22:05:20 -05:00
Brian Smith 8199a0d551 Issue #1905 - Part 3f - Collection of fixes connecting ARM support to the Mac build.
Also update ARM XPT code to add Mac/Apple support.
2022-06-09 18:08:04 -05:00
Brian Smith 6996115924 Issue #1905 - Part 3e - Fix NSPR build on ARM.
The dynamic loader had been falling through to the ancient PowerPC code without __aarch64__ #ifdef
2022-06-09 14:57:21 -05:00
Brian Smith 56ff5a50d4 Issue #1905 - Part 3d - Report GNU AS when the system "as" is LLVM-as.
LLVM as is generally compatible with GNU, this should allow ICU to build on ARM Macs.
2022-06-09 14:38:33 -05:00
Brian Smith 357463d9d7 Issue #1905 - Part 3c - Remove iOS from the rest of the configure system. 2022-06-09 14:35:28 -05:00
Brian Smith e515299477 Issue #1905 - Part 3b - Remove iOS support from old-configure.
iOS is not really a viable target and Apple Silicon Macs report the same core system.
2022-06-09 14:19:05 -05:00
Brian Smith ad1bd19571 Issue #1905 - Part 3a - Resign python binary ad-hoc since install_name_tool invalidates code signature.
The code signature is invalidated on Intel as well, but on ARM the binary fails to run with an invalid code signature error.
2022-06-09 14:12:00 -05:00
Moonchild d8070a8e0d Issue #1877 - Follow-up: Disable WMF VP9 decoding due to playback issues
On some systems this breaks frame pacing and causes stuttery playback,
especially in combination with MSE and stream switching/chunked delivery.
2022-06-08 19:00:30 +00:00
Moonchild cfc0eeca53 Revert "Issue #1909 - Guard against empty update manifest URL"
This reverts commit d7fadcdef9.
2022-06-07 11:59:07 +00:00
Moonchild cd7fab2f80 Revert "Issue #1909 - Guard against empty update manifest URL"
This reverts commit d7fadcdef9.
2022-06-07 11:58:39 +00:00
Jeremy Andrews 9733f9d2e5 [MailNews] Disable leftover Account Provisioner code. 2022-06-06 11:22:22 -05:00
Brian Smith e65f15fb4c Issue #1905 - Part 2c - Fix OpenGL crash caused by calling [NSOpenGLContext setView:] on the Compositor thread.
Starting with SDK 10.14 I believe, many functions have main thread checks, including setView: and update.
So we now move the code in the updateGLContext method into doDrawRect which runs on the main thread.
2022-06-04 17:13:45 -05:00
Jeremy Andrews 9c395967cc [MailNews] Allow shift-clicking on Edit As New to edit a message as plaintext.
Ref: BZ 731688
2022-06-04 16:13:32 -05:00
Moonchild ebd3dd9228 Merge branch 'master' into release 2022-06-03 21:50:44 +00:00
Moonchild 64e3f4118a Merge pull request 'Support MacOS Monterey version detection, 11.0 and newer SDKs and fix system font crash.' (#1912) from dbsoft/UXP:AppleARM into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1912
Reviewed-by: Moonchild <moonchild@palemoon.org>
2022-06-03 19:14:12 +00:00
Brian Smith 4abc90ad3e Issue #1905 - Part 2b - Fix crash on startup due to inability to load system font with newer SDKs.
Fix based on Mozilla Bug 1672842.
2022-06-03 05:56:46 -05:00
Brian Smith 43dfe703da Issue #1905 - Part 2a - Build system fixes to allow use of SDK versioned 11.0 and higher.
Also don't include code incompatible with SDK 10.15 and higher, when building with such a SDK.
2022-06-02 15:56:05 -05:00
Moonchild cb40e4e7ef Merge branch 'master' into release 2022-06-01 13:54:11 +00:00
Moonchild d53fd09524 [NSS] Update NSS to 3.52.6
- Initialize pointers passed to NSS_CMSDigestContext_FinishMultiple (Bug 1767590)
2022-06-01 10:22:30 +00:00
Moonchild 9551e4c9bc [DOM] Clip image data transfers. 2022-06-01 09:48:54 +00:00
Moonchild 193b14528a Issue #1911 - Clean up nsFilePicker on Windows. 2022-05-31 23:17:48 +00:00
Moonchild 70a9fe579f Merge branch 'master' of https://repo.palemoon.org/MoonchildProductions/UXP 2022-05-30 19:18:16 +00:00
Moonchild eff26719cd Merge pull request 'Guard against empty update manifest URL' (#1910) from athenian200/UXP:empty-manifest-url into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1910
2022-05-30 19:15:04 +00:00
Moonchild 14f12a065e [XPCOM] Simplify nsITimer API.
It's much simpler to hold a death grip on the timer than to have a fragile
"release upon cancel" construct.
2022-05-30 11:08:22 +00:00
FranklinDM d7fadcdef9 Issue #1909 - Guard against empty update manifest URL
When installing an incompatible add-on, the add-ons manager checks first if a newer and compatible version of that add-on is available by sending a request either to the AUS or the provided update URL in the manifest.

If there's no update URL in the manifest and if the application does not provide an add-on update URL via preferences, the add-ons manager will error out and fail to notify that the said add-on is incompatible.

This commit addresses that by:
(a) preventing substitutions on the update manifest URL - this throws an error if it's empty; and
(b) failing early in the add-on update checker if the update manifest URL is empty and sends out an error notification
2022-05-30 09:24:21 +00:00
Moonchild 775ce7fc17 [network] Fix typo in nsSocketTransport2.cpp
Follow-up to 7322bc0e9d
2022-05-30 09:16:26 +00:00
Moonchild a2054a3eaf [DOM] Promise worker-proxy cleanup improvements 2022-05-30 08:28:48 +00:00
Moonchild c048d762cf [DOM] Don't allow internal MIME types to be assigned to DataTransfer
We already blocked x-moz-file(-promise) and x-moz-place* but of course people
would find ways to abuse other internal types. This change now blocks everything
except x-moz-url types which are harmless. (i.e. whitelist instead of blacklist)
2022-05-30 08:28:11 +00:00
Moonchild 39fe9559bb [places] add Content-Security-Policy to bookmarks HTML export
This commit adds a Content-Security-Policy to HTML documents for exported
bookmarks. The change will stop active content (like bookmarklets) from being
directly runnable in the exported local file, which is *not* breaking the
normal use case in which a bookmarklet is intended to modify an existing page.
It *will* affect the use case where you have a full website/application stored
in a bookmarklet that was supposed to replace the current web page. In this
case, users can right-click copy the link and drop it in the address bar.

Note: The CSP does not mean that this is a severe attack vector. It merely
provides a basic protection measure for users who use the exported bookmarks in
a non-standard way as a local file.
2022-05-30 08:28:01 +00:00
Paul Adenot baa0c0a91e [DOM media] Handle truncated WAV stream. 2022-05-30 08:26:43 +00:00
Moonchild 7322bc0e9d [network] SocketTransport2 cleanup 2022-05-30 08:26:32 +00:00
Peter Van der Beken 0fad293135 [DOM events] Clear event listener. 2022-05-30 08:26:22 +00:00
Moonchild 612b110946 [DOM media] Adjust lock scope in MediaSourceDemuxer 2022-05-30 08:26:12 +00:00
Randell Jesup ac6d297268 [Image] Image cleanup 2022-05-30 08:25:59 +00:00
Moonchild ea3642103f [DOM media] Add a lock around Reset() in WebMBufferedParser 2022-05-30 08:25:48 +00:00
Moonchild e591cf1e1a [DOM] worker cleanup. 2022-05-30 08:25:33 +00:00
Moonchild 07a26bff17 [DOM] Consistent error messages for scripts which failed to load. 2022-05-30 08:25:20 +00:00
Moonchild 0d8cddaa73 [DOM] Clear sinks and block further use after storage observer shutdown. 2022-05-30 08:25:08 +00:00
Moonchild a595fa29a3 [Network] Add a socket thread check and early exit for corner cases. 2022-05-30 08:19:22 +00:00
Moonchild 2705986b4a [xpcom] Timer cleanup, assertions and comments. 2022-05-30 08:18:26 +00:00
Moonchild 8e42fccca6 [image] Add additional locks to imgFrame. 2022-05-30 08:17:20 +00:00
Moonchild edd7cd7d87 [Network] Only call nsWSAdmissionManager::ConnectNext on the main thread. 2022-05-30 08:13:03 +00:00
Moonchild 662dba55fd Merge branch 'master' into release 2022-05-29 11:13:44 +00:00
Moonchild 23327d7213 Merge pull request 'Fix several -Wclass-memaccess GCC warnings in /gfx' (#1908) from trav90/UXP-contrib:gcc-work into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1908
2022-05-29 08:16:24 +00:00
Moonchild 04d84d20fa Merge pull request 'Update FFVPX to version 4.2.7' (#1907) from trav90/UXP-contrib:ffvpx-update into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1907
2022-05-29 08:15:27 +00:00
trav90 676305dfeb Issue #83 - Use correct #include in parseutils.c 2022-05-28 16:44:09 -05:00
trav90 9f0c3479c0 Issue #457 - Make GLContextSymbols a pure aggregate POD 2022-05-28 11:45:52 -05:00
trav90 33a3173c79 Issue #457 - Remove the constructor from gfxShapedText::CompressedGlyph and make it a trivial class
Also provide a couple of convenience "factory" methods to create simple and complex glyph values.
2022-05-28 11:45:35 -05:00
trav90 e517623574 Issue #83 - Update FFVPX to version 4.2.7 2022-05-28 08:53:54 -05:00
Moonchild 61efa1ee08 Merge pull request 'Remove the use of tagged shape pointers' (#1906) from 1742 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1906
2022-05-28 03:44:46 +00:00
Moonchild 8a737f3234 Merge branch 'read-barriers' into 1742 2022-05-27 16:53:08 +00:00
Jeremy Andrews 7e570f010f Issue #1742 - Part 5: Remove unnecessary GCPtr::unbarrieredGet
Ref: BZ 1323441
2022-05-27 07:25:48 -05:00
Jeremy Andrews 64ea1e09c2 Issue #1742 - Part 4: Don't trigger read barriers when comparing wrapped pointers types
This is actually an undocumented dependency of Bug 1325406 for Linux and
SunOS.

Ref: BZ 1308236
2022-05-27 07:21:59 -05:00
Moonchild 84c7d3c2f6 No issue - relax ctts flag checking in media/libstagefright
Some encoders will set ctts flags incorrectly (similar to version) resulting in
libstagefright aborting playback of media based on the media header.
(Looking at you, Twitter)
This change relaxes libstagefright's checking to pass ctts flags 0 or 1 and
falls through to actually trying to decoding the file.
2022-05-26 21:23:06 +00:00
Brian Smith 5e28396116 Issue #1905 - Part 1 - Implement detection of Monterey (12.x), Intel emulation and fix required OS version check. 2022-05-25 18:51:46 -05:00
Moonchild cd55d0fbe4 Issue #1742 - Remove the ambiguous portions of gc that dealt with tagged
pointers for shapes.

Nobody likes "isNullLike(obj)" when trying to garbage collect. It either is or
is not. Master Yoda would be pleased with this change.
2022-05-25 18:33:46 +00:00
Jeremy Andrews c772d0ef21 No Issue - Epyrus-related platform changes.
I'm very confident these changes will not impact IceDove-UXP or Pale Moon. What they do is conditionally disable a button that allows people to get a new account from a Mozilla-advertised e-mail provider, and remove the hard-coded OAuth2 keys in favor of a user-controlled preference.
2022-05-24 16:40:36 -05:00
Moonchild 46c9f72fc0 Issue #1742 - Part 3: use JS::PropertyResult instead of Shape*
This is the meat of the issue and switches using raw shape pointers out for
PropertyResult objects where feasible.
2022-05-24 21:19:51 +00:00
Moonchild a160e7772a Issue #1742 - Part 2: Add a class to encapsulate the possible results of a property lookup 2022-05-24 21:15:12 +00:00
Moonchild dc5a60fb62 Issue #1742 - Part 1: Refactor rooting base class templates
Based on Bug 1325406
2022-05-24 06:51:46 +00:00
Moonchild 1588077e62 Issue #1847 - Follow-up: Re-enable building of FIPS mode in NSS.
This fell by the wayside when transitioning to gyp, but there's no good
transition path for people previously enabling the obsolete FIPS-140 mode.
2022-05-22 08:42:57 +00:00
Moonchild 17970a216b Merge pull request 'Silence some GCC compiler warnings in FFmpeg code' (#1902) from trav90/UXP-contrib:gcc-work into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1902
2022-05-21 22:27:38 +00:00
trav90 be82ca4b1f Issue #457 - Silence some GCC compiler warnings in FFmpeg code 2022-05-21 13:07:38 -05:00
FranklinDM 00c51f75fa No issue - Add null check to send packet function in the developer tools server
This resolves some of the useless log spam thrown in the browser console by the developer tools.
2022-05-21 16:37:38 +00:00
Moonchild addadda237 Merge pull request 'Implement nullish coalescing operator' (#1901) from FranklinDM/UXP-contrib:work_js-nullish-coalescing into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1901
Reviewed-by: Moonchild <moonchild@palemoon.org>
2022-05-21 10:24:26 +00:00
FranklinDM 0efc152b07 Issue #1894 - Part 7: Update tests
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1566141
2022-05-21 01:09:51 +08:00
FranklinDM 8618fcbe89 Issue #1894 - Part 6: Check for nullish values when folding coalesce nodes
This uses a different approach by modifying the `Boolish` function directly to act differently if we're checking for nullish values.

Partially based on:
Bug 1566141 - Implement the Nullish Coalescing operator (??) proposal
Bug 1599163 - Nullish coalescing operator returns undefined for void expressions
2022-05-21 01:02:24 +08:00
FranklinDM 20ee1ece01 Issue #1894 - Part 5: Implement bytecode for nullish coalescing
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1566141
2022-05-21 01:02:23 +08:00
FranklinDM bbe40dab58 Issue #1894 - Part 4: Implement IonMonkey support for nullish coalescing
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1566141
2022-05-21 01:02:22 +08:00
FranklinDM 5e500dc2b4 Issue #1894 - Part 3: Implement support for nullish coalescing in JS reflection
Partially based on:
Bug 1566141 - Implement the Nullish Coalescing operator (??) proposal
Bug 1593415 - Assertion failure: false, at js/src/builtin/ReflectParse.cpp:3092 with nullish coalescing
2022-05-21 01:02:22 +08:00
FranklinDM 5d6ae8b156 Issue #1894 - Part 2: Implement support for nullish coalescing in the JS parser
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1566141
2022-05-21 01:02:21 +08:00
FranklinDM 99f31e38ba Issue #1894 - Part 1: Implement coalesce JS opcode
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1566141
2022-05-21 01:02:16 +08:00
Moonchild 51117c2b62 Bug 1679987 - Remove unused includes of nsCharSeparatedTokenizer.h. 2022-05-17 19:42:24 +00:00
Moonchild 991b053042 Merge pull request 'Add support for MP4 playback on Linux via FFmpeg 5.0' (#1900) from trav90/UXP-contrib:ffmpeg-work into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1900
2022-05-17 19:22:18 +00:00
Moonchild 1bf41a59b9 Issue #1210 - Keep timepicker disabled for now.
This needs localization work before enabling.
2022-05-16 20:12:09 +00:00
Moonchild 86db73b5d1 Issue #1813 - Enable date and time picker by default.
Resolves #1813
2022-05-16 20:08:29 +00:00
trav90 f302cc1391 Issue #1893 - Part 3: Update audio & video decoders for FFmpeg 5.0
FFmpeg 5.0 removed some deprecated symbols so we need to update our decoding code to account for it.
2022-05-16 10:58:20 -05:00
trav90 cb0f8292a6 Issue #1893 - Part 2: Add support for libavcodec 59/FFmpeg 5.0 2022-05-16 10:55:57 -05:00
trav90 4e03bfdec8 Issue #1893 - Part 1: Import required FFmpeg 5.0 header files 2022-05-16 10:53:55 -05:00
FranklinDM bdfd859beb Issue #1898 - Make sure that the sanity test stops running if necessary
As part of telemetry removal, d60103257e removed the `reportResult` function which also handles the stopping of the sanity test. This also removes unused histogram enumeration values and revises/adds some comments.
2022-05-15 14:48:09 +00:00
Moonchild 5338dcd132 Issue #1899 - Make sure the test for it still works
Some hoops to make sure the test still works if the default value for the pref
is false, requiring setting and resetting it and making sure the observers have
time to react to these changes before testing.
2022-05-14 12:22:48 +00:00
Moonchild a9d3c2b52a Issue #1899 - Disable the (broken) MDN integration widget by default. 2022-05-14 11:06:02 +00:00
Moonchild 517aec3111 Issue #1509 - Invalidate previous result when datalist is changed.
Even if `<datalist>` is dynamically changed, the autocomplete controller still
uses the previous search result. If changed, we have to ignore the previous
result that may now be invalid.

Also, even if `<datalist>` is changed, we have to keep the selected index
(See Mozilla Bug 595069), so we cannot use `ResetInternalState` in this
situation because it resets the selected index.

This resolves #1509.
2022-05-10 21:03:53 +00:00
Moonchild 930ddd693b No Issue - Break overly long tooltips into multiple lines.
A very very old bug and annoyance: tooltips with very long content without
spaces (e.g. long URLs or gibberish data) would just cut off and leave an
un-styled right border going over the widget's constrained space.
Because of an additional bug (still unsolved), this was never properly
addressed because solutions attempted didn't work.
The workaround for the secondary bug allows for word-break to now work and this
primary problem to be resolved.
2022-05-08 21:07:03 +00:00
Moonchild 4cdd532738 Merge pull request 'Fix ASAN and clang crashes on Linux, BSD and MacOS.' (#1892) from dbsoft/UXP:fixxptcinvoke into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1892
2022-05-08 11:52:32 +00:00
Moonchild 8760ce023c Issue #1895 - Implement queueMicroTask(callback()) (uplift) 2022-05-07 14:40:14 +00:00
Moonchild 6f8d063b18 Issue #1895 - Implement queueMicroTask(callback()) 2022-05-07 14:39:41 +00:00
Moonchild b86e148bb7 Roll back milestone version to release. 2022-05-06 12:43:43 +00:00
Moonchild 9e83721e5e Merge branch 'master' into release 2022-05-06 12:43:00 +00:00
Brian Smith b1957eb7c9 Issue #1891 - Fix ASAN and clang crashes on Linux, BSD and MacOS.
Merge with the existing Solaris fix, by folding Solaris into the Linux/BSD section.
Add Apple Silicon (ARM64) support.
This should also address Issue #1884 by moving the offending code into assembly.
2022-05-05 15:53:25 -05:00
Moonchild a5b4a440d6 Update NSS to 3.52.5
- Default configure to enable dbm
- Remove a redundant check on ASN1 decoding (Bug 1753535)
2022-05-04 22:44:31 +00:00
Moonchild 9a84af4d5b Bug 1761981 2022-05-04 22:00:02 +00:00
Moonchild eecc234b44 No issue - Align our resource timing with the updated Fetch spec.
This makes FetchStart use StartTime() when the TAO check fails for
PerformanceResourceTiming

Given the recent Fetch spec updates, Step 8.1 in
https://fetch.spec.whatwg.org/#finalize-and-report-timing specifies that start
time(StartTime) and post-redirect start time(FetchStart) should be start time
when the TAO check fails.
2022-05-04 17:24:10 +00:00
Moonchild 2366accae5 Issue #1890 - Update libopus
This resolves #1890
2022-05-04 17:03:37 +00:00
Stephen A Pohl d01ae5cf25 [XPCOM] Improve the conversion of line breaks.
Fix an off-by-one error in CRLF checking.
2022-05-04 13:54:20 +00:00
Moonchild 92b3def6a8 Merge pull request 'Implement optional chaining' (#1889) from FranklinDM/UXP-contrib:work_js-optional-chaining into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1889
2022-05-04 10:42:06 +00:00
FranklinDM 006b8f5c6e Issue #1658 - Part 8: Update tests 2022-05-04 14:57:19 +08:00
FranklinDM 152974a8fe Issue #1658 - Part 7: Implement support for optional chaining in console autocomplete
This works by stripping the optional chaining characters from the completion part variable, allowing the developer tools' parser to proceed as if it were a regular, non-optional expression.

Tests were partially based on: https://bugzilla.mozilla.org/show_bug.cgi?id=1594009

Tests for features that do not apply to our version of developer tools (e.g. autocomplete for integer literals, ignoring spaces between property accessors, etc) were excluded.
2022-05-04 14:57:19 +08:00
FranklinDM 6d480d82a5 Issue #1658 - Part 6: Break and return no control flow for jumps emitted by optional chains under IonBuilder
IIUC, we want to process the GOTO in the case of optional chains, and we do not satisfy the requirements mentioned in the comment of snoopControlFlow's caller. Optional chains are not loops, we (probably) don't have a loop in the instruction following the GOTO, and in the GOTO destination, we're either returning an undefined/null value or the actual value.
2022-05-04 14:57:18 +08:00
FranklinDM fa72aef363 Issue #1658 - Part 5: Add and initialize TDZ check to optional chaining emitter
Partially based on: https://bugzilla.mozilla.org/show_bug.cgi?id=1685260
2022-05-04 14:57:18 +08:00
FranklinDM 2ed7526705 Issue #1658 - Part 4: Fix optional chaining assertions and remove unreachable code
This includes the following:

Bug 1611777 - Part 1: Report syntax error for optional property access in self-hosting code. r=yulia!
Bug 1611777 - Part 2: Merge same blocks in emitDeleteOptionalChain(). r=yulia!
Bug 1611777 - Part 3: N/A
Bug 1611777 - Part 4: `super` can't occur on the left-hand side of an optional chain
Bug 1611777 - Part 5: Remove unnecessary super-handling in optional delete. r=yulia!
The child node of a DeleteOptionalChainExpr node can't be a super-property
accessor, so we can remove this code.

Bug 1611777 - Part 6: Crash for unexpected super-base in optional call. r=yulia!
Bug 1611777 - Part 7: Add missing entries to list of valid optional chain start expressions. r=yulia!
Bug 1611777 - Part 8: Add missing emitGet in emitOptionalElemExpression. r=yulia!
Aligns emitOptionalElemExpression() with emitOptionalDotExpression(), so it's
easier to compare both methods against each other.

Bug 1611777 - Part 9: Replace an if-statement with an assertion. r=yulia!
Bug 1611777 - Part 10: N/A
Bug 1611777 - Part 11: Support optional chaining in class heritage expression. r=yulia!
Bug 1611777 - Part 12: Use optionalExpr() for update expressions to match spec grammar. r=yulia!

Using optionalExpr matches the spec grammar more closely. This change also
modifies the reported error message. ++a?.b reported before this change
"unexpected token: '?.'", but now reports "invalid increment/decrement operand".

Bug 1611777 - Part 13: N/A
Bug 1611777 - Part 14: Simplify two lines in optionalExpr(). r=yulia!

We don't need to test for tt == TokenKind::Eof when we return for tt != TokenKind::OptionalChain anyway. Omit local variable for the result value and instead use a tail-call. This matches the local style in the parser more closely.

Bug 1611777 - Part 15: Support FunCall/FunApply optimisations for optional chaining. r=yulia!
Bug 1611777 - Part 16: Pass through ValueUsage in optional chains. r=yulia
2022-05-04 14:57:17 +08:00
FranklinDM 9ecfdbe358 Issue #1658 - Part 3: Implement support for optional chaining in JS reflection
Partially based on:
Bug 1610447 - Update Reflect to handle Optional Chaining operator
Bug 1657835 - Assertion failure: false, at js/src/builtin/ReflectParse.cpp:3168
2022-05-04 14:57:16 +08:00
FranklinDM 97dcd8009a Issue #1658 - Part 2: Implement bytecode for optional chaining
Partially based on:
Bug 1566143 - Implement the Optional Chaining operator (?.) proposal
Bug 1650340 - Fix deleteElementInOptionalChain
Bug 1644839 - Fix return value of emitOptionalChain on failure
2022-05-04 14:57:16 +08:00
FranklinDM e1fc99d6ef Issue #1658 - Part 1: Implement support for optional chaining in the JS Parser
Partially based on: https://bugzilla.mozilla.org/show_bug.cgi?id=1566143
2022-05-04 14:57:15 +08:00
athenian200 0de24cc207 Merge pull request 'Allow /bin/sh to be used as a fallback value when SHELL is not set.' (#1888) from athenian200/UXP:shell_detection into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1888
2022-05-04 01:05:04 +00:00
Jeremy Andrews 28ad4a4b7c Issue #1887 - Allow /bin/sh to be used as a fallback value when SHELL is not set. 2022-05-03 20:01:09 -05:00
Moonchild dc2d6c2e60 Revert "No Issue - Make content-type on JAR channels behave the same as HTTP channels."
This reverts commit 425677ada7.
2022-05-03 17:38:19 +00:00
Moonchild 4ada6f6762 Update 7zSD for v31 2022-05-03 17:38:12 +00:00
Moonchild f41a43acf2 Revert "No Issue - Make content-type on JAR channels behave the same as HTTP channels."
This reverts commit 425677ada7.
2022-05-03 17:37:28 +00:00
Moonchild 1dd2c05377 Update 7zSD for v31 2022-05-03 17:07:38 +02:00
Moonchild f48c32ebc1 New cycle master 2022-05-03 11:27:24 +00:00
FranklinDM b0b90b81f3 [Toolkit] Set an icon for the default handler 2022-05-03 11:15:20 +00:00
Moonchild 6f9c302a32 Issue #1860 - Back out the change to vector for DisplayLists
A safe implementation means significant performance loss, making this change
undesirable.
2022-05-03 11:10:30 +00:00
FranklinDM a3bee9a6a8 Issue #1860 - Follow-up: Prevent duplicate display items by checking for its existence in the vector first before adding items
Performance impact unknown, resolves crashes on some sites that encounter this scenario.
2022-05-03 09:18:48 +00:00
FranklinDM 26d1ff2bd6 Issue #21 - Remove run phase property and constants from XPIProvider.jsm
These were introduced in Bug 853388 for the sole purpose of tracking the current startup phase for telemetry
2022-05-03 09:15:47 +00:00
FranklinDM 825ae7cb05 Regenerate developer tools' static CSS properties database 2022-05-03 09:15:15 +00:00
FranklinDM 2302734e6f Fix property alias indentation 2022-05-03 09:15:05 +00:00
FranklinDM 40c0791320 Fix generation of developer tools' static CSS properties database
- Remove `resolve_path` method and use `mozpath` instead for path operations
- Store target developer tools path as an instance variable to avoid duplicate checks for path existence
2022-05-03 09:14:57 +00:00
FranklinDM ab0be54f2d Issue #1853 - Follow-up: Add missing end of array marker to scrollbar width keyword table
This prevents the parser from accepting values outside the keyword table.
2022-05-03 09:14:47 +00:00
Moonchild 6b4ef9af48 Merge branch 'vpx-format-update' 2022-05-02 00:16:10 +00:00
Moonchild 425677ada7 No Issue - Make content-type on JAR channels behave the same as HTTP channels.
That is, treat it as a hint if called before open, and as an override if called
after. Override the hint on open.
2022-05-01 12:15:08 +00:00
Moonchild 633728842e Merge branch 'master' into vpx-format-update 2022-05-01 09:28:43 +00:00
Moonchild bc2841f9f9 Merge pull request 'Restore Mac OS X code and buildability' (#1886) from dbsoft/UXP:1829 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1886
2022-04-29 07:20:46 +00:00
Brian Smith d78e03d528 Merge branch 'master' into 1829
* master:
  No issue - Update README and SECURITY
  Issue #1885 - Follow-up: Update error message if invalid rootMargin specified.
  Issue #1879 - Follow-up: Update config/external/nss/target to security/target.
  Issue #1885 - Allow unitless rootMargin entries for IntersectionObserver.
  Issue #1879 - Revert changes to cryptox.h
  Revert "Issue #1879 - spot-fix typo in cryptox.h"
  Issue #1879 - spot-fix typo in cryptox.h
  Issue #21 - Change MappedAttrParser to store its nsIPrincipal instead of nsSVGElement
  Issue #21 - Remove use counters telemetry
  Issue #1881 - Interpret empty or whitespace root margin string as zero length
  Issue #1877 - Resolve NIGHTLY_BUILD conditionals.
  Issue #1880 - Boot Comic Sans out of the font configuration.
2022-04-28 20:27:47 -05:00
Brian Smith bebeb4e26a Issue #1829 - Build system fixes.
Readd de-unified source changes that got clobbered by commit 378738aaa9.
Fix build issues using clang broken by commit 39f9ab375b.
2022-04-28 14:21:17 -05:00
Moonchild bf110158b9 Issue #1820 - Part 8: Check bit depth in PDM::Supports. 2022-04-27 16:08:36 +00:00
Moonchild 983a87a9d7 Issue #1820 - Part 7: Check bit depth in WebMDecoder to determine if we support HDR. 2022-04-27 12:34:59 +00:00
Moonchild bf8359c704 Issue #1820 - Part 6: Extract bit depth information from codec parameter string
into VideoInfo::mBitDepth.
2022-04-27 12:34:26 +00:00
Moonchild 4e5b100cca Issue #1820 - Part 5: Add mBitDepth field to VideoInfo. 2022-04-27 11:12:39 +00:00
Moonchild a874f27b5a Issue #1820 - Part 4: Add a gtest for testing the extraction function. 2022-04-27 11:03:38 +00:00
Moonchild 6b2f1524f8 Issue #1820 - Part 3: Use Codec detail extractor helper to tell if it's a new
style VP8/VP9 codec string.
2022-04-27 10:28:18 +00:00
Moonchild 93b170e629 Issue #1820 - Part 2: Add VP9-in-MP4 support to the decoder
This also adds support in StageFright for VP9.0 FourCCs and consolidates
individual string checks to helpers for WebM
2022-04-27 10:27:49 +00:00
Moonchild 33523f5d5e No issue - Update README and SECURITY
- thereisonlyxul is no longer a thing.
- minor wording update.
2022-04-27 00:14:54 +00:00
Brian Smith 1eaadfbc8d Issue #1829 - Readd code cleanup that is not Mac related that got clobbered by reverting Issue #1751 2022-04-26 15:57:19 -05:00
Brian Smith 0102047d68 Issue #1829 - Fix psutil python extension on MacOS and potentially FreeBSD
Compilation failed due to missing sys/ioctl.h header on MacOS and FreeBSD. Call to function ioctl() with no prototype.  This was non-fatal due to the psutil component being optional.
2022-04-26 13:26:41 -05:00
Brian Smith b07c898b06 Issue #1829 - Readd a fix for Big Sur not loading libraries such as OpenGL.
This fix was included earlier but got clobbered by a recent NSPR update.
2022-04-26 13:25:29 -05:00
Brian Smith 6dd43c3e2f Issue #1829 - Fix Mac breakage due to removal of Telemetry. 2022-04-26 13:24:10 -05:00
Moonchild b9b1abc871 Issue #1820 - Part 1 : Add an extraction function to parse the RFC-6381 VP9 codec string. 2022-04-26 17:32:29 +00:00
Brian Smith 768231cf6a Issue #1829 - Revert "Issue #1751 - Remove MacOS support from configure"
This reverts commit d3543ca2fe.
2022-04-26 11:34:08 -05:00
Brian Smith c82b759d56 Issue #1829 - Revert "Issue #1751 -- Remove XP_MACOSX conditionals from /dom"
This reverts commit 0dd3424f77.
2022-04-26 11:24:42 -05:00
Brian Smith 9e2a89c71d Issue #1829 - Revert "Issue #1751 -- Remove XP_DARWIN"
This reverts commit 3d671e4275.
2022-04-26 11:07:23 -05:00
Brian Smith 68d1c14bdf Issue #1829 - Revert "Issue #1751 -- Remove files unused without XP_DARWIN"
This reverts commit cd1f724135.
2022-04-26 11:01:55 -05:00
Brian Smith b73c17b7c6 Issue #1829 - Revert "Issue #1751 -- Remove XP_MACOSX conditionals and support files from /gfx"
This reverts commit 616b39413d.
2022-04-26 10:59:55 -05:00
Brian Smith 1a31160dde Issue #1829 - Revert "Issue #1751 -- Remove XP_MACOSX conditionals and support files from /xpcom"
This reverts commit 1bf0734a72.
2022-04-26 10:56:11 -05:00
Brian Smith e764f258e2 Issue #1829 - Revert "Issue #1751 -- Remove XP_MACOSX conditionals from /layout"
This reverts commit aa0fd3d68c.
2022-04-26 10:21:29 -05:00
Brian Smith 3daf711085 Issue #1829 - Revert “Issue #1751 -- Remove XP_MACOSX conditionals from the rest of the tree.”
This also removes some PP abuse and takes file entries out of PP when no longer
needed without XP_MACOSX conditionals.

This reverts commit 6f707bde95.
2022-04-26 10:19:04 -05:00
Brian Smith 7fe7026030 Issue #1829 - Revert "Issue #1751 -- fix up a few stray #ifs"
This reverts commit e7e63565ee.
2022-04-26 10:19:04 -05:00
Brian Smith 93407295fc Issue #1829 - Revert “Issue #1751 -- Remove cocoa support code from /dom”
This reverts commit ca35efb84e.
2022-04-26 10:19:03 -05:00
Brian Smith db8d2ef672 Issue #1829 - Revert "Issue #1751 -- Remove cocoa and uikit widget support code"
This reverts commit 08da125d9c.
2022-04-26 10:19:03 -05:00
Brian Smith f4f9b0cec7 Issue #1829 - Revert "Issue #1751 -- Update crashtests"
This reverts commit b5ece9f771.
2022-04-26 10:19:02 -05:00
Brian Smith adf51bc0f5 Issue #1829 - Revert "Issue #1751 -- Remove cocoa and uikit gfx and hal support code"
This reverts commit 1ee35eafa0.
2022-04-26 10:19:02 -05:00
Brian Smith 378738aaa9 Issue #1829 - Revert “Issue #1751 - Remove Mac code behind MOZ_WIDGET_TOOLKIT == 'cocoa’”
This reverts commit 1fe9c19305.
2022-04-26 10:19:00 -05:00
Moonchild c482078b09 Merge pull request 'Remove use counters telemetry' (#1883) from FranklinDM/UXP-contrib:work_telemetry-use-counters-removal into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1883
2022-04-26 08:14:02 +00:00
Brian Smith 82f11ad8aa Issue #1829 - Revert "Issue #1751 - Remove Mac/ARM C fallback on gcc from pixman"
This reverts commit 2215d8467e.
2022-04-25 20:27:54 -05:00
Moonchild 72ff18e58e Issue #1885 - Follow-up: Update error message if invalid rootMargin specified. 2022-04-25 13:52:17 +00:00
Jeremy Andrews a0bdc21cf5 Issue #1879 - Follow-up: Update config/external/nss/target to security/target. 2022-04-24 15:03:59 -05:00
Moonchild 42ee994d99 Issue #1885 - Allow unitless rootMargin entries for IntersectionObserver.
I could have done this through a CSSLoader to allow all CSS unit quirks but
I wasn't planning to start passing around document and element references
everywhere, so instead just did it manually by accepting numbers/floats in
addition to pixel and percent.
2022-04-24 17:00:46 +00:00
Moonchild f25a45b9e6 Issue #1879 - Revert changes to cryptox.h
The error when removing this code was an #if vs #elif. But since we're planning
to restore MacOSX anyway, may as well rever the entire file here :)
2022-04-24 15:52:33 +00:00
Moonchild 677085e0c4 Revert "Issue #1879 - spot-fix typo in cryptox.h"
This reverts commit fbbcbffcc7.
2022-04-24 15:48:49 +00:00
Moonchild fbbcbffcc7 Issue #1879 - spot-fix typo in cryptox.h
Resolves #1879
2022-04-24 09:34:16 +00:00
Moonchild 5d5f72d4bc Merge pull request 'Interpret empty or whitespace root margin string as zero length for the IntersectionObserver' (#1882) from FranklinDM/UXP-contrib:work_inobsvr-empty-rootmargin-string into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1882
2022-04-24 09:28:37 +00:00
FranklinDM c8b89feae8 Issue #21 - Change MappedAttrParser to store its nsIPrincipal instead of nsSVGElement
This reverts part 2 of Bug 968923 since this was only modified to accommodate use counters.
2022-04-24 00:09:21 +08:00
FranklinDM 17b2aa7650 Issue #21 - Remove use counters telemetry
This reverts Bug 968923 - Implement some equivalent of Chrome's use counters (on top of telemetry?)

For reference: https://bugzilla.mozilla.org/show_bug.cgi?id=968923
2022-04-24 00:02:42 +08:00
FranklinDM 6f685140aa Issue #1881 - Interpret empty or whitespace root margin string as zero length
This attempts to get the first non-whitespace token, which if exists, continues with previous behavior of parsing the margin string. Otherwise, if the specified margin string is empty or consists only of whitespace characters, is interpreted as zero length.

IntersectionObserver is the only consumer of the `ParseMarginString` method, as far as I can tell, so this should not affect anything else.

Note: For some reason, Firefox and Chrome treat the unitless zero length as invalid, while with this change, we do not change existing behavior in that regard and continue to accept that value.
2022-04-23 19:34:31 +08:00
Moonchild 5aa65d2aea Issue #1877 - Resolve NIGHTLY_BUILD conditionals. 2022-04-22 13:58:16 +00:00
Moonchild 712ca7303b Issue #1880 - Boot Comic Sans out of the font configuration.
Resolves #1880
2022-04-22 13:18:55 +00:00
Moonchild 8c824b8a75 Merge pull request 'Implement :host and :host-context' (#1878) from webcomps-wchen into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1878
2022-04-20 19:33:34 +00:00
Jeremy Andrews 7aa445162e Issue #1593 - Part 5: Fix error that messes with event state detection.
Iterator changes between 42 and 52 were a bit confusing.
2022-04-19 21:48:36 +00:00
Jeremy Andrews 643e298a55 Issue #1593 - Part 4: Make :host pass DOM parsing test and basic specificity tests. 2022-04-19 21:45:51 +00:00
Jeremy Andrews f82c95d1eb Issue #1593 - Part 3: Add selector logic for :host and :host-context. 2022-04-19 21:44:23 +00:00
Jeremy Andrews 01747509f6 Issue #1593 - Part 2: Account for Shadow DOM v1 and iterator in nsBindingManager. 2022-04-19 21:43:21 +00:00
Jeremy Andrews 22b8e6b79f Issue #1593 - Part 1: Import William Chen's patches w/o selector implementation,
fixed up.
2022-04-19 21:42:11 +00:00
Moonchild f9b28d2006 Merge pull request 'Remove explicit SSL session cache cleanup' (#1875) from FranklinDM/UXP-contrib:work_nss-locks-assertion into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1875
2022-04-19 20:10:21 +00:00
Moonchild 185a027640 Issue #1877 - Resolve RELEASE_OR_BETA conditionals. 2022-04-19 17:38:02 +00:00
Moonchild 99ec088ecf No issue - Use UXP generic credentials if no module.ver is present. 2022-04-19 16:47:11 +00:00
Moonchild 062a5085b1 Bump milestone 2022-04-19 01:29:44 +00:00
Moonchild 65ed8de1fa Merge pull request 'Ensure UndisplayedMap handling code consistently uses a normalized parent' (#1874) from FranklinDM/UXP-contrib:work_frames-undisplayedmap-nmparent into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1874
2022-04-18 15:51:05 +00:00
Moonchild 2e34db5696 Merge pull request 'Bump minimum required GCC version in mfbt' (#1872) from trav90/UXP-contrib:compiler-hacks-cleanup into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1872
2022-04-18 15:44:50 +00:00
FranklinDM 3a565183f0 Issue #738 - Follow-up: Remove explicit session cache cleanup routine from ShutdownNSS
This is no longer needed because the call to SSL_ConfigServerSessionIDCache on startup was already removed (see 1425f020c4), meaning LocksInitializedEarly does not become true and only causes an assertion on debug builds.

On the other hand, SSL_ClearSessionCache is already called on XPCOM shutdown and calling it again here is redundant.

Additional context: https://bugzilla.mozilla.org/show_bug.cgi?id=1485087#c5

Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1485087
2022-04-18 23:44:27 +08:00
FranklinDM 7ed9c249be Issue #1873 - Part 3: Fix indentation 2022-04-18 23:22:04 +08:00
FranklinDM 37c86f2c07 Issue #1873 - Part 2: Ensure normalized parent is used for UndisplayedMap handling code
We have four entry points that deal with the parents of display:none/ display:contents content. These are the functions for setting, changing, getting and removing a style context. Or more specifically:

GetStyleContextInMap called by GetDisplay[None|Contents]StyleFor

SetStyleContextInMap called by RegisterDisplay[None|Contents]StyleFor

ChangeStyleContextInMap called by ChangeRegisteredDisplay[None|Contents]StyleFor

UnregisterDisplay[None|Contents]StyleFor okay, this is actually two functions, but they act as a pair

This change makes all these functions call GetApplicableParent up front and act on and pass around the parent that it returns. This is so that throughout the code we are always handling the parent that will be used as the key in the UndisplayedMap entry. This is necessary so that all the code that sets/gets the 'MayHaveChildrenWithLayoutBoxesDisabled' bit on/from an nsIContent object is using the same object, otherwise everything breaks down.

Partially based on part 2 of https://bugzilla.mozilla.org/show_bug.cgi?id=1367214
2022-04-18 23:21:58 +08:00
FranklinDM 8d8da66f94 Issue #1873 - Part 1: Introduce ParentForUndisplayedMap helper method
This introduces the `ParentForUndisplayedMap` helper method to reduce duplication in terms of getting the parent and asserting parent existence.

Partially based on parts of https://bugzilla.mozilla.org/show_bug.cgi?id=1341083
2022-04-18 23:21:22 +08:00
Moonchild 145947d86b Issue #1860 - Follow-up: Fix indentation. 2022-04-18 14:47:04 +02:00
Moonchild c2b4aa8cf2 Issue #1860 - Follow-up: Make sure we don't add duplicate frames
Changing to vector makes manipulating display list items more risky.
This is to make sure we don't inadvertently end up with duplicates in
the list of display items avoiding double-free scenarios.
2022-04-18 14:31:55 +02:00
Moonchild 129bb5568d Merge pull request 'Change LayerManagerData::mDisplayItems to a vector instead of hashtable' (#1866) from win7-7/UXP:pr-1860 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1866
2022-04-18 12:01:00 +00:00
win7-7 5b84c3e982 Merge branch 'master' into pr-1860 2022-04-18 13:15:28 +03:00
Moonchild 3abcec5d8b Merge branch 'lzma-updater' 2022-04-18 01:37:21 +02:00
Moonchild 6466bf6f5b Issue #1859 - Build xz-embedded lib when the updater is built. 2022-04-17 20:12:53 +02:00
Moonchild f4e8585e60 Merge pull request 'Follow-up: Prevent grid shorthand from resetting gutter properties' (#1871) from FranklinDM/UXP-contrib:work_css-grid-noreset-gutter-followup into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1871
2022-04-17 17:31:01 +00:00
Moonchild cc231f0a26 Merge pull request 'Set canonical name for trimStart and trimEnd functions' (#1870) from FranklinDM/UXP-contrib:work_js-selfhosted-trim-assertion into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1870
2022-04-17 17:29:58 +00:00
FranklinDM 86b17cfb4a Issue #1838 - Follow-up: Prevent grid shorthand from resetting gutter properties
This also fixes crashing when using the grid shorthand property.
2022-04-18 01:24:20 +08:00
Moonchild d2a4597cfc Issue #1859 - Part 6: Update mach mar to accept --bz2 for old style MAR
So we can build bzip2 MARs for selectively updating older versions of
the applications that don't understand xz.
2022-04-17 19:21:40 +02:00
Moonchild 43165d9edb Issue #1859 - Part 5: Add format detection to unwrap_full_update.pl 2022-04-17 19:21:30 +02:00
Moonchild 88624edc98 Issue #1859 - Part 4: Update mar file generation scripts for use of xz.
- Update packaging scripts to support both lzma and bzip2
- Update python script to support lzma
- Update test scripts to support lzma to be thorough

This all requires xz to be available in the path on the build system.
2022-04-17 19:21:20 +02:00
Moonchild c58e7c72b4 Issue #1859 - Part 3: Replace bzip2 handling in MAR files with xz.
Since there really is no need to add file detection logic to the updater
if updating through AUS is old->new only anyway, replacing bzip2
handling with xz handling is fine, instead of adding it.
Considering the far superior compression of LZMA and MAR not being
a common archive format anyway, let's just K.I.S.S. it :)
2022-04-17 19:21:09 +02:00
Moonchild 8bbfcc4c81 Issue #1859 - Part 2: xz-embedded build config changes
Always build as static lib for use in updater.
2022-04-17 19:20:59 +02:00
FranklinDM f2ad2ba0de Issue #1382 - Set canonical name for trimStart and trimEnd functions
This is needed to fix the assertion on debug builds that self-hosted functions must have consistent names, as these two functions are aliased to `trimLeft` and `trimRight`.
2022-04-18 01:12:25 +08:00
Moonchild 2af23767e1 Issue #1834 - Remove obvious entries for Binary Outcast code. 2022-04-17 11:21:48 +02:00
FranklinDM bb9700d982 Issue #1370 - Follow-up: Give table wrapper boxes a special case during flex base size resolution, so that percent main-sizes can be respected
This is a workaround, based on https://bugzilla.mozilla.org/show_bug.cgi?id=1455976
2022-04-17 11:03:22 +02:00
trav90 077b053ba4 Issue #1531 follow-up - Bump minimum required GCC version in mfbt 2022-04-16 21:12:11 -05:00
Moonchild 279ed4a9cf Merge pull request 'Fix building with GCC 11' (#1868) from trav90/UXP-contrib:gcc-work into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1868
2022-04-17 01:16:32 +00:00
trav90 5f8057cbed Issue #1804 - Fix building with GCC 11 2022-04-16 19:15:44 -05:00
Moonchild 95cda916d1 Merge pull request 'Cache the most recent nsGenConNode to speed up future insertions' (#1867) from win7-7/UXP:pr-1861 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1867
2022-04-16 16:27:21 +00:00
Moonchild 08842d77ae Merge pull request 'Issue #1818 Cleanup some old GCC hacks' (#1865) from trav90/UXP-contrib:compiler-hacks-cleanup into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1865
2022-04-16 16:23:23 +00:00
Moonchild 1191c9e371 Merge pull request 'Issue #1531 - Bump minimum required GCC version to 7.1' (#1858) from trav90/UXP-contrib:build-system-work into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1858
2022-04-16 16:13:03 +00:00
win7-7 4ea9a83b75 Merge remote-tracking branch 'Upstream/master' into pr-1861 2022-04-15 21:42:20 +03:00
Moonchild 9a2da3012a Issue #1864 - Fix IonBuilder::maybeMarkEmpty.
Look at the instruction's operands instead of the instruction itself,
and take an early exit on empty types.
2022-04-15 20:22:02 +02:00
win7-7 022ed72339 Merge remote-tracking branch 'Upstream/master' into pr-1861 2022-04-15 20:17:27 +03:00
trav90 f5c363c01d Issue #1818 - Part 4: always use -pipe with GCC
Usable GCC versions have supported -pipe for a VERY long time. There's no need to keep checking if it is supported.
2022-04-15 08:30:32 -05:00
trav90 41fc1ccf4d Issue #1818 - Part 3: Remove more old gcc compiler hacks. 2022-04-15 08:30:25 -05:00
trav90 7abed0e352 Issue #1818 - Part 2: Remove code for implementation of atomics with __sync
All supported compilers support using C++11 <atomic> natively, so implementing
this using GCC's old __sync functions is no longer necessary.
2022-04-15 08:30:16 -05:00
trav90 d430c6398b Issue #1818 - Part 1: remove a number of old GCC hacks. 2022-04-15 08:30:05 -05:00
win7-7 e44c44b749 Issue #1861 - Cache the most recent nsGenConNode to speed up future insertions.
Cache the most recent nsGenConNode to speed up future insertions.
2022-04-15 13:43:24 +03:00
win7-7 d347a1e0c6 Issue #1860 - Change LayerManagerData::mDisplayItems to a vector instead of hashtable
This should improve cache locality and help speed up layer building.
2022-04-15 13:39:58 +03:00
Moonchild 39ba93e1d7 Merge branch 'restore-dual-guid' 2022-04-15 01:32:54 +02:00
Moonchild 5cecc096a3 Issue #1821 - Pre-process AddonRepository.jsm 2022-04-14 22:13:57 +02:00
Moonchild 8feed35c61 Issue #1821 - Restore "dot" indicators
This also removes orange compat warning styling and associated strings.

Reverses the entirety of #1445
2022-04-14 20:03:05 +02:00
Moonchild 7b706516bc Issue #1821 - Revert "Issue #1744 - Remove the ability to accept Firefox
GUIDS (remove the dual system)"

This reverts commit 3aa334d0b7.
2022-04-14 20:02:49 +02:00
Moonchild 144b3844da Merge branch 'master' of https://repo.palemoon.org/MoonchildProductions/UXP 2022-04-13 20:41:37 +02:00
Moonchild eb96f030b9 Issue #1859 - Part 1: Update xz-embedded library.
This also updates the script for updating and README.
2022-04-13 20:40:56 +02:00
Moonchild 981154dc48 [network] Add non-overrideable default MIME types for js, jsm and json.
This ensures the browser always recognizes these file type extensions
appropriately, even if not otherwise registered in the system.
2022-04-13 15:44:41 +02:00
Matt A. Tobin a0da6b5b68 No Issue - Update mach langpack with -v 2022-04-13 15:37:31 +02:00
trav90 bd99ce1461 Issue #1531 - Bump minimum required GCC version to 7.1 2022-04-12 10:06:02 -05:00
Moonchild bed3776982 Merge pull request 'Re-enable building of any XUL application via UXP toolkit' (#1856) from g4jc/UXP-contrib:build_blocker into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1856
Reviewed-by: Moonchild <moonchild@palemoon.org>
2022-04-12 02:53:43 +00:00
Gaming4JC ef236bef4f Re-enable non-comm-style XUL application builds with a warning
A check was placed here to ensure the platform is built comm-style e.g. 'your-application/UXP'. There are packaging instances where old-style is still used. This re-enables the old-style with a visual warning indicating that any failure is the responsibility of the application maintainter as this style is not supported by the platform.
2022-04-11 21:57:22 -04:00
Moonchild d90ce1e30a Merge pull request 'Follow-up: Remove grid preference check from developer tools' (#1855) from FranklinDM/UXP-contrib:work_css-grid-pref-followup into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1855
2022-04-09 15:49:48 +00:00
FranklinDM bee1a6fe1c Issue #1838 - Follow-up: Remove grid preference check from developer tools 2022-04-09 22:15:18 +08:00
Moonchild f9caae6cfd Fix Mesa check + whitespace 2022-04-09 01:59:40 +02:00
Moonchild e10f9df9df Fix typo 2022-04-09 01:59:02 +02:00
Moonchild 7d87b7a270 [devtools] Restrict sourcemap URLs 2022-04-09 01:25:04 +02:00
Moonchild 3d43617bc1 [xpcom] xpcom Threadpool cleanup
Make sure thread locks are in place to guard accesses.
2022-04-09 00:33:41 +02:00
Moonchild ac9fdbf123 [js] Fix AliasSet of MLoadTypedArrayElementHole 2022-04-09 00:31:18 +02:00
Moonchild e6101f7fa6 No issue - Avoid WebGL crash on Mesa
This prevents too high vert-count draws that Mesa doesn't handle.
2022-04-08 22:55:27 +02:00
Moonchild 52bcfa36bf [XPCOM] xpcom/threads misc cleanup 2022-04-08 21:54:05 +02:00
Moonchild 6d9b8e43bf [NSS] Update NSS to 3.52.4 2022-04-08 21:44:21 +02:00
Moonchild ae8cc0e398 Issue #1836 - Implement Selection.setBaseAndExtent() 2022-04-08 20:28:55 +02:00
Moonchild 7d49b154e2 Issue #1840 - Try to deal with bad website scripting loading/unloading modules.
Apparently Bing does rapid-fire loading/unloading of module scripts that
causes our attempts at resolving and initializing them to end up with
null fetched modules.
Returning null is probably a better way to handle this than crashing
on ms->ModuleRecord() ;-)
2022-04-08 20:23:10 +02:00
Moonchild d5ae68701b Merge pull request 'Implement 'content' keyword for 'flex-basis' property and address spec changes' (#1854) from FranklinDM/UXP-contrib:work_css-flex-basis-content into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1854
2022-04-08 16:08:33 +00:00
Moonchild 330b866f46 Merge pull request 'Land final NSS-gyp work' (#1850) from nss-gyp-work into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1850
2022-04-08 13:07:17 +00:00
Moonchild edcbb85f5e Update 7zSD. 2022-04-08 15:05:09 +02:00
Moonchild c683df5483 No issue - Always build MAR support.
Even when there is no updater.
2022-04-08 15:04:57 +02:00
Moonchild 8862a2ebf7 [NSS] check for missing signedData field and bump version 2022-04-08 15:04:27 +02:00
Moonchild 82fa1fbf14 [DOM IndexedDB] Increase intermediate byte storage maximum capacity. 2022-04-08 15:04:04 +02:00
Paul Adenot faec3f2140 [DOM media] Handle truncated ADTS and MP3 resources. 2022-04-08 15:03:54 +02:00
Moonchild ab5f44b61d [devtools] Escape backtick characters 2022-04-08 15:03:43 +02:00
Moonchild c332210793 [interface] Make Windows non-ePopupLevelTop popups respect owner z-order 2022-04-08 15:03:34 +02:00
Yaron Tausky 6709388785 Bug 1650214 - Cancel progress timer when shutting down FileReader
Not canceling the timer when run in a worker could lead to the timer firing
after the primary worker runnable finished running, leading to an assertion
failure in cycle collector code.
2022-04-08 15:03:24 +02:00
Moonchild 2829b9387b [interface] Hold a self-reference in nsDataObj. 2022-04-08 15:03:12 +02:00
Moonchild 1e1a1e5c71 [DOM] Stop treating XSLT meta refresh as a special snowflake thing.
It's just not healthy. It'll get delusions of self-importance and go rogue.
Next thing you know it'll start identifying as other elements.
2022-04-08 15:03:02 +02:00
Moonchild 55d1aa0748 [interface] Don't block size mode changes. 2022-04-08 15:02:54 +02:00
Moonchild 9fd02b65e1 [win system] Update the list of delayed-loaded dlls
Primarily for those who custom-install and somehow mess up directory permissions
exposing themselves to dll injection attacks.
2022-04-08 15:02:20 +02:00
Steve Fink e6a9d13e64 [js] Add dynamic check for valid serialized length 2022-04-08 15:00:02 +02:00
Matt A. Tobin 8832bfb62f No Issue - Don't build the layout recorder unless debug 2022-04-08 14:58:33 +02:00
Moonchild 44e35f67b4 Issue #1853 - Follow-up: extend attribution mapping to resize and corner
controls to allow themes to respond to scrollbar-width.

Also clean up the comments and whitespace a bit.
2022-04-08 00:57:11 +02:00
Moonchild 56d9003017 Issue #953 - Neuter the user-facing controls for e10s
This should prevent people using a massive footgun that would blow off
their entire legs. Requires appropriate FE changes.
2022-04-08 00:55:37 +02:00
Moonchild e49b80dba7 Issue #1853 - Map scrollbar-width to an element attribute.
By mapping this to an attribute, this allows browser themes to respond to
the various available scrollbar width settings in CSS.
2022-04-08 00:40:49 +02:00
Moonchild 834ded7d18 Issue #1852 - Undo Stylo nonsense that breaks body and frame margins.
This restores support for using HTML tag styling of margins on the body.
Reftests post bug still pass for dynamic changes, so does the newly-added
test for body margins and frames that tests the old styling method.
This also removes the reftest list for stylo testing for obvious reasons.
2022-04-08 00:27:44 +02:00
Moonchild c617545914 Issue #1822 - Follow-up: Remove reputation check leftovers from jsdownloads. 2022-04-08 00:23:23 +02:00
Moonchild ee4e449e04 Issue #21 - Remove MOZ_SERVICES_HEALTHREPORT from old-configure.
Also remove irrelevant references from build docs.
2022-04-08 00:10:55 +02:00
Moonchild fd51da7587 Issue #1851 - Update embedded emoji font to Twemoji 13.1 (TM 0.6.0) 2022-04-08 00:01:44 +02:00
Moonchild e1a982d677 No issue - Fix a potential autocomplete issue.
Account for the case where we don't have a tree view in selectedIndex
setter which may break future autocompletes.
2022-04-07 23:57:37 +02:00
Moonchild b76d12c2bd [XPCOM] Use swap in nsThread::SetObserver. 2022-04-07 23:56:24 +02:00
Moonchild 57dffbd698 [DOM] Align XHR requests with the spec. 2022-04-07 23:55:45 +02:00
Moonchild e0e12932bc [Docshell] Implement reload flood guard 2022-04-07 23:54:44 +02:00
Olli Pettay 9a1e152ba3 [Docshell] Close ContentViewer properly if initialization fails. 2022-04-07 23:53:44 +02:00
Moonchild a9046dcd55 [Network] Escape external protocol handler URLs 2022-04-07 23:52:40 +02:00
Olli Pettay c265d1cb7c [DOM] Don't try to create too large string buffers 2022-04-07 23:49:05 +02:00
Moonchild d61076d50e No issue - Minor performance improvement in BidiUtils 2022-04-07 23:48:24 +02:00
Moonchild 43bed4dad8 [DOM] Fix handling of text fragments 2022-04-07 23:47:40 +02:00
Moonchild 3a27ace545 No Issue - Further optimize MSVC linker configuration
Minor update to linker configuration to leverage optimal amount of
threads and folding for the linker for the build hardware used.
2022-04-07 23:43:06 +02:00
Moonchild d3cc8bc1ae Issue #21 - Remove calls to Services.telemetry and nsITelemetry
These calls would cause breakage without the supporting plumbing.
2022-04-07 23:35:02 +02:00
Moonchild 4f6406f033 Issue #1847 - Clean up gyp[_base].mozbuild for Android removal. 2022-04-07 15:50:39 +02:00
Moonchild ce1c300502 Issue #1847 - Fixes for SunOS 2022-04-07 15:45:41 +02:00
Matt A. Tobin 6a0d77b68c Issue #1847 - Update generate_certdata.py so it matches what this
version of NSS expects.
2022-04-07 15:45:01 +02:00
Matt A. Tobin 3ceb3ee7ef Issue #1847 - Get NSS gyp to understand disabling avx2 in freebl 2022-04-07 15:44:14 +02:00
Matt A. Tobin 3adf5e5d9c Issue #1847 - Transfer build configuration to gyp 2022-04-07 15:43:28 +02:00
Matt A. Tobin b2ad7e8ed9 Issue #1847 - Updates to handle NSS
Bug 1295937
2022-04-07 15:42:57 +02:00
Matt A. Tobin 3b48d984b2 Issue #1847 - Restore build/gyp.mozbuild to m-esr52 state.
To do: remove android stuff again at the end.
2022-04-07 15:42:13 +02:00
Moonchild 02afcba614 Merge pull request 'Use RTTI when building protobuf with GCC' (#1849) from trav90/UXP-contrib:build-system-work into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1849
2022-04-07 13:38:57 +00:00
Travis W aed6c5eb62 Issue #1846 - Use RTTI when building protobuf with GCC 2022-04-07 13:15:18 +00:00
Moonchild 429a4cd9d7 Merge pull request 'Restore method that moves downloaded data's part file' (#1848) from FranklinDM/UXP-contrib:work_safebrowsing-removal-followup into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1848
2022-04-07 10:37:33 +00:00
FranklinDM acf30bc5f4 Issue #1370 - Part 6: Update tests 2022-04-07 18:35:51 +08:00
FranklinDM ca38eaca70 Issue #1370 - Part 5: Regenerate developer tools' static CSS properties database 2022-04-07 18:35:51 +08:00
FranklinDM 567ba7ede6 Issue #1370 - Part 4: Treat flex-basis: content as max-content
This uses a different approach and builds upon the refactoring made in the 576eb6ee01fb9ee3669cad634b26473c2886cab1.

Partially based on https://bugzilla.mozilla.org/show_bug.cgi?id=1374540
2022-04-07 18:35:50 +08:00
FranklinDM 79b640795a Issue #1370 - Part 3: Implement content keyword for flex-basis property
Partially based on https://bugzilla.mozilla.org/show_bug.cgi?id=1105111
2022-04-07 18:35:49 +08:00
FranklinDM 0b75a2a787 Issue #1370 - Part 2: Remove redundant special-case code for treating flex-basis enum values as 'auto' in vertical axis
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1436881
2022-04-07 18:35:48 +08:00
FranklinDM b8d18bace6 Issue #1370 - Part 1: Refactor nsFrame to use a separate function for handling flex-basis
This removes the need to keep the `flex-basis` handling code of the ComputeSize* functions in sync since they both call the same function now for this purpose.
2022-04-07 18:35:42 +08:00
FranklinDM ecbe89cd7d Issue #1822 - Follow-up: Restore method that moves downloaded data's part file
This commit fixes the issue where all downloaded files are empty/zero-byte by creating a new `_move` method, which is called in place of the removed `_checkReputationAndMove` method.

In 6042fdd44c the reputation check for downloads was removed but that same method is also being used for moving the part file of completed downloads, which consequently broke all downloads except those without a part file, and made them empty since the actual downloaded file isn't being moved.
2022-04-07 18:18:52 +08:00
Jeremy Andrews a7bb296293 Issue #1824 - Use Bash to check if config.status is up-to-date on SunOS.
The Python script here claims it can handle any Bourne-compatible shell, but the detection logic here really only works with GNU Bash. Not that there are that many Bourne-compatible shell implementations to compare against...
2022-04-06 23:51:45 +02:00
Moonchild 7da587d0aa Issue #21 - Remove unused telemetry build variables.
Hard-code the values in AppConstants.jsm for compatibility, even if
nobody should actually be using this in extensions or what not.
2022-04-06 23:48:37 +02:00
Matt A. Tobin ac50292859 Issue #1845 - Remove Marionette from toolkit.mozbuild
It even seems this was always forced enabled. :?
2022-04-06 23:42:28 +02:00
Matt A. Tobin 633a742916 Issue #1845 - Remove Marionette from mach_bootstrap.py 2022-04-06 23:29:58 +02:00
Moonchild 63b8aaa495 Issue #1845 - Remove Marionette files 2022-04-06 23:28:22 +02:00
Moonchild 4897e3653a Issue #184 - Get rid of embedding/ios 2022-04-06 23:19:49 +02:00
Moonchild af32d0b7d1 Issue #1843 - Expand on WindowsVersion.h to add later versions.
Needs future cleanup because of way too many named individual functions
and redundancy.
2022-04-06 22:56:00 +02:00
Jeremy Andrews e6c662b5c6 Issue # 1824 - Restore NSDISTMODE, and have SunOS use it by default.
To make a long story short, there's an old flag called NSDISTMODE that
was never added to old-configure so it could be passed down through the
build system to all the places it needs to go nowadays if used in your
.mozconfig, but which still sort of works when set as an environment
variable. If you leave it unset, it uses relative symlinks. However, it
has two other modes. One of them is "copy" and the other is
"absolute_symlink." Copy simply copies the files into the directory, and
absolute_symlink attempts to use absolute symlinks instead of relative
ones.

I've been wondering for a while now if there was a way to make the
shared library files in `dist/bin` that we use `./mach run` against
*not* be relative symlinks, and this seems to be that elusive technique.

It seems to be a part of the institutional memory that was all but lost
shortly after Netscape went under. You mostly see a few references to it
in NSS, NSPR, and the Makefiles in the `config` directory. And also
there is one reference in a Makefile in the application directory, which
seems to explains why application executables themselves usually aren't
symlinks:

/platform/libs/nspr/src/pr/src/md/unix/Makefile.in#76
/platform/libs/nss/src/coreconf/UNIX.mk#34
/palemoon/app/Makefile.in#30
/platform/config/config.mk#396

My patch essentially revives NSDISTMODE and makes it work as intended
again, more or less. Some parts of the work are loosely inspired by this
bug that was never finished upstream, showing that Mozilla only
rediscovered it earlier this year while trying to disable symlinks in
dist/bin for WSL, as far as I can tell.

https://bugzilla.mozilla.org/show_bug.cgi?id=1699855
2022-04-06 00:04:36 +02:00
Moonchild 6abe7e7914 Issue #1795 - Don't try to pass a dash array of > 16 elements to ExtCreatePen.
According to MSDN documentation, the count of the style array passed to
ExtCreatePen is limited to 16. When we call ExtCreatePen with cStyle=17 or more,
it simply returns an error and the cairo surface used for printing is getting
into an error state, after which nothing further gets printed.
Instead of erroring out, this code change returns an unsupported status so that
cairo will provide fallback handling for it.
2022-04-05 19:42:46 +02:00
David Major 7ab66b1c6a Issue #1795 - Reapply bug 624198 fix that got lost in an upstream update. 2022-04-05 19:41:10 +02:00
Moonchild df3eed4ef9 Issue #1795 - Increase the MAX_FONT_SIZE limit applied in cairo_ft_font
to match the Thebes gfxFont size limit.

Also adds synching comments just to be sure.
2022-04-05 19:39:53 +02:00
Moonchild 804d0f6604 Issue #1795 - Add closure point to bounds calculation.
This addition of a closure point (explicitly completing the closed shape) isn't
strictly needed in our current cairo version as it works perfectly fine without,
but if our clipping extents code changes then this might cause problems if the
extra point isn't added (in case of 0-length paths).
2022-04-05 19:25:09 +02:00
Moonchild 327f5499ca Issue #1795 - Extend cairo API with an explicit font_get_hint_metrics function.
This extension allows us to get font hint metrics without having to create and
destroy cairo font options structs. Since this is used in loops, this will
improve performance, especially in documents which have many text segments.
2022-04-05 19:23:28 +02:00
Moonchild 97f911427a Issue #1795 - Remove support for building without DirectWrite. 2022-04-05 19:21:29 +02:00
Moonchild 3b575dfced Revert "Merge pull request 'Update libcubeb to latest version' (#1812) from athenian200/UXP:libcubeb_final into master"
This reverts commit 0bc66e3b04, reversing
changes made to 6e6b5d8996.
2022-04-05 17:00:28 +02:00
athenian200 0bc66e3b04 Merge pull request 'Update libcubeb to latest version' (#1812) from athenian200/UXP:libcubeb_final into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1812
2022-04-05 13:35:47 +00:00
Moonchild 6e6b5d8996 Issue #1795 - Update libpixman 2022-04-05 14:51:06 +02:00
Moonchild 12635c1c22 Merge branch 'master' of https://repo.palemoon.org/MoonchildProductions/UXP 2022-04-04 22:27:31 +02:00
Moonchild 4c0d99d173 Issue #457 - Silence warnings in libcairo and libpixman.
We know these issues exist due to it being old 3rd party code.
2022-04-04 22:22:24 +02:00
Moonchild 8399d85036 Issue #1841 - Part 3: Remove the Direct3D9 compositor. 2022-04-04 22:16:37 +02:00
Moonchild ef5083db5f Issue #1841 - Part 2: Remove D3D9 layer compositor references and
layer fallback code.
2022-04-04 22:15:34 +02:00
Moonchild cff9ef7fb8 Issue #1841 - Part 1: Ignore the values for D3D9 preferences, forcing
them to their current default, in preparation for the removal.
2022-04-04 22:14:00 +02:00
Moonchild 124a5a8eb7 Issue #457 - Fix double -> float warning in gfxUtils. 2022-04-04 22:08:36 +02:00
Moonchild a9376e01cb [layout] Hold strong references to delayed menu command events. 2022-04-04 22:07:00 +02:00
Moonchild 8884db9790 [DOM/XSLT] Pass sandbox flags from source doc. 2022-04-04 22:06:43 +02:00
Moonchild 28a69cf1e2 Use brace initialization for Atomics.
Remind me to always build BEFORE committing :P
2022-04-04 22:06:25 +02:00
Moonchild bdfc1adbd2 [network] Make several variables atomic in nsSocketTransport2.
Fixes potential thread races between:
- nsSocketTransport::OnInputClosed and nsSocketTransport::OpenInputStream.
- nsSocketTransport::OnOutputClosed and nsSocketTransport::OpenOutputStream.
- nsSocketTransport::Close and nsSocketTransport::RecoverFromError called from
  OnSocketDetached.
2022-04-04 22:06:07 +02:00
Moonchild f990d9a46a [network] Use a COM pointer instead of NS_ADDREF in nsSocketTransport2.cpp 2022-04-04 22:05:50 +02:00
Moonchild 497e453fe7 [network] Align IDN normalization with the current spec. 2022-04-04 22:05:33 +02:00
Moonchild 7dec0edf50 [network] Tighten checks for ACE (punycode) encoding. 2022-04-04 22:05:15 +02:00
Moonchild 97ee3ee428 [network] Clean up IDN logic and add some corner case use. 2022-04-04 22:04:54 +02:00
Moonchild 18cfe514ab Merge branch 'master' of https://repo.palemoon.org/MoonchildProductions/UXP 2022-04-04 17:34:00 +02:00
Moonchild 15aafa8a46 Revert "Issue #1806 - Part 1: Update cubeb"
This reverts commit 711e049432.
2022-04-04 17:33:26 +02:00
Moonchild 757a30f720 Revert "Issue #1806 - Part 2: Adjust the platform for lib changes"
This reverts commit 3635039d2b.
2022-04-04 17:33:15 +02:00
Moonchild 78d1f68932 Merge pull request 'Support updated box alignment spec on gap properties' (#1839) from FranklinDM/UXP-contrib:work_css-boxalign-gap into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1839
2022-04-04 01:47:29 +00:00
FranklinDM b226f8942d Issue #1838 - Part 7: Update tests 2022-04-02 23:14:36 +08:00
FranklinDM f1c2ba75d1 Issue #1838 - Part 6: Re-resolve row-gap against the sum of row track sizes for auto-sized grid containers
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1458902
2022-04-02 23:14:30 +08:00
FranklinDM f3707e0637 Issue #1838 - Part 5: Address follow-up issues to initial flexbox layout for (column|row)-gap properties
Notes:
* Bug 1473044 - Make flexbox cross size take row/column gap into account
https://bugzilla.mozilla.org/show_bug.cgi?id=1473044
* Bug 1473047 - Re-resolve row-gap percentages after intrinsic block size calculated
https://bugzilla.mozilla.org/show_bug.cgi?id=1473047
* Bug 1612401 - Prevent absolute-positioned children from contributing gap size to flexbox's inline-size
https://bugzilla.mozilla.org/show_bug.cgi?id=1612401
* Bug 1639627 - Make flex-container percent 'row-gap' values resolve to 0, when they're resolved against an indefinite block-size (essentially reverts Bug 1473047)
2022-04-02 23:14:25 +08:00
FranklinDM ed8d7f1391 Issue #1838 - Part 4: Implement flexbox layout for (column|row)-gap properties
This implements flexbox layout for the gap properties without the refactoring work performed on `nsFlexContainerFrame`.

Partially based on https://bugzilla.mozilla.org/show_bug.cgi?id=1398483 and https://bugzilla.mozilla.org/show_bug.cgi?id=1454822

This excludes the second part of bug 1454822, the width caching implementation, because it is out of scope and currently causes unstable layout with `writing-mode: vertical-lr` (see bug 1709937).
2022-04-02 23:14:18 +08:00
FranklinDM 7e975c2c5b Issue #1838 - Part 3: Regenerate developer tools' static CSS properties database 2022-04-02 23:14:09 +08:00
FranklinDM 4608ae53aa Issue #1838 - Part 2: Remove grid- prefix from grid-(column|row)-gap properties
This removes the `grid` prefix from the gap-related properties of grid since they are now part of the box alignment specification. Former grid-gap* properties were aliased to the unprefixed properties to maintain compatibility.

The previously multi-column layout only `column-gap` property has been modified to apply to the Grid layout (and Flexbox in a following commit), moving the `mColumnGap` member variable from `nsStyleColumn` to `nsStylePosition`.

Notes:
* Bug 1398537 - support for percent values in column-gap for multi-column layout landed as part of Issue #1230. However, it was incomplete because it did not update `nsRuleNode` to allow transformation of percentage values for `column-gap`. This was consequently fixed as part of this commit.
* Bug 1456166 - this might not apply because we don't have that devtools test in UXP
* `nsRuleNode`, `nsCSSParser`, `Declaration`, and other related classes were merged into Stylo. These should be taken into consideration when porting patches from Mozilla.

Partially based on https://bugzilla.mozilla.org/show_bug.cgi?id=1398482
2022-04-02 23:14:04 +08:00
FranklinDM 121ee9438c Issue #1838 - Part 1: Remove CSS grid preference
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1398492
2022-04-02 23:13:54 +08:00
Moonchild ba4eba034f Issue #21 - Remove telemetry from PopupNotifications.jsm. 2022-04-02 14:51:59 +02:00
Moonchild 534de5cc5b Issue #21 - Remove remaining telemetry structs, callers and flags. 2022-04-02 14:49:45 +02:00
Moonchild 023a71c6f2 Issue #21 - Remove Telemetry from Accessibility, EME and WebRTC. 2022-04-02 14:48:02 +02:00
Moonchild c83282fd4d Issue #21 - Remove Telemetry from Push and devtools. 2022-04-02 14:45:36 +02:00
Moonchild d60103257e Issue #21 - Remove Telemetry accumulation/structures from toolkit js.
This fixes toolkit modules and prevents toolkit component breakage.
Also removes about:telemetry
2022-04-02 14:42:57 +02:00
Moonchild ee86d3eb9c Issue #21 - Remove Telemetry plumbing and fix build.
Note this won't give working applications. Requires FE changes and
additional js module changes (next part).
2022-04-02 14:39:54 +02:00
Moonchild d0acadd727 Issue #1806 - Follow-up: Fix WebRTC issues with cubeb update. 2022-04-02 14:36:54 +02:00
Matt A. Tobin 9a811901ef No Issue - Make building the backend fun again! 2022-04-02 14:27:46 +02:00
Matt A. Tobin 4a7af0d90f Issue #1835 - Part 2: Remove config and most mentions of XULRunner
Resolves #1835
2022-04-01 17:33:23 +02:00
Matt A. Tobin 0f52679d2e Issue #1835 - Part 1: Remove /xulrunner application dir. 2022-04-01 17:27:20 +02:00
Moonchild e00bc543ad [No issue] Don't rely on nsCRT from jsdate. 2022-04-01 17:19:24 +02:00
Jeremy Andrews 1e8c040307 No Issue - Clean-up stray right parenthesis 2022-04-01 17:17:29 +02:00
Moonchild 7c90c0205c Issue #1822 - Part 4: Remove URL classifier and internal blocklist errors.
This removes NS_ERROR_{TRACKING|MALWARE|PHISHING|UNWANTED|BLOCKED}_URI
that are no longer in use.
2022-04-01 16:05:02 +02:00
Moonchild a95439db61 Issue #1822 - Part 3: Remove LOAD_CLASSIFIER_URI and various
helper functions.
2022-04-01 16:03:01 +02:00
Andrea Marchesini f5fcb8a32c Issue #1833 - Get rid of ArchiveReader API 2022-04-01 15:53:22 +02:00
Moonchild ce0cefe053 Issue #1053 - Second pass remove android defines and build system stuff.
Mostly IPC, tools and mozbuild.
2022-04-01 15:47:43 +02:00
Matt A. Tobin 35e7103093 No Issue - Remove Mozilla source tree bootstrapping python module
Part of Mozilla's DaaS, "bootstrapping" the tree is heavily dependent on
Mozilla infrastructure, m-c structure and dependencies, libs, toolchain,
etc. and would never work for us. Sweeping some clutter, in other words.

This copies in a function that was imported from mozboot to satisfy deps.
2022-04-01 15:35:04 +02:00
Moonchild 426a9755d9 Issue #1053 - Remove Android systrace, more build system removals.
Also updates more comments.
2022-04-01 15:28:15 +02:00
Moonchild c14bb310ce Issue #1053 - Clean up docs and some code comments.
Polish only, no code changes.
2022-04-01 15:26:49 +02:00
Moonchild ccee5c781b Issue #1053 - Remove android-ndk from mozconfigure. 2022-04-01 15:25:14 +02:00
Moonchild d5934d65de Issue #1053 - Remove some Android compiler/runtime bug workarounds. 2022-04-01 15:23:31 +02:00
Moonchild 39f9ab375b Issue #1053 - Remove /dom/system/android and dependent modules,
as well as robocop.
2022-04-01 15:22:15 +02:00
Moonchild 28a3cd1028 Issue #1053 - First pass Android defines and remove Android Annotation
processors, some Andoid packaging stuff, Eclipse IDE support et al.
2022-04-01 15:17:54 +02:00
Moonchild f987138760 Issue #1053 - Remove Android WebGL/EGL extensions. 2022-04-01 15:16:42 +02:00
Moonchild 1803c596dc Issue #1822 - Part 2: Remove Google API key parsing in URLS. 2022-04-01 15:12:20 +02:00
Moonchild 6042fdd44c Issue #1822 - Part 1: Remove Google Safebrowsing plumbing
This removes support for querying Google services for reputation data
for sites and downloads.
2022-04-01 15:10:04 +02:00
Jeremy Andrews c56023163b Issue #1832 - Account for shadow boundaries in nsFrameManager.
Resolves #1832
2022-04-01 15:00:11 +02:00
Moonchild 1caa678592 Issue #1831 - Add an option to enable TLS 1.3 "compatibility" mode.
Critical note: this potentially reduces the strength of TLS 1.3 and
should only be enabled if absolutely necessary to access a site.
A browser restart is required for the pref change to take effect as it
is set on NSS initialization.

Resolves #1831
2022-04-01 14:52:46 +02:00
Moonchild ddaee7c1be Issue #1830 - Remove --disable-xul config and conditionals. 2022-04-01 14:47:16 +02:00
Moonchild c030a50228 Issue #1721 - Implement GlobalPrivacyControl
(and get rid of failed DoNotTrack)
2022-04-01 14:41:51 +02:00
Moonchild e4c6db86b8 [WebRTC] Clean up encode callback during GMP release. 2022-04-01 14:40:31 +02:00
Moonchild a7b63631b0 No issue - Clean up some obsolete/archaic code paths. 2022-04-01 14:38:31 +02:00
Matt A. Tobin cdff23ad0b Bug 1340030 - Remove necko_standalone lib
The only users of this library were removed by Bug 1239866 and Bug 1239870 as part of the larger removal of libxpcomrt in Bug 1237409.

This was done before our fork point..
2022-04-01 14:32:45 +02:00
Matt A. Tobin 3635039d2b Issue #1806 - Part 2: Adjust the platform for lib changes 2022-04-01 14:31:39 +02:00
Matt A. Tobin 711e049432 Issue #1806 - Part 1: Update cubeb 2022-04-01 14:29:58 +02:00
Moonchild 57c4f24573 [Autocomplete] Add styling for Pale Moon's private-* implementation of AC popups 2022-04-01 14:28:46 +02:00
Moonchild 808f96cc8f Increase MAX_ICON_SIZE to account for more common use of HiDPI icons.
This change was unintentionally reverted when importing gecko/44 search service
code.
2022-04-01 14:28:27 +02:00
Olli Pettay 2a9d0cc5af [XPCOM] be more precise when counting the number of allocator users
This patch is based on code inspection.
One could also move sAllocatorUsers to Free(), but it shouldn't matter
in practice.
2022-04-01 14:28:04 +02:00
Moonchild 1fa4cfb004 [Network] Block mk: protocol to work around MSIE vulnerability. 2022-04-01 14:27:48 +02:00
Moonchild 44d2b36eff [DOM] Use RefPtr in ContentChild::RecvGetFilesResponse. 2022-04-01 14:27:25 +02:00
Jeremy Andrews bb830b178a Issue #1806 - Convert DOS line endings to Unix line endings.
When redoing my work and creating a new file on Windows, I forgot to ensure it didn't have CRLF line endings.
2021-08-27 14:24:40 -05:00
Matt A. Tobin c6b1b30bb5 Issue #1751 - Fix preprocessor typo to restore ARM Linux buildability 2021-08-25 18:47:59 -04:00
Jeremy Andrews 5f1430b0bd Issue #1806 - Part 8: Fix Linux and SunOS build again.
The patches didn't reapply for some reason, so this restores the working state.
2021-08-24 17:52:06 -05:00
Jeremy Andrews b818d43967 Issue #1806 - Part 7: Fix up weird issue introduced when redoing branch.
Apparently this time I accentally pulled a random + and - sign into a couple files because I wasn't careful to look at the raw versions on Bugzilla.
2021-08-24 17:19:47 -05:00
Jeremy Andrews a21085b86b Issue #1806 - Part 6: Make it build on Windows.
Without this change, you get an error about external linkage or something. These files are now used outside of WebRTC.
2021-08-24 16:15:22 -05:00
Jeremy Andrews 89c3761e5c Issue #1806 - Part 5: Add multichannel audio capability.
I'm positive this works on Windows at the very least. Cubeb added proper channel map support at some point, and this allows us to take advantage of that.

Ref: BZ 1431221, BZ 1432779
2021-08-24 16:07:22 -05:00
Jeremy Andrews 893fc90379 Issue #1806 - Part 4: Add more audio troubleshooting information.
This should help us troubleshoot audio issues better in the future in general, since we'll know more about the hardware involved, etc.
2021-08-24 14:35:49 -05:00
Jeremy Andrews 41b1b3947c Issue #1806 - Part 3: Allow forcing a particular libcubeb backend.
This streamlines troubleshooting in situations where multiple audio backends are compiled into the binary. Now testing different audio backends is as simple as restarting the browser and changing a pref rather than requiring a full recompile.
2021-08-24 13:42:09 -05:00
Jeremy Andrews c23dab7adc Issue #1806 - Part 2: Move AudioConfig stuff from MediaInfo.h to MediaData.h.
This avoids circular dependencies, because otherwise the two headers would try to include each other.
2021-08-24 13:12:43 -05:00
Jeremy Andrews cc75c6a6e9 Issue #1806 - Part 1: Restore libcubeb update.
Restore the proper working environment for libcubeb work after reversion.
2021-08-24 10:38:44 -05:00
Moonchild ee49838173 Revert "Issue #1806 - Update libcubeb"
This reverts commit 741fd8b61c.
2021-08-22 17:39:55 +00:00
Moonchild a725c0fe3d Revert "Issue #1806 - Follow-up: New libcubeb uses incorrect audio backend for Oracle Solaris."
This reverts commit 9d4f14582b.
2021-08-22 17:39:42 +00:00
Moonchild 5d09ddb574 Revert "Issue #1806 - Follow-up: Restore PulseAudio support in libcubeb."
This reverts commit 0c2a0f45ec.
2021-08-22 17:39:29 +00:00
Moonchild 0c2a0f45ec Issue #1806 - Follow-up: Restore PulseAudio support in libcubeb.
This was incorrectly removed because we aren't using a Rustified abstraction.
2021-08-21 08:10:13 +00:00
Coordinator Tobin 4ac28d1d48 Merge pull request 'Follow-up: New libcubeb uses incorrect audio backend for Oracle Solaris.' (#1809) from athenian200/UXP:use_sun_audio into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1809
2021-08-19 02:37:04 +00:00
Jeremy Andrews 9d4f14582b Issue #1806 - Follow-up: New libcubeb uses incorrect audio backend for Oracle Solaris.
Mozilla picked up a change to libcubeb moz.build file from the FreeBSD project. Using OSS directly works fine in Illumos, but Oracle Solaris still has to use a Sun-specific API for sound to work, even though it also uses OSS under the hood. No code changes are needed here, the build configuration is just not what Solaris needs even though it's fine for Illumos. The Sun-specific API works for both, though, and should thus be preferred.
2021-08-18 17:24:13 -05:00
Moonchild a5a14974a1 Issue #1797 - Implement WindowOrWorkerGlobalScope.origin
Resolves #1797
2021-08-15 11:45:53 +00:00
Moonchild 9baa17379e Bump platform version. 2021-08-13 09:43:04 +00:00
Moonchild 225b5e5e5a [db] Update SQLite to 3.36.0 2021-08-13 09:41:57 +00:00
Moonchild 741fd8b61c Issue #1806 - Update libcubeb
This is a full lib update, changing callers where needed.
This also moves GertCubeMSGLatencyInFrames to CubebUtils.{cpp|h} where it
belongs.
2021-08-12 14:14:18 +00:00
Jens Stutte fe2ea0ce88 [DOM] Be more explicit about the WorkerPrivate self-reference. 2021-08-12 11:39:07 +00:00
Moonchild fa49002626 [MFBT] Convert debug asserts to early returns for situations that should
never occur.
2021-08-12 11:30:26 +00:00
Moonchild ca1a84cb93 [DOM/NPAPI] Defer loading object when setting attribute. 2021-08-12 00:27:34 +00:00
Moonchild 61a3331fe2 [network] Use a proof of lock everywhere in cache v2. 2021-08-11 23:49:44 +00:00
Moonchild 4932924d67 Issue #1675 - Move regexp to new-regexp to make bz porting simpler. 2021-07-30 11:24:18 +00:00
Moonchild 66cd46d9bc Issue #1679 - Part4: Clean up commented-out/WIP code. 2021-07-30 09:58:15 +00:00
Moonchild 979c60bc7c Issue #1679 - Part 3: Make everything build on supported compilers. 2021-07-30 09:43:28 +00:00
Moonchild 6203743160 Issue #1781 - Follow-up: fix debug assert in MergeMultiplicativeR() 2021-07-24 06:42:30 +00:00
Moonchild 738448aa0d [no issue] Replace PurpleBlock with SegmentedVector to reduce indirect memory
accesses when calling suspect

Improves overall memory performance.
Also prerequisite for further work on #1677.
2021-07-23 15:29:24 +00:00
Moonchild 74989fb284 Merge pull request 'Implement Promise.allSettled()' (#1796) from athenian200/UXP:Promise-allSettled into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1796
2021-07-18 17:03:03 +00:00
athenian200 22377b86a3 Merge branch 'master' into Promise-allSettled 2021-07-15 16:21:00 +02:00
Jeremy Andrews 5764d0c28d Issue #1725 - Fix logic in PerformPromiseAllSettled.
This function essentially appears to work as written, there was an issue with it returning false too early in some situations that prevented it from working properly.
2021-07-15 03:08:11 -05:00
Moonchild c198ef11b9 [layout] Ensure we set the primary frame for native anon content where needed. 2021-07-15 04:11:48 +00:00
Moonchild caf98496b7 Revert "[accessibility] Remove selection listeners from shutting down PresShell."
This reverts commit 684000d9a5.
2021-07-14 17:30:58 +00:00
Eitan Isaacson 684000d9a5 [accessibility] Remove selection listeners from shutting down PresShell. 2021-07-14 16:40:33 +00:00
Moonchild 00f9e24368 [gfx] Hard-block old mesa/nouveau versions 2021-07-14 15:15:14 +00:00
Dana Keeler 361743b222 [NSPR] Lock access to PRCallOnceType members in PR_CallOnce* for thread safety.
Cherry-picked upstream fix from 4.31
2021-07-14 14:42:24 +00:00
Moonchild ce2938d274 [ANGLE] Cherry-pick upstream fix 2021-07-14 13:51:11 +00:00
Valentin Gosu 6fe78cec8a [network] Make CacheIOThread::ThreadFunc hold reference to thread. 2021-07-14 13:27:14 +00:00
Moonchild 8cc2f6ba9b [network] Add some sanity checks to deserialized nsStandardURLs
Note: C++ lambda expressions are actually useful for once.
2021-07-14 13:20:09 +00:00
Moonchild 8ea119da4a [network] Stop blocking 10080
Port 10080 is shared by too many devices and services that do need http(s)
access, so this port should not be blacklisted by default.
2021-07-14 01:51:13 +00:00
Moonchild f864b515d9 WIP: Base implementation 2021-07-13 20:09:21 +00:00
Matt A. Tobin 3003f52e1d Issue #1793 - Only use Glass on the Toolkit Download Manager on Windows 7 2021-07-12 13:11:40 -04:00
Matt A. Tobin cc934f8264 Issue #1793 - Only use proper Aero Styling in the Toolkit Error Console on Windows 7 2021-07-12 13:00:51 -04:00
Matt A. Tobin 1327910cda Issue #1793 - Add a border-bottom to treecols header 2021-07-12 12:58:30 -04:00
Matt A. Tobin 3b7f2ddd3c Issue #1793 - Add a border-bottom to toolbox
Follow-up to e8be661944
2021-07-12 12:57:39 -04:00
Moonchild 82b1fdca1f Issue #1792 - Part 4: Implement constructors for the EventTarget interface. 2021-07-12 03:06:58 +00:00
Moonchild 1b86eb76fc Issue #1792 - Part 3: Add ConstructibleEventTarget helper class.
Of course it couldn't be trivial :P
wrapObject is a pure virtual function which prevents an abstract constructor
from being used.
So, we need to extend DOMEventTargetHelper (applicable acronym: DETH :D) with
a wrapObject implementation - in a derivative class is the clearest way to do
this, as opposed to making DETH more complex.
2021-07-12 03:04:29 +00:00
Moonchild ea0e4de698 Issue #1792 - Part 2: Move GetParentObject() to EventTarget.h for re-use. 2021-07-12 02:56:48 +00:00
Moonchild 6e7adbe74d Issue #1792 - Part 1: Remove superfluous check for abstract ancestors.
This removes some restrictions on whether an interface that implements
QueryInterface can have a non-abstract ancestor.

This restriction was put in place back when we automatically added
QueryInterface to all rootmost non-abstract interfaces (~Pale Moon 24).
At the time, we needed to make sure it did NOT end up on EventTarget, because
back then WebIDL quickstubs would replace the QI implementation on non-WebIDL
EventTargets with the WebIDL one, which would not work for them.

Since then, we have removed WebIDL quickstubs and we now explicitly list which
interfaces get QueryInterface, so this check is no longer needed.
2021-07-12 02:54:51 +00:00
Moonchild a58b35c01b Issue #1757 - Follow-up: Remove some stray WPT leftovers.
These were re-introduced when reverting the <details> element pref changes.
2021-07-12 02:50:57 +00:00
Moonchild 5e6305573f [network] Stop treating http and https as different for encoding schemes.
There is no reason to treat available encoding schemes for these protocols
differently.
2021-07-10 13:00:14 +00:00
Moonchild 3163b3af18 [network] Enable brotli compression on http for sites that offer it. 2021-07-06 03:07:36 +00:00
Moonchild 1fb9257ed8 [toolkit] Slightly lighten light-mode logopage background 2021-07-05 18:40:09 +02:00
Moonchild 72d0b86709 [Toolkit] Update logopage styling.
Part of the UX refresh Pale Moon effort. This uses the new -moz-dark-theme media
query to make the logopage dark if the UI is dark, without explicitly relying on
(often not sane) system color values.
2021-07-01 17:48:58 +00:00
Moonchild 2215d8467e Issue #1751 - Remove Mac/ARM C fallback on gcc from pixman 2021-06-25 19:25:29 +00:00
athenian200 a0461e3775 Issue #1784 - Add -moz-dark-theme media query and allow prefers-color-scheme to follow it. 2021-06-22 18:14:44 +00:00
Matt A. Tobin 4490f61f58 [Toolkit] Attempt to initialize DownloadTaskbarProgress when onDownloadWindowLoad() is called so that DownloadTaskbarProgress from the Downloads Manager window works when the application doesn't explicitly invoke onBrowserWindowLoad(). 2021-06-22 01:54:11 -04:00
Moonchild 1fe9c19305 Issue #1751 - Remove Mac code behind MOZ_WIDGET_TOOLKIT == 'cocoa' 2021-06-21 17:52:42 +00:00
Moonchild 5afcb4a092 [whitespace] Fix CRLF line endings.
When originally implementing ResizeObserver, line endings ended up being CRLF
instead of LF. This commit fixes those line endings (no code changes)
2021-06-21 00:40:58 +00:00
Moonchild 8689ac6304 Bump platform version 2021-06-19 23:02:06 +00:00
Moonchild 014fdd0521 Merge branch '1783' 2021-06-19 23:00:12 +00:00
New Tobin Paradigm 2c626f6046 Merge pull request 'Support detecting bool preferences in chrome stylesheets' (#1785) from athenian200/UXP:bool-chrome-stylesheets into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1785
2021-06-19 20:40:11 +00:00
Jeremy Andrews 4dac05e0e0 Issue #1776 - Support detecting bool preferences in chrome stylesheets
This functionality was already added to Gecko for UA stylesheets allow the "dom.details_element.enabled" preference to work. I changed the condition to allow bool preferences to be used in chrome stylesheets as well.
2021-06-19 15:01:08 -05:00
Moonchild cfdfbcf059 Issue #1783 - Part 3: Remove ResizeObservation's BroadcastSize.
This is chrome-only and unused, and interfered with getting the spec update in.
2021-06-19 15:40:37 +00:00
Moonchild 6f7dd6fd98 Issue #1783 - Part 2: Update ResizeObserver and resizeObserverSize.
This adds the later spec revision's contentBoxSize and borderBoxSize, and the
inlineSize and blockSize concepts.
The older spec contentRect remains functional as well for backwards
compatibility with the earlier spec (that was IMHO perfectly fine as it was...)
2021-06-19 15:38:14 +00:00
Moonchild 22a75217e1 Issue #1783 - Part 1: Move GetNodeDepth to ResizeObserver.cpp
GetNodeDepth() is a specialized version for ResizeObserver to get the depth of
a node across Shadow DOM. It's better to have this in ResizeObserver.cpp
instead of the generic ContentUtils.

Also updated the function to bypass the shadow root itself and not count it
because ResizeObserver doesn't observe the shadow root and only needs the
relative depths among all observed targets. IOW we use the flattened tree here.
2021-06-18 17:44:33 +00:00
Moonchild a970411caf Issue #1782: Remove Luna, Royale and Zune support from the platform.
These are obsolete system themes; the platform will fall back to generic/unknown
theme support instead.
2021-06-14 11:52:16 +00:00
Matt A. Tobin e8be661944 [Toolkit] Don't use the "aero" msstyle provided toolbox background on Windows 10 2021-06-12 13:13:08 -04:00
Moonchild 5ab5ce9c4f Issue #1781 - Part 3: Add reftest for the static calc() case. 2021-06-12 11:54:09 +00:00
Moonchild 205e69e2bb Issue #1781 - Part 2: Fix animation interpolation for stroke-dashoffset.
Since we have calc() and floats working now, this is a trivial fix.
2021-06-12 11:36:16 +00:00
Moonchild c337c1496b Issue #1781 - Part 1: support calc() in stroke-dashoffset CSS
This adds basic calc() support to stroke-dashoffset. It does not provide
CSS animation (yet, todo for part 2)
2021-06-12 01:12:39 +00:00
Moonchild 7f6f1c664d [js] Fix porting typo
Follow-up for 9acd98298c
2021-06-03 00:23:41 +00:00
Jan de Mooij 9acd98298c [js] Fix invalid early return in BaselineFrame::trace.
We were not tracing debugger environments for Baseline frames without any
local/expression slots.
2021-06-02 10:29:47 +00:00
Moonchild ce71c0fe3f [toolkit] Exclude printer spew from troubleshooting information.
In almost all cases this is pointless to include, a ton of useless entries,
and there's no reason to have people post a full enumeration of installed
printers on their system when asked for TS information.
If there's a printer specific issue, people can always be asked to post relevant
info manually.
2021-06-02 09:44:59 +00:00
Matt A. Tobin 42cf1ad419 Issue #1774 - Add metrics to the editable menulist-button for GTK3 2021-05-31 18:55:45 -04:00
Moonchild 6272d48e86 Revert "Issue #1774 - Make menulist-button visible again in gtk3"
This reverts commit 0a0830ba8b.
2021-05-31 17:56:30 +00:00
Moonchild 27e7b312a5 Merge pull request 'Issue #1774 - Make menulist-button visible again in gtk3' (#1775) from jobbautista9/UXP:master into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1775
2021-05-31 15:30:27 +00:00
Job Bautista 0a0830ba8b Issue #1774 - Make menulist-button visible again in gtk3 2021-05-31 22:59:39 +08:00
Moonchild c921ad59d5 Issue #1772 - Stop using legacy code page conversion for file paths on Linux.
OS.File already only supports UTF-8 paths on non-Windows systems, so this change
makes our different ways of accessing file paths consistent with each other.
This should prevent unexpected crashes in glibc that expect UTF-8.

This resolves #1772.
2021-05-14 12:25:57 +00:00
Moonchild 349346d0b7 Revert "Issue #21 - Remove TelemertyVFS"
This:
- reverts commit 83ecae9ff7
- adds a failure check to Connection::GetQuotaObjects

This resolves #1768.
2021-05-14 10:50:53 +00:00
Moonchild e983389355 [network] Fix typo in port blocking range check.
This fixes a typo in 5e705bd505
2021-05-12 20:25:55 +00:00
Moonchild 2b7197465d Merge pull request 'Fix undefined event error thrown when scrolling on the auto scroll pop-up' (#1771) from FranklinDM/UXP:scroll-wheel-event-work into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1771
2021-05-12 14:20:11 +00:00
FranklinDM 5c583e905e Issue #1770 - Fix incorrect reference to event parameter 2021-05-12 14:21:12 +08:00
Moonchild 1ee35eafa0 Issue #1751 -- Remove cocoa and uikit gfx and hal support code 2021-05-09 21:36:43 +00:00
Moonchild b5ece9f771 Issue #1751 -- Update crashtests 2021-05-09 00:29:23 +00:00
Moonchild 08da125d9c Issue #1751 -- Remove cocoa and uikit widget support code 2021-05-08 21:00:49 +00:00
Moonchild ca35efb84e Issue #1751 -- Remove cocoa support code from /dom 2021-05-08 20:59:55 +00:00
Moonchild e7e63565ee Issue #1751 -- fix up a few stray #ifs 2021-05-06 16:47:48 +00:00
Moonchild 6f707bde95 Issue #1751 -- Remove XP_MACOSX conditionals from the rest of the tree.
This also removes some PP abuse and takes file entries out of PP when no longer
needed without XP_MACOSX conditionals.
2021-05-06 09:24:03 +00:00
Moonchild aa0fd3d68c Issue #1751 -- Remove XP_MACOSX conditionals from /layout 2021-05-03 12:26:37 +00:00
Moonchild 1bf0734a72 Issue #1751 -- Remove XP_MACOSX conditionals and support files from /xpcom 2021-05-03 11:35:41 +00:00
Moonchild b1eb04d3f0 Merge branch '1767' 2021-05-02 20:28:54 +00:00
Moonchild 616b39413d Issue #1751 -- Remove XP_MACOSX conditionals and support files from /gfx 2021-05-02 20:28:36 +00:00
Moonchild cd1f724135 Issue #1751 -- Remove files unused without XP_DARWIN 2021-05-02 07:11:32 +00:00
Moonchild 3d671e4275 Issue #1751 -- Remove XP_DARWIN 2021-05-02 07:10:18 +00:00
Moonchild 56da7e2747 Issue #1751 -- Remove XP_IOS 2021-05-01 07:15:13 +00:00
Moonchild 0dd3424f77 Issue #1751 -- Remove XP_MACOSX conditionals from /dom 2021-04-30 21:22:08 +00:00
Moonchild 4e31a42b28 Issue #1767 - Prevent incorrect calling of network change detection function.
This rewrites the websocket channel network change detection function to not
skip part of its logic in a situation that has already been checked, preventing
a thread race. See analysis of the problem in the issue.
2021-04-26 10:26:22 +00:00
Moonchild 5e705bd505 [Network] Solve type mismatch in AllowPort().
Casting it to an int16_t was wrong and would preclude the check for high port
numbers (due to overflow).
This makes the type matching, but adds an explicit check to ensure the port
number passed in is within a valid range.
2021-04-20 13:12:38 +00:00
Jeff Gilbert 88a34442a3 [WebGL] Bind framebuffer before DrawBuffers/ReadBuffer selection. 2021-04-20 12:46:56 +00:00
Moonchild cf3b5cb6cc [DOM] Add missing IDL definitions for CSP .nonce attributes.
Apparently Mozilla completely spaced out on this when adding the CSP nonce
mechanism, potentially causing web compat issues if scripting relies on
being able to get/set nonces through DOM and/or causing CSP policy check
issues if websites try to "hide" nonces.
2021-04-19 20:47:29 +00:00
Moonchild 6f50c402b3 Merge pull request 'Allow use of Tauthon instead of Python 2.7' (#1762) from OlCe1/UXP:tauthon-build-support into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1762
2021-04-08 02:26:58 +00:00
Olivier Certner 264b79b31d Issue #1761 - Enable use of Tauthon instead of Python 2.7 at build
Make essential Tauthon's builtins and modules available in sandboxes, without
disrupting building with Python 2.7.

1. Allow new builtins and modules. "__build_class__" is for
building... new-style classes (to handle the new metaclass syntax imported from
3.x). "_oserror" is necessary because of internal changes to raise errors
deriving from OSError (which are reported as IOError if not caught).
2. Look for modules and packages in the right places.

This was tested on FreeBSD, and should work out of the box on Linux.
2021-04-07 16:12:20 +02:00
Moonchild b9d8b3aa2d Merge branch '1756'
This resolves #1756
2021-04-01 10:44:59 +00:00
Moonchild 5e6b15940f Merge pull request 'Reinstate "dom.details_element.enabled" preference' (#1758) from athenian200/UXP:details_element_pref into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1758
2021-04-01 07:17:23 +00:00
athenian200 82cb11de19 Issue #1757 - Reinstate "dom.details_element.enabled" preference
The removal of this preference was botched, all other surrounding plumbing changes appear to be working okay. The ability to use prefs to control this stylesheet might be useful in the future, so perhaps this is one of those "if it ain't broke, don't fix it" bugs where leaving well enough alone in the first place would have been the best choice.
2021-03-31 17:57:48 -05:00
Moonchild e07dee79c5 Issue #1756 - Clean up ICU patch.
We don't need ICU_UNUM_HAS_FORMATDOUBLEFORFIELDS because we don't support any
ICU other than the one in-tree.
2021-03-31 15:41:38 +00:00
Moonchild 685dafd775 Issue #1756 - Expose NumberFormat.formatToParts() to content. 2021-03-31 14:45:56 +00:00
Moonchild 1271dbeaf3 Issue #1756 - Initial wrapped implementation in C++ 2021-03-31 11:54:20 +00:00
Moonchild 2953a5b1a1 Issue #1755 - Add smooth, high-quality and pixelated to CSS image-rendering 2021-03-28 10:55:28 +00:00
Moonchild b969ea3b9c Issue #1754 - Fix clip path overflow.
Resolves #1754.
2021-03-26 17:19:27 +00:00
Moonchild 698b235b28 [WebRTC] Apply port restrictions to peerconnections. 2021-03-24 18:04:20 +00:00
Moonchild 75dbd532f5 [WebGL] Only allow texture uploads from pixelbuffer if bound.
Throw an error if it mismatches.
2021-03-24 12:16:08 +00:00
Moonchild 021fecdedc [docshell] Stop loading of the document if network load is stopped.
After all, stop means stop.
2021-03-24 11:41:58 +00:00
Moonchild c1b064b99f Merge pull request 'Implement "prefers-color-scheme" as a user preference.' (#1753) from athenian200/UXP:prefers-color-scheme into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1753
2021-03-24 08:58:18 +00:00
athenian200 e946ca91fb Issue #1752 - Implement "prefers-color-scheme" as a user preference.
This PR passes all current tests for this feature, and implements the "prefers-color-scheme" media query as an enumerated keyword that is controlled by an integer preference.

Currently, the possible options are 0 to see a website's fallback code and essentially behave like this isn't implemented (our current behavior), 1 to express a preference for a light theme (the default for spec reasons), and 2 to express a preference for a dark theme. Over time, this list may expand to include other preferences like a preference for a sepia theme or something, and this leaves us prepared for that future.
2021-03-23 22:25:54 -05:00
Moonchild d3543ca2fe Issue #1751 - Remove MacOS support from configure 2021-03-22 09:37:12 +00:00
Moonchild b59777a67b Issue #1053 - Remove __ANDROID__ defines (except in third party code) 2021-03-21 16:15:54 +00:00
Moonchild a94a86ff78 Issue #1749 - Remove restriction of SVG width/height element attributes.
According to the original SVG spec, the SVG element in documents had to follow
special rules as to what was allowed for width/height attributes. This is no
longer the case, so we can decouple it from whatever internal units SVG/XML
language uses and allow all units like every other element.
2021-03-20 07:35:30 +00:00
Moonchild d249dd517b [CSS] Enable scrollbar-width keyword by default.
I totally forgot this <.<
2021-03-17 12:14:00 +00:00
New Tobin Paradigm 3064ad3efe Merge pull request 'Remove the ability to accept Firefox GUIDS (remove the dual system)' (#1748) from athenian200/UXP:phoenix_extensions into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1748
2021-03-16 11:27:34 +00:00
athenian200 3aa334d0b7 Issue #1744 - Remove the ability to accept Firefox GUIDS (remove the dual system)
This finally removes the dual-GUID hack. There's nothing as permanent as a temporary solution.
2021-03-16 06:20:59 -05:00
Moonchild 6a6772f480 [Toolkit] Update TwemojiMozilla font to 0.5.1 (Twemoji 12.1.6) 2021-03-16 10:59:51 +00:00
Matt A. Tobin 29a5601f3a [NSS hotpatch] Hard disable AVX2 in NSS Build System 2021-03-15 22:16:14 +00:00
Moonchild 494718c324 Clobber for NSS update 2021-03-15 18:53:11 +00:00
Moonchild 958eb2936b Issue #1693 - Update NSS to 3.52.2-UXP
Update root certificates and port NSS sec patches from previous work.
2021-03-15 18:52:57 +00:00
Moonchild c46598c11d [NSS] Update root certificates. 2021-03-15 18:49:45 +00:00
J.C. Jones 156287f0d8 [NSS] Prevent slotLock race in NSC_GetTokenInfo
Basically, NSC_GetTokenInfo doesn't lock slot->slotLock before accessing slot
after obtaining it, even though slotLock is defined as its lock.
2021-03-15 18:43:00 +00:00
Sohaib ul Hassan 2642a2150f [NSS] Implement constant-time GCD and modular inversion
The implementation is based on the work by Bernstein and Yang
(https://eprint.iacr.org/2019/266)
"Fast constant-time gcd computation and modular inversion".

It fixes the old mp_gcd and s_mp_invmod_odd_m functions. The patch also fixes
mpl_significant_bits s_mp_div_2d and s_mp_mul_2d by having less control flow to
reduce side-channel leaks.

Co-authored by : Billy Bob Brumley
2021-03-15 18:40:01 +00:00
Moonchild 4397303e5d Issue #1743 - Update CK_GCM_PARAMS use for PKCS11 v3.0 in WebCryptoTask
Re-apply now we have PKCS11 v3.0 again
2021-03-15 18:25:42 +00:00
Moonchild a9a050901e Issue #1693 - Update NSPR to 4.25-RTM 2021-03-15 18:24:14 +00:00
Moonchild fd9fc4ea60 Issue #1693 - Update NSS to 3.52.1-RTM 2021-03-15 12:57:35 +00:00
Moonchild d830832cb9 Revert "Issue #1743 - Update CK_GCM_PARAMS use for PKCS11 v3.0 in WebCryptoTask"
This reverts commit 2b6effbf29.
2021-03-14 22:58:58 +00:00
Moonchild dc468397f3 Issue #1746 - Revert "Update NSPR to 4.29"
This reverts commit 149d2ffa77.
2021-03-14 22:48:44 +00:00
Moonchild 52d5ff242f Issue #1746 - Revert "Update to NSS 3.59.1.1" 2021-03-14 22:47:32 +00:00
Moonchild 0038394c39 Issue #1746 - Revert "Additional configuration for NSS lib update."
This reverts commit ae775e493b.
2021-03-14 22:44:25 +00:00
Moonchild 005d9c42d3 Issue #1746 - Update pkix code with later NSS code. 2021-03-14 13:06:22 +00:00
Moonchild cc8a7e3f7b Issue #1053 - Remove MOZ_WIDGET_ANDROID and IDB_MOBILE 2021-03-11 06:43:10 +00:00
Moonchild dce8a3300b Issue #1053 - Remove Android-specific blocks from system headers and /dom 2021-03-11 06:41:21 +00:00
Moonchild 515c1193c5 Issue #1053 - Remove mobile-specific graphics "optimizations" (=compromises) 2021-03-10 18:58:26 +00:00
Moonchild 108ec40998 Issue #1053 - Remove android blocks from configure. 2021-03-10 17:10:56 +00:00
Moonchild c2268033a8 Issue #1053 - Remove build system MOZ_ANDROID_* defines and related code. 2021-03-10 14:26:15 +00:00
Moonchild 78a37c1045 Issue #1737 - Update build config and mozbuild files. 2021-03-04 00:03:56 +00:00
Moonchild d192e6808f Issue #1737 - Import libaom 2.0.2 source 2021-03-04 00:03:46 +00:00
Moonchild c81c0395a3 [parser] run java translation. 2021-03-02 12:01:30 +00:00
Moonchild 78444682d7 Merge pull request '[widget] MailNews Followup: Require user interaction when picking files or folders v2' (#1745) from g4jc/UXP:master into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1745
2021-02-26 17:41:20 +00:00
Gaming4JC 9b0d589d9f [widget] MailNews Followup: Require user interaction when picking files or folders v2
98f6ad61f4 introduced a boolean, this just passes it down and fixes build bustage of mailnews.
2021-02-26 11:57:24 -05:00
Moonchild ad5a13bd50 [OTS] Backport some upstream OTS commits. 2021-02-24 14:24:24 +00:00
Moonchild 5587b6bf1a [MFBT] Update lz4 to 1.9.3 2021-02-24 12:16:57 +00:00
Moonchild 85b0f705d9 Issue #457 - Remove duplicate PKCS11 definitions 2021-02-24 11:09:47 +00:00
Moonchild 29271977c9 [security] Hold mutex when accessing TSI fields. 2021-02-24 11:08:36 +00:00
Moonchild b2c0fda775 [DOM] Don't reveal error details for CORS-cross-origin decoding errors. 2021-02-24 10:13:37 +00:00
Moonchild 525961c261 [html parser] Check for integer overflow when computing new buffer sizes. 2021-02-24 09:57:24 +00:00
Moonchild 77d26e8bcd [dom] Update noscript serialization to the changed spec.
Make <noscript> escaping conditional on whether scripting is enabled.
2021-02-24 09:05:30 +00:00
Moonchild 5f1bc29870 Issue #1722 - Update about:license
Mostly making parts conditional and removing blocks that are no longer
applicable, and a few minor edits otherwise to update links and text.

Resolves #1722
2021-02-21 19:20:31 +00:00
Moonchild 98f6ad61f4 [widget] Require user interaction when picking files or folders v2
Now with extra sauce to make it work cross-platform and cross-versions and
for HTML input elements only.
2021-02-21 10:32:47 +00:00
Moonchild 2b6effbf29 Issue #1743 - Update CK_GCM_PARAMS use for PKCS11 v3.0 in WebCryptoTask 2021-02-17 22:30:39 +00:00
Moonchild 2103a2283b Issue #1688 - Add flood guard to state change logic. 2021-02-16 12:13:16 +00:00
Moonchild 8f663e3bcd [widget] Require user interaction when picking files or folders. 2021-02-15 21:09:05 +00:00
Moonchild 9fa7943937 Issue #1741 - Follow-up: Remove superfluous prefobserver
This one is no longer necessary (and incorrect) after the changes made in #1684
2021-02-15 06:26:33 +00:00
Moonchild 9832adb6f7 Issue #1741 - Add missing prefobserver for general.useragent.* prefs
Resolves #1741
2021-02-14 16:04:06 +00:00
Moonchild 4f06d20f8a [js] Add XMMRegName for invalid_xmm 2021-02-14 08:34:36 +00:00
Moonchild fc65e1f2fa Issue #1739 - Implement numeric separators.
Resolves #1739
2021-02-13 09:41:29 +00:00
Moonchild 458939c9d9 Issue #1738 - Follow-up: Update comment (no code changes) 2021-02-12 21:24:32 +00:00
Moonchild 9ca880e200 Issue #1738 - Part 2: Implement well-formed JSON stringify
This implements the ES2019 spec for JSON stringification, including
lower-casing, properly escaping lone surrogates, etc.
2021-02-11 13:55:24 +00:00
Moonchild 2c72b8859a Issue #1738 - Part 1: Improve performance of JSON stringify
- Use some pointer voodoo and instead of stringbuffer append()
- Use a lookup table instead of char comparisons for chr < 256
- Stop using a Hashtable/MovableCellHasher for JSON CycleDetector
2021-02-11 13:20:54 +00:00
Moonchild 006d2ca827 Update tzdata to 2021a
Because people are apparently never satisfied with the time zones on the planet!
2021-02-10 03:08:34 +00:00
Moonchild 5c1d1d37fb Merge pull request 'Support for latest stable FreeBSD (12.2)' (#1736) from OlCe1/UXP:FreeBSD-support-update into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1736
2021-02-08 20:36:20 +00:00
Moonchild aa99e58876 Issue #1737 - Disable AV1 by default.
Our current implementation has consistent playback issues; this needs to be
addressed before the codec can be enabled by default.
2021-02-07 20:20:36 +00:00
Moonchild aab1c211a6 [angle] Cherry-pick compressed tex depth stride fix. 2021-02-05 18:40:41 +00:00
Olivier Certner 9f2085b5e9 Issue #1699 - Follow-up: mozjemalloc: Fix build by excluding some irrelevant init_lock code
This had been initially dealt with in issue #1699's commits, but one of them
was in the end reverted, which caused this problem (this change should have
been done there).
2021-02-05 18:22:59 +01:00
Olivier Certner 1305a9187e Issue #1730 - Part 2: harfbuzz: Remove some useless define causing a build error
Defining _POSIX_C_SOURCE to 199309L on FreeBSD causes compile errors, because of
an obscure interaction between system wrappers and libc++ headers. The source
doesn't seem to need it at all, which tests confirm.

I bet that this is not needed either on other modern systems (even those based
on glibc), and that the define could probably be entirely removed. Not trying
it because I can't test it myself.
2021-02-05 18:22:53 +01:00
Olivier Certner 5f29c78f7c Issue #1730 - Part 1: Interpose malloc even on RTLD_DEEPBIND presence
New FreeBSD versions have introduced RTLD_DEEPBIND (see dlopen(3)), which
triggers a provoked build error to be on the "safe" side.

Indeed, improper use of RTLD_DEEPBIND could cause malloc interposing not to
work on specific libraries. This would happen for libraries that provide their
own malloc/free and exchange pointers with other libraries or the main program,
one allocating an area and another one deallocating it.

It seems it happened for glibc, which is not a concern on FreeBSD, and for the
Flash Player (not a concern either, there is no native Flash Player). Moreover,
there is only a single reference to RTLD_DEEPBIND in the whole platform
currently, namely in the WebRTC code, but the corresponding code chunk is
compiled-in only on Linux (and this library doesn't seem to redefine malloc
functions anyway). So I don't see how a problem could happen. Additionally,
Pale Moon, which is my focus, doesn't use WebRTC.

Corresponding Mozilla bug: https://bugzilla.mozilla.org/show_bug.cgi?id=493541
2021-02-05 18:22:46 +01:00
Olivier Certner f3405dbede Issue #1729 - Support building/linking against libc++ 9+
Including <cstdlib> must never trigger inclusion of "mozalloc.h", because the
first thing this one does is precisely to include <cstdlib>.

It is now the case that, in libc++ 9 and beyond, <cstdlib> includes <math.h>
which then tries to include <type_traits>, which the STL wrapper intercepts,
trying to load "mozalloc.h". Same problem happens with <limits>.

Fix pulled from: https://bugzilla.mozilla.org/show_bug.cgi?id=1594027.
2021-02-05 18:20:47 +01:00
Moonchild 66d028942c Issue #1732 - Implement JSON superset proposal.
This change makes unicode line and paragraph separators allowed in JS strings,
removing the only quirk of the JS string definition that made JSON not a valid
subset of JS.

Resolves #1732
2021-02-05 12:44:26 +00:00
Moonchild bd9fdeccc7 Issue #1726 - Add verification test for string.replaceAll() 2021-02-04 21:29:55 +00:00
Moonchild 9b401e7748 Merge pull request 'Implement String.replaceAll()' (#1728) from meatloaf/UXP:string_replaceAll into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1728
2021-02-04 21:27:26 +00:00
Moonchild 914368530b Issue #439 - Remove web-platform tests from the tree.
This removes a total of 23,936 files we would never use nor have the capacity
to properly maintain or keep up-to-date.
2021-02-04 19:41:06 +00:00
meatloaf 24c40b5836 Issue #1726 - Implement String.replaceAll()
This also implements IsRegExp, as this demands it.
Ported from https://bugzilla.mozilla.org/show_bug.cgi?id=1540021
2021-02-04 12:59:54 -06:00
Moonchild c5ad76a287 Issue #1515 - Add null check to nsCSSFrameConstructor::IsValidSibling
With the changes to layout for WebComponents, it is now apparently possible to
pass in null for frame tree items to this function, which would cause a null
deref crash if not checked.
2021-02-03 11:10:44 +00:00
Moonchild ce297b972b Fix CRLF line endings in npapi.h 2021-01-30 13:17:11 +00:00
Moonchild 4d6e9aec05 Issue #1720 - Remove explicit header inclusion from npapi.h
This should allow the header to be used outside of the UXP tree for compiling
plugins etc.
Resolves #1720
2021-01-30 13:16:33 +00:00
Moonchild f394d6502c [js] Remove unused promise selfhosting functions.
These are leftovers from when promises were fully self-hosted and could cause
confusion if left in place.
2021-01-30 01:06:36 +00:00
Moonchild a4503737e1 Merge pull request 'Issue #1723 - Fix Linux build bustage in HTMLMenuItemElement.cpp' (#1724) from trav90/UXP:1723-fix into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1724
2021-01-30 01:02:59 +00:00
trav90 402881b4c2 Issue #1723 - Fix Linux build bustage in HTMLMenuItemElement.cpp 2021-01-29 16:28:26 -06:00
Moonchild e1daeef183 [network] Hold mutex when accessing mSecurityInfo. 2021-01-27 10:52:32 +00:00
Moonchild f77c7a36b7 [DOM] Store weak pointer to next parents. 2021-01-26 23:16:22 +00:00
Moonchild 8fd57ace20 [DOM] Try to avoid slow shrinking GC during sync calls 2021-01-26 22:42:46 +00:00
Moonchild 2836e51466 [webaudio] Fix up ReverbInputBuffer's writeIndex. 2021-01-26 14:55:48 +00:00
Moonchild 3661ecee11 [WebRTC] Improve SDP parser error handling. 2021-01-26 13:59:19 +00:00
Moonchild 2f9e27a306 [js] Add AutoEnterOOMUnsafeRegion to JS_TransplantObject.
Transplanting objects is inherently oom-unsafe, so add
`AutoEnterOOMUnsafeRegion` to `JS_TransplantObject()` and annotate crashes
accordingly if they do happen.
2021-01-26 12:28:25 +00:00
Moonchild 3a8b4ad00a Fix rooting hazard in ImageBitmap::CreateInternal by avoiding movable data. 2021-01-26 11:49:35 +00:00
Moonchild c1dd23bd83 [layout, XUL] Avoid accessing invalidated frame. 2021-01-26 09:56:37 +00:00
Matt A. Tobin dd932e0011 Merge branch 'presentation-cleanup' 2021-01-25 18:26:58 -05:00
Moonchild 874330d453 Issue #1719 - Make <menuitem> pref-controlled and disable by default.
Resolves #1719
2021-01-25 23:18:58 +00:00
Matt A. Tobin 7702d1f3fa Issue #1390 - Clean up presentation api leftovers 2021-01-25 17:38:49 -05:00
Moonchild 1126548dee Issue #1319 - Resolve RELEASE_OR_BETA questions in all.js
- Enabled SVG transform-box property. I've tested this extensively including the
bug that prevented Mozilla from shipping until 55 which does not seem to apply
to us (most likely a stylo issue). Should be good to go.
- Moved the getRootNode pref to a better place (no change)
- Enabled inputmode property for forms. This is n/a for physical keyboards but
should improve the experience for soft keyboards that can pop up various forms
of input (e.g. numeric) depending on the mode indicated. According to BZ this is
feature complete at our level but was problematic for Android which we don't
have support for anyway.
- Restricted crashing on insecure input of text to debug only.
- Enabled shutting down the async OSFile worker if not used for 30 seconds to
be more conscientious about resource use.
- Enabled blocking of autoplay of media in the background by default, since it
is a saner default to have for the OOBE and is commonly a desired setting by
users (see forum).
- Disabled the storage manager API by default. This fine-grained control over
stored website data is already handled by various extensions and we don't have
the front-end support for it. Assuming this was necessary for Mozilla due to
limited access of WebExtensions to this kind of data.
2021-01-23 12:42:53 +00:00
Moonchild 411ccb0e49 Issue #1630 - Enable W3C pointer events by default.
Resolves #1630
2021-01-19 10:04:24 +00:00
Matt A. Tobin 75286e68d7 [Media] Enable AV1 by default if built 2021-01-18 14:56:32 -05:00
Moonchild 22e78108bd Issue #1715 - Handle errors when initializing print settings from the printer
fails due to a bad printer name or O.S. error.

Resolves #1715
2021-01-18 18:07:28 +00:00
Moonchild c77d06c0c4 Merge pull request 'Selectively enable and pref the DOM Web Animations API' (#1714) from 1689 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1714
2021-01-18 09:41:05 +00:00
Moonchild 82fb08c650 Bump platform version for added features. 2021-01-16 14:29:01 +00:00
Moonchild b3d380b4ea Issue #1689 - Part 5: Enable DOM Animations API except the preffed-off parts.
This enables the DOM Animations API core functions with the exception of those
parts that are either unimplemented or not ready for use, which have been
preffed off in this issue's previous parts.

Also tag #1319 for enabling a previous RELEASE_OR_BETA shielded API.
2021-01-14 19:04:25 +00:00
Moonchild abc58d2ed0 Issue #1689 - Part 4: Add a preference for {Document,Element}.getAnimations()
This is probably the last thing we will ship (if ever) since it needs the most
spec and implementation work for arbitrary use that is pretty far into a corner.
2021-01-14 17:43:44 +00:00
Moonchild 931314ef61 Issue #1689 - Part 3: Add a preference for animation composite modes.
This feature should not be shipped until the various definitions of addition for
each additive property are properly specified and then implemented accordingly.

Unlike other patches in this series, compositing is not frequently used
internally so there is no need to enable this by default for chrome callers.
2021-01-14 17:41:30 +00:00
Moonchild 407c86641a Issue #1689 - Part 2: Add a preference for implicit keyframes
This preference controls whether authors are allowed to specify animations
without a 0% or 100% keyframe.

We intend to ship this but it isn't implemented yet (needs a follow-up) but this
preference acts as a safeguard in case we discover we need to disable it once
it's implemented.
2021-01-14 16:05:53 +00:00
Moonchild b0fe759f03 Issue #1689 - Part 1: Add pref for DOM Animation timelines API
Default false, no intent to ship for web content. Always enabled for Chrome.
2021-01-14 14:46:52 +00:00
Moonchild 5158142779 Merge pull request 'Add scrollbar-width CSS spec' (#1707) from 1705 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1707
2021-01-13 00:25:23 +00:00
Moonchild 0939fde1a4 Issue #1705 - Part 9b: Revert overzealous changes on Mac (cocoa). 2021-01-12 13:07:40 +00:00
Matt A. Tobin 7023db88ca Issue #1624 - Fix slot access intrinsics for objects with > 16 reserved slots
Also flips ion inlining pref back on
2021-01-11 09:31:44 -05:00
Moonchild 59ef3f4eda Issue #1705 - Part 9: Implement scrollbar-width:thin on Mac (cocoa). 2021-01-09 23:21:36 +00:00
Moonchild ecc771848f Issue #1705 - Part 8: Implement scrollbar-width:thin on GTK. 2021-01-09 23:20:31 +00:00
Moonchild 382fe423e5 Issue #1705 - Part 7: Implement scrollbar-width:thin on Windows. 2021-01-09 23:19:35 +00:00
Moonchild c0db767c25 Issue #1710 - Check for triggering principal URI in FTP subresource check.
Resolves #1710
2021-01-09 19:19:39 +00:00
Moonchild 764e13c912 Issue #1705 - Part 6: Remove scrollbarbutton min-{width|height} rule from theme.
This would interfere with implementing thin scrollbars.

Almost all widgets provide a non-overridable size for scrollbar buttons, so it
makes no sense to specify min size for them. It is probably(?) a layout bug that
min size properties can override the value returned by GetMinimumWidgetSize
even if aIsOverridable is set to false, but removing this rule is simpler than
locating and fixing the issue in layout code ;)
2021-01-08 14:40:49 +00:00
Moonchild c05bca3168 Issue #1705 - Part 5: Implement scrollbar-width:none for all target platforms. 2021-01-08 14:15:50 +00:00
Moonchild c1825acab0 Merge pull request 'Add modern FreeBSD support' (#1706) from OlCe1/UXP:FreeBSD-support-reformatted into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1706
2021-01-07 21:26:47 +00:00
Olivier Certner 5d95844f49 Revert "Issue #1699 - Part 3a: mozjemalloc: Memory barriers on 'malloc_initialized'"
This reverts commit f76695c1ce.

SUSv4 specifies that 'pthread_create' acts as a (full) memory barrier, so
barriers here are not necessary.
2021-01-07 20:28:40 +01:00
Olivier Certner 3e2dcaf7f2 Issue #1699 - Part 3c: mozjemalloc: FreeBSD: Ensure early initialization
This guarantees that initialization is done in a single-thread context.
2021-01-07 17:49:14 +01:00
Olivier Certner 91f7c9d30e Issue #1699 - Part 3b: mozjemalloc: Bootstrap allocator, early diversion for FreeBSD
Coded a simple memory allocator meant to be used during jemalloc bootstrap
(malloc_init_hard()). Although protected by "#ifdef __FreeBSD__", it is not
FreeBSD-specific: Any POSIX platform could use it.

Hook it so that it is used in place of jemalloc's own routines while
malloc_init_hard() is executing or memory for mutexes is being
allocated. Currently, 'malloc', 'calloc', '*memalign' and 'free' are diverted
during init or lock initializations.

Details are quite complex, see the big comment block starting with "There are
several problematic interactions between FreeBSD's libthr and this jemalloc."
for more explanations.

Also replaced ad-hoc BSD code to determine the number of CPUs with 'sysconf',
which is POSIX-compliant (and supported on modern BSDs).
2021-01-07 17:49:14 +01:00
Olivier Certner f76695c1ce Issue #1699 - Part 3a: mozjemalloc: Memory barriers on 'malloc_initialized'
The barriers are here to make sure that setting 'malloc_initialized' at end of
init must be noticed later by any thread running on a different core. They are
in theory necessary in the absence of an explicit pthread lock.

What could happen is that the thread doing the initialization later spawns
other threads that could not have the updated 'malloc_initialized' value,
leading to a second initialization. This is dependent on whether OSes force a
full memory barrier before the new thread is run, which I don't know, and don't
want to bother.

This was done for FreeBSD only, for the sake of robustness. In theory, this
would be needed on Windows too.
2021-01-07 17:34:03 +01:00
Olivier Certner da217348d9 Issue #1699 - Part 2: libevent: Remove 'evutil_secure_rng_add_bytes'
In fact, this is a security threat.

This function calls 'arc4random_addrandom', which was removed from the
reference implementation 7 years go [1], on the ground that this was in fact an
internal interface which is almost impossible to use correctly. This update has
since then been propagated to other implementations (e.g., FreeBSD, IllumOS,
Android).

Do this for all platforms, since 'evutil_secure_rng_add_bytes' is not even used
in the current tree, and for the reason stated above, should never be.

Related bugs at Mozilla and libevent: Links [2] and [3] below.

[1] http://marc.info/?l=openbsd-cvs&m=138238762705209&w=2
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=931354
[3] https://sourceforge.net/p/levent/bugs/320/
2021-01-07 17:02:06 +01:00
Olivier Certner 87aa6b2300 Issue #1699 - Part 1: python/psutil: Support recent FreeBSD versions
'sysctl' interface to currently opened connections changed in FreeBSD 12.

Drop support for FreeBSD < 9, these are very old and unsupported versions.
2021-01-07 17:02:05 +01:00
Moonchild 65da2431f9 Issue #1705 - Part 4: Add scrollbar-width CSS keyword to CSS parser.
This should be all parts needed to add a brand new enum keyword including
getting the computed style from it...
2021-01-06 23:57:26 +00:00
Moonchild 0e6a9cc60a Issue #1705 - Part 3: Rename ScrollbarStyles to ScrollStyles.
ScrollbarStyles contains values of overflow, (over)scroll-behavior, etc.
The only one which is marginally related to scroll _bars_ is overflow, which can
be used to hide scrollbar (by making an element not scrollable) or enforce the
scrollbar to display.

It makes more sense to be called ScrollStyles as it's mainly concerning behavior
of scrolling, not scrollbars. Also, with the addition of scrollbar width
properties, the current name can be confusing.
2021-01-06 16:31:36 +00:00
Moonchild 4681e04dc5 Issue #1705 - Part 2: Add a ShowScrollbar enum to be used in ScrollReflowInput.
Overflow properties have two purposes:
1. controlling whether the scrollbar should be shown;
2. controlling whether the content is scrollable.

However, with the scrollbar-width property being added, scrollability and
presence of a scrollbar are no longer tied together.
This patch makes a separation between the value of overflow and the presence of
a scrollbar by making it clear that for ScrollReflowInput, we only care about
whether scrollbar should be shown.
This should make it easier to write the logic involving presence of the
scrollbar based on webdev choice.
2021-01-06 12:48:38 +00:00
Moonchild e16ed489a4 Issue #1705 - Part 1: Rename nsChangeHint_CSSOverflowChange to *ScrollbarChange.
Prepare for scrollbar-width which should trigger the same kind of change.
2021-01-06 10:35:21 +00:00
Moonchild 5af0c434b9 Merge branch '61' 2021-01-04 11:29:47 +00:00
Matt A. Tobin 1a4abb5d97 Issue #61 - Add missing external symbols for gkmedias when WebRTC is built 2021-01-04 03:43:58 -05:00
Matt A. Tobin 3f1ed03579 Issue #61 - Add missing external symbol cubeb_set_log_callback to gkmedias symbols.def 2021-01-03 23:41:17 -05:00
Matt A. Tobin 46ca396f8c Issue #61 - Add configure option for non-windows platforms
Windows will ALWAYS have this enabled but we eventually want all target operating systems to use this as well but that will require more work
2021-01-03 23:40:35 -05:00
Moonchild 39cebe99e2 Issue #61 - Place Skia in libxul
Skia does some nasty things that break with DLL calls like having virtual dtors
without a body definition (and it's honestly surprising that it even builds to
begin with the way it's done, but apparently they use some linking symbol voodoo
to work around that in dependent classes).
Not wanting to have to pull Google code apart to try and fix that for something
we're only using for canvas anyway, it's better to just let Skia reside in
libxul instead.
2021-01-03 21:45:04 +00:00
Moonchild b713575ca4 Issue #61 - Add missing #endif in symbols file 2021-01-03 21:41:19 +00:00
Matt A. Tobin a625decfc9 [NSS hotpatch] Hard disable AVX2 in NSS Build System
This should be ported to the NSS repo
2021-01-03 03:11:22 -05:00
Moonchild 84fa3f9f72 Redundant code path cleanup (#1702)
Remove various obsolete configure options.
Remove Adjust SDK install tracking filth.
Remove redundant code paths in old-configure
This also optimizes linker use
Remove redundant conditional blocks.
Rewrite span.h without constexpr use.
2021-01-02 19:27:13 +00:00
Moonchild babeb5c556 Issue #61 - Reinstate buildability with shared gkmedias dll
This fully works for splitting gkmedias.dll back out from xul with one exception
which is Skia throwing undefined externals when linking gkmedias.
2021-01-02 13:35:39 +00:00
Moonchild 0bb464bfc1 Issue #1053 - Part 2b: Remove android from /layout reftests
Also cleans up some other obsolete checks and stylo reftest lists.
2020-12-31 22:46:09 +00:00
Moonchild e011a048e4 Issue #1053 - Part 3b: Remove AndroidSurfaceTexture and Android media decoder
interface.
2020-12-27 13:11:19 +00:00
Moonchild 8d4456c797 Issue #1053 - Part 3a: Remove Android conditionals from /gfx 2020-12-27 06:58:56 +00:00
Moonchild ae2a160348 Issue #1053 - Part 2a: Remove android from /layout (partial)
This removes android code from base, build, forms, generic, inspector, style,
printing, tools and xul.
2020-12-26 10:16:55 +00:00
Moonchild 9f004841a2 Issue #1053 - Part 1c: Remove references to mobile/android targets and paths 2020-12-25 23:29:47 +00:00
Moonchild 62568d94d5 Issue #1681 - Hard-code FLAC media type association for .flac
We don't support AAC outside of OMX at the moment, so oops.
2020-12-24 13:35:26 +00:00
Moonchild 837432de64 Revert "Issue #1681 - Hard-code FLAC and AAC media type associations for .flac and .aac"
This reverts commit a8e90975d0.
2020-12-24 13:34:22 +00:00
Moonchild a8e90975d0 Issue #1681 - Hard-code FLAC and AAC media type associations for .flac and .aac 2020-12-24 13:30:53 +00:00
Moonchild 6ae313b51c Clobber for NSS update. 2020-12-23 22:24:08 +00:00
Moonchild ae775e493b Issue #1693 - Additional configuration for NSS lib update.
The Seed and RC2 components are completely obsolete, so we shouldn't build them.
AVX2 for Chacha20-Poly1305 would fall outside of our platform sysreqs, and has a
build system issue with non-MSVC flags being passed (needs more research, also a
recent change around NSS 3.53 when the makefile destruction happened)
2020-12-23 19:45:11 +00:00
Moonchild 029bcfe189 Issue #1693 - Update NSS to 3.59.1.1
This updates to MoonchildProductions/NSS@bd49b2b88 in the repo created for our
consumption of the library.
2020-12-23 19:02:52 +00:00
Moonchild 149d2ffa77 Issue #1693 - Update NSPR to 4.29 2020-12-23 19:01:09 +00:00
Moonchild 25b6703e95 Issue #1701 - Implement Intl.PluralRules API 2020-12-22 20:32:56 +00:00
Moonchild 911cbcd1af Issue #1700 - Apply background color instead of inset shadow for findbar input.
This changes the toolkit theme for Linux and Windows (Mac already did this) to
style the input textbox on the findbar with -moz-appearance:none so as to give
us styling control (as opposed to using a native widget style) and apply a
neutral style to it.
Also ensures Mac remains readable in case of poorly contrasting text.
2020-12-21 16:24:37 +00:00
Moonchild 05569cb6d1 Revert "Issue #1686 - Align a keybinding definition with the others"
This reverts commit 85dc118aac.
2020-12-20 19:48:50 +00:00
Moonchild 8500ebf532 Merge pull request 'Reinstate the performance timing code removed in error' (#1698) from adesh/UXP:fix-performace-api into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1698
2020-12-16 15:36:19 +00:00
adesh 0187d3e4e7 Issue #1697 - Reinstate the performance timing code removed in error.
This was a fallout from pull request #929.
2020-12-16 06:31:31 -05:00
Moonchild 408477a87a Revert "Issue #1695 - Add clamping to websocket polling timeouts."
As of [da0c073a7] we no longer need this workaround because the issue is avoided
with proper sleep/wake logic restored.

This reverts commit 2fa993b563.
2020-12-16 06:42:42 +00:00
Moonchild da0c073a74 Issue #1695 - Restore Sleep/Wake timer that was erroneously removed.
This was fallout from PR #929 for Issue #21
2020-12-16 06:39:51 +00:00
Moonchild 78f114fc42 [toolkit] Handle corner case confusion of downloaded files without extension.
See code comment for details.
2020-12-15 11:33:29 +00:00
Moonchild ac4c22f096 Issue #1696 - Propagate flex sizes to the table wrapper
This avoids overlapping of table styled elements inside flexboxes as used on
some websites.

Resolves #1696
2020-12-15 10:30:06 +00:00
Moonchild 3c0236666e [network] Update port blacklist.
See BZ bugs 1674735, 1677047, 1677940 and 1676868 for details.
2020-12-15 09:04:21 +00:00
Moonchild 2fa993b563 Issue #1695 - Add clamping to websocket polling timeouts. 2020-12-12 12:41:26 +00:00
Moonchild 4281fcc163 Revert "Issue #1391 - Disable DOM Filesystem/dirpicker APIs by default."
This reverts commit 45a976a5f1.
2020-12-08 17:26:30 +00:00
Moonchild 6b45065f14 Issue #1695 - Fix socket timeout logic. 2020-12-08 17:19:01 +00:00
Moonchild 6cb00e2cfd Issue #1694 - Part 2: Use scriptabledateformat for Update History display. 2020-12-04 16:41:24 +00:00
Moonchild 16a1ff22a3 Issue #1694 - Part 1: Use scriptabledateformat for the Cookie Accept dialog. 2020-12-04 16:37:02 +00:00
Moonchild fd576c4270 Issue #1624 - flip the inlining pref.
The default is now set to the more stable but slower global setting.
2020-12-03 18:33:35 +00:00
Moonchild 7fda700f92 Nuke erroneously added vim line. 2020-12-03 17:52:32 +00:00
Moonchild 1a21b52692 Issue #1624 - Make ion inlining optimizations a pref.
This also adds it to JS_SetGlobalJitCompilerOption()
2020-12-03 13:56:36 +00:00
Moonchild 7f619fa9bf Merge branch 'nss-patch-work' 2020-12-01 22:47:40 +00:00
Moonchild b668164260 Issue #1624 - Globally disable inlining optimizations in the JS JIT compiler. 2020-12-01 22:46:55 +00:00
Moonchild 433ed209ba Revert "Issue #1624 - Exclude function scopes from Ion compilation."
This reverts commit bb31c1c65e.
2020-12-01 22:39:36 +00:00
Moonchild b1bbc9286d Merge pull request 'Fix macOS version detection above 10.15 and update blocklist support to 11.0' (#1692) from dbsoft/UXP:Big_Sur_Version into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1692
2020-12-01 22:27:41 +00:00
Brian Smith e43b01e58b Issue #1690 - Part 2: Update MacOS Blocklist support from 10.13 to 11.0.
Changes based on Mozilla bug 1678061.
2020-12-01 15:46:38 -06:00
Moonchild 1683d012e2 Clobber for NSS update. 2020-12-01 15:33:00 +00:00
Moonchild 958205f4da [NSS] Version and build bump 2020-12-01 14:20:15 +00:00
Moonchild cca3b9062d [NSS] Update root certificates. 2020-12-01 14:19:59 +00:00
Moonchild bb31c1c65e Issue #1624 - Exclude function scopes from Ion compilation.
This seems to work around the problem with the compiled code stack for in-line
declared JS module code. Not optimal, for sure, but better than having to kill
Ion compilation outright.
2020-11-30 16:53:49 +00:00
Moonchild 060e3eb0c8 Revert "Issue #1691 - Part 1: Provide a way of associating a private value with a script"
This reverts commit 15914ec578.
2020-11-28 10:18:10 +00:00
Moonchild 15914ec578 Issue #1691 - Part 1: Provide a way of associating a private value with a script
or module.

This is a prerequisite for dynamic import
2020-11-27 15:47:49 +00:00
Brian Smith b1ac886a98 Issue #1690 - Part 1: Fix MacOS version detection above 10.15.
Changes based on Mozilla bug 1616404 but supporting back to 10.7.
2020-11-23 08:18:34 -06:00
33444 changed files with 1289539 additions and 2267677 deletions

No files matched your search

-22
View File
@@ -187,28 +187,6 @@ devtools/client/framework/test/code_ugly*
devtools/server/tests/unit/babel_and_browserify_script_with_source_map.js
devtools/server/tests/unit/setBreakpoint*
# mobile/android/ exclusions
mobile/android/tests/
# Uses `#filter substitution`
mobile/android/b2gdroid/app/b2gdroid.js
mobile/android/app/mobile.js
mobile/android/chrome/content/healthreport-prefs.js
# Uses `#expand`
mobile/android/chrome/content/about.js
# Not much JS to lint and non-standard at that
mobile/android/installer/
mobile/android/locales/
# Non-standard `(catch ex if ...)`
mobile/android/chrome/content/browser.js
mobile/android/components/Snippets.js
# Bug 1178739: Ignore this file as a quick fix for "Illegal yield expression"
mobile/android/modules/HomeProvider.jsm
# services/ exclusions
# Uses `#filter substitution`
-3
View File
@@ -91,9 +91,6 @@ GPATH
# Git clone directory for updating web-platform-tests
testing/web-platform/sync/
# Android Gradle artifacts.
mobile/android/gradle/.gradle
# XCode project cruft
embedding/ios/GoannaEmbed/GoannaEmbed.xcodeproj/project.xcworkspace/xcuserdata
embedding/ios/GoannaEmbed/GoannaEmbed.xcodeproj/xcuserdata
-5
View File
@@ -36,11 +36,6 @@ def FlagsForFile(filename):
flag_list = shlex.split(out.getvalue())
# This flag is added by Fennec for android build and causes ycmd to fail to parse the file.
# Removing this flag is a workaround until ycmd starts to handle this flag properly.
# https://github.com/Valloric/YouCompleteMe/issues/1490
final_flags = [x for x in flag_list if not x.startswith('-march=armv')]
return {
'flags': final_flags,
'do_cache': True
+1 -1
View File
@@ -22,4 +22,4 @@
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more.
Clobber for CSS flow-root implementation
Issue #1971 - Update to ICU 63 requires clobber
+2 -38
View File
@@ -137,16 +137,10 @@ default:: $(BUILD_BACKEND_FILES)
endif
install_manifests := \
$(addprefix dist/,branding idl include public private sdk xpi-stage) \
$(addprefix dist/,branding bin idl include public private sdk xpi-stage) \
_tests \
$(NULL)
# Skip the dist/bin install manifest when using the hybrid
# FasterMake/RecursiveMake backend. This is a hack until bug 1241744 moves
# xpidl handling to FasterMake in that case, mechanically making the dist/bin
# install manifest non-existent (non-existent manifests being skipped)
ifeq (,$(filter FasterMake+RecursiveMake,$(BUILD_BACKENDS)))
install_manifests += dist/bin
endif
install_manifest_depends = \
CLOBBER \
$(configure_dir)/configure \
@@ -166,27 +160,6 @@ endif
.PHONY: install-manifests
install-manifests: $(addprefix install-,$(install_manifests))
# If we're using the hybrid FasterMake/RecursiveMake backend, we want
# to recurse in the faster/ directory in parallel of install manifests.
# But dist/idl needs to happen before (cf. dependencies in
# config/faster/rules.mk)
ifneq (,$(filter FasterMake+RecursiveMake,$(BUILD_BACKENDS)))
install-manifests: faster
.PHONY: faster
faster: install-dist/idl
$(MAKE) -C faster FASTER_RECURSIVE_MAKE=1
endif
.PHONY: tup
tup:
$(call BUILDSTATUS,TIERS make tup)
$(call BUILDSTATUS,TIER_START make)
$(MAKE) install-manifests buildid.h source-repo.h
$(call BUILDSTATUS,TIER_FINISH make)
$(call BUILDSTATUS,TIER_START tup)
@$(TUP) $(if $(findstring s,$(filter-out --%,$(MAKEFLAGS))),,--verbose)
$(call BUILDSTATUS,TIER_FINISH tup)
# process_install_manifest needs to be invoked with --no-remove when building
# js as standalone because automated builds are building nspr separately and
# that would remove the resulting files.
@@ -198,17 +171,8 @@ endif
.PHONY: $(addprefix install-,$(subst /,_,$(install_manifests)))
$(addprefix install-,$(install_manifests)): install-%: $(install_manifest_depends)
ifneq (,$(filter FasterMake+RecursiveMake,$(BUILD_BACKENDS)))
@# If we're using the hybrid FasterMake/RecursiveMake backend, we want
@# to ensure the FasterMake end doesn't have install manifests for the
@# same directory, because that would blow up
$(if $(wildcard _build_manifests/install/$(subst /,_,$*)),$(if $(wildcard faster/install_$(subst /,_,$*)*),$(error FasterMake and RecursiveMake ends of the hybrid build system want to handle $*)))
endif
$(addprefix $(call py_action,process_install_manifest,$(if $(NO_REMOVE),--no-remove )$*) ,$(wildcard _build_manifests/install/$(subst /,_,$*)))
# Dummy wrapper rule to allow the faster backend to piggy back
$(addprefix install-,$(subst /,_,$(filter dist/%,$(install_manifests)))): install-dist_%: install-dist/% ;
.PHONY: install-tests
install-tests: install-test-files
+1 -3
View File
@@ -9,8 +9,6 @@ selective cherry-picking of directly-applicable patches, this repository has its
own development and holds the base for a maintained platform to be used by XUL
applications.
For a list of active projects making use of the Unified XUL Platform, checkout http://thereisonlyxul.org/.
## Additional documentation
Additional documentation relevant to this source code can be found in the `/docs`
@@ -23,7 +21,7 @@ You are also always welcome to get in touch with our community on the [Pale Moon
### A note about trademarks and branding
Although this repository is licensed under Mozilla Public License v2.0, the
Although this repository is primarily licensed under Mozilla Public License v2.0, the
trademarks and brands contained herein remain the property of their respective
owners. For more details, please see the notifications in the respective directories.
+2 -3
View File
@@ -15,14 +15,14 @@ What should be considered vulnerabilities or security hazards by default:
Generally not security vulnerabilities:
- Null dereferencing crashes;
- Malware extensions (but please do report those on the forum in the extensions board!);
- Malware extensions (but please do report those on the forum in the add-ons board!);
- Denial-of-service (AKA "evil trap sites")
- Browser hangs
- Issues with non-standard manual configuration (either at build time or by manipulating about:config directly)
## Reporting a Vulnerability
If you find an issue in UXP or the applications it builds on that could impact the security or safety of users please **do not**
If you find an issue in UXP, or the applications building on it, that could impact the security or safety of users please **do not**
make an issue on Gitea about it. Gitea does not support restricted viewability for security sensitive bugs.
If you want to report a security-sensitive issue then please go to the [forum](https://forum.palemoon.org) and report the issue
@@ -33,4 +33,3 @@ except the recipient (not even moderators!).
You will be informed via private message if the vulnerability report is accepted or declined, with reasoning.
Security updates occur regularly and are given priority over most other development tasks. In general, they can be solved
relatively quickly and will be included in the next point release (third digit if not rolled into a more major one).
-2
View File
@@ -5,9 +5,7 @@
#include "AccIterator.h"
#include "AccGroupInfo.h"
#ifdef MOZ_XUL
#include "XULTreeAccessible.h"
#endif
#include "mozilla/dom/HTMLLabelElement.h"
-2
View File
@@ -341,8 +341,6 @@ LogRequest(nsIRequest* aRequest)
printf("targeted; ");
if (loadFlags & nsIChannel::LOAD_CALL_CONTENT_SNIFFERS)
printf("call content sniffers; ");
if (loadFlags & nsIChannel::LOAD_CLASSIFY_URI)
printf("classify uri; ");
} else {
printf(" no request");
}
@@ -13,7 +13,6 @@
#include "mozilla/dom/TabChild.h"
#include "mozilla/dom/Element.h"
#include "mozilla/Telemetry.h"
using namespace mozilla;
using namespace mozilla::a11y;
@@ -68,7 +68,6 @@
#include "mozilla/Services.h"
#include "nsDeckFrame.h"
#ifdef MOZ_XUL
#include "XULAlertAccessible.h"
#include "XULColorPickerAccessible.h"
#include "XULComboboxAccessible.h"
@@ -79,7 +78,6 @@
#include "XULSliderAccessible.h"
#include "XULTabAccessible.h"
#include "XULTreeGridAccessibleWrap.h"
#endif
#if defined(XP_WIN) || defined(MOZ_ACCESSIBILITY_ATK)
#include "nsNPAPIPluginInstance.h"
@@ -1356,7 +1354,6 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
}
RefPtr<Accessible> accessible;
#ifdef MOZ_XUL
// XUL controls
if (role.EqualsLiteral("xul:alert")) {
accessible = new XULAlertAccessible(aContent, aDoc);
@@ -1515,7 +1512,6 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
accessible = new XULToolbarButtonAccessible(aContent, aDoc);
}
#endif // MOZ_XUL
return accessible.forget();
}
@@ -1739,7 +1735,6 @@ nsAccessibilityService::HasAccessible(nsIDOMNode* aDOMNode)
////////////////////////////////////////////////////////////////////////////////
// nsAccessibilityService private (DON'T put methods here)
#ifdef MOZ_XUL
already_AddRefed<Accessible>
nsAccessibilityService::CreateAccessibleForXULTree(nsIContent* aContent,
DocAccessible* aDoc)
@@ -1769,7 +1764,6 @@ nsAccessibilityService::CreateAccessibleForXULTree(nsIContent* aContent,
new XULTreeGridAccessibleWrap(aContent, aDoc, treeFrame);
return accessible.forget();
}
#endif
nsAccessibilityService*
GetOrCreateAccService(uint32_t aNewConsumer)
-2
View File
@@ -274,13 +274,11 @@ private:
CreateAccessibleByFrameType(nsIFrame* aFrame, nsIContent* aContent,
Accessible* aContext);
#ifdef MOZ_XUL
/**
* Create accessible for XUL tree element.
*/
already_AddRefed<Accessible>
CreateAccessibleForXULTree(nsIContent* aContent, DocAccessible* aDoc);
#endif
/**
* Reference for accessibility service instance.
-6
View File
@@ -48,9 +48,7 @@
#include "mozilla/dom/DocumentType.h"
#include "mozilla/dom/Element.h"
#ifdef MOZ_XUL
#include "nsIXULDocument.h"
#endif
using namespace mozilla;
using namespace mozilla::a11y;
@@ -210,11 +208,9 @@ DocAccessible::NativeRole()
return roles::CHROME_WINDOW;
if (itemType == nsIDocShellTreeItem::typeContent) {
#ifdef MOZ_XUL
nsCOMPtr<nsIXULDocument> xulDoc(do_QueryInterface(mDocumentNode));
if (xulDoc)
return roles::APPLICATION;
#endif
return roles::DOCUMENT;
}
}
@@ -387,13 +383,11 @@ DocAccessible::URL(nsAString& aURL) const
void
DocAccessible::DocType(nsAString& aType) const
{
#ifdef MOZ_XUL
nsCOMPtr<nsIXULDocument> xulDoc(do_QueryInterface(mDocumentNode));
if (xulDoc) {
aType.AssignLiteral("window"); // doctype not implemented for XUL at time of writing - causes assertion
return;
}
#endif
dom::DocumentType* docType = mDocumentNode->GetDoctype();
if (docType)
docType->GetPublicId(aType);
+8 -31
View File
@@ -19,9 +19,7 @@
#include "Relation.h"
#include "Role.h"
#include "States.h"
#ifdef MOZ_XUL
#include "XULTreeAccessible.h"
#endif
#include "mozilla/dom/Element.h"
@@ -43,10 +41,8 @@
#include "nsFocusManager.h"
#include "nsGlobalWindow.h"
#ifdef MOZ_XUL
#include "nsIXULDocument.h"
#include "nsIXULWindow.h"
#endif
using namespace mozilla;
using namespace mozilla::a11y;
@@ -102,7 +98,6 @@ RootAccessible::NativeRole()
}
// RootAccessible protected member
#ifdef MOZ_XUL
uint32_t
RootAccessible::GetChromeFlags()
{
@@ -122,7 +117,6 @@ RootAccessible::GetChromeFlags()
xulWin->GetChromeFlags(&chromeFlags);
return chromeFlags;
}
#endif
uint64_t
RootAccessible::NativeState()
@@ -131,7 +125,6 @@ RootAccessible::NativeState()
if (state & states::DEFUNCT)
return state;
#ifdef MOZ_XUL
uint32_t chromeFlags = GetChromeFlags();
if (chromeFlags & nsIWebBrowserChrome::CHROME_WINDOW_RESIZE)
state |= states::SIZEABLE;
@@ -142,7 +135,6 @@ RootAccessible::NativeState()
state |= states::MOVEABLE;
if (chromeFlags & nsIWebBrowserChrome::CHROME_MODAL)
state |= states::MODAL;
#endif
nsFocusManager* fm = nsFocusManager::GetFocusManager();
if (fm && fm->GetActiveWindow() == mDocumentNode->GetWindow())
@@ -292,7 +284,6 @@ RootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
if (!accessible)
return;
#ifdef MOZ_XUL
XULTreeAccessible* treeAcc = accessible->AsXULTree();
if (treeAcc) {
if (eventType.EqualsLiteral("TreeRowCountChanged")) {
@@ -305,7 +296,6 @@ RootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
return;
}
}
#endif
if (eventType.EqualsLiteral("RadioStateChange")) {
uint64_t state = accessible->State();
@@ -341,7 +331,6 @@ RootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
}
Accessible* treeItemAcc = nullptr;
#ifdef MOZ_XUL
// If it's a tree element, need the currently selected item.
if (treeAcc) {
treeItemAcc = accessible->CurrentItem();
@@ -385,29 +374,22 @@ RootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
nsEventShell::FireEvent(selChangeEvent);
return;
}
}
else
#endif
if (eventType.EqualsLiteral("AlertActive")) {
} else if (eventType.EqualsLiteral("AlertActive")) {
nsEventShell::FireEvent(nsIAccessibleEvent::EVENT_ALERT, accessible);
}
else if (eventType.EqualsLiteral("popupshown")) {
} else if (eventType.EqualsLiteral("popupshown")) {
HandlePopupShownEvent(accessible);
}
else if (eventType.EqualsLiteral("DOMMenuInactive")) {
} else if (eventType.EqualsLiteral("DOMMenuInactive")) {
if (accessible->Role() == roles::MENUPOPUP) {
nsEventShell::FireEvent(nsIAccessibleEvent::EVENT_MENUPOPUP_END,
accessible);
}
}
else if (eventType.EqualsLiteral("DOMMenuItemActive")) {
} else if (eventType.EqualsLiteral("DOMMenuItemActive")) {
FocusMgr()->ActiveItemChanged(accessible);
#ifdef A11Y_LOG
if (logging::IsEnabled(logging::eFocus))
logging::ActiveItemChangeCausedBy("DOMMenuItemActive", accessible);
#endif
}
else if (eventType.EqualsLiteral("DOMMenuItemInactive")) {
} else if (eventType.EqualsLiteral("DOMMenuItemInactive")) {
// Process DOMMenuItemInactive event for autocomplete only because this is
// unique widget that may acquire focus from autocomplete popup while popup
// stays open and has no active item. In case of XUL tree autocomplete
@@ -421,8 +403,7 @@ RootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
logging::ActiveItemChangeCausedBy("DOMMenuItemInactive", accessible);
#endif
}
}
else if (eventType.EqualsLiteral("DOMMenuBarActive")) { // Always from user input
} else if (eventType.EqualsLiteral("DOMMenuBarActive")) { // Always from user input
nsEventShell::FireEvent(nsIAccessibleEvent::EVENT_MENU_START,
accessible, eFromUserInput);
@@ -440,8 +421,7 @@ RootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
logging::ActiveItemChangeCausedBy("DOMMenuBarActive", accessible);
#endif
}
}
else if (eventType.EqualsLiteral("DOMMenuBarInactive")) { // Always from user input
} else if (eventType.EqualsLiteral("DOMMenuBarInactive")) { // Always from user input
nsEventShell::FireEvent(nsIAccessibleEvent::EVENT_MENU_END,
accessible, eFromUserInput);
@@ -450,8 +430,7 @@ RootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
if (logging::IsEnabled(logging::eFocus))
logging::ActiveItemChangeCausedBy("DOMMenuBarInactive", accessible);
#endif
}
else if (accessible->NeedsDOMUIEvent() &&
} else if (accessible->NeedsDOMUIEvent() &&
eventType.EqualsLiteral("ValueChange")) {
uint32_t event = accessible->HasNumericValue()
? nsIAccessibleEvent::EVENT_VALUE_CHANGE
@@ -650,7 +629,6 @@ RootAccessible::HandlePopupHidingEvent(nsINode* aPopupNode)
}
}
#ifdef MOZ_XUL
void
RootAccessible::HandleTreeRowCountChangedEvent(nsIDOMEvent* aEvent,
XULTreeAccessible* aAccessible)
@@ -714,7 +692,6 @@ RootAccessible::HandleTreeInvalidatedEvent(nsIDOMEvent* aEvent,
aAccessible->TreeViewInvalidated(startRow, endRow, startCol, endCol);
}
#endif
ProxyAccessible*
RootAccessible::GetPrimaryRemoteTopLevelContentDoc() const
+5 -7
View File
@@ -70,14 +70,12 @@ protected:
*/
void HandlePopupHidingEvent(nsINode* aNode);
#ifdef MOZ_XUL
void HandleTreeRowCountChangedEvent(nsIDOMEvent* aEvent,
XULTreeAccessible* aAccessible);
void HandleTreeInvalidatedEvent(nsIDOMEvent* aEvent,
XULTreeAccessible* aAccessible);
void HandleTreeRowCountChangedEvent(nsIDOMEvent* aEvent,
XULTreeAccessible* aAccessible);
void HandleTreeInvalidatedEvent(nsIDOMEvent* aEvent,
XULTreeAccessible* aAccessible);
uint32_t GetChromeFlags();
#endif
uint32_t GetChromeFlags();
};
inline RootAccessible*
+5 -26
View File
@@ -64,9 +64,7 @@ this.AccessFu = { // jshint ignore:line
if (this._enabled) {
this._disable();
}
if (Utils.MozBuildApp === 'mobile/android') {
Services.obs.removeObserver(this, 'Accessibility:Settings');
} else if (Utils.win.navigator.mozSettings) {
if (Utils.win.navigator.mozSettings) {
Utils.win.navigator.mozSettings.removeObserver(
SCREENREADER_SETTING, this.handleEvent);
}
@@ -585,11 +583,7 @@ var Output = {
get androidBridge() {
delete this.androidBridge;
if (Utils.MozBuildApp === 'mobile/android') {
this.androidBridge = Services.androidBridge;
} else {
this.androidBridge = null;
}
this.androidBridge = null;
return this.androidBridge;
},
@@ -815,12 +809,6 @@ var Input = {
target.blur();
}
}
if (Utils.MozBuildApp == 'mobile/android') {
// Return focus to native Android browser chrome.
Services.androidBridge.handleGeckoMessage(
{ type: 'ToggleChrome:Focus' });
}
break;
case aEvent.DOM_VK_RETURN:
if (this.editState.editing) {
@@ -837,18 +825,9 @@ var Input = {
},
moveToPoint: function moveToPoint(aRule, aX, aY) {
// XXX: Bug 1013408 - There is no alignment between the chrome window's
// viewport size and the content viewport size in Android. This makes
// sending mouse events beyond its bounds impossible.
if (Utils.MozBuildApp === 'mobile/android') {
let mm = Utils.getMessageManager(Utils.CurrentBrowser);
mm.sendAsyncMessage('AccessFu:MoveToPoint',
{rule: aRule, x: aX, y: aY, origin: 'top'});
} else {
let win = Utils.win;
Utils.winUtils.sendMouseEvent('mousemove',
aX - win.mozInnerScreenX, aY - win.mozInnerScreenY, 0, 0, 0);
}
let win = Utils.win;
Utils.winUtils.sendMouseEvent('mousemove',
aX - win.mozInnerScreenX, aY - win.mozInnerScreenY, 0, 0, 0);
},
moveCursor: function moveCursor(aAction, aRule, aInputType, aAdjustRange) {
+1 -3
View File
@@ -76,8 +76,6 @@ const EDGE = 0.1;
const TIMEOUT_MULTIPLIER = 1;
// A single pointer down/up sequence periodically precedes the tripple swipe
// gesture on Android. This delay acounts for that.
const IS_ANDROID = Utils.MozBuildApp === 'mobile/android' &&
Utils.AndroidSdkVersion >= 14;
/**
* A point object containing distance travelled data.
@@ -206,7 +204,7 @@ this.GestureTracker = { // jshint ignore:line
if (aDetail.type !== 'pointerdown') {
return;
}
let GestureConstructor = aGesture || (IS_ANDROID ? DoubleTap : Tap);
let GestureConstructor = aGesture || Tap;
this._create(GestureConstructor);
this._update(aDetail, aTimeStamp);
},
+1 -1
View File
@@ -786,7 +786,7 @@ this.UtteranceGenerator = { // jshint ignore:line
// This is because we expose the checked information on the node itself.
// XXX: this means the checked state is always appended to the end,
// regardless of the utterance ordering preference.
if ((Utils.AndroidSdkVersion < 16 || Utils.MozBuildApp === 'browser') &&
if (Utils.MozBuildApp === 'browser' &&
aState.contains(States.CHECKABLE)) {
let checked = aState.contains(States.CHECKED);
let statetr;
-12
View File
@@ -39,13 +39,6 @@ var PointerRelay = { // jshint ignore:line
delete this._eventsOfInterest;
switch (Utils.widgetToolkit) {
case 'android':
this._eventsOfInterest = {
'touchstart' : true,
'touchmove' : true,
'touchend' : true };
break;
default:
// Desktop.
this._eventsOfInterest = {
@@ -110,11 +103,6 @@ var PointerRelay = { // jshint ignore:line
target: aEvent.target
}];
if (Utils.widgetToolkit === 'android' &&
changedTouches.length === 1 && changedTouches[0].identifier === 1) {
return;
}
if (changedTouches.length === 1 &&
changedTouches[0].identifier === SYNTH_ID) {
return;
+17 -30
View File
@@ -257,11 +257,8 @@ AndroidPresenter.prototype.pivotChanged =
let androidEvents = [];
let isExploreByTouch = (aReason == Ci.nsIAccessiblePivot.REASON_POINT &&
Utils.AndroidSdkVersion >= 14);
let focusEventType = (Utils.AndroidSdkVersion >= 16) ?
this.ANDROID_VIEW_ACCESSIBILITY_FOCUSED :
this.ANDROID_VIEW_FOCUSED;
let isExploreByTouch = (aReason == Ci.nsIAccessiblePivot.REASON_POINT);
let focusEventType = this.ANDROID_VIEW_ACCESSIBILITY_FOCUSED;
if (isExploreByTouch) {
// This isn't really used by TalkBack so this is a half-hearted attempt
@@ -270,25 +267,21 @@ AndroidPresenter.prototype.pivotChanged =
}
let brailleOutput = {};
if (Utils.AndroidSdkVersion >= 16) {
if (!this._braillePresenter) {
this._braillePresenter = new BraillePresenter();
}
brailleOutput = this._braillePresenter.pivotChanged(aContext, aReason).
details;
if (!this._braillePresenter) {
this._braillePresenter = new BraillePresenter();
}
brailleOutput = this._braillePresenter.pivotChanged(aContext, aReason).
details;
if (aReason === Ci.nsIAccessiblePivot.REASON_TEXT) {
if (Utils.AndroidSdkVersion >= 16) {
let adjustedText = aContext.textAndAdjustedOffsets;
let adjustedText = aContext.textAndAdjustedOffsets;
androidEvents.push({
eventType: this.ANDROID_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY,
text: [adjustedText.text],
fromIndex: adjustedText.startOffset,
toIndex: adjustedText.endOffset
});
}
androidEvents.push({
eventType: this.ANDROID_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY,
text: [adjustedText.text],
fromIndex: adjustedText.startOffset,
toIndex: adjustedText.endOffset
});
} else {
let state = Utils.getState(aContext.accessible);
androidEvents.push({eventType: (isExploreByTouch) ?
@@ -371,7 +364,7 @@ AndroidPresenter.prototype.textSelectionChanged =
aOldEnd, aIsFromUserInput) {
let androidEvents = [];
if (Utils.AndroidSdkVersion >= 14 && !aIsFromUserInput) {
if (!aIsFromUserInput) {
if (!this._braillePresenter) {
this._braillePresenter = new BraillePresenter();
}
@@ -388,7 +381,7 @@ AndroidPresenter.prototype.textSelectionChanged =
});
}
if (Utils.AndroidSdkVersion >= 16 && aIsFromUserInput) {
if (aIsFromUserInput) {
let [from, to] = aOldStart < aStart ?
[aOldStart, aStart] : [aStart, aOldStart];
androidEvents.push({
@@ -407,10 +400,6 @@ AndroidPresenter.prototype.textSelectionChanged =
AndroidPresenter.prototype.viewportChanged =
function AndroidPresenter_viewportChanged(aWindow, aCurrentContext) {
if (Utils.AndroidSdkVersion < 14) {
return null;
}
let events = [{
eventType: this.ANDROID_VIEW_SCROLLED,
text: [],
@@ -420,7 +409,7 @@ AndroidPresenter.prototype.viewportChanged =
maxScrollY: aWindow.scrollMaxY
}];
if (Utils.AndroidSdkVersion >= 16 && aCurrentContext) {
if (aCurrentContext) {
let currentAcc = aCurrentContext.accessibleForBounds;
if (Utils.isAliveAndVisible(currentAcc)) {
events.push({
@@ -447,8 +436,7 @@ AndroidPresenter.prototype.announce =
return {
type: this.type,
details: [{
eventType: (Utils.AndroidSdkVersion >= 16) ?
this.ANDROID_ANNOUNCEMENT : this.ANDROID_VIEW_TEXT_CHANGED,
eventType: this.ANDROID_ANNOUNCEMENT,
text: [localizedAnnouncement],
addedCount: localizedAnnouncement.length,
removedCount: 0,
@@ -680,7 +668,6 @@ this.Presentation = { // jshint ignore:line
get presenters() {
delete this.presenters;
let presenterMap = {
'mobile/android': [VisualPresenter, AndroidPresenter],
'b2g': [VisualPresenter, B2GPresenter],
'browser': [VisualPresenter, B2GPresenter, AndroidPresenter]
};
+1 -28
View File
@@ -33,9 +33,7 @@ this.Utils = { // jshint ignore:line
_buildAppMap: {
'{3c2e2abc-06d4-11e1-ac3b-374f68613e61}': 'b2g',
'{d1bfe7d9-c01e-4237-998b-7b5f960a4314}': 'graphene',
'{ec8030f7-c20a-464f-9b0e-13a3a9e97384}': 'browser',
'{aa3c5121-dab2-40e2-81ca-7ea25febc110}': 'mobile/android',
'{a23983c0-fd0e-11dc-95ff-0800200c9a66}': 'mobile/xul'
'{ec8030f7-c20a-464f-9b0e-13a3a9e97384}': 'browser'
},
init: function Utils_init(aWindow) {
@@ -111,35 +109,13 @@ this.Utils = { // jshint ignore:line
return this._ScriptName;
},
get AndroidSdkVersion() {
if (!this._AndroidSdkVersion) {
if (Services.appinfo.OS == 'Android') {
this._AndroidSdkVersion = Services.sysinfo.getPropertyAsInt32(
'version');
} else {
// Most useful in desktop debugging.
this._AndroidSdkVersion = 16;
}
}
return this._AndroidSdkVersion;
},
set AndroidSdkVersion(value) {
// When we want to mimic another version.
this._AndroidSdkVersion = value;
},
get BrowserApp() {
if (!this.win) {
return null;
}
switch (this.MozBuildApp) {
case 'mobile/android':
return this.win.BrowserApp;
case 'browser':
return this.win.gBrowser;
case 'b2g':
return this.win.shell;
default:
return null;
}
@@ -149,9 +125,6 @@ this.Utils = { // jshint ignore:line
if (!this.BrowserApp) {
return null;
}
if (this.MozBuildApp == 'b2g') {
return this.BrowserApp.contentBrowser;
}
return this.BrowserApp.selectedBrowser;
},
+2 -4
View File
@@ -21,12 +21,10 @@ DIRS += [ 'aom',
'interfaces',
'ipc',
'jsat',
'xpcom'
'xpcom',
'xul'
]
if CONFIG['MOZ_XUL']:
DIRS += ['xul']
TEST_DIRS += ['tests/mochitest']
BROWSER_CHROME_MANIFESTS += [
@@ -67,7 +67,7 @@
* Change scrollbar styles from hidden to auto. That makes us to create an
* accessible for scroll area.
*/
function changeScrollbarStyles(aContainerID, aScrollAreaID)
function changeScrollStyles(aContainerID, aScrollAreaID)
{
this.container = getAccessible(aContainerID);
this.scrollAreaNode = getNode(aScrollAreaID);
@@ -77,7 +77,7 @@
new invokerChecker(EVENT_REORDER, this.container)
];
this.invoke = function changeScrollbarStyles_invoke()
this.invoke = function changeScrollStyles_invoke()
{
var accTree =
{ SECTION: [] };
@@ -86,7 +86,7 @@
this.scrollAreaNode.style.overflow = "auto";
}
this.finalCheck = function changeScrollbarStyles_finalCheck()
this.finalCheck = function changeScrollStyles_finalCheck()
{
var accTree =
{ SECTION: [ // container
@@ -95,7 +95,7 @@
testAccessibleTree(this.container, accTree);
}
this.getID = function changeScrollbarStyles_getID()
this.getID = function changeScrollStyles_getID()
{
return "change scrollbar styles " + prettyName(aScrollAreaID);
}
@@ -114,7 +114,7 @@
gQueue = new eventQueue();
gQueue.push(new changeScrollRange("container", "scrollarea"));
gQueue.push(new changeScrollbarStyles("container2", "scrollarea2"));
gQueue.push(new changeScrollStyles("container2", "scrollarea2"));
gQueue.invoke(); // Will call SimpleTest.finish();
}
-13
View File
@@ -35,19 +35,6 @@ a11y::PlatformInit()
nsWinUtils::MaybeStartWindowEmulation();
ia2AccessibleText::InitTextChangeData();
if (BrowserTabsRemoteAutostart()) {
mscom::InterceptorLog::Init();
UniquePtr<RegisteredProxy> regProxy(
mscom::RegisterProxy(L"ia2marshal.dll"));
gRegProxy = regProxy.release();
UniquePtr<RegisteredProxy> regAccTlb(
mscom::RegisterTypelib(L"oleacc.dll",
RegistrationFlags::eUseSystemDirectory));
gRegAccTlb = regAccTlb.release();
UniquePtr<RegisteredProxy> regMiscTlb(
mscom::RegisterTypelib(L"Accessible.tlb"));
gRegMiscTlb = regMiscTlb.release();
}
}
void
+3 -7
View File
@@ -33,15 +33,11 @@ SOURCES += [
'RootAccessibleWrap.cpp',
'ServiceProvider.cpp',
'TextLeafAccessibleWrap.cpp',
'XULListboxAccessibleWrap.cpp',
'XULMenuAccessibleWrap.cpp',
'XULTreeGridAccessibleWrap.cpp',
]
if CONFIG['MOZ_XUL']:
SOURCES += [
'XULListboxAccessibleWrap.cpp',
'XULMenuAccessibleWrap.cpp',
'XULTreeGridAccessibleWrap.cpp',
]
LOCAL_INCLUDES += [
'/accessible/base',
'/accessible/generic',
Vendored
-2
View File
@@ -21,12 +21,10 @@ builtin(include, build/autoconf/frameptr.m4)dnl
builtin(include, build/autoconf/compiler-opts.m4)dnl
builtin(include, build/autoconf/expandlibs.m4)dnl
builtin(include, build/autoconf/arch.m4)dnl
builtin(include, build/autoconf/android.m4)dnl
builtin(include, build/autoconf/zlib.m4)dnl
builtin(include, build/autoconf/icu.m4)dnl
builtin(include, build/autoconf/clang-plugin.m4)dnl
builtin(include, build/autoconf/alloc.m4)dnl
builtin(include, build/autoconf/ios.m4)dnl
builtin(include, build/autoconf/sanitize.m4)dnl
MOZ_PROG_CHECKMSYS()
-129
View File
@@ -1,129 +0,0 @@
import java.util.regex.Pattern
allprojects {
// Expose the per-object-directory configuration to all projects.
ext {
mozconfig = gradle.mozconfig
topsrcdir = gradle.mozconfig.topsrcdir
topobjdir = gradle.mozconfig.topobjdir
}
repositories {
if (gradle.mozconfig.substs.GRADLE_MAVEN_REPOSITORY) {
maven {
url gradle.mozconfig.substs.GRADLE_MAVEN_REPOSITORY
}
}
}
}
buildDir "${topobjdir}/gradle/build"
buildscript {
repositories {
if (gradle.mozconfig.substs.GRADLE_MAVEN_REPOSITORY) {
maven {
url gradle.mozconfig.substs.GRADLE_MAVEN_REPOSITORY
}
}
// For android-sdk-manager SNAPSHOT releases.
maven {
url "file://${gradle.mozconfig.topsrcdir}/mobile/android/gradle/m2repo"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
classpath('com.stanfy.spoon:spoon-gradle-plugin:1.0.4') {
// Without these, we get errors linting.
exclude module: 'guava'
}
// Provided in tree.
classpath 'com.jakewharton.sdkmanager:gradle-plugin:1.5.0-SNAPSHOT'
}
}
task generateCodeAndResources(type:Exec) {
workingDir "${topobjdir}"
commandLine mozconfig.substs.GMAKE
args '-C'
args "${topobjdir}/mobile/android/base"
args 'gradle-targets'
// Only show the output if something went wrong.
ignoreExitValue = true
standardOutput = new ByteArrayOutputStream()
errorOutput = standardOutput
doLast {
if (execResult.exitValue != 0) {
throw new GradleException("Process '${commandLine}' finished with non-zero exit value ${execResult.exitValue}:\n\n${standardOutput.toString()}")
}
}
}
// Skip unit test for all build variants, unless if it was specifically requested by user.
// The enabled property for the unit test tasks is reset based on the command line task names just before the task execution.
// I bet there is a easier/cleaner way to do this, but this gets the job done for now.
Pattern pattern = Pattern.compile('.*test(.+UnitTest)?.*')
boolean startTasksIncludeTest = gradle.startParameter.taskNames.any {
taskName ->
taskName.matches(pattern)
}
gradle.taskGraph.beforeTask {
Task task ->
if (task.name.matches(pattern)) {
task.enabled = startTasksIncludeTest
}
}
afterEvaluate {
subprojects {
if (!hasProperty('android')) {
return
}
android.applicationVariants.all {
preBuild.dependsOn rootProject.generateCodeAndResources
}
android.libraryVariants.all {
preBuild.dependsOn rootProject.generateCodeAndResources
}
}
}
apply plugin: 'idea'
idea {
project {
languageLevel = '1.7'
}
module {
// Object directories take a huge amount of time for IntelliJ to index.
// Exclude them. Convention is that object directories start with obj.
// IntelliJ is clever and will not exclude the parts of the object
// directory that are referenced, if there are any. In practice,
// indexing the entirety of the tree is taking too long, so exclude all
// but mobile/.
def topsrcdirURI = file(topsrcdir).toURI()
excludeDirs += files(file(topsrcdir)
.listFiles({it.isDirectory()} as FileFilter)
.collect({topsrcdirURI.relativize(it.toURI()).toString()}) // Relative paths.
.findAll({!it.equals('mobile/')}))
// If topobjdir is below topsrcdir, hide only some portions of that tree.
def topobjdirURI = file(topobjdir).toURI()
if (!topsrcdirURI.relativize(topobjdirURI).isAbsolute()) {
excludeDirs -= file(topobjdir)
excludeDirs += files(file(topobjdir).listFiles())
excludeDirs -= file("${topobjdir}/gradle")
}
if (!mozconfig.substs.MOZ_INSTALL_TRACKING) {
excludeDirs += file("${topsrcdir}/mobile/android/thirdparty/com/adjust")
}
}
}
task wrapper(type: Wrapper) {
}
@@ -1,54 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.annotationProcessors;
/**
* Object holding annotation data. Used by GeneratableElementIterator.
*/
public class AnnotationInfo {
public enum ExceptionMode {
ABORT,
NSRESULT,
IGNORE;
String nativeValue() {
return "mozilla::jni::ExceptionMode::" + name();
}
}
public enum CallingThread {
GECKO,
UI,
ANY;
String nativeValue() {
return "mozilla::jni::CallingThread::" + name();
}
}
public enum DispatchTarget {
GECKO,
PROXY,
CURRENT;
String nativeValue() {
return "mozilla::jni::DispatchTarget::" + name();
}
}
public final String wrapperName;
public final ExceptionMode exceptionMode;
public final CallingThread callingThread;
public final DispatchTarget dispatchTarget;
public AnnotationInfo(String wrapperName, ExceptionMode exceptionMode,
CallingThread callingThread, DispatchTarget dispatchTarget) {
this.wrapperName = wrapperName;
this.exceptionMode = exceptionMode;
this.callingThread = callingThread;
this.dispatchTarget = dispatchTarget;
}
}
@@ -1,175 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.annotationProcessors;
import org.mozilla.gecko.annotationProcessors.classloader.AnnotatableEntity;
import org.mozilla.gecko.annotationProcessors.classloader.ClassWithOptions;
import org.mozilla.gecko.annotationProcessors.classloader.IterableJarLoadingURLClassLoader;
import org.mozilla.gecko.annotationProcessors.utils.GeneratableElementIterator;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Arrays;
import java.util.Iterator;
public class AnnotationProcessor {
public static final String GENERATED_COMMENT =
"// GENERATED CODE\n" +
"// Generated by the Java program at /build/annotationProcessors at compile time\n" +
"// from annotations on Java methods. To update, change the annotations on the\n" +
"// corresponding Java methods and rerun the build. Manually updating this file\n" +
"// will cause your build to fail.\n" +
"\n";
private static final StringBuilder headerFile = new StringBuilder(GENERATED_COMMENT);
private static final StringBuilder implementationFile = new StringBuilder(GENERATED_COMMENT);
private static final StringBuilder nativesFile = new StringBuilder(GENERATED_COMMENT);
public static void main(String[] args) {
// We expect a list of jars on the commandline. If missing, whinge about it.
if (args.length <= 2) {
System.err.println("Usage: java AnnotationProcessor outprefix jarfiles ...");
System.exit(1);
}
final String OUTPUT_PREFIX = args[0];
final String SOURCE_FILE = OUTPUT_PREFIX + "JNIWrappers.cpp";
final String HEADER_FILE = OUTPUT_PREFIX + "JNIWrappers.h";
final String NATIVES_FILE = OUTPUT_PREFIX + "JNINatives.h";
System.out.println("Processing annotations...");
// We want to produce the same output as last time as often as possible. Ordering of
// generated statements, therefore, needs to be consistent.
final String[] jars = Arrays.copyOfRange(args, 1, args.length);
Arrays.sort(jars);
// Start the clock!
long s = System.currentTimeMillis();
// Get an iterator over the classes in the jar files given...
Iterator<ClassWithOptions> jarClassIterator = IterableJarLoadingURLClassLoader.getIteratorOverJars(jars);
headerFile.append(
"#ifndef " + getHeaderGuardName(HEADER_FILE) + "\n" +
"#define " + getHeaderGuardName(HEADER_FILE) + "\n" +
"\n" +
"#include \"mozilla/jni/Refs.h\"\n" +
"\n" +
"namespace mozilla {\n" +
"namespace java {\n" +
"\n");
implementationFile.append(
"#include \"" + HEADER_FILE + "\"\n" +
"#include \"mozilla/jni/Accessors.h\"\n" +
"\n" +
"namespace mozilla {\n" +
"namespace java {\n" +
"\n");
nativesFile.append(
"#ifndef " + getHeaderGuardName(NATIVES_FILE) + "\n" +
"#define " + getHeaderGuardName(NATIVES_FILE) + "\n" +
"\n" +
"#include \"" + HEADER_FILE + "\"\n" +
"#include \"mozilla/jni/Natives.h\"\n" +
"\n" +
"namespace mozilla {\n" +
"namespace java {\n" +
"\n");
while (jarClassIterator.hasNext()) {
generateClass(jarClassIterator.next());
}
implementationFile.append(
"} /* java */\n" +
"} /* mozilla */\n");
headerFile.append(
"} /* java */\n" +
"} /* mozilla */\n" +
"#endif // " + getHeaderGuardName(HEADER_FILE) + "\n");
nativesFile.append(
"} /* java */\n" +
"} /* mozilla */\n" +
"#endif // " + getHeaderGuardName(NATIVES_FILE) + "\n");
writeOutputFile(SOURCE_FILE, implementationFile);
writeOutputFile(HEADER_FILE, headerFile);
writeOutputFile(NATIVES_FILE, nativesFile);
long e = System.currentTimeMillis();
System.out.println("Annotation processing complete in " + (e - s) + "ms");
}
private static void generateClass(final ClassWithOptions annotatedClass) {
// Get an iterator over the appropriately generated methods of this class
final GeneratableElementIterator methodIterator
= new GeneratableElementIterator(annotatedClass);
final ClassWithOptions[] innerClasses = methodIterator.getInnerClasses();
if (!methodIterator.hasNext() && innerClasses.length == 0) {
return;
}
final CodeGenerator generatorInstance = new CodeGenerator(annotatedClass);
generatorInstance.generateClasses(innerClasses);
// Iterate all annotated members in this class..
while (methodIterator.hasNext()) {
AnnotatableEntity aElementTuple = methodIterator.next();
switch (aElementTuple.mEntityType) {
case METHOD:
generatorInstance.generateMethod(aElementTuple);
break;
case NATIVE:
generatorInstance.generateNative(aElementTuple);
break;
case FIELD:
generatorInstance.generateField(aElementTuple);
break;
case CONSTRUCTOR:
generatorInstance.generateConstructor(aElementTuple);
break;
}
}
headerFile.append(generatorInstance.getHeaderFileContents());
implementationFile.append(generatorInstance.getWrapperFileContents());
nativesFile.append(generatorInstance.getNativesFileContents());
for (ClassWithOptions innerClass : innerClasses) {
generateClass(innerClass);
}
}
private static String getHeaderGuardName(final String name) {
return name.replaceAll("\\W", "_");
}
private static void writeOutputFile(final String name,
final StringBuilder content) {
FileOutputStream outStream = null;
try {
outStream = new FileOutputStream(name);
outStream.write(content.toString().getBytes());
} catch (IOException e) {
System.err.println("Unable to write " + name + ". Perhaps a permissions issue?");
e.printStackTrace(System.err);
} finally {
if (outStream != null) {
try {
outStream.close();
} catch (IOException e) {
System.err.println("Unable to close outStream due to "+e);
e.printStackTrace(System.err);
}
}
}
}
}
@@ -1,627 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.annotationProcessors;
import org.mozilla.gecko.annotationProcessors.classloader.AnnotatableEntity;
import org.mozilla.gecko.annotationProcessors.classloader.ClassWithOptions;
import org.mozilla.gecko.annotationProcessors.utils.Utils;
import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Member;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.HashSet;
public class CodeGenerator {
private static final Class<?>[] EMPTY_CLASS_ARRAY = new Class<?>[0];
// Buffers holding the strings to ultimately be written to the output files.
private final StringBuilder cpp = new StringBuilder();
private final StringBuilder header = new StringBuilder();
private final StringBuilder natives = new StringBuilder();
private final StringBuilder nativesInits = new StringBuilder();
private final Class<?> cls;
private final String clsName;
private AnnotationInfo.CallingThread callingThread = null;
private int numNativesInits;
private final HashSet<String> takenMethodNames = new HashSet<String>();
public CodeGenerator(ClassWithOptions annotatedClass) {
this.cls = annotatedClass.wrappedClass;
this.clsName = annotatedClass.generatedName;
final String unqualifiedName = Utils.getUnqualifiedName(clsName);
header.append(
"class " + clsName + " : public mozilla::jni::ObjectBase<" +
unqualifiedName + ">\n" +
"{\n" +
"public:\n" +
" static const char name[];\n" +
"\n" +
" explicit " + unqualifiedName + "(const Context& ctx) : ObjectBase<" +
unqualifiedName + ">(ctx) {}\n" +
"\n");
cpp.append(
"const char " + clsName + "::name[] =\n" +
" \"" + cls.getName().replace('.', '/') + "\";\n" +
"\n");
natives.append(
"template<class Impl>\n" +
"class " + clsName + "::Natives : " +
"public mozilla::jni::NativeImpl<" + unqualifiedName + ", Impl>\n" +
"{\n" +
"public:\n");
}
private String getTraitsName(String uniqueName, boolean includeScope) {
return (includeScope ? clsName + "::" : "") + uniqueName + "_t";
}
/**
* Return the C++ type name for this class or any class within the chain
* of declaring classes, if the target class matches the given type.
*
* Return null if the given type does not match any class searched.
*/
private String getMatchingClassType(final Class<?> type) {
Class<?> cls = this.cls;
String clsName = this.clsName;
while (cls != null) {
if (type.equals(cls)) {
return clsName;
}
cls = cls.getDeclaringClass();
clsName = clsName.substring(0, Math.max(0, clsName.lastIndexOf("::")));
}
return null;
}
private String getNativeParameterType(Class<?> type, AnnotationInfo info) {
final String clsName = getMatchingClassType(type);
if (clsName != null) {
return Utils.getUnqualifiedName(clsName) + "::Param";
}
return Utils.getNativeParameterType(type, info);
}
private String getNativeReturnType(Class<?> type, AnnotationInfo info) {
final String clsName = getMatchingClassType(type);
if (clsName != null) {
return Utils.getUnqualifiedName(clsName) + "::LocalRef";
}
return Utils.getNativeReturnType(type, info);
}
private void generateMember(AnnotationInfo info, Member member,
String uniqueName, Class<?> type, Class<?>[] argTypes) {
final StringBuilder args = new StringBuilder();
for (Class<?> argType : argTypes) {
args.append("\n " + getNativeParameterType(argType, info) + ",");
}
if (args.length() > 0) {
args.setLength(args.length() - 1);
}
header.append(
" struct " + getTraitsName(uniqueName, /* includeScope */ false) + " {\n" +
" typedef " + Utils.getUnqualifiedName(clsName) + " Owner;\n" +
" typedef " + getNativeReturnType(type, info) + " ReturnType;\n" +
" typedef " + getNativeParameterType(type, info) + " SetterType;\n" +
" typedef mozilla::jni::Args<" + args + "> Args;\n" +
" static constexpr char name[] = \"" +
Utils.getMemberName(member) + "\";\n" +
" static constexpr char signature[] =\n" +
" \"" + Utils.getSignature(member) + "\";\n" +
" static const bool isStatic = " + Utils.isStatic(member) + ";\n" +
" static const mozilla::jni::ExceptionMode exceptionMode =\n" +
" " + info.exceptionMode.nativeValue() + ";\n" +
" static const mozilla::jni::CallingThread callingThread =\n" +
" " + info.callingThread.nativeValue() + ";\n" +
" static const mozilla::jni::DispatchTarget dispatchTarget =\n" +
" " + info.dispatchTarget.nativeValue() + ";\n" +
" };\n" +
"\n");
cpp.append(
"constexpr char " + getTraitsName(uniqueName, /* includeScope */ true) +
"::name[];\n" +
"constexpr char " + getTraitsName(uniqueName, /* includeScope */ true) +
"::signature[];\n" +
"\n");
if (this.callingThread == null) {
this.callingThread = info.callingThread;
} else if (this.callingThread != info.callingThread) {
// We have a mix of calling threads, so specify "any" for the whole class.
this.callingThread = AnnotationInfo.CallingThread.ANY;
}
}
private String getUniqueMethodName(String basename) {
String newName = basename;
int index = 1;
while (takenMethodNames.contains(newName)) {
newName = basename + (++index);
}
takenMethodNames.add(newName);
return newName;
}
/**
* Generate a method prototype that includes return and argument types,
* without specifiers (static, const, etc.).
*/
private String generatePrototype(String name, Class<?>[] argTypes,
Class<?> returnType, AnnotationInfo info,
boolean includeScope, boolean includeArgName,
boolean isConst) {
final StringBuilder proto = new StringBuilder();
int argIndex = 0;
proto.append("auto ");
if (includeScope) {
proto.append(clsName).append("::");
}
proto.append(name).append('(');
for (Class<?> argType : argTypes) {
proto.append(getNativeParameterType(argType, info));
if (includeArgName) {
proto.append(" a").append(argIndex++);
}
proto.append(", ");
}
if (info.exceptionMode == AnnotationInfo.ExceptionMode.NSRESULT &&
!returnType.equals(void.class)) {
proto.append(getNativeReturnType(returnType, info)).append('*');
if (includeArgName) {
proto.append(" a").append(argIndex++);
}
proto.append(", ");
}
if (proto.substring(proto.length() - 2).equals(", ")) {
proto.setLength(proto.length() - 2);
}
proto.append(')');
if (isConst) {
proto.append(" const");
}
if (info.exceptionMode == AnnotationInfo.ExceptionMode.NSRESULT) {
proto.append(" -> nsresult");
} else {
proto.append(" -> ").append(getNativeReturnType(returnType, info));
}
return proto.toString();
}
/**
* Generate a method declaration that includes the prototype with specifiers,
* but without the method body.
*/
private String generateDeclaration(String name, Class<?>[] argTypes,
Class<?> returnType, AnnotationInfo info,
boolean isStatic) {
return (isStatic ? "static " : "") +
generatePrototype(name, argTypes, returnType, info,
/* includeScope */ false, /* includeArgName */ false,
/* isConst */ !isStatic) + ';';
}
/**
* Generate a method definition that includes the prototype with specifiers,
* and with the method body.
*/
private String generateDefinition(String accessorName, String name, Class<?>[] argTypes,
Class<?> returnType, AnnotationInfo info, boolean isStatic) {
final StringBuilder def = new StringBuilder(
generatePrototype(name, argTypes, returnType, info,
/* includeScope */ true, /* includeArgName */ true,
/* isConst */ !isStatic));
def.append("\n{\n");
// Generate code to handle the return value, if needed.
// We initialize rv to NS_OK instead of NS_ERROR_* because loading NS_OK (0) uses
// fewer instructions. We are guaranteed to set rv to the correct value later.
if (info.exceptionMode == AnnotationInfo.ExceptionMode.NSRESULT &&
returnType.equals(void.class)) {
def.append(
" nsresult rv = NS_OK;\n" +
" ");
} else if (info.exceptionMode == AnnotationInfo.ExceptionMode.NSRESULT) {
// Non-void return type
final String resultArg = "a" + argTypes.length;
def.append(
" MOZ_ASSERT(" + resultArg + ");\n" +
" nsresult rv = NS_OK;\n" +
" *" + resultArg + " = ");
} else {
def.append(
" return ");
}
// Generate a call, e.g., Method<Traits>::Call(a0, a1, a2);
def.append(accessorName).append("(")
.append(Utils.getUnqualifiedName(clsName) +
(isStatic ? "::Context()" : "::mCtx"));
if (info.exceptionMode == AnnotationInfo.ExceptionMode.NSRESULT) {
def.append(", &rv");
} else {
def.append(", nullptr");
}
// Generate the call argument list.
for (int argIndex = 0; argIndex < argTypes.length; argIndex++) {
def.append(", a").append(argIndex);
}
def.append(");\n");
if (info.exceptionMode == AnnotationInfo.ExceptionMode.NSRESULT) {
def.append(" return rv;\n");
}
return def.append("}").toString();
}
/**
* Append the appropriate generated code to the buffers for the method provided.
*
* @param annotatedMethod The Java method, plus annotation data.
*/
public void generateMethod(AnnotatableEntity annotatedMethod) {
// Unpack the tuple and extract some useful fields from the Method..
final Method method = annotatedMethod.getMethod();
final AnnotationInfo info = annotatedMethod.mAnnotationInfo;
final String uniqueName = getUniqueMethodName(info.wrapperName);
final Class<?>[] argTypes = method.getParameterTypes();
final Class<?> returnType = method.getReturnType();
if (method.isSynthetic()) {
return;
}
// Sanity check
if (info.dispatchTarget != AnnotationInfo.DispatchTarget.CURRENT) {
throw new IllegalStateException("Invalid dispatch target \"" +
info.dispatchTarget.name().toLowerCase() +
"\" for non-native method " + clsName + "::" + uniqueName);
}
generateMember(info, method, uniqueName, returnType, argTypes);
final boolean isStatic = Utils.isStatic(method);
header.append(
" " + generateDeclaration(info.wrapperName, argTypes,
returnType, info, isStatic) + "\n" +
"\n");
cpp.append(
generateDefinition(
"mozilla::jni::Method<" +
getTraitsName(uniqueName, /* includeScope */ false) + ">::Call",
info.wrapperName, argTypes, returnType, info, isStatic) + "\n" +
"\n");
}
/**
* Append the appropriate generated code to the buffers for the native method provided.
*
* @param annotatedMethod The Java native method, plus annotation data.
*/
public void generateNative(AnnotatableEntity annotatedMethod) {
// Unpack the tuple and extract some useful fields from the Method..
final Method method = annotatedMethod.getMethod();
final AnnotationInfo info = annotatedMethod.mAnnotationInfo;
final String uniqueName = getUniqueMethodName(info.wrapperName);
final Class<?>[] argTypes = method.getParameterTypes();
final Class<?> returnType = method.getReturnType();
// Sanity check
if (info.exceptionMode != AnnotationInfo.ExceptionMode.ABORT &&
info.exceptionMode != AnnotationInfo.ExceptionMode.IGNORE) {
throw new IllegalStateException("Invalid exception mode \"" +
info.exceptionMode.name().toLowerCase() +
"\" for native method " + clsName + "::" + uniqueName);
}
if (info.dispatchTarget != AnnotationInfo.DispatchTarget.CURRENT &&
returnType != void.class) {
throw new IllegalStateException(
"Must return void when not dispatching to current thread for native method " +
clsName + "::" + uniqueName);
}
generateMember(info, method, uniqueName, returnType, argTypes);
final String traits = getTraitsName(uniqueName, /* includeScope */ true);
if (nativesInits.length() > 0) {
nativesInits.append(',');
}
nativesInits.append(
"\n" +
"\n" +
" mozilla::jni::MakeNativeMethod<" + traits + ">(\n" +
" mozilla::jni::NativeStub<" + traits + ", Impl>\n" +
" ::template Wrap<&Impl::" + info.wrapperName + ">)");
numNativesInits++;
}
private String getLiteral(Object val, AnnotationInfo info) {
final Class<?> type = val.getClass();
if (type.equals(char.class) || type.equals(Character.class)) {
final char c = (char) val;
if (c >= 0x20 && c < 0x7F) {
return "'" + c + '\'';
}
return "u'\\u" + Integer.toHexString(0x10000 | (int) c).substring(1) + '\'';
} else if (type.equals(CharSequence.class) || type.equals(String.class)) {
final CharSequence str = (CharSequence) val;
final StringBuilder out = new StringBuilder("u\"");
for (int i = 0; i < str.length(); i++) {
final char c = str.charAt(i);
if (c >= 0x20 && c < 0x7F) {
out.append(c);
} else {
out.append("\\u").append(Integer.toHexString(0x10000 | (int) c).substring(1));
}
}
return out.append('"').toString();
}
return String.valueOf(val);
}
public void generateField(AnnotatableEntity annotatedField) {
final Field field = annotatedField.getField();
final AnnotationInfo info = annotatedField.mAnnotationInfo;
final String uniqueName = info.wrapperName;
final Class<?> type = field.getType();
// Handles a peculiar case when dealing with enum types. We don't care about this field.
// It just gets in the way and stops our code from compiling.
if (field.isSynthetic() || field.getName().equals("$VALUES")) {
return;
}
// Sanity check
if (info.dispatchTarget != AnnotationInfo.DispatchTarget.CURRENT) {
throw new IllegalStateException("Invalid dispatch target \"" +
info.dispatchTarget.name().toLowerCase() +
"\" for field " + clsName + "::" + uniqueName);
}
final boolean isStatic = Utils.isStatic(field);
final boolean isFinal = Utils.isFinal(field);
if (isStatic && isFinal && (type.isPrimitive() || type.equals(String.class))) {
Object val = null;
try {
field.setAccessible(true);
val = field.get(null);
} catch (final IllegalAccessException e) {
}
if (val != null && type.isPrimitive()) {
// For static final primitive fields, we can use a "static const" declaration.
header.append(
" static const " + Utils.getNativeReturnType(type, info) +
' ' + info.wrapperName + " = " + getLiteral(val, info) + ";\n" +
"\n");
return;
} else if (val != null && type.equals(String.class)) {
final String nativeType = "char16_t";
header.append(
" static const " + nativeType + ' ' + info.wrapperName + "[];\n" +
"\n");
cpp.append(
"const " + nativeType + ' ' + clsName + "::" + info.wrapperName +
"[] = " + getLiteral(val, info) + ";\n" +
"\n");
return;
}
// Fall back to using accessors if we encounter an exception.
}
generateMember(info, field, uniqueName, type, EMPTY_CLASS_ARRAY);
final Class<?>[] getterArgs = EMPTY_CLASS_ARRAY;
header.append(
" " + generateDeclaration(info.wrapperName, getterArgs,
type, info, isStatic) + "\n" +
"\n");
cpp.append(
generateDefinition(
"mozilla::jni::Field<" +
getTraitsName(uniqueName, /* includeScope */ false) + ">::Get",
info.wrapperName, getterArgs, type, info, isStatic) + "\n" +
"\n");
if (isFinal) {
return;
}
final Class<?>[] setterArgs = new Class<?>[] { type };
header.append(
" " + generateDeclaration(info.wrapperName, setterArgs,
void.class, info, isStatic) + "\n" +
"\n");
cpp.append(
generateDefinition(
"mozilla::jni::Field<" +
getTraitsName(uniqueName, /* includeScope */ false) + ">::Set",
info.wrapperName, setterArgs, void.class, info, isStatic) + "\n" +
"\n");
}
public void generateConstructor(AnnotatableEntity annotatedConstructor) {
// Unpack the tuple and extract some useful fields from the Method..
final Constructor<?> method = annotatedConstructor.getConstructor();
final AnnotationInfo info = annotatedConstructor.mAnnotationInfo;
final String wrapperName = "New";
final String uniqueName = getUniqueMethodName(wrapperName);
final Class<?>[] argTypes = method.getParameterTypes();
final Class<?> returnType = cls;
if (method.isSynthetic()) {
return;
}
// Sanity check
if (info.dispatchTarget != AnnotationInfo.DispatchTarget.CURRENT) {
throw new IllegalStateException("Invalid dispatch target \"" +
info.dispatchTarget.name().toLowerCase() +
"\" for constructor " + clsName + "::" + uniqueName);
}
generateMember(info, method, uniqueName, returnType, argTypes);
header.append(
" " + generateDeclaration(wrapperName, argTypes,
returnType, info, /* isStatic */ true) + "\n" +
"\n");
cpp.append(
generateDefinition(
"mozilla::jni::Constructor<" +
getTraitsName(uniqueName, /* includeScope */ false) + ">::Call",
wrapperName, argTypes, returnType, info, /* isStatic */ true) + "\n" +
"\n");
}
public void generateMembers(Member[] members) {
for (Member m : members) {
if (!Modifier.isPublic(m.getModifiers())) {
continue;
}
String name = Utils.getMemberName(m);
name = name.substring(0, 1).toUpperCase() + name.substring(1);
// Default for SDK bindings.
final AnnotationInfo info = new AnnotationInfo(name,
AnnotationInfo.ExceptionMode.NSRESULT,
AnnotationInfo.CallingThread.ANY,
AnnotationInfo.DispatchTarget.CURRENT);
final AnnotatableEntity entity = new AnnotatableEntity(m, info);
if (m instanceof Constructor) {
generateConstructor(entity);
} else if (m instanceof Method) {
generateMethod(entity);
} else if (m instanceof Field) {
generateField(entity);
} else {
throw new IllegalArgumentException(
"expected member to be Constructor, Method, or Field");
}
}
}
public void generateClasses(final ClassWithOptions[] classes) {
if (classes.length == 0) {
return;
}
for (final ClassWithOptions cls : classes) {
// Extract "Inner" from "Outer::Inner".
header.append(
" class " + Utils.getUnqualifiedName(cls.generatedName) + ";\n");
}
header.append('\n');
}
/**
* Get the finalised bytes to go into the generated wrappers file.
*
* @return The bytes to be written to the wrappers file.
*/
public String getWrapperFileContents() {
return cpp.toString();
}
/**
* Get the finalised bytes to go into the generated header file.
*
* @return The bytes to be written to the header file.
*/
public String getHeaderFileContents() {
if (this.callingThread == null) {
this.callingThread = AnnotationInfo.CallingThread.ANY;
}
header.append(
" static const mozilla::jni::CallingThread callingThread =\n" +
" " + this.callingThread.nativeValue() + ";\n" +
"\n");
if (nativesInits.length() > 0) {
header.append(
" template<class Impl> class Natives;\n");
}
header.append(
"};\n" +
"\n");
return header.toString();
}
/**
* Get the finalised bytes to go into the generated natives header file.
*
* @return The bytes to be written to the header file.
*/
public String getNativesFileContents() {
if (nativesInits.length() == 0) {
return "";
}
natives.append(
" static const JNINativeMethod methods[" + numNativesInits + "];\n" +
"};\n" +
"\n" +
"template<class Impl>\n" +
"const JNINativeMethod " + clsName + "::Natives<Impl>::methods[] = {" + nativesInits + '\n' +
"};\n" +
"\n");
return natives.toString();
}
}
-10
View File
@@ -1,10 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
include $(topsrcdir)/config/rules.mk
# Include Android specific java flags, instead of what's in rules.mk.
include $(topsrcdir)/config/android-common.mk
export:: annotationProcessors.jar
@@ -1,258 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.annotationProcessors;
import com.android.tools.lint.checks.ApiLookup;
import com.android.tools.lint.LintCliClient;
import org.mozilla.gecko.annotationProcessors.classloader.AnnotatableEntity;
import org.mozilla.gecko.annotationProcessors.classloader.ClassWithOptions;
import org.mozilla.gecko.annotationProcessors.classloader.IterableJarLoadingURLClassLoader;
import org.mozilla.gecko.annotationProcessors.utils.GeneratableElementIterator;
import org.mozilla.gecko.annotationProcessors.utils.Utils;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Iterator;
import java.util.Properties;
import java.util.Scanner;
import java.util.Vector;
import java.net.URL;
import java.net.URLClassLoader;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Member;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
public class SDKProcessor {
public static final String GENERATED_COMMENT =
"// GENERATED CODE\n" +
"// Generated by the Java program at /build/annotationProcessors at compile time\n" +
"// from annotations on Java methods. To update, change the annotations on the\n" +
"// corresponding Javamethods and rerun the build. Manually updating this file\n" +
"// will cause your build to fail.\n" +
"\n";
private static ApiLookup sApiLookup;
private static int sMaxSdkVersion;
public static void main(String[] args) throws Exception {
// We expect a list of jars on the commandline. If missing, whinge about it.
if (args.length < 5) {
System.err.println("Usage: java SDKProcessor sdkjar classlistfile outdir fileprefix max-sdk-version");
System.exit(1);
}
System.out.println("Processing platform bindings...");
String sdkJar = args[0];
Vector classes = getClassList(args[1]);
String outdir = args[2];
String generatedFilePrefix = args[3];
sMaxSdkVersion = Integer.parseInt(args[4]);
LintCliClient lintClient = new LintCliClient();
sApiLookup = ApiLookup.get(lintClient);
// Start the clock!
long s = System.currentTimeMillis();
// Get an iterator over the classes in the jar files given...
// Iterator<ClassWithOptions> jarClassIterator = IterableJarLoadingURLClassLoader.getIteratorOverJars(args);
StringBuilder headerFile = new StringBuilder(GENERATED_COMMENT);
headerFile.append(
"#ifndef " + generatedFilePrefix + "_h__\n" +
"#define " + generatedFilePrefix + "_h__\n" +
"\n" +
"#include \"mozilla/jni/Refs.h\"\n" +
"\n" +
"namespace mozilla {\n" +
"namespace java {\n" +
"namespace sdk {\n" +
"\n");
StringBuilder implementationFile = new StringBuilder(GENERATED_COMMENT);
implementationFile.append(
"#include \"" + generatedFilePrefix + ".h\"\n" +
"#include \"mozilla/jni/Accessors.h\"\n" +
"\n" +
"namespace mozilla {\n" +
"namespace java {\n" +
"namespace sdk {\n" +
"\n");
// Used to track the calls to the various class-specific initialisation functions.
ClassLoader loader = null;
try {
loader = URLClassLoader.newInstance(new URL[] { new URL("file://" + sdkJar) },
SDKProcessor.class.getClassLoader());
} catch (Exception e) {
throw new RuntimeException(e.toString());
}
for (Iterator<String> i = classes.iterator(); i.hasNext(); ) {
String className = i.next();
System.out.println("Looking up: " + className);
generateClass(Class.forName(className, true, loader),
implementationFile,
headerFile);
}
implementationFile.append(
"} /* sdk */\n" +
"} /* java */\n" +
"} /* mozilla */\n");
headerFile.append(
"} /* sdk */\n" +
"} /* java */\n" +
"} /* mozilla */\n" +
"#endif\n");
writeOutputFiles(outdir, generatedFilePrefix, headerFile, implementationFile);
long e = System.currentTimeMillis();
System.out.println("SDK processing complete in " + (e - s) + "ms");
}
private static int getAPIVersion(Class<?> cls, Member m) {
if (m instanceof Method || m instanceof Constructor) {
return sApiLookup.getCallVersion(
cls.getName().replace('.', '/'),
Utils.getMemberName(m),
Utils.getSignature(m));
} else if (m instanceof Field) {
return sApiLookup.getFieldVersion(
Utils.getClassDescriptor(m.getDeclaringClass()), m.getName());
} else {
throw new IllegalArgumentException("expected member to be Method, Constructor, or Field");
}
}
private static Member[] sortAndFilterMembers(Class<?> cls, Member[] members) {
Arrays.sort(members, new Comparator<Member>() {
@Override
public int compare(Member a, Member b) {
return a.getName().compareTo(b.getName());
}
});
ArrayList<Member> list = new ArrayList<>();
for (Member m : members) {
// Sometimes (e.g. Bundle) has methods that moved to/from a superclass in a later SDK
// version, so we check for both classes and see if we can find a minimum SDK version.
int version = getAPIVersion(cls, m);
final int version2 = getAPIVersion(m.getDeclaringClass(), m);
if (version2 > 0 && version2 < version) {
version = version2;
}
if (version > sMaxSdkVersion) {
System.out.println("Skipping " + m.getDeclaringClass().getName() + "." + m.getName() +
", version " + version + " > " + sMaxSdkVersion);
continue;
}
// Sometimes (e.g. KeyEvent) a field can appear in both a class and a superclass. In
// that case we want to filter out the version that appears in the superclass, or
// we'll have bindings with duplicate names.
try {
if (m instanceof Field && !m.equals(cls.getField(m.getName()))) {
// m is a field in a superclass that has been hidden by
// a field with the same name in a subclass.
System.out.println("Skipping " + m.getName() +
" from " + m.getDeclaringClass());
continue;
}
} catch (final NoSuchFieldException e) {
}
list.add(m);
}
return list.toArray(new Member[list.size()]);
}
private static void generateClass(Class<?> clazz,
StringBuilder implementationFile,
StringBuilder headerFile) {
String generatedName = clazz.getSimpleName();
CodeGenerator generator = new CodeGenerator(new ClassWithOptions(clazz, generatedName));
generator.generateMembers(sortAndFilterMembers(clazz, clazz.getConstructors()));
generator.generateMembers(sortAndFilterMembers(clazz, clazz.getMethods()));
generator.generateMembers(sortAndFilterMembers(clazz, clazz.getFields()));
headerFile.append(generator.getHeaderFileContents());
implementationFile.append(generator.getWrapperFileContents());
}
private static Vector<String> getClassList(String path) {
Scanner scanner = null;
try {
scanner = new Scanner(new FileInputStream(path));
Vector lines = new Vector();
while (scanner.hasNextLine()) {
lines.add(scanner.nextLine());
}
return lines;
} catch (Exception e) {
System.out.println(e.toString());
return null;
} finally {
if (scanner != null) {
scanner.close();
}
}
}
private static void writeOutputFiles(String aOutputDir, String aPrefix, StringBuilder aHeaderFile,
StringBuilder aImplementationFile) {
FileOutputStream implStream = null;
try {
implStream = new FileOutputStream(new File(aOutputDir, aPrefix + ".cpp"));
implStream.write(aImplementationFile.toString().getBytes());
} catch (IOException e) {
System.err.println("Unable to write " + aOutputDir + ". Perhaps a permissions issue?");
e.printStackTrace(System.err);
} finally {
if (implStream != null) {
try {
implStream.close();
} catch (IOException e) {
System.err.println("Unable to close implStream due to "+e);
e.printStackTrace(System.err);
}
}
}
FileOutputStream headerStream = null;
try {
headerStream = new FileOutputStream(new File(aOutputDir, aPrefix + ".h"));
headerStream.write(aHeaderFile.toString().getBytes());
} catch (IOException e) {
System.err.println("Unable to write " + aOutputDir + ". Perhaps a permissions issue?");
e.printStackTrace(System.err);
} finally {
if (headerStream != null) {
try {
headerStream.close();
} catch (IOException e) {
System.err.println("Unable to close headerStream due to "+e);
e.printStackTrace(System.err);
}
}
}
}
}
@@ -1,62 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.annotationProcessors.classloader;
import org.mozilla.gecko.annotationProcessors.AnnotationInfo;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Member;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
/**
* Union type to hold either a method, field, or ctor. Allows us to iterate "The generatable stuff", despite
* the fact that such things can be of either flavour.
*/
public class AnnotatableEntity {
public enum ENTITY_TYPE {METHOD, NATIVE, FIELD, CONSTRUCTOR}
private final Member mMember;
public final ENTITY_TYPE mEntityType;
public final AnnotationInfo mAnnotationInfo;
public AnnotatableEntity(Member aObject, AnnotationInfo aAnnotationInfo) {
mMember = aObject;
mAnnotationInfo = aAnnotationInfo;
if (aObject instanceof Method) {
if (Modifier.isNative(aObject.getModifiers())) {
mEntityType = ENTITY_TYPE.NATIVE;
} else {
mEntityType = ENTITY_TYPE.METHOD;
}
} else if (aObject instanceof Field) {
mEntityType = ENTITY_TYPE.FIELD;
} else {
mEntityType = ENTITY_TYPE.CONSTRUCTOR;
}
}
public Method getMethod() {
if (mEntityType != ENTITY_TYPE.METHOD && mEntityType != ENTITY_TYPE.NATIVE) {
throw new UnsupportedOperationException("Attempt to cast to unsupported member type.");
}
return (Method) mMember;
}
public Field getField() {
if (mEntityType != ENTITY_TYPE.FIELD) {
throw new UnsupportedOperationException("Attempt to cast to unsupported member type.");
}
return (Field) mMember;
}
public Constructor<?> getConstructor() {
if (mEntityType != ENTITY_TYPE.CONSTRUCTOR) {
throw new UnsupportedOperationException("Attempt to cast to unsupported member type.");
}
return (Constructor<?>) mMember;
}
}
@@ -1,15 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.annotationProcessors.classloader;
public class ClassWithOptions {
public final Class<?> wrappedClass;
public final String generatedName;
public ClassWithOptions(Class<?> someClass, String name) {
wrappedClass = someClass;
generatedName = name;
}
}
@@ -1,75 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.annotationProcessors.classloader;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Collections;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
/**
* A classloader which can be initialised with a list of jar files and which can provide an iterator
* over the top level classes in the jar files it was initialised with.
* classNames is kept sorted to ensure iteration order is consistent across program invocations.
* Otherwise, we'd forever be reporting the outdatedness of the generated code as we permute its
* contents.
*/
public class IterableJarLoadingURLClassLoader extends URLClassLoader {
LinkedList<String> classNames = new LinkedList<String>();
/**
* Create an instance and return its iterator. Provides an iterator over the classes in the jar
* files provided as arguments.
* Inner classes are not supported.
*
* @param args A list of jar file names an iterator over the classes of which is desired.
* @return An iterator over the top level classes in the jar files provided, in arbitrary order.
*/
public static Iterator<ClassWithOptions> getIteratorOverJars(String[] args) {
URL[] urlArray = new URL[args.length];
LinkedList<String> aClassNames = new LinkedList<String>();
for (int i = 0; i < args.length; i++) {
try {
urlArray[i] = (new File(args[i])).toURI().toURL();
Enumeration<JarEntry> entries = new JarFile(args[i]).entries();
while (entries.hasMoreElements()) {
JarEntry e = entries.nextElement();
String fName = e.getName();
if (!fName.endsWith(".class")) {
continue;
}
final String className = fName.substring(0, fName.length() - 6).replace('/', '.');
aClassNames.add(className);
}
} catch (IOException e) {
System.err.println("Error loading jar file \"" + args[i] + '"');
e.printStackTrace(System.err);
}
}
Collections.sort(aClassNames);
return new JarClassIterator(new IterableJarLoadingURLClassLoader(urlArray, aClassNames));
}
/**
* Constructs a classloader capable of loading all classes given as URLs in urls. Used by static
* method above.
*
* @param urls URLs for all classes the new instance shall be capable of loading.
* @param aClassNames A list of names of the classes this instance shall be capable of loading.
*/
protected IterableJarLoadingURLClassLoader(URL[] urls, LinkedList<String> aClassNames) {// Array to populate with URLs for each class in the given jars.
super(urls);
classNames = aClassNames;
}
}
@@ -1,84 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.annotationProcessors.classloader;
import java.util.Iterator;
/**
* Class for iterating over an IterableJarLoadingURLClassLoader's classes.
*
* This class is not thread safe: use it only from a single thread.
*/
public class JarClassIterator implements Iterator<ClassWithOptions> {
private IterableJarLoadingURLClassLoader mTarget;
private Iterator<String> mTargetClassListIterator;
private ClassWithOptions lookAhead;
public JarClassIterator(IterableJarLoadingURLClassLoader aTarget) {
mTarget = aTarget;
mTargetClassListIterator = aTarget.classNames.iterator();
}
@Override
public boolean hasNext() {
return fillLookAheadIfPossible();
}
@Override
public ClassWithOptions next() {
if (!fillLookAheadIfPossible()) {
throw new IllegalStateException("Failed to look ahead in next()!");
}
ClassWithOptions next = lookAhead;
lookAhead = null;
return next;
}
private boolean fillLookAheadIfPossible() {
if (lookAhead != null) {
return true;
}
if (!mTargetClassListIterator.hasNext()) {
return false;
}
String className = mTargetClassListIterator.next();
try {
Class<?> ret = mTarget.loadClass(className);
// Incremental builds can leave stale classfiles in the jar. Such classfiles will cause
// an exception at this point. We can safely ignore these classes - they cannot possibly
// ever be loaded as they conflict with their parent class and will be killed by
// Proguard later on anyway.
final Class<?> enclosingClass;
try {
enclosingClass = ret.getEnclosingClass();
} catch (IncompatibleClassChangeError e) {
return fillLookAheadIfPossible();
}
if (enclosingClass != null) {
// Anonymous inner class - unsupported.
// Or named inner class, which will be processed when we process the outer class.
return fillLookAheadIfPossible();
}
lookAhead = new ClassWithOptions(ret, ret.getSimpleName());
return true;
} catch (ClassNotFoundException e) {
System.err.println("Unable to enumerate class: " + className + ". Corrupted jar file?");
e.printStackTrace();
System.exit(2);
}
return false;
}
@Override
public void remove() {
throw new UnsupportedOperationException("Removal of classes from iterator not supported.");
}
}
-23
View File
@@ -1,23 +0,0 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
jar = add_java_jar('annotationProcessors')
jar.sources += [
'AnnotationInfo.java',
'AnnotationProcessor.java',
'classloader/AnnotatableEntity.java',
'classloader/ClassWithOptions.java',
'classloader/IterableJarLoadingURLClassLoader.java',
'classloader/JarClassIterator.java',
'CodeGenerator.java',
'SDKProcessor.java',
'utils/AlphabeticAnnotatableEntityComparator.java',
'utils/GeneratableElementIterator.java',
'utils/Utils.java',
]
jar.extra_jars += [
CONFIG['ANDROID_TOOLS'] + '/lib/lint.jar',
CONFIG['ANDROID_TOOLS'] + '/lib/lint-checks.jar',
]
@@ -1,81 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.annotationProcessors.utils;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Member;
import java.lang.reflect.Method;
import java.util.Comparator;
public class AlphabeticAnnotatableEntityComparator<T extends Member> implements Comparator<T> {
@Override
public int compare(T aLhs, T aRhs) {
// Constructors, Methods, Fields.
boolean lIsConstructor = aLhs instanceof Constructor;
boolean rIsConstructor = aRhs instanceof Constructor;
boolean lIsMethod = aLhs instanceof Method;
boolean rIsField = aRhs instanceof Field;
if (lIsConstructor) {
if (!rIsConstructor) {
return -1;
}
} else if (lIsMethod) {
if (rIsConstructor) {
return 1;
} else if (rIsField) {
return -1;
}
} else {
if (!rIsField) {
return 1;
}
}
// Verify these objects are the same type and cast them.
if (aLhs instanceof Method) {
return compare((Method) aLhs, (Method) aRhs);
} else if (aLhs instanceof Field) {
return compare((Field) aLhs, (Field) aRhs);
} else {
return compare((Constructor) aLhs, (Constructor) aRhs);
}
}
// Alas, the type system fails us.
private static int compare(Method aLhs, Method aRhs) {
// Initially, attempt to differentiate the methods be name alone..
String lName = aLhs.getName();
String rName = aRhs.getName();
int ret = lName.compareTo(rName);
if (ret != 0) {
return ret;
}
// The names were the same, so we need to compare signatures to find their uniqueness..
lName = Utils.getSignature(aLhs);
rName = Utils.getSignature(aRhs);
return lName.compareTo(rName);
}
private static int compare(Constructor<?> aLhs, Constructor<?> aRhs) {
// The names will be the same, so we need to compare signatures to find their uniqueness..
String lName = Utils.getSignature(aLhs);
String rName = Utils.getSignature(aRhs);
return lName.compareTo(rName);
}
private static int compare(Field aLhs, Field aRhs) {
// Compare field names..
String lName = aLhs.getName();
String rName = aRhs.getName();
return lName.compareTo(rName);
}
}
@@ -1,267 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.annotationProcessors.utils;
import org.mozilla.gecko.annotationProcessors.AnnotationInfo;
import org.mozilla.gecko.annotationProcessors.classloader.AnnotatableEntity;
import org.mozilla.gecko.annotationProcessors.classloader.ClassWithOptions;
import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Member;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Iterator;
/**
* Iterator over the methods in a given method list which have the WrappedJNIMethod
* annotation. Returns an object containing both the annotation (Which may contain interesting
* parameters) and the argument.
*/
public class GeneratableElementIterator implements Iterator<AnnotatableEntity> {
private final ClassWithOptions mClass;
private final Member[] mObjects;
private AnnotatableEntity mNextReturnValue;
private int mElementIndex;
private AnnotationInfo mClassInfo;
private boolean mIterateEveryEntry;
private boolean mSkipCurrentEntry;
public GeneratableElementIterator(ClassWithOptions annotatedClass) {
mClass = annotatedClass;
final Class<?> aClass = annotatedClass.wrappedClass;
// Get all the elements of this class as AccessibleObjects.
Member[] aMethods = aClass.getDeclaredMethods();
Member[] aFields = aClass.getDeclaredFields();
Member[] aCtors = aClass.getDeclaredConstructors();
// Shove them all into one buffer.
Member[] objs = new Member[aMethods.length + aFields.length + aCtors.length];
int offset = 0;
System.arraycopy(aMethods, 0, objs, 0, aMethods.length);
offset += aMethods.length;
System.arraycopy(aFields, 0, objs, offset, aFields.length);
offset += aFields.length;
System.arraycopy(aCtors, 0, objs, offset, aCtors.length);
// Sort the elements to ensure determinism.
Arrays.sort(objs, new AlphabeticAnnotatableEntityComparator<Member>());
mObjects = objs;
// Check for "Wrap ALL the things" flag.
for (Annotation annotation : aClass.getDeclaredAnnotations()) {
mClassInfo = buildAnnotationInfo(aClass, annotation);
if (mClassInfo != null) {
mIterateEveryEntry = true;
break;
}
}
if (mSkipCurrentEntry) {
throw new IllegalArgumentException("Cannot skip entire class");
}
findNextValue();
}
private Class<?>[] getFilteredInnerClasses() {
// Go through all inner classes and see which ones we want to generate.
final Class<?>[] candidates = mClass.wrappedClass.getDeclaredClasses();
int count = 0;
for (int i = 0; i < candidates.length; ++i) {
final GeneratableElementIterator testIterator
= new GeneratableElementIterator(new ClassWithOptions(candidates[i], null));
if (testIterator.hasNext()
|| testIterator.getFilteredInnerClasses() != null) {
count++;
continue;
}
// Clear out ones that don't match.
candidates[i] = null;
}
return count > 0 ? candidates : null;
}
public ClassWithOptions[] getInnerClasses() {
final Class<?>[] candidates = getFilteredInnerClasses();
if (candidates == null) {
return new ClassWithOptions[0];
}
int count = 0;
for (Class<?> candidate : candidates) {
if (candidate != null) {
count++;
}
}
final ClassWithOptions[] ret = new ClassWithOptions[count];
count = 0;
for (Class<?> candidate : candidates) {
if (candidate != null) {
ret[count++] = new ClassWithOptions(
candidate, mClass.generatedName + "::" + candidate.getSimpleName());
}
}
assert ret.length == count;
Arrays.sort(ret, new Comparator<ClassWithOptions>() {
@Override public int compare(ClassWithOptions lhs, ClassWithOptions rhs) {
return lhs.generatedName.compareTo(rhs.generatedName);
}
});
return ret;
}
private static <T extends Enum<T>> T getEnumValue(Class<T> type, String name)
throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
try {
return Enum.valueOf(type, name.toUpperCase());
} catch (IllegalArgumentException e) {
Object[] values = (Object[]) type.getDeclaredMethod("values").invoke(null);
StringBuilder names = new StringBuilder();
for (int i = 0; i < values.length; i++) {
if (i != 0) {
names.append(", ");
}
names.append(values[i].toString().toLowerCase());
}
System.err.println("***");
System.err.println("*** Invalid value \"" + name + "\" for " + type.getSimpleName());
System.err.println("*** Specify one of " + names.toString());
System.err.println("***");
e.printStackTrace(System.err);
System.exit(6);
return null;
}
}
private AnnotationInfo buildAnnotationInfo(AnnotatedElement element, Annotation annotation) {
Class<? extends Annotation> annotationType = annotation.annotationType();
final String annotationTypeName = annotationType.getName();
if (!annotationTypeName.equals("org.mozilla.gecko.annotation.WrapForJNI")) {
return null;
}
String stubName = null;
AnnotationInfo.ExceptionMode exceptionMode = null;
AnnotationInfo.CallingThread callingThread = null;
AnnotationInfo.DispatchTarget dispatchTarget = null;
try {
final Method skipMethod = annotationType.getDeclaredMethod("skip");
skipMethod.setAccessible(true);
if ((Boolean) skipMethod.invoke(annotation)) {
mSkipCurrentEntry = true;
return null;
}
// Determine the explicitly-given name of the stub to generate, if any.
final Method stubNameMethod = annotationType.getDeclaredMethod("stubName");
stubNameMethod.setAccessible(true);
stubName = (String) stubNameMethod.invoke(annotation);
final Method exceptionModeMethod = annotationType.getDeclaredMethod("exceptionMode");
exceptionModeMethod.setAccessible(true);
exceptionMode = getEnumValue(
AnnotationInfo.ExceptionMode.class,
(String) exceptionModeMethod.invoke(annotation));
final Method calledFromMethod = annotationType.getDeclaredMethod("calledFrom");
calledFromMethod.setAccessible(true);
callingThread = getEnumValue(
AnnotationInfo.CallingThread.class,
(String) calledFromMethod.invoke(annotation));
final Method dispatchToMethod = annotationType.getDeclaredMethod("dispatchTo");
dispatchToMethod.setAccessible(true);
dispatchTarget = getEnumValue(
AnnotationInfo.DispatchTarget.class,
(String) dispatchToMethod.invoke(annotation));
} catch (NoSuchMethodException e) {
System.err.println("Unable to find expected field on WrapForJNI annotation. Did the signature change?");
e.printStackTrace(System.err);
System.exit(3);
} catch (IllegalAccessException e) {
System.err.println("IllegalAccessException reading fields on WrapForJNI annotation. Seems the semantics of Reflection have changed...");
e.printStackTrace(System.err);
System.exit(4);
} catch (InvocationTargetException e) {
System.err.println("InvocationTargetException reading fields on WrapForJNI annotation. This really shouldn't happen.");
e.printStackTrace(System.err);
System.exit(5);
}
// If the method name was not explicitly given in the annotation generate one...
if (stubName.isEmpty()) {
stubName = Utils.getNativeName(element);
}
return new AnnotationInfo(stubName, exceptionMode, callingThread, dispatchTarget);
}
/**
* Find and cache the next appropriately annotated method, plus the annotation parameter, if
* one exists. Otherwise cache null, so hasNext returns false.
*/
private void findNextValue() {
while (mElementIndex < mObjects.length) {
Member candidateElement = mObjects[mElementIndex];
mElementIndex++;
for (Annotation annotation : ((AnnotatedElement) candidateElement).getDeclaredAnnotations()) {
AnnotationInfo info = buildAnnotationInfo((AnnotatedElement)candidateElement, annotation);
if (info != null) {
mNextReturnValue = new AnnotatableEntity(candidateElement, info);
return;
}
}
if (mSkipCurrentEntry) {
mSkipCurrentEntry = false;
continue;
}
// If no annotation found, we might be expected to generate anyway
// using default arguments, thanks to the "Generate everything" annotation.
if (mIterateEveryEntry) {
AnnotationInfo annotationInfo = new AnnotationInfo(
Utils.getNativeName(candidateElement),
mClassInfo.exceptionMode,
mClassInfo.callingThread,
mClassInfo.dispatchTarget);
mNextReturnValue = new AnnotatableEntity(candidateElement, annotationInfo);
return;
}
}
mNextReturnValue = null;
}
@Override
public boolean hasNext() {
return mNextReturnValue != null;
}
@Override
public AnnotatableEntity next() {
AnnotatableEntity ret = mNextReturnValue;
findNextValue();
return ret;
}
@Override
public void remove() {
throw new UnsupportedOperationException("Removal of methods from GeneratableElementIterator not supported.");
}
}
-288
View File
@@ -1,288 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.annotationProcessors.utils;
import org.mozilla.gecko.annotationProcessors.AnnotationInfo;
import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Member;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.nio.ByteBuffer;
import java.util.HashMap;
/**
* A collection of utility methods used by CodeGenerator. Largely used for translating types.
*/
public class Utils {
// A collection of lookup tables to simplify the functions to follow...
private static final HashMap<String, String> NATIVE_TYPES = new HashMap<String, String>();
static {
NATIVE_TYPES.put("void", "void");
NATIVE_TYPES.put("boolean", "bool");
NATIVE_TYPES.put("byte", "int8_t");
NATIVE_TYPES.put("char", "char16_t");
NATIVE_TYPES.put("short", "int16_t");
NATIVE_TYPES.put("int", "int32_t");
NATIVE_TYPES.put("long", "int64_t");
NATIVE_TYPES.put("float", "float");
NATIVE_TYPES.put("double", "double");
}
private static final HashMap<String, String> NATIVE_ARRAY_TYPES = new HashMap<String, String>();
static {
NATIVE_ARRAY_TYPES.put("boolean", "mozilla::jni::BooleanArray");
NATIVE_ARRAY_TYPES.put("byte", "mozilla::jni::ByteArray");
NATIVE_ARRAY_TYPES.put("char", "mozilla::jni::CharArray");
NATIVE_ARRAY_TYPES.put("short", "mozilla::jni::ShortArray");
NATIVE_ARRAY_TYPES.put("int", "mozilla::jni::IntArray");
NATIVE_ARRAY_TYPES.put("long", "mozilla::jni::LongArray");
NATIVE_ARRAY_TYPES.put("float", "mozilla::jni::FloatArray");
NATIVE_ARRAY_TYPES.put("double", "mozilla::jni::DoubleArray");
}
private static final HashMap<String, String> CLASS_DESCRIPTORS = new HashMap<String, String>();
static {
CLASS_DESCRIPTORS.put("void", "V");
CLASS_DESCRIPTORS.put("boolean", "Z");
CLASS_DESCRIPTORS.put("byte", "B");
CLASS_DESCRIPTORS.put("char", "C");
CLASS_DESCRIPTORS.put("short", "S");
CLASS_DESCRIPTORS.put("int", "I");
CLASS_DESCRIPTORS.put("long", "J");
CLASS_DESCRIPTORS.put("float", "F");
CLASS_DESCRIPTORS.put("double", "D");
}
/**
* Get the C++ type corresponding to the provided type parameter.
*
* @param type Class to determine the corresponding JNI type for.
* @return C++ type as a String
*/
public static String getNativeParameterType(Class<?> type, AnnotationInfo info) {
final String name = type.getName().replace('.', '/');
if (NATIVE_TYPES.containsKey(name)) {
return NATIVE_TYPES.get(name);
}
if (type.isArray()) {
final String compName = type.getComponentType().getName();
if (NATIVE_ARRAY_TYPES.containsKey(compName)) {
return NATIVE_ARRAY_TYPES.get(compName) + "::Param";
}
return "mozilla::jni::ObjectArray::Param";
}
if (type.equals(String.class) || type.equals(CharSequence.class)) {
return "mozilla::jni::String::Param";
}
if (type.equals(Class.class)) {
// You're doing reflection on Java objects from inside C, returning Class objects
// to C, generating the corresponding code using this Java program. Really?!
return "mozilla::jni::Class::Param";
}
if (type.equals(Throwable.class)) {
return "mozilla::jni::Throwable::Param";
}
if (type.equals(ByteBuffer.class)) {
return "mozilla::jni::ByteBuffer::Param";
}
return "mozilla::jni::Object::Param";
}
public static String getNativeReturnType(Class<?> type, AnnotationInfo info) {
final String name = type.getName().replace('.', '/');
if (NATIVE_TYPES.containsKey(name)) {
return NATIVE_TYPES.get(name);
}
if (type.isArray()) {
final String compName = type.getComponentType().getName();
if (NATIVE_ARRAY_TYPES.containsKey(compName)) {
return NATIVE_ARRAY_TYPES.get(compName) + "::LocalRef";
}
return "mozilla::jni::ObjectArray::LocalRef";
}
if (type.equals(String.class)) {
return "mozilla::jni::String::LocalRef";
}
if (type.equals(Class.class)) {
// You're doing reflection on Java objects from inside C, returning Class objects
// to C, generating the corresponding code using this Java program. Really?!
return "mozilla::jni::Class::LocalRef";
}
if (type.equals(Throwable.class)) {
return "mozilla::jni::Throwable::LocalRef";
}
if (type.equals(ByteBuffer.class)) {
return "mozilla::jni::ByteBuffer::LocalRef";
}
return "mozilla::jni::Object::LocalRef";
}
/**
* Get the JNI class descriptor corresponding to the provided type parameter.
*
* @param type Class to determine the corresponding JNI descriptor for.
* @return Class descripor as a String
*/
public static String getClassDescriptor(Class<?> type) {
final String name = type.getName().replace('.', '/');
if (CLASS_DESCRIPTORS.containsKey(name)) {
return CLASS_DESCRIPTORS.get(name);
}
if (type.isArray()) {
// Array names are already in class descriptor form.
return name;
}
return "L" + name + ';';
}
/**
* Get the JNI signaure for a member.
*
* @param member Member to get the signature for.
* @return JNI signature as a string
*/
public static String getSignature(Member member) {
return member instanceof Field ? getSignature((Field) member) :
member instanceof Method ? getSignature((Method) member) :
getSignature((Constructor<?>) member);
}
/**
* Get the JNI signaure for a field.
*
* @param member Field to get the signature for.
* @return JNI signature as a string
*/
public static String getSignature(Field member) {
return getClassDescriptor(member.getType());
}
private static String getSignature(Class<?>[] args, Class<?> ret) {
final StringBuilder sig = new StringBuilder("(");
for (int i = 0; i < args.length; i++) {
sig.append(getClassDescriptor(args[i]));
}
return sig.append(')').append(getClassDescriptor(ret)).toString();
}
/**
* Get the JNI signaure for a method.
*
* @param member Method to get the signature for.
* @return JNI signature as a string
*/
public static String getSignature(Method member) {
return getSignature(member.getParameterTypes(), member.getReturnType());
}
/**
* Get the JNI signaure for a constructor.
*
* @param member Constructor to get the signature for.
* @return JNI signature as a string
*/
public static String getSignature(Constructor<?> member) {
return getSignature(member.getParameterTypes(), void.class);
}
/**
* Get the C++ name for a member.
*
* @param member Member to get the name for.
* @return JNI name as a string
*/
public static String getNativeName(Member member) {
final String name = getMemberName(member);
return name.substring(0, 1).toUpperCase() + name.substring(1);
}
/**
* Get the C++ name for a member.
*
* @param member Member to get the name for.
* @return JNI name as a string
*/
public static String getNativeName(Class<?> clz) {
final String name = clz.getName();
return name.substring(0, 1).toUpperCase() + name.substring(1);
}
/**
* Get the C++ name for a member.
*
* @param member Member to get the name for.
* @return JNI name as a string
*/
public static String getNativeName(AnnotatedElement element) {
if (element instanceof Class<?>) {
return getNativeName((Class<?>)element);
} else if (element instanceof Member) {
return getNativeName((Member)element);
} else {
return null;
}
}
/**
* Get the JNI name for a member.
*
* @param member Member to get the name for.
* @return JNI name as a string
*/
public static String getMemberName(Member member) {
if (member instanceof Constructor) {
return "<init>";
}
return member.getName();
}
public static String getUnqualifiedName(String name) {
return name.substring(name.lastIndexOf(':') + 1);
}
/**
* Determine if a member is declared static.
*
* @param member The Member to check.
* @return true if the member is declared static, false otherwise.
*/
public static boolean isStatic(final Member member) {
return Modifier.isStatic(member.getModifiers());
}
/**
* Determine if a member is declared final.
*
* @param member The Member to check.
* @return true if the member is declared final, false otherwise.
*/
public static boolean isFinal(final Member member) {
return Modifier.isFinal(member.getModifiers());
}
}
-376
View File
@@ -1,376 +0,0 @@
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
AC_DEFUN([MOZ_ANDROID_NDK],
[
MOZ_ARG_WITH_STRING(android-cxx-stl,
[ --with-android-cxx-stl=VALUE
use the specified C++ STL (libstdc++, libc++)],
android_cxx_stl=$withval,
android_cxx_stl=libc++)
case "$target" in
*-android*|*-linuxandroid*)
dnl $android_platform will be set for us by Python configure.
CPPFLAGS="-idirafter $android_platform/usr/include $CPPFLAGS"
CFLAGS="-fno-short-enums -fno-exceptions $CFLAGS"
CXXFLAGS="-fno-short-enums -fno-exceptions $CXXFLAGS"
ASFLAGS="-idirafter $android_platform/usr/include -DANDROID $ASFLAGS"
dnl Add --allow-shlib-undefined, because libGLESv2 links to an
dnl undefined symbol (present on the hardware, just not in the
dnl NDK.)
LDFLAGS="-L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform -Wl,--allow-shlib-undefined $LDFLAGS"
dnl Add -llog by default, since we use it all over the place.
LIBS="-llog $LIBS"
ANDROID_PLATFORM="${android_platform}"
AC_DEFINE(ANDROID)
AC_SUBST(ANDROID_PLATFORM)
;;
esac
])
AC_DEFUN([MOZ_ANDROID_CPU_ARCH],
[
if test "$OS_TARGET" = "Android"; then
case "${CPU_ARCH}-${MOZ_ARCH}" in
arm-armv7*)
ANDROID_CPU_ARCH=armeabi-v7a
;;
arm-*)
ANDROID_CPU_ARCH=armeabi
;;
x86-*)
ANDROID_CPU_ARCH=x86
;;
mips32-*) # When target_cpu is mipsel, CPU_ARCH is mips32
ANDROID_CPU_ARCH=mips
;;
aarch64-*)
ANDROID_CPU_ARCH=arm64-v8a
;;
esac
AC_SUBST(ANDROID_CPU_ARCH)
fi
])
AC_DEFUN([MOZ_ANDROID_STLPORT],
[
if test "$OS_TARGET" = "Android"; then
cpu_arch_dir="$ANDROID_CPU_ARCH"
# NDK r12 removed the arm/thumb library split and just made everything
# thumb by default. Attempt to compensate.
if test "$MOZ_THUMB2" = 1 -a -d "$cpu_arch_dir/thumb"; then
cpu_arch_dir="$cpu_arch_dir/thumb"
fi
if test -z "$STLPORT_CPPFLAGS$STLPORT_LIBS"; then
case "$android_cxx_stl" in
libstdc++)
# android-ndk-r8b and later
ndk_base="$android_ndk/sources/cxx-stl/gnu-libstdc++/$android_gnu_compiler_version"
ndk_libs_include="$ndk_base/libs/$ANDROID_CPU_ARCH"
ndk_libs="$ndk_base/libs/$cpu_arch_dir"
ndk_include="$ndk_base/include"
if ! test -e "$ndk_libs/libgnustl_static.a"; then
AC_MSG_ERROR([Couldn't find path to gnu-libstdc++ in the android ndk])
fi
STLPORT_LIBS="-L$ndk_libs -lgnustl_static"
STLPORT_CPPFLAGS="-I$ndk_include -I$ndk_include/backward -I$ndk_libs_include/include"
;;
libc++)
# android-ndk-r8b and later
ndk_base="$android_ndk/sources/cxx-stl"
cxx_base="$ndk_base/llvm-libc++"
cxx_libs="$cxx_base/libs/$cpu_arch_dir"
cxx_include="$cxx_base/libcxx/include"
cxxabi_base="$ndk_base/llvm-libc++abi"
cxxabi_include="$cxxabi_base/libcxxabi/include"
if ! test -e "$cxx_libs/libc++_static.a"; then
AC_MSG_ERROR([Couldn't find path to llvm-libc++ in the android ndk])
fi
STLPORT_LIBS="-L$cxx_libs -lc++_static"
# NDK r12 split the libc++ runtime libraries into pieces.
for lib in c++abi unwind android_support; do
if test -e "$cxx_libs/lib${lib}.a"; then
STLPORT_LIBS="$STLPORT_LIBS -l${lib}"
fi
done
# Add android/support/include/ for prototyping long double math
# functions, locale-specific C library functions, multibyte support,
# etc.
STLPORT_CPPFLAGS="-I$android_ndk/sources/android/support/include -I$cxx_include -I$cxxabi_include"
;;
*)
AC_MSG_ERROR([Bad value for --enable-android-cxx-stl])
;;
esac
fi
CXXFLAGS="$CXXFLAGS $STLPORT_CPPFLAGS"
fi
MOZ_ANDROID_CXX_STL=$android_cxx_stl
AC_SUBST([MOZ_ANDROID_CXX_STL])
AC_SUBST([STLPORT_LIBS])
])
AC_DEFUN([concat],[$1$2$3$4])
dnl Find a component of an AAR.
dnl Arg 1: variable name to expose, like ANDROID_SUPPORT_V4_LIB.
dnl Arg 2: path to component.
dnl Arg 3: if non-empty, expect and require component.
AC_DEFUN([MOZ_ANDROID_AAR_COMPONENT], [
ifelse([$3], ,
[
if test -e "$$1" ; then
AC_MSG_ERROR([Found unexpected exploded $1!])
fi
],
[
AC_MSG_CHECKING([for $1])
$1="$2"
if ! test -e "$$1" ; then
AC_MSG_ERROR([Could not find required exploded $1!])
fi
AC_MSG_RESULT([$$1])
AC_SUBST($1)
])
])
dnl Find an AAR and expose variables representing its exploded components.
dnl AC_SUBSTs ANDROID_NAME_{AAR,AAR_RES,AAR_LIB,AAR_INTERNAL_LIB}.
dnl Arg 1: name, like play-services-base
dnl Arg 2: version, like 7.8.0
dnl Arg 3: extras subdirectory, either android or google
dnl Arg 4: package subdirectory, like com/google/android/gms
dnl Arg 5: if non-empty, expect and require internal_impl JAR.
dnl Arg 6: if non-empty, expect and require assets/ directory.
AC_DEFUN([MOZ_ANDROID_AAR],[
define([local_aar_var_base], translit($1, [-a-z], [_A-Z]))
define([local_aar_var], concat(ANDROID_, local_aar_var_base, _AAR))
local_aar_var="$ANDROID_SDK_ROOT/extras/$3/m2repository/$4/$1/$2/$1-$2.aar"
AC_MSG_CHECKING([for $1 AAR])
if ! test -e "$local_aar_var" ; then
AC_MSG_ERROR([You must download the $1 AAR. Run the Android SDK tool and install the Android and Google Support Repositories under Extras. See https://developer.android.com/tools/extras/support-library.html for more info. (Looked for $local_aar_var)])
fi
AC_SUBST(local_aar_var)
AC_MSG_RESULT([$local_aar_var])
if ! $PYTHON -m mozbuild.action.explode_aar --destdir=$MOZ_BUILD_ROOT/dist/exploded-aar $local_aar_var ; then
AC_MSG_ERROR([Could not explode $local_aar_var!])
fi
define([root], $MOZ_BUILD_ROOT/dist/exploded-aar/$1-$2/)
MOZ_ANDROID_AAR_COMPONENT(concat(local_aar_var, _LIB), concat(root, $1-$2-classes.jar), REQUIRED)
MOZ_ANDROID_AAR_COMPONENT(concat(local_aar_var, _RES), concat(root, res), REQUIRED)
MOZ_ANDROID_AAR_COMPONENT(concat(local_aar_var, _INTERNAL_LIB), concat(root, libs/$1-$2-internal_impl-$2.jar), $5)
MOZ_ANDROID_AAR_COMPONENT(concat(local_aar_var, _ASSETS), concat(root, assets), $6)
])
AC_DEFUN([MOZ_ANDROID_GOOGLE_PLAY_SERVICES],
[
if test -n "$MOZ_NATIVE_DEVICES" ; then
AC_SUBST(MOZ_NATIVE_DEVICES)
MOZ_ANDROID_AAR(play-services-base, $ANDROID_GOOGLE_PLAY_SERVICES_VERSION, google, com/google/android/gms)
MOZ_ANDROID_AAR(play-services-basement, $ANDROID_GOOGLE_PLAY_SERVICES_VERSION, google, com/google/android/gms)
MOZ_ANDROID_AAR(play-services-cast, $ANDROID_GOOGLE_PLAY_SERVICES_VERSION, google, com/google/android/gms)
MOZ_ANDROID_AAR(mediarouter-v7, $ANDROID_SUPPORT_LIBRARY_VERSION, android, com/android/support, REQUIRED_INTERNAL_IMPL)
fi
])
AC_DEFUN([MOZ_ANDROID_GOOGLE_CLOUD_MESSAGING],
[
if test -n "$MOZ_ANDROID_GCM" ; then
MOZ_ANDROID_AAR(play-services-base, $ANDROID_GOOGLE_PLAY_SERVICES_VERSION, google, com/google/android/gms)
MOZ_ANDROID_AAR(play-services-basement, $ANDROID_GOOGLE_PLAY_SERVICES_VERSION, google, com/google/android/gms)
MOZ_ANDROID_AAR(play-services-gcm, $ANDROID_GOOGLE_PLAY_SERVICES_VERSION, google, com/google/android/gms)
MOZ_ANDROID_AAR(play-services-measurement, $ANDROID_GOOGLE_PLAY_SERVICES_VERSION, google, com/google/android/gms)
fi
])
AC_DEFUN([MOZ_ANDROID_INSTALL_TRACKING],
[
if test -n "$MOZ_INSTALL_TRACKING"; then
AC_SUBST(MOZ_INSTALL_TRACKING)
MOZ_ANDROID_AAR(play-services-ads, $ANDROID_GOOGLE_PLAY_SERVICES_VERSION, google, com/google/android/gms)
MOZ_ANDROID_AAR(play-services-basement, $ANDROID_GOOGLE_PLAY_SERVICES_VERSION, google, com/google/android/gms)
fi
])
dnl Configure an Android SDK.
dnl Arg 1: target SDK version, like 23.
dnl Arg 2: list of build-tools versions, like "23.0.3 23.0.1".
AC_DEFUN([MOZ_ANDROID_SDK],
[
MOZ_ARG_WITH_STRING(android-sdk,
[ --with-android-sdk=DIR
location where the Android SDK can be found (like ~/.mozbuild/android-sdk-linux)],
android_sdk_root=$withval)
android_sdk_root=${withval%/platforms/android-*}
case "$target" in
*-android*|*-linuxandroid*)
if test -z "$android_sdk_root" ; then
AC_MSG_ERROR([You must specify --with-android-sdk=/path/to/sdk when targeting Android.])
fi
# We were given an old-style
# --with-android-sdk=/path/to/sdk/platforms/android-*. We could warn, but
# we'll get compliance by forcing the issue.
if test -e "$withval"/source.properties ; then
AC_MSG_ERROR([Including platforms/android-* in --with-android-sdk arguments is deprecated. Use --with-android-sdk=$android_sdk_root.])
fi
android_target_sdk=$1
AC_MSG_CHECKING([for Android SDK platform version $android_target_sdk])
android_sdk=$android_sdk_root/platforms/android-$android_target_sdk
if ! test -e "$android_sdk/source.properties" ; then
AC_MSG_ERROR([You must download Android SDK platform version $android_target_sdk. Try |mach bootstrap|. (Looked for $android_sdk)])
fi
AC_MSG_RESULT([$android_sdk])
AC_MSG_CHECKING([for Android build-tools])
android_build_tools_base="$android_sdk_root"/build-tools
android_build_tools_version=""
for version in $2; do
android_build_tools="$android_build_tools_base"/$version
if test -d "$android_build_tools" -a -f "$android_build_tools/aapt"; then
android_build_tools_version=$version
AC_MSG_RESULT([$android_build_tools])
break
fi
done
if test "$android_build_tools_version" = ""; then
version=$(echo $2 | cut -d" " -f1)
AC_MSG_ERROR([You must install the Android build-tools version $version. Try |mach bootstrap|. (Looked for "$android_build_tools_base"/$version)])
fi
MOZ_PATH_PROG(ZIPALIGN, zipalign, :, [$android_build_tools])
MOZ_PATH_PROG(DX, dx, :, [$android_build_tools])
MOZ_PATH_PROG(AAPT, aapt, :, [$android_build_tools])
MOZ_PATH_PROG(AIDL, aidl, :, [$android_build_tools])
if test -z "$ZIPALIGN" -o "$ZIPALIGN" = ":"; then
AC_MSG_ERROR([The program zipalign was not found. Try |mach bootstrap|.])
fi
if test -z "$DX" -o "$DX" = ":"; then
AC_MSG_ERROR([The program dx was not found. Try |mach bootstrap|.])
fi
if test -z "$AAPT" -o "$AAPT" = ":"; then
AC_MSG_ERROR([The program aapt was not found. Try |mach bootstrap|.])
fi
if test -z "$AIDL" -o "$AIDL" = ":"; then
AC_MSG_ERROR([The program aidl was not found. Try |mach bootstrap|.])
fi
android_platform_tools="$android_sdk_root"/platform-tools
AC_MSG_CHECKING([for Android platform-tools])
if test -d "$android_platform_tools" -a -f "$android_platform_tools/adb"; then
AC_MSG_RESULT([$android_platform_tools])
else
AC_MSG_ERROR([You must install the Android platform-tools. Try |mach bootstrap|. (Looked for $android_platform_tools)])
fi
MOZ_PATH_PROG(ADB, adb, :, [$android_platform_tools])
if test -z "$ADB" -o "$ADB" = ":"; then
AC_MSG_ERROR([The program adb was not found. Try |mach bootstrap|.])
fi
android_tools="$android_sdk_root"/tools
AC_MSG_CHECKING([for Android tools])
if test -d "$android_tools" -a -f "$android_tools/emulator"; then
AC_MSG_RESULT([$android_tools])
else
AC_MSG_ERROR([You must install the Android tools. Try |mach bootstrap|. (Looked for $android_tools)])
fi
MOZ_PATH_PROG(EMULATOR, emulator, :, [$android_tools])
if test -z "$EMULATOR" -o "$EMULATOR" = ":"; then
AC_MSG_ERROR([The program emulator was not found. Try |mach bootstrap|.])
fi
ANDROID_TARGET_SDK="${android_target_sdk}"
ANDROID_SDK="${android_sdk}"
ANDROID_SDK_ROOT="${android_sdk_root}"
ANDROID_TOOLS="${android_tools}"
ANDROID_BUILD_TOOLS_VERSION="$android_build_tools_version"
AC_DEFINE_UNQUOTED(ANDROID_TARGET_SDK,$ANDROID_TARGET_SDK)
AC_SUBST(ANDROID_TARGET_SDK)
AC_SUBST(ANDROID_SDK_ROOT)
AC_SUBST(ANDROID_SDK)
AC_SUBST(ANDROID_TOOLS)
AC_SUBST(ANDROID_BUILD_TOOLS_VERSION)
MOZ_ANDROID_AAR(customtabs, $ANDROID_SUPPORT_LIBRARY_VERSION, android, com/android/support)
MOZ_ANDROID_AAR(appcompat-v7, $ANDROID_SUPPORT_LIBRARY_VERSION, android, com/android/support)
MOZ_ANDROID_AAR(support-vector-drawable, $ANDROID_SUPPORT_LIBRARY_VERSION, android, com/android/support)
MOZ_ANDROID_AAR(animated-vector-drawable, $ANDROID_SUPPORT_LIBRARY_VERSION, android, com/android/support)
MOZ_ANDROID_AAR(cardview-v7, $ANDROID_SUPPORT_LIBRARY_VERSION, android, com/android/support)
MOZ_ANDROID_AAR(design, $ANDROID_SUPPORT_LIBRARY_VERSION, android, com/android/support)
MOZ_ANDROID_AAR(recyclerview-v7, $ANDROID_SUPPORT_LIBRARY_VERSION, android, com/android/support)
MOZ_ANDROID_AAR(support-v4, $ANDROID_SUPPORT_LIBRARY_VERSION, android, com/android/support, REQUIRED_INTERNAL_IMPL)
MOZ_ANDROID_AAR(palette-v7, $ANDROID_SUPPORT_LIBRARY_VERSION, android, com/android/support)
ANDROID_SUPPORT_ANNOTATIONS_JAR="$ANDROID_SDK_ROOT/extras/android/m2repository/com/android/support/support-annotations/$ANDROID_SUPPORT_LIBRARY_VERSION/support-annotations-$ANDROID_SUPPORT_LIBRARY_VERSION.jar"
AC_MSG_CHECKING([for support-annotations JAR])
if ! test -e $ANDROID_SUPPORT_ANNOTATIONS_JAR ; then
AC_MSG_ERROR([You must download the support-annotations lib. Run the Android SDK tool and install the Android Support Repository under Extras. See https://developer.android.com/tools/extras/support-library.html for more info. (looked for $ANDROID_SUPPORT_ANNOTATIONS_JAR)])
fi
AC_MSG_RESULT([$ANDROID_SUPPORT_ANNOTATIONS_JAR])
AC_SUBST(ANDROID_SUPPORT_ANNOTATIONS_JAR)
ANDROID_SUPPORT_ANNOTATIONS_JAR_LIB=$ANDROID_SUPPORT_ANNOTATIONS_JAR
AC_SUBST(ANDROID_SUPPORT_ANNOTATIONS_JAR_LIB)
;;
esac
MOZ_ARG_WITH_STRING(android-min-sdk,
[ --with-android-min-sdk=[VER] Impose a minimum Firefox for Android SDK version],
[ MOZ_ANDROID_MIN_SDK_VERSION=$withval ])
MOZ_ARG_WITH_STRING(android-max-sdk,
[ --with-android-max-sdk=[VER] Impose a maximum Firefox for Android SDK version],
[ MOZ_ANDROID_MAX_SDK_VERSION=$withval ])
if test -n "$MOZ_ANDROID_MIN_SDK_VERSION"; then
if test -n "$MOZ_ANDROID_MAX_SDK_VERSION"; then
if test $MOZ_ANDROID_MAX_SDK_VERSION -lt $MOZ_ANDROID_MIN_SDK_VERSION ; then
AC_MSG_ERROR([--with-android-max-sdk must be at least the value of --with-android-min-sdk.])
fi
fi
if test $MOZ_ANDROID_MIN_SDK_VERSION -gt $ANDROID_TARGET_SDK ; then
AC_MSG_ERROR([--with-android-min-sdk is expected to be less than $ANDROID_TARGET_SDK])
fi
AC_DEFINE_UNQUOTED(MOZ_ANDROID_MIN_SDK_VERSION, $MOZ_ANDROID_MIN_SDK_VERSION)
AC_SUBST(MOZ_ANDROID_MIN_SDK_VERSION)
fi
if test -n "$MOZ_ANDROID_MAX_SDK_VERSION"; then
AC_DEFINE_UNQUOTED(MOZ_ANDROID_MAX_SDK_VERSION, $MOZ_ANDROID_MAX_SDK_VERSION)
AC_SUBST(MOZ_ANDROID_MAX_SDK_VERSION)
fi
])
-12
View File
@@ -28,24 +28,12 @@ MOZ_ARG_WITH_STRING(arch,
if test -z "$MOZ_ARCH"; then
dnl Defaults
case "${CPU_ARCH}-${OS_TARGET}" in
arm-Android)
MOZ_THUMB=yes
MOZ_ARCH=armv7-a
MOZ_FPU=vfp
MOZ_FLOAT_ABI=softfp
MOZ_ALIGN=no
;;
arm-Darwin)
MOZ_ARCH=toolchain-default
;;
esac
fi
if test "$MOZ_ARCH" = "armv6" -a "$OS_TARGET" = "Android"; then
MOZ_FPU=vfp
MOZ_FLOAT_ABI=softfp
fi
MOZ_ARG_WITH_STRING(thumb,
[ --with-thumb[[=yes|no|toolchain-default]]]
[ Use Thumb instruction set (-mthumb)],
+8 -16
View File
@@ -16,7 +16,7 @@ dnl set DEVELOPER_OPTIONS early; MOZ_DEFAULT_COMPILER is usually the first non-s
DEVELOPER_OPTIONS=,
DEVELOPER_OPTIONS=1)
dnl Default to MSVC for win32 and gcc-4.2 for darwin
dnl Default to MSVC for win32
dnl ==============================================================
if test -z "$CROSS_COMPILE"; then
case "$target" in
@@ -176,8 +176,8 @@ if test "$GNU_CC"; then
CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
CXXFLAGS="$CXXFLAGS -ffunction-sections -fdata-sections"
fi
CFLAGS="$CFLAGS -fno-math-errno"
CXXFLAGS="$CXXFLAGS -fno-exceptions -fno-math-errno"
CFLAGS="$CFLAGS -fno-math-errno -pipe"
CXXFLAGS="$CXXFLAGS -fno-exceptions -fno-math-errno -pipe"
if test "$CPU_ARCH" = "x86" -o "$CPU_ARCH" = "x86_64"; then
CFLAGS="$CFLAGS -msse2 -mfpmath=sse"
@@ -186,7 +186,8 @@ if test "$GNU_CC"; then
if test -z "$CLANG_CC"; then
case "$CC_VERSION" in
4.* | 5.*)
4.* | 5.* | 6.*)
AC_MSG_ERROR([Unsupported GCC version.])
;;
*)
# Lifetime Dead Store Elimination level 2 (default in GCC6+) breaks Gecko.
@@ -270,18 +271,9 @@ if test "$GNU_CC" -a "$GCC_USE_GNU_LD" -a -z "$DEVELOPER_OPTIONS"; then
fi
fi
# bionic in Android < 4.1 doesn't support PIE
# On OSX, the linker defaults to building PIE programs when targetting OSX 10.7+,
# but not when targetting OSX < 10.7. OSX < 10.7 doesn't support running PIE
# programs, so as long as support for OSX 10.6 is kept, we can't build PIE.
# Even after dropping 10.6 support, MOZ_PIE would not be useful since it's the
# default (and clang says the -pie option is not used).
# On other Unix systems, some file managers (Nautilus) can't start PIE programs
if test -n "$gonkdir" && test "$ANDROID_VERSION" -ge 16; then
MOZ_PIE=1
else
MOZ_PIE=
fi
# On some Unix systems, some file managers (e.g. Nautilus) can't start PIE programs
# so don't enable it by default.
MOZ_PIE=
MOZ_ARG_ENABLE_BOOL(pie,
[ --enable-pie Enable Position Independent Executables],
+2 -6
View File
@@ -114,7 +114,7 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | \
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
kopensolaris*-gnu* | \
@@ -122,10 +122,6 @@ case $maybe_os in
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
android-linux)
os=-linux-android
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
;;
*)
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ]
@@ -1389,7 +1385,7 @@ case $os in
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* | -cegcc* \
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
| -mingw32* | -mingw64* | -linux-gnu* \
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
-5
View File
@@ -7,11 +7,6 @@ dnl disabling frame pointers in this architecture based on the configure
dnl options
AC_DEFUN([MOZ_SET_FRAMEPTR_FLAGS], [
case "$target" in
*android*)
unwind_tables="-funwind-tables"
;;
esac
if test "$GNU_CC"; then
MOZ_ENABLE_FRAME_PTR="-fno-omit-frame-pointer $unwind_tables"
MOZ_DISABLE_FRAME_PTR="-fomit-frame-pointer"
-108
View File
@@ -1,108 +0,0 @@
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
AC_DEFUN([MOZ_IOS_PATH_PROG],
[
changequote({,})
_prog_name=ifelse($2, {}, `echo $1 | tr "[:upper:]" "[:lower:]"`, $2)
changequote([,])
AC_CACHE_CHECK([for $_prog_name in iOS SDK],
ac_cv_ios_path_$1,
[
_path=`xcrun --sdk $ios_sdk --find $_prog_name 2>/dev/null`
_res=$?
if test $_res -ne 0; then
AC_MSG_ERROR([Could not find '$_prog_name' in the iOS SDK])
fi
ac_cv_ios_path_$1=$_path
])
$1="${ac_cv_ios_path_$1}$3"
])
AC_DEFUN([MOZ_IOS_SDK],
[
MOZ_ARG_WITH_STRING(ios-sdk,
[ --with-ios-sdk=TYPE
Type of iOS SDK to use (iphonesimulator, iphoneos)
and optionally version (like iphoneos8.2)],
ios_sdk=$withval)
MOZ_ARG_ENABLE_STRING(ios-target,
[ --enable-ios-target=VER (default=8.0)
Set the minimum iOS version needed at runtime],
[_IOS_TARGET=$enableval])
_IOS_TARGET_DEFAULT=8.0
case "$target" in
arm*-apple-darwin*)
if test -z "$ios_sdk" -o "$ios_sdk" = "yes"; then
ios_sdk=iphoneos
fi
case "$ios_sdk" in
iphoneos*)
ios_target_arg="-miphoneos-version-min"
;;
*)
AC_MSG_ERROR([Only 'iphoneos' SDKs are valid when targeting iOS device, don't know what to do with '$ios_sdk'.])
;;
esac
;;
*-apple-darwin*)
ios_target_arg="-mios-simulator-version-min"
case "$ios_sdk" in
# Empty SDK is okay, this might be an OS X desktop build.
""|iphonesimulator*)
;;
# Default to iphonesimulator
yes)
ios_sdk=iphonesimulator
;;
*)
AC_MSG_ERROR([Only 'iphonesimulator' SDKs are valid when targeting iOS simulator.])
;;
esac
;;
esac
if test -n "$ios_sdk"; then
if test -z "$_IOS_TARGET"; then
_IOS_TARGET=$_IOS_TARGET_DEFAULT
ios_target_arg="${ios_target_arg}=${_IOS_TARGET}"
fi
# Ensure that xcrun knows where this SDK is.
ios_sdk_path=`xcrun --sdk $ios_sdk --show-sdk-path 2>/dev/null`
_ret=$?
if test $_ret -ne 0; then
AC_MSG_ERROR([iOS SDK '$ios_sdk' could not be found.])
fi
MOZ_IOS=1
export HOST_CC=clang
export HOST_CXX=clang++
# Add isysroot, arch, and ios target arguments
case "$target_cpu" in
arm*)
ARGS="-arch armv7"
;;
*)
# Unfortunately simulator builds need this.
export CROSS_COMPILE=1
;;
esac
ARGS=" $ARGS -isysroot $ios_sdk_path $ios_target_arg"
# Now find our tools
MOZ_IOS_PATH_PROG(CC, clang, $ARGS)
MOZ_IOS_PATH_PROG(CXX, clang++, $ARGS)
export CPP="$CC -E"
export LD="$CXX"
MOZ_IOS_PATH_PROG(AR)
MOZ_IOS_PATH_PROG(AS, as, $ARGS)
MOZ_IOS_PATH_PROG(OTOOL)
MOZ_IOS_PATH_PROG(STRIP)
export PKG_CONFIG_PATH=${ios_sdk_path}/usr/lib/pkgconfig/
fi
AC_SUBST(MOZ_IOS)
])
+2
View File
@@ -138,6 +138,8 @@ if test -n "$NSPR_CFLAGS" -o -n "$NSPR_LIBS"; then
,
AC_MSG_ERROR([system NSPR does not support PR_UINT64 or including prtypes.h does not provide it]))
CFLAGS=$_SAVE_CFLAGS
NSPR_INCLUDE_DIR=`echo ${NSPR_CFLAGS} | sed -e 's/.*-I\([^ ]*\).*/\1/'`
NSPR_LIB_DIR=`echo ${NSPR_LIBS} | sed -e 's/.*-L\([^ ]*\).*/\1/'`
elif test -z "$JS_POSIX_NSPR"; then
NSPR_INCLUDE_DIR="${DIST}/include/nspr"
NSPR_CFLAGS="-I${NSPR_INCLUDE_DIR}"
+3
View File
@@ -27,6 +27,9 @@ fi
if test "`echo | $AS -o conftest.out -v 2>&1 | grep -c GNU`" != "0"; then
GNU_AS=1
fi
if test "`echo | $AS -o conftest.out -v 2>&1 | grep -c Apple`" != "0"; then
GNU_AS=1
fi
rm -f conftest.out
if test "`echo | $LD -v 2>&1 | grep -c GNU`" != "0"; then
GNU_LD=1
-58
View File
@@ -1,58 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Imports
from __future__ import print_function, unicode_literals
import os
import sys
# Sanity check
if not len(sys.argv) > 1:
print("Incorrect number of arguments")
sys.exit(1)
# Vars
listConfigure = sys.argv[1:]
listConfig = []
strBrandingDirectory = ""
listViolations = []
# Build a list of set configure variables
for _value in listConfigure:
_splitString = _value.split("=")
if _splitString[1] == "1":
listConfig += [ _splitString[0] ]
elif _splitString[0] == "MOZ_BRANDING_DIRECTORY":
strBrandingDirectory = _splitString[1]
# Only applies if using Official Branding or specific branding directories
if ('MOZ_OFFICIAL_BRANDING' in listConfig) or (strBrandingDirectory.endswith("branding/official")) or (strBrandingDirectory.endswith("branding/unstable")):
# Applies to Pale Moon and Basilisk
if ('MC_BASILISK' in listConfig) or ('MC_PALEMOON' in listConfig):
listViolations += [
'MOZ_SYSTEM_JPEG',
'MOZ_SYSTEM_ZLIB',
'MOZ_SYSTEM_BZ2',
'MOZ_SYSTEM_JEMALLOC'
]
# Applies to Pale Moon Only
if 'MC_PALEMOON' in listConfig:
listViolations += [
'MOZ_EME',
'MOZ_WEBRTC'
]
# Iterate through enabled violations and output 1 to DIRECTIVE4 if any are found
for _value in listViolations:
if _value in listConfig:
sys.stdout.write("1")
sys.exit(1)
# Exit outputting nothing to DIRECTIVE4 being empty because there are no violations
sys.exit(0)
-90
View File
@@ -1,90 +0,0 @@
.. _build_androideclipse:
========================
Android Eclipse Projects
========================
The build system contains alpha support for generating Android Eclipse
project files to aid with development.
To generate Android Eclipse project files, you'll need to have a fully
built and packaged tree::
mach build && mach package
(This is because Eclipse itself packages an APK containing
``omni.ja``, and ``omni.ja`` is only assembled during packaging.)
Then, simply generate the Android Eclipse build backend::
mach build-backend -b AndroidEclipse
If all goes well, the path to the generated projects should be
printed (currently, ``$OBJDIR/android_eclipse``).
To use the generated Android Eclipse project files, you'll need to
have a recent version of Eclipse (see `Tested Versions`_) with the
`Eclipse ADT plugin
<http://developer.android.com/tools/sdk/eclipse-adt.html>`_
installed. You can then import all the projects into Eclipse using
*File > Import ... > General > Existing Projects into Workspace*.
Updating Project Files
======================
As you pull and update the source tree, your Android Eclipse files may
fall out of sync with the build configuration. The tree should still
build fine from within Eclipse, but source files may be missing and in
rare circumstances Eclipse's index may not have the proper build
configuration.
To account for this, you'll want to periodically regenerate the
Android Eclipse project files. You can do this by running ``mach build
&& mach package && mach build-backend -b AndroidEclipse`` from the
command line. It's a good idea to refresh and clean build all projects
in Eclipse after doing this.
In future, we'd like to include an Android Eclipse run configuration
or build target that integrates updating the project files.
Currently, regeneration rewrites the original project files. **If
you've made any customizations to the projects, they will likely get
overwritten.** We would like to improve this user experience in the
future.
Troubleshooting
===============
If Eclipse's builder gets confused, you should always refresh and
clean build all projects. If Eclipse's builder is continually
confused, you can see a log of what is happening at
``$OBJDIR/android_eclipse/build.log``.
If you run into memory problems executing ``dex``, you should
`Increase Eclipse's memory limits <http://stackoverflow.com/a/11093228>`_.
The produced Android Eclipse project files are unfortunately not
portable. Please don't move them around.
Structure of Android Eclipse projects
=====================================
The Android Eclipse backend generates several projects spanning Fennec
itself and its tests. You'll mostly interact with the *Fennec* project
itself.
In future, we'd like to expand this documentation to include some of
the technical details of how the Eclipse integration works, and how to
add additional Android Eclipse projects using the ``moz.build``
system.
Tested Versions
===============
=============== ==================================== =================
OS Version Working as of
=============== ==================================== =================
Mac OS X Luna (Build id: 20130919-0819) February 2014
Mac OS X Kepler (Build id: 20131219-0014) February 2014
Mac OS X 10.8.5 Kepler (Build id: 20130919-0819) February 2014
=============== ==================================== =================
-54
View File
@@ -1,54 +0,0 @@
.. _build_cppeclipse:
=====================
Cpp Eclipse Projects
=====================
For additional information on using Eclipse CDT see
`the MDN page
<https://developer.mozilla.org/en-US/docs/Eclipse_CDT>`_.
The build system contains alpha support for generating C++ Eclipse
project files to aid with development.
Please report bugs to bugzilla and make them depend on bug 973770.
To generate a C++ Eclipse project files, you'll need to have a fully
built tree::
mach build
Then, simply generate the Android Eclipse build backend::
mach build-backend -b CppEclipse
If all goes well, the path to the generated workspace should be
printed (currently, ``$OBJDIR/android_eclipse``).
To use the generated Android Eclipse project files, you'll need to
have a Eclipse CDT 8.3 (We plan to follow the latest Eclipse release)
`Eclipse CDT plugin
<https://www.eclipse.org/cdt/>`_
installed. You can then import all the projects into Eclipse using
*File > Import ... > General > Existing Projects into Workspace*
-only- if you have not ran the background indexer.
Updating Project Files
======================
As you pull and update the source tree, your C++ Eclipse files may
fall out of sync with the build configuration. The tree should still
build fine from within Eclipse, but source files may be missing and in
rare circumstances Eclipse's index may not have the proper build
configuration.
To account for this, you'll want to periodically regenerate the
Android Eclipse project files. You can do this by running ``mach build
&& mach build-backend -b CppEclipse`` from the
command line.
Currently, regeneration rewrites the original project files. **If
you've made any customizations to the projects, they will likely get
overwritten.** We would like to improve this user experience in the
future.
-9
View File
@@ -28,15 +28,6 @@ Important Concepts
locales
rust
integrated development environment (IDE)
========================================
.. toctree::
:maxdepth: 1
androideclipse
cppeclipse
visualstudio
mozbuild
========
-79
View File
@@ -17,84 +17,5 @@ like a re-packaging post-processing step.
There are scripts in-tree in mozharness to orchestrate these re-packaging
steps for `Desktop
<https://dxr.mozilla.org/mozilla-central/source/testing/mozharness/scripts/desktop_l10n.py>`_
and `Android
<https://dxr.mozilla.org/mozilla-central/source/testing/mozharness/scripts/mobile_l10n.py>`_
but they rely heavily on buildbot information so they are almost impossible to
run locally.
The following instructions are extracted from the `Android script with hg hash
494289c7
<https://dxr.mozilla.org/mozilla-central/rev/494289c72ba3997183e7b5beaca3e0447ecaf96d/testing/mozharness/scripts/mobile_l10n.py>`_,
and may need to be updated and slightly modified for Desktop.
Step by step instructions for Android
-------------------------------------
This assumes that ``$AB_CD`` is the locale you want to repack with; I tested
with "ar" and "en-GB".
.. warning:: l10n repacks do not work with artifact builds. Repackaging
compiles no code so supporting ``--disable-compile-environment`` would not
save much, if any, time.
#. You must have a built and packaged object directory, or a pre-built
``en-US`` package.
.. code-block:: shell
./mach build
./mach package
#. Clone ``l10n-central/$AB_CD`` so that it is a sibling to your
``mozilla-central`` directory.
.. code-block:: shell
$ ls -al
mozilla-central
...
$ mkdir -p l10n-central
$ hg clone https://hg.mozilla.org/l10n-central/$AB_CD l10n-central/$AB_CD
$ ls -al
mozilla-central
l10n-central/$AB_CD
...
#. Copy your ``mozconfig`` to ``mozconfig.l10n`` and add the following.
::
ac_add_options --with-l10n-base=../../l10n-central
ac_add_options --disable-tests
mk_add_options MOZ_OBJDIR=./objdir-l10n
#. Configure and prepare the l10n object directory.
.. code-block:: shell
MOZCONFIG=mozconfig.l10n ./mach configure
MOZCONFIG=mozconfig.l10n ./mach build -C config export
MOZCONFIG=mozconfig.l10n ./mach build buildid.h
#. Copy your built package and unpack it into the l10n object directory.
.. code-block:: shell
cp $OBJDIR/dist/fennec-*en-US*.apk ./objdir-l10n/dist
MOZCONFIG=mozconfig.l10n ./mach build -C mobile/android/locales unpack
#. Run the ``compare-locales`` script to write locale-specific changes into
``objdir-l10n/merged``.
.. code-block:: shell
MOZCONFIG=mozconfig.l10n ./mach compare-locales --merge-dir objdir-l10n/merged $AB_CD
#. Finally, repackage using the locale-specific changes.
.. code-block:: shell
MOZCONFIG=mozconfig.l10n LOCALE_MERGEDIR=`realpath objdir-l10n/merged` ./mach build -C mobile/android/locales installers-$AB_CD
(Note the absolute path for ``LOCALE_MERGEDIR``.) You should find a
re-packaged build at ``objdir-l10n/dist/fennec-*$AB_CD*.apk``.
+4 -19
View File
@@ -62,8 +62,7 @@ bits
buildapp
The path to the XUL application being built.
For desktop Firefox, this is ``browser``. For Fennec, it's
``mobile/android``. For B2G, it's ``b2g``.
For desktop Firefox, this is ``browser``.
crashreporter
Whether the crash reporter is enabled for this build.
@@ -72,13 +71,6 @@ crashreporter
Always defined.
datareporting
Whether data reporting (MOZ_DATA_REPORTING) is enabled for this build.
Values are ``true`` and ``false``.
Always defined.
debug
Whether this is a debug build.
@@ -86,13 +78,6 @@ debug
Always defined.
healthreport
Whether the Health Report feature is enabled.
Values are ``true`` and ``false``.
Always defined.
mozconfig
The path of the :ref:`mozconfig file <mozconfig>` used to produce this build.
@@ -107,9 +92,9 @@ nightly_build
os
The operating system the build is produced for. Values for tier-1
supported platforms are ``linux``, ``win``, ``mac``, ``b2g``, and
``android``. For other platforms, the value is the lowercase version
of the ``OS_TARGET`` variable from ``config.status``.
supported platforms are ``linux`` and ``win``. For other platforms,
the value is the lowercase version of the ``OS_TARGET`` variable
from ``config.status``.
Always defined.
+21 -21
View File
@@ -5,41 +5,44 @@ Supported Configurations
========================
This page attempts to document supported build configurations.
For more up-to-date information please go to http://developer.palemoon.org/
Windows
=======
We support building on Windows XP and newer operating systems using
Visual Studio 2010 and newer.
We support building on Windows 7 and newer operating systems using
Visual Studio 2015 U3.
The following are not fully supported by Mozilla (but may work):
The following are not fully supported (but may work):
* Building without the latest *MozillaBuild* Windows development
environment
* Building with a *MozillaBuild* Windows development
environment not mentioned on the developer documentation site.
* Building with Mingw or any other non-Visual Studio toolchain.
OS X
====
We support building on OS X 10.6 and newer with the OS X 10.6 SDK.
(This section needs updating)
We support building on OS X 10.8 and newer with the OS X 10.8 SDK.
The tree should build with the following OS X releases and SDK versions:
* 10.6 Snow Leopard
* 10.7 Lion
* 10.8 Mountain Lion
* 10.9 Mavericks
* 10.10 Yosemite
* 10.11 El Capitan
* 10.12 Sierra
* 10.13 High Sierra
* 10.14 Mojave
* 10.15 Catalina
* 11 Big Sur (Including Apple ARM SoC)
The tree requires building with Clang 3.3 and newer. This corresponds to
version of 4.2 of Apple's Clang that ships with Xcode. This corresponds
to Xcode 4.6 and newer. Xcode 4.6 only runs on OS X 10.7.4 and newer.
So, OS X 10.6 users will need to install a non-Apple toolchain. Running
``mach bootstrap`` should install an appropriate toolchain from Homebrew
or MacPorts automatically.
The tree requires building with Apple's Clang 4.2 that ships with Xcode.
This corresponds to Xcode 4.6 and newer. Xcode 4.6 only runs on OS X 10.7.4
and newer.
The tree should build with GCC 4.4 and newer on OS X. However, this
The tree should build with GCC 7.1 and newer on OS X. However, this
build configuration isn't as widely used (and differs from what Mozilla
uses to produce OS X builds), so it's recommended to stick with Clang.
uses to produce OS X builds).
Linux
=====
@@ -47,9 +50,6 @@ Linux
Linux 2.6 and later kernels are supported.
Most distributions are supported as long as the proper package
dependencies are in place. Running ``mach bootstrap`` should install
packages for popular Linux distributions. ``configure`` will typically
dependencies are in place. ``configure`` will typically
detect missing dependencies and inform you how to disable features to
work around unsatisfied dependencies.
Clang 3.3 or GCC 4.4 is required to build the tree.
-55
View File
@@ -54,58 +54,3 @@ archive::
$ ./mach python build/windows_toolchain.py create-zip vs2015u3
The produced archive will be the argument to ``create-zip`` + ``.zip``.
Firefox for Android with Gradle
===============================
To build Firefox for Android with Gradle in automation, archives
containing both the Gradle executable and a Maven repository
comprising the exact build dependencies are produced and uploaded to
an internal Mozilla server. The build automation will download,
verify, and extract these archive before building. These archives
provide a self-contained Gradle and Maven repository so that machines
don't need to fetch additional Maven dependencies at build time.
(Gradle and the downloaded Maven dependencies can be both
redistributed publicly.)
Archiving the Gradle executable is straight-forward, but archiving a
local Maven repository is not. Therefore a special Task Cluster
Docker image and job exist for producing the required archives. The
Docker image definition is rooted in
``taskcluster/docker/android-gradle-build``. The Task Cluster job
definition is in
``testing/taskcluster/tasks/builds/android_api_15_gradle_dependencies.yml``.
The job runs in a container based on the custom Docker image and
spawns a Sonatype Nexus proxying Maven repository process in the
background. The job builds Firefox for Android using Gradle and the
in-tree Gradle configuration rooted at ``build.gradle``. The spawned
proxying Maven repository downloads external dependencies and collects
them. After the Gradle build completes, the job archives the Gradle
version used to build, and the downloaded Maven repository, and
exposes them as Task Cluster artifacts.
Here is `an example try job fetching these dependencies
<https://treeherder.mozilla.org/#/jobs?repo=try&revision=75bc98935147&selectedJob=17793653>`_.
The resulting task produced a `Gradle archive
<https://queue.taskcluster.net/v1/task/CeYMgAP3Q-KF8h37nMhJjg/runs/0/artifacts/public%2Fbuild%2Fgradle.tar.xz>`_
and a `Maven repository archive
<https://queue.taskcluster.net/v1/task/CeYMgAP3Q-KF8h37nMhJjg/runs/0/artifacts/public%2Fbuild%2Fjcentral.tar.xz>`_.
These archives were then uploaded (manually) to Mozilla automation
using tooltool for consumption in Gradle builds.
To update the version of Gradle in the archive produced, update
``gradle/wrapper/gradle-wrapper.properties``. Be sure to also update
the SHA256 checksum to prevent poisoning the build machines!
To update the versions of Gradle dependencies used, update
``dependencies`` sections in the in-tree Gradle configuration rooted
at ``build.gradle``. Once you are confident your changes build
locally, push a fresh try build with an invocation like::
$ hg push-to-try -m "try: -b o -p android-api-15-gradle-dependencies"
Then `upload your archives to tooltool
<https://wiki.mozilla.org/ReleaseEngineering/Applications/Tooltool#How_To_Upload_To_Tooltool>`_,
update the in-tree manifests in
``mobile/android/config/tooltool-manifests``, and push a fresh try
build.
-100
View File
@@ -1,100 +0,0 @@
.. _build_visualstudio:
======================
Visual Studio Projects
======================
The build system contains alpha support for generating Visual Studio
project files to aid with development.
To generate Visual Studio project files, you'll need to have a configured tree::
mach configure
(If you have built recently, your tree is already configured.)
Then, simply generate the Visual Studio build backend::
mach build-backend -b VisualStudio
If all goes well, the path to the generated Solution (``.sln``) file should be
printed. You should be able to open that solution with Visual Studio 2010 or
newer.
Currently, output is hard-coded to the Visual Studio 2010 format. If you open
the solution in a newer Visual Studio release, you will be prompted to upgrade
projects. Simply click through the wizard to do that.
Structure of Solution
=====================
The Visual Studio solution consists of hundreds of projects spanning thousands
of files. To help with organization, the solution is divided into the following
trees/folders:
Build Targets
This folder contains common build targets. The *full* project is used to
perform a full build. The *binaries* project is used to build just binaries.
The *visual-studio* project can be built to regenerate the Visual Studio
project files.
Performing the *clean* action on any of these targets will clean the
*entire* build output.
Binaries
This folder contains common binaries that can be executed from within
Visual Studio. If you are building the Firefox desktop application,
the *firefox* project will launch firefox.exe. You probably want one of
these set to your startup project.
Libraries
This folder contains entries for each static library that is produced as
part of the build. These roughly correspond to each directory in the tree
containing C/C++. e.g. code from ``dom/base`` will be contained in the
``dom_base`` project.
These projects don't do anything when built. If you build a project here,
the *binaries* build target project is built.
Updating Project Files
======================
As you pull and update the source tree, your Visual Studio files may fall out
of sync with the build configuration. The tree should still build fine from
within Visual Studio. But source files may be missing and IntelliSense may not
have the proper build configuration.
To account for this, you'll want to periodically regenerate the Visual Studio
project files. You can do this within Visual Studio by building the
``Build Targets :: visual-studio`` project or by running
``mach build-backend -b VisualStudio`` from the command line.
Currently, regeneration rewrites the original project files. **If you've made
any customizations to the solution or projects, they will likely get
overwritten.** We would like to improve this user experience in the
future.
Moving Project Files Around
===========================
The produced Visual Studio solution and project files should be portable.
If you want to move them to a non-default directory, they should continue
to work from wherever they are. If they don't, please file a bug.
Invoking mach through Visual Studio
===================================
It's possible to build the tree via Visual Studio. There is some light magic
involved here.
Alongside the Visual Studio project files is a batch script named ``mach.bat``.
This batch script sets the environment variables present in your *MozillaBuild*
development environment at the time of Visual Studio project generation
and invokes *mach* inside an msys shell with the arguments specified to the
batch script. This script essentially allows you to invoke mach commands
inside the MozillaBuild environment without having to load MozillaBuild.
While projects currently only utilize the ``mach build`` command, the batch
script does not limit it's use: any mach command can be invoked. Developers
may abuse this fact to add custom projects and commands that invoke other
mach commands.
+5
View File
@@ -63,6 +63,11 @@ def GeckoBinary(linkage='dependent', msvcrt='dynamic', mozglue=None):
LDFLAGS += ['-rdynamic']
if CONFIG['MOZ_MEMORY']:
USE_LIBS += ['memory']
if CONFIG['OS_ARCH'] == 'FreeBSD':
# Make sure this function is linked in, so that it is
# executed at executable load (it has the 'constructor'
# flag).
LDFLAGS += ['-u', 'jemalloc_FreeBSD_init']
elif mozglue == 'library':
LIBRARY_DEFINES['MOZ_HAS_MOZGLUE'] = True
if not CONFIG['MOZ_GLUE_IN_PROGRAM']:
+4 -40
View File
@@ -3,7 +3,9 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
gyp_vars = {
include('gyp_base.mozbuild')
gyp_vars.update({
'lsan': 0,
'asan': 0,
'build_with_mozilla': 1,
@@ -18,8 +20,6 @@ gyp_vars = {
'clang_use_chrome_plugins': 0,
'enable_protobuf': 0,
'include_tests': 0,
'enable_android_opensl': 1,
'enable_android_opensl_output': 0,
# use_system_lib* still seems to be in use in trunk/build
'use_system_libjpeg': 0,
'use_system_libvpx': 0,
@@ -67,43 +67,7 @@ gyp_vars = {
# linker to throw away uneeded bits.
'include_isac': 1,
'include_pcm16b': 1,
}
os = CONFIG['OS_TARGET']
if os == 'WINNT':
gyp_vars.update(
MSVS_VERSION=CONFIG['_MSVS_VERSION'],
MSVS_OS_BITS=64 if CONFIG['HAVE_64BIT_BUILD'] else 32,
)
elif os == 'Android':
gyp_vars.update(
gtest_target_type='executable',
moz_webrtc_mediacodec=1,
android_toolchain=CONFIG.get('ANDROID_TOOLCHAIN', ''),
)
flavors = {
'WINNT': 'win',
'Android': 'android',
'Linux': 'linux',
'Darwin': 'mac' if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa' else 'ios',
'SunOS': 'solaris',
'GNU/kFreeBSD': 'freebsd',
'DragonFly': 'dragonfly',
'FreeBSD': 'freebsd',
'NetBSD': 'netbsd',
'OpenBSD': 'openbsd',
}
gyp_vars['OS'] = flavors.get(os)
arches = {
'x86_64': 'x64',
'x86': 'ia32',
'aarch64': 'arm64',
}
gyp_vars['target_arch'] = arches.get(CONFIG['CPU_ARCH'], CONFIG['CPU_ARCH'])
})
if CONFIG['ARM_ARCH']:
if int(CONFIG['ARM_ARCH']) < 7:
+36
View File
@@ -0,0 +1,36 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
gyp_vars = {}
os = CONFIG['OS_TARGET']
if os == 'WINNT':
gyp_vars.update(
MSVS_VERSION=CONFIG['_MSVS_VERSION'],
MSVS_OS_BITS=64 if CONFIG['HAVE_64BIT_BUILD'] else 32,
)
flavors = {
'WINNT': 'win',
'Linux': 'linux',
'Darwin': 'mac',
'SunOS': 'solaris',
'GNU/kFreeBSD': 'freebsd',
'DragonFly': 'dragonfly',
'FreeBSD': 'freebsd',
'NetBSD': 'netbsd',
'OpenBSD': 'openbsd',
}
gyp_vars['OS'] = flavors.get(os)
arches = {
'x86_64': 'x64',
'x86': 'ia32',
'aarch64': 'arm64',
}
gyp_vars['host_arch'] = arches.get(CONFIG['HOST_CPU_ARCH'], CONFIG['HOST_CPU_ARCH'])
gyp_vars['target_arch'] = arches.get(CONFIG['CPU_ARCH'], CONFIG['CPU_ARCH'])
+14 -15
View File
@@ -35,7 +35,6 @@ Press ENTER/RETURN to continue or CTRL+c to abort.
# TODO Bug 794506 Integrate with the in-tree virtualenv configuration.
SEARCH_PATHS = [
'python/mach',
'python/mozboot',
'python/mozbuild',
'python/mozlint',
'python/mozversioncontrol',
@@ -65,11 +64,6 @@ SEARCH_PATHS = [
'other-licenses/ply',
'taskcluster',
'testing',
'testing/firefox-ui/harness',
'testing/marionette/client',
'testing/marionette/harness',
'testing/marionette/harness/marionette_harness/runner/mixins/browsermob-proxy-py',
'testing/marionette/puppeteer/firefox',
'testing/mozbase/mozcrash',
'testing/mozbase/mozdebug',
'testing/mozbase/mozdevice',
@@ -90,9 +84,6 @@ SEARCH_PATHS = [
'testing/mozbase/manifestparser',
'testing/taskcluster',
'testing/tools/autotry',
'testing/web-platform',
'testing/web-platform/harness',
'testing/web-platform/tests/tools/wptserve',
'testing/xpcshell',
'xpcom/idl-parser',
]
@@ -108,20 +99,15 @@ MACH_MODULES = [
'python/mach/mach/commands/commandinfo.py',
'python/mach/mach/commands/settings.py',
'python/compare-locales/mach_commands.py',
'python/mozboot/mozboot/mach_commands.py',
'python/mozbuild/mozbuild/mach_commands.py',
'python/mozbuild/mozbuild/backend/mach_commands.py',
'python/mozbuild/mozbuild/compilation/codecomplete.py',
'python/mozbuild/mozbuild/frontend/mach_commands.py',
'services/common/tests/mach_commands.py',
'taskcluster/mach_commands.py',
'testing/firefox-ui/mach_commands.py',
'testing/mach_commands.py',
'testing/marionette/mach_commands.py',
'testing/mochitest/mach_commands.py',
'testing/mozharness/mach_commands.py',
'testing/talos/mach_commands.py',
'testing/web-platform/mach_commands.py',
'testing/xpcshell/mach_commands.py',
'tools/docs/mach_commands.py',
'tools/lint/mach_commands.py',
@@ -202,7 +188,20 @@ def bootstrap(topsrcdir, mozilla_dir=None):
# like surprises.
sys.path[0:0] = [os.path.join(mozilla_dir, path) for path in SEARCH_PATHS]
import mach.main
from mozboot.util import get_state_dir
def get_state_dir():
"""Obtain path to a directory to hold state.
Returns a tuple of the path and a bool indicating whether the
value came from an environment variable.
"""
state_user_dir = os.path.expanduser('~/.mozbuild')
state_env_dir = os.environ.get('MOZBUILD_STATE_PATH')
if state_env_dir:
return state_env_dir, True
else:
return state_user_dir, False
def telemetry_handler(context, data):
# We have not opted-in to telemetry
-451
View File
@@ -1,451 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import datetime
import mozcrash
import threading
import os
import posixpath
import Queue
import re
import shutil
import signal
import tempfile
import time
import traceback
import zipfile
from automation import Automation
from mozlog import get_default_logger
from mozprocess import ProcessHandlerMixin
class StdOutProc(ProcessHandlerMixin):
"""Process handler for b2g which puts all output in a Queue.
"""
def __init__(self, cmd, queue, **kwargs):
self.queue = queue
kwargs.setdefault('processOutputLine', []).append(self.handle_output)
ProcessHandlerMixin.__init__(self, cmd, **kwargs)
def handle_output(self, line):
self.queue.put_nowait(line)
class B2GRemoteAutomation(Automation):
_devicemanager = None
def __init__(self, deviceManager, appName='', remoteLog=None,
marionette=None):
self._devicemanager = deviceManager
self._appName = appName
self._remoteProfile = None
self._remoteLog = remoteLog
self.marionette = marionette
self._is_emulator = False
self.test_script = None
self.test_script_args = None
# Default our product to b2g
self._product = "b2g"
self.lastTestSeen = "b2gautomation.py"
# Default log finish to mochitest standard
self.logFinish = 'INFO SimpleTest FINISHED'
Automation.__init__(self)
def setEmulator(self, is_emulator):
self._is_emulator = is_emulator
def setDeviceManager(self, deviceManager):
self._devicemanager = deviceManager
def setAppName(self, appName):
self._appName = appName
def setRemoteProfile(self, remoteProfile):
self._remoteProfile = remoteProfile
def setProduct(self, product):
self._product = product
def setRemoteLog(self, logfile):
self._remoteLog = logfile
def getExtensionIDFromRDF(self, rdfSource):
"""
Retrieves the extension id from an install.rdf file (or string).
"""
from xml.dom.minidom import parse, parseString, Node
if isinstance(rdfSource, file):
document = parse(rdfSource)
else:
document = parseString(rdfSource)
# Find the <em:id> element. There can be multiple <em:id> tags
# within <em:targetApplication> tags, so we have to check this way.
for rdfChild in document.documentElement.childNodes:
if rdfChild.nodeType == Node.ELEMENT_NODE and rdfChild.tagName == "Description":
for descChild in rdfChild.childNodes:
if descChild.nodeType == Node.ELEMENT_NODE and descChild.tagName == "em:id":
return descChild.childNodes[0].data
return None
def installExtension(self, extensionSource, profileDir, extensionID=None):
# Bug 827504 - installing special-powers extension separately causes problems in B2G
if extensionID != "special-powers@mozilla.org":
if not os.path.isdir(profileDir):
self.log.info("INFO | automation.py | Cannot install extension, invalid profileDir at: %s", profileDir)
return
installRDFFilename = "install.rdf"
extensionsRootDir = os.path.join(profileDir, "extensions", "staged")
if not os.path.isdir(extensionsRootDir):
os.makedirs(extensionsRootDir)
if os.path.isfile(extensionSource):
reader = zipfile.ZipFile(extensionSource, "r")
for filename in reader.namelist():
# Sanity check the zip file.
if os.path.isabs(filename):
self.log.info("INFO | automation.py | Cannot install extension, bad files in xpi")
return
# We may need to dig the extensionID out of the zip file...
if extensionID is None and filename == installRDFFilename:
extensionID = self.getExtensionIDFromRDF(reader.read(filename))
# We must know the extensionID now.
if extensionID is None:
self.log.info("INFO | automation.py | Cannot install extension, missing extensionID")
return
# Make the extension directory.
extensionDir = os.path.join(extensionsRootDir, extensionID)
os.mkdir(extensionDir)
# Extract all files.
reader.extractall(extensionDir)
elif os.path.isdir(extensionSource):
if extensionID is None:
filename = os.path.join(extensionSource, installRDFFilename)
if os.path.isfile(filename):
with open(filename, "r") as installRDF:
extensionID = self.getExtensionIDFromRDF(installRDF)
if extensionID is None:
self.log.info("INFO | automation.py | Cannot install extension, missing extensionID")
return
# Copy extension tree into its own directory.
# "destination directory must not already exist".
shutil.copytree(extensionSource, os.path.join(extensionsRootDir, extensionID))
else:
self.log.info("INFO | automation.py | Cannot install extension, invalid extensionSource at: %s", extensionSource)
# Set up what we need for the remote environment
def environment(self, env=None, xrePath=None, crashreporter=True, debugger=False):
# Because we are running remote, we don't want to mimic the local env
# so no copying of os.environ
if env is None:
env = {}
# We always hide the results table in B2G; it's much slower if we don't.
env['MOZ_HIDE_RESULTS_TABLE'] = '1'
return env
def waitForNet(self):
active = False
time_out = 0
while not active and time_out < 40:
data = self._devicemanager._runCmd(['shell', '/system/bin/netcfg']).stdout.readlines()
data.pop(0)
for line in data:
if (re.search(r'UP\s+(?:[0-9]{1,3}\.){3}[0-9]{1,3}', line)):
active = True
break
time_out += 1
time.sleep(1)
return active
def checkForCrashes(self, directory, symbolsPath):
crashed = False
remote_dump_dir = self._remoteProfile + '/minidumps'
print "checking for crashes in '%s'" % remote_dump_dir
if self._devicemanager.dirExists(remote_dump_dir):
local_dump_dir = tempfile.mkdtemp()
self._devicemanager.getDirectory(remote_dump_dir, local_dump_dir)
try:
logger = get_default_logger()
if logger is not None:
crashed = mozcrash.log_crashes(logger, local_dump_dir, symbolsPath, test=self.lastTestSeen)
else:
crashed = mozcrash.check_for_crashes(local_dump_dir, symbolsPath, test_name=self.lastTestSeen)
except:
traceback.print_exc()
finally:
shutil.rmtree(local_dump_dir)
self._devicemanager.removeDir(remote_dump_dir)
return crashed
def buildCommandLine(self, app, debuggerInfo, profileDir, testURL, extraArgs):
# if remote profile is specified, use that instead
if (self._remoteProfile):
profileDir = self._remoteProfile
cmd, args = Automation.buildCommandLine(self, app, debuggerInfo, profileDir, testURL, extraArgs)
return app, args
def waitForFinish(self, proc, utilityPath, timeout, maxTime, startTime,
debuggerInfo, symbolsPath, outputHandler=None):
""" Wait for tests to finish (as evidenced by a signature string
in logcat), or for a given amount of time to elapse with no
output.
"""
timeout = timeout or 120
while True:
lines = proc.getStdoutLines(timeout)
if lines:
currentlog = '\n'.join(lines)
if outputHandler:
for line in lines:
outputHandler(line)
else:
print(currentlog)
# Match the test filepath from the last TEST-START line found in the new
# log content. These lines are in the form:
# ... INFO TEST-START | /filepath/we/wish/to/capture.html\n
testStartFilenames = re.findall(r"TEST-START \| ([^\s]*)", currentlog)
if testStartFilenames:
self.lastTestSeen = testStartFilenames[-1]
if (outputHandler and outputHandler.suite_finished) or (
hasattr(self, 'logFinish') and self.logFinish in currentlog):
return 0
else:
self.log.info("TEST-UNEXPECTED-FAIL | %s | application timed "
"out after %d seconds with no output",
self.lastTestSeen, int(timeout))
self._devicemanager.killProcess('/system/b2g/b2g', sig=signal.SIGABRT)
timeout = 10 # seconds
starttime = datetime.datetime.utcnow()
while datetime.datetime.utcnow() - starttime < datetime.timedelta(seconds=timeout):
if not self._devicemanager.processExist('/system/b2g/b2g'):
break
time.sleep(1)
else:
print "timed out after %d seconds waiting for b2g process to exit" % timeout
return 1
self.checkForCrashes(None, symbolsPath)
return 1
def getDeviceStatus(self, serial=None):
# Get the current status of the device. If we know the device
# serial number, we look for that, otherwise we use the (presumably
# only) device shown in 'adb devices'.
serial = serial or self._devicemanager._deviceSerial
status = 'unknown'
for line in self._devicemanager._runCmd(['devices']).stdout.readlines():
result = re.match('(.*?)\t(.*)', line)
if result:
thisSerial = result.group(1)
if not serial or thisSerial == serial:
serial = thisSerial
status = result.group(2)
return (serial, status)
def restartB2G(self):
# TODO hangs in subprocess.Popen without this delay
time.sleep(5)
self._devicemanager._checkCmd(['shell', 'stop', 'b2g'])
# Wait for a bit to make sure B2G has completely shut down.
time.sleep(10)
self._devicemanager._checkCmd(['shell', 'start', 'b2g'])
if self._is_emulator:
self.marionette.emulator.wait_for_port(self.marionette.port)
def rebootDevice(self):
# find device's current status and serial number
serial, status = self.getDeviceStatus()
# reboot!
self._devicemanager._runCmd(['shell', '/system/bin/reboot'])
# The above command can return while adb still thinks the device is
# connected, so wait a little bit for it to disconnect from adb.
time.sleep(10)
# wait for device to come back to previous status
print 'waiting for device to come back online after reboot'
start = time.time()
rserial, rstatus = self.getDeviceStatus(serial)
while rstatus != 'device':
if time.time() - start > 120:
# device hasn't come back online in 2 minutes, something's wrong
raise Exception("Device %s (status: %s) not back online after reboot" % (serial, rstatus))
time.sleep(5)
rserial, rstatus = self.getDeviceStatus(serial)
print 'device:', serial, 'status:', rstatus
def Process(self, cmd, stdout=None, stderr=None, env=None, cwd=None):
# On a desktop or fennec run, the Process method invokes a gecko
# process in which to the tests. For B2G, we simply
# reboot the device (which was configured with a test profile
# already), wait for B2G to start up, and then navigate to the
# test url using Marionette. There doesn't seem to be any way
# to pass env variables into the B2G process, but this doesn't
# seem to matter.
# reboot device so it starts up with the mochitest profile
# XXX: We could potentially use 'stop b2g' + 'start b2g' to achieve
# a similar effect; will see which is more stable while attempting
# to bring up the continuous integration.
if not self._is_emulator:
self.rebootDevice()
time.sleep(5)
#wait for wlan to come up
if not self.waitForNet():
raise Exception("network did not come up, please configure the network" +
" prior to running before running the automation framework")
# stop b2g
self._devicemanager._runCmd(['shell', 'stop', 'b2g'])
time.sleep(5)
# For some reason user.js in the profile doesn't get picked up.
# Manually copy it over to prefs.js. See bug 1009730 for more details.
self._devicemanager.moveTree(posixpath.join(self._remoteProfile, 'user.js'),
posixpath.join(self._remoteProfile, 'prefs.js'))
# relaunch b2g inside b2g instance
instance = self.B2GInstance(self._devicemanager, env=env)
time.sleep(5)
# Set up port forwarding again for Marionette, since any that
# existed previously got wiped out by the reboot.
if not self._is_emulator:
self._devicemanager._checkCmd(['forward',
'tcp:%s' % self.marionette.port,
'tcp:%s' % self.marionette.port])
if self._is_emulator:
self.marionette.emulator.wait_for_port(self.marionette.port)
else:
time.sleep(5)
# start a marionette session
session = self.marionette.start_session()
if 'b2g' not in session:
raise Exception("bad session value %s returned by start_session" % session)
with self.marionette.using_context(self.marionette.CONTEXT_CHROME):
self.marionette.execute_script("""
let SECURITY_PREF = "security.turn_off_all_security_so_that_viruses_can_take_over_this_computer";
Components.utils.import("resource://gre/modules/Services.jsm");
Services.prefs.setBoolPref(SECURITY_PREF, true);
if (!testUtils.hasOwnProperty("specialPowersObserver")) {
let loader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader);
loader.loadSubScript("chrome://specialpowers/content/SpecialPowersObserver.jsm",
testUtils);
testUtils.specialPowersObserver = new testUtils.SpecialPowersObserver();
testUtils.specialPowersObserver.init();
}
""")
# run the script that starts the tests
if self.test_script:
if os.path.isfile(self.test_script):
script = open(self.test_script, 'r')
self.marionette.execute_script(script.read(), script_args=self.test_script_args)
script.close()
elif isinstance(self.test_script, basestring):
self.marionette.execute_script(self.test_script, script_args=self.test_script_args)
else:
# assumes the tests are started on startup automatically
pass
return instance
# be careful here as this inner class doesn't have access to outer class members
class B2GInstance(object):
"""Represents a B2G instance running on a device, and exposes
some process-like methods/properties that are expected by the
automation.
"""
def __init__(self, dm, env=None):
self.dm = dm
self.env = env or {}
self.stdout_proc = None
self.queue = Queue.Queue()
# Launch b2g in a separate thread, and dump all output lines
# into a queue. The lines in this queue are
# retrieved and returned by accessing the stdout property of
# this class.
cmd = [self.dm._adbPath]
if self.dm._deviceSerial:
cmd.extend(['-s', self.dm._deviceSerial])
cmd.append('shell')
for k, v in self.env.iteritems():
cmd.append("%s=%s" % (k, v))
cmd.append('/system/bin/b2g.sh')
proc = threading.Thread(target=self._save_stdout_proc, args=(cmd, self.queue))
proc.daemon = True
proc.start()
def _save_stdout_proc(self, cmd, queue):
self.stdout_proc = StdOutProc(cmd, queue)
self.stdout_proc.run()
if hasattr(self.stdout_proc, 'processOutput'):
self.stdout_proc.processOutput()
self.stdout_proc.wait()
self.stdout_proc = None
@property
def pid(self):
# a dummy value to make the automation happy
return 0
def getStdoutLines(self, timeout):
# Return any lines in the queue used by the
# b2g process handler.
lines = []
# get all of the lines that are currently available
while True:
try:
lines.append(self.queue.get_nowait())
except Queue.Empty:
break
# wait 'timeout' for any additional lines
if not lines:
try:
lines.append(self.queue.get(True, timeout))
except Queue.Empty:
pass
return lines
def wait(self, timeout=None):
# this should never happen
raise Exception("'wait' called on B2GInstance")
def kill(self):
# this should never happen
raise Exception("'kill' called on B2GInstance")
-401
View File
@@ -1,401 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import datetime
import glob
import time
import re
import os
import posixpath
import tempfile
import shutil
import subprocess
import sys
from automation import Automation
from mozdevice import DMError, DeviceManager
from mozlog import get_default_logger
import mozcrash
# signatures for logcat messages that we don't care about much
fennecLogcatFilters = [ "The character encoding of the HTML document was not declared",
"Use of Mutation Events is deprecated. Use MutationObserver instead.",
"Unexpected value from nativeGetEnabledTags: 0" ]
class RemoteAutomation(Automation):
_devicemanager = None
# Part of a hack for Robocop: "am COMMAND" is handled specially if COMMAND
# is in this set. See usages below.
_specialAmCommands = ('instrument', 'start')
def __init__(self, deviceManager, appName = '', remoteLog = None,
processArgs=None):
self._devicemanager = deviceManager
self._appName = appName
self._remoteProfile = None
self._remoteLog = remoteLog
self._processArgs = processArgs or {};
# Default our product to fennec
self._product = "fennec"
self.lastTestSeen = "remoteautomation.py"
Automation.__init__(self)
def setDeviceManager(self, deviceManager):
self._devicemanager = deviceManager
def setAppName(self, appName):
self._appName = appName
def setRemoteProfile(self, remoteProfile):
self._remoteProfile = remoteProfile
def setProduct(self, product):
self._product = product
def setRemoteLog(self, logfile):
self._remoteLog = logfile
# Set up what we need for the remote environment
def environment(self, env=None, xrePath=None, crashreporter=True, debugger=False, dmdPath=None, lsanPath=None):
# Because we are running remote, we don't want to mimic the local env
# so no copying of os.environ
if env is None:
env = {}
if dmdPath:
env['MOZ_REPLACE_MALLOC_LIB'] = os.path.join(dmdPath, 'libdmd.so')
# Except for the mochitest results table hiding option, which isn't
# passed to runtestsremote.py as an actual option, but through the
# MOZ_HIDE_RESULTS_TABLE environment variable.
if 'MOZ_HIDE_RESULTS_TABLE' in os.environ:
env['MOZ_HIDE_RESULTS_TABLE'] = os.environ['MOZ_HIDE_RESULTS_TABLE']
env['MOZ_CRASHREPORTER_DISABLE'] = '1'
# Crash on non-local network connections by default.
# MOZ_DISABLE_NONLOCAL_CONNECTIONS can be set to "0" to temporarily
# enable non-local connections for the purposes of local testing.
# Don't override the user's choice here. See bug 1049688.
env.setdefault('MOZ_DISABLE_NONLOCAL_CONNECTIONS', '1')
# Send an env var noting that we are in automation. Passing any
# value except the empty string will declare the value to exist.
#
# This may be used to disabled network connections during testing, e.g.
# Switchboard & telemetry uploads.
env.setdefault('MOZ_IN_AUTOMATION', '1')
# Set WebRTC logging in case it is not set yet.
# On Android, environment variables cannot contain ',' so the
# standard WebRTC setting for NSPR_LOG_MODULES is not available.
# env.setdefault('NSPR_LOG_MODULES', 'signaling:5,mtransport:5,datachannel:5,jsep:5,MediaPipelineFactory:5')
env.setdefault('R_LOG_LEVEL', '6')
env.setdefault('R_LOG_DESTINATION', 'stderr')
env.setdefault('R_LOG_VERBOSE', '1')
return env
def waitForFinish(self, proc, utilityPath, timeout, maxTime, startTime, debuggerInfo, symbolsPath, outputHandler=None):
""" Wait for tests to finish.
If maxTime seconds elapse or no output is detected for timeout
seconds, kill the process and fail the test.
"""
# maxTime is used to override the default timeout, we should honor that
status = proc.wait(timeout = maxTime, noOutputTimeout = timeout)
self.lastTestSeen = proc.getLastTestSeen
topActivity = self._devicemanager.getTopActivity()
if topActivity == proc.procName:
proc.kill(True)
if status == 1:
if maxTime:
print "TEST-UNEXPECTED-FAIL | %s | application ran for longer than " \
"allowed maximum time of %s seconds" % (self.lastTestSeen, maxTime)
else:
print "TEST-UNEXPECTED-FAIL | %s | application ran for longer than " \
"allowed maximum time" % (self.lastTestSeen)
if status == 2:
print "TEST-UNEXPECTED-FAIL | %s | application timed out after %d seconds with no output" \
% (self.lastTestSeen, int(timeout))
return status
def deleteANRs(self):
# empty ANR traces.txt file; usually need root permissions
# we make it empty and writable so we can test the ANR reporter later
traces = "/data/anr/traces.txt"
try:
self._devicemanager.shellCheckOutput(['echo', '', '>', traces], root=True,
timeout=DeviceManager.short_timeout)
self._devicemanager.shellCheckOutput(['chmod', '666', traces], root=True,
timeout=DeviceManager.short_timeout)
except DMError:
print "Error deleting %s" % traces
pass
def checkForANRs(self):
traces = "/data/anr/traces.txt"
if self._devicemanager.fileExists(traces):
try:
t = self._devicemanager.pullFile(traces)
if t:
stripped = t.strip()
if len(stripped) > 0:
print "Contents of %s:" % traces
print t
# Once reported, delete traces
self.deleteANRs()
except DMError:
print "Error pulling %s" % traces
except IOError:
print "Error pulling %s" % traces
else:
print "%s not found" % traces
def deleteTombstones(self):
# delete any existing tombstone files from device
remoteDir = "/data/tombstones"
try:
self._devicemanager.shellCheckOutput(['rm', '-r', remoteDir], root=True,
timeout=DeviceManager.short_timeout)
except DMError:
# This may just indicate that the tombstone directory is missing
pass
def checkForTombstones(self):
# pull any tombstones from device and move to MOZ_UPLOAD_DIR
remoteDir = "/data/tombstones"
blobberUploadDir = os.environ.get('MOZ_UPLOAD_DIR', None)
if blobberUploadDir:
if not os.path.exists(blobberUploadDir):
os.mkdir(blobberUploadDir)
if self._devicemanager.dirExists(remoteDir):
# copy tombstone files from device to local blobber upload directory
try:
self._devicemanager.shellCheckOutput(['chmod', '777', remoteDir], root=True,
timeout=DeviceManager.short_timeout)
self._devicemanager.shellCheckOutput(['chmod', '666', os.path.join(remoteDir, '*')], root=True,
timeout=DeviceManager.short_timeout)
self._devicemanager.getDirectory(remoteDir, blobberUploadDir, False)
except DMError:
# This may just indicate that no tombstone files are present
pass
self.deleteTombstones()
# add a .txt file extension to each tombstone file name, so
# that blobber will upload it
for f in glob.glob(os.path.join(blobberUploadDir, "tombstone_??")):
# add a unique integer to the file name, in case there are
# multiple tombstones generated with the same name, for
# instance, after multiple robocop tests
for i in xrange(1, sys.maxint):
newname = "%s.%d.txt" % (f, i)
if not os.path.exists(newname):
os.rename(f, newname)
break
else:
print "%s does not exist; tombstone check skipped" % remoteDir
else:
print "MOZ_UPLOAD_DIR not defined; tombstone check skipped"
def checkForCrashes(self, directory, symbolsPath):
self.checkForANRs()
self.checkForTombstones()
logcat = self._devicemanager.getLogcat(filterOutRegexps=fennecLogcatFilters)
javaException = mozcrash.check_for_java_exception(logcat, test_name=self.lastTestSeen)
if javaException:
return True
# No crash reporting means we can't say anything.
return False
def buildCommandLine(self, app, debuggerInfo, profileDir, testURL, extraArgs):
# If remote profile is specified, use that instead
if (self._remoteProfile):
profileDir = self._remoteProfile
# Hack for robocop, if app & testURL == None and extraArgs contains the rest of the stuff, lets
# assume extraArgs is all we need
if app == "am" and extraArgs[0] in RemoteAutomation._specialAmCommands:
return app, extraArgs
cmd, args = Automation.buildCommandLine(self, app, debuggerInfo, profileDir, testURL, extraArgs)
# Remove -foreground if it exists, if it doesn't this just returns
try:
args.remove('-foreground')
except:
pass
#TODO: figure out which platform require NO_EM_RESTART
# return app, ['--environ:NO_EM_RESTART=1'] + args
return app, args
def Process(self, cmd, stdout = None, stderr = None, env = None, cwd = None):
if stdout == None or stdout == -1 or stdout == subprocess.PIPE:
stdout = self._remoteLog
return self.RProcess(self._devicemanager, cmd, stdout, stderr, env, cwd, self._appName,
**self._processArgs)
# be careful here as this inner class doesn't have access to outer class members
class RProcess(object):
# device manager process
dm = None
def __init__(self, dm, cmd, stdout=None, stderr=None, env=None, cwd=None, app=None,
messageLogger=None):
self.dm = dm
self.stdoutlen = 0
self.lastTestSeen = "remoteautomation.py"
self.proc = dm.launchProcess(cmd, stdout, cwd, env, True)
self.messageLogger = messageLogger
if (self.proc is None):
if cmd[0] == 'am':
self.proc = stdout
else:
raise Exception("unable to launch process")
self.procName = cmd[0].split('/')[-1]
if cmd[0] == 'am' and cmd[1] in RemoteAutomation._specialAmCommands:
self.procName = app
# Setting timeout at 1 hour since on a remote device this takes much longer.
# Temporarily increased to 90 minutes because no more chunks can be created.
self.timeout = 5400
# The benefit of the following sleep is unclear; it was formerly 15 seconds
time.sleep(1)
# Used to buffer log messages until we meet a line break
self.logBuffer = ""
@property
def pid(self):
pid = self.dm.processExist(self.procName)
# HACK: we should probably be more sophisticated about monitoring
# running processes for the remote case, but for now we'll assume
# that this method can be called when nothing exists and it is not
# an error
if pid is None:
return 0
return pid
def read_stdout(self):
"""
Fetch the full remote log file using devicemanager, process them and
return whether there were any new log entries since the last call.
"""
if not self.dm.fileExists(self.proc):
return False
try:
newLogContent = self.dm.pullFile(self.proc, self.stdoutlen)
except DMError:
# we currently don't retry properly in the pullFile
# function in dmSUT, so an error here is not necessarily
# the end of the world
return False
if not newLogContent:
return False
self.stdoutlen += len(newLogContent)
if self.messageLogger is None:
testStartFilenames = re.findall(r"TEST-START \| ([^\s]*)", newLogContent)
if testStartFilenames:
self.lastTestSeen = testStartFilenames[-1]
print newLogContent
return True
self.logBuffer += newLogContent
lines = self.logBuffer.split('\n')
lines = [l for l in lines if l]
if lines:
if self.logBuffer.endswith('\n'):
# all lines are complete; no need to buffer
self.logBuffer = ""
else:
# keep the last (unfinished) line in the buffer
self.logBuffer = lines[-1]
del lines[-1]
if not lines:
return False
for line in lines:
# This passes the line to the logger (to be logged or buffered)
parsed_messages = self.messageLogger.write(line)
for message in parsed_messages:
if isinstance(message, dict) and message.get('action') == 'test_start':
self.lastTestSeen = message['test']
return True
@property
def getLastTestSeen(self):
return self.lastTestSeen
# Wait for the remote process to end (or for its activity to go to background).
# While waiting, periodically retrieve the process output and print it.
# If the process is still running after *timeout* seconds, return 1;
# If the process is still running but no output is received in *noOutputTimeout*
# seconds, return 2;
# Else, once the process exits/goes to background, return 0.
def wait(self, timeout = None, noOutputTimeout = None):
timer = 0
noOutputTimer = 0
interval = 10
if timeout == None:
timeout = self.timeout
status = 0
top = self.procName
slowLog = False
while (top == self.procName):
# Get log updates on each interval, but if it is taking
# too long, only do it every 60 seconds
if (not slowLog) or (timer % 60 == 0):
startRead = datetime.datetime.utcnow()
hasOutput = self.read_stdout()
if (datetime.datetime.utcnow() - startRead) > datetime.timedelta(seconds=5):
slowLog = True
if hasOutput:
noOutputTimer = 0
time.sleep(interval)
timer += interval
noOutputTimer += interval
if (timer > timeout):
status = 1
break
if (noOutputTimeout and noOutputTimer > noOutputTimeout):
status = 2
break
top = self.dm.getTopActivity()
# Flush anything added to stdout during the sleep
self.read_stdout()
return status
def kill(self, stagedShutdown = False):
if stagedShutdown:
# Trigger an ANR report with "kill -3" (SIGQUIT)
self.dm.killProcess(self.procName, 3)
time.sleep(3)
# Trigger a breakpad dump with "kill -6" (SIGABRT)
self.dm.killProcess(self.procName, 6)
# Wait for process to end
retries = 0
while retries < 3:
pid = self.dm.processExist(self.procName)
if pid and pid > 0:
print "%s still alive after SIGABRT: waiting..." % self.procName
time.sleep(5)
else:
return
retries += 1
self.dm.killProcess(self.procName, 9)
pid = self.dm.processExist(self.procName)
if pid and pid > 0:
self.dm.killProcess(self.procName)
else:
self.dm.killProcess(self.procName)
+1 -1
View File
@@ -15,7 +15,7 @@ ifndef JS_STANDALONE
include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
include $(topsrcdir)/toolkit/mozapps/installer/upload-files.mk
# Clear out DIST_FILES if it was set by upload-files.mk (for Android builds)
# Clear out DIST_FILES if it was set
DIST_FILES =
endif
+1 -14
View File
@@ -3,9 +3,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
with Files('**'):
BUG_COMPONENT = ('Core', 'Build Config')
# This cannot be named "build" because of bug 922191.
SPHINX_TREES['buildsystem'] = 'docs'
@@ -14,9 +11,6 @@ if CONFIG['OS_ARCH'] == 'WINNT':
else:
DIRS += ['unix']
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
DIRS += ['annotationProcessors']
for var in ('GRE_MILESTONE',
'MOZ_APP_VERSION',
'MOZ_APP_BASENAME',
@@ -70,7 +64,7 @@ if CONFIG['MOZ_ASAN'] and CONFIG['CLANG_CL']:
if CONFIG['MOZ_APP_BASENAME']:
FINAL_TARGET_PP_FILES += ['application.ini']
if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android' and CONFIG['MOZ_UPDATER']:
if CONFIG['MOZ_UPDATER']:
FINAL_TARGET_PP_FILES += ['update-settings.ini']
if CONFIG['MOZ_APP_STATIC_INI']:
@@ -103,10 +97,3 @@ if CONFIG['MOZ_VALGRIND']:
'valgrind/i386-redhat-linux-gnu.sup',
'valgrind/x86_64-redhat-linux-gnu.sup',
]
if CONFIG['MOZ_ARTIFACT_BUILDS']:
# Ensure a pre-built interfaces.xpt installed to the objdir by the artifact
# code is included by the top-level chrome.manifest.
EXTRA_COMPONENTS += [
'prebuilt-interfaces.manifest',
]
-149
View File
@@ -1,149 +0,0 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
js_option('--with-android-ndk', nargs=1,
help='location where the Android NDK can be found')
js_option('--with-android-toolchain', nargs=1,
help='location of the Android toolchain')
js_option('--with-android-gnu-compiler-version', nargs=1,
help='GNU compiler version to use')
min_android_version = dependable(lambda: '9')
js_option('--with-android-version',
nargs=1,
help='android platform version',
default=min_android_version)
@depends('--with-android-version', min_android_version)
@imports(_from='__builtin__', _import='ValueError')
def android_version(value, min_version):
if not value:
# Someone has passed --without-android-version.
die('--with-android-version cannot be disabled.')
try:
version = int(value[0])
except ValueError:
die('--with-android-version expects an integer value')
if version < int(min_version):
die('--with-android-version must be at least %s (got %s)',
min_version, value[0])
return version
add_old_configure_assignment('android_version', android_version)
@depends('--with-android-ndk', build_project)
def ndk(value, build_project):
if build_project == 'mobile/android' and not value:
die('You must specify --with-android-ndk=/path/to/ndk when '
'building mobile/android')
if value:
return value[0]
set_config('ANDROID_NDK', ndk)
add_old_configure_assignment('android_ndk', ndk)
@depends(target, android_version, ndk)
@checking('for android platform directory')
@imports(_from='os.path', _import='isdir')
def android_platform(target, android_version, ndk):
if target.os != 'Android':
return
if 'mips' in target.cpu:
target_dir_name = 'mips'
elif 'aarch64' == target.cpu:
target_dir_name = 'arm64'
else:
target_dir_name = target.cpu
# Not all Android releases have their own platform release. We use
# the next lower platform version in these cases.
if android_version in (11, 10):
platform_version = 9
elif android_version in (20, 22):
platform_version = android_version - 1
else:
platform_version = android_version
platform_dir = os.path.join(ndk,
'platforms',
'android-%s' % platform_version,
'arch-%s' % target_dir_name)
if not isdir(platform_dir):
die("Android platform directory not found. With the current "
"configuration, it should be in %s" % platform_dir)
return platform_dir
add_old_configure_assignment('android_platform', android_platform)
@depends(android_platform)
def extra_toolchain_flags(platform_dir):
if not platform_dir:
return []
return ['-idirafter',
os.path.join(platform_dir, 'usr', 'include')]
@depends(target, host, ndk, '--with-android-toolchain',
'--with-android-gnu-compiler-version')
@checking('for the Android toolchain directory', lambda x: x or 'not found')
@imports(_from='os.path', _import='isdir')
@imports(_from='mozbuild.shellutil', _import='quote')
def android_toolchain(target, host, ndk, toolchain, gnu_compiler_version):
if not ndk:
return
if toolchain:
return toolchain[0]
else:
if target.cpu == 'arm' and target.endianness == 'little':
target_base = 'arm-linux-androideabi'
elif target.cpu == 'x86':
target_base = 'x86'
elif target.cpu == 'mips32' and target.endianness == 'little':
target_base = 'mipsel-linux-android'
elif target.cpu == 'aarch64' and target.endianness == 'little':
target_base = 'aarch64-linux-android'
else:
die('Target cpu is not supported.')
toolchain_format = '%s/toolchains/%s-%s/prebuilt/%s-%s'
for version in gnu_compiler_version or ['4.9', '4.8', '4.7']:
toolchain = toolchain_format % (ndk, target_base, version,
host.kernel.lower(), host.cpu)
log.debug('Trying %s' % quote(toolchain))
if not isdir(toolchain) and host.cpu == 'x86_64':
toolchain = toolchain_format % (ndk, target_base, version,
host.kernel.lower(), 'x86')
log.debug('Trying %s' % quote(toolchain))
if isdir(toolchain):
return toolchain
else:
if gnu_compiler_version:
die('Your --with-android-gnu-compiler-version may be wrong')
die('You have to specify --with-android-toolchain='
'/path/to/ndk/toolchain.')
set_config('ANDROID_TOOLCHAIN', android_toolchain)
@depends(target, android_toolchain)
def android_toolchain_prefix(target, toolchain):
if toolchain:
if target.cpu == 'x86':
# Ideally, the --target should just have the right x86 variant
# in the first place.
return '%s/bin/i686-linux-android-' % toolchain
return '%s/bin/%s-' % (toolchain, target.toolchain)
imply_option('--with-toolchain-prefix', android_toolchain_prefix,
reason='--with-android-ndk')
+2 -3
View File
@@ -42,11 +42,10 @@ def compiler_class(compiler):
def checking_fn(fn):
return fn
@depends_when(self, dependable(flags), extra_toolchain_flags, when=when)
@depends_when(self, dependable(flags), when=when)
@checking_fn
def func(compiler, flags, extra_flags):
def func(compiler, flags):
flags = flags or []
flags += extra_flags or []
flags.append('-c')
if try_invoke_compiler(
+16 -46
View File
@@ -308,10 +308,7 @@ def split_triplet(triplet):
# mix of uname and config.guess output, while we now only use the latter,
# which presumably has a cleaner and leaner output. Let's refine later.
os = os.replace('/', '_')
if 'android' in os:
canonical_os = 'Android'
canonical_kernel = 'Linux'
elif os.startswith('linux'):
if os.startswith('linux'):
canonical_os = 'GNU'
canonical_kernel = 'Linux'
elif os.startswith('kfreebsd') and os.endswith('-gnu'):
@@ -324,9 +321,6 @@ def split_triplet(triplet):
elif os.startswith('darwin'):
canonical_kernel = 'Darwin'
canonical_os = 'OSX'
elif os.startswith('ios'):
canonical_kernel = 'Darwin'
canonical_os = 'iOS'
elif os.startswith('dragonfly'):
canonical_os = canonical_kernel = 'DragonFly'
elif os.startswith('freebsd'):
@@ -458,10 +452,6 @@ add_old_configure_arg(host_for_old_configure)
@depends(host, target)
def target_for_old_configure(host, target):
target_alias = target.alias
# old-configure does plenty of tests against $target and $target_os
# and expects darwin for iOS, so make it happy.
if target.os == 'iOS':
target_alias = target_alias.replace('-ios', '-darwin')
return '--target=%s' % target_alias
add_old_configure_arg(target_for_old_configure)
@@ -521,6 +511,7 @@ def host_variables(host):
HOST_OS_ARCH=os_arch,
)
set_config('HOST_CPU_ARCH', delayed_getattr(host, 'cpu'))
set_config('HOST_OS_ARCH', delayed_getattr(host_variables, 'HOST_OS_ARCH'))
add_old_configure_assignment('HOST_OS_ARCH',
delayed_getattr(host_variables, 'HOST_OS_ARCH'))
@@ -549,13 +540,6 @@ def target_is_darwin(target):
set_define('XP_DARWIN', target_is_darwin)
@depends(target)
def target_is_ios(target):
if target.kernel == 'Darwin' and target.os == 'iOS':
return True
set_define('XP_IOS', target_is_ios)
@depends(target)
def target_is_osx(target):
if target.kernel == 'Darwin' and target.os == 'OSX':
@@ -607,9 +591,7 @@ imply_option('--enable-project', application)
@depends(check_build_environment, '--help')
def default_project(build_env, help):
if build_env.topobjdir.endswith('/js/src'):
return 'js'
return 'application/xulrunner'
return 'js'
option('--enable-project', nargs=1, default=default_project,
help='Project to build')
@@ -642,9 +624,10 @@ def external_source_dir(value):
set_config('EXTERNAL_SOURCE_DIR', external_source_dir)
add_old_configure_assignment('EXTERNAL_SOURCE_DIR', external_source_dir)
@depends('--enable-project', '--with-external-source-dir', check_build_environment, '--help')
option('--enable-noncomm-build', default=False, help='Allows non-comm-style builds (deprecated)')
@depends('--enable-noncomm-build','--enable-project', '--with-external-source-dir', check_build_environment, '--help')
@imports(_from='os.path', _import='exists')
def build_project(project, external_source_dir, build_env, help):
def build_project(noncomm_build, project, external_source_dir, build_env, help):
if not project:
die('--enable-project is required.')
@@ -655,8 +638,13 @@ def build_project(project, external_source_dir, build_env, help):
build_app = project[0]
if not external_source_dir and build_app not in ('xulrunner', 'js'):
die('Cannot find project %s', build_app)
if not external_source_dir and build_app not in ('js'):
if noncomm_build:
log.info("=====WARNING WARNING WARNING=====")
log.info("UNSUPPORTED NONCOMM-BUILD: Application code SHOULD NOT be put inside the platform tree, and doing so may have unforseen consequences if/when platform code is changed.")
log.info("=====WARNING WARNING WARNING=====")
else:
die('Cannot find project %s', build_app)
build_app_abspath = os.path.join(base_dir, build_app)
@@ -671,11 +659,7 @@ set_define('MOZ_BUILD_APP', build_project)
add_old_configure_assignment('MOZ_BUILD_APP', build_project)
# set RELEASE_OR_BETA and NIGHTLY_BUILD variables depending on the cycle we're in
# The logic works like this:
# - if we have "a1" in GRE_MILESTONE, we're building Nightly (define NIGHTLY_BUILD)
# - otherwise, if we have "a" in GRE_MILESTONE, we're building Nightly or Aurora
# - otherwise, we're building Release/Beta (define RELEASE_OR_BETA)
# set RELEASE_OR_BETA and NIGHTLY_BUILD variables for compatibility
@depends(check_build_environment, '--help')
@imports(_from='__builtin__', _import='open')
def milestone(build_env, _):
@@ -685,12 +669,8 @@ def milestone(build_env, _):
with open(milestone_path, 'r') as fh:
milestone = fh.read().splitlines()[-1]
is_nightly = is_release_or_beta = None
if 'a1' in milestone:
is_nightly = True
elif 'a' not in milestone:
is_release_or_beta = True
is_nightly = None
is_release_or_beta = True
return namespace(version=milestone,
is_nightly=is_nightly,
@@ -809,13 +789,3 @@ def js_option(*args, **kwargs):
return value.format(opt.option)
add_old_configure_arg(js_option)
# Bug 1278542: This function is a workaround to resolve
# |android_ndk_include|'s dependency on 'gonkdir.' The
# actual implementation is located in b2g/moz.configure.
# Remove this function as soon as 'android_ndk_include'
# depends on 'target.'
@depends('--help')
def gonkdir(_):
return None
-4
View File
@@ -36,10 +36,6 @@ def keyfile(desc, help=None, callback=lambda x: x):
def simple_keyfile(desc):
value = keyfile(desc)
set_config('MOZ_%s_KEY' % desc.upper().replace(' ', '_'), value)
# Only really required for MOZ_ADJUST_SDK_KEY currently still used in
# old-configure.
add_old_configure_assignment('MOZ_%s_KEY' % desc.upper().replace(' ', '_'),
value)
@template
-8
View File
@@ -64,14 +64,6 @@ def jemalloc_os_define(jemalloc, target):
set_define(jemalloc_os_define, '1')
@depends(jemalloc, target)
def jemalloc_os_define_android(jemalloc, target):
if jemalloc and target.os == 'Android':
return 'MOZ_MEMORY_ANDROID'
set_define(jemalloc_os_define_android, '1')
option('--enable-replace-malloc',
help='Enable ability to dynamically replace the malloc implementation')
+1 -7
View File
@@ -200,7 +200,6 @@ def old_configure_options(*options):
'--enable-logrefcnt',
'--enable-maintenance-service',
'--enable-memory-sanitizer',
'--enable-mobile-optimize',
'--enable-mozril-geoloc',
'--enable-necko-wifi',
'--enable-negotiateauth',
@@ -226,6 +225,7 @@ def old_configure_options(*options):
'--enable-safe-browsing',
'--enable-sandbox',
'--enable-security-sqlstore',
'--enable-shared-media',
'--enable-signmar',
'--enable-simulator',
'--enable-small-chunk-size',
@@ -249,17 +249,11 @@ def old_configure_options(*options):
'--enable-valgrind',
'--enable-verify-mar',
'--enable-webrtc',
'--enable-xul',
'--enable-zipwriter',
'--includedir',
'--libdir',
'--no-create',
'--prefix',
'--with-android-cxx-stl',
'--with-android-distribution-directory',
'--with-android-max-sdk',
'--with-android-min-sdk',
'--with-android-sdk',
'--with-app-basename',
'--with-app-name',
'--with-arch',
+55 -57
View File
@@ -61,15 +61,6 @@ set_config('HAVE_YASM', have_yasm)
# Until the YASM variable is not necessary in old-configure.
add_old_configure_assignment('YASM', have_yasm)
# Android NDK
# ==============================================================
@depends('--disable-compile-environment', build_project, gonkdir, '--help')
def compiling_android(compile_env, build_project, gonkdir, _):
return compile_env and (gonkdir or build_project in ('mobile/android', 'js'))
include('android-ndk.configure', when=compiling_android)
# MacOS deployment target version
# ==============================================================
# This needs to happen before any compilation test is done.
@@ -165,9 +156,8 @@ def toolchain_prefix(value, target, host, cross_compiling):
@depends(toolchain_prefix, target)
def first_toolchain_prefix(toolchain_prefix, target):
# Pass TOOLCHAIN_PREFIX down to the build system if it was given from the
# command line/environment (in which case there's only one value in the tuple),
# or when cross-compiling for Android.
if toolchain_prefix and (target.os == 'Android' or len(toolchain_prefix) == 1):
# command line/environment (in which case there's only one value in the tuple).
if toolchain_prefix and (len(toolchain_prefix) == 1):
return toolchain_prefix[0]
set_config('TOOLCHAIN_PREFIX', first_toolchain_prefix)
@@ -393,57 +383,65 @@ def check_compiler(compiler, language, target):
)
@imports(_from='collections', _import='defaultdict')
@imports(_from='__builtin__', _import='open')
@imports('json')
@imports('subprocess')
@imports('sys')
def get_vc_paths(topsrcdir):
def vswhere(args):
encoding = 'mbcs' if sys.platform == 'win32' else 'utf-8'
return json.loads(subprocess.check_output([os.path.join(topsrcdir, 'build/win32/vswhere.exe'), '-format', 'json'] + args).decode(encoding, 'replace'))
# Can't pass -requires with -legacy, so query each separately.
# Legacy versions first (VS2015)
for install in vswhere(['-legacy', '-version', '[14.0,15.0)']):
version = Version(install['installationVersion'])
# Skip anything older than VS2015.
if version < '14':
continue
path = install['installationPath']
yield (Version(install['installationVersion']), {
'x64': [os.path.join(path, r'VC\bin\amd64')],
# The x64->x86 cross toolchain requires DLLs from the native x64 toolchain.
'x86': [os.path.join(path, r'VC\bin\amd64_x86'), os.path.join (path, r'VC\bin\amd64')],
})
# Then VS2017 and newer.
for install in vswhere(['-requires', 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64']):
path = install['installationPath']
tools_version = open(os.path.join(path, r'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt'), 'rb').read().strip()
tools_path = os.path.join(path, r'VC\Tools\MSVC', tools_version, r'bin\HostX64')
yield (Version(install['installationVersion']), {
'x64': [os.path.join(tools_path, 'x64')],
# The x64->x86 cross toolchain requires DLLs from the native x64 toolchain.
'x86': [os.path.join(tools_path, 'x86'), os.path.join(tools_path, 'x64')],
})
@depends(host, target, check_build_environment)
@imports(_from='__builtin__', _import='sorted')
def get_vc_paths(base):
vc = defaultdict(lambda: defaultdict(dict))
subkey = r'Microsoft\VisualStudio\VC\*\*\*\Compiler'
for v, h, t, p in get_registry_values(base + '\\' + subkey):
vc[v][h][t] = p
if not vc:
return
version, data = sorted(vc.iteritems(), key=lambda x: Version(x[0]))[-1]
return data
@depends(host)
@imports(_from='operator', _import='itemgetter')
@imports('platform')
def vc_compiler_path(host):
def vc_compiler_path(host, target, env):
if host.kernel != 'WINNT':
return
vc_host = {
'x86': 'x86',
'AMD64': 'x64',
}.get(platform.machine())
if vc_host is None:
return
vc_target = {
'x86': 'x86',
'x86_64': 'x64',
'arm': 'arm',
}.get(host.cpu)
}.get(target.cpu)
if vc_target is None:
return
base_key = r'HKEY_LOCAL_MACHINE\SOFTWARE'
data = get_vc_paths(base_key)
if not data:
data = get_vc_paths(base_key + r'\Wow6432Node')
if not data:
all_versions = sorted(get_vc_paths(env.topsrcdir), key=itemgetter(0))
if not all_versions:
return
path = data.get(vc_host, {}).get(vc_target)
if not path and vc_host == 'x64':
vc_host = 'x86'
path = data.get(vc_host, {}).get(vc_target)
if not path:
# Choose the newest version.
data = all_versions[-1][1]
paths = data.get(vc_target)
if not paths:
return
path = os.path.dirname(path)
if vc_host != vc_target:
other_path = data.get(vc_host, {}).get(vc_host)
if other_path:
return (path, os.path.dirname(other_path))
return (path,)
return paths
@depends(vc_compiler_path)
@@ -685,9 +683,9 @@ def compiler(language, host_or_target, c_compiler=None, other_compiler=None,
# Check the compiler version here instead of in `compiler_version` so
# that the `checking` message doesn't pretend the compiler can be used
# to then bail out one line later.
if info.type == 'gcc' and info.version < '4.9.0':
if info.type == 'gcc' and info.version < '7.1.0':
raise FatalCheckError(
'Only GCC 4.9 or newer is supported (found version %s).'
'Only GCC 7.1 or newer is supported (found version %s).'
% info.version)
# If you want to bump the version check here search for
@@ -840,10 +838,9 @@ def debug_flags(env_debug_flags, enable_debug_flags, default_debug_flags):
set_config('MOZ_DEBUG_FLAGS', debug_flags)
add_old_configure_assignment('MOZ_DEBUG_FLAGS', debug_flags)
# Some standard library headers (notably bionic on Android) declare standard
# functions (e.g. getchar()) and also #define macros for those standard
# functions. libc++ deals with this by doing something like the following
# (explanatory comments added):
# Some standard library headers declare standard functions (e.g. getchar()) and
# also #define macros for those standard functions. libc++ deals with this by
# doing something like the following (explanatory comments added):
#
# #ifdef FUNC
# // Capture the definition of FUNC.
@@ -878,7 +875,8 @@ add_old_configure_assignment('MOZ_DEBUG_FLAGS', debug_flags)
# effectively does the same thing we are doing here.
@depends(c_compiler, target)
def libcxx_inline_visibility(c_compiler, target):
if c_compiler.type == 'clang' and target.os == 'Android':
# FIXME: Vestigial conditional left over from Android, please remove.
if False:
return ''
set_define('_LIBCPP_INLINE_VISIBILITY', libcxx_inline_visibility)
+32 -19
View File
@@ -261,13 +261,17 @@ def vc_path(c_compiler):
break
return result
@depends_win(vc_path)
@depends_win(vc_path, c_compiler)
@checking('for the Debug Interface Access SDK', lambda x: x or 'not found')
@imports(_from='os.path', _import='isdir')
def dia_sdk_dir(vc_path):
def dia_sdk_dir(vc_path, c_compiler):
if vc_path:
path = os.path.join(os.path.dirname(vc_path), 'DIA SDK')
if c_compiler.version < '19.10':
path = os.path.join(os.path.dirname(vc_path), 'DIA SDK')
else:
# This would be easier if we had the installationPath that
# get_vc_paths works with, since 'DIA SDK' is relative to that.
path = os.path.normpath(os.path.join(vc_path, r'..\..\..\..\DIA SDK'))
if isdir(path):
return path
@@ -309,29 +313,36 @@ def include_path(vc_path, windows_sdk_dir, ucrt_sdk_dir, dia_sdk_dir):
set_config('INCLUDE', include_path)
@depends_win(target, vc_path, valid_windows_sdk_dir, valid_ucrt_sdk_dir, dia_sdk_dir)
@depends_win(target, c_compiler, vc_path, valid_windows_sdk_dir, valid_ucrt_sdk_dir, dia_sdk_dir)
@imports('os')
def lib_path(target, vc_path, windows_sdk_dir, ucrt_sdk_dir, dia_sdk_dir):
def lib_path(target, c_compiler, vc_path, windows_sdk_dir, ucrt_sdk_dir, dia_sdk_dir):
if not vc_path:
return
vc_target = {
'x86': '',
'x86_64': 'amd64',
'arm': 'arm',
}.get(target.cpu)
if vc_target is None:
return
# As vc_target can be '', and os.path.join will happily use the empty
# string, leading to a string ending with a backslash, that Make will
# interpret as a "string continues on next line" indicator, use variable
# args.
vc_target = (vc_target,) if vc_target else ()
sdk_target = {
'x86': 'x86',
'x86_64': 'x64',
'arm': 'arm',
}.get(target.cpu)
old_target = {
'x86': '',
'x86_64': 'amd64',
'arm': 'arm',
}.get(target.cpu)
if old_target is None:
return
# As old_target can be '', and os.path.join will happily use the empty
# string, leading to a string ending with a backslash, that Make will
# interpret as a "string continues on next line" indicator, use variable
# args.
old_target = (old_target,) if old_target else ()
if c_compiler.version < '19.10':
# MSVC2015
vc_target = old_target
else:
# MSVC2017 switched to use the same target naming as the sdk.
vc_target = (sdk_target,)
atlmfc_dir = os.path.join(vc_path, 'atlmfc', 'lib', *vc_target)
if not os.path.isdir(atlmfc_dir):
die('Cannot find the ATL/MFC libraries in the Visual C++ directory (%s). '
@@ -349,7 +360,9 @@ def lib_path(target, vc_path, windows_sdk_dir, ucrt_sdk_dir, dia_sdk_dir):
os.path.join(ucrt_sdk_dir.lib, 'ucrt', sdk_target),
))
if dia_sdk_dir:
libs.append(os.path.join(dia_sdk_dir, 'lib', *vc_target))
# For some reason the DIA SDK still uses the old-style targets
# even in a newer MSVC.
libs.append(os.path.join(dia_sdk_dir, 'lib', *old_target))
# Set in the environment for old-configure
libs = os.pathsep.join(libs)
os.environ['LIB'] = libs
+1 -1
View File
@@ -1,6 +1,6 @@
#!/bin/bash
gcc_version=4.8.5
gcc_version=7.1.0
binutils_version=2.25.1
this_path=$(readlink -f $(dirname $0))
make_flags='-j12'
-1
View File
@@ -40,7 +40,6 @@
fun:malloc
fun:moz_xmalloc
fun:operator new
fun:_Z21XRE_CreateStatsObjectv
...
}
Binary file not shown.
@@ -58,7 +58,6 @@ const URLs = new Map([
["data:text/html,Hi", true, false, true],
["view-source:data:text/html,Hi", false, false, true],
["javascript:alert('hi')", true, false, true],
["moz://a", false, false, true],
["about:test-chrome-privs", false, false, true],
["about:test-unknown-unlinkable", false, false, true],
["about:test-content-unlinkable", false, false, true],
@@ -80,7 +79,6 @@ const URLs = new Map([
["data:text/html,Hi", true, false, true],
["view-source:data:text/html,Hi", false, false, true],
["javascript:alert('hi')", true, false, true],
["moz://a", false, false, true],
["about:test-chrome-privs", false, false, true],
["about:test-unknown-unlinkable", false, false, true],
["about:test-content-unlinkable", false, false, true],
@@ -102,7 +100,6 @@ const URLs = new Map([
["data:text/html,Hi", true, false, true],
["view-source:data:text/html,Hi", true, false, true],
["javascript:alert('hi')", true, false, true],
["moz://a", false, false, true],
["about:test-chrome-privs", false, false, true],
["about:test-unknown-unlinkable", false, false, true],
["about:test-content-unlinkable", false, false, true],
-2
View File
@@ -108,9 +108,7 @@ NS_INTERFACE_MAP_BEGIN(nsChromeRegistry)
NS_INTERFACE_MAP_ENTRY(nsIChromeRegistry)
NS_INTERFACE_MAP_ENTRY(nsIXULChromeRegistry)
NS_INTERFACE_MAP_ENTRY(nsIToolkitChromeRegistry)
#ifdef MOZ_XUL
NS_INTERFACE_MAP_ENTRY(nsIXULOverlayProvider)
#endif
NS_INTERFACE_MAP_ENTRY(nsIObserver)
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIChromeRegistry)
-6
View File
@@ -9,11 +9,7 @@
#include "nsIToolkitChromeRegistry.h"
#include "nsIObserver.h"
#include "nsWeakReference.h"
#ifdef MOZ_XUL
#include "nsIXULOverlayProvider.h"
#endif
#include "nsString.h"
#include "nsURIHashKey.h"
#include "nsInterfaceHashtable.h"
@@ -37,9 +33,7 @@ class nsIURL;
{ 0x47049e42, 0x1d87, 0x482a, { 0x98, 0x4d, 0x56, 0xae, 0x18, 0x5e, 0x36, 0x7a } }
class nsChromeRegistry : public nsIToolkitChromeRegistry,
#ifdef MOZ_XUL
public nsIXULOverlayProvider,
#endif
public nsIObserver,
public nsSupportsWeakReference
{
-2
View File
@@ -640,7 +640,6 @@ nsChromeRegistryChrome::OverlayListHash::GetArray(nsIURI* aBase)
return &entry->mArray;
}
#ifdef MOZ_XUL
NS_IMETHODIMP
nsChromeRegistryChrome::GetStyleOverlays(nsIURI *aChromeURL,
nsISimpleEnumerator **aResult)
@@ -670,7 +669,6 @@ nsChromeRegistryChrome::GetXULOverlays(nsIURI *aChromeURL,
return NS_NewArrayEnumerator(aResult, *parray);
}
#endif // MOZ_XUL
nsIURI*
nsChromeRegistry::ManifestProcessingContext::GetManifestURI()
-2
View File
@@ -41,12 +41,10 @@ class nsChromeRegistryChrome : public nsChromeRegistry
NS_IMETHOD Observe(nsISupports *aSubject, const char *aTopic,
const char16_t *someData) override;
#ifdef MOZ_XUL
NS_IMETHOD GetXULOverlays(nsIURI *aURI,
nsISimpleEnumerator **_retval) override;
NS_IMETHOD GetStyleOverlays(nsIURI *aURI,
nsISimpleEnumerator **_retval) override;
#endif
// If aChild is non-null then it is a new child to notify. If aChild is
// null, then we have installed new chrome and we are resetting all of our
-51
View File
@@ -1,51 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Ensure ANDROID_SDK is defined before including this file.
# We use common android defaults for boot class path and java version.
ifndef ANDROID_SDK
$(error ANDROID_SDK must be defined before including android-common.mk)
endif
# DEBUG_JARSIGNER always debug signs.
DEBUG_JARSIGNER=$(PYTHON) $(abspath $(topsrcdir)/mobile/android/debug_sign_tool.py) \
--keytool=$(KEYTOOL) \
--jarsigner=$(JARSIGNER) \
$(NULL)
# RELEASE_JARSIGNER release signs if possible.
ifdef MOZ_SIGN_CMD
RELEASE_JARSIGNER := $(MOZ_SIGN_CMD) -f jar
else
RELEASE_JARSIGNER := $(DEBUG_JARSIGNER)
endif
# $(1) is the full path to input: foo-debug-unsigned-unaligned.apk.
# $(2) is the full path to output: foo.apk.
# Use this like: $(call RELEASE_SIGN_ANDROID_APK,foo-debug-unsigned-unaligned.apk,foo.apk)
#
# The |zip -d| there to handle re-signing previously signed APKs. Gradle
# produces signed, unaligned APK files, but this expects unsigned, unaligned
# APK files. The |zip -d| discards any existing signature, turning a signed,
# unaligned APK into an unsigned, unaligned APK. Sadly |zip -q| doesn't
# silence a warning about "nothing to do" so we pipe to /dev/null.
RELEASE_SIGN_ANDROID_APK = \
cp $(1) $(2)-unaligned.apk && \
($(ZIP) -d $(2)-unaligned.apk 'META-INF/*' > /dev/null || true) && \
$(RELEASE_JARSIGNER) $(2)-unaligned.apk && \
$(ZIPALIGN) -f -v 4 $(2)-unaligned.apk $(2) && \
$(RM) $(2)-unaligned.apk
# For Android, we default to 1.7
ifndef JAVA_VERSION
JAVA_VERSION = 1.7
endif
JAVAC_FLAGS = \
-target $(JAVA_VERSION) \
-source $(JAVA_VERSION) \
-encoding UTF8 \
-g:source,lines \
-Werror \
$(NULL)
+1 -1
View File
@@ -45,7 +45,7 @@ endif # WINNT
ifndef INCLUDED_AUTOCONF_MK
default::
else
TIERS := $(if $(MOZ_ARTIFACT_BUILDS),artifact )pre-export export $(if $(COMPILE_ENVIRONMENT),compile )misc libs tools
TIERS := pre-export export $(if $(COMPILE_ENVIRONMENT),compile )misc libs tools
endif
# These defines are used to support the twin-topsrcdir model for comm-central.
+5 -1
View File
@@ -79,17 +79,21 @@ included_inclnames_to_ignore = set([
'prtypes.h', # NSPR
'selfhosted.out.h', # generated in $OBJDIR
'shellmoduleloader.out.h', # generated in $OBJDIR
'unicode/plurrule.h', # ICU
'unicode/timezone.h', # ICU
'unicode/ucal.h', # ICU
'unicode/uclean.h', # ICU
'unicode/ucol.h', # ICU
'unicode/udat.h', # ICU
'unicode/udatpg.h', # ICU
'unicode/udisplaycontext.h',# ICU
'unicode/uenum.h', # ICU
'unicode/uniset.h', # ICU
'unicode/unorm.h', # ICU
'unicode/unorm2.h', # ICU
'unicode/unum.h', # ICU
'unicode/unumsys.h', # ICU
'unicode/upluralrules.h', # ICU
'unicode/ureldatefmt.h', # ICU
'unicode/ustring.h', # ICU
'unicode/utypes.h', # ICU
'vtune/VTuneWrapper.h' # VTune
+14 -10
View File
@@ -377,8 +377,20 @@ endif # WINNT
ifdef _MSC_VER
ifeq ($(CPU_ARCH),x86_64)
# set stack to 2MB on x64 build. See bug 582910
WIN32_EXE_LDFLAGS += -STACK:2097152
# Normal operation on 64-bit Windows needs 2 MB of stack. (Bug 582910)
# ASAN requires 6 MB of stack.
# Setting the stack to 8 MB to match the capability of other systems
# to deal with frame construction for unreasonably deep DOM trees
# with worst-case styling. This uses address space unnecessarily for
# non-main threads, but that should be tolerable on 64-bit systems.
WIN32_EXE_LDFLAGS += -STACK:8388608
else
# Since this setting affects the default stack size for non-main
# threads, too, to avoid burning the address space, increase only
# 512 KB over the default. Just enough to be able to deal with
# reasonable styling applied to DOM trees whose depth is near what
# Blink's HTML parser can output.
WIN32_EXE_LDFLAGS += -STACK:1572864
endif
endif
@@ -550,14 +562,6 @@ ifeq (,$(filter $(OS_TARGET),WINNT Darwin))
CHECK_TEXTREL = @$(TOOLCHAIN_PREFIX)readelf -d $(1) | grep TEXTREL > /dev/null && echo 'TEST-UNEXPECTED-FAIL | check_textrel | We do not want text relocations in libraries and programs' || true
endif
ifeq ($(MOZ_WIDGET_TOOLKIT),android)
# While this is very unlikely (libc being added by the compiler at the end
# of the linker command line), if libmozglue.so ends up after libc.so, all
# hell breaks loose, so better safe than sorry, and check it's actually the
# case.
CHECK_MOZGLUE_ORDER = @$(TOOLCHAIN_PREFIX)readelf -d $(1) | grep NEEDED | awk '{ libs[$$NF] = ++n } END { if (libs["[libmozglue.so]"] && libs["[libc.so]"] < libs["[libmozglue.so]"]) { print "libmozglue.so must be linked before libc.so"; exit 1 } }'
endif
define CHECK_BINARY
$(call CHECK_GLIBC,$(1))
$(call CHECK_STDCXX,$(1))
+2
View File
@@ -121,6 +121,8 @@ else:
DEFINES['SYMBOL_UNDERSCORE'] = True
else:
ffi_srcs = ('ffi.c', 'darwin.S', 'ffi64.c', 'darwin64.S')
elif CONFIG['FFI_TARGET'] == 'AARCH64_DARWIN':
ffi_srcs = ('sysv.S', 'ffi.c')
SOURCES += [
'/js/src/ctypes/libffi/src/%s/%s' % (CONFIG['FFI_TARGET_DIR'], s)
+63 -52
View File
@@ -4,26 +4,28 @@ SOURCES += [
'/intl/icu/source/common/bmpset.cpp',
'/intl/icu/source/common/brkeng.cpp',
'/intl/icu/source/common/brkiter.cpp',
'/intl/icu/source/common/bytesinkutil.cpp',
'/intl/icu/source/common/bytestream.cpp',
'/intl/icu/source/common/bytestrie.cpp',
'/intl/icu/source/common/bytestriebuilder.cpp',
'/intl/icu/source/common/bytestrieiterator.cpp',
'/intl/icu/source/common/caniter.cpp',
'/intl/icu/source/common/characterproperties.cpp',
'/intl/icu/source/common/chariter.cpp',
'/intl/icu/source/common/charstr.cpp',
'/intl/icu/source/common/cmemory.c',
'/intl/icu/source/common/cmemory.cpp',
'/intl/icu/source/common/cstr.cpp',
'/intl/icu/source/common/cstring.c',
'/intl/icu/source/common/cwchar.c',
'/intl/icu/source/common/cstring.cpp',
'/intl/icu/source/common/cwchar.cpp',
'/intl/icu/source/common/dictbe.cpp',
'/intl/icu/source/common/dictionarydata.cpp',
'/intl/icu/source/common/dtintrv.cpp',
'/intl/icu/source/common/edits.cpp',
'/intl/icu/source/common/errorcode.cpp',
'/intl/icu/source/common/filteredbrk.cpp',
'/intl/icu/source/common/filterednormalizer2.cpp',
'/intl/icu/source/common/icudataver.c',
'/intl/icu/source/common/icudataver.cpp',
'/intl/icu/source/common/icuplug.cpp',
'/intl/icu/source/common/listformatter.cpp',
'/intl/icu/source/common/loadednormalizer2impl.cpp',
'/intl/icu/source/common/locavailable.cpp',
'/intl/icu/source/common/locbased.cpp',
@@ -31,7 +33,7 @@ SOURCES += [
'/intl/icu/source/common/locdspnm.cpp',
'/intl/icu/source/common/locid.cpp',
'/intl/icu/source/common/loclikely.cpp',
'/intl/icu/source/common/locmap.c',
'/intl/icu/source/common/locmap.cpp',
'/intl/icu/source/common/locresdata.cpp',
'/intl/icu/source/common/locutil.cpp',
'/intl/icu/source/common/messagepattern.cpp',
@@ -42,10 +44,11 @@ SOURCES += [
'/intl/icu/source/common/patternprops.cpp',
'/intl/icu/source/common/pluralmap.cpp',
'/intl/icu/source/common/propname.cpp',
'/intl/icu/source/common/propsvec.c',
'/intl/icu/source/common/propsvec.cpp',
'/intl/icu/source/common/punycode.cpp',
'/intl/icu/source/common/putil.cpp',
'/intl/icu/source/common/rbbi.cpp',
'/intl/icu/source/common/rbbi_cache.cpp',
'/intl/icu/source/common/rbbidata.cpp',
'/intl/icu/source/common/rbbinode.cpp',
'/intl/icu/source/common/rbbirb.cpp',
@@ -67,68 +70,70 @@ SOURCES += [
'/intl/icu/source/common/servslkf.cpp',
'/intl/icu/source/common/sharedobject.cpp',
'/intl/icu/source/common/simpleformatter.cpp',
'/intl/icu/source/common/static_unicode_sets.cpp',
'/intl/icu/source/common/stringpiece.cpp',
'/intl/icu/source/common/stringtriebuilder.cpp',
'/intl/icu/source/common/uarrsort.c',
'/intl/icu/source/common/ubidi.c',
'/intl/icu/source/common/ubidi_props.c',
'/intl/icu/source/common/ubidiln.c',
'/intl/icu/source/common/ubiditransform.c',
'/intl/icu/source/common/ubidiwrt.c',
'/intl/icu/source/common/uarrsort.cpp',
'/intl/icu/source/common/ubidi.cpp',
'/intl/icu/source/common/ubidi_props.cpp',
'/intl/icu/source/common/ubidiln.cpp',
'/intl/icu/source/common/ubiditransform.cpp',
'/intl/icu/source/common/ubidiwrt.cpp',
'/intl/icu/source/common/ubrk.cpp',
'/intl/icu/source/common/ucase.cpp',
'/intl/icu/source/common/ucasemap.cpp',
'/intl/icu/source/common/ucasemap_titlecase_brkiter.cpp',
'/intl/icu/source/common/ucat.c',
'/intl/icu/source/common/uchar.c',
'/intl/icu/source/common/ucat.cpp',
'/intl/icu/source/common/uchar.cpp',
'/intl/icu/source/common/ucharstrie.cpp',
'/intl/icu/source/common/ucharstriebuilder.cpp',
'/intl/icu/source/common/ucharstrieiterator.cpp',
'/intl/icu/source/common/uchriter.cpp',
'/intl/icu/source/common/ucln_cmn.cpp',
'/intl/icu/source/common/ucmndata.c',
'/intl/icu/source/common/ucnv.c',
'/intl/icu/source/common/ucmndata.cpp',
'/intl/icu/source/common/ucnv.cpp',
'/intl/icu/source/common/ucnv2022.cpp',
'/intl/icu/source/common/ucnv_bld.cpp',
'/intl/icu/source/common/ucnv_cb.c',
'/intl/icu/source/common/ucnv_cnv.c',
'/intl/icu/source/common/ucnv_ct.c',
'/intl/icu/source/common/ucnv_err.c',
'/intl/icu/source/common/ucnv_cb.cpp',
'/intl/icu/source/common/ucnv_cnv.cpp',
'/intl/icu/source/common/ucnv_ct.cpp',
'/intl/icu/source/common/ucnv_err.cpp',
'/intl/icu/source/common/ucnv_ext.cpp',
'/intl/icu/source/common/ucnv_io.cpp',
'/intl/icu/source/common/ucnv_lmb.c',
'/intl/icu/source/common/ucnv_set.c',
'/intl/icu/source/common/ucnv_u16.c',
'/intl/icu/source/common/ucnv_u32.c',
'/intl/icu/source/common/ucnv_u7.c',
'/intl/icu/source/common/ucnv_u8.c',
'/intl/icu/source/common/ucnv_lmb.cpp',
'/intl/icu/source/common/ucnv_set.cpp',
'/intl/icu/source/common/ucnv_u16.cpp',
'/intl/icu/source/common/ucnv_u32.cpp',
'/intl/icu/source/common/ucnv_u7.cpp',
'/intl/icu/source/common/ucnv_u8.cpp',
'/intl/icu/source/common/ucnvbocu.cpp',
'/intl/icu/source/common/ucnvdisp.c',
'/intl/icu/source/common/ucnvhz.c',
'/intl/icu/source/common/ucnvisci.c',
'/intl/icu/source/common/ucnvlat1.c',
'/intl/icu/source/common/ucnvdisp.cpp',
'/intl/icu/source/common/ucnvhz.cpp',
'/intl/icu/source/common/ucnvisci.cpp',
'/intl/icu/source/common/ucnvlat1.cpp',
'/intl/icu/source/common/ucnvmbcs.cpp',
'/intl/icu/source/common/ucnvscsu.c',
'/intl/icu/source/common/ucnvscsu.cpp',
'/intl/icu/source/common/ucnvsel.cpp',
'/intl/icu/source/common/ucol_swp.cpp',
'/intl/icu/source/common/ucptrie.cpp',
'/intl/icu/source/common/ucurr.cpp',
'/intl/icu/source/common/udata.cpp',
'/intl/icu/source/common/udatamem.c',
'/intl/icu/source/common/udataswp.c',
'/intl/icu/source/common/uenum.c',
'/intl/icu/source/common/uhash.c',
'/intl/icu/source/common/udatamem.cpp',
'/intl/icu/source/common/udataswp.cpp',
'/intl/icu/source/common/uenum.cpp',
'/intl/icu/source/common/uhash.cpp',
'/intl/icu/source/common/uhash_us.cpp',
'/intl/icu/source/common/uidna.cpp',
'/intl/icu/source/common/uinit.cpp',
'/intl/icu/source/common/uinvchar.c',
'/intl/icu/source/common/uinvchar.cpp',
'/intl/icu/source/common/uiter.cpp',
'/intl/icu/source/common/ulist.c',
'/intl/icu/source/common/ulistformatter.cpp',
'/intl/icu/source/common/ulist.cpp',
'/intl/icu/source/common/uloc.cpp',
'/intl/icu/source/common/uloc_keytype.cpp',
'/intl/icu/source/common/uloc_tag.c',
'/intl/icu/source/common/umapfile.c',
'/intl/icu/source/common/umath.c',
'/intl/icu/source/common/uloc_tag.cpp',
'/intl/icu/source/common/umapfile.cpp',
'/intl/icu/source/common/umath.cpp',
'/intl/icu/source/common/umutablecptrie.cpp',
'/intl/icu/source/common/umutex.cpp',
'/intl/icu/source/common/unames.cpp',
'/intl/icu/source/common/unifiedcache.cpp',
@@ -148,11 +153,11 @@ SOURCES += [
'/intl/icu/source/common/unormcmp.cpp',
'/intl/icu/source/common/uobject.cpp',
'/intl/icu/source/common/uprops.cpp',
'/intl/icu/source/common/ures_cnv.c',
'/intl/icu/source/common/ures_cnv.cpp',
'/intl/icu/source/common/uresbund.cpp',
'/intl/icu/source/common/uresdata.cpp',
'/intl/icu/source/common/usc_impl.c',
'/intl/icu/source/common/uscript.c',
'/intl/icu/source/common/usc_impl.cpp',
'/intl/icu/source/common/uscript.cpp',
'/intl/icu/source/common/uscript_props.cpp',
'/intl/icu/source/common/uset.cpp',
'/intl/icu/source/common/uset_props.cpp',
@@ -166,23 +171,24 @@ SOURCES += [
'/intl/icu/source/common/ustrcase.cpp',
'/intl/icu/source/common/ustrcase_locale.cpp',
'/intl/icu/source/common/ustrenum.cpp',
'/intl/icu/source/common/ustrfmt.c',
'/intl/icu/source/common/ustrfmt.cpp',
'/intl/icu/source/common/ustring.cpp',
'/intl/icu/source/common/ustrtrns.cpp',
'/intl/icu/source/common/utext.cpp',
'/intl/icu/source/common/utf_impl.c',
'/intl/icu/source/common/utf_impl.cpp',
'/intl/icu/source/common/util.cpp',
'/intl/icu/source/common/util_props.cpp',
'/intl/icu/source/common/utrace.c',
'/intl/icu/source/common/utrace.cpp',
'/intl/icu/source/common/utrie.cpp',
'/intl/icu/source/common/utrie2.cpp',
'/intl/icu/source/common/utrie2_builder.cpp',
'/intl/icu/source/common/utrie_swap.cpp',
'/intl/icu/source/common/uts46.cpp',
'/intl/icu/source/common/utypes.c',
'/intl/icu/source/common/utypes.cpp',
'/intl/icu/source/common/uvector.cpp',
'/intl/icu/source/common/uvectr32.cpp',
'/intl/icu/source/common/uvectr64.cpp',
'/intl/icu/source/common/wintz.c',
'/intl/icu/source/common/wintz.cpp',
]
EXPORTS.unicode += [
@@ -192,17 +198,19 @@ EXPORTS.unicode += [
'/intl/icu/source/common/unicode/bytestrie.h',
'/intl/icu/source/common/unicode/bytestriebuilder.h',
'/intl/icu/source/common/unicode/caniter.h',
'/intl/icu/source/common/unicode/casemap.h',
'/intl/icu/source/common/unicode/char16ptr.h',
'/intl/icu/source/common/unicode/chariter.h',
'/intl/icu/source/common/unicode/dbbi.h',
'/intl/icu/source/common/unicode/docmain.h',
'/intl/icu/source/common/unicode/dtintrv.h',
'/intl/icu/source/common/unicode/edits.h',
'/intl/icu/source/common/unicode/enumset.h',
'/intl/icu/source/common/unicode/errorcode.h',
'/intl/icu/source/common/unicode/filteredbrk.h',
'/intl/icu/source/common/unicode/icudataver.h',
'/intl/icu/source/common/unicode/icuplug.h',
'/intl/icu/source/common/unicode/idna.h',
'/intl/icu/source/common/unicode/listformatter.h',
'/intl/icu/source/common/unicode/localpointer.h',
'/intl/icu/source/common/unicode/locdspnm.h',
'/intl/icu/source/common/unicode/locid.h',
@@ -221,6 +229,7 @@ EXPORTS.unicode += [
'/intl/icu/source/common/unicode/simpleformatter.h',
'/intl/icu/source/common/unicode/std_string.h',
'/intl/icu/source/common/unicode/strenum.h',
'/intl/icu/source/common/unicode/stringoptions.h',
'/intl/icu/source/common/unicode/stringpiece.h',
'/intl/icu/source/common/unicode/stringtriebuilder.h',
'/intl/icu/source/common/unicode/symtable.h',
@@ -239,6 +248,8 @@ EXPORTS.unicode += [
'/intl/icu/source/common/unicode/ucnv_err.h',
'/intl/icu/source/common/unicode/ucnvsel.h',
'/intl/icu/source/common/unicode/uconfig.h',
'/intl/icu/source/common/unicode/ucpmap.h',
'/intl/icu/source/common/unicode/ucptrie.h',
'/intl/icu/source/common/unicode/ucurr.h',
'/intl/icu/source/common/unicode/udata.h',
'/intl/icu/source/common/unicode/udisplaycontext.h',
@@ -246,10 +257,10 @@ EXPORTS.unicode += [
'/intl/icu/source/common/unicode/uidna.h',
'/intl/icu/source/common/unicode/uiter.h',
'/intl/icu/source/common/unicode/uldnames.h',
'/intl/icu/source/common/unicode/ulistformatter.h',
'/intl/icu/source/common/unicode/uloc.h',
'/intl/icu/source/common/unicode/umachine.h',
'/intl/icu/source/common/unicode/umisc.h',
'/intl/icu/source/common/unicode/umutablecptrie.h',
'/intl/icu/source/common/unicode/unifilt.h',
'/intl/icu/source/common/unicode/unifunct.h',
'/intl/icu/source/common/unicode/unimatch.h',
Binary file not shown.
Binary file not shown.
-1
View File
@@ -14,7 +14,6 @@ DEFINES.update(
UCONFIG_NO_LEGACY_CONVERSION = True,
UCONFIG_NO_TRANSLITERATION = True,
UCONFIG_NO_REGULAR_EXPRESSIONS = True,
UCONFIG_NO_BREAK_ITERATION = True,
# We don't need to pass data to and from legacy char* APIs.
U_CHARSET_IS_UTF8 = True,
+57 -19
View File
@@ -1,6 +1,5 @@
# THIS FILE IS GENERATED BY /intl/icu_sources_data.py DO NOT EDIT
SOURCES += [
'/intl/icu/source/i18n/affixpatternparser.cpp',
'/intl/icu/source/i18n/alphaindex.cpp',
'/intl/icu/source/i18n/anytrans.cpp',
'/intl/icu/source/i18n/astro.cpp',
@@ -53,23 +52,22 @@ SOURCES += [
'/intl/icu/source/i18n/datefmt.cpp',
'/intl/icu/source/i18n/dayperiodrules.cpp',
'/intl/icu/source/i18n/dcfmtsym.cpp',
'/intl/icu/source/i18n/decContext.c',
'/intl/icu/source/i18n/decfmtst.cpp',
'/intl/icu/source/i18n/decimalformatpattern.cpp',
'/intl/icu/source/i18n/decContext.cpp',
'/intl/icu/source/i18n/decimfmt.cpp',
'/intl/icu/source/i18n/decimfmtimpl.cpp',
'/intl/icu/source/i18n/decNumber.c',
'/intl/icu/source/i18n/digitaffix.cpp',
'/intl/icu/source/i18n/digitaffixesandpadding.cpp',
'/intl/icu/source/i18n/digitformatter.cpp',
'/intl/icu/source/i18n/digitgrouping.cpp',
'/intl/icu/source/i18n/digitinterval.cpp',
'/intl/icu/source/i18n/digitlst.cpp',
'/intl/icu/source/i18n/decNumber.cpp',
'/intl/icu/source/i18n/double-conversion-bignum-dtoa.cpp',
'/intl/icu/source/i18n/double-conversion-bignum.cpp',
'/intl/icu/source/i18n/double-conversion-cached-powers.cpp',
'/intl/icu/source/i18n/double-conversion-diy-fp.cpp',
'/intl/icu/source/i18n/double-conversion-fast-dtoa.cpp',
'/intl/icu/source/i18n/double-conversion-strtod.cpp',
'/intl/icu/source/i18n/double-conversion.cpp',
'/intl/icu/source/i18n/dtfmtsym.cpp',
'/intl/icu/source/i18n/dtitvfmt.cpp',
'/intl/icu/source/i18n/dtitvinf.cpp',
'/intl/icu/source/i18n/dtptngen.cpp',
'/intl/icu/source/i18n/dtrule.cpp',
'/intl/icu/source/i18n/erarules.cpp',
'/intl/icu/source/i18n/esctrn.cpp',
'/intl/icu/source/i18n/ethpccal.cpp',
'/intl/icu/source/i18n/fmtable.cpp',
@@ -86,6 +84,7 @@ SOURCES += [
'/intl/icu/source/i18n/inputext.cpp',
'/intl/icu/source/i18n/islamcal.cpp',
'/intl/icu/source/i18n/japancal.cpp',
'/intl/icu/source/i18n/listformatter.cpp',
'/intl/icu/source/i18n/measfmt.cpp',
'/intl/icu/source/i18n/measunit.cpp',
'/intl/icu/source/i18n/measure.cpp',
@@ -95,15 +94,50 @@ SOURCES += [
'/intl/icu/source/i18n/nfrule.cpp',
'/intl/icu/source/i18n/nfsubs.cpp',
'/intl/icu/source/i18n/nortrans.cpp',
'/intl/icu/source/i18n/nounit.cpp',
'/intl/icu/source/i18n/nultrans.cpp',
'/intl/icu/source/i18n/number_affixutils.cpp',
'/intl/icu/source/i18n/number_asformat.cpp',
'/intl/icu/source/i18n/number_capi.cpp',
'/intl/icu/source/i18n/number_compact.cpp',
'/intl/icu/source/i18n/number_currencysymbols.cpp',
'/intl/icu/source/i18n/number_decimalquantity.cpp',
'/intl/icu/source/i18n/number_decimfmtprops.cpp',
'/intl/icu/source/i18n/number_fluent.cpp',
'/intl/icu/source/i18n/number_formatimpl.cpp',
'/intl/icu/source/i18n/number_grouping.cpp',
'/intl/icu/source/i18n/number_integerwidth.cpp',
'/intl/icu/source/i18n/number_longnames.cpp',
'/intl/icu/source/i18n/number_mapper.cpp',
'/intl/icu/source/i18n/number_modifiers.cpp',
'/intl/icu/source/i18n/number_multiplier.cpp',
'/intl/icu/source/i18n/number_notation.cpp',
'/intl/icu/source/i18n/number_padding.cpp',
'/intl/icu/source/i18n/number_patternmodifier.cpp',
'/intl/icu/source/i18n/number_patternstring.cpp',
'/intl/icu/source/i18n/number_rounding.cpp',
'/intl/icu/source/i18n/number_scientific.cpp',
'/intl/icu/source/i18n/number_skeletons.cpp',
'/intl/icu/source/i18n/number_stringbuilder.cpp',
'/intl/icu/source/i18n/number_utils.cpp',
'/intl/icu/source/i18n/numfmt.cpp',
'/intl/icu/source/i18n/numparse_affixes.cpp',
'/intl/icu/source/i18n/numparse_compositions.cpp',
'/intl/icu/source/i18n/numparse_currency.cpp',
'/intl/icu/source/i18n/numparse_decimal.cpp',
'/intl/icu/source/i18n/numparse_impl.cpp',
'/intl/icu/source/i18n/numparse_parsednumber.cpp',
'/intl/icu/source/i18n/numparse_scientific.cpp',
'/intl/icu/source/i18n/numparse_stringsegment.cpp',
'/intl/icu/source/i18n/numparse_symbols.cpp',
'/intl/icu/source/i18n/numparse_validators.cpp',
'/intl/icu/source/i18n/numrange_fluent.cpp',
'/intl/icu/source/i18n/numrange_impl.cpp',
'/intl/icu/source/i18n/numsys.cpp',
'/intl/icu/source/i18n/olsontz.cpp',
'/intl/icu/source/i18n/persncal.cpp',
'/intl/icu/source/i18n/pluralaffix.cpp',
'/intl/icu/source/i18n/plurfmt.cpp',
'/intl/icu/source/i18n/plurrule.cpp',
'/intl/icu/source/i18n/precision.cpp',
'/intl/icu/source/i18n/quant.cpp',
'/intl/icu/source/i18n/quantityformatter.cpp',
'/intl/icu/source/i18n/rbnf.cpp',
@@ -130,7 +164,6 @@ SOURCES += [
'/intl/icu/source/i18n/selfmt.cpp',
'/intl/icu/source/i18n/sharedbreakiterator.cpp',
'/intl/icu/source/i18n/simpletz.cpp',
'/intl/icu/source/i18n/smallintformatter.cpp',
'/intl/icu/source/i18n/smpdtfmt.cpp',
'/intl/icu/source/i18n/smpdtfst.cpp',
'/intl/icu/source/i18n/sortkey.cpp',
@@ -167,7 +200,8 @@ SOURCES += [
'/intl/icu/source/i18n/udatpg.cpp',
'/intl/icu/source/i18n/ufieldpositer.cpp',
'/intl/icu/source/i18n/uitercollationiterator.cpp',
'/intl/icu/source/i18n/ulocdata.c',
'/intl/icu/source/i18n/ulistformatter.cpp',
'/intl/icu/source/i18n/ulocdata.cpp',
'/intl/icu/source/i18n/umsg.cpp',
'/intl/icu/source/i18n/unesctrn.cpp',
'/intl/icu/source/i18n/uni2name.cpp',
@@ -184,10 +218,8 @@ SOURCES += [
'/intl/icu/source/i18n/uspoof_impl.cpp',
'/intl/icu/source/i18n/utf16collationiterator.cpp',
'/intl/icu/source/i18n/utf8collationiterator.cpp',
'/intl/icu/source/i18n/utmscale.c',
'/intl/icu/source/i18n/utmscale.cpp',
'/intl/icu/source/i18n/utrans.cpp',
'/intl/icu/source/i18n/valueformatter.cpp',
'/intl/icu/source/i18n/visibledigits.cpp',
'/intl/icu/source/i18n/vtzone.cpp',
'/intl/icu/source/i18n/vzone.cpp',
'/intl/icu/source/i18n/windtfmt.cpp',
@@ -223,10 +255,14 @@ EXPORTS.unicode += [
'/intl/icu/source/i18n/unicode/fpositer.h',
'/intl/icu/source/i18n/unicode/gender.h',
'/intl/icu/source/i18n/unicode/gregocal.h',
'/intl/icu/source/i18n/unicode/listformatter.h',
'/intl/icu/source/i18n/unicode/measfmt.h',
'/intl/icu/source/i18n/unicode/measunit.h',
'/intl/icu/source/i18n/unicode/measure.h',
'/intl/icu/source/i18n/unicode/msgfmt.h',
'/intl/icu/source/i18n/unicode/nounit.h',
'/intl/icu/source/i18n/unicode/numberformatter.h',
'/intl/icu/source/i18n/unicode/numberrangeformatter.h',
'/intl/icu/source/i18n/unicode/numfmt.h',
'/intl/icu/source/i18n/unicode/numsys.h',
'/intl/icu/source/i18n/unicode/plurfmt.h',
@@ -263,10 +299,12 @@ EXPORTS.unicode += [
'/intl/icu/source/i18n/unicode/ufieldpositer.h',
'/intl/icu/source/i18n/unicode/uformattable.h',
'/intl/icu/source/i18n/unicode/ugender.h',
'/intl/icu/source/i18n/unicode/ulistformatter.h',
'/intl/icu/source/i18n/unicode/ulocdata.h',
'/intl/icu/source/i18n/unicode/umsg.h',
'/intl/icu/source/i18n/unicode/unirepl.h',
'/intl/icu/source/i18n/unicode/unum.h',
'/intl/icu/source/i18n/unicode/unumberformatter.h',
'/intl/icu/source/i18n/unicode/unumsys.h',
'/intl/icu/source/i18n/unicode/upluralrules.h',
'/intl/icu/source/i18n/unicode/uregex.h',
+1 -1
View File
@@ -9,4 +9,4 @@
Library('icustubdata')
SOURCES += ['/intl/icu/source/stubdata/stubdata.c']
SOURCES += ['/intl/icu/source/stubdata/stubdata.cpp']
+3 -4
View File
@@ -10,9 +10,8 @@ DIRS += ['lgpllibs']
if not CONFIG['MOZ_SYSTEM_JPEG']:
external_dirs += ['media/libjpeg']
if CONFIG['MOZ_UPDATER']:
if not CONFIG['MOZ_SYSTEM_BZ2']:
external_dirs += ['modules/libbz2']
if not CONFIG['MOZ_SYSTEM_BZ2']:
external_dirs += ['modules/libbz2']
# There's no "native" brotli or woff2 yet, but probably in the future...
external_dirs += ['modules/brotli']
@@ -55,7 +54,7 @@ external_dirs += [
'media/psshparser'
]
if CONFIG['MOZ_LINKER']:
if CONFIG['MOZ_UPDATER']:
external_dirs += ['modules/xz-embedded']
DIRS += ['../../' + i for i in external_dirs]
-469
View File
@@ -1,469 +0,0 @@
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
CC_WRAPPER =
CXX_WRAPPER =
default::
include $(topsrcdir)/config/makefiles/functions.mk
NSS_LIBS = \
nss3 \
nssutil3 \
smime3 \
ssl3 \
$(NULL)
ifdef MOZ_FOLD_LIBS
NSS_DLLS = $(LIBRARY_NAME)
else
NSS_DLLS = $(NSS_LIBS)
endif
NSS_EXTRA_DLLS = \
nssckbi \
softokn3 \
$(NULL)
ifndef NSS_DISABLE_DBM
NSS_EXTRA_DLLS += nssdbm3
endif
SDK_LIBS = crmf
ifneq (,$(filter WINNT,$(OS_ARCH)))
SDK_LIBS += $(NSS_DLLS)
endif
# Default
HAVE_FREEBL_LIBS = 1
# SunOS SPARC
ifeq ($(OS_ARCH), SunOS)
ifneq (86,$(findstring 86,$(OS_TEST)))
ifdef HAVE_64BIT_BUILD
HAVE_FREEBL_LIBS =
HAVE_FREEBL_LIBS_64 = 1
else
HAVE_FREEBL_LIBS =
HAVE_FREEBL_LIBS_32FPU = 1
HAVE_FREEBL_LIBS_32INT64 = 1
endif
endif
endif
ifeq ($(OS_TARGET),Linux)
HAVE_FREEBL_LIBS =
HAVE_FREEBL_LIBS_PRIV = 1
FREEBL_LOWHASH_FLAG = FREEBL_LOWHASH=1
endif
ifdef HAVE_FREEBL_LIBS
NSS_EXTRA_DLLS += freebl3
endif
ifdef HAVE_FREEBL_LIBS_PRIV
NSS_EXTRA_DLLS += freeblpriv3
endif
ifdef HAVE_FREEBL_LIBS_32INT32
NSS_EXTRA_DLLS += freebl_32int_3
endif
ifdef HAVE_FREEBL_LIBS_32FPU
NSS_EXTRA_DLLS += freebl_32fpu_3
endif
ifdef HAVE_FREEBL_LIBS_32INT64
NSS_EXTRA_DLLS += freebl_32int64_3
endif
ifdef HAVE_FREEBL_LIBS_64
NSS_EXTRA_DLLS += freebl_64int_3
NSS_EXTRA_DLLS += freebl_64fpu_3
endif
# For all variables such as DLLFLAGS, that may contain $(DIST)
DIST := $(ABS_DIST)
# TODO: move this all to configure, but in Python
ifndef MOZ_BUILD_NSPR
NSPR_INCLUDE_DIR = $(firstword $(filter -I%,$(NSPR_CFLAGS)))
ifneq (,$(strip $(NSPR_INCLUDE_DIR)))
NSPR_INCLUDE_DIR := $(subst -I,,$(subst -I$(DIST),-I$(ABS_DIST),$(NSPR_INCLUDE_DIR)))
else
$(error Your NSPR CFLAGS are broken!)
endif
NSPR_LIB_DIR = $(firstword $(filter -L%,$(NSPR_LIBS)))
ifneq (,$(strip $(NSPR_LIB_DIR)))
NSPR_LIB_DIR := $(subst -L,,$(subst -L$(DIST),-L$(ABS_DIST),$(NSPR_LIB_DIR)))
else
$(error Your NSPR LDFLAGS are broken!)
endif
endif
# To get debug symbols from NSS
export MOZ_DEBUG_SYMBOLS
DEFAULT_GMAKE_FLAGS =
DEFAULT_GMAKE_FLAGS += CC='$(CC)'
DEFAULT_GMAKE_FLAGS += MT='$(MT)'
DEFAULT_GMAKE_FLAGS += LD='$(LD)'
DEFAULT_GMAKE_FLAGS += SOURCE_MD_DIR=$(ABS_DIST)
DEFAULT_GMAKE_FLAGS += SOURCE_MDHEADERS_DIR=$(NSPR_INCLUDE_DIR)
DEFAULT_GMAKE_FLAGS += DIST=$(ABS_DIST)
DEFAULT_GMAKE_FLAGS += NSPR_INCLUDE_DIR=$(NSPR_INCLUDE_DIR)
DEFAULT_GMAKE_FLAGS += NSPR_LIB_DIR=$(NSPR_LIB_DIR)
DEFAULT_GMAKE_FLAGS += MOZILLA_CLIENT=1
DEFAULT_GMAKE_FLAGS += NO_MDUPDATE=1
DEFAULT_GMAKE_FLAGS += NSS_ENABLE_ECC=1
DEFAULT_GMAKE_FLAGS += NSS_ENABLE_TLS_1_3=1
ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_1)
DEFAULT_GMAKE_FLAGS += OS_DLLFLAGS='-static-libgcc' NSPR31_LIB_PREFIX=lib
endif
DEFAULT_GMAKE_FLAGS += SQLITE_LIB_NAME=mozsqlite3
DEFAULT_GMAKE_FLAGS += SQLITE_LIB_DIR=$(ABS_DIST)/../db/sqlite3/src
DEFAULT_GMAKE_FLAGS += SQLITE_INCLUDE_DIR=$(ABS_DIST)/include
ifdef NSS_DISABLE_DBM
DEFAULT_GMAKE_FLAGS += NSS_DISABLE_DBM=1
endif
# Hack to force NSS build system to use "normal" object directories
DEFAULT_GMAKE_FLAGS += topsrcdir='$(topsrcdir)'
# topsrcdir can't be expanded here because msys path mangling likes to break
# paths in that case.
DEFAULT_GMAKE_FLAGS += BUILD='$(MOZ_BUILD_ROOT)/security/$$(subst $$(topsrcdir)/security/,,$$(CURDIR))'
DEFAULT_GMAKE_FLAGS += BUILD_TREE='$$(BUILD)' OBJDIR='$$(BUILD)' DEPENDENCIES='$$(BUILD)/.deps' SINGLE_SHLIB_DIR='$$(BUILD)'
DEFAULT_GMAKE_FLAGS += SOURCE_XP_DIR=$(ABS_DIST)
ifndef MOZ_DEBUG
DEFAULT_GMAKE_FLAGS += BUILD_OPT=1 OPT_CODE_SIZE=1
endif
ifdef GNU_CC
DEFAULT_GMAKE_FLAGS += NS_USE_GCC=1
else
DEFAULT_GMAKE_FLAGS += NS_USE_GCC=
endif
ifdef USE_N32
# It is not really necessary to specify USE_PTHREADS=1. USE_PTHREADS
# merely adds _PTH to coreconf's OBJDIR name.
DEFAULT_GMAKE_FLAGS += USE_N32=1 USE_PTHREADS=1
endif
ifdef HAVE_64BIT_BUILD
DEFAULT_GMAKE_FLAGS += USE_64=1
endif
ifeq ($(OS_ARCH),WINNT)
DEFAULT_GMAKE_FLAGS += OS_TARGET=WIN95
ifdef MOZ_DEBUG
ifndef MOZ_NO_DEBUG_RTL
DEFAULT_GMAKE_FLAGS += USE_DEBUG_RTL=1
endif
endif
endif # WINNT
ifeq ($(OS_ARCH),Darwin)
# Make nsinstall use absolute symlinks by default when building NSS
# for Mozilla on Mac OS X. (Bugzilla bug 193164)
ifndef NSDISTMODE
DEFAULT_GMAKE_FLAGS += NSDISTMODE=absolute_symlink
endif
ifdef MACOS_SDK_DIR
DEFAULT_GMAKE_FLAGS += MACOS_SDK_DIR=$(MACOS_SDK_DIR)
endif
endif
# Turn off TLS compression support because it requires system zlib.
# See bug 580679 comment 18.
DEFAULT_GMAKE_FLAGS += NSS_SSL_ENABLE_ZLIB=
# Disable building of the test programs in security/nss/lib/zlib
DEFAULT_GMAKE_FLAGS += PROGRAMS=
# Disable creating .chk files. They will be generated from packager.mk
# When bug 681624 lands, we can replace CHECKLOC= with SKIP_SHLIBSIGN=1
DEFAULT_GMAKE_FLAGS += CHECKLOC=
ifdef CROSS_COMPILE
DEFAULT_GMAKE_FLAGS += \
NATIVE_CC='$(HOST_CC)' \
CC='$(CC)' \
CCC='$(CXX)' \
AS='$(AS)' \
AR='$(AR) $(AR_FLAGS:$@=$$@)' \
RANLIB='$(RANLIB)' \
RC='$(RC) $(RCFLAGS)' \
OS_ARCH='$(OS_ARCH)' \
OS_TEST='$(OS_TEST)' \
CPU_ARCH='$(TARGET_CPU)' \
$(NULL)
# Android has pthreads integrated into -lc, so OS_PTHREAD is set to nothing
ifeq ($(OS_TARGET), Android)
DEFAULT_GMAKE_FLAGS += \
OS_RELEASE='2.6' \
OS_PTHREAD= \
$(NULL)
DEFAULT_GMAKE_FLAGS += ARCHFLAG='$(filter-out -W%,$(CFLAGS)) -DCHECK_FORK_GETPID $(addprefix -DANDROID_VERSION=,$(ANDROID_VERSION)) -include $(topsrcdir)/security/manager/android_stub.h'
endif
endif
ifdef WRAP_LDFLAGS
NSS_EXTRA_LDFLAGS += $(WRAP_LDFLAGS)
endif
# The SHARED_LIBS part is needed unconditionally on Android. It's not
# clear why this is the case, but see bug 1133073 (starting around
# comment #8) for context.
ifneq (,$(or $(MOZ_GLUE_WRAP_LDFLAGS), $(filter Android, $(OS_TARGET))))
NSS_EXTRA_LDFLAGS += $(SHARED_LIBS:$(DEPTH)%=$(MOZ_BUILD_ROOT)%) $(MOZ_GLUE_WRAP_LDFLAGS)
endif
ifneq (,$(NSS_EXTRA_LDFLAGS))
DEFAULT_GMAKE_FLAGS += \
LDFLAGS='$(LDFLAGS) $(NSS_EXTRA_LDFLAGS)' \
DSO_LDOPTS='$(DSO_LDOPTS) $(LDFLAGS) $(NSS_EXTRA_LDFLAGS)' \
$(NULL)
endif
DEFAULT_GMAKE_FLAGS += FREEBL_NO_DEPEND=0 $(FREEBL_LOWHASH_FLAG)
DEFAULT_GMAKE_FLAGS += NSS_ALLOW_SSLKEYLOGFILE=1
ifdef MOZ_NO_WLZDEFS
DEFAULT_GMAKE_FLAGS += ZDEFS_FLAG=
endif
ifdef MOZ_CFLAGS_NSS
NSS_XCFLAGS += $(filter-out -W%,$(CFLAGS))
DEFAULT_GMAKE_FLAGS += DARWIN_DYLIB_VERSIONS='-compatibility_version 1 -current_version 1 $(LDFLAGS)'
endif
ifeq (1_1,$(CLANG_CL)_$(MOZ_ASAN))
XLDFLAGS := $(OS_LDFLAGS)
DEFAULT_GMAKE_FLAGS += XLDFLAGS='$(XLDFLAGS)'
endif
DEFAULT_GMAKE_FLAGS += NSS_NO_PKCS11_BYPASS=1
# Put NSS headers directly under $(DIST)/include
DEFAULT_GMAKE_FLAGS += PUBLIC_EXPORT_DIR='$(ABS_DIST)/include/$$(MODULE)'
DEFAULT_GMAKE_FLAGS += SOURCE_XPHEADERS_DIR='$$(SOURCE_XP_DIR)/include/$$(MODULE)'
DEFAULT_GMAKE_FLAGS += MODULE_INCLUDES='$$(addprefix -I$$(SOURCE_XP_DIR)/include/,$$(REQUIRES))'
# Work around NSS's MAKE_OBJDIR being racy. See bug #836220
DEFAULT_GMAKE_FLAGS += MAKE_OBJDIR='$$(INSTALL) -D $$(OBJDIR)'
# Work around NSS adding IMPORT_LIBRARY to TARGETS with no rule for
# it, creating race conditions. See bug #836220
DEFAULT_GMAKE_FLAGS += TARGETS='$$(LIBRARY) $$(SHARED_LIBRARY) $$(PROGRAM)'
ifdef MOZ_FOLD_LIBS_FLAGS
NSS_XCFLAGS += $(MOZ_FOLD_LIBS_FLAGS)
endif
# Pass on the MSVC target arch from the main build system.
# Note this is case- and switch-character sensitive, while
# the MSVC option is not.
ifeq (WINNT,$(OS_TARGET))
NSS_XCFLAGS += $(filter -arch:%,$(CFLAGS))
endif
# Enable short header experiment. Firefox only.
NSS_XCFLAGS += -DNSS_ENABLE_TLS13_SHORT_HEADERS
# Export accumulated XCFLAGS to modify nss defaults.
DEFAULT_GMAKE_FLAGS += XCFLAGS='$(NSS_XCFLAGS)'
NSS_SRCDIR = $(topsrcdir)
NSS_DIRS =
ifndef MOZ_FOLD_LIBS
NSS_DIRS += nss/lib
else
ifndef NSS_DISABLE_DBM
NSS_DIRS += nss/lib/dbm
endif
endif
NSS_DIRS += \
nss/cmd/lib \
nss/cmd/shlibsign \
$(NULL)
ifdef ENABLE_TESTS
NSS_DIRS += \
nss/cmd/certutil \
nss/cmd/pk12util \
nss/cmd/modutil \
$(NULL)
endif
ifneq (,$(filter %--build-id,$(LDFLAGS)))
DEFAULT_GMAKE_ENV = LDFLAGS=-Wl,--build-id
endif
ifdef MOZ_FOLD_LIBS
# TODO: The following can be replaced by something simpler when bug 844880
# is fixed.
# All static libraries required for nss, smime, ssl and nssutil.
# The strip is needed to remove potential linefeed characters, since they hang
# around in some cases on Windows.
NSS_STATIC_LIBS := $(strip $(shell $(MAKE) --no-print-directory -f $(srcdir)/nss.mk DEPTH='$(DEPTH)' topsrcdir='$(topsrcdir)' srcdir='$(srcdir)' echo-variable-libs))
# Corresponding build directories
NSS_STATIC_DIRS := $(foreach lib,$(NSS_STATIC_LIBS),$(patsubst %/,%,$(dir $(lib))))
NSS_DIRS += $(NSS_STATIC_DIRS)
# TODO: The following can be replaced by something simpler when bug 844884
# is fixed.
# Remaining nss/lib directories
NSS_DIRS += nss/lib/freebl nss/lib/softoken nss/lib/jar nss/lib/crmf nss/lib/ckfw
DEFAULT_GMAKE_FLAGS += NSS_DISABLE_LIBPKIX=1
ifeq (WINNT,$(OS_TARGET))
NSS_DIRS += nss/lib/zlib
endif
endif # MOZ_FOLD_LIBS
# Filter-out $(LIBRARY_NAME) because it's already handled in config/rules.mk.
NSS_DIST_DLL_FILES := $(addprefix $(DIST)/lib/$(DLL_PREFIX),$(addsuffix $(DLL_SUFFIX),$(filter-out $(LIBRARY_NAME),$(NSS_DLLS)) $(NSS_EXTRA_DLLS)))
NSS_DIST_DLL_DEST := $(DIST)/bin
NSS_DIST_DLL_TARGET := target
INSTALL_TARGETS += NSS_DIST_DLL
ifeq ($(OS_ARCH)_$(1), SunOS_softokn3)
# has to use copy mode on Solaris, see #665509
$(DIST)/bin/$(DLL_PREFIX)softokn3$(DLL_SUFFIX): INSTALL := $(NSINSTALL) -t
endif
NSS_SDK_LIB_FILES := \
$(addprefix $(DIST)/lib/$(LIB_PREFIX),$(addsuffix .$(LIB_SUFFIX),$(SDK_LIBS))) \
$(addprefix $(DIST)/bin/$(DLL_PREFIX),$(addsuffix $(DLL_SUFFIX),$(NSS_DLLS))) \
$(NULL)
NSS_SDK_LIB_DEST := $(DIST)/sdk/lib
NSS_SDK_LIB_TARGET := target
INSTALL_TARGETS += NSS_SDK_LIB
ifdef MOZ_FOLD_LIBS
# Add all static libraries for nss, smime, ssl and nssutil
STATIC_LIBS += $(addprefix $(DEPTH)/security/,$(NSS_STATIC_LIBS))
IMPORT_LIB_FILES = $(IMPORT_LIBRARY)
IMPORT_LIB_DEST ?= $(DIST)/lib
IMPORT_LIB_TARGET = target
INSTALL_TARGETS += IMPORT_LIB
endif # MOZ_FOLD_LIBS
include $(topsrcdir)/config/rules.mk
ifeq (1,$(ALLOW_COMPILER_WARNINGS))
DEFAULT_GMAKE_FLAGS += NSS_ENABLE_WERROR=0
endif
# Can't pass this in DEFAULT_GMAKE_FLAGS because that overrides
# definitions in NSS, so just export it into the sub-make's environment.
ifeq (WINNT_1,$(OS_TARGET)_$(MOZ_MEMORY))
DLLFLAGS := -LIBPATH:$(ABS_DIST)/../mozglue/build -DEFAULTLIB:mozglue
export DLLFLAGS
endif
ifdef MOZ_FOLD_LIBS
# Force the linker to include everything from the static libraries.
EXPAND_LIBS_EXEC += --extract
$(SHARED_LIBRARY): $(addprefix $(DEPTH)/security/,$(NSS_STATIC_LIBS))
ifdef IMPORT_LIB_SUFFIX
IMPORT_PREFIX = $(LIB_PREFIX)
IMPORT_SUFFIX = .$(IMPORT_LIB_SUFFIX)
else
IMPORT_PREFIX = $(DLL_PREFIX)
IMPORT_SUFFIX = $(DLL_SUFFIX)
endif
NSPR_IMPORT_LIBS = $(addprefix $(DIST)/lib/$(IMPORT_PREFIX),$(addsuffix $(IMPORT_SUFFIX),nspr4 plc4 plds4))
SQLITE_IMPORT_LIB = $(DIST)/lib/$(IMPORT_PREFIX)mozsqlite3$(IMPORT_SUFFIX)
# TODO: The following can be replaced by something simpler when bug 844884
# is fixed.
# Associate target files with the rules that build them.
$(DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX): libs-nss/lib/crmf
$(DIST)/lib/$(DLL_PREFIX)freebl3$(DLL_SUFFIX): libs-nss/lib/freebl
$(DIST)/lib/$(DLL_PREFIX)nssckbi$(DLL_SUFFIX): libs-nss/lib/ckfw
$(DIST)/lib/$(DLL_PREFIX)softokn3$(DLL_SUFFIX): libs-nss/lib/softoken
$(DIST)/lib/$(DLL_PREFIX)nssdbm3$(DLL_SUFFIX): libs-nss/lib/softoken
$(foreach lib,$(NSS_STATIC_LIBS),$(eval $(DEPTH)/security/$(lib): libs-$(patsubst %/,%,$(dir $(lib)))))
# Create fake import libraries for the folded libraries, so that linking
# against them works both for the NSS build system (see dependencies below)
# and for the rest of the mozilla build system.
$(NSPR_IMPORT_LIBS) \
$(SQLITE_IMPORT_LIB) \
$(DIST)/lib/$(IMPORT_PREFIX)nssutil3$(IMPORT_SUFFIX) \
$(DIST)/lib/$(IMPORT_PREFIX)ssl3$(IMPORT_SUFFIX) \
$(DIST)/lib/$(IMPORT_PREFIX)smime3$(IMPORT_SUFFIX): $(DIST)/lib/$(IMPORT_PREFIX)nss3$(IMPORT_SUFFIX)
ifeq (WINNT,$(OS_TARGET))
cp $< $@
else
ln -sf $< $@
endif
# Interdependencies between nss sub-directories, and dependencies on NSPR/SQLite
libs-nss/lib/ckfw: libs-nss/lib/nss/../base $(NSPR_IMPORT_LIBS)
libs-nss/lib/softoken: $(NSPR_IMPORT_LIBS) $(SQLITE_IMPORT_LIB)
libs-nss/lib/softoken: libs-nss/lib/freebl
ifndef NSS_DISABLE_DBM
libs-nss/lib/softoken: libs-nss/lib/dbm
endif
libs-nss/lib/softoken: $(DIST)/lib/$(IMPORT_PREFIX)nssutil3$(IMPORT_SUFFIX)
libs-nss/lib/freebl: $(DIST)/lib/$(IMPORT_PREFIX)nssutil3$(IMPORT_SUFFIX) $(NSPR_IMPORT_LIBS)
# For each directory where we build static libraries, force the NSS build system
# to only build static libraries.
$(addprefix libs-,$(NSS_STATIC_DIRS)): DEFAULT_GMAKE_FLAGS += SHARED_LIBRARY= IMPORT_LIBRARY=
else
$(STATIC_LIBS) $(NSS_DIST_DLL_FILES) $(NSS_SDK_LIB_FILES): libs-nss/lib
endif # MOZ_FOLD_LIBS
ifeq ($(NSINSTALL_PY),$(NSINSTALL))
DEFAULT_GMAKE_FLAGS += PYTHON='$(PYTHON)'
DEFAULT_GMAKE_FLAGS += NSINSTALL_PY='$(abspath $(topsrcdir)/config/nsinstall.py)'
DEFAULT_GMAKE_FLAGS += NSINSTALL='$$(PYTHON) $$(NSINSTALL_PY)'
else
DEFAULT_GMAKE_FLAGS += NSINSTALL='$(abspath $(NSINSTALL))'
endif
ifeq ($(OS_ARCH),WINNT)
DEFAULT_GMAKE_FLAGS += INSTALL='$$(NSINSTALL) -t'
endif
DEFAULT_GMAKE_FLAGS += $(EXTRA_GMAKE_FLAGS)
$(addprefix libs-,$(NSS_DIRS)): libs-%:
# Work around NSS's export rule being racy when recursing for private_export
# See bug #836220.
$(addprefix export-,$(NSS_DIRS)): EXTRA_GMAKE_FLAGS = PRIVATE_EXPORTS=
$(addprefix export-,$(NSS_DIRS)): export-%: private_export-%
$(addprefix private_export-,$(NSS_DIRS)): EXTRA_GMAKE_FLAGS =
$(addprefix private_export-,$(NSS_DIRS)): private_export-%:
$(foreach p,libs export private_export,$(addprefix $(p)-,$(NSS_DIRS))):
$(DEFAULT_GMAKE_ENV) $(MAKE) -C $(NSS_SRCDIR)/security/$* $(@:-$*=) $(DEFAULT_GMAKE_FLAGS)
export:: $(addprefix export-,$(NSS_DIRS))
$(addprefix clean-,$(NSS_DIRS)): clean-%:
$(MAKE) -C $(NSS_SRCDIR)/security/$* $(DEFAULT_GMAKE_FLAGS) clean
clean clobber clobber_all realclean distclean depend:: $(addprefix clean-,$(NSS_DIRS))
NSS_CMD_TARGETS := $(addprefix libs-,$(filter-out nss/cmd/lib,$(filter nss/cmd/%,$(NSS_DIRS))))
target:: $(NSS_CMD_TARGETS)
ifdef MOZ_FOLD_LIBS
$(NSS_CMD_TARGETS): $(addprefix $(DIST)/lib/$(IMPORT_PREFIX),$(addsuffix $(IMPORT_SUFFIX),$(NSS_LIBS)))
libs-nss/cmd/modutil: libs-nss/lib/jar
ifeq (WINNT,$(OS_TARGET))
libs-nss/cmd/modutil: libs-nss/lib/zlib
endif
$(NSS_CMD_TARGETS): libs-nss/cmd/lib
else
$(NSS_CMD_TARGETS): libs-nss/lib libs-nss/cmd/lib
endif # MOZ_FOLD_LIBS
# Work around NSS build system race condition creating certdata.c in
# security/nss/lib/ckfw/builtins. See bug #836220.
libs-nss/lib$(if $(MOZ_FOLD_LIBS),/ckfw): $(call mkdir_deps,$(DEPTH)/security/nss/lib/ckfw/builtins)
-15
View File
@@ -1,15 +0,0 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
Library('crmf')
USE_LIBS += [
# The dependency on nss is not real, but is required to force the
# parent directory being built before this one. This has no
# practical effect on linkage, since the only thing linking crmf
# will need nss anyways.
'nss',
'static:/security/nss/lib/crmf/crmf',
]
-39
View File
@@ -1,39 +0,0 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DIRS += ['crmf']
if CONFIG['MOZ_FOLD_LIBS']:
GeckoSharedLibrary('nss', linkage=None)
# TODO: The library name can be changed when bug 845217 is fixed.
SHARED_LIBRARY_NAME = 'nss3'
SDK_LIBRARY = True
USE_LIBS += [
'nspr4',
'plc4',
'plds4',
]
OS_LIBS += CONFIG['REALTIME_LIBS']
SYMBOLS_FILE = 'nss.symbols'
else:
Library('nss')
USE_LIBS += [
'/security/nss/lib/nss/nss3',
'/security/nss/lib/smime/smime3',
'/security/nss/lib/ssl/ssl3',
'/security/nss/lib/util/nssutil3',
]
USE_LIBS += ['sqlite']
# XXX: We should fix these warnings.
ALLOW_COMPILER_WARNINGS = True
if CONFIG['NSS_EXTRA_SYMBOLS_FILE']:
DEFINES['NSS_EXTRA_SYMBOLS_FILE'] = CONFIG['NSS_EXTRA_SYMBOLS_FILE']
-27
View File
@@ -1,27 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/config.mk
dirs :=
define add_dirs
SHARED_LIBRARY_DIRS :=
include $(topsrcdir)/security/$(1)/config.mk
dirs += $$(addprefix $(1)/,$$(SHARED_LIBRARY_DIRS)) $(1)
endef
$(foreach dir,util nss ssl smime,$(eval $(call add_dirs,nss/lib/$(dir))))
libs :=
define add_lib
LIBRARY_NAME :=
include $(topsrcdir)/security/$(1)/manifest.mn
libs += $$(addprefix $(1)/,$(LIB_PREFIX)$$(LIBRARY_NAME).$(LIB_SUFFIX))
endef
$(foreach dir,$(dirs),$(eval $(call add_lib,$(dir))))
echo-variable-%:
@echo $($*)
-110
View File
@@ -1,110 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# /!\ Please make sure to update the following comment when you touch this
# file. Thank you /!\
# The traditional Mozilla build system relied on going through the entire
# build tree a number of times with different targets, and many of the
# things happening at each step required other things happening in previous
# steps without any documentation of those dependencies.
#
# This new build system tries to start afresh by establishing what files or
# operations are needed for the build, and applying the necessary rules to
# have those in place, relying on make dependencies to get them going.
#
# As of writing, only building non-compiled parts of Firefox is supported
# here (a few other things are also left out). This is a starting point, with
# the intent to grow this build system to make it more complete.
#
# This file contains rules and dependencies to get things working. The intent
# is for a Makefile to define some dependencies and variables, and include
# this file. What needs to be defined there, and ends up being generated by
# python/mozbuild/mozbuild/backend/fastermake.py is the following:
# - TOPSRCDIR/TOPOBJDIR, respectively the top source directory and the top
# object directory
# - PYTHON, the path to the python executable
# - ACDEFINES, which contains a set of -Dvar=name to be used during
# preprocessing
# - INSTALL_MANIFESTS, which defines the list of base directories handled
# by install manifests, see further below
#
# A convention used between this file and the Makefile including it is that
# global Make variables names are uppercase, while "local" Make variables
# applied to specific targets are lowercase.
# Targets to be triggered for a default build
default: $(addprefix install-,$(INSTALL_MANIFESTS))
ifndef NO_XPIDL
# Targets from the recursive make backend to be built for a default build
default: $(TOPOBJDIR)/config/makefiles/xpidl/xpidl
endif
# Mac builds require to copy things in dist/bin/*.app
# TODO: remove the MOZ_WIDGET_TOOLKIT and MOZ_BUILD_APP variables from
# faster/Makefile and python/mozbuild/mozbuild/test/backend/test_build.py
# when this is not required anymore.
# We however don't need to do this when using the hybrid
# FasterMake/RecursiveMake backend (FASTER_RECURSIVE_MAKE is set when
# recursing from the RecursiveMake backend)
ifndef FASTER_RECURSIVE_MAKE
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
default:
$(MAKE) -C $(TOPOBJDIR)/$(MOZ_BUILD_APP)/app repackage
endif
endif
.PHONY: FORCE
# Extra define to trigger some workarounds. We should strive to limit the
# use of those. As of writing the only ones are in
# toolkit/content/buildconfig.html and browser/locales/jar.mn.
ACDEFINES += -DBUILD_FASTER
# Files under the faster/ sub-directory, however, are not meant to use the
# fallback
$(TOPOBJDIR)/faster/%: ;
# Generic rule to fall back to the recursive make backend.
# This needs to stay after other $(TOPOBJDIR)/* rules because GNU Make
# <3.82 apply pattern rules in definition order, not stem length like
# modern GNU Make.
$(TOPOBJDIR)/%: FORCE
$(MAKE) -C $(dir $@) $(notdir $@)
# Install files using install manifests
#
# The list of base directories is given in INSTALL_MANIFESTS. The
# corresponding install manifests are named correspondingly, with forward
# slashes replaced with underscores, and prefixed with `install_`. That is,
# the install manifest for `dist/bin` would be `install_dist_bin`.
$(addprefix install-,$(INSTALL_MANIFESTS)): install-%: $(addprefix $(TOPOBJDIR)/,buildid.h source-repo.h)
@# For now, force preprocessed files to be reprocessed every time.
@# The overhead is not that big, and this avoids waiting for proper
@# support for defines tracking in process_install_manifest.
@touch install_$(subst /,_,$*)
@# BOOKMARKS_INCLUDE_DIR is for bookmarks.html only.
$(PYTHON) -m mozbuild.action.process_install_manifest \
--track install_$(subst /,_,$*).track \
$(TOPOBJDIR)/$* \
-DAB_CD=en-US \
-DBOOKMARKS_INCLUDE_DIR=$(TOPSRCDIR)/browser/locales/en-US/profile \
$(ACDEFINES) \
install_$(subst /,_,$*)
# ============================================================================
# Below is a set of additional dependencies and variables used to build things
# that are not supported by data in moz.build.
# The xpidl target in config/makefiles/xpidl requires the install manifest for
# dist/idl to have been processed. When using the hybrid
# FasterMake/RecursiveMake backend, this dependency is handled in the top-level
# Makefile.
ifndef FASTER_RECURSIVE_MAKE
$(TOPOBJDIR)/config/makefiles/xpidl/xpidl: $(TOPOBJDIR)/install-dist_idl
endif
# It also requires all the install manifests for dist/bin to have been processed
# because it adds interfaces.manifest references with buildlist.py.
$(TOPOBJDIR)/config/makefiles/xpidl/xpidl: $(addprefix install-,$(filter dist/bin%,$(INSTALL_MANIFESTS)))
+9 -3
View File
@@ -8,9 +8,7 @@
#ifndef mozilla_${HEADER}_h
#define mozilla_${HEADER}_h
// For some reason, Apple's GCC refuses to honor -fno-exceptions when
// compiling ObjC.
#if defined(__EXCEPTIONS) && __EXCEPTIONS && !(__OBJC__ && __GNUC__ && XP_IOS)
#if defined(__EXCEPTIONS) && __EXCEPTIONS
# error "STL code can only be used with -fno-exceptions"
#endif
@@ -32,6 +30,14 @@
# define moz_dont_include_mozalloc_for_cstdlib
#endif
#ifndef moz_dont_include_mozalloc_for_type_traits
# define moz_dont_include_mozalloc_for_type_traits
#endif
#ifndef moz_dont_include_mozalloc_for_limits
# define moz_dont_include_mozalloc_for_limits
#endif
// Include mozalloc after the STL header and all other headers it includes
// have been preprocessed.
#if !defined(MOZ_INCLUDE_MOZALLOC_H) && \
-159
View File
@@ -1,159 +0,0 @@
# -*- makefile -*-
# vim:set ts=8 sw=8 sts=8 noet:
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
ifndef INCLUDED_JAVA_BUILD_MK #{
ifdef JAVAFILES #{
GENERATED_DIRS += classes
export:: classes
classes: $(call mkdir_deps,classes)
endif #} JAVAFILES
default_bootclasspath_jars := \
$(ANDROID_SDK)/android.jar \
$(NULL)
default_classpath_jars := \
$(NULL)
# Turn a possibly empty list of JAR files into a Java classpath, like a.jar:b.jar.
# Arg 1: Possibly empty list of JAR files.
define classpath_template
$(subst $(NULL) ,:,$(strip $(1)))
endef
ifdef ANDROID_APK_NAME #{
$(if $(ANDROID_APK_PACKAGE),,$(error Missing ANDROID_APK_PACKAGE with ANDROID_APK_NAME))
android_res_dirs := $(or $(ANDROID_RES_DIRS),$(srcdir)/res)
_ANDROID_RES_FLAG := $(addprefix -S ,$(android_res_dirs))
_ANDROID_ASSETS_FLAG := $(if $(ANDROID_ASSETS_DIRS),$(addprefix -A ,$(ANDROID_ASSETS_DIRS)))
android_manifest := $(or $(ANDROID_MANIFEST_FILE),AndroidManifest.xml)
GENERATED_DIRS += classes generated
generated_r_java := generated/$(subst .,/,$(ANDROID_APK_PACKAGE))/R.java
classes.dex: $(call mkdir_deps,classes)
classes.dex: $(generated_r_java)
classes.dex: $(ANDROID_APK_NAME).ap_
classes.dex: $(default_classpath_jars) $(ANDROID_CLASSPATH_JARS)
classes.dex: $(default_bootclasspath_jars) $(ANDROID_BOOTCLASSPATH_JARS) $(ANDROID_EXTRA_JARS)
classes.dex: $(JAVAFILES)
$(JAVAC) $(JAVAC_FLAGS) -d classes $(filter %.java,$^) \
$(addprefix -bootclasspath ,$(call classpath_template,$(default_bootclasspath_jars) $(ANDROID_BOOTCLASSPATH_JARS))) \
$(addprefix -classpath ,$(call classpath_template,$(default_classpath_jars) $(ANDROID_CLASSPATH_JARS) $(ANDROID_EXTRA_JARS)))
$(DX) --dex --output=$@ classes $(ANDROID_EXTRA_JARS)
# R.java and $(ANDROID_APK_NAME).ap_ are both produced by aapt. To
# save an aapt invocation, we produce them both at the same time. The
# trailing semi-colon defines an empty recipe; defining no recipe at
# all causes Make to treat the target differently, in a way that
# defeats our dependencies.
$(generated_r_java): .aapt.deps ;
$(ANDROID_APK_NAME).ap_: .aapt.deps ;
# This uses the fact that Android resource directories list all
# resource files one subdirectory below the parent resource directory.
android_res_files := $(wildcard $(addsuffix /*,$(wildcard $(addsuffix /*,$(android_res_dirs)))))
# An extra package like org.example.app generates dependencies like:
# generated/org/example/app/R.java: .aapt.deps ;
# classes.dex: generated/org/example/app/R.java
# GARBAGE: generated/org/example/app/R.java
$(foreach extra_package,$(ANDROID_EXTRA_PACKAGES), \
$(eval generated/$(subst .,/,$(extra_package))/R.java: .aapt.deps ;) \
$(eval classes.dex: generated/$(subst .,/,$(extra_package))/R.java) \
$(eval GARBAGE: generated/$(subst .,/,$(extra_package))/R.java) \
)
# aapt flag -m: 'make package directories under location specified by -J'.
# The --extra-package list is colon separated.
.aapt.deps: $(android_manifest) $(android_res_files) $(wildcard $(ANDROID_ASSETS_DIRS))
@$(TOUCH) $@
$(AAPT) package -f -M $< -I $(ANDROID_SDK)/android.jar $(_ANDROID_RES_FLAG) $(_ANDROID_ASSETS_FLAG) \
--custom-package $(ANDROID_APK_PACKAGE) \
--non-constant-id \
--auto-add-overlay \
$(if $(ANDROID_EXTRA_PACKAGES),--extra-packages $(subst $(NULL) ,:,$(strip $(ANDROID_EXTRA_PACKAGES)))) \
$(if $(ANDROID_EXTRA_RES_DIRS),$(addprefix -S ,$(ANDROID_EXTRA_RES_DIRS))) \
-m \
-J ${@D}/generated \
-F $(ANDROID_APK_NAME).ap_
$(ANDROID_APK_NAME)-unsigned-unaligned.apk: $(ANDROID_APK_NAME).ap_ classes.dex
cp $< $@
$(ZIP) -0 $@ classes.dex
$(ANDROID_APK_NAME)-unaligned.apk: $(ANDROID_APK_NAME)-unsigned-unaligned.apk
cp $< $@
$(DEBUG_JARSIGNER) $@
$(ANDROID_APK_NAME).apk: $(ANDROID_APK_NAME)-unaligned.apk
$(ZIPALIGN) -f 4 $< $@
GARBAGE += \
$(generated_r_java) \
classes.dex \
$(ANDROID_APK_NAME).ap_ \
$(ANDROID_APK_NAME)-unsigned-unaligned.apk \
$(ANDROID_APK_NAME)-unaligned.apk \
$(ANDROID_APK_NAME).apk \
$(NULL)
# Include Android specific java flags, instead of what's in rules.mk.
include $(topsrcdir)/config/android-common.mk
endif #} ANDROID_APK_NAME
ifdef JAVA_JAR_TARGETS #{
# Arg 1: Output target name with .jar suffix, like jars/jarfile.jar.
# Intermediate class files are generated in jars/jarfile-classes.
# Arg 2: Java sources list. We use VPATH and $^ so sources can be
# relative to $(srcdir) or $(CURDIR).
# Arg 3: List of extra jars to link against. We do not use VPATH so
# jars must be relative to $(CURDIR).
# Arg 4: Additional JAVAC_FLAGS.
# Note: Proguard fails when stale .class files corresponding to
# removed inner classes are present in the object directory. These
# stale class files get packaged into the .jar file, which then gets
# processed by Proguard. To work around this, we always delete any
# existing jarfile-classes directory and start fresh.
define java_jar_template
$(1): $(2) $(3) $(default_bootclasspath_jars) $(default_classpath_jars)
$$(REPORT_BUILD)
@$$(RM) -rf $(1:.jar=)-classes
@$$(NSINSTALL) -D $(1:.jar=)-classes
@$$(if $$(filter-out .,$$(@D)),$$(NSINSTALL) -D $$(@D))
$$(JAVAC) $$(JAVAC_FLAGS)\
$(4)\
-d $(1:.jar=)-classes\
$(addprefix -bootclasspath ,$(call classpath_template,$(default_bootclasspath_jars)))\
$(addprefix -classpath ,$(call classpath_template,$(default_classpath_jars) $(3)))\
$$(filter %.java,$$^)
$$(JAR) cMf $$@ -C $(1:.jar=)-classes .
GARBAGE += $(1)
GARBAGE_DIRS += $(1:.jar=)-classes
endef
$(foreach jar,$(JAVA_JAR_TARGETS),\
$(if $($(jar)_DEST),,$(error Missing $(jar)_DEST))\
$(if $($(jar)_JAVAFILES) $($(jar)_PP_JAVAFILES),,$(error Must provide at least one of $(jar)_JAVAFILES and $(jar)_PP_JAVAFILES))\
$(eval $(call java_jar_template,$($(jar)_DEST),$($(jar)_JAVAFILES) $($(jar)_PP_JAVAFILES),$($(jar)_EXTRA_JARS),$($(jar)_JAVAC_FLAGS)))\
)
endif #} JAVA_JAR_TARGETS
INCLUDED_JAVA_BUILD_MK := 1
endif #} INCLUDED_JAVA_BUILD_MK
Loaded 100 of 33444 files, more files were not shown because too many files have changed in this diff. Show more