⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 276128 in webkit


Ignore:
Timestamp:
Apr 16, 2021, 2:04:23 AM (5 years ago)
Author:
Manuel Rego Casasnovas
Message:

Avoid converting HTML chars in _W3CTestConverter
https://bugs.webkit.org/show_bug.cgi?id=224658

Reviewed by Adrian Perez de Castro.

There has been a change in Python HTMLParser in version 3.5 that makes convert_charrefs to be True by default:
https://docs.python.org/3/library/html.parser.html

This is causing that we're modifying the tests that have HTML characters, which is something
we shouldn't change and was not happening in previous Python 3 versions, or Python 2.

  • Scripts/webkitpy/w3c/test_converter.py:

(_W3CTestConverter.init): Set convert_charrefs to False.

  • Scripts/webkitpy/w3c/test_converter_unittest.py: Update test to include HTML chars and check that they're not modified.
Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r276125 r276128  
     12021-04-16  Manuel Rego Casasnovas  <rego@igalia.com>
     2
     3        Avoid converting HTML chars in _W3CTestConverter
     4        https://bugs.webkit.org/show_bug.cgi?id=224658
     5
     6        Reviewed by Adrian Perez de Castro.
     7
     8        There has been a change in Python HTMLParser in version 3.5 that makes convert_charrefs to be True by default:
     9        https://docs.python.org/3/library/html.parser.html
     10
     11        This is causing that we're modifying the tests that have HTML characters, which is something
     12        we shouldn't change and was not happening in previous Python 3 versions, or Python 2.
     13
     14        * Scripts/webkitpy/w3c/test_converter.py:
     15        (_W3CTestConverter.__init__): Set convert_charrefs to False.
     16        * Scripts/webkitpy/w3c/test_converter_unittest.py: Update test to include HTML chars and check that they're not modified.
     17
    1182021-04-16  Youenn Fablet  <youenn@apple.com>
    219
  • trunk/Tools/Scripts/webkitpy/w3c/test_converter.py

    r273057 r276128  
    6767class _W3CTestConverter(HTMLParser):
    6868    def __init__(self, new_path, filename, reference_support_info, host=Host(), convert_test_harness_links=True, webkit_test_runner_options=''):
    69         HTMLParser.__init__(self)
     69        if sys.version_info > (3, 0):
     70            HTMLParser.__init__(self, convert_charrefs=False)
     71        else:
     72            HTMLParser.__init__(self)
    7073
    7174        self._host = host
  • trunk/Tools/Scripts/webkitpy/w3c/test_converter_unittest.py

    r273057 r276128  
    8181<body>
    8282CONTENT OF TEST
     83&lt;We shouldn't convert HTML characters.&gt;
    8384</body>
    8485</html>
Note: See TracChangeset for help on using the changeset viewer.