Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meta: Make CI enforce doctype in test cases #3456

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Psychpsyo
Copy link
Contributor

@Psychpsyo Psychpsyo commented Feb 4, 2025

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.

@Psychpsyo Psychpsyo force-pushed the force-doctype-on-tests branch from 2b6bc92 to e105db1 Compare February 5, 2025 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant