﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
30468	assertHTMLEqual doesn't account for all ASCII whitespace in a class attribute.	Jon Dufresne	nobody	"From https://html.spec.whatwg.org/#classes

> When specified on HTML elements, the class attribute must have a value that is a set of space-separated tokens representing the various classes that the element belongs to.

And ""space-separated tokens"" is defined as:

https://html.spec.whatwg.org/#set-of-space-separated-tokens

> A set of space-separated tokens is a string containing zero or more words (known as tokens) separated by one or more ASCII whitespace, where words consist of any string of one or more characters, none of which are ASCII whitespace.

And ""ASCII whitespace"" is defined as:

https://infra.spec.whatwg.org/#ascii-whitespace

> ASCII whitespace is U+0009 TAB, U+000A LF, U+000C FF, U+000D CR, or U+0020 SPACE.

The current implementation (copied and linked below) only accounts for a single space. Not all consecutive ASCII whitespace.


https://github.com/django/django/blob/48235ba807483fe349d2dc66aaeddc0d03f8b0d4/django/test/html.py#L180-L187

{{{
        # Special case handling of 'class' attribute, so that comparisons of DOM
        # instances are not sensitive to ordering of classes.
        attrs = [
            (name, "" "".join(sorted(value.split("" ""))))
            if name == ""class""
            else (name, value)
            for name, value in attrs
        ]
}}}
"	Bug	closed	Testing framework	dev	Normal	fixed			Ready for checkin	1	0	0	0	0	0
