transition patch is redundant in Chrome 93+

This commit is contained in:
tophf 2022-03-08 23:38:51 +03:00
parent 619f771b4a
commit 614dce0e8c
3 changed files with 14 additions and 9 deletions

View File

@ -15,7 +15,7 @@ window.StyleInjector = window.INJECTED === 1 ? window.StyleInjector : ({
const list = [];
const table = new Map();
let isEnabled = true;
let isTransitionPatched;
let isTransitionPatched = chrome.app && CSS.supports('accent-color', 'red'); // Chrome 93
let exposeStyleName;
// will store the original method refs because the page can override them
let creationDoc, createElement, createElementNS;

View File

@ -1,9 +1,12 @@
html#stylus #header *:not(#\1transition-suppressor) {
@supports not (accent-color: red) {
/* This suppresses a bug in all? browsers: they apply transitions during page load.
* It was fixed by crrev.com/886802 in Chrome 93, which we detect via `accent-color`.
* Using an increased specificity to override sane selectors in user styles.
* Using \1 to simplify js code because \0 is converted to \xFFFD per spec. */
html#stylus #header *:not(#\1transition-suppressor) {
transition: none !important;
}
}
:root {
--family: Arial, "Helvetica Neue", Helvetica, system-ui, sans-serif;
--input-height: 22px;

View File

@ -1,5 +1,5 @@
/* global $$ $ $create focusAccessibility getEventKeyName moveFocus */// dom.js
/* global clamp debounce */// toolbox.js
/* global CHROME clamp debounce */// toolbox.js
/* global msg */
/* global t */// localization.js
'use strict';
@ -24,13 +24,15 @@
}
});
// Removing transition-suppressor rule
if (!CHROME || CHROME < 93) {
const {sheet} = $('link[href$="global.css"]');
for (let i = 0, rule; (rule = sheet.cssRules[i]); i++) {
if (/#\\1\s?transition-suppressor/.test(rule.selectorText)) {
if (/#\\1\s?transition-suppressor/.test(rule.cssText)) {
sheet.deleteRule(i);
break;
}
}
}
function changeFocusedInputOnWheel(event) {
const el = document.activeElement;