From b178881cabf6e06b1706f5692c414904fb6befe4 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Sun, 18 Aug 2013 09:11:22 -0700 Subject: [PATCH] Fix breaking styles --- builds/appchan-x.user.js | 6 +++--- builds/crx/script.js | 6 +++--- src/Theming/Style.coffee | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index 8f042a66e..0dc457f9c 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -12144,13 +12144,13 @@ return; } node = nodes[i]; - if (!(node.nodeName === 'STYLE' && !node.id)) { + if (node.nodeName === 'STYLE' && node.id) { continue; } - if (("" + node.rel).contains('stylesheet') && (/flags.*\.css$/.test(href = node.href) || href.slice(0, 4) === 'data')) { + if (/stylesheet/.test(node.rel) && (/flags.*\.css$/.test(href = node.href) || href.slice(0, 4) === 'data')) { continue; } - if (/\b(\.typeset)/.test(node.textContent)) { + if (/\.typeset/.test(node.textContent)) { continue; } Style.headCount--; diff --git a/builds/crx/script.js b/builds/crx/script.js index 74082b8ea..c24afbbfe 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -12136,13 +12136,13 @@ return; } node = nodes[i]; - if (!(node.nodeName === 'STYLE' && !node.id)) { + if (node.nodeName === 'STYLE' && node.id) { continue; } - if (("" + node.rel).contains('stylesheet') && (/flags.*\.css$/.test(href = node.href) || href.slice(0, 4) === 'data')) { + if (/stylesheet/.test(node.rel) && (/flags.*\.css$/.test(href = node.href) || href.slice(0, 4) === 'data')) { continue; } - if (/\b(\.typeset)/.test(node.textContent)) { + if (/\.typeset/.test(node.textContent)) { continue; } Style.headCount--; diff --git a/src/Theming/Style.coffee b/src/Theming/Style.coffee index 6b8b94d1c..867997412 100644 --- a/src/Theming/Style.coffee +++ b/src/Theming/Style.coffee @@ -114,10 +114,10 @@ Style = return unless Style.headCount node = nodes[i] - continue unless node.nodeName is 'STYLE' and !node.id - continue if "#{node.rel}".contains('stylesheet') and (/flags.*\.css$/.test(href = node.href) or href[..3] is 'data') - continue if /\b(\.typeset)/.test node.textContent - + continue if node.nodeName is 'STYLE' and node.id + or (/stylesheet/.test(node.rel) and (/flags.*\.css$/.test(href = node.href) or href[..3] is 'data')) + or (/\.typeset/.test node.textContent) + Style.headCount-- $.rm node return