construct-stylesheets
construct-stylesheets copied to clipboard
Need to define quirks mode interactions for constructable stylesheets
Stylesheet parsing is affected by quirks mode. Should constructable stylesheets always be parsed in standards mode? Should they pick up the quirks mode of a document (which)?
@tabatkins @annevk @domenic @rakina
Definitely always Standards mode; I see no reason to further expose quirks mode.
I agree.
(Note that the mismatch of document and style sheet quirks mode can already be done using the Link header and document.open(). It's a little unclear if all the specifications are clear on which quirks mode they mean though.)
cc @zcorpan
Also agree with @tabatkins
Fwiw, I also think they should always be standards mode. We just need to specify this.
How do we define that? Just add "in no-quirks mode" to the end of "Parse a stylesheet from text"?
Good question. There's no actual entrypoint to stylesheet parsing that takes a mode as an argument, and the quirks mode bits are comefrom-monkeypatched in by https://quirks.spec.whatwg.org/#the-hashless-hex-color-quirk and https://quirks.spec.whatwg.org/#the-unitless-length-quirk
Maybe the right thing for now is to just add text to the ends of those sections (akin to the existing "must apply" and "must not be supported" bits). Sort of up to @tabatkins and @zcorpan who maintain the relevant specs how they think this should best be done.
I'd be happy to have this more explicit as a flag on the stylesheet or so and use that in the quirks standard. @tabatkins ?
How much of the Web still uses quirks mode?
Wouldn't it make sense to discourage its use by disabling the new features when rendering in quirks mode (as in, either don't provide the APIs, or provide them, but throw on call/getter access)?
It would reduce the accidental use of quirks mode in new pages/apps, and would not break Web CompatTM.
@pygy 4.85% of httparchive https://twitter.com/zcorpan/status/1205242913908838400
Disabling or changing features in quirks mode is effectively adding more quirks. In the past, we have instead tried to remove quirks to reduce complexity in the implementation.
Feel free to create a new issue in https://github.com/whatwg/quirks if you'd like to discuss the idea more.
How much of the Web still uses quirks mode?
A ton, because about:blank is in quirks mode and lots of sites create blank iframes and then add content to them...