From f7729eac155fd08b3fc208346c12c3f49da9036d Mon Sep 17 00:00:00 2001 From: tophf Date: Tue, 18 Jan 2022 17:23:51 +0300 Subject: [PATCH 1/2] remove unused files --- edit/tab.css | 28 ---------------------------- edit/tab.js | 19 ------------------- 2 files changed, 47 deletions(-) delete mode 100644 edit/tab.css delete mode 100644 edit/tab.js diff --git a/edit/tab.css b/edit/tab.css deleted file mode 100644 index 7b581cfa..00000000 --- a/edit/tab.css +++ /dev/null @@ -1,28 +0,0 @@ -.tab-container { - display: flex; - flex-direction: column; -} -.tab-bar { - display: flex; - flex-direction: row; - border-bottom: 1px solid silver; - padding: 5px 5px 0 15px; -} -.tab-bar-item { - margin: 0 0.3em; - padding: 0.3em 0.6em; - border: 1px solid silver; - border-bottom: none; - background: silver; - cursor: pointer; -} -.tab-bar-item.active { - background: white; -} -.tab-panel { - flex-grow: 1; -} -.tab-panel > :not(.active) { - display: none; -} - diff --git a/edit/tab.js b/edit/tab.js deleted file mode 100644 index 887a6e3a..00000000 --- a/edit/tab.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -(() => { - for (const container of document.querySelectorAll('.tab-container')) { - init(container); - } - - function init(container) { - const tabButtons = [...container.querySelector('.tab-bar').children]; - const tabPanels = [...container.querySelector('.tab-panel').children]; - tabButtons.forEach((button, i) => button.addEventListener('click', () => activate(i))); - - function activate(index) { - const toggleActive = (button, i) => button.classList.toggle('active', i === index); - tabButtons.forEach(toggleActive); - tabPanels.forEach(toggleActive); - } - } -})(); From 42d6e2f2af5704f3514c9f70fa4e163ad71213f1 Mon Sep 17 00:00:00 2001 From: tophf Date: Tue, 18 Jan 2022 20:24:41 +0300 Subject: [PATCH 2/2] parserlib: reimplement d9a80623 properly --- js/csslint/parserlib.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/js/csslint/parserlib.js b/js/csslint/parserlib.js index 55d6e0bd..546aad70 100644 --- a/js/csslint/parserlib.js +++ b/js/csslint/parserlib.js @@ -4381,18 +4381,10 @@ self.parserlib = (() => { let next, tt; while ((next = stream.get(true)).value !== '}' && (tt = next.type)) { try { - // Pre-check to avoid calling _ws too much as it's wasteful - if (tt === Tokens.S || - tt === Tokens.COMMENT || - tt === Tokens.USO_VAR) { - this._ws(next, true); - tt = 0; - } if (tt === Tokens.SEMICOLON || + this._ws(next, true) || readMargins && this._margin() || - (tt && stream.unget(), this._declaration(true, Props)) || - (next = stream.LT(1)).value === ';' || - this._ws(null, true)) { + (stream.unget(), this._declaration(true, Props))) { continue; } break; @@ -4427,6 +4419,14 @@ self.parserlib = (() => { } _ws(start, skipUsoVar) { + const tt = start && start.type; + if (tt && !( + tt === Tokens.S || + tt === Tokens.COMMENT || + tt === Tokens.USO_VAR && skipUsoVar + )) { + return ''; + } const stream = this._tokenStream; const tokens = skipUsoVar ? TT.usoS : Tokens.S; let ws = start ? start.value : '';