summaryrefslogtreecommitdiff
path: root/ext/js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js')
-rw-r--r--ext/js/dom/css-style-applier.js15
1 files changed, 11 insertions, 4 deletions
diff --git a/ext/js/dom/css-style-applier.js b/ext/js/dom/css-style-applier.js
index 6de4bd2d..32d7ef0f 100644
--- a/ext/js/dom/css-style-applier.js
+++ b/ext/js/dom/css-style-applier.js
@@ -57,9 +57,6 @@ class CssStyleApplier {
const {className} = element;
if (className.length === 0) { continue; }
let cssTextNew = '';
- if (className.indexOf('th') >= 0) {
- console.log(className, this._getRulesForClass(className));
- }
for (const {selectorText, styles} of this._getRulesForClass(className)) {
if (!element.matches(selectorText)) { continue; }
cssTextNew += this._getCssText(styles);
@@ -69,7 +66,17 @@ class CssStyleApplier {
}
for (const {element, style} of elementStyles) {
element.removeAttribute('class');
- element.setAttribute('style', style);
+ if (style.length > 0) {
+ element.setAttribute('style', style);
+ } else {
+ element.removeAttribute('style');
+ }
+ }
+ for (const element of elements) {
+ const {dataset} = element;
+ for (const key of Object.keys(dataset)) {
+ delete dataset[key];
+ }
}
}