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

Doesn't work on legacy HTML documents #3

Open
CITguy opened this issue Mar 30, 2019 · 1 comment
Open

Doesn't work on legacy HTML documents #3

CITguy opened this issue Mar 30, 2019 · 1 comment

Comments

@CITguy
Copy link
Owner

CITguy commented Mar 30, 2019

Specifically, it doesn't apply correctly to documents with a declared doctype that doesn't support CSS (e.g., HTML 3).

For example:
We can't reliably apply filter: grayscale(100%); if the document relies on text, bgcolor, or similar stylistic attributes used in HTML 3 or older.

Maybe provide a warning when toggling that the doctype is too old to reliably function.

@CITguy
Copy link
Owner Author

CITguy commented Mar 30, 2019

Doctype Reference

HTML 5 (and beyond)

<!DOCTYPE html>
  • OK - I've high confidence that the vast majority of pages with this doctype are using CSS instead of stylistic attributes.

XHTML 1.0 Strict

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  • OK - DTD doesn't support stylistic attributes

XHTML 1.0 Transitional

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  • WARN - DTD supports old stylistic attributes
    • <body> color attributes: text, link, vlink, alink, bgcolor
    • elements supporting bgcolor attribute: <table>, <tr>, <th>, <td>

XHTML 1.0 Frameset

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
  • WARN - Same as XHTML 1.0 Transitional

XHTML 1.1

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  • OK - Same as XHTML 1.0 strict

XHTML 1.1 Basic

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">
  • OK - Same as XHTML 1.0 Strict

HTML 4.01 Strict

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  • OK - DTD doesn't support stylistic attributes

HTML 4.01 Transitional

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  • WARN - DTD supports stylistic attributes
    • <body> color attributes: text, link, vlink, alink, and bgcolor (%bodycolors DTD entity)
    • bgcolor attribute: <table>, <tr>, <th>, <td>

HTML 4.01 Frameset

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
  • WARN - Identical to HTML 4.01 Transitional

Conclusion

OK

  • XHTML 1.0 Strict
  • XHTML 1.1 (any)
  • HTML 4.01 Strict
  • HTML 5

WARN

  • XHTML 1.0 Transitional and Frameset
  • HTML 4.01 Transitional and Frameset
  • SVG
  • MathML

UNSUPPORTED

  • HTML 3 (or older)

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

No branches or pull requests

1 participant