Compare commits

...
Author SHA1 Message Date
Moonchild 53bf5b5a21 Bump NSS (UXP) patch level. 2026-07-28 15:51:54 +02:00
John Schanck 07b2881965 Bug 2043887 - guard against integer overflow in CERT_Hexify. 2026-07-28 15:51:45 +02:00
Benjamin Beurdouche ca1b7c2595 Bug 2027353 - clamp input.len to testString size in pk11_mergeSecretKey. 2026-07-28 15:51:41 +02:00
Benjamin Beurdouche a0d8eeb768 Bug 2029433 - Bounds-check wrap index in PK11_GetWrapKey to match PK11_SetWrapKey. 2026-07-28 15:51:34 +02:00
Anna Weine 278ce9a272 Bug 2028954 - CERT_DecodeAVAValue — Integer Overflow in Output Buffer Sizing. 2026-07-28 15:51:29 +02:00
Moonchild 9367b64f2a Bug 2027364 - Set tail pointer to null in static slot lists when deallocating. 2026-07-28 15:51:24 +02:00
John Schanck 080247cf2f Bug 2032110 - fix two integer overflows on LLP64 systems. 2026-07-28 15:51:19 +02:00
John Schanck 95bf9478c7 Bug 2030102 - avoid leaving a dangling ss->sec.ci.sid on allocation failure. 2026-07-28 15:51:13 +02:00
Maurice Dauer 4ae3149d2e Bug 2027325 - Reject empty nickname in PK11_TraverseCertsForNicknameInSlot. 2026-07-28 15:51:08 +02:00
Moonchild 9bf01636f1 Bug 2030563 - Validate CKA_CERTIFICATE_TYPE ulValueLen in nss_cert_type_from_ck_attrib. 2026-07-28 15:51:03 +02:00
Benjamin Beurdouche e48fe8e307 Bug 2029807 - Guard padding read against empty output in SEC_PKCS7DecryptContents. 2026-07-28 15:50:56 +02:00
Benjamin Beurdouche 27c12ad698 Bug 2027346 - validate encoded EC params length and tag in SECKEY_ECParamsToKeySize/BasePointOrderLen. 2026-07-28 15:50:51 +02:00
Benjamin Beurdouche 612ddb64e5 Bug 2027371 - rewrite labelLen bound in tls13_HkdfExpandLabelGeneral to avoid unsigned overflow. 2026-07-28 15:50:46 +02:00
Benjamin Beurdouche c6c8421a2a Bug 2027373 - guard space subtraction in ssl_CallCustomExtensionSenders. 2026-07-28 15:50:41 +02:00
Benjamin Beurdouche f9859d226c Bug 2029901 - Guard against keySize overflow in IKE PRF/PRF+ output sizing. 2026-07-28 15:50:36 +02:00
Benjamin Beurdouche 7c0e60c4f1 Bug 2027362 - bound usageCount in PK11_UnwrapPrivKey to keyTemplate capacity. 2026-07-28 15:50:27 +02:00
Benjamin Beurdouche e06ef010c4 Bug 2027349 - reject empty nickname in PK11_TraverseCertsForNicknameInSlot. 2026-07-28 15:50:20 +02:00
Moonchild 3935cd9ed3 [network] Fix CacheEntry::mDoomCallback data race. 2026-07-28 15:49:52 +02:00
Moonchild f781824676 [layout] Fix nsFrameSetFrame primary frame handling of replicated children. 2026-07-28 15:49:40 +02:00
Moonchild 5a231d5bf9 [DOM media] Perform more thorough checks on video regions. 2026-07-28 15:49:19 +02:00
az 02302031dd Bug 2045742 2026-07-28 15:49:11 +02:00
Andrew McCreight b59b350424 Bug 2049523 - Make ToJSValue for float consistent with double. 2026-07-28 15:48:56 +02:00
Moonchild 99b8669d0a Fix comment (nit) 2026-07-28 15:48:49 +02:00
Randell Jesup 919fbff2ec Bug 2029734: Flush before calling sctp_process_init() 2026-07-28 15:48:10 +02:00
Moonchild 4977713834 [image] Make sure the image was fully and cleanly decoded before finalizing its animation state as complete. 2026-07-28 15:48:01 +02:00
Moonchild 1f8bd8cf45 [parser] Associate image elements with form only if the form and the intended parent are in the same tree. 2026-07-28 15:47:55 +02:00
Moonchild 8f6bacf33e [DOM media] Stop accepting audio samples with too low sample rates.
This sets the floor to 8kHz audio, which is generally considered to be
the lowest acceptable "phone quality"/"walkie-talkie" audio rate.
Audio outside the range will refuse to decode after this commit and give
a console error.
This avoids a whole class of potential bugs.
2026-07-28 15:47:27 +02:00
Moonchild a79a1b55a1 [layout] Add corner-case correctness check in DottedCornerFinder::FindBestOverlap. 2026-07-28 15:47:21 +02:00
Moonchild fa4d389b91 [network] Add usrsctp TSN gap check. 2026-07-28 15:47:08 +02:00
Moonchild 36b884ff7f [js] Clamp length of regexp captures array for dollar substitution. 2026-07-28 15:46:52 +02:00
Moonchild f3a7e60608 [js] Initialize BaselineFrame return value slot in OnLeaveBaselineFrame. 2026-07-28 15:46:45 +02:00
Moonchild a8405c5667 [DOM] Make parser update form owner properly 2026-07-28 15:46:39 +02:00
Moonchild 829354fb65 [gfx] Hold a strong ref during GetFontAt lookup. 2026-07-28 15:46:33 +02:00
Moonchild 4be7883908 [gfx] Add bounds checks and limit reverse scanning of ligature data. 2026-07-28 15:46:27 +02:00
Moonchild 2f77b246b3 No issue - Use strnlen instead of strnlen_s.
Apparently, GCC doesn't like the _s variants.
2026-07-28 15:46:08 +02:00
Moonchild ddf950f5ed [js] Guard against OOB string sizes in internal Printf 2026-07-28 15:45:28 +02:00
Basilisk-Dev ad98fe5130 Issue #3140 - implement URL.parse() 2026-07-14 23:08:55 +02:00
Moonchild 659c690d5b Issue #3129 - Add palette_neon_intrinsics.c to moz.build 2026-06-23 08:11:16 +02:00
Moonchild f1dc542b0b Issue #3122 - Put base paths in the json viewer client deps.
The dependency modules are requested early. Seems CSP can block baseURL
on these networking requests, so add the base manually to the resource
paths to prevent network requests before the html base element is
resolved and active.
2026-06-22 18:54:00 +02:00
Moonchild 0c5437c80b Apply (hopefully for the last time before 2.0.x) APNG support code.
This commit also removes MOZCHANGES (old and irrelevant information)
This commit also adds a new readme.
2026-06-21 14:23:55 +02:00
Moonchild db9881b854 Fresh import of libpng 1.6.58 2026-06-21 14:23:47 +02:00
Moonchild c5a37cad2e Bump NSS version for adopted changes. 2026-06-21 14:23:40 +02:00
Moonchild dd97244289 [DOM] Clean up WebGL transform feedback validation. 2026-06-21 14:23:07 +02:00
John Schanck 5372fed15c Bug 2030564 - add defensive input validation to sftk_compute_ANSI_X9_63_kdf. 2026-06-21 14:22:56 +02:00
John Schanck 37a8909357 Bug 2030366 - avoid race with module unloading in NSSTrustDomain_FindTokensByURI. 2026-06-21 14:22:48 +02:00
John Schanck 18f4069d8d Bug 2029403 - avoid PORT_Strdup in ssl_DecodeResumptionToken. 2026-06-21 14:22:27 +02:00
Julian Descottes 78c01f1b3f [devtools] Consistently show filepicker on first save action from StyleEditor.
Bug 2038133
2026-06-21 14:22:18 +02:00
Moonchild f946c969a2 Issue #3127 - Add trademark notice to the tree.
Resolves #3127
2026-06-21 14:22:11 +02:00
Moonchild 2dfa2b7c19 [network] Make HttpBaseChannel::mLoadFlags atomic. 2026-06-21 14:21:44 +02:00
Moonchild 8b88dd736a [gfx] Check more offsets during CFF subsetting.
Also fixes a bunch of whitespace (TAB -> spaces)
2026-06-21 14:21:33 +02:00
Moonchild b9fd964fec [DOM] Avoid over-optimizing some getter/function calls. 2026-06-21 14:21:25 +02:00
Moonchild 9c74a819e4 [parser] Better align with spec definition of adding nodes. 2026-06-21 14:21:18 +02:00
Moonchild f700453cb1 No issue - Use ImmGCPtr for module meta data visits.
This should make module GCs less touchy.
2026-06-21 14:20:42 +02:00
Moonchild 4ea0375575 [DOM media] Zero-initialize ThreadSharedFloatArrayBufferList. 2026-06-21 14:20:33 +02:00
Kui-Feng Lee 7071894a52 Bug 2033848 - Use non-default response ID for GTK file picker accept button. r=stransky
Replace GTK_RESPONSE_ACCEPT (-3) with a non-negative application-defined
response ID (kFilePickerAccept = 0) for the accept button in the GTK file
chooser dialog, and remove the gtk_dialog_set_default_response() call.

GTK treats buttons with negative built-in response IDs as candidates for
the dialog's default widget, which activates on Enter key press. By using
a non-negative ID and not calling set_default_response(), the accept button
is no longer pre-selected, preventing a page from tricking the user into
confirming a file upload by holding Enter before the dialog appears.

GTK's file chooser internally emits GTK_RESPONSE_ACCEPT via file_activated_cb
when the user double-clicks a file, so we keep that case in DoneNonPortal()
alongside kFilePickerAccept.
2026-06-21 14:20:22 +02:00
John Schanck 0f471cfde7 Bug 2023478 - improve handling of escape sequences in pk11uri_ParseAttributes. 2026-06-21 14:20:15 +02:00
Moonchild a8cc198e79 [DOM] Reject too large mLength in MutableBlobStorage::WriteRunnable. 2026-06-21 14:20:09 +02:00
John Schanck 477b1010fe Bug 2030570 - use correct data for ID comparison in transfer_uri_certs_to_collection. 2026-06-21 14:20:02 +02:00
Moonchild 8722bc3693 [network] Make keep-alive pref Atomic. 2026-06-21 14:19:53 +02:00
John Schanck e31e3802a0 Bug 2029765 - avoid refcount over-release in nssTokenObjectCache error path [@ nssToken_Destroy]. 2026-06-21 14:19:46 +02:00
Nicolas B. Pierron 723d95295e Bug 2029066 - Remove Sinking of Live instructions.
Instruction sinking was made possible by the introduction of recover
instructions, which are moving instructions to be executed on bailout, but this
is only possible for instructions which are not used.

This feature, which is now removed, was made to sink instructions which are
live, but only in a small set of branches, by moving the computation of these
instructions to bailout paths, and to the concerned if branches.

The current implementation never delivered and remained as dead-code for
multiple years, without having a firm benefit on performance oriented
benchmarks.

Thus, this change removes the part of the Sink optimization which deals with
live instructions but keeps the part of the Sink optimization which deals with
instructions which are only used on bailout paths.
2026-06-21 14:19:37 +02:00
John Schanck 91b3b6fdc8 Bug 2029803 - add defensive info->len check in PK11_HPKE_SetupS and PK11_HPKE_SetupR. 2026-06-21 14:19:18 +02:00
Moonchild 34a901430d Issue #3122 - Exclude local resources from <base> CSP checks.
This avoids local-resource <base> URLs being restricted/nullified by
remote CSP. This aligns the CSP handling with direct requests.

Resolves #3122
2026-06-14 10:52:53 +02:00
Moonchild 83826f1f34 Issue #3111 - Clean up logic in SweepFinalizationRegistries.
Resolves #3111
2026-06-09 18:07:37 +02:00
Moonchild 3562ba1235 [DOM] Provide more silent audio processing frames. 2026-06-05 12:39:58 +02:00
Moonchild 1cc002018f Revert "Bug 2027433 Treat null input channels as zero in InterleaveAndConvertBuffer()"
This reverts commit e76fc5637a.
2026-06-05 11:38:27 +02:00
Moonchild 352863cab4 Revert "Bug 2027433 Treat null input channels as zero in AudioChannelsDownMix()"
This reverts commit ddd016a6f8.
2026-06-05 11:38:22 +02:00
Moonchild d69570b62b Revert "Bug 2027433 use nullptr for silent up-mix channels"
This reverts commit 5309640d6c.
2026-06-05 11:38:14 +02:00
Moonchild 26c44d4869 Issue #3109 - Use CSS' internal length clamp value instead. 2026-05-30 10:44:40 +02:00
Moonchild f10fc4489c Issue #3109 - Clamp border-radius value to Int32.MaxValue
This avoids artifacts from out-of-bounds values.
Resolves #3109
2026-05-30 10:44:32 +02:00
Moonchild 3450ed2282 Merge branch 'master' into release 2026-05-26 14:16:41 +02:00
Moonchild a0f135b94f NSS version update 2026-05-26 14:16:25 +02:00
Moonchild 967e985c5f Merge branch 'master' into release 2026-05-26 09:32:40 +02:00
Moonchild 3be679effc [DOM] Stop speech synthesis if the originating document is closed. 2026-05-25 20:32:10 +02:00
Moonchild 2d91c80555 [media] ffvpx patch: Fix leak in flac decoder in case of alloc failure. 2026-05-25 19:10:46 +02:00
Moonchild e5326c1d74 [DOM] Hold a strong ref to VoiceData in nsSynthVoiceRegistry::RemoveVoice. 2026-05-25 18:56:57 +02:00
Jens Stutte 5ddccdc7f6 Bug 1784128 - Assert count passed to PR_Read/PR_Write in nsFileStreamBase fits INT32_MAX. 2026-05-25 15:44:51 +02:00
Moonchild 8dc41b293a [gfx/layout] Simplify textruns
Cache overflow textruns in a better place and stop using a lazy class.
This avoids doing caching in the rendering back-end, and does so where
necessary in TextOverflow (for ellipses)
2026-05-25 14:59:51 +02:00
Moonchild f02956a324 No issue - Remove ISO-2022-JP from menu, overridability and detector.
Removed autodetection of this charset due to unreliability.
There are known security issues around charset auto-detection for ISO-2022-JP.
Given the usage is around 0.000002% of page loads, and Safari does not
support auto-detection of ISO-2022-JP, Chrome also planned to remove
support for it to eliminate the security issues.

See also https://www.sonarsource.com/blog/encoding-differentials-why-charset-matters/

Removal from the menu to avoid social engineering hazards and it being
literally unused on the web.
2026-05-25 13:08:29 +02:00
Moonchild e3646af419 [libvorbis] Allocate memory with _ogg_malloc
See https://gitlab.xiph.org/xiph/vorbis/-/commit/28965ede851bb9c1ce5cc0ed733fdf4ebd3d4241 and related commits.
2026-05-25 11:44:16 +02:00
Moonchild ee1f2e31a1 [layout] Hide accessible carets when needed. 2026-05-25 11:23:05 +02:00
Moonchild dcb90d6f92 [DOM] Check values in audio resampling. 2026-05-25 10:57:18 +02:00
John Schanck f9cdc54e09 Bug 2029818 - avoid refcount over-release in CERT_CertChainFromCert error path. 2026-05-25 10:22:44 +02:00
Moonchild 28be7ae6e0 [NSS] Fix use of uninitialized length after failed PK11_SignWithMechanism/SymKey. 2026-05-25 07:27:51 +02:00
Moonchild 463e7ec3c6 Force Clobber 2026-05-25 06:44:48 +02:00
John Schanck 531eeaabaa [NSS] Fix maxSize calculation in NSSUTIL_AddNSSFlagToModuleSpec. 2026-05-25 06:43:53 +02:00
Moonchild d6915b9014 Merge branch 'master' into release 2026-05-25 06:08:13 +02:00
Moonchild af92afbd6c Merge pull request 'Revert all Issue #3092 Commits' (#3107) from Basilisk-Dev/UXP-contrib:revert-3092 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3107
2026-05-25 04:05:41 +00:00
John Schanck 5005a47921 Bug 2027381 - improve error handling in SECITEM_DupArray with non-null arena. 2026-05-24 22:30:38 +02:00
Basilisk-Dev 72d4ca2b35 Clean up Issue #3092 revert whitespace 2026-05-24 16:19:36 -04:00
Basilisk-Dev b8951dbc2a Revert "Issue #3092 - Fix unsafe GC multithreading changes"
This reverts commit 2ca5d21147.

The mechanical inverse patch would restore earlier Issue #3092 parallel GC code that has already been removed by the preceding revert commits, so this records the revert without changing the tree.
2026-05-24 16:18:45 -04:00
Basilisk-Dev 20c92e63c5 Revert "Issue #3092 - Safely parallelize GC background finalization"
This reverts commit 3cf7c94995.
2026-05-24 16:13:21 -04:00
Moonchild ea785c3bb0 [netwerk] Make socket transport hold a reference to TLSServerConnectionInfo. 2026-05-24 21:48:55 +02:00
Randell Jesup 7abc11b3d1 Bug 2036905: Fix UDPSocketParent::ConnectInternal data race on mSocket. 2026-05-24 21:22:57 +02:00
Moonchild 2a4c4687c6 [netwerk] Make nsSocketTransport2::mConnectionFlags atomic. 2026-05-24 21:10:00 +02:00
Basilisk-Dev de3970d9b4 Revert "Issue #3092 - Refactor WASM compilation handling"
This reverts commit 1c09cd7816.
2026-05-24 14:58:21 -04:00
Basilisk-Dev 4da8c1fe4c Revert "Issue #3092 - Add new GC sweep tasks."
This reverts commit 8b6414ea7c.
2026-05-24 14:57:38 -04:00
Basilisk-Dev 8230f9b359 Revert "Issue #3092 - Implement BackgroundFinalizeTask for parallel garbage collection finalization"
This reverts commit 8ca5438db9.
2026-05-24 14:57:38 -04:00
Basilisk-Dev 310fec9ad5 Revert "Issue #3092 - Implement parallel sweeping and compaction tasks"
This reverts commit f33ccb5ce3.
2026-05-24 14:55:47 -04:00
Basilisk-Dev 5f2040153b Revert "Issue #3092 - Initial idle GC implementation"
This reverts commit fba218cff4.
2026-05-24 14:54:58 -04:00
Basilisk-Dev 30a774eb08 Revert "Issue #3092 - Perform a minor GC on tab close"
This reverts commit 266cc371f7.
2026-05-24 14:53:56 -04:00
Moonchild e8ee09b41f Merge pull request 'Implement CSSStyleSheet constructor' (#3103) from Basilisk-Dev/UXP-contrib:cssstylesheet-updates into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3103
2026-05-24 18:36:53 +00:00
Moonchild 5fc626f0fc [netwerk] nsRequestObserverProxy ref cleanup. 2026-05-24 19:40:23 +02:00
John Schanck c87c0e440b Bug 2029782 - fix 8-byte over-read of AES-192 key buffer in x86 builds without USE_HW_AES. 2026-05-24 15:10:06 +02:00
John Schanck 39b34ed8c5 Bug 2029771 - Heap use-after-free in [@ token_destructor] reading tok->pk11slot after nssToken_Destroy frees the token arena. 2026-05-24 15:07:24 +02:00
John Schanck e6b4a84e7e [NSS] Avoid integer overflow when converting AVA value to hex string. 2026-05-24 15:03:12 +02:00
John Schanck f7dfc278c4 [NSS] Enforce minimum buffer length in sftk_CheckCBCPadding. 2026-05-24 14:58:53 +02:00
Dana Keeler 13349f484c [NSS] VerifyCodeSigningCertificateChain: require at least one certificate. 2026-05-24 14:40:56 +02:00
Moonchild bd2670e006 [NSS] Initialize src in SEC_PKCS5GetIV 2026-05-24 14:37:06 +02:00
Dana Keeler e5bebae2c7 [NSS] NSS_CMSContentInfo_SetContent: only modify cinfo if everything succeeds. 2026-05-24 12:03:33 +02:00
Dennis Jackson d93df7216d [NSS] Align PKCS7 digest array with digestAlgorithms. 2026-05-24 11:50:38 +02:00
Moonchild 3d0a6899ce [libjar] Check Jar entry names for nulls. 2026-05-24 10:51:21 +02:00
John Schanck fdde68855b [NSS] Handle SEC_ASN1_NULL in sec_asn1e_contents_length. 2026-05-24 10:16:24 +02:00
Moonchild 304e6d045d Merge branch 'master' into release
# Conflicts:
#	dom/media/webm/WebMDemuxer.cpp
2026-05-24 10:11:40 +02:00
Moonchild 2d038e6c1a [NSS] Fix instances of softoken attributes freed after owning object. 2026-05-24 10:09:28 +02:00
Moonchild c10f8a567b Merge branch 'master' of https://repo.palemoon.org/MoonchildProductions/UXP 2026-05-24 09:10:39 +02:00
Moonchild dcfa35e1ff Merge pull request 'Restore libAOM to the tree and making it a build-time configuration.' (#3104) from 888-32-bit-work2 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3104
2026-05-24 07:09:19 +00:00
Iain Ireland de1a7f5fe1 [js] Use size_t when inflating UTF8 2026-05-24 09:08:03 +02:00
Basilisk-Dev 34d88ac937 Issue #3053 - Implement CSSStyleSheet constructor 2026-05-23 16:45:54 -04:00
Moonchild 39a89b708e Issue #888 - Fix makefile configure syntax for x86 check.
Not sure what language I was thinking but it was the wrong one. :P
2026-05-23 14:02:04 +02:00
Moonchild 69ad4f1674 Fix line endings in WebmDemuxer.cpp
No code changes.
2026-05-23 13:42:03 +02:00
Moonchild 59ae55a0e2 Issue #888 - Back out changes to the Dav1d lib. 2026-05-23 12:46:23 +02:00
Moonchild 6eb551332e Issue #888 - Hook libAOM back up, and make it configurable at build time.
Since the Dav1d changes will be reverted in the next commit, this also
includes a test for 32-bit x86 targets which makes libAOM mandatory.
2026-05-23 12:44:12 +02:00
Moonchild 96be1bb7a0 Revert "Issue #888 - Remove bundled libaom"
This reverts commit eb487c2ca1.
2026-05-23 10:26:43 +02:00
Moonchild 4dc3b6db93 Merge pull request 'Follow up on Dav1d implementation for 32-bit targets' (#3100) from 888-32bit into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3100
2026-05-23 07:37:32 +00:00
Moonchild a1da555b51 Issue #888 - Follow-up: Put smooth_weights_{1|2}d_16bpc back in ipred16 sources.
This reverts commit 16212905de and places
the SMOOTH_WEIGHTS in the SSE source instead, since that is always included.
2026-05-22 12:15:20 +02:00
Moonchild c1abc2eb3e Merge pull request 'ffvpx: Configuration for NetBSD/powerpc' (#3101) from nia/UXP:ffvpx-ppc into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3101
2026-05-22 08:14:01 +00:00
nia f0acda0bf4 ffvpx: Configuration for NetBSD/powerpc
Signed-off-by: Nia Alarie <nia@NetBSD.org>
2026-05-21 17:10:41 +02:00
Moonchild 16212905de Issue #888 - Follow-up: Lift smooth_weights_{1|2}d_16bpc out of AVX source.
This lifts the 2 functions out of the AVX-specific source (since it's
also used in the SSE one as external) and places it in the common x86
include.

This is an upstream code placement error; should be reported upstream.
2026-05-21 13:38:47 +02:00
Moonchild 2eb5e91b62 Issue #888 - Follow-up: don't assemble AVX into Dav1d on 32-bit x86 2026-05-21 13:34:47 +02:00
Moonchild fa6b67c8ac Re-land: Fix devtools on 32-bit big endian platforms
Tag PR #3098
2026-05-21 09:42:07 +02:00
Moonchild 6a117bd9d1 Revert "Fix dev tools on 32-bit big endian platforms"
This reverts commit f363ec1838.
2026-05-20 16:18:09 +02:00
Moonchild 714c709ad0 Merge pull request 'Add NetBSD to list of platforms where mapfile gets generated' (#3099) from nia/UXP:mapfile into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3099
2026-05-20 10:47:37 +00:00
Moonchild eafc230ff2 Merge pull request 'A collection of random fixes I've been accumulating.' (#3097) from dbsoft/UXP:miscfixes4 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3097
2026-05-20 10:46:57 +00:00
Moonchild 523a9aa2de Merge pull request 'Split loongarch jit so it no longer uses any mips files' (#3096) from Basilisk-Dev/UXP-contrib:loongarch-fix-jit into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3096
2026-05-20 10:46:19 +00:00
Moonchild ec92c29029 Merge pull request 'Fix dev tools on 32-bit big endian platforms' (#3098) from nia/UXP:devtools-lp32 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3098
2026-05-20 10:45:41 +00:00
nia 4a9d702bc1 Add NetBSD to list of platforms where mapfile gets generated
Signed-off-by: Nia Alarie <nia@NetBSD.org>
2026-05-20 10:26:38 +02:00
nia f363ec1838 Fix dev tools on 32-bit big endian platforms
This resolves a crash when pressing F12.

The __LP64__ macro is relied upon elsewhere in UXP so I think
this change should be safe.

Signed-off-by: Nia Alarie <nia@NetBSD.org>
2026-05-20 10:05:48 +02:00
Basilisk-Dev ffb3a95eb9 Issue #3095 - split loongarch jit so it no longer uses any mips files 2026-05-19 15:43:21 -04:00
Moonchild 63094adef4 Merge pull request 'Fix build on NetBSD/aarch64' (#3094) from nia/UXP:netbsd-aarch64 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3094
2026-05-19 15:50:04 +00:00
nia 1f8dcf74c8 Fix build on NetBSD/aarch64
Signed-off-by: Nia Alarie <nia@NetBSD.org>
2026-05-19 09:28:23 +02:00
Moonchild f20c549f66 Issue #888 - Follow-up: Spot-fix; set PREFIX in Dav1d config on Apple. 2026-05-19 09:02:10 +02:00
Brian Smith b62cccda62 Issue #1829 - Follow-up: Fix package name check for 32-bit Intel. 2026-05-18 08:51:11 -05:00
Brian Smith 43f3b3c7ee Issue #1829 - Follow-up: Fix version check for CoreLocation on 10.5 and earlier. 2026-05-18 08:51:11 -05:00
Brian Smith a328464912 Issue #1829 - Follow-up: Remove obsolete font code from Cairo.
This code only gets built on 32-bit MacOS, and it isn't used.
This allows Intel 32-bit MacOS builds to succeed.
2026-05-18 08:51:11 -05:00
Brian Smith 977ddd9e81 No Issue - Fix font crash on MacOS 10.7-10.11 using fonts with variations.
Switch to MacOS version guard's instead of PowerPC guards, for Intel support.
Remove inactive debug code.
2026-05-18 08:51:11 -05:00
Brian Smith 67717762f9 Issue #2051 - Follow-up: Fix CSS image masks on PowerPC Mac.
When I brought back CoreGraphics backend I brought back a fix for this.
However the fix was designed for Intel which uses Skia as a backend.
Our Skia does not support big endian, so change it to use Cairo backend.
2026-05-18 08:51:11 -05:00
Brian Smith a33f6857fd Issue #2354 - Follow-up: Fix building WebRTC on 32-bit ARM without hardware float. 2026-05-18 08:51:11 -05:00
Brian Smith 5c7c192df1 No Issue - Fix cubeb compilation targeting MacOS 10.5 from newer versions.
Remove obsolete iOS checks.
2026-05-18 08:51:11 -05:00
Basilisk-Dev 0186e78221 Fix WeakRef constructor realm prototype 2026-05-18 13:05:28 +02:00
Basilisk-Dev e9e858348b Fix FinalizationRegistry constructor realm prototype 2026-05-18 13:05:21 +02:00
Basilisk-Dev 631bb15b05 Implement FinalizationRegistry 2026-05-18 13:05:15 +02:00
Basilisk-Dev e7d6301c75 Make WeakRef support always enabled 2026-05-18 12:52:09 +02:00
Moonchild 22001fbca3 Fix incorrect variadic for size_t in fprintf statement in hyphen.c. 2026-05-18 12:41:20 +02:00
Basilisk-Dev 22e3028d56 Fix ArrayBuffer storage and error types 2026-05-18 12:31:46 +02:00
Basilisk-Dev 9498ce3f1e Fix ArrayBuffer slice after resizable source shrink 2026-05-18 12:31:40 +02:00
Basilisk-Dev 172c7b6f25 Validate typed array set and constructors on resizable buffers 2026-05-18 12:31:35 +02:00
Basilisk-Dev 750ef67831 Validate typed array methods on resizable buffers 2026-05-18 12:31:29 +02:00
Basilisk-Dev c19a39c4a5 Fix resizable DataView out-of-bounds semantics 2026-05-18 12:31:24 +02:00
Basilisk-Dev d6bfeeaf1a Support BigInt Atomics waiters 2026-05-18 12:31:17 +02:00
Basilisk-Dev e7ea20c073 Support DataView on shared array buffers 2026-05-18 12:31:11 +02:00
Basilisk-Dev a7e01b3f77 Guard typed array JIT paths for resizable buffers 2026-05-18 12:31:06 +02:00
Basilisk-Dev c3a541c55a Implement resizable buffer view semantics 2026-05-18 12:30:59 +02:00
Basilisk-Dev 41efdfd488 Implement Atomics.waitAsync 2026-05-18 12:30:52 +02:00
Basilisk-Dev 7d41d2a47c Implement growable SharedArrayBuffer 2026-05-18 12:30:46 +02:00
Basilisk-Dev ec951c592a Allow symbols as weak collection keys 2026-05-18 12:30:39 +02:00
Basilisk-Dev 829fd431e2 Implement ES2024 ArrayBuffer transfer APIs 2026-05-18 12:30:33 +02:00
Basilisk-Dev 9b7d25d1fd Implement ES2024 grouping and resolver builtins 2026-05-18 12:30:28 +02:00
Basilisk-Dev 1ab3e82a4d Fix JS shell module hook build 2026-05-18 12:30:22 +02:00
Moonchild b07102b821 Merge pull request 'Paralellize GC and implement GC-on-Idle' (#3093) from 3092 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3093
2026-05-18 10:28:10 +00:00
Moonchild 3adf3917ee Merge pull request 'Port various code changes from eUXP that should have been upstreamed' (#3091) from eUXP_ports2 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3091
2026-05-18 10:27:54 +00:00
Moonchild bbaf41e032 Merge pull request 'Truncate fractional border calculations to integers with special handling' (#3090) from 3088 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3090
2026-05-18 10:26:16 +00:00
Moonchild 618c017249 Merge pull request 'Replace libAOM reference AV1 implementation with Dav1d' (#3087) from dav1d-work into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3087
2026-05-18 10:25:52 +00:00
Basilisk-Dev 3cf7c94995 Issue #3092 - Safely parallelize GC background finalization
Parallelize background finalization across zones within each finalize
phase while preserving phase ordering and falling back to serial work
when no helper thread is idle.

Make compacting GC pointer updates schedule background work per zone and
only when enough background-safe arenas exist.
2026-05-18 12:18:05 +02:00
Basilisk-Dev 2ca5d21147 Issue #3092 - Fix unsafe GC multithreading changes 2026-05-18 12:17:18 +02:00
ownedbywuigi 266cc371f7 Issue #3092 - Perform a minor GC on tab close 2026-05-18 12:16:56 +02:00
ownedbywuigi fba218cff4 Issue #3092 - Initial idle GC implementation 2026-05-18 12:15:55 +02:00
ownedbywuigi f33ccb5ce3 Issue #3092 - Implement parallel sweeping and compaction tasks
for improved garbage collection performance
2026-05-18 12:15:34 +02:00
ownedbywuigi 8ca5438db9 Issue #3092 - Implement BackgroundFinalizeTask for parallel garbage collection finalization 2026-05-18 12:15:09 +02:00
ownedbywuigi 8b6414ea7c Issue #3092 - Add new GC sweep tasks.
For saved stacks, self-hosting scripts, and native iterators.
2026-05-18 12:14:30 +02:00
ownedbywuigi 1c09cd7816 Issue #3092 - Refactor WASM compilation handling 2026-05-18 12:13:18 +02:00
wuggy 07b47c8472 Whitelist virtual GPUs (VirtualBox, VMware, VirtIO (QEMU and forks like UTM), Parallels) 2026-05-18 09:48:35 +02:00
Basilisk-Dev 950a608e01 Support CSS shadow parts 2026-05-17 09:57:14 +02:00
Basilisk-Dev c7f08c7e53 Issue #2506 - Support range media query syntax
Resolves #2506
2026-05-17 09:55:27 +02:00
Basilisk-Dev 4f3857c1ea Issue #1826 - Parse calc() weights in color-mix 2026-05-17 09:53:56 +02:00
Basilisk-Dev 60b4b1ad47 Issue #3089 - Support logical border radius properties
Resolves #3089
2026-05-17 09:53:05 +02:00
Basilisk-Dev 8262184873 Revert "Cloudflare Image Resizing fix take 2"
This reverts commit ef19ad3ffd.

No longer necessary with aspect-ratio in place.
2026-05-17 09:46:52 +02:00
Basilisk-Dev e9abd8b022 Support CSS sizing math functions
Prereq for parts of #2404
2026-05-17 09:46:07 +02:00
Basilisk-Dev fe29e0430c Issue #2404 - Enable CSS aspect-ratio sizing 2026-05-17 09:44:59 +02:00
Moonchild 589967f3df Merge branch '3088' into euxp-ports2 2026-05-17 09:44:13 +02:00
Basilisk-Dev 9db275d300 Remove stale imagebitmap support file entry 2026-05-17 09:42:03 +02:00
Basilisk-Dev b6d0a261d2 Load mochitest modules without imp 2026-05-17 09:41:56 +02:00
Basilisk-Dev dad0daf389 Issue #2982 - Follow-up: allow color-mix to work with oklab and oklch
Tag #2489 and #3003
2026-05-17 09:41:44 +02:00
Basilisk-Dev b58e2b9312 Issue #1826 - Serialize special calc() number values 2026-05-17 09:39:23 +02:00
Basilisk-Dev b8f458a819 Issue #1826 - Add typed calc() arithmetic for media queries 2026-05-17 09:39:00 +02:00
Basilisk-Dev 39321f4796 Issue #1826 - Canonicalize nested calc() serialization 2026-05-17 09:38:31 +02:00
Basilisk-Dev d8de738239 Issue #1826 - Support calc() in media queries 2026-05-17 09:37:49 +02:00
Basilisk-Dev 40407bb784 Issue #1826 - Implement broader CSS calc() parsing 2026-05-17 09:37:11 +02:00
Basilisk-Dev a5b2671f1e Fix app-unit rounding for border width edges 2026-05-17 09:34:28 +02:00
Basilisk-Dev 4249686af4 Flush layout for computed border-width shorthand 2026-05-17 09:34:20 +02:00
Basilisk-Dev 69ba22d624 Fix CSS border rounding and currentcolor clipping 2026-05-17 09:34:13 +02:00
Basilisk-Dev 4359582e67 Test fractional border width rounding 2026-05-17 09:33:59 +02:00
Basilisk-Dev fa06d2de31 Floor fractional border widths 2026-05-17 09:33:49 +02:00
ownedbywuigi b7b1918a36 Issue #888 - Add dav1d_flush 2026-05-17 09:06:09 +02:00
ownedbywuigi aa69d5ec99 Issue #888 - Make symbols direct to dav1d, not AOM. 2026-05-17 09:05:44 +02:00
ownedbywuigi 6e4bb257a4 Issue #888 - (potentially) fix MSVC builderr 2026-05-17 09:05:24 +02:00
wuggy a30f439a9c Issue #888 - Fix alphabetical order issue 2026-05-17 09:04:52 +02:00
Basilisk-Dev 0ccaab55ca Issue #888 - Update AV1 configure comment for dav1d 2026-05-17 09:04:31 +02:00
Basilisk-Dev e61621692c Issue #888 - Enable AV1 playback by default 2026-05-17 09:04:05 +02:00
Basilisk-Dev 9a8cb2e22e Issue #888 - Enable dav1d SIMD on more architectures 2026-05-17 09:03:41 +02:00
Basilisk-Dev eb487c2ca1 Issue #888 - Remove bundled libaom 2026-05-17 09:03:21 +02:00
Basilisk-Dev 5c0a35a358 Issue #888 - Enable dav1d LoongArch SIMD 2026-05-17 09:02:50 +02:00
Basilisk-Dev a468f81a5e Issue #888 - Use in-tree dav1d for AV1 decoding 2026-05-17 09:00:34 +02:00
Basilisk-Dev d1b46d7347 Issue #888 - Vendor dav1d 1.5.3 2026-05-17 09:00:07 +02:00
Moonchild 3583e443dd [js] Increase RecoverOffset size (64-bit) 2026-05-12 19:42:44 +02:00
Moonchild afc6210b2c [DOM] Add nullcheck on thumb dragging event ranges. 2026-05-12 09:58:43 +02:00
Moonchild 6fb98414ef [DOM] Add nullcheck on document for requestSubmit 2026-05-12 09:57:56 +02:00
Moonchild 1268c5055a Merge pull request 'Cherry pick some things from Dactyloidae' (#3086) from dactyloidae-ports into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3086
2026-05-11 08:59:14 +00:00
Moonchild 30a1c98c9d Revert "Issue #3030 - Implement lazy-loading for image elements."
This reverts commit 7574161abe.
2026-05-09 10:23:04 +02:00
Moonchild 17b7e131b4 Issue #3030 - Improve image cache entry handling.
This:
- increases max image cache entry size and adjusts related parameters.
- makes the cache entry timeout configurable for advanced tweaking.
- adds a mechanism to keep commonly-used, small image sizes in cache
  longer.
2026-05-09 08:26:44 +02:00
ownedbywuigi 7574161abe Issue #3030 - Implement lazy-loading for image elements. 2026-05-09 08:08:45 +02:00
ownedbywuigi 5185da6cf0 Issue #3030 - Prevent unnecessary event allocation.
Reuse the same event object when dispatching bubbling/capturing phases
instead of allocating new ones.
2026-05-09 08:08:14 +02:00
ownedbywuigi a5c925df20 Issue #3030 - Account for custom elements in attribute value checking.
Refactors MaybeCheckSameAttrVal to streamline old value storage for
custom elements.
2026-05-09 08:06:50 +02:00
ownedbywuigi e794163e05 Issue #3030 - Block auth prompt if there is a sync XHR active.
This attempts to fix https://forum.palemoon.org/viewtopic.php?f=3&t=33260
2026-05-09 08:03:43 +02:00
Moonchild 2690911551 Merge pull request 'Set glx as OpenGL backend default until egl bugs can be investigated' (#3084) from Basilisk-Dev/UXP-contrib:egl-followup into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3084
2026-05-08 06:47:21 +00:00
Basilisk-Dev 6cc0c04b5c Issue #3079 followup - set glx as OpenGL backend default until egl bugs can be investigated 2026-05-07 21:03:15 -04:00
Moonchild edd0f13910 Merge branch 'ANGLE-fixes' 2026-05-07 20:09:23 +02:00
Moonchild c57f1ec98c Merge branch '150.0.2' 2026-05-07 20:09:12 +02:00
Moonchild f757e38c04 [layout] Check offset against start of skip range. 2026-05-07 20:07:33 +02:00
Moonchild 00ab986cb8 [gfx] Fix integer overflow in cairo PDF surface image emission 2026-05-07 19:39:49 +02:00
Valentin Gosu cd873c87d5 Bug 2034352 - Make URL::SearchParams return an already_AddRefed 2026-05-07 19:39:42 +02:00
Moonchild bd3ea8d98d Issue #3083 - Fix incorrect nullcheck. 2026-05-07 19:39:04 +02:00
Moonchild 865d547992 Issue #3083 - Add sanity check to EmulatedIndexedStorage::getNativeStorage 2026-05-07 19:38:17 +02:00
Moonchild 2c4ea0bc88 Issue #3083 - Turn debug-only assert into a skip. 2026-05-07 19:37:46 +02:00
Moonchild 001f950041 Merge pull request 'Enable EGL as the default OpenGL context backend on Linux with GLX fallback' (#3080) from Basilisk-Dev/UXP-contrib:egl into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3080
2026-05-05 20:51:55 +00:00
Basilisk-Dev ca839a4b0f Issue #3079 - only build the X11-specific GL code on X11 systems 2026-05-05 14:07:55 -04:00
Basilisk-Dev 807faf43b0 Issue #3079 - Silence EGL library load logging 2026-05-05 10:13:33 -04:00
Basilisk-Dev 2edc704e4f Issue #3079 - Use desktop OpenGL for X11 EGL 2026-05-05 07:58:40 -04:00
Basilisk-Dev becff6c0d2 Issue #3079 - Add EGL-aware X11 GL probing and fallback 2026-05-05 07:58:26 -04:00
Moonchild 06caa2f30f Merge pull request 'Backport 1398140 and 1377238 - Ion Multithreading Improvements' (#3076) from Basilisk-Dev/UXP-contrib:bugzilla-performance-backports into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3076
2026-05-03 11:57:55 +00:00
Moonchild ac0f516a1a Merge pull request 'Upgrade mimalloc to 3.3.1' (#3056) from Basilisk-Dev/UXP-contrib:mimalloc into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3056
2026-05-03 09:18:12 +00:00
Basilisk-Dev 6d4244e049 Issue #3075 - Backport bug 1398140 - Remove the Ion helper thread pausing 2026-04-30 08:46:31 -04:00
Basilisk-Dev d5d43c7221 Issue #3075 - Backport bug 1377238 - Free finished IonBuilders off-thread. 2026-04-30 08:43:37 -04:00
Moonchild 3a5950ae65 Issue #3066 - Follow-up: use cpuCount for maxParseThreads.
Addressing the confusing naming here:
cpuCount is the number of _logical_ processors as reported by the system,
not the physical cores.
threadCount is that number with some extras. This should be used with care.
2026-04-30 10:51:52 +02:00
Moonchild 58a00fe63b Revert "Issue #3066 - Follow-up: Reserve threads for burst use cases."
This reverts commit 3259bdc1c1.
2026-04-30 10:47:03 +02:00
Moonchild b486a37ba1 Revert "Issue #3066 - Follow-up: Change the way HelperThread counts are calculated."
This reverts commit a1bde368ab.
2026-04-30 10:46:54 +02:00
Moonchild a1bde368ab Issue #3066 - Follow-up: Change the way HelperThread counts are calculated. 2026-04-30 10:39:09 +02:00
Moonchild dc2cb047aa Platform version bump. 2026-04-29 15:08:29 +02:00
Moonchild 4dea7f04dc [gfx] Add sanity checks in ANGLE D3D11 renderer. 2026-04-29 15:06:03 +02:00
Moonchild 7cc35f1195 [DOM] Do not interrupt worker execution if already scheduled. 2026-04-29 15:05:56 +02:00
Moonchild afd0648631 [DOM] Validate size in FileReader. 2026-04-29 15:05:17 +02:00
Moonchild 6524bfee21 [DOM/media] Add some sanity checks to MP3 demuxer.
Note: `vbr.NumAudioFrames()` is already checked in `vbr.IsComplete()`
2026-04-29 15:05:11 +02:00
Iain Ireland de8c2d1762 Bug 2029806: Handle ill-formed UTF16 2026-04-29 15:05:06 +02:00
Karl Tomlinson 5309640d6c Bug 2027433 use nullptr for silent up-mix channels 2026-04-29 15:05:01 +02:00
Karl Tomlinson ddd016a6f8 Bug 2027433 Treat null input channels as zero in AudioChannelsDownMix() 2026-04-29 15:04:55 +02:00
Karl Tomlinson e76fc5637a Bug 2027433 Treat null input channels as zero in InterleaveAndConvertBuffer()
The loop nesting is inverted so as not to add a null check to the inner
loop, but this change would also have some impact on cache use:

* The loop ordering might perhaps not be the ideal for two channels and
large sample counts, for example, because it means going through the
output/largest buffer twice.
* It does, however, avoid pathological situations of iterating across
planar channel buffers, likely to load set-associative cache lines if
the channel buffers are page aligned, due to having 1024 (or somewhat
fewer) floats, for example.
2026-04-29 15:04:49 +02:00
Moonchild a06d5a80a1 [gfx] Add sanity checks in ANGLE D3D11 renderer. 2026-04-29 14:57:03 +02:00
Moonchild 2dbf5e90d6 [DOM] Do not interrupt worker execution if already scheduled. 2026-04-29 13:28:06 +02:00
Moonchild 3259bdc1c1 Issue #3066 - Follow-up: Reserve threads for burst use cases. 2026-04-29 12:10:41 +02:00
Moonchild d8fc800bb6 [DOM] Validate size in FileReader. 2026-04-29 11:30:43 +02:00
Moonchild 2f48cd27d5 [DOM/media] Add some sanity checks to MP3 demuxer.
Note: `vbr.NumAudioFrames()` is already checked in `vbr.IsComplete()`
2026-04-29 11:10:41 +02:00
Iain Ireland 5da410af19 Bug 2029806: Handle ill-formed UTF16 2026-04-29 10:38:42 +02:00
Karl Tomlinson 11b676d033 Bug 2027433 use nullptr for silent up-mix channels 2026-04-29 10:16:55 +02:00
Karl Tomlinson 68f88c7b49 Bug 2027433 Treat null input channels as zero in AudioChannelsDownMix() 2026-04-29 10:03:32 +02:00
Karl Tomlinson b887dd8f37 Bug 2027433 Treat null input channels as zero in InterleaveAndConvertBuffer()
The loop nesting is inverted so as not to add a null check to the inner
loop, but this change would also have some impact on cache use:

* The loop ordering might perhaps not be the ideal for two channels and
large sample counts, for example, because it means going through the
output/largest buffer twice.
* It does, however, avoid pathological situations of iterating across
planar channel buffers, likely to load set-associative cache lines if
the channel buffers are page aligned, due to having 1024 (or somewhat
fewer) floats, for example.
2026-04-29 09:49:46 +02:00
Moonchild 9be79d5b97 Revert "[DOM] Ensure the GC sees consistent states while adopting DOM nodes."
This reverts commit 07c08f37be.
2026-04-28 18:12:15 +02:00
Moonchild 62110dcf7f Revert "[DOM] Ensure the GC sees consistent states while adopting DOM nodes."
This reverts commit 7664a83451.
2026-04-28 17:39:16 +02:00
Moonchild ed4b5d4214 Merge pull request 'Issue #3038 - Fix ./mach help command on Python 3.14.' (#3072) from athenian200/UXP:mach_help_fix into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3072
2026-04-28 13:29:05 +00:00
Moonchild 2aeecda75f Merge pull request 'Fix non-English output corruption and issues surrounding Python cl wrapper.' (#3069) from athenian200/UXP:foreign_msvc_fix into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3069
2026-04-28 13:25:49 +00:00
Moonchild 633de098f8 Merge pull request 'Implement full LoongArch64 Baseline/Ion/wasm JIT backend' (#3067) from Basilisk-Dev/UXP-contrib:loongjit into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3067
2026-04-28 13:06:32 +00:00
Jeremy Andrews 241f9c3965 Issue #3038 - Fix ./mach help command on Python 3.14.
This was a deliberate change in Python 3.14 specifically, should be noted that the old code worked
on every earlier Python version before this. It also was not documented in the release notes,
but it was easy to find people complaining about them tightening the API here.

Ref: https://discuss.python.org/t/argparse-valueerror-action-store-true-is-not-valid-for-positional-arguments/106355
2026-04-27 12:53:09 -05:00
Moonchild 3749fabef9 Merge pull request 'Issue #3066 - on systems with 2 or less CPU cores, use cpuCount for number of helper threads instead of threadCount to prevent performance issues' (#3071) from Basilisk-Dev/UXP-contrib:cpuCount-fix into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3071
2026-04-27 17:38:31 +00:00
Basilisk-Dev ab6fdd555a Issue #3066 - on systems with 2 or less CPU cores, use cpuCount for number of helper threads instead of threadCount to prevent performance issues 2026-04-27 12:57:08 -04:00
Moonchild 6dcb20949a [NSS] Restore dropped 'S' :P 2026-04-27 16:36:01 +02:00
Jeremy Andrews 2ad83109ee Issue #3068 - Implement C++ wrapper.
I looked at the Python wrapper so many times and felt like I was
writing C by proxy to clean up Python assumptions, and started
wondering if C++ was the right tool for this job instead of Python.
Here's my attempt at a C++ version of this wrapper. I'm offering both
options, you can revert this commit if you prefer the Python version.
2026-04-27 01:21:42 -05:00
Jeremy Andrews 993f6947d0 Issue #3068 - Fix non-English MSVC text corruption.
This fixes the original Python wrapper. So basically, the Python developers
have a poor grasp of how Windows handles anything outside of UTF-16 and
the W APIs, and barely understand ANSI codepages, let alone console codepages.
Both MSYS1 and Python 3 seem to treat Windows NT like Windows 9x way too often.
Not the kind of 1990s nostalgia trip we had in mind, but it's the one we got.
2026-04-27 01:21:27 -05:00
Basilisk-Dev a0ee7ae1d7 Issue #3049 - loongarch64: remove remaining MIPS file diffs 2026-04-26 16:20:22 -04:00
Basilisk-Dev 140226f9ee Issue #3049 - loongarch64: drop whitespace-only mips64 diff 2026-04-26 16:20:22 -04:00
Basilisk-Dev 4729e6299e Issue #3049 - loongarch64: localize shared JIT cleanup 2026-04-26 16:20:22 -04:00
Basilisk-Dev b6a9734757 Issue #3049 - loongarch64: drop inert minimal JIT path 2026-04-26 16:20:21 -04:00
Basilisk-Dev 426edd0c41 Issue #3049 - loongarch64: trim non-JIT PR fallout 2026-04-26 16:20:21 -04:00
Basilisk-Dev 5cc9593b41 Issue #3049 - loongarch64: fill scalar macroassembler NYI helpers 2026-04-26 16:20:21 -04:00
Basilisk-Dev bd3a1d801a Issue #3049 - loongarch64: implement baseline wasm atomics 2026-04-26 16:20:21 -04:00
Basilisk-Dev 007e595a33 Issue #3049 - loongarch64: fix JIT uint8 clamp lowering 2026-04-26 16:20:20 -04:00
Basilisk-Dev 537bbfa821 Issue #3049 - loongarch64: fix wasm and debug-trap jit-test regressions 2026-04-26 16:20:20 -04:00
Basilisk-Dev 4b340a1d4d Issue #3049 - loongarch64: retire stale JIT TODOs 2026-04-26 16:20:20 -04:00
Basilisk-Dev 8ef06683c6 Issue #3049 - loongarch64: clarify stale shared-code fallback guards 2026-04-26 16:20:20 -04:00
Basilisk-Dev 2f1765ef22 Issue #3049 - loongarch64: direct wasm baseline truncation 2026-04-26 16:20:20 -04:00
Basilisk-Dev 569f912ffd Issue #3049 - loongarch64: restore pre-barrier link register correctly 2026-04-26 16:20:19 -04:00
Basilisk-Dev 7bd4bfeb06 Issue #3049 - loongarch64: flush icache after JIT runtime patching 2026-04-26 16:20:19 -04:00
Basilisk-Dev 043c98373e Issue #3049 - loongarch64: allocate Ion temps for post-write barriers 2026-04-26 16:20:19 -04:00
Basilisk-Dev c02d8f1d61 Issue #3049 - loongarch64: reserve extract temps in shared IC register pools 2026-04-26 16:20:19 -04:00
Basilisk-Dev c2aeecbf38 Issue #3049 - loongarch64: use explicit VM wrapper tail-call contracts 2026-04-26 16:20:19 -04:00
Basilisk-Dev 3869453bba Issue #3049 - loongarch64: fix scaled JIT memory addressing 2026-04-26 16:20:18 -04:00
Basilisk-Dev 14d2e10576 Issue #3049 - loongarch64: fix pointer immediates and scratch aliasing 2026-04-26 16:20:18 -04:00
Basilisk-Dev d667906533 Issue #3049 - loongarch64: fix JIT value boxing and unboxing 2026-04-26 16:20:18 -04:00
Basilisk-Dev 6b4b7dadb2 Issue #3049 - Save loongarch64 regexp JIT link register 2026-04-26 16:20:18 -04:00
Basilisk-Dev 9f73d5bb49 Issue #3049 - Fix loongarch64 wasm JIT dispatch and truncation 2026-04-26 16:20:17 -04:00
Basilisk-Dev 802aebd0dd Issue #3049 - Fix loongarch64 wasm profiling integration 2026-04-26 16:20:17 -04:00
Basilisk-Dev 88a7b76bfe Issue #3049 - Fix loongarch64 wasm baseline integration 2026-04-26 16:20:17 -04:00
Basilisk-Dev 0164ef4a07 Issue #3049 - Fix loongarch64 wasm runtime plumbing 2026-04-26 16:20:17 -04:00
Basilisk-Dev cd1e02de12 Issue #3049 - Enable loongarch64 wasm baseline compiler 2026-04-26 16:20:17 -04:00
Basilisk-Dev 265bdc3076 Issue #3049 - Remove loongarch64 native call IC fallback 2026-04-26 16:20:16 -04:00
Basilisk-Dev 0f54499203 Issue #3049 - Re-enable loongarch64 asm.js and native regexp 2026-04-26 16:20:16 -04:00
Basilisk-Dev cd028bb746 Issue #3049 - Enable loongarch64 wasm profiling patching 2026-04-26 16:20:16 -04:00
Basilisk-Dev 1b15cf18d7 Issue #3049 - Enable loongarch64 Ion environments 2026-04-26 16:20:16 -04:00
Basilisk-Dev da0cf2149f Issue #3049 - Enable loongarch64 JIT atomics 2026-04-26 16:20:15 -04:00
Basilisk-Dev e079c83629 Issue #3049 - Split loongarch64 Ion lowering from mips64 2026-04-26 16:20:15 -04:00
Basilisk-Dev fc489dc3ad Issue #3049 - Harden loongarch64 Ion call and environment paths 2026-04-26 16:20:15 -04:00
Basilisk-Dev 983e140fbc Issue #3049 - Fix loongarch64 nursery chunk JIT checks 2026-04-26 16:20:15 -04:00
Basilisk-Dev bc826af721 Issue #3049 - Stabilize loongarch64 Ion patching and wasm loads 2026-04-26 16:20:15 -04:00
Basilisk-Dev ade8a91835 Issue #3049 - Enable loongarch64 wasm runtime and Ion patching 2026-04-26 16:20:14 -04:00
Basilisk-Dev 7a9e340ba4 Issue #3049 - Add loongarch64 wasm backend build support 2026-04-26 16:20:14 -04:00
Basilisk-Dev 907d5eb3a0 Issue #3049 - Enable loongarch64 Ion backend build and runtime 2026-04-26 16:20:14 -04:00
Basilisk-Dev 9ae455ac7d Issue #3049 - Wire up loongarch64 Ion backend compilation 2026-04-26 16:20:14 -04:00
Basilisk-Dev ac2c809f8c Issue #3049 - Fix loongarch64 string extraction in JIT stubs 2026-04-26 16:20:13 -04:00
Basilisk-Dev 86d942f9b5 Issue #3049 - Normalize loongarch64 VM wrapper return setup 2026-04-26 16:20:13 -04:00
Basilisk-Dev 0581d130fe Issue #3049 - Fix loongarch64 value decoding and exception tail 2026-04-26 16:20:13 -04:00
Basilisk-Dev 5e74610f98 Issue #3049 - Preserve loongarch64 ra across baseline helper calls 2026-04-26 16:20:13 -04:00
Basilisk-Dev 2710214767 Issue #3049 - Disable native regexp JIT on loongarch64 2026-04-26 16:20:13 -04:00
Basilisk-Dev efd34d3137 Issue #3049 - Handle loongarch64 unary baseline inc and dec 2026-04-26 16:20:12 -04:00
Moonchild c597f4de77 [NSS] Restore dropped 'S' :P 2026-04-26 17:06:16 +02:00
Moonchild fe4b55154b [NSS] Update NSS version for release.
Add (UXP) to the version display string to signify this is our variant of
NSS 3.90 to avoid confusion with the 3.90 branch used in Firefox 115 ESR.
This version has backported considerably more fixes than Mozilla's NSS.
2026-04-26 15:56:47 +02:00
Moonchild d9f4319bfd [parser] Handle foster parenting properly. 2026-04-26 15:56:36 +02:00
Moonchild ec7baced6c [media] Spot-fix for ffvpx handling of bad video data. 2026-04-26 15:56:28 +02:00
Moonchild 5ed591c3d7 [image] Don't do unnecessary work if the image is being destroyed. 2026-04-26 15:56:21 +02:00
Iain Ireland 32859868d6 Bug 2029727: Update RegExpStatics data after realloc 2026-04-26 15:56:09 +02:00
Moonchild 4ab80fceb4 [gfx] OTS/HB: Correct bounds checks. 2026-04-26 15:56:00 +02:00
Moonchild 4e25cc130f [js] Use isElement in UnmappedArgSetter to check if the argument was marked as deleted.
This is more consistent with `UnmappedArgGetter` and better handles the
case where the property was marked deleted in `RareArgumentsData` but not
actually deleted from the object due to OOM. Unfortunately this scenario
is hard to prevent because the property is marked as deleted in the
`ArgumentsObject::obj_delProperty` class hook and after that
`NativeDeleteProperty` tries to remove the property and this can fail.
2026-04-26 15:55:52 +02:00
Dennis Jackson f1b56f6512 Bug 2029323 - Improve size calculations in CMS content buffering 2026-04-26 15:55:38 +02:00
John Schanck b5d6c427ad Bug 2029425 - Heap use-after-free in cert_VerifyCertChainOld via dangling certsList[] entry on NameConstraints violation. 2026-04-26 15:55:29 +02:00
Moonchild 9a900503ea [image] Hold a strong ref on mInnerImage when requesting a refresh. 2026-04-26 15:55:22 +02:00
Moonchild f6296891bf [DOM] Add some death grips to TextTrackManager. 2026-04-26 15:55:17 +02:00
Moonchild bbd16ed644 [DOM/media] Use extended channel data as-appropriate. 2026-04-26 15:55:11 +02:00
John Schanck 8f6cd1cfcd Bug 2030135 - improve error handling in PK11_ImportPrivateKeyInfoAndReturnKey 2026-04-26 15:55:06 +02:00
Moonchild 70a3532f49 Revert "[gfx] Use local statics for harfbuzz callback pointers"
This reverts commit 60a96d9cd2.
2026-04-26 15:54:57 +02:00
Moonchild c160edb49b No issue - Update our in-tree brotli library to 1.2.0+
This includes a minor patch to encode.c to work around the "static init"
check that actually doesn't do anything in its default state, but, due to
compiler subtleties in handling duplicate object names, would not be able
to link brotli.exe because it would refuse to expose all symbols for
duplicate objects (a later one would just be ignored).
Unsure how clang does this but it's not portable across compilers.
(we need the brotli.exe tool for resource package compression)
2026-04-26 15:54:50 +02:00
John Schanck 32f0e6d1e6 Bug 2029462 - store email on subject cache_entry in NSS trust domain.
remove_email_entry used cert->email of the last-destroyed cert to locate
the hash entry to clean up. If that cert had no email, the entry was
silently skipped, leaving a dangling subjectList pointer after the arena
was freed. Store the registration-time email on the subject cache_entry
(mirroring ce->nickname) and thread it through remove_subject_entry so
removal always uses the correct email regardless of destruction order.
2026-04-26 15:54:36 +02:00
Moonchild 8c6098ed9e [security] Ensure DispatchToMainThreadAndWait isn't interrupted.
In some cases, `lock.wait()` can be interrupted by spurious wake-ups
before processing is done. To ensure things are, in fact, synchronous,
loop over `wait()` until it is actually done.
2026-04-26 15:54:26 +02:00
Timothy Nikkel 5f70302bfc Bug 2029291. 2026-04-26 15:54:16 +02:00
Jan de Mooij f1cc25409a Bug 2029317 - Create RareArgumentsData before mutating the arguments object in MappedArgumentsObject::obj_defineProperty. 2026-04-26 15:54:10 +02:00
Jan-Ivar Bruaroey 1bb67f87d1 Bug 2029423 - Reset post_proc state. 2026-04-26 15:53:55 +02:00
Andy Leiserson 6f89be191d Bug 2029427 - Fix format string 2026-04-26 15:53:50 +02:00
Moonchild f453aac0eb [gfx] Explicitly cast calculation to int32. 2026-04-26 15:53:42 +02:00
Moonchild abc2e56e6a [gfx] Port libyuv upstream bounds check. 2026-04-26 15:53:31 +02:00
Simon Farre 2f2c86599f Bug 2025973 - Use value-semantics for txExecutionState::TemplateRule
TemplateRule is a wrapper around references mostly and can for the
purposes of this function be copied to the stack, given that
TemplateRule::mModeNsId is not mutated there.
2026-04-26 15:53:24 +02:00
Dennis Jackson a52e68f04d [NSS] Clarify extension negotiation mechanism for TLS Handshakes. 2026-04-26 15:53:16 +02:00
Moonchild ee256eda09 [js] Only allow strings as function name. 2026-04-26 15:53:07 +02:00
Olli Pettay adbedd87a3 Bug 2025370 - Properly handle error case in EventListenerManager::GetTypedEventHandler 2026-04-26 15:52:46 +02:00
Moonchild 4f94981ad9 [DOM/XSLT] Don't use txXPathNode by reference.
Follow-up to previous XSLT fixes.
2026-04-26 15:52:36 +02:00
Moonchild fb15e11ef3 [gfx] Stop using binary arithmetic in software filtering.
There was some weird binary arithmetic to artificially clamp values in
calculations for dot products. (multiply by (x >= 0)...)
Switch to `std::clamp()` on the initial value instead.
2026-04-26 15:52:31 +02:00
Tom Schuster b0e1570535 Bug 2025332 - ErrorResult should call ClearUnionData more. 2026-04-26 15:52:26 +02:00
Karl Tomlinson b370042040 Bug 2025483 update mBeginProcessing even on speex_resampler_set_rate() error 2026-04-26 15:52:20 +02:00
Moonchild 60daf77274 [NSS] Deep copy profile data in CERT_FindSMimeProfile. 2026-04-26 15:52:15 +02:00
Moonchild 4f9ed77789 [DOM/XSLT] Prevent circular indexing
Added additional flag to txIndexedKeyHashEntry to signal whether or not
this entry is already in the process of indexing.

The XSL specs 3.0 talk about recursion being fine, but circularity not
being ok, which is the case when a key is already being looked up.
2026-04-26 15:52:04 +02:00
Moonchild c819a0b3c8 No issue - Deduplicate HTMLAllCollection::GetSupportedNames code.
This was duplicated with a minor difference from the code present in
nsContentList::GetSupportedNames.
2026-04-26 15:51:57 +02:00
Moonchild 104f493044 [NSS] Reject excessively large ASN.1 SEQUENCE OF in quickder. 2026-04-26 15:51:14 +02:00
Moonchild ccfb3fc5db [DOM] Avoid leaks in nsXMLPrettyPrinter. 2026-04-26 15:51:05 +02:00
Moonchild 9fa543c9f4 [DOM/WebCrypto] Reject absurdly large salt values. 2026-04-26 15:51:00 +02:00
Moonchild 1d18178eda [DOM] Add a death grip and use locals in BaseMediaResource::ModifyLoadFlags. 2026-04-26 15:50:54 +02:00
Moonchild 8a6b1f309b [DOM] Add a SequenceRooter to ConsoleProfile. 2026-04-26 15:50:48 +02:00
Moonchild a60ab0def7 [widget] Improve clearing of data during clipboard operations. 2026-04-26 15:50:40 +02:00
Daniel Holbert 6276177e20 Bug 2026293: Block scripts when initiating async scrollbar activity. 2026-04-26 15:50:33 +02:00
Moonchild 6c4e8f1466 [accessibility] Hold a strong ref to mParent in AccIterator. 2026-04-26 15:50:22 +02:00
Moonchild 19a4ae248b [gfx] Don't return dummy surfaces. 2026-04-26 15:50:16 +02:00
Moonchild 744212dbf3 [webrtc] Fix off-by-one comparison. 2026-04-26 15:50:10 +02:00
Simon Farre a46fbd6ead Bug 2025971 - Use txSingleNodeContext getter of owned txXPathNode.
eContext gets a copy of aNode. The function should use that one's member
as it's not a shared reference, which we can't know the life time of.
2026-04-26 15:50:04 +02:00
Moonchild bb39100caf Bug 2025976 - Follow-up: Make txXPathNode() a public class member. 2026-04-26 15:49:51 +02:00
Moonchild a27a4e4b60 [DOM/XSLT] Re-fetch index entry. 2026-04-26 15:49:45 +02:00
Simon Farre 490cf03fba Bug 2025976 - Make txxPathNode be a value instead of reference.
txxPathNode has value semantics (it's a smart pointer + uint32_t index;
two different objects of this instance with the same contents are the same
thing).

Increase correctness by making a copy instead of a reference.
2026-04-26 15:49:40 +02:00
Moonchild e93191409e [NSS] Improve input validation in DSAU signature decoding 2026-04-26 15:49:33 +02:00
Moonchild 5cfdaf4ad4 [image] Hold a strong ref on error. 2026-04-26 15:49:28 +02:00
Moonchild 7664a83451 [DOM] Ensure the GC sees consistent states while adopting DOM nodes.
This should prevent some intermittent CC crashes when the wrapper cache
has an incorrect state.
2026-04-26 15:49:22 +02:00
Moonchild f449e1fd7d [DOM] Improve CC/WrapperCache for nursery objects. 2026-04-26 15:49:16 +02:00
Moonchild bbd4a99be2 [network] Ensure UDPSocket remains alive during CloseWithReason. 2026-04-26 15:49:11 +02:00
Moonchild 4ae471baf9 [network] Hold strong ref in nsSyncStreamListener::Available. 2026-04-26 15:49:01 +02:00
Moonchild 4d41b5df11 [network] Force NUL termination in ToStringBuffer AF_LOCAL.
Also reject AF_LOCAL in IPC reader (just in case).
2026-04-26 15:48:54 +02:00
Moonchild 01188c1465 [webrtc] Hold a self-ref on behalf of sigslot, just in case.
Also, stop using these PC_AUTO_ENTER_API_CALL... macros
in functions that aren't actually JS API.
2026-04-26 15:48:41 +02:00
Moonchild 7eac3090a5 [DOM] Fix access to shared RuntimeService::mNavigatorProperties. 2026-04-26 15:48:28 +02:00
Moonchild e9bb602131 Issue #3060 - Align cookie magic prefix handling with the updated spec.
This adds `__Http-` and `__Host-Http-` magic prefixes, and aligns
our checks with RFC6265bis.

Resolves #3060
2026-04-26 15:48:16 +02:00
Moonchild ddc8b21705 [network] Handle WebSocketChannel::IsPersistentFramePtr correctly. 2026-04-26 15:47:59 +02:00
Moonchild 6209d33f4e [network] Hold strong ref in nsDownloader::OnDataAvailable. 2026-04-26 15:47:50 +02:00
Moonchild cbaace24c0 [DOM] Add a death grip. 2026-04-26 15:47:44 +02:00
Moonchild 051951ef00 [network] Use locals for VisitHeader 2026-04-26 15:47:38 +02:00
Moonchild a9062b8710 [DOM] Update some DOM canvas checks. 2026-04-26 15:47:14 +02:00
Moonchild 18c656ebba Issue #3058 - Part 1: Fix arithmetic issue in ConvertYCbCrToRGB32
The more complex part can be landed later.
2026-04-26 15:46:58 +02:00
Moonchild 9220d05de2 [NSS] Fix memory leak in NSC_GenerateKey error path. 2026-04-26 15:46:43 +02:00
Moonchild fdd286d190 [NSS] Protect rwSessionCount with slotLock.
Previously, SFTKSlot.rwSessionCount was incremented and decremented
atomically, which meant that there was no way to synchronize reads from it
in NSC_GetTokenInfo. This patch removes the atomic operations but protects
rwSessionCount with SFTKSlot.slotLock.
SFTKSlot.sessionCount is already protected in this way, so this should
have no performance impact.
2026-04-26 15:46:29 +02:00
Moonchild 4fa8a8ce1d [NSS] Fix potential integer underflow in tls 1.3.
Fix integer underflow in tls13_AEAD when ciphertext is shorter than tag.
2026-04-26 15:46:24 +02:00
Moonchild d5e853a25b [media] Check alpha data pointer instead of length.
`nestegg_packet_additional_data()` can return a non-zero length with a
null-pointer after failure to parse an ID_BLOCK_ADDITIONAL element.
See upstream bug https://github.com/mozilla/nestegg/issues/76
2026-04-26 15:46:18 +02:00
Moonchild 6ea3635847 [network] use nsCOMPtr for mRequest in Base Channel's ScopedRequestSuspender 2026-04-26 15:46:09 +02:00
Moonchild 0ea3d42a38 Issue #2946 - Follow-up: Sanity-check WMF video properties.
Not sure where else to put this under, but it's a WMF HWA related check,
so filing it as a follow-up here to recent work.
Also tag #2949
2026-04-26 15:45:50 +02:00
Moonchild a024df6124 [DOM] More consistently use already-calculated image properties. 2026-04-26 15:45:33 +02:00
Moonchild 11a80021f4 [layout] Minor frame scroll improvements. 2026-04-26 15:45:26 +02:00
Moonchild 301873c751 [XPCOM] Update list of executable extensions on Windows. 2026-04-26 15:45:18 +02:00
Moonchild 90986caee8 [NSS] ensure permittedSubtrees don't match wildcards that could be outside
the permitted tree.
2026-04-26 15:45:12 +02:00
Moonchild e051599073 [NSS] Update NSS version for release.
Add (UXP) to the version display string to signify this is our variant of
NSS 3.90 to avoid confusion with the 3.90 branch used in Firefox 115 ESR.
This version has backported considerably more fixes than Mozilla's NSS.
2026-04-26 15:44:48 +02:00
Moonchild 002b1d928e [parser] Handle foster parenting properly. 2026-04-26 12:16:13 +02:00
Moonchild 79aa36ef10 [media] Spot-fix for ffvpx handling of bad video data. 2026-04-26 12:00:21 +02:00
Moonchild 1842de878f [image] Don't do unnecessary work if the image is being destroyed. 2026-04-26 11:48:42 +02:00
Iain Ireland 81cc4e7d9e Bug 2029727: Update RegExpStatics data after realloc 2026-04-26 11:31:06 +02:00
Moonchild 0d69bdc104 [gfx] OTS/HB: Correct bounds checks. 2026-04-26 11:06:48 +02:00
Moonchild eb235f0675 [js] Use isElement in UnmappedArgSetter to check if the argument was marked as deleted.
This is more consistent with `UnmappedArgGetter` and better handles the
case where the property was marked deleted in `RareArgumentsData` but not
actually deleted from the object due to OOM. Unfortunately this scenario
is hard to prevent because the property is marked as deleted in the
`ArgumentsObject::obj_delProperty` class hook and after that
`NativeDeleteProperty` tries to remove the property and this can fail.
2026-04-26 10:49:29 +02:00
Dennis Jackson 2729d6cae9 Bug 2029323 - Improve size calculations in CMS content buffering 2026-04-26 10:31:29 +02:00
John Schanck da3b8fc623 Bug 2029425 - Heap use-after-free in cert_VerifyCertChainOld via dangling certsList[] entry on NameConstraints violation. 2026-04-26 10:27:35 +02:00
Moonchild 58f6eb679b [image] Hold a strong ref on mInnerImage when requesting a refresh. 2026-04-26 10:23:39 +02:00
Moonchild e4db1b8fdc [DOM] Add some death grips to TextTrackManager. 2026-04-26 10:13:02 +02:00
Moonchild 6f68647251 [DOM/media] Use extended channel data as-appropriate. 2026-04-26 10:06:09 +02:00
John Schanck 867bd1549b Bug 2030135 - improve error handling in PK11_ImportPrivateKeyInfoAndReturnKey 2026-04-26 09:18:06 +02:00
Moonchild bb3275468d Revert "[gfx] Use local statics for harfbuzz callback pointers"
This reverts commit 60a96d9cd2.
2026-04-26 07:50:58 +02:00
Moonchild bfc67972ed No issue - Update our in-tree brotli library to 1.2.0+
This includes a minor patch to encode.c to work around the "static init"
check that actually doesn't do anything in its default state, but, due to
compiler subtleties in handling duplicate object names, would not be able
to link brotli.exe because it would refuse to expose all symbols for
duplicate objects (a later one would just be ignored).
Unsure how clang does this but it's not portable across compilers.
(we need the brotli.exe tool for resource package compression)
2026-04-26 00:55:29 +02:00
John Schanck c04c33e327 Bug 2029462 - store email on subject cache_entry in NSS trust domain.
remove_email_entry used cert->email of the last-destroyed cert to locate
the hash entry to clean up. If that cert had no email, the entry was
silently skipped, leaving a dangling subjectList pointer after the arena
was freed. Store the registration-time email on the subject cache_entry
(mirroring ce->nickname) and thread it through remove_subject_entry so
removal always uses the correct email regardless of destruction order.
2026-04-25 22:59:08 +02:00
Moonchild a64033be06 [security] Ensure DispatchToMainThreadAndWait isn't interrupted.
In some cases, `lock.wait()` can be interrupted by spurious wake-ups
before processing is done. To ensure things are, in fact, synchronous,
loop over `wait()` until it is actually done.
2026-04-25 17:17:08 +02:00
Timothy Nikkel 1805114b8b Bug 2029291. 2026-04-25 16:31:01 +02:00
Jan de Mooij d0465ae9e5 Bug 2029317 - Create RareArgumentsData before mutating the arguments object in MappedArgumentsObject::obj_defineProperty. 2026-04-25 16:16:00 +02:00
Jan-Ivar Bruaroey 533b487b3b Bug 2029423 - Reset post_proc state. 2026-04-25 15:58:00 +02:00
Andy Leiserson 7899aa0e49 Bug 2029427 - Fix format string 2026-04-25 15:49:02 +02:00
Moonchild 2ac6f05047 [gfx] Explicitly cast calculation to int32. 2026-04-25 15:25:11 +02:00
Moonchild 6bd4859ef6 [gfx] Port libyuv upstream bounds check. 2026-04-25 15:10:43 +02:00
Simon Farre 120f8bebe4 Bug 2025973 - Use value-semantics for txExecutionState::TemplateRule
TemplateRule is a wrapper around references mostly and can for the
purposes of this function be copied to the stack, given that
TemplateRule::mModeNsId is not mutated there.
2026-04-25 15:03:37 +02:00
Dennis Jackson 84a3ff050c [NSS] Clarify extension negotiation mechanism for TLS Handshakes. 2026-04-25 14:14:21 +02:00
Moonchild b822fda771 [js] Only allow strings as function name. 2026-04-25 11:44:48 +02:00
athenian200 3e38744f8b No Issue - Fix non-fatal powershell invocation on Windows.
This only happened because Python 3 no longer has the limitation of requiring VS 2009 to build binary extensions, and Python uses powershell to build those on Windows for some reason. Was an optional module anyway, not worth the annoyance it caused some users.
2026-04-25 09:20:32 +00:00
ownedbywuigi ffeaec8710 Issue #3030 - Reduce layout stalls due to compositor hang-ups. 2026-04-25 11:11:40 +02:00
Olli Pettay bbeb397619 Bug 2025370 - Properly handle error case in EventListenerManager::GetTypedEventHandler 2026-04-25 11:03:41 +02:00
Moonchild 0e0e2eed28 [DOM/XSLT] Don't use txXPathNode by reference.
Follow-up to previous XSLT fixes.
2026-04-25 10:51:24 +02:00
Moonchild 0541bf3363 [gfx] Stop using binary arithmetic in software filtering.
There was some weird binary arithmetic to artificially clamp values in
calculations for dot products. (multiply by (x >= 0)...)
Switch to `std::clamp()` on the initial value instead.
2026-04-25 10:22:15 +02:00
Tom Schuster 8c677506b2 Bug 2025332 - ErrorResult should call ClearUnionData more. 2026-04-25 09:32:58 +02:00
Karl Tomlinson d77bac2b73 Bug 2025483 update mBeginProcessing even on speex_resampler_set_rate() error 2026-04-25 09:03:05 +02:00
Moonchild 4f8122c97c [NSS] Deep copy profile data in CERT_FindSMimeProfile. 2026-04-25 08:52:27 +02:00
Moonchild 7db3518bcb [DOM/XSLT] Prevent circular indexing
Added additional flag to txIndexedKeyHashEntry to signal whether or not
this entry is already in the process of indexing.

The XSL specs 3.0 talk about recursion being fine, but circularity not
being ok, which is the case when a key is already being looked up.
2026-04-24 21:35:24 +02:00
Moonchild 509b1c9c9d No issue - Deduplicate HTMLAllCollection::GetSupportedNames code.
This was duplicated with a minor difference from the code present in
nsContentList::GetSupportedNames.
2026-04-24 21:21:00 +02:00
Moonchild ceb04b11aa [NSS] Reject excessively large ASN.1 SEQUENCE OF in quickder. 2026-04-24 20:55:33 +02:00
Moonchild 1fb0e5ad2e [DOM] Avoid leaks in nsXMLPrettyPrinter. 2026-04-24 20:38:39 +02:00
Moonchild 0d778af5a1 [DOM/WebCrypto] Reject absurdly large salt values. 2026-04-24 20:34:09 +02:00
Moonchild 1983e6dc6e [DOM] Add a death grip and use locals in BaseMediaResource::ModifyLoadFlags. 2026-04-24 16:55:15 +02:00
Moonchild 851cfe1a41 [DOM] Add a SequenceRooter to ConsoleProfile. 2026-04-24 16:34:52 +02:00
Moonchild 86cbf4a9f3 [widget] Improve clearing of data during clipboard operations. 2026-04-24 16:25:17 +02:00
Daniel Holbert af8cda32de Bug 2026293: Block scripts when initiating async scrollbar activity. 2026-04-24 15:59:17 +02:00
Moonchild 6b9f39b933 [accessibility] Hold a strong ref to mParent in AccIterator. 2026-04-24 15:21:29 +02:00
Moonchild ac7a61a9be [gfx] Don't return dummy surfaces. 2026-04-24 14:39:16 +02:00
Moonchild 017cc7ef84 [webrtc] Fix off-by-one comparison. 2026-04-24 14:17:19 +02:00
Simon Farre 72b2c2c555 Bug 2025971 - Use txSingleNodeContext getter of owned txXPathNode.
eContext gets a copy of aNode. The function should use that one's member
as it's not a shared reference, which we can't know the life time of.
2026-04-24 14:09:59 +02:00
Moonchild aec1c42d17 Bug 2025976 - Follow-up: Make txXPathNode() a public class member. 2026-04-24 14:08:54 +02:00
Moonchild a84dbb6281 [DOM/XSLT] Re-fetch index entry. 2026-04-24 13:47:43 +02:00
Simon Farre 951c54835b Bug 2025976 - Make txxPathNode be a value instead of reference.
txxPathNode has value semantics (it's a smart pointer + uint32_t index;
two different objects of this instance with the same contents are the same
thing).

Increase correctness by making a copy instead of a reference.
2026-04-24 11:30:00 +02:00
Moonchild 142dca26f4 [NSS] Improve input validation in DSAU signature decoding 2026-04-24 11:09:35 +02:00
Moonchild 6f74b59900 [image] Hold a strong ref on error. 2026-04-24 10:37:01 +02:00
Moonchild 07c08f37be [DOM] Ensure the GC sees consistent states while adopting DOM nodes.
This should prevent some intermittent CC crashes when the wrapper cache
has an incorrect state.
2026-04-24 10:04:44 +02:00
Moonchild a703325af2 [DOM] Improve CC/WrapperCache for nursery objects. 2026-04-24 09:15:19 +02:00
Basilisk-Dev acf54dc358 Issue #3049 - Add loongarch64 JIT link-time compatibility stubs 2026-04-24 00:38:15 -04:00
Basilisk-Dev edee1158ee Issue #3049 - Wire up loongarch64 SpiderMonkey baseline backend 2026-04-23 23:41:12 -04:00
Basilisk-Dev 4f7803881b Issue #3049 - Disable wasm signal handlers on loongarch64 2026-04-23 22:04:40 -04:00
Basilisk-Dev a54d8527c8 Issue #3049 - Disable unsupported JIT features in loongarch64 contexts 2026-04-23 21:42:15 -04:00
Basilisk-Dev 7ddab852c3 Issue #3049 - Normalize loongarch64 baseline frame register use 2026-04-23 21:17:14 -04:00
Basilisk-Dev ffc4084854 Issue #3049 - Use s5 for loongarch64 baseline frames 2026-04-23 21:06:53 -04:00
Basilisk-Dev 367dec14bc Issue #3049 - Preserve loongarch64 callee-save JIT entry regs 2026-04-23 20:53:40 -04:00
Basilisk-Dev 522b1c58df Issue #3049 - Fix loongarch64 baseline IC integer compare stub 2026-04-23 20:19:29 -04:00
Basilisk-Dev f5c28ff4d6 Issue #3049 - Adapt loongarch64 baseline macroassembler to old JIT APIs 2026-04-23 20:03:41 -04:00
Basilisk-Dev 11aa5a7586 Issue #3049 - Fix loongarch64 JIT header compatibility 2026-04-23 19:30:19 -04:00
Basilisk-Dev f3eb80a55b Issue #3049 - Adapt loongarch64 JIT glue to older JS APIs 2026-04-23 19:21:46 -04:00
Basilisk-Dev 5a606f322e Issue #3049 - Wire loongarch64 non-Ion frame and patch hooks 2026-04-23 19:16:28 -04:00
Basilisk-Dev fb9098d69b Issue #3049 - Rename and wire loongarch64 baseline JIT backend 2026-04-23 19:09:10 -04:00
Basilisk-Dev 7e1d721f20 Issue #3049 - Extend LoongArch minimal JIT frame slots 2026-04-23 17:48:36 -04:00
Moonchild 55fe29cbb7 [network] Ensure UDPSocket remains alive during CloseWithReason. 2026-04-23 19:35:41 +02:00
Moonchild 044736c889 [network] Hold strong ref in nsSyncStreamListener::Available. 2026-04-23 19:32:33 +02:00
Moonchild 875b73823e [network] Force NUL termination in ToStringBuffer AF_LOCAL.
Also reject AF_LOCAL in IPC reader (just in case).
2026-04-23 19:14:31 +02:00
Moonchild 74fc0fc150 [webrtc] Hold a self-ref on behalf of sigslot, just in case.
Also, stop using these PC_AUTO_ENTER_API_CALL... macros
in functions that aren't actually JS API.
2026-04-23 15:07:09 +02:00
Moonchild a4c8f55faf [DOM] Fix access to shared RuntimeService::mNavigatorProperties. 2026-04-23 14:29:43 +02:00
Moonchild 8405bea921 Issue #3060 - Align cookie magic prefix handling with the updated spec.
This adds `__Http-` and `__Host-Http-` magic prefixes, and aligns
our checks with RFC6265bis.

Resolves #3060
2026-04-23 12:07:59 +02:00
Basilisk-Dev feda33fbec Issue #3049 - Allow more LoongArch minimal JIT arguments 2026-04-23 03:36:42 -04:00
Basilisk-Dev 741112d29c Issue #3049 - Support more LoongArch minimal JIT branch ops 2026-04-23 03:31:22 -04:00
Basilisk-Dev afe857516d Issue #3049 - Track LoongArch minimal JIT control flow state 2026-04-23 03:26:35 -04:00
Moonchild 101c6c1ca8 [network] Handle WebSocketChannel::IsPersistentFramePtr correctly. 2026-04-23 09:23:51 +02:00
Basilisk-Dev 6d70806439 Issue #3049 - Handle more LoongArch minimal JIT stack ops 2026-04-23 03:19:20 -04:00
Moonchild 6aed69f637 [network] Hold strong ref in nsDownloader::OnDataAvailable. 2026-04-23 09:14:05 +02:00
Moonchild fc8ca12118 [DOM] Add a death grip. 2026-04-23 08:50:17 +02:00
Moonchild 15faf0c3c6 [network] Use locals for VisitHeader 2026-04-23 08:38:29 +02:00
Moonchild a16543eb90 Merge branch 'master' of https://repo.palemoon.org/MoonchildProductions/UXP 2026-04-23 07:19:00 +02:00
athenian200 eaf6665b70 Issue #3038 - Make sure js/src/configure.in invokes Python 3.
Missed this file while cleaning up Python 2 references in shell scripts. Not sure this is used, but better safe than sorry.
2026-04-23 04:43:28 +00:00
Basilisk-Dev 9907fca0bb Issue #3049 - Add LoongArch minimal JIT div and mod 2026-04-22 23:42:58 -04:00
Basilisk-Dev 145748d74c Issue #3049 - Add LoongArch minimal JIT multiply support 2026-04-22 23:39:10 -04:00
Basilisk-Dev 885aeb2ffa Issue #3049 - Add LoongArch minimal JIT shifts and negation 2026-04-22 23:37:23 -04:00
Basilisk-Dev 0eac54b24e Issue #3049 - Extend LoongArch minimal JIT value handling 2026-04-22 23:33:46 -04:00
Basilisk-Dev f4fbed884b Issue #3049 - Fix LoongArch minimal JIT return path 2026-04-22 23:13:21 -04:00
Moonchild a4b7b7473f [DOM] Update some DOM canvas checks. 2026-04-22 23:54:56 +02:00
Moonchild 4fdaa6a05a Issue #3058 - Part 1: Fix arithmetic issue in ConvertYCbCrToRGB32
The more complex part can be landed later.
2026-04-22 21:23:42 +02:00
Moonchild cfe4a5e353 [NSS] Fix memory leak in NSC_GenerateKey error path. 2026-04-22 16:58:07 +02:00
Moonchild 561002daa4 [NSS] Protect rwSessionCount with slotLock.
Previously, SFTKSlot.rwSessionCount was incremented and decremented
atomically, which meant that there was no way to synchronize reads from it
in NSC_GetTokenInfo. This patch removes the atomic operations but protects
rwSessionCount with SFTKSlot.slotLock.
SFTKSlot.sessionCount is already protected in this way, so this should
have no performance impact.
2026-04-22 16:32:19 +02:00
Moonchild 9a5b0e8fef [NSS] Fix potential integer underflow in tls 1.3.
Fix integer underflow in tls13_AEAD when ciphertext is shorter than tag.
2026-04-22 15:42:40 +02:00
Moonchild 7da9a8d988 [media] Check alpha data pointer instead of length.
`nestegg_packet_additional_data()` can return a non-zero length with a
null-pointer after failure to parse an ID_BLOCK_ADDITIONAL element.
See upstream bug https://github.com/mozilla/nestegg/issues/76
2026-04-22 14:25:22 +02:00
Moonchild 373ada7321 [network] use nsCOMPtr for mRequest in Base Channel's ScopedRequestSuspender 2026-04-22 13:24:12 +02:00
Moonchild 8ebd469720 Issue #2946 - Follow-up: Sanity-check WMF video properties.
Not sure where else to put this under, but it's a WMF HWA related check,
so filing it as a follow-up here to recent work.
Also tag #2949
2026-04-22 12:00:51 +02:00
Moonchild 481c255726 [DOM] More consistently use already-calculated image properties. 2026-04-22 09:20:11 +02:00
Moonchild 3d790dfa0b [layout] Minor frame scroll improvements. 2026-04-22 08:52:48 +02:00
Moonchild 4bd6812d9c [XPCOM] Update list of executable extensions on Windows. 2026-04-22 08:20:43 +02:00
Moonchild 98514f7e45 [NSS] ensure permittedSubtrees don't match wildcards that could be outside
the permitted tree.
2026-04-22 07:51:47 +02:00
Basilisk-Dev b822fa9d33 Issue #2927 - Update mimalloc to 3.3.1 2026-04-21 18:09:24 -04:00
Basilisk-Dev 336c03ff42 Issue #2927 - Update mimalloc to 3.3.0 2026-04-21 18:09:12 -04:00
Moonchild 5e7320f939 Merge pull request 'Issue #3038 - Fix ARM assembler issues in libpixman.' (#3054) from athenian200/UXP:libpixman-arm-fix into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3054
2026-04-19 22:25:41 +00:00
Jeremy Andrews 0ea174bd02 Issue #3038 - Add explicit UTF-8 decode to check_debug_ranges.
Should be safe because this code path will only fire on Linux and Unix-likes.
Committing directly to master due to it being a one-line change similar to all
the other Python 3 changes.
2026-04-19 13:29:08 -05:00
Jeremy Andrews 4fbecf0e50 Issue #3038 - Fix ARM assembler issues in libpixman.
Probably not strictly related to Python 3 changes, but small enough
that expanding the scope to general UXP build issues on Debian
won't be too bad an idea, since the issue was reported there anyway.
Likely related to binutils updates reporter mentioned.
2026-04-18 16:37:30 -05:00
Moonchild 48eee536a3 Merge pull request 'Backport Performance Improvements from 1379814 and 1431353' (#3051) from Basilisk-Dev/UXP-contrib:bugzilla-backports into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3051
2026-04-18 11:37:01 +00:00
Moonchild 010f09bf1e Merge pull request 'Backport libffi loongarch support' (#3052) from Basilisk-Dev/UXP-contrib:libffi-loongarch into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3052
2026-04-18 07:10:17 +00:00
Basilisk-Dev 771f5dccd5 Issue #3049 - backport libffi loongarch support 2026-04-17 22:19:38 -04:00
athenian200 18a693a8ab Merge pull request 'Completely remove all remaining usages of and references to dbus-glib from our tree' (#3039) from Basilisk-Dev/UXP-contrib:dbus-glib-removal into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3039

I reviewed and tested this PR on Fedora 43 two days ago. Gave it an r+. Was admittedly hoping Travis (our main Linux guy) would confirm my results, but Basilisk-Dev already tested Oracle Linux and I already tested Fedora, so that is likely good enough. Looked at the patch visually and see nothing that could go wrong on Windows or any other platform, since all the changes appear confined to Linux and WebRTC code paths that we don't use for Windows or Mac. Looks correct, and should be low-risk even if there are issues.

**Justification for merge into master on own initiative:**

1. I have enough Linux experience to confirm the patch shouldn't break our official Linux builds.

2. Patch mostly touches WebRTC related stuff in Basilisk-Dev's area of concern, so he is the most qualified to sign off on such changes.

3. The patch has been tested twice.

4. MC is a bit preoccupied with the server move.

5. Travis also appears to have been busy.

6. 10 days have passed since PR was first submitted.

If master breaks or anything unusual happens as a result of this merge, I am prepared to accept the blame and consequences.

Sincerely,

Jeremy Andrews (athenian200)
2026-04-18 01:41:48 +00:00
Basilisk-Dev e10d75b7c2 Issue #3050 - Backport 1431353: Remove off-thread parse thread limit 2026-04-17 11:31:08 -04:00
Basilisk-Dev fd62e7eb91 Issue #3050 - Backport 1379814: Prevent HelperThreads master-task deadlock 2026-04-17 11:30:50 -04:00
Basilisk-Dev 975e6c2618 Issue #3049 - Add property-wrapper fast path to minimal LoongArch JIT 2026-04-16 11:36:57 -04:00
Basilisk-Dev 94ff99c265 Issue #3049 - Cache minimal JIT code on JSScript 2026-04-16 00:01:33 -04:00
Basilisk-Dev 1e1235d1fb Issue #3049 - Guard minimal JIT direct-call fast path 2026-04-15 23:56:36 -04:00
Basilisk-Dev 9ae59f4312 Issue #3049 - Back out unstable minimal JIT direct-call hook 2026-04-15 23:49:50 -04:00
Basilisk-Dev 802110305d Issue #3049 - Call minimal LoongArch JIT directly from interpreter 2026-04-15 23:46:29 -04:00
Basilisk-Dev 008d2b2b01 Issue #3049 - Fix switch scoping in minimal LoongArch JIT 2026-04-15 23:40:18 -04:00
Basilisk-Dev db451f41d4 Issue #3049 - Extend minimal LoongArch JIT for cached counted loops 2026-04-15 23:38:35 -04:00
Basilisk-Dev a00c861f3b Issue #3049 - Use standard JSContext declaration in minimal JIT header 2026-04-15 23:18:51 -04:00
Basilisk-Dev 56035186ff Issue #3049 - Qualify ArrayLength in minimal LoongArch JIT 2026-04-15 23:17:10 -04:00
Basilisk-Dev 73cfb5e9e5 Issue #3049 - Sort minimal LoongArch JIT moz.build entry 2026-04-15 22:56:50 -04:00
Basilisk-Dev 9eed22be4f Issue #3049 - Add minimal LoongArch JIT regression coverage 2026-04-15 22:46:53 -04:00
Basilisk-Dev 11d18319bd Issue #3049 - Add minimal LoongArch JS proof-of-concept JIT 2026-04-15 22:45:58 -04:00
Moonchild d07eaa0c68 Merge pull request 'Added a null-argument guard in uriloader/exthandler/nsExternalHelperAppService' (#3048) from Basilisk-Dev/UXP-contrib:fix-crashes into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3048
2026-04-14 21:30:16 +00:00
Moonchild e6f73d578b Merge pull request 'Backport of bug 1350760 - atomization fast-path improvements' (#3046) from Basilisk-Dev/UXP-contrib:1350760-backport into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3046
2026-04-14 21:29:55 +00:00
Basilisk-Dev 0e825b7a8b Issue #3047 - Added a null-argument guard in uriloader/exthandler/nsExternalHelperAppService
setProtocolHandlerDefaults(null, ...) now returns NS_ERROR_INVALID_ARG instead of dereferencing aHandlerInfo and crashing
2026-04-14 00:16:02 -04:00
Basilisk-Dev d3b337c77a Issue #3045 - backport of bug 1350760 - atomization fast-path improvements 2026-04-14 00:05:30 -04:00
Moonchild 19b79bef4b Merge pull request 'Fix ccache builds and clean up Python 3.14 warning spew.' (#3041) from athenian200/UXP:warning-spew-ccache-fixes into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3041
2026-04-13 20:27:58 +00:00
Moonchild cfbe413763 Merge pull request 'Implement support for lch color space' (#3035) from Basilisk-Dev/UXP-contrib:lch-color into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3035
2026-04-13 20:12:27 +00:00
Moonchild 090242a16e Merge pull request 'Fix stack OOB write in nsLocaleService::GetLocaleFromAcceptLanguage bounds checks' (#3044) from Basilisk-Dev/UXP-contrib:nslocaleservice-mem-bug into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3044
2026-04-13 20:04:28 +00:00
Basilisk-Dev 53bc735ee9 Issue #3043 - Fix stack OOB write in nsLocaleService::GetLocaleFromAcceptLanguage bounds checks 2026-04-10 14:31:54 -04:00
Moonchild dc92189c0f Issue #3042 - Add canvas WebGL context powerPreference
Resolves #3042
2026-04-10 10:25:45 +02:00
Jeremy Andrews 3b0aadb95c Issue #3038 - Fix ccache builds and clean up Python 3.14 warning spew.
None of these resulted in build bustage using our default configuration,
but apparently ccache builds were broken due to a bytes/text issue. Wish
the original reporter had mentioned he was using ccache, but he saved me
a lot of busywork. Changes appear safe across whole range of Python
versions we support.
2026-04-08 02:31:52 -05:00
Basilisk-Dev 12ba8bf083 Issue #3027 - completely remove all remaining usages of dbus-glib from our tree 2026-04-07 15:26:28 -04:00
Moonchild 71a061f3ea Merge pull request 'Remove ia64 from WebRTC in old-configure.in. Replace reference with loongarch64' (#3033) from Basilisk-Dev/UXP-contrib:ia64-old-configure-in into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3033
2026-04-03 06:45:30 +00:00
Moonchild c29de91663 Merge pull request 'Replace all uses of dbus-glib in widget/gtk with direct libdbus calls' (#3032) from Basilisk-Dev/UXP-contrib:dbus-glib-widget into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3032
2026-04-03 06:45:09 +00:00
Moonchild 3be43599e2 Merge pull request 'Modify nsGIOService to call libdbus directly instead of using dbus-glib' (#3028) from Basilisk-Dev/UXP-contrib:dbus-glib into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3028
2026-04-03 06:43:58 +00:00
Moonchild 2f07b7f26e Merge pull request 'Follow-up: Fix 32-bit Windows builds.' (#3037) from athenian200/UXP:fix-32bit-windows-build into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3037
2026-04-03 06:42:23 +00:00
Moonchild 778d93ac49 [network] Ignore non-compliant http server header. 2026-04-03 07:38:32 +02:00
Moonchild f9ba08fa11 [NSS] Update NSS to 3.90.9.1 (custom) 2026-04-03 07:38:24 +02:00
Moonchild 95911aa2ce [gfx] Use local statics for harfbuzz callback pointers
This ensures thread-safe initialization.
2026-04-03 07:38:10 +02:00
Moonchild ccbea05142 [XPCOM] Add more validation to SnappyUncompressInputStream 2026-04-03 07:37:56 +02:00
Moonchild 867c957ceb No issue - Add convolver sanity check 2026-04-03 07:37:41 +02:00
Jeremy Andrews b180acefa2 Issue #2974 - Follow-up: Fix 32-bit Windows builds.
Apparently on 32-bit builds, bytes are passed into the build system in exactly
one more place than on 64-bit builds. The fix is trivial and one-line...
hopefully no one minds me doing this as a quick follow-up to the original
issue, it was very small and missed during testing.
2026-04-02 21:32:32 -05:00
Basilisk-Dev 0cd75d7bee Issue #3003 - Add CSS lch() color parsing support 2026-04-02 17:14:03 -04:00
Basilisk-Dev f17894ba65 Issue #3003 prerequisite - Split non-sRGB CSS color helpers out of nsCSSParser 2026-04-02 17:13:51 -04:00
Basilisk-Dev 656a76c24e Issue #3007 - remove unneeded comment 2026-04-02 16:27:52 -04:00
Basilisk-Dev 20a0b94fbf Issue #3007 and #2897 followup - remove ia64 from WebRTC in old-configure.in. Replace reference with loongarch64 2026-04-02 16:19:55 -04:00
Basilisk-Dev c037f1194f Issue #3027 - remove all uses of dbus-glib from widget/ 2026-04-02 15:06:41 -04:00
Moonchild 5fb569520e [network] Ignore non-compliant http server header. 2026-04-02 15:24:32 +02:00
Moonchild 0054f425d9 [NSS] Update NSS to 3.90.9.1 (custom) 2026-04-02 14:35:17 +02:00
Moonchild 60a96d9cd2 [gfx] Use local statics for harfbuzz callback pointers
This ensures thread-safe initialization.
2026-04-02 13:27:11 +02:00
Moonchild 323338eb09 Revert "[network] Ignore non-compliant http server header."
This reverts commit d2a4890384.
2026-04-01 20:57:56 +02:00
Moonchild d2a4890384 [network] Ignore non-compliant http server header. 2026-04-01 16:15:19 +02:00
Moonchild 56a2627104 [XPCOM] Add more validation to SnappyUncompressInputStream 2026-04-01 14:49:47 +02:00
Moonchild 8811a48b8a CLOBBER for python 3 migration 2026-04-01 14:24:42 +02:00
Moonchild 5f03b88dd3 Merge pull request 'Switch to Python 3.' (#3024) from athenian200/UXP:python3-clean into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3024
2026-04-01 11:57:01 +00:00
Moonchild 2e18e11f2b No issue - Add convolver sanity check 2026-04-01 13:52:32 +02:00
Jeremy Andrews 02ec45c715 Issue #2974 - Part 70: Clean up PPC code so we can build on PPC.
Normally we'd want to do this as part of clean-up for Android-related
enums we don't use or making mozbuild syntax more consistent, but
Python 3's strict enforcement of enums kinda forced my hand here.
In principle, it's a little out of scope, but in practice the "scope"
is practically every Python file in the build system at this
point, unfortunately including mozbuild.
2026-03-30 15:03:49 -05:00
Jeremy Andrews 3b21b1bc49 Issue #2974 - Part 69: Attempt to deal with EnumString issues.
Improve logger handling when they happen, also try to keep EnumString
objects out of gyp where we know not all enums will match our internal list.
2026-03-29 16:16:54 -05:00
Basilisk-Dev 663ec3d230 Issue #3027 - modify nsGIOService to call libdbus directly instead of using dbus-glib 2026-03-28 15:41:13 -04:00
Moonchild 0d2ff3ee65 Merge branch 'master' into release 2026-03-28 19:02:37 +01:00
Jeremy Andrews c36a9c674e Issue #2974 - Part 68: Fix a regex warning and improve Python check.
Trying to get this cleaned up...
2026-03-28 11:13:48 -05:00
Jeremy Andrews 4ff3a75296 Issue #2974 - Part 67: Last-minute FreeBSD fixes.
Something went wrong on FreeBSD... I hope I don't have to go back
to the drawing board again.
2026-03-28 11:13:20 -05:00
Moonchild 5871ce0b85 Merge pull request 'Implement TypedArray.prototype.toSorted' (#3025) from Basilisk-Dev/UXP-contrib:typedarray-tosorted into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3025
2026-03-28 15:07:05 +00:00
Moonchild 6237c680ca Merge pull request 'Cleanup obsolete XPCOM Support' (#3026) from Basilisk-Dev/UXP-contrib:cleanup-xpcom into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3026
2026-03-28 15:05:35 +00:00
Basilisk-Dev facdbf7bc0 Issue #3007 - remove VERY obsolete HTML files in XPCOM 2026-03-28 09:08:54 -04:00
Basilisk-Dev 8f54050907 Issue #3007 - remove 32-bit SPARC OpenBSD support in XPCOM 2026-03-28 08:50:38 -04:00
Basilisk-Dev 2fbe032ee9 Issue #3007 - remove some obsolete HTML files in xpcom 2026-03-28 08:46:49 -04:00
Basilisk-Dev a8a68383cb Issue #3007 - Remove bitrig support from XPCOM. 2026-03-28 08:44:21 -04:00
Basilisk-Dev e3f67c01a2 Issue #3007 - remove remaining HP-UX references in XPCOM 2026-03-28 08:39:01 -04:00
Moonchild a1fe345c98 No issue - Add 10.4 and 26.* SDK versions to KNOWN_SDK_VERSIONS
For Mac builds as requested by dbsoft.
Sorted the entries by major version for readability.
2026-03-28 08:37:42 +01:00
Basilisk-Dev a1caa316a7 Issue #2551 - implement TypedArray.prototype.toSorted 2026-03-27 13:35:04 -04:00
Moonchild 1011058248 Merge pull request 'Update document.currentScript implementation to align with current spec' (#3021) from currentScript-work into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3021
2026-03-26 14:59:30 +00:00
athenian200 b9842306a4 merge upstream 2026-03-26 02:29:44 +00:00
Jeremy Andrews 5d63edee09 Issue #2974 - Part 66: client.mk and configure.in shouldn't invoke Python 2.
This was unneeded on my system because I made sure the build system couldn't
find Python 2 on the PATH, forcing it to use Python 3. Many developers may
be in environments with both available, so this should be changed.
2026-03-25 21:06:01 -05:00
Moonchild dc9a5cd350 Merge pull request 'Implement window.MathMLElement global.' (#3022) from dbsoft/UXP:mathmldom-work6 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3022
Reviewed-by: Moonchild <moonchild@palemoon.org>
2026-03-25 21:52:41 +00:00
Jeremy Andrews 017e021c37 Issue #2974 - Part 65: Last-minute Linux fixes.
Forgot to test packaging on Linux this whole time.

Also, kept forgetting to commit these random changes to mozbuild
files that just refer to GNU/kFreeBSD consistently as kFreeBSD.

Not because it's the right thing to call it, but because it's
what we have in the enums that works consistently right now.
And ripping out support entirely would be out of scope.
2026-03-25 11:47:07 -05:00
Jeremy Andrews 12641659e6 Issue #2974 - Part 64: Use venv in VirtualenvManager.
I felt like this was a cheat when I did it in my hacky build, and
seriously thought ChatGPT was just suggesting this because it was too
lazy to figure out how to fix virtualenv. I learned several things:

- The approach virtualenv 15.x uses to simulate a Python environment
  does not work after Python 3.10. So we'd need a newer virtualenv
  anyway, which has different quirks. I got it to "work" on Python 3.11...
  but only by copying (almost) the whole stdlib and a bunch of DLL files to
  bootstrap it. Which is no longer a virtualenv, it's... just an env.

- VirtualenvManager is Mozilla's code, not a part of virtualenv itself.
  Which means everything we need is now contained within our own code,
  no third-party module like virtualenv required.

- Our build system doesn't depend on virtualenv quirks at all. In
  a pinch, if you copy all the .pth files it generates into the
  system's site-packages directory (after turning them all into
  absolute paths), it would even run under system Python. It really
  only "needs" virtualenv to find its own modules because of how it
  was designed.

- I've tested venv extensively across a wide range of Python 3 versions.
  not a single one has any issues or behaves in a noticably different
  fashion from a build based on a repaired virtualenv extended up to
  Python 3.10, which means no regressions were introduced by the switch.

- Python's devs want the venv route over the way virtualenv did things.
  PEP 405 was very critical of virtualenv's design, and PEP 587 created a
  a new configuration mechanism precisely so no application would have to
  do what virtualenv did to get isolation without copying
  the whole interpreter into another directory.

- Mozilla also did something similar in BZ 1766497, so they clearly
  thought venv had enough features for their build system.
2026-03-25 04:33:16 -05:00
Jeremy Andrews 16f351a14c Issue #2974 - Part 63: Bring in lex and yacc from "dirty" migration.
These versions work on 3.14, my attempt at a cleaner solution did not.
Besides, they apparently were designed for Python 3 to start with.
The mid-to-late parts of that migration were mostly correct, it seems.

Ref: https://repo.palemoon.org/athenian200/UXP/commit/4117ccfc36284845cb4c75cf4e3d5a8997417225#diff-48dc6c6013e343ba4e196819d2cd873b3d576140
2026-03-25 01:27:12 -05:00
Brian Smith 80c7d08eee Issue #2548 - Part 5 - Implement the HTMLOrForeignElement mixin.
https://bugzilla.mozilla.org/show_bug.cgi?id=1577660
Add 'preventScroll' option to HTMLElement's, SVGElement's and XULElement's 'focus' method.
https://bugzilla.mozilla.org/show_bug.cgi?id=1374045
2026-03-24 19:38:41 -05:00
Brian Smith a8c59c38d4 Issue #2548 - Part 4 - Fix some missed changes for ElementCSSInlineStyle.
Introduce GlobalEventHandlers/DocumentAndElementEventHandlers/ElementCSSInlineStyle mixin.
https://bugzilla.mozilla.org/show_bug.cgi?id=1579457
2026-03-24 19:38:41 -05:00
Brian Smith 9bf46d80f1 Issue #2548 - Part 3 - Fix some MathML issues encountered since WebIDL works.
Add an nsContentUtils API for getting the CallerType of a JSContext.
https://bugzilla.mozilla.org/show_bug.cgi?id=1316616
Also added a Fetch() change that was not in the Mozilla patch.
2026-03-24 19:38:41 -05:00
Brian Smith 638c7f07f7 Issue #2548 - Part 2 - Collection of WebIDL parsing updates in an attempt to fix partial interface mixin error.
We should ensure, at build-time, that partial interfaces are defined in the same file as the interface they extend.
Since our build system doesn't really support correct dep builds if they're placed in a different file.
https://bugzilla.mozilla.org/show_bug.cgi?id=1333117
WebIDL: Better error message for trying to inherit from a mixin.
https://bugzilla.mozilla.org/show_bug.cgi?id=1575384
Fix webidl identifier conflicts involving typedefs to produce saner exceptions.
https://bugzilla.mozilla.org/show_bug.cgi?id=1531623
Disallow nullable types for WebIDL constants.
https://bugzilla.mozilla.org/show_bug.cgi?id=1535647
Add support for extended attributes on types in Web IDL
https://bugzilla.mozilla.org/show_bug.cgi?id=1359269
Allow LenientFloat to be only in a specific overload
https://bugzilla.mozilla.org/show_bug.cgi?id=1020975
2026-03-24 19:38:41 -05:00
Brian Smith 8e01b2d181 Issue #2548 - Part 1 - Implement MathML DOM and pre-requisites.
https://bugzilla.mozilla.org/show_bug.cgi?id=1571487
Introduce interface mixins.
https://bugzilla.mozilla.org/show_bug.cgi?id=1414372
Switch XPathEvaluator to using IDL mixins and remaining users of IDL "implements" over to mixin syntax.
https://bugzilla.mozilla.org/show_bug.cgi?id=1574195
Introduce GlobalEventHandlers/DocumentAndElementEventHandlers/ElementCSSInlineStyle mixin.
https://bugzilla.mozilla.org/show_bug.cgi?id=1579457
Introduce DocumentAndElementEventHandlers to more closely align with the HTML spec.
https://bugzilla.mozilla.org/show_bug.cgi?id=1330457
Remove the use of IsCallerChrome in FetchRequest.
https://bugzilla.mozilla.org/show_bug.cgi?id=1335368
2026-03-24 19:38:41 -05:00
Jeremy Andrews 235db83ca0 Issue #2974 - Part 62: Replace cgi.escape with html.escape.
The cgi module was removed from Python 3.14. html module has almost
the exact same thing, and this was apparently used to format html
rather than cgi anyway, so it's probably more correct.

Ref: PEP 594
https://peps.python.org/pep-0594/#cgi
2026-03-24 18:39:27 -05:00
Moonchild 3a4dc8de41 Issue #3020 - Clear currentScript after running microtasks
Per HTML spec:

`document.currentScript` Returns null if the Document is not currently
executing a script or SVG script element (e.g., because the running
script is an event handler, or a timeout), or if the currently executing
script or SVG script element represents a module script.

---

It's ambiguous about whether, for micro tasks, it should return null.
(This section is labelled as "non-normative", as well.)
However, mainstream browsers handle this differently and don't return
null after running microtasks, so we need to clear this and not assume
null persistently, and run the auto-updater for it, regardless if
it's a module or not.
2026-03-24 20:44:13 +01:00
Moonchild 18595b01b6 Issue #3020 - Update currentScript when dealing with shadow DOM.
`currentScript` should be null when evaluating scripts from shadow DOM.
2026-03-24 15:53:04 +01:00
Moonchild f7215fc685 Issue #3020 - document.currentScript should be null in modules
This is done correctly in `EvaluateScript`, but `CreateModuleScript` was
still setting currentScript to an element.
2026-03-24 15:50:34 +01:00
Moonchild 08521d4651 Merge pull request 'Remove Itanium/ia64 support from xpcom' (#3018) from Basilisk-Dev/UXP-contrib:xpcom-itanium-cleanup into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3018
2026-03-24 11:18:04 +00:00
Jeremy Andrews 160e956ab5 Issue #2974 - Part 61: Python 3.14 AST changes.
This was done sloppily in my initial work, this is a bit more clean.

Ref: https://docs.python.org/3/deprecations/pending-removal-in-3.14.html
2026-03-24 05:11:44 -05:00
Jeremy Andrews 2cecbc0e7f Issue #2974 - Part 60: Last fixes for virtualenv.
After 3.10, it won't work anymore... thankfully lack of virtualenv
wasn't the cause of busted symlinks on Linux after all.
2026-03-24 05:04:58 -05:00
Moonchild 00b177d75f Merge pull request 'Fix Shadow DOM spellchecker crash' (#3014) from spellcheck-shadowdom-work into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3014
2026-03-23 23:48:49 +00:00
Jeremy Andrews 11226f5308 Issue #2974 - Part 59: Make backend file generation more deterministic.
This led to a lot of false positives while trying to resolve the other
issue. The changes don't seem to cause harm, so I'd like to keep them...
they make debugging easier.
2026-03-23 12:14:25 -05:00
Jeremy Andrews 8ff0eb3b1c Issue #2974 - Part 58: Fix regexes and lexer on Python 3.11+
Newest versions of Python 3 do not like lex.py or the regexes used by
xpidl. These workarounds allow it to work anyway.
2026-03-23 12:09:24 -05:00
Jeremy Andrews 2bb084e824 Issue #2974 - Part 57: Prevent backend regeneration loop.
Sometimes Python 3.11+ keeps thinking the backend has changed due to
excessively precise timestamps or something. This workaround makes sure
that make doesn't regenerate the backend more than once per run.
2026-03-23 12:07:25 -05:00
Moonchild a89a071049 Merge pull request 'implement TypedArray.prototype.with' (#3019) from Basilisk-Dev/UXP-contrib:typedarray-with into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3019
2026-03-23 15:18:47 +00:00
Basilisk-Dev f9dc8a091a Issue #2551 - implement TypedArray.prototype.with 2026-03-23 08:50:01 -04:00
Basilisk-Dev 944299ed6c Issue #3007 - Remove Itanium/ia64 support from xpcom 2026-03-23 08:15:51 -04:00
Moonchild 0e1441155c Merge pull request 'Issue #3016 - allow url.CanParse to use custom-scheme bases to match current spec' (#3017) from Basilisk-Dev/UXP-contrib:url-canparse-spec-compliance into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3017
2026-03-23 05:23:18 +00:00
Moonchild 7bf5dfe4e4 Merge pull request 'Modify valgrind logging in libavutil to require MOZ_VALGRIND' (#3010) from Basilisk-Dev/UXP-contrib:ffvpx-valgrind into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3010
Reviewed-by: Moonchild <moonchild@palemoon.org>
2026-03-22 21:23:00 +00:00
Basilisk-Dev d4c34fc9f7 Issue #3009 - updated libavutil to keep HAVE_VALGRIND_VALGRIND_H as the primary gate, with MOZ_VALGRIND added inside it 2026-03-22 16:57:34 -04:00
Basilisk-Dev 6811005551 Issue #3016 - allow url.CanParse to use custom-scheme bases to match current spec 2026-03-22 16:48:43 -04:00
Moonchild 464cefa127 Merge pull request 'Attempt to fix Cloudflare image resizing' (#3012) from wuggy/UXP:master into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3012
Reviewed-by: Moonchild <moonchild@palemoon.org>
2026-03-22 14:42:51 +00:00
Moonchild c94a1ab5d3 Merge pull request 'Issue #3007 - remove itanium support and references from webrtc' (#3015) from Basilisk-Dev/UXP-contrib:webrtc-itanium-cleanup into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3015
2026-03-22 14:40:10 +00:00
Jeremy Andrews c089567185 Issue #2974 - Part 56: Full Python 3.10 support.
Deal with rU full deprecation and collections.abc move being enforced.
2026-03-22 05:18:14 -05:00
Jeremy Andrews 62397ff43e Issue #2974 - Part 55: Remove pip from build system, fix Linux builds.
pip was apparently breaking Linux builds and I didn't even notice. Turns out
virtualenv doesn't even need pip, and Python ships its own pip so I don't know
why this was even needed...
2026-03-22 04:53:47 -05:00
Basilisk-Dev 8aa5b35605 Issue #3007 - remove itanium support and references from webrtc 2026-03-22 01:05:18 -04:00
Basilisk-Dev 25dd1fb31a Issue #3009 - restore valgrind functionality in libavutil and hide behind MOZ_VALGRIND instead 2026-03-21 22:52:25 -04:00
wuggy d8cf2c8b44 Cloudflare Image Resizing fix take 3 part 2 (all.js) 2026-03-21 13:28:57 +00:00
wuggy 938c5d08d4 Cloudflare Image Resizing fix take 3 part 1 (main fixup) 2026-03-21 13:26:34 +00:00
Moonchild 7fca2b8de3 Issue #2739 - Follow-up: remove missed configure bits.
We still accepted {en|dis}able-jxl as a valid old-configure option and
there were a few leftover pref conditionals.
2026-03-21 11:57:15 +01:00
Jeremy Andrews 458f60d071 Issue #2974 - Part 54: Replace distutils.strtobool with custom implementation.
Another sys.path.append hack in virtualenv made necessary by an stdlib
deprecation. Sigh.

Ref: BZ 1877347
2026-03-20 20:21:45 -05:00
Jeremy Andrews 63752e83a5 Issue #2974 - Part 53: Replace distutils.sysconfig with sysconfig.
Fairly straightforward. Not too many problems here.
2026-03-20 18:09:10 -05:00
Jeremy Andrews 033b7f5219 Issue #2974 - Part 52: Read /etc/os-version manually to fill in missing logic.
There are third-party packages that will do this... but every distro
we support uses /etc/os-version now, and we only check in one place.
2026-03-20 14:36:23 -05:00
wuggy ef19ad3ffd Cloudflare Image Resizing fix take 2
Better documentation and about:config pref controlled (network.url.cloudflare_image_resizing.enabled)
2026-03-20 19:02:52 +00:00
Jeremy Andrews 9c10d36094 Issue #2974 - Part 51: Replace imp with importlib.
imp was actually still available up until Python 3.9 or so. Ripping
it out made me go through the headache of debugging our import logic.
Granted, it was deprecated long ago and there was plenty of warning, but
since we are doing the migration now it's all hitting at once if we want
to support any semi-modern Python.
2026-03-20 13:29:08 -05:00
Moonchild ab88527fe6 Issue #3011 - Part 3: Handle edge case for spellchecking.
Make spellchecking work in Shadow DOM after anchor navigates away from it.
2026-03-20 17:07:55 +01:00
Moonchild 6c0ff1881a Issue #3011 - Part 2: Switch spellchecker root to Shadow DOM.
Set the root for spelling checker to shadow root if the contenteditable
nodes are in the shadow DOM. Bail if the position can't be set properly.
2026-03-20 14:45:11 +01:00
Moonchild 1e7f4c8474 Issue #3011 - Part 1: Add As{Text|Html}Editor() and AsEditorBase()
This adds helper functions to get specific types of content editors (if
possible) through the nsIEditor interface, as opposed to doing manual
casting and the ad hoc `GetHTMLEditor()` function.

Helper functions are spread out over multiple headers due to the
circular dependency issues that would be triggered otherwise.
2026-03-20 13:26:18 +01:00
wuggy fdf491d4ec Cloudflare Image Resizing fix 2026-03-20 10:18:45 +00:00
Jeremy Andrews 19f0115559 Issue #2974 - Part 50: Remove distutils.version and replace.
Python no longer provides any version-related utilities in stdlib.

Did a thorough grep and made absolutely sure to replace every last
use. This was the work I was avoiding during my first port...

Ref: PEP 632, BZ 1777414, BZ 1858065, BZ 1766085
2026-03-20 04:14:03 -05:00
Basilisk-Dev 1f4cceca43 Issue #3009 - Remove valgrind logging in libavutil so that valgrind is no longer required at build time 2026-03-18 19:44:28 -04:00
Moonchild 542eaca577 Merge pull request 'LoongArch Support Followup - Do not hardcode jemalloc page size on LoongArch' (#3006) from Basilisk-Dev/UXP-contrib:loongarchpagesize into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3006
2026-03-18 23:02:13 +00:00
Basilisk-Dev 1cb6f56418 Issue #2897 followup - Do not hardcode jemalloc page size on LoongArch
Loongarch can run on either a 4k or 16k page size
2026-03-18 18:14:27 -04:00
Moonchild a503e883d9 Merge pull request 'Don't attempt on-stack replacement for TLA modules when interpreter loop encounters JSOP_LOOPENTRY' (#3002) from jobbautista9/UXP:2229-jsop_loopentry into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3002
2026-03-18 15:21:31 +00:00
Moonchild 347681c219 Merge pull request 'Implement array.prototype.toSpliced and array.prototype.with' (#3005) from Basilisk-Dev/UXP-contrib:arraybycopy into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3005
2026-03-17 20:31:34 +00:00
Jeremy Andrews 5188aa4874 Issue #2974 - Part 49: Various logging fixes.
Try to ensure error messages from mozbuild are readable...
2026-03-17 03:42:38 -05:00
Jeremy Andrews 4e11fab9b4 Issue #2974 - Part 48: Python 3.8+ related fixes.
Got everything working under older Python 3, to deal with fewer issues at once.
Now the following had to be done:

- time.clock had to be replaced with time.process_time
- Drive letters now need explicit normalization because they are uppercase
by default (was the reason why I had to turn everything into a relpath before).
- Virtualenv works, but needs a couple extra modules because of new includes
in newer Python 3 versions.
2026-03-17 03:10:33 -05:00
Jeremy Andrews 8cb419166a Issue #2974 - Part 47: Fix packaging.
Tested ./mach package, ./mach mozpackage, ./mach installer, and ./mach mar
Everything should work.
2026-03-16 19:28:14 -05:00
Basilisk-Dev 2984237f4f Issue #2551 - implement array.prototype.toSpliced 2026-03-16 14:33:50 -04:00
Basilisk-Dev 1c4a73de71 Issue #2551 - implement array.prototype.with 2026-03-16 14:27:02 -04:00
Jeremy Andrews e431c0cb13 Issue #2974 - Part 46: Linux-related fixes.
Also moved the Windows version of my NSDISTMODE=copy thing where
I meant to have it in the first place, it was misplaced before.
2026-03-16 05:25:34 -05:00
Job Bautista d27df4d88f Issue #2229 - Follow-up: Don't attempt on-stack replacement for TLA modules
When interpreter loop encounters JSOP_LOOPENTRY, we should not let TLA modules
enter baseline JIT.
2026-03-16 11:28:25 +08:00
Jeremy Andrews 889a1c39c5 Issue #2974 - Part 45: Miscellaneous build system tweaks.
Most notably, these tweaks were needed to fix ./mach build faster.
Also chose to set NSDISTMODE=copy by default for Windows, since
wildcards will be symlinks otherwise. This will always fail
because our binaries have the symlinked MSVC DLLs in their import
tables, and Windows loader silently fails in this situation.
2026-03-15 19:01:00 -05:00
Jeremy Andrews 6c77f329da Issue #2974 - Part 44: Make ppCheck Python 3 compatible.
I also wound up having it point out files that can't be decoded as UTF-8.
Not sure if it was the right move, can remove that feature if it's not wanted.
2026-03-15 18:51:24 -05:00
Jeremy Andrews 0e0823a4df Issue #2974 - Part 43: Import random NSIS installer file from Mozilla.
This file was already ported to Python 3 by them, and hasn't seen breaking
changes, so it was safe to use.

Ref: BZ 1633016, BZ 1751990
2026-03-15 15:58:44 -05:00
Jeremy Andrews f335e05ff6 Issue #2974 - Part 42: Jar and preprocessor changes.
For strings/bytes issue, used a similar strategy to what I saw in our old
layout code, having a flag set to be false by default as it's passed from
function to function, eventually being activated and doing something at
a specific point in the loop if it's ever true. The datetime stuff is
simply because in Python 3, integer comparisons were failing so I had
to make both sides be an integer Unix timestamp.
2026-03-15 15:49:04 -05:00
Jeremy Andrews 74762d6567 Issue #2974 - Part 41: Update configobj to version 5.
This version is compatible with Python 3 already.
2026-03-14 20:12:48 -05:00
Jeremy Andrews 1545a33858 Issue #2974 - Part 40: Miscellaneous build system tweaks prior to new configobj.
More small tweaks mostly related to decoding/encoding, some not even related to
failures but are more anxiously done in anticipation of something going wrong.
Even though these are called commits, I often revise little things several
times because I am not sure what the most robust approach would be.
2026-03-14 19:57:16 -05:00
Jeremy Andrews 1801a9148d Issue #2974 - Part 39: Fix early WebIDL generation issues. 2026-03-14 19:55:21 -05:00
Jeremy Andrews deff79b573 Issue #2974 - Part 38: Fix early IPDL generation issues.
This is fewer issues than I remember encountering last time... 2to3 must have
helped. Though I won't hold my breath that newer Python 3 will be this
forgiving when I get around to that near the end.
2026-03-14 19:54:14 -05:00
Jeremy Andrews 0dbe65d6af Issue #2974 - Part 37: Fix malformed track files.
The issue was essentially that the fourth field was being stripped due to the
way Python 3 handles text. I solved the problem originally with a "pad" hack to
add the extra space back in, since that actually gets interpreted as a reference
to the current directory. The eventual solution mostly involved using . instead of
a blank space to refer to the current directory. Don't know if the other stuff
was needed, may remove later if it causes any issues.
2026-03-14 18:51:21 -05:00
Moonchild 9562888e77 Merge pull request 'Flatten nested CSS to standard CSS before parsing (fix sites using nested CSS)' (#2999) from Basilisk-Dev/UXP-contrib:nested-css into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2999
Reviewed-by: Moonchild <moonchild@palemoon.org>
2026-03-14 18:24:58 +00:00
Moonchild 5536b38401 Merge pull request 'Add AudioNode constructors' (#2988) from audionode-constructors-pr into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2988
2026-03-14 18:19:08 +00:00
Moonchild c011b271a1 Issue #3001 - Restore table reference frame call.
While the result value was only used for debug purposes, the function
`FindReferenceFrameFor` also updates the reference frame for use
outside of debug builds. The opaque double use of this function
was not clear from code inspection and it was erroneously removed.

Resolves #3001
2026-03-14 19:16:41 +01:00
Basilisk-Dev c21fb81d3e Issue #2862 - css nesting pref true by default 2026-03-14 13:23:54 -04:00
Basilisk-Dev 5a3dcf5939 Issue #2862 - Remove unused vars in CSS flattener 2026-03-14 13:22:59 -04:00
Jeremy Andrews 04e6f86a60 Issue #2974 - Part 36: Fix XPIDL and XPT generator.
Most of this is taken from my original port, but I did revisit xpt.py
and rework the way cmp was translated to Python 3 by using a
ComparableMixin class.
2026-03-14 01:27:31 -05:00
Moonchild 1d709fe942 Merge pull request 'Update expat source to 2.7.4 and apply local patches' (#2998) from jobbautista9/UXP:expat-2.7.4 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2998
2026-03-13 17:06:21 +00:00
Moonchild e55c16146f Issue #2993 - Follow-up: Clobber. 2026-03-13 16:19:56 +01:00
Basilisk-Dev 997a9a3e13 Issue #2862 - Change tests from lowering to flattening 2026-03-13 09:01:56 -04:00
Basilisk-Dev 008f38579c Issue #2862 - Change code references from CSS lowering to CSS flattening 2026-03-13 08:58:18 -04:00
Basilisk-Dev d943e86b28 Issue #2862 - handle more edge cases in css lowering 2026-03-12 08:44:03 -04:00
Basilisk-Dev 3f2d707a83 Issue #2862 - more tests files for nested css 2026-03-12 08:43:58 -04:00
Basilisk-Dev b145a93ad6 Issue #2862 - Split the css lowering functionality out to a separate file for easier maintenance 2026-03-12 08:43:53 -04:00
Basilisk-Dev 3056028db4 Issue #2862 - Fix a few nested selectors 2026-03-12 08:43:48 -04:00
Basilisk-Dev b4dac14720 Issue #2862 - Modify the css lowerer so that the lowering pass now recognizes bare type-selector nested rules and combinator-led cases 2026-03-12 08:43:42 -04:00
Basilisk-Dev 76694b956f Issue #2862 - add initial nested css test file 2026-03-12 08:43:33 -04:00
Basilisk-Dev 9fab5b3e3c Issue #2862 - Initial attempt at a css lowering 2026-03-12 08:43:23 -04:00
Job Bautista d54491fdd0 Issue #2997 - Update expat source to 2.7.4 and apply local patches. 2026-03-12 13:50:10 +08:00
Moonchild 00c3c3a546 Merge pull request 'Only use SVE instructions on Apple Silicon (disable on aarch64 Linux)' (#2994) from Basilisk-Dev/UXP-contrib:vpx-sve into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2994
2026-03-11 20:50:08 +00:00
Moonchild 1da5c344be Merge pull request 'Implement TypedArray.prototype.toReversed()' (#2996) from Basilisk-Dev/UXP-contrib:typed-toReversed into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2996
2026-03-11 20:28:21 +00:00
Moonchild 76d66b5dad Merge pull request 'Work around macOS WebGL crash on unconsumed vertex attrib arrays' (#2995) from Basilisk-Dev/UXP-contrib:webgl-crash into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2995
2026-03-11 20:23:20 +00:00
Basilisk-Dev e502735eb2 Issue #2993 - only use SVE instructions on Apple Silicon (disable on aarch64 Linux) 2026-03-11 15:07:09 -04:00
Basilisk-Dev edfebe1b99 Issue #2551 - Implement TypedArray.prototype.toReversed() 2026-03-11 15:04:16 -04:00
Moonchild 250e4f75da Merge pull request 'Avoid empty replacements in macro expansion.' (#2986) from 2978 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2986
2026-03-11 19:03:59 +00:00
Basilisk-Dev 53f1bdd9c2 Issue #2978 - Work around macOS WebGL crash on unconsumed vertex attrib arrays 2026-03-11 14:25:20 -04:00
Jeremy Andrews 214fc9bdfb Issue #2974 - Part 35: FileAvoidWrite changes and other tweaks after new gyp.
Most notable changes are the ugly stuff I had to do in FileAvoidWrite and
everything that interacts with it, which is where I expect a lot future pain
and revision to enter the picture from, if I have to revisit this part of the
work again.
2026-03-11 02:17:23 -05:00
Jeremy Andrews 3dd092c8d8 Issue #2974 - Part 34: Import new version of gyp, ensure it finds six.
Dropping this in actually just works for NSS (no promises this will hold true
with Basilisk), because gyp's design is a lot more conservative and consistent
compared with upstream Mozilla code. For some reason, the new gyp couldn't find
the six library it relies on that's already in our tree, and the library also
needed a small update. Also incorporates a few simple Python 3 tweaks to our
gyp_reader code.
2026-03-11 01:59:39 -05:00
Moonchild ade298d0a7 Merge pull request 'Issue #2990 - implement object.GroupBy' (#2991) from Basilisk-Dev/UXP-contrib:objectgroupby into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2991
2026-03-10 15:24:08 +00:00
Basilisk-Dev 387b01ce14 Issue #2990 - implement object.GroupBy 2026-03-10 10:45:54 -04:00
Moonchild 47d2094329 Merge pull request 'Issue #2926 - Tweak mimalloc performance tunables' (#2989) from Basilisk-Dev/UXP-contrib:mimalloc-tweaks into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2989
2026-03-10 13:48:48 +00:00
Basilisk-Dev 43f9a8e1f0 Issue #2926 - Tweak mimalloc performance tunables:
MI_DEFAULT_PURGE_DECOMMITS=0 - fewer costly kernel operations and fewer immediate recommit/zero-fill penalties on reuse.

MI_DEFAULT_PURGE_DELAY=500 - short-lived allocation bursts can reuse pages directly, avoiding purge/reclaim ping-pong.

MI_DEFAULT_GENERIC_COLLECT=50000 - lower background allocator housekeeping overhead on hot allocation paths.
2026-03-10 09:08:14 -04:00
Jeremy Andrews cb559a5eb2 Issue #2974 - Part 33: Miscellaneous build system tweaks prior to new gyp.
Not really sure how to categorize these, except they are either
language-related cleanups, small bug fixes, or are careful to decode
things using the preferred OS encoding where reasonable. A lot of UTF-8 only
worked by luck because it only tried to decode ASCII bytes, or had good
replacements for bad chars due to explicit error handling.

I'm basically just commiting the last state before I update gyp, because
I can't really proceed without updating it, and that's a big enough step I want
it to have its own commit... and also don't want it mixed in with other stuff.
2026-03-09 23:28:50 -05:00
Jeremy Andrews 313dcc69fa Issue #2974 - Part 32: Fix configure sandbox builtins, update encoding guards. 2026-03-09 18:40:53 -05:00
Jeremy Andrews 367505a1b0 Issue #2974 - Part 31: Fix indented_repr and TypedTuple, remove encode.
indented_repr and encode were introducing corruption into config.status
blocking the build. TypedTuple's logic needed to change a bit due to Python 3.
encode can just be removed because it does more harm than good now.
indented_repr was fixed. Note it was always limited to ASCII range because
that's the "safe zone" CP1252 and UTF-8 have in common. Investigate replacing
this with pprint and repr if we ever need Unicode in config.status...
2026-03-09 17:44:33 -05:00
Jeremy Andrews fb669b392c Issue #2974 - Part 30: Address strict EnumString handling in OS_ARCH/OS_TARGET. 2026-03-09 17:16:11 -05:00
Jeremy Andrews b818d7905a Issue #2974 - Part 29: More fixes to virtualenv.
Wasn't as hard as I expected to get this working. Mostly just missing imports,
and they are only missing because Mozilla added a couple to the base import
that caused no issues on Python 2, but require an additional slew of imports
on Python 3.
2026-03-09 16:13:55 -05:00
Jeremy Andrews 827b1052ea Issue #2974 - Part 28: Further fixes to processhandler and winprocess.
This is apparently the one place we can't use UTF-8 on Windows, we absolutely
need CP1252 here. Mozilla originally avoided a lot of these encoding issues by
treating everything as bytes. That trick won't fly in Python 3, so we now
have to deal with text streams and face Windows and Unicode issues.

Ref: BZ 1585702
2026-03-09 16:01:44 -05:00
Moonchild 77f8cae06e Issue #2978 - Avoid empty replacements in macro expansion.
If the replacements array is empty, don't attempt to do any work on the
existing macro, and return. This should prevent infinite recursion in
some cases.
Order matters here: we're relying on the `if` statement shortcut so
`collectMacroArgs()` doesn't get called.
2026-03-09 16:04:57 +01:00
Moonchild 14122475be Issue #2981 - Add nullcheck in GetPointerCapabilities (uplift)
Uplift to release.
2026-03-09 11:32:39 +01:00
Jeremy Andrews 04b9a2f949 Issue #2974 - Part 27: Actually fix processhandler.py.
This is the work I was trying to avoid in my initial port... now it's time to
actually do it.

Ref: BZ 1473498, BZ 1428713, BZ 1799483
2026-03-07 22:49:29 -06:00
Jeremy Andrews d9821226cf Issue #2974 - Part 26: Clean up more bytestrings and fix busted logging system.
Also modified virtualenv.py just enough to see the next failure mode.
2026-03-07 22:20:02 -06:00
Jeremy Andrews 17e3d48201 Issue #2974 - Part 25: Logic changes in decorators and string_version.
In decorators.py, the original logic fails because cls.__init__ is now a
function instead of a method in Python 3.

In string_version.py, the issue is that str.__init__(self, args) is no longer a
valid way of referencing the parent class of the function, the no-argument
super() can do that in Python 3 properly by using the __class__ cell variable.

Ref: PEP 3135
https://peps.python.org/pep-3135/
2026-03-06 21:35:00 -06:00
Jeremy Andrews 151ca2805b Issue #2974 - Part 24: Stop encoding strings to bytes in configure and clobber. 2026-03-06 20:06:10 -06:00
Jeremy Andrews 93272b0ac0 Issue #2974 - Part 23: Clean up old string logic in configenvironment/mozinfo.
No real logic changes here, just obvious work.
2026-03-06 19:57:51 -06:00
Jeremy Andrews 763e812c4c Issue #2974 - Part 22: Fix-up main.py and config.py.
The bytestrings seem to break the build system. Also, get_hex is no longer a
thing, those two basestrings can become str (had to check), and
also noticed load_settings was ignoring its own argument.

Ref: BZ 1473498, BZ 1739556
https://hg-edge.mozilla.org/mozilla-central/rev/fa5e23975029
2026-03-06 18:39:10 -06:00
Jeremy Andrews 6433d1d7a4 Issue #2974 - Part 21: Disable old Win32 hack on Python 3.4+
The issue requiring this only affected older versions of Python 3.
Newer Python 3 no longer requires this. Mozilla also did this in their
initial Python 3 support, after moving the hack itself from mach to
somewhere in mozbuild. This commit also unblocks newer Python versions.

Ref: BZ 1473498
https://hg-edge.mozilla.org/mozilla-central/rev/fa5e23975029
2026-03-06 03:14:53 -06:00
Jeremy Andrews ae877638e8 Issue #2974 - Part 20: Use last few fixers.
Just rush through the last ones I semi-trust...

2to3 . --fix methodattrs -wpn
''           funcattrs   ''
''           has_key     ''
''           renames     ''
''           types       ''
''           nonzero     ''

Ref:
https://docs.python.org/3/whatsnew/3.0.html
2026-03-06 02:08:07 -06:00
Jeremy Andrews e12d6ebd5e Issue #2974 - Part 19: Use various fixers.
Mostly exec and execfile, but also StandardError and sys_exc.

2to3 . --fix exec -wpn
''           execfile ''
''           sys_exc  ''
''           standarderror ''

Ref:
https://docs.python.org/3/whatsnew/3.0.html
2026-03-05 22:10:28 -06:00
Jeremy Andrews 7abb343363 Issue #2974 - Part 18: Use str instead of unicode.
The standard str is unicode now...

2to3 . --fix unicode -wpn

Ref:
https://docs.python.org/3/whatsnew/3.0.html
2026-03-05 21:38:47 -06:00
Jeremy Andrews af6ae6a1d3 Issue #2974 - Part 17: Use new unittest names.
2to3 . --fix asserts -wpn

Ref:
https://docs.python.org/3.11/library/unittest.html#deprecated-aliases
2026-03-05 21:11:31 -06:00
Jeremy Andrews 69d2d3f47d Issue #2974 - Part 16: Adapt apply.
Syntax change, also cleaning up stuff from previous change.

2to3 . --fix apply -wpn

Ref:
https://docs.python.org/3/whatsnew/3.0.html
2026-03-05 20:00:40 -06:00
Jeremy Andrews 0ce9d8f121 Issue #2974 - Part 15: Adapt itertools.
Ordinary versions of these functions are iterators now,
rather than lists...

2to3 . --fix itertools -wpn
2to3 . --fix itertools_imports -wpn

Ref:
https://docs.python.org/3/whatsnew/3.0.html#range
2026-03-05 19:46:43 -06:00
Jeremy Andrews 0c61ee391c Issue #2974 - Part 14: Moved libraries and imports.
reduce is moved to functools, urllib reogranized.

2to3 . --fix urllib -wpn
2to3 . --fix reduce -wpn
2to3 . --fix import -wpn
2to3 . --fix imports -wpn
2to3 . --fix imports2 -wpn

Ref: PEP 3108, PEP 3100
https://peps.python.org/pep-3108/
https://peps.python.org/pep-3100/
2026-03-04 20:24:12 -06:00
Jeremy Andrews 5fdc8dd723 Issue #2974 - Part 13: Adapt octal number syntax.
Used to be like C, with 0755 or something, now it's
0o755. Also, long and int are the same type now.

2to3 . --fix numliterals -wpn
2to3 . --fix long -wpn

Ref: PEP 3127, PEP 237
https://peps.python.org/pep-3127/
https://peps.python.org/pep-0237/
2026-03-04 20:03:01 -06:00
Jeremy Andrews 5af8e3ba5c Issue #2974 - Part 12: Adapt metaclass syntax.
It seems to have moved out of the body of the function,
into the class definition. Hit this a couple times...

2to3 . --fix metaclass -wpn

Ref: PEP 3115
https://peps.python.org/pep-3115/
2026-03-04 18:55:13 -06:00
Jeremy Andrews 2f37a44b8f Issue #2974 - Part 11: Adapt iterator.next().
2to3 . --fix next -wpn

Ref: PEP 3114
https://peps.python.org/pep-3114/
2026-03-04 18:39:49 -06:00
Jeremy Andrews 6454d7492f Issue #2974 - Part 10: Adapt tuple unpacking.
2to3 . --fix tuple_params -wpn

They actually had a fixer for this?! Anyway... yeah,
Py2 allowed tuple parameter unpacking. Py3 doesn't.
However, the adaptations are fairly mechanical.

Ref: PEP 3113
https://peps.python.org/pep-3113/
2026-03-04 15:52:40 -06:00
Jeremy Andrews c77e0a8cec Issue #2974 - Part 9: Adapt input and raw_input
2to3 . --fix input -wpn
2to3 . --fix raw_input -wpn

Py2 input is the new Py3 input wrapped in eval tags.
The new input is the old raw_input.
This lets you have the old behavior. Mechanical.

Ref: PEP 3111
https://peps.python.org/pep-3111/
2026-03-04 15:16:45 -06:00
Jeremy Andrews 46f126c10c Issue #2974 - Part 8: Adapt except
2to3 . --fix except -wpn

Python 3 exception syntax is different. Comma-based syntax is gone,
much like print syntax is changed.
This lets you have the old behavior. Mechanical.

Ref: PEP 3110
https://peps.python.org/pep-3110/
2026-03-04 15:00:58 -06:00
Jeremy Andrews 4906a75883 Issue #2974 - Part 7: Adapt raise
2to3 . --fix raise -wpn

Python 3 raise syntax is different. Three-argument raise is
deprecated, much like print syntax is changed.
This lets you have the old behavior. Mechanical.

Ref: PEP 3109
https://peps.python.org/pep-3109/
2026-03-04 14:16:18 -06:00
Jeremy Andrews 8c0f0ccdcf Issue #2974 - Part 6: Adapt dict
2to3 . --fix dict -wpn

Py2 dict was a list by default, the iterator versions
were switched around to be the default.
This lets you have the old behavior. Mechanical.

Ref: PEP 3106
https://peps.python.org/pep-3106/
2026-03-04 13:56:53 -06:00
Jeremy Andrews 112c119477 Issue #2974 - Part 5: Adapt zip
2to3 . --fix zip -wpn

Py2 zip was a list, now zip is an iterator.
This lets you have the old behavior. Mechanical.

Ref:
https://www.artima.com/weblogs/viewpost.jsp?thread=208549
2026-03-04 13:29:40 -06:00
Jeremy Andrews ec4f21e5e3 Issue #2974 - Part 4: Adapt map
2to3 . --fix map -wpn

Py2 map was a list, now map is an iterator.
This lets you have the old behavior. Mechanical.

Ref:
https://www.artima.com/weblogs/viewpost.jsp?thread=208549
2026-03-04 13:22:20 -06:00
Jeremy Andrews 42fbdd74fd Issue #2974 - Part 3: Adapt filter.
2to3 . --fix filter -wpn

Py2 filter was a list, now filter is an iterator.
This lets you have the old behavior. Mechanical.

Ref:
https://www.artima.com/weblogs/viewpost.jsp?thread=208549
2026-03-04 13:13:03 -06:00
Jeremy Andrews 49615281cd Issue #2974 - Part 2: Adapt range/xrange.
2to3 . --fix xrange -wpn

range takes the place of Py2 xrange.
Py2 range was a list. Mechanical, did
it by hand several times...

Ref:
https://docs.python.org/3/whatsnew/3.0.html#range
2026-03-04 08:33:16 -06:00
Jeremy Andrews e11fc9b4cf Issue #2974 - Part 1: Adapt all print statements.
2to3 . --fix print -wn
Essentially, print is a function instead of statement.
Ref:
PEP 3105
https://peps.python.org/pep-3105/
2026-03-04 03:48:01 -06:00
Moonchild d881e7ed56 Merge branch 'master' into release 2026-03-01 23:37:59 +01:00
Moonchild 9b0054c55f Merge branch 'master' into release 2026-02-27 19:28:35 +01:00
Moonchild baeae97784 Merge branch 'master' into release 2026-02-27 07:08:35 +01:00
Moonchild 0324bfa219 Re-sync master to release.
Post-merge synchronization to bypass rebase-shenanigans after backouts.
2026-02-24 17:25:53 +01:00
Moonchild b279fd025b Merge branch 'master' into release
# Conflicts:
#	js/src/jit/CodeGenerator.cpp
#	js/src/jit/arm/Lowering-arm.cpp
#	js/src/jit/arm64/Lowering-arm64.cpp
#	js/src/jit/mips32/Lowering-mips32.cpp
#	js/src/jit/mips64/Lowering-mips64.cpp
#	js/src/jit/shared/LIR-shared.h
#	js/src/jit/x64/Lowering-x64.cpp
#	js/src/jit/x86/Lowering-x86.cpp
#	mfbt/Xoroshiro128PlusPlusRNG.h
#	parser/expat/lib/xmlparse.c
2026-02-24 14:37:42 +01:00
Francis Dominic Fajardo f31546817a Issue #2828 - Follow-up: Simplify rule node tracking and ensure rule walker state isn't reset for the first child processor (uplift)
Styles contained in NAC shouldn't be tracked with their own rule node (as opposed to what was done in https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2859) because it causes precedence issues. This should now more closely imitate the original behavior where NAC and regular document styles (at least, the "unlayered" layer) are grouped together.

This also gets rid of the manual last rule node checks against null, since they are now consistently handled by the separate function.
2026-01-25 14:44:49 +01:00
Moonchild f272382a9c Revert "Issue #2895 - Part 1: Replace XorShift128+ with Xoroshiro128++"
This reverts commit c90df0c332.
2026-01-21 10:18:46 +01:00
Moonchild aa8af9d7f8 Revert "Issue #2895 - Part 2: Remove incorrect debug asserts."
This reverts commit 97786271f9.
2026-01-21 10:18:38 +01:00
Moonchild e1f03ae019 Revert "Issue #2895 - Part 1b: Update license block."
This reverts commit 12821ae90a.
2026-01-21 10:18:08 +01:00
Moonchild f316bc6535 Revert "Issue #2895 - Follow-up: Fix JIT code generator for 32-bit targets."
This reverts commit 8112ed2e6c.
2026-01-21 10:17:51 +01:00
Moonchild 82e4c66520 Revert "Issue #2889 - Part 0: Relocate Mozilla-specific files from Expat source."
This reverts commit f93d0fadf2.
2026-01-21 10:04:52 +01:00
Moonchild 3c923e0467 Revert "Issue #2889 - Part 1: Prepare Mozilla's changes and extensions for Expat 2.6.4."
This reverts commit 6c7850482f.
2026-01-21 10:04:44 +01:00
Moonchild 866985ac88 Revert "Issue #2889 - Part 2: Import Expat 2.6.4 source."
This reverts commit e7cacf4642.
2026-01-21 10:04:37 +01:00
Moonchild ba772b40ad Revert "Issue #2889 - Part 3: Apply Mozilla's patches to Expat 2.6.4."
This reverts commit 2ae8833092.
2026-01-21 10:04:29 +01:00
Moonchild 7a86f0e1b7 Revert "Issue #2889 - Part 4: Fix build and runtime issues."
This reverts commit ef1532cab2.
2026-01-21 10:04:22 +01:00
Moonchild 7e9286f2d8 Revert "Issue #2889 - Follow-up: Avoid conflicts with system version of libexpat"
This reverts commit e284ffab6c.
2026-01-21 10:04:14 +01:00
Moonchild b0d1e365ec Revert "Issue #2889 - Follow-up: void methods shouldn't return a value."
This reverts commit 647a1ab5f0.
2026-01-21 10:04:07 +01:00
Moonchild dbd5a2cbf4 Revert "Issue #2889 - Part 5: Rewrite patches for Expat 2.7.3."
This reverts commit 0f1faad9a3.
2026-01-21 10:03:58 +01:00
Moonchild d60fb1d5c0 Revert "Issue #2889 - Part 6: Import Expat 2.7.3 source."
This reverts commit 627fdf8fe4.
2026-01-21 10:03:49 +01:00
Moonchild 29c91fcdba Revert "Issue #2889 - Part 7: Apply patches to Expat 2.7.3."
This reverts commit 112abdc25a.
2026-01-21 10:03:40 +01:00
Moonchild fe65674f3f Revert "Issue #2889 - Follow-up: Allow generate_hash_secret_salt to be used." 2026-01-21 10:03:24 +01:00
Moonchild a3a6b5ed7e Revert "Issue #2889 - Follow-up: Adjust Expat 2.7.3 local patches for removal of 3rd patch."
This reverts commit 073378ec92.
2026-01-21 10:01:44 +01:00
Moonchild d2de8658a7 Revert "Issue #2889 - Follow-up: Remove fix for BZ 569229."
This reverts commit a22613d3e0.
2026-01-21 10:01:37 +01:00
Moonchild be785b4783 Merge branch 'master' into release
This resyncs platform to master, overwriting more recent backouts from
the release branch.
2026-01-16 23:16:32 +01:00
Moonchild 70e34941c4 [devtools] Remove newline kludge from "Copy as cURL" on Windows 2025-10-15 19:46:52 +02:00
Moonchild 545d52572d Revert "Issue #2828 - Part 1: Build and store the array of layer name tokens in the layer at-rules"
This reverts commit 253ec6706a.
2025-10-08 23:24:27 +02:00
Moonchild dfa0736b49 Revert "Issue #2828 - Part 2: Collect and hold rule cascade data per cascade layer"
This reverts commit a91b385f68.
2025-10-08 23:24:20 +02:00
Moonchild c7bb5664d9 Revert "Issue #2828 - Part 3: Refactor selector matching and rule cascade data into separate files/classes"
This reverts commit 211aa6d652.
2025-10-08 23:24:13 +02:00
Moonchild 6bbc6f3417 Revert "Issue #2828 - Part 4: Move cache key storage to ResolvedRuleCascades"
This reverts commit 202e354f87.
2025-10-08 23:24:07 +02:00
Moonchild 631169a312 Revert "Issue #2828 - Part 5: Implement child rule processors"
This reverts commit bc45ec4f57.
2025-10-08 23:24:02 +02:00
Moonchild 427b3312a6 Revert "Issue #2828 - Part 6: Assert rules were added to the rule cascade data"
This reverts commit be7a231579.
2025-10-08 23:23:56 +02:00
Moonchild 2287b0b57a Revert "Issue #2828 - Part 7: Walk child rule processors separately and ensure inverted cascade layer order is enforced for important rules"
This reverts commit c3e12fe822.
2025-10-08 23:23:50 +02:00
Moonchild 56aaba09b1 Revert "Issue #2828 - Part 8: Extract RuleProcessorGroup (formerly ResolvedRuleCascades) into separate file"
This reverts commit 5fda071898.
2025-10-08 23:23:45 +02:00
Moonchild 332938fef3 Revert "Issue #2828 - Part 9: Rename CascadeEnumData to CascadeLayer"
This reverts commit ebb0ae456c.
2025-10-08 23:23:39 +02:00
Moonchild 13710f7a06 Revert "Issue #2828 – Part 10: Clean up cascade layer constructor"
This reverts commit 047458a002.
2025-10-08 23:23:33 +02:00
Moonchild 530693099b Revert "Issue #2828 - Part 11: Detach weighted rule data from cascade layer"
This reverts commit b1c19137ad.
2025-10-08 23:23:28 +02:00
Moonchild f68aa7ea88 Revert "Issue #2828 - Part 12: Implement cascade layer SizeOfIncludingThis"
This reverts commit 5ef79e303f.
2025-10-08 23:23:23 +02:00
Moonchild 5bdaee5e40 Revert "Issue #2828 - Part 13: Exclude strong layers-related code from release builds"
This reverts commit e82fa3450a.
2025-10-08 23:23:18 +02:00
Moonchild 1b465bc2e2 Revert "Issue #2828 - Part 14: Clobber required for CSS rule processor refactoring"
This reverts commit 038c5a95fc.
2025-10-08 23:23:12 +02:00
Moonchild e455021bea Revert "Issue #2835 - Part 1: Expose nsCSSRuleProcessor::CascadeSheet"
This reverts commit 618f62e753.
2025-10-08 23:23:02 +02:00
Moonchild 4fe1246bcc Revert "Issue #2835 - Part 2: Implement processing of import rules based on order of appearance"
This reverts commit 2ba24302d9.
2025-10-08 23:22:57 +02:00
Moonchild 59b4ac4d5f Revert "Issue #2835 - Follow-up: Guard against import rules with no attached style sheet"
This reverts commit 5fccc6ec3d.
2025-10-08 23:22:42 +02:00
Moonchild de641fedfe Merge branch 'master' into release 2025-10-02 21:21:39 +02:00
Moonchild cb99fabcc0 Merge branch 'master' into release 2025-09-24 10:33:48 +02:00
Moonchild f996ea12c2 Merge branch 'master' into release 2025-09-19 21:04:01 +02:00
Moonchild 4e7fb3e0ea Merge branch 'master' into release 2025-09-18 13:15:14 +02:00
Moonchild e7cbbbef0f Merge branch 'master' into release 2025-09-14 11:54:15 +02:00
Moonchild a181078981 Revert "[gfx] Guard against possible race via gfxFontEntry::GetFontTable."
This reverts commit 98ddf30155.
2025-08-27 15:54:15 +02:00
Moonchild 987a662b51 [NSS] Avoid leak in pkcs12 decoder. 2025-08-20 16:26:17 +02:00
Moonchild 77e3e14e55 [js] Error-check pthread calls
These calls return error states (int) that weren't checked for success.
Failures here are fatal, so using MOZ_RELEASE_ASSERT to safely crash.
2025-08-20 16:26:10 +02:00
Moonchild 98ddf30155 [gfx] Guard against possible race via gfxFontEntry::GetFontTable. 2025-08-20 16:26:03 +02:00
Moonchild 83da5c58a2 Issue #2850 - Alias :focus-visible to :-moz-focusring
Band-aid to have it be parsed as valid with reasonably-expected behaviour.
2025-08-17 10:46:32 +02:00
Moonchild 7136ae45a7 [DOM] Simplify <object> scheme check code and fix plugin handling.
Trying to do a positive check on nested URIs apparently doesn't work,
but the handling could be simplified to just check for non-null mURI
instead - this also fixes plugin loading (which broke with the previous
check).
2025-07-31 10:44:08 +02:00
Moonchild 97d3d61749 [DOM] Fix crash in <object> scheme checking code.
If a website would nor supply a URI for object loading code, the browser
would crash on a null deref.
This reintroduces the nestedURI check to make sure we have a valid URI.
2025-07-30 09:29:51 +02:00
Sergey Larin 9c8bf1fe5d No Issue - Disable VSX extensions (uplift)
There is no detection script for them as for AltiVec, and
it's breaking older machines (PowerMac G5 in particular).
2025-07-25 16:57:09 +02:00
Sergey Larin d1cc6ff3cb Issue #2777 - Fix ffvpx build on PPC64 (uplift) 2025-07-25 16:55:27 +02:00
Moonchild db76d74820 [DOM] Make object loading use an explicit scheme whitelist. 2025-07-25 14:23:45 +02:00
Moonchild 8fdd9d52f9 [network] Stop accepting nameless cookies. 2025-07-25 14:23:34 +02:00
Moonchild d42797f587 [js] Align br_table limits with V8/Gecko. 2025-07-25 14:23:18 +02:00
Moonchild 6b9c1f6ab8 [gfx] Hold a stronger reference to gfxFontEntry. 2025-07-25 14:23:10 +02:00
Moonchild 4aedc96db2 No issue - Adjust CSP URI reporting more closely with the spec.
According to the W3C discussion we should allow websocket URIs to be
reported aside from http/https/ftp ones.
This rewrites things slightly and updates comments to clarify.
We do retain the non-standard reduction to origin only in case the
report is for cross-origin URIs (stops leaking full URIs to the CSP
reported destination).
See https://github.com/w3c/webappsec-csp/issues/735
2025-07-25 14:22:58 +02:00
Francis Dominic Fajardo 234830da1e Issue #2826 - Set up fontconfig on XRE startup (GTK only) 2025-07-25 14:22:35 +02:00
Moonchild 244b95968f Issue #2720 - Follow-up: Use temp value for duplicate color stop 2025-07-25 14:20:13 +02:00
Moonchild 810cd553b5 [devtools] Further improve special character escaping in "copy as curl".
Follow-up to 15335ce39d

Trying to cross-platform sanitize causes issues escaping too much and
as a result mangling the curl commands that get spit out.
This reverts previously added Windows-specific escaping on POSIX and
vice versa.
Since we do not offer cross-platform copying as a curl command in devtools
anyway, it makes little sense to sanitize for the O.S. we're not running on
as we would not be using the command processor in such environments that
could trip over characters for the other O.S. This was previously added
as a defense-in-depth in case we would start offering this, but I see no
real reason to do so, anyway.

Also decided to in-line comments for readability instead of a bulleted
list in the function head.

Mozilla has taken similar steps because of fall-out, but they do offer
cross-platform "copy as curl" for corner cases, so they will have to
find solutions for a problem we won't have.
2025-07-08 22:57:28 +02:00
Basilisk-dev e52eaa961c Issue #2773 - Allow building FFVPX on all architectures (uplift)
Resolves build bustage.
2025-07-03 20:16:10 +02:00
Moonchild b7827091b8 Merge branch 'master' into release 2025-06-26 14:26:02 +02:00
Moonchild 2e344377b5 Merge branch 'master' into release
# Conflicts:
#	devtools/client/shared/curl.js
#	security/nss/lib/ckfw/builtins/certdata.txt
#	security/nss/lib/nss/nss.h
#	security/nss/lib/softoken/softkver.h
#	security/nss/lib/util/nssutil.h
2025-06-24 17:08:59 +02:00
Moonchild 15335ce39d [devtools] Improve special character escaping for curl 2025-05-29 17:28:44 +02:00
Moonchild 14b03e1f8c No issue - Set device contrast to an acceptable value if OOB.
On Mac and Win+DW, enhanced device contrast can possibly not be set.
This throws Skia for a loop by passing in an OOB scalar to its init.
Work around this by setting an accepted average value that helps
prevent font wash-out while not causing fringing.
2025-05-29 17:28:30 +02:00
Moonchild 0968b94e5c No issue - Force C++ run-time type information on protobuf (uplift)
Protobuf uses `dynamic_cast` on polymorphic types which cannot be
inferred properly at compile-time, which can lead to unexpected behavior.
As a code safety measure, enable C++ RTTI for protobuf.
2025-05-29 17:27:29 +02:00
Moonchild ba6b2258aa No issue - Don't support modulo math space in ExtractLinearSum. (uplift) 2025-05-20 00:56:35 +02:00
Moonchild 1e1715ff11 No issue - Fix promise combinator function state. (uplift) 2025-05-19 22:50:48 +02:00
Brian Smith c93381fa79 No Issue - Fixes for building with LLVM 19 (uplift).
Fix a conflict with libc++ 19 and the old Mozilla (re)alloc macros.
LLVM 18+ does not allow std::char_traits<unsigned char> so avoid it.
https://bugzilla.mozilla.org/show_bug.cgi?id=1849070
Partial NSS upgrade to replace ByteString with a class.
https://bugzilla.mozilla.org/show_bug.cgi?id=1851092
2025-05-07 13:01:33 +02:00
Moonchild 65b0a59757 [devtools] Escape some more characters for copying as cURL on Posix. 2025-04-30 15:01:54 +02:00
Moonchild c785639043 [NSS] Update NSS version to 3.90.7 2025-04-30 15:01:48 +02:00
Moonchild 512c259822 [NSS] Update built-in data 2025-04-30 15:01:42 +02:00
Moonchild 90fea6f0d4 [NSS] Improve locking in nssPKIObject_GetInstances. 2025-04-30 15:01:35 +02:00
Moonchild d892468fd0 Issue #2731 - Fix crashes on unknown BigInt types in JIT (uplift)
This only works around the unknown type crashes but doesn't actually fix
attempts at using 64-bit BigInts in Ion.
Resolves #2731
2025-04-22 15:27:34 +02:00
Moonchild 81ab98b329 Merge branch 'master' into release 2025-04-04 20:37:42 +02:00
Moonchild 3f1cacd3e6 Merge branch 'master' into release 2025-04-03 10:22:24 +02:00
Moonchild 6e41e01a29 No issue - fix some minor link issues in about:rights
Privacy was moved to a subdir. Also replacing http with https because
that is what everyone expects by default.
2025-03-07 15:43:13 +01:00
Moonchild 9ce81488d4 No issue - Update Twemoji font to unicode 15.1.3 2025-03-07 02:06:25 +01:00
Moonchild 25bc2630d9 [js] Disable potentially unsafe attempts at recovering JIT operations. 2025-03-06 20:18:39 +01:00
Moonchild e5b69418a0 No Issue - NULL crash fix in nsExternalResourceMap::PendingLoad::OnDataAvailable
Curiously, we should have had this at our fork point (as it was backported
by Mozilla to 52.5.2) by apparently Tobin's import wasn't actually 52.6.0.
:-/
2025-03-06 20:18:24 +01:00
Shadow 229a69be5f Update js/src/wasm/WasmIonCompile.cpp
Bug 1328639 , wasm , Simplify block-value popping in Ion compilation
2025-03-06 20:18:07 +01:00
Moonchild 7f2561312a [layout] Always reserve 64 bits for frame property value
This ensures frame property values can always be stored even in edge cases
on 32-bit machines (where a void ptr is half the width).
2025-02-18 21:42:59 +01:00
Moonchild 93d11a07f9 Issue #2694 - Improve nested grid layout performance by caching.
This improves performance by caching the grid items' block axis
measurement, avoiding potentially exponential calculations and reflows.
Resolves #2694
2025-02-18 16:57:20 +01:00
Moonchild 8e5e24c4c6 Issue #2693 - Disable CSP reporting by default in the platform.
This is a temporary measure to work around CF OOM situations.
Reporting is desirable normally so webmasters get alerted to CSP issues,
and this should be flipped back on once we can.
2025-02-18 10:13:35 +01:00
Moonchild 517ee6754c [DOM] Honor security.csp.reporting.enabled pref in more places. 2025-02-18 10:13:28 +01:00
Moonchild 47690c287c No issue - avoid potential underflow in StructuredClone.
Prevents potential loop-around if there's bogus internal Map data.
2025-02-18 10:13:19 +01:00
Moonchild 364b95170e Merge branch 'master' into release 2025-02-05 23:36:07 +01:00
Moonchild 407006d673 Merge branch 'master' into release 2025-02-05 18:33:29 +01:00
Moonchild 2d60605cc6 Merge branch 'master' into release
# Conflicts:
#	netwerk/cookie/nsCookieService.cpp
2025-02-03 19:13:42 +01:00
Moonchild 2d1129eb7e [network] Don't try to use non-existing connections. 2025-01-13 20:29:31 +01:00
Moonchild 495b4980e7 [DOM] Convert cleanup of FlushCurrentWord() to a ScopeExit task.
Ensures consistent cleanup even if early exit due to OOM.
2025-01-10 15:55:10 +01:00
Moonchild ad480be112 [DOM] Slightly extend lifetime of data in Structured Clone operations. 2025-01-10 15:54:44 +01:00
Moonchild a06001c022 [network] Verify connection NPN against negotiated NPN. 2025-01-10 15:54:35 +01:00
Moonchild 6cbda74aeb Issue #2670 - Compute baseDomain when cookies are read from the database
baseDomain is used as a key for cookies in a hashmap. For cookie
operations to work properly, the baseDomain generation must be reliable.
This is, however, not the case, because the result can change by updates
to the public suffix list (PSL).

Since the stored baseDomain is not reliable, the value must be recomputed
when the database is read. This causes a minor performance hit but is
needed if we want to keep abreast of PSL changes without clobbering the
cookies database.

Resolves #2670
2024-12-24 22:12:33 +01:00
Moonchild 576fbdf490 Issue #2672 - Follow-up: Remove unused telemetry variable. 2024-12-24 22:12:24 +01:00
Moonchild 52b00c38ea Issue #2672 - Part 4: Prevent db access while rebuilding is underway. 2024-12-24 22:12:15 +01:00
Moonchild 8ec56f459b Issue #2672 - Part 3: Ensure thread lifetimes are in tandem. 2024-12-24 22:12:05 +01:00
Moonchild 5cbe423461 Issue #2672 - Part 2: Auto-close syncConn for edge cases. 2024-12-24 22:11:59 +01:00
Moonchild 369fbba750 Issue #2672 - Part 1: Load nsCookieService OMT and use sync reads.
No more lazy-loading on the main thread, thanks. Everyone needs this.
2024-12-24 22:11:52 +01:00
Martok 8e3c35efc6 Issue #1787 - Follow-up: remove no longer used AppClearDataObserver. 2024-12-24 22:11:37 +01:00
Moonchild b3b852b877 Merge branch 'master' into release 2024-12-04 11:10:21 +01:00
Moonchild d5c6e20e9e Merge branch 'master' into release 2024-12-01 20:52:12 +01:00
Moonchild 89b36775fb Merge branch 'master' into release 2024-11-29 10:21:36 +01:00
Karl Tomlinson df16df5693 Bug 1920800 - Remove oldImages from check for flushed old principal handle
The logic should be equivalent when frame IDs on aImages are contiguously
increasing from IDs on previously set frames.

There are currently no callers passing empty aImages, but the logic in this
case would now be as described in the documentation of
UpdatePrincipalHandleForFrameID():

> We will notify mElement that aPrincipalHandle has been applied when all
> FrameIDs prior to aFrameID have been flushed out.
2024-10-31 11:44:56 +01:00
Moonchild aa1fd576ac Issue #2648 - Inherit the content disposition of the multipart response 2024-10-30 10:54:11 +01:00
Moonchild 2512188ca7 Issue #2648 - Apply CSP to documents sent through multipart/x-mixed-replace 2024-10-30 10:54:04 +01:00
Moonchild 89e88ca6a0 Merge branch 'master' into release 2024-10-02 19:45:47 +02:00
Moonchild 2697dd162f [js xpconnect] Fix error handling in xpc::CreateSandboxObject 2024-09-05 10:13:09 +02:00
Moonchild 53a4179c4a [js] Simplify with-env handling in FetchName 2024-09-05 10:13:01 +02:00
Moonchild a120731ddd [DOM] Stop exposing NotifyPaintEvent to web content.
There's no reason this should be available to the web, as it's an
indicator of browser internals.
2024-09-05 10:12:55 +02:00
Moonchild bda611a41a Revert "Issue #2523 - Part 1 - Import headers from FFmpeg 7.0"
This reverts commit 27bb48deaf.
2024-09-03 13:03:20 +02:00
Moonchild 5a02a4a1a4 Revert "Issue #2523 - Part 2 - Update audio & video decoders to work with FFmpeg 7.0"
This reverts commit 7dbc24a739.
2024-09-03 13:03:12 +02:00
Moonchild e59f358b45 Revert "Issue #2527 - Part 1 - Remove old FFmpeg and LibAV headers"
This reverts commit b970fc412a.
2024-09-03 13:02:55 +02:00
Moonchild 90c9535b39 Revert "Issue #2527 - Part 2 - Remove support for libavcodec < 58"
This reverts commit 738c6a740a.
2024-09-03 13:02:46 +02:00
Moonchild ad778bbfdb Revert "Issue #2527 - Part 3 - Remove additional checks for LibAV"
This reverts commit b0f872c919.
2024-09-03 13:02:31 +02:00
Moonchild 8868552b24 Merge branch 'master' into release 2024-08-09 19:35:34 +02:00
Moonchild 66826eb487 Merge branch 'master' into release 2024-08-09 19:18:02 +02:00
Moonchild 39127b5ee9 Merge branch 'master' into release 2024-08-09 16:18:50 +02:00
Moonchild 80cff816a8 Merge branch 'master' into release 2024-08-09 15:56:36 +02:00
Moonchild e9dda8dafa Merge branch 'master' into release
# Conflicts:
#	security/nss/doc/rst/releases/index.rst
#	security/nss/lib/nss/nss.h
#	security/nss/lib/softoken/softkver.h
#	security/nss/lib/util/nssutil.h
2024-08-07 20:13:00 +02:00
Moonchild 11fc818dfb [DOM/network] Disable DNS prefetching if document nodePrincipal is systemPrincipal 2024-07-10 10:54:53 +02:00
Moonchild 84ed844e3f [IPC] Clean up control flow in WaitableEvent. 2024-07-10 10:54:43 +02:00
Moonchild 50af804f1c [network] Add additional cookie setting checks.
Added checks for sub-document navigations from cross-site to same-site in
third-party checks when setting a cookie.
2024-07-10 10:54:37 +02:00
Moonchild 82ce93bce9 No issue - Update SQLite to 3.46.0 2024-07-10 10:54:24 +02:00
Moonchild 228abc8259 No issue - Update NSS to 3.90.3 2024-07-10 10:54:17 +02:00
Moonchild 1692fa5291 Issue #2045 - Temporarily force hidden elements to be actually hidden.
For the time being, because we don't have `revert` yet, we should force
normally hidden elements to be hidden, so they aren't revealed by sites
using the bad practice of `*{ }` style blanking rules but then using
`revert` to re-hide them.
2024-07-10 10:54:02 +02:00
Moonchild bb58c6ae38 Issue #2541 - Deal with empty LineNameList in CSS grid templates.
Resolves #2541
2024-07-02 01:39:01 +02:00
Moonchild 4f58dc27f9 Re-synchronize branches, picking up 2 commits that were not correctly merged. 2024-06-16 12:32:02 +02:00
Moonchild fc5324b9f7 Issue #2532 - Align dialog submission triggered by form.submit() with the spec.
Submission in click handler of submit button should not be deferred
per https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#submit-dialog

See Bug 1719872
2024-06-15 17:56:37 +02:00
Moonchild 561f65aabf Issue #2532 - Prevent unwanted text selection when backdrop is clicked. 2024-06-15 17:56:31 +02:00
Moonchild 9acfe36b95 Issue #2532 - Don't do PreventDefault for escape key if <select> dropdown is not shown
We always use PreventDefault for <select> element, which is problematic if modal
dialog is on as it prevents cancelling the dialog. We fix it by not blocking the
default action if <select> is not shown.

See Bug 1649278
2024-06-15 17:56:25 +02:00
Moonchild ce495cbd85 Issue #2532 - Fix a null pointer crash while doing dialog form submission
See Bug 1652699
2024-06-15 17:56:20 +02:00
Moonchild c44020f188 Issue #2532 - Default pref check to true 2024-06-15 17:56:15 +02:00
Moonchild 35e7a695af Issue #2532 - Implement form[method=dialog]
See bug 1557303
2024-06-15 17:56:08 +02:00
Moonchild 7a55055d22 Merge branch 'master' into release 2024-06-13 21:31:39 +02:00
Moonchild 061900b87f [gfx] Use calloc for cairo font-creation functions. 2024-05-23 13:48:18 +02:00
Moonchild abe32f7309 [gfx] Ensure font entry's unitsPerEm and font extents are initialized when gfxFont is created. 2024-05-23 13:48:11 +02:00
Moonchild 7bfd4c7fe7 [DOM] Clean up ReportLoadError and normalize error messages. 2024-05-23 13:48:04 +02:00
Moonchild 859d6a3e2c [gfx] Clear mSharedBlobData if blob creation failed. 2024-05-23 13:47:58 +02:00
Moonchild c2f05f99af [network] Make http digest auth cnonce length configurable. 2024-05-23 13:47:50 +02:00
Moonchild 55b33fb02b Merge branch 'master' into release 2024-04-19 22:05:10 +02:00
Moonchild c247e40d41 Revert "Update NSS to 3.90.2"
This reverts commit b1cb7e0a8f.
2024-03-23 07:45:56 +01:00
Moonchild 05c58f159d Revert "Undo build system change from NSS update to fix missing command-line utils."
This reverts commit 67d5fefcf2.
2024-03-23 07:45:40 +01:00
Moonchild 67d5fefcf2 Undo build system change from NSS update to fix missing command-line utils. 2024-03-21 21:53:57 +01:00
Moonchild aad017be9e [MFBT] Make move assignment of RefPtr have the same behavior as nsCOMPtr 2024-03-20 19:52:30 +01:00
Moonchild 4543dbf3ff [parser] Specialize AddAttributes for <html>/<body>. 2024-03-20 19:52:24 +01:00
Moonchild b1cb7e0a8f Update NSS to 3.90.2 2024-03-20 19:52:08 +01:00
Moonchild 1c6d21c97d [network] Block set-cookie from multipart/x-mixed-replace 2024-02-22 23:20:07 +01:00
Eitan Isaacson fc42fb38c9 [layout] Process pairs in coord list in PolyArea.
Range -1 assures the array is even with a step size of 2, avoiding lone
value processing.
2024-02-22 23:19:59 +01:00
Jens Stutte 618068c15b [DOM] Check if WorkerRunnable::Run runs on top of WorkerThreadPrimaryRunnable::Run in a worker thread. 2024-02-22 23:19:53 +01:00
FranklinDM 808516a0a8 No issue - Replacing location might throw NS_ERROR_UNEXPECTED while the developer tools window is being destroyed 2024-02-22 23:19:45 +01:00
FranklinDM 7d6b806040 No issue - Remove leftover doorhanger code from the developer tools
Partially based on reverting https://bugzilla.mozilla.org/show_bug.cgi?id=1078539
2024-02-22 23:19:38 +01:00
Martok 6b4e2c9d73 Issue #2453 - Follow-Up: Use hard-coded minimum timer interval in workers.
From the spec: "If nesting level is greater than 5, and timeout is less than 4, then set timeout to 4.",
therefore not having it user-configurable doesn't really break anything.
2024-02-22 23:19:20 +01:00
Moonchild 787883f6a4 Disable URL-paste content loading by default.
See https://repo.palemoon.org/MoonchildProductions/Pale-Moon/issues/1957
2024-02-22 23:18:36 +01:00
Moonchild 7f02753c04 Issue #2465 - Do not use our in-tree metrics hints if using system-cairo
Use a somewhat equivalent font-options instance when using the
system-supplied cairo lib, instead of our in-tree extension.

Resolves #2465
2024-02-07 21:40:55 +01:00
Moonchild 8fa38b3445 Issue #618 - Follow-up: Fix missed constant refactor preventing ExportEntries from working. 2024-02-07 21:40:29 +01:00
Moonchild 541c5f9f45 Merge branch 'master' into release 2024-01-25 15:55:20 +01:00
Moonchild 4b6bd4976a Merge branch 'master' into release
# Conflicts:
#	modules/libpref/init/all.js
2024-01-25 09:09:51 +01:00
Moonchild a0843d52b4 Revert "[XPCOM] Compare return value of readlink in nsLocalFileUnix::GetNativeTarget"
This reverts commit 188f61505f.
2023-12-21 14:03:31 +01:00
Kershaw Chang 977a8cbed8 Bug 1736385 - Make sure thread is alive in CacheIOThread::ThreadFunc 2023-12-21 11:44:50 +01:00
Moonchild 1e85085305 [dom] Better handling of aborted websocket workers.
Catch the case where we are in worker-shutdown but are still connecting
and make filing and closing connections a bit more robust with a RefPtr.
2023-12-21 11:44:42 +01:00
Barret Rennie 188f61505f [XPCOM] Compare return value of readlink in nsLocalFileUnix::GetNativeTarget 2023-12-21 11:44:32 +01:00
Moonchild a514d7f6a4 [layout] Always check against fragment length in nsTextFrame 2023-12-21 11:44:21 +01:00
Moonchild 47c2c75ceb Bug 1868901 2023-12-21 11:44:12 +01:00
Moonchild 7082ec8a9a No issue - Allow redirects for requests that require preflight
Spec update, see Bug 1312864
2023-12-21 11:43:58 +01:00
Brian Smith 2907a84362 Issue #2387 - Remove a missed AddRef() which could cause leaks.
Update comments explaining how the reference counting works.
2023-12-10 23:58:08 +01:00
Brian Smith b8d1ee05c3 Issue #2387 - Collection of fixes related to a crash while canceling a dynamic import.
Add AddRef/Release hooks for embedding's script or module private value and set this script source object where appropriate.
https://bugzilla.mozilla.org/show_bug.cgi?id=1519140 Partial, no Value passing changes.
Clear the list of dynamic import requests after cancelling them in ScriptLoader::ParsingComplete as we do for other requests.
https://bugzilla.mozilla.org/show_bug.cgi?id=1291535
ScriptLoader::OnStreamComplete never returns a failure.
https://bugzilla.mozilla.org/show_bug.cgi?id=1627275
Also cancel the correct kind of parser for Modules.
2023-12-10 23:57:54 +01:00
Moonchild 0b625e624a [DOM] Fix double-free crash in MessagePort.cpp 2023-12-10 17:02:28 +01:00
Moonchild a4da712f91 Issue #2281 - Exclude throw wrapping on modern libcpp.
As discussed.
2023-11-25 18:17:35 +01:00
Moonchild 185f124e87 Issue #2381 - Remove system-nspr/nss leftovers (release port) 2023-11-25 17:15:01 +01:00
Moonchild 8633077691 [WebGL] Flip the validation state for gl_KHR_no_validation.
The original state was inverted due to confusion due to a double
negative (not:no_error).
This validation should only be enabled on Windows (for now).
Future tracking and discussion in BZ 1862039
2023-11-24 12:24:55 +01:00
Moonchild 39a1899045 [DOM] Improve MessagePort state machine. 2023-11-24 12:24:32 +01:00
Moonchild 4dc011a187 [Network] Fix relative URL path starting with multiple slashes 2023-11-24 12:24:19 +01:00
Moonchild ccb12e1dda [DOM] Check if rootDoc is secure context for web compat 2023-11-24 12:24:04 +01:00
Moonchild 63f0d3e295 [WebGL] Turn on more validation/error checking in webgl (when not on Win) 2023-11-24 12:23:49 +01:00
Moonchild 09d598c496 Revert "No Issue - add mutex in EventSource"
This reverts commit 10b3237e52.

Apparently causes deadlocks in Linux.
2023-11-15 12:22:11 +01:00
Moonchild 7e60482d80 No issue - Stop supporting data: scheme in SVG <use> elements. 2023-11-14 12:42:58 +01:00
Moonchild 10b3237e52 No Issue - add mutex in EventSource
Potentially avoids a gc crash when load is high.
2023-11-14 12:42:26 +01:00
athenian200 99af7cc028 Issue #1824 - Support SunOS Linker mapfiles.
Generating OS-appropriate mapfiles from a provided SYMBOL_FILE is
apparently required to work with newer ffvpx. Nothing else in our
codebase actually seemed to require it. Also seems to reduce the amount
of console spam I see relating to symbol visibility during the build
process, and I think it even makes libxul.so link a bit faster.
2023-11-04 01:47:00 -05:00
athenian200 76b360b5d1 Issue #1824 - Move to GCC 10.
It seems to work, but it is a lot slower than compiling with GCC 7.
2023-11-04 01:38:20 -05:00
Moonchild 4001b58a3e [DOM] For now, use C++11 static_asserts only.
Single-param static_assert is C++17 or later.
Follow-up to 3d92b82125
2023-10-27 14:20:10 +02:00
Moonchild 134a8aac87 Issue #35 - Follow-up: undo locale changes so they aren't pre-processed.
Pre-processing loses our localization notes and licensing headers for
l10n which is not a good thing. It's not a big deal having a few unused
strings in these files in the resulting locales.
2023-10-26 22:47:13 +02:00
Moonchild 3e2e48872a Merge branch 'master' into release 2023-10-25 22:51:58 +02:00
Moonchild 622b43cbc5 Merge branch 'master' into release 2023-10-25 22:49:37 +02:00
Moonchild 75b44ef620 Merge branch 'master' into release
# Conflicts:
#	js/src/wasm/WasmBinaryIterator.cpp
#	media/libvpx/vp8/encoder/onyx_if.c
2023-10-05 23:43:10 +02:00
Basilisk-Dev 00084ea49c Cherry-pick upstream libvpx fix
Backport of https://hg.mozilla.org/releases/mozilla-esr115/rev/5241232a3292943bd59ff1704eab60fee3cbc9d1
Addresses CVE-2023-5217
2023-09-28 16:18:01 +02:00
Moonchild b6fae24296 [network] Refactor TransactionObserver::OnDataAvailable() 2023-09-27 21:55:28 +02:00
André Bargull 13c6b7422d [js] Handle dead wrappers 2023-09-27 21:55:19 +02:00
Moonchild 24f2e663cd Restore incorrect SIMD Op removals. 2023-09-25 10:48:42 +02:00
Brian Smith f96b155988 Issue #2313 - Implement WebAssembly sign extension opcodes. (uplift) 2023-09-25 10:46:25 +02:00
Brian Smith d5cc24e916 Issue #2308 & #1240 Follow-up - Fill in missing JSOP_INC/DEC cases for Doubles in Ion. 2023-09-20 03:34:06 +02:00
Brian Smith 8eba271c5f Issue #2308 & #1240 Follow-up - Replace JSOP_POS in ++/-- with JSOP_TONUMERIC.
https://bugzilla.mozilla.org/show_bug.cgi?id=1519135
2023-09-20 03:33:57 +02:00
Brian Smith 19955c82b3 Issue #2308 & #1240 Follow-up - Fill in missing JSOP_INC/DEC cases for Ion on Intel32/64. 2023-09-20 03:33:50 +02:00
Brian Smith 80ae8aec7c Issue #2308 & #1240 Follow-up - Add BigInt support to JSOP_INC and JSOP_DEC.
https://bugzilla.mozilla.org/show_bug.cgi?id=1526309
2023-09-20 03:33:41 +02:00
Brian Smith d8441d7c81 Issue #2308 & #1240 Follow-up - Introduce new increment and decrement operations.
https://bugzilla.mozilla.org/show_bug.cgi?id=1508521
2023-09-20 03:33:33 +02:00
Brian Smith c2446f2478 Issue #2308 - Fix JSON BigInt regressions.
https://bugzilla.mozilla.org/show_bug.cgi?id=1522433
2023-09-20 03:33:23 +02:00
Brian Smith 6efb7a1904 Issue #2282 - Performance observer safety checks.
Both fixes from later revisions, without the Dispatch API changes.
2023-09-20 03:33:14 +02:00
Brian Smith fa0b03a10f Issue #2026 Follow-up: Fill in missing BigInt64 cases in js::IsTypedArrayConstructor().
Hopefully fixes RSA errors on ProtonMail.
2023-09-20 03:32:41 +02:00
Moonchild 3ae2972950 Issue #2309 - Cherry-pick upstream libwebp fix.
Backport of: https://chromium.googlesource.com/webm/libwebp.git/+/2af26267cdfcb63a88e5c74a85927a12d6ca1d76

Resolves #2309
2023-09-13 10:22:50 +02:00
Moonchild 2d48de9998 Merge branch 'master' into release 2023-09-01 15:44:29 +02:00
Moonchild 3b029cdfe4 Merge branch 'master' into release 2023-07-15 16:01:39 +02:00
Moonchild ea9077a8a5 Merge branch 'master' into release 2023-07-07 19:41:06 +02:00
Moonchild b4af6b6265 No issue - Set the default for incremental cycle collector to be off.
Negative performance impact if enabled.
2023-06-05 21:17:24 +02:00
Moonchild ae1d53ceb1 Issue #2257 - Remove rematerialized frames after bailouts and exceptions.
This ensures that rematerialized frames used by the devtools debugger
are properly removed so that no stale data is used during bailouts.
2023-06-05 21:17:13 +02:00
Brian Smith c3f4709d5e Issue #2252 - Prevent crash when attempting to load a script with execution disallowed.
This issue is due to the ExecutionContext added in Issue #1691 not handling GetScript()
in a context where script execution is not allowed.  This expressed itself in crashes when
playing MP4s with the NoScript extension installed and enabled.
2023-06-05 21:16:57 +02:00
FranklinDM a7bb3fc175 Issue #1592 - Follow-up: Ensure topmost scope marker is cleaned up 2023-06-05 21:16:43 +02:00
FranklinDM 6a0203f25f Issue #2250 - Part 2: Ignore the ancestor filter assertion if rule matching is restricted or if the current element is under a shadow host
This only affects debug builds.
2023-06-05 21:16:31 +02:00
FranklinDM b0dfcb147f Issue #2250 - Part 1: Return early if the element being tested for is likely an ancestor and does not have an assigned slot 2023-06-05 21:16:22 +02:00
Job Bautista 06fd4c9357 Issue #2221 - Follow-up: Simplify jit_ioncheck{1|2|3}_deunified_sources assignment. 2023-06-05 21:15:52 +02:00
Job Bautista b9ea7fd9ee Issue #2221 - Follow-up: Ensure jit_ioncheck{1|2|3}_deunified_sources is defined.
Should fix build bustage in armhf, as well as prevent bustage in mips32.
2023-06-05 21:15:33 +02:00
Moonchild 58308a5c7a Merge branch 'master' into release
# Conflicts:
#	python/mozbuild/mozpack/dmg.py
2023-05-11 17:35:14 +02:00
Brian Smith 88c7d54975 No Issue - Fix FreeBSD build failure with WebRTC enabled. (release uplift)
Tag #2227
2023-05-01 22:12:11 +02:00
Timothy Valldeperas eadb5678b3 Issue #2175 - Fix build bustage in WebRTC. (release uplift)
Resolves #2227
2023-05-01 19:04:57 +02:00
Moonchild 54e3e60796 Revert "[devtools] Don't allow sourcemap URLs to redirect"
This reverts commit 2a05494abe.
2023-04-17 10:25:45 +02:00
Moonchild 2a05494abe [devtools] Don't allow sourcemap URLs to redirect 2023-04-13 10:54:34 +02:00
Moonchild bc89e58def [network] Improve checks while parsing MIME parameters. 2023-04-13 10:54:27 +02:00
Moonchild 3a009b97f6 Issue #1911 - Follow-up: Filter out illegal characters in more locations. 2023-04-13 10:54:10 +02:00
Moonchild a105f6d5e9 No issue - Fix off-by-one of kLargeDatasetSize 2023-04-13 10:54:02 +02:00
Sandra 5db241c0c0 Increase size of data over which we write the data to disk rather than keep it around in memory 2023-04-13 10:53:53 +02:00
Sandra d38dca10e5 Use nsAnonymousTemporaryFile for clipboard cache
Base on https://github.com/mozilla/gecko-dev/commit/ecc04a9245b409d7eed7df63ba733cd2073180de
2023-04-13 10:53:14 +02:00
Moonchild 54fc723126 Issue #2180 - Follow-up: Move sentinel check up a bit. 2023-04-02 15:39:05 +02:00
Moonchild 9b8ca17ee4 Issue #2180 - Add pref to control NSS TLS 1.3 protocol downgrade sentinel 2023-04-02 15:38:57 +02:00
Moonchild cddc95b39b Issue #2176 - Don't reconstruct the parent when tearing down
display:contents nodes with pseudo-elements.

We need to use StyleChildrenIterator which iterates over them, instead.
This is a bit of a hack but we can't always have our cake.

We need to be a bit careful though, since ::before and ::after are owned
by their own frame, and thus could be unbound from the tree or even dead
after removing the frame.

This basically ports bugs 1435566 and 1438467
2023-04-02 15:38:31 +02:00
Moonchild 5676529793 Issue #2171 - Skip over shadow nodes that don't have an owning node.
Resolves #2171
2023-04-02 15:37:44 +02:00
Moonchild ce68156cf4 Revert "[widget] Linux GTK3: Detach accessible from moz_container before it's deleted"
This reverts commit 465a18f342.
Resolves #2168
2023-03-18 19:57:56 +01:00
Moonchild 5032ad9593 Issue #2117 - Follow-up: Run precomplete cmd during package staging
We rely on this for all OSes except Mac where precomplete should not
be in the root (it uses Mozilla's fallback packaging that places it in
$RESPATH)
2023-03-17 22:11:30 +01:00
Moonchild b55f765f2e Issue #1911 - Follow-up: Filter out illegal file extensions also.
We already did this for file names, just not extensions.
2023-03-17 12:02:55 +01:00
Moonchild 856078d435 [widget] Linux GTK3: Detach accessible from moz_container before it's deleted 2023-03-17 12:02:46 +01:00
Moonchild c74c262d2f [GFX] Add some sanity checks and clamps to SurfaceData calculations. 2023-03-17 12:02:38 +01:00
Moonchild 787e29e374 No Issue - Ensure more OsiSpace
ensureOsiSpace(); was very much under-used. This adds more instances
where it makes sense to ensure Osi space before placing masm calls.
2023-03-17 12:02:31 +01:00
FranklinDM e439896c9b Issue #2148 - Shrink Vector from (usually) four pointers in size to three
when no inline storage is used.

See Bug 1338374
2023-03-17 12:02:20 +01:00
FranklinDM 15b508f1fb Issue #2148 - Make Vector not use AlignedStorage for its inline element storage
See Bug 1338374 1/2
2023-03-17 12:02:12 +01:00
Job Bautista 5651ebfc76 Issue #2148 - Discard RegExpShared data tables when discarding regexp JIT code.
Based on Mozilla bug 1378736's part 2.
Should fix the double-free.
Follow-up for #2083
2023-03-17 12:02:04 +01:00
Job Bautista 593bfc1ce8 Issue #2148 - Don't null out RegExpObject -> RegExpShared pointer on GC.
Follow-up for issue #2083.
Taken from Mozilla bug 1378736.
2023-03-17 12:01:50 +01:00
Brian Smith 28953cda7a Issue #2160 - Initial support for notarizing during DMG package.
Added --with-macbundle-idenity configure option to set a codesign identity.
If no identity is set or cross-compiling from Linux no codesigning will be
done. Currently doing a full deep bundle v2 sign, instead of limited v1.
2023-03-15 15:10:52 +01:00
Moonchild 516f3f545d Merge branch 'master' into release
# Conflicts:
#	CLOBBER
#	js/src/vm/RegExpObject.cpp
#	security/nss/lib/nss/nss.h
#	security/nss/lib/pkcs12/p12d.c
#	security/nss/lib/softoken/softkver.h
#	security/nss/lib/util/nssutil.h
2023-03-13 13:11:20 +01:00
Moonchild 83aff65a42 Force clobber 2023-02-19 17:53:31 +01:00
Moonchild 5bd97df957 [NSS] Update NSS to 3.52.9 to pick up fixes. 2023-02-19 17:51:26 +01:00
Moonchild 8772711181 [DOM] Check whether module load request was already cancelled when a load fails 2023-02-19 17:51:18 +01:00
Moonchild dc9526f4c6 [widget] Properly test for and handle errors in target-surface creation
and mapping.
2023-02-19 17:51:10 +01:00
Moonchild 9ab36e7ae0 Issue #2103 - Fix typo in RegExp Parser
This corrects the typo where the left-hand character would determine if
the right-hand character would be added or not.

Resolves #2103
2023-02-02 10:50:47 +01:00
Job Bautista e8d30841e7 Issue #2091 - Parse \p{Extended_Pictographic} too.
This is essentially a follow up to Issue #1286. We already have
 UCHAR_EXTENDED_PICTOGRAPHIC in our in-tree ICU, so there's no reason to comment
 this case out.
2023-01-27 05:01:53 +01:00
Martok 9faf29374e Issue #2093 - Trace HeapPtr<RegExpShared::groupsTemplate_> for GC move/compact events, regression from #2072 2023-01-26 20:11:28 +01:00
Moonchild 75e4818d36 Merge branch 'master' into release 2023-01-19 00:42:00 +01:00
Moonchild a65144e9e0 Fix merge conflicts. 2023-01-13 12:55:52 +01:00
Moonchild 4f29548526 Merge branch 'master' into release
# Conflicts:
#	image/decoders/nsJXLDecoder.cpp
#	js/src/irregexp/NativeRegExpMacroAssembler.cpp
#	js/src/irregexp/RegExpAST.h
#	js/src/irregexp/RegExpEngine.cpp
#	js/src/irregexp/RegExpParser.cpp
#	js/src/irregexp/RegExpParser.h
#	xpcom/io/nsLocalFileUnix.cpp
2023-01-13 12:11:56 +01:00
Moonchild 528db2cbd8 Issue #1818 - Remove obsolete path hack in widget code. 2022-12-16 09:13:48 +00:00
Moonchild 84e6bcc1e6 [network] Align cookie checks with RFC 6265 (bis) 2022-12-16 09:13:38 +00:00
Moonchild 0dc9ff518d [libjar] Add some extra sanity checks to our Zip reader. 2022-12-16 09:13:25 +00:00
Moonchild a2e3bd44aa [network] move some generic websocket code to the baseclass 2022-12-16 09:13:09 +00:00
Moonchild 163a0e7caf Revert "Issue #1279 - Implement regular expressions lookbehind (v2)"
This reverts commit d10e8a5b06.
2022-12-15 09:11:02 +00:00
Moonchild 49a86db5f3 Issue #2040 - Pre-multiply the alpha values in our JXL decode buffer. (uplift)
Using selective calculation (only if not opaque) and fast integer
math here should optimize well in compilers.
2022-12-15 09:09:19 +00:00
Moonchild 2640953d8b Issue #2019 - Follow-up: Make nsPluginInstanceOwner also listen to keypress events in the system event group.
nsPluginInstanceOwner only listens to keypress events in the default event group.
However, in our changed operating mode, keypress events are not fired in the
default event group if the key does not result in something printable.
This means that nsPluginInstanceOwner should also listen to keypress events
in the system event group and should handle each keypress that way, but
only once. I.e., if a printable keypress event is received in the system event
group, it should be ignored, since it would've already been handled in the
default event group in that case.
2022-11-26 18:18:09 +00:00
Moonchild 7eb7d67f7a Issue #2033 - Temporary fix of R<->B channel swap.
We have a BGR/RGB channel ordering mismatch here. to at least
provide proper display, a quick&dirty byte swap on the output
buffer will fix this for now, but we should look into seeing where
the surface mismatch is caused.
std::swap() should optimize pretty well in any of the used
compilers, but if necessary, a full buffer ASM routine can be
slotted in (although on current hardware I doubt this will be
even noticeable as it is)
2022-11-26 02:43:18 +00:00
Moonchild e28860ba7f Revert "[XPCOM] Deal with lstat potentially lying in nsLocalFileUnix."
This reverts commit c127f58ef3.
2022-11-20 14:14:48 +00:00
Moonchild 49a96b1d91 Merge branch 'master' into release 2022-11-19 20:15:23 +00:00
Moonchild 3130812693 Merge branch 'master' into release 2022-11-12 18:34:07 +00:00
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 4898c4f297 Merge branch 'master' into release 2022-09-24 12:16:59 +00:00
Moonchild 7cd578bbc6 Merge branch 'master' into release 2022-09-22 13:16:48 +00:00
Moonchild 1e91df628a Merge branch 'master' into release 2022-09-22 11:52:16 +00:00
Moonchild b110549cbd Merge branch 'master' into release 2022-07-27 06:07:45 +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 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 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
Moonchild cfc0eeca53 Revert "Issue #1909 - Guard against empty update manifest URL"
This reverts commit d7fadcdef9.
2022-06-07 11:59:07 +00:00
Moonchild ebd3dd9228 Merge branch 'master' into release 2022-06-03 21:50:44 +00:00
Moonchild cb40e4e7ef Merge branch 'master' into release 2022-06-01 13:54:11 +00:00
Moonchild 662dba55fd Merge branch 'master' into release 2022-05-29 11:13:44 +00:00
Moonchild 8760ce023c Issue #1895 - Implement queueMicroTask(callback()) (uplift) 2022-05-07 14:40:14 +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
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
2565 changed files with 420844 additions and 52878 deletions

No files matched your search

+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 ICU 78.1
Clobber for Idle GC backout
+8 -4
View File
@@ -14,7 +14,7 @@ endif
export TOPLEVEL_BUILD := 1
default::
BACKEND_ONCE_STAMP := backend.once.stamp
ifndef TEST_MOZBUILD
ifdef MOZ_BUILD_APP
include $(wildcard $(topsrcdir)/$(MOZ_BUILD_APP)/build.mk)
@@ -46,7 +46,7 @@ ifndef TEST_MOZBUILD
ifndef MOZ_PROFILE_USE
# We need to explicitly put BUILD_BACKEND_FILES here otherwise the rule in
# rules.mk doesn't run early enough.
$(TIERS) binaries:: CLOBBER $(configure_dir)/configure config.status $(BUILD_BACKEND_FILES)
$(TIERS) binaries:: CLOBBER $(configure_dir)/configure config.status $(BACKEND_ONCE_STAMP)
# While our mozbuild backend has some kind of crazy install_manfests junk to
# try and make this not have to happen, we actually want dist/bin to be
@@ -100,7 +100,11 @@ config.status js/src/config.status:
ifndef TEST_MOZBUILD
.PHONY: backend
backend: $(BUILD_BACKEND_FILES)
backend: $(BACKEND_ONCE_STAMP)
# Create a per-invocation stamp so backend regenerates only once
$(BACKEND_ONCE_STAMP):
@echo "Stamping backend regeneration."
@$(TOUCH) $@
# A traditional rule would look like this:
# backend.%:
@@ -122,7 +126,7 @@ $(subst .,%,$(BUILD_BACKEND_FILES)):
@echo 'Build configuration changed. Regenerating backend.'
$(PYTHON) config.status
Makefile: $(BUILD_BACKEND_FILES)
Makefile: $(BACKEND_ONCE_STAMP)
@$(TOUCH) $@
define build_backend_rule
+8
View File
@@ -0,0 +1,8 @@
TRADEMARK NOTICE
================
The name "Goanna" and visual representations (logo) have not been
registered by the Copyright owners as a trademark in any jurisdiction.
However, because Goanna has been distributed and maintained world-wide,
continually since 2015, the Copyright owners claim "common-law trademark
protection" in any jurisdiction where common-law trademark is recognized.
+1 -1
View File
@@ -55,7 +55,7 @@ private:
{
explicit IteratorState(Accessible* aParent, IteratorState* mParentState = nullptr);
Accessible* mParent;
RefPtr<Accessible> mParent;
int32_t mIndex;
IteratorState* mParentState;
};
+9 -9
View File
@@ -40,7 +40,7 @@ def loadEventIDL(parser, includePath, eventname):
class Configuration:
def __init__(self, filename):
config = {}
execfile(filename, config)
exec(compile(open(filename, "rb").read(), filename, 'exec'), config)
self.simple_events = config.get('simple_events', [])
def firstCap(str):
@@ -64,7 +64,7 @@ def print_header_file(fd, conf, incdirs):
for e in conf.simple_events:
idl, idl_path = loadEventIDL(p, incdirs, e)
idl_paths.add(idl_path)
for iface in filter(lambda p: p.kind == "interface", idl.productions):
for iface in [p for p in idl.productions if p.kind == "interface"]:
classname = ("xpcAcc%s" % e)
baseinterfaces = interfaces(iface)
@@ -73,7 +73,7 @@ def print_header_file(fd, conf, incdirs):
fd.write("public:\n")
attributes = allAttributes(iface)
args = map(writeAttributeParams, attributes)
args = list(map(writeAttributeParams, attributes))
fd.write(" %s(%s) :\n" % (classname, ", ".join(args)))
initializers = []
@@ -83,7 +83,7 @@ def print_header_file(fd, conf, incdirs):
fd.write(" NS_DECL_CYCLE_COLLECTING_ISUPPORTS\n")
fd.write(" NS_DECL_CYCLE_COLLECTION_CLASS(%s)\n" % (classname))
for iface in filter(lambda i: i.name != "nsISupports", baseinterfaces):
for iface in [i for i in baseinterfaces if i.name != "nsISupports"]:
fd.write(" NS_DECL_%s\n" % iface.name.upper())
fd.write("\nprivate:\n")
@@ -97,13 +97,13 @@ def print_header_file(fd, conf, incdirs):
return idl_paths
def interfaceAttributeTypes(idl):
ifaces = filter(lambda p: p.kind == "interface", idl.productions)
ifaces = [p for p in idl.productions if p.kind == "interface"]
attributes = []
for i in ifaces:
ifaceAttributes = allAttributes(i)
attributes.extend(ifaceAttributes)
ifaceAttrs = filter(lambda a: a.realtype.nativeType("in").endswith("*"), attributes)
return map(lambda a: a.realtype.nativeType("in").strip(" *"), ifaceAttrs)
ifaceAttrs = [a for a in attributes if a.realtype.nativeType("in").endswith("*")]
return [a.realtype.nativeType("in").strip(" *") for a in ifaceAttrs]
def print_cpp(idl, fd, conf, eventname):
for p in idl.productions:
@@ -186,7 +186,7 @@ def interfaces(iface):
def allAttributes(iface):
attributes = []
for i in interfaces(iface):
attrs = filter(lambda m: isinstance(m, xpidl.Attribute), i.members)
attrs = [m for m in i.members if isinstance(m, xpidl.Attribute)]
attributes.extend(attrs)
return attributes
@@ -194,7 +194,7 @@ def allAttributes(iface):
def write_cpp(eventname, iface, fd):
classname = "xpcAcc%s" % eventname
attributes = allAttributes(iface)
ccattributes = filter(lambda m: m.realtype.nativeType('in').endswith('*'), attributes)
ccattributes = [m for m in attributes if m.realtype.nativeType('in').endswith('*')]
fd.write("NS_IMPL_CYCLE_COLLECTION(%s" % classname)
for c in ccattributes:
fd.write(", m%s" % firstCap(c.name))
+4 -5
View File
@@ -5,11 +5,11 @@
'''Parses a given application.ini file and outputs the corresponding
XULAppData structure as a C++ header file'''
import ConfigParser
import configparser
import sys
def main(output, file):
config = ConfigParser.RawConfigParser()
config = configparser.RawConfigParser()
config.read(file)
flags = set()
try:
@@ -27,8 +27,7 @@ def main(output, file):
'App:id', 'Gecko:minversion', 'Gecko:maxversion')
missing = [var for var in expected if var not in appdata]
if missing:
print >>sys.stderr, \
"Missing values in %s: %s" % (file, ', '.join(missing))
print("Missing values in %s: %s" % (file, ', '.join(missing)), file=sys.stderr)
sys.exit(1)
if not 'Crash Reporter:serverurl' in appdata:
@@ -57,4 +56,4 @@ if __name__ == '__main__':
if len(sys.argv) != 1:
main(sys.stdout, sys.argv[1])
else:
print >>sys.stderr, "Usage: %s /path/to/application.ini" % sys.argv[0]
print("Usage: %s /path/to/application.ini" % sys.argv[0], file=sys.stderr)
+4 -4
View File
@@ -34,7 +34,7 @@ def symlink(source, link_name):
def check_run(args):
global DEBUG
if DEBUG:
print >> sys.stderr, ' '.join(args)
print(' '.join(args), file=sys.stderr)
r = subprocess.call(args)
assert r == 0
@@ -43,11 +43,11 @@ def run_in(path, args):
d = os.getcwd()
global DEBUG
if DEBUG:
print >> sys.stderr, 'cd "%s"' % path
print('cd "%s"' % path, file=sys.stderr)
os.chdir(path)
check_run(args)
if DEBUG:
print >> sys.stderr, 'cd "%s"' % d
print('cd "%s"' % d, file=sys.stderr)
os.chdir(d)
@@ -377,7 +377,7 @@ if __name__ == "__main__":
extra_cflags2 = ["-fPIC"]
extra_cxxflags2 = ["-fPIC", "-static-libstdc++"]
if os.environ.has_key('LD_LIBRARY_PATH'):
if 'LD_LIBRARY_PATH' in os.environ:
os.environ['LD_LIBRARY_PATH'] = '%s/lib64/:%s' % (gcc_dir, os.environ['LD_LIBRARY_PATH']);
else:
os.environ['LD_LIBRARY_PATH'] = '%s/lib64/' % gcc_dir
+3 -3
View File
@@ -81,9 +81,9 @@ def process_files(files, output_filename, digests, strip):
short_file = short_file.lstrip('/')
else:
short_file = file
print >>output, '%s %s %s %s' % (hash, digest,
print('%s %s %s %s' % (hash, digest,
os.path.getsize(file),
short_file)
short_file), file=output)
def setup_logging(level=logging.DEBUG):
'''This function sets up the logging module using a speficiable logging
@@ -140,7 +140,7 @@ def main():
try:
for digest in options.digests:
hashlib.new(digest)
except ValueError, ve:
except ValueError as ve:
logger.error('Could not create a "%s" hash object (%s)' %
(digest, ve.args[0]))
exit(1)
@@ -11,7 +11,7 @@ import logging
import os
import site
import sys
import urllib2
import urllib.request, urllib.error, urllib.parse
import difflib
FAILURE_CODE = 1
@@ -40,10 +40,10 @@ def make_hg_url(hgHost, repoPath, protocol='https', revision=None,
def readConfig(configfile, keys=[], required=[]):
c = {}
execfile(configfile, c)
exec(compile(open(configfile, "rb").read(), configfile, 'exec'), c)
for k in keys:
c = c[k]
items = c.keys()
items = list(c.keys())
err = False
for key in required:
if key not in items:
@@ -126,7 +126,7 @@ def get_mozconfig(path, options):
else:
url = make_hg_url(options.hghost, options.branch, 'http',
options.revision, path)
return urllib2.urlopen(url).readlines()
return urllib.request.urlopen(url).readlines()
if __name__ == '__main__':
from optparse import OptionParser
-2
View File
@@ -73,8 +73,6 @@ if CONFIG['ARM_ARCH']:
if int(CONFIG['ARM_ARCH']) < 7:
gyp_vars['armv7'] = 0
gyp_vars['arm_neon_optional'] = 0
elif os == 'Android':
gyp_vars['armv7'] = 1
else:
# CPU detection for ARM works on Android only. armv7 always uses CPU
# detection, so we have to set armv7=0 for non-Android target
+1 -1
View File
@@ -18,7 +18,7 @@ flavors = {
'Linux': 'linux',
'Darwin': 'mac',
'SunOS': 'solaris',
'GNU/kFreeBSD': 'freebsd',
'kFreeBSD': 'freebsd',
'DragonFly': 'dragonfly',
'FreeBSD': 'freebsd',
'NetBSD': 'netbsd',
+14 -9
View File
@@ -12,7 +12,7 @@ import random
import subprocess
import sys
import uuid
import __builtin__
import builtins
from types import ModuleType
@@ -170,11 +170,16 @@ def bootstrap(topsrcdir, mozilla_dir=None):
if mozilla_dir is None:
mozilla_dir = topsrcdir
# Ensure we are running Python 2.7+. We put this check here so we generate a
# user-friendly error message rather than a cryptic stack trace on module
# import.
if sys.version_info[0] != 2 or sys.version_info[1] < 7:
print('Python 2.7 or above (but not Python 3) is required to run mach.')
# Ensure we are not running Python 2.
# We put this check here so we generate a user-friendly error message
# rather than a cryptic stack trace on module import.
if sys.version_info[0] < 3 or sys.version_info[1] < 3:
print('Python 3.3 or above is required to run mach.')
print('You are running Python', platform.python_version())
sys.exit(1)
# This sanity check is overkill, but why not?
if sys.version_info[0] > 3:
print('Python 4.x or higher not supported. Use Python 3 instead.')
print('You are running Python', platform.python_version())
sys.exit(1)
@@ -335,7 +340,7 @@ def bootstrap(topsrcdir, mozilla_dir=None):
# always load local repository configuration
mach.settings_paths.append(mozilla_dir)
for category, meta in CATEGORIES.items():
for category, meta in list(CATEGORIES.items()):
mach.define_category(category, meta['short'], meta['long'],
meta['priority'])
@@ -360,7 +365,7 @@ class ImportHook(object):
self._modules = set()
def __call__(self, name, globals=None, locals=None, fromlist=None,
level=-1):
level=0):
# name might be a relative import. Instead of figuring out what that
# resolves to, which is complex, just rely on the real import.
# Since we don't know the full module name, we can't check sys.modules,
@@ -409,4 +414,4 @@ class ImportHook(object):
# Install our hook
__builtin__.__import__ = ImportHook(__builtin__.__import__)
builtins.__import__ = ImportHook(builtins.__import__)
+1 -1
View File
@@ -11,7 +11,7 @@
# _declare_exceptions template, and add it to the return statement. Then
# destructure in the assignment below the function declaration.
@template
@imports(_from='__builtin__', _import='Exception')
@imports(_from='builtins', _import='Exception')
def _declare_exceptions():
class FatalCheckError(Exception):
'''An exception to throw from a function decorated with @checking.
+20 -13
View File
@@ -133,7 +133,8 @@ option(env='PYTHON', nargs=1, help='Python interpreter')
@imports(_from='mozbuild.configure.util', _import='LineIO')
@imports(_from='mozbuild.virtualenv', _import='VirtualenvManager')
@imports(_from='mozbuild.virtualenv', _import='verify_python_version')
@imports('distutils.sysconfig')
@imports(_from='mozpack.path', _import='normsep')
@imports('sysconfig')
def virtualenv_python(env_python, build_env, mozconfig, help):
if help:
return
@@ -165,6 +166,9 @@ def virtualenv_python(env_python, build_env, mozconfig, help):
os.path.join(topobjdir, '_virtualenv'), out,
os.path.join(topsrcdir, 'build', 'virtualenv_packages.txt'))
if normsep(sys.executable) == normsep(manager.python_path):
return normsep(manager.python_path)
if python:
# If we're not in the virtualenv, we need the which module for
# find_program.
@@ -193,10 +197,10 @@ def virtualenv_python(env_python, build_env, mozconfig, help):
sys.exit(subprocess.call([python] + sys.argv))
# We are now in the virtualenv
if not distutils.sysconfig.get_python_lib():
if not sysconfig.get_path("purelib"):
die('Could not determine python site packages directory')
return python
return normsep(python)
set_config('PYTHON', virtualenv_python)
add_old_configure_assignment('PYTHON', virtualenv_python)
@@ -212,7 +216,7 @@ def early_options():
def early_options():
return set(
option.env
for option in __sandbox__._options.itervalues()
for option in __sandbox__._options.values()
if option.env
)
return early_options
@@ -240,17 +244,17 @@ def mozconfig_options(mozconfig, help):
log.info(' %s' % arg)
helper.add(arg, origin='mozconfig', args=helper._args)
for key, value in mozconfig['env']['added'].iteritems():
for key, value in mozconfig['env']['added'].items():
add(key, value)
os.environ[key] = value
for key, (_, value) in mozconfig['env']['modified'].iteritems():
for key, (_, value) in mozconfig['env']['modified'].items():
add(key, value)
os.environ[key] = value
for key, value in mozconfig['vars']['added'].iteritems():
for key, value in mozconfig['vars']['added'].items():
# mozconfig_loader adds _IS_SET variables that are irrelevant
if not key.endswith('_IS_SET'):
add(key, value)
for key, (_, value) in mozconfig['vars']['modified'].iteritems():
for key, (_, value) in mozconfig['vars']['modified'].items():
add(key, value)
@@ -290,6 +294,7 @@ option('--target', nargs=1,
@imports(_from='mozbuild.configure.constants', _import='Endianness')
@imports(_from='mozbuild.configure.constants', _import='Kernel')
@imports(_from='mozbuild.configure.constants', _import='OS')
@imports(_from='mozbuild.configure.constants', _import='OS_and_Kernel')
def split_triplet(triplet):
# The standard triplet is defined as
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
@@ -385,8 +390,8 @@ def split_triplet(triplet):
alias=triplet,
cpu=CPU(canonical_cpu),
bitness=CPU_bitness[canonical_cpu],
kernel=Kernel(canonical_kernel),
os=OS(canonical_os),
kernel=OS_and_Kernel(canonical_kernel),
os=OS_and_Kernel(canonical_os),
endianness=Endianness(endianness),
raw_cpu=cpu,
raw_os=os,
@@ -400,7 +405,8 @@ def split_triplet(triplet):
def config_sub(shell, triplet):
config_sub = os.path.join(os.path.dirname(__file__), '..',
'autoconf', 'config.sub')
return subprocess.check_output([shell, config_sub, triplet]).strip()
return subprocess.check_output([shell, config_sub, triplet],
universal_newlines=True).strip()
@depends('--host', shell)
@@ -410,7 +416,8 @@ def host(value, shell):
if not value:
config_guess = os.path.join(os.path.dirname(__file__), '..',
'autoconf', 'config.guess')
host = subprocess.check_output([shell, config_guess]).strip()
host = subprocess.check_output([shell, config_guess],
universal_newlines=True).strip()
else:
host = value[0]
@@ -761,7 +768,7 @@ def enabled_in_nightly(milestone, _):
def all_configure_options(_):
result = []
previous = None
for option in __sandbox__._options.itervalues():
for option in __sandbox__._options.values():
# __sandbox__._options contains items for both option.name and
# option.env. But it's also an OrderedDict, meaning both are
# consecutive.
+14 -21
View File
@@ -3,13 +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/.
@imports('codecs')
@imports('sys')
def encoded_open(path, mode):
encoding = 'mbcs' if sys.platform == 'win32' else 'utf-8'
return codecs.open(path, mode, encoding)
m4 = check_prog(
"M4",
(
@@ -31,8 +24,10 @@ m4 = check_prog(
@imports(_from='os.path', _import='exists')
@imports(_from='mozbuild.shellutil', _import='quote')
@imports(_from='os', _import='environ')
@imports(_from='mozbuild.getencoding', _import='getencoding')
def prepare_configure(old_configure, mozconfig, awk, m4, build_env, shell,
old_configure_assignments, build_project):
encoding = getencoding()
# os.path.abspath in the sandbox will ensure forward slashes on Windows,
# which is actually necessary because this path actually ends up literally
# as $0, and backslashes there breaks autoconf's detection of the source
@@ -43,7 +38,6 @@ def prepare_configure(old_configure, mozconfig, awk, m4, build_env, shell,
if not old_configure_dir.endswith('/js/src'):
old_configure = os.path.join(old_configure_dir, 'js', 'src',
os.path.basename(old_configure))
refresh = True
if exists(old_configure):
mtime = getmtime(old_configure)
@@ -67,25 +61,21 @@ def prepare_configure(old_configure, mozconfig, awk, m4, build_env, shell,
env['AWK'] = awk
env['AC_MACRODIR'] = os.path.join(build_env.topsrcdir, 'build', 'autoconf')
my_env = env
# Handle Python 2.7 not allowing unicode in the environment on Windows
if sys.platform == 'win32':
my_env = dict()
for e in env:
my_env[e.encode('ascii','ignore')] = env[e].encode('ascii','ignore')
script = subprocess.check_output([
shell, autoconf,
'--localdir=%s' % os.path.dirname(old_configure),
old_configure + '.in'], env=my_env)
script = script.decode(encoding, errors='replace')
# Make old-configure append to config.log, where we put our own log.
# This could be done with a m4 macro, but it's way easier this way
script = script.replace('>./config.log', '>>./config.log')
with open(old_configure, 'wb') as fh:
with open(old_configure, 'w', encoding=encoding, errors='replace') as fh:
fh.write(script)
cmd = [shell, old_configure]
with encoded_open('old-configure.vars', 'w') as out:
with open('old-configure.vars', 'w', encoding=encoding, errors='replace') as out:
log.debug('Injecting the following to old-configure:')
def inject(command):
print(command, file=out)
@@ -127,7 +117,6 @@ def old_configure_options(*options):
'--enable-alsa',
'--enable-appcompat-guid',
'--enable-av1',
'--enable-jxl',
'--enable-b2g-bt',
'--enable-b2g-camera',
'--enable-b2g-ril',
@@ -163,6 +152,7 @@ def old_configure_options(*options):
'--enable-jitspew',
'--enable-js-lto',
'--enable-leak-sanitizer',
'--enable-libaom',
'--enable-libjpeg-turbo',
'--enable-libproxy',
'--enable-llvm-hacks',
@@ -295,8 +285,11 @@ def old_configure_options(*options):
@imports('subprocess')
@imports('sys')
@imports(_from='mozbuild.shellutil', _import='quote')
@imports(_from='mozbuild.util', _import='exec_')
@imports(_from='mozbuild.getencoding', _import='getencoding')
def old_configure(prepare_configure, extra_old_configure_args, all_options,
*options):
encoding = getencoding()
cmd = prepare_configure
# old-configure only supports the options listed in @old_configure_options
@@ -333,7 +326,7 @@ def old_configure(prepare_configure, extra_old_configure_args, all_options,
ret = subprocess.call(cmd)
if ret:
with log.queue_debug():
with encoded_open('config.log', 'r') as fh:
with open('config.log', 'r', encoding=encoding, errors='replace') as fh:
fh.seek(log_size)
for line in fh:
log.debug(line.rstrip())
@@ -341,12 +334,12 @@ def old_configure(prepare_configure, extra_old_configure_args, all_options,
sys.exit(ret)
raw_config = {}
with encoded_open('config.data', 'r') as fh:
with open('config.data', 'r', encoding=encoding, errors='replace') as fh:
code = compile(fh.read(), 'config.data', 'exec')
# Every variation of the exec() function I tried led to:
# SyntaxError: unqualified exec is not allowed in function 'main' it
# contains a nested function with free variables
exec code in raw_config
exec_(code, raw_config)
# Ensure all the flags known to old-configure appear in the
# @old_configure_options above.
@@ -380,9 +373,9 @@ def set_old_configure_define(name, value):
def post_old_configure(raw_config):
for k, v in raw_config['substs']:
set_old_configure_config(
k[1:-1], v[1:-1] if isinstance(v, types.StringTypes) else v)
k[1:-1], v[1:-1] if isinstance(v, str) else v)
for k, v in dict(raw_config['defines']).iteritems():
for k, v in dict(raw_config['defines']).items():
set_old_configure_define(k[1:-1], v[1:-1])
set_old_configure_config('non_global_defines',
+45 -6
View File
@@ -61,6 +61,44 @@ set_config('HAVE_YASM', have_yasm)
# Until the YASM variable is not necessary in old-configure.
add_old_configure_assignment('YASM', have_yasm)
# nasm detection
# ==============================================================
nasm = check_prog('NASM', ['nasm'], allow_missing=True)
@depends_if(nasm)
@checking('nasm version')
def nasm_version(nasm):
version = check_cmd_output(
nasm, '-v',
onerror=lambda: die('Failed to get nasm version.')
).splitlines()[0].split()[2]
return Version(version)
@depends(nasm, nasm_version)
def have_nasm(nasm, version):
if nasm and version >= Version('2.14'):
return True
set_config('HAVE_NASM', have_nasm)
@depends(have_nasm, target)
def nasm_asflags(have_nasm, target):
if have_nasm:
asflags = {
('OSX', 'x86'): '-f macho32',
('OSX', 'x86_64'): '-f macho64',
('WINNT', 'x86'): '-f win32',
('WINNT', 'x86_64'): '-f win64',
}.get((target.os, target.cpu), None)
if asflags is None:
if target.cpu == 'x86':
asflags = '-f elf32'
elif target.cpu == 'x86_64':
asflags = '-f elf64'
return asflags
set_config('NASM_ASFLAGS', nasm_asflags)
# MacOS deployment target version
# ==============================================================
# This needs to happen before any compilation test is done.
@@ -236,7 +274,7 @@ def get_compiler_info(compiler, language):
('CPU', CPU_preprocessor_checks),
('KERNEL', kernel_preprocessor_checks),
):
for n, (value, condition) in enumerate(preprocessor_checks.iteritems()):
for n, (value, condition) in enumerate(preprocessor_checks.items()):
check += dedent('''\
#%(if)s %(condition)s
%%%(name)s "%(value)s"
@@ -269,7 +307,7 @@ def get_compiler_info(compiler, language):
# have non-ASCII characters. Treat the output as bytearray.
data = {}
for line in result.splitlines():
if line.startswith(b'%'):
if line.startswith('%'):
k, _, v = line.partition(' ')
k = k.lstrip('%')
data[k] = v.replace(' ', '').lstrip('"').rstrip('"')
@@ -397,10 +435,11 @@ def check_compiler(compiler, language, target):
@imports('json')
@imports('subprocess')
@imports('sys')
@imports(_from='locale', _import='getpreferredencoding')
def get_vc_paths(topsrcdir):
encoding = getpreferredencoding(False)
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'))
return json.loads(subprocess.check_output([os.path.join(topsrcdir, 'build/win32/vswhere.exe'), '-format', 'json'] + args).decode(encoding, errors='replace'))
# Can't pass -requires with -legacy, so query each separately.
# Legacy versions first (VS2015)
@@ -419,7 +458,7 @@ def get_vc_paths(topsrcdir):
# 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_version = open(os.path.join(path, r'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt'), 'r', encoding=encoding, errors='replace').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')],
@@ -601,7 +640,7 @@ def compiler(language, host_or_target, c_compiler=None, other_compiler=None,
if cross_compiling and other_compiler.type == 'clang':
return namespace(**{
k: [] if k == 'flags' else v
for k, v in other_compiler.__dict__.iteritems()
for k, v in other_compiler.__dict__.items()
})
# Normally, we'd use `var` instead of `_var`, but the interaction with
+10 -3
View File
@@ -25,15 +25,22 @@ def configure_error(message):
@imports('sys')
@imports(_from='mozbuild.configure.util', _import='LineIO')
@imports(_from='mozbuild.shellutil', _import='quote')
@imports(_from='mozbuild.getencoding', _import='getencoding')
def check_cmd_output(*args, **kwargs):
encoding = getencoding()
onerror = kwargs.pop('onerror', None)
with log.queue_debug():
log.debug('Executing: `%s`', quote(*args))
proc = subprocess.Popen(args, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = proc.communicate()
retcode = proc.wait()
stdout = stdout.decode(encoding, errors='replace')
stderr = stderr.decode(encoding, errors='replace')
if retcode == 0:
return stdout
@@ -70,7 +77,7 @@ def windows_binary_type(path):
Returns WindowsBinaryType constant.
"""
GetBinaryTypeW = ctypes.windll.kernel32.GetBinaryTypeW
GetBinaryTypeW.argtypes = [wintypes.LPWSTR, wintypes.POINTER(wintypes.DWORD)]
GetBinaryTypeW.argtypes = [wintypes.LPWSTR, ctypes.POINTER(wintypes.DWORD)]
GetBinaryTypeW.restype = wintypes.BOOL
bin_type = wintypes.DWORD()
@@ -232,7 +239,7 @@ def unique_list(l):
# ('19.0', 'arm', r'C:\...\amd64_arm\cl.exe')
# ('19.0', 'x64', r'C:\...\amd64\cl.exe')
# ('19.0', 'x86', r'C:\...\amd64_x86\cl.exe')
@imports(_import='_winreg', _as='winreg')
@imports(_import='winreg', _as='winreg')
@imports(_from='__builtin__', _import='WindowsError')
@imports(_from='fnmatch', _import='fnmatch')
def get_registry_values(pattern):
@@ -295,7 +302,7 @@ def get_registry_values(pattern):
keys = next_keys
@imports(_from='mozbuild.configure.util', _import='Version', _as='_Version')
@imports(_from='mozbuild.version', _import='RichVersion', _as='_Version')
def Version(v):
'A version number that can be compared usefully.'
return _Version(v)
+4 -1
View File
@@ -408,9 +408,12 @@ mt = check_prog('MT', depends_win()(lambda: ('mt.exe',)), input='MT',
@depends_win(mt)
@checking('whether MT is really Microsoft Manifest Tool', lambda x: bool(x))
@imports('subprocess')
@imports(_from='locale', _import='getpreferredencoding')
def valid_mt(path):
encoding = getpreferredencoding(False)
try:
out = subprocess.check_output([path]).splitlines()
out = subprocess.check_output([path])
out = out.decode(encoding, errors='replace').splitlines()
out = '\n'.join(l for l in out
if 'Microsoft (R) Manifest Tool' in l)
if out:
+13 -13
View File
@@ -58,7 +58,7 @@ def runUtil(util, args, inputdata = None):
def createRandomFile(randomFile):
for count in xrange(0, 2048):
for count in range(0, 2048):
randomFile.write(chr(random.randint(0, 255)))
@@ -125,7 +125,7 @@ def createSSLServerCertificate(build, srcDir):
iterator = iter(locations)
# Skips the first entry, I don't know why: bug 879740
iterator.next()
next(iterator)
locationsParam = ""
firstLocation = ""
@@ -148,7 +148,7 @@ def createSSLServerCertificate(build, srcDir):
firstLocation = loc.host
if not firstLocation:
print "Nothing to generate, no automatic secure hosts specified"
print("Nothing to generate, no automatic secure hosts specified")
else:
createRandomFile(rndfile)
@@ -162,7 +162,7 @@ def createSSLServerCertificate(build, srcDir):
return 0
if len(sys.argv) == 1:
print "Specify --gen-server or --gen-ca"
print("Specify --gen-server or --gen-ca")
sys.exit(1)
build = MozbuildObject.from_environment()
@@ -170,23 +170,23 @@ certdir = os.path.join(build.topsrcdir, "build", "pgo", "certs")
if sys.argv[1] == "--gen-server":
certificateStatus = createSSLServerCertificate(build, certdir)
if certificateStatus:
print "TEST-UNEXPECTED-FAIL | SSL Server Certificate generation"
print("TEST-UNEXPECTED-FAIL | SSL Server Certificate generation")
sys.exit(certificateStatus)
if sys.argv[1] == "--gen-ca":
certificateStatus = createCertificateAuthority(build, certdir)
if certificateStatus:
print "TEST-UNEXPECTED-FAIL | Certificate Authority generation"
print("TEST-UNEXPECTED-FAIL | Certificate Authority generation")
else:
print "\n\n"
print "==================================================="
print " IMPORTANT:"
print " To use this new certificate authority in tests"
print " run 'make' at testing/mochitest"
print "==================================================="
print("\n\n")
print("===================================================")
print(" IMPORTANT:")
print(" To use this new certificate authority in tests")
print(" run 'make' at testing/mochitest")
print("===================================================")
sys.exit(certificateStatus)
print "Invalid option specified"
print("Invalid option specified")
sys.exit(1)
+1 -1
View File
@@ -77,7 +77,7 @@ if __name__ == '__main__':
jarlog = os.getenv("JARLOG_FILE")
if jarlog:
env["MOZ_JAR_LOG_FILE"] = os.path.abspath(jarlog)
print "jarlog: %s" % env["MOZ_JAR_LOG_FILE"]
print("jarlog: %s" % env["MOZ_JAR_LOG_FILE"])
cmdargs = ["http://localhost:%d/index.html" % PORT]
runner = FirefoxRunner(profile=profile,
+22 -11
View File
@@ -3,7 +3,7 @@
from __future__ import print_function
import os, sys
if not len(sys.argv) is 2 or not os.path.exists(sys.argv[1]):
if not len(sys.argv) == 2 or not os.path.exists(sys.argv[1]):
print("\nYou did not supply a valid path to check.")
exit(1)
else:
@@ -44,7 +44,8 @@ PP_DIRECTIVES = [
]
PP_FILES = []
PP_BAD_FILES = []
PP_BAD_DIRECTIVE_FILES = []
PP_BAD_ENCODING_FILES = []
for root, directories, filenames in os.walk(DIST_PATH):
for filename in filenames:
@@ -52,21 +53,31 @@ for root, directories, filenames in os.walk(DIST_PATH):
PP_FILES += [ os.path.join(root, filename).replace(os.sep, '/') ]
for file in PP_FILES:
with open(file) as fp:
with open(file, encoding='utf-8') as fp:
marker = '%' if file.endswith(PP_SPECIAL_TYPES) else '#'
directives = tuple(marker + directive for directive in PP_DIRECTIVES)
for line in fp:
if line.startswith(directives):
PP_BAD_FILES += [ file.replace(DIST_PATH + '/', '') ]
try:
for line in fp:
if line.startswith(directives):
PP_BAD_DIRECTIVE_FILES += [ file.replace(DIST_PATH + '/', '') ]
except UnicodeDecodeError:
PP_BAD_ENCODING_FILES += [ file.replace(DIST_PATH+ '/' , '') ]
fp.close()
PP_BAD_FILES = list(dict.fromkeys(PP_BAD_FILES))
PP_BAD_DIRECTIVE_FILES = list(dict.fromkeys(PP_BAD_DIRECTIVE_FILES))
PP_BAD_ENCODING_FILES = list(dict.fromkeys(PP_BAD_ENCODING_FILES))
print('Done!')
if len(PP_BAD_FILES) > 0:
print("\nWARNING: The following {0} file(s) in {1} may require preprocessing:\n".format(len(PP_BAD_FILES), DIST_PATH))
for file in PP_BAD_FILES:
if len(PP_BAD_DIRECTIVE_FILES) > 0:
print("\nWARNING: The following {0} file(s) in {1} may require preprocessing:\n".format(len(PP_BAD_DIRECTIVE_FILES), DIST_PATH))
for file in PP_BAD_DIRECTIVE_FILES:
print(file)
exit(0)
if len(PP_BAD_ENCODING_FILES) > 0:
print("\nWARNING: The following {0} file(s) in {1} are not valid UTF-8:\n".format(len(PP_BAD_ENCODING_FILES), DIST_PATH))
for file in PP_BAD_ENCODING_FILES:
print(file)
sys.exit(0)
+1 -1
View File
@@ -10,4 +10,4 @@ with open(filename, 'rU') as fh:
source = fh.read()
statements = pymake.parser.parsestring(source, filename)
print statements.to_source()
print(statements.to_source())
+2 -2
View File
@@ -4,9 +4,9 @@ import sys
import pymake.parser
for f in sys.argv[1:]:
print "Parsing %s" % f
print("Parsing %s" % f)
fd = open(f, 'rU')
s = fd.read()
fd.close()
stmts = pymake.parser.parsestring(s, f)
print stmts
print(stmts)
+15 -15
View File
@@ -2,7 +2,7 @@
import errno, sys, os, shutil, time
from getopt import getopt, GetoptError
from process import PythonException
from .process import PythonException
__all__ = ["mkdir", "rm", "sleep", "touch"]
@@ -13,8 +13,8 @@ def mkdir(args):
"""
try:
opts, args = getopt(args, "p", ["parents"])
except GetoptError, e:
raise PythonException, ("mkdir: %s" % e, 1)
except GetoptError as e:
raise PythonException("mkdir: %s" % e, 1)
parents = False
for o, a in opts:
if o in ('-p', '--parents'):
@@ -25,11 +25,11 @@ def mkdir(args):
os.makedirs(f)
else:
os.mkdir(f)
except OSError, e:
except OSError as e:
if e.errno == errno.EEXIST and parents:
pass
else:
raise PythonException, ("mkdir: %s" % e, 1)
raise PythonException("mkdir: %s" % e, 1)
def rm(args):
"""
@@ -38,8 +38,8 @@ def rm(args):
"""
try:
opts, args = getopt(args, "rRf", ["force", "recursive"])
except GetoptError, e:
raise PythonException, ("rm: %s" % e, 1)
except GetoptError as e:
raise PythonException("rm: %s" % e, 1)
force = False
recursive = False
for o, a in opts:
@@ -50,7 +50,7 @@ def rm(args):
for f in args:
if os.path.isdir(f):
if not recursive:
raise PythonException, ("rm: cannot remove '%s': Is a directory" % f, 1)
raise PythonException("rm: cannot remove '%s': Is a directory" % f, 1)
else:
shutil.rmtree(f, force)
elif os.path.exists(f):
@@ -58,9 +58,9 @@ def rm(args):
os.unlink(f)
except:
if not force:
raise PythonException, ("rm: failed to remove '%s': %s" % (f, sys.exc_info()[0]), 1)
raise PythonException("rm: failed to remove '%s': %s" % (f, sys.exc_info()[0]), 1)
elif not force:
raise PythonException, ("rm: cannot remove '%s': No such file or directory" % f, 1)
raise PythonException("rm: cannot remove '%s': No such file or directory" % f, 1)
def sleep(args):
"""
@@ -70,7 +70,7 @@ def sleep(args):
values = {'s': 1, 'm': 60, 'h': 3600, 'd': 86400}
for a in args:
multiplier = 1
for k, v in values.iteritems():
for k, v in values.items():
if a.endswith(k):
a = a[:-1]
multiplier = v
@@ -79,7 +79,7 @@ def sleep(args):
f = float(a)
total += f * multiplier
except ValueError:
raise PythonException, ("sleep: invalid time interval '%s'" % a, 1)
raise PythonException("sleep: invalid time interval '%s'" % a, 1)
time.sleep(total)
def touch(args):
@@ -88,8 +88,8 @@ def touch(args):
"""
try:
opts, args = getopt(args, "t:")
except GetoptError, e:
raise PythonException, ("touch: %s" % e, 1)
except GetoptError as e:
raise PythonException("touch: %s" % e, 1)
opts = dict(opts)
times = None
if '-t' in opts:
@@ -97,7 +97,7 @@ def touch(args):
from time import mktime, localtime
m = re.match('^(?P<Y>(?:\d\d)?\d\d)?(?P<M>\d\d)(?P<D>\d\d)(?P<h>\d\d)(?P<m>\d\d)(?:\.(?P<s>\d\d))?$', opts['-t'])
if not m:
raise PythonException, ("touch: invalid date format '%s'" % opts['-t'], 1)
raise PythonException("touch: invalid date format '%s'" % opts['-t'], 1)
def normalized_field(m, f):
if f == 'Y':
if m.group(f) is None:
+13 -13
View File
@@ -11,7 +11,7 @@ except when a submake specifies -j1 when the parent make is building in parallel
import os, subprocess, sys, logging, time, traceback, re
from optparse import OptionParser
import data, parserdata, process, util
from . import data, parserdata, process, util
# TODO: If this ever goes from relocatable package to system-installed, this may need to be
# a configured-in path.
@@ -62,7 +62,7 @@ def parsemakeflags(env):
return opts
def _version(*args):
print """pymake: GNU-compatible make program
print("""pymake: GNU-compatible make program
Copyright (C) 2009 The Mozilla Foundation <http://www.mozilla.org/>
This is free software; see the source for copying conditions.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
@@ -71,7 +71,7 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE."""
DEALINGS IN THE SOFTWARE.""")
_log = logging.getLogger('pymake.execution')
@@ -95,7 +95,7 @@ class _MakeContext(object):
def remakecb(self, remade, error=None):
if error is not None:
print error
print(error)
self.context.defer(self.cb, 2)
return
@@ -124,15 +124,15 @@ class _MakeContext(object):
self.makefile.include(f)
self.makefile.finishparsing()
self.makefile.remakemakefiles(self.remakecb)
except util.MakeError, e:
print e
except util.MakeError as e:
print(e)
self.context.defer(self.cb, 2)
return
if len(self.targets) == 0:
if self.makefile.defaulttarget is None:
print "No target specified and no default target found."
print("No target specified and no default target found.")
self.context.defer(self.cb, 2)
return
@@ -154,7 +154,7 @@ class _MakeContext(object):
if not len(self.realtargets):
if self.options.printdir:
print "make.py[%i]: Leaving directory '%s'" % (self.makelevel, self.workdir)
print("make.py[%i]: Leaving directory '%s'" % (self.makelevel, self.workdir))
sys.stdout.flush()
self.context.defer(self.cb, 0)
@@ -255,24 +255,24 @@ def main(args, env, cwd, cb):
context = process.getcontext(options.jobcount)
if options.printdir:
print "make.py[%i]: Entering directory '%s'" % (makelevel, workdir)
print("make.py[%i]: Entering directory '%s'" % (makelevel, workdir))
sys.stdout.flush()
if len(options.makefiles) == 0:
if os.path.exists(util.normaljoin(workdir, 'Makefile')):
options.makefiles.append('Makefile')
else:
print "No makefile found"
print("No makefile found")
cb(2)
return
ostmts, targets, overrides = parserdata.parsecommandlineargs(arguments)
_MakeContext(makeflags, makelevel, workdir, context, env, targets, options, ostmts, overrides, cb)
except (util.MakeError), e:
print e
except (util.MakeError) as e:
print(e)
if options.printdir:
print "make.py[%i]: Leaving directory '%s'" % (makelevel, workdir)
print("make.py[%i]: Leaving directory '%s'" % (makelevel, workdir))
sys.stdout.flush()
cb(2)
return
+18 -18
View File
@@ -3,8 +3,9 @@ A representation of makefile data structures.
"""
import logging, re, os, sys
import parserdata, parser, functions, process, util, implicit
from cStringIO import StringIO
from . import parserdata, parser, functions, process, util, implicit
from io import StringIO
from functools import reduce
if sys.version_info[0] < 3:
str_type = basestring
@@ -405,7 +406,7 @@ class Expansion(BaseExpansion, list):
if len(a) != len(b):
return False
for i in xrange(len(self)):
for i in range(len(self)):
e1, is_func1 = a[i]
e2, is_func2 = b[i]
@@ -447,7 +448,7 @@ class Variables(object):
self.parent = parent
def readfromenvironment(self, env):
for k, v in env.iteritems():
for k, v in env.items():
self.set(k, self.FLAVOR_RECURSIVE, self.SOURCE_ENVIRONMENT, v)
def get(self, name, expand=True):
@@ -547,7 +548,7 @@ class Variables(object):
self.set(k, flavor, source, value)
def __iter__(self):
for k, (flavor, source, value, valueexp) in self._map.iteritems():
for k, (flavor, source, value, valueexp) in self._map.items():
yield k, flavor, source, value
def __contains__(self, item):
@@ -864,7 +865,7 @@ class RemakeRuleContext(object):
assert error in (True, False)
if error:
print "<%s>: Found error" % self.target.target
print("<%s>: Found error" % self.target.target)
self.error = True
if didanything:
self.didanything = True
@@ -949,8 +950,8 @@ class RemakeRuleContext(object):
self.target.didanything = True
try:
self.commands = [c for c in self.rule.getcommands(self.target, self.makefile)]
except util.MakeError, e:
print e
except util.MakeError as e:
print(e)
sys.stdout.flush()
cb(error=True)
return
@@ -1283,9 +1284,9 @@ class Target(object):
try:
self.resolvedeps(makefile, targetstack, [], False)
except util.MakeError, e:
except util.MakeError as e:
if printerror:
print e
print(e)
self.error = True
self.notifydone(makefile)
return
@@ -1397,7 +1398,7 @@ class _CommandWrapper(object):
def _cb(self, res):
if res != 0 and not self.ignoreErrors:
print "%s: command '%s' failed, return code %i" % (self.loc, self.cline, res)
print("%s: command '%s' failed, return code %i" % (self.loc, self.cline, res))
self.usercb(error=True)
else:
self.usercb(error=False)
@@ -1591,7 +1592,7 @@ class _RemakeContext(object):
assert error in (True, False)
if error and self.required:
print "Error remaking makefiles (ignored)"
print("Error remaking makefiles (ignored)")
if len(self.toremake):
target, self.required = self.toremake.pop(0)
@@ -1678,7 +1679,7 @@ class Makefile(object):
self.variables.set('MAKECMDGOALS', Variables.FLAVOR_SIMPLE,
Variables.SOURCE_AUTOMATIC, ' '.join(targets))
for vname, val in implicit.variables.iteritems():
for vname, val in implicit.variables.items():
self.variables.set(vname,
Variables.FLAVOR_SIMPLE,
Variables.SOURCE_IMPLICIT, val)
@@ -1750,11 +1751,10 @@ class Makefile(object):
if value is None:
self._vpath = []
else:
self._vpath = filter(lambda e: e != '',
re.split('[%s\s]+' % os.pathsep,
value.resolvestr(self, self.variables, ['VPATH'])))
self._vpath = [e for e in re.split('[%s\s]+' % os.pathsep,
value.resolvestr(self, self.variables, ['VPATH'])) if e != '']
targets = list(self._targets.itervalues())
targets = list(self._targets.values())
for t in targets:
t.explicit = True
for r in t.rules:
@@ -1825,7 +1825,7 @@ class Makefile(object):
def getsubenvironment(self, variables):
env = dict(self.env)
for vname, v in self.exportedvars.iteritems():
for vname, v in self.exportedvars.items():
if v:
flavor, source, val = variables.get(vname)
if val is None:
+11 -11
View File
@@ -2,10 +2,10 @@
Makefile functions.
"""
import parser, util
from . import parser, util
import subprocess, os, logging, sys
from globrelative import glob
from cStringIO import StringIO
from .globrelative import glob
from io import StringIO
log = logging.getLogger('pymake.data')
@@ -135,7 +135,7 @@ class Function(object):
if len(self._arguments) != len(other._arguments):
return False
for i in xrange(len(self._arguments)):
for i in range(len(self._arguments)):
# According to the GNU make manual Section 8.1, whitespace around
# arguments is *not* part of the argument's value. So, we do a
# whitespace-agnostic comparison.
@@ -525,7 +525,7 @@ class JoinFunction(Function):
@staticmethod
def iterjoin(l1, l2):
for i in xrange(0, max(len(l1), len(l2))):
for i in range(0, max(len(l1), len(l2))):
i1 = i < len(l1) and l1[i] or ''
i2 = i < len(l2) and l2[i] or ''
yield i1 + i2
@@ -670,7 +670,7 @@ class CallFunction(Function):
v = data.Variables(parent=variables)
v.set('0', data.Variables.FLAVOR_SIMPLE, data.Variables.SOURCE_AUTOMATIC, vname)
for i in xrange(1, len(self._arguments)):
for i in range(1, len(self._arguments)):
param = self._arguments[i].resolvestr(makefile, variables, setting)
v.set(str(i), data.Variables.FLAVOR_SIMPLE, data.Variables.SOURCE_AUTOMATIC, param)
@@ -770,7 +770,7 @@ class ShellFunction(Function):
__slots__ = Function.__slots__
def resolve(self, makefile, variables, fd, setting):
from process import prepare_command
from .process import prepare_command
cline = self._arguments[0].resolvestr(makefile, variables, setting)
executable, cline = prepare_command(cline, makefile.workdir, self.loc)
@@ -785,8 +785,8 @@ class ShellFunction(Function):
try:
p = subprocess.Popen(cline, executable=executable, env=makefile.env, shell=False,
stdout=subprocess.PIPE, cwd=makefile.workdir)
except OSError, e:
print >>sys.stderr, "Error executing command %s" % cline[0], e
except OSError as e:
print("Error executing command %s" % cline[0], e, file=sys.stderr)
return
finally:
os.environ['PATH'] = oldpath
@@ -830,7 +830,7 @@ class InfoFunction(Function):
def resolve(self, makefile, variables, fd, setting):
v = self._arguments[0].resolvestr(makefile, variables, setting)
print v
print(v)
functionmap = {
'subst': SubstFunction,
@@ -870,4 +870,4 @@ functionmap = {
'info': InfoFunction,
}
import data
from . import data
+2 -2
View File
@@ -7,7 +7,7 @@ Filename globbing like the python glob module with minor differences:
"""
import os, re, fnmatch
import util
from . import util
_globcheck = re.compile('[[*?]')
@@ -62,7 +62,7 @@ def globpattern(dir, pattern):
if not leaf.startswith('.')]
leaves = fnmatch.filter(leaves, pattern)
leaves = filter(lambda l: os.path.exists(util.normaljoin(dir, l)), leaves)
leaves = [l for l in leaves if os.path.exists(util.normaljoin(dir, l))]
leaves.sort()
return leaves
+4 -4
View File
@@ -34,7 +34,7 @@ coming.
"""
import logging, re, os, sys
import data, functions, util, parserdata
from . import data, functions, util, parserdata
_log = logging.getLogger('pymake.parser')
@@ -108,7 +108,7 @@ _alltokens = re.compile(r'''\\*\# | # hash mark preceeded by any number of backs
:: |
(?:\$(?:$|[\(\{](?:%s)\s+|.)) | # dollar sign followed by EOF, a function keyword with whitespace, or any character
:(?![\\/]) | # colon followed by anything except a slash (Windows path detection)
[=#{}();,|'"]''' % '|'.join(functions.functionmap.iterkeys()), re.VERBOSE)
[=#{}();,|'"]''' % '|'.join(iter(functions.functionmap.keys())), re.VERBOSE)
def iterdata(d, offset, tokenlist, it):
"""
@@ -336,7 +336,7 @@ _conditionkeywords = {
'ifndef': ifndef
}
_conditiontokens = tuple(_conditionkeywords.iterkeys())
_conditiontokens = tuple(_conditionkeywords.keys())
_conditionre = re.compile(r'(%s)(?:$|\s+)' % '|'.join(_conditiontokens))
_directivestokenlist = _conditiontokens + \
@@ -691,7 +691,7 @@ def parsemakesyntax(d, offset, stopon, iterfunc):
while True: # this is not a for loop because `di` changes during the function
assert stacktop is not None
try:
s, token, tokenoffset, offset = di.next()
s, token, tokenoffset, offset = next(di)
except StopIteration:
break
+19 -19
View File
@@ -1,6 +1,6 @@
import logging, re, os
import data, parser, functions, util
from cStringIO import StringIO
from . import data, parser, functions, util
from io import StringIO
from pymake.globrelative import hasglob, glob
_log = logging.getLogger('pymake.data')
@@ -76,7 +76,7 @@ def parsecommandlineargs(args):
overrides = []
stmts = StatementList()
r = []
for i in xrange(0, len(args)):
for i in range(0, len(args)):
a = args[i]
vname, t, val = util.strpartition(a, ':=')
@@ -195,7 +195,7 @@ class Rule(Statement):
deps = list(_expandwildcards(makefile, data.stripdotslashes(self.depexp.resolvesplit(makefile, makefile.variables))))
if ispattern:
rule = data.PatternRule(targets, map(data.Pattern, deps), self.doublecolon, loc=self.targetexp.loc)
rule = data.PatternRule(targets, list(map(data.Pattern, deps)), self.doublecolon, loc=self.targetexp.loc)
makefile.appendimplicitrule(rule)
else:
rule = data.Rule(deps, self.doublecolon, loc=self.targetexp.loc, weakdeps=False)
@@ -207,7 +207,7 @@ class Rule(Statement):
context.currule = rule
def dump(self, fd, indent):
print >>fd, "%sRule %s: %s" % (indent, self.targetexp, self.depexp)
print("%sRule %s: %s" % (indent, self.targetexp, self.depexp), file=fd)
def to_source(self):
sep = ':'
@@ -285,7 +285,7 @@ class StaticPatternRule(Statement):
context.currule = rule
def dump(self, fd, indent):
print >>fd, "%sStaticPatternRule %s: %s: %s" % (indent, self.targetexp, self.patternexp, self.depexp)
print("%sStaticPatternRule %s: %s: %s" % (indent, self.targetexp, self.patternexp, self.depexp), file=fd)
def to_source(self):
sep = ':'
@@ -339,7 +339,7 @@ class Command(Statement):
context.currule.addcommand(self.exp)
def dump(self, fd, indent):
print >>fd, "%sCommand %s" % (indent, self.exp,)
print("%sCommand %s" % (indent, self.exp,), file=fd)
def to_source(self):
# Commands have some interesting quirks when it comes to source
@@ -438,7 +438,7 @@ class SetVariable(Statement):
v.set(vname, flavor, self.source, value)
def dump(self, fd, indent):
print >>fd, "%sSetVariable<%s> %s %s\n%s %r" % (indent, self.valueloc, self.vnameexp, self.token, indent, self.value)
print("%sSetVariable<%s> %s %s\n%s %r" % (indent, self.valueloc, self.vnameexp, self.token, indent, self.value), file=fd)
def __eq__(self, other):
if not isinstance(other, SetVariable):
@@ -452,7 +452,7 @@ class SetVariable(Statement):
def to_source(self):
chars = []
for i in xrange(0, len(self.value)):
for i in range(0, len(self.value)):
c = self.value[i]
# Literal # is escaped in variable assignment otherwise it would be
@@ -651,14 +651,14 @@ class ConditionBlock(Statement):
i += 1
def dump(self, fd, indent):
print >>fd, "%sConditionBlock" % (indent,)
print("%sConditionBlock" % (indent,), file=fd)
indent2 = indent + ' '
for c, statements in self._groups:
print >>fd, "%s Condition %s" % (indent, c)
print("%s Condition %s" % (indent, c), file=fd)
statements.dump(fd, indent2)
print >>fd, "%s ~Condition" % (indent,)
print >>fd, "%s~ConditionBlock" % (indent,)
print("%s ~Condition" % (indent,), file=fd)
print("%s~ConditionBlock" % (indent,), file=fd)
def to_source(self):
lines = []
@@ -681,7 +681,7 @@ class ConditionBlock(Statement):
if len(self) != len(other):
return False
for i in xrange(0, len(self)):
for i in range(0, len(self)):
our_condition, our_statements = self[i]
other_condition, other_statements = other[i]
@@ -793,7 +793,7 @@ class Include(Statement):
makefile.include(f, self.required, loc=self.exp.loc, weak=self.weak)
def dump(self, fd, indent):
print >>fd, "%sInclude %s" % (indent, self.exp)
print("%sInclude %s" % (indent, self.exp), file=fd)
def to_source(self):
prefix = ''
@@ -840,7 +840,7 @@ class VPathDirective(Statement):
makefile.addvpath(pattern, dirs)
def dump(self, fd, indent):
print >>fd, "%sVPath %s" % (indent, self.exp)
print("%sVPath %s" % (indent, self.exp), file=fd)
def to_source(self):
return 'vpath %s' % self.exp.to_source()
@@ -885,7 +885,7 @@ class ExportDirective(Statement):
makefile.exportedvars[v] = True
def dump(self, fd, indent):
print >>fd, "%sExport (single=%s) %s" % (indent, self.single, self.exp)
print("%sExport (single=%s) %s" % (indent, self.single, self.exp), file=fd)
def to_source(self):
return ('export %s' % self.exp.to_source()).rstrip()
@@ -915,7 +915,7 @@ class UnexportDirective(Statement):
makefile.exportedvars[v] = False
def dump(self, fd, indent):
print >>fd, "%sUnexport %s" % (indent, self.exp)
print("%sUnexport %s" % (indent, self.exp), file=fd)
def to_source(self):
return 'unexport %s' % self.exp.to_source()
@@ -947,7 +947,7 @@ class EmptyDirective(Statement):
raise data.DataError("Line expands to non-empty value", self.exp.loc)
def dump(self, fd, indent):
print >>fd, "%sEmptyDirective: %s" % (indent, self.exp)
print("%sEmptyDirective: %s" % (indent, self.exp), file=fd)
def to_source(self):
return self.exp.to_source()
+25 -25
View File
@@ -10,9 +10,9 @@ import site
from collections import deque
# XXXkhuey Work around http://bugs.python.org/issue1731717
subprocess._cleanup = lambda: None
import command, util
from . import command, util
if sys.platform=='win32':
import win32process
from . import win32process
_log = logging.getLogger('pymake.process')
@@ -28,7 +28,7 @@ def tokens2re(tokens):
# which matches the pattern and captures it in a named match group.
# The group names and patterns come are given as a dict in the function
# argument.
nonescaped = r'(?<!\\)(?:%s)' % '|'.join('(?P<%s>%s)' % (name, value) for name, value in tokens.iteritems())
nonescaped = r'(?<!\\)(?:%s)' % '|'.join('(?P<%s>%s)' % (name, value) for name, value in tokens.items())
# The final pattern matches either the above pattern, or an escaped
# backslash, captured in the "escape" match group.
return re.compile('(?:%s|%s)' % (nonescaped, r'(?P<escape>\\\\)'))
@@ -115,7 +115,7 @@ class ClineSplitter(list):
self._push(self.cline[:m.start()])
self.cline = self.cline[m.end():]
match = dict([(name, value) for name, value in m.groupdict().items() if value])
match = dict([(name, value) for name, value in list(m.groupdict().items()) if value])
if 'quote' in match:
# " or ' start a quoted string
if match['quote'] == '"':
@@ -129,7 +129,7 @@ class ClineSplitter(list):
elif 'special' in match:
# Unquoted, non-escaped special characters need to be sent to a
# shell.
raise MetaCharacterException, match['special']
raise MetaCharacterException(match['special'])
elif 'whitespace' in match:
# Whitespaces terminate current argument.
self._next()
@@ -145,7 +145,7 @@ class ClineSplitter(list):
self.glob = True
self._push(m.group(0))
else:
raise Exception, "Shouldn't reach here"
raise Exception("Shouldn't reach here")
if self.arg:
self._next()
@@ -153,20 +153,20 @@ class ClineSplitter(list):
# Single quoted strings are preserved, except for the final quote
index = self.cline.find("'")
if index == -1:
raise Exception, 'Unterminated quoted string in command'
raise Exception('Unterminated quoted string in command')
self._push(self.cline[:index])
self.cline = self.cline[index+1:]
def _parse_doubly_quoted(self):
if not self.cline:
raise Exception, 'Unterminated quoted string in command'
raise Exception('Unterminated quoted string in command')
while self.cline:
m = _doubly_quoted_tokens.search(self.cline)
if not m:
raise Exception, 'Unterminated quoted string in command'
raise Exception('Unterminated quoted string in command')
self._push(self.cline[:m.start()])
self.cline = self.cline[m.end():]
match = dict([(name, value) for name, value in m.groupdict().items() if value])
match = dict([(name, value) for name, value in list(m.groupdict().items()) if value])
if 'quote' in match:
# a double quote ends the quoted string, so go back to
# unquoted parsing
@@ -175,7 +175,7 @@ class ClineSplitter(list):
# Unquoted, non-escaped special characters in a doubly quoted
# string still have a special meaning and need to be sent to a
# shell.
raise MetaCharacterException, match['special']
raise MetaCharacterException(match['special'])
elif 'escape' in match:
# Escaped backslashes turn into a single backslash
self._push('\\')
@@ -194,7 +194,7 @@ def clinetoargv(cline, cwd):
str = _escapednewlines.sub('', cline)
try:
args = ClineSplitter(str, cwd)
except MetaCharacterException, e:
except MetaCharacterException as e:
return None, e.char
if len(args) and args[0].find('=') != -1:
@@ -327,12 +327,12 @@ class PopenJob(Job):
# general overview of "subprocess PATH semantics and portability".
oldpath = os.environ['PATH']
try:
if self.env is not None and self.env.has_key('PATH'):
if self.env is not None and 'PATH' in self.env:
os.environ['PATH'] = self.env['PATH']
p = subprocess.Popen(self.argv, executable=self.executable, shell=self.shell, env=self.env, cwd=self.cwd)
return p.wait()
except OSError, e:
print >>sys.stderr, e
except OSError as e:
print(e, file=sys.stderr)
return -127
finally:
os.environ['PATH'] = oldpath
@@ -383,30 +383,30 @@ class PythonJob(Job):
try:
__import__(self.module)
except Exception as e:
print >>sys.stderr, 'Error importing %s: %s' % (
self.module, e)
print('Error importing %s: %s' % (
self.module, e), file=sys.stderr)
return -127
m = sys.modules[self.module]
if self.method not in m.__dict__:
print >>sys.stderr, "No method named '%s' in module %s" % (self.method, self.module)
print("No method named '%s' in module %s" % (self.method, self.module), file=sys.stderr)
return -127
rv = m.__dict__[self.method](self.argv)
if rv != 0 and rv is not None:
print >>sys.stderr, (
print((
"Native command '%s %s' returned value '%s'" %
(self.module, self.method, rv))
(self.module, self.method, rv)), file=sys.stderr)
return (rv if isinstance(rv, int) else 1)
except PythonException, e:
print >>sys.stderr, e
except PythonException as e:
print(e, file=sys.stderr)
return e.exitcode
except:
e = sys.exc_info()[1]
if isinstance(e, SystemExit) and (e.code == 0 or e.code is None):
pass # sys.exit(0) is not a failure
else:
print >>sys.stderr, e
print(e, file=sys.stderr)
traceback.print_exc()
return -127
finally:
@@ -461,7 +461,7 @@ class ParallelContext(object):
def _docall_generic(self, pool, job, cb, echo, justprint):
if echo is not None:
print echo
print(echo)
processcb = job.get_callback(ParallelContext._condition)
if justprint:
processcb(0)
@@ -491,7 +491,7 @@ class ParallelContext(object):
def _checkdone():
jobs = []
for c in ParallelContext._allcontexts:
for i in xrange(0, len(c.running)):
for i in range(0, len(c.running)):
if c.running[i][0].done:
jobs.append(c.running[i])
for j in jobs:
+2 -2
View File
@@ -82,7 +82,7 @@ else:
return str[:offset], token, str[offset + len(token):]
try:
from __builtin__ import any
from builtins import any
except ImportError:
def any(it):
for i in it:
@@ -138,7 +138,7 @@ class MostUsedCache(object):
return item.o
def verify(self):
for k, v in self.d.iteritems():
for k, v in self.d.items():
if v.o:
assert v in self.active
else:
+3 -3
View File
@@ -1,10 +1,10 @@
import pymake.data, pymake.functions, pymake.util
import unittest
import re
from cStringIO import StringIO
from io import StringIO
def multitest(cls):
for name in cls.testdata.iterkeys():
for name in cls.testdata.keys():
def m(self, name=name):
return self.runSingle(*self.testdata[name])
@@ -63,7 +63,7 @@ class LRUTest(unittest.TestCase):
c = pymake.util.LRUCache(3, self.spaceFunc, lambda k, v: k % 2)
self.assertEqual(tuple(c.debugitems()), ())
for i in xrange(0, len(self.expected)):
for i in range(0, len(self.expected)):
k, e, fc, di = self.expected[i]
v = c.get(k)
+1 -1
View File
@@ -277,7 +277,7 @@ class MakefileCorupusTest(TestBase):
self.assertEqual(len(statements), len(new_statements))
for i in xrange(0, len(statements)):
for i in range(0, len(statements)):
original = statements[i]
formatted = new_statements[i]
+6 -6
View File
@@ -2,10 +2,10 @@ import pymake.data, pymake.parser, pymake.parserdata, pymake.functions
import unittest
import logging
from cStringIO import StringIO
from io import StringIO
def multitest(cls):
for name in cls.testdata.iterkeys():
for name in cls.testdata.keys():
def m(self, name=name):
return self.runSingle(*self.testdata[name])
@@ -134,7 +134,7 @@ class IterTest(TestBase):
self.assertEqual(actual, expected)
if ifunc == pymake.parser.itermakefilechars:
print "testing %r" % expected
print("testing %r" % expected)
self.assertEqual(pymake.parser.flattenmakesyntax(d, 0), expected)
multitest(IterTest)
@@ -207,7 +207,7 @@ class MakeSyntaxTest(TestBase):
def compareRecursive(self, actual, expected, path):
self.assertEqual(len(actual), len(expected),
"compareRecursive: %s %r" % (path, actual))
for i in xrange(0, len(actual)):
for i in range(0, len(actual)):
ipath = path + [i]
a, isfunc = actual[i]
@@ -217,7 +217,7 @@ class MakeSyntaxTest(TestBase):
else:
self.assertEqual(type(a), getattr(pymake.functions, e['type']),
"compareRecursive: %s" % (ipath,))
for k, v in e.iteritems():
for k, v in e.items():
if k == 'type':
pass
elif k[0] == '[':
@@ -264,7 +264,7 @@ class VariableTest(TestBase):
m = pymake.data.Makefile()
stmts.execute(m)
for k, v in self.expected.iteritems():
for k, v in self.expected.items():
flavor, source, val = m.variables.get(k)
if val is None:
self.assertEqual(val, v, 'variable named %s' % k)
+13 -13
View File
@@ -63,7 +63,7 @@ def runTest(makefile, make, logfile, options):
"""
if os.path.exists(opts.tempdir): shutil.rmtree(opts.tempdir)
os.mkdir(opts.tempdir, 0755)
os.mkdir(opts.tempdir, 0o755)
logfd = open(logfile, 'w')
p = Popen(make + options['commandline'], stdout=logfd, stderr=STDOUT, env=options['env'])
@@ -78,15 +78,15 @@ def runTest(makefile, make, logfile, options):
logfd.close()
if stdout.find('TEST-FAIL') != -1:
print stdout
print(stdout)
return False, "FAIL (TEST-FAIL printed)"
if options['grepfor'] and stdout.find(options['grepfor']) == -1:
print stdout
print(stdout)
return False, "FAIL (%s not in output)" % options['grepfor']
if options['returncode'] == 0 and stdout.find('TEST-PASS') == -1:
print stdout
print(stdout)
return False, 'FAIL (No TEST-PASS printed)'
if options['returncode'] != 0:
@@ -94,7 +94,7 @@ def runTest(makefile, make, logfile, options):
return True, 'PASS'
print "%-30s%-28s%-28s" % ("Test:", "gmake:", "pymake:")
print("%-30s%-28s%-28s" % ("Test:", "gmake:", "pymake:"))
gmakefails = 0
pymakefails = 0
@@ -144,7 +144,7 @@ for makefile in makefiles:
if sys.platform in data:
d['returncode'] = data[sys.platform]
elif key == 'environment':
for k, v in data.iteritems():
for k, v in data.items():
d['env'][k] = v
elif key == 'grep-for':
d['grepfor'] = data
@@ -153,7 +153,7 @@ for makefile in makefiles:
elif key == 'skip':
d['skip'] = True
else:
print >>sys.stderr, "%s: Unexpected #T key: %s" % (makefile, key)
print("%s: Unexpected #T key: %s" % (makefile, key), file=sys.stderr)
sys.exit(1)
mdata.close()
@@ -190,12 +190,12 @@ for makefile in makefiles:
else:
pymakemsg = "OK (known fail)"
print "%-30.30s%-28.28s%-28.28s" % (os.path.basename(makefile),
gmakemsg, pymakemsg)
print("%-30.30s%-28.28s%-28.28s" % (os.path.basename(makefile),
gmakemsg, pymakemsg))
print
print "Summary:"
print "%-30s%-28s%-28s" % ("", "gmake:", "pymake:")
print()
print("Summary:")
print("%-30s%-28s%-28s" % ("", "gmake:", "pymake:"))
if gmakefails == 0:
gmakemsg = 'PASS'
@@ -207,7 +207,7 @@ if pymakefails == 0:
else:
pymakemsg = 'FAIL (%i failures)' % pymakefails
print "%-30.30s%-28.28s%-28.28s" % ('', gmakemsg, pymakemsg)
print("%-30.30s%-28.28s%-28.28s" % ('', gmakemsg, pymakemsg))
shutil.rmtree(opts.tempdir)
+5 -5
View File
@@ -4,7 +4,7 @@ from os import path
import re
import shutil
import sys
from urllib2 import urlopen
from urllib.request import urlopen
from release.paths import makeCandidatesDir
@@ -50,7 +50,7 @@ def findOldBuildIDs(product, version, buildNumber, platforms,
id = getBuildID(platform, product, version, n, nightlyDir,
server)
ids[platform].append(id)
except Exception, e:
except Exception as e:
log.error("Hit exception: %s" % e)
return ids
@@ -87,10 +87,10 @@ def readBranchConfig(dir, localconfig, branch, required=[]):
def readConfig(configfile, keys=[], required=[]):
c = {}
execfile(configfile, c)
exec(compile(open(configfile, "rb").read(), configfile, 'exec'), c)
for k in keys:
c = c[k]
items = c.keys()
items = list(c.keys())
err = False
for key in required:
if key not in items:
@@ -137,7 +137,7 @@ def getReleaseName(product, version, buildNumber):
def getRepoMatchingBranch(branch, sourceRepositories):
for sr in sourceRepositories.values():
for sr in list(sourceRepositories.values()):
if branch in sr['path']:
return sr
return None
+1 -1
View File
@@ -1,7 +1,7 @@
import difflib
import logging
import re
import urllib2
import urllib.request, urllib.error, urllib.parse
from util.commands import run_cmd, get_output
from util.hg import get_repo_name, make_hg_url
from subprocess import CalledProcessError
+29 -24
View File
@@ -13,9 +13,11 @@ import re
import subprocess
import sys
import pickle
from locale import getpreferredencoding
import mozpack.path as mozpath
encoding = getpreferredencoding(False)
class Pool(object):
def __new__(cls, size):
@@ -27,7 +29,7 @@ class Pool(object):
return super(Pool, cls).__new__(cls)
def imap_unordered(self, fn, iterable):
return itertools.imap(fn, iterable)
return map(fn, iterable)
def close(self):
pass
@@ -60,7 +62,7 @@ class File(object):
modified = True
if os.path.exists(self._path):
if open(self._path, 'rb').read() == self._content:
if open(self._path, 'r', encoding=encoding, errors='replace').read() == self._content:
modified = False
self._modified = modified
return modified
@@ -131,11 +133,11 @@ def maybe_clear_cache(data):
is_set = cache.get('ac_cv_env_%s_set' % precious) == 'set'
value = cache.get('ac_cv_env_%s_value' % precious) if is_set else None
if value != env.get(precious):
print 'Removing %s because of %s value change from:' \
% (data['cache-file'], precious)
print ' %s' % (value if value is not None else 'undefined')
print 'to:'
print ' %s' % env.get(precious, 'undefined')
print('Removing %s because of %s value change from:' \
% (data['cache-file'], precious))
print(' %s' % (value if value is not None else 'undefined'))
print('to:')
print(' %s' % env.get(precious, 'undefined'))
os.remove(data['cache-file'])
return True
return False
@@ -160,9 +162,11 @@ def get_config_files(data):
# Scan the config.status output for information about configuration files
# it generates.
config_status_output = subprocess.check_output(
raw_output = subprocess.check_output(
[data['shell'], '-c', '%s --help' % config_status],
stderr=subprocess.STDOUT).splitlines()
stderr=subprocess.STDOUT)
config_status_output = raw_output.decode(encoding,
errors='replace').splitlines()
state = None
for line in config_status_output:
if line.startswith('Configuration') and line.endswith(':'):
@@ -183,7 +187,6 @@ def get_config_files(data):
return config_files, command_files
def prepare(srcdir, objdir, shell, args):
parser = argparse.ArgumentParser()
parser.add_argument('--target', type=str)
@@ -232,7 +235,7 @@ def prepare(srcdir, objdir, shell, args):
'args': others,
'shell': shell,
'srcdir': srcdir,
'env': environ,
'env': {str(k): str(v) for k, v in environ.items()},
}
if args.cache_file:
@@ -249,9 +252,9 @@ def prepare(srcdir, objdir, shell, args):
except OSError as e:
if e.errno != errno.EEXIST:
raise
with open(data_file, 'wb') as f:
pickle.dump(data, f)
for k, v in data.items():
with open(data_file, 'wb') as f:
pickle.dump(data, f)
def prefix_lines(text, prefix):
@@ -261,7 +264,6 @@ def prefix_lines(text, prefix):
def run(objdir):
ret = 0
output = ''
with open(os.path.join(objdir, CONFIGURE_DATA), 'rb') as f:
data = pickle.load(f)
@@ -333,14 +335,16 @@ def run(objdir):
# We're going to run it ourselves.
command += ['--no-create']
print prefix_lines('configuring', relobjdir)
print prefix_lines('running %s' % ' '.join(command[:-1]), relobjdir)
print(prefix_lines('configuring', relobjdir))
print(prefix_lines('running %s' % ' '.join(command[:-1]), relobjdir))
sys.stdout.flush()
try:
output += subprocess.check_output(command,
raw_output = subprocess.check_output(command,
stderr=subprocess.STDOUT, cwd=objdir, env=data['env'])
output += raw_output.decode(encoding, errors='replace')
except subprocess.CalledProcessError as e:
return relobjdir, e.returncode, e.output
err = e.output.decode(encoding, errors='replace')
return relobjdir, e.returncode, err
# Leave config.status with a new timestamp if configure is newer than
# its original mtime.
@@ -368,12 +372,13 @@ def run(objdir):
if not skip_config_status:
if skip_configure:
print prefix_lines('running config.status', relobjdir)
print(prefix_lines('running config.status', relobjdir))
sys.stdout.flush()
try:
output += subprocess.check_output([data['shell'], '-c',
raw_output = subprocess.check_output([data['shell'], '-c',
'./config.status'], stderr=subprocess.STDOUT, cwd=objdir,
env=data['env'])
output += raw_output.decode(encoding, errors='replace')
except subprocess.CalledProcessError as e:
ret = e.returncode
output += e.output
@@ -395,9 +400,9 @@ def subconfigure(args):
args, others = parser.parse_known_args(args)
subconfigures = args.subconfigures
if args.list:
subconfigures.extend(open(args.list, 'rb').read().splitlines())
subconfigures.extend(open(args.list, 'r', encoding=encoding, errors='replace').read().splitlines())
if args.skip:
skips = set(open(args.skip, 'rb').read().splitlines())
skips = set(open(args.skip, 'r', encoding=encoding, errors='replace').read().splitlines())
subconfigures = [s for s in subconfigures if s not in skips]
if not subconfigures:
@@ -410,7 +415,7 @@ def subconfigure(args):
pool = Pool(len(subconfigures))
for relobjdir, returncode, output in \
pool.imap_unordered(run, subconfigures):
print prefix_lines(output, relobjdir)
print(prefix_lines(output, relobjdir))
sys.stdout.flush()
ret = max(returncode, ret)
if ret:
+17 -17
View File
@@ -104,10 +104,10 @@ def DoSSHCommand(command, user, host, port=None, ssh_key=None):
try:
output = f(cmdline, stderr=STDOUT).strip()
except CalledProcessError as e:
print "failed ssh command output:"
print '=' * 20
print e.output
print '=' * 20
print("failed ssh command output:")
print('=' * 20)
print(e.output)
print('=' * 20)
raise
return output
@@ -118,7 +118,7 @@ def DoSCPFile(file, remote_path, user, host, port=None, ssh_key=None,
"""Upload file to user@host:remote_path using scp. Optionally use
port and ssh_key, if provided."""
if log:
print 'Uploading %s' % file
print('Uploading %s' % file)
cmdline = ["scp"]
AppendOptionalArgsToSSHCommandline(cmdline, port, ssh_key)
cmdline.extend([WindowsPathToMsysPath(file),
@@ -221,8 +221,8 @@ def UploadFiles(user, host, path, files, verbose=False, port=None, ssh_key=None,
if not host or not user:
return {}
if (not path and not upload_to_temp_dir) or (path and upload_to_temp_dir):
print "One (and only one of UPLOAD_PATH or UPLOAD_TO_TEMP must be " + \
"defined."
print("One (and only one of UPLOAD_PATH or UPLOAD_TO_TEMP must be " + \
"defined.")
sys.exit(1)
if upload_to_temp_dir:
@@ -269,18 +269,18 @@ def UploadFiles(user, host, path, files, verbose=False, port=None, ssh_key=None,
if post_upload_command is not None:
if verbose:
print "Running post-upload command: " + post_upload_command
print("Running post-upload command: " + post_upload_command)
file_list = '"' + '" "'.join(remote_files) + '"'
output = DoSSHCommand('%s "%s" %s' % (post_upload_command, path, file_list), user, host, port=port, ssh_key=ssh_key)
# We print since mozharness may parse URLs from the output stream.
print output
print(output)
properties = GetUrlProperties(output, package)
finally:
if upload_to_temp_dir:
DoSSHCommand("rm -rf %s" % path, user, host, port=port,
ssh_key=ssh_key)
if verbose:
print "Upload complete"
print("Upload complete")
return properties
def CopyFilesLocally(path, files, verbose=False, base_path=None, package=None):
@@ -299,7 +299,7 @@ def CopyFilesLocally(path, files, verbose=False, base_path=None, package=None):
if not os.path.exists(target_path):
os.makedirs(target_path)
if verbose:
print "Copying " + file + " to " + target_path
print("Copying " + file + " to " + target_path)
shutil.copy(file, target_path)
def WriteProperties(files, properties_file, url_properties, package):
@@ -341,20 +341,20 @@ if __name__ == '__main__':
help="Name of the main package.")
(options, args) = parser.parse_args()
if len(args) < 1:
print "You must specify at least one file to upload"
print("You must specify at least one file to upload")
sys.exit(1)
if not options.properties_file:
print "You must specify a --properties-file"
print("You must specify a --properties-file")
sys.exit(1)
if host == "localhost":
if upload_to_temp_dir:
print "Cannot use UPLOAD_TO_TEMP with UPLOAD_HOST=localhost"
print("Cannot use UPLOAD_TO_TEMP with UPLOAD_HOST=localhost")
sys.exit(1)
if post_upload_command:
# POST_UPLOAD_COMMAND is difficult to extract from the mozharness
# scripts, so just ignore it until it's no longer used anywhere
print "Ignoring POST_UPLOAD_COMMAND with UPLOAD_HOST=localhost"
print("Ignoring POST_UPLOAD_COMMAND with UPLOAD_HOST=localhost")
try:
if host == "localhost":
@@ -370,6 +370,6 @@ if __name__ == '__main__':
package=options.package, verbose=True)
WriteProperties(args, options.properties_file, url_properties, options.package)
except IOError, (strerror):
print strerror
except IOError as strerror:
print(strerror)
sys.exit(1)
+3 -3
View File
@@ -36,7 +36,7 @@ def count_ctors(filename):
# Even if we have .ctors, we shouldn't have any constructors in .ctors.
# Complain if .ctors does not look how we expect it to.
if have_ctors and n_ctors_ctors != 0:
print >>sys.stderr, "Unexpected .ctors contents for", filename
print("Unexpected .ctors contents for", filename, file=sys.stderr)
sys.exit(1)
return n_init_array_ctors
if have_ctors:
@@ -44,7 +44,7 @@ def count_ctors(filename):
# We didn't find anything; somebody switched initialization mechanisms on
# us, or the binary is completely busted. Complain either way.
print >>sys.stderr, "Couldn't find .init_array or .ctors in", filename
print("Couldn't find .init_array or .ctors in", filename, file=sys.stderr)
sys.exit(1)
if __name__ == '__main__':
@@ -60,5 +60,5 @@ if __name__ == '__main__':
}]}
]
}
print "PERFHERDER_DATA: %s" % json.dumps(perfherder_data)
print("PERFHERDER_DATA: %s" % json.dumps(perfherder_data))
+7 -7
View File
@@ -2,8 +2,8 @@
import os
import re
import subprocess
from urlparse import urlsplit
from ConfigParser import RawConfigParser
from urllib.parse import urlsplit
from configparser import RawConfigParser
from util.commands import run_cmd, get_output, remove_path
from util.retry import retry
@@ -105,7 +105,7 @@ def purge(dest):
try:
run_cmd(['hg', '--config', 'extensions.purge=', 'purge',
'-a', '--all', dest], cwd=dest)
except subprocess.CalledProcessError, e:
except subprocess.CalledProcessError as e:
log.debug('purge failed: %s' % e)
raise
@@ -306,7 +306,7 @@ def out(src, remote, **kwargs):
branch = "default"
revs.append((rev, branch))
return revs
except subprocess.CalledProcessError, inst:
except subprocess.CalledProcessError as inst:
# In some situations, some versions of Mercurial return "1"
# if no changes are found, so we need to ignore this return code
if inst.returncode == 1:
@@ -500,7 +500,7 @@ def apply_and_push(localrepo, remote, changer, max_attempts=10,
push(src=localrepo, remote=remote, ssh_username=ssh_username,
ssh_key=ssh_key, force=force)
return
except subprocess.CalledProcessError, e:
except subprocess.CalledProcessError as e:
log.debug("Hit error when trying to push: %s" % str(e))
if n == max_attempts:
log.debug("Tried %d times, giving up" % max_attempts)
@@ -515,7 +515,7 @@ def apply_and_push(localrepo, remote, changer, max_attempts=10,
try:
run_cmd(['hg', '--config', 'ui.merge=internal:merge',
'rebase'], cwd=localrepo)
except subprocess.CalledProcessError, e:
except subprocess.CalledProcessError as e:
log.debug("Failed to rebase: %s" % str(e))
update(localrepo, branch=branch)
for r in reversed(new_revs):
@@ -578,7 +578,7 @@ def adjust_paths(dest, **paths):
config.add_section('paths')
changed = False
for path_name, path_value in paths.items():
for path_name, path_value in list(paths.items()):
if (not config.has_option('paths', path_name) or
config.get('paths', path_name) != path_value):
changed = True
+1 -1
View File
@@ -11,7 +11,6 @@ mozbuild.pth:python/mozbuild
mozversioncontrol.pth:python/mozversioncontrol
mozlint.pth:python/mozlint
pymake.pth:build/pymake
optional:setup.py:python/psutil:build_ext:--inplace
optional:psutil.pth:python/psutil
which.pth:python/which
ply.pth:other-licenses/ply/
@@ -29,6 +28,7 @@ moztreedocs.pth:tools/docs
packages.txt:testing/mozbase/packages.txt
objdir:build
gyp.pth:media/webrtc/trunk/tools/gyp/pylib
six.pth:python/requests/requests/packages/urllib3/packages
pyasn1.pth:python/pyasn1
pyasn1_modules.pth:python/pyasn1-modules
bitstring.pth:python/bitstring
+13 -11
View File
@@ -23,8 +23,8 @@ BINSCOPE_OUTPUT_LOGFILE = r".\binscope_xml_output.log"
# usage
if len(sys.argv) < 3:
print """usage : autobinscope.by path_to_binary path_to_symbols [log_file_path]"
log_file_path is optional, log will be written to .\binscope_xml_output.log by default"""
print("""usage : autobinscope.by path_to_binary path_to_symbols [log_file_path]"
log_file_path is optional, log will be written to .\binscope_xml_output.log by default""")
sys.exit(0)
binary_path = sys.argv[1]
@@ -40,7 +40,7 @@ else:
try:
binscope_path = os.environ['BINSCOPE']
except KeyError:
print "BINSCOPE environment variable is not set, can't check DEP/ASLR etc. status."
print("BINSCOPE environment variable is not set, can't check DEP/ASLR etc. status.")
sys.exit(0)
try:
@@ -51,13 +51,15 @@ try:
"/c", "CompilerVersionCheck", "/c", "SafeSEHCheck", "/c", "SNCheck",
"/c", "DBCheck"], stdout=subprocess.PIPE)
except WindowsError, (errno, strerror):
except OSError as e:
errno = e.errno
strerror = e.strerror or str(e)
if errno != 2 and errno != 3:
print "Unexpected error ! \nError " + str(errno) + " : " + strerror + "\nExiting !\n"
print("Unexpected error ! \nError " + str(errno) + " : " + strerror + "\nExiting !\n")
sys.exit(0)
else:
print "Could not locate binscope at location : %s\n" % binscope_path
print "Binscope wasn't installed or the BINSCOPE env variable wasn't set correctly, skipping this check and exiting..."
print("Could not locate binscope at location : %s\n" % binscope_path)
print("Binscope wasn't installed or the BINSCOPE env variable wasn't set correctly, skipping this check and exiting...")
sys.exit(0)
proc.wait()
@@ -66,10 +68,10 @@ output = proc.communicate()[0]
# is this a PASS or a FAIL ?
if proc.returncode != 0:
print "Error count: %d" % proc.returncode
print "TEST-UNEXPECTED-FAIL | autobinscope.py | %s is missing a needed Windows protection, such as /GS or ASLR" % binary_path
print("Error count: %d" % proc.returncode)
print("TEST-UNEXPECTED-FAIL | autobinscope.py | %s is missing a needed Windows protection, such as /GS or ASLR" % binary_path)
logfile = open(log_file_path, "r")
for line in logfile:
print(line),
print((line), end=' ')
else:
print "TEST-PASS | autobinscope.py | %s succeeded" % binary_path
print("TEST-PASS | autobinscope.py | %s succeeded" % binary_path)
+1 -1
View File
@@ -39,6 +39,6 @@ def MergePGOFiles(basename, pgddir, pgcdir):
if __name__ == '__main__':
if len(sys.argv) != 3:
print >>sys.stderr, "Usage: pgomerge.py <binary basename> <dist/bin>"
print("Usage: pgomerge.py <binary basename> <dist/bin>", file=sys.stderr)
sys.exit(1)
MergePGOFiles(sys.argv[1], os.getcwd(), sys.argv[2])
+3 -3
View File
@@ -40,9 +40,9 @@ if __name__ == '__main__':
0, # no inherit
int(pid))
if handle:
print "Process %s:" % pid
print("Process %s:" % pid)
vsize, peak_vsize = get_vmsize(handle)
print "peak vsize: %d" % peak_vsize
print("peak vsize: %d" % peak_vsize)
ctypes.windll.kernel32.CloseHandle(handle)
else:
print "Couldn't open process %s" % pid
print("Couldn't open process %s" % pid)
+6 -6
View File
@@ -200,7 +200,7 @@ def format_manifest(manifest):
def write_zip(zip_path, prefix=None):
"""Write toolchain data to a zip file."""
if isinstance(prefix, unicode):
if isinstance(prefix, str):
prefix = prefix.encode('utf-8')
with JarWriter(file=zip_path, optimize=False, compress=5) as zip:
@@ -226,7 +226,7 @@ def write_zip(zip_path, prefix=None):
if __name__ == '__main__':
if len(sys.argv) != 3:
print('usage: %s create-zip <path-prefix>' % sys.argv[0])
print(('usage: %s create-zip <path-prefix>' % sys.argv[0]))
sys.exit(1)
assert sys.argv[1] == 'create-zip'
@@ -244,7 +244,7 @@ if __name__ == '__main__':
sha256.update(data)
sha512.update(data)
print('Hashes of %s (size=%d)' % (destzip, len(data)))
print('SHA-1: %s' % sha1.hexdigest())
print('SHA-256: %s' % sha256.hexdigest())
print('SHA-512: %s' % sha512.hexdigest())
print(('Hashes of %s (size=%d)' % (destzip, len(data))))
print(('SHA-1: %s' % sha1.hexdigest()))
print(('SHA-256: %s' % sha256.hexdigest()))
print(('SHA-512: %s' % sha512.hexdigest()))
+1 -1
View File
@@ -66,7 +66,7 @@ endif
SH := /bin/sh
PERL ?= perl
PYTHON ?= $(shell which python2.7 > /dev/null 2>&1 && echo python2.7 || echo python)
PYTHON ?= $(shell which python3 > /dev/null 2>&1 && echo python3 || echo python)
CONFIG_GUESS_SCRIPT := $(wildcard $(TOPSRCDIR)/build/autoconf/config.guess)
ifdef CONFIG_GUESS_SCRIPT
+12 -12
View File
@@ -22,7 +22,7 @@ if topsrcdir == '':
topsrcdir = '.'
def check_call_noisy(cmd, *args, **kwargs):
print "Executing command:", cmd
print("Executing command:", cmd)
check_call(cmd, *args, **kwargs)
def do_hg_pull(dir, repository, hg):
@@ -67,22 +67,22 @@ def do_cvs_export(modules, tag, cvsroot, cvs):
cvs_module = module_tuple[1]
fullpath = os.path.join(topsrcdir, module)
if os.path.exists(fullpath):
print "Removing '%s'" % fullpath
print("Removing '%s'" % fullpath)
shutil.rmtree(fullpath)
(parent, leaf) = os.path.split(module)
print "CVS export begin: " + datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S UTC")
print("CVS export begin: " + datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S UTC"))
check_call_noisy([cvs, '-d', cvsroot,
'export', '-r', tag, '-d', leaf, cvs_module],
cwd=os.path.join(topsrcdir, parent))
print "CVS export end: " + datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S UTC")
print("CVS export end: " + datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S UTC"))
def toggle_trailing_blank_line(depname):
"""If the trailing line is empty, then we'll delete it.
Otherwise we'll add a blank line."""
lines = open(depname, "r").readlines()
if not lines:
print >>sys.stderr, "unexpected short file"
print("unexpected short file", file=sys.stderr)
return
if not lines[-1].strip():
@@ -95,7 +95,7 @@ def toggle_trailing_blank_line(depname):
def get_trailing_blank_line_state(depname):
lines = open(depname, "r").readlines()
if not lines:
print >>sys.stderr, "unexpected short file"
print("unexpected short file", file=sys.stderr)
return "no blank line"
if not lines[-1].strip():
@@ -104,18 +104,18 @@ def get_trailing_blank_line_state(depname):
return "no blank line"
def update_nspr_or_nss(tag, depfile, destination, hgpath):
print "reverting to HG version of %s to get its blank line state" % depfile
print("reverting to HG version of %s to get its blank line state" % depfile)
check_call_noisy([options.hg, 'revert', depfile])
old_state = get_trailing_blank_line_state(depfile)
print "old state of %s is: %s" % (depfile, old_state)
print("old state of %s is: %s" % (depfile, old_state))
do_hg_replace(destination, hgpath, tag, HG_EXCLUSIONS, options.hg)
new_state = get_trailing_blank_line_state(depfile)
print "new state of %s is: %s" % (depfile, new_state)
print("new state of %s is: %s" % (depfile, new_state))
if old_state == new_state:
print "toggling blank line in: ", depfile
print("toggling blank line in: ", depfile)
toggle_trailing_blank_line(depfile)
tag_file = destination + "/TAG-INFO"
print >>file(tag_file, "w"), tag
print(tag, file=file(tag_file, "w"))
o = OptionParser(usage="client.py [options] update_nspr tagname | update_nss tagname | update_libffi tagname")
o.add_option("--skip-mozilla", dest="skip_mozilla",
@@ -139,7 +139,7 @@ except IndexError:
sys.exit(2)
if action in ('checkout', 'co'):
print >>sys.stderr, "Warning: client.py checkout is obsolete."
print("Warning: client.py checkout is obsolete.", file=sys.stderr)
pass
elif action in ('update_nspr'):
tag, = args[1:]
+5 -5
View File
@@ -46,7 +46,7 @@ class ZipFile(zipfile.ZipFile):
date_time=time.localtime(time.time()))
zinfo.compress_type = self.compression
# Add some standard UNIX file access permissions (-rw-r--r--).
zinfo.external_attr = (0x81a4 & 0xFFFF) << 16L
zinfo.external_attr = (0x81a4 & 0xFFFF) << 16
else:
zinfo = zinfo_or_arcname
@@ -58,7 +58,7 @@ class ZipFile(zipfile.ZipFile):
# as the old, reuse the existing entry.
doSeek = False # store if we need to seek to the eof after overwriting
if self.NameToInfo.has_key(zinfo.filename):
if zinfo.filename in self.NameToInfo:
# Find the last ZipInfo with our name.
# Last, because that's catching multiple overwrites
i = len(self.filelist)
@@ -109,14 +109,14 @@ class ZipFile(zipfile.ZipFile):
# adjust file mode if we originally just wrote, now we rewrite
self.fp.close()
self.fp = open(self.filename, 'r+b')
all = map(lambda zi: (zi, True), self.filelist) + \
map(lambda zi: (zi, False), self._remove)
all = [(zi, True) for zi in self.filelist] + \
[(zi, False) for zi in self._remove]
all.sort(lambda l, r: cmp(l[0].header_offset, r[0].header_offset))
# empty _remove for multiple closes
self._remove = []
lengths = [all[i+1][0].header_offset - all[i][0].header_offset
for i in xrange(len(all)-1)]
for i in range(len(all)-1)]
lengths.append(self.end - all[-1][0].header_offset)
to_pos = 0
for (zi, keep), length in zip(all, lengths):
+354
View File
@@ -0,0 +1,354 @@
/* 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 https://mozilla.org/MPL/2.0/.
*
* C++ replacement for mozbuild/action/cl.py that wraps cl.exe on Windows.
* This is a Windows-only host tool, built well before XPCOM.
*/
#include <windows.h>
#include <string> // We don't use XPCOM string classes here.
#include <vector>
#include <fstream>
#include <algorithm>
#pragma warning(disable:4530)
using namespace std;
/* Make passed argv into a command line for cl.exe */
static wstring quoteArg(const wstring& aCmdArgv) {
bool addQuotes = aCmdArgv.find_first_of(L" \t\"") != wstring::npos;
if (!addQuotes) {
return aCmdArgv;
}
wstring out = L"\"";
size_t backslash = 0;
for (wchar_t ch : aCmdArgv) {
if (ch == L'\\') {
backslash++;
} else if (ch == L'"') {
// Escape all backslashes before a quote
out.append(backslash * 2, L'\\');
backslash = 0;
out += L"\\\"";
} else {
out.append(backslash, L'\\');
backslash = 0;
out += ch;
}
}
out.append(backslash * 2, L'\\');
out += L"\"";
return out;
}
/* We need to detect the showIncludes prefix to extract raw paths for
dep files, and drop the lines from display to avoid console spam. */
static string showIncludesPrefixDetection(const string& aLine) {
// Look for absolute Windows paths
size_t pos = string::npos;
// Drive letter: C:\...
for (size_t i = 0; i + 2 < aLine.size(); i++) {
if (isalpha((unsigned char)aLine[i]) &&
aLine[i + 1] == ':' &&
(aLine[i + 2] == '\\' || aLine[i + 2] == '/')) {
pos = i;
break;
}
}
// UNC path: \\server\share
if (pos == string::npos) {
if (aLine.size() >= 2 && aLine[0] == '\\' && aLine[1] == '\\') {
pos = 0;
}
}
if (pos == string::npos) {
return "";
}
// Prefix is everything before the path
return aLine.substr(0, pos);
}
/* Extract the header path from an include line using the known prefix */
static string extractHeaderPath(const string& aLine, const string& aPrefix) {
if (aLine.rfind(aPrefix, 0) != 0) {
return "";
}
// Strip prefix
string path = aLine.substr(aPrefix.size());
// Trim leading whitespace
while (!path.empty() && (path[0] == ' ' || path[0] == '\t')) {
path.erase(0, 1);
}
// Remove trailing newline
if (!path.empty() && (path.back() == '\n' || path.back() == '\r')) {
path.pop_back();
}
return path;
}
/* Sanitize a dependency path for Makefile depfiles.
Performs:
1. Strip trailing CR/LF
2. Strip leading MSVC indentation
3. Normalize slashes to '/'
4. Escape spaces and backslashes for Make */
static string sanitizeMakeDeps(string aLine) {
// 1. Strip trailing CR/LF
while (!aLine.empty() && (aLine.back() == '\r' || aLine.back() == '\n')) {
aLine.pop_back();
}
// 2. Strip leading indentation (MSVC indents include lines)
while (!aLine.empty() && (aLine.front() == ' ' || aLine.front() == '\t')) {
aLine.erase(aLine.begin());
}
// 3. Normalize slashes
for (char& ch : aLine) {
if (ch == '\\') {
ch = '/';
}
}
// 4. Escape for Make
string out;
out.reserve(aLine.size() * 2);
for (char ch : aLine) {
if (ch == ' ') {
out += "\\ ";
} else if (ch == '\\') {
// After normalization this shouldn't occur, but safe anyway
out += "\\\\";
} else {
out += ch;
}
}
return out;
}
/* MSYS1 does not use wide APIs, so ensure we get the narrow version here. */
static string getWinEnvVar(const char* aName) {
char buffer[32768];
DWORD length = GetEnvironmentVariableA(aName, buffer, sizeof(buffer));
if (length == 0 || length >= sizeof(buffer)) {
return string();
}
return string(buffer, length);
}
/* Exclude system headers by ignoring anything not in our directories.
* We don't know where people will put their objdir, so it has to be
* tracked separately.
*/
static bool isProjectDep(const string& aPath,
const string& aTopSrcDir,
const string& aTopObjDir) {
// We need forward slashes for our build system.
auto norm = [](string aStr) {
replace(aStr.begin(), aStr.end(), '\\', '/');
return aStr;
};
string path = norm(aPath);
string topSrcDir = norm(aTopSrcDir);
string topObjDir = norm(aTopObjDir);
// Must be absolute or relative under one of the two roots
return (path.rfind(topSrcDir, 0) == 0) ||
(path.rfind(topObjDir, 0) == 0);
}
/* Read stdout from the compiler pipe line-by-line, filtering include
lines and collecting dependency paths. */
static vector<string> processOutput(HANDLE aReadPipe) {
string lineBuf;
vector<string> deps;
string topSrcDir = getWinEnvVar("CL_TOPSRCDIR");
string topObjDir = getWinEnvVar("CL_TOPOBJDIR");
char buffer[4096];
DWORD bytesRead;
string includePrefix;
bool prefixFound = false;
while (ReadFile(aReadPipe, buffer, sizeof(buffer), &bytesRead, nullptr)) {
lineBuf.append(buffer, bytesRead);
size_t pos;
while ((pos = lineBuf.find('\n')) != string::npos) {
string line = lineBuf.substr(0, pos + 1);
lineBuf.erase(0, pos + 1);
if (!prefixFound) {
string maybe = showIncludesPrefixDetection(line);
if (!maybe.empty()) {
includePrefix = maybe;
prefixFound = true;
}
}
// If prefix is known and this line starts with it, it's an include line
if (prefixFound && line.rfind(includePrefix, 0) == 0) {
string header = extractHeaderPath(line, includePrefix);
if (!header.empty()) {
header = sanitizeMakeDeps(header);
if (isProjectDep(header, topSrcDir, topObjDir)) {
deps.push_back(header);
}
}
// This is an include line, don't print it
continue;
}
// Otherwise, just print
fwrite(line.data(), 1, line.size(), stdout);
}
}
if (!lineBuf.empty()) {
fwrite(lineBuf.data(), 1, lineBuf.size(), stdout);
}
return deps;
}
/* Convert a UTF-16 wide string to a UTF-8 narrow string. */
static string wideToUtf8(const wstring& aWide) {
if (aWide.empty()) {
return {};
}
int len = WideCharToMultiByte(CP_UTF8, 0, aWide.c_str(), -1, nullptr, 0, nullptr, nullptr);
string out(len - 1, '\0');
WideCharToMultiByte(CP_UTF8, 0, aWide.c_str(), -1, &out[0], len - 1, nullptr, nullptr);
return out;
}
/* Compute the .pp depfile path next to the given object file. */
static string makeDepfilePath(const string& aObjUtf8) {
size_t pos = aObjUtf8.find_last_of("/\\");
string dir = (pos == string::npos) ? "" : aObjUtf8.substr(0, pos + 1);
string base = (pos == string::npos) ? aObjUtf8 : aObjUtf8.substr(pos + 1);
return dir + ".deps/" + base + ".pp";
}
/* Write a Make-style dependency file for the given object and dep list. */
static void writeDepfile(const wstring& aObjFile, const vector<string>& aDeps) {
string objUtf8 = wideToUtf8(aObjFile);
string ppName = makeDepfilePath(objUtf8);
ofstream out(ppName);
out << objUtf8 << ":";
for (auto& dep : aDeps) {
out << " " << dep;
}
out << "\r\n";
}
int wmain(int argc, wchar_t** argv) {
if (argc < 2) {
fwprintf(stderr, L"Usage: action_cl.exe <compiler> [args...]\n");
return 1;
}
const wchar_t* compiler = argv[1];
// Build command line
wstring cmd = quoteArg(compiler);
wstring objFile;
wstring sourceFile;
cmd += L" -showIncludes";
for (int i = 2; i < argc; i++) {
cmd += L" ";
cmd += quoteArg(argv[i]);
}
vector<wchar_t> cmdLine(cmd.begin(), cmd.end());
cmdLine.push_back(L'\0');
for (int i = 2; i < argc; i++) {
wstring arg = argv[i];
if (arg.rfind(L"/Fo", 0) == 0 || arg.rfind(L"-Fo", 0) == 0) {
objFile = arg.substr(3); // strip /Fo or -Fo
}
if (!arg.empty() && arg[0] != L'-' && arg[0] != L'/') {
sourceFile = arg; // last non-flag argument is the source file
}
}
// Create pipe for capturing stdout
HANDLE readPipe, writePipe;
SECURITY_ATTRIBUTES sa = { sizeof(sa), nullptr, TRUE };
if (!CreatePipe(&readPipe, &writePipe, &sa, 0)) {
fwprintf(stderr, L"Failed to create pipe\n");
return 1;
}
SetHandleInformation(readPipe, HANDLE_FLAG_INHERIT, 0);
STARTUPINFOW si = { sizeof(si) };
si.dwFlags = STARTF_USESTDHANDLES;
si.hStdOutput = writePipe;
si.hStdError = GetStdHandle(STD_ERROR_HANDLE);
si.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
PROCESS_INFORMATION pi;
BOOL ok = CreateProcessW(nullptr, cmdLine.data(), nullptr, nullptr, TRUE, 0, nullptr, nullptr, &si, &pi);
CloseHandle(writePipe);
if (!ok) {
fwprintf(stderr, L"Failed to launch compiler: %ls (error %lu)\n", compiler, GetLastError());
CloseHandle(readPipe);
return 1;
}
// Read compiler output and collect dependencies
auto deps = processOutput(readPipe);
CloseHandle(readPipe);
WaitForSingleObject(pi.hProcess, INFINITE);
DWORD exitCode = 0;
GetExitCodeProcess(pi.hProcess, &exitCode);
// Write the depfile only if we know the output object path
if (!objFile.empty()) {
string srcUtf8 = wideToUtf8(sourceFile);
deps.insert(deps.begin(), sanitizeMakeDeps(srcUtf8));
writeDepfile(objFile, deps);
}
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
return exitCode;
}
+1 -1
View File
@@ -275,7 +275,7 @@ def check_style():
edges[inclname] = set()
# Process all the JS files.
for filename in js_names.keys():
for filename in list(js_names.keys()):
inclname = js_names[filename]
file_kind = FileKind.get(filename)
if file_kind == FileKind.C or file_kind == FileKind.CPP or \
+4 -3
View File
@@ -120,8 +120,8 @@ CONFIG_TOOLS = $(MOZ_BUILD_ROOT)/config
AUTOCONF_TOOLS = $(MOZILLA_DIR)/build/autoconf
ifdef _MSC_VER
CC_WRAPPER ?= $(call py_action,cl)
CXX_WRAPPER ?= $(call py_action,cl)
CC_WRAPPER ?= $(DEPTH)/config/action_cl$(BIN_SUFFIX)
CXX_WRAPPER ?= $(DEPTH)/config/action_cl$(BIN_SUFFIX)
endif # _MSC_VER
CC := $(CC_WRAPPER) $(CC)
@@ -562,7 +562,8 @@ endif
PLY_INCLUDE = -I$(MOZILLA_DIR)/other-licenses/ply
export CL_INCLUDES_PREFIX
export CL_TOPOBJDIR = $(MOZ_BUILD_ROOT)
export CL_TOPSRCDIR = $(EXTERNAL_SOURCE_DIR)
# Make sure that the build system can handle non-ASCII characters
# in environment variables to prevent it from breking silently on
# non-English systems.
+4 -2
View File
@@ -56,10 +56,12 @@ def generate_precomplete(root_path):
precomplete_file = open(precomplete_file_path, "wb")
rel_file_path_list, rel_dir_path_list = get_build_entries(root_path)
for rel_file_path in rel_file_path_list:
precomplete_file.writelines("remove \""+rel_file_path+"\"\n")
line = "remove \""+rel_file_path+"\"\n"
precomplete_file.write(line.encode('utf-8'))
for rel_dir_path in rel_dir_path_list:
precomplete_file.writelines("rmdir \""+rel_dir_path+"\"\n")
line = "rmdir \""+rel_dir_path+"\"\n"
precomplete_file.write(line.encode('utf-8'))
precomplete_file.close()
+2 -2
View File
@@ -36,7 +36,7 @@ def ensureParentDir(file):
if dir and not os.path.exists(dir):
try:
os.makedirs(dir)
except OSError, error:
except OSError as error:
if error.errno != errno.EEXIST:
raise
@@ -140,4 +140,4 @@ class ExpandArgs(list):
return [relativize(arg)]
if __name__ == '__main__':
print " ".join(ExpandArgs(sys.argv[1:]))
print(" ".join(ExpandArgs(sys.argv[1:])))
+7 -7
View File
@@ -305,11 +305,11 @@ class SectionFinder(object):
return syms
def print_command(out, args):
print >>out, "Executing: " + " ".join(args)
print("Executing: " + " ".join(args), file=out)
for tmp in [f for f in args.tmp if os.path.isfile(f)]:
print >>out, tmp + ":"
print(tmp + ":", file=out)
with open(tmp) as file:
print >>out, "".join([" " + l for l in file.readlines()])
print("".join([" " + l for l in file.readlines()]), file=out)
out.flush()
def main(args, proc_callback=None):
@@ -339,14 +339,14 @@ def main(args, proc_callback=None):
proc = subprocess.Popen(args, stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
if proc_callback:
proc_callback(proc)
except Exception, e:
print >>sys.stderr, 'error: Launching', args, ':', e
except Exception as e:
print('error: Launching', args, ':', e, file=sys.stderr)
raise e
(stdout, stderr) = proc.communicate()
if proc.returncode and not options.verbose:
print_command(sys.stderr, args)
sys.stderr.write(stdout)
sys.stderr.flush()
sys.stderr.buffer.write(stdout)
sys.stderr.buffer.flush()
if proc.returncode:
return proc.returncode
return 0
+1 -1
View File
@@ -38,4 +38,4 @@ if __name__ == '__main__':
ensureParentDir(options.output)
with open(options.output, 'w') as outfile:
print >>outfile, generate(args)
print(generate(args), file=outfile)
+2
View File
@@ -101,6 +101,8 @@ else:
ASFLAGS += ['-no-integrated-as']
elif CONFIG['FFI_TARGET'] == 'AARCH64':
ffi_srcs = ('sysv.S', 'ffi.c')
elif CONFIG['FFI_TARGET'] == 'LOONGARCH64':
ffi_srcs = ('ffi.c', 'sysv.S')
elif CONFIG['FFI_TARGET'] == 'X86':
ffi_srcs = ('ffi.c', 'sysv.S', 'win32.S')
elif CONFIG['FFI_TARGET'] == 'X86_64':
+4 -1
View File
@@ -29,7 +29,10 @@ if CONFIG['MOZ_WEBM_ENCODER']:
external_dirs += ['media/libvpx']
if CONFIG['MOZ_AV1']:
external_dirs += ['media/libaom']
if CONFIG['AV1_USE_AOM']:
external_dirs += ['media/libaom']
else:
external_dirs += ['media/libdav1d']
external_dirs += ['media/libpng']
+2 -2
View File
@@ -95,12 +95,12 @@ def count_lines():
"""Keep track of the amount of times individual lines occur, in order to
prioritize the errors which occur most frequently."""
counts = {}
for string,count in blacklist.items():
for string,count in list(blacklist.items()):
for line in string.split("\n"):
counts[line] = counts.get(line, 0) + count
lines = []
for k,v in counts.items():
for k,v in list(counts.items()):
lines.append("{0:6}: {1}".format(v, k))
lines.sort()
+2 -2
View File
@@ -18,7 +18,7 @@ def periodically_print_status(proc):
time.sleep(0.5)
idleTime += 0.5
if idleTime > 20 * 60:
print "Still linking, 20 minutes passed..."
print("Still linking, 20 minutes passed...")
sys.stdout.flush()
idleTime = 0
@@ -42,6 +42,6 @@ def wrap_linker(args):
if __name__ == "__main__":
if len(sys.argv) < 2:
print >>sys.stderr, "Usage: link.py <commandline>"
print("Usage: link.py <commandline>", file=sys.stderr)
sys.exit(1)
sys.exit(wrap_linker(sys.argv[1:]))
+1 -1
View File
@@ -8,4 +8,4 @@
# Referenced by milestone.py.
#--------------------------------------------------------
6.8.1
6.9.0
+8
View File
@@ -23,11 +23,19 @@ if CONFIG['HOST_OS_ARCH'] != 'WINNT':
'nsinstall.c',
'pathsub.c',
]
# stdc++compat depends on config/export, so avoid a circular
# dependency added by HostProgram depending on stdc++compat,
# while the program here is in C.
HostProgram('nsinstall_real', c_only=True)
if CONFIG['HOST_OS_ARCH'] == 'WINNT':
HOST_SOURCES +=[
'action_cl.cpp',
]
HostProgram('action_cl')
if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
DEFINES['GKMEDIAS_SHARED_LIBRARY'] = True
+7 -7
View File
@@ -5,7 +5,7 @@
from unittest import TextTestRunner as _TestRunner, TestResult as _TestResult
import unittest
import inspect
from StringIO import StringIO
from io import StringIO
import os
import sys
@@ -140,7 +140,7 @@ class MockedOpen(object):
'''
def __init__(self, files = {}):
self.files = {}
for name, content in files.iteritems():
for name, content in files.items():
self.files[normcase(os.path.abspath(name))] = content
def __call__(self, name, mode = 'r'):
@@ -158,19 +158,19 @@ class MockedOpen(object):
return file
def __enter__(self):
import __builtin__
self.open = __builtin__.open
import builtins
self.open = builtins.open
self._orig_path_exists = os.path.exists
self._orig_path_isdir = os.path.isdir
self._orig_path_isfile = os.path.isfile
__builtin__.open = self
builtins.open = self
os.path.exists = self._wrapped_exists
os.path.isdir = self._wrapped_isdir
os.path.isfile = self._wrapped_isfile
def __exit__(self, type, value, traceback):
import __builtin__
__builtin__.open = self.open
import builtins
builtins.open = self.open
os.path.exists = self._orig_path_exists
os.path.isdir = self._orig_path_isdir
os.path.isfile = self._orig_path_isfile
+3 -6
View File
@@ -149,7 +149,7 @@ def _nsinstall_internal(argv):
# nsinstall as a native command is always UTF-8
def nsinstall(argv):
return _nsinstall_internal([unicode(arg, "utf-8") for arg in argv])
return _nsinstall_internal([str(arg, "utf-8") for arg in argv])
if __name__ == '__main__':
# sys.argv corrupts characters outside the system code page on Windows
@@ -173,10 +173,7 @@ if __name__ == '__main__':
# The first argv will be "python", the second will be the .py file
argv = argv_arr[1:argc.value]
else:
# For consistency, do it on Unix as well
if sys.stdin.encoding is not None:
argv = [unicode(arg, sys.stdin.encoding) for arg in sys.argv]
else:
argv = [unicode(arg) for arg in sys.argv]
# On Py3, we shouldn't do this for non-Windows. sys.argv is UTF-8 (or ASCII on old Unix).
argv = sys.argv
sys.exit(_nsinstall_internal(argv[1:]))
+6 -6
View File
@@ -5,27 +5,27 @@
import configobj
import sys
import re
from StringIO import StringIO
from io import StringIO
try:
(file, section, key) = sys.argv[1:]
except ValueError:
print "Usage: printconfigsetting.py <file> <section> <setting>"
print("Usage: printconfigsetting.py <file> <section> <setting>")
sys.exit(1)
with open(file) as fh:
content = re.sub('^\s*;', '#', fh.read(), flags=re.M)
content = re.sub(r'^\s*;', '#', fh.read(), flags=re.M)
c = configobj.ConfigObj(StringIO(content))
try:
s = c[section]
except KeyError:
print >>sys.stderr, "Section [%s] not found." % section
print("Section [%s] not found." % section, file=sys.stderr)
sys.exit(1)
try:
print s[key]
print(s[key])
except KeyError:
print >>sys.stderr, "Key %s not found." % key
print("Key %s not found." % key, file=sys.stderr)
sys.exit(1)
+2 -2
View File
@@ -9,7 +9,7 @@ Run a python script, adding extra directories to the python path.
def main(args):
def usage():
print >>sys.stderr, "pythonpath.py -I directory script.py [args...]"
print("pythonpath.py -I directory script.py [args...]", file=sys.stderr)
sys.exit(150)
paths = []
@@ -45,7 +45,7 @@ def main(args):
frozenglobals['__name__'] = '__main__'
frozenglobals['__file__'] = script
execfile(script, frozenglobals)
exec(compile(open(script, "rb").read(), script, 'exec'), frozenglobals)
# Freeze scope here ... why this makes things work I have no idea ...
frozenglobals = globals()
+5 -5
View File
@@ -18,7 +18,7 @@ def rebuild_check(args):
deps = args[1:]
t = mtime(target)
if t < 0:
print target
print(target)
return
newer = []
@@ -31,13 +31,13 @@ def rebuild_check(args):
newer.append(dep)
if newer and removed:
print 'Rebuilding %s because %s changed and %s was removed' % (target, ', '.join(newer), ', '.join(removed))
print('Rebuilding %s because %s changed and %s was removed' % (target, ', '.join(newer), ', '.join(removed)))
elif newer:
print 'Rebuilding %s because %s changed' % (target, ', '.join(newer))
print('Rebuilding %s because %s changed' % (target, ', '.join(newer)))
elif removed:
print 'Rebuilding %s because %s was removed' % (target, ', '.join(removed))
print('Rebuilding %s because %s was removed' % (target, ', '.join(removed)))
else:
print 'Rebuilding %s for an unknown reason' % target
print('Rebuilding %s for an unknown reason' % target)
if __name__ == '__main__':
import sys
-2
View File
@@ -335,8 +335,6 @@ curses.h
cxxabi.h
DateTimeUtils.h
dbus/dbus.h
dbus/dbus-glib.h
dbus/dbus-glib-lowlevel.h
ddeml.h
Debug.h
dem.h
+2 -3
View File
@@ -7,7 +7,7 @@ from tempfile import mkdtemp
from shutil import rmtree
import mozunit
from UserString import UserString
from collections import UserString
# Create a controlled configuration for use by expandlibs
config_win = {
'AR': 'lib',
@@ -120,8 +120,7 @@ class ReplicateTests(type):
del dict[name]
return type.__new__(cls, clsName, bases, dict)
class TestCaseWithTmpDir(unittest.TestCase):
__metaclass__ = ReplicateTests
class TestCaseWithTmpDir(unittest.TestCase, metaclass=ReplicateTests):
def init(self):
self.tmpdir = os.path.abspath(mkdtemp(dir=os.curdir))
+21 -21
View File
@@ -28,9 +28,9 @@ class TestNsinstall(unittest.TestCase):
# Unicode strings means non-ASCII children can be deleted properly on
# Windows
if sys.stdin.encoding is None:
tmpdir = unicode(self.tmpdir)
tmpdir = str(self.tmpdir)
else:
tmpdir = unicode(self.tmpdir, sys.stdin.encoding)
tmpdir = str(self.tmpdir, sys.stdin.encoding)
rmtree(tmpdir)
# utility methods for tests
@@ -50,14 +50,14 @@ class TestNsinstall(unittest.TestCase):
"Test nsinstall -D <dir>"
testdir = os.path.join(self.tmpdir, "test")
self.assertEqual(nsinstall(["-D", testdir]), 0)
self.assert_(os.path.isdir(testdir))
self.assertTrue(os.path.isdir(testdir))
def test_nsinstall_basic(self):
"Test nsinstall <file> <dir>"
testfile = self.touch("testfile")
testdir = self.mkdirs("testdir")
self.assertEqual(nsinstall([testfile, testdir]), 0)
self.assert_(os.path.isfile(os.path.join(testdir, "testfile")))
self.assertTrue(os.path.isfile(os.path.join(testdir, "testfile")))
def test_nsinstall_basic_recursive(self):
"Test nsinstall <dir> <dest dir>"
@@ -76,12 +76,12 @@ class TestNsinstall(unittest.TestCase):
'-X', Xdir]), 0)
testdir = os.path.join(destdir, "sourcedir")
self.assert_(os.path.isdir(testdir))
self.assert_(os.path.isfile(os.path.join(testdir, "testfile")))
self.assert_(not os.path.exists(os.path.join(testdir, "Xfile")))
self.assert_(os.path.isdir(os.path.join(testdir, "copieddir")))
self.assert_(os.path.isfile(os.path.join(testdir, "copieddir", "testfile2")))
self.assert_(not os.path.exists(os.path.join(testdir, "Xdir")))
self.assertTrue(os.path.isdir(testdir))
self.assertTrue(os.path.isfile(os.path.join(testdir, "testfile")))
self.assertTrue(not os.path.exists(os.path.join(testdir, "Xfile")))
self.assertTrue(os.path.isdir(os.path.join(testdir, "copieddir")))
self.assertTrue(os.path.isfile(os.path.join(testdir, "copieddir", "testfile2")))
self.assertTrue(not os.path.exists(os.path.join(testdir, "Xdir")))
def test_nsinstall_multiple(self):
"Test nsinstall <three files> <dest dir>"
@@ -91,7 +91,7 @@ class TestNsinstall(unittest.TestCase):
testdir = self.mkdirs("testdir")
self.assertEqual(nsinstall(testfiles + [testdir]), 0)
for f in testfiles:
self.assert_(os.path.isfile(os.path.join(testdir,
self.assertTrue(os.path.isfile(os.path.join(testdir,
os.path.basename(f))))
def test_nsinstall_dir_exists(self):
@@ -99,7 +99,7 @@ class TestNsinstall(unittest.TestCase):
srcdir = self.mkdirs("test")
destdir = self.mkdirs("testdir/test")
self.assertEqual(nsinstall([srcdir, os.path.dirname(destdir)]), 0)
self.assert_(os.path.isdir(destdir))
self.assertTrue(os.path.isdir(destdir))
def test_nsinstall_t(self):
"Test that nsinstall -t works (preserve timestamp)"
@@ -110,7 +110,7 @@ class TestNsinstall(unittest.TestCase):
os.utime(testfile, (t, t))
self.assertEqual(nsinstall(["-t", testfile, testdir]), 0)
destfile = os.path.join(testdir, "testfile")
self.assert_(os.path.isfile(destfile))
self.assertTrue(os.path.isfile(destfile))
self.assertEqual(os.stat(testfile).st_mtime,
os.stat(destfile).st_mtime)
@@ -125,7 +125,7 @@ class TestNsinstall(unittest.TestCase):
self.assertEqual(nsinstall(["-m", "{0:04o}"
.format(mode), testfile, testdir]), 0)
destfile = os.path.join(testdir, "testfile")
self.assert_(os.path.isfile(destfile))
self.assertTrue(os.path.isfile(destfile))
self.assertEqual(os.stat(testfile).st_mode,
os.stat(destfile).st_mode)
@@ -136,25 +136,25 @@ class TestNsinstall(unittest.TestCase):
testdir = self.mkdirs("testdir")
destdir = os.path.join(testdir, "subdir")
self.assertEqual(nsinstall(["-d", testfile, destdir]), 0)
self.assert_(os.path.isdir(os.path.join(destdir, "testfile")))
self.assertTrue(os.path.isdir(os.path.join(destdir, "testfile")))
if RUN_NON_ASCII_TESTS:
def test_nsinstall_non_ascii(self):
"Test that nsinstall handles non-ASCII files"
filename = u"\u2325\u3452\u2415\u5081"
filename = "\u2325\u3452\u2415\u5081"
testfile = self.touch(filename)
testdir = self.mkdirs(u"\u4241\u1D04\u1414")
testdir = self.mkdirs("\u4241\u1D04\u1414")
self.assertEqual(nsinstall([testfile.encode("utf-8"),
testdir.encode("utf-8")]), 0)
destfile = os.path.join(testdir, filename)
self.assert_(os.path.isfile(destfile))
self.assertTrue(os.path.isfile(destfile))
def test_nsinstall_non_ascii_subprocess(self):
"Test that nsinstall as a subprocess handles non-ASCII files"
filename = u"\u2325\u3452\u2415\u5081"
filename = "\u2325\u3452\u2415\u5081"
testfile = self.touch(filename)
testdir = self.mkdirs(u"\u4241\u1D04\u1414")
testdir = self.mkdirs("\u4241\u1D04\u1414")
# We don't use subprocess because it can't handle Unicode on
# Windows <http://bugs.python.org/issue1759845>. mozprocess calls
# CreateProcessW directly so it's perfect.
@@ -166,7 +166,7 @@ class TestNsinstall(unittest.TestCase):
self.assertEqual(rv, 0)
destfile = os.path.join(testdir, filename)
self.assert_(os.path.isfile(destfile))
self.assertTrue(os.path.isfile(destfile))
#TODO: implement -R, -l, -L and test them!
+12 -11
View File
@@ -11,6 +11,7 @@ import sys
import random
import copy
from string import letters
from functools import reduce
'''
Test case infrastructure for MozZipFile.
@@ -38,7 +39,7 @@ leafs = (
'firstdir/oneleaf',
'seconddir/twoleaf',
'thirddir/with/sub/threeleaf')
_lengths = map(lambda n: n * 64, [16, 64, 80])
_lengths = [n * 64 for n in [16, 64, 80]]
lengths = 3
writes = 5
@@ -71,7 +72,7 @@ def getid(descs):
def getContent(length):
'Get pseudo random content of given length.'
rv = [None] * length
for i in xrange(length):
for i in range(length):
rv[i] = random.choice(letters)
return ''.join(rv)
@@ -133,13 +134,13 @@ class TestExtensiveStored(unittest.TestCase):
def _verifyZip(self):
zf = zipfile.ZipFile(self.f)
badEntry = zf.testzip()
self.failIf(badEntry, badEntry)
self.assertFalse(badEntry, badEntry)
zlist = zf.namelist()
zlist.sort()
vlist = self.ref.keys()
vlist = list(self.ref.keys())
vlist.sort()
self.assertEqual(zlist, vlist)
for leaf, content in self.ref.iteritems():
for leaf, content in self.ref.items():
zcontent = zf.read(leaf)
self.assertEqual(content, zcontent)
@@ -158,16 +159,16 @@ class TestExtensiveStored(unittest.TestCase):
open(self.leaf('stage', leaf), 'w').write(content)
# all leafs in all lengths
atomics = list(prod(xrange(len(leafs)), xrange(lengths)))
atomics = list(prod(range(len(leafs)), range(lengths)))
# populate TestExtensiveStore with testcases
for w in xrange(writes):
for w in range(writes):
# Don't iterate over all files for the the first n passes,
# those are redundant as long as w < lengths.
# There are symmetries in the trailing end, too, but I don't know
# how to reduce those out right now.
nonatomics = [list(prod(range(min(i,len(leafs))), xrange(lengths)))
for i in xrange(1, w+1)] + [atomics]
nonatomics = [list(prod(list(range(min(i,len(leafs)))), range(lengths)))
for i in range(1, w+1)] + [atomics]
for descs in prod(*nonatomics):
suffix = getid(descs)
dicts = [dict(leaf=leaf, length=length) for leaf, length in descs]
@@ -181,9 +182,9 @@ for w in xrange(writes):
# and then write all atomics again.
# This should catch more or less all artifacts generated
# by the final ordering step when closing the jar.
files = [list(prod([i], xrange(lengths))) for i in xrange(len(leafs))]
files = [list(prod([i], range(lengths))) for i in range(len(leafs))]
allfiles = reduce(lambda l,r:l+r,
[list(prod(*files[:(i+1)])) for i in xrange(len(leafs))])
[list(prod(*files[:(i+1)])) for i in range(len(leafs))])
for first in allfiles:
testbasename = 'test{0}_'.format(getid(first))
+1 -1
View File
@@ -22,4 +22,4 @@ SRCDIR=$(dirname $0)
TOPSRCDIR="$SRCDIR"
export OLD_CONFIGURE="$SRCDIR"/old-configure
which python2.7 > /dev/null && exec python2.7 "$TOPSRCDIR/configure.py" "$@" || exec python "$TOPSRCDIR/configure.py" "$@"
which python3 > /dev/null && exec python3 "$TOPSRCDIR/configure.py" "$@" || exec python "$TOPSRCDIR/configure.py" "$@"
+17 -22
View File
@@ -10,13 +10,11 @@ import subprocess
import sys
import textwrap
base_dir = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, os.path.join(base_dir, 'python', 'mozbuild'))
from mozbuild.configure import ConfigureSandbox
from mozbuild.util import (
indented_repr,
encode,
)
@@ -36,20 +34,24 @@ def config_status(config):
# Ideally, all the backend and frontend code would handle the booleans, but
# there are so many things involved, that it's easier to keep config.status
# untouched for now.
def sanitized_bools(v):
def sanitized_values(v):
if v is True:
return '1'
if v is False:
return ''
if isinstance(v, dict):
return {key: sanitized_values(value) for key, value in v.items()}
if isinstance(v, (list, tuple)):
return [sanitized_values(value) for value in v]
return v
sanitized_config = {}
sanitized_config['substs'] = {
k: sanitized_bools(v) for k, v in config.iteritems()
if k not in ('DEFINES', 'non_global_defines', 'TOPSRCDIR', 'TOPOBJDIR')
key: sanitized_values(value) for key, value in config.items()
if key not in ('DEFINES', 'non_global_defines', 'TOPSRCDIR', 'TOPOBJDIR')
}
sanitized_config['defines'] = {
k: sanitized_bools(v) for k, v in config['DEFINES'].iteritems()
key: sanitized_values(value) for key, value in config['DEFINES'].items()
}
sanitized_config['non_global_defines'] = config['non_global_defines']
sanitized_config['topsrcdir'] = config['TOPSRCDIR']
@@ -60,19 +62,16 @@ def config_status(config):
# here, when we're able to skip configure tests/use cached results/not rely
# on autoconf.
print("Creating config.status", file=sys.stderr)
encoding = 'mbcs' if sys.platform == 'win32' else 'utf-8'
with codecs.open('config.status', 'w', encoding) as fh:
with codecs.open('config.status', 'w', encoding='utf-8', errors='replace') as fh:
fh.write(textwrap.dedent('''\
#!%(python)s
# coding=%(encoding)s
from __future__ import unicode_literals
from mozbuild.util import encode
encoding = '%(encoding)s'
''') % {'python': config['PYTHON'], 'encoding': encoding})
''') % {'python': config['PYTHON'], 'encoding': 'utf-8'})
# A lot of the build backend code is currently expecting byte
# strings and breaks in subtle ways with unicode strings. (bug 1296508)
for k, v in sanitized_config.iteritems():
fh.write('%s = encode(%s, encoding)\n' % (k, indented_repr(v)))
for k, v in sanitized_config.items():
fh.write('%s = %s\n' % (k, indented_repr(v)))
fh.write("__all__ = ['topobjdir', 'topsrcdir', 'defines', "
"'non_global_defines', 'substs', 'mozconfig']")
@@ -88,18 +87,14 @@ def config_status(config):
# executable permissions.
os.chmod('config.status', 0o755)
if config.get('MOZ_BUILD_APP') != 'js' or config.get('JS_STANDALONE'):
os.environ[b'WRITE_MOZINFO'] = b'1'
os.environ['WRITE_MOZINFO'] = '1'
from mozbuild.config_status import config_status
# Some values in sanitized_config also have more complex types, such as
# EnumString, which using when calling config_status would currently
# break the build, as well as making it inconsistent with re-running
# config.status. Fortunately, EnumString derives from unicode, so it's
# covered by converting unicode strings.
# A lot of the build backend code is currently expecting byte strings
# and breaks in subtle ways with unicode strings.
return config_status(args=[], **encode(sanitized_config, encoding))
# EnumString and tuples. Converting string subclasses to plain strings
# and tuples to lists keeps this code path consistent with the
# generated config.status file, which serializes iterables as lists.
return config_status(args=[], **sanitized_config)
return 0
+2 -2
View File
@@ -210,10 +210,10 @@ function initialHTML(doc) {
let style = doc.createElement("link");
style.rel = "stylesheet";
style.type = "text/css";
style.href = "css/main.css";
style.href = base.href +"css/main.css";
let script = doc.createElement("script");
script.src = "lib/require.js";
script.src = base.href + "lib/require.js";
script.dataset.main = "viewer-config";
script.defer = true;
@@ -103,12 +103,6 @@ function StyleSheetEditor(styleSheet, win, file, isNew, walker, highlighter) {
}
};
this._styleSheetFilePath = null;
if (styleSheet.href &&
Services.io.extractScheme(this.styleSheet.href) == "file") {
this._styleSheetFilePath = this.styleSheet.href;
}
this._onPropertyChange = this._onPropertyChange.bind(this);
this._onError = this._onError.bind(this);
this._onMediaRuleMatchesChange = this._onMediaRuleMatchesChange.bind(this);
@@ -664,8 +658,7 @@ StyleSheetEditor.prototype = {
if (this._friendlyName) {
defaultName = OS.Path.basename(this._friendlyName);
}
showFilePicker(file || this._styleSheetFilePath, true, this._window,
onFile, defaultName);
showFilePicker(file, true, this._window, onFile, defaultName);
},
/**
@@ -1,98 +1,112 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that 'Save' function works.
const TESTCASE_URI_HTML = TEST_BASE_HTTP + "simple.html";
const TESTCASE_URI_CSS = TEST_BASE_HTTP + "simple.css";
var tempScope = {};
Components.utils.import("resource://gre/modules/FileUtils.jsm", tempScope);
Components.utils.import("resource://gre/modules/NetUtil.jsm", tempScope);
var FileUtils = tempScope.FileUtils;
var NetUtil = tempScope.NetUtil;
add_task(function* () {
let htmlFile = yield copy(TESTCASE_URI_HTML, "simple.html");
yield copy(TESTCASE_URI_CSS, "simple.css");
let uri = Services.io.newFileURI(htmlFile);
let filePath = uri.resolve("");
let { ui } = yield openStyleEditorForURL(filePath);
let editor = ui.editors[0];
yield editor.getSourceEditor();
info("Editing the style sheet.");
let dirty = editor.sourceEditor.once("dirty-change");
let beginCursor = {line: 0, ch: 0};
editor.sourceEditor.replaceText("DIRTY TEXT", beginCursor, beginCursor);
yield dirty;
is(editor.sourceEditor.isClean(), false, "Editor is dirty.");
ok(editor.summary.classList.contains("unsaved"),
"Star icon is present in the corresponding summary.");
info("Saving the changes.");
dirty = editor.sourceEditor.once("dirty-change");
editor.saveToFile(null, function (file) {
ok(file, "file should get saved directly when using a file:// URI");
});
yield dirty;
is(editor.sourceEditor.isClean(), true, "Editor is clean.");
ok(!editor.summary.classList.contains("unsaved"),
"Star icon is not present in the corresponding summary.");
});
function copy(srcChromeURL, destFileName) {
let deferred = defer();
let destFile = FileUtils.getFile("ProfD", [destFileName]);
write(read(srcChromeURL), destFile, deferred.resolve);
return deferred.promise;
}
function read(srcChromeURL) {
let scriptableStream = Cc["@mozilla.org/scriptableinputstream;1"]
.getService(Ci.nsIScriptableInputStream);
let channel = NetUtil.newChannel({
uri: srcChromeURL,
loadUsingSystemPrincipal: true
});
let input = channel.open2();
scriptableStream.init(input);
let data = "";
while (input.available()) {
data = data.concat(scriptableStream.read(input.available()));
}
scriptableStream.close();
input.close();
return data;
}
function write(data, file, callback) {
let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"]
.createInstance(Ci.nsIScriptableUnicodeConverter);
converter.charset = "UTF-8";
let istream = converter.convertToInputStream(data);
let ostream = FileUtils.openSafeFileOutputStream(file);
NetUtil.asyncCopy(istream, ostream, function (status) {
if (!Components.isSuccessCode(status)) {
info("Couldn't write to " + file.path);
return;
}
callback(file);
});
}
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that 'Save' function works.
const TESTCASE_URI_HTML = TEST_BASE_HTTP + "simple.html";
const TESTCASE_URI_CSS = TEST_BASE_HTTP + "simple.css";
var tempScope = {};
Components.utils.import("resource://gre/modules/FileUtils.jsm", tempScope);
Components.utils.import("resource://gre/modules/NetUtil.jsm", tempScope);
var FileUtils = tempScope.FileUtils;
var NetUtil = tempScope.NetUtil;
add_task(function* () {
let htmlFile = yield copy(TESTCASE_URI_HTML, "simple.html");
const cssFile = await copy(TESTCASE_URI_CSS, "simple.css");
let uri = Services.io.newFileURI(htmlFile);
let filePath = uri.resolve("");
let { ui } = yield openStyleEditorForURL(filePath);
let editor = ui.editors[0];
yield editor.getSourceEditor();
is(
editor.savedFile,
null,
"savedFile should not be pre-populated from the source file"
);
info("Editing the style sheet.");
let dirty = editor.sourceEditor.once("dirty-change");
let beginCursor = {line: 0, ch: 0};
editor.sourceEditor.replaceText("DIRTY TEXT", beginCursor, beginCursor);
yield dirty;
is(editor.sourceEditor.isClean(), false, "Editor is dirty.");
ok(editor.summary.classList.contains("unsaved"),
"Star icon is present in the corresponding summary.");
info(
"Saving the changes with an explicit file (simulating a user-chosen save location)."
);
dirty = editor.sourceEditor.once("dirty-change");
editor.saveToFile(cssFile, function (file) {
ok(file, "file should get saved when explicitly passing a file");
});
yield dirty;
is(editor.sourceEditor.isClean(), true, "Editor is clean.");
ok(!editor.summary.classList.contains("unsaved"),
"Star icon is not present in the corresponding summary.");
is(
editor.savedFile?.path,
cssFile.path,
"savedFile should now be set on the editor"
);
});
function copy(srcChromeURL, destFileName) {
let deferred = defer();
let destFile = FileUtils.getFile("ProfD", [destFileName]);
write(read(srcChromeURL), destFile, deferred.resolve);
return deferred.promise;
}
function read(srcChromeURL) {
let scriptableStream = Cc["@mozilla.org/scriptableinputstream;1"]
.getService(Ci.nsIScriptableInputStream);
let channel = NetUtil.newChannel({
uri: srcChromeURL,
loadUsingSystemPrincipal: true
});
let input = channel.open2();
scriptableStream.init(input);
let data = "";
while (input.available()) {
data = data.concat(scriptableStream.read(input.available()));
}
scriptableStream.close();
input.close();
return data;
}
function write(data, file, callback) {
let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"]
.createInstance(Ci.nsIScriptableUnicodeConverter);
converter.charset = "UTF-8";
let istream = converter.convertToInputStream(data);
let ostream = FileUtils.openSafeFileOutputStream(file);
NetUtil.asyncCopy(istream, ostream, function (status) {
if (!Components.isSuccessCode(status)) {
info("Couldn't write to " + file.path);
return;
}
callback(file);
});
}
@@ -28,7 +28,10 @@ add_task(function* () {
let HTMLFile = yield copy(TESTCASE_URI_HTML, ["sourcemaps.html"]);
let CSSFile = yield copy(TESTCASE_URI_CSS,
["sourcemap-css", "sourcemaps.css"]);
yield copy(TESTCASE_URI_SCSS, ["sourcemap-sass", "sourcemaps.scss"]);
const SCSSFile = await copy(TESTCASE_URI_SCSS, [
"sourcemap-sass",
"sourcemaps.scss",
]);
yield copy(TESTCASE_URI_MAP, ["sourcemap-css", "sourcemaps.css.map"]);
yield copy(TESTCASE_URI_REG_CSS, ["simple.css"]);
@@ -59,7 +62,7 @@ add_task(function* () {
// Edit and save Sass in the editor. This will start off a file-watching
// process waiting for the CSS file to change.
yield editSCSS(editor);
yield editSCSS(SCSSFile, editor);
// We can't run Sass or another compiler, so we fake it by just
// directly changing the CSS file.
@@ -73,12 +76,12 @@ add_task(function* () {
is(color, "rgb(0, 0, 255)", "div is blue after saving file");
});
function editSCSS(editor) {
function editSCSS(SCSSFile, editor) {
let deferred = defer();
editor.sourceEditor.setText(CSS_TEXT);
editor.saveToFile(null, function (file) {
editor.saveToFile(SCSSFile, function (file) {
ok(file, "Scss file should be saved");
deferred.resolve();
});
@@ -97,4 +97,4 @@ class MachCommands(MachCommandBase):
with open(destination_path, 'wb') as destination:
destination.write(preamble + contents)
print('The database was successfully generated at ' + destination_path)
print(('The database was successfully generated at ' + destination_path))
+9 -9
View File
@@ -152,12 +152,12 @@ receipt_with_wrong_typ = {
"reissue": "http://mochi.test:8888/reissue/5169314356"
}
print("let valid_receipt1 = \"" + jwt.encode(receipt1, "") + "\";\n")
print("let valid_receipt2 = \"" + jwt.encode(receipt2, "") + "\";\n")
print("let receipt_without_typ = \"" + jwt.encode(receipt_without_typ, "") + "\";\n")
print("let receipt_without_product = \"" + jwt.encode(receipt_without_product, "") + "\";\n")
print("let receipt_without_user = \"" + jwt.encode(receipt_without_user, "") + "\";\n")
print("let receipt_without_iss = \"" + jwt.encode(receipt_without_iss, "") + "\";\n")
print("let receipt_without_nbf = \"" + jwt.encode(receipt_without_nbf, "") + "\";\n")
print("let receipt_without_iat = \"" + jwt.encode(receipt_without_iat, "") + "\";\n")
print("let receipt_with_wrong_typ = \"" + jwt.encode(receipt_with_wrong_typ, "") + "\";\n")
print(("let valid_receipt1 = \"" + jwt.encode(receipt1, "") + "\";\n"))
print(("let valid_receipt2 = \"" + jwt.encode(receipt2, "") + "\";\n"))
print(("let receipt_without_typ = \"" + jwt.encode(receipt_without_typ, "") + "\";\n"))
print(("let receipt_without_product = \"" + jwt.encode(receipt_without_product, "") + "\";\n"))
print(("let receipt_without_user = \"" + jwt.encode(receipt_without_user, "") + "\";\n"))
print(("let receipt_without_iss = \"" + jwt.encode(receipt_without_iss, "") + "\";\n"))
print(("let receipt_without_nbf = \"" + jwt.encode(receipt_without_nbf, "") + "\";\n"))
print(("let receipt_without_iat = \"" + jwt.encode(receipt_without_iat, "") + "\";\n"))
print(("let receipt_with_wrong_typ = \"" + jwt.encode(receipt_with_wrong_typ, "") + "\";\n"))
+18 -13
View File
@@ -304,12 +304,18 @@ Element::TabIndex()
}
void
Element::Focus(mozilla::ErrorResult& aError)
Element::Focus(const FocusOptions& aOptions, ErrorResult& aError)
{
nsCOMPtr<nsIDOMElement> domElement = do_QueryInterface(this);
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
// Also other browsers seem to have the hack to not re-focus (and flush) when
// the element is already focused.
// Until https://github.com/whatwg/html/issues/4512 is clarified, we'll
// maintain interoperatibility by not re-focusing, independent of aOptions.
// I.e., `focus({ preventScroll: true})` followed by `focus( { preventScroll:
// false })` won't re-focus.
if (fm && domElement) {
aError = fm->SetFocus(domElement, 0);
aError = fm->SetFocus(domElement, nsFocusManager::FocusOptionsToFocusManagerFlags(aOptions));
}
}
@@ -2326,6 +2332,7 @@ Element::MaybeCheckSameAttrVal(int32_t aNamespaceID,
bool* aOldValueSet)
{
bool modification = false;
CustomElementData* customElementData = GetCustomElementData();
*aHasListeners = aNotify &&
nsContentUtils::HasMutationListeners(this,
NS_EVENT_BITS_MUTATION_ATTRMODIFIED,
@@ -2341,13 +2348,14 @@ Element::MaybeCheckSameAttrVal(int32_t aNamespaceID,
if (*aHasListeners || aNotify) {
BorrowedAttrInfo info(GetAttrInfo(aNamespaceID, aName));
if (info.mValue) {
// Check whether the old value is the same as the new one. Note that we
// only need to actually _get_ the old value if we have listeners or
// if the element is a custom element (because it may have an
// attribute changed callback).
if (*aHasListeners || GetCustomElementData()) {
// Need to store the old value.
//
bool valueMatches = aValue.EqualsAsStrings(*info.mValue);
if (valueMatches && aPrefix == info.mName->GetPrefix()) {
return true;
}
// Need to store the old value if listeners are present or this is a
// custom element that may run an attribute-changed callback.
if (*aHasListeners || customElementData) {
// If the current attribute value contains a pointer to some other data
// structure that gets updated in the process of setting the attribute
// we'll no longer have the old value of the attribute. Therefore, we
@@ -2358,10 +2366,7 @@ Element::MaybeCheckSameAttrVal(int32_t aNamespaceID,
aOldValue.SetToSerialized(*info.mValue);
*aOldValueSet = true;
}
bool valueMatches = aValue.EqualsAsStrings(*info.mValue);
if (valueMatches && aPrefix == info.mName->GetPrefix()) {
return true;
}
modification = true;
}
}
+1 -1
View File
@@ -216,7 +216,7 @@ public:
/**
* Make focus on this element.
*/
virtual void Focus(mozilla::ErrorResult& aError);
virtual void Focus(const FocusOptions& aOptions, ErrorResult& aError);
/**
* Show blur and clear focus.
+7 -1
View File
@@ -395,8 +395,14 @@ FileReader::ReadFileContent(Blob& aBlob,
return;
}
CheckedInt<size_t> size(mTotal);
if (!size.isValid()) {
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
return;
}
if (mDataFormat == FILE_AS_ARRAYBUFFER) {
mFileData = js_pod_malloc<char>(mTotal);
mFileData = js_pod_malloc<char>(size.value());
if (!mFileData) {
NS_WARNING("Preallocation failed for ReadFileData");
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
+7 -6
View File
@@ -400,6 +400,7 @@ ImageEncoder::ExtractDataInternal(const nsAString& aType,
layers::PlanarYCbCrImage* ycbcrImage = static_cast<layers::PlanarYCbCrImage*> (aImage);
gfxImageFormat format = SurfaceFormat::A8R8G8B8_UINT32;
uint32_t stride = GetAlignedStride<16>(aSize.width, 4);
auto size = stride * aSize.height;
size_t length = BufferSizeFromStrideAndHeight(stride, aSize.height);
if (length == 0) {
return NS_ERROR_INVALID_ARG;
@@ -413,10 +414,10 @@ ImageEncoder::ExtractDataInternal(const nsAString& aType,
stride);
rv = aEncoder->InitFromData(data.Elements(),
aSize.width * aSize.height * 4,
size,
aSize.width,
aSize.height,
aSize.width * 4,
stride,
imgIEncoder::INPUT_FORMAT_HOSTARGB,
aOptions);
} else {
@@ -433,10 +434,10 @@ ImageEncoder::ExtractDataInternal(const nsAString& aType,
return NS_ERROR_INVALID_ARG;
}
rv = aEncoder->InitFromData(map.mData,
aSize.width * aSize.height * 4,
map.mStride * aSize.height,
aSize.width,
aSize.height,
aSize.width * 4,
map.mStride,
imgIEncoder::INPUT_FORMAT_HOSTARGB,
aOptions);
dataSurface->Unmap();
@@ -467,10 +468,10 @@ ImageEncoder::ExtractDataInternal(const nsAString& aType,
return NS_ERROR_INVALID_ARG;
}
rv = aEncoder->InitFromData(map.mData,
aSize.width * aSize.height * 4,
map.mStride * aSize.height,
aSize.width,
aSize.height,
aSize.width * 4,
map.mStride,
imgIEncoder::INPUT_FORMAT_HOSTARGB,
aOptions);
emptyCanvas->Unmap();
+1 -1
View File
@@ -196,7 +196,7 @@ public:
{
MOZ_ASSERT(!NS_IsMainThread());
int32_t written = PR_Write(mFD, mData, mLength);
int32_t written = mLength < INT32_MAX ? PR_Write(mFD, mData, mLength) : -1;
if (NS_WARN_IF(written < 0 || uint32_t(written) != mLength)) {
return NS_DispatchToMainThread(
new ErrorPropagationRunnable(mBlobStorage, NS_ERROR_FAILURE));
+4 -2
View File
@@ -523,7 +523,8 @@ nsContentList::NamedItem(const nsAString& aName, bool aDoFlush)
}
void
nsContentList::GetSupportedNames(nsTArray<nsString>& aNames)
nsContentList::GetSupportedNames(nsTArray<nsString>& aNames,
FilterElementWithName aFilter)
{
BringSelfUpToDate(true);
@@ -546,7 +547,8 @@ nsContentList::GetSupportedNames(nsTArray<nsString>& aNames)
// Note: nsINode::HasName means the name is exposed on the document,
// which is false for options, so we don't check it here.
const nsAttrValue* val = el->GetParsedAttr(nsGkAtoms::name);
if (val && val->Type() == nsAttrValue::eAtom) {
if (val && val->Type() == nsAttrValue::eAtom &&
(!aFilter || aFilter(el))) {
nsIAtom* name = val->GetAtomValue();
MOZ_ASSERT(name != nsGkAtoms::_empty,
"Empty names don't get atomized");
+9 -1
View File
@@ -295,7 +295,9 @@ public:
aFound = !!item;
return item;
}
virtual void GetSupportedNames(nsTArray<nsString>& aNames) override;
virtual void GetSupportedNames(nsTArray<nsString>& aNames) override {
GetSupportedNames(aNames, nullptr);
}
// nsContentList public methods
uint32_t Length(bool aDoFlush);
@@ -303,6 +305,12 @@ public:
mozilla::dom::Element*
NamedItem(const nsAString& aName, bool aDoFlush);
// Used by HTMLAllCollection to limit the elements whose name attribute is
// considered. The filter MUST NOT cause any flushes.
using FilterElementWithName = bool (*)(nsIContent*);
void GetSupportedNames(nsTArray<nsString>& aNames,
FilterElementWithName aFilter);
// nsIMutationObserver
NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED
NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
+36
View File
@@ -2259,6 +2259,31 @@ nsContentUtils::IsCallerContentXBL()
return xpc::IsContentXBLScope(c);
}
bool
nsContentUtils::IsSystemCaller(JSContext* aCx)
{
MOZ_ASSERT(NS_IsMainThread());
// This is similar to what SubjectPrincipal() does, except we do in fact
// assume that we're in a compartment here; anyone who calls this function in
// situations where that's not the case is doing it wrong.
JSCompartment *compartment = js::GetContextCompartment(aCx);
MOZ_ASSERT(compartment);
JSPrincipals *principals = JS_GetCompartmentPrincipals(compartment);
return nsJSPrincipals::get(principals) == sSystemPrincipal;
}
bool
nsContentUtils::ThreadsafeIsSystemCaller(JSContext* aCx)
{
if (NS_IsMainThread()) {
return IsSystemCaller(aCx);
}
return workers::GetWorkerPrivateFromContext(aCx)->UsesSystemPrincipal();
}
// static
bool
nsContentUtils::LookupBindingMember(JSContext* aCx, nsIContent *aContent,
@@ -7336,6 +7361,17 @@ nsContentUtils::HasDistributedChildren(nsIContent* aContent)
return false;
}
// static
bool nsContentUtils::IsNodeInEditableRegion(nsINode* aNode) {
while (aNode) {
if (aNode->IsEditable()) {
return true;
}
aNode = aNode->GetParent();
}
return false;
}
// static
bool
nsContentUtils::IsForbiddenRequestHeader(const nsACString& aHeader,
+24
View File
@@ -202,6 +202,23 @@ public:
static bool ThreadsafeIsCallerChrome();
static bool IsCallerContentXBL();
// The APIs for checking whether the caller is system (in the sense of system
// principal) should only be used when the JSContext is known to accurately
// represent the caller. In practice, that means you should only use them in
// two situations at the moment:
//
// 1) Functions used in WebIDL Func annotations.
// 2) Bindings code.
//
// Use pretty much anywhere else is almost certainly wrong and should be
// replaced with [NeedsCallerType] annotations in bindings.
// Check whether the caller is system if you know you're on the main thread.
static bool IsSystemCaller(JSContext* aCx);
// Check whether the caller is system if you might be on a worker thread.
static bool ThreadsafeIsSystemCaller(JSContext* aCx);
// In the traditional Gecko architecture, both C++ code and untrusted JS code
// needed to rely on the same XPCOM method/getter/setter to get work done.
// This required lots of security checks in the various exposed methods, which
@@ -2550,6 +2567,13 @@ public:
*/
static bool GPCEnabled();
/**
* Returns whether a node has an editable ancestor.
*
* @param aNode The node to test.
*/
static bool IsNodeInEditableRegion(nsINode* aNode);
/**
* Returns a LogModule that dump calls from content script are logged to.
* This can be enabled with the 'Dump' module, and is useful for synchronizing
+6
View File
@@ -48,6 +48,7 @@
#include "mozilla/ContentEvents.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/ElementBinding.h"
#include "mozilla/dom/ShadowRoot.h"
#include "mozilla/dom/HTMLInputElement.h"
#include "mozilla/dom/HTMLSlotElement.h"
@@ -2999,6 +3000,11 @@ nsFocusManager::DetermineElementToMoveFocus(nsPIDOMWindowOuter* aWindow,
return NS_OK;
}
uint32_t nsFocusManager::FocusOptionsToFocusManagerFlags(
const mozilla::dom::FocusOptions& aOptions) {
return aOptions.mPreventScroll ? nsIFocusManager::FLAG_NOSCROLL : 0;
}
static bool
IsHostOrSlot(nsIContent* aContent)
{
+4
View File
@@ -26,6 +26,7 @@ class nsIMessageBroadcaster;
namespace mozilla {
namespace dom {
struct FocusOptions;
class TabParent;
}
}
@@ -110,6 +111,9 @@ public:
static nsIContent* GetFocusedDescendant(nsPIDOMWindowOuter* aWindow, bool aDeep,
nsPIDOMWindowOuter** aFocusedWindow);
static uint32_t FocusOptionsToFocusManagerFlags(
const mozilla::dom::FocusOptions& aOptions);
/**
* Returns the content node that focus will be redirected to if aContent was
* focused. This is used for the special case of certain XUL elements such
+1
View File
@@ -1004,6 +1004,7 @@ GK_ATOM(parameter, "parameter")
GK_ATOM(parent, "parent")
GK_ATOM(parentfocused, "parentfocused")
GK_ATOM(parsetype, "parsetype")
GK_ATOM(part, "part")
GK_ATOM(password, "password")
GK_ATOM(pattern, "pattern")
GK_ATOM(patternSeparator, "pattern-separator")
+3 -2
View File
@@ -7395,9 +7395,10 @@ nsGlobalWindow::Confirm(const nsAString& aMessage,
already_AddRefed<Promise>
nsGlobalWindow::Fetch(const RequestOrUSVString& aInput,
const RequestInit& aInit, ErrorResult& aRv)
const RequestInit& aInit,
CallerType aCallerType, ErrorResult& aRv)
{
return FetchRequest(this, aInput, aInit, aRv);
return FetchRequest(this, aInput, aInit, aCallerType, aRv);
}
void
+1
View File
@@ -929,6 +929,7 @@ public:
already_AddRefed<mozilla::dom::cache::CacheStorage> GetCaches(mozilla::ErrorResult& aRv);
already_AddRefed<mozilla::dom::Promise> Fetch(const mozilla::dom::RequestOrUSVString& aInput,
const mozilla::dom::RequestInit& aInit,
mozilla::dom::CallerType aCallerType,
mozilla::ErrorResult& aRv);
void PrintOuter(mozilla::ErrorResult& aError);
void Print(mozilla::ErrorResult& aError);
+1 -1
View File
@@ -37,7 +37,7 @@ native Visibility(mozilla::Visibility);
* observers to check which request they are getting notifications for.
*
* Please make sure to update the MozImageLoadingContent WebIDL
* interface to mirror this interface when changing it.
* mixin to mirror this interface when changing it.
*/
[scriptable, builtinclass, uuid(0357123d-9224-4d12-a47e-868c32689777)]
+1
View File
@@ -16,6 +16,7 @@
#include "mozilla/CORSMode.h"
#include "mozilla/EventDispatcher.h"
#include "mozilla/EventListenerManager.h"
#include "mozilla/HTMLEditor.h"
#include "mozilla/InternalMutationEvent.h"
#include "mozilla/Likely.h"
#include "mozilla/MemoryReporting.h"
+16 -4
View File
@@ -33,17 +33,29 @@ nsWrapperCache::HoldJSObjects(void* aScriptObjectHolder,
}
}
static inline bool
IsNurseryWrapper(JSObject* aWrapper) {
return aWrapper && !JS::ObjectIsTenured(aWrapper);
}
void
nsWrapperCache::SetWrapperJSObject(JSObject* aWrapper)
{
mWrapper = aWrapper;
nsWrapperCache::SetWrapperJSObject(JSObject* aNewWrapper) {
JSObject* oldWrapper = mWrapper;
mWrapper = aNewWrapper;
UnsetWrapperFlags(kWrapperFlagsMask & ~WRAPPER_IS_NOT_DOM_BINDING);
if (aWrapper && !JS::ObjectIsTenured(aWrapper)) {
if (IsNurseryWrapper(aNewWrapper) && !IsNurseryWrapper(oldWrapper)) {
CycleCollectedJSContext::Get()->NurseryWrapperAdded(this);
}
}
void nsWrapperCache::ClearWrapperOnWrapFailure() {
if (IsNurseryWrapper(mWrapper)) {
CycleCollectedJSContext::Get()->NurseryWrapperRemovedSlow(this);
}
ClearWrapper();
}
void
nsWrapperCache::ReleaseWrapper(void* aScriptObjectHolder)
{
+2
View File
@@ -131,6 +131,8 @@ public:
SetWrapperJSObject(nullptr);
}
void ClearWrapperOnWrapFailure();
/**
* Update the wrapper if the object it contains is moved.
*
+1 -1
View File
@@ -72,7 +72,7 @@ def web_socket_transfer_data(request):
msgutil.send_message(request, resp.decode('utf-8'))
elif request.ws_protocol == "test-12":
msg = msgutil.receive_message(request)
if msg == u'a\ufffdb':
if msg == 'a\ufffdb':
# converted unpaired surrogate in UTF-16 to UTF-8 OK
msgutil.send_message(request, "SUCCESS")
else:
@@ -15,4 +15,4 @@ def web_socket_transfer_data(request):
def all_distinct_bytes():
return ''.join([chr(i) for i in xrange(256)])
return ''.join([chr(i) for i in range(256)])
Loaded 100 of 2565 files, more files were not shown because too many files have changed in this diff. Show more