Page MenuHomeFreeBSD

D22781.id65544.diff
No OneTemporary

D22781.id65544.diff

Index: Mk/bsd.gecko.mk
===================================================================
--- Mk/bsd.gecko.mk
+++ Mk/bsd.gecko.mk
@@ -372,6 +372,9 @@
-e 's|share/mozilla/extensions|lib/xpi|g' \
${MOZSRC}/xpcom/io/nsAppFileLocationProvider.cpp \
${MOZSRC}/toolkit/xre/nsXREDirProvider.cpp
+# Disable vendor checksums like lang/rust
+ @${REINPLACE_CMD} 's,"files":{[^}]*},"files":{},' \
+ ${MOZSRC}/third_party/rust/*/.cargo-checksum.json
post-install-script: gecko-create-plist
Index: www/firefox/Makefile
===================================================================
--- www/firefox/Makefile
+++ www/firefox/Makefile
@@ -2,26 +2,26 @@
# $FreeBSD$
PORTNAME= firefox
-DISTVERSION= 71.0
-PORTREVISION= 2
+DISTVERSION= 72.0b5
PORTEPOCH= 1
CATEGORIES= www
MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \
MOZILLA/${PORTNAME}/candidates/${DISTVERSION}-candidates/build5/source
-DISTFILES= ${DISTNAME}.source${EXTRACT_SUFX}
+DISTNAME= ${PORTNAME}-${PORTVERSION:R}
+DISTFILES= ${DISTNAME}${PORTVERSION:E}.source${EXTRACT_SUFX}
MAINTAINER= gecko@FreeBSD.org
COMMENT= Web browser based on the browser portion of Mozilla
-BUILD_DEPENDS= nspr>=4.23:devel/nspr \
- nss>=3.47.1:security/nss \
+BUILD_DEPENDS= nspr>=4.24:devel/nspr \
+ nss>=3.48:security/nss \
icu>=64.1,1:devel/icu \
libevent>=2.1.8:devel/libevent \
- harfbuzz>=2.6.2:print/harfbuzz \
+ harfbuzz>=2.6.4:print/harfbuzz \
graphite2>=1.3.13:graphics/graphite2 \
png>=1.6.35:graphics/png \
libvpx>=1.5.0:multimedia/libvpx \
- sqlite3>=3.29.0:databases/sqlite3 \
+ sqlite3>=3.30.1:databases/sqlite3 \
${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR} \
v4l_compat>0:multimedia/v4l_compat \
autoconf-2.13:devel/autoconf213 \
Index: www/firefox/distinfo
===================================================================
--- www/firefox/distinfo
+++ www/firefox/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1575289476
-SHA256 (firefox-71.0.source.tar.xz) = 78304cd58229e7103b56b34718aad051c9a4db30c266512a64f501ba58da7fbe
-SIZE (firefox-71.0.source.tar.xz) = 312341460
+TIMESTAMP = 1576052061
+SHA256 (firefox-72.0b5.source.tar.xz) = 0b3fe565ca5e8e74a2a86840ff1a629d5f41c96841db189515e8659a35fb41ce
+SIZE (firefox-72.0b5.source.tar.xz) = 314953148
Index: www/firefox/files/patch-bug1602358
===================================================================
--- www/firefox/files/patch-bug1602358
+++ /dev/null
@@ -1,45 +0,0 @@
-commit 9ca396abb28b
-Author: Emilio Cobos Álvarez <emilio@crisal.io>
-Date: Mon Dec 9 12:47:00 2019 +0000
-
- Bug 1602358 - Fix older builds with newer cbindgen. r=heycam
-
- This should be fine to uplift so that downstream doesn't need multiple cbindgen
- versions.
----
- layout/generic/WritingModes.h | 3 ++-
- servo/ports/geckolib/cbindgen.toml | 10 ----------
- 2 files changed, 2 insertions(+), 11 deletions(-)
-
-diff --git layout/generic/WritingModes.h layout/generic/WritingModes.h
-index 1a8d08b191bbb..0671388902f0f 100644
---- layout/generic/WritingModes.h
-+++ layout/generic/WritingModes.h
-@@ -518,7 +518,8 @@ class WritingMode {
- */
- void SetDirectionFromBidiLevel(uint8_t level) {
- if (IS_LEVEL_RTL(level) == IsBidiLTR()) {
-- mWritingMode ^= StyleWritingMode_RTL | StyleWritingMode_INLINE_REVERSED;
-+ mWritingMode.bits ^= static_cast<uint8_t>(
-+ (StyleWritingMode_RTL | StyleWritingMode_INLINE_REVERSED).bits);
- }
- }
-
-diff --git servo/ports/geckolib/cbindgen.toml servo/ports/geckolib/cbindgen.toml
-index bed86498ea125..8a7a9cd7998f1 100644
---- servo/ports/geckolib/cbindgen.toml
-+++ servo/ports/geckolib/cbindgen.toml
-@@ -616,13 +616,3 @@ renaming_overrides_prefixing = true
- // Get the layout rect, replacing auto right / bottom values for aAutoSize.
- inline nsRect ToLayoutRect(nscoord aAutoSize = NS_MAXSIZE) const;
- """
--
--"WritingMode" = """
-- StyleWritingMode operator^(const StyleWritingMode& other) const {
-- return {static_cast<decltype(bits)>(this->bits ^ other.bits)};
-- }
-- StyleWritingMode& operator^=(const StyleWritingMode& other) {
-- *this = (*this ^ other);
-- return *this;
-- }
--"""
Index: www/firefox/files/patch-revert-bug1584000
===================================================================
--- /dev/null
+++ www/firefox/files/patch-revert-bug1584000
@@ -0,0 +1,378 @@
+Revert bug 1584000 to keep usincg --with-system-graphite2
+
+diff --git gfx/graphite2/geckoextra/include/GraphiteExtra.h gfx/graphite2/geckoextra/include/GraphiteExtra.h
+deleted file mode 100644
+index 9352e709919c5..0000000000000
+--- gfx/graphite2/geckoextra/include/GraphiteExtra.h
++++ /dev/null
+@@ -1,42 +0,0 @@
+-// -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+-// vim: set ts=2 et sw=2 tw=80:
+-// This Source Code is subject to the terms of the Mozilla Public License
+-// version 2.0 (the "License"). You can obtain a copy of the License at
+-// http://mozilla.org/MPL/2.0/.
+-
+-#ifndef GraphiteExtra_h__
+-#define GraphiteExtra_h__
+-
+-#include <stdint.h>
+-
+-#ifdef __cplusplus
+-extern "C" {
+-#endif
+-
+-#include "graphite2/Segment.h"
+-
+-typedef struct {
+- uint32_t baseChar; // in UTF16 code units, not Unicode character indices
+- uint32_t baseGlyph;
+- uint32_t nChars; // UTF16 code units
+- uint32_t nGlyphs;
+-} gr_glyph_to_char_cluster;
+-
+-typedef struct {
+- gr_glyph_to_char_cluster* clusters;
+- uint16_t* gids;
+- float* xLocs;
+- float* yLocs;
+- uint32_t cIndex;
+-} gr_glyph_to_char_association;
+-
+-gr_glyph_to_char_association* gr_get_glyph_to_char_association(
+- gr_segment* aSegment, uint32_t aLength, const char16_t* aText);
+-
+-void gr_free_char_association(gr_glyph_to_char_association* aData);
+-
+-#ifdef __cplusplus
+-}
+-#endif
+-
+-#endif
+\ No newline at end of file
+diff --git gfx/graphite2/geckoextra/src/GraphiteExtra.cpp gfx/graphite2/geckoextra/src/GraphiteExtra.cpp
+deleted file mode 100644
+index b5c8802b151d3..0000000000000
+--- gfx/graphite2/geckoextra/src/GraphiteExtra.cpp
++++ /dev/null
+@@ -1,167 +0,0 @@
+-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
+-/* This Source Code Form is subject to the terms of the Mozilla Public
+- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+- * You can obtain one at http://mozilla.org/MPL/2.0/. */
+-
+-#include "graphite2/Font.h"
+-#include "graphite2/Segment.h"
+-#include "graphite2/GraphiteExtra.h"
+-
+-#include <stdlib.h>
+-#include <memory>
+-#include <limits>
+-
+-#define CHECK(cond, str) \
+- do { \
+- if (!(cond)) { \
+- return false; \
+- } \
+- } while (false)
+-
+-// High surrogates are in the range 0xD800 -- OxDBFF
+-#define NS_IS_HIGH_SURROGATE(u) ((uint32_t(u) & 0xFFFFFC00) == 0xD800)
+-// Low surrogates are in the range 0xDC00 -- 0xDFFF
+-#define NS_IS_LOW_SURROGATE(u) ((uint32_t(u) & 0xFFFFFC00) == 0xDC00)
+-
+-#define IS_POWER_OF_2(n) (n & (n - 1)) == 0
+-
+-typedef gr_glyph_to_char_cluster Cluster;
+-
+-// returns whether successful
+-static bool LoopThrough(gr_segment* aSegment, const uint32_t aLength,
+- const uint32_t aGlyphCount, const char16_t* aText,
+- uint32_t& aCIndex, Cluster* aClusters, uint16_t* aGids,
+- float* aXLocs, float* aYLocs) {
+- // walk through the glyph slots and check which original character
+- // each is associated with
+- uint32_t gIndex = 0; // glyph slot index
+- for (const gr_slot* slot = gr_seg_first_slot(aSegment); slot != nullptr;
+- slot = gr_slot_next_in_segment(slot), gIndex++) {
+- CHECK(gIndex < aGlyphCount, "iterating past glyphcount");
+- uint32_t before =
+- gr_cinfo_base(gr_seg_cinfo(aSegment, gr_slot_before(slot)));
+- uint32_t after = gr_cinfo_base(gr_seg_cinfo(aSegment, gr_slot_after(slot)));
+- aGids[gIndex] = gr_slot_gid(slot);
+- aXLocs[gIndex] = gr_slot_origin_X(slot);
+- aYLocs[gIndex] = gr_slot_origin_Y(slot);
+-
+- // if this glyph has a "before" character index that precedes the
+- // current cluster's char index, we need to merge preceding
+- // aClusters until it gets included
+- while (before < aClusters[aCIndex].baseChar && aCIndex > 0) {
+- aClusters[aCIndex - 1].nChars += aClusters[aCIndex].nChars;
+- aClusters[aCIndex - 1].nGlyphs += aClusters[aCIndex].nGlyphs;
+- --aCIndex;
+- }
+-
+- // if there's a gap between the current cluster's base character and
+- // this glyph's, extend the cluster to include the intervening chars
+- if (gr_slot_can_insert_before(slot) && aClusters[aCIndex].nChars &&
+- before >= aClusters[aCIndex].baseChar + aClusters[aCIndex].nChars) {
+- CHECK(aCIndex < aLength - 1, "aCIndex at end of word");
+- Cluster& c = aClusters[aCIndex + 1];
+- c.baseChar = aClusters[aCIndex].baseChar + aClusters[aCIndex].nChars;
+- c.nChars = before - c.baseChar;
+- c.baseGlyph = gIndex;
+- c.nGlyphs = 0;
+- ++aCIndex;
+- }
+-
+- // increment cluster's glyph count to include current slot
+- CHECK(aCIndex < aLength, "aCIndex beyond word length");
+- ++aClusters[aCIndex].nGlyphs;
+-
+- // bump |after| index if it falls in the middle of a surrogate pair
+- if (NS_IS_HIGH_SURROGATE(aText[after]) && after < aLength - 1 &&
+- NS_IS_LOW_SURROGATE(aText[after + 1])) {
+- after++;
+- }
+-
+- // extend cluster if necessary to reach the glyph's "after" index
+- if (aClusters[aCIndex].baseChar + aClusters[aCIndex].nChars < after + 1) {
+- aClusters[aCIndex].nChars = after + 1 - aClusters[aCIndex].baseChar;
+- }
+- }
+-
+- // Succeeded
+- return true;
+-}
+-
+-static gr_glyph_to_char_association* calloc_glyph_to_char_association(
+- uint32_t aGlyphCount, uint32_t aLength) {
+- using Type1 = gr_glyph_to_char_association;
+- using Type2 = gr_glyph_to_char_cluster;
+- using Type3 = float;
+- using Type4 = float;
+- using Type5 = uint16_t;
+-
+- // We are allocating memory in a pool. To avoid dealing with thorny alignment
+- // issues, we allocate from most to least aligned
+- static_assert(
+- alignof(Type1) >= alignof(Type2) && alignof(Type2) >= alignof(Type3) &&
+- alignof(Type3) >= alignof(Type4) && alignof(Type4) >= alignof(Type5),
+- "Unexpected alignments of types");
+-
+- const uint64_t size1 = sizeof(Type1) * static_cast<uint64_t>(1);
+- const uint64_t size2 = sizeof(Type2) * static_cast<uint64_t>(aLength);
+- const uint64_t size3 = sizeof(Type3) * static_cast<uint64_t>(aGlyphCount);
+- const uint64_t size4 = sizeof(Type4) * static_cast<uint64_t>(aGlyphCount);
+- const uint64_t size5 = sizeof(Type5) * static_cast<uint64_t>(aGlyphCount);
+-
+- uint64_t totalSize = size1 + size2 + size3 + size4 + size5;
+-
+- if (totalSize > std::numeric_limits<uint32_t>::max()) {
+- // allocation request got too large
+- return nullptr;
+- }
+-
+- char* const memoryPool = static_cast<char*>(calloc(1, totalSize));
+- if (!memoryPool) {
+- return nullptr;
+- }
+-
+- char* currentPoolFront = memoryPool;
+-
+- auto data = reinterpret_cast<Type1*>(currentPoolFront);
+- currentPoolFront += size1;
+- data->clusters = reinterpret_cast<Type2*>(currentPoolFront);
+- currentPoolFront += size2;
+- data->xLocs = reinterpret_cast<Type3*>(currentPoolFront);
+- currentPoolFront += size3;
+- data->yLocs = reinterpret_cast<Type4*>(currentPoolFront);
+- currentPoolFront += size4;
+- data->gids = reinterpret_cast<Type5*>(currentPoolFront);
+-
+- return data;
+-}
+-
+-// returns nullptr on failure and the glyph to char association on success
+-gr_glyph_to_char_association* gr_get_glyph_to_char_association(
+- gr_segment* aSegment, uint32_t aLength, const char16_t* aText) {
+- uint32_t glyphCount = gr_seg_n_slots(aSegment);
+-
+- gr_glyph_to_char_association* data =
+- calloc_glyph_to_char_association(glyphCount, aLength);
+- if (!data) {
+- return nullptr;
+- }
+-
+- bool succeeded =
+- LoopThrough(aSegment, aLength, glyphCount, aText, data->cIndex,
+- data->clusters, data->gids, data->xLocs, data->yLocs);
+- if (!succeeded) {
+- gr_free_char_association(data);
+- return nullptr;
+- }
+- return data;
+-}
+-
+-void gr_free_char_association(gr_glyph_to_char_association* aData) {
+- free(aData);
+-}
+-
+-#undef CHECK
+-#undef NS_IS_HIGH_SURROGATE
+-#undef NS_IS_LOW_SURROGATE
+-#undef IS_POWER_OF_2
+diff --git gfx/graphite2/src/moz.build gfx/graphite2/src/moz.build
+index a6167943e43cb..4d1e6bbd3b63e 100755
+--- gfx/graphite2/src/moz.build
++++ gfx/graphite2/src/moz.build
+@@ -6,7 +6,6 @@
+
+ # This should contain all of the _PUBLIC_HEADERS from files.mk
+ EXPORTS.graphite2 += [
+- '../geckoextra/include/GraphiteExtra.h',
+ '../include/graphite2/Font.h',
+ '../include/graphite2/Log.h',
+ '../include/graphite2/Segment.h',
+@@ -24,7 +23,6 @@ else:
+
+ # This should contain all of the _SOURCES from files.mk, except *_machine.cpp
+ UNIFIED_SOURCES += [
+- '../geckoextra/src/GraphiteExtra.cpp',
+ 'CmapCache.cpp',
+ 'Code.cpp',
+ 'Collider.cpp',
+diff --git gfx/thebes/gfxGraphiteShaper.cpp gfx/thebes/gfxGraphiteShaper.cpp
+index f00671162f1af..8e53058c46b01 100644
+--- gfx/thebes/gfxGraphiteShaper.cpp
++++ gfx/thebes/gfxGraphiteShaper.cpp
+@@ -10,7 +10,6 @@
+ #include "gfxTextRun.h"
+
+ #include "graphite2/Font.h"
+-#include "graphite2/GraphiteExtra.h"
+ #include "graphite2/Segment.h"
+
+ #include "harfbuzz/hb.h"
+@@ -192,6 +191,18 @@ bool gfxGraphiteShaper::ShapeText(DrawTarget* aDrawTarget,
+ return NS_SUCCEEDED(rv);
+ }
+
++#define SMALL_GLYPH_RUN \
++ 256 // avoid heap allocation of per-glyph data arrays
++ // for short (typical) runs up to this length
++
++struct Cluster {
++ uint32_t baseChar; // in UTF16 code units, not Unicode character indices
++ uint32_t baseGlyph;
++ uint32_t nChars; // UTF16 code units
++ uint32_t nGlyphs;
++ Cluster() : baseChar(0), baseGlyph(0), nChars(0), nGlyphs(0) {}
++};
++
+ nsresult gfxGraphiteShaper::SetGlyphsFromSegment(
+ gfxShapedText* aShapedText, uint32_t aOffset, uint32_t aLength,
+ const char16_t* aText, gr_segment* aSegment, RoundingFlags aRounding) {
+@@ -200,19 +211,70 @@ nsresult gfxGraphiteShaper::SetGlyphsFromSegment(
+ int32_t dev2appUnits = aShapedText->GetAppUnitsPerDevUnit();
+ bool rtl = aShapedText->IsRightToLeft();
+
+- // identify clusters; graphite may have reordered/expanded/ligated glyphs.
+- gr_glyph_to_char_association* data =
+- gr_get_glyph_to_char_association(aSegment, aLength, aText);
++ uint32_t glyphCount = gr_seg_n_slots(aSegment);
+
+- if (!data) {
+- return NS_ERROR_FAILURE;
++ // identify clusters; graphite may have reordered/expanded/ligated glyphs.
++ AutoTArray<Cluster, SMALL_GLYPH_RUN> clusters;
++ AutoTArray<uint16_t, SMALL_GLYPH_RUN> gids;
++ AutoTArray<float, SMALL_GLYPH_RUN> xLocs;
++ AutoTArray<float, SMALL_GLYPH_RUN> yLocs;
++
++ if (!clusters.SetLength(aLength, fallible) ||
++ !gids.SetLength(glyphCount, fallible) ||
++ !xLocs.SetLength(glyphCount, fallible) ||
++ !yLocs.SetLength(glyphCount, fallible)) {
++ return NS_ERROR_OUT_OF_MEMORY;
+ }
+
+- uint32_t cIndex = data->cIndex;
+- gr_glyph_to_char_cluster* clusters = data->clusters;
+- uint16_t* gids = data->gids;
+- float* xLocs = data->xLocs;
+- float* yLocs = data->yLocs;
++ // walk through the glyph slots and check which original character
++ // each is associated with
++ uint32_t gIndex = 0; // glyph slot index
++ uint32_t cIndex = 0; // current cluster index
++ for (const gr_slot* slot = gr_seg_first_slot(aSegment); slot != nullptr;
++ slot = gr_slot_next_in_segment(slot), gIndex++) {
++ uint32_t before =
++ gr_cinfo_base(gr_seg_cinfo(aSegment, gr_slot_before(slot)));
++ uint32_t after = gr_cinfo_base(gr_seg_cinfo(aSegment, gr_slot_after(slot)));
++ gids[gIndex] = gr_slot_gid(slot);
++ xLocs[gIndex] = gr_slot_origin_X(slot);
++ yLocs[gIndex] = gr_slot_origin_Y(slot);
++
++ // if this glyph has a "before" character index that precedes the
++ // current cluster's char index, we need to merge preceding
++ // clusters until it gets included
++ while (before < clusters[cIndex].baseChar && cIndex > 0) {
++ clusters[cIndex - 1].nChars += clusters[cIndex].nChars;
++ clusters[cIndex - 1].nGlyphs += clusters[cIndex].nGlyphs;
++ --cIndex;
++ }
++
++ // if there's a gap between the current cluster's base character and
++ // this glyph's, extend the cluster to include the intervening chars
++ if (gr_slot_can_insert_before(slot) && clusters[cIndex].nChars &&
++ before >= clusters[cIndex].baseChar + clusters[cIndex].nChars) {
++ NS_ASSERTION(cIndex < aLength - 1, "cIndex at end of word");
++ Cluster& c = clusters[cIndex + 1];
++ c.baseChar = clusters[cIndex].baseChar + clusters[cIndex].nChars;
++ c.nChars = before - c.baseChar;
++ c.baseGlyph = gIndex;
++ c.nGlyphs = 0;
++ ++cIndex;
++ }
++
++ // increment cluster's glyph count to include current slot
++ NS_ASSERTION(cIndex < aLength, "cIndex beyond word length");
++ ++clusters[cIndex].nGlyphs;
++
++ // bump |after| index if it falls in the middle of a surrogate pair
++ if (NS_IS_HIGH_SURROGATE(aText[after]) && after < aLength - 1 &&
++ NS_IS_LOW_SURROGATE(aText[after + 1])) {
++ after++;
++ }
++ // extend cluster if necessary to reach the glyph's "after" index
++ if (clusters[cIndex].baseChar + clusters[cIndex].nChars < after + 1) {
++ clusters[cIndex].nChars = after + 1 - clusters[cIndex].baseChar;
++ }
++ }
+
+ CompressedGlyph* charGlyphs = aShapedText->GetCharacterGlyphs() + aOffset;
+
+@@ -221,7 +283,7 @@ nsresult gfxGraphiteShaper::SetGlyphsFromSegment(
+
+ // now put glyphs into the textrun, one cluster at a time
+ for (uint32_t i = 0; i <= cIndex; ++i) {
+- const gr_glyph_to_char_cluster& c = clusters[i];
++ const Cluster& c = clusters[i];
+
+ float adv; // total advance of the cluster
+ if (rtl) {
+@@ -288,10 +350,11 @@ nsresult gfxGraphiteShaper::SetGlyphsFromSegment(
+ }
+ }
+
+- gr_free_char_association(data);
+ return NS_OK;
+ }
+
++#undef SMALL_GLYPH_RUN
++
+ // for language tag validation - include list of tags from the IANA registry
+ #include "gfxLanguageTagList.cpp"
+

File Metadata

Mime Type
text/plain
Expires
Wed, May 20, 8:38 PM (4 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33355982
Default Alt Text
D22781.id65544.diff (18 KB)

Event Timeline