Meta: Make CI enforce doctype in test cases #3456
Open
+1,598
−594
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This makes it mandatory for test cases to include a doctype declaration at the beginning of the file.
Specific tests can be made exempt via a hard-coded list in the python file for the test.
All imported web platform tests are automatically exempt, as we do not have control over those.
Motivated by having to rebase #3271 every few days when someone forgets to add a doctype on a new test case.
Methodology
About 950 tests needed to have a doctype fixed or added.
Tests that clearly indicated quirks mode (in their file name or with a
<!-- quirks mode -->
comment or similar) have received a<!DOCTYPE quirks>
.Some tests already had a doctype but it was preceded by an issue link comment or similar. In those cases I just moved the doctype up, above the comment.
One test just had
<!doctype>
, which I just converted to<!doctype html>
since it did not expect quirks mode.All other tests have received a
<!DOCTYPE html>
.Two tests had encodings that the python file reader did not like. I excluded those from this requirement and left them as-is.
One screenshot test technically needed rebaselining, but I wasn't sure how to, so I put a
<DOCTYPE quirks>
, followed by a FIXME comment that the test should ideally be converted to standards mode at some point.About 250 layout tests were simply rebaselined without manual verification, since the html and body elements shrink from being 100% tall, to the height of their contents when switch to standards mode.
I assume that this does not impact the tests as the rest of the layout should behave the same / in an equivalent manner.
The remaining non-layout tests were manually checked and fixed/rebaselined.