From 648b7278f60a38d317ca308a3c997c1f3fec7bfa Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 13 Mar 2020 13:00:12 -0400 Subject: [PATCH 01/11] Issue #1477 - Fix finding config.guess on builds not using MOZ_OBJDIR * So far this seems to only affect Macintosh builds but other unix builds may be affected. Windows doesn't seem to be. * This maintains consistency with other one-off file invocations and backwards compatibility with older comm setups --- python/mozbuild/mozbuild/base.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python/mozbuild/mozbuild/base.py b/python/mozbuild/mozbuild/base.py index 9d5897a34a..9db1005d11 100644 --- a/python/mozbuild/mozbuild/base.py +++ b/python/mozbuild/mozbuild/base.py @@ -352,6 +352,13 @@ class MozbuildObject(ProcessExecutionMixin): return _config_guess_output[0] p = os.path.join(self.topsrcdir, 'build', 'autoconf', 'config.guess') + + # Try looking for mozilla, for comm-central + if not os.path.isfile(p): + p = os.path.join(self.topsrcdir, 'mozilla', 'build', 'autoconf', 'config.guess') + + if not os.path.isfile(p): + p = os.path.join(self.topsrcdir, 'platform', 'build', 'autoconf', 'config.guess') # This is a little kludgy. We need access to the normalize_command # function. However, that's a method of a mach mixin, so we need a From 30e381eea23624a2db5d43e0afe7f163dcf29cd0 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Fri, 13 Mar 2020 11:28:54 +0100 Subject: [PATCH 02/11] Issue #1485 - Fix incorrect grid cell sizing to min/max space. There were actually two separate logical errors in this method: The first part is that "origSizes.isSome()" is simply a bogus requirement for applying min/max-sizes here. I'm still keeping the optimization of not needlessly copying the mSizes array (as originally intended) since it's a quite common case. The second bug is that min/max-sizes were only applied under the "if (fr != 0.0f)" block. This is bogus since the calculated 'fr' value depends on 'aAvailableSize' which might change by applying min/max-sizes and thus 'fr' could become non-zero in the second round. To fix, this patch just moves "applyMinMax" block out one level. --- layout/generic/nsGridContainerFrame.cpp | 58 +++++++++---------- .../grid-max-sizing-flex-007-ref.html | 24 ++++++++ .../css-grid/grid-max-sizing-flex-007.html | 24 ++++++++ 3 files changed, 77 insertions(+), 29 deletions(-) diff --git a/layout/generic/nsGridContainerFrame.cpp b/layout/generic/nsGridContainerFrame.cpp index 959061e334..f771c9d7c5 100644 --- a/layout/generic/nsGridContainerFrame.cpp +++ b/layout/generic/nsGridContainerFrame.cpp @@ -4822,14 +4822,14 @@ nsGridContainerFrame::Tracks::StretchFlexibleTracks( : ri->ComputedMaxISize(); } Maybe> origSizes; + bool applyMinMax = (minSize != 0 || maxSize != NS_UNCONSTRAINEDSIZE) && + aAvailableSize == NS_UNCONSTRAINEDSIZE; // We iterate twice at most. The 2nd time if the grid size changed after // applying a min/max-size (can only occur if aAvailableSize is indefinite). while (true) { float fr = FindUsedFlexFraction(aState, aGridItems, flexTracks, aFunctions, aAvailableSize); if (fr != 0.0f) { - bool applyMinMax = (minSize != 0 || maxSize != NS_UNCONSTRAINEDSIZE) && - aAvailableSize == NS_UNCONSTRAINEDSIZE; for (uint32_t i : flexTracks) { float flexFactor = aFunctions.MaxSizingFor(i).GetFlexFractionValue(); nscoord flexLength = NSToCoordRound(flexFactor * fr); @@ -4841,36 +4841,36 @@ nsGridContainerFrame::Tracks::StretchFlexibleTracks( base = flexLength; } } - if (applyMinMax && origSizes.isSome()) { - // https://drafts.csswg.org/css-grid/#algo-flex-tracks - // "If using this flex fraction would cause the grid to be smaller than - // the grid container’s min-width/height (or larger than the grid - // container’s max-width/height), then redo this step, treating the free - // space as definite [...]" - nscoord newSize = 0; - for (auto& sz : mSizes) { - newSize += sz.mBase; - } - const auto sumOfGridGaps = SumOfGridGaps(); - newSize += sumOfGridGaps; - if (newSize > maxSize) { - aAvailableSize = maxSize; - } else if (newSize < minSize) { - aAvailableSize = minSize; - } - if (aAvailableSize != NS_UNCONSTRAINEDSIZE) { - // Reset min/max-size to ensure 'applyMinMax' becomes false next time. - minSize = 0; - maxSize = NS_UNCONSTRAINEDSIZE; - aAvailableSize = std::max(0, aAvailableSize - sumOfGridGaps); - // Restart with the original track sizes and definite aAvailableSize. + } + if (applyMinMax) { + applyMinMax = false; + // https://drafts.csswg.org/css-grid/#algo-flex-tracks + // "If using this flex fraction would cause the grid to be smaller than + // the grid container’s min-width/height (or larger than the grid + // container’s max-width/height), then redo this step, treating the free + // space as definite [...]" + nscoord newSize = 0; + for (auto& sz : mSizes) { + newSize += sz.mBase; + } + const auto sumOfGridGaps = SumOfGridGaps(); + newSize += sumOfGridGaps; + if (newSize > maxSize) { + aAvailableSize = maxSize; + } else if (newSize < minSize) { + aAvailableSize = minSize; + } + if (aAvailableSize != NS_UNCONSTRAINEDSIZE) { + aAvailableSize = std::max(0, aAvailableSize - sumOfGridGaps); + // Restart with the original track sizes and definite aAvailableSize. + if (origSizes.isSome()) { mSizes = Move(*origSizes); origSizes.reset(); - if (aAvailableSize == 0) { - break; // zero available size wouldn't change any sizes though... - } - continue; + } // else, no mSizes[].mBase were changed above so it's still correct + if (aAvailableSize == 0) { + break; // zero available size wouldn't change any sizes though... } + continue; } } break; diff --git a/layout/reftests/css-grid/grid-max-sizing-flex-007-ref.html b/layout/reftests/css-grid/grid-max-sizing-flex-007-ref.html index c5392d32cd..b17a1cc02e 100644 --- a/layout/reftests/css-grid/grid-max-sizing-flex-007-ref.html +++ b/layout/reftests/css-grid/grid-max-sizing-flex-007-ref.html @@ -107,4 +107,28 @@
+
The first 6 grids should look the same:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ diff --git a/layout/reftests/css-grid/grid-max-sizing-flex-007.html b/layout/reftests/css-grid/grid-max-sizing-flex-007.html index ac9dcc77c4..a2f39e95be 100644 --- a/layout/reftests/css-grid/grid-max-sizing-flex-007.html +++ b/layout/reftests/css-grid/grid-max-sizing-flex-007.html @@ -105,4 +105,28 @@
+
The first 6 grids should look the same:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ From 4f0a0c46067e4e006f39371ca3c5b47b52884c8a Mon Sep 17 00:00:00 2001 From: JustOff Date: Thu, 12 Mar 2020 21:37:13 +0200 Subject: [PATCH 03/11] Issue #1482 - Give dynamic SSUAO rules priority over static ones --- netwerk/protocol/http/UserAgentOverrides.jsm | 24 +++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/netwerk/protocol/http/UserAgentOverrides.jsm b/netwerk/protocol/http/UserAgentOverrides.jsm index aa1325a644..425bdfd726 100644 --- a/netwerk/protocol/http/UserAgentOverrides.jsm +++ b/netwerk/protocol/http/UserAgentOverrides.jsm @@ -30,6 +30,7 @@ XPCOMUtils.defineLazyServiceGetter(this, "ppmm", var gPrefBranch; var gOverrides = new Map; var gUpdatedOverrides; +var gOldDynOverrides; var gOverrideForHostCache = new Map; var gInitialized = false; var gOverrideFunctions = [ @@ -55,7 +56,10 @@ this.UserAgentOverrides = { } UserAgentUpdates.init(function(overrides) { - gOverrideForHostCache.clear(); + if (overrides == gOldDynOverrides) { + return; + } + gOldDynOverrides = overrides; if (overrides) { for (let domain in overrides) { overrides[domain] = getUserAgentFromOverride(overrides[domain]); @@ -63,6 +67,7 @@ this.UserAgentOverrides = { overrides.get = function(key) { return this[key]; }; } gUpdatedOverrides = overrides; + buildOverrides(); }); buildOverrides(); @@ -159,15 +164,22 @@ function buildOverrides() { if (!Services.prefs.getBoolPref(PREF_OVERRIDES_ENABLED)) return; - let builtUAs = new Map; let domains = gPrefBranch.getChildList(""); + // Since the static override map has the highest priority, we build it so + // that it includes only domains with user-set overrides and domains with + // default pre-set overrides that are not overridden by dynamic updates. for (let domain of domains) { - let override = gPrefBranch.getCharPref(domain); - let userAgent = getUserAgentFromOverride(override); + if (!(gUpdatedOverrides && gUpdatedOverrides.get(domain)) || + gPrefBranch.prefHasUserValue(domain)) { + // Here we selected domains that are not dynamically overridden + // or have a user-set override. + let override = gPrefBranch.getCharPref(domain); + let userAgent = getUserAgentFromOverride(override); - if (userAgent != DEFAULT_UA) { - gOverrides.set(domain, userAgent); + if (userAgent != DEFAULT_UA) { + gOverrides.set(domain, userAgent); + } } } } From 1069ed92733628553b115edc4a416296882442d4 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Mon, 16 Mar 2020 09:30:31 +0100 Subject: [PATCH 04/11] Issue #1355 - Make addition of cell border display items depend on whether they should be drawn. This reduces the size of display lists for tables by only adding display list items that are actually going to be visibly drawn, which will help overall performance of table drawing. --- layout/tables/nsTableFrame.cpp | 83 ++++++++++++++++++++++++++++++++-- layout/tables/nsTableFrame.h | 33 ++++++++++++++ 2 files changed, 112 insertions(+), 4 deletions(-) diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp index 4257c9c579..e5a48139a0 100644 --- a/layout/tables/nsTableFrame.cpp +++ b/layout/tables/nsTableFrame.cpp @@ -1268,6 +1268,74 @@ PaintRowGroupBackgroundByColIdx(nsTableRowGroupFrame* aRowGroup, } } +static inline bool FrameHasBorder(nsIFrame* f) +{ + if (!f->StyleVisibility()->IsVisible()) { + return false; + } + + if (f->StyleBorder()->HasBorder()) { + return true; + } + + return false; +} + +void nsTableFrame::CalcHasBCBorders() +{ + if (!IsBorderCollapse()) { + SetHasBCBorders(false); + return; + } + + if (FrameHasBorder(this)) { + SetHasBCBorders(true); + return; + } + + // Check col and col group has borders. + for (nsIFrame* f : this->GetChildList(kColGroupList)) { + if (FrameHasBorder(f)) { + SetHasBCBorders(true); + return; + } + + nsTableColGroupFrame *colGroup = static_cast(f); + for (nsTableColFrame* col = colGroup->GetFirstColumn(); col; col = col->GetNextCol()) { + if (FrameHasBorder(col)) { + SetHasBCBorders(true); + return; + } + } + } + + // check row group, row and cell has borders. + RowGroupArray rowGroups; + OrderRowGroups(rowGroups); + for (nsTableRowGroupFrame* rowGroup : rowGroups) { + if (FrameHasBorder(rowGroup)) { + SetHasBCBorders(true); + return; + } + + for (nsTableRowFrame* row = rowGroup->GetFirstRow(); row; row = row->GetNextRow()) { + if (FrameHasBorder(row)) { + SetHasBCBorders(true); + return; + } + + for (nsTableCellFrame* cell = row->GetFirstCell(); cell; cell = cell->GetNextCell()) { + if (FrameHasBorder(cell)) { + SetHasBCBorders(true); + return; + } + } + } + } + + SetHasBCBorders(false); +} + /* static */ void nsTableFrame::DisplayGenericTablePart(nsDisplayListBuilder* aBuilder, nsFrame* aFrame, @@ -1375,11 +1443,16 @@ nsTableFrame::DisplayGenericTablePart(nsDisplayListBuilder* aBuilder, nsTableFrame* table = static_cast(aFrame); // In the collapsed border model, overlay all collapsed borders. if (table->IsBorderCollapse()) { - aLists.BorderBackground()->AppendNewToTop( - new (aBuilder) nsDisplayTableBorderCollapse(aBuilder, table)); + if (table->HasBCBorders()) { + aLists.BorderBackground()->AppendNewToTop( + new (aBuilder) nsDisplayTableBorderCollapse(aBuilder, table)); + } } else { - aLists.BorderBackground()->AppendNewToTop( - new (aBuilder) nsDisplayBorder(aBuilder, table)); + const nsStyleBorder* borderStyle = aFrame->StyleBorder(); + if (borderStyle->HasBorder()) { + aLists.BorderBackground()->AppendNewToTop( + new (aBuilder) nsDisplayBorder(aBuilder, table)); + } } } } @@ -4101,6 +4174,7 @@ nsTableFrame::AddBCDamageArea(const TableArea& aValue) #endif SetNeedToCalcBCBorders(true); + SetNeedToCalcHasBCBorders(true); // Get the property BCPropertyData* value = GetOrCreateBCProperty(); if (value) { @@ -4141,6 +4215,7 @@ nsTableFrame::SetFullBCDamageArea() NS_ASSERTION(IsBorderCollapse(), "invalid SetFullBCDamageArea call"); SetNeedToCalcBCBorders(true); + SetNeedToCalcHasBCBorders(true); BCPropertyData* value = GetOrCreateBCProperty(); if (value) { diff --git a/layout/tables/nsTableFrame.h b/layout/tables/nsTableFrame.h index a6b786402d..d739faa72b 100644 --- a/layout/tables/nsTableFrame.h +++ b/layout/tables/nsTableFrame.h @@ -761,6 +761,13 @@ public: bool NeedToCollapse() const; void SetNeedToCollapse(bool aValue); + bool NeedToCalcHasBCBorders() const; + void SetNeedToCalcHasBCBorders(bool aValue); + + void CalcHasBCBorders(); + bool HasBCBorders(); + void SetHasBCBorders(bool aValue); + /** The GeometryDirty bit is similar to the NS_FRAME_IS_DIRTY frame * state bit, which implies that all descendants are dirty. The * GeometryDirty still implies that all the parts of the table are @@ -870,6 +877,8 @@ protected: uint32_t mIStartContBCBorder:8; uint32_t mNeedToCollapse:1; // rows, cols that have visibility:collapse need to be collapsed uint32_t mResizedColumns:1; // have we resized columns since last reflow? + uint32_t mNeedToCalcHasBCBorders:1; + uint32_t mHasBCBorders:1; } mBits; nsTableCellMap* mCellMap; // maintains the relationships between rows, cols, and cells @@ -965,6 +974,30 @@ inline void nsTableFrame::SetNeedToCalcBCBorders(bool aValue) mBits.mNeedToCalcBCBorders = (unsigned)aValue; } +inline bool nsTableFrame::NeedToCalcHasBCBorders() const +{ + return (bool)mBits.mNeedToCalcHasBCBorders; +} + +inline void nsTableFrame::SetNeedToCalcHasBCBorders(bool aValue) +{ + mBits.mNeedToCalcHasBCBorders = (unsigned)aValue; +} + +inline bool nsTableFrame::HasBCBorders() +{ + if (NeedToCalcHasBCBorders()) { + CalcHasBCBorders(); + SetNeedToCalcHasBCBorders(false); + } + return (bool)mBits.mHasBCBorders; +} + +inline void nsTableFrame::SetHasBCBorders(bool aValue) +{ + mBits.mHasBCBorders = (unsigned)aValue; +} + inline nscoord nsTableFrame::GetContinuousIStartBCBorderWidth() const { From 7a9ab66aed50b2e595882dd8c5735309ae0514a2 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 18 Mar 2020 11:11:13 +0100 Subject: [PATCH 05/11] [network] Cherry-pick various sctp lib upstream fixes. --- netwerk/sctp/src/netinet/sctp.h | 7 +++++-- netwerk/sctp/src/netinet/sctp_auth.c | 5 +++-- netwerk/sctp/src/netinet/sctp_pcb.c | 7 +++++-- netwerk/sctp/src/netinet/sctp_usrreq.c | 14 +++++++++++--- 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/netwerk/sctp/src/netinet/sctp.h b/netwerk/sctp/src/netinet/sctp.h index a5ff4eb0bc..962ce1140b 100644 --- a/netwerk/sctp/src/netinet/sctp.h +++ b/netwerk/sctp/src/netinet/sctp.h @@ -32,7 +32,7 @@ #ifdef __FreeBSD__ #include -__FBSDID("$FreeBSD: head/sys/netinet/sctp.h 279859 2015-03-10 19:49:25Z tuexen $"); +__FBSDID("$FreeBSD: head/sys/netinet/sctp.h 356270 2020-01-02 13:55:10Z tuexen $"); #endif #ifndef _NETINET_SCTP_H_ @@ -598,7 +598,10 @@ struct sctp_error_no_user_data { #define SCTP_MOBILITY_PRIM_DELETED 0x00000004 -#define SCTP_SMALLEST_PMTU 512 /* smallest pmtu allowed when disabling PMTU discovery */ +/* Smallest PMTU allowed when disabling PMTU discovery */ +#define SCTP_SMALLEST_PMTU 512 +/* Largest PMTU allowed when disabling PMTU discovery */ +#define SCTP_LARGEST_PMTU 65536 #if defined(__Userspace_os_Windows) #pragma pack() diff --git a/netwerk/sctp/src/netinet/sctp_auth.c b/netwerk/sctp/src/netinet/sctp_auth.c index ee5ca36ce3..4e9f7e4cda 100644 --- a/netwerk/sctp/src/netinet/sctp_auth.c +++ b/netwerk/sctp/src/netinet/sctp_auth.c @@ -32,7 +32,7 @@ #ifdef __FreeBSD__ #include -__FBSDID("$FreeBSD: head/sys/netinet/sctp_auth.c 271673 2014-09-16 14:20:33Z tuexen $"); +__FBSDID("$FreeBSD: head/sys/netinet/sctp_auth.c 355931 2019-12-20 15:25:08Z tuexen $"); #endif #include @@ -1450,7 +1450,8 @@ sctp_auth_get_cookie_params(struct sctp_tcb *stcb, struct mbuf *m, ptype = ntohs(phdr->param_type); plen = ntohs(phdr->param_length); - if ((plen == 0) || (offset + plen > length)) + if ((plen < sizeof(struct sctp_paramhdr)) || + (offset + plen > length)) break; if (ptype == SCTP_RANDOM) { diff --git a/netwerk/sctp/src/netinet/sctp_pcb.c b/netwerk/sctp/src/netinet/sctp_pcb.c index 58c164f503..ea5725c85c 100644 --- a/netwerk/sctp/src/netinet/sctp_pcb.c +++ b/netwerk/sctp/src/netinet/sctp_pcb.c @@ -32,7 +32,7 @@ #ifdef __FreeBSD__ #include -__FBSDID("$FreeBSD: head/sys/netinet/sctp_pcb.c 280459 2015-03-24 21:12:45Z tuexen $"); +__FBSDID("$FreeBSD: head/sys/netinet/sctp_pcb.c 355931 2019-12-20 15:25:08Z tuexen $"); #endif #include @@ -7213,7 +7213,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m, if (offset + plen > limit) { break; } - if (plen == 0) { + if (plen < sizeof(struct sctp_paramhdr)) { break; } #ifdef INET @@ -7413,6 +7413,9 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m, if (plen > sizeof(lstore)) { return (-23); } + if (plen < sizeof(struct sctp_asconf_addrv4_param)) { + return (-101); + } phdr = sctp_get_next_param(m, offset, (struct sctp_paramhdr *)&lstore, min(plen,sizeof(lstore))); diff --git a/netwerk/sctp/src/netinet/sctp_usrreq.c b/netwerk/sctp/src/netinet/sctp_usrreq.c index d24a21815e..7ffd8e8c81 100644 --- a/netwerk/sctp/src/netinet/sctp_usrreq.c +++ b/netwerk/sctp/src/netinet/sctp_usrreq.c @@ -32,7 +32,7 @@ #ifdef __FreeBSD__ #include -__FBSDID("$FreeBSD: head/sys/netinet/sctp_usrreq.c 280459 2015-03-24 21:12:45Z tuexen $"); +__FBSDID("$FreeBSD: head/sys/netinet/sctp_usrreq.c 356270 2020-01-02 13:55:10Z tuexen $"); #endif #include @@ -5995,6 +5995,14 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); return (EINVAL); } + if ((paddrp->spp_flags & SPP_PMTUD_DISABLE) && + ((paddrp->spp_pathmtu < SCTP_SMALLEST_PMTU) || + (paddrp->spp_pathmtu > SCTP_LARGEST_PMTU))) { + if (stcb) + SCTP_TCB_UNLOCK(stcb); + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + return (EINVAL); + } if (stcb != NULL) { /************************TCB SPECIFIC SET ******************/ @@ -6038,7 +6046,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_SOCKOPT, SCTP_SO_LOCKED); sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net); } - if ((paddrp->spp_flags & SPP_PMTUD_DISABLE) && (paddrp->spp_pathmtu >= SCTP_SMALLEST_PMTU)) { + if (paddrp->spp_flags & SPP_PMTUD_DISABLE) { if (SCTP_OS_TIMER_PENDING(&net->pmtu_timer.timer)) { sctp_timer_stop(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net, SCTP_FROM_SCTP_USRREQ+SCTP_LOC_10); @@ -6160,7 +6168,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, } sctp_stcb_feature_on(inp, stcb, SCTP_PCB_FLAGS_DONOT_HEARTBEAT); } - if ((paddrp->spp_flags & SPP_PMTUD_DISABLE) && (paddrp->spp_pathmtu >= SCTP_SMALLEST_PMTU)) { + if (paddrp->spp_flags & SPP_PMTUD_DISABLE) { TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { if (SCTP_OS_TIMER_PENDING(&net->pmtu_timer.timer)) { sctp_timer_stop(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net, From bc6ac88559214afd924030c751ae48d0e4237217 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 18 Mar 2020 13:31:19 +0100 Subject: [PATCH 06/11] [js] Remove pointless MakeMRegExpHoistable optimization. It's a lot of code with no measurable effect. --- js/src/jit/Ion.cpp | 8 - js/src/jit/IonAnalysis.cpp | 268 -------------------------------- js/src/jit/IonAnalysis.h | 3 - js/src/jit/Lowering.cpp | 11 +- js/src/jit/MIR.h | 10 +- js/src/vm/CommonPropertyNames.h | 6 - 6 files changed, 4 insertions(+), 302 deletions(-) diff --git a/js/src/jit/Ion.cpp b/js/src/jit/Ion.cpp index 9337f61505..aa0ba8e3d3 100644 --- a/js/src/jit/Ion.cpp +++ b/js/src/jit/Ion.cpp @@ -1497,14 +1497,6 @@ OptimizeMIR(MIRGenerator* mir) if (mir->shouldCancel("Start")) return false; - if (!mir->compilingWasm()) { - if (!MakeMRegExpHoistable(mir, graph)) - return false; - - if (mir->shouldCancel("Make MRegExp Hoistable")) - return false; - } - gs.spewPass("BuildSSA"); AssertBasicGraphCoherency(graph); diff --git a/js/src/jit/IonAnalysis.cpp b/js/src/jit/IonAnalysis.cpp index 3c0f2c4b32..1e3cb0ad44 100644 --- a/js/src/jit/IonAnalysis.cpp +++ b/js/src/jit/IonAnalysis.cpp @@ -1975,274 +1975,6 @@ jit::ApplyTypeInformation(MIRGenerator* mir, MIRGraph& graph) return true; } -// Check if `def` is only the N-th operand of `useDef`. -static inline size_t -IsExclusiveNthOperand(MDefinition* useDef, size_t n, MDefinition* def) -{ - uint32_t num = useDef->numOperands(); - if (n >= num || useDef->getOperand(n) != def) - return false; - - for (uint32_t i = 0; i < num; i++) { - if (i == n) - continue; - if (useDef->getOperand(i) == def) - return false; - } - - return true; -} - -static size_t -IsExclusiveThisArg(MCall* call, MDefinition* def) -{ - return IsExclusiveNthOperand(call, MCall::IndexOfThis(), def); -} - -static size_t -IsExclusiveFirstArg(MCall* call, MDefinition* def) -{ - return IsExclusiveNthOperand(call, MCall::IndexOfArgument(0), def); -} - -static bool -IsRegExpHoistableCall(MCall* call, MDefinition* def) -{ - if (call->isConstructing()) - return false; - - JSAtom* name; - if (WrappedFunction* fun = call->getSingleTarget()) { - if (!fun->isSelfHostedBuiltin()) - return false; - name = GetSelfHostedFunctionName(fun->rawJSFunction()); - } else { - MDefinition* funDef = call->getFunction(); - if (funDef->isDebugCheckSelfHosted()) - funDef = funDef->toDebugCheckSelfHosted()->input(); - if (funDef->isTypeBarrier()) - funDef = funDef->toTypeBarrier()->input(); - - if (!funDef->isCallGetIntrinsicValue()) - return false; - name = funDef->toCallGetIntrinsicValue()->name(); - } - - // Hoistable only if the RegExp is the first argument of RegExpBuiltinExec. - CompileRuntime* runtime = GetJitContext()->runtime; - if (name == runtime->names().RegExpBuiltinExec || - name == runtime->names().UnwrapAndCallRegExpBuiltinExec || - name == runtime->names().RegExpMatcher || - name == runtime->names().RegExpTester || - name == runtime->names().RegExpSearcher) - { - return IsExclusiveFirstArg(call, def); - } - - if (name == runtime->names().RegExp_prototype_Exec) - return IsExclusiveThisArg(call, def); - - return false; -} - -static bool -CanCompareRegExp(MCompare* compare, MDefinition* def) -{ - MDefinition* value; - if (compare->lhs() == def) { - value = compare->rhs(); - } else { - MOZ_ASSERT(compare->rhs() == def); - value = compare->lhs(); - } - - // Comparing two regexp that weren't cloned will give different result - // than if they were cloned. - if (value->mightBeType(MIRType::Object)) - return false; - - // Make sure @@toPrimitive is not called which could notice - // the difference between a not cloned/cloned regexp. - - JSOp op = compare->jsop(); - // Strict equality comparison won't invoke @@toPrimitive. - if (op == JSOP_STRICTEQ || op == JSOP_STRICTNE) - return true; - - if (op != JSOP_EQ && op != JSOP_NE) { - // Relational comparison always invoke @@toPrimitive. - MOZ_ASSERT(op == JSOP_GT || op == JSOP_GE || op == JSOP_LT || op == JSOP_LE); - return false; - } - - // Loose equality comparison can invoke @@toPrimitive. - if (value->mightBeType(MIRType::Boolean) || value->mightBeType(MIRType::String) || - value->mightBeType(MIRType::Int32) || - value->mightBeType(MIRType::Double) || value->mightBeType(MIRType::Float32) || - value->mightBeType(MIRType::Symbol)) - { - return false; - } - - return true; -} - -static inline void -SetNotInWorklist(MDefinitionVector& worklist) -{ - for (size_t i = 0; i < worklist.length(); i++) - worklist[i]->setNotInWorklist(); -} - -static bool -IsRegExpHoistable(MIRGenerator* mir, MDefinition* regexp, MDefinitionVector& worklist, - bool* hoistable) -{ - MOZ_ASSERT(worklist.length() == 0); - - if (!worklist.append(regexp)) - return false; - regexp->setInWorklist(); - - for (size_t i = 0; i < worklist.length(); i++) { - MDefinition* def = worklist[i]; - if (mir->shouldCancel("IsRegExpHoistable outer loop")) - return false; - - for (MUseIterator use = def->usesBegin(); use != def->usesEnd(); use++) { - if (mir->shouldCancel("IsRegExpHoistable inner loop")) - return false; - - // Ignore resume points. At this point all uses are listed. - // No DCE or GVN or something has happened. - if (use->consumer()->isResumePoint()) - continue; - - MDefinition* useDef = use->consumer()->toDefinition(); - - // Step through a few white-listed ops. - if (useDef->isPhi() || useDef->isFilterTypeSet() || useDef->isGuardShape()) { - if (useDef->isInWorklist()) - continue; - - if (!worklist.append(useDef)) - return false; - useDef->setInWorklist(); - continue; - } - - // Instructions that doesn't invoke unknown code that may modify - // RegExp instance or pass it to elsewhere. - if (useDef->isRegExpMatcher() || useDef->isRegExpTester() || - useDef->isRegExpSearcher()) - { - if (IsExclusiveNthOperand(useDef, 0, def)) - continue; - } else if (useDef->isLoadFixedSlot() || useDef->isTypeOf()) { - continue; - } else if (useDef->isCompare()) { - if (CanCompareRegExp(useDef->toCompare(), def)) - continue; - } - // Instructions that modifies `lastIndex` property. - else if (useDef->isStoreFixedSlot()) { - if (IsExclusiveNthOperand(useDef, 0, def)) { - MStoreFixedSlot* store = useDef->toStoreFixedSlot(); - if (store->slot() == RegExpObject::lastIndexSlot()) - continue; - } - } else if (useDef->isSetPropertyCache()) { - if (IsExclusiveNthOperand(useDef, 0, def)) { - MSetPropertyCache* setProp = useDef->toSetPropertyCache(); - if (setProp->idval()->isConstant()) { - Value propIdVal = setProp->idval()->toConstant()->toJSValue(); - if (propIdVal.isString()) { - CompileRuntime* runtime = GetJitContext()->runtime; - if (propIdVal.toString() == runtime->names().lastIndex) - continue; - } - } - } - } - // MCall is safe only for some known safe functions. - else if (useDef->isCall()) { - if (IsRegExpHoistableCall(useDef->toCall(), def)) - continue; - } - - // Everything else is unsafe. - SetNotInWorklist(worklist); - worklist.clear(); - *hoistable = false; - - return true; - } - } - - SetNotInWorklist(worklist); - worklist.clear(); - *hoistable = true; - return true; -} - -bool -jit::MakeMRegExpHoistable(MIRGenerator* mir, MIRGraph& graph) -{ - // If we are compiling try blocks, regular expressions may be observable - // from catch blocks (which Ion does not compile). For now just disable the - // pass in this case. - if (graph.hasTryBlock()) - return true; - - MDefinitionVector worklist(graph.alloc()); - - for (ReversePostorderIterator block(graph.rpoBegin()); block != graph.rpoEnd(); block++) { - if (mir->shouldCancel("MakeMRegExpHoistable outer loop")) - return false; - - for (MDefinitionIterator iter(*block); iter; iter++) { - if (!*iter) - MOZ_CRASH("confirm bug 1263794."); - - if (mir->shouldCancel("MakeMRegExpHoistable inner loop")) - return false; - - if (!iter->isRegExp()) - continue; - - MRegExp* regexp = iter->toRegExp(); - - bool hoistable = false; - if (!IsRegExpHoistable(mir, regexp, worklist, &hoistable)) - return false; - - if (!hoistable) - continue; - - // Make MRegExp hoistable - regexp->setMovable(); - regexp->setDoNotClone(); - - // That would be incorrect for global/sticky, because lastIndex - // could be wrong. Therefore setting the lastIndex to 0. That is - // faster than a not movable regexp. - RegExpObject* source = regexp->source(); - if (source->sticky() || source->global()) { - if (!graph.alloc().ensureBallast()) - return false; - MConstant* zero = MConstant::New(graph.alloc(), Int32Value(0)); - regexp->block()->insertAfter(regexp, zero); - - MStoreFixedSlot* lastIndex = - MStoreFixedSlot::New(graph.alloc(), regexp, RegExpObject::lastIndexSlot(), zero); - regexp->block()->insertAfter(zero, lastIndex); - } - } - } - - return true; -} - void jit::RenumberBlocks(MIRGraph& graph) { diff --git a/js/src/jit/IonAnalysis.h b/js/src/jit/IonAnalysis.h index 49bc0b5919..673c797bd1 100644 --- a/js/src/jit/IonAnalysis.h +++ b/js/src/jit/IonAnalysis.h @@ -56,9 +56,6 @@ EliminateDeadCode(MIRGenerator* mir, MIRGraph& graph); MOZ_MUST_USE bool ApplyTypeInformation(MIRGenerator* mir, MIRGraph& graph); -MOZ_MUST_USE bool -MakeMRegExpHoistable(MIRGenerator* mir, MIRGraph& graph); - void RenumberBlocks(MIRGraph& graph); diff --git a/js/src/jit/Lowering.cpp b/js/src/jit/Lowering.cpp index 19266bae85..f9b0b21570 100644 --- a/js/src/jit/Lowering.cpp +++ b/js/src/jit/Lowering.cpp @@ -2297,14 +2297,9 @@ LIRGenerator::visitToObjectOrNull(MToObjectOrNull* ins) void LIRGenerator::visitRegExp(MRegExp* ins) { - if (ins->mustClone()) { - LRegExp* lir = new(alloc()) LRegExp(); - defineReturn(lir, ins); - assignSafepoint(lir, ins); - } else { - RegExpObject* source = ins->source(); - define(new(alloc()) LPointer(source), ins); - } + LRegExp* lir = new(alloc()) LRegExp(); + defineReturn(lir, ins); + assignSafepoint(lir, ins); } void diff --git a/js/src/jit/MIR.h b/js/src/jit/MIR.h index af0abc695f..81662a9be7 100644 --- a/js/src/jit/MIR.h +++ b/js/src/jit/MIR.h @@ -8102,11 +8102,9 @@ class MDefFun class MRegExp : public MNullaryInstruction { CompilerGCPointer source_; - bool mustClone_; MRegExp(CompilerConstraintList* constraints, RegExpObject* source) - : source_(source), - mustClone_(true) + : source_(source) { setResultType(MIRType::Object); setResultTypeSet(MakeSingletonTypeSet(constraints, source)); @@ -8116,12 +8114,6 @@ class MRegExp : public MNullaryInstruction INSTRUCTION_HEADER(RegExp) TRIVIAL_NEW_WRAPPERS - void setDoNotClone() { - mustClone_ = false; - } - bool mustClone() const { - return mustClone_; - } RegExpObject* source() const { return source_; } diff --git a/js/src/vm/CommonPropertyNames.h b/js/src/vm/CommonPropertyNames.h index 6a8afb56b5..420ee75353 100644 --- a/js/src/vm/CommonPropertyNames.h +++ b/js/src/vm/CommonPropertyNames.h @@ -281,13 +281,8 @@ macro(proxy, proxy, "proxy") \ macro(raw, raw, "raw") \ macro(reason, reason, "reason") \ - macro(RegExpBuiltinExec, RegExpBuiltinExec, "RegExpBuiltinExec") \ macro(RegExpFlagsGetter, RegExpFlagsGetter, "RegExpFlagsGetter") \ - macro(RegExpMatcher, RegExpMatcher, "RegExpMatcher") \ - macro(RegExpSearcher, RegExpSearcher, "RegExpSearcher") \ macro(RegExpStringIterator, RegExpStringIterator, "RegExp String Iterator") \ - macro(RegExpTester, RegExpTester, "RegExpTester") \ - macro(RegExp_prototype_Exec, RegExp_prototype_Exec, "RegExp_prototype_Exec") \ macro(Reify, Reify, "Reify") \ macro(reject, reject, "reject") \ macro(rejected, rejected, "rejected") \ @@ -360,7 +355,6 @@ macro(uninitialized, uninitialized, "uninitialized") \ macro(unsized, unsized, "unsized") \ macro(unwatch, unwatch, "unwatch") \ - macro(UnwrapAndCallRegExpBuiltinExec, UnwrapAndCallRegExpBuiltinExec, "UnwrapAndCallRegExpBuiltinExec") \ macro(url, url, "url") \ macro(usage, usage, "usage") \ macro(useAsm, useAsm, "use asm") \ From 41bd0de230e5ddc74bd55045c84e02938b5f227c Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 18 Mar 2020 21:15:10 +0100 Subject: [PATCH 07/11] [DOM] Make sure to exit fullscreen mode if popups are opened or focused. --- dom/base/nsFocusManager.cpp | 9 +++++++++ embedding/components/windowwatcher/nsWindowWatcher.cpp | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/dom/base/nsFocusManager.cpp b/dom/base/nsFocusManager.cpp index fb350fa120..01c1944bec 100644 --- a/dom/base/nsFocusManager.cpp +++ b/dom/base/nsFocusManager.cpp @@ -1261,6 +1261,15 @@ nsFocusManager::SetFocusInner(nsIContent* aNewContent, int32_t aFlags, isElementInActiveWindow = (mActiveWindow && newRootWindow == mActiveWindow); } + // Exit fullscreen if a website focuses another window + if (!isElementInActiveWindow && aFlags & FLAG_RAISE) { + if (nsIDocument* doc = mActiveWindow ? mActiveWindow->GetDoc() : nullptr) { + if (doc && doc->GetFullscreenElement()) { + nsIDocument::AsyncExitFullscreen(doc); + } + } + } + // Exit fullscreen if we're focusing a windowed plugin on a non-MacOSX // system. We don't control event dispatch to windowed plugins on non-MacOSX, // so we can't display the "Press ESC to leave fullscreen mode" warning on diff --git a/embedding/components/windowwatcher/nsWindowWatcher.cpp b/embedding/components/windowwatcher/nsWindowWatcher.cpp index 3732ea66de..fa23e285bf 100644 --- a/embedding/components/windowwatcher/nsWindowWatcher.cpp +++ b/embedding/components/windowwatcher/nsWindowWatcher.cpp @@ -1297,6 +1297,12 @@ nsWindowWatcher::OpenWindowInternal(mozIDOMWindowProxy* aParent, } } + // If a website opens a popup exit DOM fullscreen + if (windowIsNew && aCalledFromJS && !hasChromeParent && !isCallerChrome && + parentWindow) { + nsIDocument::AsyncExitFullscreen(parentWindow->GetDoc()); + } + if (aForceNoOpener && windowIsNew) { NS_RELEASE(*aResult); } From aa637c405a88b2450c22b3dba2f6dda0a163b34e Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Thu, 19 Mar 2020 07:33:05 +0100 Subject: [PATCH 08/11] [devtools] Properly escape method arguments for curl. --- devtools/client/shared/curl.js | 38 ++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/devtools/client/shared/curl.js b/devtools/client/shared/curl.js index 9670197466..d9abf506aa 100644 --- a/devtools/client/shared/curl.js +++ b/devtools/client/shared/curl.js @@ -58,9 +58,21 @@ const Curl = { * A cURL command. */ generateCommand: function (data) { - let utils = CurlUtils; + const utils = CurlUtils; let command = ["curl"]; + + // Make sure to use the following helpers to sanitize arguments before execution. + const addParam = value => { + const safe = /^[a-zA-Z-]+$/.test(value) ? value : escapeString(value); + command.push(safe); + }; + + const addPostData = value => { + const safe = /^[a-zA-Z-]+$/.test(value) ? value : escapeString(value); + postData.push(safe); + }; + let ignoredHeaders = new Set(); // The cURL command is expected to run on the same platform that Firefox runs @@ -69,7 +81,7 @@ const Curl = { utils.escapeStringWin : utils.escapeStringPosix; // Add URL. - command.push(escapeString(data.url)); + addParam(data.url); let postDataText = null; let multipartRequest = utils.isMultipartRequest(data); @@ -79,15 +91,15 @@ const Curl = { if (utils.isUrlEncodedRequest(data) || ["PUT", "POST", "PATCH"].includes(data.method)) { postDataText = data.postDataText; - postData.push("--data"); - postData.push(escapeString(utils.writePostDataTextParams(postDataText))); + addPostData("--data"); + addPostData(utils.writePostDataTextParams(postDataText)); ignoredHeaders.add("content-length"); } else if (multipartRequest) { postDataText = data.postDataText; - postData.push("--data-binary"); + addPostData("--data-binary"); let boundary = utils.getMultipartBoundary(data); let text = utils.removeBinaryDataFromMultipartText(postDataText, boundary); - postData.push(escapeString(text)); + addPostData(text); ignoredHeaders.add("content-length"); } @@ -95,15 +107,15 @@ const Curl = { // For GET and POST requests this is not necessary as GET is the // default. If --data or --binary is added POST is the default. if (!(data.method == "GET" || data.method == "POST")) { - command.push("-X"); - command.push(data.method); + addParam("-X"); + addParam(data.method); } // Add -I (HEAD) // For servers that supports HEAD. // This will fetch the header of a document only. if (data.method == "HEAD") { - command.push("-I"); + addParam("-I"); } // Add http version. @@ -114,7 +126,7 @@ const Curl = { // data.httpVersion are HTTP/1.0, HTTP/1.1 and HTTP/2.0 // So in case of HTTP/2.0 (which should ideally be HTTP/2) we are using // only major version, and full version in other cases - command.push("--http" + (version == "2.0" ? version.split(".")[0] : version)); + addParam("--http" + (version == "2.0" ? version.split(".")[0] : version)); } // Add request headers. @@ -126,14 +138,14 @@ const Curl = { for (let i = 0; i < headers.length; i++) { let header = headers[i]; if (header.name.toLowerCase() === "accept-encoding") { - command.push("--compressed"); + addParam("--compressed"); continue; } if (ignoredHeaders.has(header.name.toLowerCase())) { continue; } - command.push("-H"); - command.push(escapeString(header.name + ": " + header.value)); + addParam("-H"); + addParam(header.name + ": " + header.value); } // Add post data. From 8da913b5eeb3a48fc993fd1cffad15dc884308ed Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Tue, 10 Mar 2020 08:56:20 -0500 Subject: [PATCH 09/11] [Pale-Moon] Issue MoonchildProductions/UXP#1469 - Copy dylibs to the application bundle instead of symlinks. --- application/palemoon/app/Makefile.in | 3 +++ .../app/macbuild/Contents/MacOS-files-copy.in | 11 +++++++++++ .../palemoon/app/macbuild/Contents/MacOS-files.in | 1 - 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 application/palemoon/app/macbuild/Contents/MacOS-files-copy.in diff --git a/application/palemoon/app/Makefile.in b/application/palemoon/app/Makefile.in index d008010ec8..34efe931e2 100644 --- a/application/palemoon/app/Makefile.in +++ b/application/palemoon/app/Makefile.in @@ -88,6 +88,9 @@ tools repackage:: $(PROGRAM) sed -e 's/%MAC_APP_NAME%/$(MAC_APP_NAME)/' $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | iconv -f UTF-8 -t UTF-16 > '$(dist_dest)/Contents/Resources/$(AB).lproj/InfoPlist.strings' rsync -a --exclude-from='$(srcdir)/macbuild/Contents/MacOS-files.in' $(DIST)/bin/ '$(dist_dest)/Contents/Resources' rsync -a --include-from='$(srcdir)/macbuild/Contents/MacOS-files.in' --exclude '*' $(DIST)/bin/ '$(dist_dest)/Contents/MacOS' + # MacOS-files-copy.in is a list of files that should be copies rather + # than symlinks and placed in .app/Contents/MacOS. + rsync -aL --include-from='$(srcdir)/macbuild/Contents/MacOS-files-copy.in' --exclude '*' $(DIST)/bin/ '$(dist_dest)/Contents/MacOS' $(RM) '$(dist_dest)/Contents/MacOS/$(PROGRAM)' rsync -aL $(PROGRAM) '$(dist_dest)/Contents/MacOS' cp -RL $(DIST)/branding/firefox.icns '$(dist_dest)/Contents/Resources/firefox.icns' diff --git a/application/palemoon/app/macbuild/Contents/MacOS-files-copy.in b/application/palemoon/app/macbuild/Contents/MacOS-files-copy.in new file mode 100644 index 0000000000..628fea3fab --- /dev/null +++ b/application/palemoon/app/macbuild/Contents/MacOS-files-copy.in @@ -0,0 +1,11 @@ +# Specifies files that should be copied (via deep copy, resolving symlinks) +# from dist/bin to the .app/Contents/MacOS directory. Linking is preferred to +# reduce disk I/O during builds, so just include dylibs which need to be in the +# same directory as returned by dladdr(3). +# +# Some of these dylibs load other dylibs which are assumed to be siblings in +# the same directory obtained from dladdr(3). With macOS 10.15, dladdr returns +# absolute resolved paths which breaks this assumption if symlinks are used +# because the symlink targets are in different directories. Hence the need for +# them to be copied to the same directory. +/*.dylib diff --git a/application/palemoon/app/macbuild/Contents/MacOS-files.in b/application/palemoon/app/macbuild/Contents/MacOS-files.in index 561366def2..6f52895020 100644 --- a/application/palemoon/app/macbuild/Contents/MacOS-files.in +++ b/application/palemoon/app/macbuild/Contents/MacOS-files.in @@ -1,5 +1,4 @@ /*.app/*** -/*.dylib /certutil /firefox-bin /gtest/*** From e0e1cf493fd90b310094d64bfa4b76f1c8f1eff3 Mon Sep 17 00:00:00 2001 From: JustOff Date: Wed, 11 Mar 2020 00:41:06 +0200 Subject: [PATCH 10/11] [Basilisk] Issue MoonchildProductions/UXP#1473 - Use `%OS_SLICE%` macro in SSUAO to refine OS info --- .../basilisk/branding/shared/uaoverrides.inc | 28 +++++++------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/application/basilisk/branding/shared/uaoverrides.inc b/application/basilisk/branding/shared/uaoverrides.inc index 2c4c43a37f..cfc803dae6 100644 --- a/application/basilisk/branding/shared/uaoverrides.inc +++ b/application/basilisk/branding/shared/uaoverrides.inc @@ -9,38 +9,30 @@ #define GK_SLICE Gecko/20100101 #define FX_SLICE Firefox/@GK_VERSION@ -#ifdef XP_UNIX -#ifndef XP_MACOSX -#define OS_SLICE X11; Linux x86_64; -#else -#define OS_SLICE Macintosh; Intel Mac OS X 10.11; -#endif -#else -#define OS_SLICE Windows NT 6.1; WOW64; -#endif +// %OS_SLICE% macro is resolved at runtime, see MoonchildProductions/UXP#1473 // Mozilla overrides -pref("@GUAO_PREF@.accounts.firefox.com", "Mozilla/5.0 (@OS_SLICE@ rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@"); -pref("@GUAO_PREF@.addons.mozilla.org", "Mozilla/5.0 (@OS_SLICE@ rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@"); +pref("@GUAO_PREF@.accounts.firefox.com", "Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@"); +pref("@GUAO_PREF@.addons.mozilla.org", "Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@"); // Required for domains that have proven unresponsive to requests from users -pref("@GUAO_PREF@.youtube.com","Mozilla/5.0 (@OS_SLICE@ rv:62.0) @GK_SLICE@ Firefox/62.0 @APP_SLICE@"); -pref("@GUAO_PREF@.gaming.youtube.com","Mozilla/5.0 (@OS_SLICE@ rv:62.0) @GK_SLICE@ Firefox/62.0"); -pref("@GUAO_PREF@.netflix.com","Mozilla/5.0 (@OS_SLICE@ rv:42.0) @GK_SLICE@ Firefox/42.0 @APP_SLICE@"); +pref("@GUAO_PREF@.youtube.com","Mozilla/5.0 (%OS_SLICE% rv:62.0) @GK_SLICE@ Firefox/62.0 @APP_SLICE@"); +pref("@GUAO_PREF@.gaming.youtube.com","Mozilla/5.0 (%OS_SLICE% rv:62.0) @GK_SLICE@ Firefox/62.0"); +pref("@GUAO_PREF@.netflix.com","Mozilla/5.0 (%OS_SLICE% rv:42.0) @GK_SLICE@ Firefox/42.0 @APP_SLICE@"); // The never-ending Facebook debacle... // UA-Sniffing domains below are pending responses from their operators - temp workaround // Daily motion only likes strict Firefox UAs -pref("@GUAO_PREF@.dailymotion.com","Mozilla/5.0 (@OS_SLICE@ rv:52.0) @GK_SLICE@ Firefox/52.0"); +pref("@GUAO_PREF@.dailymotion.com","Mozilla/5.0 (%OS_SLICE% rv:52.0) @GK_SLICE@ Firefox/52.0"); // The following requires native mode. Or it blocks.. "too old firefox", breakage, etc. // UA-Sniffing domains below have indicated no interest in supporting Pale Moon (BOO!) -pref("@GUAO_PREF@.whatsapp.com","Mozilla/5.0 (@OS_SLICE@ rv:68.0) @GK_SLICE@ Firefox/68.0"); +pref("@GUAO_PREF@.whatsapp.com","Mozilla/5.0 (%OS_SLICE% rv:68.0) @GK_SLICE@ Firefox/68.0"); // UA-sniffing domains that are "app/vendor-specific" and do not like Pale Moon // The following domains do not like the Goanna slice -pref("@GUAO_PREF@.hitbox.tv","Mozilla/5.0 (@OS_SLICE@ rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@"); -pref("@GUAO_PREF@.yuku.com","Mozilla/5.0 (@OS_SLICE@ rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@ @APP_SLICE@"); +pref("@GUAO_PREF@.hitbox.tv","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@"); +pref("@GUAO_PREF@.yuku.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@ @APP_SLICE@"); From b6b9b0e3fad41d10f70584d1c6961aa409588feb Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Tue, 10 Mar 2020 12:25:05 -0500 Subject: [PATCH 11/11] [Basilisk] Issue MoonchildProductions/UXP#1469 - Copy dylibs to the application bundle instead of symlinks. --- application/basilisk/app/Makefile.in | 3 +++ .../app/macbuild/Contents/MacOS-files-copy.in | 11 +++++++++++ .../basilisk/app/macbuild/Contents/MacOS-files.in | 1 - 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 application/basilisk/app/macbuild/Contents/MacOS-files-copy.in diff --git a/application/basilisk/app/Makefile.in b/application/basilisk/app/Makefile.in index b0c1570f6b..5f82f6930c 100644 --- a/application/basilisk/app/Makefile.in +++ b/application/basilisk/app/Makefile.in @@ -83,6 +83,9 @@ tools repackage:: $(DIST)/bin/$(MOZ_APP_NAME) sed -e 's/%MAC_APP_NAME%/$(MAC_APP_NAME)/' $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | iconv -f UTF-8 -t UTF-16 > '$(dist_dest)/$(LPROJ)/InfoPlist.strings' rsync -a --exclude-from='$(srcdir)/macbuild/Contents/MacOS-files.in' $(DIST)/bin/ '$(dist_dest)/Contents/Resources' rsync -a --include-from='$(srcdir)/macbuild/Contents/MacOS-files.in' --exclude '*' $(DIST)/bin/ '$(dist_dest)/Contents/MacOS' + # MacOS-files-copy.in is a list of files that should be copies rather + # than symlinks and placed in .app/Contents/MacOS. + rsync -aL --include-from='$(srcdir)/macbuild/Contents/MacOS-files-copy.in' --exclude '*' $(DIST)/bin/ '$(dist_dest)/Contents/MacOS' $(RM) '$(dist_dest)/Contents/MacOS/$(MOZ_APP_NAME)' rsync -aL $(DIST)/bin/$(MOZ_APP_NAME) '$(dist_dest)/Contents/MacOS' cp -RL $(DIST)/branding/firefox.icns '$(dist_dest)/Contents/Resources/firefox.icns' diff --git a/application/basilisk/app/macbuild/Contents/MacOS-files-copy.in b/application/basilisk/app/macbuild/Contents/MacOS-files-copy.in new file mode 100644 index 0000000000..628fea3fab --- /dev/null +++ b/application/basilisk/app/macbuild/Contents/MacOS-files-copy.in @@ -0,0 +1,11 @@ +# Specifies files that should be copied (via deep copy, resolving symlinks) +# from dist/bin to the .app/Contents/MacOS directory. Linking is preferred to +# reduce disk I/O during builds, so just include dylibs which need to be in the +# same directory as returned by dladdr(3). +# +# Some of these dylibs load other dylibs which are assumed to be siblings in +# the same directory obtained from dladdr(3). With macOS 10.15, dladdr returns +# absolute resolved paths which breaks this assumption if symlinks are used +# because the symlink targets are in different directories. Hence the need for +# them to be copied to the same directory. +/*.dylib diff --git a/application/basilisk/app/macbuild/Contents/MacOS-files.in b/application/basilisk/app/macbuild/Contents/MacOS-files.in index 849336bc9b..2dba8d69a2 100644 --- a/application/basilisk/app/macbuild/Contents/MacOS-files.in +++ b/application/basilisk/app/macbuild/Contents/MacOS-files.in @@ -1,5 +1,4 @@ /*.app/*** -/*.dylib /certutil /firefox-bin /gtest/***