Skip to content

Conversation

@YeongseoYoon
Copy link

This PR adds tests to verify the behavior of DOCTYPE system identifier handling for quirks mode determination.

Related Issue

Summary

The HTML spec currently distinguishes between a missing system identifier and an empty string ("") system identifier. However, Chromium and WebKit treat both cases identically (as quirks mode triggers).

Test Cases

DOCTYPE Public ID System ID Expected compatMode
-//W3C//DTD HTML 4.01 Frameset// "" (empty) BackCompat
-//W3C//DTD HTML 4.01 Frameset// missing BackCompat
-//W3C//DTD HTML 4.01 Frameset// non-empty CSS1Compat
-//W3C//DTD HTML 4.01 Transitional// "" (empty) BackCompat
-//W3C//DTD HTML 4.01 Transitional// missing BackCompat
-//W3C//DTD HTML 4.01 Transitional// non-empty CSS1Compat

Expected Results

Browser Result
Chrome ✅ 6/6 PASS
Safari ✅ 6/6 PASS
Firefox 4/6 PASS, 2 FAIL (empty cases fail - follows current spec)

Test Results Screenshots

Chrome

image

Safari

image

Firefox

image

Files Added

  • html/syntax/parsing/doctype-system-identifier-distinction.html - Main test file
  • html/syntax/parsing/support/doctype-system-id-empty-frameset.html
  • html/syntax/parsing/support/doctype-system-id-empty-transitional.html
  • html/syntax/parsing/support/doctype-system-id-missing-frameset.html
  • html/syntax/parsing/support/doctype-system-id-missing-transitional.html
  • html/syntax/parsing/support/doctype-system-id-nonempty-frameset.html
  • html/syntax/parsing/support/doctype-system-id-nonempty-transitional.html

This adds tests to verify that an empty DOCTYPE system identifier
is treated the same as a missing one for quirks mode determination,
aligning with Chromium and WebKit behavior.

Tests:
- Frameset/Transitional + empty system ID → quirks mode
- Frameset/Transitional + missing system ID → quirks mode
- Frameset/Transitional + non-empty system ID → limited-quirks mode

See whatwg/html#12023
Copy link
Member

@zcorpan zcorpan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but the spec should be changed before landing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants