Browse Source

webkitgtk4 package update

Signed-off-by: guibuilder_pel7x64builder0 <guibuilder@powerel.org>
master
guibuilder_pel7x64builder0 6 years ago
parent
commit
3b3d22fa5f
  1. 44
      SOURCES/icu-7601.Indic-ccmp.patch
  2. 129
      SOURCES/icu-8198.revert.icu5431.patch
  3. 14
      SOURCES/icu-8800.freeserif.crash.patch
  4. 96
      SOURCES/icu-armv7hl-disable-tests.patch
  5. 156
      SOURCES/icu-diff-icu_trunk_source_common_locid.cpp-from-39282-to-39384.patch
  6. 16
      SOURCES/icu-dont_use_clang_even_if_installed.patch
  7. 128
      SOURCES/icu-gennorm2-man.patch
  8. 145
      SOURCES/icu-icuinfo-man.patch
  9. 244
      SOURCES/icu-rhbz1360340-icu-changeset-39109.patch
  10. 156
      SOURCES/icu-rhbz1444101-icu-changeset-39671.patch
  11. 15
      SOURCES/webkit-atk_continuation_crash.patch
  12. 24
      SOURCES/webkit-atk_crash.patch
  13. 30
      SOURCES/webkit-cloop_big_endians.patch
  14. 13
      SOURCES/webkit-covscan_1.patch
  15. 20
      SOURCES/webkit-covscan_2.patch
  16. 13
      SOURCES/webkit-covscan_3.patch
  17. 24
      SOURCES/webkit-covscan_already_fixed.patch
  18. 41
      SOURCES/webkit-covscan_bmalloc.patch
  19. 39
      SOURCES/webkit-covscan_gstreamer.patch
  20. 21
      SOURCES/webkit-covscan_uninit.patch
  21. 505
      SOURCES/webkit-covscan_uninit_ctor.patch
  22. 44
      SOURCES/webkit-covscan_va_close.patch
  23. 39
      SOURCES/webkit-covscan_wtf.patch
  24. 35
      SOURCES/webkit-library_typos.patch
  25. 12
      SOURCES/webkit-lower_libgcrypt_version.patch
  26. 15
      SOURCES/webkit-memset_zero_length.patch
  27. 197
      SOURCES/webkit-minibrowser-labels.patch
  28. 513
      SOURCES/webkit-no_webp_demux.patch
  29. 17
      SOURCES/webkit-page_size.patch
  30. 12853
      SOURCES/webkit-remove_brotli.patch
  31. 5289
      SOURCES/webkit-remove_woff2.patch
  32. 111
      SOURCES/webkit-woff2_1.0.2.patch
  33. 618
      SPECS/webkitgtk4.spec

44
SOURCES/icu-7601.Indic-ccmp.patch

