You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can't distinguish HTML and non-HTML documents in UA stylesheets #44886
In some cases certain UA style rules are only expected to apply on HTML documents.
For example in https://html.spec.whatwg.org/multipage/rendering.html#tables-2, the spec expects the :is(table, thead, tbody, tfoot, tr) > form { display: none !important; } rule to only apply on HTML documents.
However, there isn't currently any way to distinguish between HTML and non-HTML documents in stylesheets, as such it is impossible to currently apply this rule. This means that either one of the /html/rendering/non-replaced-elements/tables/form-in-tables{-xhtml.xhtml, .html} WPT tests fail (the XHTML tests since #44837).
I don't know if there is some reason not to do that, but it does appear a lot simpler than having a separate pseudo-class. As far as I can find, it appears that the only use of the :-moz-is-html is the above different handling of forms in a table, so it unclear why Gecko has this, as an extra stylesheet would indeed seemingly to make more sense.
Activity
simonwuelker commentedon May 13, 2026
Would it make sense to simply include different UA stylesheets for HTML and XML documents?
avis137 commentedon May 13, 2026
I don't know if there is some reason not to do that, but it does appear a lot simpler than having a separate pseudo-class. As far as I can find, it appears that the only use of the
:-moz-is-htmlis the above different handling of forms in a table, so it unclear why Gecko has this, as an extra stylesheet would indeed seemingly to make more sense.layout: Only apply form in table UA style rule in HTML documents (ser…