[14:49:43] subbu: I'm surprised CI passes here. Do we have some kind of attribute order tolerance nowadays? https://gerrit.wikimedia.org/r/1319860 [14:49:59] It is essentially reverting (unintentionally) part of https://gerrit.wikimedia.org/r/1319561 [15:06:13] order of attributes is unimportant semantically .. so yes, we do have normalization that ignores attribute order. [15:06:20] why do we care about attribute order though? [15:07:08] we would occassionally have patches that had to go and mess with a whole bunch of parser tests because some attribute orders changed because of some code paths changing. [15:07:24] finally, we got tired and implemented normalization .. scott did i am not mistaken. [15:09:33] we have a lot of parser tests across a number of files and it gets annoying to update tests for stuff like that. [15:13:03] https://github.com/wikimedia/mediawiki-services-parsoid/blob/1d04ec9b526126628019761b1f54b9ab94f61b05/src/ParserTests/TestUtils.php#L67-L445 is the test normalization code we have. [15:13:47] https://github.com/wikimedia/mediawiki-services-parsoid/blob/1d04ec9b526126628019761b1f54b9ab94f61b05/src/ParserTests/TestUtils.php#L118-L119 is the attribute order normalization [15:14:26] I see. cool. [15:14:44] but, do you disagree? :-) [15:15:04] No, tolerating order change is fine. I think separate from that there can be a preferred order, but not worth enforcing in CI. [15:15:25] Having them be consistent and presenting class first in the DOM as seen in browser devtools and such has some marginal value. [15:16:32] It surprised me because the day before I proactively synced the test and source together, under the impression that it was required for it to pass. I didn't bother trying first with the "wrong" value to see if it passed also. The interaction succeed and so confirmed my assumption :) [15:16:50] Sure, but, as I said .. depending on which parts of the code run when, attributes might be rendered in different order unless we enforce an alphabetical order or some canonical order during serialization ... we could consider that if it is important, but yes, CI shouldn't bother. [15:17:38] on the core side, i don't think there is any normalization, but parsoid has had normalization since pretty much the early days and we've tweaked and updated as necessary over time. [15:24:22] We've talked about using some ordering mechanism during serialization in the past, but never bothered to implement it ... that might address the issue of consistent ordering for the marginal value it does have (which it does simply because it eliminates some friction if we are looking at html source often .. which we do during debugging). [15:28:20] Filed https://phabricator.wikimedia.org/T433715 to record this. [15:46:48] ack