diff --git a/extra/qt5-webengine/PKGBUILD b/extra/qt5-webengine/PKGBUILD
index 522a73301..b19e8b1cc 100644
--- a/extra/qt5-webengine/PKGBUILD
+++ b/extra/qt5-webengine/PKGBUILD
@@ -12,7 +12,7 @@ highmem=1
pkgname=qt5-webengine
_qtver=5.15.8
pkgver=${_qtver/-/}
-pkgrel=1
+pkgrel=3
arch=('x86_64')
url='https://www.qt.io'
license=('LGPL3' 'LGPL2.1' 'BSD')
@@ -28,6 +28,7 @@ source=(git+https://code.qt.io/qt/qtwebengine.git#tag=v${pkgver}-lts
git+https://chromium.googlesource.com/catapult#commit=5eedfe23148a234211ba477f76fc2ea2e8529189
qt5-webengine-python3.patch
qt5-webengine-chromium-python3.patch
+ qt5-webengine-ffmpeg5.patch
0001-ARM-toolchain-fixes.patch
0002-Fix-ARM-skia-ICE.patch
0003-bind-gen-Support-single_process-flag-in-generate_bin.patch
@@ -36,11 +37,13 @@ sha256sums=('SKIP'
'SKIP'
'SKIP'
'398c996cb5b606695ac93645143df39e23fa67e768b09e0da6dbd37342a43f32'
- 'cf7be86f1d301001f91b89455b7edbbd269041e2e196355940c38afc84400826'
+ 'fda4ff16790799fb285847918a677f4f3f7c0f513d4751f846ffc5aa5d873932'
+ 'c50d3019626183e753c53a997dc8a55938847543aa3178d4c51f377be741c693'
'81b7a62368f40d757b165b88df4813413f30db797e4f93a84dd75e12e1ebd679'
'298037fcbc132f1539616cdf6149ad5da104f8e2345a9c1af1e7bf8b0dd52c70'
'b878770648437c9bc24023b1d5a47bcd51382d7142b695864c3379826511bcd9'
'e447f5d2635f8f32914c912d7f99b38726c1541334f3a2c1a8ca2dbde565a7de')
+options=(debug)
prepare() {
mkdir -p build
@@ -54,6 +57,8 @@ prepare() {
patch -p1 -i "$srcdir"/qt5-webengine-python3.patch # Fix build with Python 3
patch -p1 -d src/3rdparty -i "$srcdir"/qt5-webengine-chromium-python3.patch
+# patch -p1 -d src/3rdparty -i "$srcdir"/qt5-webengine-ffmpeg5.patch # Fix build with ffmpeg 5
+
# Update catapult for python3 compatibility
rm -r src/3rdparty/chromium/third_party/catapult
mv "$srcdir"/catapult src/3rdparty/chromium/third_party
diff --git a/extra/qt5-webengine/qt5-webengine-chromium-python3.patch b/extra/qt5-webengine/qt5-webengine-chromium-python3.patch
index 73999dfd8..c55225b68 100644
--- a/extra/qt5-webengine/qt5-webengine-chromium-python3.patch
+++ b/extra/qt5-webengine/qt5-webengine-chromium-python3.patch
@@ -1541,1027 +1541,21 @@ index cb05c6c4315..bd5566b03e7 100644
{{symbol_export}}extern const blink::QualifiedName& {{attr|symbol}}Attr;
{% endfor %}
-diff --git a/chromium/third_party/catapult/common/py_vulcanize/py_vulcanize/parse_html_deps.py b/chromium/third_party/catapult/common/py_vulcanize/py_vulcanize/parse_html_deps.py
-index 441edc5ed0d..4574d8b4951 100644
---- a/chromium/third_party/catapult/common/py_vulcanize/py_vulcanize/parse_html_deps.py
-+++ b/chromium/third_party/catapult/common/py_vulcanize/py_vulcanize/parse_html_deps.py
-@@ -24,10 +24,16 @@ def _InitBeautifulSoup():
- catapult_path = os.path.abspath(
- os.path.join(os.path.dirname(__file__),
- os.path.pardir, os.path.pardir, os.path.pardir))
-- bs_path = os.path.join(catapult_path, 'third_party', 'beautifulsoup4')
-+ if six.PY3:
-+ bs_path = os.path.join(catapult_path, 'third_party', 'beautifulsoup4-4.9.3', 'py3k')
-+ else:
-+ bs_path = os.path.join(catapult_path, 'third_party', 'beautifulsoup4')
- _AddToPathIfNeeded(bs_path)
-
-- html5lib_path = os.path.join(catapult_path, 'third_party', 'html5lib-python')
-+ if six.PY3:
-+ html5lib_path = os.path.join(catapult_path, 'third_party', 'html5lib-1.1')
-+ else:
-+ html5lib_path = os.path.join(catapult_path, 'third_party', 'html5lib-python')
- _AddToPathIfNeeded(html5lib_path)
-
- six_path = os.path.join(catapult_path, 'third_party', 'six')
-diff --git a/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/__init__.py b/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/__init__.py
-index 7ba34269af7..85d9135f39d 100644
---- a/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/__init__.py
-+++ b/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/__init__.py
-@@ -16,6 +16,10 @@ documentation:
- http://www.crummy.com/software/BeautifulSoup/bs4/doc/
- """
-
-+from __future__ import absolute_import
-+from __future__ import print_function
-+import six
-+from six.moves import range
- __author__ = "Leonard Richardson (leonardr@segfault.org)"
- __version__ = "4.3.2"
- __copyright__ = "Copyright (c) 2004-2013 Leonard Richardson"
-@@ -135,12 +139,12 @@ class BeautifulSoup(Tag):
- "fromEncoding", "from_encoding")
-
- if len(kwargs) > 0:
-- arg = kwargs.keys().pop()
-+ arg = list(kwargs.keys()).pop()
- raise TypeError(
- "__init__() got an unexpected keyword argument '%s'" % arg)
-
- if builder is None:
-- if isinstance(features, basestring):
-+ if isinstance(features, six.string_types):
- features = [features]
- if features is None or len(features) == 0:
- features = self.DEFAULT_BUILDER_FEATURES
-@@ -164,7 +168,7 @@ class BeautifulSoup(Tag):
- # involving passing non-markup to Beautiful Soup.
- # Beautiful Soup will still parse the input as markup,
- # just in case that's what the user really wants.
-- if (isinstance(markup, unicode)
-+ if (isinstance(markup, six.text_type)
- and not os.path.supports_unicode_filenames):
- possible_filename = markup.encode("utf8")
- else:
-@@ -172,7 +176,7 @@ class BeautifulSoup(Tag):
- is_file = False
- try:
- is_file = os.path.exists(possible_filename)
-- except Exception, e:
-+ except Exception as e:
- # This is almost certainly a problem involving
- # characters not valid in filenames on this
- # system. Just let it go.
-@@ -184,7 +188,7 @@ class BeautifulSoup(Tag):
- # TODO: This is ugly but I couldn't get it to work in
- # Python 3 otherwise.
- if ((isinstance(markup, bytes) and not b' ' in markup)
-- or (isinstance(markup, unicode) and not u' ' in markup)):
-+ or (isinstance(markup, six.text_type) and not u' ' in markup)):
- warnings.warn(
- '"%s" looks like a URL. Beautiful Soup is not an HTTP client. You should probably use an HTTP client to get the document behind the URL, and feed that document to Beautiful Soup.' % markup)
-
-@@ -403,4 +407,4 @@ class FeatureNotFound(ValueError):
- if __name__ == '__main__':
- import sys
- soup = BeautifulSoup(sys.stdin)
-- print soup.prettify()
-+ print(soup.prettify())
-diff --git a/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/builder/__init__.py b/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/builder/__init__.py
-index 740f5f29cd7..819012dc22c 100644
---- a/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/builder/__init__.py
-+++ b/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/builder/__init__.py
-@@ -1,3 +1,4 @@
-+from __future__ import absolute_import
- from collections import defaultdict
- import itertools
- import sys
-@@ -6,6 +7,7 @@ from bs4.element import (
- ContentMetaAttributeValue,
- whitespace_re
- )
-+import six
-
- __all__ = [
- 'HTMLTreeBuilder',
-@@ -159,7 +161,7 @@ class TreeBuilder(object):
- # value is a whitespace-separated list of
- # values. Split it into a list.
- value = attrs[attr]
-- if isinstance(value, basestring):
-+ if isinstance(value, six.string_types):
- values = whitespace_re.split(value)
- else:
- # html5lib sometimes calls setAttributes twice
-diff --git a/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/builder/_html5lib.py b/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/builder/_html5lib.py
-index 7de36ae75e4..93d53812b0f 100644
---- a/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/builder/_html5lib.py
-+++ b/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/builder/_html5lib.py
-@@ -1,3 +1,5 @@
-+from __future__ import absolute_import
-+import six
- __all__ = [
- 'HTML5TreeBuilder',
- ]
-@@ -37,7 +39,7 @@ class HTML5TreeBuilder(HTMLTreeBuilder):
- doc = parser.parse(markup, encoding=self.user_specified_encoding)
-
- # Set the character encoding detected by the tokenizer.
-- if isinstance(markup, unicode):
-+ if isinstance(markup, six.text_type):
- # We need to special-case this because html5lib sets
- # charEncoding to UTF-8 if it gets Unicode input.
- doc.original_encoding = None
-@@ -124,7 +126,7 @@ class Element(html5lib.treebuilders._base.Node):
-
- def appendChild(self, node):
- string_child = child = None
-- if isinstance(node, basestring):
-+ if isinstance(node, six.string_types):
- # Some other piece of code decided to pass in a string
- # instead of creating a TextElement object to contain the
- # string.
-@@ -139,7 +141,7 @@ class Element(html5lib.treebuilders._base.Node):
- else:
- child = node.element
-
-- if not isinstance(child, basestring) and child.parent is not None:
-+ if not isinstance(child, six.string_types) and child.parent is not None:
- node.element.extract()
-
- if (string_child and self.element.contents
-@@ -152,7 +154,7 @@ class Element(html5lib.treebuilders._base.Node):
- old_element.replace_with(new_element)
- self.soup._most_recent_element = new_element
- else:
-- if isinstance(node, basestring):
-+ if isinstance(node, six.string_types):
- # Create a brand new NavigableString from this string.
- child = self.soup.new_string(node)
-
-diff --git a/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/builder/_htmlparser.py b/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/builder/_htmlparser.py
-index ca8d8b892bf..504a901c737 100644
---- a/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/builder/_htmlparser.py
-+++ b/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/builder/_htmlparser.py
-@@ -1,13 +1,18 @@
- """Use the HTMLParser library to parse HTML files that aren't too bad."""
-
-+from __future__ import absolute_import
-+from six import unichr
-+import six
- __all__ = [
- 'HTMLParserTreeBuilder',
- ]
-
--from HTMLParser import (
-- HTMLParser,
-- HTMLParseError,
-- )
-+from six.moves.html_parser import HTMLParser
-+if six.PY2:
-+ from six.moves.html_parser import HTMLParseError
-+else:
-+ class HTMLParseError(Exception):
-+ pass
- import sys
- import warnings
-
-@@ -73,7 +78,7 @@ class BeautifulSoupHTMLParser(HTMLParser):
-
- try:
- data = unichr(real_name)
-- except (ValueError, OverflowError), e:
-+ except (ValueError, OverflowError) as e:
- data = u"\N{REPLACEMENT CHARACTER}"
-
- self.handle_data(data)
-@@ -142,7 +147,7 @@ class HTMLParserTreeBuilder(HTMLTreeBuilder):
- declared within markup, whether any characters had to be
- replaced with REPLACEMENT CHARACTER).
- """
-- if isinstance(markup, unicode):
-+ if isinstance(markup, six.text_type):
- yield (markup, None, None, False)
- return
-
-@@ -158,7 +163,7 @@ class HTMLParserTreeBuilder(HTMLTreeBuilder):
- parser.soup = self.soup
- try:
- parser.feed(markup)
-- except HTMLParseError, e:
-+ except HTMLParseError as e:
- warnings.warn(RuntimeWarning(
- "Python's built-in HTMLParser cannot parse the given document. This is not a bug in Beautiful Soup. The best solution is to install an external parser (lxml or html5lib), and use Beautiful Soup with that parser. See http://www.crummy.com/software/BeautifulSoup/bs4/doc/#installing-a-parser for help."))
- raise e
-diff --git a/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/builder/_lxml.py b/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/builder/_lxml.py
-index fa5d49875ea..7a5e612a641 100644
---- a/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/builder/_lxml.py
-+++ b/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/builder/_lxml.py
-@@ -1,3 +1,5 @@
-+from __future__ import absolute_import
-+import six
- __all__ = [
- 'LXMLTreeBuilderForXML',
- 'LXMLTreeBuilder',
-@@ -78,12 +80,12 @@ class LXMLTreeBuilderForXML(TreeBuilder):
-
- Each 4-tuple represents a strategy for parsing the document.
- """
-- if isinstance(markup, unicode):
-+ if isinstance(markup, six.text_type):
- # We were given Unicode. Maybe lxml can parse Unicode on
- # this system?
- yield markup, None, document_declared_encoding, False
-
-- if isinstance(markup, unicode):
-+ if isinstance(markup, six.text_type):
- # No, apparently not. Convert the Unicode to UTF-8 and
- # tell lxml to parse it as UTF-8.
- yield (markup.encode("utf8"), "utf8",
-@@ -102,7 +104,7 @@ class LXMLTreeBuilderForXML(TreeBuilder):
- def feed(self, markup):
- if isinstance(markup, bytes):
- markup = BytesIO(markup)
-- elif isinstance(markup, unicode):
-+ elif isinstance(markup, six.text_type):
- markup = StringIO(markup)
-
- # Call feed() at least once, even if the markup is empty,
-@@ -117,7 +119,7 @@ class LXMLTreeBuilderForXML(TreeBuilder):
- if len(data) != 0:
- self.parser.feed(data)
- self.parser.close()
-- except (UnicodeDecodeError, LookupError, etree.ParserError), e:
-+ except (UnicodeDecodeError, LookupError, etree.ParserError) as e:
- raise ParserRejectedMarkup(str(e))
-
- def close(self):
-@@ -224,7 +226,7 @@ class LXMLTreeBuilder(HTMLTreeBuilder, LXMLTreeBuilderForXML):
- self.parser = self.parser_for(encoding)
- self.parser.feed(markup)
- self.parser.close()
-- except (UnicodeDecodeError, LookupError, etree.ParserError), e:
-+ except (UnicodeDecodeError, LookupError, etree.ParserError) as e:
- raise ParserRejectedMarkup(str(e))
-
-
-diff --git a/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/dammit.py b/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/dammit.py
-index 59640b7ce3a..5fad7274b8f 100644
---- a/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/dammit.py
-+++ b/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/dammit.py
-@@ -7,11 +7,14 @@ Feed Parser. It works best on XML and XML, but it does not rewrite the
- XML or HTML to reflect a new encoding; that's the tree builder's job.
- """
-
-+from __future__ import absolute_import
- import codecs
--from htmlentitydefs import codepoint2name
-+from six.moves.html_entities import codepoint2name
- import re
- import logging
- import string
-+from six import unichr
-+import six
-
- # Import a library to autodetect character encodings.
- chardet_type = None
-@@ -340,9 +343,9 @@ class UnicodeDammit:
- self.detector = EncodingDetector(markup, override_encodings, is_html)
-
- # Short-circuit if the data is in Unicode to begin with.
-- if isinstance(markup, unicode) or markup == '':
-+ if isinstance(markup, six.text_type) or markup == '':
- self.markup = markup
-- self.unicode_markup = unicode(markup)
-+ self.unicode_markup = six.text_type(markup)
- self.original_encoding = None
- return
-
-@@ -425,7 +428,7 @@ class UnicodeDammit:
- def _to_unicode(self, data, encoding, errors="strict"):
- '''Given a string and its encoding, decodes the string into Unicode.
- %encoding is a string recognized by encodings.aliases'''
-- return unicode(data, encoding, errors)
-+ return six.text_type(data, encoding, errors)
-
- @property
- def declared_html_encoding(self):
-diff --git a/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/diagnose.py b/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/diagnose.py
-index 4d0b00afadd..ec417abba3a 100644
---- a/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/diagnose.py
-+++ b/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/diagnose.py
-@@ -1,7 +1,9 @@
- """Diagnostic functions, mainly for use when doing tech support."""
-+from __future__ import absolute_import
-+from __future__ import print_function
- import cProfile
- from StringIO import StringIO
--from HTMLParser import HTMLParser
-+from six.moves.html_parser import HTMLParser
- import bs4
- from bs4 import BeautifulSoup, __version__
- from bs4.builder import builder_registry
-@@ -14,11 +16,13 @@ import time
- import traceback
- import sys
- import cProfile
-+from six.moves import map
-+from six.moves import range
-
- def diagnose(data):
- """Diagnostic suite for isolating common problems."""
-- print "Diagnostic running on Beautiful Soup %s" % __version__
-- print "Python version %s" % sys.version
-+ print("Diagnostic running on Beautiful Soup %s" % __version__)
-+ print("Python version %s" % sys.version)
-
- basic_parsers = ["html.parser", "html5lib", "lxml"]
- for name in basic_parsers:
-@@ -27,44 +31,44 @@ def diagnose(data):
- break
- else:
- basic_parsers.remove(name)
-- print (
-+ print((
- "I noticed that %s is not installed. Installing it may help." %
-- name)
-+ name))
-
- if 'lxml' in basic_parsers:
- basic_parsers.append(["lxml", "xml"])
- from lxml import etree
-- print "Found lxml version %s" % ".".join(map(str,etree.LXML_VERSION))
-+ print("Found lxml version %s" % ".".join(map(str,etree.LXML_VERSION)))
-
- if 'html5lib' in basic_parsers:
- import html5lib
-- print "Found html5lib version %s" % html5lib.__version__
-+ print("Found html5lib version %s" % html5lib.__version__)
-
- if hasattr(data, 'read'):
- data = data.read()
- elif os.path.exists(data):
-- print '"%s" looks like a filename. Reading data from the file.' % data
-+ print('"%s" looks like a filename. Reading data from the file.' % data)
- data = open(data).read()
- elif data.startswith("http:") or data.startswith("https:"):
-- print '"%s" looks like a URL. Beautiful Soup is not an HTTP client.' % data
-- print "You need to use some other library to get the document behind the URL, and feed that document to Beautiful Soup."
-+ print('"%s" looks like a URL. Beautiful Soup is not an HTTP client.' % data)
-+ print("You need to use some other library to get the document behind the URL, and feed that document to Beautiful Soup.")
- return
-- print
-+ print()
-
- for parser in basic_parsers:
-- print "Trying to parse your markup with %s" % parser
-+ print("Trying to parse your markup with %s" % parser)
- success = False
- try:
- soup = BeautifulSoup(data, parser)
- success = True
-- except Exception, e:
-- print "%s could not parse the markup." % parser
-+ except Exception as e:
-+ print("%s could not parse the markup." % parser)
- traceback.print_exc()
- if success:
-- print "Here's what %s did with the markup:" % parser
-- print soup.prettify()
-+ print("Here's what %s did with the markup:" % parser)
-+ print(soup.prettify())
-
-- print "-" * 80
-+ print("-" * 80)
-
- def lxml_trace(data, html=True, **kwargs):
- """Print out the lxml events that occur during parsing.
-@@ -74,7 +78,7 @@ def lxml_trace(data, html=True, **kwargs):
- """
- from lxml import etree
- for event, element in etree.iterparse(StringIO(data), html=html, **kwargs):
-- print("%s, %4s, %s" % (event, element.tag, element.text))
-+ print(("%s, %4s, %s" % (event, element.tag, element.text)))
-
- class AnnouncingParser(HTMLParser):
- """Announces HTMLParser parse events, without doing anything else."""
-@@ -156,9 +160,9 @@ def rdoc(num_elements=1000):
-
- def benchmark_parsers(num_elements=100000):
- """Very basic head-to-head performance benchmark."""
-- print "Comparative parser benchmark on Beautiful Soup %s" % __version__
-+ print("Comparative parser benchmark on Beautiful Soup %s" % __version__)
- data = rdoc(num_elements)
-- print "Generated a large invalid HTML document (%d bytes)." % len(data)
-+ print("Generated a large invalid HTML document (%d bytes)." % len(data))
-
- for parser in ["lxml", ["lxml", "html"], "html5lib", "html.parser"]:
- success = False
-@@ -167,24 +171,24 @@ def benchmark_parsers(num_elements=100000):
- soup = BeautifulSoup(data, parser)
- b = time.time()
- success = True
-- except Exception, e:
-- print "%s could not parse the markup." % parser
-+ except Exception as e:
-+ print("%s could not parse the markup." % parser)
- traceback.print_exc()
- if success:
-- print "BS4+%s parsed the markup in %.2fs." % (parser, b-a)
-+ print("BS4+%s parsed the markup in %.2fs." % (parser, b-a))
-
- from lxml import etree
- a = time.time()
- etree.HTML(data)
- b = time.time()
-- print "Raw lxml parsed the markup in %.2fs." % (b-a)
-+ print("Raw lxml parsed the markup in %.2fs." % (b-a))
-
- import html5lib
- parser = html5lib.HTMLParser()
- a = time.time()
- parser.parse(data)
- b = time.time()
-- print "Raw html5lib parsed the markup in %.2fs." % (b-a)
-+ print("Raw html5lib parsed the markup in %.2fs." % (b-a))
-
- def profile(num_elements=100000, parser="lxml"):
-
-diff --git a/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/element.py b/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/element.py
-index da9afdf48ec..bda27c3e9c9 100644
---- a/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/element.py
-+++ b/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/element.py
-@@ -1,8 +1,11 @@
-+from __future__ import absolute_import
-+from __future__ import print_function
- import collections
- import re
- import sys
- import warnings
- from bs4.dammit import EntitySubstitution
-+import six
-
- DEFAULT_OUTPUT_ENCODING = "utf-8"
- PY3K = (sys.version_info[0] > 2)
-@@ -21,22 +24,22 @@ def _alias(attr):
- return alias
-
-
--class NamespacedAttribute(unicode):
-+class NamespacedAttribute(six.text_type):
-
- def __new__(cls, prefix, name, namespace=None):
- if name is None:
-- obj = unicode.__new__(cls, prefix)
-+ obj = six.text_type.__new__(cls, prefix)
- elif prefix is None:
- # Not really namespaced.
-- obj = unicode.__new__(cls, name)
-+ obj = six.text_type.__new__(cls, name)
- else:
-- obj = unicode.__new__(cls, prefix + ":" + name)
-+ obj = six.text_type.__new__(cls, prefix + ":" + name)
- obj.prefix = prefix
- obj.name = name
- obj.namespace = namespace
- return obj
-
--class AttributeValueWithCharsetSubstitution(unicode):
-+class AttributeValueWithCharsetSubstitution(six.text_type):
- """A stand-in object for a character encoding specified in HTML."""
-
- class CharsetMetaAttributeValue(AttributeValueWithCharsetSubstitution):
-@@ -47,7 +50,7 @@ class CharsetMetaAttributeValue(AttributeValueWithCharsetSubstitution):
- """
-
- def __new__(cls, original_value):
-- obj = unicode.__new__(cls, original_value)
-+ obj = six.text_type.__new__(cls, original_value)
- obj.original_value = original_value
- return obj
-
-@@ -70,9 +73,9 @@ class ContentMetaAttributeValue(AttributeValueWithCharsetSubstitution):
- match = cls.CHARSET_RE.search(original_value)
- if match is None:
- # No substitution necessary.
-- return unicode.__new__(unicode, original_value)
-+ return six.text_type.__new__(six.text_type, original_value)
-
-- obj = unicode.__new__(cls, original_value)
-+ obj = six.text_type.__new__(cls, original_value)
- obj.original_value = original_value
- return obj
-
-@@ -272,7 +275,7 @@ class PageElement(object):
- def insert(self, position, new_child):
- if new_child is self:
- raise ValueError("Cannot insert a tag into itself.")
-- if (isinstance(new_child, basestring)
-+ if (isinstance(new_child, six.string_types)
- and not isinstance(new_child, NavigableString)):
- new_child = NavigableString(new_child)
-
-@@ -489,7 +492,7 @@ class PageElement(object):
- result = (element for element in generator
- if isinstance(element, Tag))
- return ResultSet(strainer, result)
-- elif isinstance(name, basestring):
-+ elif isinstance(name, six.string_types):
- # Optimization to find all tags with a given name.
- result = (element for element in generator
- if isinstance(element, Tag)
-@@ -640,7 +643,7 @@ class PageElement(object):
- return self.parents
-
-
--class NavigableString(unicode, PageElement):
-+class NavigableString(six.text_type, PageElement):
-
- PREFIX = ''
- SUFFIX = ''
-@@ -653,15 +656,15 @@ class NavigableString(unicode, PageElement):
- passed in to the superclass's __new__ or the superclass won't know
- how to handle non-ASCII characters.
- """
-- if isinstance(value, unicode):
-- return unicode.__new__(cls, value)
-- return unicode.__new__(cls, value, DEFAULT_OUTPUT_ENCODING)
-+ if isinstance(value, six.text_type):
-+ return six.text_type.__new__(cls, value)
-+ return six.text_type.__new__(cls, value, DEFAULT_OUTPUT_ENCODING)
-
- def __copy__(self):
- return self
-
- def __getnewargs__(self):
-- return (unicode(self),)
-+ return (six.text_type(self),)
-
- def __getattr__(self, attr):
- """text.string gives you text. This is for backwards
-@@ -1025,8 +1028,8 @@ class Tag(PageElement):
- else:
- if isinstance(val, list) or isinstance(val, tuple):
- val = ' '.join(val)
-- elif not isinstance(val, basestring):
-- val = unicode(val)
-+ elif not isinstance(val, six.string_types):
-+ val = six.text_type(val)
- elif (
- isinstance(val, AttributeValueWithCharsetSubstitution)
- and eventual_encoding is not None):
-@@ -1034,7 +1037,7 @@ class Tag(PageElement):
-
- text = self.format_string(val, formatter)
- decoded = (
-- unicode(key) + '='
-+ six.text_type(key) + '='
- + EntitySubstitution.quoted_attribute_value(text))
- attrs.append(decoded)
- close = ''
-@@ -1210,16 +1213,16 @@ class Tag(PageElement):
- raise ValueError(
- 'Final combinator "%s" is missing an argument.' % tokens[-1])
- if self._select_debug:
-- print 'Running CSS selector "%s"' % selector
-+ print('Running CSS selector "%s"' % selector)
- for index, token in enumerate(tokens):
- if self._select_debug:
-- print ' Considering token "%s"' % token
-+ print(' Considering token "%s"' % token)
- recursive_candidate_generator = None
- tag_name = None
- if tokens[index-1] in self._selector_combinators:
- # This token was consumed by the previous combinator. Skip it.
- if self._select_debug:
-- print ' Token was consumed by the previous combinator.'
-+ print(' Token was consumed by the previous combinator.')
- continue
- # Each operation corresponds to a checker function, a rule
- # for determining whether a candidate matches the
-@@ -1325,14 +1328,14 @@ class Tag(PageElement):
- next_token = tokens[index+1]
- def recursive_select(tag):
- if self._select_debug:
-- print ' Calling select("%s") recursively on %s %s' % (next_token, tag.name, tag.attrs)
-- print '-' * 40
-+ print(' Calling select("%s") recursively on %s %s' % (next_token, tag.name, tag.attrs))
-+ print('-' * 40)
- for i in tag.select(next_token, recursive_candidate_generator):
- if self._select_debug:
-- print '(Recursive select picked up candidate %s %s)' % (i.name, i.attrs)
-+ print('(Recursive select picked up candidate %s %s)' % (i.name, i.attrs))
- yield i
- if self._select_debug:
-- print '-' * 40
-+ print('-' * 40)
- _use_candidate_generator = recursive_select
- elif _candidate_generator is None:
- # By default, a tag's candidates are all of its
-@@ -1343,7 +1346,7 @@ class Tag(PageElement):
- check = "[any]"
- else:
- check = tag_name
-- print ' Default candidate generator, tag name="%s"' % check
-+ print(' Default candidate generator, tag name="%s"' % check)
- if self._select_debug:
- # This is redundant with later code, but it stops
- # a bunch of bogus tags from cluttering up the
-@@ -1365,8 +1368,8 @@ class Tag(PageElement):
- new_context_ids = set([])
- for tag in current_context:
- if self._select_debug:
-- print " Running candidate generator on %s %s" % (
-- tag.name, repr(tag.attrs))
-+ print(" Running candidate generator on %s %s" % (
-+ tag.name, repr(tag.attrs)))
- for candidate in _use_candidate_generator(tag):
- if not isinstance(candidate, Tag):
- continue
-@@ -1381,21 +1384,21 @@ class Tag(PageElement):
- break
- if checker is None or result:
- if self._select_debug:
-- print " SUCCESS %s %s" % (candidate.name, repr(candidate.attrs))
-+ print(" SUCCESS %s %s" % (candidate.name, repr(candidate.attrs)))
- if id(candidate) not in new_context_ids:
- # If a tag matches a selector more than once,
- # don't include it in the context more than once.
- new_context.append(candidate)
- new_context_ids.add(id(candidate))
- elif self._select_debug:
-- print " FAILURE %s %s" % (candidate.name, repr(candidate.attrs))
-+ print(" FAILURE %s %s" % (candidate.name, repr(candidate.attrs)))
-
- current_context = new_context
-
- if self._select_debug:
-- print "Final verdict:"
-+ print("Final verdict:")
- for i in current_context:
-- print " %s %s" % (i.name, i.attrs)
-+ print(" %s %s" % (i.name, i.attrs))
- return current_context
-
- # Old names for backwards compatibility
-@@ -1448,7 +1451,7 @@ class SoupStrainer(object):
- def _normalize_search_value(self, value):
- # Leave it alone if it's a Unicode string, a callable, a
- # regular expression, a boolean, or None.
-- if (isinstance(value, unicode) or callable(value) or hasattr(value, 'match')
-+ if (isinstance(value, six.text_type) or callable(value) or hasattr(value, 'match')
- or isinstance(value, bool) or value is None):
- return value
-
-@@ -1461,7 +1464,7 @@ class SoupStrainer(object):
- new_value = []
- for v in value:
- if (hasattr(v, '__iter__') and not isinstance(v, bytes)
-- and not isinstance(v, unicode)):
-+ and not isinstance(v, six.text_type)):
- # This is almost certainly the user's mistake. In the
- # interests of avoiding infinite loops, we'll let
- # it through as-is rather than doing a recursive call.
-@@ -1473,7 +1476,7 @@ class SoupStrainer(object):
- # Otherwise, convert it into a Unicode string.
- # The unicode(str()) thing is so this will do the same thing on Python 2
- # and Python 3.
-- return unicode(str(value))
-+ return six.text_type(str(value))
-
- def __str__(self):
- if self.text:
-@@ -1527,7 +1530,7 @@ class SoupStrainer(object):
- found = None
- # If given a list of items, scan it for a text element that
- # matches.
-- if hasattr(markup, '__iter__') and not isinstance(markup, (Tag, basestring)):
-+ if hasattr(markup, '__iter__') and not isinstance(markup, (Tag, six.string_types)):
- for element in markup:
- if isinstance(element, NavigableString) \
- and self.search(element):
-@@ -1540,7 +1543,7 @@ class SoupStrainer(object):
- found = self.search_tag(markup)
- # If it's text, make sure the text matches.
- elif isinstance(markup, NavigableString) or \
-- isinstance(markup, basestring):
-+ isinstance(markup, six.string_types):
- if not self.name and not self.attrs and self._matches(markup, self.text):
- found = markup
- else:
-@@ -1554,7 +1557,7 @@ class SoupStrainer(object):
- if isinstance(markup, list) or isinstance(markup, tuple):
- # This should only happen when searching a multi-valued attribute
- # like 'class'.
-- if (isinstance(match_against, unicode)
-+ if (isinstance(match_against, six.text_type)
- and ' ' in match_against):
- # A bit of a special case. If they try to match "foo
- # bar" on a multivalue attribute's value, only accept
-@@ -1589,7 +1592,7 @@ class SoupStrainer(object):
- # None matches None, False, an empty string, an empty list, and so on.
- return not match_against
-
-- if isinstance(match_against, unicode):
-+ if isinstance(match_against, six.text_type):
- # Exact string match
- return markup == match_against
-
-diff --git a/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/testing.py b/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/testing.py
-index fd4495ac58c..4d94c392373 100644
---- a/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/testing.py
-+++ b/chromium/third_party/catapult/third_party/beautifulsoup4/bs4/testing.py
-@@ -1,5 +1,6 @@
- """Helper classes for tests."""
-
-+from __future__ import absolute_import
- import copy
- import functools
- import unittest
-@@ -14,6 +15,7 @@ from bs4.element import (
- )
-
- from bs4.builder import HTMLParserTreeBuilder
-+import six
- default_builder = HTMLParserTreeBuilder
-
-
-@@ -501,7 +503,7 @@ class XMLTreeBuilderSmokeTest(object):
- markup = '