suppress transition bug on page open in Chrome, too (#1193)

This commit is contained in:
tophf 2021-02-28 23:01:49 +03:00 committed by GitHub
parent 4228758cec
commit 102121ad8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 44 deletions

View File

@ -4,18 +4,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="global.css" rel="stylesheet"> <link href="global.css" rel="stylesheet">
<style id="firefox-transitions-bug-suppressor">
/* restrict to FF */
@supports (-moz-appearance:none) {
/* increased specificity to override sane selectors in user styles */
html#stylus.firefox #stylus-edit #header *,
html#stylus.firefox #stylus-edit #sections * {
transition: none !important;
}
}
</style>
<link id="cm-theme" rel="stylesheet"> <link id="cm-theme" rel="stylesheet">
<script src="js/polyfill.js"></script> <script src="js/polyfill.js"></script>

View File

@ -1,3 +1,9 @@
html#stylus #stylus-manage #header *:not(#\0) {
/* This suppresses transitions on page open.
* WARNING! Must be the first rule here so dom.js can simply call deleteRule for index 0.
* Using an increased specificity to override sane selectors in user styles */
transition: none !important;
}
body { body {
font: normal 12px Arial, system-ui, sans-serif; font: normal 12px Arial, system-ui, sans-serif;
} }

View File

@ -3,9 +3,10 @@
'use strict'; 'use strict';
/* exported /* exported
$$remove
$createLink $createLink
$isTextInput $isTextInput
$remove
$$remove
animateElement animateElement
getEventKeyName getEventKeyName
messageBoxProxy messageBoxProxy
@ -431,11 +432,13 @@ async function waitForSheet({
}); });
onDOMready().then(() => { onDOMready().then(() => {
$remove('#firefox-transitions-bug-suppressor');
debounce(addTooltipsToEllipsized, 500); debounce(addTooltipsToEllipsized, 500);
window.on('resize', () => debounce(addTooltipsToEllipsized, 100)); window.on('resize', () => debounce(addTooltipsToEllipsized, 100));
}); });
// Using `load` event as we need transition bug suppressor active until everything loads
window.on('load', () => $('link[href^="global.css"]').sheet.deleteRule(0), {once: true});
function addFaviconFF() { function addFaviconFF() {
const iconset = ['', 'light/'][prefs.get('iconset')] || ''; const iconset = ['', 'light/'][prefs.get('iconset')] || '';
for (const size of [38, 32, 19, 16]) { for (const size of [38, 32, 19, 16]) {

View File

@ -6,16 +6,6 @@
<title i18n-text="manageTitle"></title> <title i18n-text="manageTitle"></title>
<link rel="stylesheet" href="global.css"> <link rel="stylesheet" href="global.css">
<style id="firefox-transitions-bug-suppressor">
/* restrict to FF */
@supports (-moz-appearance:none) {
/* increased specificity to override sane selectors in user styles */
html#stylus.firefox #stylus-manage #header * {
transition: none !important;
}
}
</style>
<!-- Notes: <!-- Notes:
* Chrome doesn't garbage-collect (or even leaks) SVG <symbol> referenced via <use> so we'll embed the code directly * Chrome doesn't garbage-collect (or even leaks) SVG <symbol> referenced via <use> so we'll embed the code directly
* inter-tag whitespace in templates is automatically removed in localization.js * inter-tag whitespace in templates is automatically removed in localization.js

View File

@ -6,16 +6,6 @@
<title i18n-text-append="optionsHeading">Stylus </title> <title i18n-text-append="optionsHeading">Stylus </title>
<link rel="stylesheet" href="global.css"> <link rel="stylesheet" href="global.css">
<style id="firefox-transitions-bug-suppressor">
/* restrict to FF */
@supports (-moz-appearance:none) {
/* increased specificity to override sane selectors in user styles */
html#stylus.firefox #options *, #stylus #notes * {
transition: none !important;
}
}
</style>
<script src="js/polyfill.js"></script> <script src="js/polyfill.js"></script>
<script src="js/toolbox.js"></script> <script src="js/toolbox.js"></script>
<script src="js/msg.js"></script> <script src="js/msg.js"></script>

View File

@ -6,16 +6,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="global.css"> <link rel="stylesheet" href="global.css">
<style id="firefox-transitions-bug-suppressor">
/* restrict to FF */
@supports (-moz-appearance:none) {
/* increased specificity to override sane selectors in user styles */
html#stylus.firefox #stylus-popup #actions * {
transition: none !important;
}
}
</style>
<template data-id="style"> <template data-id="style">
<div class="entry"> <div class="entry">
<div class="entry-content"> <div class="entry-content">