@ -0,0 +1,44 @@ @@ -0,0 +1,44 @@
diff -ru orig.icu/source/layout/IndicReordering.cpp icu/source/layout/IndicReordering.cpp
--- orig.icu/source/layout/IndicReordering.cpp 2016-04-15 18:30:15.788856946 +0200
+++ icu/source/layout/IndicReordering.cpp 2016-04-15 18:30:39.244998995 +0200
@@ -13,6 +13,7 @@
U_NAMESPACE_BEGIN
+#define ccmpFeatureTag LE_CCMP_FEATURE_TAG
#define loclFeatureTag LE_LOCL_FEATURE_TAG
#define initFeatureTag LE_INIT_FEATURE_TAG
#define nuktFeatureTag LE_NUKT_FEATURE_TAG
@@ -35,6 +36,7 @@
#define caltFeatureTag LE_CALT_FEATURE_TAG
#define kernFeatureTag LE_KERN_FEATURE_TAG
+#define ccmpFeatureMask 0x00000001UL
#define loclFeatureMask 0x80000000UL
#define rphfFeatureMask 0x40000000UL
#define blwfFeatureMask 0x20000000UL
@@ -73,7 +75,7 @@
#define repositionedGlyphMask 0x00000002UL
-#define basicShapingFormsMask ( loclFeatureMask | nuktFeatureMask | akhnFeatureMask | rkrfFeatureMask | blwfFeatureMask | halfFeatureMask | vatuFeatureMask | cjctFeatureMask )
+#define basicShapingFormsMask ( ccmpFeatureMask | loclFeatureMask | nuktFeatureMask | akhnFeatureMask | rkrfFeatureMask | blwfFeatureMask | halfFeatureMask | vatuFeatureMask | cjctFeatureMask )
#define positioningFormsMask ( kernFeatureMask | distFeatureMask | abvmFeatureMask | blwmFeatureMask )
#define presentationFormsMask ( presFeatureMask | abvsFeatureMask | blwsFeatureMask | pstsFeatureMask | halnFeatureMask | caltFeatureMask )
@@ -484,6 +486,7 @@
#define tagArray0 (rphfFeatureMask | tagArray1)
static const FeatureMap featureMap[] = {
+ {ccmpFeatureTag, ccmpFeatureMask},
{loclFeatureTag, loclFeatureMask},
{initFeatureTag, initFeatureMask},
{nuktFeatureTag, nuktFeatureMask},
@@ -506,6 +509,7 @@
static const le_int32 featureCount = LE_ARRAY_SIZE(featureMap);
static const FeatureMap v2FeatureMap[] = {
+ {ccmpFeatureTag, ccmpFeatureMask},
{loclFeatureTag, loclFeatureMask},
{nuktFeatureTag, nuktFeatureMask},
{akhnFeatureTag, akhnFeatureMask},

129
SOURCES/icu-8198.revert.icu5431.patch

@ -0,0 +1,129 @@ @@ -0,0 +1,129 @@
Index: icu/trunk/source/layout/IndicReordering.cpp
===================================================================
--- icu/trunk/source/layout/IndicReordering.cpp (revision 25772)
+++ icu/trunk/source/layout/IndicReordering.cpp (revision 26090)
@@ -126,4 +126,8 @@
FeatureMask fSMFeatures;
+ LEUnicode fPreBaseConsonant;
+ LEUnicode fPreBaseVirama;
+ le_int32 fPBCIndex;
+ FeatureMask fPBCFeatures;
void saveMatra(LEUnicode matra, le_int32 matraIndex, IndicClassTable::CharClass matraClass)
@@ -172,5 +176,6 @@
fMatraFeatures(0), fMPreOutIndex(-1), fMPreFixups(mpreFixups),
fVMabove(0), fVMpost(0), fVMIndex(0), fVMFeatures(0),
- fSMabove(0), fSMbelow(0), fSMIndex(0), fSMFeatures(0)
+ fSMabove(0), fSMbelow(0), fSMIndex(0), fSMFeatures(0),
+ fPreBaseConsonant(0), fPreBaseVirama(0), fPBCIndex(0), fPBCFeatures(0)
{
// nothing else to do...
@@ -191,4 +196,6 @@
fVMabove = fVMpost = 0;
fSMabove = fSMbelow = 0;
+
+ fPreBaseConsonant = fPreBaseVirama = 0;
}
@@ -386,4 +393,12 @@
}
+ void notePreBaseConsonant(le_uint32 index,LEUnicode PBConsonant, LEUnicode PBVirama, FeatureMask features)
+ {
+ fPBCIndex = index;
+ fPreBaseConsonant = PBConsonant;
+ fPreBaseVirama = PBVirama;
+ fPBCFeatures = features;
+ }
+
void noteBaseConsonant()
{
@@ -465,4 +480,20 @@
}
+ void writePreBaseConsonant()
+ {
+ // The TDIL spec says that consonant + virama + RRA should produce a rakar in Malayalam. However,
+ // it seems that almost none of the fonts for Malayalam are set up to handle this.
+ // So, we're going to force the issue here by using the rakar as defined with RA in most fonts.
+
+ if (fPreBaseConsonant == 0x0d31) { // RRA
+ fPreBaseConsonant = 0x0d30; // RA
+ }
+
+ if (fPreBaseConsonant != 0) {
+ writeChar(fPreBaseConsonant, fPBCIndex, fPBCFeatures);
+ writeChar(fPreBaseVirama,fPBCIndex-1,fPBCFeatures);
+ }
+ }
+
le_int32 getOutputIndex()
{
@@ -723,4 +754,5 @@
}
+
IndicClassTable::CharClass charClass = CC_RESERVED;
IndicClassTable::CharClass nextClass = CC_RESERVED;
@@ -730,7 +762,9 @@
le_bool seenVattu = FALSE;
le_bool seenBelowBaseForm = FALSE;
+ le_bool seenPreBaseForm = FALSE;
le_bool hasNukta = FALSE;
le_bool hasBelowBaseForm = FALSE;
le_bool hasPostBaseForm = FALSE;
+ le_bool hasPreBaseForm = FALSE;
if (postBase < markStart && classTable->isNukta(chars[postBase])) {
@@ -746,12 +780,20 @@
hasBelowBaseForm = IndicClassTable::hasBelowBaseForm(charClass) && !hasNukta;
hasPostBaseForm = IndicClassTable::hasPostBaseForm(charClass) && !hasNukta;
+ hasPreBaseForm = IndicClassTable::hasPreBaseForm(charClass) && !hasNukta;
if (IndicClassTable::isConsonant(charClass)) {
if (postBaseLimit == 0 || seenVattu ||
(baseConsonant > baseLimit && !classTable->isVirama(chars[baseConsonant - 1])) ||
- !(hasBelowBaseForm || hasPostBaseForm)) {
+ !(hasBelowBaseForm || hasPostBaseForm || hasPreBaseForm)) {
break;
}
+ // Note any pre-base consonants
+ if ( baseConsonant == lastConsonant && lastConsonant > 0 &&
+ hasPreBaseForm && classTable->isVirama(chars[baseConsonant - 1])) {
+ output.notePreBaseConsonant(lastConsonant,chars[lastConsonant],chars[lastConsonant-1],tagArray2);
+ seenPreBaseForm = TRUE;
+
+ }
// consonants with nuktas are never vattus
seenVattu = IndicClassTable::isVattu(charClass) && !hasNukta;
@@ -786,10 +828,12 @@
// write any pre-base consonants
+ output.writePreBaseConsonant();
+
le_bool supressVattu = TRUE;
for (i = baseLimit; i < baseConsonant; i += 1) {
LEUnicode ch = chars[i];
- // Don't put 'blwf' on first consonant.
- FeatureMask features = (i == baseLimit? tagArray2 : tagArray1);
+ // Don't put 'pstf' or 'blwf' on anything before the base consonant.
+ FeatureMask features = tagArray1 & ~( pstfFeatureMask | blwfFeatureMask );
charClass = classTable->getCharClass(ch);
@@ -842,5 +886,5 @@
// write below-base consonants
- if (baseConsonant != lastConsonant) {
+ if (baseConsonant != lastConsonant && !seenPreBaseForm) {
for (i = bcSpan + 1; i < postBase; i += 1) {
output.writeChar(chars[i], i, tagArray1);
@@ -872,5 +916,5 @@
// write post-base consonants
// FIXME: does this put the right tags on post-base consonants?
- if (baseConsonant != lastConsonant) {
+ if (baseConsonant != lastConsonant && !seenPreBaseForm) {
if (postBase <= lastConsonant) {
for (i = postBase; i <= lastConsonant; i += 1) {

14
SOURCES/icu-8800.freeserif.crash.patch

@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
diff -ru orig.icu/source/layout/LookupProcessor.cpp icu/source/layout/LookupProcessor.cpp
--- orig.icu/source/layout/LookupProcessor.cpp 2016-03-23 21:56:44.000000000 +0100
+++ icu/source/layout/LookupProcessor.cpp 2016-04-15 18:19:26.903927005 +0200
@@ -223,7 +223,9 @@
if (requiredFeatureIndex != 0xFFFF) {
requiredFeatureTable = featureListTable->getFeatureTable(featureListTable, requiredFeatureIndex, &requiredFeatureTag, success);
- featureReferences += SWAPW(requiredFeatureTable->lookupCount);
+ if (requiredFeatureTable.isValid()) {
+ featureReferences += SWAPW(requiredFeatureTable->lookupCount);
+ }
}
lookupOrderArray = LE_NEW_ARRAY(le_uint16, featureReferences);

96
SOURCES/icu-armv7hl-disable-tests.patch

@ -0,0 +1,96 @@ @@ -0,0 +1,96 @@
diff -ru orig.icu/source/test/cintltst/cnmdptst.c icu/source/test/cintltst/cnmdptst.c
--- orig.icu/source/test/cintltst/cnmdptst.c 2016-03-23 21:48:18.000000000 +0100
+++ icu/source/test/cintltst/cnmdptst.c 2016-04-15 18:34:06.148251985 +0200
@@ -186,6 +186,12 @@
/* Test exponential pattern*/
static void TestExponential(void)
{
+/* erAck: fails on armv7hl, https://bugzilla.redhat.com/show_bug.cgi?id=1239574 */
+#if 1
+ /* Actually only 3 tests fail, but given the nested structure depending on
+ * array sizes there's no simple "disable this and that". */
+ return;
+#endif
int32_t pat_length, val_length, lval_length;
int32_t ival, ilval, p, v, lneed;
UNumberFormat *fmt;
diff -ru orig.icu/source/test/intltest/dcfmtest.cpp icu/source/test/intltest/dcfmtest.cpp
--- orig.icu/source/test/intltest/dcfmtest.cpp 2016-03-23 21:48:38.000000000 +0100
+++ icu/source/test/intltest/dcfmtest.cpp 2016-04-15 18:34:06.148251985 +0200
@@ -279,6 +279,13 @@
//
formatLineMat.reset(testLine);
if (formatLineMat.lookingAt(status)) {
+/* erAck: fails on armv7hl, https://bugzilla.redhat.com/show_bug.cgi?id=1239574 */
+#if 1
+// [Formattable] file dcfmtest.txt, line 62: expected "12.35E5", got "1.235E6"
+// [StringPiece] file dcfmtest.txt, line 62: expected "12.35E5", got "1.235E6"
+ if (lineNum == 62)
+ continue;
+#endif
execFormatTest(lineNum,
formatLineMat.group(1, status), // Pattern
formatLineMat.group(2, status), // rounding mode
diff -ru orig.icu/source/test/intltest/numfmtspectest.cpp icu/source/test/intltest/numfmtspectest.cpp
--- orig.icu/source/test/intltest/numfmtspectest.cpp 2016-03-23 21:48:40.000000000 +0100
+++ icu/source/test/intltest/numfmtspectest.cpp 2016-04-15 18:34:06.148251985 +0200
@@ -137,11 +137,14 @@
void NumberFormatSpecificationTest::TestScientificNotation() {
assertPatternFr("1,23E4", 12345.0, "0.00E0", TRUE);
+/* erAck: fails on armv7hl, https://bugzilla.redhat.com/show_bug.cgi?id=1239574 */
+#if 0
assertPatternFr("123,00E2", 12300.0, "000.00E0", TRUE);
assertPatternFr("123,0E2", 12300.0, "000.0#E0", TRUE);
assertPatternFr("123,0E2", 12300.1, "000.0#E0", TRUE);
assertPatternFr("123,01E2", 12301.0, "000.0#E0", TRUE);
assertPatternFr("123,01E+02", 12301.0, "000.0#E+00", TRUE);
+#endif
assertPatternFr("12,3E3", 12345.0, "##0.00E0", TRUE);
assertPatternFr("12,300E3", 12300.1, "##0.0000E0", TRUE);
assertPatternFr("12,30E3", 12300.1, "##0.000#E0", TRUE);
@@ -221,6 +224,8 @@
assertEquals("", "USD (433.22)", result, TRUE);
}
}
+/* erAck: fails on armv7hl, https://bugzilla.redhat.com/show_bug.cgi?id=1239574 */
+#if 0
const char *paddedSciPattern = "QU**00.#####E0";
assertPatternFr("QU***43,3E-1", 4.33, paddedSciPattern, TRUE);
{
@@ -242,6 +247,7 @@
}
// padding cannot work as intended with scientific notation.
assertPatternFr("QU**43,32E-1", 4.332, paddedSciPattern, TRUE);
+#endif
}
void NumberFormatSpecificationTest::assertPatternFr(
diff -ru orig.icu/source/test/intltest/numfmtst.cpp icu/source/test/intltest/numfmtst.cpp
--- orig.icu/source/test/intltest/numfmtst.cpp 2016-03-23 21:48:40.000000000 +0100
+++ icu/source/test/intltest/numfmtst.cpp 2016-04-15 18:34:06.150251997 +0200
@@ -730,6 +730,12 @@
void
NumberFormatTest::TestExponential(void)
{
+/* erAck: fails on armv7hl, https://bugzilla.redhat.com/show_bug.cgi?id=1239574 */
+#if 1
+ /* Actually only 3 tests fail, but given the nested structure depending on
+ * array sizes there's no simple "disable this and that". */
+ return;
+#endif
UErrorCode status = U_ZERO_ERROR;
DecimalFormatSymbols sym(Locale::getUS(), status);
if (U_FAILURE(status)) { errcheckln(status, "FAIL: Bad status returned by DecimalFormatSymbols ct - %s", u_errorName(status)); return; }
@@ -1846,8 +1852,11 @@
(int32_t) 45678000, "5E7", status);
expect(new DecimalFormat("00E0", US, status),
(int32_t) 45678000, "46E6", status);
+/* erAck: fails on armv7hl, https://bugzilla.redhat.com/show_bug.cgi?id=1239574 */
+#if 0
expect(new DecimalFormat("000E0", US, status),
(int32_t) 45678000, "457E5", status);
+#endif
/*
expect(new DecimalFormat("###E0", US, status),
new Object[] { new Double(0.0000123), "12.3E-6",

156
SOURCES/icu-diff-icu_trunk_source_common_locid.cpp-from-39282-to-39384.patch

@ -0,0 +1,156 @@ @@ -0,0 +1,156 @@
Index: icu/trunk/source/common/locid.cpp
===================================================================
--- icu/source/common/locid.cpp (revision 39282)
+++ icu/source/common/locid.cpp (revision 39384)
@@ -45,4 +45,5 @@
#include "ucln_cmn.h"
#include "ustr_imp.h"
+#include "charstr.h"
U_CDECL_BEGIN
@@ -59,4 +60,10 @@
static UHashtable *gDefaultLocalesHashT = NULL;
static Locale *gDefaultLocale = NULL;
+
+/**
+ * \def ULOC_STRING_LIMIT
+ * strings beyond this value crash in CharString
+ */
+#define ULOC_STRING_LIMIT 357913941
U_NAMESPACE_END
@@ -286,5 +293,5 @@
else
{
- MaybeStackArray<char, ULOC_FULLNAME_CAPACITY> togo;
+ UErrorCode status = U_ZERO_ERROR;
int32_t size = 0;
int32_t lsize = 0;
@@ -292,5 +299,4 @@
int32_t vsize = 0;
int32_t ksize = 0;
- char *p;
// Calculate the size of the resulting string.
@@ -300,6 +306,12 @@
{
lsize = (int32_t)uprv_strlen(newLanguage);
+ if ( lsize < 0 || lsize > ULOC_STRING_LIMIT ) { // int32 wrap
+ setToBogus();
+ return;
+ }
size = lsize;
}
+
+ CharString togo(newLanguage, lsize, status); // start with newLanguage
// _Country
@@ -307,4 +319,8 @@
{
csize = (int32_t)uprv_strlen(newCountry);
+ if ( csize < 0 || csize > ULOC_STRING_LIMIT ) { // int32 wrap
+ setToBogus();
+ return;
+ }
size += csize;
}
@@ -321,4 +337,8 @@
// remove trailing _'s
vsize = (int32_t)uprv_strlen(newVariant);
+ if ( vsize < 0 || vsize > ULOC_STRING_LIMIT ) { // int32 wrap
+ setToBogus();
+ return;
+ }
while( (vsize>1) && (newVariant[vsize-1] == SEP_CHAR) )
{
@@ -345,48 +365,30 @@
{
ksize = (int32_t)uprv_strlen(newKeywords);
+ if ( ksize < 0 || ksize > ULOC_STRING_LIMIT ) {
+ setToBogus();
+ return;
+ }
size += ksize + 1;
}
-
// NOW we have the full locale string..
-
- /*if the whole string is longer than our internal limit, we need
- to go to the heap for temporary buffers*/
- if (size >= togo.getCapacity())
- {
- // If togo_heap could not be created, initialize with default settings.
- if (togo.resize(size+1) == NULL) {
- init(NULL, FALSE);
- }
- }
-
- togo[0] = 0;
-
// Now, copy it back.
- p = togo.getAlias();
- if ( lsize != 0 )
- {
- uprv_strcpy(p, newLanguage);
- p += lsize;
- }
+
+ // newLanguage is already copied
if ( ( vsize != 0 ) || (csize != 0) ) // at least: __v
{ // ^
- *p++ = SEP_CHAR;
+ togo.append(SEP_CHAR, status);
}
if ( csize != 0 )
{
- uprv_strcpy(p, newCountry);
- p += csize;
+ togo.append(newCountry, status);
}
if ( vsize != 0)
{
- *p++ = SEP_CHAR; // at least: __v
-
- uprv_strncpy(p, newVariant, vsize); // Must use strncpy because
- p += vsize; // of trimming (above).
- *p = 0; // terminate
+ togo.append(SEP_CHAR, status)
+ .append(newVariant, vsize, status);
}
@@ -394,19 +396,23 @@
{
if (uprv_strchr(newKeywords, '=')) {
- *p++ = '@'; /* keyword parsing */
+ togo.append('@', status); /* keyword parsing */
}
else {
- *p++ = '_'; /* Variant parsing with a script */
+ togo.append('_', status); /* Variant parsing with a script */
if ( vsize == 0) {
- *p++ = '_'; /* No country found */
+ togo.append('_', status); /* No country found */
}
}
- uprv_strcpy(p, newKeywords);
- p += ksize;
- }
-
+ togo.append(newKeywords, status);
+ }
+
+ if (U_FAILURE(status)) {
+ // Something went wrong with appending, etc.
+ setToBogus();
+ return;
+ }
// Parse it, because for example 'language' might really be a complete
// string.
- init(togo.getAlias(), FALSE);
+ init(togo.data(), FALSE);
}
}

16
SOURCES/icu-dont_use_clang_even_if_installed.patch

@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
diff -up icu/source/configure.ac.dont_use_clang_even_if_installed icu/source/configure.ac
--- icu/source/configure.ac.dont_use_clang_even_if_installed 2017-02-10 13:36:23.708830671 +0100
+++ icu/source/configure.ac 2017-02-10 13:37:00.618423307 +0100
@@ -132,10 +132,10 @@ AC_SUBST(ENABLE_RELEASE)
: ${CXXFLAGS=""}
# Checks for compilers
-AC_PROG_CC([clang gcc cc c99 c89 xlc_r xlc cl.exe icc])
+AC_PROG_CC([gcc cc c99 c89 xlc_r xlc cl.exe icc])
# Make sure that we try clang++ first, which provides C++11 support.
# The g++ compiler is less likely to support C++11.
-AC_PROG_CXX([clang++ g++ c++ gpp xlC_r xlC aCC CC cxx cc++ cl.exe icc FCC KCC RCC])
+AC_PROG_CXX([g++ c++ gpp xlC_r xlC aCC CC cxx cc++ cl.exe icc FCC KCC RCC])
# pkg-config is needed for harfbuzz support
PKG_PROG_PKG_CONFIG([0.20])

128
SOURCES/icu-gennorm2-man.patch

@ -0,0 +1,128 @@ @@ -0,0 +1,128 @@
Description: supply manual page for program that doesn't have one
Author: Jay Berkenbilt <qjb@debian.org>
Bug: http://bugs.icu-project.org/trac/ticket/7554

diff -r -u -N icu.orig/source/tools/gennorm2/gennorm2.8.in icu/source/tools/gennorm2/gennorm2.8.in
--- icu.orig/source/tools/gennorm2/gennorm2.8.in 1970-01-01 01:00:00.000000000 +0100
+++ icu/source/tools/gennorm2/gennorm2.8.in 2013-02-25 16:43:28.297062638 +0100
@@ -0,0 +1,71 @@
+.\" Hey, Emacs! This is -*-nroff-*- you know...
+.\"
+.\" gennorm2.8: manual page for the gennorm2 utility
+.\"
+.\" Copyright (C) 2005-2006 International Business Machines Corporation and others
+.\"
+.TH GENNORM2 8 "15 March 2010" "ICU MANPAGE" "ICU @VERSION@ Manual"
+.SH NAME
+.B gennorm2
+\- Builds binary data file with Unicode normalization data.
+.SH SYNOPSIS
+.B gennorm2
+[
+.BR "\-h\fP, \fB\-?\fP, \fB\-\-help"
+]
+[
+.BR "\-V\fP, \fB\-\-version"
+]
+[
+.BR "\-c\fP, \fB\-\-copyright"
+]
+[
+.BR "\-v\fP, \fB\-\-verbose"
+]
+[
+.BI "\-u\fP, \fB\-\-unicode" " unicode\-version\-number"
+]
+[
+.BI "\-s\fP, \fB\-\-sourcedir" " source\-directory"
+]
+[
+.BI "\-o\fP, \fB\-\-output" " output\-filename"
+]
+.BI "\fB\-\-fast"
+.SH DESCRIPTION
+.B gennorm2
+reads text files that define Unicode normalization,
+them, and builds a binary data file.
+.SH OPTIONS
+.TP
+.BR "\-h\fP, \fB\-?\fP, \fB\-\-help"
+Print help about usage and exit.
+.TP
+.BR "\-V\fP, \fB\-\-version"
+Print the version of
+.B gennorm2
+and exit.
+.TP
+.BR "\-c\fP, \fB\-\-copyright"
+Include a copyright notice.
+.TP
+.BR "\-v\fP, \fB\-\-verbose"
+Display extra informative messages during execution.
+.TP
+.BR "\-u\fP, \fB\-\-unicode"
+Specify Unicode version number, such as 5.2.0.
+.TP
+.BI "\-s\fP, \fB\-\-sourcedir" " source\-directory"
+Specify the input directory.
+.TP
+.BI "\-s\fP, \fB\-\-sourcedir" " source\-directory"
+Set the name of the output file.
+.TP
+.BI "\fB\-\-fast"
+optimize the .nrm file for fast normalization,
+which might increase its size (Writes fully decomposed
+regular mappings instead of delta mappings.
+You should measure the runtime speed to make sure that
+this is a good trade-off.)
+.SH COPYRIGHT
+Copyright (C) 2009-2010 International Business Machines Corporation and others
diff -r -u -N icu.orig/source/tools/gennorm2/Makefile.in icu/source/tools/gennorm2/Makefile.in
--- icu.orig/source/tools/gennorm2/Makefile.in 2013-01-11 01:23:32.000000000 +0100
+++ icu/source/tools/gennorm2/Makefile.in 2013-02-25 16:43:28.296062632 +0100
@@ -16,8 +16,13 @@
TARGET_STUB_NAME = gennorm2
+SECTION = 8
+
+MAN_FILES = $(TARGET_STUB_NAME).$(SECTION)
+
+
## Extra files to remove for 'make clean'
-CLEANFILES = *~ $(DEPS)
+CLEANFILES = *~ $(DEPS) $(MAN_FILES)
## Target information
TARGET = $(BINDIR)/$(TARGET_STUB_NAME)$(EXEEXT)
@@ -44,12 +49,16 @@
dist: dist-local
check: all check-local
-all-local: $(TARGET)
+all-local: $(TARGET) $(MAN_FILES)
-install-local: all-local
+install-local: all-local install-man
$(MKINSTALLDIRS) $(DESTDIR)$(sbindir)
$(INSTALL) $(TARGET) $(DESTDIR)$(sbindir)
+install-man: $(MAN_FILES)
+ $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$(SECTION)
+ $(INSTALL_DATA) $? $(DESTDIR)$(mandir)/man$(SECTION)
+
dist-local:
clean-local:
@@ -70,6 +79,11 @@
$(POST_BUILD_STEP)
+%.$(SECTION): $(srcdir)/%.$(SECTION).in
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+
ifeq (,$(MAKECMDGOALS))
-include $(DEPS)
else

145
SOURCES/icu-icuinfo-man.patch

@ -0,0 +1,145 @@ @@ -0,0 +1,145 @@
Description: supply manual page for program that doesn't have one
Author: Jay Berkenbilt <qjb@debian.org>
Bug: http://bugs.icu-project.org/trac/ticket/7665
erAck: adapted to ICU 56.1 icu/source/tools/icuinfo/Makefile.in

diff -Nur orig.icu/source/tools/icuinfo/icuinfo.1.in icu/source/tools/icuinfo/icuinfo.1.in
--- orig.icu/source/tools/icuinfo/icuinfo.1.in 1970-01-01 01:00:00.000000000 +0100
+++ icu/source/tools/icuinfo/icuinfo.1.in 2015-10-27 19:19:35.184056800 +0100
@@ -0,0 +1,76 @@
+.\" Hey, Emacs! This is -*-nroff-*- you know...
+.\"
+.\" icuinfo.1: manual page for the icuinfo utility
+.\"
+.\" Copyright (C) 2005-2006 International Business Machines Corporation and others
+.\"
+.TH ICUINFO 1 "1 May 2010" "ICU MANPAGE" "ICU @VERSION@ Manual"
+.SH NAME
+.B icuinfo
+\- Shows some basic info about the current ICU
+.SH SYNOPSIS
+.B icuinfo
+[
+.BR "\-h\fP, \fB\-?\fP, \fB\-\-help"
+]
+[
+.BR "\-V\fP, \fB\-\-version"
+]
+[
+.BR "\-c\fP, \fB\-\-copyright"
+]
+[
+.BI "\-i\fP, \fB\-\-icudatadir" " directory"
+]
+[
+.BR "\-v\fP, \fB\-\-verbose"
+]
+[
+.BI "\-L\fP, \fB\-\-list-plugins"
+]
+[
+.BI "\-m\fP, \fB\-\-milisecond-time"
+]
+[
+.BI "\-K\fP, \fB\-\-cleanup"
+]
+.SH DESCRIPTION
+.B icuinfo
+prints basic information about the current version of ICU.
+.SH OPTIONS
+.TP
+.BR "\-h\fP, \fB\-?\fP, \fB\-\-help"
+Print help about usage and exit.
+.TP
+.BR "\-V\fP, \fB\-\-version"
+Print the version of
+.B icuinfo
+and exit.
+.TP
+.BR "\-c\fP, \fB\-\-copyright"
+Embeds the standard ICU copyright into the
+.IR output-file .
+.TP
+.BR "\-v\fP, \fB\-\-verbose"
+Display extra informative messages during execution.
+.TP
+.BI "\-i\fP, \fB\-\-icudatadir" " directory"
+Look for any necessary ICU data files in
+.IR directory .
+For example, the file
+.B pnames.icu
+must be located when ICU's data is not built as a shared library.
+The default ICU data directory is specified by the environment variable
+.BR ICU_DATA .
+Most configurations of ICU do not require this argument.
+.TP
+.BI "\-L\fP, \fB\-\-list-plugins"
+If specified, list and diagnose issues with ICU plugins.
+.TP
+.BI "\-K\fP, \fB\-\-cleanup"
+Attempt to unload plugins before exiting.
+.TP
+.BI "\-m\fP, \fB\-\-milisecond-time"
+Print the current UTC time in milliseconds.
+.SH COPYRIGHT
+Copyright (C) 2010 International Business Machines Corporation and others
diff -Nur orig.icu/source/tools/icuinfo/Makefile.in icu/source/tools/icuinfo/Makefile.in
--- orig.icu/source/tools/icuinfo/Makefile.in 2015-10-08 05:53:56.000000000 +0200
+++ icu/source/tools/icuinfo/Makefile.in 2015-10-27 19:23:19.115509906 +0100
@@ -14,8 +14,15 @@
## Build directory information
subdir = tools/icuinfo
+TARGET_STUB_NAME = icuinfo
+
+SECTION = 1
+
+MAN_FILES = $(TARGET_STUB_NAME).$(SECTION)
+
+
## Extra files to remove for 'make clean'
-CLEANFILES = *~ $(DEPS) $(PLUGIN_OBJECTS) $(PLUGINFILE) $(PLUGIN)
+CLEANFILES = *~ $(DEPS) $(PLUGIN_OBJECTS) $(PLUGINFILE) $(PLUGIN) $(MAN_FILES)
## Target information
TARGET = icuinfo$(EXEEXT)
@@ -35,7 +42,8 @@
## List of phony targets
.PHONY : all all-local install install-local clean clean-local \
-distclean distclean-local dist dist-local check check-local plugin-check
+distclean distclean-local dist dist-local check check-local plugin-check \
+install-man
## Clear suffix list
.SUFFIXES :
@@ -48,12 +56,16 @@
dist: dist-local
check: all check-local
-all-local: $(TARGET)
+all-local: $(TARGET) $(MAN_FILES)
-install-local: all-local
+install-local: all-local install-man
$(MKINSTALLDIRS) $(DESTDIR)$(bindir)
$(INSTALL) $(TARGET) $(DESTDIR)$(bindir)
+install-man: $(MAN_FILES)
+ $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$(SECTION)
+ $(INSTALL_DATA) $? $(DESTDIR)$(mandir)/man$(SECTION)
+
dist-local:
clean-local:
@@ -103,6 +115,10 @@
@echo "Plugins are disabled (use --enable-plugins to enable)"
endif
+%.$(SECTION): $(srcdir)/%.$(SECTION).in
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
ifeq (,$(MAKECMDGOALS))
-include $(DEPS)
else

244
SOURCES/icu-rhbz1360340-icu-changeset-39109.patch

@ -0,0 +1,244 @@ @@ -0,0 +1,244 @@
# Offsets corected from https://ssl.icu-project.org/trac/changeset/39109
diff -ru icu.orig/source/common/uloc.cpp icu/source/common/uloc.cpp
--- icu.orig/source/common/uloc.cpp 2016-03-23 21:50:12.000000000 +0100
+++ icu/source/common/uloc.cpp 2016-11-01 15:21:16.542151312 +0100
@@ -2246,7 +2246,7 @@
typedef struct {
float q;
int32_t dummy; /* to avoid uninitialized memory copy from qsort */
- char *locale;
+ char locale[ULOC_FULLNAME_CAPACITY+1];
} _acceptLangItem;
static int32_t U_CALLCONV
@@ -2288,9 +2288,7 @@
UEnumeration* availableLocales,
UErrorCode *status)
{
- _acceptLangItem *j;
- _acceptLangItem smallBuffer[30];
- char **strs;
+ MaybeStackArray<_acceptLangItem, 4> items; // Struct for collecting items.
char tmp[ULOC_FULLNAME_CAPACITY +1];
int32_t n = 0;
const char *itemEnd;
@@ -2300,11 +2298,7 @@
int32_t res;
int32_t i;
int32_t l = (int32_t)uprv_strlen(httpAcceptLanguage);
- int32_t jSize;
- char *tempstr; /* Use for null pointer check */
- j = smallBuffer;
- jSize = UPRV_LENGTHOF(smallBuffer);
if(U_FAILURE(*status)) {
return -1;
}
@@ -2332,27 +2326,29 @@
while(isspace(*t)) {
t++;
}
- j[n].q = (float)_uloc_strtod(t,NULL);
+ items[n].q = (float)_uloc_strtod(t,NULL);
} else {
/* no semicolon - it's 1.0 */
- j[n].q = 1.0f;
+ items[n].q = 1.0f;
paramEnd = itemEnd;
}
- j[n].dummy=0;
+ items[n].dummy=0;
/* eat spaces prior to semi */
for(t=(paramEnd-1);(paramEnd>s)&&isspace(*t);t--)
;
- /* Check for null pointer from uprv_strndup */
- tempstr = uprv_strndup(s,(int32_t)((t+1)-s));
- if (tempstr == NULL) {
- *status = U_MEMORY_ALLOCATION_ERROR;
- return -1;
- }
- j[n].locale = tempstr;
- uloc_canonicalize(j[n].locale,tmp,UPRV_LENGTHOF(tmp),status);
- if(strcmp(j[n].locale,tmp)) {
- uprv_free(j[n].locale);
- j[n].locale=uprv_strdup(tmp);
+ int32_t slen = ((t+1)-s);
+ if(slen > ULOC_FULLNAME_CAPACITY) {
+ *status = U_BUFFER_OVERFLOW_ERROR;
+ return -1; // too big
+ }
+ uprv_strncpy(items[n].locale, s, slen);
+ items[n].locale[slen]=0; // terminate
+ int32_t clen = uloc_canonicalize(items[n].locale, tmp, UPRV_LENGTHOF(tmp)-1, status);
+ if(U_FAILURE(*status)) return -1;
+ if((clen!=slen) || (uprv_strncmp(items[n].locale, tmp, slen))) {
+ // canonicalization had an effect- copy back
+ uprv_strncpy(items[n].locale, tmp, clen);
+ items[n].locale[clen] = 0; // terminate
}
#if defined(ULOC_DEBUG)
/*fprintf(stderr,"%d: s <%s> q <%g>\n", n, j[n].locale, j[n].q);*/
@@ -2362,63 +2358,29 @@
while(*s==',') { /* eat duplicate commas */
s++;
}
- if(n>=jSize) {
- if(j==smallBuffer) { /* overflowed the small buffer. */
- j = static_cast<_acceptLangItem *>(uprv_malloc(sizeof(j[0])*(jSize*2)));
- if(j!=NULL) {
- uprv_memcpy(j,smallBuffer,sizeof(j[0])*jSize);
- }
+ if(n>=items.getCapacity()) { // If we need more items
+ if(NULL == items.resize(items.getCapacity()*2, items.getCapacity())) {
+ *status = U_MEMORY_ALLOCATION_ERROR;
+ return -1;
+ }
#if defined(ULOC_DEBUG)
- fprintf(stderr,"malloced at size %d\n", jSize);
+ fprintf(stderr,"malloced at size %d\n", items.getCapacity());
#endif
- } else {
- j = static_cast<_acceptLangItem *>(uprv_realloc(j, sizeof(j[0])*jSize*2));
-#if defined(ULOC_DEBUG)
- fprintf(stderr,"re-alloced at size %d\n", jSize);
-#endif
- }
- jSize *= 2;
- if(j==NULL) {
- *status = U_MEMORY_ALLOCATION_ERROR;
- return -1;
- }
}
}
- uprv_sortArray(j, n, sizeof(j[0]), uloc_acceptLanguageCompare, NULL, TRUE, status);
+ uprv_sortArray(items.getAlias(), n, sizeof(items[0]), uloc_acceptLanguageCompare, NULL, TRUE, status);
+ LocalArray<const char*> strs(new const char*[n], *status);
if(U_FAILURE(*status)) {
- if(j != smallBuffer) {
-#if defined(ULOC_DEBUG)
- fprintf(stderr,"freeing j %p\n", j);
-#endif
- uprv_free(j);
- }
- return -1;
- }
- strs = static_cast<char **>(uprv_malloc((size_t)(sizeof(strs[0])*n)));
- /* Check for null pointer */
- if (strs == NULL) {
- uprv_free(j); /* Free to avoid memory leak */
- *status = U_MEMORY_ALLOCATION_ERROR;
- return -1;
+ return -1;
}
for(i=0;i<n;i++) {
#if defined(ULOC_DEBUG)
/*fprintf(stderr,"%d: s <%s> q <%g>\n", i, j[i].locale, j[i].q);*/
#endif
- strs[i]=j[i].locale;
+ strs[i]=items[i].locale;
}
res = uloc_acceptLanguage(result, resultAvailable, outResult,
- (const char**)strs, n, availableLocales, status);
- for(i=0;i<n;i++) {
- uprv_free(strs[i]);
- }
- uprv_free(strs);
- if(j != smallBuffer) {
-#if defined(ULOC_DEBUG)
- fprintf(stderr,"freeing j %p\n", j);
-#endif
- uprv_free(j);
- }
+ strs.getAlias(), n, availableLocales, status);
return res;
}
diff -ru icu.orig/source/test/cintltst/cloctst.c icu/source/test/cintltst/cloctst.c
--- icu.orig/source/test/cintltst/cloctst.c 2016-03-23 21:48:18.000000000 +0100
+++ icu/source/test/cintltst/cloctst.c 2016-11-01 15:21:16.544151315 +0100
@@ -2775,16 +2775,20 @@
const char *icuSet; /**< ? */
const char *expect; /**< The expected locale result */
UAcceptResult res; /**< The expected error code */
+ UErrorCode expectStatus; /**< expected status */
} tests[] = {
- /*0*/{ 0, NULL, "mt_MT", ULOC_ACCEPT_VALID },
- /*1*/{ 1, NULL, "en", ULOC_ACCEPT_VALID },
- /*2*/{ 2, NULL, "en", ULOC_ACCEPT_FALLBACK },
- /*3*/{ 3, NULL, "", ULOC_ACCEPT_FAILED },
- /*4*/{ 4, NULL, "es", ULOC_ACCEPT_VALID },
-
- /*5*/{ 5, NULL, "en", ULOC_ACCEPT_VALID }, /* XF */
- /*6*/{ 6, NULL, "ja", ULOC_ACCEPT_FALLBACK }, /* XF */
- /*7*/{ 7, NULL, "zh", ULOC_ACCEPT_FALLBACK }, /* XF */
+ /*0*/{ 0, NULL, "mt_MT", ULOC_ACCEPT_VALID, U_ZERO_ERROR},
+ /*1*/{ 1, NULL, "en", ULOC_ACCEPT_VALID, U_ZERO_ERROR},
+ /*2*/{ 2, NULL, "en", ULOC_ACCEPT_FALLBACK, U_ZERO_ERROR},
+ /*3*/{ 3, NULL, "", ULOC_ACCEPT_FAILED, U_ZERO_ERROR},
+ /*4*/{ 4, NULL, "es", ULOC_ACCEPT_VALID, U_ZERO_ERROR},
+ /*5*/{ 5, NULL, "en", ULOC_ACCEPT_VALID, U_ZERO_ERROR}, /* XF */
+ /*6*/{ 6, NULL, "ja", ULOC_ACCEPT_FALLBACK, U_ZERO_ERROR}, /* XF */
+ /*7*/{ 7, NULL, "zh", ULOC_ACCEPT_FALLBACK, U_ZERO_ERROR}, /* XF */
+ /*8*/{ 8, NULL, "", ULOC_ACCEPT_FAILED, U_ZERO_ERROR }, /* */
+ /*9*/{ 9, NULL, "", ULOC_ACCEPT_FAILED, U_ZERO_ERROR }, /* */
+ /*10*/{10, NULL, "", ULOC_ACCEPT_FAILED, U_BUFFER_OVERFLOW_ERROR }, /* */
+ /*11*/{11, NULL, "", ULOC_ACCEPT_FAILED, U_BUFFER_OVERFLOW_ERROR }, /* */
};
const int32_t numTests = UPRV_LENGTHOF(tests);
static const char *http[] = {
@@ -2800,10 +2804,25 @@
"xxx-yyy;q=.01, xxx-yyy;q=.01, xxx-yyy;q=.01, xxx-yyy;q=.01, xxx-yyy;q=.01, "
"xxx-yyy;q=.01, xxx-yyy;q=.01, xxx-yyy;q=.01, xx-yy;q=.1, "
"es",
-
/*5*/ "zh-xx;q=0.9, en;q=0.6",
/*6*/ "ja-JA",
/*7*/ "zh-xx;q=0.9",
+ /*08*/ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", // 156
+ /*09*/ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB", // 157 (this hits U_STRING_NOT_TERMINATED_WARNING )
+ /*10*/ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABC", // 158
+ /*11*/ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", // 163 bytes
};
for(i=0;i<numTests;i++) {
@@ -2818,17 +2837,22 @@
(void)rc; /* Suppress set but not used warning. */
uenum_close(available);
log_verbose(" got %s, %s [%s]\n", tmp[0]?tmp:"(EMPTY)", acceptResult(outResult), u_errorName(status));
- if(outResult != tests[i].res) {
+ if(status != tests[i].expectStatus) {
+ log_err_status(status, "FAIL: expected status %s but got %s\n", u_errorName(tests[i].expectStatus), u_errorName(status));
+ } else if(U_SUCCESS(tests[i].expectStatus)) {
+ /* don't check content if expected failure */
+ if(outResult != tests[i].res) {
log_err_status(status, "FAIL: #%d: expected outResult of %s but got %s\n", i,
acceptResult( tests[i].res),
acceptResult( outResult));
log_info("test #%d: http[%s], ICU[%s], expect %s, %s\n",
i, http[tests[i].httpSet], tests[i].icuSet, tests[i].expect,acceptResult(tests[i].res));
- }
- if((outResult>0)&&uprv_strcmp(tmp, tests[i].expect)) {
- log_err_status(status, "FAIL: #%d: expected %s but got %s\n", i, tests[i].expect, tmp);
- log_info("test #%d: http[%s], ICU[%s], expect %s, %s\n",
- i, http[tests[i].httpSet], tests[i].icuSet, tests[i].expect, acceptResult(tests[i].res));
+ }
+ if((outResult>0)&&uprv_strcmp(tmp, tests[i].expect)) {
+ log_err_status(status, "FAIL: #%d: expected %s but got %s\n", i, tests[i].expect, tmp);
+ log_info("test #%d: http[%s], ICU[%s], expect %s, %s\n",
+ i, http[tests[i].httpSet], tests[i].icuSet, tests[i].expect, acceptResult(tests[i].res));
+ }
}
}
}

156
SOURCES/icu-rhbz1444101-icu-changeset-39671.patch

@ -0,0 +1,156 @@ @@ -0,0 +1,156 @@
# https://ssl.icu-project.org/trac/changeset/39671
Index: /trunk/icu4c/source/common/utext.cpp
===================================================================
--- icu.orig/source/common/utext.cpp
+++ icu/source/common/utext.cpp
@@ -848,7 +848,13 @@
// Chunk size.
-// Must be less than 85, because of byte mapping from UChar indexes to native indexes.
-// Worst case is three native bytes to one UChar. (Supplemenaries are 4 native bytes
-// to two UChars.)
+// Must be less than 42 (256/6), because of byte mapping from UChar indexes to native indexes.
+// Worst case there are six UTF-8 bytes per UChar.
+// obsolete 6 byte form fd + 5 trails maps to fffd
+// obsolete 5 byte form fc + 4 trails maps to fffd
+// non-shortest 4 byte forms maps to fffd
+// normal supplementaries map to a pair of utf-16, two utf8 bytes per utf-16 unit
+// mapToUChars array size must allow for the worst case, 6.
+// This could be brought down to 4, by treating fd and fc as pure illegal,
+// rather than obsolete lead bytes. But that is not compatible with the utf-8 access macros.
//
enum { UTF8_TEXT_CHUNK_SIZE=32 };
@@ -890,5 +896,5 @@
// one for a supplementary starting in the last normal position,
// and one for an entry for the buffer limit position.
- uint8_t mapToUChars[UTF8_TEXT_CHUNK_SIZE*3+6]; // Map native offset from bufNativeStart to
+ uint8_t mapToUChars[UTF8_TEXT_CHUNK_SIZE*6+6]; // Map native offset from bufNativeStart to
// correspoding offset in filled part of buf.
int32_t align;
@@ -1033,4 +1039,5 @@
u8b = (UTF8Buf *)ut->p; // the current buffer
mapIndex = ix - u8b->toUCharsMapStart;
+ U_ASSERT(mapIndex < (int32_t)sizeof(UTF8Buf::mapToUChars));
ut->chunkOffset = u8b->mapToUChars[mapIndex] - u8b->bufStartIdx;
return TRUE;
@@ -1299,4 +1306,8 @@
// If index is at the end, there is no character there to look at.
if (ix != ut->b) {
+ // Note: this function will only move the index back if it is on a trail byte
+ // and there is a preceding lead byte and the sequence from the lead
+ // through this trail could be part of a valid UTF-8 sequence
+ // Otherwise the index remains unchanged.
U8_SET_CP_START(s8, 0, ix);
}
@@ -1312,5 +1323,8 @@
uint8_t *mapToNative = u8b->mapToNative;
uint8_t *mapToUChars = u8b->mapToUChars;
- int32_t toUCharsMapStart = ix - (UTF8_TEXT_CHUNK_SIZE*3 + 1);
+ int32_t toUCharsMapStart = ix - sizeof(UTF8Buf::mapToUChars) + 1;
+ // Note that toUCharsMapStart can be negative. Happens when the remaining
+ // text from current position to the beginning is less than the buffer size.
+ // + 1 because mapToUChars must have a slot at the end for the bufNativeLimit entry.
int32_t destIx = UTF8_TEXT_CHUNK_SIZE+2; // Start in the overflow region
// at end of buffer to leave room
@@ -1339,4 +1353,5 @@
// Special case ASCII range for speed.
buf[destIx] = (UChar)c;
+ U_ASSERT(toUCharsMapStart <= srcIx);
mapToUChars[srcIx - toUCharsMapStart] = (uint8_t)destIx;
mapToNative[destIx] = (uint8_t)(srcIx - toUCharsMapStart);
@@ -1368,4 +1383,5 @@
mapToUChars[sIx-- - toUCharsMapStart] = (uint8_t)destIx;
} while (sIx >= srcIx);
+ U_ASSERT(toUCharsMapStart <= (srcIx+1));
// Set native indexing limit to be the current position.
@@ -1542,4 +1558,5 @@
U_ASSERT(index<=ut->chunkNativeLimit);
int32_t mapIndex = index - u8b->toUCharsMapStart;
+ U_ASSERT(mapIndex < (int32_t)sizeof(UTF8Buf::mapToUChars));
int32_t offset = u8b->mapToUChars[mapIndex] - u8b->bufStartIdx;
U_ASSERT(offset>=0 && offset<=ut->chunkLength);
Index: /trunk/icu4c/source/test/intltest/utxttest.cpp
===================================================================
--- icu.orig/source/test/intltest/utxttest.cpp
+++ icu/source/test/intltest/utxttest.cpp
@@ -68,4 +68,6 @@
case 7: name = "Ticket12130";
if (exec) Ticket12130(); break;
+ case 8: name = "Ticket12888";
+ if (exec) Ticket12888(); break;
default: name = ""; break;
}
@@ -1584,2 +1586,62 @@
utext_close(&ut);
}
+
+// Ticket 12888: bad handling of illegal utf-8 containing many instances of the archaic, now illegal,
+// six byte utf-8 forms. Original implementation had an assumption that
+// there would be at most three utf-8 bytes per UTF-16 code unit.
+// The five and six byte sequences map to a single replacement character.
+
+void UTextTest::Ticket12888() {
+ const char *badString =
+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80"
+ "\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80\xfd\x80\x80\x80\x80\x80";
+
+ UErrorCode status = U_ZERO_ERROR;
+ LocalUTextPointer ut(utext_openUTF8(NULL, badString, -1, &status));
+ TEST_SUCCESS(status);
+ for (;;) {
+ UChar32 c = utext_next32(ut.getAlias());
+ if (c == U_SENTINEL) {
+ break;
+ }
+ }
+ int32_t endIdx = utext_getNativeIndex(ut.getAlias());
+ if (endIdx != (int32_t)strlen(badString)) {
+ errln("%s:%d expected=%d, actual=%d", __FILE__, __LINE__, strlen(badString), endIdx);
+ return;
+ }
+
+ for (int32_t prevIndex = endIdx; prevIndex>0;) {
+ UChar32 c = utext_previous32(ut.getAlias());
+ int32_t currentIndex = utext_getNativeIndex(ut.getAlias());
+ if (c != 0xfffd) {
+ errln("%s:%d (expected, actual, index) = (%d, %d, %d)\n",
+ __FILE__, __LINE__, 0xfffd, c, currentIndex);
+ break;
+ }
+ if (currentIndex != prevIndex - 6) {
+ errln("%s:%d: wrong index. Expected, actual = %d, %d",
+ __FILE__, __LINE__, prevIndex - 6, currentIndex);
+ break;
+ }
+ prevIndex = currentIndex;
+ }
+}
Index: /trunk/icu4c/source/test/intltest/utxttest.h
===================================================================
--- icu.orig/source/test/intltest/utxttest.h
+++ icu/source/test/intltest/utxttest.h
@@ -39,4 +39,5 @@
void Ticket10983();
void Ticket12130();
+ void Ticket12888();
private:

15
SOURCES/webkit-atk_continuation_crash.patch

@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
diff -up webkitgtk-2.20.4/Source/WebCore/accessibility/AccessibilityRenderObject.cpp.atk_continuation_crash webkitgtk-2.20.4/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
--- webkitgtk-2.20.4/Source/WebCore/accessibility/AccessibilityRenderObject.cpp.atk_continuation_crash 2018-02-20 09:25:28.000000000 +0100
+++ webkitgtk-2.20.4/Source/WebCore/accessibility/AccessibilityRenderObject.cpp 2018-08-07 11:43:19.438679595 +0200
@@ -381,8 +381,9 @@ AccessibilityObject* AccessibilityRender
// Case 5: node has no next sibling, and its parent is an inline with a continuation.
// Case 5.1: After case 4, (the element was inline w/ continuation but had no sibling), then check it's parent.
- if (!nextSibling && isInlineWithContinuation(*m_renderer->parent())) {
- auto& continuation = *downcast<RenderInline>(*m_renderer->parent()).continuation();
+ auto parent = m_renderer->parent();
+ if (!nextSibling && parent && isInlineWithContinuation(*parent)) {
+ auto& continuation = *downcast<RenderInline>(*parent).continuation();
// Case 5a: continuation is a block - in this case the block itself is the next sibling.
if (is<RenderBlock>(continuation))

24
SOURCES/webkit-atk_crash.patch

@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@
diff -up webkitgtk-2.20.3/Source/WebCore/accessibility/AccessibilityObject.cpp.atk_crash webkitgtk-2.20.3/Source/WebCore/accessibility/AccessibilityObject.cpp
--- webkitgtk-2.20.3/Source/WebCore/accessibility/AccessibilityObject.cpp.atk_crash 2018-04-09 14:00:57.000000000 +0200
+++ webkitgtk-2.20.3/Source/WebCore/accessibility/AccessibilityObject.cpp 2018-07-24 13:40:41.183634369 +0200
@@ -67,6 +67,7 @@
#include "RenderView.h"
#include "RenderWidget.h"
#include "RenderedPosition.h"
+#include "ScriptDisallowedScope.h"
#include "Settings.h"
#include "TextCheckerClient.h"
#include "TextCheckingHelper.h"
@@ -1771,7 +1772,11 @@ void AccessibilityObject::updateBackingS
// Updating the layout may delete this object.
RefPtr<AccessibilityObject> protectedThis(this);
if (auto* document = this->document()) {
- if (!document->view()->layoutContext().isInRenderTreeLayout() && !document->inRenderTreeUpdate() && !document->inStyleRecalc())
+ if (!document->view()->layoutContext().isInRenderTreeLayout()
+ && !document->inRenderTreeUpdate()
+ && !document->inStyleRecalc()
+ && ScriptDisallowedScope::InMainThread::isScriptAllowed())
+
document->updateLayoutIgnorePendingStylesheets();
}
updateChildrenIfNecessary();

30
SOURCES/webkit-cloop_big_endians.patch

@ -0,0 +1,30 @@ @@ -0,0 +1,30 @@
diff -up webkitgtk-2.14.7/Source/JavaScriptCore/bytecode/CodeBlock.cpp.b132333 webkitgtk-2.14.7/Source/JavaScriptCore/bytecode/CodeBlock.cpp
--- webkitgtk-2.14.7/Source/JavaScriptCore/bytecode/CodeBlock.cpp.b132333 2017-02-07 09:05:07.000000000 +0100
+++ webkitgtk-2.14.7/Source/JavaScriptCore/bytecode/CodeBlock.cpp 2017-06-16 10:34:57.859748036 +0200
@@ -2186,7 +2186,12 @@ void CodeBlock::finishCreation(VM& vm, S
instructions[i + 5].u.watchpointSet = op.watchpointSet;
else if (op.structure)
instructions[i + 5].u.structure.set(vm, this, op.structure);
- instructions[i + 6].u.pointer = reinterpret_cast<void*>(op.operand);
+
+ if (op.type == ClosureVar || op.type == ClosureVarWithVarInjectionChecks || op.type == GlobalProperty || op.type == GlobalPropertyWithVarInjectionChecks || op.type == ModuleVar)
+ instructions[i + 6].u.operand = op.operand;
+ else
+ instructions[i + 6].u.pointer = reinterpret_cast<void*>(op.operand);
+
break;
}
@@ -2222,7 +2227,11 @@ void CodeBlock::finishCreation(VM& vm, S
op.watchpointSet->invalidate(vm, PutToScopeFireDetail(this, ident));
} else if (op.structure)
instructions[i + 5].u.structure.set(vm, this, op.structure);
- instructions[i + 6].u.pointer = reinterpret_cast<void*>(op.operand);
+
+ if (op.type == ClosureVar || op.type == ClosureVarWithVarInjectionChecks || op.type == GlobalProperty || op.type == GlobalPropertyWithVarInjectionChecks || op.type == ModuleVar)
+ instructions[i + 6].u.operand = op.operand;
+ else
+ instructions[i + 6].u.pointer = reinterpret_cast<void*>(op.operand);
break;
}

13
SOURCES/webkit-covscan_1.patch

@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
diff --git a/Source/WebCore/rendering/RenderThemeGtk.cpp b/Source/WebCore/rendering/RenderThemeGtk.cpp
index d04a6845f26..8e8fe10f58e 100644
--- a/Source/WebCore/rendering/RenderThemeGtk.cpp
+++ b/Source/WebCore/rendering/RenderThemeGtk.cpp
@@ -1314,7 +1314,7 @@ void RenderThemeGtk::adjustSliderThumbSize(RenderStyle& style, const Element*) c
if (part != SliderThumbHorizontalPart && part != SliderThumbVerticalPart)
return;
- auto& sliderWidget = static_cast<RenderThemeSlider&>(RenderThemeWidget::getOrCreate(part == SliderHorizontalPart ? RenderThemeWidget::Type::HorizontalSlider : RenderThemeWidget::Type::VerticalSlider));
+ auto& sliderWidget = static_cast<RenderThemeSlider&>(RenderThemeWidget::getOrCreate(part == SliderThumbHorizontalPart ? RenderThemeWidget::Type::HorizontalSlider : RenderThemeWidget::Type::VerticalSlider));
sliderWidget.scale().setState(GTK_STATE_FLAG_NORMAL);
sliderWidget.trough().setState(GTK_STATE_FLAG_NORMAL);

20
SOURCES/webkit-covscan_2.patch

@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
diff --git a/Source/WebCore/page/linux/ResourceUsageThreadLinux.cpp b/Source/WebCore/page/linux/ResourceUsageThreadLinux.cpp
index d9e4179072d..b1f51e14f6f 100644
--- a/Source/WebCore/page/linux/ResourceUsageThreadLinux.cpp
+++ b/Source/WebCore/page/linux/ResourceUsageThreadLinux.cpp
@@ -58,8 +58,14 @@ static float cpuPeriod()
unsigned long long userTime, niceTime, systemTime, idleTime;
unsigned long long ioWait, irq, softIrq, steal, guest, guestnice;
ioWait = irq = softIrq = steal = guest = guestnice = 0;
- sscanf(buffer, "cpu %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu",
+ int retVal = sscanf(buffer, "cpu %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu",
&userTime, &niceTime, &systemTime, &idleTime, &ioWait, &irq, &softIrq, &steal, &guest, &guestnice);
+ // We expect 10 values to be matched by sscanf
+ if (retVal < 10 || retVal == EOF) {
+ fclose(file);
+ return 0;
+ }
+
// Keep parsing if we still don't know cpuCount.
static unsigned cpuCount = 0;

13
SOURCES/webkit-covscan_3.patch

@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
diff --git a/Source/WebCore/page/linux/ResourceUsageThreadLinux.cpp b/Source/WebCore/page/linux/ResourceUsageThreadLinux.cpp
index b1f51e14f6f..70f0d69c11b 100644
--- a/Source/WebCore/page/linux/ResourceUsageThreadLinux.cpp
+++ b/Source/WebCore/page/linux/ResourceUsageThreadLinux.cpp
@@ -61,7 +61,7 @@ static float cpuPeriod()
int retVal = sscanf(buffer, "cpu %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu",
&userTime, &niceTime, &systemTime, &idleTime, &ioWait, &irq, &softIrq, &steal, &guest, &guestnice);
// We expect 10 values to be matched by sscanf
- if (retVal < 10 || retVal == EOF) {
+ if (retVal != 10) {
fclose(file);
return 0;
}

24
SOURCES/webkit-covscan_already_fixed.patch

@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@
diff -up webkitgtk-2.20.3/Source/JavaScriptCore/runtime/JSString.h.covscan_fixes webkitgtk-2.20.3/Source/JavaScriptCore/runtime/JSString.h
--- webkitgtk-2.20.3/Source/JavaScriptCore/runtime/JSString.h.covscan_fixes 2018-06-13 15:02:38.085399191 +0200
+++ webkitgtk-2.20.3/Source/JavaScriptCore/runtime/JSString.h 2018-06-13 15:02:45.140375189 +0200
@@ -221,7 +221,7 @@ private:
mutable unsigned m_flags;
// A string is represented either by a String or a rope of fibers.
- unsigned m_length;
+ unsigned m_length{0};
mutable String m_value;
friend class LLIntOffsetsExtractor;
diff -up webkitgtk-2.20.3/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp.covscan_fixes webkitgtk-2.20.3/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
--- webkitgtk-2.20.3/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp.covscan_fixes 2018-06-11 10:16:31.000000000 +0200
+++ webkitgtk-2.20.3/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp 2018-06-13 16:14:56.188378149 +0200
@@ -230,7 +230,7 @@ private:
GstVideoFrame m_videoFrame;
IntSize m_size;
TextureMapperGL::Flags m_flags;
- GLuint m_textureID;
+ GLuint m_textureID { 0 };
bool m_isValid { false };
};
#endif // USE(GSTREAMER_GL)

41
SOURCES/webkit-covscan_bmalloc.patch

@ -0,0 +1,41 @@ @@ -0,0 +1,41 @@
--- a/Source/bmalloc/bmalloc/DebugHeap.h
+++ a/Source/bmalloc/bmalloc/DebugHeap.h
@@ -53,7 +53,7 @@ private:
#endif
// This is the debug heap. We can use whatever data structures we like. It doesn't matter.
- size_t m_pageSize;
+ size_t m_pageSize { 0 };
std::mutex m_lock;
std::unordered_map<void*, size_t> m_sizeMap;
};
--- a/Source/bmalloc/bmalloc/IsoTLS.cpp
+++ a/Source/bmalloc/bmalloc/IsoTLS.cpp
@@ -68,7 +68,9 @@ IsoTLS* IsoTLS::ensureEntries(unsigned offset)
#if HAVE_PTHREAD_MACHDEP_H
pthread_key_init_np(tlsKey, destructor);
#else
- pthread_key_create(&s_tlsKey, destructor);
+ int error = pthread_key_create(&s_tlsKey, destructor);
+ if (error)
+ BCRASH();
s_didInitialize = true;
#endif
});
--- a/Source/bmalloc/bmalloc/VMAllocate.h
+++ a/Source/bmalloc/bmalloc/VMAllocate.h
@@ -56,8 +56,12 @@ namespace bmalloc {
inline size_t vmPageSize()
{
static size_t cached;
- if (!cached)
- cached = sysconf(_SC_PAGESIZE);
+ if (!cached) {
+ long pageSize = sysconf(_SC_PAGESIZE);
+ if (pageSize < 0)
+ BCRASH();
+ cached = pageSize;
+ }
return cached;
}

39
SOURCES/webkit-covscan_gstreamer.patch

@ -0,0 +1,39 @@ @@ -0,0 +1,39 @@
diff -up webkitgtk-2.20.3/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp.covscan_gstreamer webkitgtk-2.20.3/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
--- webkitgtk-2.20.3/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp.covscan_gstreamer 2018-06-27 10:21:44.715668445 +0200
+++ webkitgtk-2.20.3/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp 2018-06-27 10:22:48.513607713 +0200
@@ -227,9 +227,9 @@ public:
bool isValid() const { return m_isValid; }
private:
- GstVideoFrame m_videoFrame;
+ GstVideoFrame m_videoFrame { };
IntSize m_size;
- TextureMapperGL::Flags m_flags;
+ TextureMapperGL::Flags m_flags { };
GLuint m_textureID { 0 };
bool m_isValid { false };
};
diff -up webkitgtk-2.20.3/Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h.covscan_gstreamer webkitgtk-2.20.3/Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h
--- webkitgtk-2.20.3/Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h.covscan_gstreamer 2018-02-19 08:45:32.000000000 +0100
+++ webkitgtk-2.20.3/Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h 2018-06-27 10:21:44.715668445 +0200
@@ -85,7 +85,7 @@ private:
MediaSourceGStreamer* m_mediaSource;
ContentType m_type;
Ref<MediaSourceClientGStreamerMSE> m_client;
- SourceBufferPrivateClient* m_sourceBufferPrivateClient;
+ SourceBufferPrivateClient* m_sourceBufferPrivateClient { nullptr };
bool m_isReadyForMoreSamples = true;
bool m_notifyWhenReadyForMoreSamples = false;
AtomicString m_trackId;
diff -up webkitgtk-2.20.3/Source/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp.covscan_gstreamer webkitgtk-2.20.3/Source/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp
--- webkitgtk-2.20.3/Source/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp.covscan_gstreamer 2018-02-19 08:45:32.000000000 +0100
+++ webkitgtk-2.20.3/Source/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp 2018-06-27 10:21:44.715668445 +0200
@@ -135,7 +135,7 @@ struct _WebKitVideoSinkPrivate {
VideoRenderRequestScheduler scheduler;
GstVideoInfo info;
- GstCaps* currentCaps;
+ GstCaps* currentCaps { nullptr };
};
#define webkit_video_sink_parent_class parent_class

21
SOURCES/webkit-covscan_uninit.patch

@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
diff -up webkitgtk-2.20.3/Source/JavaScriptCore/runtime/CodeCache.cpp.covscan_uninit webkitgtk-2.20.3/Source/JavaScriptCore/runtime/CodeCache.cpp
--- webkitgtk-2.20.3/Source/JavaScriptCore/runtime/CodeCache.cpp.covscan_uninit 2018-06-18 10:03:23.060605715 +0200
+++ webkitgtk-2.20.3/Source/JavaScriptCore/runtime/CodeCache.cpp 2018-06-18 10:03:44.223529644 +0200
@@ -129,7 +129,7 @@ UnlinkedFunctionExecutable* CodeCache::g
// This function assumes an input string that would result in a single function declaration.
StatementNode* statement = program->singleStatement();
if (UNLIKELY(!statement)) {
- JSToken token;
+ JSToken token = { };
error = ParserError(ParserError::SyntaxError, ParserError::SyntaxErrorIrrecoverable, token, "Parser error", -1);
return nullptr;
}
@@ -137,7 +137,7 @@ UnlinkedFunctionExecutable* CodeCache::g
StatementNode* funcDecl = static_cast<BlockNode*>(statement)->singleStatement();
if (UNLIKELY(!funcDecl)) {
- JSToken token;
+ JSToken token = { };
error = ParserError(ParserError::SyntaxError, ParserError::SyntaxErrorIrrecoverable, token, "Parser error", -1);
return nullptr;
}

505
SOURCES/webkit-covscan_uninit_ctor.patch

@ -0,0 +1,505 @@ @@ -0,0 +1,505 @@
diff -up webkitgtk-2.20.3/Source/JavaScriptCore/b3/air/AirAllocateRegistersByGraphColoring.cpp.covscan_fixes_uninit_ctor webkitgtk-2.20.3/Source/JavaScriptCore/b3/air/AirAllocateRegistersByGraphColoring.cpp
--- webkitgtk-2.20.3/Source/JavaScriptCore/b3/air/AirAllocateRegistersByGraphColoring.cpp.covscan_fixes_uninit_ctor 2018-02-19 08:45:14.000000000 +0100
+++ webkitgtk-2.20.3/Source/JavaScriptCore/b3/air/AirAllocateRegistersByGraphColoring.cpp 2018-06-18 09:07:12.032744813 +0200
@@ -876,7 +876,7 @@ protected:
}
private:
- unsigned m_positionInMoveList;
+ unsigned m_positionInMoveList { 0 };
Vector<unsigned, 0, UnsafeVectorOverflow> m_moveList;
Vector<unsigned, 0, UnsafeVectorOverflow> m_lowPriorityMoveList;
};
diff -up webkitgtk-2.20.3/Source/JavaScriptCore/bytecode/PolymorphicAccess.h.covscan_fixes_uninit_ctor webkitgtk-2.20.3/Source/JavaScriptCore/bytecode/PolymorphicAccess.h
--- webkitgtk-2.20.3/Source/JavaScriptCore/bytecode/PolymorphicAccess.h.covscan_fixes_uninit_ctor 2018-02-19 08:45:14.000000000 +0100
+++ webkitgtk-2.20.3/Source/JavaScriptCore/bytecode/PolymorphicAccess.h 2018-06-18 09:07:12.034744805 +0200
@@ -122,7 +122,7 @@ public:
}
private:
- Kind m_kind;
+ Kind m_kind { MadeNoChanges };
MacroAssemblerCodePtr m_code;
Vector<std::pair<InlineWatchpointSet&, StringFireDetail>> m_watchpointsToFire;
};
diff -up webkitgtk-2.20.3/Source/JavaScriptCore/dfg/DFGOSRExit.h.covscan_fixes_uninit_ctor webkitgtk-2.20.3/Source/JavaScriptCore/dfg/DFGOSRExit.h
--- webkitgtk-2.20.3/Source/JavaScriptCore/dfg/DFGOSRExit.h.covscan_fixes_uninit_ctor 2018-02-19 08:45:14.000000000 +0100
+++ webkitgtk-2.20.3/Source/JavaScriptCore/dfg/DFGOSRExit.h 2018-06-18 09:07:12.034744805 +0200
@@ -131,7 +131,7 @@ struct OSRExitState : RefCounted<OSRExit
void* jumpTarget;
ArrayProfile* arrayProfile;
- ExtraInitializationLevel extraInitializationLevel;
+ ExtraInitializationLevel extraInitializationLevel { };
Profiler::OSRExit* profilerExit { nullptr };
};
diff -up webkitgtk-2.20.3/Source/JavaScriptCore/runtime/ConfigFile.cpp.covscan_fixes_uninit_ctor webkitgtk-2.20.3/Source/JavaScriptCore/runtime/ConfigFile.cpp
--- webkitgtk-2.20.3/Source/JavaScriptCore/runtime/ConfigFile.cpp.covscan_fixes_uninit_ctor 2018-06-11 10:16:31.000000000 +0200
+++ webkitgtk-2.20.3/Source/JavaScriptCore/runtime/ConfigFile.cpp 2018-06-18 09:07:12.035744801 +0200
@@ -233,7 +233,7 @@ private:
const char* m_filename;
unsigned m_lineNumber;
- FILE* m_file;
+ FILE* m_file { nullptr };
char m_buffer[BUFSIZ];
char* m_srcPtr;
char* m_bufferEnd;
diff -up webkitgtk-2.20.3/Source/JavaScriptCore/runtime/JSBigInt.h.covscan_fixes_uninit_ctor webkitgtk-2.20.3/Source/JavaScriptCore/runtime/JSBigInt.h
--- webkitgtk-2.20.3/Source/JavaScriptCore/runtime/JSBigInt.h.covscan_fixes_uninit_ctor 2018-02-19 08:45:17.000000000 +0100
+++ webkitgtk-2.20.3/Source/JavaScriptCore/runtime/JSBigInt.h 2018-06-18 09:07:12.035744801 +0200
@@ -84,7 +84,7 @@ public:
double toNumber(ExecState*) const;
JSObject* toObject(ExecState*, JSGlobalObject*) const;
-
+
private:
using Digit = uintptr_t;
static constexpr const int bitsPerByte = 8;
@@ -92,15 +92,15 @@ private:
static constexpr const int halfDigitBits = digitBits / 2;
static constexpr const Digit halfDigitMask = (1ull << halfDigitBits) - 1;
static constexpr const int maxInt = 0x7FFFFFFF;
-
+
// The maximum length that the current implementation supports would be
// maxInt / digitBits. However, we use a lower limit for now, because
// raising it later is easier than lowering it.
// Support up to 1 million bits.
static const int maxLength = 1024 * 1024 / (sizeof(void*) * bitsPerByte);
-
+
static uint64_t calculateMaximumCharactersRequired(int length, int radix, Digit lastDigit, bool sign);
-
+
static void absoluteDivSmall(ExecState&, JSBigInt* x, Digit divisor, JSBigInt** quotient, Digit& remainder);
static void internalMultiplyAdd(JSBigInt* source, Digit factor, Digit summand, int, JSBigInt* result);
@@ -126,15 +126,15 @@ private:
JSBigInt* rightTrim(VM&);
void inplaceMultiplyAdd(Digit multiplier, Digit part);
-
+
static size_t offsetOfData();
Digit* dataStorage();
Digit digit(int);
void setDigit(int, Digit);
-
- int m_length;
- bool m_sign;
+
+ int m_length { 0 };
+ bool m_sign { false };
};
inline JSBigInt* asBigInt(JSValue value)
diff -up webkitgtk-2.20.3/Source/JavaScriptCore/runtime/PropertySlot.h.covscan_fixes_uninit_ctor webkitgtk-2.20.3/Source/JavaScriptCore/runtime/PropertySlot.h
--- webkitgtk-2.20.3/Source/JavaScriptCore/runtime/PropertySlot.h.covscan_fixes_uninit_ctor 2018-02-19 08:45:17.000000000 +0100
+++ webkitgtk-2.20.3/Source/JavaScriptCore/runtime/PropertySlot.h 2018-06-18 09:07:12.035744801 +0200
@@ -368,7 +368,7 @@ private:
JS_EXPORT_PRIVATE JSValue customGetter(ExecState*, PropertyName) const;
JS_EXPORT_PRIVATE JSValue customAccessorGetter(ExecState*, PropertyName) const;
- unsigned m_attributes;
+ unsigned m_attributes { 0 };
union {
EncodedJSValue value;
struct {
diff -up webkitgtk-2.20.3/Source/JavaScriptCore/wasm/js/WasmToJS.cpp.covscan_fixes_uninit_ctor webkitgtk-2.20.3/Source/JavaScriptCore/wasm/js/WasmToJS.cpp
--- webkitgtk-2.20.3/Source/JavaScriptCore/wasm/js/WasmToJS.cpp.covscan_fixes_uninit_ctor 2018-03-05 12:42:39.000000000 +0100
+++ webkitgtk-2.20.3/Source/JavaScriptCore/wasm/js/WasmToJS.cpp 2018-06-18 09:07:12.035744801 +0200
@@ -264,7 +264,7 @@ Expected<MacroAssemblerCodeRef, BindingF
JSValue result = call(exec, callee, callType, callData, jsUndefined(), args);
RETURN_IF_EXCEPTION(throwScope, 0);
- uint64_t realResult;
+ uint64_t realResult = 0;
switch (signature.returnType()) {
case Func:
case Anyfunc:
diff -up webkitgtk-2.20.3/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp.covscan_fixes_uninit_ctor webkitgtk-2.20.3/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp
--- webkitgtk-2.20.3/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp.covscan_fixes_uninit_ctor 2018-03-05 11:37:06.000000000 +0100
+++ webkitgtk-2.20.3/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp 2018-06-18 09:07:12.036744797 +0200
@@ -147,10 +147,10 @@ public:
private:
friend class B3IRGenerator;
- BlockType blockType;
- BasicBlock* continuation;
- BasicBlock* special;
- ResultList result;
+ BlockType blockType { };
+ BasicBlock* continuation { nullptr };
+ BasicBlock* special { nullptr };
+ ResultList result { };
};
typedef Value* ExpressionType;
diff -up webkitgtk-2.20.3/Source/JavaScriptCore/wasm/WasmFormat.h.covscan_fixes_uninit_ctor webkitgtk-2.20.3/Source/JavaScriptCore/wasm/WasmFormat.h
--- webkitgtk-2.20.3/Source/JavaScriptCore/wasm/WasmFormat.h.covscan_fixes_uninit_ctor 2018-02-19 08:45:17.000000000 +0100
+++ webkitgtk-2.20.3/Source/JavaScriptCore/wasm/WasmFormat.h 2018-06-18 09:07:12.036744797 +0200
@@ -226,7 +226,7 @@ public:
std::optional<uint32_t> maximum() const { return m_maximum; }
private:
- uint32_t m_initial;
+ uint32_t m_initial { 0 };
std::optional<uint32_t> m_maximum;
bool m_isImport { false };
bool m_isValid { false };
diff -up webkitgtk-2.20.3/Source/JavaScriptCore/wasm/WasmFunctionParser.h.covscan_fixes_uninit_ctor webkitgtk-2.20.3/Source/JavaScriptCore/wasm/WasmFunctionParser.h
--- webkitgtk-2.20.3/Source/JavaScriptCore/wasm/WasmFunctionParser.h.covscan_fixes_uninit_ctor 2018-02-19 08:45:17.000000000 +0100
+++ webkitgtk-2.20.3/Source/JavaScriptCore/wasm/WasmFunctionParser.h 2018-06-18 09:07:12.036744797 +0200
@@ -87,7 +87,7 @@ private:
const Signature& m_signature;
const ModuleInformation& m_info;
- OpType m_currentOpcode;
+ OpType m_currentOpcode { };
size_t m_currentOpcodeStartingOffset { 0 };
unsigned m_unreachableBlocks { 0 };
diff -up webkitgtk-2.20.3/Source/JavaScriptCore/wasm/WasmTierUpCount.h.covscan_fixes_uninit_ctor webkitgtk-2.20.3/Source/JavaScriptCore/wasm/WasmTierUpCount.h
--- webkitgtk-2.20.3/Source/JavaScriptCore/wasm/WasmTierUpCount.h.covscan_fixes_uninit_ctor 2018-02-19 08:45:17.000000000 +0100
+++ webkitgtk-2.20.3/Source/JavaScriptCore/wasm/WasmTierUpCount.h 2018-06-18 09:07:12.037744793 +0200
@@ -65,7 +65,7 @@ public:
private:
uint32_t m_count;
- Atomic<bool> m_tierUpStarted;
+ Atomic<bool> m_tierUpStarted { false };
};
} } // namespace JSC::Wasm
diff -up webkitgtk-2.20.3/Source/JavaScriptCore/wasm/WasmValidate.cpp.covscan_fixes_uninit_ctor webkitgtk-2.20.3/Source/JavaScriptCore/wasm/WasmValidate.cpp
--- webkitgtk-2.20.3/Source/JavaScriptCore/wasm/WasmValidate.cpp.covscan_fixes_uninit_ctor 2018-02-19 08:45:17.000000000 +0100
+++ webkitgtk-2.20.3/Source/JavaScriptCore/wasm/WasmValidate.cpp 2018-06-18 09:07:12.037744793 +0200
@@ -72,8 +72,8 @@ public:
Type signature() const { return m_signature; }
Type branchTargetSignature() const { return type() == BlockType::Loop ? Void : signature(); }
private:
- BlockType m_blockType;
- Type m_signature;
+ BlockType m_blockType { };
+ Type m_signature { };
};
typedef String ErrorType;
typedef Unexpected<ErrorType> UnexpectedResult;
diff -up webkitgtk-2.20.3/Source/JavaScriptCore/yarr/YarrJIT.h.covscan_fixes_uninit_ctor webkitgtk-2.20.3/Source/JavaScriptCore/yarr/YarrJIT.h
--- webkitgtk-2.20.3/Source/JavaScriptCore/yarr/YarrJIT.h.covscan_fixes_uninit_ctor 2018-02-20 10:12:50.000000000 +0100
+++ webkitgtk-2.20.3/Source/JavaScriptCore/yarr/YarrJIT.h 2018-06-18 09:07:12.037744793 +0200
@@ -201,7 +201,7 @@ private:
MacroAssemblerCodeRef m_matchOnly8;
MacroAssemblerCodeRef m_matchOnly16;
#if ENABLE(YARR_JIT_ALL_PARENS_EXPRESSIONS)
- bool m_usesPatternContextBuffer;
+ bool m_usesPatternContextBuffer { false };
#endif
std::optional<JITFailureReason> m_failureReason;
};
diff -up webkitgtk-2.20.3/Source/WebCore/accessibility/AccessibilityTableColumn.h.covscan_fixes_uninit_ctor webkitgtk-2.20.3/Source/WebCore/accessibility/AccessibilityTableColumn.h
--- webkitgtk-2.20.3/Source/WebCore/accessibility/AccessibilityTableColumn.h.covscan_fixes_uninit_ctor 2018-02-19 08:45:31.000000000 +0100
+++ webkitgtk-2.20.3/Source/WebCore/accessibility/AccessibilityTableColumn.h 2018-06-18 09:07:12.037744793 +0200
@@ -33,36 +33,36 @@
#include "IntRect.h"
namespace WebCore {
-
+
class RenderTableSection;
class AccessibilityTableColumn final : public AccessibilityMockObject {
public:
static Ref<AccessibilityTableColumn> create();
virtual ~AccessibilityTableColumn();
-
+
AccessibilityObject* headerObject();
-
+
AccessibilityRole roleValue() const override { return AccessibilityRole::Column; }
-
+
void setColumnIndex(int columnIndex) { m_columnIndex = columnIndex; }
- int columnIndex() const { return m_columnIndex; }
-
+ int columnIndex() const { return m_columnIndex; }
+
void addChildren() override;
void setParent(AccessibilityObject*) override;
-
+
LayoutRect elementRect() const override;
-
+
private:
AccessibilityTableColumn();
-
+
AccessibilityObject* headerObjectForSection(RenderTableSection*, bool thTagRequired);
bool computeAccessibilityIsIgnored() const override;
bool isTableColumn() const override { return true; }
- unsigned m_columnIndex;
+ unsigned m_columnIndex { 0 };
};
-} // namespace WebCore
+} // namespace WebCore
SPECIALIZE_TYPE_TRAITS_ACCESSIBILITY(AccessibilityTableColumn, isTableColumn())
diff -up webkitgtk-2.20.3/Source/WebCore/dom/RequestAnimationFrameCallback.h.covscan_fixes_uninit_ctor webkitgtk-2.20.3/Source/WebCore/dom/RequestAnimationFrameCallback.h
--- webkitgtk-2.20.3/Source/WebCore/dom/RequestAnimationFrameCallback.h.covscan_fixes_uninit_ctor 2018-02-19 08:45:32.000000000 +0100
+++ webkitgtk-2.20.3/Source/WebCore/dom/RequestAnimationFrameCallback.h 2018-06-18 09:07:12.037744793 +0200
@@ -42,9 +42,9 @@ public:
virtual CallbackResult<void> handleEvent(double highResTimeMs) = 0;
- int m_id;
- bool m_firedOrCancelled;
- bool m_useLegacyTimeBase;
+ int m_id { 0 };
+ bool m_firedOrCancelled { false };
+ bool m_useLegacyTimeBase { false };
};
} // namespace WebCore
diff -up webkitgtk-2.20.3/Source/WebCore/html/HTMLMediaElement.cpp.covscan_fixes_uninit_ctor webkitgtk-2.20.3/Source/WebCore/html/HTMLMediaElement.cpp
--- webkitgtk-2.20.3/Source/WebCore/html/HTMLMediaElement.cpp.covscan_fixes_uninit_ctor 2018-02-19 12:04:38.000000000 +0100
+++ webkitgtk-2.20.3/Source/WebCore/html/HTMLMediaElement.cpp 2018-06-18 09:07:12.039744785 +0200
@@ -2105,9 +2105,10 @@ bool HTMLMediaElement::isSafeToLoadURL(c
RefPtr<Frame> frame = document().frame();
if (!frame || !document().securityOrigin().canDisplay(url)) {
- if (actionIfInvalid == Complain)
+ if (actionIfInvalid == Complain) {
FrameLoader::reportLocalLoadFailed(frame.get(), url.stringCenterEllipsizedToLength());
ERROR_LOG(LOGIDENTIFIER, url , " was rejected by SecurityOrigin");
+ }
return false;
}
diff -up webkitgtk-2.20.3/Source/WebCore/html/HTMLMenuElement.h.covscan_fixes_uninit_ctor webkitgtk-2.20.3/Source/WebCore/html/HTMLMenuElement.h
--- webkitgtk-2.20.3/Source/WebCore/html/HTMLMenuElement.h.covscan_fixes_uninit_ctor 2018-02-19 08:45:32.000000000 +0100
+++ webkitgtk-2.20.3/Source/WebCore/html/HTMLMenuElement.h 2018-06-18 09:07:12.039744785 +0200
@@ -39,7 +39,7 @@ private:
void removedFromAncestor(RemovalType, ContainerNode&) final;
void parseAttribute(const QualifiedName&, const AtomicString&) final;
- bool m_isTouchBarMenu;
+ bool m_isTouchBarMenu { false };
};
} // namespace WebCore
diff -up webkitgtk-2.20.3/Source/WebCore/Modules/webaudio/AudioProcessingEvent.h.covscan_fixes_uninit_ctor webkitgtk-2.20.3/Source/WebCore/Modules/webaudio/AudioProcessingEvent.h
--- webkitgtk-2.20.3/Source/WebCore/Modules/webaudio/AudioProcessingEvent.h.covscan_fixes_uninit_ctor 2018-02-19 08:45:31.000000000 +0100
+++ webkitgtk-2.20.3/Source/WebCore/Modules/webaudio/AudioProcessingEvent.h 2018-06-18 09:07:12.040744781 +0200
@@ -58,7 +58,7 @@ private:
RefPtr<AudioBuffer> m_inputBuffer;
RefPtr<AudioBuffer> m_outputBuffer;
- double m_playbackTime;
+ double m_playbackTime { 0.0 };
};
} // namespace WebCore
diff -up webkitgtk-2.20.3/Source/WebCore/Modules/webaudio/DelayDSPKernel.h.covscan_fixes_uninit_ctor webkitgtk-2.20.3/Source/WebCore/Modules/webaudio/DelayDSPKernel.h
--- webkitgtk-2.20.3/Source/WebCore/Modules/webaudio/DelayDSPKernel.h.covscan_fixes_uninit_ctor 2018-02-19 08:45:31.000000000 +0100
+++ webkitgtk-2.20.3/Source/WebCore/Modules/webaudio/DelayDSPKernel.h 2018-06-18 09:07:12.040744781 +0200
@@ -31,17 +31,17 @@
namespace WebCore {
class DelayProcessor;
-
+
class DelayDSPKernel : public AudioDSPKernel {
-public:
+public:
explicit DelayDSPKernel(DelayProcessor*);
DelayDSPKernel(double maxDelayTime, float sampleRate);
-
+
void process(const float* source, float* destination, size_t framesToProcess) override;
void reset() override;
-
+
double maxDelayTime() const { return m_maxDelayTime; }
-
+
void setDelayFrames(double numberOfFrames) { m_desiredDelayFrames = numberOfFrames; }
double tailTime() const override;
@@ -49,12 +49,12 @@ public:
private:
AudioFloatArray m_buffer;
- double m_maxDelayTime;
+ double m_maxDelayTime { 0.0 };
int m_writeIndex;
- double m_currentDelayTime;
- double m_smoothingRate;
+ double m_currentDelayTime { 0.0 };
+ double m_smoothingRate { 0.0 };
bool m_firstTime;
- double m_desiredDelayFrames;
+ double m_desiredDelayFrames { 0.0 };
AudioFloatArray m_delayTimes;
diff -up webkitgtk-2.20.3/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h.covscan_fixes_uninit_ctor webkitgtk-2.20.3/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h
--- webkitgtk-2.20.3/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h.covscan_fixes_uninit_ctor 2018-02-19 08:45:32.000000000 +0100
+++ webkitgtk-2.20.3/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h 2018-06-18 09:07:12.040744781 +0200
@@ -85,7 +85,7 @@ private:
ShShaderOutput m_shaderOutput;
ShShaderSpec m_shaderSpec;
- ShBuiltInResources m_resources;
+ ShBuiltInResources m_resources { };
};
} // namespace WebCore
diff -up webkitgtk-2.20.3/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h.covscan_fixes_uninit_ctor webkitgtk-2.20.3/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h
--- webkitgtk-2.20.3/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h.covscan_fixes_uninit_ctor 2018-02-19 08:45:32.000000000 +0100
+++ webkitgtk-2.20.3/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h 2018-06-18 09:07:12.040744781 +0200
@@ -72,7 +72,7 @@ private:
GLuint m_textureID;
IntSize m_size;
- GLint m_internalFormat;
+ GLint m_internalFormat { 0 };
TextureMapperGL::Flags m_extraFlags;
bool m_hasManagedTexture;
std::unique_ptr<UnmanagedBufferDataHolder> m_unmanagedBufferDataHolder;
diff -up webkitgtk-2.20.3/Source/WebCore/platform/gtk/ScrollbarThemeGtk.h.covscan_fixes_uninit_ctor webkitgtk-2.20.3/Source/WebCore/platform/gtk/ScrollbarThemeGtk.h
--- webkitgtk-2.20.3/Source/WebCore/platform/gtk/ScrollbarThemeGtk.h.covscan_fixes_uninit_ctor 2018-02-19 08:45:32.000000000 +0100
+++ webkitgtk-2.20.3/Source/WebCore/platform/gtk/ScrollbarThemeGtk.h 2018-06-18 09:07:12.041744777 +0200
@@ -61,10 +61,10 @@ public:
private:
void updateThemeProperties();
- bool m_hasForwardButtonStartPart : 1;
- bool m_hasForwardButtonEndPart : 1;
- bool m_hasBackButtonStartPart : 1;
- bool m_hasBackButtonEndPart : 1;
+ bool m_hasForwardButtonStartPart { true };
+ bool m_hasForwardButtonEndPart { true };
+ bool m_hasBackButtonStartPart { true };
+ bool m_hasBackButtonEndPart { true };
bool m_usesOverlayScrollbars { false };
#endif // GTK_API_VERSION_2
};
diff -up webkitgtk-2.20.3/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp.covscan_fixes_uninit_ctor webkitgtk-2.20.3/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
--- webkitgtk-2.20.3/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp.covscan_fixes_uninit_ctor 2018-02-19 08:45:32.000000000 +0100
+++ webkitgtk-2.20.3/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp 2018-06-18 09:07:12.042744773 +0200
@@ -454,10 +454,10 @@ private:
JPEGImageDecoder* m_decoder;
unsigned m_bufferLength;
int m_bytesToSkip;
- bool m_decodingSizeOnly;
+ bool m_decodingSizeOnly { false };
jpeg_decompress_struct m_info;
- decoder_error_mgr m_err;
+ decoder_error_mgr m_err { };
jstate m_state;
JSAMPARRAY m_samples;
diff -up webkitgtk-2.20.3/Source/WebCore/platform/text/TextCodecUTF16.h.covscan_fixes_uninit_ctor webkitgtk-2.20.3/Source/WebCore/platform/text/TextCodecUTF16.h
--- webkitgtk-2.20.3/Source/WebCore/platform/text/TextCodecUTF16.h.covscan_fixes_uninit_ctor 2018-02-19 08:45:32.000000000 +0100
+++ webkitgtk-2.20.3/Source/WebCore/platform/text/TextCodecUTF16.h 2018-06-18 09:07:12.042744773 +0200
@@ -42,7 +42,7 @@ private:
bool m_littleEndian;
bool m_haveBufferedByte { false };
- unsigned char m_bufferedByte;
+ unsigned char m_bufferedByte { 0 };
};
} // namespace WebCore
diff -up webkitgtk-2.20.3/Source/WebCore/platform/URL.h.covscan_fixes_uninit_ctor webkitgtk-2.20.3/Source/WebCore/platform/URL.h
--- webkitgtk-2.20.3/Source/WebCore/platform/URL.h.covscan_fixes_uninit_ctor 2018-04-09 13:02:14.000000000 +0200
+++ webkitgtk-2.20.3/Source/WebCore/platform/URL.h 2018-06-18 09:07:12.043744769 +0200
@@ -218,19 +218,19 @@ private:
bool hasPath() const;
String m_string;
- bool m_isValid : 1;
- bool m_protocolIsInHTTPFamily : 1;
- bool m_cannotBeABaseURL : 1;
+ bool m_isValid { true };
+ bool m_protocolIsInHTTPFamily { true };
+ bool m_cannotBeABaseURL { true };
- unsigned m_schemeEnd;
- unsigned m_userStart;
- unsigned m_userEnd;
- unsigned m_passwordEnd;
- unsigned m_hostEnd;
- unsigned m_portEnd;
- unsigned m_pathAfterLastSlash;
- unsigned m_pathEnd;
- unsigned m_queryEnd;
+ unsigned m_schemeEnd { 0 };
+ unsigned m_userStart { 0 };
+ unsigned m_userEnd { 0 };
+ unsigned m_passwordEnd { 0 };
+ unsigned m_hostEnd { 0 };
+ unsigned m_portEnd { 0 };
+ unsigned m_pathAfterLastSlash { 0 };
+ unsigned m_pathEnd { 0 };
+ unsigned m_queryEnd { 0 };
};
template <class Encoder>
diff -up webkitgtk-2.20.3/Source/WebCore/rendering/RenderFragmentedFlow.h.covscan_fixes_uninit_ctor webkitgtk-2.20.3/Source/WebCore/rendering/RenderFragmentedFlow.h
--- webkitgtk-2.20.3/Source/WebCore/rendering/RenderFragmentedFlow.h.covscan_fixes_uninit_ctor 2018-02-26 17:00:31.000000000 +0100
+++ webkitgtk-2.20.3/Source/WebCore/rendering/RenderFragmentedFlow.h 2018-06-18 09:07:12.043744769 +0200
@@ -231,7 +231,7 @@ protected:
private:
WeakPtr<RenderFragmentContainer> m_startFragment;
WeakPtr<RenderFragmentContainer> m_endFragment;
- bool m_rangeInvalidated;
+ bool m_rangeInvalidated { false };
};
typedef PODInterval<LayoutUnit, RenderFragmentContainer*> FragmentInterval;
diff -up webkitgtk-2.20.3/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h.covscan_fixes_uninit_ctor webkitgtk-2.20.3/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h
--- webkitgtk-2.20.3/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h.covscan_fixes_uninit_ctor 2018-02-19 08:45:32.000000000 +0100
+++ webkitgtk-2.20.3/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h 2018-06-18 09:07:12.043744769 +0200
@@ -58,7 +58,7 @@ struct NetworkProcessCreationParameters
bool canHandleHTTPSServerTrustEvaluation { true };
String cacheStorageDirectory;
- uint64_t cacheStoragePerOriginQuota;
+ uint64_t cacheStoragePerOriginQuota { 0 };
SandboxExtension::Handle cacheStorageDirectoryExtensionHandle;
String diskCacheDirectory;
SandboxExtension::Handle diskCacheDirectoryExtensionHandle;
diff -up webkitgtk-2.20.3/Source/WebKit/Shared/Plugins/PluginProcessCreationParameters.h.covscan_fixes_uninit_ctor webkitgtk-2.20.3/Source/WebKit/Shared/Plugins/PluginProcessCreationParameters.h
--- webkitgtk-2.20.3/Source/WebKit/Shared/Plugins/PluginProcessCreationParameters.h.covscan_fixes_uninit_ctor 2018-02-19 08:45:32.000000000 +0100
+++ webkitgtk-2.20.3/Source/WebKit/Shared/Plugins/PluginProcessCreationParameters.h 2018-06-18 09:07:12.045744761 +0200
@@ -49,7 +49,7 @@ struct PluginProcessCreationParameters {
void encode(IPC::Encoder&) const;
static bool decode(IPC::Decoder&, PluginProcessCreationParameters&);
- PluginProcessType processType;
+ PluginProcessType processType { PluginProcessTypeNormal };
bool supportsAsynchronousPluginInitialization;
Seconds minimumLifetime;
diff -up webkitgtk-2.20.3/Source/WebKit/UIProcess/API/glib/IconDatabase.h.covscan_fixes_uninit_ctor webkitgtk-2.20.3/Source/WebKit/UIProcess/API/glib/IconDatabase.h
--- webkitgtk-2.20.3/Source/WebKit/UIProcess/API/glib/IconDatabase.h.covscan_fixes_uninit_ctor 2018-02-19 08:45:33.000000000 +0100
+++ webkitgtk-2.20.3/Source/WebKit/UIProcess/API/glib/IconDatabase.h 2018-06-18 09:07:12.050744740 +0200
@@ -226,7 +226,7 @@ private:
Deque<Function<void()>> m_notificationQueue;
Lock m_notificationQueueLock;
- Atomic<bool> m_isActive;
+ Atomic<bool> m_isActive { false };
RunLoop::Timer<MainThreadNotifier> m_timer;
};

