From 3a3104b30af32f9104eab3610d1f2e812bed6e64 Mon Sep 17 00:00:00 2001 From: tophf Date: Mon, 1 Feb 2021 18:51:24 +0300 Subject: [PATCH 1/3] update parserlib * add aspect-ratio, color-adjust, forced-color-adjust * remove ar units --- js/csslint/parserlib.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/js/csslint/parserlib.js b/js/csslint/parserlib.js index 517a6dc7..e48b08fa 100644 --- a/js/csslint/parserlib.js +++ b/js/csslint/parserlib.js @@ -101,6 +101,7 @@ self.parserlib = (() => { 'push-button | hyperlink | radio | radio-button | checkbox | menu-item | tab | menu | ' + 'menubar | pull-down-menu | pop-up-menu | list-menu | radio-group | checkbox-group | ' + 'outline-tree | range | field | combo-box | signature | password | normal', + 'aspect-ratio': 'auto || [ / ]', 'azimuth': '', 'backdrop-filter': ' | none', @@ -182,6 +183,7 @@ self.parserlib = (() => { 'clip-path': ' | | none', 'clip-rule': 'nonzero | evenodd', 'color': '', + 'color-adjust': 'economy | exact', 'color-interpolation': 'auto | sRGB | linearRGB', 'color-interpolation-filters': 'auto | sRGB | linearRGB', 'color-profile': 1, @@ -284,6 +286,7 @@ self.parserlib = (() => { 'font-variant-position': 'normal | sub | super', 'font-variation-settings': 'normal | [ ]#', 'font-weight': '', + 'forced-color-adjust': 'auto | none', '-ms-flex-align': 1, '-ms-flex-order': 1, '-ms-flex-pack': 1, @@ -681,7 +684,6 @@ self.parserlib = (() => { dpcm: 'resolution', dppx: 'resolution', x: 'resolution', - ar: 'dimension', }; // Sticky `y` flag must be used in expressions used with peekTest and readMatch const rxIdentStart = /[-\\_a-zA-Z\u00A0-\uFFFF]/u; @@ -703,7 +705,6 @@ self.parserlib = (() => { !/^(unset|initial|inherit|will-change|auto|scroll-position|contents)$/i.test(p), '': p => p.type === 'angle' || p.isCalc, '': p => p.text === '0' || p.type === 'angle' || p.isCalc, - '': p => p.units && lowerCmp(p.units, 'ar'), '': vtIsAttr, '': 'scroll | fixed | local', '': ' | none', @@ -806,7 +807,7 @@ self.parserlib = (() => { const VTComplex = { '': 'normal | | | ' + - ' ? | ? ', + '? ', '': 'auto | normal | stretch | | ? ', '': @@ -917,7 +918,7 @@ self.parserlib = (() => { '': '', '': '[ | ] {2} [ / ]? | ' + '[ | ] , #{2} [ , ]?', - '': 'normal | | ? | ' + + '': 'normal | | ' + '? [ | left | right ]', '': 'auto | normal | stretch | | ? ' + '[ | left | right ]', From c41a5f92c34c92e68ad1aedc1b560603a34cf5dc Mon Sep 17 00:00:00 2001 From: tophf Date: Tue, 2 Feb 2021 00:33:41 +0300 Subject: [PATCH 2/3] preserve `dirty` after importing moz-format [v2], fixes #1163 --- edit/sections-editor.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/edit/sections-editor.js b/edit/sections-editor.js index af539415..2b4a7442 100644 --- a/edit/sections-editor.js +++ b/edit/sections-editor.js @@ -371,6 +371,7 @@ function SectionsEditor() { await initSections(sections, { replace: replaceOldStyle, focusOn: replaceOldStyle ? 0 : false, + keepDirty: true, }); helpPopup.close(); } @@ -473,6 +474,7 @@ function SectionsEditor() { async function initSections(src, { focusOn = 0, replace = false, + keepDirty = false, // used by import } = {}) { if (replace) { sections.forEach(s => s.remove(true)); @@ -505,7 +507,7 @@ function SectionsEditor() { if (si) forceRefresh = y < si.scrollY2 && (y += si.cms[i].parentHeight) > si.scrollY; insertSectionAfter(src[i], null, forceRefresh, si && si.cms[i]); setGlobalProgress(i, src.length); - dirty.clear(); + if (!keepDirty) dirty.clear(); if (i === focusOn) sections[i].cm.focus(); } if (!si) requestAnimationFrame(fitToAvailableSpace); From 24a0077783622a0c8d47f7a4c978cbbe3e3a58bd Mon Sep 17 00:00:00 2001 From: tophf Date: Thu, 28 Jan 2021 21:35:37 +0300 Subject: [PATCH 3/3] chrome bug: onCommitted is fired twice --- background/navigation-manager.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/background/navigation-manager.js b/background/navigation-manager.js index dff9c6fe..1fa4a9f0 100644 --- a/background/navigation-manager.js +++ b/background/navigation-manager.js @@ -1,4 +1,4 @@ -/* global CHROME FIREFOX URLS ignoreChromeError */// toolbox.js +/* global CHROME FIREFOX URLS deepEqual ignoreChromeError */// toolbox.js /* global bgReady */// common.js /* global msg */ 'use strict'; @@ -6,6 +6,7 @@ /* exported navMan */ const navMan = (() => { const listeners = new Set(); + let prevData = {}; chrome.webNavigation.onCommitted.addListener(onNavigation.bind('committed')); chrome.webNavigation.onHistoryStateUpdated.addListener(onFakeNavigation.bind('history')); @@ -20,6 +21,10 @@ const navMan = (() => { /** @this {string} type */ async function onNavigation(data) { + if (CHROME && data.timeStamp === prevData.timeStamp && deepEqual(data, prevData)) { + return; // Chrome bug: listener is called twice with identical data + } + prevData = data; if (CHROME && URLS.chromeProtectsNTP && data.url.startsWith('https://www.google.') &&