From 3eae4bb0457b81d495e375a4e3962ecff99053bf Mon Sep 17 00:00:00 2001 From: bbrucezhang Date: Mon, 28 Jul 2025 14:16:13 +0800 Subject: [PATCH 1/7] Recompile using python3 --- qt5-qtwebengine.spec | 14 +- qt5-webengine-chromium-python3.patch | 1812 ++++++++++++++++++++++++++ qt5-webengine-python3.patch | 161 +++ 3 files changed, 1981 insertions(+), 6 deletions(-) create mode 100644 qt5-webengine-chromium-python3.patch create mode 100644 qt5-webengine-python3.patch diff --git a/qt5-qtwebengine.spec b/qt5-qtwebengine.spec index 199558c..5f2d2d2 100644 --- a/qt5-qtwebengine.spec +++ b/qt5-qtwebengine.spec @@ -45,7 +45,7 @@ Patch6: chromium-angle-nullptr.patch Patch7: chromium-hunspell-nullptr.patch Patch8: qtwebengine-everywhere-5.15.8-libpipewire-0.3.patch Patch24: qtwebengine-everywhere-src-5.11.3-aarch64-new-stat.patch -Patch26: qtwebengine-everywhere-5.15.5-use-python2.patch +#Patch26: qtwebengine-everywhere-5.15.5-use-python3.patch Patch32: qtwebengine-skia-missing-includes.patch Patch34: qtwebengine-fix-build.patch Patch35: qt5-qtwebengine-c99.patch @@ -57,6 +57,8 @@ Patch51: qtwebengine-icu-74.patch Patch100: v8.patch Patch101: riscv.patch +Patch102: qt5-webengine-chromium-python3.patch +Patch103: qt5-webengine-python3.patch ExclusiveArch: %{qt5_qtwebengine_arches} @@ -134,13 +136,13 @@ BuildRequires: pkgconfig(lcms2) BuildRequires: pkgconfig(xkbcommon) BuildRequires: pkgconfig(xkbfile) BuildRequires: perl-interpreter -BuildRequires: /usr/bin/python2 +BuildRequires: /usr/bin/python3 %if 0%{?use_system_libvpx} BuildRequires: pkgconfig(vpx) >= 1.8.0 %endif BuildRequires: libtirpc BuildRequires: libnsl2 -BuildRequires: python-rpm-macros +#BuildRequires: python-rpm-macros BuildRequires: pkgconfig(libavcodec) BuildRequires: pkgconfig(libavformat) @@ -249,7 +251,7 @@ popd %patch -P8 -p1 -b .libpipewire-0.3 %patch -P24 -p1 -b .aarch64-new-stat -%patch -P26 -p1 -b .use-python2 +#%patch -P26 -p1 -b .use-python3 %patch -P32 -p1 -b .skia-missing-includes %patch -P34 -p1 -b .fix-build @@ -282,8 +284,8 @@ test -f "./include/QtWebEngineCore/qtwebenginecoreglobal.h" %build -export PATH=$(pwd)/python2/usr/bin:$PATH -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/python2/usr/lib64 +#export PATH=$(pwd)/python2/usr/bin:$PATH +#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/python2/usr/lib64 export STRIP=strip export NINJAFLAGS="%{__ninja_common_opts}" diff --git a/qt5-webengine-chromium-python3.patch b/qt5-webengine-chromium-python3.patch new file mode 100644 index 0000000..0ea9edd --- /dev/null +++ b/qt5-webengine-chromium-python3.patch @@ -0,0 +1,1812 @@ +diff --git a/qtwebengine/src/3rdparty/chromium/build/print_python_deps.py b/qtwebengine/src/3rdparty/chromium/build/print_python_deps.py +index fd29c0972c9..69af247094b 100755 +--- a/qtwebengine/src/3rdparty/chromium/build/print_python_deps.py ++++ b/qtwebengine/src/3rdparty/chromium/build/print_python_deps.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/python2.7 ++#!/usr/bin/python + # Copyright 2016 The Chromium Authors. All rights reserved. + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. +@@ -80,7 +80,7 @@ def _GetTargetPythonVersion(module): + if shebang.startswith('#!'): + # Examples: + # '#!/usr/bin/python' +- # '#!/usr/bin/python2.7' ++ # '#!/usr/bin/python' + # '#!/usr/bin/python3' + # '#!/usr/bin/env python3' + # '#!/usr/bin/env vpython' +@@ -152,7 +152,7 @@ def main(): + + # Trybots run with vpython as default Python, but with a different config + # from //.vpython. To make the is_vpython test work, and to match the behavior +- # of dev machines, the shebang line must be run with python2.7. ++ # of dev machines, the shebang line must be run with python. + # + # E.g. $HOME/.vpython-root/dd50d3/bin/python + # E.g. /b/s/w/ir/cache/vpython/ab5c79/bin/python +diff --git a/qtwebengine/src/3rdparty/chromium/components/resources/protobufs/binary_proto_generator.py b/qtwebengine/src/3rdparty/chromium/components/resources/protobufs/binary_proto_generator.py +index 7422ead9697..16365515f26 100755 +--- a/qtwebengine/src/3rdparty/chromium/components/resources/protobufs/binary_proto_generator.py ++++ b/qtwebengine/src/3rdparty/chromium/components/resources/protobufs/binary_proto_generator.py +@@ -7,7 +7,7 @@ + Converts a given ASCII proto into a binary resource. + + """ +- ++from __future__ import print_function + import abc + import imp + import optparse +@@ -196,12 +196,12 @@ class BinaryProtoGenerator: + self._ImportProtoModules(opts.path) + + if not self.VerifyArgs(opts): +- print "Wrong arguments" ++ print("Wrong arguments") + return 1 + + try: + self._GenerateBinaryProtos(opts) + except Exception as e: +- print "ERROR: Failed to render binary version of %s:\n %s\n%s" % ( +- opts.infile, str(e), traceback.format_exc()) ++ print("ERROR: Failed to render binary version of %s:\n %s\n%s" % ++ (opts.infile, str(e), traceback.format_exc())) + return 1 +diff --git a/qtwebengine/src/3rdparty/chromium/content/browser/tracing/generate_trace_viewer_grd.py b/qtwebengine/src/3rdparty/chromium/content/browser/tracing/generate_trace_viewer_grd.py +index 037f9497dc2..be393d21f90 100755 +--- a/qtwebengine/src/3rdparty/chromium/content/browser/tracing/generate_trace_viewer_grd.py ++++ b/qtwebengine/src/3rdparty/chromium/content/browser/tracing/generate_trace_viewer_grd.py +@@ -74,7 +74,7 @@ def main(argv): + for filename in parsed_args.source_files: + add_file_to_grd(doc, os.path.basename(filename)) + +- with open(parsed_args.output_filename, 'w') as output_file: ++ with open(parsed_args.output_filename, 'wb') as output_file: + output_file.write(doc.toxml(encoding='UTF-8')) + + +diff --git a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/BUILD.gn b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/BUILD.gn +index fc04b5dd0b1..708958e438b 100644 +--- a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/BUILD.gn ++++ b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/BUILD.gn +@@ -2,9 +2,11 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/python.gni") + import("//mojo/public/tools/bindings/mojom.gni") + import("//third_party/jinja2/jinja2.gni") + ++# TODO(crbug.com/1194274): Investigate nondeterminism in Py3 builds. + action("precompile_templates") { + sources = mojom_generator_sources + sources += [ +diff --git a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/gen_data_files_list.py b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/gen_data_files_list.py +index 79c9e50efce..8b78d092418 100644 +--- a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/gen_data_files_list.py ++++ b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/gen_data_files_list.py +@@ -18,7 +18,6 @@ import os + import re + import sys + +-from cStringIO import StringIO + from optparse import OptionParser + + sys.path.insert( +@@ -41,12 +40,9 @@ def main(): + pattern = re.compile(options.pattern) + files = [f for f in os.listdir(options.directory) if pattern.match(f)] + +- stream = StringIO() +- for f in files: +- print(f, file=stream) ++ contents = '\n'.join(f for f in files) + '\n' ++ WriteFile(contents, options.output) + +- WriteFile(stream.getvalue(), options.output) +- stream.close() + + if __name__ == '__main__': + sys.exit(main()) +diff --git a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/generators/mojom_java_generator.py b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/generators/mojom_java_generator.py +index 96b2fdfae0c..00b9dccd00c 100644 +--- a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/generators/mojom_java_generator.py ++++ b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/generators/mojom_java_generator.py +@@ -25,6 +25,10 @@ sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, + 'build', 'android', 'gyp')) + from util import build_utils + ++# TODO(crbug.com/1174969): Remove this once Python2 is obsoleted. ++if sys.version_info.major != 2: ++ basestring = str ++ long = int + + GENERATOR_PREFIX = 'java' + +diff --git a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/generator.py b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/generator.py +index de62260a5c9..4a1c73fcf82 100644 +--- a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/generator.py ++++ b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/generator.py +@@ -136,9 +136,14 @@ class Stylizer(object): + + def WriteFile(contents, full_path): + # If |contents| is same with the file content, we skip updating. ++ if not isinstance(contents, bytes): ++ data = contents.encode('utf8') ++ else: ++ data = contents ++ + if os.path.isfile(full_path): + with open(full_path, 'rb') as destination_file: +- if destination_file.read() == contents: ++ if destination_file.read() == data: + return + + # Make sure the containing directory exists. +@@ -146,11 +151,8 @@ def WriteFile(contents, full_path): + fileutil.EnsureDirectoryExists(full_dir) + + # Dump the data to disk. +- with open(full_path, "wb") as f: +- if not isinstance(contents, bytes): +- f.write(contents.encode('utf-8')) +- else: +- f.write(contents) ++ with open(full_path, 'wb') as f: ++ f.write(data) + + + def AddComputedData(module): +diff --git a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/module.py b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/module.py +index ebbc9b322ea..3d026429bbc 100644 +--- a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/module.py ++++ b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/module.py +@@ -398,7 +398,8 @@ class Field(object): + + + class StructField(Field): +- pass ++ def __hash__(self): ++ return super(Field, self).__hash__() + + + class UnionField(Field): +diff --git a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/template_expander.py b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/template_expander.py +index 7a300560246..8d9e26fb7f6 100644 +--- a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/template_expander.py ++++ b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/template_expander.py +@@ -75,9 +75,9 @@ def PrecompileTemplates(generator_modules, output_dir): + os.path.dirname(module.__file__), generator.GetTemplatePrefix()) + ])) + jinja_env.filters.update(generator.GetFilters()) +- jinja_env.compile_templates( +- os.path.join(output_dir, "%s.zip" % generator.GetTemplatePrefix()), +- extensions=["tmpl"], +- zip="stored", +- py_compile=True, +- ignore_errors=False) ++ jinja_env.compile_templates(os.path.join( ++ output_dir, "%s.zip" % generator.GetTemplatePrefix()), ++ extensions=["tmpl"], ++ zip="stored", ++ py_compile=sys.version_info.major < 3, ++ ignore_errors=False) +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/blink_v8_bridge.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/blink_v8_bridge.py +index 3225ecca6e4..fc078d31b55 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/blink_v8_bridge.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/blink_v8_bridge.py +@@ -344,7 +344,7 @@ def make_default_value_expr(idl_type, default_value): + """ + assert default_value.is_type_compatible_with(idl_type) + +- class DefaultValueExpr: ++ class DefaultValueExpr(object): + _ALLOWED_SYMBOLS_IN_DEPS = ("isolate") + + def __init__(self, initializer_expr, initializer_deps, +@@ -502,7 +502,7 @@ def make_v8_to_blink_value(blink_var_name, + assert isinstance(blink_var_name, str) + assert isinstance(v8_value_expr, str) + assert isinstance(idl_type, web_idl.IdlType) +- assert (argument_index is None or isinstance(argument_index, (int, long))) ++ assert (argument_index is None or isinstance(argument_index, int)) + assert (default_value is None + or isinstance(default_value, web_idl.LiteralConstant)) + +@@ -622,7 +622,7 @@ def make_v8_to_blink_value_variadic(blink_var_name, v8_array, + """ + assert isinstance(blink_var_name, str) + assert isinstance(v8_array, str) +- assert isinstance(v8_array_start_index, (int, long)) ++ assert isinstance(v8_array_start_index, int) + assert isinstance(idl_type, web_idl.IdlType) + + pattern = ("auto&& ${{{_1}}} = " +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/callback_interface.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/callback_interface.py +index 4a6df513068..8b51f23a409 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/callback_interface.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/callback_interface.py +@@ -177,7 +177,7 @@ def generate_callback_interface(callback_interface_identifier): + prop_install_mode=PropInstallMode.UNCONDITIONAL, + trampoline_var_name=None, + attribute_entries=[], +- constant_entries=filter(is_unconditional, constant_entries), ++ constant_entries=list(filter(is_unconditional, constant_entries)), + exposed_construct_entries=[], + operation_entries=[]) + (install_interface_template_decl, install_interface_template_def, +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/code_node.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/code_node.py +index 52972fefe20..e5ae9d9629e 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/code_node.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/code_node.py +@@ -503,13 +503,13 @@ class CompositeNode(CodeNode): + gensym_kwargs = {} + template_vars = {} + for arg in args: +- assert isinstance(arg, (CodeNode, int, long, str)) ++ assert isinstance(arg, (CodeNode, int, str)) + gensym = CodeNode.gensym() + gensym_args.append("${{{}}}".format(gensym)) + template_vars[gensym] = arg + for key, value in kwargs.items(): +- assert isinstance(key, (int, long, str)) +- assert isinstance(value, (CodeNode, int, long, str)) ++ assert isinstance(key, (int, str)) ++ assert isinstance(value, (CodeNode, int, str)) + gensym = CodeNode.gensym() + gensym_kwargs[key] = "${{{}}}".format(gensym) + template_vars[gensym] = value +@@ -602,7 +602,7 @@ class ListNode(CodeNode): + def insert(self, index, node): + if node is None: + return +- assert isinstance(index, (int, long)) ++ assert isinstance(index, int) + assert isinstance(node, CodeNode) + assert node.outer is None and node.prev is None + +@@ -721,7 +721,7 @@ class SymbolScopeNode(SequenceNode): + if not scope_chains: + return counts + +- self_index = iter(scope_chains).next().index(self) ++ self_index = next(iter(scope_chains)).index(self) + scope_chains = map( + lambda scope_chain: scope_chain[self_index + 1:], scope_chains) + scope_to_likeliness = {} +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_expr.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_expr.py +index a229a6c71c9..5fa288dabf2 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_expr.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_expr.py +@@ -109,7 +109,7 @@ def expr_and(terms): + + if any(term.is_always_false for term in terms): + return _Expr(False) +- terms = filter(lambda x: not x.is_always_true, terms) ++ terms = list(filter(lambda x: not x.is_always_true, terms)) + if not terms: + return _Expr(True) + if len(terms) == 1: +@@ -124,7 +124,7 @@ def expr_or(terms): + + if any(term.is_always_true for term in terms): + return _Expr(True) +- terms = filter(lambda x: not x.is_always_false, terms) ++ terms = list(filter(lambda x: not x.is_always_false, terms)) + if not terms: + return _Expr(False) + if len(terms) == 1: +@@ -222,7 +222,7 @@ def expr_from_exposure(exposure, + elif exposure.only_in_secure_contexts is False: + secure_context_term = _Expr(True) + else: +- terms = map(ref_enabled, exposure.only_in_secure_contexts) ++ terms = list(map(ref_enabled, exposure.only_in_secure_contexts)) + secure_context_term = expr_or( + [_Expr("${is_in_secure_context}"), + expr_not(expr_and(terms))]) +@@ -275,10 +275,11 @@ def expr_from_exposure(exposure, + + # [ContextEnabled] + if exposure.context_enabled_features: +- terms = map( +- lambda feature: _Expr( +- "${{context_feature_settings}}->is{}Enabled()".format( +- feature)), exposure.context_enabled_features) ++ terms = list( ++ map( ++ lambda feature: _Expr( ++ "${{context_feature_settings}}->is{}Enabled()".format( ++ feature)), exposure.context_enabled_features)) + context_enabled_terms.append( + expr_and([_Expr("${context_feature_settings}"), + expr_or(terms)])) +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_format.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_format.py +index 87d26eec3ca..f3e9d38247e 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_format.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_format.py +@@ -23,7 +23,7 @@ class _TemplateFormatter(string.Formatter): + self._template_formatter_indexing_count_ = 0 + + def get_value(self, key, args, kwargs): +- if isinstance(key, (int, long)): ++ if isinstance(key, int): + return args[key] + assert isinstance(key, str) + if not key: +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_utils.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_utils.py +index 2bcc4fed49a..e72282aa696 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_utils.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_utils.py +@@ -116,4 +116,4 @@ def write_code_node_to_file(code_node, filepath): + # stderr=format_result.error_message)) + # + # web_idl.file_io.write_to_file_if_changed(filepath, format_result.contents) +- web_idl.file_io.write_to_file_if_changed(filepath, rendered_text) ++ web_idl.file_io.write_to_file_if_changed(filepath, rendered_text.encode('utf-8')) +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/dictionary.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/dictionary.py +index b39f0100410..4d68202296b 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/dictionary.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/dictionary.py +@@ -993,7 +993,7 @@ def make_dict_trace_func(cg_context): + _2 = _blink_member_name(member).value_var + return TextNode(_format(pattern, _1=_1, _2=_2)) + +- body.extend(map(make_trace_member_node, own_members)) ++ body.extend(list(map(make_trace_member_node, own_members))) + body.append(TextNode("BaseClass::Trace(visitor);")) + + return func_decl, func_def +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py +index 10ff30656ad..bfdf7128aac 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py +@@ -582,7 +582,7 @@ def _make_blink_api_call(code_node, + overriding_args=None): + assert isinstance(code_node, SymbolScopeNode) + assert isinstance(cg_context, CodeGenContext) +- assert num_of_args is None or isinstance(num_of_args, (int, long)) ++ assert num_of_args is None or isinstance(num_of_args, int) + assert (overriding_args is None + or (isinstance(overriding_args, (list, tuple)) + and all(isinstance(arg, str) for arg in overriding_args))) +@@ -1196,8 +1196,10 @@ def make_overload_dispatcher(cg_context): + did_use_break = did_use_break or can_fail + + conditional = expr_or( +- map(lambda item: expr_from_exposure(item.function_like.exposure), +- items)) ++ list( ++ map( ++ lambda item: expr_from_exposure(item.function_like.exposure ++ ), items))) + if not conditional.is_always_true: + node = CxxUnlikelyIfNode(cond=conditional, body=node) + +@@ -4642,7 +4644,7 @@ class _PropEntryConstructorGroup(_PropEntryBase): + def __init__(self, is_context_dependent, exposure_conditional, world, + constructor_group, ctor_callback_name, ctor_func_length): + assert isinstance(ctor_callback_name, str) +- assert isinstance(ctor_func_length, (int, long)) ++ assert isinstance(ctor_func_length, int) + + _PropEntryBase.__init__(self, is_context_dependent, + exposure_conditional, world, constructor_group) +@@ -4670,7 +4672,7 @@ class _PropEntryOperationGroup(_PropEntryBase): + op_func_length, + no_alloc_direct_callback_name=None): + assert isinstance(op_callback_name, str) +- assert isinstance(op_func_length, (int, long)) ++ assert isinstance(op_func_length, int) + + _PropEntryBase.__init__(self, is_context_dependent, + exposure_conditional, world, operation_group) +@@ -5175,9 +5177,9 @@ def make_install_interface_template(cg_context, function_name, class_name, api_c + ]) + + if class_like.identifier == "CSSStyleDeclaration": +- css_properties = filter( +- lambda attr: "CSSProperty" in attr.extended_attributes, +- class_like.attributes) ++ css_properties = list( ++ filter(lambda attr: "CSSProperty" in attr.extended_attributes, ++ class_like.attributes)) + if css_properties: + prop_name_list = "".join( + map(lambda attr: "\"{}\", ".format(attr.identifier), +@@ -5567,8 +5569,8 @@ ${instance_object} = ${v8_context}->Global()->GetPrototype().As();\ + "V8DOMConfiguration::InstallConstants(${isolate}, " + "${interface_template}, ${prototype_template}, " + "kConstantCallbackTable, base::size(kConstantCallbackTable));") +- constant_callback_entries = filter(lambda entry: entry.const_callback_name, +- constant_entries) ++ constant_callback_entries = list(filter(lambda entry: entry.const_callback_name, ++ constant_entries)) + install_properties(table_name, constant_callback_entries, + _make_constant_callback_registration_table, + installer_call_text) +@@ -5584,8 +5586,8 @@ ${instance_object} = ${v8_context}->Global()->GetPrototype().As();\ + "V8DOMConfiguration::InstallConstants(${isolate}, " + "${interface_template}, ${prototype_template}, " + "kConstantValueTable, base::size(kConstantValueTable));") +- constant_value_entries = filter( +- lambda entry: not entry.const_callback_name, constant_entries) ++ constant_value_entries = list(filter( ++ lambda entry: not entry.const_callback_name, constant_entries)) + install_properties(table_name, constant_value_entries, + _make_constant_value_registration_table, + installer_call_text) +@@ -6336,8 +6338,8 @@ def make_v8_context_snapshot_api(cg_context, component, attribute_entries, + assert isinstance(component, web_idl.Component) + + derived_interfaces = cg_context.interface.deriveds +- derived_names = map(lambda interface: interface.identifier, +- derived_interfaces) ++ derived_names = list( ++ map(lambda interface: interface.identifier, derived_interfaces)) + derived_names.append(cg_context.interface.identifier) + if not ("Window" in derived_names or "HTMLDocument" in derived_names): + return None, None +@@ -6411,9 +6413,11 @@ def _make_v8_context_snapshot_get_reference_table_function( + collect_callbacks(named_properties_object_callback_defs) + collect_callbacks(cross_origin_property_callback_defs) + +- entry_nodes = map( +- lambda name: TextNode("reinterpret_cast({}),".format(name)), +- filter(None, callback_names)) ++ entry_nodes = list( ++ map( ++ lambda name: TextNode("reinterpret_cast({}),".format(name ++ )), ++ filter(None, callback_names))) + table_node = ListNode([ + TextNode("using namespace ${class_name}Callbacks;"), + TextNode("static const intptr_t kReferenceTable[] = {"), +@@ -6451,10 +6455,11 @@ def _make_v8_context_snapshot_install_props_per_context_function( + class_name=None, + prop_install_mode=PropInstallMode.V8_CONTEXT_SNAPSHOT, + trampoline_var_name=None, +- attribute_entries=filter(selector, attribute_entries), +- constant_entries=filter(selector, constant_entries), +- exposed_construct_entries=filter(selector, exposed_construct_entries), +- operation_entries=filter(selector, operation_entries)) ++ attribute_entries=list(filter(selector, attribute_entries)), ++ constant_entries=list(filter(selector, constant_entries)), ++ exposed_construct_entries=list( ++ filter(selector, exposed_construct_entries)), ++ operation_entries=list(filter(selector, operation_entries))) + + return func_decl, func_def + +@@ -6810,11 +6815,11 @@ def generate_interface(interface_identifier): + class_name=impl_class_name, + prop_install_mode=PropInstallMode.UNCONDITIONAL, + trampoline_var_name=tp_install_unconditional_props, +- attribute_entries=filter(is_unconditional, attribute_entries), +- constant_entries=filter(is_unconditional, constant_entries), +- exposed_construct_entries=filter(is_unconditional, +- exposed_construct_entries), +- operation_entries=filter(is_unconditional, operation_entries)) ++ attribute_entries=list(filter(is_unconditional, attribute_entries)), ++ constant_entries=list(filter(is_unconditional, constant_entries)), ++ exposed_construct_entries=list( ++ filter(is_unconditional, exposed_construct_entries)), ++ operation_entries=list(filter(is_unconditional, operation_entries))) + (install_context_independent_props_decl, + install_context_independent_props_def, + install_context_independent_props_trampoline) = make_install_properties( +@@ -6823,11 +6828,14 @@ def generate_interface(interface_identifier): + class_name=impl_class_name, + prop_install_mode=PropInstallMode.CONTEXT_INDEPENDENT, + trampoline_var_name=tp_install_context_independent_props, +- attribute_entries=filter(is_context_independent, attribute_entries), +- constant_entries=filter(is_context_independent, constant_entries), +- exposed_construct_entries=filter(is_context_independent, +- exposed_construct_entries), +- operation_entries=filter(is_context_independent, operation_entries)) ++ attribute_entries=list( ++ filter(is_context_independent, attribute_entries)), ++ constant_entries=list(filter(is_context_independent, ++ constant_entries)), ++ exposed_construct_entries=list( ++ filter(is_context_independent, exposed_construct_entries)), ++ operation_entries=list( ++ filter(is_context_independent, operation_entries))) + (install_context_dependent_props_decl, install_context_dependent_props_def, + install_context_dependent_props_trampoline) = make_install_properties( + cg_context, +@@ -6835,11 +6843,13 @@ def generate_interface(interface_identifier): + class_name=impl_class_name, + prop_install_mode=PropInstallMode.CONTEXT_DEPENDENT, + trampoline_var_name=tp_install_context_dependent_props, +- attribute_entries=filter(is_context_dependent, attribute_entries), +- constant_entries=filter(is_context_dependent, constant_entries), +- exposed_construct_entries=filter(is_context_dependent, +- exposed_construct_entries), +- operation_entries=filter(is_context_dependent, operation_entries)) ++ attribute_entries=list(filter(is_context_dependent, ++ attribute_entries)), ++ constant_entries=list(filter(is_context_dependent, constant_entries)), ++ exposed_construct_entries=list( ++ filter(is_context_dependent, exposed_construct_entries)), ++ operation_entries=list(filter(is_context_dependent, ++ operation_entries))) + (install_interface_template_decl, install_interface_template_def, + install_interface_template_trampoline) = make_install_interface_template( + cg_context, +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/mako_renderer.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/mako_renderer.py +index b4c70553863..f3a2fcd772d 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/mako_renderer.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/mako_renderer.py +@@ -105,7 +105,7 @@ class MakoRenderer(object): + on_error = self._caller_stack_on_error + if (len(current) <= len(on_error) + and all(current[i] == on_error[i] +- for i in xrange(len(current)))): ++ for i in range(len(current)))): + pass # Error happened in a deeper caller. + else: + self._caller_stack_on_error = list(self._caller_stack) +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/style_format.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/style_format.py +index dc3493cc394..017d3d47bb3 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/style_format.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/style_format.py +@@ -70,8 +70,13 @@ def gn_format(contents, filename=None): + + + def _invoke_format_command(command_line, filename, contents): +- proc = subprocess.Popen( +- command_line, stdin=subprocess.PIPE, stdout=subprocess.PIPE) ++ kwargs = {} ++ if sys.version_info.major != 2: ++ kwargs['encoding'] = 'utf-8' ++ proc = subprocess.Popen(command_line, ++ stdin=subprocess.PIPE, ++ stdout=subprocess.PIPE, ++ **kwargs) + stdout_output, stderr_output = proc.communicate(input=contents) + exit_code = proc.wait() + +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/task_queue.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/task_queue.py +index 0d8f4c0f303..e666a9b668e 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/task_queue.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/task_queue.py +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import functools + import multiprocessing + + from .package_initializer import package_initializer +@@ -76,7 +77,7 @@ class TaskQueue(object): + if not report_progress: + return + +- done_count = reduce( ++ done_count = functools.reduce( + lambda count, worker_task: count + bool(worker_task.ready()), + self._worker_tasks, 0) + report_progress(len(self._worker_tasks), done_count) +@@ -85,4 +86,4 @@ class TaskQueue(object): + def _task_queue_run_tasks(tasks): + for task in tasks: + func, args, kwargs = task +- apply(func, args, kwargs) ++ func(*args, **kwargs) +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/code_generator.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/code_generator.py +index e8280be7213..e49e6eb965e 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/code_generator.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/code_generator.py +@@ -13,6 +13,7 @@ import re + import sys + + from idl_types import set_ancestors, IdlType ++from itertools import groupby + from v8_globals import includes + from v8_interface import constant_filters + from v8_types import set_component_dirs +@@ -43,6 +44,7 @@ TEMPLATES_DIR = os.path.normpath( + # after path[0] == invoking script dir + sys.path.insert(1, THIRD_PARTY_DIR) + import jinja2 ++from jinja2.filters import make_attrgetter, environmentfilter + + + def generate_indented_conditional(code, conditional): +@@ -88,6 +90,13 @@ def runtime_enabled_if(code, name): + return generate_indented_conditional(code, function) + + ++@environmentfilter ++def do_stringify_key_group_by(environment, value, attribute): ++ expr = make_attrgetter(environment, attribute) ++ key = lambda item: '' if expr(item) is None else str(expr(item)) ++ return groupby(sorted(value, key=key), expr) ++ ++ + def initialize_jinja_env(cache_dir): + jinja_env = jinja2.Environment( + loader=jinja2.FileSystemLoader(TEMPLATES_DIR), +@@ -117,6 +126,7 @@ def initialize_jinja_env(cache_dir): + }) + jinja_env.filters.update(constant_filters()) + jinja_env.filters.update(method_filters()) ++ jinja_env.filters["stringifykeygroupby"] = do_stringify_key_group_by + return jinja_env + + +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/generate_origin_trial_features.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/generate_origin_trial_features.py +index 130004eae83..04c0fabcef2 100755 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/generate_origin_trial_features.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/generate_origin_trial_features.py +@@ -80,7 +80,7 @@ def read_idl_file(reader, idl_filename): + assert len(interfaces) == 1, ( + "Expected one interface in file %r, found %d" % + (idl_filename, len(interfaces))) +- return (interfaces.values()[0], includes) ++ return (list(interfaces.values())[0], includes) + + + def interface_is_global(interface): +@@ -281,7 +281,7 @@ def main(): + + info_provider = create_component_info_provider( + os.path.normpath(options.info_dir), options.target_component) +- idl_filenames = map(str.strip, open(options.idl_files_list)) ++ idl_filenames = list(map(str.strip, open(options.idl_files_list))) + + generate_origin_trial_features(info_provider, options, idl_filenames) + return 0 +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_definitions.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_definitions.py +index 14e6e9d3f87..b027818aef2 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_definitions.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_definitions.py +@@ -394,7 +394,8 @@ class IdlInterface(object): + else: + raise ValueError('Unrecognized node class: %s' % child_class) + +- if len(filter(None, [self.iterable, self.maplike, self.setlike])) > 1: ++ if len(list(filter(None, ++ [self.iterable, self.maplike, self.setlike]))) > 1: + raise ValueError( + 'Interface can only have one of iterable<>, maplike<> and setlike<>.' + ) +@@ -512,6 +513,9 @@ class IdlAttribute(TypedObject): + def accept(self, visitor): + visitor.visit_attribute(self) + ++ def __lt__(self, other): ++ return self.name < other.name ++ + + ################################################################################ + # Constants +@@ -852,7 +856,7 @@ class IdlIncludes(object): + ################################################################################ + + +-class Exposure: ++class Exposure(object): + """An Exposure holds one Exposed or RuntimeEnabled condition. + Each exposure has two properties: exposed and runtime_enabled. + Exposure(e, r) corresponds to [Exposed(e r)]. Exposure(e) corresponds to +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_reader.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_reader.py +index 8d72865a6ca..b80eebdcd61 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_reader.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_reader.py +@@ -55,8 +55,8 @@ def validate_blink_idl_definitions(idl_filename, idl_file_basename, + definitions. There is no filename convention in this case. + - Otherwise, an IDL file is invalid. + """ +- targets = ( +- definitions.interfaces.values() + definitions.dictionaries.values()) ++ targets = (list(definitions.interfaces.values()) + ++ list(definitions.dictionaries.values())) + number_of_targets = len(targets) + if number_of_targets > 1: + raise Exception( +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_types.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_types.py +index cd4f0c3513b..ab95e9c0b08 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_types.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_types.py +@@ -349,7 +349,7 @@ class IdlUnionType(IdlTypeBase): + return True + + def single_matching_member_type(self, predicate): +- matching_types = filter(predicate, self.flattened_member_types) ++ matching_types = list(filter(predicate, self.flattened_member_types)) + if len(matching_types) > 1: + raise ValueError('%s is ambiguous.' % self.name) + return matching_types[0] if matching_types else None +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/utilities.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/utilities.py +index e1677ee7bd6..3c5006f064f 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/utilities.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/utilities.py +@@ -196,8 +196,9 @@ class ComponentInfoProviderModules(ComponentInfoProvider): + + @property + def callback_functions(self): +- return dict(self._component_info_core['callback_functions'].items() + +- self._component_info_modules['callback_functions'].items()) ++ return dict( ++ list(self._component_info_core['callback_functions'].items()) + ++ list(self._component_info_modules['callback_functions'].items())) + + @property + def specifier_for_export(self): +@@ -209,8 +210,8 @@ class ComponentInfoProviderModules(ComponentInfoProvider): + + + def load_interfaces_info_overall_pickle(info_dir): +- with open(os.path.join(info_dir, +- 'interfaces_info.pickle')) as interface_info_file: ++ with open(os.path.join(info_dir, 'interfaces_info.pickle'), ++ mode='rb') as interface_info_file: + return pickle.load(interface_info_file) + + +@@ -236,23 +237,20 @@ def merge_dict_recursively(target, diff): + + def create_component_info_provider_core(info_dir): + interfaces_info = load_interfaces_info_overall_pickle(info_dir) +- with open( +- os.path.join(info_dir, 'core', +- 'component_info_core.pickle')) as component_info_file: ++ with open(os.path.join(info_dir, 'core', 'component_info_core.pickle'), ++ mode='rb') as component_info_file: + component_info = pickle.load(component_info_file) + return ComponentInfoProviderCore(interfaces_info, component_info) + + + def create_component_info_provider_modules(info_dir): + interfaces_info = load_interfaces_info_overall_pickle(info_dir) +- with open( +- os.path.join(info_dir, 'core', +- 'component_info_core.pickle')) as component_info_file: ++ with open(os.path.join(info_dir, 'core', 'component_info_core.pickle'), ++ mode='rb') as component_info_file: + component_info_core = pickle.load(component_info_file) +- with open( +- os.path.join( +- info_dir, 'modules', +- 'component_info_modules.pickle')) as component_info_file: ++ with open(os.path.join(info_dir, 'modules', ++ 'component_info_modules.pickle'), ++ mode='rb') as component_info_file: + component_info_modules = pickle.load(component_info_file) + return ComponentInfoProviderModules(interfaces_info, component_info_core, + component_info_modules) +@@ -356,7 +354,7 @@ def write_pickle_file(pickle_filename, data): + pickle_filename = abs(pickle_filename) + # If |data| is same with the file content, we skip updating. + if os.path.isfile(pickle_filename): +- with open(pickle_filename) as pickle_file: ++ with open(pickle_filename, 'rb') as pickle_file: + try: + if pickle.load(pickle_file) == data: + return +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_interface.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_interface.py +index a43260414db..a85b03abe75 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_interface.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_interface.py +@@ -189,7 +189,7 @@ def context_enabled_features(attributes): + return sorted([ + member for member in members + if member.get(KEY) and not member.get('exposed_test') +- ]) ++ ], key=lambda item: item['name']) + + def member_filter_by_name(members, name): + return [member for member in members if member[KEY] == name] +@@ -612,7 +612,8 @@ def interface_context(interface, interfaces, component_info): + sorted( + origin_trial_features(interface, context['constants'], + context['attributes'], context['methods']) + +- context_enabled_features(context['attributes'])), ++ context_enabled_features(context['attributes']), ++ key=lambda item: item['name']), + }) + if context['optional_features']: + includes.add('platform/bindings/v8_per_context_data.h') +@@ -1356,9 +1357,9 @@ def resolution_tests_methods(effective_overloads): + + # Extract argument and IDL type to simplify accessing these in each loop. + arguments = [method['arguments'][index] for method in methods] +- arguments_methods = zip(arguments, methods) ++ arguments_methods = list(zip(arguments, methods)) + idl_types = [argument['idl_type_object'] for argument in arguments] +- idl_types_methods = zip(idl_types, methods) ++ idl_types_methods = list(zip(idl_types, methods)) + + # We can’t do a single loop through all methods or simply sort them, because + # a method may be listed in multiple steps of the resolution algorithm, and +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_methods.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_methods.py +index 5f1f89a3def..6ee8a407798 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_methods.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_methods.py +@@ -46,6 +46,10 @@ import v8_types + import v8_utilities + from v8_utilities import (has_extended_attribute_value, is_unforgeable) + ++# TODO: Remove this once Python2 is obsoleted. ++if sys.version_info.major != 2: ++ basestring = str ++ + + def method_is_visible(method, interface_is_partial): + if 'overloads' in method: +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_utilities.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_utilities.py +index 2ecd6923320..fcfc48371b1 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_utilities.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_utilities.py +@@ -271,7 +271,7 @@ EXPOSED_WORKERS = set([ + ]) + + +-class ExposureSet: ++class ExposureSet(object): + """An ExposureSet is a collection of Exposure instructions.""" + + def __init__(self, exposures=None): +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/callback_interface.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/callback_interface.py +index 13fb7c7068d..b73b7710687 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/callback_interface.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/callback_interface.py +@@ -91,11 +91,13 @@ class CallbackInterface(UserDefinedType, WithExtendedAttributes, + for operation_ir in ir.operations + ]) + self._operation_groups = tuple([ +- OperationGroup( +- operation_group_ir, +- filter(lambda x: x.identifier == operation_group_ir.identifier, +- self._operations), +- owner=self) for operation_group_ir in ir.operation_groups ++ OperationGroup(operation_group_ir, ++ list( ++ filter( ++ lambda x: x.identifier == operation_group_ir ++ .identifier, self._operations)), ++ owner=self) ++ for operation_group_ir in ir.operation_groups + ]) + + @property +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/database.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/database.py +index c92cf48eb2a..f5d59129449 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/database.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/database.py +@@ -156,4 +156,4 @@ class Database(object): + return self._view_by_kind(Database._Kind.UNION) + + def _view_by_kind(self, kind): +- return self._impl.find_by_kind(kind).values() ++ return list(self._impl.find_by_kind(kind).values()) +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/exposure.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/exposure.py +index abaeef39c30..e36cf7439ae 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/exposure.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/exposure.py +@@ -8,8 +8,11 @@ from .runtime_enabled_features import RuntimeEnabledFeatures + class _Feature(str): + """Represents a runtime-enabled feature.""" + ++ def __new__(cls, value): ++ return str.__new__(cls, value) ++ + def __init__(self, value): +- str.__init__(self, value) ++ str.__init__(self) + self._is_context_dependent = ( + RuntimeEnabledFeatures.is_context_dependent(self)) + +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/function_like.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/function_like.py +index 648c70d803d..1712f19c672 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/function_like.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/function_like.py +@@ -71,8 +71,9 @@ class FunctionLike(WithIdentifier): + def num_of_required_arguments(self): + """Returns the number of required arguments.""" + return len( +- filter(lambda arg: not (arg.is_optional or arg.is_variadic), +- self.arguments)) ++ list( ++ filter(lambda arg: not (arg.is_optional or arg.is_variadic), ++ self.arguments))) + + + class OverloadGroup(WithIdentifier): +@@ -171,8 +172,7 @@ class OverloadGroup(WithIdentifier): + Returns the effective overload set. + https://heycam.github.io/webidl/#compute-the-effective-overload-set + """ +- assert argument_count is None or isinstance(argument_count, +- (int, long)) ++ assert argument_count is None or isinstance(argument_count, int) + + N = argument_count + S = [] +@@ -188,21 +188,21 @@ class OverloadGroup(WithIdentifier): + + S.append( + OverloadGroup.EffectiveOverloadItem( +- X, map(lambda arg: arg.idl_type, X.arguments), +- map(lambda arg: arg.optionality, X.arguments))) ++ X, list(map(lambda arg: arg.idl_type, X.arguments)), ++ list(map(lambda arg: arg.optionality, X.arguments)))) + + if X.is_variadic: +- for i in xrange(n, max(maxarg, N)): +- t = map(lambda arg: arg.idl_type, X.arguments) +- o = map(lambda arg: arg.optionality, X.arguments) +- for _ in xrange(n, i + 1): ++ for i in range(n, max(maxarg, N)): ++ t = list(map(lambda arg: arg.idl_type, X.arguments)) ++ o = list(map(lambda arg: arg.optionality, X.arguments)) ++ for _ in range(n, i + 1): + t.append(X.arguments[-1].idl_type) + o.append(X.arguments[-1].optionality) + S.append(OverloadGroup.EffectiveOverloadItem(X, t, o)) + +- t = map(lambda arg: arg.idl_type, X.arguments) +- o = map(lambda arg: arg.optionality, X.arguments) +- for i in xrange(n - 1, -1, -1): ++ t = list(map(lambda arg: arg.idl_type, X.arguments)) ++ o = list(map(lambda arg: arg.optionality, X.arguments)) ++ for i in range(n - 1, -1, -1): + if X.arguments[i].optionality == IdlType.Optionality.REQUIRED: + break + S.append(OverloadGroup.EffectiveOverloadItem(X, t[:i], o[:i])) +@@ -222,7 +222,7 @@ class OverloadGroup(WithIdentifier): + for item in items) + assert len(items) > 1 + +- for index in xrange(len(items[0].type_list)): ++ for index in range(len(items[0].type_list)): + # Assume that the given items are valid, and we only need to test + # the two types. + if OverloadGroup.are_distinguishable_types( +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/idl_compiler.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/idl_compiler.py +index c5ee2bd8a3d..58315072480 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/idl_compiler.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/idl_compiler.py +@@ -149,8 +149,8 @@ class IdlCompiler(object): + for old_ir in old_irs: + new_ir = make_copy(old_ir) + self._ir_map.add(new_ir) +- new_ir.attributes = filter(not_disabled, new_ir.attributes) +- new_ir.operations = filter(not_disabled, new_ir.operations) ++ new_ir.attributes = list(filter(not_disabled, new_ir.attributes)) ++ new_ir.operations = list(filter(not_disabled, new_ir.operations)) + + def _record_defined_in_partial_and_mixin(self): + old_irs = self._ir_map.irs_of_kinds( +@@ -231,7 +231,7 @@ class IdlCompiler(object): + only_to_members_of_partial_or_mixin=False) + propagate_to_exposure(propagate) + +- map(process_member_like, ir.iter_all_members()) ++ list(map(process_member_like, ir.iter_all_members())) + + def process_member_like(ir): + propagate = functools.partial(propagate_extattr, ir=ir) +@@ -257,7 +257,7 @@ class IdlCompiler(object): + + self._ir_map.move_to_new_phase() + +- map(process_interface_like, old_irs) ++ list(map(process_interface_like, old_irs)) + + def _determine_blink_headers(self): + irs = self._ir_map.irs_of_kinds( +@@ -422,9 +422,9 @@ class IdlCompiler(object): + assert not new_interface.deriveds + derived_set = identifier_to_derived_set.get( + new_interface.identifier, set()) +- new_interface.deriveds = map( +- lambda id_: self._ref_to_idl_def_factory.create(id_), +- sorted(derived_set)) ++ new_interface.deriveds = list( ++ map(lambda id_: self._ref_to_idl_def_factory.create(id_), ++ sorted(derived_set))) + + def _supplement_missing_html_constructor_operation(self): + # Temporary mitigation of misuse of [HTMLConstructor] +@@ -553,7 +553,8 @@ class IdlCompiler(object): + self._ir_map.add(new_ir) + + for group in new_ir.iter_all_overload_groups(): +- exposures = map(lambda overload: overload.exposure, group) ++ exposures = list(map(lambda overload: overload.exposure, ++ group)) + + # [Exposed] + if any(not exposure.global_names_and_features +@@ -653,8 +654,8 @@ class IdlCompiler(object): + constructs = set() + for global_name in global_names: + constructs.update(exposed_map.get(global_name, [])) +- new_ir.exposed_constructs = map( +- self._ref_to_idl_def_factory.create, sorted(constructs)) ++ new_ir.exposed_constructs = list( ++ map(self._ref_to_idl_def_factory.create, sorted(constructs))) + + assert not new_ir.legacy_window_aliases + if new_ir.identifier != 'Window': +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/interface.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/interface.py +index 65d24e529d1..067ef2eb0b2 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/interface.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/interface.py +@@ -180,8 +180,9 @@ class Interface(UserDefinedType, WithExtendedAttributes, WithCodeGeneratorInfo, + self._constructor_groups = tuple([ + ConstructorGroup( + group_ir, +- filter(lambda x: x.identifier == group_ir.identifier, +- self._constructors), ++ list( ++ filter(lambda x: x.identifier == group_ir.identifier, ++ self._constructors)), + owner=self) for group_ir in ir.constructor_groups + ]) + assert len(self._constructor_groups) <= 1 +@@ -192,8 +193,9 @@ class Interface(UserDefinedType, WithExtendedAttributes, WithCodeGeneratorInfo, + self._named_constructor_groups = tuple([ + ConstructorGroup( + group_ir, +- filter(lambda x: x.identifier == group_ir.identifier, +- self._named_constructors), ++ list( ++ filter(lambda x: x.identifier == group_ir.identifier, ++ self._named_constructors)), + owner=self) for group_ir in ir.named_constructor_groups + ]) + self._operations = tuple([ +@@ -203,22 +205,23 @@ class Interface(UserDefinedType, WithExtendedAttributes, WithCodeGeneratorInfo, + self._operation_groups = tuple([ + OperationGroup( + group_ir, +- filter(lambda x: x.identifier == group_ir.identifier, +- self._operations), ++ list( ++ filter(lambda x: x.identifier == group_ir.identifier, ++ self._operations)), + owner=self) for group_ir in ir.operation_groups + ]) + self._exposed_constructs = tuple(ir.exposed_constructs) + self._legacy_window_aliases = tuple(ir.legacy_window_aliases) + self._indexed_and_named_properties = None +- indexed_and_named_property_operations = filter( +- lambda x: x.is_indexed_or_named_property_operation, +- self._operations) ++ indexed_and_named_property_operations = list( ++ filter(lambda x: x.is_indexed_or_named_property_operation, ++ self._operations)) + if indexed_and_named_property_operations: + self._indexed_and_named_properties = IndexedAndNamedProperties( + indexed_and_named_property_operations, owner=self) + self._stringifier = None +- stringifier_operation_irs = filter(lambda x: x.is_stringifier, +- ir.operations) ++ stringifier_operation_irs = list( ++ filter(lambda x: x.is_stringifier, ir.operations)) + if stringifier_operation_irs: + assert len(stringifier_operation_irs) == 1 + op_ir = make_copy(stringifier_operation_irs[0]) +@@ -231,8 +234,9 @@ class Interface(UserDefinedType, WithExtendedAttributes, WithCodeGeneratorInfo, + attribute = None + if operation.stringifier_attribute: + attr_id = operation.stringifier_attribute +- attributes = filter(lambda x: x.identifier == attr_id, +- self._attributes) ++ attributes = list( ++ filter(lambda x: x.identifier == attr_id, ++ self._attributes)) + assert len(attributes) == 1 + attribute = attributes[0] + self._stringifier = Stringifier(operation, attribute, owner=self) +@@ -578,8 +582,9 @@ class Iterable(WithDebugInfo): + self._operation_groups = tuple([ + OperationGroup( + group_ir, +- filter(lambda x: x.identifier == group_ir.identifier, +- self._operations), ++ list( ++ filter(lambda x: x.identifier == group_ir.identifier, ++ self._operations)), + owner=owner) for group_ir in ir.operation_groups + ]) + +@@ -666,8 +671,9 @@ class Maplike(WithDebugInfo): + self._operation_groups = tuple([ + OperationGroup( + group_ir, +- filter(lambda x: x.identifier == group_ir.identifier, +- self._operations), ++ list( ++ filter(lambda x: x.identifier == group_ir.identifier, ++ self._operations)), + owner=owner) for group_ir in ir.operation_groups + ]) + +@@ -755,8 +761,9 @@ class Setlike(WithDebugInfo): + self._operation_groups = tuple([ + OperationGroup( + group_ir, +- filter(lambda x: x.identifier == group_ir.identifier, +- self._operations), ++ list( ++ filter(lambda x: x.identifier == group_ir.identifier, ++ self._operations)), + owner=owner) for group_ir in ir.operation_groups + ]) + +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/ir_builder.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/ir_builder.py +index e9aeff4ab82..d80554d603e 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/ir_builder.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/ir_builder.py +@@ -2,6 +2,8 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import sys ++ + from .argument import Argument + from .ast_group import AstGroup + from .attribute import Attribute +@@ -30,6 +32,11 @@ from .operation import Operation + from .typedef import Typedef + + ++# TODO: Remove this once Python2 is obsoleted. ++if sys.version_info.major != 2: ++ long = int ++ ++ + def load_and_register_idl_definitions(filepaths, register_ir, + create_ref_to_idl_def, idl_type_factory): + """ +@@ -160,7 +167,7 @@ class _IRBuilder(object): + child_nodes = list(node.GetChildren()) + extended_attributes = self._take_extended_attributes(child_nodes) + +- members = map(self._build_interface_member, child_nodes) ++ members = list(map(self._build_interface_member, child_nodes)) + attributes = [] + constants = [] + operations = [] +@@ -302,7 +309,7 @@ class _IRBuilder(object): + child_nodes = list(node.GetChildren()) + inherited = self._take_inheritance(child_nodes) + extended_attributes = self._take_extended_attributes(child_nodes) +- own_members = map(self._build_dictionary_member, child_nodes) ++ own_members = list(map(self._build_dictionary_member, child_nodes)) + + return Dictionary.IR( + identifier=Identifier(node.GetName()), +@@ -336,7 +343,7 @@ class _IRBuilder(object): + + child_nodes = list(node.GetChildren()) + extended_attributes = self._take_extended_attributes(child_nodes) +- members = map(self._build_interface_member, child_nodes) ++ members = list(map(self._build_interface_member, child_nodes)) + constants = [] + operations = [] + for member in members: +@@ -456,8 +463,8 @@ class _IRBuilder(object): + assert len(child_nodes) == 1 + child = child_nodes[0] + if child.GetClass() == 'Arguments': +- arguments = map(build_extattr_argument, +- child.GetChildren()) ++ arguments = list( ++ map(build_extattr_argument, child.GetChildren())) + elif child.GetClass() == 'Call': + assert len(child.GetChildren()) == 1 + grand_child = child.GetChildren()[0] +@@ -486,7 +493,9 @@ class _IRBuilder(object): + + assert node.GetClass() == 'ExtAttributes' + return ExtendedAttributes( +- filter(None, map(build_extended_attribute, node.GetChildren()))) ++ list( ++ filter(None, map(build_extended_attribute, ++ node.GetChildren())))) + + def _build_inheritance(self, node): + assert node.GetClass() == 'Inherit' +@@ -506,7 +515,7 @@ class _IRBuilder(object): + + def _build_iterable(self, node): + assert node.GetClass() == 'Iterable' +- types = map(self._build_type, node.GetChildren()) ++ types = list(map(self._build_type, node.GetChildren())) + assert len(types) == 1 or len(types) == 2 + if len(types) == 1: # value iterator + key_type, value_type = (None, types[0]) +@@ -584,7 +593,7 @@ class _IRBuilder(object): + def _build_maplike(self, node, interface_identifier): + assert node.GetClass() == 'Maplike' + assert isinstance(interface_identifier, Identifier) +- types = map(self._build_type, node.GetChildren()) ++ types = list(map(self._build_type, node.GetChildren())) + assert len(types) == 2 + key_type, value_type = types + is_readonly = bool(node.GetProperty('READONLY')) +@@ -676,7 +685,7 @@ class _IRBuilder(object): + def _build_setlike(self, node, interface_identifier): + assert node.GetClass() == 'Setlike' + assert isinstance(interface_identifier, Identifier) +- types = map(self._build_type, node.GetChildren()) ++ types = list(map(self._build_type, node.GetChildren())) + assert len(types) == 1 + value_type = types[0] + is_readonly = bool(node.GetProperty('READONLY')) +@@ -838,7 +847,7 @@ class _IRBuilder(object): + + def build_union_type(node, extended_attributes): + return self._idl_type_factory.union_type( +- member_types=map(self._build_type, node.GetChildren()), ++ member_types=list(map(self._build_type, node.GetChildren())), + is_optional=is_optional, + extended_attributes=extended_attributes, + debug_info=self._build_debug_info(node)) +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/make_copy.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/make_copy.py +index a7a2b11f3f0..2f6b61300ff 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/make_copy.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/make_copy.py +@@ -3,6 +3,13 @@ + # found in the LICENSE file. + + ++import sys ++ ++# TODO: Remove this once Python2 is obsoleted. ++if sys.version_info.major != 2: ++ long = int ++ basestring = str ++ + def make_copy(obj, memo=None): + """ + Creates a copy of the given object, which should be an IR or part of IR. +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/namespace.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/namespace.py +index eeabef97cbe..bd7e98907f3 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/namespace.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/namespace.py +@@ -107,11 +107,13 @@ class Namespace(UserDefinedType, WithExtendedAttributes, WithCodeGeneratorInfo, + for operation_ir in ir.operations + ]) + self._operation_groups = tuple([ +- OperationGroup( +- operation_group_ir, +- filter(lambda x: x.identifier == operation_group_ir.identifier, +- self._operations), +- owner=self) for operation_group_ir in ir.operation_groups ++ OperationGroup(operation_group_ir, ++ list( ++ filter( ++ lambda x: x.identifier == operation_group_ir ++ .identifier, self._operations)), ++ owner=self) ++ for operation_group_ir in ir.operation_groups + ]) + + @property +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/templates/dictionary_v8.cc.tmpl b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/templates/dictionary_v8.cc.tmpl +index 0add9c45a38..dc910f6d227 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/templates/dictionary_v8.cc.tmpl ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/templates/dictionary_v8.cc.tmpl +@@ -59,9 +59,9 @@ void {{v8_class}}::ToImpl(v8::Isolate* isolate, v8::Local v8_value, { + DCHECK(executionContext); + {% endif %}{# has_origin_trial_members #} + {% endif %}{# members #} +- {% for origin_trial_test, origin_trial_member_list in members | groupby('origin_trial_feature_name') %} ++ {% for origin_trial_test, origin_trial_member_list in members | stringifykeygroupby('origin_trial_feature_name') %} + {% filter origin_trial_enabled(origin_trial_test, "executionContext") %} +- {% for feature_name, member_list in origin_trial_member_list | groupby('runtime_enabled_feature_name') %} ++ {% for feature_name, member_list in origin_trial_member_list | stringifykeygroupby('runtime_enabled_feature_name') %} + {% filter runtime_enabled(feature_name) %} + {% for member in member_list %} + v8::Local {{member.v8_value}}; +@@ -147,9 +147,9 @@ bool toV8{{cpp_class}}(const {{cpp_class}}* impl, v8::Local dictiona + DCHECK(executionContext); + {% endif %}{# has_origin_trial_members #} + {% endif %}{# members #} +- {% for origin_trial_test, origin_trial_member_list in members | groupby('origin_trial_feature_name') %} ++ {% for origin_trial_test, origin_trial_member_list in members | stringifykeygroupby('origin_trial_feature_name') %} + {% filter origin_trial_enabled(origin_trial_test, "executionContext") %} +- {% for feature_name, member_list in origin_trial_member_list | groupby('runtime_enabled_feature_name') %} ++ {% for feature_name, member_list in origin_trial_member_list | stringifykeygroupby('runtime_enabled_feature_name') %} + {% filter runtime_enabled(feature_name) %} + {% for member in member_list %} + v8::Local {{member.v8_value}}; +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/make_style_shorthands.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/make_style_shorthands.py +index 1799cd5a153..5f43ffabc26 100755 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/make_style_shorthands.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/make_style_shorthands.py +@@ -71,7 +71,7 @@ class Expansion(object): + def enabled_longhands(self): + include = lambda longhand: not longhand[ + 'runtime_flag'] or self.is_enabled(longhand['runtime_flag']) +- return filter(include, self._longhands) ++ return list(filter(include, self._longhands)) + + @property + def index(self): +@@ -87,8 +87,9 @@ class Expansion(object): + + def create_expansions(longhands): + flags = collect_runtime_flags(longhands) +- expansions = map(lambda mask: Expansion(longhands, flags, mask), +- range(1 << len(flags))) ++ expansions = list( ++ map(lambda mask: Expansion(longhands, flags, mask), ++ range(1 << len(flags)))) + assert len(expansions) > 0 + # We generate 2^N expansions for N flags, so enforce some limit. + assert len(flags) <= 4, 'Too many runtime flags for a single shorthand' +@@ -114,14 +115,14 @@ class StylePropertyShorthandWriter(json5_generator.Writer): + + self._longhand_dictionary = defaultdict(list) + for property_ in json5_properties.shorthands: +- property_['longhand_enum_keys'] = map(enum_key_for_css_property, +- property_['longhands']) +- property_['longhand_property_ids'] = map(id_for_css_property, +- property_['longhands']) +- +- longhands = map( +- lambda name: json5_properties.properties_by_name[name], +- property_['longhands']) ++ property_['longhand_enum_keys'] = list( ++ map(enum_key_for_css_property, property_['longhands'])) ++ property_['longhand_property_ids'] = list( ++ map(id_for_css_property, property_['longhands'])) ++ ++ longhands = list( ++ map(lambda name: json5_properties.properties_by_name[name], ++ property_['longhands'])) + property_['expansions'] = create_expansions(longhands) + for longhand_enum_key in property_['longhand_enum_keys']: + self._longhand_dictionary[longhand_enum_key].append(property_) +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/properties/make_css_property_instances.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/properties/make_css_property_instances.py +index 75030ac577e..f72aadee17d 100755 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/properties/make_css_property_instances.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/properties/make_css_property_instances.py +@@ -42,8 +42,8 @@ class CSSPropertyInstancesWriter(json5_generator.Writer): + aliases = self._css_properties.aliases + + # Lists of PropertyClassData. +- self._property_classes_by_id = map(self.get_class, properties) +- self._alias_classes_by_id = map(self.get_class, aliases) ++ self._property_classes_by_id = list(map(self.get_class, properties)) ++ self._alias_classes_by_id = list(map(self.get_class, aliases)) + + # Sort by enum value. + self._property_classes_by_id.sort(key=lambda t: t.enum_value) +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py +index 5ee49056be4..db72660d471 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py +@@ -95,7 +95,7 @@ def main(): + + open(args.output_file, 'wb').write( + generate_gperf(gperf_path, +- open(infile).read(), gperf_args)) ++ open(infile).read(), gperf_args).encode('utf-8')) + + + if __name__ == '__main__': +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_file.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_file.py +index 28adc050f1e..58113483e57 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_file.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_file.py +@@ -66,7 +66,7 @@ class InFile(object): + self._defaults = defaults + self._valid_values = copy.deepcopy( + valid_values if valid_values else {}) +- self._parse(map(str.strip, lines)) ++ self._parse(list(map(str.strip, lines))) + + @classmethod + def load_from_files(self, file_paths, defaults, valid_values, +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_generator.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_generator.py +index e46740a2e85..ab1981ad1e3 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_generator.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_generator.py +@@ -32,10 +32,15 @@ import os + import os.path + import shlex + import shutil ++import sys + import optparse + + from in_file import InFile + ++# TODO: Remove this once Python2 is obsoleted. ++if sys.version_info.major != 2: ++ basestring = str ++ + + ######################################################### + # This is now deprecated - use json5_generator.py instead +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/make_runtime_features.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/make_runtime_features.py +index cafe8d94a8e..6925a4fa580 100755 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/make_runtime_features.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/make_runtime_features.py +@@ -138,7 +138,7 @@ class RuntimeFeatureWriter(BaseRuntimeFeatureWriter): + except Exception: + # If trouble unpickling, overwrite + pass +- with open(os.path.abspath(file_name), 'w') as pickle_file: ++ with open(os.path.abspath(file_name), 'wb') as pickle_file: + pickle.dump(features_map, pickle_file) + + def _template_inputs(self): +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_factory.cc.tmpl b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_factory.cc.tmpl +index dc3f44c5b10..3eefcf9f0ee 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_factory.cc.tmpl ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_factory.cc.tmpl +@@ -26,7 +26,7 @@ using {{namespace}}FunctionMap = HashMapGetExecutionContext())) { +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_type_helpers.h.tmpl b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_type_helpers.h.tmpl +index 1b5297d52dc..edecc81d9d4 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_type_helpers.h.tmpl ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_type_helpers.h.tmpl +@@ -15,7 +15,7 @@ namespace blink { + class Document; + + // Type checking. +-{% for tag in tags|sort if not tag.multipleTagNames and not tag.noTypeHelpers %} ++{% for tag in tags|sort(attribute='name') if not tag.multipleTagNames and not tag.noTypeHelpers %} + class {{tag.interface}}; + template <> + inline bool IsElementOfType(const Node& node) { +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/macros.tmpl b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/macros.tmpl +index 0244433af2e..dcdbb02a56c 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/macros.tmpl ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/macros.tmpl +@@ -25,7 +25,7 @@ + + + {% macro trie_leaf(index, object, return_macro, lowercase_data) %} +-{% set name, value = object.items()[0] %} ++{% set name, value = (object.items()|list)[0] %} + {% if name|length %} + if ( + {%- for c in name -%} +@@ -45,7 +45,7 @@ return {{ return_macro(value) }}; + + + {% macro trie_switch(trie, index, return_macro, lowercase_data) %} +-{% if trie|length == 1 and trie.values()[0] is string %} ++{% if trie|length == 1 and (trie.values()|list)[0] is string %} + {{ trie_leaf(index, trie, return_macro, lowercase_data) -}} + {% else %} + {% if lowercase_data %} +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/make_qualified_names.h.tmpl b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/make_qualified_names.h.tmpl +index cb05c6c4315..bd5566b03e7 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/make_qualified_names.h.tmpl ++++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/make_qualified_names.h.tmpl +@@ -24,12 +24,12 @@ namespace {{cpp_namespace}} { + {{symbol_export}}extern const WTF::AtomicString& {{namespace_prefix}}NamespaceURI; + + // Tags +-{% for tag in tags|sort %} ++{% for tag in tags|sort(attribute='name') %} + {{symbol_export}}extern const blink::{{namespace}}QualifiedName& {{tag|symbol}}Tag; + {% endfor %} + + // Attributes +-{% for attr in attrs|sort %} ++{% for attr in attrs|sort(attribute='name') %} + {{symbol_export}}extern const blink::QualifiedName& {{attr|symbol}}Attr; + {% endfor %} + +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/dawn/generator/generator_lib.py b/qtwebengine/src/3rdparty/chromium/third_party/dawn/generator/generator_lib.py +index 5e3734d7833..e3d46bd194f 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/dawn/generator/generator_lib.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/dawn/generator/generator_lib.py +@@ -201,6 +201,10 @@ def _compute_python_dependencies(root_dir=None): + + paths = set() + for path in module_paths: ++ # Builtin/namespaced modules may return None for the file path. ++ if not path: ++ continue ++ + path = os.path.abspath(path) + + if not path.startswith(root_dir): +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/BUILD.gn b/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/BUILD.gn +index cd488e88b60..ea1dc3d9a79 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/BUILD.gn ++++ b/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/BUILD.gn +@@ -2,6 +2,8 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/python.gni") ++ + import("//third_party/blink/public/public_features.gni") + import("./all_devtools_files.gni") + import("./all_devtools_modules.gni") +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_inspector_overlay.py b/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_inspector_overlay.py +index d6666e8b74f..0f7a661e632 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_inspector_overlay.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_inspector_overlay.py +@@ -45,7 +45,8 @@ def rollup(input_path, output_path, filename, max_size, rollup_plugin): + ['--format', 'iife', '-n', 'InspectorOverlay'] + ['--input', target] + + ['--plugin', rollup_plugin], + stdout=subprocess.PIPE, +- stderr=subprocess.PIPE) ++ stderr=subprocess.PIPE, ++ text=True) + out, error = rollup_process.communicate() + if not out: + raise Exception("rollup failed: " + error) +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_release_applications.py b/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_release_applications.py +index fa8e73d34af..7d0b84b2171 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_release_applications.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_release_applications.py +@@ -10,7 +10,7 @@ Builds applications in release mode: + and the application loader into a single script. + """ + +-from cStringIO import StringIO ++from io import StringIO + from os import path + from os.path import join + import copy +@@ -145,8 +145,7 @@ class ReleaseBuilder(object): + resource_content = read_file(path.join(self.application_dir, resource_name)) + if not (resource_name.endswith('.html') + or resource_name.endswith('md')): +- resource_content += resource_source_url(resource_name).encode( +- 'utf-8') ++ resource_content += resource_source_url(resource_name) + resource_content = resource_content.replace('\\', '\\\\') + resource_content = resource_content.replace('\n', '\\n') + resource_content = resource_content.replace('"', '\\"') +@@ -173,7 +172,9 @@ class ReleaseBuilder(object): + def _concatenate_application_script(self, output): + output.write('Root.allDescriptors.push(...%s);' % self._release_module_descriptors()) + if self.descriptors.extends: +- output.write('Root.applicationDescriptor.modules.push(...%s);' % json.dumps(self.descriptors.application.values())) ++ output.write( ++ 'Root.applicationDescriptor.modules.push(...%s);' % ++ json.dumps(list(self.descriptors.application.values()))) + else: + output.write('Root.applicationDescriptor = %s;' % self.descriptors.application_json()) + +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/generate_devtools_grd.py b/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/generate_devtools_grd.py +index be510c48d76..c6a59c90298 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/generate_devtools_grd.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/generate_devtools_grd.py +@@ -123,7 +123,7 @@ def main(argv): + + try: + os.makedirs(path.join(output_directory, 'Images')) +- except OSError, e: ++ except OSError as e: + if e.errno != errno.EEXIST: + raise e + +@@ -147,7 +147,7 @@ def main(argv): + shutil.copy(path.join(dirname, filename), path.join(output_directory, 'Images')) + add_file_to_grd(doc, path.join('Images', filename)) + +- with open(parsed_args.output_filename, 'w') as output_file: ++ with open(parsed_args.output_filename, 'wb') as output_file: + output_file.write(doc.toxml(encoding='UTF-8')) + + +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/modular_build.py b/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/modular_build.py +index 0ba695d3810..bb1da2f9f8d 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/modular_build.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/modular_build.py +@@ -7,6 +7,8 @@ + Utilities for the modular DevTools build. + """ + ++from __future__ import print_function ++ + import collections + from os import path + import os +@@ -40,7 +42,7 @@ def load_and_parse_json(filename): + try: + return json.loads(read_file(filename)) + except: +- print 'ERROR: Failed to parse %s' % filename ++ print('ERROR: Failed to parse %s' % filename) + raise + + class Descriptors: +@@ -57,7 +59,7 @@ class Descriptors: + + def application_json(self): + result = dict() +- result['modules'] = self.application.values() ++ result['modules'] = list(self.application.values()) + return json.dumps(result) + + def all_compiled_files(self): +diff --git a/qtwebengine/src/3rdparty/chromium/third_party/jinja2/tests.py b/qtwebengine/src/3rdparty/chromium/third_party/jinja2/tests.py +index 0adc3d4dbcb..b14f85ff148 100644 +--- a/qtwebengine/src/3rdparty/chromium/third_party/jinja2/tests.py ++++ b/qtwebengine/src/3rdparty/chromium/third_party/jinja2/tests.py +@@ -10,7 +10,7 @@ + """ + import operator + import re +-from collections import Mapping ++from collections.abc import Mapping + from jinja2.runtime import Undefined + from jinja2._compat import text_type, string_types, integer_types + import decimal +diff --git a/qtwebengine/src/3rdparty/chromium/tools/metrics/ukm/gen_builders.py b/qtwebengine/src/3rdparty/chromium/tools/metrics/ukm/gen_builders.py +index f9f61d90a56..44e46fae8cc 100755 +--- a/qtwebengine/src/3rdparty/chromium/tools/metrics/ukm/gen_builders.py ++++ b/qtwebengine/src/3rdparty/chromium/tools/metrics/ukm/gen_builders.py +@@ -48,9 +48,10 @@ def ReadFilteredData(path): + data = ukm_model.UKM_XML_TYPE.Parse(ukm_file.read()) + event_tag = ukm_model._EVENT_TYPE.tag + metric_tag = ukm_model._METRIC_TYPE.tag +- data[event_tag] = filter(ukm_model.IsNotObsolete, data[event_tag]) ++ data[event_tag] = list(filter(ukm_model.IsNotObsolete, data[event_tag])) + for event in data[event_tag]: +- event[metric_tag] = filter(ukm_model.IsNotObsolete, event[metric_tag]) ++ event[metric_tag] = list( ++ filter(ukm_model.IsNotObsolete, event[metric_tag])) + return data + + +diff --git a/qtwebengine/src/3rdparty/chromium/ui/ozone/generate_constructor_list.py b/qtwebengine/src/3rdparty/chromium/ui/ozone/generate_constructor_list.py +index 8d800636c97..04fa18e93df 100755 +--- a/qtwebengine/src/3rdparty/chromium/ui/ozone/generate_constructor_list.py ++++ b/qtwebengine/src/3rdparty/chromium/ui/ozone/generate_constructor_list.py +@@ -45,12 +45,15 @@ Example Output: ./ui/ozone/generate_constructor_list.py \ + } // namespace ui + """ + ++try: ++ from StringIO import StringIO # for Python 2 ++except ImportError: ++ from io import StringIO # for Python 3 + import optparse + import os + import collections + import re + import sys +-import string + + + def GetTypedefName(typename): +@@ -68,7 +71,7 @@ def GetConstructorName(typename, platform): + This is just "Create" + typename + platform. + """ + +- return 'Create' + typename + string.capitalize(platform) ++ return 'Create' + typename + platform.capitalize() + + + def GenerateConstructorList(out, namespace, export, typenames, platforms, +@@ -163,12 +166,14 @@ def main(argv): + sys.exit(1) + + # Write to standard output or file specified by --output_cc. +- out_cc = sys.stdout ++ out_cc = getattr(sys.stdout, 'buffer', sys.stdout) + if options.output_cc: + out_cc = open(options.output_cc, 'wb') + +- GenerateConstructorList(out_cc, options.namespace, options.export, ++ out_cc_str = StringIO() ++ GenerateConstructorList(out_cc_str, options.namespace, options.export, + typenames, platforms, includes, usings) ++ out_cc.write(out_cc_str.getvalue().encode('utf-8')) + + if options.output_cc: + out_cc.close() +diff --git a/qtwebengine/src/3rdparty/chromium/ui/ozone/generate_ozone_platform_list.py b/qtwebengine/src/3rdparty/chromium/ui/ozone/generate_ozone_platform_list.py +index d47c398259b..2702b68b9bd 100755 +--- a/qtwebengine/src/3rdparty/chromium/ui/ozone/generate_ozone_platform_list.py ++++ b/qtwebengine/src/3rdparty/chromium/ui/ozone/generate_ozone_platform_list.py +@@ -49,12 +49,15 @@ Example Output: ./generate_ozone_platform_list.py --default wayland dri wayland + + """ + ++try: ++ from StringIO import StringIO # for Python 2 ++except ImportError: ++ from io import StringIO # for Python 3 + import optparse + import os + import collections + import re + import sys +-import string + + + def GetConstantName(name): +@@ -63,7 +66,7 @@ def GetConstantName(name): + We just capitalize the platform name and prepend "CreateOzonePlatform". + """ + +- return 'kPlatform' + string.capitalize(name) ++ return 'kPlatform' + name.capitalize() + + + def GeneratePlatformListText(out, platforms): +@@ -149,9 +152,9 @@ def main(argv): + platforms.insert(0, options.default) + + # Write to standard output or file specified by --output_{cc,h}. +- out_cc = sys.stdout +- out_h = sys.stdout +- out_txt = sys.stdout ++ out_cc = getattr(sys.stdout, 'buffer', sys.stdout) ++ out_h = getattr(sys.stdout, 'buffer', sys.stdout) ++ out_txt = getattr(sys.stdout, 'buffer', sys.stdout) + if options.output_cc: + out_cc = open(options.output_cc, 'wb') + if options.output_h: +@@ -159,9 +162,16 @@ def main(argv): + if options.output_txt: + out_txt = open(options.output_txt, 'wb') + +- GeneratePlatformListText(out_txt, platforms) +- GeneratePlatformListHeader(out_h, platforms) +- GeneratePlatformListSource(out_cc, platforms) ++ out_txt_str = StringIO() ++ out_h_str = StringIO() ++ out_cc_str = StringIO() ++ ++ GeneratePlatformListText(out_txt_str, platforms) ++ out_txt.write(out_txt_str.getvalue().encode('utf-8')) ++ GeneratePlatformListHeader(out_h_str, platforms) ++ out_h.write(out_h_str.getvalue().encode('utf-8')) ++ GeneratePlatformListSource(out_cc_str, platforms) ++ out_cc.write(out_cc_str.getvalue().encode('utf-8')) + + if options.output_cc: + out_cc.close() diff --git a/qt5-webengine-python3.patch b/qt5-webengine-python3.patch new file mode 100644 index 0000000..6a1ccc4 --- /dev/null +++ b/qt5-webengine-python3.patch @@ -0,0 +1,161 @@ +diff --git a/qtwebengine/configure.pri b/qtwebengine/configure.pri +index 8705ad93..6723bffe 100644 +--- a/qtwebengine/configure.pri ++++ b/qtwebengine/configure.pri +@@ -7,20 +7,7 @@ QTWEBENGINE_SOURCE_TREE = $$PWD + equals(QMAKE_HOST.os, Windows): EXE_SUFFIX = .exe + + defineTest(isPythonVersionSupported) { +- python = $$system_quote($$system_path($$1)) +- python_version = $$system('$$python -c "import sys; print(sys.version_info[0:3])"') +- python_version ~= s/[()]//g +- python_version = $$split(python_version, ',') +- python_major_version = $$first(python_version) +- greaterThan(python_major_version, 2) { +- qtLog("Python version 3 is not supported by Chromium.") +- return(false) +- } +- python_minor_version = $$member(python_version, 1) +- python_patch_version = $$member(python_version, 2) +- greaterThan(python_major_version, 1): greaterThan(python_minor_version, 6): greaterThan(python_patch_version, 4): return(true) +- qtLog("Unsupported python version: $${python_major_version}.$${python_minor_version}.$${python_patch_version}.") +- return(false) ++ return(true) + } + + defineTest(qtConfTest_detectJumboBuild) { +@@ -52,10 +48,10 @@ defineTest(qtConfReport_jumboBuild) { + qtConfReportPadded($${1}, $$mergeLimit) + } + +-defineTest(qtConfTest_detectPython2) { +- python = $$qtConfFindInPath("python2$$EXE_SUFFIX") ++defineTest(qtConfTest_detectPython) { ++ python = $$qtConfFindInPath("python$$EXE_SUFFIX") + isEmpty(python) { +- qtLog("'python2$$EXE_SUFFIX' not found in PATH. Checking for 'python$$EXE_SUFFIX'.") ++ qtLog("'python$$EXE_SUFFIX' not found in PATH. Checking for 'python$$EXE_SUFFIX'.") + python = $$qtConfFindInPath("python$$EXE_SUFFIX") + } + isEmpty(python) { +@@ -63,11 +59,11 @@ defineTest(qtConfTest_detectPython2) { + return(false) + } + !isPythonVersionSupported($$python) { +- qtLog("A suitable Python 2 executable could not be located.") ++ qtLog("A suitable Python executable could not be located.") + return(false) + } + +- # Make tests.python2.location available in configure.json. ++ # Make tests.python.location available in configure.json. + $${1}.location = $$clean_path($$python) + export($${1}.location) + $${1}.cache += location +diff --git a/qtwebengine/mkspecs/features/functions.prf b/qtwebengine/mkspecs/features/functions.prf +index 2750d707..9fda13d0 100644 +--- a/qtwebengine/mkspecs/features/functions.prf ++++ b/qtwebengine/mkspecs/features/functions.prf +@@ -39,11 +39,11 @@ defineReplace(which) { + + # Returns the unquoted path to the python executable. + defineReplace(pythonPath) { +- isEmpty(QMAKE_PYTHON2) { ++ isEmpty(QMAKE_PYTHON) { + # Fallback for building QtWebEngine with Qt < 5.8 +- QMAKE_PYTHON2 = python ++ QMAKE_PYTHON = python + } +- return($$QMAKE_PYTHON2) ++ return($$QMAKE_PYTHON) + } + + # Returns the python executable for use with shell / make targets. +diff --git a/qtwebengine/src/buildtools/config/support.pri b/qtwebengine/src/buildtools/config/support.pri +index e7f869a1..1bf2c5d7 100644 +--- a/qtwebengine/src/buildtools/config/support.pri ++++ b/qtwebengine/src/buildtools/config/support.pri +@@ -21,7 +21,7 @@ defineReplace(qtwebengine_checkWebEngineCoreError) { + !qtwebengine_checkForGperf(QtWebEngine):return(false) + !qtwebengine_checkForBison(QtWebEngine):return(false) + !qtwebengine_checkForFlex(QtWebEngine):return(false) +- !qtwebengine_checkForPython2(QtWebEngine):return(false) ++ !qtwebengine_checkForPython(QtWebEngine):return(false) + !qtwebengine_checkForNodejs(QtWebEngine):return(false) + !qtwebengine_checkForSanitizer(QtWebEngine):return(false) + linux:!qtwebengine_checkForPkgCfg(QtWebEngine):return(false) +@@ -51,7 +51,7 @@ defineReplace(qtwebengine_checkPdfError) { + !qtwebengine_checkForGperf(QtPdf):return(false) + !qtwebengine_checkForBison(QtPdf):return(false) + !qtwebengine_checkForFlex(QtPdf):return(false) +- !qtwebengine_checkForPython2(QtPdf):return(false) ++ !qtwebengine_checkForPython(QtPdf):return(false) + !qtwebengine_checkForSanitizer(QtPdf):return(false) + linux:!qtwebengine_checkForPkgCfg(QtPdf):return(false) + linux:!qtwebengine_checkForHostPkgCfg(QtPdf):return(false) +@@ -143,10 +143,10 @@ defineTest(qtwebengine_checkForFlex) { + return(true) + } + +-defineTest(qtwebengine_checkForPython2) { ++defineTest(qtwebengine_checkForPython) { + module = $$1 +- !qtConfig(webengine-python2) { +- qtwebengine_skipBuild("Python version 2 (2.7.5 or later) is required to build $${module}.") ++ !qtConfig(webengine-python) { ++ qtwebengine_skipBuild("Python is required to build $${module}.") + return(false) + } + return(true) +diff --git a/qtwebengine/src/buildtools/configure.json b/qtwebengine/src/buildtools/configure.json +index 88d1790c..032aa665 100644 +--- a/qtwebengine/src/buildtools/configure.json ++++ b/qtwebengine/src/buildtools/configure.json +@@ -295,9 +295,9 @@ + "label": "system ninja", + "type": "detectNinja" + }, +- "webengine-python2": { +- "label": "python2", +- "type": "detectPython2", ++ "webengine-python": { ++ "label": "python", ++ "type": "detectPython", + "log": "location" + }, + "webengine-winversion": { +@@ -374,7 +374,7 @@ + && features.webengine-gperf + && features.webengine-bison + && features.webengine-flex +- && features.webengine-python2 ++ && features.webengine-python + && features.webengine-nodejs + && (!config.sanitizer || features.webengine-sanitizer) + && (!config.linux || features.pkg-config) +@@ -400,7 +400,7 @@ + && features.webengine-gperf + && features.webengine-bison + && features.webengine-flex +- && features.webengine-python2 ++ && features.webengine-python + && (!config.sanitizer || features.webengine-sanitizer) + && (!config.linux || features.pkg-config) + && (!config.linux || features.webengine-host-pkg-config) +@@ -423,12 +423,12 @@ + "autoDetect": "features.private_tests", + "output": [ "privateFeature" ] + }, +- "webengine-python2": { +- "label": "python2", +- "condition": "tests.webengine-python2", ++ "webengine-python": { ++ "label": "python", ++ "condition": "tests.webengine-python", + "output": [ + "privateFeature", +- { "type": "varAssign", "name": "QMAKE_PYTHON2", "value": "tests.webengine-python2.location" } ++ { "type": "varAssign", "name": "QMAKE_PYTHON", "value": "tests.webengine-python.location" } + ] + }, + "webengine-gperf": { -- Gitee From 6e8818db53895b2dbd3e5151cc6d9846459de194 Mon Sep 17 00:00:00 2001 From: bbrucezhang Date: Mon, 28 Jul 2025 14:45:26 +0800 Subject: [PATCH 2/7] fix arches --- qt5-qtwebengine.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/qt5-qtwebengine.spec b/qt5-qtwebengine.spec index 5f2d2d2..94b49a0 100644 --- a/qt5-qtwebengine.spec +++ b/qt5-qtwebengine.spec @@ -1,6 +1,6 @@ %global _unpackaged_files_terminate_build 0 %global qt_module qtwebengine -%global qt5_qtwebengine_arches x86_64 aarch64 +%global qt5_qtwebengine_arches x86_64 aarch64 loongarch64 %global _hardened_build 1 @@ -12,7 +12,7 @@ %global use_system_libicu 1 -%ifarch %{arm} aarch64 +%ifarch %{arm} aarch64 loongarch64 %global debug_config %{nil} %else %global debug_config force_debug_info @@ -267,6 +267,9 @@ popd %patch -P101 -p1 -b .riscv64 %endif +%patch -P102 -p1 -b .chromium-python3 +%patch -P103 -p1 -b .python3 + sed -i -e '/toolprefix = /d' -e 's/\${toolprefix}//g' \ src/3rdparty/chromium/build/toolchain/linux/BUILD.gn -- Gitee From 1331bb3f07dfd83ba136c3579de03e132685c7be Mon Sep 17 00:00:00 2001 From: bbrucezhang Date: Mon, 28 Jul 2025 15:13:58 +0800 Subject: [PATCH 3/7] fix patch --- qt5-qtwebengine.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qt5-qtwebengine.spec b/qt5-qtwebengine.spec index 94b49a0..abafbb4 100644 --- a/qt5-qtwebengine.spec +++ b/qt5-qtwebengine.spec @@ -267,8 +267,8 @@ popd %patch -P101 -p1 -b .riscv64 %endif -%patch -P102 -p1 -b .chromium-python3 -%patch -P103 -p1 -b .python3 +%patch -P102 -p2 -b .chromium-python3 +%patch -P103 -p2 -b .python3 sed -i -e '/toolprefix = /d' -e 's/\${toolprefix}//g' \ src/3rdparty/chromium/build/toolchain/linux/BUILD.gn -- Gitee From a356884d4b780204fe26285ca349b083b8957add Mon Sep 17 00:00:00 2001 From: bbrucezhang Date: Tue, 29 Jul 2025 10:57:16 +0800 Subject: [PATCH 4/7] Update to 5.15.17 --- ...ops-clip-constants-used-with-shift-i.patch | 75 - clean_ffmpeg.sh | 364 ++++ clean_qtwebengine.sh | 70 + fix_build_pdf_extension_util.patch | 10 + get_free_ffmpeg_source_files.py | 82 + python3.12-imp.patch | 26 + python3.12-six.patch | 58 + python3.13-pipes.patch | 21 + qt5-qtwebengine-ffmpeg7.patch | 493 +++++ qt5-qtwebengine.spec | 67 +- qt5-webengine-chromium-python3.patch | 1812 ----------------- qt5-webengine-python3.patch | 161 -- qtwebengine-5.15.13_p20240322-ninja1.12.patch | 27 + ...engine-everywhere-5.15.5-use-python2.patch | 35 - qtwebengine-icu-74.patch | 15 - qtwebengine-release.sh | 15 + sources | 2 +- 17 files changed, 1200 insertions(+), 2133 deletions(-) delete mode 100644 0001-avcodec-x86-mathops-clip-constants-used-with-shift-i.patch create mode 100755 clean_ffmpeg.sh create mode 100755 clean_qtwebengine.sh create mode 100644 fix_build_pdf_extension_util.patch create mode 100755 get_free_ffmpeg_source_files.py create mode 100644 python3.12-imp.patch create mode 100644 python3.12-six.patch create mode 100644 python3.13-pipes.patch create mode 100644 qt5-qtwebengine-ffmpeg7.patch delete mode 100644 qt5-webengine-chromium-python3.patch delete mode 100644 qt5-webengine-python3.patch create mode 100644 qtwebengine-5.15.13_p20240322-ninja1.12.patch delete mode 100644 qtwebengine-everywhere-5.15.5-use-python2.patch delete mode 100644 qtwebengine-icu-74.patch create mode 100755 qtwebengine-release.sh diff --git a/0001-avcodec-x86-mathops-clip-constants-used-with-shift-i.patch b/0001-avcodec-x86-mathops-clip-constants-used-with-shift-i.patch deleted file mode 100644 index 5dcc8fb..0000000 --- a/0001-avcodec-x86-mathops-clip-constants-used-with-shift-i.patch +++ /dev/null @@ -1,75 +0,0 @@ -From effadce6c756247ea8bae32dc13bb3e6f464f0eb Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= -Date: Sun, 16 Jul 2023 18:18:02 +0300 -Subject: [PATCH] avcodec/x86/mathops: clip constants used with shift - instructions within inline assembly - -Fixes assembling with binutil as >= 2.41 - -Signed-off-by: James Almer ---- - libavcodec/x86/mathops.h | 26 +++++++++++++++++++++++--- - 1 file changed, 23 insertions(+), 3 deletions(-) - -diff --git a/src/3rdparty/chromium/third_party/ffmpeg/libavcodec/x86/mathops.h b/src/3rdparty/chromium/third_party/ffmpeg/libavcodec/x86/mathops.h -index 6298f5ed19..ca7e2dffc1 100644 ---- a/src/3rdparty/chromium/third_party/ffmpeg/libavcodec/x86/mathops.h -+++ b/src/3rdparty/chromium/third_party/ffmpeg/libavcodec/x86/mathops.h -@@ -35,12 +35,20 @@ - static av_always_inline av_const int MULL(int a, int b, unsigned shift) - { - int rt, dummy; -+ if (__builtin_constant_p(shift)) - __asm__ ( - "imull %3 \n\t" - "shrdl %4, %%edx, %%eax \n\t" - :"=a"(rt), "=d"(dummy) -- :"a"(a), "rm"(b), "ci"((uint8_t)shift) -+ :"a"(a), "rm"(b), "i"(shift & 0x1F) - ); -+ else -+ __asm__ ( -+ "imull %3 \n\t" -+ "shrdl %4, %%edx, %%eax \n\t" -+ :"=a"(rt), "=d"(dummy) -+ :"a"(a), "rm"(b), "c"((uint8_t)shift) -+ ); - return rt; - } - -@@ -113,19 +121,31 @@ __asm__ volatile(\ - // avoid +32 for shift optimization (gcc should do that ...) - #define NEG_SSR32 NEG_SSR32 - static inline int32_t NEG_SSR32( int32_t a, int8_t s){ -+ if (__builtin_constant_p(s)) - __asm__ ("sarl %1, %0\n\t" - : "+r" (a) -- : "ic" ((uint8_t)(-s)) -+ : "i" (-s & 0x1F) - ); -+ else -+ __asm__ ("sarl %1, %0\n\t" -+ : "+r" (a) -+ : "c" ((uint8_t)(-s)) -+ ); - return a; - } - - #define NEG_USR32 NEG_USR32 - static inline uint32_t NEG_USR32(uint32_t a, int8_t s){ -+ if (__builtin_constant_p(s)) - __asm__ ("shrl %1, %0\n\t" - : "+r" (a) -- : "ic" ((uint8_t)(-s)) -+ : "i" (-s & 0x1F) - ); -+ else -+ __asm__ ("shrl %1, %0\n\t" -+ : "+r" (a) -+ : "c" ((uint8_t)(-s)) -+ ); - return a; - } - --- -2.41.0 diff --git a/clean_ffmpeg.sh b/clean_ffmpeg.sh new file mode 100755 index 0000000..360f330 --- /dev/null +++ b/clean_ffmpeg.sh @@ -0,0 +1,364 @@ +#!/bin/bash +# Copyright 2013 Tomas Popela +# Copyright 2016-2017 Kevin Kofler +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +where=`pwd` + +generated_files=`./get_free_ffmpeg_source_files.py $1 0` +generated_files_headers="${generated_files//.c/.h}" +generated_files_headers="${generated_files_headers//.S/.h}" +generated_files_headers="${generated_files_headers//.asm/.h}" + +cd $1/third_party/ffmpeg + +header_files=" libavutil/x86/asm.h \ + libavutil/x86/bswap.h \ + libavutil/x86/cpu.h \ + libavutil/x86/emms.h \ + libavutil/x86/intmath.h \ + libavutil/x86/intreadwrite.h \ + libavutil/x86/timer.h \ + libavutil/aarch64/asm.S \ + libavutil/aarch64/bswap.h \ + libavutil/aarch64/cpu.h \ + libavutil/aarch64/timer.h \ + libavutil/arm/asm.S \ + libavutil/arm/bswap.h \ + libavutil/arm/cpu.h \ + libavutil/arm/float_dsp_arm.h \ + libavutil/arm/intmath.h \ + libavutil/arm/intreadwrite.h \ + libavutil/arm/timer.h \ + libavutil/ppc/cpu.h \ + libavutil/ppc/float_dsp_altivec.h \ + libavutil/ppc/float_dsp_vsx.h \ + libavutil/ppc/intreadwrite.h \ + libavutil/ppc/timer.h \ + libavutil/ppc/util_altivec.h \ + libavutil/aes_internal.h \ + libavutil/atomic.h \ + libavutil/atomic_gcc.h \ + libavutil/attributes.h \ + libavutil/audio_fifo.h \ + libavutil/avassert.h \ + libavutil/avutil.h \ + libavutil/bswap.h \ + libavutil/buffer_internal.h \ + libavcodec/bsf_internal.h \ + libavcodec/codec.h \ + libavcodec/codec_desc.h \ + libavcodec/codec_id.h \ + libavcodec/codec_par.h \ + libavcodec/decode.h \ + libavcodec/hwconfig.h \ + libavcodec/internal.h \ + libavcodec/packet.h \ + libavcodec/packet_internal.h \ + libavutil/common.h \ + libavutil/colorspace.h \ + libavutil/cpu_internal.h \ + libavutil/cpu.h \ + libavutil/dynarray.h \ + libavutil/ffmath.h \ + libavutil/fixed_dsp.h \ + libavutil/float_dsp.h \ + libavutil/hwcontext_internal.h \ + libavutil/imgutils.h \ + libavutil/imgutils_internal.h \ + libavutil/internal.h \ + libavutil/intfloat.h \ + libavutil/intreadwrite.h \ + libavutil/libm.h \ + libavutil/lls.h \ + libavutil/lzo.h \ + libavutil/macros.h \ + libavutil/mem_internal.h \ + libavcodec/mlp_parse.h \ + libavutil/old_pix_fmts.h \ + libavutil/pixfmt.h \ + libavutil/qsort.h \ + libavutil/replaygain.h \ + libavutil/softfloat_tables.h \ + libavutil/thread.h \ + libavutil/timer.h \ + libavutil/timestamp.h \ + libavutil/time_internal.h \ + libavutil/tx_priv.h \ + libavutil/tx_template.c \ + libavutil/version.h \ + libavutil/x86_cpu.h + libavcodec/aarch64/neon.S \ + libavcodec/aarch64/vp8dsp.h \ + libavcodec/x86/constants.h \ + libavcodec/x86/dsputil_x86.h \ + libavcodec/x86/fft.h \ + libavcodec/x86/fpel.h \ + libavcodec/x86/hpeldsp.h \ + libavcodec/x86/inline_asm.h \ + libavcodec/x86/mathops.h \ + libavcodec/x86/vp56_arith.h \ + libavcodec/arm/mathops.h \ + libavcodec/arm/neon.S \ + libavcodec/arm/videodsp_arm.h \ + libavcodec/arm/vp56_arith.h \ + libavcodec/arm/vp8.h \ + libavcodec/arm/vp8dsp.h \ + libavcodec/ppc/fft_vsx.h \ + libavcodec/ppc/hpeldsp_altivec.h \ + libavcodec/ppc/mathops.h \ + libavcodec/aac_ac3_parser.h \ + libavcodec/ac3_parser_internal.h \ + libavcodec/ac3.h \ + libavcodec/adts_header.h \ + libavcodec/avcodec.h \ + libavcodec/blockdsp.h \ + libavcodec/bytestream.h \ + libavcodec/dct.h \ + libavcodec/dct32.h \ + libavcodec/dsputil.h \ + libavcodec/dv_profile_internal.h \ + libavcodec/error_resilience.h \ + libavcodec/fdctdsp.h \ + libavcodec/flac.h \ + libavcodec/flacdsp.h \ + libavcodec/fft.h \ + libavcodec/fft-internal.h \ + libavcodec/fft_table.h \ + libavcodec/frame_thread_encoder.h \ + libavcodec/get_bits.h \ + libavcodec/h263dsp.h \ + libavcodec/h264chroma.h \ + libavcodec/h264pred.h \ + libavcodec/hpeldsp.h \ + libavcodec/hwaccel.h \ + libavcodec/hwaccels.h \ + libavcodec/idctdsp.h \ + libavcodec/internal.h \ + libavcodec/mathops.h \ + libavcodec/mdct15.h \ + libavcodec/me_cmp.h \ + libavcodec/motion_est.h \ + libavcodec/mpegaudio_tablegen.h \ + libavcodec/mpegaudiodectab.h \ + libavcodec/mpegaudiodsp.h \ + libavcodec/mpeg12.h \ + libavcodec/mpeg12data.h \ + libavcodec/mpeg12vlc.h \ + libavcodec/mpegpicture.h \ + libavcodec/mpegutils.h \ + libavcodec/mpegvideo.h \ + libavcodec/mpegvideodata.h \ + libavcodec/mpegvideodsp.h \ + libavcodec/mpegvideoencdsp.h \ + libavcodec/old_codec_ids.h \ + libavcodec/options_table.h \ + libavcodec/opus_celt.h \ + libavcodec/opusdsp.h \ + libavcodec/opus_pvq.h \ + libavcodec/opus_rc.h \ + libavcodec/pcm_tablegen.h \ + libavcodec/pel_template.c \ + libavcodec/pixblockdsp.h \ + libavcodec/pixels.h \ + libavcodec/png.h \ + libavcodec/pthread_internal.h \ + libavcodec/put_bits.h \ + libavcodec/qpeldsp.h \ + libavcodec/ratecontrol.h \ + libavcodec/rectangle.h \ + libavcodec/rl.h \ + libavcodec/rnd_avg.h \ + libavcodec/thread.h \ + libavcodec/tpel_template.c \ + libavcodec/unary.h \ + libavcodec/version.h \ + libavcodec/videodsp.h \ + libavcodec/vlc.h \ + libavcodec/vorbis_parser_internal.h \ + libavcodec/vorbisdsp.h \ + libavcodec/vp3data.h \ + libavcodec/vp3dsp.h \ + libavcodec/vp4data.h \ + libavcodec/vp56.h \ + libavcodec/vp56dsp.h \ + libavcodec/vp8data.h \ + libavcodec/vp8.h \ + libavcodec/vp8dsp.h \ + libavformat/audiointerleave.h \ + libavformat/avio_internal.h \ + libavformat/avformat.h \ + libavformat/dv.h \ + libavformat/internal.h \ + libavformat/pcm.h \ + libavformat/rdt.h \ + libavformat/rtp.h \ + libavformat/rtpdec.h \ + libavformat/spdif.h \ + libavformat/srtp.h \ + libavformat/options_table.h \ + libavformat/version.h \ + libavformat/w64.h \ + libswresample/swresample.h \ + libswresample/version.h \ + compat/va_copy.h " + +manual_files=" libavutil/x86/x86inc.asm \ + libavutil/x86/x86util.asm \ + libavcodec/x86/hpeldsp_rnd_template.c \ + libavcodec/x86/rnd_template.c \ + libavcodec/x86/autorename_libavcodec_x86_videodsp_init.c \ + libavcodec/x86/autorename_libavcodec_x86_vorbisdsp_init.c \ + libavcodec/x86/constants.c \ + libavcodec/x86/fft_init.c \ + libavcodec/x86/h264_intrapred_init.c \ + libavcodec/x86/hpeldsp_init.c \ + libavcodec/x86/videodsp_init.c \ + libavcodec/x86/vorbisdsp_init.c \ + libavcodec/x86/vp3dsp_init.c \ + libavcodec/x86/vp8dsp_init.c \ + libavutil/x86/autorename_libavutil_x86_cpu.c \ + libavutil/x86/autorename_libavutil_x86_float_dsp_init.c \ + libavutil/x86/cpu.c \ + libavutil/x86/float_dsp_init.c \ + libavutil/x86/lls_init.c \ + libavcodec/x86/deinterlace.asm \ + libavcodec/x86/fft.asm \ + libavcodec/x86/fpel.asm \ + libavcodec/x86/h264_intrapred.asm \ + libavcodec/x86/h264_intrapred_10bit.asm \ + libavcodec/x86/hpeldsp.asm \ + libavcodec/x86/videodsp.asm \ + libavcodec/x86/vorbisdsp.asm \ + libavcodec/x86/vp3dsp.asm \ + libavcodec/x86/vp8dsp.asm \ + libavcodec/x86/vp8dsp_loopfilter.asm \ + libavutil/x86/cpuid.asm \ + libavutil/x86/float_dsp.asm \ + libavutil/x86/lls.asm \ + libavcodec/bit_depth_template.c \ + libavcodec/dct32_template.c \ + libavcodec/fft_template.c \ + libavcodec/h264pred_template.c \ + libavcodec/hpel_template.c \ + libavcodec/hpeldsp_template.c \ + libavcodec/mdct_template.c \ + libavcodec/mpegaudiodec_template.c \ + libavcodec/mpegaudiodsp_template.c + libavcodec/mpegaudiodsp.c \ + libavcodec/videodsp_template.c \ + libavcodec/flacdec.c \ + libavcodec/flacdsp.c \ + libavcodec/flacdsp_template.c \ + libavcodec/flacdsp_lpc_template.c \ + libavcodec/h264pred.c \ + libavcodec/hpeldsp.c \ + libavcodec/videodsp.c \ + libavcodec/vorbisdsp.c \ + libavcodec/vp3.c \ + libavcodec/vp3_parser.c \ + libavcodec/vp3dsp.c \ + libavcodec/vp56rac.c \ + libavcodec/vp8.c \ + libavcodec/vp8_parser.c \ + libavcodec/vp8dsp.c \ + libavutil/cpu.c \ + libavutil/fixed_dsp.c \ + libavutil/float_dsp.c \ + libavutil/imgutils.c \ + libavutil/aarch64/cpu.c \ + libavutil/aarch64/float_dsp_neon.S \ + libavutil/arm/cpu.c \ + libavutil/arm/float_dsp_neon.S \ + libavformat/options.c \ + libavformat/pcm.c \ + libavformat/utils.c \ + libavcodec/utils.c \ + libavcodec/aarch64/fft_neon.S \ + libavcodec/aarch64/hpeldsp_neon.S \ + libavcodec/aarch64/h264pred_neon.S \ + libavcodec/aarch64/mdct_neon.S \ + libavcodec/aarch64/vorbisdsp_neon.S \ + libavcodec/aarch64/vp8dsp_neon.S \ + libavcodec/arm/vorbisdsp_neon.S \ + libavcodec/arm/mdct_neon.S \ + libavcodec/arm/fft_neon.S \ + libavcodec/arm/vp8dsp_neon.S \ + libavutil/ppc/cpu.c \ + libavutil/ppc/float_dsp_altivec.c \ + libavutil/ppc/float_dsp_init.c \ + libavutil/ppc/float_dsp_vsx.c \ + libavcodec/ppc/fft_altivec.S \ + libavcodec/ppc/fft_init.c \ + libavcodec/ppc/fft_vsx.c \ + libavcodec/ppc/hpeldsp_altivec.c \ + libavcodec/ppc/mpegaudiodsp_altivec.c \ + libavcodec/ppc/videodsp.c \ + libavcodec/ppc/vorbisdsp_altivec.c \ + libavcodec/ppc/vp3dsp_altivec.c \ + libavcodec/ppc/vp8dsp_altivec.c \ + chromium/ffmpeg_stub_headers.fragment \ + chromium/ffmpegsumo.sigs" + +other_files=" BUILD.gn \ + Changelog \ + COPYING.GPLv2 \ + COPYING.GPLv3 \ + COPYING.LGPLv2.1 \ + COPYING.LGPLv3 \ + CREDITS \ + CREDITS.chromium \ + ffmpeg.gyp \ + ffmpeg_generated.gypi \ + ffmpeg_generated.gni \ + ffmpeg_options.gni \ + ffmpegsumo.ver \ + INSTALL \ + LICENSE \ + MAINTAINERS \ + OWNERS \ + README \ + README.chromium \ + RELEASE \ + xcode_hack.c " + +files=$generated_files$manual_files$other_files$generated_files_headers$header_files + +for f in $files +do + dir_name=`dirname $f`/ + if [[ $dir_name == ./ ]]; then + dir_name= + else + mkdir -p ../tmp_ffmpeg/$dir_name + fi + + cp -p $f ../tmp_ffmpeg/$dir_name 2>/dev/null +done + +# whole directory +mkdir -p ../tmp_ffmpeg/chromium +cp -pr chromium/config ../tmp_ffmpeg/chromium/ + +cd .. +rm -rf ffmpeg +mv tmp_ffmpeg ffmpeg + +cd $where diff --git a/clean_qtwebengine.sh b/clean_qtwebengine.sh new file mode 100755 index 0000000..628fe44 --- /dev/null +++ b/clean_qtwebengine.sh @@ -0,0 +1,70 @@ +#!/bin/bash +# Copyright 2015-2017 Kevin Kofler +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +if [ -z "$1" ] ; then + echo "usage: ./clean_qtwebengine.sh VERSION" + echo "e.g.: ./clean_qtwebengine.sh 5.15.16" + exit 1 +fi + +DIRNAME="qtwebengine-everywhere-src-$1" + +echo "removing $DIRNAME" +rm -rf "$DIRNAME" || exit $? + +if [ -f "$DIRNAME.tar.xz" ] ; then + echo "unpacking $DIRNAME.tar.xz" + XZ_OPT="-T 4" tar xJf "$DIRNAME.tar.xz" || exit $? +elif [ -f "$DIRNAME.tar.bz2" ] ; then + echo "unpacking $DIRNAME.tar.bz2" + tar xjf "$DIRNAME.tar.bz2" || exit $? +elif [ -f "$DIRNAME.tar.gz" ] ; then + echo "unpacking $DIRNAME.tar.gz" + tar xzf "$DIRNAME.tar.gz" || exit $? +elif [ -f "$DIRNAME.7z" ] ; then + echo "unpacking $DIRNAME.7z" + if type 7za >/dev/null 2>/dev/null ; then + 7za x "$DIRNAME.7z" || exit $? + elif type 7z >/dev/null 2>/dev/null ; then + 7z x "$DIRNAME.7z" || exit $? + else + echo "error: p7zip required" + exit 1 + fi +else + echo "error: no archive for $DIRNAME found" + exit 1 +fi + +echo "running clean_ffmpeg.sh" +./clean_ffmpeg.sh "$DIRNAME/src/3rdparty/chromium" || exit $? + +echo "ripping out openh264 sources" +rm -rf "$DIRNAME/src/3rdparty/chromium/third_party/openh264/src" || exit $? + +echo "repacking as $DIRNAME-clean.tar.xz" +XZ_OPT="-8 -T 2" tar cJf "$DIRNAME-clean.tar.xz" "$DIRNAME" || exit $? + +echo "removing $DIRNAME" +rm -rf "$DIRNAME" || exit $? + +echo "done" +exit 0 diff --git a/fix_build_pdf_extension_util.patch b/fix_build_pdf_extension_util.patch new file mode 100644 index 0000000..0b4c754 --- /dev/null +++ b/fix_build_pdf_extension_util.patch @@ -0,0 +1,10 @@ +--- ./src/3rdparty/chromium/qtwebengine/browser/pdf/BUILD.gn.orig 2024-07-03 13:49:13.812285886 +0100 ++++ ./src/3rdparty/chromium/qtwebengine/browser/pdf/BUILD.gn 2024-07-03 13:51:45.789966941 +0100 +@@ -6,6 +6,7 @@ source_set("pdf") { + ] + + deps = [ ++ "//chrome/app:generated_resources", + "//content/public/browser", + ] + } diff --git a/get_free_ffmpeg_source_files.py b/get_free_ffmpeg_source_files.py new file mode 100755 index 0000000..390ee3f --- /dev/null +++ b/get_free_ffmpeg_source_files.py @@ -0,0 +1,82 @@ +#!/usr/bin/python3 +# Copyright 2015 Tomas Popela +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +import sys +import re + +def append_sources (input_sources, output_sources): + + # Get the source files. + source_files = re.findall(r"\"(.*?)\"", input_sources) + output_sources += source_files + + +def parse_sources(input_sources, output_sources, arch_not_arm): + + # Get the type of sources in one group and sources itself in the other one. + blocks = re.findall(r"(ffmpeg[^\s]*).*?\[(.*?)]", input_sources, re.DOTALL) + for block in blocks: + if (arch_not_arm): + if not 'ffmpeg_gas_sources' in block[0]: + append_sources (block[1], output_sources) + else: + append_sources (block[1], output_sources) + + +def parse_ffmpeg_gyni_file(gyni_path, arch_not_arm): + + with open(gyni_path, "r") as input_file: + content = input_file.read().replace('\n', '') + + output_sources = [] + # Get all the sections. + sections = re.findall(r"if (.*?})", content, re.DOTALL) + for section in sections: + # Get all the conditions (first group) and sources (second group) for the + # current section. + blocks = re.findall(r"(\(.*?\))\s\{(.*?)\}", section, re.DOTALL) + for block in blocks: + conditions = re.findall(r"\(?\((.*?)\)", block[0]) + inserted = False + for condition in conditions: + if inserted: + break + limitations = ['ffmpeg_branding == "Chrome"', 'ffmpeg_branding == "ChromeOS"'] + if ('use_linux_config' in condition) and not any(limitation in condition for limitation in limitations): + if (arch_not_arm): + if ('x64' in condition) or ('x86' in condition): + parse_sources (block[1], output_sources, arch_not_arm) + inserted = True + else: + parse_sources (block[1], output_sources, arch_not_arm) + inserted = True + + if len(output_sources) == 0: + sys.stderr.write("Something went wrong, no sources parsed!\n") + sys.exit(1) + + print(' '.join(output_sources)) + + +if __name__ == "__main__": + + path = "%s/third_party/ffmpeg/ffmpeg_generated.gni" % sys.argv[1] + parse_ffmpeg_gyni_file (path, False if sys.argv[2] == "0" else True) diff --git a/python3.12-imp.patch b/python3.12-imp.patch new file mode 100644 index 0000000..b06f957 --- /dev/null +++ b/python3.12-imp.patch @@ -0,0 +1,26 @@ +Description: stop using imp module which was removed in Python 3.12 +Origin: upstream, commits + https://chromium.googlesource.com/chromium/src/+/9e0c89a3b5638ba2 + https://chromium.googlesource.com/chromium/src/+/f5f6e361d037c316 +Last-Update: 2024-03-17 + +--- a/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/fileutil.py ++++ b/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/fileutil.py +@@ -3,7 +3,6 @@ + # found in the LICENSE file. + + import errno +-import imp + import os.path + import sys + +--- a/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/parse/lexer.py ++++ b/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/parse/lexer.py +@@ -2,7 +2,6 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + +-import imp + import os.path + import sys + diff --git a/python3.12-six.patch b/python3.12-six.patch new file mode 100644 index 0000000..bfc0438 --- /dev/null +++ b/python3.12-six.patch @@ -0,0 +1,58 @@ +Patch-Source: https://sources.debian.org/data/main/q/qtwebengine-opensource-src/5.15.16+dfsg-3/debian/patches/python3.12-six.patch +-- +Description: implement find_spec() for _SixMetaPathImporter +Origin: upstream, https://github.com/benjaminp/six/commit/25916292d96f5f09 +Last-Update: 2024-03-17 + +--- a/src/3rdparty/chromium/third_party/protobuf/third_party/six/six.py ++++ b/src/3rdparty/chromium/third_party/protobuf/third_party/six/six.py +@@ -71,6 +71,11 @@ else: + MAXSIZE = int((1 << 63) - 1) + del X + ++if PY34: ++ from importlib.util import spec_from_loader ++else: ++ spec_from_loader = None ++ + + def _add_doc(func, doc): + """Add documentation to a function.""" +@@ -186,6 +191,11 @@ class _SixMetaPathImporter(object): + return self + return None + ++ def find_spec(self, fullname, path, target=None): ++ if fullname in self.known_modules: ++ return spec_from_loader(fullname, self) ++ return None ++ + def __get_module(self, fullname): + try: + return self.known_modules[fullname] +--- a/src/3rdparty/chromium/tools/grit/third_party/six/__init__.py ++++ b/src/3rdparty/chromium/tools/grit/third_party/six/__init__.py +@@ -71,6 +71,11 @@ else: + MAXSIZE = int((1 << 63) - 1) + del X + ++if PY34: ++ from importlib.util import spec_from_loader ++else: ++ spec_from_loader = None ++ + + def _add_doc(func, doc): + """Add documentation to a function.""" +@@ -186,6 +191,11 @@ class _SixMetaPathImporter(object): + return self + return None + ++ def find_spec(self, fullname, path, target=None): ++ if fullname in self.known_modules: ++ return spec_from_loader(fullname, self) ++ return None ++ + def __get_module(self, fullname): + try: + return self.known_modules[fullname] diff --git a/python3.13-pipes.patch b/python3.13-pipes.patch new file mode 100644 index 0000000..b04f6a4 --- /dev/null +++ b/python3.13-pipes.patch @@ -0,0 +1,21 @@ +diff --git a/src/3rdparty/chromium/build/android/gyp/util/build_utils.py b/src/3rdparty/chromium/build/android/gyp/util/build_utils.py +index 022980517..e3f82704a 100644 +--- a/src/3rdparty/chromium/build/android/gyp/util/build_utils.py ++++ b/src/3rdparty/chromium/build/android/gyp/util/build_utils.py +@@ -12,7 +12,6 @@ import fnmatch + import json + import logging + import os +-import pipes + import re + import shutil + import stat +@@ -198,7 +197,7 @@ class CalledProcessError(Exception): + # A user should be able to simply copy and paste the command that failed + # into their shell. + copyable_command = '( cd {}; {} )'.format(os.path.abspath(self.cwd), +- ' '.join(map(pipes.quote, self.args))) ++ printed_cmd) + return 'Command failed: {}\n{}'.format(copyable_command, self.output) + + diff --git a/qt5-qtwebengine-ffmpeg7.patch b/qt5-qtwebengine-ffmpeg7.patch new file mode 100644 index 0000000..182239f --- /dev/null +++ b/qt5-qtwebengine-ffmpeg7.patch @@ -0,0 +1,493 @@ +From 6e554a30893150793c2638e3689cf208ffc8e375 Mon Sep 17 00:00:00 2001 +From: Dale Curtis +Date: Sat, 2 Apr 2022 05:13:53 +0000 +Subject: [PATCH] Roll src/third_party/ffmpeg/ 574c39cce..32b2d1d526 (1125 + commits) + +https://chromium.googlesource.com/chromium/third_party/ffmpeg.git/+log/574c39cce323..32b2d1d526 + +Created with: + roll-dep src/third_party/ffmpeg + +Fixed: 1293918 +Cq-Include-Trybots: luci.chromium.try:mac_chromium_asan_rel_ng,linux_chromium_asan_rel_ng,linux_chromium_chromeos_asan_rel_ng +Change-Id: I41945d0f963e3d1f65940067bac22f63b68e37d2 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3565647 +Auto-Submit: Dale Curtis +Reviewed-by: Dan Sanders +Commit-Queue: Dale Curtis +Cr-Commit-Position: refs/heads/main@{#988253} +--- + .../clear_key_cdm/ffmpeg_cdm_audio_decoder.cc | 29 ++++++++++--------- + media/ffmpeg/ffmpeg_common.cc | 11 +++---- + media/filters/audio_file_reader.cc | 9 +++--- + media/filters/audio_file_reader_unittest.cc | 6 ++-- + .../filters/audio_video_metadata_extractor.cc | 11 +++++-- + .../filters/ffmpeg_aac_bitstream_converter.cc | 7 +++-- + ...ffmpeg_aac_bitstream_converter_unittest.cc | 2 +- + media/filters/ffmpeg_audio_decoder.cc | 13 +++++---- + 8 files changed, 51 insertions(+), 37 deletions(-) + +diff --git a/src/3rdparty/chromium/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc b/src/3rdparty/chromium/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc +index a043005..9ae2ca9 100644 +--- a/src/3rdparty/chromium/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc ++++ b/src/3rdparty/chromium/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc +@@ -73,7 +73,7 @@ void CdmAudioDecoderConfigToAVCodecContext( + codec_context->sample_fmt = AV_SAMPLE_FMT_NONE; + } + +- codec_context->channels = config.channel_count; ++ codec_context->ch_layout.nb_channels = config.channel_count; + codec_context->sample_rate = config.samples_per_second; + + if (config.extra_data) { +@@ -123,8 +123,8 @@ void CopySamples(cdm::AudioFormat cdm_format, + case cdm::kAudioFormatPlanarS16: + case cdm::kAudioFormatPlanarF32: { + const int decoded_size_per_channel = +- decoded_audio_size / av_frame.channels; +- for (int i = 0; i < av_frame.channels; ++i) { ++ decoded_audio_size / av_frame.ch_layout.nb_channels; ++ for (int i = 0; i < av_frame.ch_layout.nb_channels; ++i) { + memcpy(output_buffer, av_frame.extended_data[i], + decoded_size_per_channel); + output_buffer += decoded_size_per_channel; +@@ -184,13 +184,14 @@ bool FFmpegCdmAudioDecoder::Initialize( + // Success! + decoding_loop_.reset(new FFmpegDecodingLoop(codec_context_.get())); + samples_per_second_ = config.samples_per_second; +- bytes_per_frame_ = codec_context_->channels * config.bits_per_channel / 8; ++ bytes_per_frame_ = ++ codec_context_->ch_layout.nb_channels * config.bits_per_channel / 8; + output_timestamp_helper_.reset( + new AudioTimestampHelper(config.samples_per_second)); + is_initialized_ = true; + + // Store initial values to guard against midstream configuration changes. +- channels_ = codec_context_->channels; ++ channels_ = codec_context_->ch_layout.nb_channels; + av_sample_format_ = codec_context_->sample_fmt; + + return true; +@@ -290,17 +291,18 @@ cdm::Status FFmpegCdmAudioDecoder::DecodeBuffer( + for (auto& frame : audio_frames) { + int decoded_audio_size = 0; + if (frame->sample_rate != samples_per_second_ || +- frame->channels != channels_ || frame->format != av_sample_format_) { ++ frame->ch_layout.nb_channels != channels_ || ++ frame->format != av_sample_format_) { + DLOG(ERROR) << "Unsupported midstream configuration change!" + << " Sample Rate: " << frame->sample_rate << " vs " +- << samples_per_second_ << ", Channels: " << frame->channels ++ << samples_per_second_ << ", Channels: " << frame->ch_layout.nb_channels + << " vs " << channels_ << ", Sample Format: " << frame->format + << " vs " << av_sample_format_; + return cdm::kDecodeError; + } + + decoded_audio_size = av_samples_get_buffer_size( +- nullptr, codec_context_->channels, frame->nb_samples, ++ nullptr, codec_context_->ch_layout.nb_channels, frame->nb_samples, + codec_context_->sample_fmt, 1); + if (!decoded_audio_size) + continue; +@@ -319,7 +321,7 @@ bool FFmpegCdmAudioDecoder::OnNewFrame( + size_t* total_size, + std::vector>* audio_frames, + AVFrame* frame) { +- *total_size += av_samples_get_buffer_size(nullptr, codec_context_->channels, ++ *total_size += av_samples_get_buffer_size(nullptr, codec_context_->ch_layout.nb_channels, + frame->nb_samples, + codec_context_->sample_fmt, 1); + audio_frames->emplace_back(av_frame_clone(frame)); +diff --git a/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc b/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc +index c17dd9f..0448cb5 100644 +--- a/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc ++++ b/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc +@@ -341,10 +341,11 @@ bool AVCodecContextToAudioDecoderConfig(const AVCodecContext* codec_context, + codec_context->sample_fmt, codec_context->codec_id); + + ChannelLayout channel_layout = +- codec_context->channels > 8 ++ codec_context->ch_layout.nb_channels > 8 + ? CHANNEL_LAYOUT_DISCRETE +- : ChannelLayoutToChromeChannelLayout(codec_context->channel_layout, +- codec_context->channels); ++ : ChannelLayoutToChromeChannelLayout( ++ codec_context->ch_layout.u.mask, ++ codec_context->ch_layout.nb_channels); + + int sample_rate = codec_context->sample_rate; + switch (codec) { +@@ -397,7 +398,7 @@ bool AVCodecContextToAudioDecoderConfig(const AVCodecContext* codec_context, + extra_data, encryption_scheme, seek_preroll, + codec_context->delay); + if (channel_layout == CHANNEL_LAYOUT_DISCRETE) +- config->SetChannelsForDiscrete(codec_context->channels); ++ config->SetChannelsForDiscrete(codec_context->ch_layout.nb_channels); + + #if BUILDFLAG(ENABLE_PLATFORM_AC3_EAC3_AUDIO) + // These are bitstream formats unknown to ffmpeg, so they don't have +@@ -462,7 +463,7 @@ void AudioDecoderConfigToAVCodecContext(const AudioDecoderConfig& config, + + // TODO(scherkus): should we set |channel_layout|? I'm not sure if FFmpeg uses + // said information to decode. +- codec_context->channels = config.channels(); ++ codec_context->ch_layout.nb_channels = config.channels(); + codec_context->sample_rate = config.samples_per_second(); + + if (config.extra_data().empty()) { +diff --git a/src/3rdparty/chromium/media/filters/audio_file_reader.cc b/src/3rdparty/chromium/media/filters/audio_file_reader.cc +index bd73908..745c4c7 100644 +--- a/src/3rdparty/chromium/media/filters/audio_file_reader.cc ++++ b/src/3rdparty/chromium/media/filters/audio_file_reader.cc +@@ -112,14 +112,15 @@ bool AudioFileReader::OpenDecoder() { + + // Verify the channel layout is supported by Chrome. Acts as a sanity check + // against invalid files. See http://crbug.com/171962 +- if (ChannelLayoutToChromeChannelLayout(codec_context_->channel_layout, +- codec_context_->channels) == ++ if (ChannelLayoutToChromeChannelLayout( ++ codec_context_->ch_layout.u.mask, ++ codec_context_->ch_layout.nb_channels) == + CHANNEL_LAYOUT_UNSUPPORTED) { + return false; + } + + // Store initial values to guard against midstream configuration changes. +- channels_ = codec_context_->channels; ++ channels_ = codec_context_->ch_layout.nb_channels; + audio_codec_ = CodecIDToAudioCodec(codec_context_->codec_id); + sample_rate_ = codec_context_->sample_rate; + av_sample_format_ = codec_context_->sample_fmt; +@@ -222,7 +223,7 @@ bool AudioFileReader::OnNewFrame( + if (frames_read < 0) + return false; + +- const int channels = frame->channels; ++ const int channels = frame->ch_layout.nb_channels; + if (frame->sample_rate != sample_rate_ || channels != channels_ || + frame->format != av_sample_format_) { + DLOG(ERROR) << "Unsupported midstream configuration change!" +diff --git a/src/3rdparty/chromium/media/filters/ffmpeg_aac_bitstream_converter.cc b/src/3rdparty/chromium/media/filters/ffmpeg_aac_bitstream_converter.cc +index 6f231c8..ca5e5fb 100644 +--- a/src/3rdparty/chromium/media/filters/ffmpeg_aac_bitstream_converter.cc ++++ b/src/3rdparty/chromium/media/filters/ffmpeg_aac_bitstream_converter.cc +@@ -195,14 +195,15 @@ bool FFmpegAACBitstreamConverter::ConvertPacket(AVPacket* packet) { + if (!header_generated_ || codec_ != stream_codec_parameters_->codec_id || + audio_profile_ != stream_codec_parameters_->profile || + sample_rate_index_ != sample_rate_index || +- channel_configuration_ != stream_codec_parameters_->channels || ++ channel_configuration_ != ++ stream_codec_parameters_->ch_layout.nb_channels || + frame_length_ != header_plus_packet_size) { + header_generated_ = + GenerateAdtsHeader(stream_codec_parameters_->codec_id, + 0, // layer + stream_codec_parameters_->profile, sample_rate_index, + 0, // private stream +- stream_codec_parameters_->channels, ++ stream_codec_parameters_->ch_layout.nb_channels, + 0, // originality + 0, // home + 0, // copyrighted_stream +@@ -214,7 +215,7 @@ bool FFmpegAACBitstreamConverter::ConvertPacket(AVPacket* packet) { + codec_ = stream_codec_parameters_->codec_id; + audio_profile_ = stream_codec_parameters_->profile; + sample_rate_index_ = sample_rate_index; +- channel_configuration_ = stream_codec_parameters_->channels; ++ channel_configuration_ = stream_codec_parameters_->ch_layout.nb_channels; + frame_length_ = header_plus_packet_size; + } + +diff --git a/src/3rdparty/chromium/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc b/src/3rdparty/chromium/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc +index ac8bb13..3e4e3f6 100644 +--- a/src/3rdparty/chromium/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc ++++ b/src/3rdparty/chromium/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc +@@ -29,7 +29,7 @@ class FFmpegAACBitstreamConverterTest : public testing::Test { + memset(&test_parameters_, 0, sizeof(AVCodecParameters)); + test_parameters_.codec_id = AV_CODEC_ID_AAC; + test_parameters_.profile = FF_PROFILE_AAC_MAIN; +- test_parameters_.channels = 2; ++ test_parameters_.ch_layout.nb_channels = 2; + test_parameters_.extradata = extradata_header_; + test_parameters_.extradata_size = sizeof(extradata_header_); + } +diff --git a/src/3rdparty/chromium/media/filters/ffmpeg_audio_decoder.cc b/src/3rdparty/chromium/media/filters/ffmpeg_audio_decoder.cc +index 72fac61..ab49fd5 100644 +--- a/src/3rdparty/chromium/media/filters/ffmpeg_audio_decoder.cc ++++ b/src/3rdparty/chromium/media/filters/ffmpeg_audio_decoder.cc +@@ -27,7 +27,7 @@ namespace media { + + // Return the number of channels from the data in |frame|. + static inline int DetermineChannels(AVFrame* frame) { +- return frame->channels; ++ return frame->ch_layout.nb_channels; + } + + // Called by FFmpeg's allocation routine to allocate a buffer. Uses +@@ -227,7 +227,7 @@ bool FFmpegAudioDecoder::OnNewFrame(const DecoderBuffer& buffer, + // Translate unsupported into discrete layouts for discrete configurations; + // ffmpeg does not have a labeled discrete configuration internally. + ChannelLayout channel_layout = ChannelLayoutToChromeChannelLayout( +- codec_context_->channel_layout, codec_context_->channels); ++ codec_context_->ch_layout.u.mask, codec_context_->ch_layout.nb_channels); + if (channel_layout == CHANNEL_LAYOUT_UNSUPPORTED && + config_.channel_layout() == CHANNEL_LAYOUT_DISCRETE) { + channel_layout = CHANNEL_LAYOUT_DISCRETE; +@@ -344,11 +344,11 @@ bool FFmpegAudioDecoder::ConfigureDecoder(const AudioDecoderConfig& config) { + // Success! + av_sample_format_ = codec_context_->sample_fmt; + +- if (codec_context_->channels != config.channels()) { ++ if (codec_context_->ch_layout.nb_channels != config.channels()) { + MEDIA_LOG(ERROR, media_log_) + << "Audio configuration specified " << config.channels() + << " channels, but FFmpeg thinks the file contains " +- << codec_context_->channels << " channels"; ++ << codec_context_->ch_layout.nb_channels << " channels"; + ReleaseFFmpegResources(); + state_ = kUninitialized; + return false; +@@ -398,7 +398,7 @@ int FFmpegAudioDecoder::GetAudioBuffer(struct AVCodecContext* s, + if (frame->nb_samples <= 0) + return AVERROR(EINVAL); + +- if (s->channels != channels) { ++ if (s->ch_layout.nb_channels != channels) { + DLOG(ERROR) << "AVCodecContext and AVFrame disagree on channel count."; + return AVERROR(EINVAL); + } +@@ -431,7 +431,8 @@ int FFmpegAudioDecoder::GetAudioBuffer(struct AVCodecContext* s, + ChannelLayout channel_layout = + config_.channel_layout() == CHANNEL_LAYOUT_DISCRETE + ? CHANNEL_LAYOUT_DISCRETE +- : ChannelLayoutToChromeChannelLayout(s->channel_layout, s->channels); ++ : ChannelLayoutToChromeChannelLayout(s->ch_layout.u.mask, ++ s->ch_layout.nb_channels); + + if (channel_layout == CHANNEL_LAYOUT_UNSUPPORTED) { + DLOG(ERROR) << "Unsupported channel layout."; +commit 62274859104bd828373ae406aa9309e610449ac5 +Author: Ted Meyer +Date: Fri Mar 22 19:56:55 2024 +0000 + + Replace deprecated use of AVCodecContext::reordered_opaque + + We can use the AV_CODEC_FLAG_COPY_OPAQUE flag on the codec context + now to trigger timestamp propagation. + + Bug: 330573128 + Change-Id: I6bc57241a35ab5283742aad8d42acb4dc5e85858 + Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5384308 + Commit-Queue: Ted (Chromium) Meyer + Reviewed-by: Dan Sanders + Cr-Commit-Position: refs/heads/main@{#1277051} + +diff --git a/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc b/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc +index 0448cb5..89e9cf9 100644 +--- a/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc ++++ b/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc +@@ -414,7 +414,9 @@ bool AVCodecContextToAudioDecoderConfig(const AVCodecContext* codec_context, + #if BUILDFLAG(USE_PROPRIETARY_CODECS) + // TODO(dalecurtis): Just use the profile from the codec context if ffmpeg + // ever starts supporting xHE-AAC. +- if (codec == kCodecAAC && codec_context->profile == FF_PROFILE_UNKNOWN) { ++ constexpr uint8_t kXHEAAc = 41; ++ if (codec == kCodecAAC && codec_context->profile == FF_PROFILE_UNKNOWN || ++ codec_context->profile == kXHEAAc) { + // Errors aren't fatal here, so just drop any MediaLog messages. + NullMediaLog media_log; + mp4::AAC aac_parser; +diff --git a/src/3rdparty/chromium/media/ffmpeg/ffmpeg_regression_tests.cc b/src/3rdparty/chromium/media/ffmpeg/ffmpeg_regression_tests.cc +index ebd1bab..04d5ecc 100644 +--- a/src/3rdparty/chromium/media/ffmpeg/ffmpeg_regression_tests.cc ++++ b/src/3rdparty/chromium/media/ffmpeg/ffmpeg_regression_tests.cc +@@ -86,16 +86,16 @@ FFMPEG_TEST_CASE(Cr47761, "crbug47761.ogg", PIPELINE_OK, PIPELINE_OK); + FFMPEG_TEST_CASE(Cr50045, "crbug50045.mp4", PIPELINE_OK, PIPELINE_OK); + FFMPEG_TEST_CASE(Cr62127, "crbug62127.webm", PIPELINE_OK, PIPELINE_OK); + FFMPEG_TEST_CASE(Cr93620, "security/93620.ogg", PIPELINE_OK, PIPELINE_OK); +-FFMPEG_TEST_CASE(Cr100492, +- "security/100492.webm", +- DECODER_ERROR_NOT_SUPPORTED, +- DECODER_ERROR_NOT_SUPPORTED); ++FFMPEG_TEST_CASE(Cr100492, "security/100492.webm", PIPELINE_OK, PIPELINE_OK); + FFMPEG_TEST_CASE(Cr100543, "security/100543.webm", PIPELINE_OK, PIPELINE_OK); + FFMPEG_TEST_CASE(Cr101458, + "security/101458.webm", + PIPELINE_ERROR_DECODE, + PIPELINE_ERROR_DECODE); +-FFMPEG_TEST_CASE(Cr108416, "security/108416.webm", PIPELINE_OK, PIPELINE_OK); ++FFMPEG_TEST_CASE(Cr108416, ++ "security/108416.webm", ++ PIPELINE_ERROR_DECODE, ++ PIPELINE_ERROR_DECODE); + FFMPEG_TEST_CASE(Cr110849, + "security/110849.mkv", + DEMUXER_ERROR_COULD_NOT_OPEN, +@@ -150,7 +150,10 @@ FFMPEG_TEST_CASE(Cr234630b, + "security/234630b.mov", + DEMUXER_ERROR_NO_SUPPORTED_STREAMS, + DEMUXER_ERROR_NO_SUPPORTED_STREAMS); +-FFMPEG_TEST_CASE(Cr242786, "security/242786.webm", PIPELINE_OK, PIPELINE_OK); ++FFMPEG_TEST_CASE(Cr242786, ++ "security/242786.webm", ++ PIPELINE_OK, ++ PIPELINE_ERROR_DECODE); + // Test for out-of-bounds access with slightly corrupt file (detection logic + // thinks it's a MONO file, but actually contains STEREO audio). + FFMPEG_TEST_CASE(Cr275590, +@@ -371,8 +374,8 @@ FFMPEG_TEST_CASE(WEBM_2, + DEMUXER_ERROR_NO_SUPPORTED_STREAMS); + FFMPEG_TEST_CASE(WEBM_4, + "security/out.webm.68798.1929", +- DECODER_ERROR_NOT_SUPPORTED, +- DECODER_ERROR_NOT_SUPPORTED); ++ PIPELINE_OK, ++ PIPELINE_OK); + FFMPEG_TEST_CASE(WEBM_5, "frame_size_change.webm", PIPELINE_OK, PIPELINE_OK); + + // General MKV test cases. +diff --git a/src/3rdparty/chromium/media/filters/audio_file_reader.cc b/src/3rdparty/chromium/media/filters/audio_file_reader.cc +index 745c4c7..2b3abba 100644 +--- a/src/3rdparty/chromium/media/filters/audio_file_reader.cc ++++ b/src/3rdparty/chromium/media/filters/audio_file_reader.cc +@@ -242,10 +242,10 @@ bool AudioFileReader::OnNewFrame( + // silence from being output. In the case where we are also discarding some + // portion of the packet (as indicated by a negative pts), we further want to + // adjust the duration downward by however much exists before zero. +- if (audio_codec_ == kCodecAAC && frame->pkt_duration) { ++ if (audio_codec_ == kCodecAAC && frame->duration) { + const base::TimeDelta pkt_duration = ConvertFromTimeBase( + glue_->format_context()->streams[stream_index_]->time_base, +- frame->pkt_duration + std::min(static_cast(0), frame->pts)); ++ frame->duration + std::min(static_cast(0), frame->pts)); + const base::TimeDelta frame_duration = base::TimeDelta::FromSecondsD( + frames_read / static_cast(sample_rate_)); + +diff --git a/src/3rdparty/chromium/media/filters/ffmpeg_video_decoder.cc b/src/3rdparty/chromium/media/filters/ffmpeg_video_decoder.cc +index 7996606..a15aafc 100644 +--- a/src/3rdparty/chromium/media/filters/ffmpeg_video_decoder.cc ++++ b/src/3rdparty/chromium/media/filters/ffmpeg_video_decoder.cc +@@ -86,7 +86,7 @@ bool FFmpegVideoDecoder::IsCodecSupported(VideoCodec codec) { + } + + FFmpegVideoDecoder::FFmpegVideoDecoder(MediaLog* media_log) +- : media_log_(media_log), state_(kUninitialized), decode_nalus_(false) { ++ : media_log_(media_log), state_(kUninitialized), decode_nalus_(false), timestamp_map_(128) { + DVLOG(1) << __func__; + thread_checker_.DetachFromThread(); + } +@@ -183,7 +183,6 @@ int FFmpegVideoDecoder::GetVideoBuffer(struct AVCodecContext* codec_context, + frame->width = coded_size.width(); + frame->height = coded_size.height(); + frame->format = codec_context->pix_fmt; +- frame->reordered_opaque = codec_context->reordered_opaque; + + // Now create an AVBufferRef for the data just allocated. It will own the + // reference to the VideoFrame object. +@@ -318,8 +317,10 @@ bool FFmpegVideoDecoder::FFmpegDecode(const DecoderBuffer& buffer) { + DCHECK(packet.data); + DCHECK_GT(packet.size, 0); + +- // Let FFmpeg handle presentation timestamp reordering. +- codec_context_->reordered_opaque = buffer.timestamp().InMicroseconds(); ++ const int64_t timestamp = buffer.timestamp().InMicroseconds(); ++ const TimestampId timestamp_id = timestamp_id_generator_.GenerateNextId(); ++ timestamp_map_.Put(timestamp_id, timestamp); ++ packet.opaque = reinterpret_cast(timestamp_id.GetUnsafeValue()); + } + + switch (decoding_loop_->DecodePacket( +@@ -358,8 +359,13 @@ bool FFmpegVideoDecoder::OnNewFrame(AVFrame* frame) { + + scoped_refptr video_frame = + reinterpret_cast(av_buffer_get_opaque(frame->buf[0])); ++ const auto ts_id = TimestampId(reinterpret_cast(frame->opaque)); ++ const auto ts_lookup = timestamp_map_.Get(ts_id); ++ if (ts_lookup == timestamp_map_.end()) { ++ return false; ++ } + video_frame->set_timestamp( +- base::TimeDelta::FromMicroseconds(frame->reordered_opaque)); ++ base::TimeDelta::FromMicroseconds(std::get<1>(*ts_lookup))); + video_frame->metadata()->power_efficient = false; + output_cb_.Run(video_frame); + return true; +@@ -385,8 +391,10 @@ bool FFmpegVideoDecoder::ConfigureDecoder(const VideoDecoderConfig& config, + codec_context_->thread_count = GetFFmpegVideoDecoderThreadCount(config); + codec_context_->thread_type = + FF_THREAD_SLICE | (low_delay ? 0 : FF_THREAD_FRAME); ++ + codec_context_->opaque = this; + codec_context_->get_buffer2 = GetVideoBufferImpl; ++ codec_context_->flags |= AV_CODEC_FLAG_COPY_OPAQUE; + + if (decode_nalus_) + codec_context_->flags2 |= AV_CODEC_FLAG2_CHUNKS; +diff --git a/src/3rdparty/chromium/media/filters/ffmpeg_video_decoder.h b/src/3rdparty/chromium/media/filters/ffmpeg_video_decoder.h +index f13ce41..ee2444b 100644 +--- a/src/3rdparty/chromium/media/filters/ffmpeg_video_decoder.h ++++ b/src/3rdparty/chromium/media/filters/ffmpeg_video_decoder.h +@@ -8,6 +8,8 @@ + #include + #include + ++#include "base/containers/mru_cache.h" ++#include "base/util/type_safety/id_type.h" + #include "base/callback.h" + #include "base/macros.h" + #include "base/memory/ref_counted.h" +@@ -85,6 +87,20 @@ class MEDIA_EXPORT FFmpegVideoDecoder : public VideoDecoder { + // FFmpeg structures owned by this object. + std::unique_ptr codec_context_; + ++ // The gist here is that timestamps need to be 64 bits to store microsecond ++ // precision. A 32 bit integer would overflow at ~35 minutes at this level of ++ // precision. We can't cast the timestamp to the void ptr object used by the ++ // opaque field in ffmpeg then, because it would lose data on a 32 bit build. ++ // However, we don't actually have 2^31 timestamped frames in a single ++ // playback, so it's fine to use the 32 bit value as a key in a map which ++ // contains the actual timestamps. Additionally, we've in the past set 128 ++ // outstanding frames for re-ordering as a limit for cross-thread decoding ++ // tasks, so we'll do that here too with the LRU cache. ++ using TimestampId = util::IdType; ++ ++ TimestampId::Generator timestamp_id_generator_; ++ base::MRUCache timestamp_map_; ++ + VideoDecoderConfig config_; + + VideoFramePool frame_pool_; +diff --git a/src/3rdparty/chromium/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc b/src/3rdparty/chromium/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc +index d12fade..8abfbbf 100644 +--- a/src/3rdparty/chromium/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc ++++ b/src/3rdparty/chromium/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc +@@ -114,7 +114,6 @@ int H264DecoderImpl::AVGetBuffer2(AVCodecContext* context, + int total_size = y_size + 2 * uv_size; + + av_frame->format = context->pix_fmt; +- av_frame->reordered_opaque = context->reordered_opaque; + + // Set |av_frame| members as required by FFmpeg. + av_frame->data[kYPlaneIndex] = frame_buffer->MutableDataY(); +@@ -273,8 +272,6 @@ int32_t H264DecoderImpl::Decode(const EncodedImage& input_image, + return WEBRTC_VIDEO_CODEC_ERROR; + } + packet.size = static_cast(input_image.size()); +- int64_t frame_timestamp_us = input_image.ntp_time_ms_ * 1000; // ms -> μs +- av_context_->reordered_opaque = frame_timestamp_us; + + int result = avcodec_send_packet(av_context_.get(), &packet); + if (result < 0) { +@@ -290,10 +287,6 @@ int32_t H264DecoderImpl::Decode(const EncodedImage& input_image, + return WEBRTC_VIDEO_CODEC_ERROR; + } + +- // We don't expect reordering. Decoded frame tamestamp should match +- // the input one. +- RTC_DCHECK_EQ(av_frame_->reordered_opaque, frame_timestamp_us); +- + absl::optional qp; + // TODO(sakal): Maybe it is possible to get QP directly from FFmpeg. + h264_bitstream_parser_.ParseBitstream(input_image.data(), input_image.size()); diff --git a/qt5-qtwebengine.spec b/qt5-qtwebengine.spec index abafbb4..0e9940b 100644 --- a/qt5-qtwebengine.spec +++ b/qt5-qtwebengine.spec @@ -1,4 +1,5 @@ %global _unpackaged_files_terminate_build 0 + %global qt_module qtwebengine %global qt5_qtwebengine_arches x86_64 aarch64 loongarch64 @@ -7,12 +8,12 @@ %undefine _package_note_file %global use_system_libvpx 1 -%global use_system_re2 1 +#global pipewire 1 %global use_system_libicu 1 -%ifarch %{arm} aarch64 loongarch64 +%ifarch aarch64 %global debug_config %{nil} %else %global debug_config force_debug_info @@ -28,13 +29,18 @@ Summary: Qt5 - QtWebEngine components Name: qt5-qtwebengine -Version: 5.15.16 -Release: 4%{?dist} +Version: 5.15.17 +Release: 1%{?dist} License: (LGPLv2 with exceptions or GPLv3 with exceptions) and BSD and LGPLv2+ and ASL 2.0 and IJG and MIT and GPLv2+ and ISC and OpenSSL and (MPLv1.1 or GPLv2 or LGPLv2) URL: http://www.qt.io Source0: qtwebengine-everywhere-src-%{version}-clean.tar.xz +Source1: qtwebengine-release.sh +Source2: clean_qtwebengine.sh +Source3: clean_ffmpeg.sh +Source4: get_free_ffmpeg_source_files.py Source10: macros.qt5-qtwebengine + Source20: pulseaudio-12.2-headers.tar.gz Patch2: qtwebengine-opensource-src-5.12.4-fix-extractcflag.patch @@ -45,20 +51,21 @@ Patch6: chromium-angle-nullptr.patch Patch7: chromium-hunspell-nullptr.patch Patch8: qtwebengine-everywhere-5.15.8-libpipewire-0.3.patch Patch24: qtwebengine-everywhere-src-5.11.3-aarch64-new-stat.patch -#Patch26: qtwebengine-everywhere-5.15.5-use-python3.patch Patch32: qtwebengine-skia-missing-includes.patch Patch34: qtwebengine-fix-build.patch Patch35: qt5-qtwebengine-c99.patch -Patch50: 0001-avcodec-x86-mathops-clip-constants-used-with-shift-i.patch -Patch51: qtwebengine-icu-74.patch +Patch60: qtwebengine-ffmpeg5.patch +Patch61: qt5-qtwebengine-ffmpeg7.patch -#Patch60: qtwebengine-ffmpeg5.patch +Patch70: qtwebengine-5.15.13_p20240322-ninja1.12.patch +Patch71: fix_build_pdf_extension_util.patch +Patch72: python3.12-imp.patch +Patch73: python3.12-six.patch +Patch74: python3.13-pipes.patch Patch100: v8.patch Patch101: riscv.patch -Patch102: qt5-webengine-chromium-python3.patch -Patch103: qt5-webengine-python3.patch ExclusiveArch: %{qt5_qtwebengine_arches} @@ -80,6 +87,7 @@ BuildRequires: cmake BuildRequires: bison BuildRequires: flex BuildRequires: gcc-c++ +BuildRequires: binutils-gold BuildRequires: libstdc++-static BuildRequires: git-core BuildRequires: gperf @@ -89,9 +97,6 @@ BuildRequires: libicu-devel >= 65 %endif BuildRequires: libjpeg-devel BuildRequires: nodejs -%if 0%{?use_system_re2} -BuildRequires: re2-devel -%endif %if 0%{?pipewire} BuildRequires: pkgconfig(libpipewire-0.3) %endif @@ -135,21 +140,22 @@ BuildRequires: pkgconfig(nss) BuildRequires: pkgconfig(lcms2) BuildRequires: pkgconfig(xkbcommon) BuildRequires: pkgconfig(xkbfile) +#BuildRequires: pkgconfig(libxslt) pkgconfig(libxml-2.0) BuildRequires: perl-interpreter -BuildRequires: /usr/bin/python3 +BuildRequires: %{__python3} +BuildRequires: python3-html5lib %if 0%{?use_system_libvpx} BuildRequires: pkgconfig(vpx) >= 1.8.0 %endif BuildRequires: libtirpc BuildRequires: libnsl2 -#BuildRequires: python-rpm-macros +BuildRequires: python-rpm-macros BuildRequires: pkgconfig(libavcodec) BuildRequires: pkgconfig(libavformat) BuildRequires: pkgconfig(libavutil) - Provides: bundled(chromium) = 87.0.4280.144 Provides: bundled(angle) = 2422 @@ -180,7 +186,7 @@ Provides: bundled(sqlite) = 3.35.5 Provides: bundled(usrsctp) Provides: bundled(webrtc) = 90 -%ifarch %{ix86} x86_64 +%ifarch x86_64 Provides: bundled(x86inc) %endif @@ -239,7 +245,6 @@ mv pulse src/3rdparty/chromium/ pushd src/3rdparty/chromium popd - %patch -P2 -p1 -b .fix-extractcflag %if !0%{?arm_neon} %patch -P3 -p1 -b .no-neon @@ -251,32 +256,27 @@ popd %patch -P8 -p1 -b .libpipewire-0.3 %patch -P24 -p1 -b .aarch64-new-stat -#%patch -P26 -p1 -b .use-python3 %patch -P32 -p1 -b .skia-missing-includes %patch -P34 -p1 -b .fix-build %patch -P35 -p1 -b .c99 -%patch -P50 -p1 -b .0001-avcodec-x86-mathops-clip-constants-used-with-shift-i -%patch -P51 -p1 -b .icu-74 - #%%patch -P60 -p1 +%patch -P61 -p1 +%patch -P70 -p1 +%patch -P71 -p1 +%patch -P72 -p1 +%patch -P73 -p1 +%patch -P74 -p1 %ifarch riscv64 %patch -P100 -p1 -b .riscv64-v8 %patch -P101 -p1 -b .riscv64 %endif -%patch -P102 -p2 -b .chromium-python3 -%patch -P103 -p2 -b .python3 - sed -i -e '/toolprefix = /d' -e 's/\${toolprefix}//g' \ src/3rdparty/chromium/build/toolchain/linux/BUILD.gn -%if 0%{?use_system_re2} -cp -bv /usr/include/re2/*.h src/3rdparty/chromium/third_party/re2/src/re2/ -%endif - cp -p src/3rdparty/chromium/LICENSE LICENSE.Chromium if [ ! -f "./include/QtWebEngineCore/qtwebenginecoreglobal.h" ]; then @@ -287,9 +287,6 @@ test -f "./include/QtWebEngineCore/qtwebenginecoreglobal.h" %build -#export PATH=$(pwd)/python2/usr/bin:$PATH -#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/python2/usr/lib64 - export STRIP=strip export NINJAFLAGS="%{__ninja_common_opts}" export NINJA_PATH=%{__ninja} @@ -302,8 +299,7 @@ export NINJA_PATH=%{__ninja} CONFIG+="link_pulseaudio use_gold_linker" \ %endif QMAKE_EXTRA_ARGS+="-system-webengine-ffmpeg -system-webengine-webp -system-webengine-opus" \ - QMAKE_EXTRA_ARGS+="-webengine-kerberos" \ - QMAKE_EXTRA_ARGS+="-qt-webengine-ffmpeg" \ + QMAKE_EXTRA_ARGS+="-webengine-kerberos -webengine-python-version python3" \ %{?use_system_libicu:QMAKE_EXTRA_ARGS+="-system-webengine-icu"} \ %{?pipewire:QMAKE_EXTRA_ARGS+="-webengine-webrtc-pipewire"} \ . @@ -440,6 +436,9 @@ done %{_qt5_examplesdir}/ %changelog +* Tue Jul 29 2025 OpenCloudOS Release Engineering - 5.15.17-1 +- Update to 5.15.17 + * Thu Jun 12 2025 bbrucezhang - 5.15.16-4 - Rebuilt for loongarch64 diff --git a/qt5-webengine-chromium-python3.patch b/qt5-webengine-chromium-python3.patch deleted file mode 100644 index 0ea9edd..0000000 --- a/qt5-webengine-chromium-python3.patch +++ /dev/null @@ -1,1812 +0,0 @@ -diff --git a/qtwebengine/src/3rdparty/chromium/build/print_python_deps.py b/qtwebengine/src/3rdparty/chromium/build/print_python_deps.py -index fd29c0972c9..69af247094b 100755 ---- a/qtwebengine/src/3rdparty/chromium/build/print_python_deps.py -+++ b/qtwebengine/src/3rdparty/chromium/build/print_python_deps.py -@@ -1,4 +1,4 @@ --#!/usr/bin/python2.7 -+#!/usr/bin/python - # Copyright 2016 The Chromium Authors. All rights reserved. - # Use of this source code is governed by a BSD-style license that can be - # found in the LICENSE file. -@@ -80,7 +80,7 @@ def _GetTargetPythonVersion(module): - if shebang.startswith('#!'): - # Examples: - # '#!/usr/bin/python' -- # '#!/usr/bin/python2.7' -+ # '#!/usr/bin/python' - # '#!/usr/bin/python3' - # '#!/usr/bin/env python3' - # '#!/usr/bin/env vpython' -@@ -152,7 +152,7 @@ def main(): - - # Trybots run with vpython as default Python, but with a different config - # from //.vpython. To make the is_vpython test work, and to match the behavior -- # of dev machines, the shebang line must be run with python2.7. -+ # of dev machines, the shebang line must be run with python. - # - # E.g. $HOME/.vpython-root/dd50d3/bin/python - # E.g. /b/s/w/ir/cache/vpython/ab5c79/bin/python -diff --git a/qtwebengine/src/3rdparty/chromium/components/resources/protobufs/binary_proto_generator.py b/qtwebengine/src/3rdparty/chromium/components/resources/protobufs/binary_proto_generator.py -index 7422ead9697..16365515f26 100755 ---- a/qtwebengine/src/3rdparty/chromium/components/resources/protobufs/binary_proto_generator.py -+++ b/qtwebengine/src/3rdparty/chromium/components/resources/protobufs/binary_proto_generator.py -@@ -7,7 +7,7 @@ - Converts a given ASCII proto into a binary resource. - - """ -- -+from __future__ import print_function - import abc - import imp - import optparse -@@ -196,12 +196,12 @@ class BinaryProtoGenerator: - self._ImportProtoModules(opts.path) - - if not self.VerifyArgs(opts): -- print "Wrong arguments" -+ print("Wrong arguments") - return 1 - - try: - self._GenerateBinaryProtos(opts) - except Exception as e: -- print "ERROR: Failed to render binary version of %s:\n %s\n%s" % ( -- opts.infile, str(e), traceback.format_exc()) -+ print("ERROR: Failed to render binary version of %s:\n %s\n%s" % -+ (opts.infile, str(e), traceback.format_exc())) - return 1 -diff --git a/qtwebengine/src/3rdparty/chromium/content/browser/tracing/generate_trace_viewer_grd.py b/qtwebengine/src/3rdparty/chromium/content/browser/tracing/generate_trace_viewer_grd.py -index 037f9497dc2..be393d21f90 100755 ---- a/qtwebengine/src/3rdparty/chromium/content/browser/tracing/generate_trace_viewer_grd.py -+++ b/qtwebengine/src/3rdparty/chromium/content/browser/tracing/generate_trace_viewer_grd.py -@@ -74,7 +74,7 @@ def main(argv): - for filename in parsed_args.source_files: - add_file_to_grd(doc, os.path.basename(filename)) - -- with open(parsed_args.output_filename, 'w') as output_file: -+ with open(parsed_args.output_filename, 'wb') as output_file: - output_file.write(doc.toxml(encoding='UTF-8')) - - -diff --git a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/BUILD.gn b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/BUILD.gn -index fc04b5dd0b1..708958e438b 100644 ---- a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/BUILD.gn -+++ b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/BUILD.gn -@@ -2,9 +2,11 @@ - # Use of this source code is governed by a BSD-style license that can be - # found in the LICENSE file. - -+import("//build/config/python.gni") - import("//mojo/public/tools/bindings/mojom.gni") - import("//third_party/jinja2/jinja2.gni") - -+# TODO(crbug.com/1194274): Investigate nondeterminism in Py3 builds. - action("precompile_templates") { - sources = mojom_generator_sources - sources += [ -diff --git a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/gen_data_files_list.py b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/gen_data_files_list.py -index 79c9e50efce..8b78d092418 100644 ---- a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/gen_data_files_list.py -+++ b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/gen_data_files_list.py -@@ -18,7 +18,6 @@ import os - import re - import sys - --from cStringIO import StringIO - from optparse import OptionParser - - sys.path.insert( -@@ -41,12 +40,9 @@ def main(): - pattern = re.compile(options.pattern) - files = [f for f in os.listdir(options.directory) if pattern.match(f)] - -- stream = StringIO() -- for f in files: -- print(f, file=stream) -+ contents = '\n'.join(f for f in files) + '\n' -+ WriteFile(contents, options.output) - -- WriteFile(stream.getvalue(), options.output) -- stream.close() - - if __name__ == '__main__': - sys.exit(main()) -diff --git a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/generators/mojom_java_generator.py b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/generators/mojom_java_generator.py -index 96b2fdfae0c..00b9dccd00c 100644 ---- a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/generators/mojom_java_generator.py -+++ b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/bindings/generators/mojom_java_generator.py -@@ -25,6 +25,10 @@ sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, - 'build', 'android', 'gyp')) - from util import build_utils - -+# TODO(crbug.com/1174969): Remove this once Python2 is obsoleted. -+if sys.version_info.major != 2: -+ basestring = str -+ long = int - - GENERATOR_PREFIX = 'java' - -diff --git a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/generator.py b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/generator.py -index de62260a5c9..4a1c73fcf82 100644 ---- a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/generator.py -+++ b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/generator.py -@@ -136,9 +136,14 @@ class Stylizer(object): - - def WriteFile(contents, full_path): - # If |contents| is same with the file content, we skip updating. -+ if not isinstance(contents, bytes): -+ data = contents.encode('utf8') -+ else: -+ data = contents -+ - if os.path.isfile(full_path): - with open(full_path, 'rb') as destination_file: -- if destination_file.read() == contents: -+ if destination_file.read() == data: - return - - # Make sure the containing directory exists. -@@ -146,11 +151,8 @@ def WriteFile(contents, full_path): - fileutil.EnsureDirectoryExists(full_dir) - - # Dump the data to disk. -- with open(full_path, "wb") as f: -- if not isinstance(contents, bytes): -- f.write(contents.encode('utf-8')) -- else: -- f.write(contents) -+ with open(full_path, 'wb') as f: -+ f.write(data) - - - def AddComputedData(module): -diff --git a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/module.py b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/module.py -index ebbc9b322ea..3d026429bbc 100644 ---- a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/module.py -+++ b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/module.py -@@ -398,7 +398,8 @@ class Field(object): - - - class StructField(Field): -- pass -+ def __hash__(self): -+ return super(Field, self).__hash__() - - - class UnionField(Field): -diff --git a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/template_expander.py b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/template_expander.py -index 7a300560246..8d9e26fb7f6 100644 ---- a/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/template_expander.py -+++ b/qtwebengine/src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/template_expander.py -@@ -75,9 +75,9 @@ def PrecompileTemplates(generator_modules, output_dir): - os.path.dirname(module.__file__), generator.GetTemplatePrefix()) - ])) - jinja_env.filters.update(generator.GetFilters()) -- jinja_env.compile_templates( -- os.path.join(output_dir, "%s.zip" % generator.GetTemplatePrefix()), -- extensions=["tmpl"], -- zip="stored", -- py_compile=True, -- ignore_errors=False) -+ jinja_env.compile_templates(os.path.join( -+ output_dir, "%s.zip" % generator.GetTemplatePrefix()), -+ extensions=["tmpl"], -+ zip="stored", -+ py_compile=sys.version_info.major < 3, -+ ignore_errors=False) -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/blink_v8_bridge.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/blink_v8_bridge.py -index 3225ecca6e4..fc078d31b55 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/blink_v8_bridge.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/blink_v8_bridge.py -@@ -344,7 +344,7 @@ def make_default_value_expr(idl_type, default_value): - """ - assert default_value.is_type_compatible_with(idl_type) - -- class DefaultValueExpr: -+ class DefaultValueExpr(object): - _ALLOWED_SYMBOLS_IN_DEPS = ("isolate") - - def __init__(self, initializer_expr, initializer_deps, -@@ -502,7 +502,7 @@ def make_v8_to_blink_value(blink_var_name, - assert isinstance(blink_var_name, str) - assert isinstance(v8_value_expr, str) - assert isinstance(idl_type, web_idl.IdlType) -- assert (argument_index is None or isinstance(argument_index, (int, long))) -+ assert (argument_index is None or isinstance(argument_index, int)) - assert (default_value is None - or isinstance(default_value, web_idl.LiteralConstant)) - -@@ -622,7 +622,7 @@ def make_v8_to_blink_value_variadic(blink_var_name, v8_array, - """ - assert isinstance(blink_var_name, str) - assert isinstance(v8_array, str) -- assert isinstance(v8_array_start_index, (int, long)) -+ assert isinstance(v8_array_start_index, int) - assert isinstance(idl_type, web_idl.IdlType) - - pattern = ("auto&& ${{{_1}}} = " -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/callback_interface.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/callback_interface.py -index 4a6df513068..8b51f23a409 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/callback_interface.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/callback_interface.py -@@ -177,7 +177,7 @@ def generate_callback_interface(callback_interface_identifier): - prop_install_mode=PropInstallMode.UNCONDITIONAL, - trampoline_var_name=None, - attribute_entries=[], -- constant_entries=filter(is_unconditional, constant_entries), -+ constant_entries=list(filter(is_unconditional, constant_entries)), - exposed_construct_entries=[], - operation_entries=[]) - (install_interface_template_decl, install_interface_template_def, -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/code_node.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/code_node.py -index 52972fefe20..e5ae9d9629e 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/code_node.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/code_node.py -@@ -503,13 +503,13 @@ class CompositeNode(CodeNode): - gensym_kwargs = {} - template_vars = {} - for arg in args: -- assert isinstance(arg, (CodeNode, int, long, str)) -+ assert isinstance(arg, (CodeNode, int, str)) - gensym = CodeNode.gensym() - gensym_args.append("${{{}}}".format(gensym)) - template_vars[gensym] = arg - for key, value in kwargs.items(): -- assert isinstance(key, (int, long, str)) -- assert isinstance(value, (CodeNode, int, long, str)) -+ assert isinstance(key, (int, str)) -+ assert isinstance(value, (CodeNode, int, str)) - gensym = CodeNode.gensym() - gensym_kwargs[key] = "${{{}}}".format(gensym) - template_vars[gensym] = value -@@ -602,7 +602,7 @@ class ListNode(CodeNode): - def insert(self, index, node): - if node is None: - return -- assert isinstance(index, (int, long)) -+ assert isinstance(index, int) - assert isinstance(node, CodeNode) - assert node.outer is None and node.prev is None - -@@ -721,7 +721,7 @@ class SymbolScopeNode(SequenceNode): - if not scope_chains: - return counts - -- self_index = iter(scope_chains).next().index(self) -+ self_index = next(iter(scope_chains)).index(self) - scope_chains = map( - lambda scope_chain: scope_chain[self_index + 1:], scope_chains) - scope_to_likeliness = {} -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_expr.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_expr.py -index a229a6c71c9..5fa288dabf2 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_expr.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_expr.py -@@ -109,7 +109,7 @@ def expr_and(terms): - - if any(term.is_always_false for term in terms): - return _Expr(False) -- terms = filter(lambda x: not x.is_always_true, terms) -+ terms = list(filter(lambda x: not x.is_always_true, terms)) - if not terms: - return _Expr(True) - if len(terms) == 1: -@@ -124,7 +124,7 @@ def expr_or(terms): - - if any(term.is_always_true for term in terms): - return _Expr(True) -- terms = filter(lambda x: not x.is_always_false, terms) -+ terms = list(filter(lambda x: not x.is_always_false, terms)) - if not terms: - return _Expr(False) - if len(terms) == 1: -@@ -222,7 +222,7 @@ def expr_from_exposure(exposure, - elif exposure.only_in_secure_contexts is False: - secure_context_term = _Expr(True) - else: -- terms = map(ref_enabled, exposure.only_in_secure_contexts) -+ terms = list(map(ref_enabled, exposure.only_in_secure_contexts)) - secure_context_term = expr_or( - [_Expr("${is_in_secure_context}"), - expr_not(expr_and(terms))]) -@@ -275,10 +275,11 @@ def expr_from_exposure(exposure, - - # [ContextEnabled] - if exposure.context_enabled_features: -- terms = map( -- lambda feature: _Expr( -- "${{context_feature_settings}}->is{}Enabled()".format( -- feature)), exposure.context_enabled_features) -+ terms = list( -+ map( -+ lambda feature: _Expr( -+ "${{context_feature_settings}}->is{}Enabled()".format( -+ feature)), exposure.context_enabled_features)) - context_enabled_terms.append( - expr_and([_Expr("${context_feature_settings}"), - expr_or(terms)])) -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_format.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_format.py -index 87d26eec3ca..f3e9d38247e 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_format.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_format.py -@@ -23,7 +23,7 @@ class _TemplateFormatter(string.Formatter): - self._template_formatter_indexing_count_ = 0 - - def get_value(self, key, args, kwargs): -- if isinstance(key, (int, long)): -+ if isinstance(key, int): - return args[key] - assert isinstance(key, str) - if not key: -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_utils.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_utils.py -index 2bcc4fed49a..e72282aa696 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_utils.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_utils.py -@@ -116,4 +116,4 @@ def write_code_node_to_file(code_node, filepath): - # stderr=format_result.error_message)) - # - # web_idl.file_io.write_to_file_if_changed(filepath, format_result.contents) -- web_idl.file_io.write_to_file_if_changed(filepath, rendered_text) -+ web_idl.file_io.write_to_file_if_changed(filepath, rendered_text.encode('utf-8')) -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/dictionary.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/dictionary.py -index b39f0100410..4d68202296b 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/dictionary.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/dictionary.py -@@ -993,7 +993,7 @@ def make_dict_trace_func(cg_context): - _2 = _blink_member_name(member).value_var - return TextNode(_format(pattern, _1=_1, _2=_2)) - -- body.extend(map(make_trace_member_node, own_members)) -+ body.extend(list(map(make_trace_member_node, own_members))) - body.append(TextNode("BaseClass::Trace(visitor);")) - - return func_decl, func_def -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py -index 10ff30656ad..bfdf7128aac 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py -@@ -582,7 +582,7 @@ def _make_blink_api_call(code_node, - overriding_args=None): - assert isinstance(code_node, SymbolScopeNode) - assert isinstance(cg_context, CodeGenContext) -- assert num_of_args is None or isinstance(num_of_args, (int, long)) -+ assert num_of_args is None or isinstance(num_of_args, int) - assert (overriding_args is None - or (isinstance(overriding_args, (list, tuple)) - and all(isinstance(arg, str) for arg in overriding_args))) -@@ -1196,8 +1196,10 @@ def make_overload_dispatcher(cg_context): - did_use_break = did_use_break or can_fail - - conditional = expr_or( -- map(lambda item: expr_from_exposure(item.function_like.exposure), -- items)) -+ list( -+ map( -+ lambda item: expr_from_exposure(item.function_like.exposure -+ ), items))) - if not conditional.is_always_true: - node = CxxUnlikelyIfNode(cond=conditional, body=node) - -@@ -4642,7 +4644,7 @@ class _PropEntryConstructorGroup(_PropEntryBase): - def __init__(self, is_context_dependent, exposure_conditional, world, - constructor_group, ctor_callback_name, ctor_func_length): - assert isinstance(ctor_callback_name, str) -- assert isinstance(ctor_func_length, (int, long)) -+ assert isinstance(ctor_func_length, int) - - _PropEntryBase.__init__(self, is_context_dependent, - exposure_conditional, world, constructor_group) -@@ -4670,7 +4672,7 @@ class _PropEntryOperationGroup(_PropEntryBase): - op_func_length, - no_alloc_direct_callback_name=None): - assert isinstance(op_callback_name, str) -- assert isinstance(op_func_length, (int, long)) -+ assert isinstance(op_func_length, int) - - _PropEntryBase.__init__(self, is_context_dependent, - exposure_conditional, world, operation_group) -@@ -5175,9 +5177,9 @@ def make_install_interface_template(cg_context, function_name, class_name, api_c - ]) - - if class_like.identifier == "CSSStyleDeclaration": -- css_properties = filter( -- lambda attr: "CSSProperty" in attr.extended_attributes, -- class_like.attributes) -+ css_properties = list( -+ filter(lambda attr: "CSSProperty" in attr.extended_attributes, -+ class_like.attributes)) - if css_properties: - prop_name_list = "".join( - map(lambda attr: "\"{}\", ".format(attr.identifier), -@@ -5567,8 +5569,8 @@ ${instance_object} = ${v8_context}->Global()->GetPrototype().As();\ - "V8DOMConfiguration::InstallConstants(${isolate}, " - "${interface_template}, ${prototype_template}, " - "kConstantCallbackTable, base::size(kConstantCallbackTable));") -- constant_callback_entries = filter(lambda entry: entry.const_callback_name, -- constant_entries) -+ constant_callback_entries = list(filter(lambda entry: entry.const_callback_name, -+ constant_entries)) - install_properties(table_name, constant_callback_entries, - _make_constant_callback_registration_table, - installer_call_text) -@@ -5584,8 +5586,8 @@ ${instance_object} = ${v8_context}->Global()->GetPrototype().As();\ - "V8DOMConfiguration::InstallConstants(${isolate}, " - "${interface_template}, ${prototype_template}, " - "kConstantValueTable, base::size(kConstantValueTable));") -- constant_value_entries = filter( -- lambda entry: not entry.const_callback_name, constant_entries) -+ constant_value_entries = list(filter( -+ lambda entry: not entry.const_callback_name, constant_entries)) - install_properties(table_name, constant_value_entries, - _make_constant_value_registration_table, - installer_call_text) -@@ -6336,8 +6338,8 @@ def make_v8_context_snapshot_api(cg_context, component, attribute_entries, - assert isinstance(component, web_idl.Component) - - derived_interfaces = cg_context.interface.deriveds -- derived_names = map(lambda interface: interface.identifier, -- derived_interfaces) -+ derived_names = list( -+ map(lambda interface: interface.identifier, derived_interfaces)) - derived_names.append(cg_context.interface.identifier) - if not ("Window" in derived_names or "HTMLDocument" in derived_names): - return None, None -@@ -6411,9 +6413,11 @@ def _make_v8_context_snapshot_get_reference_table_function( - collect_callbacks(named_properties_object_callback_defs) - collect_callbacks(cross_origin_property_callback_defs) - -- entry_nodes = map( -- lambda name: TextNode("reinterpret_cast({}),".format(name)), -- filter(None, callback_names)) -+ entry_nodes = list( -+ map( -+ lambda name: TextNode("reinterpret_cast({}),".format(name -+ )), -+ filter(None, callback_names))) - table_node = ListNode([ - TextNode("using namespace ${class_name}Callbacks;"), - TextNode("static const intptr_t kReferenceTable[] = {"), -@@ -6451,10 +6455,11 @@ def _make_v8_context_snapshot_install_props_per_context_function( - class_name=None, - prop_install_mode=PropInstallMode.V8_CONTEXT_SNAPSHOT, - trampoline_var_name=None, -- attribute_entries=filter(selector, attribute_entries), -- constant_entries=filter(selector, constant_entries), -- exposed_construct_entries=filter(selector, exposed_construct_entries), -- operation_entries=filter(selector, operation_entries)) -+ attribute_entries=list(filter(selector, attribute_entries)), -+ constant_entries=list(filter(selector, constant_entries)), -+ exposed_construct_entries=list( -+ filter(selector, exposed_construct_entries)), -+ operation_entries=list(filter(selector, operation_entries))) - - return func_decl, func_def - -@@ -6810,11 +6815,11 @@ def generate_interface(interface_identifier): - class_name=impl_class_name, - prop_install_mode=PropInstallMode.UNCONDITIONAL, - trampoline_var_name=tp_install_unconditional_props, -- attribute_entries=filter(is_unconditional, attribute_entries), -- constant_entries=filter(is_unconditional, constant_entries), -- exposed_construct_entries=filter(is_unconditional, -- exposed_construct_entries), -- operation_entries=filter(is_unconditional, operation_entries)) -+ attribute_entries=list(filter(is_unconditional, attribute_entries)), -+ constant_entries=list(filter(is_unconditional, constant_entries)), -+ exposed_construct_entries=list( -+ filter(is_unconditional, exposed_construct_entries)), -+ operation_entries=list(filter(is_unconditional, operation_entries))) - (install_context_independent_props_decl, - install_context_independent_props_def, - install_context_independent_props_trampoline) = make_install_properties( -@@ -6823,11 +6828,14 @@ def generate_interface(interface_identifier): - class_name=impl_class_name, - prop_install_mode=PropInstallMode.CONTEXT_INDEPENDENT, - trampoline_var_name=tp_install_context_independent_props, -- attribute_entries=filter(is_context_independent, attribute_entries), -- constant_entries=filter(is_context_independent, constant_entries), -- exposed_construct_entries=filter(is_context_independent, -- exposed_construct_entries), -- operation_entries=filter(is_context_independent, operation_entries)) -+ attribute_entries=list( -+ filter(is_context_independent, attribute_entries)), -+ constant_entries=list(filter(is_context_independent, -+ constant_entries)), -+ exposed_construct_entries=list( -+ filter(is_context_independent, exposed_construct_entries)), -+ operation_entries=list( -+ filter(is_context_independent, operation_entries))) - (install_context_dependent_props_decl, install_context_dependent_props_def, - install_context_dependent_props_trampoline) = make_install_properties( - cg_context, -@@ -6835,11 +6843,13 @@ def generate_interface(interface_identifier): - class_name=impl_class_name, - prop_install_mode=PropInstallMode.CONTEXT_DEPENDENT, - trampoline_var_name=tp_install_context_dependent_props, -- attribute_entries=filter(is_context_dependent, attribute_entries), -- constant_entries=filter(is_context_dependent, constant_entries), -- exposed_construct_entries=filter(is_context_dependent, -- exposed_construct_entries), -- operation_entries=filter(is_context_dependent, operation_entries)) -+ attribute_entries=list(filter(is_context_dependent, -+ attribute_entries)), -+ constant_entries=list(filter(is_context_dependent, constant_entries)), -+ exposed_construct_entries=list( -+ filter(is_context_dependent, exposed_construct_entries)), -+ operation_entries=list(filter(is_context_dependent, -+ operation_entries))) - (install_interface_template_decl, install_interface_template_def, - install_interface_template_trampoline) = make_install_interface_template( - cg_context, -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/mako_renderer.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/mako_renderer.py -index b4c70553863..f3a2fcd772d 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/mako_renderer.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/mako_renderer.py -@@ -105,7 +105,7 @@ class MakoRenderer(object): - on_error = self._caller_stack_on_error - if (len(current) <= len(on_error) - and all(current[i] == on_error[i] -- for i in xrange(len(current)))): -+ for i in range(len(current)))): - pass # Error happened in a deeper caller. - else: - self._caller_stack_on_error = list(self._caller_stack) -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/style_format.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/style_format.py -index dc3493cc394..017d3d47bb3 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/style_format.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/style_format.py -@@ -70,8 +70,13 @@ def gn_format(contents, filename=None): - - - def _invoke_format_command(command_line, filename, contents): -- proc = subprocess.Popen( -- command_line, stdin=subprocess.PIPE, stdout=subprocess.PIPE) -+ kwargs = {} -+ if sys.version_info.major != 2: -+ kwargs['encoding'] = 'utf-8' -+ proc = subprocess.Popen(command_line, -+ stdin=subprocess.PIPE, -+ stdout=subprocess.PIPE, -+ **kwargs) - stdout_output, stderr_output = proc.communicate(input=contents) - exit_code = proc.wait() - -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/task_queue.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/task_queue.py -index 0d8f4c0f303..e666a9b668e 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/task_queue.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/task_queue.py -@@ -2,6 +2,7 @@ - # Use of this source code is governed by a BSD-style license that can be - # found in the LICENSE file. - -+import functools - import multiprocessing - - from .package_initializer import package_initializer -@@ -76,7 +77,7 @@ class TaskQueue(object): - if not report_progress: - return - -- done_count = reduce( -+ done_count = functools.reduce( - lambda count, worker_task: count + bool(worker_task.ready()), - self._worker_tasks, 0) - report_progress(len(self._worker_tasks), done_count) -@@ -85,4 +86,4 @@ class TaskQueue(object): - def _task_queue_run_tasks(tasks): - for task in tasks: - func, args, kwargs = task -- apply(func, args, kwargs) -+ func(*args, **kwargs) -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/code_generator.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/code_generator.py -index e8280be7213..e49e6eb965e 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/code_generator.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/code_generator.py -@@ -13,6 +13,7 @@ import re - import sys - - from idl_types import set_ancestors, IdlType -+from itertools import groupby - from v8_globals import includes - from v8_interface import constant_filters - from v8_types import set_component_dirs -@@ -43,6 +44,7 @@ TEMPLATES_DIR = os.path.normpath( - # after path[0] == invoking script dir - sys.path.insert(1, THIRD_PARTY_DIR) - import jinja2 -+from jinja2.filters import make_attrgetter, environmentfilter - - - def generate_indented_conditional(code, conditional): -@@ -88,6 +90,13 @@ def runtime_enabled_if(code, name): - return generate_indented_conditional(code, function) - - -+@environmentfilter -+def do_stringify_key_group_by(environment, value, attribute): -+ expr = make_attrgetter(environment, attribute) -+ key = lambda item: '' if expr(item) is None else str(expr(item)) -+ return groupby(sorted(value, key=key), expr) -+ -+ - def initialize_jinja_env(cache_dir): - jinja_env = jinja2.Environment( - loader=jinja2.FileSystemLoader(TEMPLATES_DIR), -@@ -117,6 +126,7 @@ def initialize_jinja_env(cache_dir): - }) - jinja_env.filters.update(constant_filters()) - jinja_env.filters.update(method_filters()) -+ jinja_env.filters["stringifykeygroupby"] = do_stringify_key_group_by - return jinja_env - - -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/generate_origin_trial_features.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/generate_origin_trial_features.py -index 130004eae83..04c0fabcef2 100755 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/generate_origin_trial_features.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/generate_origin_trial_features.py -@@ -80,7 +80,7 @@ def read_idl_file(reader, idl_filename): - assert len(interfaces) == 1, ( - "Expected one interface in file %r, found %d" % - (idl_filename, len(interfaces))) -- return (interfaces.values()[0], includes) -+ return (list(interfaces.values())[0], includes) - - - def interface_is_global(interface): -@@ -281,7 +281,7 @@ def main(): - - info_provider = create_component_info_provider( - os.path.normpath(options.info_dir), options.target_component) -- idl_filenames = map(str.strip, open(options.idl_files_list)) -+ idl_filenames = list(map(str.strip, open(options.idl_files_list))) - - generate_origin_trial_features(info_provider, options, idl_filenames) - return 0 -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_definitions.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_definitions.py -index 14e6e9d3f87..b027818aef2 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_definitions.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_definitions.py -@@ -394,7 +394,8 @@ class IdlInterface(object): - else: - raise ValueError('Unrecognized node class: %s' % child_class) - -- if len(filter(None, [self.iterable, self.maplike, self.setlike])) > 1: -+ if len(list(filter(None, -+ [self.iterable, self.maplike, self.setlike]))) > 1: - raise ValueError( - 'Interface can only have one of iterable<>, maplike<> and setlike<>.' - ) -@@ -512,6 +513,9 @@ class IdlAttribute(TypedObject): - def accept(self, visitor): - visitor.visit_attribute(self) - -+ def __lt__(self, other): -+ return self.name < other.name -+ - - ################################################################################ - # Constants -@@ -852,7 +856,7 @@ class IdlIncludes(object): - ################################################################################ - - --class Exposure: -+class Exposure(object): - """An Exposure holds one Exposed or RuntimeEnabled condition. - Each exposure has two properties: exposed and runtime_enabled. - Exposure(e, r) corresponds to [Exposed(e r)]. Exposure(e) corresponds to -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_reader.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_reader.py -index 8d72865a6ca..b80eebdcd61 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_reader.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_reader.py -@@ -55,8 +55,8 @@ def validate_blink_idl_definitions(idl_filename, idl_file_basename, - definitions. There is no filename convention in this case. - - Otherwise, an IDL file is invalid. - """ -- targets = ( -- definitions.interfaces.values() + definitions.dictionaries.values()) -+ targets = (list(definitions.interfaces.values()) + -+ list(definitions.dictionaries.values())) - number_of_targets = len(targets) - if number_of_targets > 1: - raise Exception( -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_types.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_types.py -index cd4f0c3513b..ab95e9c0b08 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_types.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_types.py -@@ -349,7 +349,7 @@ class IdlUnionType(IdlTypeBase): - return True - - def single_matching_member_type(self, predicate): -- matching_types = filter(predicate, self.flattened_member_types) -+ matching_types = list(filter(predicate, self.flattened_member_types)) - if len(matching_types) > 1: - raise ValueError('%s is ambiguous.' % self.name) - return matching_types[0] if matching_types else None -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/utilities.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/utilities.py -index e1677ee7bd6..3c5006f064f 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/utilities.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/utilities.py -@@ -196,8 +196,9 @@ class ComponentInfoProviderModules(ComponentInfoProvider): - - @property - def callback_functions(self): -- return dict(self._component_info_core['callback_functions'].items() + -- self._component_info_modules['callback_functions'].items()) -+ return dict( -+ list(self._component_info_core['callback_functions'].items()) + -+ list(self._component_info_modules['callback_functions'].items())) - - @property - def specifier_for_export(self): -@@ -209,8 +210,8 @@ class ComponentInfoProviderModules(ComponentInfoProvider): - - - def load_interfaces_info_overall_pickle(info_dir): -- with open(os.path.join(info_dir, -- 'interfaces_info.pickle')) as interface_info_file: -+ with open(os.path.join(info_dir, 'interfaces_info.pickle'), -+ mode='rb') as interface_info_file: - return pickle.load(interface_info_file) - - -@@ -236,23 +237,20 @@ def merge_dict_recursively(target, diff): - - def create_component_info_provider_core(info_dir): - interfaces_info = load_interfaces_info_overall_pickle(info_dir) -- with open( -- os.path.join(info_dir, 'core', -- 'component_info_core.pickle')) as component_info_file: -+ with open(os.path.join(info_dir, 'core', 'component_info_core.pickle'), -+ mode='rb') as component_info_file: - component_info = pickle.load(component_info_file) - return ComponentInfoProviderCore(interfaces_info, component_info) - - - def create_component_info_provider_modules(info_dir): - interfaces_info = load_interfaces_info_overall_pickle(info_dir) -- with open( -- os.path.join(info_dir, 'core', -- 'component_info_core.pickle')) as component_info_file: -+ with open(os.path.join(info_dir, 'core', 'component_info_core.pickle'), -+ mode='rb') as component_info_file: - component_info_core = pickle.load(component_info_file) -- with open( -- os.path.join( -- info_dir, 'modules', -- 'component_info_modules.pickle')) as component_info_file: -+ with open(os.path.join(info_dir, 'modules', -+ 'component_info_modules.pickle'), -+ mode='rb') as component_info_file: - component_info_modules = pickle.load(component_info_file) - return ComponentInfoProviderModules(interfaces_info, component_info_core, - component_info_modules) -@@ -356,7 +354,7 @@ def write_pickle_file(pickle_filename, data): - pickle_filename = abs(pickle_filename) - # If |data| is same with the file content, we skip updating. - if os.path.isfile(pickle_filename): -- with open(pickle_filename) as pickle_file: -+ with open(pickle_filename, 'rb') as pickle_file: - try: - if pickle.load(pickle_file) == data: - return -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_interface.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_interface.py -index a43260414db..a85b03abe75 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_interface.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_interface.py -@@ -189,7 +189,7 @@ def context_enabled_features(attributes): - return sorted([ - member for member in members - if member.get(KEY) and not member.get('exposed_test') -- ]) -+ ], key=lambda item: item['name']) - - def member_filter_by_name(members, name): - return [member for member in members if member[KEY] == name] -@@ -612,7 +612,8 @@ def interface_context(interface, interfaces, component_info): - sorted( - origin_trial_features(interface, context['constants'], - context['attributes'], context['methods']) + -- context_enabled_features(context['attributes'])), -+ context_enabled_features(context['attributes']), -+ key=lambda item: item['name']), - }) - if context['optional_features']: - includes.add('platform/bindings/v8_per_context_data.h') -@@ -1356,9 +1357,9 @@ def resolution_tests_methods(effective_overloads): - - # Extract argument and IDL type to simplify accessing these in each loop. - arguments = [method['arguments'][index] for method in methods] -- arguments_methods = zip(arguments, methods) -+ arguments_methods = list(zip(arguments, methods)) - idl_types = [argument['idl_type_object'] for argument in arguments] -- idl_types_methods = zip(idl_types, methods) -+ idl_types_methods = list(zip(idl_types, methods)) - - # We can’t do a single loop through all methods or simply sort them, because - # a method may be listed in multiple steps of the resolution algorithm, and -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_methods.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_methods.py -index 5f1f89a3def..6ee8a407798 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_methods.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_methods.py -@@ -46,6 +46,10 @@ import v8_types - import v8_utilities - from v8_utilities import (has_extended_attribute_value, is_unforgeable) - -+# TODO: Remove this once Python2 is obsoleted. -+if sys.version_info.major != 2: -+ basestring = str -+ - - def method_is_visible(method, interface_is_partial): - if 'overloads' in method: -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_utilities.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_utilities.py -index 2ecd6923320..fcfc48371b1 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_utilities.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_utilities.py -@@ -271,7 +271,7 @@ EXPOSED_WORKERS = set([ - ]) - - --class ExposureSet: -+class ExposureSet(object): - """An ExposureSet is a collection of Exposure instructions.""" - - def __init__(self, exposures=None): -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/callback_interface.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/callback_interface.py -index 13fb7c7068d..b73b7710687 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/callback_interface.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/callback_interface.py -@@ -91,11 +91,13 @@ class CallbackInterface(UserDefinedType, WithExtendedAttributes, - for operation_ir in ir.operations - ]) - self._operation_groups = tuple([ -- OperationGroup( -- operation_group_ir, -- filter(lambda x: x.identifier == operation_group_ir.identifier, -- self._operations), -- owner=self) for operation_group_ir in ir.operation_groups -+ OperationGroup(operation_group_ir, -+ list( -+ filter( -+ lambda x: x.identifier == operation_group_ir -+ .identifier, self._operations)), -+ owner=self) -+ for operation_group_ir in ir.operation_groups - ]) - - @property -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/database.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/database.py -index c92cf48eb2a..f5d59129449 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/database.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/database.py -@@ -156,4 +156,4 @@ class Database(object): - return self._view_by_kind(Database._Kind.UNION) - - def _view_by_kind(self, kind): -- return self._impl.find_by_kind(kind).values() -+ return list(self._impl.find_by_kind(kind).values()) -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/exposure.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/exposure.py -index abaeef39c30..e36cf7439ae 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/exposure.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/exposure.py -@@ -8,8 +8,11 @@ from .runtime_enabled_features import RuntimeEnabledFeatures - class _Feature(str): - """Represents a runtime-enabled feature.""" - -+ def __new__(cls, value): -+ return str.__new__(cls, value) -+ - def __init__(self, value): -- str.__init__(self, value) -+ str.__init__(self) - self._is_context_dependent = ( - RuntimeEnabledFeatures.is_context_dependent(self)) - -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/function_like.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/function_like.py -index 648c70d803d..1712f19c672 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/function_like.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/function_like.py -@@ -71,8 +71,9 @@ class FunctionLike(WithIdentifier): - def num_of_required_arguments(self): - """Returns the number of required arguments.""" - return len( -- filter(lambda arg: not (arg.is_optional or arg.is_variadic), -- self.arguments)) -+ list( -+ filter(lambda arg: not (arg.is_optional or arg.is_variadic), -+ self.arguments))) - - - class OverloadGroup(WithIdentifier): -@@ -171,8 +172,7 @@ class OverloadGroup(WithIdentifier): - Returns the effective overload set. - https://heycam.github.io/webidl/#compute-the-effective-overload-set - """ -- assert argument_count is None or isinstance(argument_count, -- (int, long)) -+ assert argument_count is None or isinstance(argument_count, int) - - N = argument_count - S = [] -@@ -188,21 +188,21 @@ class OverloadGroup(WithIdentifier): - - S.append( - OverloadGroup.EffectiveOverloadItem( -- X, map(lambda arg: arg.idl_type, X.arguments), -- map(lambda arg: arg.optionality, X.arguments))) -+ X, list(map(lambda arg: arg.idl_type, X.arguments)), -+ list(map(lambda arg: arg.optionality, X.arguments)))) - - if X.is_variadic: -- for i in xrange(n, max(maxarg, N)): -- t = map(lambda arg: arg.idl_type, X.arguments) -- o = map(lambda arg: arg.optionality, X.arguments) -- for _ in xrange(n, i + 1): -+ for i in range(n, max(maxarg, N)): -+ t = list(map(lambda arg: arg.idl_type, X.arguments)) -+ o = list(map(lambda arg: arg.optionality, X.arguments)) -+ for _ in range(n, i + 1): - t.append(X.arguments[-1].idl_type) - o.append(X.arguments[-1].optionality) - S.append(OverloadGroup.EffectiveOverloadItem(X, t, o)) - -- t = map(lambda arg: arg.idl_type, X.arguments) -- o = map(lambda arg: arg.optionality, X.arguments) -- for i in xrange(n - 1, -1, -1): -+ t = list(map(lambda arg: arg.idl_type, X.arguments)) -+ o = list(map(lambda arg: arg.optionality, X.arguments)) -+ for i in range(n - 1, -1, -1): - if X.arguments[i].optionality == IdlType.Optionality.REQUIRED: - break - S.append(OverloadGroup.EffectiveOverloadItem(X, t[:i], o[:i])) -@@ -222,7 +222,7 @@ class OverloadGroup(WithIdentifier): - for item in items) - assert len(items) > 1 - -- for index in xrange(len(items[0].type_list)): -+ for index in range(len(items[0].type_list)): - # Assume that the given items are valid, and we only need to test - # the two types. - if OverloadGroup.are_distinguishable_types( -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/idl_compiler.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/idl_compiler.py -index c5ee2bd8a3d..58315072480 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/idl_compiler.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/idl_compiler.py -@@ -149,8 +149,8 @@ class IdlCompiler(object): - for old_ir in old_irs: - new_ir = make_copy(old_ir) - self._ir_map.add(new_ir) -- new_ir.attributes = filter(not_disabled, new_ir.attributes) -- new_ir.operations = filter(not_disabled, new_ir.operations) -+ new_ir.attributes = list(filter(not_disabled, new_ir.attributes)) -+ new_ir.operations = list(filter(not_disabled, new_ir.operations)) - - def _record_defined_in_partial_and_mixin(self): - old_irs = self._ir_map.irs_of_kinds( -@@ -231,7 +231,7 @@ class IdlCompiler(object): - only_to_members_of_partial_or_mixin=False) - propagate_to_exposure(propagate) - -- map(process_member_like, ir.iter_all_members()) -+ list(map(process_member_like, ir.iter_all_members())) - - def process_member_like(ir): - propagate = functools.partial(propagate_extattr, ir=ir) -@@ -257,7 +257,7 @@ class IdlCompiler(object): - - self._ir_map.move_to_new_phase() - -- map(process_interface_like, old_irs) -+ list(map(process_interface_like, old_irs)) - - def _determine_blink_headers(self): - irs = self._ir_map.irs_of_kinds( -@@ -422,9 +422,9 @@ class IdlCompiler(object): - assert not new_interface.deriveds - derived_set = identifier_to_derived_set.get( - new_interface.identifier, set()) -- new_interface.deriveds = map( -- lambda id_: self._ref_to_idl_def_factory.create(id_), -- sorted(derived_set)) -+ new_interface.deriveds = list( -+ map(lambda id_: self._ref_to_idl_def_factory.create(id_), -+ sorted(derived_set))) - - def _supplement_missing_html_constructor_operation(self): - # Temporary mitigation of misuse of [HTMLConstructor] -@@ -553,7 +553,8 @@ class IdlCompiler(object): - self._ir_map.add(new_ir) - - for group in new_ir.iter_all_overload_groups(): -- exposures = map(lambda overload: overload.exposure, group) -+ exposures = list(map(lambda overload: overload.exposure, -+ group)) - - # [Exposed] - if any(not exposure.global_names_and_features -@@ -653,8 +654,8 @@ class IdlCompiler(object): - constructs = set() - for global_name in global_names: - constructs.update(exposed_map.get(global_name, [])) -- new_ir.exposed_constructs = map( -- self._ref_to_idl_def_factory.create, sorted(constructs)) -+ new_ir.exposed_constructs = list( -+ map(self._ref_to_idl_def_factory.create, sorted(constructs))) - - assert not new_ir.legacy_window_aliases - if new_ir.identifier != 'Window': -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/interface.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/interface.py -index 65d24e529d1..067ef2eb0b2 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/interface.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/interface.py -@@ -180,8 +180,9 @@ class Interface(UserDefinedType, WithExtendedAttributes, WithCodeGeneratorInfo, - self._constructor_groups = tuple([ - ConstructorGroup( - group_ir, -- filter(lambda x: x.identifier == group_ir.identifier, -- self._constructors), -+ list( -+ filter(lambda x: x.identifier == group_ir.identifier, -+ self._constructors)), - owner=self) for group_ir in ir.constructor_groups - ]) - assert len(self._constructor_groups) <= 1 -@@ -192,8 +193,9 @@ class Interface(UserDefinedType, WithExtendedAttributes, WithCodeGeneratorInfo, - self._named_constructor_groups = tuple([ - ConstructorGroup( - group_ir, -- filter(lambda x: x.identifier == group_ir.identifier, -- self._named_constructors), -+ list( -+ filter(lambda x: x.identifier == group_ir.identifier, -+ self._named_constructors)), - owner=self) for group_ir in ir.named_constructor_groups - ]) - self._operations = tuple([ -@@ -203,22 +205,23 @@ class Interface(UserDefinedType, WithExtendedAttributes, WithCodeGeneratorInfo, - self._operation_groups = tuple([ - OperationGroup( - group_ir, -- filter(lambda x: x.identifier == group_ir.identifier, -- self._operations), -+ list( -+ filter(lambda x: x.identifier == group_ir.identifier, -+ self._operations)), - owner=self) for group_ir in ir.operation_groups - ]) - self._exposed_constructs = tuple(ir.exposed_constructs) - self._legacy_window_aliases = tuple(ir.legacy_window_aliases) - self._indexed_and_named_properties = None -- indexed_and_named_property_operations = filter( -- lambda x: x.is_indexed_or_named_property_operation, -- self._operations) -+ indexed_and_named_property_operations = list( -+ filter(lambda x: x.is_indexed_or_named_property_operation, -+ self._operations)) - if indexed_and_named_property_operations: - self._indexed_and_named_properties = IndexedAndNamedProperties( - indexed_and_named_property_operations, owner=self) - self._stringifier = None -- stringifier_operation_irs = filter(lambda x: x.is_stringifier, -- ir.operations) -+ stringifier_operation_irs = list( -+ filter(lambda x: x.is_stringifier, ir.operations)) - if stringifier_operation_irs: - assert len(stringifier_operation_irs) == 1 - op_ir = make_copy(stringifier_operation_irs[0]) -@@ -231,8 +234,9 @@ class Interface(UserDefinedType, WithExtendedAttributes, WithCodeGeneratorInfo, - attribute = None - if operation.stringifier_attribute: - attr_id = operation.stringifier_attribute -- attributes = filter(lambda x: x.identifier == attr_id, -- self._attributes) -+ attributes = list( -+ filter(lambda x: x.identifier == attr_id, -+ self._attributes)) - assert len(attributes) == 1 - attribute = attributes[0] - self._stringifier = Stringifier(operation, attribute, owner=self) -@@ -578,8 +582,9 @@ class Iterable(WithDebugInfo): - self._operation_groups = tuple([ - OperationGroup( - group_ir, -- filter(lambda x: x.identifier == group_ir.identifier, -- self._operations), -+ list( -+ filter(lambda x: x.identifier == group_ir.identifier, -+ self._operations)), - owner=owner) for group_ir in ir.operation_groups - ]) - -@@ -666,8 +671,9 @@ class Maplike(WithDebugInfo): - self._operation_groups = tuple([ - OperationGroup( - group_ir, -- filter(lambda x: x.identifier == group_ir.identifier, -- self._operations), -+ list( -+ filter(lambda x: x.identifier == group_ir.identifier, -+ self._operations)), - owner=owner) for group_ir in ir.operation_groups - ]) - -@@ -755,8 +761,9 @@ class Setlike(WithDebugInfo): - self._operation_groups = tuple([ - OperationGroup( - group_ir, -- filter(lambda x: x.identifier == group_ir.identifier, -- self._operations), -+ list( -+ filter(lambda x: x.identifier == group_ir.identifier, -+ self._operations)), - owner=owner) for group_ir in ir.operation_groups - ]) - -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/ir_builder.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/ir_builder.py -index e9aeff4ab82..d80554d603e 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/ir_builder.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/ir_builder.py -@@ -2,6 +2,8 @@ - # Use of this source code is governed by a BSD-style license that can be - # found in the LICENSE file. - -+import sys -+ - from .argument import Argument - from .ast_group import AstGroup - from .attribute import Attribute -@@ -30,6 +32,11 @@ from .operation import Operation - from .typedef import Typedef - - -+# TODO: Remove this once Python2 is obsoleted. -+if sys.version_info.major != 2: -+ long = int -+ -+ - def load_and_register_idl_definitions(filepaths, register_ir, - create_ref_to_idl_def, idl_type_factory): - """ -@@ -160,7 +167,7 @@ class _IRBuilder(object): - child_nodes = list(node.GetChildren()) - extended_attributes = self._take_extended_attributes(child_nodes) - -- members = map(self._build_interface_member, child_nodes) -+ members = list(map(self._build_interface_member, child_nodes)) - attributes = [] - constants = [] - operations = [] -@@ -302,7 +309,7 @@ class _IRBuilder(object): - child_nodes = list(node.GetChildren()) - inherited = self._take_inheritance(child_nodes) - extended_attributes = self._take_extended_attributes(child_nodes) -- own_members = map(self._build_dictionary_member, child_nodes) -+ own_members = list(map(self._build_dictionary_member, child_nodes)) - - return Dictionary.IR( - identifier=Identifier(node.GetName()), -@@ -336,7 +343,7 @@ class _IRBuilder(object): - - child_nodes = list(node.GetChildren()) - extended_attributes = self._take_extended_attributes(child_nodes) -- members = map(self._build_interface_member, child_nodes) -+ members = list(map(self._build_interface_member, child_nodes)) - constants = [] - operations = [] - for member in members: -@@ -456,8 +463,8 @@ class _IRBuilder(object): - assert len(child_nodes) == 1 - child = child_nodes[0] - if child.GetClass() == 'Arguments': -- arguments = map(build_extattr_argument, -- child.GetChildren()) -+ arguments = list( -+ map(build_extattr_argument, child.GetChildren())) - elif child.GetClass() == 'Call': - assert len(child.GetChildren()) == 1 - grand_child = child.GetChildren()[0] -@@ -486,7 +493,9 @@ class _IRBuilder(object): - - assert node.GetClass() == 'ExtAttributes' - return ExtendedAttributes( -- filter(None, map(build_extended_attribute, node.GetChildren()))) -+ list( -+ filter(None, map(build_extended_attribute, -+ node.GetChildren())))) - - def _build_inheritance(self, node): - assert node.GetClass() == 'Inherit' -@@ -506,7 +515,7 @@ class _IRBuilder(object): - - def _build_iterable(self, node): - assert node.GetClass() == 'Iterable' -- types = map(self._build_type, node.GetChildren()) -+ types = list(map(self._build_type, node.GetChildren())) - assert len(types) == 1 or len(types) == 2 - if len(types) == 1: # value iterator - key_type, value_type = (None, types[0]) -@@ -584,7 +593,7 @@ class _IRBuilder(object): - def _build_maplike(self, node, interface_identifier): - assert node.GetClass() == 'Maplike' - assert isinstance(interface_identifier, Identifier) -- types = map(self._build_type, node.GetChildren()) -+ types = list(map(self._build_type, node.GetChildren())) - assert len(types) == 2 - key_type, value_type = types - is_readonly = bool(node.GetProperty('READONLY')) -@@ -676,7 +685,7 @@ class _IRBuilder(object): - def _build_setlike(self, node, interface_identifier): - assert node.GetClass() == 'Setlike' - assert isinstance(interface_identifier, Identifier) -- types = map(self._build_type, node.GetChildren()) -+ types = list(map(self._build_type, node.GetChildren())) - assert len(types) == 1 - value_type = types[0] - is_readonly = bool(node.GetProperty('READONLY')) -@@ -838,7 +847,7 @@ class _IRBuilder(object): - - def build_union_type(node, extended_attributes): - return self._idl_type_factory.union_type( -- member_types=map(self._build_type, node.GetChildren()), -+ member_types=list(map(self._build_type, node.GetChildren())), - is_optional=is_optional, - extended_attributes=extended_attributes, - debug_info=self._build_debug_info(node)) -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/make_copy.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/make_copy.py -index a7a2b11f3f0..2f6b61300ff 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/make_copy.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/make_copy.py -@@ -3,6 +3,13 @@ - # found in the LICENSE file. - - -+import sys -+ -+# TODO: Remove this once Python2 is obsoleted. -+if sys.version_info.major != 2: -+ long = int -+ basestring = str -+ - def make_copy(obj, memo=None): - """ - Creates a copy of the given object, which should be an IR or part of IR. -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/namespace.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/namespace.py -index eeabef97cbe..bd7e98907f3 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/namespace.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/namespace.py -@@ -107,11 +107,13 @@ class Namespace(UserDefinedType, WithExtendedAttributes, WithCodeGeneratorInfo, - for operation_ir in ir.operations - ]) - self._operation_groups = tuple([ -- OperationGroup( -- operation_group_ir, -- filter(lambda x: x.identifier == operation_group_ir.identifier, -- self._operations), -- owner=self) for operation_group_ir in ir.operation_groups -+ OperationGroup(operation_group_ir, -+ list( -+ filter( -+ lambda x: x.identifier == operation_group_ir -+ .identifier, self._operations)), -+ owner=self) -+ for operation_group_ir in ir.operation_groups - ]) - - @property -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/templates/dictionary_v8.cc.tmpl b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/templates/dictionary_v8.cc.tmpl -index 0add9c45a38..dc910f6d227 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/templates/dictionary_v8.cc.tmpl -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/bindings/templates/dictionary_v8.cc.tmpl -@@ -59,9 +59,9 @@ void {{v8_class}}::ToImpl(v8::Isolate* isolate, v8::Local v8_value, { - DCHECK(executionContext); - {% endif %}{# has_origin_trial_members #} - {% endif %}{# members #} -- {% for origin_trial_test, origin_trial_member_list in members | groupby('origin_trial_feature_name') %} -+ {% for origin_trial_test, origin_trial_member_list in members | stringifykeygroupby('origin_trial_feature_name') %} - {% filter origin_trial_enabled(origin_trial_test, "executionContext") %} -- {% for feature_name, member_list in origin_trial_member_list | groupby('runtime_enabled_feature_name') %} -+ {% for feature_name, member_list in origin_trial_member_list | stringifykeygroupby('runtime_enabled_feature_name') %} - {% filter runtime_enabled(feature_name) %} - {% for member in member_list %} - v8::Local {{member.v8_value}}; -@@ -147,9 +147,9 @@ bool toV8{{cpp_class}}(const {{cpp_class}}* impl, v8::Local dictiona - DCHECK(executionContext); - {% endif %}{# has_origin_trial_members #} - {% endif %}{# members #} -- {% for origin_trial_test, origin_trial_member_list in members | groupby('origin_trial_feature_name') %} -+ {% for origin_trial_test, origin_trial_member_list in members | stringifykeygroupby('origin_trial_feature_name') %} - {% filter origin_trial_enabled(origin_trial_test, "executionContext") %} -- {% for feature_name, member_list in origin_trial_member_list | groupby('runtime_enabled_feature_name') %} -+ {% for feature_name, member_list in origin_trial_member_list | stringifykeygroupby('runtime_enabled_feature_name') %} - {% filter runtime_enabled(feature_name) %} - {% for member in member_list %} - v8::Local {{member.v8_value}}; -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/make_style_shorthands.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/make_style_shorthands.py -index 1799cd5a153..5f43ffabc26 100755 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/make_style_shorthands.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/make_style_shorthands.py -@@ -71,7 +71,7 @@ class Expansion(object): - def enabled_longhands(self): - include = lambda longhand: not longhand[ - 'runtime_flag'] or self.is_enabled(longhand['runtime_flag']) -- return filter(include, self._longhands) -+ return list(filter(include, self._longhands)) - - @property - def index(self): -@@ -87,8 +87,9 @@ class Expansion(object): - - def create_expansions(longhands): - flags = collect_runtime_flags(longhands) -- expansions = map(lambda mask: Expansion(longhands, flags, mask), -- range(1 << len(flags))) -+ expansions = list( -+ map(lambda mask: Expansion(longhands, flags, mask), -+ range(1 << len(flags)))) - assert len(expansions) > 0 - # We generate 2^N expansions for N flags, so enforce some limit. - assert len(flags) <= 4, 'Too many runtime flags for a single shorthand' -@@ -114,14 +115,14 @@ class StylePropertyShorthandWriter(json5_generator.Writer): - - self._longhand_dictionary = defaultdict(list) - for property_ in json5_properties.shorthands: -- property_['longhand_enum_keys'] = map(enum_key_for_css_property, -- property_['longhands']) -- property_['longhand_property_ids'] = map(id_for_css_property, -- property_['longhands']) -- -- longhands = map( -- lambda name: json5_properties.properties_by_name[name], -- property_['longhands']) -+ property_['longhand_enum_keys'] = list( -+ map(enum_key_for_css_property, property_['longhands'])) -+ property_['longhand_property_ids'] = list( -+ map(id_for_css_property, property_['longhands'])) -+ -+ longhands = list( -+ map(lambda name: json5_properties.properties_by_name[name], -+ property_['longhands'])) - property_['expansions'] = create_expansions(longhands) - for longhand_enum_key in property_['longhand_enum_keys']: - self._longhand_dictionary[longhand_enum_key].append(property_) -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/properties/make_css_property_instances.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/properties/make_css_property_instances.py -index 75030ac577e..f72aadee17d 100755 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/properties/make_css_property_instances.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/properties/make_css_property_instances.py -@@ -42,8 +42,8 @@ class CSSPropertyInstancesWriter(json5_generator.Writer): - aliases = self._css_properties.aliases - - # Lists of PropertyClassData. -- self._property_classes_by_id = map(self.get_class, properties) -- self._alias_classes_by_id = map(self.get_class, aliases) -+ self._property_classes_by_id = list(map(self.get_class, properties)) -+ self._alias_classes_by_id = list(map(self.get_class, aliases)) - - # Sort by enum value. - self._property_classes_by_id.sort(key=lambda t: t.enum_value) -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py -index 5ee49056be4..db72660d471 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py -@@ -95,7 +95,7 @@ def main(): - - open(args.output_file, 'wb').write( - generate_gperf(gperf_path, -- open(infile).read(), gperf_args)) -+ open(infile).read(), gperf_args).encode('utf-8')) - - - if __name__ == '__main__': -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_file.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_file.py -index 28adc050f1e..58113483e57 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_file.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_file.py -@@ -66,7 +66,7 @@ class InFile(object): - self._defaults = defaults - self._valid_values = copy.deepcopy( - valid_values if valid_values else {}) -- self._parse(map(str.strip, lines)) -+ self._parse(list(map(str.strip, lines))) - - @classmethod - def load_from_files(self, file_paths, defaults, valid_values, -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_generator.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_generator.py -index e46740a2e85..ab1981ad1e3 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_generator.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_generator.py -@@ -32,10 +32,15 @@ import os - import os.path - import shlex - import shutil -+import sys - import optparse - - from in_file import InFile - -+# TODO: Remove this once Python2 is obsoleted. -+if sys.version_info.major != 2: -+ basestring = str -+ - - ######################################################### - # This is now deprecated - use json5_generator.py instead -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/make_runtime_features.py b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/make_runtime_features.py -index cafe8d94a8e..6925a4fa580 100755 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/make_runtime_features.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/make_runtime_features.py -@@ -138,7 +138,7 @@ class RuntimeFeatureWriter(BaseRuntimeFeatureWriter): - except Exception: - # If trouble unpickling, overwrite - pass -- with open(os.path.abspath(file_name), 'w') as pickle_file: -+ with open(os.path.abspath(file_name), 'wb') as pickle_file: - pickle.dump(features_map, pickle_file) - - def _template_inputs(self): -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_factory.cc.tmpl b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_factory.cc.tmpl -index dc3f44c5b10..3eefcf9f0ee 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_factory.cc.tmpl -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_factory.cc.tmpl -@@ -26,7 +26,7 @@ using {{namespace}}FunctionMap = HashMapGetExecutionContext())) { -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_type_helpers.h.tmpl b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_type_helpers.h.tmpl -index 1b5297d52dc..edecc81d9d4 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_type_helpers.h.tmpl -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_type_helpers.h.tmpl -@@ -15,7 +15,7 @@ namespace blink { - class Document; - - // Type checking. --{% for tag in tags|sort if not tag.multipleTagNames and not tag.noTypeHelpers %} -+{% for tag in tags|sort(attribute='name') if not tag.multipleTagNames and not tag.noTypeHelpers %} - class {{tag.interface}}; - template <> - inline bool IsElementOfType(const Node& node) { -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/macros.tmpl b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/macros.tmpl -index 0244433af2e..dcdbb02a56c 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/macros.tmpl -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/macros.tmpl -@@ -25,7 +25,7 @@ - - - {% macro trie_leaf(index, object, return_macro, lowercase_data) %} --{% set name, value = object.items()[0] %} -+{% set name, value = (object.items()|list)[0] %} - {% if name|length %} - if ( - {%- for c in name -%} -@@ -45,7 +45,7 @@ return {{ return_macro(value) }}; - - - {% macro trie_switch(trie, index, return_macro, lowercase_data) %} --{% if trie|length == 1 and trie.values()[0] is string %} -+{% if trie|length == 1 and (trie.values()|list)[0] is string %} - {{ trie_leaf(index, trie, return_macro, lowercase_data) -}} - {% else %} - {% if lowercase_data %} -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/make_qualified_names.h.tmpl b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/make_qualified_names.h.tmpl -index cb05c6c4315..bd5566b03e7 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/make_qualified_names.h.tmpl -+++ b/qtwebengine/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/make_qualified_names.h.tmpl -@@ -24,12 +24,12 @@ namespace {{cpp_namespace}} { - {{symbol_export}}extern const WTF::AtomicString& {{namespace_prefix}}NamespaceURI; - - // Tags --{% for tag in tags|sort %} -+{% for tag in tags|sort(attribute='name') %} - {{symbol_export}}extern const blink::{{namespace}}QualifiedName& {{tag|symbol}}Tag; - {% endfor %} - - // Attributes --{% for attr in attrs|sort %} -+{% for attr in attrs|sort(attribute='name') %} - {{symbol_export}}extern const blink::QualifiedName& {{attr|symbol}}Attr; - {% endfor %} - -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/dawn/generator/generator_lib.py b/qtwebengine/src/3rdparty/chromium/third_party/dawn/generator/generator_lib.py -index 5e3734d7833..e3d46bd194f 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/dawn/generator/generator_lib.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/dawn/generator/generator_lib.py -@@ -201,6 +201,10 @@ def _compute_python_dependencies(root_dir=None): - - paths = set() - for path in module_paths: -+ # Builtin/namespaced modules may return None for the file path. -+ if not path: -+ continue -+ - path = os.path.abspath(path) - - if not path.startswith(root_dir): -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/BUILD.gn b/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/BUILD.gn -index cd488e88b60..ea1dc3d9a79 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/BUILD.gn -+++ b/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/BUILD.gn -@@ -2,6 +2,8 @@ - # Use of this source code is governed by a BSD-style license that can be - # found in the LICENSE file. - -+import("//build/config/python.gni") -+ - import("//third_party/blink/public/public_features.gni") - import("./all_devtools_files.gni") - import("./all_devtools_modules.gni") -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_inspector_overlay.py b/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_inspector_overlay.py -index d6666e8b74f..0f7a661e632 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_inspector_overlay.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_inspector_overlay.py -@@ -45,7 +45,8 @@ def rollup(input_path, output_path, filename, max_size, rollup_plugin): - ['--format', 'iife', '-n', 'InspectorOverlay'] + ['--input', target] + - ['--plugin', rollup_plugin], - stdout=subprocess.PIPE, -- stderr=subprocess.PIPE) -+ stderr=subprocess.PIPE, -+ text=True) - out, error = rollup_process.communicate() - if not out: - raise Exception("rollup failed: " + error) -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_release_applications.py b/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_release_applications.py -index fa8e73d34af..7d0b84b2171 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_release_applications.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_release_applications.py -@@ -10,7 +10,7 @@ Builds applications in release mode: - and the application loader into a single script. - """ - --from cStringIO import StringIO -+from io import StringIO - from os import path - from os.path import join - import copy -@@ -145,8 +145,7 @@ class ReleaseBuilder(object): - resource_content = read_file(path.join(self.application_dir, resource_name)) - if not (resource_name.endswith('.html') - or resource_name.endswith('md')): -- resource_content += resource_source_url(resource_name).encode( -- 'utf-8') -+ resource_content += resource_source_url(resource_name) - resource_content = resource_content.replace('\\', '\\\\') - resource_content = resource_content.replace('\n', '\\n') - resource_content = resource_content.replace('"', '\\"') -@@ -173,7 +172,9 @@ class ReleaseBuilder(object): - def _concatenate_application_script(self, output): - output.write('Root.allDescriptors.push(...%s);' % self._release_module_descriptors()) - if self.descriptors.extends: -- output.write('Root.applicationDescriptor.modules.push(...%s);' % json.dumps(self.descriptors.application.values())) -+ output.write( -+ 'Root.applicationDescriptor.modules.push(...%s);' % -+ json.dumps(list(self.descriptors.application.values()))) - else: - output.write('Root.applicationDescriptor = %s;' % self.descriptors.application_json()) - -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/generate_devtools_grd.py b/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/generate_devtools_grd.py -index be510c48d76..c6a59c90298 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/generate_devtools_grd.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/generate_devtools_grd.py -@@ -123,7 +123,7 @@ def main(argv): - - try: - os.makedirs(path.join(output_directory, 'Images')) -- except OSError, e: -+ except OSError as e: - if e.errno != errno.EEXIST: - raise e - -@@ -147,7 +147,7 @@ def main(argv): - shutil.copy(path.join(dirname, filename), path.join(output_directory, 'Images')) - add_file_to_grd(doc, path.join('Images', filename)) - -- with open(parsed_args.output_filename, 'w') as output_file: -+ with open(parsed_args.output_filename, 'wb') as output_file: - output_file.write(doc.toxml(encoding='UTF-8')) - - -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/modular_build.py b/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/modular_build.py -index 0ba695d3810..bb1da2f9f8d 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/modular_build.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/modular_build.py -@@ -7,6 +7,8 @@ - Utilities for the modular DevTools build. - """ - -+from __future__ import print_function -+ - import collections - from os import path - import os -@@ -40,7 +42,7 @@ def load_and_parse_json(filename): - try: - return json.loads(read_file(filename)) - except: -- print 'ERROR: Failed to parse %s' % filename -+ print('ERROR: Failed to parse %s' % filename) - raise - - class Descriptors: -@@ -57,7 +59,7 @@ class Descriptors: - - def application_json(self): - result = dict() -- result['modules'] = self.application.values() -+ result['modules'] = list(self.application.values()) - return json.dumps(result) - - def all_compiled_files(self): -diff --git a/qtwebengine/src/3rdparty/chromium/third_party/jinja2/tests.py b/qtwebengine/src/3rdparty/chromium/third_party/jinja2/tests.py -index 0adc3d4dbcb..b14f85ff148 100644 ---- a/qtwebengine/src/3rdparty/chromium/third_party/jinja2/tests.py -+++ b/qtwebengine/src/3rdparty/chromium/third_party/jinja2/tests.py -@@ -10,7 +10,7 @@ - """ - import operator - import re --from collections import Mapping -+from collections.abc import Mapping - from jinja2.runtime import Undefined - from jinja2._compat import text_type, string_types, integer_types - import decimal -diff --git a/qtwebengine/src/3rdparty/chromium/tools/metrics/ukm/gen_builders.py b/qtwebengine/src/3rdparty/chromium/tools/metrics/ukm/gen_builders.py -index f9f61d90a56..44e46fae8cc 100755 ---- a/qtwebengine/src/3rdparty/chromium/tools/metrics/ukm/gen_builders.py -+++ b/qtwebengine/src/3rdparty/chromium/tools/metrics/ukm/gen_builders.py -@@ -48,9 +48,10 @@ def ReadFilteredData(path): - data = ukm_model.UKM_XML_TYPE.Parse(ukm_file.read()) - event_tag = ukm_model._EVENT_TYPE.tag - metric_tag = ukm_model._METRIC_TYPE.tag -- data[event_tag] = filter(ukm_model.IsNotObsolete, data[event_tag]) -+ data[event_tag] = list(filter(ukm_model.IsNotObsolete, data[event_tag])) - for event in data[event_tag]: -- event[metric_tag] = filter(ukm_model.IsNotObsolete, event[metric_tag]) -+ event[metric_tag] = list( -+ filter(ukm_model.IsNotObsolete, event[metric_tag])) - return data - - -diff --git a/qtwebengine/src/3rdparty/chromium/ui/ozone/generate_constructor_list.py b/qtwebengine/src/3rdparty/chromium/ui/ozone/generate_constructor_list.py -index 8d800636c97..04fa18e93df 100755 ---- a/qtwebengine/src/3rdparty/chromium/ui/ozone/generate_constructor_list.py -+++ b/qtwebengine/src/3rdparty/chromium/ui/ozone/generate_constructor_list.py -@@ -45,12 +45,15 @@ Example Output: ./ui/ozone/generate_constructor_list.py \ - } // namespace ui - """ - -+try: -+ from StringIO import StringIO # for Python 2 -+except ImportError: -+ from io import StringIO # for Python 3 - import optparse - import os - import collections - import re - import sys --import string - - - def GetTypedefName(typename): -@@ -68,7 +71,7 @@ def GetConstructorName(typename, platform): - This is just "Create" + typename + platform. - """ - -- return 'Create' + typename + string.capitalize(platform) -+ return 'Create' + typename + platform.capitalize() - - - def GenerateConstructorList(out, namespace, export, typenames, platforms, -@@ -163,12 +166,14 @@ def main(argv): - sys.exit(1) - - # Write to standard output or file specified by --output_cc. -- out_cc = sys.stdout -+ out_cc = getattr(sys.stdout, 'buffer', sys.stdout) - if options.output_cc: - out_cc = open(options.output_cc, 'wb') - -- GenerateConstructorList(out_cc, options.namespace, options.export, -+ out_cc_str = StringIO() -+ GenerateConstructorList(out_cc_str, options.namespace, options.export, - typenames, platforms, includes, usings) -+ out_cc.write(out_cc_str.getvalue().encode('utf-8')) - - if options.output_cc: - out_cc.close() -diff --git a/qtwebengine/src/3rdparty/chromium/ui/ozone/generate_ozone_platform_list.py b/qtwebengine/src/3rdparty/chromium/ui/ozone/generate_ozone_platform_list.py -index d47c398259b..2702b68b9bd 100755 ---- a/qtwebengine/src/3rdparty/chromium/ui/ozone/generate_ozone_platform_list.py -+++ b/qtwebengine/src/3rdparty/chromium/ui/ozone/generate_ozone_platform_list.py -@@ -49,12 +49,15 @@ Example Output: ./generate_ozone_platform_list.py --default wayland dri wayland - - """ - -+try: -+ from StringIO import StringIO # for Python 2 -+except ImportError: -+ from io import StringIO # for Python 3 - import optparse - import os - import collections - import re - import sys --import string - - - def GetConstantName(name): -@@ -63,7 +66,7 @@ def GetConstantName(name): - We just capitalize the platform name and prepend "CreateOzonePlatform". - """ - -- return 'kPlatform' + string.capitalize(name) -+ return 'kPlatform' + name.capitalize() - - - def GeneratePlatformListText(out, platforms): -@@ -149,9 +152,9 @@ def main(argv): - platforms.insert(0, options.default) - - # Write to standard output or file specified by --output_{cc,h}. -- out_cc = sys.stdout -- out_h = sys.stdout -- out_txt = sys.stdout -+ out_cc = getattr(sys.stdout, 'buffer', sys.stdout) -+ out_h = getattr(sys.stdout, 'buffer', sys.stdout) -+ out_txt = getattr(sys.stdout, 'buffer', sys.stdout) - if options.output_cc: - out_cc = open(options.output_cc, 'wb') - if options.output_h: -@@ -159,9 +162,16 @@ def main(argv): - if options.output_txt: - out_txt = open(options.output_txt, 'wb') - -- GeneratePlatformListText(out_txt, platforms) -- GeneratePlatformListHeader(out_h, platforms) -- GeneratePlatformListSource(out_cc, platforms) -+ out_txt_str = StringIO() -+ out_h_str = StringIO() -+ out_cc_str = StringIO() -+ -+ GeneratePlatformListText(out_txt_str, platforms) -+ out_txt.write(out_txt_str.getvalue().encode('utf-8')) -+ GeneratePlatformListHeader(out_h_str, platforms) -+ out_h.write(out_h_str.getvalue().encode('utf-8')) -+ GeneratePlatformListSource(out_cc_str, platforms) -+ out_cc.write(out_cc_str.getvalue().encode('utf-8')) - - if options.output_cc: - out_cc.close() diff --git a/qt5-webengine-python3.patch b/qt5-webengine-python3.patch deleted file mode 100644 index 6a1ccc4..0000000 --- a/qt5-webengine-python3.patch +++ /dev/null @@ -1,161 +0,0 @@ -diff --git a/qtwebengine/configure.pri b/qtwebengine/configure.pri -index 8705ad93..6723bffe 100644 ---- a/qtwebengine/configure.pri -+++ b/qtwebengine/configure.pri -@@ -7,20 +7,7 @@ QTWEBENGINE_SOURCE_TREE = $$PWD - equals(QMAKE_HOST.os, Windows): EXE_SUFFIX = .exe - - defineTest(isPythonVersionSupported) { -- python = $$system_quote($$system_path($$1)) -- python_version = $$system('$$python -c "import sys; print(sys.version_info[0:3])"') -- python_version ~= s/[()]//g -- python_version = $$split(python_version, ',') -- python_major_version = $$first(python_version) -- greaterThan(python_major_version, 2) { -- qtLog("Python version 3 is not supported by Chromium.") -- return(false) -- } -- python_minor_version = $$member(python_version, 1) -- python_patch_version = $$member(python_version, 2) -- greaterThan(python_major_version, 1): greaterThan(python_minor_version, 6): greaterThan(python_patch_version, 4): return(true) -- qtLog("Unsupported python version: $${python_major_version}.$${python_minor_version}.$${python_patch_version}.") -- return(false) -+ return(true) - } - - defineTest(qtConfTest_detectJumboBuild) { -@@ -52,10 +48,10 @@ defineTest(qtConfReport_jumboBuild) { - qtConfReportPadded($${1}, $$mergeLimit) - } - --defineTest(qtConfTest_detectPython2) { -- python = $$qtConfFindInPath("python2$$EXE_SUFFIX") -+defineTest(qtConfTest_detectPython) { -+ python = $$qtConfFindInPath("python$$EXE_SUFFIX") - isEmpty(python) { -- qtLog("'python2$$EXE_SUFFIX' not found in PATH. Checking for 'python$$EXE_SUFFIX'.") -+ qtLog("'python$$EXE_SUFFIX' not found in PATH. Checking for 'python$$EXE_SUFFIX'.") - python = $$qtConfFindInPath("python$$EXE_SUFFIX") - } - isEmpty(python) { -@@ -63,11 +59,11 @@ defineTest(qtConfTest_detectPython2) { - return(false) - } - !isPythonVersionSupported($$python) { -- qtLog("A suitable Python 2 executable could not be located.") -+ qtLog("A suitable Python executable could not be located.") - return(false) - } - -- # Make tests.python2.location available in configure.json. -+ # Make tests.python.location available in configure.json. - $${1}.location = $$clean_path($$python) - export($${1}.location) - $${1}.cache += location -diff --git a/qtwebengine/mkspecs/features/functions.prf b/qtwebengine/mkspecs/features/functions.prf -index 2750d707..9fda13d0 100644 ---- a/qtwebengine/mkspecs/features/functions.prf -+++ b/qtwebengine/mkspecs/features/functions.prf -@@ -39,11 +39,11 @@ defineReplace(which) { - - # Returns the unquoted path to the python executable. - defineReplace(pythonPath) { -- isEmpty(QMAKE_PYTHON2) { -+ isEmpty(QMAKE_PYTHON) { - # Fallback for building QtWebEngine with Qt < 5.8 -- QMAKE_PYTHON2 = python -+ QMAKE_PYTHON = python - } -- return($$QMAKE_PYTHON2) -+ return($$QMAKE_PYTHON) - } - - # Returns the python executable for use with shell / make targets. -diff --git a/qtwebengine/src/buildtools/config/support.pri b/qtwebengine/src/buildtools/config/support.pri -index e7f869a1..1bf2c5d7 100644 ---- a/qtwebengine/src/buildtools/config/support.pri -+++ b/qtwebengine/src/buildtools/config/support.pri -@@ -21,7 +21,7 @@ defineReplace(qtwebengine_checkWebEngineCoreError) { - !qtwebengine_checkForGperf(QtWebEngine):return(false) - !qtwebengine_checkForBison(QtWebEngine):return(false) - !qtwebengine_checkForFlex(QtWebEngine):return(false) -- !qtwebengine_checkForPython2(QtWebEngine):return(false) -+ !qtwebengine_checkForPython(QtWebEngine):return(false) - !qtwebengine_checkForNodejs(QtWebEngine):return(false) - !qtwebengine_checkForSanitizer(QtWebEngine):return(false) - linux:!qtwebengine_checkForPkgCfg(QtWebEngine):return(false) -@@ -51,7 +51,7 @@ defineReplace(qtwebengine_checkPdfError) { - !qtwebengine_checkForGperf(QtPdf):return(false) - !qtwebengine_checkForBison(QtPdf):return(false) - !qtwebengine_checkForFlex(QtPdf):return(false) -- !qtwebengine_checkForPython2(QtPdf):return(false) -+ !qtwebengine_checkForPython(QtPdf):return(false) - !qtwebengine_checkForSanitizer(QtPdf):return(false) - linux:!qtwebengine_checkForPkgCfg(QtPdf):return(false) - linux:!qtwebengine_checkForHostPkgCfg(QtPdf):return(false) -@@ -143,10 +143,10 @@ defineTest(qtwebengine_checkForFlex) { - return(true) - } - --defineTest(qtwebengine_checkForPython2) { -+defineTest(qtwebengine_checkForPython) { - module = $$1 -- !qtConfig(webengine-python2) { -- qtwebengine_skipBuild("Python version 2 (2.7.5 or later) is required to build $${module}.") -+ !qtConfig(webengine-python) { -+ qtwebengine_skipBuild("Python is required to build $${module}.") - return(false) - } - return(true) -diff --git a/qtwebengine/src/buildtools/configure.json b/qtwebengine/src/buildtools/configure.json -index 88d1790c..032aa665 100644 ---- a/qtwebengine/src/buildtools/configure.json -+++ b/qtwebengine/src/buildtools/configure.json -@@ -295,9 +295,9 @@ - "label": "system ninja", - "type": "detectNinja" - }, -- "webengine-python2": { -- "label": "python2", -- "type": "detectPython2", -+ "webengine-python": { -+ "label": "python", -+ "type": "detectPython", - "log": "location" - }, - "webengine-winversion": { -@@ -374,7 +374,7 @@ - && features.webengine-gperf - && features.webengine-bison - && features.webengine-flex -- && features.webengine-python2 -+ && features.webengine-python - && features.webengine-nodejs - && (!config.sanitizer || features.webengine-sanitizer) - && (!config.linux || features.pkg-config) -@@ -400,7 +400,7 @@ - && features.webengine-gperf - && features.webengine-bison - && features.webengine-flex -- && features.webengine-python2 -+ && features.webengine-python - && (!config.sanitizer || features.webengine-sanitizer) - && (!config.linux || features.pkg-config) - && (!config.linux || features.webengine-host-pkg-config) -@@ -423,12 +423,12 @@ - "autoDetect": "features.private_tests", - "output": [ "privateFeature" ] - }, -- "webengine-python2": { -- "label": "python2", -- "condition": "tests.webengine-python2", -+ "webengine-python": { -+ "label": "python", -+ "condition": "tests.webengine-python", - "output": [ - "privateFeature", -- { "type": "varAssign", "name": "QMAKE_PYTHON2", "value": "tests.webengine-python2.location" } -+ { "type": "varAssign", "name": "QMAKE_PYTHON", "value": "tests.webengine-python.location" } - ] - }, - "webengine-gperf": { diff --git a/qtwebengine-5.15.13_p20240322-ninja1.12.patch b/qtwebengine-5.15.13_p20240322-ninja1.12.patch new file mode 100644 index 0000000..0fdf13e --- /dev/null +++ b/qtwebengine-5.15.13_p20240322-ninja1.12.patch @@ -0,0 +1,27 @@ +Quoting the description from qtwebengine-6.7.0-ninja1.12.patch: +""" +Patch status: pending being looked at upstream + +Issue[1][2][3] also exist in chromium itself[4], and unclear +why this started happening only with ninja-1.12.0 at the moment. + +Just a quickfix, likely not fully correct and seems there may +be further unresolved race issues. + +[1] https://bugs.gentoo.org/930107 +[2] https://bugreports.qt.io/browse/QTBUG-124375 +[3] https://github.com/ninja-build/ninja/issues/2417 +[4] https://bugs.gentoo.org/930112 +""" + +This has a hunk removed but is otherwise the same. +--- ./src/3rdparty/chromium/content/browser/BUILD.gn.orig 2024-03-26 14:47:34.000000000 +0000 ++++ ./src/3rdparty/chromium/content/browser/BUILD.gn 2024-06-24 04:57:25.108720935 +0100 +@@ -196,6 +196,7 @@ jumbo_static_library("browser") { + "//content/common", + "//content/common:buildflags", + "//content/common:mojo_bindings", ++ "//components/spellcheck:buildflags", + "//content/public/browser:proto", + "//content/public/common:common_sources", + "//content/public/common:content_descriptor_keys", diff --git a/qtwebengine-everywhere-5.15.5-use-python2.patch b/qtwebengine-everywhere-5.15.5-use-python2.patch deleted file mode 100644 index 9626d27..0000000 --- a/qtwebengine-everywhere-5.15.5-use-python2.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff --git a/src/3rdparty/chromium/third_party/catapult/common/py_vulcanize/py_vulcanize/generate.py b/src/3rdparty/chromium/third_party/catapult/common/py_vulcanize/py_vulcanize/generate.py -index 8af373102..b551c0fe2 100644 ---- a/src/3rdparty/chromium/third_party/catapult/common/py_vulcanize/py_vulcanize/generate.py -+++ b/src/3rdparty/chromium/third_party/catapult/common/py_vulcanize/py_vulcanize/generate.py -@@ -83,7 +83,7 @@ def _MinifyJS(input_js): - - with tempfile.NamedTemporaryFile() as _: - args = [ -- 'python', -+ 'python2', - rjsmin_path - ] - p = subprocess.Popen(args, -@@ -203,7 +203,7 @@ def _MinifyCSS(css_text): - os.path.join(py_vulcanize_path, 'third_party', 'rcssmin', 'rcssmin.py')) - - with tempfile.NamedTemporaryFile() as _: -- rcssmin_args = ['python', rcssmin_path] -+ rcssmin_args = ['python2', rcssmin_path] - p = subprocess.Popen(rcssmin_args, - stdin=subprocess.PIPE, - stdout=subprocess.PIPE, -diff --git a/src/webengine/module.pro b/src/webengine/module.pro -index 49a1086b2..afc89d49e 100644 ---- a/src/webengine/module.pro -+++ b/src/webengine/module.pro -@@ -76,7 +76,7 @@ qtConfig(webengine-testsupport) { - python = $$pythonPathForShell() - chromium_attributions.commands = \ - cd $$shell_quote($$shell_path($$PWD/../3rdparty)) && \ -- $$python chromium/tools/licenses.py \ -+ python2 chromium/tools/licenses.py \ - --file-template ../../tools/about_credits.tmpl \ - --entry-template ../../tools/about_credits_entry.tmpl credits \ - $$shell_quote($$shell_path($$OUT_PWD/chromium_attributions.qdoc)) diff --git a/qtwebengine-icu-74.patch b/qtwebengine-icu-74.patch deleted file mode 100644 index 703f5f3..0000000 --- a/qtwebengine-icu-74.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/src/3rdparty/chromium/third_party/blink/renderer/platform/text/text_break_iterator.cc b/src/3rdparty/chromium/third_party/blink/renderer/platform/text/text_break_iterator.cc -index e34b07372..c0f9268aa 100644 ---- a/src/3rdparty/chromium/third_party/blink/renderer/platform/text/text_break_iterator.cc -+++ b/src/3rdparty/chromium/third_party/blink/renderer/platform/text/text_break_iterator.cc -@@ -162,7 +162,9 @@ static const unsigned char kAsciiLineBreakTable[][(kAsciiLineBreakTableLastChar - }; - // clang-format on - --#if U_ICU_VERSION_MAJOR_NUM >= 58 -+#if U_ICU_VERSION_MAJOR_NUM >= 74 -+#define BA_LB_COUNT (U_LB_COUNT - 8) -+#elif U_ICU_VERSION_MAJOR_NUM >= 58 - #define BA_LB_COUNT (U_LB_COUNT - 3) - #else - #define BA_LB_COUNT U_LB_COUNT diff --git a/qtwebengine-release.sh b/qtwebengine-release.sh new file mode 100755 index 0000000..2d86b0f --- /dev/null +++ b/qtwebengine-release.sh @@ -0,0 +1,15 @@ +#!/bin/sh +set -x +VERSION=5.15.17 +CHROMIUMHASH=`wget https://code.qt.io/cgit/qt/qtwebengine.git/tree/src/3rdparty?h=$VERSION -q --content-on-error -O - | grep "Bad object name: " | sed 's/^.*Bad object name: \([0-9a-f]\{40\}\).*$/\1/g'` +rm -rf qtwebengine-$VERSION qtwebengine-$VERSION.tar.gz qtwebengine-chromium-$CHROMIUMHASH qtwebengine-chromium-$CHROMIUMHASH.tar.gz qtwebengine-everywhere-src-$VERSION +wget https://github.com/qt/qtwebengine/archive/$VERSION.tar.gz -O qtwebengine-$VERSION.tar.gz || exit $? +tar xzf qtwebengine-$VERSION.tar.gz || exit $? +wget https://github.com/qt/qtwebengine-chromium/archive/$CHROMIUMHASH.tar.gz -O qtwebengine-chromium-$CHROMIUMHASH.tar.gz || exit $? +tar xzf qtwebengine-chromium-$CHROMIUMHASH.tar.gz || exit $? +mv qtwebengine-$VERSION qtwebengine-everywhere-src-$VERSION || exit $? +(cd qtwebengine-everywhere-src-$VERSION ; syncqt.pl -version $VERSION ) || exit $? +rmdir qtwebengine-everywhere-src-$VERSION/src/3rdparty || exit $? +mv qtwebengine-chromium-$CHROMIUMHASH qtwebengine-everywhere-src-$VERSION/src/3rdparty || exit $? +XZ_OPT="-9 -T2" tar cJf qtwebengine-everywhere-src-$VERSION.tar.xz qtwebengine-everywhere-src-$VERSION || exit $? +rm -rf qtwebengine-$VERSION qtwebengine-$VERSION.tar.gz qtwebengine-chromium-$CHROMIUMHASH qtwebengine-chromium-$CHROMIUMHASH.tar.gz qtwebengine-everywhere-src-$VERSION diff --git a/sources b/sources index 7e01f71..dd94a45 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ +SHA512 (qtwebengine-everywhere-src-5.15.17-clean.tar.xz) = d8fa20e0d1eea0c3c15a98145995eaa37ca21edcb7de3bf5ec548a0347c0aa2409a183ba2f8d9fdfc3686802e5e1f5bb083c0d51fe5ad3a435ab3c72b4c32af9 SHA512 (pulseaudio-12.2-headers.tar.gz) = a5a9bcbb16030b3bc83cc0cc8f5e7f90e0723d3e83258a5c77eacb32eaa267118a73fa7814fbcc99a24e4907916a2b371ebb6dedc4f45541c3acf6c834fd35be -SHA512 (qtwebengine-everywhere-src-5.15.16-clean.tar.xz) = 40572289b542a55d6e87d045fc9f9d841e5434df55bcdd4da3818df492b0cdcaaa2cc14f0827a2e9af65d08372a69de980732bf7f83b0103732c9ea4f0881bf1 -- Gitee From fefcb7e4727ddf742b56d067f382fea23b78d78d Mon Sep 17 00:00:00 2001 From: bbrucezhang Date: Tue, 29 Jul 2025 11:34:19 +0800 Subject: [PATCH 5/7] add args -qt-webengine-ffmpeg --- qt5-qtwebengine.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qt5-qtwebengine.spec b/qt5-qtwebengine.spec index 0e9940b..57e4c2d 100644 --- a/qt5-qtwebengine.spec +++ b/qt5-qtwebengine.spec @@ -298,7 +298,7 @@ export NINJA_PATH=%{__ninja} %else CONFIG+="link_pulseaudio use_gold_linker" \ %endif - QMAKE_EXTRA_ARGS+="-system-webengine-ffmpeg -system-webengine-webp -system-webengine-opus" \ + QMAKE_EXTRA_ARGS+="-system-webengine-ffmpeg -qt-webengine-ffmpeg -system-webengine-webp -system-webengine-opus" \ QMAKE_EXTRA_ARGS+="-webengine-kerberos -webengine-python-version python3" \ %{?use_system_libicu:QMAKE_EXTRA_ARGS+="-system-webengine-icu"} \ %{?pipewire:QMAKE_EXTRA_ARGS+="-webengine-webrtc-pipewire"} \ -- Gitee From 6bf184bb11ba7316ee3b25fa86673dfce0414d66 Mon Sep 17 00:00:00 2001 From: bbrucezhang Date: Tue, 29 Jul 2025 11:35:36 +0800 Subject: [PATCH 6/7] add BuildRequires ffmpeg --- qt5-qtwebengine.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qt5-qtwebengine.spec b/qt5-qtwebengine.spec index 57e4c2d..a11a465 100644 --- a/qt5-qtwebengine.spec +++ b/qt5-qtwebengine.spec @@ -155,6 +155,8 @@ BuildRequires: pkgconfig(libavcodec) BuildRequires: pkgconfig(libavformat) BuildRequires: pkgconfig(libavutil) +BuildRequires: ffmpeg + Provides: bundled(chromium) = 87.0.4280.144 -- Gitee From 8a438b60cc7c983d2affdaa66f0fc5ac2ab014f5 Mon Sep 17 00:00:00 2001 From: bbrucezhang Date: Tue, 29 Jul 2025 14:54:13 +0800 Subject: [PATCH 7/7] loongarch64 architecture disable use_gold_linker --- qt5-qtwebengine.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qt5-qtwebengine.spec b/qt5-qtwebengine.spec index a11a465..86ce34a 100644 --- a/qt5-qtwebengine.spec +++ b/qt5-qtwebengine.spec @@ -87,7 +87,9 @@ BuildRequires: cmake BuildRequires: bison BuildRequires: flex BuildRequires: gcc-c++ +%ifarch x86_64 aarch64 BuildRequires: binutils-gold +%endif BuildRequires: libstdc++-static BuildRequires: git-core BuildRequires: gperf @@ -295,7 +297,7 @@ export NINJA_PATH=%{__ninja} %{qmake_qt5} \ %{?debug_config:CONFIG+="%{debug_config}}" \ -%ifarch riscv64 +%ifarch riscv64 loongarch64 CONFIG+="link_pulseaudio" \ %else CONFIG+="link_pulseaudio use_gold_linker" \ -- Gitee