44
SOURCES/webkit-covscan_va_close.patch

@ -0,0 +1,44 @@ @@ -0,0 +1,44 @@
From 726cf686973683b1af76e3d9f5029cbe6d82edad Mon Sep 17 00:00:00 2001
From: Tomas Popela <tpopela@redhat.com>
Date: Tue, 24 Jul 2018 13:21:55 +0200
Subject: [PATCH 2/2] wip

---
Source/WTF/wtf/text/WTFString.cpp | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/Source/WTF/wtf/text/WTFString.cpp b/Source/WTF/wtf/text/WTFString.cpp
index 9c5edd6a992..57bf1f8d06a 100644
--- a/Source/WTF/wtf/text/WTFString.cpp
+++ b/Source/WTF/wtf/text/WTFString.cpp
@@ -462,7 +462,7 @@ WTF_ATTRIBUTE_PRINTF(1, 0) static String createWithFormatAndArguments(const char
if (strstr(format, "%@")) {
auto cfFormat = adoptCF(CFStringCreateWithCString(kCFAllocatorDefault, format, kCFStringEncodingUTF8));
auto result = adoptCF(CFStringCreateWithFormatAndArguments(kCFAllocatorDefault, nullptr, cfFormat.get(), args));
- va_end(args);
+ va_end(argsCopy);
return result.get();
}
#endif
@@ -474,12 +474,15 @@ WTF_ATTRIBUTE_PRINTF(1, 0) static String createWithFormatAndArguments(const char
char ch;
int result = vsnprintf(&ch, 1, format, args);
#endif
- va_end(args);
- if (result == 0)
+ if (!result) {
+ va_end(argsCopy);
return emptyString();
- if (result < 0)
+ }
+ if (result < 0) {
+ va_end(argsCopy);
return String();
+ }
Vector<char, 256> buffer;
unsigned len = result;
--
2.17.1

39
SOURCES/webkit-covscan_wtf.patch

@ -0,0 +1,39 @@ @@ -0,0 +1,39 @@
diff --git a/Source/WTF/wtf/CheckedArithmetic.h b/Source/WTF/wtf/CheckedArithmetic.h
index 31be98b0929b5924bd5dfee55482af8d3807d9ca..e668bf8a8364c6959e146084e77dd64d5af26987 100644
--- a/Source/WTF/wtf/CheckedArithmetic.h
+++ b/Source/WTF/wtf/CheckedArithmetic.h
@@ -489,7 +489,7 @@ template <typename ResultType> struct ArithmeticOperations<unsigned, int, Result
static inline bool multiply(int64_t lhs, int64_t rhs, ResultType& result)
{
- return ArithmeticOperations<int, unsigned, ResultType>::multiply(rhs, lhs, result);
+ return ArithmeticOperations<int, unsigned, ResultType>::multiply(lhs, rhs, result);
}
static inline bool equals(unsigned lhs, int rhs)
diff --git a/Source/WTF/wtf/ThreadSpecific.h b/Source/WTF/wtf/ThreadSpecific.h
index 1be1204cddf694521e82a576b8854237d0b59ee1..fc75b241e9eb6510d8cdd7c3fd0a3c1049b87d8e 100644
--- a/Source/WTF/wtf/ThreadSpecific.h
+++ b/Source/WTF/wtf/ThreadSpecific.h
@@ -122,7 +122,7 @@ private:
void static THREAD_SPECIFIC_CALL destroy(void* ptr);
#if USE(PTHREADS)
- pthread_key_t m_key;
+ pthread_key_t m_key { };
#elif OS(WINDOWS)
int m_index;
#endif
diff --git a/Source/WTF/wtf/dtoa.cpp b/Source/WTF/wtf/dtoa.cpp
index edefd7f884305fc2c20cb3f3bc571a7f980e30f7..7b5f59290101c3abb754c55f1ea4e11a7ec23258 100644
--- a/Source/WTF/wtf/dtoa.cpp
+++ b/Source/WTF/wtf/dtoa.cpp
@@ -360,7 +360,7 @@ struct P5Node {
public:
P5Node() { }
BigInt val;
- P5Node* next;
+ P5Node* next { nullptr };
};
static P5Node* p5s;

35
SOURCES/webkit-library_typos.patch

@ -0,0 +1,35 @@ @@ -0,0 +1,35 @@
From ecbb859d88eacad10bf556044abaeaed6c9b32fc Mon Sep 17 00:00:00 2001
From: "berto@igalia.com"
<berto@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu, 2 Nov 2017 13:41:16 +0000
Subject: [PATCH] Unreviewed, fix typos in library names for the GTK+ port.

* Source/cmake/OptionsGTK.cmake:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@224329 268f45cc-cd09-0410-ab3c-d52691b4dbfc
---
ChangeLog | 6 ++++++
Source/cmake/OptionsGTK.cmake | 4 ++--
2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/Source/cmake/OptionsGTK.cmake b/Source/cmake/OptionsGTK.cmake
index 2b440a27376..6c99868ae86 100644
--- a/Source/cmake/OptionsGTK.cmake
+++ b/Source/cmake/OptionsGTK.cmake
@@ -367,11 +367,11 @@ endif ()
if (USE_WOFF2)
find_package(BrotliDec 1.0.1)
if (NOT BROTLIDEC_FOUND)
- message(FATAL_ERROR "librotlidec is needed for USE_WOFF2.")
+ message(FATAL_ERROR "libbrotlidec is needed for USE_WOFF2.")
endif ()
find_package(WOFF2Dec 1.0.1)
if (NOT WOFF2DEC_FOUND)
- message(FATAL_ERROR "liwoff2dec is needed for USE_WOFF2.")
+ message(FATAL_ERROR "libwoff2dec is needed for USE_WOFF2.")
endif ()
endif ()
--
2.16.2

12
SOURCES/webkit-lower_libgcrypt_version.patch

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
diff -up webkitgtk-2.16.6/Source/cmake/OptionsGTK.cmake.libgcrypt webkitgtk-2.16.6/Source/cmake/OptionsGTK.cmake
--- webkitgtk-2.16.6/Source/cmake/OptionsGTK.cmake.libgcrypt 2017-08-07 11:55:53.254869026 +0200
+++ webkitgtk-2.16.6/Source/cmake/OptionsGTK.cmake 2017-08-07 11:56:11.259673114 +0200
@@ -32,7 +32,7 @@ set(INTROSPECTION_INSTALL_TYPELIBDIR "${
find_package(Cairo 1.10.2 REQUIRED)
find_package(Fontconfig 2.8.0 REQUIRED)
find_package(Freetype2 2.4.2 REQUIRED)
-find_package(LibGcrypt 1.6.0 REQUIRED)
+find_package(LibGcrypt 1.5.3 REQUIRED)
find_package(GTK3 3.6.0 REQUIRED)
find_package(GDK3 3.6.0 REQUIRED)
find_package(HarfBuzz 0.9.2 REQUIRED)

15
SOURCES/webkit-memset_zero_length.patch

@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
diff -up webkitgtk-2.20.3/Source/JavaScriptCore/runtime/HashMapImpl.h.memset_zero_length webkitgtk-2.20.3/Source/JavaScriptCore/runtime/HashMapImpl.h
--- webkitgtk-2.20.3/Source/JavaScriptCore/runtime/HashMapImpl.h.memset_zero_length 2018-02-19 08:45:16.000000000 +0100
+++ webkitgtk-2.20.3/Source/JavaScriptCore/runtime/HashMapImpl.h 2018-06-26 09:29:58.672408600 +0200
@@ -220,7 +220,10 @@ public:
ALWAYS_INLINE void reset(uint32_t capacity)
{
- memset(this, -1, allocationSize(capacity));
+#if COMPILER(GCC_OR_CLANG) && defined(_FORTIFY_SOURCE)
+ if (capacity && allocationSize(capacity))
+#endif
+ memset(this, -1, allocationSize(capacity));
}
};

197
SOURCES/webkit-minibrowser-labels.patch

@ -0,0 +1,197 @@ @@ -0,0 +1,197 @@
diff --git a/Tools/MiniBrowser/gtk/BrowserWindow.c b/Tools/MiniBrowser/gtk/BrowserWindow.c
index ece39c1b3c4..36b30657c9a 100644
--- a/Tools/MiniBrowser/gtk/BrowserWindow.c
+++ b/Tools/MiniBrowser/gtk/BrowserWindow.c
@@ -491,6 +491,7 @@ static void faviconChanged(WebKitWebView *webView, GParamSpec *paramSpec, Browse
static void webViewIsLoadingChanged(WebKitWebView *webView, GParamSpec *paramSpec, BrowserWindow *window)
{
gboolean isLoading = webkit_web_view_is_loading(webView);
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(window->reloadOrStopButton), isLoading ? "Stop" : "Reload");
gtk_tool_button_set_stock_id(GTK_TOOL_BUTTON(window->reloadOrStopButton), isLoading ? GTK_STOCK_STOP : GTK_STOCK_REFRESH);
}
@@ -710,6 +711,7 @@ static void browserWindowSetupEditorToolbar(BrowserWindow *window)
GtkToolItem *item = gtk_toggle_tool_button_new_from_stock(GTK_STOCK_BOLD);
window->boldItem = GTK_WIDGET(item);
gtk_widget_set_name(GTK_WIDGET(item), "Bold");
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), "Bold");
g_signal_connect(G_OBJECT(item), "toggled", G_CALLBACK(editingCommandCallback), window);
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
gtk_widget_show(GTK_WIDGET(item));
@@ -717,6 +719,7 @@ static void browserWindowSetupEditorToolbar(BrowserWindow *window)
item = gtk_toggle_tool_button_new_from_stock(GTK_STOCK_ITALIC);
window->italicItem = GTK_WIDGET(item);
gtk_widget_set_name(GTK_WIDGET(item), "Italic");
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), "Italic");
g_signal_connect(G_OBJECT(item), "toggled", G_CALLBACK(editingCommandCallback), window);
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
gtk_widget_show(GTK_WIDGET(item));
@@ -724,12 +727,14 @@ static void browserWindowSetupEditorToolbar(BrowserWindow *window)
item = gtk_toggle_tool_button_new_from_stock(GTK_STOCK_UNDERLINE);
window->underlineItem = GTK_WIDGET(item);
gtk_widget_set_name(GTK_WIDGET(item), "Underline");
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), "Underline");
g_signal_connect(G_OBJECT(item), "toggled", G_CALLBACK(editingCommandCallback), window);
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
gtk_widget_show(GTK_WIDGET(item));
item = gtk_toggle_tool_button_new_from_stock(GTK_STOCK_STRIKETHROUGH);
gtk_widget_set_name(GTK_WIDGET(item), "Strikethrough");
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), "Strikethrough");
window->strikethroughItem = GTK_WIDGET(item);
g_signal_connect(G_OBJECT(item), "toggled", G_CALLBACK(editingCommandCallback), window);
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
@@ -741,18 +746,21 @@ static void browserWindowSetupEditorToolbar(BrowserWindow *window)
item = gtk_tool_button_new_from_stock(GTK_STOCK_CUT);
gtk_widget_set_name(GTK_WIDGET(item), WEBKIT_EDITING_COMMAND_CUT);
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), WEBKIT_EDITING_COMMAND_CUT);
g_signal_connect(G_OBJECT(item), "clicked", G_CALLBACK(editingCommandCallback), window);
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
gtk_widget_show(GTK_WIDGET(item));
item = gtk_tool_button_new_from_stock(GTK_STOCK_COPY);
gtk_widget_set_name(GTK_WIDGET(item), WEBKIT_EDITING_COMMAND_COPY);
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), WEBKIT_EDITING_COMMAND_COPY);
g_signal_connect(G_OBJECT(item), "clicked", G_CALLBACK(editingCommandCallback), window);
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
gtk_widget_show(GTK_WIDGET(item));
item = gtk_tool_button_new_from_stock(GTK_STOCK_PASTE);
gtk_widget_set_name(GTK_WIDGET(item), WEBKIT_EDITING_COMMAND_PASTE);
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), WEBKIT_EDITING_COMMAND_PASTE);
g_signal_connect(G_OBJECT(item), "clicked", G_CALLBACK(editingCommandCallback), window);
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
gtk_widget_show(GTK_WIDGET(item));
@@ -763,12 +771,14 @@ static void browserWindowSetupEditorToolbar(BrowserWindow *window)
item = gtk_tool_button_new_from_stock(GTK_STOCK_UNDO);
gtk_widget_set_name(GTK_WIDGET(item), WEBKIT_EDITING_COMMAND_UNDO);
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), WEBKIT_EDITING_COMMAND_UNDO);
g_signal_connect(G_OBJECT(item), "clicked", G_CALLBACK(editingCommandCallback), window);
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
gtk_widget_show(GTK_WIDGET(item));
item = gtk_tool_button_new_from_stock(GTK_STOCK_REDO);
gtk_widget_set_name(GTK_WIDGET(item), WEBKIT_EDITING_COMMAND_REDO);
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), WEBKIT_EDITING_COMMAND_REDO);
g_signal_connect(G_OBJECT(item), "clicked", G_CALLBACK(editingCommandCallback), window);
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
gtk_widget_show(GTK_WIDGET(item));
@@ -780,6 +790,7 @@ static void browserWindowSetupEditorToolbar(BrowserWindow *window)
item = gtk_radio_tool_button_new_from_stock(NULL, GTK_STOCK_JUSTIFY_LEFT);
GSList *justifyRadioGroup = gtk_radio_tool_button_get_group(GTK_RADIO_TOOL_BUTTON(item));
gtk_widget_set_name(GTK_WIDGET(item), "JustifyLeft");
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), "Justify Left");
g_signal_connect(G_OBJECT(item), "toggled", G_CALLBACK(editingCommandCallback), window);
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
gtk_widget_show(GTK_WIDGET(item));
@@ -787,12 +798,14 @@ static void browserWindowSetupEditorToolbar(BrowserWindow *window)
item = gtk_radio_tool_button_new_from_stock(justifyRadioGroup, GTK_STOCK_JUSTIFY_CENTER);
justifyRadioGroup = gtk_radio_tool_button_get_group(GTK_RADIO_TOOL_BUTTON(item));
gtk_widget_set_name(GTK_WIDGET(item), "JustifyCenter");
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), "Justify Center");
g_signal_connect(G_OBJECT(item), "toggled", G_CALLBACK(editingCommandCallback), window);
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
gtk_widget_show(GTK_WIDGET(item));
item = gtk_radio_tool_button_new_from_stock(justifyRadioGroup, GTK_STOCK_JUSTIFY_RIGHT);
gtk_widget_set_name(GTK_WIDGET(item), "JustifyRight");
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), "Justify Right");
g_signal_connect(G_OBJECT(item), "toggled", G_CALLBACK(editingCommandCallback), window);
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
gtk_widget_show(GTK_WIDGET(item));
@@ -803,12 +816,14 @@ static void browserWindowSetupEditorToolbar(BrowserWindow *window)
item = gtk_tool_button_new_from_stock(GTK_STOCK_INDENT);
gtk_widget_set_name(GTK_WIDGET(item), "Indent");
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), "Indent");
g_signal_connect(G_OBJECT(item), "clicked", G_CALLBACK(editingCommandCallback), window);
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
gtk_widget_show(GTK_WIDGET(item));
item = gtk_tool_button_new_from_stock(GTK_STOCK_UNINDENT);
gtk_widget_set_name(GTK_WIDGET(item), "Outdent");
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), "Outdent");
g_signal_connect(G_OBJECT(item), "clicked", G_CALLBACK(editingCommandCallback), window);
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
gtk_widget_show(GTK_WIDGET(item));
@@ -819,12 +834,14 @@ static void browserWindowSetupEditorToolbar(BrowserWindow *window)
item = gtk_tool_button_new(NULL, NULL);
gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(item), "insert-image");
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), "Insert Image");
g_signal_connect(G_OBJECT(item), "clicked", G_CALLBACK(insertImageCommandCallback), window);
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
gtk_widget_show(GTK_WIDGET(item));
item = gtk_tool_button_new(NULL, NULL);
gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(item), "insert-link");
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), "Insert Link");
g_signal_connect(G_OBJECT(item), "clicked", G_CALLBACK(insertLinkCommandCallback), window);
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
gtk_widget_show(GTK_WIDGET(item));
@@ -976,6 +993,7 @@ static void browser_window_init(BrowserWindow *window)
window->backItem = GTK_WIDGET(item);
gtk_menu_tool_button_set_menu(GTK_MENU_TOOL_BUTTON(item), 0);
g_signal_connect_swapped(item, "clicked", G_CALLBACK(goBackCallback), (gpointer)window);
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), "Back");
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
gtk_widget_show(GTK_WIDGET(item));
@@ -983,40 +1001,47 @@ static void browser_window_init(BrowserWindow *window)
window->forwardItem = GTK_WIDGET(item);
gtk_menu_tool_button_set_menu(GTK_MENU_TOOL_BUTTON(item), 0);
g_signal_connect_swapped(G_OBJECT(item), "clicked", G_CALLBACK(goForwardCallback), (gpointer)window);
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), "Forward");
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
gtk_widget_show(GTK_WIDGET(item));
item = gtk_tool_button_new_from_stock(GTK_STOCK_PREFERENCES);
g_signal_connect_swapped(G_OBJECT(item), "clicked", G_CALLBACK(settingsCallback), window);
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), "Preferences");
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
gtk_widget_show(GTK_WIDGET(item));
item = gtk_tool_button_new_from_stock(GTK_STOCK_ZOOM_OUT);
window->zoomOutItem = GTK_WIDGET(item);
g_signal_connect_swapped(item, "clicked", G_CALLBACK(zoomOutCallback), window);
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), "Zoom Out");
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
gtk_widget_show(GTK_WIDGET(item));
item = gtk_tool_button_new_from_stock(GTK_STOCK_ZOOM_IN);
window->zoomInItem = GTK_WIDGET(item);
g_signal_connect_swapped(item, "clicked", G_CALLBACK(zoomInCallback), window);
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), "Zoom In");
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
gtk_widget_show(GTK_WIDGET(item));
item = gtk_tool_button_new_from_stock(GTK_STOCK_FIND);
g_signal_connect_swapped(item, "clicked", G_CALLBACK(searchCallback), window);
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), "Find");
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
gtk_widget_add_accelerator(GTK_WIDGET(item), "clicked", window->accelGroup, GDK_KEY_F, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
gtk_widget_show(GTK_WIDGET(item));
item = gtk_tool_button_new_from_stock(GTK_STOCK_HOME);
g_signal_connect_swapped(item, "clicked", G_CALLBACK(loadHomePage), window);
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), "Home");
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
gtk_widget_add_accelerator(GTK_WIDGET(item), "clicked", window->accelGroup, GDK_KEY_Home, GDK_MOD1_MASK, GTK_ACCEL_VISIBLE);
gtk_widget_show(GTK_WIDGET(item));
item = gtk_tool_button_new(gtk_image_new_from_icon_name("tab-new", GTK_ICON_SIZE_SMALL_TOOLBAR), NULL);
g_signal_connect_swapped(item, "clicked", G_CALLBACK(newTabCallback), window);
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), "New Tab");
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
gtk_widget_add_accelerator(GTK_WIDGET(item), "clicked", window->accelGroup, GDK_KEY_T, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
gtk_widget_show_all(GTK_WIDGET(item));
@@ -1031,6 +1056,7 @@ static void browser_window_init(BrowserWindow *window)
item = gtk_tool_button_new_from_stock(GTK_STOCK_REFRESH);
window->reloadOrStopButton = GTK_WIDGET(item);
g_signal_connect_swapped(item, "clicked", G_CALLBACK(reloadOrStopCallback), window);
+ gtk_tool_button_set_label(GTK_TOOL_BUTTON(item), "Reload");
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
gtk_widget_add_accelerator(window->reloadOrStopButton, "clicked", window->accelGroup, GDK_KEY_F5, 0, GTK_ACCEL_VISIBLE);
gtk_widget_show(window->reloadOrStopButton);

513
SOURCES/webkit-no_webp_demux.patch

@ -0,0 +1,513 @@ @@ -0,0 +1,513 @@
diff -up webkitgtk-2.20.2/Source/cmake/FindWebP.cmake.no_webp_demux webkitgtk-2.20.2/Source/cmake/FindWebP.cmake
--- webkitgtk-2.20.2/Source/cmake/FindWebP.cmake.no_webp_demux 2018-02-19 08:45:33.000000000 +0100
+++ webkitgtk-2.20.2/Source/cmake/FindWebP.cmake 2018-05-11 08:36:41.026235222 +0200
@@ -33,34 +33,20 @@ find_package(PkgConfig)
pkg_check_modules(PC_WEBP QUIET libwebp)
# Look for the header file.
-find_path(WEBP_INCLUDE_DIR
+find_path(WEBP_INCLUDE_DIRS
NAMES webp/decode.h
HINTS ${PC_WEBP_INCLUDEDIR} ${PC_WEBP_INCLUDE_DIRS}
)
-list(APPEND WEBP_INCLUDE_DIRS ${WEBP_INCLUDE_DIR})
mark_as_advanced(WEBP_INCLUDE_DIRS)
# Look for the library.
find_library(
- WEBP_LIBRARY
+ WEBP_LIBRARIES
NAMES webp
HINTS ${PC_WEBP_LIBDIR} ${PC_WEBP_LIBRARY_DIRS}
)
-list(APPEND WEBP_LIBRARIES ${WEBP_LIBRARY})
mark_as_advanced(WEBP_LIBRARIES)
-find_path(WEBP_DEMUX_INCLUDE_DIR
- NAMES webp/demux.h
- HINTS ${PC_WEBP_INCLUDEDIR} ${PC_WEBP_INCLUDE_DIRS}
-)
-list(APPEND WEBP_INCLUDE_DIRS ${WEBP_DEMUX_INCLUDE_DIR})
-
-find_library(WEBP_DEMUX_LIBRARY
- NAMES webpdemux
- HINTS ${PC_WEBP_LIBDIR} ${PC_WEBP_LIBRARY_DIRS}
-)
-list(APPEND WEBP_LIBRARIES ${WEBP_DEMUX_LIBRARY})
-
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(WebP REQUIRED_VARS WEBP_INCLUDE_DIRS WEBP_LIBRARIES
FOUND_VAR WEBP_FOUND)
diff -up webkitgtk-2.20.2/Source/WebCore/platform/graphics/ImageBackingStore.h.no_webp_demux webkitgtk-2.20.2/Source/WebCore/platform/graphics/ImageBackingStore.h
--- webkitgtk-2.20.2/Source/WebCore/platform/graphics/ImageBackingStore.h.no_webp_demux 2018-02-19 08:45:32.000000000 +0100
+++ webkitgtk-2.20.2/Source/WebCore/platform/graphics/ImageBackingStore.h 2018-05-11 08:36:41.027235218 +0200
@@ -147,6 +147,7 @@ public:
setPixel(pixelAt(x, y), r, g, b, a);
}
+#if ENABLE(APNG)
void blendPixel(RGBA32* dest, unsigned r, unsigned g, unsigned b, unsigned a)
{
if (!a)
@@ -172,6 +173,7 @@ public:
else
*dest = makeUnPremultipliedRGBA(r, g, b, a);
}
+#endif
static bool isOverSize(const IntSize& size)
{
diff -up webkitgtk-2.20.2/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp.no_webp_demux webkitgtk-2.20.2/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp
--- webkitgtk-2.20.2/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp.no_webp_demux 2018-02-19 08:45:32.000000000 +0100
+++ webkitgtk-2.20.2/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp 2018-05-11 09:19:25.756550925 +0200
@@ -31,49 +31,47 @@
#if USE(WEBP)
-namespace WebCore {
+// Backward emulation for earlier versions than 0.1.99.
+#if (WEBP_DECODER_ABI_VERSION < 0x0163)
+#define MODE_rgbA MODE_RGBA
+#define MODE_bgrA MODE_BGRA
+#endif
+
+#if CPU(BIG_ENDIAN) || CPU(MIDDLE_ENDIAN)
+inline WEBP_CSP_MODE outputMode(bool hasAlpha) { return hasAlpha ? MODE_rgbA : MODE_RGBA; }
+#else // LITTLE_ENDIAN, output BGRA pixels.
+inline WEBP_CSP_MODE outputMode(bool hasAlpha) { return hasAlpha ? MODE_bgrA : MODE_BGRA; }
+#endif
-// Convenience function to improve code readability, as WebPDemuxGetFrame is +1 based.
-bool webpFrameAtIndex(WebPDemuxer* demuxer, size_t index, WebPIterator* webpFrame)
-{
- return WebPDemuxGetFrame(demuxer, index + 1, webpFrame);
-}
+namespace WebCore {
WEBPImageDecoder::WEBPImageDecoder(AlphaOption alphaOption, GammaAndColorProfileOption gammaAndColorProfileOption)
: ScalableImageDecoder(alphaOption, gammaAndColorProfileOption)
+ , m_decoder(0)
+ , m_hasAlpha(false)
{
}
-WEBPImageDecoder::~WEBPImageDecoder() = default;
-
-void WEBPImageDecoder::setData(SharedBuffer& data, bool allDataReceived)
+WEBPImageDecoder::~WEBPImageDecoder()
{
- if (failed())
- return;
-
- // We need to ensure that the header is parsed everytime new data arrives, as the number
- // of frames may change until we have the complete data. If the size has not been obtained
- // yet, the call to ScalableImageDecoder::setData() will call parseHeader() and set
- // m_headerParsed to true, so the call to parseHeader() at the end won't do anything. If the size
- // is available, then parseHeader() is only called once.
- m_headerParsed = false;
- ScalableImageDecoder::setData(data, allDataReceived);
- parseHeader();
+ clear();
}
-RepetitionCount WEBPImageDecoder::repetitionCount() const
+void WEBPImageDecoder::clear()
{
- if (failed())
- return RepetitionCountOnce;
-
- return m_repetitionCount ? m_repetitionCount : RepetitionCountInfinite;
+ if (m_decoder)
+ WebPIDelete(m_decoder);
+ m_decoder = 0;
}
ImageFrame* WEBPImageDecoder::frameBufferAtIndex(size_t index)
{
- if (index >= frameCount())
+ if (index)
return 0;
+ if (m_frameBufferCache.isEmpty())
+ m_frameBufferCache.grow(1);
+
// The size of m_frameBufferCache may be smaller than the index requested. This can happen
// because new data may have arrived with a bigger frameCount, but decode() hasn't been called
// yet, which is the one that resizes the cache.
@@ -85,275 +83,73 @@ ImageFrame* WEBPImageDecoder::frameBuffe
return &m_frameBufferCache[index];
}
-size_t WEBPImageDecoder::findFirstRequiredFrameToDecode(size_t frameIndex, WebPDemuxer* demuxer)
-{
- // The first frame doesn't depend on any other.
- if (!frameIndex)
- return 0;
-
- // Go backwards and find the first complete frame.
- size_t firstIncompleteFrame = frameIndex;
- for (; firstIncompleteFrame; --firstIncompleteFrame) {
- if (m_frameBufferCache[firstIncompleteFrame - 1].isComplete())
- break;
- }
-
- // Check if there are any independent frames between firstIncompleteFrame and frameIndex.
- for (size_t firstIndependentFrame = frameIndex; firstIndependentFrame > firstIncompleteFrame ; --firstIndependentFrame) {
- WebPIterator webpFrame;
- if (!webpFrameAtIndex(demuxer, firstIndependentFrame, &webpFrame))
- continue;
-
- IntRect frameRect(webpFrame.x_offset, webpFrame.y_offset, webpFrame.width, webpFrame.height);
- if (!frameRect.contains({ { }, size() }))
- continue;
-
- // This frame covers the whole area and doesn't have alpha, so it can be rendered without
- // dependencies.
- if (!webpFrame.has_alpha)
- return firstIndependentFrame;
-
- // This frame covers the whole area and its disposalMethod is RestoreToBackground, which means
- // that the next frame will be rendered on top of a transparent background, and can be decoded
- // without dependencies. This can only be checked for frames prior to frameIndex.
- if (firstIndependentFrame < frameIndex && m_frameBufferCache[firstIndependentFrame].disposalMethod() == ImageFrame::DisposalMethod::RestoreToBackground)
- return firstIndependentFrame + 1;
- }
-
- return firstIncompleteFrame;
-}
-
-void WEBPImageDecoder::decode(size_t frameIndex, bool allDataReceived)
+bool WEBPImageDecoder::decode(bool onlySize, bool)
{
if (failed())
- return;
-
- // This can be executed both in the main thread (when not using async decoding) or in the decoding thread.
- // When executed in the decoding thread, a call to setData() from the main thread may change the data
- // the WebPDemuxer is using, leaving it in an inconsistent state, so we need to protect the data.
- RefPtr<SharedBuffer> protectedData(m_data);
- WebPData inputData = { reinterpret_cast<const uint8_t*>(protectedData->data()), protectedData->size() };
- WebPDemuxState demuxerState;
- WebPDemuxer* demuxer = WebPDemuxPartial(&inputData, &demuxerState);
- if (!demuxer) {
- setFailed();
- return;
- }
-
- m_frameBufferCache.resize(m_frameCount);
-
- // It is a fatal error if all data is received and we have decoded all frames available but the file is truncated.
- if (frameIndex >= m_frameBufferCache.size() - 1 && allDataReceived && demuxer && demuxerState != WEBP_DEMUX_DONE) {
- WebPDemuxDelete(demuxer);
- setFailed();
- return;
- }
-
- for (size_t i = findFirstRequiredFrameToDecode(frameIndex, demuxer); i <= frameIndex; i++)
- decodeFrame(i, demuxer);
+ return false;
- WebPDemuxDelete(demuxer);
-}
+ const uint8_t* dataBytes = reinterpret_cast<const uint8_t*>(m_data->data());
+ const size_t dataSize = m_data->size();
-void WEBPImageDecoder::decodeFrame(size_t frameIndex, WebPDemuxer* demuxer)
-{
- if (failed())
- return;
+ if (ScalableImageDecoder::encodedDataStatus() < EncodedDataStatus::SizeAvailable) {
+ static const size_t imageHeaderSize = 30;
+ if (dataSize < imageHeaderSize)
+ return false;
+ int width, height;
+#if (WEBP_DECODER_ABI_VERSION >= 0x0163)
+ WebPBitstreamFeatures features;
+ if (WebPGetFeatures(dataBytes, dataSize, &features) != VP8_STATUS_OK)
+ return setFailed();
+ width = features.width;
+ height = features.height;
+ m_hasAlpha = features.has_alpha;
+#else
+ // Earlier version won't be able to display WebP files with alpha.
+ if (!WebPGetInfo(dataBytes, dataSize, &width, &height))
+ return setFailed();
+ m_hasAlpha = false;
+#endif
+ if (!setSize(IntSize(width, height)))
+ return setFailed();
+ }
+
+ ASSERT(ScalableImageDecoder::encodedDataStatus() >= EncodedDataStatus::SizeAvailable);
+ if (onlySize)
+ return true;
- WebPIterator webpFrame;
- if (!webpFrameAtIndex(demuxer, frameIndex, &webpFrame))
- return;
-
- const uint8_t* dataBytes = reinterpret_cast<const uint8_t*>(webpFrame.fragment.bytes);
- size_t dataSize = webpFrame.fragment.size;
- bool blend = webpFrame.blend_method == WEBP_MUX_BLEND ? true : false;
-
- ASSERT(m_frameBufferCache.size() > frameIndex);
- ImageFrame& buffer = m_frameBufferCache[frameIndex];
- buffer.setDuration(Seconds::fromMilliseconds(webpFrame.duration));
- buffer.setDisposalMethod(webpFrame.dispose_method == WEBP_MUX_DISPOSE_BACKGROUND ? ImageFrame::DisposalMethod::RestoreToBackground : ImageFrame::DisposalMethod::DoNotDispose);
+ ASSERT(!m_frameBufferCache.isEmpty());
+ ImageFrame& buffer = m_frameBufferCache[0];
ASSERT(!buffer.isComplete());
- if (buffer.isInvalid() && !initFrameBuffer(frameIndex, &webpFrame)) {
- setFailed();
- return;
- }
-
- WebPDecBuffer decoderBuffer;
- WebPInitDecBuffer(&decoderBuffer);
- decoderBuffer.colorspace = MODE_RGBA;
- decoderBuffer.u.RGBA.stride = webpFrame.width * sizeof(RGBA32);
- decoderBuffer.u.RGBA.size = decoderBuffer.u.RGBA.stride * webpFrame.height;
- decoderBuffer.is_external_memory = 1;
- std::unique_ptr<unsigned char[]> p(new uint8_t[decoderBuffer.u.RGBA.size]());
- decoderBuffer.u.RGBA.rgba = p.get();
- if (!decoderBuffer.u.RGBA.rgba) {
- setFailed();
- return;
- }
-
- WebPIDecoder* decoder = WebPINewDecoder(&decoderBuffer);
- if (!decoder) {
- setFailed();
- return;
+ if (buffer.isInvalid()) {
+ if (!buffer.initialize(size(), m_premultiplyAlpha))
+ return setFailed();
+ buffer.setDecodingStatus(DecodingStatus::Partial);
+ buffer.setHasAlpha(m_hasAlpha);
+ }
+
+ if (!m_decoder) {
+ WEBP_CSP_MODE mode = outputMode(m_hasAlpha);
+ if (!m_premultiplyAlpha)
+ mode = outputMode(false);
+ int rowStride = size().width() * sizeof(RGBA32);
+ uint8_t* output = reinterpret_cast<uint8_t*>(buffer.backingStore()->pixelAt(0, 0));
+ int outputSize = size().height() * rowStride;
+ m_decoder = WebPINewRGB(mode, output, outputSize, rowStride);
+ if (!m_decoder)
+ return setFailed();
}
- switch (WebPIUpdate(decoder, dataBytes, dataSize)) {
+ switch (WebPIUpdate(m_decoder, dataBytes, dataSize)) {
case VP8_STATUS_OK:
- applyPostProcessing(frameIndex, decoder, decoderBuffer, blend);
buffer.setDecodingStatus(DecodingStatus::Complete);
- break;
+ clear();
+ return true;
case VP8_STATUS_SUSPENDED:
- if (!isAllDataReceived()) {
- applyPostProcessing(frameIndex, decoder, decoderBuffer, blend);
- buffer.setDecodingStatus(DecodingStatus::Partial);
- break;
- }
- // Fallthrough.
- default:
- setFailed();
- }
-
- WebPIDelete(decoder);
-}
-
-bool WEBPImageDecoder::initFrameBuffer(size_t frameIndex, const WebPIterator* webpFrame)
-{
- if (frameIndex >= frameCount())
return false;
-
- ImageFrame& buffer = m_frameBufferCache[frameIndex];
-
- // Initialize the frame rect in our buffer.
- IntRect frameRect(webpFrame->x_offset, webpFrame->y_offset, webpFrame->width, webpFrame->height);
-
- // Make sure the frameRect doesn't extend outside the buffer.
- frameRect.intersect({ { }, size() });
-
- if (!frameIndex || !m_frameBufferCache[frameIndex - 1].backingStore()) {
- // This frame doesn't rely on any previous data.
- if (!buffer.initialize(size(), m_premultiplyAlpha))
- return false;
- } else {
- const ImageFrame& prevBuffer = m_frameBufferCache[frameIndex - 1];
- ASSERT(prevBuffer.isComplete());
-
- // Preserve the last frame as the starting state for this frame.
- if (!prevBuffer.backingStore() || !buffer.initialize(*prevBuffer.backingStore()))
- return false;
-
- if (prevBuffer.disposalMethod() == ImageFrame::DisposalMethod::RestoreToBackground) {
- // We want to clear the previous frame to transparent, without
- // affecting pixels in the image outside of the frame.
- const IntRect& prevRect = prevBuffer.backingStore()->frameRect();
- buffer.backingStore()->clearRect(prevRect);
- }
- }
-
- buffer.setHasAlpha(webpFrame->has_alpha);
- buffer.backingStore()->setFrameRect(frameRect);
-
- return true;
-}
-
-void WEBPImageDecoder::applyPostProcessing(size_t frameIndex, WebPIDecoder* decoder, WebPDecBuffer& decoderBuffer, bool blend)
-{
- ImageFrame& buffer = m_frameBufferCache[frameIndex];
- int decodedWidth = 0;
- int decodedHeight = 0;
- if (!WebPIDecGetRGB(decoder, &decodedHeight, &decodedWidth, 0, 0))
- return; // See also https://bugs.webkit.org/show_bug.cgi?id=74062
- if (decodedHeight <= 0)
- return;
-
- const IntRect& frameRect = buffer.backingStore()->frameRect();
- ASSERT_WITH_SECURITY_IMPLICATION(decodedWidth == frameRect.width());
- ASSERT_WITH_SECURITY_IMPLICATION(decodedHeight <= frameRect.height());
- const int left = frameRect.x();
- const int top = frameRect.y();
-
- for (int y = 0; y < decodedHeight; y++) {
- const int canvasY = top + y;
- for (int x = 0; x < decodedWidth; x++) {
- const int canvasX = left + x;
- RGBA32* address = buffer.backingStore()->pixelAt(canvasX, canvasY);
- uint8_t* pixel = decoderBuffer.u.RGBA.rgba + (y * frameRect.width() + x) * sizeof(RGBA32);
- if (blend && (pixel[3] < 255))
- buffer.backingStore()->blendPixel(address, pixel[0], pixel[1], pixel[2], pixel[3]);
- else
- buffer.backingStore()->setPixel(address, pixel[0], pixel[1], pixel[2], pixel[3]);
- }
- }
-}
-
-void WEBPImageDecoder::parseHeader()
-{
- if (m_headerParsed)
- return;
-
- m_headerParsed = true;
-
- const unsigned webpHeaderSize = 30; // RIFF_HEADER_SIZE + CHUNK_HEADER_SIZE + VP8_FRAME_HEADER_SIZE
- if (m_data->size() < webpHeaderSize)
- return; // Await VP8X header so WebPDemuxPartial succeeds.
-
- WebPData inputData = { reinterpret_cast<const uint8_t*>(m_data->data()), m_data->size() };
- WebPDemuxState demuxerState;
- WebPDemuxer* demuxer = WebPDemuxPartial(&inputData, &demuxerState);
- if (!demuxer) {
- setFailed();
- return;
- }
-
- m_frameCount = WebPDemuxGetI(demuxer, WEBP_FF_FRAME_COUNT);
- if (!m_frameCount) {
- WebPDemuxDelete(demuxer);
- return; // Wait until the encoded image frame data arrives.
- }
-
- int width = WebPDemuxGetI(demuxer, WEBP_FF_CANVAS_WIDTH);
- int height = WebPDemuxGetI(demuxer, WEBP_FF_CANVAS_HEIGHT);
- if (!isSizeAvailable() && !setSize(IntSize(width, height))) {
- WebPDemuxDelete(demuxer);
- return;
- }
-
- m_formatFlags = WebPDemuxGetI(demuxer, WEBP_FF_FORMAT_FLAGS);
- if (!(m_formatFlags & ANIMATION_FLAG))
- m_repetitionCount = WebCore::RepetitionCountNone;
- else {
- // Since we have parsed at least one frame, even if partially,
- // the global animation (ANIM) properties have been read since
- // an ANIM chunk must precede the ANMF frame chunks.
- m_repetitionCount = WebPDemuxGetI(demuxer, WEBP_FF_LOOP_COUNT);
- ASSERT(m_repetitionCount == (m_repetitionCount & 0xffff)); // Loop count is always <= 16 bits.
- if (!m_repetitionCount)
- m_repetitionCount = WebCore::RepetitionCountInfinite;
- }
-
- WebPDemuxDelete(demuxer);
-}
-
-void WEBPImageDecoder::clearFrameBufferCache(size_t clearBeforeFrame)
-{
- if (m_frameBufferCache.isEmpty())
- return;
-
- // We don't want to delete the last frame in the cache, as is may be needed for
- // decoding when new data arrives. See GIFImageDecoder for the full explanation.
- clearBeforeFrame = std::min(clearBeforeFrame, m_frameBufferCache.size() - 1);
-
- // Also from GIFImageDecoder: We need to preserve frames such that:
- // * We don't clear |clearBeforeFrame|.
- // * We don't clear the frame we're currently decoding.
- // * We don't clear any frame from which a future initFrameBuffer() call will copy bitmap data.
- //
- // In WEBP every frame depends on the previous one or none. That means that frames after clearBeforeFrame
- // won't need any frame before them to render, so we can clear them all.
- for (int i = clearBeforeFrame - 1; i >= 0; i--) {
- ImageFrame& buffer = m_frameBufferCache[i];
- if (!buffer.isInvalid())
- buffer.clear();
+ default:
+ clear();
+ return setFailed();
}
}
diff -up webkitgtk-2.20.2/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.h.no_webp_demux webkitgtk-2.20.2/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.h
--- webkitgtk-2.20.2/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.h.no_webp_demux 2018-02-19 08:45:32.000000000 +0100
+++ webkitgtk-2.20.2/Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.h 2018-05-11 08:36:41.029235210 +0200
@@ -33,7 +33,6 @@
#if USE(WEBP)
#include "webp/decode.h"
-#include "webp/demux.h"
namespace WebCore {
@@ -47,26 +46,19 @@ public:
virtual ~WEBPImageDecoder();
String filenameExtension() const override { return ASCIILiteral("webp"); }
- void setData(SharedBuffer&, bool) final;
ImageFrame* frameBufferAtIndex(size_t index) override;
- RepetitionCount repetitionCount() const override;
- size_t frameCount() const override { return m_frameCount; }
- void clearFrameBufferCache(size_t) override;
private:
WEBPImageDecoder(AlphaOption, GammaAndColorProfileOption);
- void tryDecodeSize(bool) override { parseHeader(); }
- void decode(size_t, bool);
- void decodeFrame(size_t, WebPDemuxer*);
- void parseHeader();
- bool initFrameBuffer(size_t, const WebPIterator*);
- void applyPostProcessing(size_t, WebPIDecoder*, WebPDecBuffer&, bool);
- size_t findFirstRequiredFrameToDecode(size_t, WebPDemuxer*);
-
- int m_repetitionCount { 0 };
- size_t m_frameCount { 0 };
- int m_formatFlags { 0 };
- bool m_headerParsed { false };
+ void tryDecodeSize(bool allDataReceived) override { decode(true, allDataReceived); }
+
+ bool decode(bool onlySize, bool allDataReceived);
+
+ WebPIDecoder* m_decoder;
+ bool m_hasAlpha;
+
+ void applyColorProfile(const uint8_t*, size_t, ImageFrame&) { };
+ void clear();
};
} // namespace WebCore

17
SOURCES/webkit-page_size.patch

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
diff --git a/Source/JavaScriptCore/heap/MarkedBlock.h b/Source/JavaScriptCore/heap/MarkedBlock.h
index 7d14eecfd8d..95ea41c04dd 100644
--- a/Source/JavaScriptCore/heap/MarkedBlock.h
+++ b/Source/JavaScriptCore/heap/MarkedBlock.h
@@ -66,7 +66,12 @@ private:
friend class Handle;
public:
static constexpr size_t atomSize = 16; // bytes
+
+#if CPU(PPC64) || CPU(PPC64LE) || CPU(PPC) || CPU(ARM64) || CPU(UNKNOWN)
+ static constexpr size_t blockSize = 64 * KB;
+#else
static constexpr size_t blockSize = 16 * KB;
+#endif
static constexpr size_t blockMask = ~(blockSize - 1); // blockSize must be a power of two.
static constexpr size_t atomsPerBlock = blockSize / atomSize;

12853
SOURCES/webkit-remove_brotli.patch

File diff suppressed because one or more lines are too long

5289
SOURCES/webkit-remove_woff2.patch

File diff suppressed because it is too large Load Diff

111
SOURCES/webkit-woff2_1.0.2.patch

@ -0,0 +1,111 @@ @@ -0,0 +1,111 @@
From aacbb7501a1c9b16a73211a8a67ff5b028e92988 Mon Sep 17 00:00:00 2001
From: "mcatanzaro@igalia.com"
<mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue, 14 Nov 2017 00:42:20 +0000
Subject: [PATCH] [GTK] Require woff2 1.0.2 and drop direct brotli dependency
https://bugs.webkit.org/show_bug.cgi?id=179630
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Reviewed by Frédéric Wang.

.:

* Source/cmake/FindBrotliDec.cmake: Removed.
* Source/cmake/OptionsGTK.cmake:

Tools:

* gtk/jhbuild.modules:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@224793 268f45cc-cd09-0410-ab3c-d52691b4dbfc
---
ChangeLog | 10 ++++++++
Source/cmake/FindBrotliDec.cmake | 53 ----------------------------------------
Source/cmake/OptionsGTK.cmake | 6 +----
Tools/ChangeLog | 9 +++++++
Tools/gtk/jhbuild.modules | 2 +-
5 files changed, 21 insertions(+), 59 deletions(-)
delete mode 100644 Source/cmake/FindBrotliDec.cmake

diff --git a/Source/cmake/FindBrotliDec.cmake b/Source/cmake/FindBrotliDec.cmake
deleted file mode 100644
index 3a8cf90357f..00000000000
--- a/Source/cmake/FindBrotliDec.cmake
+++ /dev/null
@@ -1,53 +0,0 @@
-# - Try to find BrotliDec.
-# Once done, this will define
-#
-# BROTLIDEC_FOUND - system has BrotliDec.
-# BROTLIDEC_INCLUDE_DIRS - the BrotliDec include directories
-# BROTLIDEC_LIBRARIES - link these to use BrotliDec.
-#
-# Copyright (C) 2017 Igalia S.L.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
-# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-find_package(PkgConfig)
-pkg_check_modules(PC_BROTLIDEC libbrotlidec)
-
-find_path(BROTLIDEC_INCLUDE_DIRS
- NAMES brotli/decode.h
- HINTS ${PC_BROTLIDEC_INCLUDEDIR}
-)
-
-find_library(BROTLIDEC_LIBRARIES
- NAMES brotlidec
- HINTS ${PC_BROTLIDEC_LIBDIR}
-)
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(BrotliDec
- REQUIRED_VARS BROTLIDEC_INCLUDE_DIRS BROTLIDEC_LIBRARIES
- FOUND_VAR BROTLIDEC_FOUND
- VERSION_VAR PC_BROTLIDEC_VERSION)
-
-mark_as_advanced(
- BROTLIDEC_INCLUDE_DIRS
- BROTLIDEC_LIBRARIES
-)
diff --git a/Source/cmake/OptionsGTK.cmake b/Source/cmake/OptionsGTK.cmake
index ba7e134c7cc..39c3a9be47e 100644
--- a/Source/cmake/OptionsGTK.cmake
+++ b/Source/cmake/OptionsGTK.cmake
@@ -365,11 +365,7 @@ if (USE_UPOWER)
endif ()
if (USE_WOFF2)
- find_package(BrotliDec 1.0.1)
- if (NOT BROTLIDEC_FOUND)
- message(FATAL_ERROR "libbrotlidec is needed for USE_WOFF2.")
- endif ()
- find_package(WOFF2Dec 1.0.1)
+ find_package(WOFF2Dec 1.0.2)
if (NOT WOFF2DEC_FOUND)
message(FATAL_ERROR "libwoff2dec is needed for USE_WOFF2.")
endif ()
--
2.16.2

618
SPECS/webkitgtk4.spec

@ -0,0 +1,618 @@ @@ -0,0 +1,618 @@
## NOTE: Lots of files in various subdirectories have the same name (such as
## "LICENSE") so this short macro allows us to distinguish them by using their
## directory names (from the source tree) as prefixes for the files.
%global add_to_license_files() \
mkdir -p _license_files ; \
cp -p %1 _license_files/$(echo '%1' | sed -e 's!/!.!g')

# Bundle ICU 57 - see https://bugzilla.redhat.com/show_bug.cgi?id=1414413
%define bundle_icu 1
%if 0%{?bundle_icu}
# Filter out provides/requires for private libraries
%global __provides_exclude %{?__provides_exclude:%__provides_exclude|}libicu.*
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}libicu.*
%global __provides_exclude_from ^%{_libdir}/webkit2gtk-4\\.0/.*\\.so$
%endif

# Increase the DIE limit so our debuginfo packages could be size optimized.
# Fedora bug - https://bugzilla.redhat.com/show_bug.cgi?id=1456261
%global _dwz_max_die_limit 250000000
# The _dwz_max_die_limit is being overridden by the arch specific ones from the
# redhat-rpm-config so we need to set the arch specific ones as well - now it
# is only needed for x86_64.
%global _dwz_max_die_limit_x86_64 250000000

# As we are using the DTS we have to build this package as:
# rhpkg build --target rhel-7.6-devtoolset-7-candidate

Name: webkitgtk4
Version: 2.20.5
Release: 1%{?dist}
Summary: GTK+ Web content engine library

License: LGPLv2
URL: http://www.webkitgtk.org
Source0: http://webkitgtk.org/releases/webkitgtk-%{version}.tar.xz
%if 0%{?bundle_icu}
Source1: http://download.icu-project.org/files/icu4c/57.1/icu4c-57_1-src.tgz
%endif


# https://bugs.webkit.org/show_bug.cgi?id=132333
Patch0: webkit-cloop_big_endians.patch
# Silly workaround for
# https://bugs.webkit.org/show_bug.cgi?id=182923
Patch1: webkit-page_size.patch
# Revert woff2 and brotli removal to bundle them again, as they are not
# included in RHEL 7
# https://bugs.webkit.org/show_bug.cgi?id=179630
Patch2: webkit-woff2_1.0.2.patch
# https://trac.webkit.org/changeset/224329
Patch3: webkit-library_typos.patch
# https://bugs.webkit.org/show_bug.cgi?id=177862
Patch4: webkit-remove_woff2.patch
# https://bugs.webkit.org/show_bug.cgi?id=177804
Patch5: webkit-remove_brotli.patch
# We don't have new enough version of libgcrypt to support Subtle Crypto, lower
# the version in the check so configure can pass and also disable Subtle Crypto
# through cmake argument.
Patch6: webkit-lower_libgcrypt_version.patch
# We don't have new enough version of libwebp (that has demux) to support the
# animated WebP images - revert the change that introduced it.
Patch7: webkit-no_webp_demux.patch
Patch8: webkit-memset_zero_length.patch
Patch9: webkit-covscan_already_fixed.patch
Patch10: webkit-covscan_uninit_ctor.patch
Patch11: webkit-covscan_uninit.patch
# https://bugs.webkit.org/show_bug.cgi?id=186756
Patch12: webkit-covscan_1.patch
# https://bugs.webkit.org/show_bug.cgi?id=186757
Patch13: webkit-covscan_2.patch
Patch14: webkit-covscan_3.patch
# https://bugs.webkit.org/show_bug.cgi?id=186758
Patch15: webkit-covscan_va_close.patch
# https://bugs.webkit.org/show_bug.cgi?id=186763
Patch16: webkit-covscan_bmalloc.patch
# https://bugs.webkit.org/show_bug.cgi?id=186800
Patch17: webkit-covscan_wtf.patch
# https://bugs.webkit.org/show_bug.cgi?id=187087
Patch18: webkit-covscan_gstreamer.patch
# For QA tests
Patch19: webkit-minibrowser-labels.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1591638
Patch20: webkit-atk_crash.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1503624
Patch21: webkit-atk_continuation_crash.patch


%if 0%{?bundle_icu}
Patch50: icu-8198.revert.icu5431.patch
Patch51: icu-8800.freeserif.crash.patch
Patch52: icu-7601.Indic-ccmp.patch
Patch53: icu-gennorm2-man.patch
Patch54: icu-icuinfo-man.patch
Patch55: icu-armv7hl-disable-tests.patch
Patch56: icu-rhbz1360340-icu-changeset-39109.patch
Patch57: icu-diff-icu_trunk_source_common_locid.cpp-from-39282-to-39384.patch
Patch58: icu-dont_use_clang_even_if_installed.patch
# CVE-2017-7867 CVE-2017-7868
Patch59: icu-rhbz1444101-icu-changeset-39671.patch
%endif

BuildRequires: at-spi2-core-devel
BuildRequires: bison
BuildRequires: cairo-devel
BuildRequires: enchant-devel
BuildRequires: flex
BuildRequires: fontconfig-devel
BuildRequires: freetype-devel
BuildRequires: geoclue2-devel
BuildRequires: gettext
BuildRequires: glib2-devel
BuildRequires: gobject-introspection-devel
BuildRequires: gperf
BuildRequires: gstreamer1-devel
BuildRequires: gstreamer1-plugins-base-devel
BuildRequires: gstreamer1-plugins-bad-free-devel
BuildRequires: gtk2-devel
BuildRequires: gtk3-devel
BuildRequires: gtk-doc >= 1.25
BuildRequires: harfbuzz-devel
%if ! 0%{?bundle_icu}
BuildRequires: libicu-devel
%endif
BuildRequires: libjpeg-devel
BuildRequires: libnotify-devel
BuildRequires: libpng-devel
BuildRequires: libsecret-devel
BuildRequires: libsoup-devel >= 2.56
BuildRequires: libwebp-devel
BuildRequires: libxslt-devel
BuildRequires: libXt-devel
BuildRequires: libwayland-client-devel
BuildRequires: libwayland-egl-devel
BuildRequires: libwayland-server-devel
BuildRequires: mesa-libEGL-devel
BuildRequires: mesa-libGL-devel
BuildRequires: mesa-libGLES-devel
BuildRequires: pcre-devel
BuildRequires: perl-Switch
BuildRequires: perl-JSON-PP
BuildRequires: ruby
BuildRequires: rubygems
BuildRequires: sqlite-devel
BuildRequires: hyphen-devel
BuildRequires: gnutls-devel
%if 0%{?rhel} == 7
BuildRequires: devtoolset-7-gcc
BuildRequires: devtoolset-7-gcc-c++
BuildRequires: devtoolset-7-build
BuildRequires: devtoolset-7-libatomic-devel
BuildRequires: llvm-toolset-7-cmake
%else
BuildRequires: libatomic
BuildRequires: cmake
%endif

Requires: geoclue2

%if 0%{?bundle_icu}
BuildRequires: doxygen
BuildRequires: autoconf
BuildRequires: python
%endif

# Obsolete libwebkit2gtk from the webkitgtk3 package
Obsoletes: libwebkit2gtk < 2.5.0
Provides: libwebkit2gtk = %{version}-%{release}

# We're supposed to specify versions here, but these Google libs don't do
# normal releases. Accordingly, they're not suitable to be system libs.
# Provides: bundled(angle)
# Provides: bundled(brotli)
# Provides: bundled(woff2)

# Require the jsc subpackage
Requires: %{name}-jsc%{?_isa} = %{version}-%{release}

# Require the support for the GTK+ 2 based NPAPI plugins
# Would be nice to recommend as in Fedora, but RHEL7 RPM doesn't support it.
Requires: %{name}-plugin-process-gtk2%{?_isa} = %{version}-%{release}

%description
WebKitGTK+ is the port of the portable web rendering engine WebKit to the
GTK+ platform.

This package contains WebKitGTK+ for GTK+ 3.

%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: %{name}-jsc%{?_isa} = %{version}-%{release}
Requires: %{name}-jsc-devel%{?_isa} = %{version}-%{release}

%description devel
The %{name}-devel package contains libraries, build data, and header
files for developing applications that use %{name}.

%package doc
Summary: Documentation files for %{name}
BuildArch: noarch
Requires: %{name} = %{version}-%{release}

%description doc
This package contains developer documentation for %{name}.

%package jsc
Summary: JavaScript engine from %{name}
Requires: %{name} = %{version}-%{release}

%description jsc
This package contains JavaScript engine from %{name}.

%package jsc-devel
Summary: Development files for JavaScript engine from %{name}
Requires: %{name}-jsc%{?_isa} = %{version}-%{release}
Requires: %{name} = %{version}-%{release}

%description jsc-devel
The %{name}-jsc-devel package contains libraries, build data, and header
files for developing applications that use JavaScript engine from %{name}.

%package plugin-process-gtk2
Summary: GTK+ 2 based NPAPI plugins support for %{name}
Requires: %{name}-jsc%{?_isa} = %{version}-%{release}
Requires: %{name} = %{version}-%{release}

%description plugin-process-gtk2
Support for the GTK+ 2 based NPAPI plugins (such as Adobe Flash) for %{name}.

%prep
%if 0%{?bundle_icu}
%setup -q -T -n icu -b 1
%patch50 -p2 -R -b .icu8198.revert.icu5431.patch
%patch51 -p1 -b .icu8800.freeserif.crash.patch
%patch52 -p1 -b .icu7601.Indic-ccmp.patch
%patch53 -p1 -b .gennorm2-man.patch
%patch54 -p1 -b .icuinfo-man.patch
%ifarch armv7hl
%patch55 -p1 -b .armv7hl-disable-tests.patch
%endif
%patch56 -p1 -b .rhbz1360340-icu-changeset-39109.patch
%patch57 -p1 -b .diff-icu_trunk_source_common_locid.cpp-from-39282-to-39384.patch
%patch58 -p1 -b .dont_use_clang_even_if_installed
%patch59 -p1 -b .rhbz1444101-icu-changeset-39671.patch

%setup -q -T -n webkitgtk-%{version} -b 0
%patch0 -p1 -b .cloop_big_endians
%patch1 -p1 -b .page_size
%patch2 -R -p1 -b .woff2_1.0.2
%patch3 -R -p1 -b .library_typos
%patch4 -p1 -b .remove_woff2
%patch5 -p1 -b .remove_brotli
%patch6 -p1 -b .lower_libgcrypt_version
%patch7 -p1 -b .no_webp_demux
%patch8 -p1 -b .memset_zero_length
%patch9 -p1 -b .covscan_already_fixed
%patch10 -p1 -b .covscan_uninit_ctor
%patch11 -p1 -b .covscan_uninit
%patch12 -p1 -b .covscan_1
%patch13 -p1 -b .covscan_2
%patch14 -p1 -b .covscan_3
%patch15 -p1 -b .covscan_va_close
%patch16 -p1 -b .covscan_bmalloc
%patch17 -p1 -b .covscan_wtf
%patch18 -p1 -b .covscan_gstreamer
%patch19 -p1 -b .minibrowser_labels
%patch20 -p1 -b .atk_crash
%patch21 -p1 -b .atk_continuation_crash
%else
%autosetup -p1 -n webkitgtk-%{version}
%endif

# Remove bundled libraries
rm -rf Source/ThirdParty/gtest/
rm -rf Source/ThirdParty/qunit/

%build
%ifarch s390 aarch64
# Use linker flags to reduce memory consumption - on other arches the ld.gold is
# used and also it doesn't have the --reduce-memory-overheads option
%global optflags %{optflags} -Wl,--no-keep-memory -Wl,--reduce-memory-overheads
%endif

# Decrease debuginfo even on ix86 because of:
# https://bugs.webkit.org/show_bug.cgi?id=140176
%ifarch s390 s390x %{arm} %{ix86} ppc %{power64} %{mips}
# Decrease debuginfo verbosity to reduce memory consumption even more
%global optflags %(echo %{optflags} | sed 's/-g /-g1 /')
%endif

%ifarch ppc
# Use linker flag -relax to get WebKit build under ppc(32) with JIT disabled
%global optflags %{optflags} -Wl,-relax
%endif

%if 0%{?bundle_icu}
pushd ../icu/source
autoconf
CFLAGS='%optflags -fno-strict-aliasing'
CXXFLAGS='%optflags -fno-strict-aliasing'
%{!?endian: %global endian %(%{__python} -c "import sys;print (0 if sys.byteorder=='big' else 1)")}
# " this line just fixes syntax highlighting for vim that is confused by the above and continues literal
# Endian: BE=0 LE=1
%if ! 0%{?endian}
CPPFLAGS='-DU_IS_BIG_ENDIAN=1'
%endif

#rhbz856594 do not use --disable-renaming or cope with the mess
OPTIONS='--with-data-packaging=library --disable-samples'
%configure $OPTIONS

#rhbz#225896
sed -i 's|-nodefaultlibs -nostdlib||' config/mh-linux
#rhbz#681941
sed -i 's|^LIBS =.*|LIBS = -L../lib -licuuc -lpthread -lm|' i18n/Makefile
sed -i 's|^LIBS =.*|LIBS = -nostdlib -L../lib -licuuc -licui18n -lc -lgcc|' io/Makefile
sed -i 's|^LIBS =.*|LIBS = -nostdlib -L../lib -licuuc -lc|' layout/Makefile
sed -i 's|^LIBS =.*|LIBS = -nostdlib -L../lib -licuuc -licule -lc|' layoutex/Makefile
sed -i 's|^LIBS =.*|LIBS = -nostdlib -L../../lib -licutu -licuuc -lc|' tools/ctestfw/Makefile
# As of ICU 52.1 the -nostdlib in tools/toolutil/Makefile results in undefined reference to `__dso_handle'
sed -i 's|^LIBS =.*|LIBS = -L../../lib -licui18n -licuuc -lpthread -lc|' tools/toolutil/Makefile
#rhbz#813484
sed -i 's| \$(docfilesdir)/installdox||' Makefile
# There is no source/doc/html/search/ directory
sed -i '/^\s\+\$(INSTALL_DATA) \$(docsrchfiles) \$(DESTDIR)\$(docdir)\/\$(docsubsrchdir)\s*$/d' Makefile
# rhbz#856594 The configure --disable-renaming and possibly other options
# result in icu/source/uconfig.h.prepend being created, include that content in
# icu/source/common/unicode/uconfig.h to propagate to consumer packages.
test -f uconfig.h.prepend && sed -e '/^#define __UCONFIG_H__/ r uconfig.h.prepend' -i common/unicode/uconfig.h

# more verbosity for build.log
sed -i -r 's|(PKGDATA_OPTS = )|\1-v |' data/Makefile

make %{?_smp_mflags} VERBOSE=1
cd ..
BUNDLED_ICU_PATH="`pwd`/icu_installed"
make %{?_smp_mflags} -C source install DESTDIR=$BUNDLED_ICU_PATH
popd
%endif

# Enable DTS
%if 0%{?rhel} == 7
source /opt/rh/devtoolset-7/enable
source /opt/rh/llvm-toolset-7/enable
%define __cmake /opt/rh/llvm-toolset-7/root/usr/bin/cmake
%endif

# Disable ld.gold on s390 as it does not have it.
# Also for aarch64 as the support is in upstream, but not packaged in Fedora.
# Disable subtle crypto as we have an old libgcrypt in RHEL 7
mkdir -p %{_target_platform}
pushd %{_target_platform}
%cmake \
-DPORT=GTK \
-DCMAKE_BUILD_TYPE=Release \
%if 0%{bundle_icu}
-DICU_DATA_LIBRARY=$BUNDLED_ICU_PATH/%{_libdir}/libicudata.so \
-DICU_I18N_LIBRARY=$BUNDLED_ICU_PATH/%{_libdir}/libicui18n.so \
-DICU_INCLUDE_DIR=$BUNDLED_ICU_PATH/%{_includedir} \
-DICU_LIBRARY=$BUNDLED_ICU_PATH/%{_libdir}/libicuuc.so \
-DCMAKE_INSTALL_RPATH=%{_libdir}/webkit2gtk-4.0 \
%endif
-DENABLE_GTKDOC=ON \
-DENABLE_MINIBROWSER=ON \
-DENABLE_SUBTLE_CRYPTO=OFF \
%ifarch s390 aarch64
-DUSE_LD_GOLD=OFF \
%endif
%ifarch s390 s390x ppc %{power64} aarch64 %{mips}
-DENABLE_JIT=OFF \
-DUSE_SYSTEM_MALLOC=ON \
%endif
..
popd

# Remove the static amount of jobs once
# https://projects.engineering.redhat.com/browse/BREW-2146 is resolved
# make %{?_smp_mflags} -C %{_target_platform}
make -j4 -C %{_target_platform}

%install
%if 0%{?bundle_icu}
pushd ../icu/icu_installed/%{_libdir}
mkdir -p $RPM_BUILD_ROOT%{_libdir}/webkit2gtk-4.0/
cp -a libicudata.so.* $RPM_BUILD_ROOT%{_libdir}/webkit2gtk-4.0/
cp -a libicui18n.so.* $RPM_BUILD_ROOT%{_libdir}/webkit2gtk-4.0/
cp -a libicuuc.so.* $RPM_BUILD_ROOT%{_libdir}/webkit2gtk-4.0/
popd
# We don't want debuginfo generated for the bundled icu libraries.
# Turn off execute bit so they aren't included in the debuginfo.list.
# We'll turn the execute bit on again in %%files.
# https://bugzilla.redhat.com/show_bug.cgi?id=1486771
chmod 644 $RPM_BUILD_ROOT%{_libdir}/webkit2gtk-4.0/libicudata.so.57.1
chmod 644 $RPM_BUILD_ROOT%{_libdir}/webkit2gtk-4.0/libicui18n.so.57.1
chmod 644 $RPM_BUILD_ROOT%{_libdir}/webkit2gtk-4.0/libicuuc.so.57.1
%endif

%make_install %{?_smp_mflags} -C %{_target_platform}

%find_lang WebKit2GTK-4.0

# Finally, copy over and rename various files for %%license inclusion
%add_to_license_files Source/JavaScriptCore/COPYING.LIB
%add_to_license_files Source/JavaScriptCore/icu/LICENSE
%add_to_license_files Source/ThirdParty/ANGLE/LICENSE
%add_to_license_files Source/ThirdParty/ANGLE/src/common/third_party/smhasher/LICENSE
%add_to_license_files Source/ThirdParty/ANGLE/src/third_party/compiler/LICENSE
%add_to_license_files Source/ThirdParty/ANGLE/src/third_party/libXNVCtrl/LICENSE
%add_to_license_files Source/ThirdParty/brotli/LICENSE
%add_to_license_files Source/ThirdParty/woff2/LICENSE
%add_to_license_files Source/WebCore/icu/LICENSE
%add_to_license_files Source/WebCore/LICENSE-APPLE
%add_to_license_files Source/WebCore/LICENSE-LGPL-2
%add_to_license_files Source/WebCore/LICENSE-LGPL-2.1
%add_to_license_files Source/WebInspectorUI/UserInterface/External/CodeMirror/LICENSE
%add_to_license_files Source/WebInspectorUI/UserInterface/External/ESLint/LICENSE
%add_to_license_files Source/WebInspectorUI/UserInterface/External/Esprima/LICENSE
%add_to_license_files Source/WebInspectorUI/UserInterface/External/three.js/LICENSE
%add_to_license_files Source/WTF/icu/LICENSE
%add_to_license_files Source/WTF/wtf/dtoa/COPYING
%add_to_license_files Source/WTF/wtf/dtoa/LICENSE

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%post jsc -p /sbin/ldconfig
%postun jsc -p /sbin/ldconfig

%files -f WebKit2GTK-4.0.lang
%license _license_files/*ThirdParty*
%license _license_files/*WebCore*
%license _license_files/*WebInspectorUI*
%license _license_files/*WTF*
%{_libdir}/libwebkit2gtk-4.0.so.*
%dir %{_libdir}/girepository-1.0
%{_libdir}/girepository-1.0/WebKit2-4.0.typelib
%{_libdir}/girepository-1.0/WebKit2WebExtension-4.0.typelib
%{_libdir}/webkit2gtk-4.0/
# Turn on executable bit again for bundled icu libraries.
# Was disabled in %%install to prevent debuginfo stripping.
%attr(0755,root,root) %{_libdir}/webkit2gtk-4.0/libicudata.so.57.1
%attr(0755,root,root) %{_libdir}/webkit2gtk-4.0/libicui18n.so.57.1
%attr(0755,root,root) %{_libdir}/webkit2gtk-4.0/libicuuc.so.57.1
%{_libexecdir}/webkit2gtk-4.0/
%{_bindir}/WebKitWebDriver
%exclude %{_libexecdir}/webkit2gtk-4.0/WebKitPluginProcess2

%files devel
%{_libexecdir}/webkit2gtk-4.0/MiniBrowser
%{_includedir}/webkitgtk-4.0/
%exclude %{_includedir}/webkitgtk-4.0/JavaScriptCore
%{_libdir}/libwebkit2gtk-4.0.so
%{_libdir}/pkgconfig/webkit2gtk-4.0.pc
%{_libdir}/pkgconfig/webkit2gtk-web-extension-4.0.pc
%{_datadir}/gir-1.0/WebKit2-4.0.gir
%{_datadir}/gir-1.0/WebKit2WebExtension-4.0.gir

%files jsc
%license _license_files/*JavaScriptCore*
%{_libdir}/libjavascriptcoregtk-4.0.so.*
%dir %{_libdir}/girepository-1.0
%{_libdir}/girepository-1.0/JavaScriptCore-4.0.typelib

%files jsc-devel
%{_libexecdir}/webkit2gtk-4.0/jsc
%dir %{_includedir}/webkitgtk-4.0
%{_includedir}/webkitgtk-4.0/JavaScriptCore/
%{_libdir}/libjavascriptcoregtk-4.0.so
%{_libdir}/pkgconfig/javascriptcoregtk-4.0.pc
%dir %{_datadir}/gir-1.0
%{_datadir}/gir-1.0/JavaScriptCore-4.0.gir

%files plugin-process-gtk2
%{_libexecdir}/webkit2gtk-4.0/WebKitPluginProcess2

%files doc
%dir %{_datadir}/gtk-doc
%dir %{_datadir}/gtk-doc/html
%{_datadir}/gtk-doc/html/webkit2gtk-4.0/
%{_datadir}/gtk-doc/html/webkitdomgtk-4.0/

%changelog
* Tue Aug 14 2018 Tomas Popela <tpopela@redhat.com> - 2.20.5-1
- Update to 2.20.5 - technically it was not necessary as the only difference
between 2.20.4 and .5 was the revert of one change, that we already reverted
while building 2.20.4. But it's better to stay with upstream.
- Update the labels patch with the version that was pushed upstream.
- Resolves: rhbz#1576544

* Thu Aug 09 2018 Tomas Popela <tpopela@redhat.com> - 2.20.4-2
- webkitgtk4: Crash on Google login page when a11y is active
- Resolves: rhbz#1503624
- Revert patch causing rendering glitches

* Mon Aug 06 2018 Tomas Popela <tpopela@redhat.com> - 2.20.4-1
- Update to 2.20.4
- Resolves: rhbz#1576544
- WebKitWebProcess crashes when a11y is active
- Resolves: rhbz#1591638

* Wed Jun 27 2018 Tomas Popela <tpopela@redhat.com> - 2.20.3-5
- Add GStreamer coverity fixes
- Resolves: rhbz#1576544

* Tue Jun 26 2018 Tomas Popela <tpopela@redhat.com> - 2.20.3-4
- More rpmdiff and covscan fixes
- Resolves: rhbz#1576544

* Wed Jun 13 2018 Tomas Popela <tpopela@redhat.com> - 2.20.3-3
- Unbundle cmake
- Add covscan fixes
- Resolves: rhbz#1576544

* Tue Jun 12 2018 Tomas Popela <tpopela@redhat.com> - 2.20.3-2
- Fix the rpmdiff warning
- Resolves: rhbz#1576544

* Mon Jun 11 2018 Tomas Popela <tpopela@redhat.com> - 2.20.3-1
- Update to 2.20.3
- Resolves: rhbz#1576544

* Fri Jun 08 2018 Tomas Popela <tpopela@redhat.com> - 2.20.2-1
- Update to 2.20.2
- Resolves: rhbz#1576544

* Wed Nov 08 2017 Tomas Popela <tpopela@redhat.com> - 2.16.6-6
- Don't strip debug info from bundled icu libraries, otherwise there
will be conflicts between webkitgtk4-debuginfo and icu-debuginfo packages
- Resolves: rhbz#1486771

* Mon Oct 09 2017 Tomas Popela <tpopela@redhat.com> - 2.16.6-5
- Update the bundled brotli and woff2 to the latest releases due to
woff2's license incompatibility with WebKitGTK+ project
- Resolves: rhbz#1499745
- Drop unused patches

* Fri Sep 29 2017 Tomas Popela <tpopela@redhat.com> - 2.16.6-4
- Build wayland support
- Backport fixes proposed by upstream to 2.16 branch
- Remove accidentally committed workaround for rhbz#1486771
- Resolves: rhbz#1496800

* Tue Sep 05 2017 Tomas Popela <tpopela@redhat.com> - 2.16.6-3
- Coverity scan fixes
- Resolves: rhbz#1476707

* Fri Aug 25 2017 Tomas Popela <tpopela@redhat.com> - 2.16.6-2
- Backport security fixes for bundled icu
- Backport geoclue2 id fixes
- Resolves: rhbz#1476707

* Thu Aug 17 2017 Tomas Popela <tpopela@redhat.com> - 2.16.6-1
- Update to 2.16.6
- Resolves: rhbz#1476707

* Fri Jun 16 2017 Tomas Popela <tpopela@redhat.com> - 2.14.7-2
- Fix a CLoop patch that was not correctly backported from upstream, causing
crashes on big endian machines
- Resolves: rhbz#1442160

* Thu Jun 01 2017 Tomas Popela <tpopela@redhat.com> - 2.14.7-1
- Update to 2.14.7
- Backport more of a11y fixes from upstream
- Fix JSC crashes on big endian arches
- Resolves: rhbz#1442160

* Wed May 10 2017 Milan Crha <mcrha@redhat.com> - 2.14.6-6
- Add upstream patch to fix login to Google account
- Resolves: rhbz#1448192

* Wed Apr 26 2017 Tomas Popela <tpopela@redhat.com> - 2.14.6-5
- Don't require icu libraries that are bundled
- Resolves: rhbz#1414413

* Tue Apr 25 2017 Tomas Popela <tpopela@redhat.com> - 2.14.6-4
- Use the right function for removing from provides
- Resolves: rhbz#1383614

* Mon Apr 24 2017 Tomas Popela <tpopela@redhat.com> - 2.14.6-3
- Bundle only needed icu libraries
- Don't list bundled icu libraries in provides
- Resolves: rhbz#1383614

* Mon Apr 24 2017 Tomas Popela <tpopela@redhat.com> - 2.14.6-2
- Bundle icu57
- Resolves: rhbz#1414413

* Mon Apr 10 2017 Tomas Popela <tpopela@redhat.com> - 2.14.6-1
- Update to 2.14.6
- Resolves: rhbz#1440681
- Don't crash is no render is available in AX render object
- Resolves: rhbz#1437672

* Tue Mar 21 2017 Tomas Popela <tpopela@redhat.com> - 2.14.5-5
- Add more Coverity scan fixes
- Remove icu from sources
- Resolves: rhbz#1383614

* Mon Mar 13 2017 Tomas Popela <tpopela@redhat.com> - 2.14.5-4
- Add some Coverity scan fixes
- Resolves: rhbz#1383614

* Tue Feb 28 2017 Tomas Popela <tpopela@redhat.com> - 2.14.5-3
- Add explicit requires of webkitgtk4-jsc for -devel and -plugin-process-gtk2
subpackages (found by rpmdiff).
- Resolves: rhbz#1383614

* Mon Feb 20 2017 Tomas Popela <tpopela@redhat.com> - 2.14.5-2
- Remove bundled ICU and require libicu57
- Resolves: rhbz#1383614

* Thu Feb 16 2017 Kalev Lember <klember@redhat.com> - 2.14.5-1
- Update to 2.14.5
- Resolves: rhbz#1383614

* Fri Feb 10 2017 Tomas Popela <tpopela@redhat.com> - 2.14.4-1
- Initial RHEL packaging
- Temporary bundling icu57 until rhbz#1414413 is resolved
- Resolves: rhbz#1383614
Loading…
Cancel
Save