[wp-trac] [WordPress Trac] #61102: Tests: Html5lib-tests context tag needs to be reset

WordPress Trac noreply at wordpress.org
Tue Apr 30 16:20:39 UTC 2024


#61102: Tests: Html5lib-tests context tag needs to be reset
------------------------------+-----------------------------
 Reporter:  jonsurrell        |      Owner:  jonsurrell
     Type:  defect (bug)      |     Status:  assigned
 Priority:  normal            |  Milestone:  Awaiting Review
Component:  Build/Test Tools  |    Version:  trunk
 Severity:  normal            |   Keywords:
  Focuses:                    |
------------------------------+-----------------------------
 The html5lib-tests suite parses tests from a number of files with a
 specific data format. It uses a dataProvider in a loop that yields test
 information. This relies on some variables being reset on each iteration.
 The context element is not properly reset on each iteration.

 [https://github.com/html5lib/html5lib-
 tests/blob/a9f44960a9fedf265093d22b2aa3c7ca123727b9/tree-
 construction/README.md The test specification describes the context
 element as follows:]

 > Then there *may* be a line that says "#document-fragment", which must be
 followed by a newline (LF), followed by a string of characters that
 indicates the context element, followed by a newline (LF). If the string
 of characters starts with "svg ", the context element is in the SVG
 namespace and the substring after "svg " is the local name. If the string
 of characters starts with "math ", the context element is in the MathML
 namespace and the substring after "math " is the local name. Otherwise,
 the context element is in the HTML namespace and the string is the local
 name. If this line is present the "#data" must be parsed using the HTML
 fragment parsing algorithm with the context element as context.

 Without the proper reset of this value, a single context element would
 change subsequent tests, breaking the test suite.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61102>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list