tmedwards / sugarcube-2

SugarCube is a free (gratis and libre) story format for Twine/Twee.
https://www.motoslave.net/sugarcube/2/
BSD 2-Clause "Simplified" License
177 stars 41 forks source link

Make SugarCube CSS1Compat compliant in Firefox #120

Closed Arkerthan closed 3 years ago

Arkerthan commented 3 years ago

Is your feature request related to a problem? Currently SugarCube games run in BackCompat/Quirks mode in Firefox (on Chromium they run in CSS1Compat mode). While this does not create problems itself many modern libraries expect to run in CSS1mode (For example Popper.js, where some placement options require CSS1Compat to work properly.)

SugarCube already has <!DOCTYPE html> specified, but something else seems to override it.

To see the mode the page is rendered in, type document.compatMode in the Browser Console.

Describe the solution you'd like. SugarCube games run in CSS1Compat mode

Describe alternatives you've considered. Interestingly, removing the line <meta charset="UTF-8" /> from the compiled HTML file makes Firefox run in CSS1Compat mode, though it generates an error about the missing encoding declaration, does support the thesis that something else breaks CSS1Compat mode though.

Additional context. Firefox 88.0

tmedwards commented 3 years ago

By default SugarCube v2 runs in CSS1Compat mode in every browser I test it in. From obsolete browsers like Opera 12 (Presto) to the latest mainstream browsers, including Firefox (as seen below).

image image

Arkerthan commented 3 years ago

Thanks for the confirmation.

Turns out it's probably a specific combination of plugins and something SugerCube/our game does that makes Firefox fall back to BackCompat mode.